UNPKG

three-globe

Version:

Globe data visualization as a ThreeJS reusable 3D object

2 lines 424 kB
// Version 2.18.3 three-globe - https://github.com/vasturiano/three-globe !function(A,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("three")):"function"==typeof define&&define.amd?define(["three"],e):(A="undefined"!=typeof globalThis?globalThis:A||self).ThreeGlobe=e(A.THREE)}(this,(function(A){"use strict";function e(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable}))),t.push.apply(t,n)}return t}function t(A){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?e(Object(n),!0).forEach((function(e){r(A,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(n,e))}))}return A}function n(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function r(A,e,t){return e in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function i(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&o(A,e)}function a(A){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}function o(A,e){return(o=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}function u(A,e,t){return(u=l()?Reflect.construct:function(A,e,t){var n=[null];n.push.apply(n,e);var r=new(Function.bind.apply(A,n));return t&&o(r,t.prototype),r}).apply(null,arguments)}function s(A,e){if(null==A)return{};var t,n,r=function(A,e){if(null==A)return{};var t,n,r={},i=Object.keys(A);for(n=0;n<i.length;n++)t=i[n],e.indexOf(t)>=0||(r[t]=A[t]);return r}(A,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);for(n=0;n<i.length;n++)t=i[n],e.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(A,t)&&(r[t]=A[t])}return r}function f(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function c(A,e){return!e||"object"!=typeof e&&"function"!=typeof e?f(A):e}function h(A){var e=l();return function(){var t,n=a(A);if(e){var r=a(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return c(this,t)}}function d(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=A&&("undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"]);if(null==t)return;var n,r,i=[],a=!0,o=!1;try{for(t=t.call(A);!(a=(n=t.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(A){o=!0,r=A}finally{try{a||null==t.return||t.return()}finally{if(o)throw r}}return i}(A,e)||p(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(A){return function(A){if(Array.isArray(A))return g(A)}(A)||function(A){if("undefined"!=typeof Symbol&&null!=A[Symbol.iterator]||null!=A["@@iterator"])return Array.from(A)}(A)||p(A)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(A,e){if(A){if("string"==typeof A)return g(A,e);var t=Object.prototype.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?g(A,e):void 0}}function g(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=A[t];return n}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function b(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}function q(A,e,t){var n,r,i,a,o;function l(){var u=Date.now()-a;u<e&&u>=0?n=setTimeout(l,e-u):(n=null,t||(o=A.apply(i,r),i=r=null))}null==e&&(e=100);var u=function(){i=this,r=arguments,a=Date.now();var u=t&&!n;return n||(n=setTimeout(l,e)),u&&(o=A.apply(i,r),i=r=null),o};return u.clear=function(){n&&(clearTimeout(n),n=null)},u.flush=function(){n&&(o=A.apply(i,r),i=r=null,clearTimeout(n),n=null)},u}q.debounce=q;var y=q;function v(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=A&&("undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"]);if(null==t)return;var n,r,i=[],a=!0,o=!1;try{for(t=t.call(A);!(a=(n=t.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(A){o=!0,r=A}finally{try{a||null==t.return||t.return()}finally{if(o)throw r}}return i}(A,e)||function(A,e){if(!A)return;if("string"==typeof A)return x(A,e);var t=Object.prototype.toString.call(A).slice(8,-1);"Object"===t&&A.constructor&&(t=A.constructor.name);if("Map"===t||"Set"===t)return Array.from(A);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return x(A,e)}(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=A[t];return n}var _=function A(e,t){var n=t.default,r=void 0===n?null:n,i=t.triggerUpdate,a=void 0===i||i,o=t.onChange,l=void 0===o?function(A,e){}:o;!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.name=e,this.defaultVal=r,this.triggerUpdate=a,this.onChange=l};function w(A){var e=A.stateInit,t=void 0===e?function(){return{}}:e,n=A.props,r=void 0===n?{}:n,i=A.methods,a=void 0===i?{}:i,o=A.aliases,l=void 0===o?{}:o,u=A.init,s=void 0===u?function(){}:u,f=A.update,c=void 0===f?function(){}:f,h=Object.keys(r).map((function(A){return new _(A,r[A])}));return function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({},t instanceof Function?t(A):t,{initialised:!1}),n={};function r(e){return i(e,A),o(),r}var i=function(A,t){s.call(r,A,e,t),e.initialised=!0},o=y((function(){e.initialised&&(c.call(r,e,n),n={})}),1);return h.forEach((function(A){r[A.name]=function(A){var t=A.name,i=A.triggerUpdate,a=void 0!==i&&i,l=A.onChange,u=void 0===l?function(A,e){}:l,s=A.defaultVal,f=void 0===s?null:s;return function(A){var i=e[t];if(!arguments.length)return i;var l=void 0===A?f:A;return e[t]=l,u.call(r,l,e,i),!n.hasOwnProperty(t)&&(n[t]=i),a&&o(),r}}(A)})),Object.keys(a).forEach((function(A){r[A]=function(){for(var t,n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return(t=a[A]).call.apply(t,[r,e].concat(i))}})),Object.entries(l).forEach((function(A){var e=v(A,2),t=e[0],n=e[1];return r[t]=r[n]})),r.resetProps=function(){return h.forEach((function(A){r[A.name](A.defaultVal)})),r},r.resetProps(),e._rerender=o,r}}var M,B={Linear:{None:function(A){return A}},Quadratic:{In:function(A){return A*A},Out:function(A){return A*(2-A)},InOut:function(A){return(A*=2)<1?.5*A*A:-.5*(--A*(A-2)-1)}},Cubic:{In:function(A){return A*A*A},Out:function(A){return--A*A*A+1},InOut:function(A){return(A*=2)<1?.5*A*A*A:.5*((A-=2)*A*A+2)}},Quartic:{In:function(A){return A*A*A*A},Out:function(A){return 1- --A*A*A*A},InOut:function(A){return(A*=2)<1?.5*A*A*A*A:-.5*((A-=2)*A*A*A-2)}},Quintic:{In:function(A){return A*A*A*A*A},Out:function(A){return--A*A*A*A*A+1},InOut:function(A){return(A*=2)<1?.5*A*A*A*A*A:.5*((A-=2)*A*A*A*A+2)}},Sinusoidal:{In:function(A){return 1-Math.cos(A*Math.PI/2)},Out:function(A){return Math.sin(A*Math.PI/2)},InOut:function(A){return.5*(1-Math.cos(Math.PI*A))}},Exponential:{In:function(A){return 0===A?0:Math.pow(1024,A-1)},Out:function(A){return 1===A?1:1-Math.pow(2,-10*A)},InOut:function(A){return 0===A?0:1===A?1:(A*=2)<1?.5*Math.pow(1024,A-1):.5*(2-Math.pow(2,-10*(A-1)))}},Circular:{In:function(A){return 1-Math.sqrt(1-A*A)},Out:function(A){return Math.sqrt(1- --A*A)},InOut:function(A){return(A*=2)<1?-.5*(Math.sqrt(1-A*A)-1):.5*(Math.sqrt(1-(A-=2)*A)+1)}},Elastic:{In:function(A){return 0===A?0:1===A?1:-Math.pow(2,10*(A-1))*Math.sin(5*(A-1.1)*Math.PI)},Out:function(A){return 0===A?0:1===A?1:Math.pow(2,-10*A)*Math.sin(5*(A-.1)*Math.PI)+1},InOut:function(A){return 0===A?0:1===A?1:(A*=2)<1?-.5*Math.pow(2,10*(A-1))*Math.sin(5*(A-1.1)*Math.PI):.5*Math.pow(2,-10*(A-1))*Math.sin(5*(A-1.1)*Math.PI)+1}},Back:{In:function(A){var e=1.70158;return A*A*((e+1)*A-e)},Out:function(A){var e=1.70158;return--A*A*((e+1)*A+e)+1},InOut:function(A){var e=2.5949095;return(A*=2)<1?A*A*((e+1)*A-e)*.5:.5*((A-=2)*A*((e+1)*A+e)+2)}},Bounce:{In:function(A){return 1-B.Bounce.Out(1-A)},Out:function(A){return A<1/2.75?7.5625*A*A:A<2/2.75?7.5625*(A-=1.5/2.75)*A+.75:A<2.5/2.75?7.5625*(A-=2.25/2.75)*A+.9375:7.5625*(A-=2.625/2.75)*A+.984375},InOut:function(A){return A<.5?.5*B.Bounce.In(2*A):.5*B.Bounce.Out(2*A-1)+.5}}},E="undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?function(){var A=process.hrtime();return 1e3*A[0]+A[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},k=function(){function A(){this._tweens={},this._tweensAddedDuringUpdate={}}return A.prototype.getAll=function(){var A=this;return Object.keys(this._tweens).map((function(e){return A._tweens[e]}))},A.prototype.removeAll=function(){this._tweens={}},A.prototype.add=function(A){this._tweens[A.getId()]=A,this._tweensAddedDuringUpdate[A.getId()]=A},A.prototype.remove=function(A){delete this._tweens[A.getId()],delete this._tweensAddedDuringUpdate[A.getId()]},A.prototype.update=function(A,e){void 0===A&&(A=E()),void 0===e&&(e=!1);var t=Object.keys(this._tweens);if(0===t.length)return!1;for(;t.length>0;){this._tweensAddedDuringUpdate={};for(var n=0;n<t.length;n++){var r=this._tweens[t[n]],i=!e;r&&!1===r.update(A,i)&&!e&&delete this._tweens[t[n]]}t=Object.keys(this._tweensAddedDuringUpdate)}return!0},A}(),S={Linear:function(A,e){var t=A.length-1,n=t*e,r=Math.floor(n),i=S.Utils.Linear;return e<0?i(A[0],A[1],n):e>1?i(A[t],A[t-1],t-n):i(A[r],A[r+1>t?t:r+1],n-r)},Bezier:function(A,e){for(var t=0,n=A.length-1,r=Math.pow,i=S.Utils.Bernstein,a=0;a<=n;a++)t+=r(1-e,n-a)*r(e,a)*A[a]*i(n,a);return t},CatmullRom:function(A,e){var t=A.length-1,n=t*e,r=Math.floor(n),i=S.Utils.CatmullRom;return A[0]===A[t]?(e<0&&(r=Math.floor(n=t*(1+e))),i(A[(r-1+t)%t],A[r],A[(r+1)%t],A[(r+2)%t],n-r)):e<0?A[0]-(i(A[0],A[0],A[1],A[1],-n)-A[0]):e>1?A[t]-(i(A[t],A[t],A[t-1],A[t-1],n-t)-A[t]):i(A[r?r-1:0],A[r],A[t<r+1?t:r+1],A[t<r+2?t:r+2],n-r)},Utils:{Linear:function(A,e,t){return(e-A)*t+A},Bernstein:function(A,e){var t=S.Utils.Factorial;return t(A)/t(e)/t(A-e)},Factorial:(M=[1],function(A){var e=1;if(M[A])return M[A];for(var t=A;t>1;t--)e*=t;return M[A]=e,e}),CatmullRom:function(A,e,t,n,r){var i=.5*(t-A),a=.5*(n-e),o=r*r;return(2*e-2*t+i+a)*(r*o)+(-3*e+3*t-2*i-a)*o+i*r+e}}},T=function(){function A(){}return A.nextId=function(){return A._nextId++},A._nextId=0,A}(),D=new k,C=function(){function A(A,e){void 0===e&&(e=D),this._object=A,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=B.Linear.None,this._interpolationFunction=S.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=T.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return A.prototype.getId=function(){return this._id},A.prototype.isPlaying=function(){return this._isPlaying},A.prototype.isPaused=function(){return this._isPaused},A.prototype.to=function(A,e){return this._valuesEnd=Object.create(A),void 0!==e&&(this._duration=e),this},A.prototype.duration=function(A){return this._duration=A,this},A.prototype.start=function(A){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var e in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e];return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=void 0!==A?"string"==typeof A?E()+parseFloat(A):A:E(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},A.prototype._setupProperties=function(A,e,t,n){for(var r in t){var i=A[r],a=Array.isArray(i),o=a?"array":typeof i,l=!a&&Array.isArray(t[r]);if("undefined"!==o&&"function"!==o){if(l){var u=t[r];if(0===u.length)continue;u=u.map(this._handleRelativeValue.bind(this,i)),t[r]=[i].concat(u)}if("object"!==o&&!a||!i||l)void 0===e[r]&&(e[r]=i),a||(e[r]*=1),n[r]=l?t[r].slice().reverse():e[r]||0;else{for(var s in e[r]=a?[]:{},i)e[r][s]=i[s];n[r]=a?[]:{},this._setupProperties(i,e[r],t[r],n[r])}}}},A.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},A.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},A.prototype.pause=function(A){return void 0===A&&(A=E()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=A,this._group&&this._group.remove(this)),this},A.prototype.resume=function(A){return void 0===A&&(A=E()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=A-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},A.prototype.stopChainedTweens=function(){for(var A=0,e=this._chainedTweens.length;A<e;A++)this._chainedTweens[A].stop();return this},A.prototype.group=function(A){return this._group=A,this},A.prototype.delay=function(A){return this._delayTime=A,this},A.prototype.repeat=function(A){return this._initialRepeat=A,this._repeat=A,this},A.prototype.repeatDelay=function(A){return this._repeatDelayTime=A,this},A.prototype.yoyo=function(A){return this._yoyo=A,this},A.prototype.easing=function(A){return this._easingFunction=A,this},A.prototype.interpolation=function(A){return this._interpolationFunction=A,this},A.prototype.chain=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];return this._chainedTweens=A,this},A.prototype.onStart=function(A){return this._onStartCallback=A,this},A.prototype.onUpdate=function(A){return this._onUpdateCallback=A,this},A.prototype.onRepeat=function(A){return this._onRepeatCallback=A,this},A.prototype.onComplete=function(A){return this._onCompleteCallback=A,this},A.prototype.onStop=function(A){return this._onStopCallback=A,this},A.prototype.update=function(A,e){if(void 0===A&&(A=E()),void 0===e&&(e=!0),this._isPaused)return!0;var t,n,r=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(A>r)return!1;e&&this.start(A)}if(this._goToEnd=!1,A<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),n=(A-this._startTime)/this._duration,n=0===this._duration||n>1?1:n;var i=this._easingFunction(n);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,i),this._onUpdateCallback&&this._onUpdateCallback(this._object,n),1===n){if(this._repeat>0){for(t in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[t]||(this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(this._valuesEnd[t])),this._yoyo&&this._swapEndStartRepeatValues(t),this._valuesStart[t]=this._valuesStartRepeat[t];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=A+this._repeatDelayTime:this._startTime=A+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var a=0,o=this._chainedTweens.length;a<o;a++)this._chainedTweens[a].start(this._startTime+this._duration);return this._isPlaying=!1,!1}return!0},A.prototype._updateProperties=function(A,e,t,n){for(var r in t)if(void 0!==e[r]){var i=e[r]||0,a=t[r],o=Array.isArray(A[r]),l=Array.isArray(a);!o&&l?A[r]=this._interpolationFunction(a,n):"object"==typeof a&&a?this._updateProperties(A[r],i,a,n):"number"==typeof(a=this._handleRelativeValue(i,a))&&(A[r]=i+(a-i)*n)}},A.prototype._handleRelativeValue=function(A,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?A+parseFloat(e):parseFloat(e)},A.prototype._swapEndStartRepeatValues=function(A){var e=this._valuesStartRepeat[A],t=this._valuesEnd[A];this._valuesStartRepeat[A]="string"==typeof t?this._valuesStartRepeat[A]+parseFloat(t):this._valuesEnd[A],this._valuesEnd[A]=e},A}(),I=T.nextId,O=D,P=O.getAll.bind(O),Q=O.removeAll.bind(O),R=O.add.bind(O),G=O.remove.bind(O),F=O.update.bind(O),U={Easing:B,Group:k,Interpolation:S,now:E,Sequence:T,nextId:I,Tween:C,VERSION:"18.6.4",getAll:P,removeAll:Q,add:R,remove:G,update:F},j=function A(e){e instanceof Array?e.forEach(A):(e.map&&e.map.dispose(),e.dispose())},L=function A(e){e.geometry&&e.geometry.dispose(),e.material&&j(e.material),e.texture&&e.texture.dispose(),e.children&&e.children.forEach(A)},N=function(A){for(;A.children.length;){var e=A.children[0];A.remove(e),L(e)}};function H(A,e){var t=new e;return{linkProp:function(e){return{default:t[e](),onChange:function(t,n){n[A][e](t)},triggerUpdate:!1}},linkMethod:function(e){return function(t){for(var n=t[A],r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];var o=n[e].apply(n,i);return o===n?this:o}}}}var z=100;function V(A,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=(90-A)*Math.PI/180,r=(90-e)*Math.PI/180,i=z*(1+t);return{x:i*Math.sin(n)*Math.cos(r),y:i*Math.cos(n),z:i*Math.sin(n)*Math.sin(r)}}function Y(A){var e=A.x,t=A.y,n=A.z,r=Math.sqrt(e*e+t*t+n*n),i=Math.acos(t/r),a=Math.atan2(n,e);return{lat:90-180*i/Math.PI,lng:90-180*a/Math.PI-(a<-Math.PI/2?360:0),altitude:r/z-1}}var W={exports:{}};function Z(A,e,t){t=t||2;var n,r,i,a,o,l,u,s=e&&e.length,f=s?e[0]*t:A.length,c=J(A,0,f,t,!0),h=[];if(!c||c.next===c.prev)return h;if(s&&(c=function(A,e,t,n){var r,i,a,o=[];for(r=0,i=e.length;r<i;r++)(a=J(A,e[r]*n,r<i-1?e[r+1]*n:A.length,n,!1))===a.next&&(a.steiner=!0),o.push(oA(a));for(o.sort(nA),r=0;r<o.length;r++)rA(o[r],t),t=K(t,t.next);return t}(A,e,c,t)),A.length>80*t){n=i=A[0],r=a=A[1];for(var d=t;d<f;d+=t)(o=A[d])<n&&(n=o),(l=A[d+1])<r&&(r=l),o>i&&(i=o),l>a&&(a=l);u=0!==(u=Math.max(i-n,a-r))?1/u:0}return X(c,h,t,n,r,u),h}function J(A,e,t,n,r){var i,a;if(r===yA(A,e,t,n)>0)for(i=e;i<t;i+=n)a=gA(i,A[i],A[i+1],a);else for(i=t-n;i>=e;i-=n)a=gA(i,A[i],A[i+1],a);return a&&fA(a,a.next)&&(bA(a),a=a.next),a}function K(A,e){if(!A)return A;e||(e=A);var t,n=A;do{if(t=!1,n.steiner||!fA(n,n.next)&&0!==sA(n.prev,n,n.next))n=n.next;else{if(bA(n),(n=e=n.prev)===n.next)break;t=!0}}while(t||n!==e);return e}function X(A,e,t,n,r,i,a){if(A){!a&&i&&function(A,e,t,n){var r=A;do{null===r.z&&(r.z=aA(r.x,r.y,e,t,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==A);r.prevZ.nextZ=null,r.prevZ=null,function(A){var e,t,n,r,i,a,o,l,u=1;do{for(t=A,A=null,i=null,a=0;t;){for(a++,n=t,o=0,e=0;e<u&&(o++,n=n.nextZ);e++);for(l=u;o>0||l>0&&n;)0!==o&&(0===l||!n||t.z<=n.z)?(r=t,t=t.nextZ,o--):(r=n,n=n.nextZ,l--),i?i.nextZ=r:A=r,r.prevZ=i,i=r;t=n}i.nextZ=null,u*=2}while(a>1)}(r)}(A,n,r,i);for(var o,l,u=A;A.prev!==A.next;)if(o=A.prev,l=A.next,i?AA(A,n,r,i):$(A))e.push(o.i/t),e.push(A.i/t),e.push(l.i/t),bA(A),A=l.next,u=l.next;else if((A=l)===u){a?1===a?X(A=eA(K(A),e,t),e,t,n,r,i,2):2===a&&tA(A,e,t,n,r,i):X(K(A),e,t,n,r,i,1);break}}}function $(A){var e=A.prev,t=A,n=A.next;if(sA(e,t,n)>=0)return!1;for(var r=A.next.next;r!==A.prev;){if(lA(e.x,e.y,t.x,t.y,n.x,n.y,r.x,r.y)&&sA(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function AA(A,e,t,n){var r=A.prev,i=A,a=A.next;if(sA(r,i,a)>=0)return!1;for(var o=r.x<i.x?r.x<a.x?r.x:a.x:i.x<a.x?i.x:a.x,l=r.y<i.y?r.y<a.y?r.y:a.y:i.y<a.y?i.y:a.y,u=r.x>i.x?r.x>a.x?r.x:a.x:i.x>a.x?i.x:a.x,s=r.y>i.y?r.y>a.y?r.y:a.y:i.y>a.y?i.y:a.y,f=aA(o,l,e,t,n),c=aA(u,s,e,t,n),h=A.prevZ,d=A.nextZ;h&&h.z>=f&&d&&d.z<=c;){if(h!==A.prev&&h!==A.next&&lA(r.x,r.y,i.x,i.y,a.x,a.y,h.x,h.y)&&sA(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,d!==A.prev&&d!==A.next&&lA(r.x,r.y,i.x,i.y,a.x,a.y,d.x,d.y)&&sA(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;h&&h.z>=f;){if(h!==A.prev&&h!==A.next&&lA(r.x,r.y,i.x,i.y,a.x,a.y,h.x,h.y)&&sA(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;d&&d.z<=c;){if(d!==A.prev&&d!==A.next&&lA(r.x,r.y,i.x,i.y,a.x,a.y,d.x,d.y)&&sA(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function eA(A,e,t){var n=A;do{var r=n.prev,i=n.next.next;!fA(r,i)&&cA(r,n,n.next,i)&&mA(r,i)&&mA(i,r)&&(e.push(r.i/t),e.push(n.i/t),e.push(i.i/t),bA(n),bA(n.next),n=A=i),n=n.next}while(n!==A);return K(n)}function tA(A,e,t,n,r,i){var a=A;do{for(var o=a.next.next;o!==a.prev;){if(a.i!==o.i&&uA(a,o)){var l=pA(a,o);return a=K(a,a.next),l=K(l,l.next),X(a,e,t,n,r,i),void X(l,e,t,n,r,i)}o=o.next}a=a.next}while(a!==A)}function nA(A,e){return A.x-e.x}function rA(A,e){if(e=function(A,e){var t,n=e,r=A.x,i=A.y,a=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){var o=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(o<=r&&o>a){if(a=o,o===r){if(i===n.y)return n;if(i===n.next.y)return n.next}t=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!t)return null;if(r===a)return t;var l,u=t,s=t.x,f=t.y,c=1/0;n=t;do{r>=n.x&&n.x>=s&&r!==n.x&&lA(i<f?r:a,i,s,f,i<f?a:r,i,n.x,n.y)&&(l=Math.abs(i-n.y)/(r-n.x),mA(n,A)&&(l<c||l===c&&(n.x>t.x||n.x===t.x&&iA(t,n)))&&(t=n,c=l)),n=n.next}while(n!==u);return t}(A,e)){var t=pA(e,A);K(e,e.next),K(t,t.next)}}function iA(A,e){return sA(A.prev,A,e.prev)<0&&sA(e.next,A,A.next)<0}function aA(A,e,t,n,r){return(A=1431655765&((A=858993459&((A=252645135&((A=16711935&((A=32767*(A-t)*r)|A<<8))|A<<4))|A<<2))|A<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function oA(A){var e=A,t=A;do{(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next}while(e!==A);return t}function lA(A,e,t,n,r,i,a,o){return(r-a)*(e-o)-(A-a)*(i-o)>=0&&(A-a)*(n-o)-(t-a)*(e-o)>=0&&(t-a)*(i-o)-(r-a)*(n-o)>=0}function uA(A,e){return A.next.i!==e.i&&A.prev.i!==e.i&&!function(A,e){var t=A;do{if(t.i!==A.i&&t.next.i!==A.i&&t.i!==e.i&&t.next.i!==e.i&&cA(t,t.next,A,e))return!0;t=t.next}while(t!==A);return!1}(A,e)&&(mA(A,e)&&mA(e,A)&&function(A,e){var t=A,n=!1,r=(A.x+e.x)/2,i=(A.y+e.y)/2;do{t.y>i!=t.next.y>i&&t.next.y!==t.y&&r<(t.next.x-t.x)*(i-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next}while(t!==A);return n}(A,e)&&(sA(A.prev,A,e.prev)||sA(A,e.prev,e))||fA(A,e)&&sA(A.prev,A,A.next)>0&&sA(e.prev,e,e.next)>0)}function sA(A,e,t){return(e.y-A.y)*(t.x-e.x)-(e.x-A.x)*(t.y-e.y)}function fA(A,e){return A.x===e.x&&A.y===e.y}function cA(A,e,t,n){var r=dA(sA(A,e,t)),i=dA(sA(A,e,n)),a=dA(sA(t,n,A)),o=dA(sA(t,n,e));return r!==i&&a!==o||(!(0!==r||!hA(A,t,e))||(!(0!==i||!hA(A,n,e))||(!(0!==a||!hA(t,A,n))||!(0!==o||!hA(t,e,n)))))}function hA(A,e,t){return e.x<=Math.max(A.x,t.x)&&e.x>=Math.min(A.x,t.x)&&e.y<=Math.max(A.y,t.y)&&e.y>=Math.min(A.y,t.y)}function dA(A){return A>0?1:A<0?-1:0}function mA(A,e){return sA(A.prev,A,A.next)<0?sA(A,e,A.next)>=0&&sA(A,A.prev,e)>=0:sA(A,e,A.prev)<0||sA(A,A.next,e)<0}function pA(A,e){var t=new qA(A.i,A.x,A.y),n=new qA(e.i,e.x,e.y),r=A.next,i=e.prev;return A.next=e,e.prev=A,t.next=r,r.prev=t,n.next=t,t.prev=n,i.next=n,n.prev=i,n}function gA(A,e,t,n){var r=new qA(A,e,t);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function bA(A){A.next.prev=A.prev,A.prev.next=A.next,A.prevZ&&(A.prevZ.nextZ=A.nextZ),A.nextZ&&(A.nextZ.prevZ=A.prevZ)}function qA(A,e,t){this.i=A,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function yA(A,e,t,n){for(var r=0,i=e,a=t-n;i<t;i+=n)r+=(A[a]-A[i])*(A[i+1]+A[a+1]),a=i;return r}W.exports=Z,W.exports.default=Z,Z.deviation=function(A,e,t,n){var r=e&&e.length,i=r?e[0]*t:A.length,a=Math.abs(yA(A,0,i,t));if(r)for(var o=0,l=e.length;o<l;o++){var u=e[o]*t,s=o<l-1?e[o+1]*t:A.length;a-=Math.abs(yA(A,u,s,t))}var f=0;for(o=0;o<n.length;o+=3){var c=n[o]*t,h=n[o+1]*t,d=n[o+2]*t;f+=Math.abs((A[c]-A[d])*(A[h+1]-A[c+1])-(A[c]-A[h])*(A[d+1]-A[c+1]))}return 0===a&&0===f?0:Math.abs((f-a)/a)},Z.flatten=function(A){for(var e=A[0][0].length,t={vertices:[],holes:[],dimensions:e},n=0,r=0;r<A.length;r++){for(var i=0;i<A[r].length;i++)for(var a=0;a<e;a++)t.vertices.push(A[r][i][a]);r>0&&(n+=A[r-1].length,t.holes.push(n))}return t};var vA=W.exports;function xA(A,e){return A<e?-1:A>e?1:A>=e?0:NaN}function _A(A){let e=A,t=A;function n(A,e,n,r){for(null==n&&(n=0),null==r&&(r=A.length);n<r;){const i=n+r>>>1;t(A[i],e)<0?n=i+1:r=i}return n}return 1===A.length&&(e=(e,t)=>A(e)-t,t=function(A){return(e,t)=>xA(A(e),t)}(A)),{left:n,center:function(A,t,r,i){null==r&&(r=0),null==i&&(i=A.length);const a=n(A,t,r,i-1);return a>r&&e(A[a-1],t)>-e(A[a],t)?a-1:a},right:function(A,e,n,r){for(null==n&&(n=0),null==r&&(r=A.length);n<r;){const i=n+r>>>1;t(A[i],e)>0?r=i:n=i+1}return n}}}const wA=_A(xA).right;function MA(A,e){let t,n;if(void 0===e)for(const e of A)null!=e&&(void 0===t?e>=e&&(t=n=e):(t>e&&(t=e),n<e&&(n=e)));else{let r=-1;for(let i of A)null!=(i=e(i,++r,A))&&(void 0===t?i>=i&&(t=n=i):(t>i&&(t=i),n<i&&(n=i)))}return[t,n]}_A((function(A){return null===A?NaN:+A})).center;class BA{constructor(){this._partials=new Float64Array(32),this._n=0}add(A){const e=this._partials;let t=0;for(let n=0;n<this._n&&n<32;n++){const r=e[n],i=A+r,a=Math.abs(A)<Math.abs(r)?A-(i-r):r-(i-A);a&&(e[t++]=a),A=i}return e[t]=A,this._n=t+1,this}valueOf(){const A=this._partials;let e,t,n,r=this._n,i=0;if(r>0){for(i=A[--r];r>0&&(e=i,t=A[--r],i=e+t,n=t-(i-e),!n););r>0&&(n<0&&A[r-1]<0||n>0&&A[r-1]>0)&&(t=2*n,e=i+t,t==e-i&&(i=e))}return i}}var EA=Math.sqrt(50),kA=Math.sqrt(10),SA=Math.sqrt(2);function TA(A,e,t){var n=(e-A)/Math.max(0,t),r=Math.floor(Math.log(n)/Math.LN10),i=n/Math.pow(10,r);return r>=0?(i>=EA?10:i>=kA?5:i>=SA?2:1)*Math.pow(10,r):-Math.pow(10,-r)/(i>=EA?10:i>=kA?5:i>=SA?2:1)}function DA(A,e){let t=0,n=0;if(void 0===e)for(let e of A)null!=e&&(e=+e)>=e&&(++t,n+=e);else{let r=-1;for(let i of A)null!=(i=e(i,++r,A))&&(i=+i)>=i&&(++t,n+=i)}if(t)return n/t}function CA(A){return Array.from(function*(A){for(const e of A)yield*e}(A))}function IA(A,e,t){A=+A,e=+e,t=(r=arguments.length)<2?(e=A,A=0,1):r<3?1:+t;for(var n=-1,r=0|Math.max(0,Math.ceil((e-A)/t)),i=new Array(r);++n<r;)i[n]=A+n*t;return i}var OA=1e-6,PA=Math.PI,QA=PA/2,RA=PA/4,GA=2*PA,FA=180/PA,UA=PA/180,jA=Math.abs,LA=Math.atan2,NA=Math.cos,HA=Math.ceil,zA=Math.sin,VA=Math.sign||function(A){return A>0?1:A<0?-1:0},YA=Math.sqrt;function WA(A){return A>1?QA:A<-1?-QA:Math.asin(A)}function ZA(A){return(A=zA(A/2))*A}function JA(){}function KA(A,e){A&&$A.hasOwnProperty(A.type)&&$A[A.type](A,e)}var XA={Feature:function(A,e){KA(A.geometry,e)},FeatureCollection:function(A,e){for(var t=A.features,n=-1,r=t.length;++n<r;)KA(t[n].geometry,e)}},$A={Sphere:function(A,e){e.sphere()},Point:function(A,e){A=A.coordinates,e.point(A[0],A[1],A[2])},MultiPoint:function(A,e){for(var t=A.coordinates,n=-1,r=t.length;++n<r;)A=t[n],e.point(A[0],A[1],A[2])},LineString:function(A,e){Ae(A.coordinates,e,0)},MultiLineString:function(A,e){for(var t=A.coordinates,n=-1,r=t.length;++n<r;)Ae(t[n],e,0)},Polygon:function(A,e){ee(A.coordinates,e)},MultiPolygon:function(A,e){for(var t=A.coordinates,n=-1,r=t.length;++n<r;)ee(t[n],e)},GeometryCollection:function(A,e){for(var t=A.geometries,n=-1,r=t.length;++n<r;)KA(t[n],e)}};function Ae(A,e,t){var n,r=-1,i=A.length-t;for(e.lineStart();++r<i;)n=A[r],e.point(n[0],n[1],n[2]);e.lineEnd()}function ee(A,e){var t=-1,n=A.length;for(e.polygonStart();++t<n;)Ae(A[t],e,1);e.polygonEnd()}function te(A,e){A&&XA.hasOwnProperty(A.type)?XA[A.type](A,e):KA(A,e)}var ne,re,ie,ae,oe,le,ue,se,fe,ce,he,de,me,pe,ge,be,qe=new BA,ye=new BA,ve={point:JA,lineStart:JA,lineEnd:JA,polygonStart:function(){qe=new BA,ve.lineStart=xe,ve.lineEnd=_e},polygonEnd:function(){var A=+qe;ye.add(A<0?GA+A:A),this.lineStart=this.lineEnd=this.point=JA},sphere:function(){ye.add(GA)}};function xe(){ve.point=we}function _e(){Me(ne,re)}function we(A,e){ve.point=Me,ne=A,re=e,ie=A*=UA,ae=NA(e=(e*=UA)/2+RA),oe=zA(e)}function Me(A,e){var t=(A*=UA)-ie,n=t>=0?1:-1,r=n*t,i=NA(e=(e*=UA)/2+RA),a=zA(e),o=oe*a,l=ae*i+o*NA(r),u=o*n*zA(r);qe.add(LA(u,l)),ie=A,ae=i,oe=a}function Be(A){var e=A[0],t=A[1],n=NA(t);return[n*NA(e),n*zA(e),zA(t)]}function Ee(A,e){return[A[1]*e[2]-A[2]*e[1],A[2]*e[0]-A[0]*e[2],A[0]*e[1]-A[1]*e[0]]}function ke(A){var e=YA(A[0]*A[0]+A[1]*A[1]+A[2]*A[2]);A[0]/=e,A[1]/=e,A[2]/=e}var Se,Te,De,Ce,Ie={point:Oe,lineStart:Qe,lineEnd:Re,polygonStart:function(){Ie.point=Ge,Ie.lineStart=Fe,Ie.lineEnd=Ue,pe=new BA,ve.polygonStart()},polygonEnd:function(){ve.polygonEnd(),Ie.point=Oe,Ie.lineStart=Qe,Ie.lineEnd=Re,qe<0?(le=-(se=180),ue=-(fe=90)):pe>OA?fe=90:pe<-1e-6&&(ue=-90),be[0]=le,be[1]=se},sphere:function(){le=-(se=180),ue=-(fe=90)}};function Oe(A,e){ge.push(be=[le=A,se=A]),e<ue&&(ue=e),e>fe&&(fe=e)}function Pe(A,e){var t=Be([A*UA,e*UA]);if(me){var n=Ee(me,t),r=Ee([n[1],-n[0],0],n);ke(r),r=function(A){return[LA(A[1],A[0]),WA(A[2])]}(r);var i,a=A-ce,o=a>0?1:-1,l=r[0]*FA*o,u=jA(a)>180;u^(o*ce<l&&l<o*A)?(i=r[1]*FA)>fe&&(fe=i):u^(o*ce<(l=(l+360)%360-180)&&l<o*A)?(i=-r[1]*FA)<ue&&(ue=i):(e<ue&&(ue=e),e>fe&&(fe=e)),u?A<ce?je(le,A)>je(le,se)&&(se=A):je(A,se)>je(le,se)&&(le=A):se>=le?(A<le&&(le=A),A>se&&(se=A)):A>ce?je(le,A)>je(le,se)&&(se=A):je(A,se)>je(le,se)&&(le=A)}else ge.push(be=[le=A,se=A]);e<ue&&(ue=e),e>fe&&(fe=e),me=t,ce=A}function Qe(){Ie.point=Pe}function Re(){be[0]=le,be[1]=se,Ie.point=Oe,me=null}function Ge(A,e){if(me){var t=A-ce;pe.add(jA(t)>180?t+(t>0?360:-360):t)}else he=A,de=e;ve.point(A,e),Pe(A,e)}function Fe(){ve.lineStart()}function Ue(){Ge(he,de),ve.lineEnd(),jA(pe)>OA&&(le=-(se=180)),be[0]=le,be[1]=se,me=null}function je(A,e){return(e-=A)<0?e+360:e}function Le(A,e){return A[0]-e[0]}function Ne(A,e){return A[0]<=A[1]?A[0]<=e&&e<=A[1]:e<A[0]||A[1]<e}function He(A){var e,t,n,r,i,a,o;if(fe=se=-(le=ue=1/0),ge=[],te(A,Ie),t=ge.length){for(ge.sort(Le),e=1,i=[n=ge[0]];e<t;++e)Ne(n,(r=ge[e])[0])||Ne(n,r[1])?(je(n[0],r[1])>je(n[0],n[1])&&(n[1]=r[1]),je(r[0],n[1])>je(n[0],n[1])&&(n[0]=r[0])):i.push(n=r);for(a=-1/0,e=0,n=i[t=i.length-1];e<=t;n=r,++e)r=i[e],(o=je(n[1],r[0]))>a&&(a=o,le=r[0],se=n[1])}return ge=be=null,le===1/0||ue===1/0?[[NaN,NaN],[NaN,NaN]]:[[le,ue],[se,fe]]}function ze(A){return jA(A[0])<=PA?A[0]:VA(A[0])*((jA(A[0])+PA)%GA-PA)}var Ve={sphere:JA,point:JA,lineStart:function(){Ve.point=We,Ve.lineEnd=Ye},lineEnd:JA,polygonStart:JA,polygonEnd:JA};function Ye(){Ve.point=Ve.lineEnd=JA}function We(A,e){Te=A*=UA,De=zA(e*=UA),Ce=NA(e),Ve.point=Ze}function Ze(A,e){A*=UA;var t=zA(e*=UA),n=NA(e),r=jA(A-Te),i=NA(r),a=n*zA(r),o=Ce*t-De*n*i,l=De*t+Ce*n*i;Se.add(LA(YA(a*a+o*o),l)),Te=A,De=t,Ce=n}var Je=[null,null],Ke={type:"LineString",coordinates:Je};function Xe(A,e){return Je[0]=A,Je[1]=e,function(A){return Se=new BA,te(A,Ve),+Se}(Ke)}var $e={Feature:function(A,e){return et(A.geometry,e)},FeatureCollection:function(A,e){for(var t=A.features,n=-1,r=t.length;++n<r;)if(et(t[n].geometry,e))return!0;return!1}},At={Sphere:function(){return!0},Point:function(A,e){return tt(A.coordinates,e)},MultiPoint:function(A,e){for(var t=A.coordinates,n=-1,r=t.length;++n<r;)if(tt(t[n],e))return!0;return!1},LineString:function(A,e){return nt(A.coordinates,e)},MultiLineString:function(A,e){for(var t=A.coordinates,n=-1,r=t.length;++n<r;)if(nt(t[n],e))return!0;return!1},Polygon:function(A,e){return rt(A.coordinates,e)},MultiPolygon:function(A,e){for(var t=A.coordinates,n=-1,r=t.length;++n<r;)if(rt(t[n],e))return!0;return!1},GeometryCollection:function(A,e){for(var t=A.geometries,n=-1,r=t.length;++n<r;)if(et(t[n],e))return!0;return!1}};function et(A,e){return!(!A||!At.hasOwnProperty(A.type))&&At[A.type](A,e)}function tt(A,e){return 0===Xe(A,e)}function nt(A,e){for(var t,n,r,i=0,a=A.length;i<a;i++){if(0===(n=Xe(A[i],e)))return!0;if(i>0&&(r=Xe(A[i],A[i-1]))>0&&t<=r&&n<=r&&(t+n-r)*(1-Math.pow((t-n)/r,2))<1e-12*r)return!0;t=n}return!1}function rt(A,e){return!!function(A,e){var t=ze(e),n=e[1],r=zA(n),i=[zA(t),-NA(t),0],a=0,o=0,l=new BA;1===r?n=QA+OA:-1===r&&(n=-QA-OA);for(var u=0,s=A.length;u<s;++u)if(c=(f=A[u]).length)for(var f,c,h=f[c-1],d=ze(h),m=h[1]/2+RA,p=zA(m),g=NA(m),b=0;b<c;++b,d=y,p=x,g=_,h=q){var q=f[b],y=ze(q),v=q[1]/2+RA,x=zA(v),_=NA(v),w=y-d,M=w>=0?1:-1,B=M*w,E=B>PA,k=p*x;if(l.add(LA(k*M*zA(B),g*_+k*NA(B))),a+=E?w+M*GA:w,E^d>=t^y>=t){var S=Ee(Be(h),Be(q));ke(S);var T=Ee(i,S);ke(T);var D=(E^w>=0?-1:1)*WA(T[2]);(n>D||n===D&&(S[0]||S[1]))&&(o+=E^w>=0?1:-1)}}return(a<-1e-6||a<OA&&l<-1e-12)^1&o}(A.map(it),at(e))}function it(A){return(A=A.map(at)).pop(),A}function at(A){return[A[0]*UA,A[1]*UA]}function ot(A,e){return(A&&$e.hasOwnProperty(A.type)?$e[A.type]:et)(A,e)}function lt(A,e,t){var n=IA(A,e-OA,t).concat(e);return function(A){return n.map((function(e){return[A,e]}))}}function ut(A,e,t){var n=IA(A,e-OA,t).concat(e);return function(A){return n.map((function(e){return[e,A]}))}}function st(){return function(){var A,e,t,n,r,i,a,o,l,u,s,f,c=10,h=c,d=90,m=360,p=2.5;function g(){return{type:"MultiLineString",coordinates:b()}}function b(){return IA(HA(n/d)*d,t,d).map(s).concat(IA(HA(o/m)*m,a,m).map(f)).concat(IA(HA(e/c)*c,A,c).filter((function(A){return jA(A%d)>OA})).map(l)).concat(IA(HA(i/h)*h,r,h).filter((function(A){return jA(A%m)>OA})).map(u))}return g.lines=function(){return b().map((function(A){return{type:"LineString",coordinates:A}}))},g.outline=function(){return{type:"Polygon",coordinates:[s(n).concat(f(a).slice(1),s(t).reverse().slice(1),f(o).reverse().slice(1))]}},g.extent=function(A){return arguments.length?g.extentMajor(A).extentMinor(A):g.extentMinor()},g.extentMajor=function(A){return arguments.length?(n=+A[0][0],t=+A[1][0],o=+A[0][1],a=+A[1][1],n>t&&(A=n,n=t,t=A),o>a&&(A=o,o=a,a=A),g.precision(p)):[[n,o],[t,a]]},g.extentMinor=function(t){return arguments.length?(e=+t[0][0],A=+t[1][0],i=+t[0][1],r=+t[1][1],e>A&&(t=e,e=A,A=t),i>r&&(t=i,i=r,r=t),g.precision(p)):[[e,i],[A,r]]},g.step=function(A){return arguments.length?g.stepMajor(A).stepMinor(A):g.stepMinor()},g.stepMajor=function(A){return arguments.length?(d=+A[0],m=+A[1],g):[d,m]},g.stepMinor=function(A){return arguments.length?(c=+A[0],h=+A[1],g):[c,h]},g.precision=function(c){return arguments.length?(p=+c,l=lt(i,r,90),u=ut(e,A,p),s=lt(o,a,90),f=ut(n,t,p),g):p},g.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}()()}function ft(A,e){var t=A[0]*UA,n=A[1]*UA,r=e[0]*UA,i=e[1]*UA,a=NA(n),o=zA(n),l=NA(i),u=zA(i),s=a*NA(t),f=a*zA(t),c=l*NA(r),h=l*zA(r),d=2*WA(YA(ZA(i-n)+a*l*ZA(r-t))),m=zA(d),p=d?function(A){var e=zA(A*=d)/m,t=zA(d-A)/m,n=t*s+e*c,r=t*f+e*h,i=t*o+e*u;return[LA(r,n)*FA,LA(i,YA(n*n+r*r))*FA]}:function(){return[t*FA,n*FA]};return p.distance=d,p}function ct(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}function ht(A){return(ht=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)})(A)}function dt(A,e){return(dt=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A})(A,e)}function mt(A,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A):e}function pt(A){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}();return function(){var t,n=ht(A);if(e){var r=ht(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return mt(this,t)}}function gt(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=A&&("undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"]);if(null==t)return;var n,r,i=[],a=!0,o=!1;try{for(t=t.call(A);!(a=(n=t.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(A){o=!0,r=A}finally{try{a||null==t.return||t.return()}finally{if(o)throw r}}return i}(A,e)||bt(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bt(A,e){if(A){if("string"==typeof A)return qt(A,e);var t=Object.prototype.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?qt(A,e):void 0}}function qt(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=A[t];return n}var yt=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,t=[],n=null;return A.forEach((function(A){if(n){var r=180*Xe(A,n)/Math.PI;if(r>e)for(var i=ft(n,A),a=1/Math.ceil(r/e),o=a;o<1;)t.push(i(o)),o+=a}t.push(n=A)})),t},vt=window.THREE?window.THREE:{BufferGeometry:A.BufferGeometry,Float32BufferAttribute:A.Float32BufferAttribute},xt=(new vt.BufferGeometry).setAttribute?"setAttribute":"addAttribute",_t=function(A){!function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&dt(A,e)}(t,A);var e=pt(t);function t(A){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;ct(this,t),(n=e.call(this)).type="GeoJsonGeometry",n.parameters={geoJson:A,radius:r,resolution:i};var a=({Point:s,MultiPoint:f,LineString:c,MultiLineString:h,Polygon:d,MultiPolygon:m}[A.type]||function(){return[]})(A.coordinates,r),o=[],l=[],u=0;function s(A,e){return[{vertices:Bt(A[1],A[0],e),indices:[]}]}function f(A,e){var t={vertices:[],indices:[]};return A.map((function(A){return s(A,e)})).forEach((function(A){var e=gt(A,1)[0];wt(t,e)})),[t]}function c(A,e){for(var t=yt(A,i).map((function(A){var t=gt(A,2),n=t[0];return Bt(t[1],n,e)})),n=vA.flatten([t]).vertices,r=Math.round(n.length/3),a=[],o=1;o<r;o++)a.push(o-1,o);return[{vertices:n,indices:a}]}function h(A,e){var t={vertices:[],indices:[]};return A.map((function(A){return c(A,e)})).forEach((function(A){var e=gt(A,1)[0];wt(t,e)})),[t]}function d(A,e){for(var t=A.map((function(A){return yt(A,i).map((function(A){var t=gt(A,2),n=t[0];return Bt(t[1],n,e)}))})),n=vA.flatten(t),r=n.vertices,a=n.holes,o=a[0]||1/0,l=r.slice(0,o),u=r.slice(o),s=new Set(a),f=Math.round(r.length/3),c=[],h=[],d=1;d<f;d++)s.has(d)||(d<o?c.push(d-1,d):h.push(d-1-o,d-o));var m=[{indices:c,vertices:l}];return a.length&&m.push({indices:h,vertices:u}),m}function m(A,e){var t={vertices:[],indices:[]},n={vertices:[],indices:[]};A.map((function(A){return d(A,e)})).forEach((function(A){var e=gt(A,2),r=e[0],i=e[1];wt(t,r),i&&wt(n,i)}));var r=[t];return n.vertices.length&&r.push(n),r}return a.forEach((function(A){var e=o.length;wt({indices:o,vertices:l},A),n.addGroup(e,o.length-e,u++)})),o.length&&n.setIndex(o),l.length&&n[xt]("position",new vt.Float32BufferAttribute(l,3)),n}return t}(vt.BufferGeometry);function wt(A,e){var t=Math.round(A.vertices.length/3);Mt(A.vertices,e.vertices),Mt(A.indices,e.indices.map((function(A){return A+t})))}function Mt(A,e){var t,n=function(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=bt(A))||e&&A&&"number"==typeof A.length){t&&(A=t);var n=0,r=function(){};return{s:r,n:function(){return n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,o=!1;return{s:function(){t=t.call(A)},n:function(){var A=t.next();return a=A.done,A},e:function(A){o=!0,i=A},f:function(){try{a||null==t.return||t.return()}finally{if(o)throw i}}}}(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;A.push(r)}}catch(A){n.e(A)}finally{n.f()}}function Bt(A,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=(90-A)*Math.PI/180,r=(90-e)*Math.PI/180;return[t*Math.sin(n)*Math.cos(r),t*Math.cos(n),t*Math.sin(n)*Math.sin(r)]}var Et=window.THREE?window.THREE:{BackSide:A.BackSide,BufferAttribute:A.BufferAttribute,Color:A.Color,Mesh:A.Mesh,ShaderMaterial:A.ShaderMaterial},kt={backside:!0,coefficient:.5,color:"gold",size:2,power:1};function St(A,e,t){return new Et.ShaderMaterial({depthWrite:!1,fragmentShader:"\nuniform vec3 color;\nuniform float coefficient;\nuniform float power;\nvarying vec3 vVertexNormal;\nvarying vec3 vVertexWorldPosition;\nvoid main() {\n vec3 worldCameraToVertex = vVertexWorldPosition - cameraPosition;\n vec3 viewCameraToVertex\t= (viewMatrix * vec4(worldCameraToVertex, 0.0)).xyz;\n viewCameraToVertex = normalize(viewCameraToVertex);\n float intensity\t= pow(\n coefficient + dot(vVertexNormal, viewCameraToVertex),\n power\n );\n gl_FragColor = vec4(color, intensity);\n}",transparent:!0,uniforms:{coefficient:{value:A},color:{value:new Et.Color(e)},power:{value:t}},vertexShader:"\nvarying vec3 vVertexWorldPosition;\nvarying vec3 vVertexNormal;\nvoid main() {\n vVertexNormal\t= normalize(normalMatrix * normal);\n vVertexWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n gl_Position\t= projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}\n"})}function Tt(A,e){for(var t=A.clone(),n=new Float32Array(3*A.attributes.position.count),r=0,i=n.length;r<i;r++){var a=A.attributes.normal.array[r],o=A.attributes.position.array[r];n[r]=o+a*e}return t.setAttribute("position",new Et.BufferAttribute(n,3)),t}var Dt=window.THREE?window.THREE:{Color:A.Color,LineBasicMaterial:A.LineBasicMaterial,LineSegments:A.LineSegments,Mesh:A.Mesh,MeshPhongMaterial:A.MeshPhongMaterial,SphereBufferGeometry:A.SphereBufferGeometry,TextureLoader:A.TextureLoader},Ct=w({props:{globeImageUrl:{},bumpImageUrl:{},showGlobe:{default:!0,onChange:function(A,e){e.globeObj.visible=!!A},triggerUpdate:!1},showGraticules:{default:!1,onChange:function(A,e){e.graticulesObj.visible=!!A},triggerUpdate:!1},showAtmosphere:{default:!0,onChange:function(A,e){e.atmosphereObj&&(e.atmosphereObj.visible=!!A)},triggerUpdate:!1},atmosphereColor:{default:"lightskyblue"},atmosphereAltitude:{default:.15},onReady:{default:function(){},triggerUpdate:!1}},methods:{globeMaterial:function(A,e){return void 0!==e?(A.globeObj.material=e||A.defaultGlobeMaterial,this):A.globeObj.material}},stateInit:function(){var A=new Dt.SphereBufferGeometry(z,75,75),e=new Dt.MeshPhongMaterial({color:0,transparent:!0}),t=new Dt.Mesh(A,e);return t.rotation.y=-Math.PI/2,t.__globeObjType="globe",{globeObj:t,graticulesObj:new Dt.LineSegments(new _t(st(),z,2),new Dt.LineBasicMaterial({color:"lightgrey",transparent:!0,opacity:.1})),defaultGlobeMaterial:e}},init:function(A,e){N(A),e.scene=A,e.scene.add(e.globeObj),e.scene.add(e.graticulesObj),e.ready=!1},update:function(A,e){var t=A.globeObj.material;if(e.hasOwnProperty("globeImageUrl")&&(A.globeImageUrl?(new Dt.TextureLoader).load(A.globeImageUrl,(function(e){t.map=e,t.color=null,t.needsUpdate=!0,!A.ready&&(A.ready=!0)&&setTimeout(A.onReady)})):!t.color&&(t.color=new Dt.Color(0))),e.hasOwnProperty("bumpImageUrl")&&(A.bumpImageUrl?A.bumpImageUrl&&(new Dt.TextureLoader).load(A.bumpImageUrl,(function(A){t.bumpMap=A,t.needsUpdate=!0})):(t.bumpMap=null,t.needsUpdate=!0)),(e.hasOwnProperty("atmosphereColor")||e.hasOwnProperty("atmosphereAltitude"))&&(A.atmosphereObj&&(A.scene.remove(A.atmosphereObj),N(A.atmosphereObj)),A.atmosphereColor&&A.atmosphereAltitude)){var n=A.atmosphereObj=function(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kt,t=e.backside,n=e.coefficient,r=e.color,i=e.size,a=e.power,o=Tt(A,i),l=St(n,r,a);return t&&(l.side=Et.BackSide),new Et.Mesh(o,l)}(A.globeObj.geometry,{backside:!0,color:A.atmosphereColor,size:z*A.atmosphereAltitude,power:3.5,coefficient:.1});n.visible=!!A.showAtmosphere,n.__globeObjType="atmosphere",A.scene.add(n)}A.ready||A.globeImageUrl||(A.ready=!0,A.onReady())}});class It{static computeTangents(A){A.computeTangents(),console.warn("THREE.BufferGeometryUtils: .computeTangents() has been removed. Use BufferGeometry.computeTangents() instead.")}static mergeBufferGeometries(e,t=!1){const n=null!==e[0].index,r=new Set(Object.keys(e[0].attributes)),i=new Set(Object.keys(e[0].morphAttributes)),a={},o={},l=e[0].morphTargetsRelative,u=new A.BufferGeometry;let s=0;for(let A=0;A<e.length;++A){const f=e[A];let c=0;if(n!==(null!==f.index))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+A+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const e in f.attributes){if(!r.has(e))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+A+'. All geometries must have compatible attributes; make sure "'+e+'" attribute exists among all geometries, or in none of them.'),null;void 0===a[e]&&(a[e]=[]),a[e].push(f.attributes[e]),c++}if(c!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+A+". Make sure all geometries have the same number of attributes."),null;if(l!==f.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+A+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const e in f.morphAttributes){if(!i.has(e))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+A+". .morphAttributes must be consistent throughout all geometries."),null;void 0===o[e]&&(o[e]=[]),o[e].push(f.morphAttributes[e])}if(u.userData.mergedUserData=u.userData.mergedUserData||[],u.userData.mergedUserData.push(f.userData),t){let e;if(n)e=f.index.count;else{if(void 0===f.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+A+". The geometry must have either an index or a position attribute"),null;e=f.attributes.position.count}u.addGroup(s,e,A),s+=e}}if(n){let A=0;const t=[];for(let n=0;n<e.length;++n){const r=e[n].index;for(let e=0;e<r.count;++e)t.push(r.getX(e)+A);A+=e[n].attributes.position.count}u.setIndex(t)}for(const A in a){const e=this.mergeBufferAttributes(a[A]);if(!e)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+A+" attribute."),null;u.setAttribute(A,e)}for(const A in o){const e=o[A][0].length;if(0===e)break;u.morphAttributes=u.morphAttributes||{},u.morphAttributes[A]=[];for(let t=0;t<e;++t){const e=[];for(let n=0;n<o[A].length;++n)e.push(o[A][n][t]);const n=this.mergeBufferAttributes(e);if(!n)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+A+" morphAttribute."),null;u.morphAttributes[A].push(n)}}return u}static mergeBufferAttributes(e){let t,n,r,i=0;for(let A=0;A<e.length;++A){const a=e[A];if(a.isInterleavedBufferAttribute)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. InterleavedBufferAttributes are not supported."),null;if(void 0===t&&(t=a.array.constructor),t!==a.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===n&&(n=a.itemSize),n!==a.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===r&&(r=a.normalized),r!==a.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;i+=a.array.length}const a=new t(i);let o=0;for(let A=0;A<e.length;++A)a.set(e[A].array,o),o+=e[A].array.length;return new A.BufferAttribute(a,n,r)}static interleaveAttributes(e){let t,n=0,r=0;for(let A=0,i=e.length;A<i;++A){const i=e[A];if(void 0===t&&(t=i.array.constructor),t!==i.array.constructor)return console.error("AttributeBuffers of different types cannot be interleaved"),null;n+=i.array.length,r+=i.itemSize}const i=new A.InterleavedBuffer(new t(n),r);let a=0;const o=[],l=["getX","getY","getZ","getW"],u=["setX","setY","setZ","setW"];for(let t=0,n=e.length;t<n;t++){const n=e[t],r=n.itemSize,s=n.count,f=new A.InterleavedBufferAttribute(i,r,a,n.normalized);o.push(f),a+=r;for(let A=0;A<s;A++)for(let e=0;e<r;e++)f[u[e]](A,n[l[e]](A))}return o}static estimateBytesUsed(A){let e=0;for(const t in A.attributes){const n=A.getAttribute(t);e+=n.count*n.itemSize*n.array.BYTES_PER_ELEMENT}const t=A.getIndex();return e+=t?t.count*t.itemSize*t.array.BYTES_PER_ELEMENT:0,e}static mergeVertices(e,t=1e-4){t=Math.max(t,Number.EPSILON);const n={},r=e.getIndex(),i=e.getAttribute("position"),a=r?r.count:i.count;let o=0;const l=Object.keys(e.attributes),u={},s={},f=[],c=["getX","getY","getZ","getW"];for(let A=0,t=l.length;A<t;A++){const t=l[A];u[t]