vizicities/dist/vizicities.min.js

8 wiersze
162 KiB
JavaScript
Czysty Wina Historia

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("proj4"),require("THREE")):"function"==typeof define&&define.amd?define(["proj4","THREE"],t):"object"==typeof exports?exports.VIZI=t(require("proj4"),require("THREE")):e.VIZI=t(e.proj4,e.THREE)}(this,function(__WEBPACK_EXTERNAL_MODULE_22__,__WEBPACK_EXTERNAL_MODULE_24__){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(36),s=r(a),u=n(31),l=r(u),c=n(30),f=r(c),h=n(40),p=r(h),d=n(55),v=r(d),y=n(68),m=r(y),_=n(69),g=r(_),b=n(70),x=r(b),w=n(11),k=r(w),O=n(10),E=r(O),M={version:"0.3",World:o["default"],world:i.world,Controls:s["default"],Layer:l["default"],layer:u.layer,EnvironmentLayer:f["default"],environmentLayer:c.environmentLayer,ImageTileLayer:p["default"],imageTileLayer:h.imageTileLayer,GeoJSONTileLayer:v["default"],geoJSONTileLayer:d.geoJSONTileLayer,TopoJSONTileLayer:m["default"],topoJSONTileLayer:y.topoJSONTileLayer,GeoJSONLayer:g["default"],geoJSONLayer:_.geoJSONLayer,TopoJSONLayer:x["default"],topoJSONLayer:b.topoJSONLayer,Point:k["default"],point:w.point,LatLon:E["default"],latLon:O.latLon};t["default"]=M,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(2),l=r(u),c=n(3),f=r(c),h=n(6),p=r(h),d=n(11),v=n(10),y=n(23),m=r(y),_=n(30),g=r(_),b=function(e){function t(e,n){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this);var r={crs:p["default"].EPSG3857,skybox:!1};this.options=(0,f["default"])({},r,n),this._layers=[],this._controls=[],this._initContainer(e),this._initEngine(),this._initEnvironment(),this._initEvents(),this._pause=!1,this._update()}return o(t,e),a(t,[{key:"_initContainer",value:function(e){this._container=document.getElementById(e)}},{key:"_initEngine",value:function(){this._engine=new m["default"](this._container,this)}},{key:"_initEnvironment",value:function(){this._environment=new g["default"]({skybox:this.options.skybox}).addTo(this)}},{key:"_initEvents",value:function(){this.on("controlsMoveEnd",this._onControlsMoveEnd)}},{key:"_onControlsMoveEnd",value:function(e){var t=(0,d.point)(e.x,e.z);this._resetView(this.pointToLatLon(t),t)}},{key:"_resetView",value:function(e,t){this.emit("preResetView"),this._moveStart(),this._move(e,t),this._moveEnd(),this.emit("postResetView")}},{key:"_moveStart",value:function(){this.emit("moveStart")}},{key:"_move",value:function(e,t){this._lastPosition=e,this.emit("move",e,t)}},{key:"_moveEnd",value:function(){this.emit("moveEnd")}},{key:"_update",value:function(){if(!this._pause){var e=this._engine.clock.getDelta();window.requestAnimationFrame(this._update.bind(this)),this._controls.forEach(function(e){e.update()}),this.emit("preUpdate",e),this._engine.update(e),this.emit("postUpdate",e)}}},{key:"setView",value:function(e){return this._originLatlon=e,this._originPoint=this.project(e),this._resetView(e),this}},{key:"getPosition",value:function(){return this._lastPosition}},{key:"project",value:function(e){return this.options.crs.latLonToPoint((0,v.latLon)(e))}},{key:"unproject",value:function(e){return this.options.crs.pointToLatLon((0,d.point)(e))}},{key:"latLonToPoint",value:function(e){var t=this.project((0,v.latLon)(e));return t._subtract(this._originPoint)}},{key:"pointToLatLon",value:function(e){var t=(0,d.point)(e).add(this._originPoint);return this.unproject(t)}},{key:"pointScale",value:function(e,t){return this.options.crs.pointScale(e,t)}},{key:"metresToWorld",value:function(e,t,n){return this.options.crs.metresToWorld(e,t,n)}},{key:"worldToMetres",value:function(e,t,n){return this.options.crs.worldToMetres(e,t,n)}},{key:"getCamera",value:function(){return this._engine._camera}},{key:"addLayer",value:function(e){return e._addToWorld(this),this._layers.push(e),this._engine._scene.add(e._layer),this.emit("layerAdded",e),this}},{key:"removeLayer",value:function(e){var t=this._layers.indexOf(e);return t>-1&&this._layers.splice(t,1),this._engine._scene.remove(e._layer),this.emit("layerRemoved"),this}},{key:"addControls",value:function(e){return e._addToWorld(this),this._controls.push(e),this.emit("controlsAdded",e),this}},{key:"removeControls",value:function(e){var t=this._controls.indexOf(t);return t>-1&&this._controls.splice(t,1),this.emit("controlsRemoved",e),this}},{key:"stop",value:function(){this._pause=!0}},{key:"start",value:function(){this._pause=!1,this._update()}},{key:"destroy",value:function(){this.stop(),this.off("controlsMoveEnd",this._onControlsMoveEnd);var e,t;for(e=this._controls.length-1;e>=0;e--)t=this._controls[0],this.removeControls(t),t.destroy();var n;for(e=this._layers.length-1;e>=0;e--)n=this._layers[0],this.removeLayer(n),n.destroy();this._environment=null,this._engine.destroy(),this._engine=null,this._container=null}}]),t}(l["default"]);t["default"]=b;var x=function(e,t){return new b(e,t)};t.world=x},function(e,t,n){"use strict";function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(){}var o="function"!=typeof Object.create?"~":!1;i.prototype._events=void 0,i.prototype.listeners=function(e,t){var n=o?o+e:e,r=this._events&&this._events[n];if(t)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,s=new Array(a);a>i;i++)s[i]=r[i].fn;return s},i.prototype.emit=function(e,t,n,r,i,a){var s=o?o+e:e;if(!this._events||!this._events[s])return!1;var u,l,c=this._events[s],f=arguments.length;if("function"==typeof c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),f){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,r),!0;case 5:return c.fn.call(c.context,t,n,r,i),!0;case 6:return c.fn.call(c.context,t,n,r,i,a),!0}for(l=1,u=new Array(f-1);f>l;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var h,p=c.length;for(l=0;p>l;l++)switch(c[l].once&&this.removeListener(e,c[l].fn,void 0,!0),f){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,t);break;case 3:c[l].fn.call(c[l].context,t,n);break;default:if(!u)for(h=1,u=new Array(f-1);f>h;h++)u[h-1]=arguments[h];c[l].fn.apply(c[l].context,u)}}return!0},i.prototype.on=function(e,t,n){var i=new r(t,n||this),a=o?o+e:e;return this._events||(this._events=o?{}:Object.create(null)),this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],i]:this._events[a].push(i):this._events[a]=i,this},i.prototype.once=function(e,t,n){var i=new r(t,n||this,!0),a=o?o+e:e;return this._events||(this._events=o?{}:Object.create(null)),this._events[a]?this._events[a].fn?this._events[a]=[this._events[a],i]:this._events[a].push(i):this._events[a]=i,this},i.prototype.removeListener=function(e,t,n,r){var i=o?o+e:e;if(!this._events||!this._events[i])return this;var a=this._events[i],s=[];if(t)if(a.fn)(a.fn!==t||r&&!a.once||n&&a.context!==n)&&s.push(a);else for(var u=0,l=a.length;l>u;u++)(a[u].fn!==t||r&&!a[u].once||n&&a[u].context!==n)&&s.push(a[u]);return s.length?this._events[i]=1===s.length?s[0]:s:delete this._events[i],this},i.prototype.removeAllListeners=function(e){return this._events?(e?delete this._events[o?o+e:e]:this._events=o?{}:Object.create(null),this):this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prototype.setMaxListeners=function(){return this},i.prefixed=o,e.exports=i},function(e,t,n){function r(e,t){return e="number"==typeof e||b.test(e)?+e:-1,t=null==t?m:t,e>-1&&e%1==0&&t>e}function i(e,t,n){var r=e[t];(!c(r,n)||c(r,x[t])&&!w.call(e,t)||void 0===n&&!(t in e))&&(e[t]=n)}function o(e){return function(t){return null==t?void 0:t[e]}}function a(e,t,n){return s(e,t,n)}function s(e,t,n,r){n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],u=r?r(n[s],e[s],s,n,e):e[s];i(n,s,u)}return n}function u(e){return y(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o="function"==typeof o?(i--,o):void 0,a&&l(n[0],n[1],a)&&(o=3>i?void 0:o,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,o)}return t})}function l(e,t,n){if(!d(n))return!1;var i=typeof t;return("number"==i?f(n)&&r(t,n.length):"string"==i&&t in n)?c(n[t],e):!1}function c(e,t){return e===t||e!==e&&t!==t}function f(e){return null!=e&&!("function"==typeof e&&h(e))&&p(O(e))}function h(e){var t=d(e)?k.call(e):"";return t==_||t==g}function p(e){return"number"==typeof e&&e>-1&&e%1==0&&m>=e}function d(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var v=n(4),y=n(5),m=9007199254740991,_="[object Function]",g="[object GeneratorFunction]",b=/^(?:0|[1-9]\d*)$/,x=Object.prototype,w=x.hasOwnProperty,k=x.toString,O=o("length"),E=u(function(e,t){a(t,v(t),e)});e.exports=E},function(e,t){function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function r(e,t){return e="number"==typeof e||k.test(e)?+e:-1,t=null==t?_:t,e>-1&&e%1==0&&t>e}function i(e,t){return E.call(e,t)||"object"==typeof e&&t in e&&null===T(e)}function o(e){return j(Object(e))}function a(e){return function(t){return null==t?void 0:t[e]}}function s(e){var t=e?e.length:void 0;return p(t)&&(L(e)||y(e)||l(e))?n(t,String):null}function u(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||O;return e===n}function l(e){return f(e)&&E.call(e,"callee")&&(!P.call(e,"callee")||M.call(e)==g)}function c(e){return null!=e&&!("function"==typeof e&&h(e))&&p(S(e))}function f(e){return v(e)&&c(e)}function h(e){var t=d(e)?M.call(e):"";return t==b||t==x}function p(e){return"number"==typeof e&&e>-1&&e%1==0&&_>=e}function d(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){return!!e&&"object"==typeof e}function y(e){return"string"==typeof e||!L(e)&&v(e)&&M.call(e)==w}function m(e){var t=u(e);if(!t&&!c(e))return o(e);var n=s(e),a=!!n,l=n||[],f=l.length;for(var h in e)!i(e,h)||a&&("length"==h||r(h,f))||t&&"constructor"==h||l.push(h);return l}var _=9007199254740991,g="[object Arguments]",b="[object Function]",x="[object GeneratorFunction]",w="[object String]",k=/^(?:0|[1-9]\d*)$/,O=Object.prototype,E=O.hasOwnProperty,M=O.toString,T=Object.getPrototypeOf,P=O.propertyIsEnumerable,j=Object.keys,S=a("length"),L=Array.isArray;e.exports=m},function(e,t){function n(e,t,n){var r=n.length;switch(r){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function r(e,t){if("function"!=typeof e)throw new TypeError(u);return t=x(void 0===t?e.length-1:a(t),0),function(){for(var r=arguments,i=-1,o=x(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];switch(t){case 0:return e.call(this,a);case 1:return e.call(this,r[0],a);case 2:return e.call(this,r[0],r[1],a)}var s=Array(t+1);for(i=-1;++i<t;)s[i]=r[i];return s[t]=a,n(e,this,s)}}function i(e){var t=o(e)?b.call(e):"";return t==h||t==p}function o(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function a(e){if(!e)return 0===e?e:0;if(e=s(e),e===l||e===-l){var t=0>e?-1:1;return t*c}var n=e%1;return e===e?n?e-n:e:0}function s(e){if(o(e)){var t=i(e.valueOf)?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(d,"");var n=y.test(e);return n||m.test(e)?_(e.slice(2),n?2:8):v.test(e)?f:+e}var u="Expected a function",l=1/0,c=1.7976931348623157e308,f=NaN,h="[object Function]",p="[object GeneratorFunction]",d=/^\s+|\s+$/g,v=/^[-+]0x[0-9a-f]+$/i,y=/^0b[01]+$/i,m=/^0o[0-7]+$/i,_=parseInt,g=Object.prototype,b=g.toString,x=Math.max;e.exports=r},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(7),o=r(i),a=n(15),s=r(a),u=n(17),l=r(u),c=n(19),f=r(c),h=n(20),p=r(h),d={};d.EPSG3857=o["default"],d.EPSG900913=i.EPSG900913,d.EPSG3395=s["default"],d.EPSG4326=l["default"],d.Simple=f["default"],d.Proj4=p["default"],t["default"]=d,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=r(i),a=n(8),s=r(a),u=n(13),l=r(u),c=n(14),f=r(c),h={code:"EPSG:3857",projection:l["default"],transformScale:1/(Math.PI*l["default"].R),transformation:function(){var e=1/(Math.PI*l["default"].R);return new f["default"](e,0,-e,0)}()},p=(0,o["default"])({},s["default"],h),d=(0,o["default"])({},p,{code:"EPSG:900913"});t.EPSG900913=d,t["default"]=p},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=r(i),a=n(9),s=r(a),u=(n(10),{wrapLon:[-180,180],R:6378137,distance:function(e,t,n){var r,i,o,a=Math.PI/180;if(n){r=e.lat*a,i=t.lat*a;var s=e.lon*a,u=t.lon*a,l=i-r,c=u-s,f=l/2,h=c/2;o=Math.sin(f)*Math.sin(f)+Math.cos(r)*Math.cos(i)*Math.sin(h)*Math.sin(h);var p=2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o));return this.R*p}return r=e.lat*a,i=t.lat*a,o=Math.sin(r)*Math.sin(i)+Math.cos(r)*Math.cos(i)*Math.cos((t.lon-e.lon)*a),this.R*Math.acos(Math.min(o,1))},pointScale:function(e,t){return this.projection.pointScale?this.projection.pointScale(e,t):[1,1]},metresToProjected:function(e,t){return e*t[1]},projectedToMetres:function(e,t){return e/t[1]},metresToWorld:function(e,t,n){var r=this.metresToProjected(e,t),i=this.scale(n);n&&(i/=2);var o=i*(this.transformScale*r);return n&&(o/=t[1]),o},worldToMetres:function(e,t,n){var r=this.scale(n);n&&(r/=2);var i=e/r/this.transformScale,o=this.projectedToMetres(i,t);return n&&(o*=t[1]),o}});t["default"]=(0,o["default"])({},s["default"],u),e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(10),o=n(11),a=n(12),s=r(a),u={scaleFactor:1e6,latLonToPoint:function(e,t){var n=this.projection.project(e),r=this.scale(t);return t&&(r/=2),this.transformation._transform(n,r)},pointToLatLon:function(e,t){var n=this.scale(t);t&&(n/=2);var r=this.transformation.untransform(e,n);return this.projection.unproject(r)},project:function(e){return this.projection.project(e)},unproject:function(e){return this.projection.unproject(e)},scale:function(e){return e>=0?256*Math.pow(2,e):this.scaleFactor},zoom:function(e){return Math.log(e/256)/Math.LN2},getProjectedBounds:function(e){if(this.infinite)return null;var t=this.projection.bounds,n=this.scale(e);e&&(n/=2);var r=this.transformation.transform((0,o.point)(t[0]),n),i=this.transformation.transform((0,o.point)(t[1]),n);return[r,i]},wrapLatLon:function(e){var t=this.wrapLat?(0,s["default"])(e.lat,this.wrapLat,!0):e.lat,n=this.wrapLon?(0,s["default"])(e.lon,this.wrapLon,!0):e.lon,r=e.alt;return(0,i.latLon)(t,n,r)}};t["default"]=u,e.exports=t["default"]},function(e,t){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t,r,i){if(n(this,e),isNaN(t)||isNaN(r))throw new Error("Invalid LatLon object: ("+t+", "+r+")");this.lat=+t,this.lon=+r,void 0!==i&&(this.alt=+i)}return r(e,[{key:"clone",value:function(){return new e(this.lat,this.lon,this.alt)}}]),e}();t["default"]=i;var o=function(e,t,n){return e instanceof i?e:Array.isArray(e)&&"object"!=typeof e[0]?3===e.length?new i(e[0],e[1],e[2]):2===e.length?new i(e[0],e[1]):null:void 0===e||null===e?e:"object"==typeof e&&"lat"in e?new i(e.lat,"lng"in e?e.lng:e.lon,e.alt):void 0===t?null:new i(e,t,n)};t.latLon=o},function(e,t){function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t,r,i){n(this,e),this.x=i?Math.round(t):t,this.y=i?Math.round(r):r}return r(e,[{key:"clone",value:function(){return new e(this.x,this.y)}},{key:"add",value:function(e){return this.clone()._add(o(e))}},{key:"_add",value:function(e){return this.x+=e.x,this.y+=e.y,this}},{key:"subtract",value:function(e){return this.clone()._subtract(o(e))}},{key:"_subtract",value:function(e){return this.x-=e.x,this.y-=e.y,this}}]),e}();t["default"]=i;var o=function(e,t,n){return e instanceof i?e:Array.isArray(e)?new i(e[0],e[1]):void 0===e||null===e?e:new i(e,t,n)};t.point=o},function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,n){var r=t[1],i=t[0],o=r-i;return e===r&&n?e:((e-i)%o+o)%o+i};t["default"]=n,e.exports=t["default"]},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(11),o={R:6378137,MAX_LATITUDE:85.0511287798,ECC:.081819191,ECC2:.006694380015894481,project:function(e){var t=Math.PI/180,n=this.MAX_LATITUDE,r=Math.max(Math.min(n,e.lat),-n),o=Math.sin(r*t);return(0,i.point)(this.R*e.lon*t,this.R*Math.log((1+o)/(1-o))/2)},unproject:function(e){var t=180/Math.PI;return(0,r.latLon)((2*Math.atan(Math.exp(e.y/this.R))-Math.PI/2)*t,e.x*t/this.R)},pointScale:function(e,t){var n,r=Math.PI/180;if(t){var i=e.lat*r,o=(e.lon*r,this.R),a=Math.sin(i),s=a*a,u=Math.cos(i),l=o*(1-this.ECC2)/Math.pow(1-this.ECC2*s,1.5),c=o/Math.sqrt(1-this.ECC2*s),f=o/l/u;return n=o/c/u,[n,f]}return n=1/Math.cos(e.lat*r),[n,n]},bounds:function(){var e=6378137*Math.PI;return[[-e,-e],[e,e]]}()};t["default"]=o,e.exports=t["default"]},function(e,t,n){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(11),a=function(){function e(t,n,i,o){r(this,e),this._a=t,this._b=n,this._c=i,this._d=o}return i(e,[{key:"transform",value:function(e,t){return this._transform(e.clone(),t)}},{key:"_transform",value:function(e,t){return t=t||1,e.x=t*(this._a*e.x+this._b),e.y=t*(this._c*e.y+this._d),e}},{key:"untransform",value:function(e,t){return t=t||1,(0,o.point)((e.x/t-this._b)/this._a,(e.y/t-this._d)/this._c)}}]),e}();t["default"]=a,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=r(i),a=n(8),s=r(a),u=n(16),l=r(u),c=n(14),f=r(c),h={code:"EPSG:3395",projection:l["default"],transformScale:1/(Math.PI*l["default"].R),transformation:function(){var e=1/(Math.PI*l["default"].R);return new f["default"](e,0,-e,0)}()},p=(0,o["default"])({},s["default"],h);t["default"]=p,e.exports=t["default"]},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(11),o={R:6378137,R_MINOR:6356752.314245179,ECC:.081819191,ECC2:.006694380015894481,project:function(e){var t=Math.PI/180,n=this.R,r=e.lat*t,o=this.R_MINOR/n,a=Math.sqrt(1-o*o),s=a*Math.sin(r),u=Math.tan(Math.PI/4-r/2)/Math.pow((1-s)/(1+s),a/2);return r=-n*Math.log(Math.max(u,1e-10)),(0,i.point)(e.lon*t*n,r)},unproject:function(e){for(var t,n=180/Math.PI,i=this.R,o=this.R_MINOR/i,a=Math.sqrt(1-o*o),s=Math.exp(-e.y/i),u=Math.PI/2-2*Math.atan(s),l=0,c=.1;15>l&&Math.abs(c)>1e-7;l++)t=a*Math.sin(u),t=Math.pow((1-t)/(1+t),a/2),c=Math.PI/2-2*Math.atan(s*t)-u,u+=c;return(0,r.latLon)(u*n,e.x*n/i)},pointScale:function(e){var t=Math.PI/180,n=e.lat*t,r=Math.sin(n),i=r*r,o=Math.cos(n),a=Math.sqrt(1-this.ECC2*i)/o;return[a,a]},bounds:[[-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]]};t["default"]=o,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=r(i),a=n(8),s=r(a),u=n(18),l=r(u),c=n(14),f=r(c),h={code:"EPSG:4326",projection:l["default"],transformScale:1/180,transformation:new f["default"](1/180,0,-1/180,0)},p=(0,o["default"])({},s["default"],h);t["default"]=p,e.exports=t["default"]},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(10),i=n(11),o={project:function(e){return(0,i.point)(e.lon,e.lat)},unproject:function(e){return(0,r.latLon)(e.y,e.x)},pointScale:function(e){var t=111132.92,n=-559.82,r=1.175,i=-.0023,o=111412.84,a=-93.5,s=.118,u=Math.PI/180,l=e.lat*u,c=t+n*Math.cos(2*l)+r*Math.cos(4*l)+i*Math.cos(6*l),f=o*Math.cos(l)+a*Math.cos(3*l)+s*Math.cos(5*l);return[1/c,1/f]},bounds:[[-180,-90],[180,90]]};t["default"]=o,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=r(i),a=n(9),s=r(a),u=n(18),l=r(u),c=n(14),f=r(c),h={projection:l["default"],transformation:new f["default"](1,0,1,0),scale:function(e){return e?Math.pow(2,e):1},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,t){var n=t.lon-e.lon,r=t.lat-e.lat;return Math.sqrt(n*n+r*r)},infinite:!0},p=(0,o["default"])({},s["default"],h);t["default"]=p,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=r(i),a=n(8),s=r(a),u=n(21),l=r(u),c=n(14),f=r(c),h=function(e,t,n){var r=(0,l["default"])(t,n),i=r.bounds[1][0]-r.bounds[0][0],o=r.bounds[1][1]-r.bounds[0][1],a=i/2,s=o/2,u=1/a,c=1/s,h=Math.min(u,c),p=h*(r.bounds[0][0]+a),d=h*(r.bounds[0][1]+s);return{code:e,projection:r,transformScale:h,transformation:new f["default"](h,-p,-h,d)}},p=function(e,t,n){return(0,o["default"])({},s["default"],h(e,t,n))};t["default"]=p,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(22),o=r(i),a=n(10),s=n(11),u=function(e,t){var n=(0,o["default"])(e),r=function(e){return(0,s.point)(n.forward([e.lon,e.lat]))},i=function(e){var t=n.inverse([e.x,e.y]);return(0,a.latLon)(t[1],t[0])};return{project:r,unproject:i,pointScale:function(e,t){return[1,1]},bounds:function(){if(t)return t;var e=r([-90,-180]),n=r([90,180]);return[e,n]}()}};t["default"]=u,e.exports=t["default"]},function(e,t){e.exports=__WEBPACK_EXTERNAL_MODULE_22__},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},l=n(2),c=r(l),f=n(24),h=r(f),p=n(25),d=r(p),v=n(26),y=r(v),m=n(27),_=r(m),g=n(28),b=r(g),x=function(e){function t(e,n){o(this,t),console.log("Init Engine"),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this._world=n,this._scene=d["default"],this._renderer=(0,y["default"])(e),this._camera=(0,_["default"])(e),this._picking=(0,b["default"])(this._world,this._renderer,this._camera),this.clock=new h["default"].Clock,this._frustum=new h["default"].Frustum}return a(t,e),s(t,[{key:"update",value:function(e){this.emit("preRender"),this._renderer.render(this._scene,this._camera),this.emit("postRender")}},{key:"destroy",value:function(){var e;for(i=this._scene.children.length-1;i>=0;i--)e=this._scene.children[i],e&&(this._scene.remove(e),e.geometry&&(e.geometry.dispose(),e.geometry=null),e.material&&(e.material.map&&(e.material.map.dispose(),e.material.map=null),e.material.dispose(),e.material=null));this._picking.destroy(),this._picking=null,this._world=null,this._scene=null,this._renderer=null,this._camera=null,this._clock=null,this._frustum=null}}]),t}(c["default"]);t["default"]=x,e.exports=t["default"]},function(e,t){e.exports=__WEBPACK_EXTERNAL_MODULE_24__},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i);t["default"]=function(){var e=new o["default"].Scene;return e}(),e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i),a=n(25);r(a);t["default"]=function(e){var t=new o["default"].WebGLRenderer({antialias:!0});t.setClearColor(16777215,1),t.setPixelRatio(window.devicePixelRatio),t.gammaInput=!0,t.gammaOutput=!0,t.shadowMap.enabled=!0,t.shadowMap.cullFace=o["default"].CullFaceBack,e.appendChild(t.domElement);var n=function(){t.setSize(e.clientWidth,e.clientHeight)};return window.addEventListener("resize",n,!1),n(),t},e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i);t["default"]=function(e){var t=new o["default"].PerspectiveCamera(45,1,1,2e5);t.position.y=400,t.position.z=400;var n=function(){t.aspect=e.clientWidth/e.clientHeight,t.updateProjectionMatrix()};return window.addEventListener("resize",n,!1),n(),t},e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(24),s=r(a),u=n(11),l=n(29),c=r(l),f=1,h=function(){function e(t,n,r){i(this,e),this._world=t,this._renderer=n,this._camera=r,this._raycaster=new s["default"].Raycaster,this._raycaster.linePrecision=3,this._pickingScene=c["default"],this._pickingTexture=new s["default"].WebGLRenderTarget,this._pickingTexture.texture.minFilter=s["default"].LinearFilter,this._pickingTexture.texture.generateMipmaps=!1,this._nextId=1,this._resizeTexture(),this._initEvents()}return o(e,[{key:"_initEvents",value:function(){window.addEventListener("resize",this._resizeTexture.bind(this),!1),this._renderer.domElement.addEventListener("mouseup",this._onMouseUp.bind(this),!1),this._world.on("move",this._onWorldMove,this)}},{key:"_onMouseUp",value:function(e){if(0===e.button){var t=(0,u.point)(e.clientX,e.clientY),n=(0,u.point)(0,0);n.x=t.x/this._width*2-1,n.y=2*-(t.y/this._height)+1,this._pick(t,n)}}},{key:"_onWorldMove",value:function(){this._needUpdate=!0}},{key:"_resizeTexture",value:function(){var e=this._renderer.getSize();this._width=e.width,this._height=e.height,this._pickingTexture.setSize(this._width,this._height),this._pixelBuffer=new Uint8Array(4*this._width*this._height),this._needUpdate=!0}},{key:"_update",value:function(){if(this._needUpdate){var e=this._pickingTexture;this._renderer.render(this._pickingScene,this._camera,this._pickingTexture),this._renderer.readRenderTargetPixels(e,0,0,e.width,e.height,this._pixelBuffer),this._needUpdate=!1}}},{key:"_pick",value:function(e,t){this._update();var n=e.x+(this._pickingTexture.height-e.y)*this._pickingTexture.width,r=255*this._pixelBuffer[4*n+2]*255+255*this._pixelBuffer[4*n+1]+this._pixelBuffer[4*n+0];if(16646655!==r){this._raycaster.setFromCamera(t,this._camera);var i,o=this._raycaster.intersectObjects(this._pickingScene.children,!0),a=e.clone();o.length>0&&(i=o[0].point.clone()),this._world.emit("pick",r,a,i,o),this._world.emit("pick-"+r,a,i,o)}}},{key:"add",value:function(e){this._pickingScene.add(e),this._needUpdate=!0}},{key:"remove",value:function(e){this._pickingScene.remove(e),this._needUpdate=!0}},{key:"getNextId",value:function(){return f++}},{key:"destroy",value:function(){if(window.removeEventListener("resize",this._resizeTexture,!1),this._renderer.domElement.removeEventListener("mouseup",this._onMouseUp,!1),this._world.off("move",this._onWorldMove),this._pickingScene.children)for(var e,t=this._pickingScene.children.length-1;t>=0;t--)e=this._pickingScene.children[t],e&&(this._pickingScene.remove(e),e.material&&(e.material.map&&(e.material.map.dispose(),e.material.map=null),e.material.dispose(),e.material=null));this._pickingScene=null,this._pickingTexture=null,this._pixelBuffer=null,this._world=null,this._renderer=null,this._camera=null}}]),e}();t["default"]=function(e,t,n){return new h(e,t,n)},e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i);t["default"]=function(){var e=new o["default"].Scene;return e}(),e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(31),l=r(u),c=n(3),f=r(c),h=n(24),p=r(h),d=n(32),v=r(d),y=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this);var n={skybox:!1};this._options=(0,f["default"])(n,e)}return o(t,e),a(t,[{key:"_onAdd",value:function(){this._initLights(),this._options.skybox&&this._initSkybox()}},{key:"_initLights",value:function(){if(this._options.skybox){this._skyboxLight=new p["default"].DirectionalLight(16777215,1),this._skyboxLight.castShadow=!0;
var e=1e3;this._skyboxLight.shadow.camera.left=-e,this._skyboxLight.shadow.camera.right=e,this._skyboxLight.shadow.camera.top=e,this._skyboxLight.shadow.camera.bottom=-e,this._skyboxLight.shadow.camera.near=1e4,this._skyboxLight.shadow.camera.far=7e4,this._skyboxLight.shadow.mapSize.width=2048,this._skyboxLight.shadow.mapSize.height=2048,this.add(this._skyboxLight)}else{var t=new p["default"].DirectionalLight(16777215,1);t.position.x=1e3,t.position.y=1e3,t.position.z=1e3;var n=new p["default"].DirectionalLight(16777215,.5);n.position.x=-1e3,n.position.y=1e3,n.position.z=-1e3,this.add(t),this.add(n)}}},{key:"_initSkybox",value:function(){this._skybox=new v["default"](this._world,this._skyboxLight),this.add(this._skybox._mesh)}},{key:"_initGrid",value:function(){var e=4e3,t=100,n=new p["default"].GridHelper(e,t);this.add(n)}},{key:"destroy",value:function(){this._skyboxLight=null,this.remove(this._skybox._mesh),this._skybox.destroy(),this._skybox=null,s(Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}}]),t}(l["default"]);t["default"]=y;var m=function(e){return new y(e)};t.environmentLayer=m},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(2),l=r(u),c=n(24),f=r(c),h=n(25),p=(r(h),function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this._layer=new f["default"].Object3D}return o(t,e),a(t,[{key:"add",value:function(e){this._layer.add(e)}},{key:"remove",value:function(e){this._layer.remove(e)}},{key:"addTo",value:function(e){return e.addLayer(this),this}},{key:"_addToWorld",value:function(e){this._world=e,this._onAdd(e),this.emit("added")}},{key:"getPickingId",value:function(){return this._world._engine._picking?this._world._engine._picking.getNextId():!1}},{key:"addToPicking",value:function(e){this._world._engine._picking&&this._world._engine._picking.add(e)}},{key:"removeFromPicking",value:function(e){this._world._engine._picking&&this._world._engine._picking.remove(e)}},{key:"destroy",value:function(){if(this._layer.children)for(var e,t=this._layer.children.length-1;t>=0;t--)e=this._layer.children[t],e&&(this.remove(e),e.geometry&&(e.geometry.dispose(),e.geometry=null),e.material&&(e.material.map&&(e.material.map.dispose(),e.material.map=null),e.material.dispose(),e.material=null));this._world=null,this._layer=null}}]),t}(l["default"]));t["default"]=p;var d=function(){return new p};t.layer=d},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(24),s=r(a),u=n(33),l=r(u),c=n(34),f=r(c),h={vertexShader:["varying vec3 vPosition;","void main() {","vPosition = position;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform samplerCube cubemap;","varying vec3 vPosition;","void main() {","gl_FragColor = textureCube(cubemap, normalize(vPosition));","}"].join("\n")},p=function(){function e(t,n){i(this,e),this._world=t,this._light=n,this._settings={distance:38e3,turbidity:10,reileigh:2,mieCoefficient:.005,mieDirectionalG:.8,luminance:1,inclination:.48,azimuth:.25},this._initSkybox(),this._updateUniforms(),this._initEvents()}return o(e,[{key:"_initEvents",value:function(){this._throttledWorldUpdate=(0,f["default"])(this._update,100),this._world.on("preUpdate",this._throttledWorldUpdate,this)}},{key:"_initSkybox",value:function(){this._cubeCamera=new s["default"].CubeCamera(1,2e6,128);var e=this._cubeCamera.renderTarget;this._sky=new l["default"],this._skyScene=new s["default"].Scene,this._skyScene.add(this._sky.mesh),this._sunSphere=new s["default"].Mesh(new s["default"].SphereBufferGeometry(2e3,16,8),new s["default"].MeshBasicMaterial({color:16777215}));var t={cubemap:{type:"t",value:e}},n=new s["default"].ShaderMaterial({uniforms:t,vertexShader:h.vertexShader,fragmentShader:h.fragmentShader,side:s["default"].BackSide});this._mesh=new s["default"].Mesh(new s["default"].BoxGeometry(19e4,19e4,19e4),n),this._updateSkybox=!0}},{key:"_updateUniforms",value:function(){var e=this._settings,t=this._sky.uniforms;t.turbidity.value=e.turbidity,t.reileigh.value=e.reileigh,t.luminance.value=e.luminance,t.mieCoefficient.value=e.mieCoefficient,t.mieDirectionalG.value=e.mieDirectionalG;var n=Math.PI*(e.inclination-.5),r=2*Math.PI*(e.azimuth-.5);this._sunSphere.position.x=e.distance*Math.cos(r),this._sunSphere.position.y=e.distance*Math.sin(r)*Math.sin(n),this._sunSphere.position.z=e.distance*Math.sin(r)*Math.cos(n),this._light.position.copy(this._sunSphere.position),this._sky.uniforms.sunPosition.value.copy(this._sunSphere.position)}},{key:"_update",value:function(e){this._updateSkybox&&(this._updateSkybox=!1,this._light.intensity=1-.95*(this._settings.inclination/.5),this._updateUniforms(),this._cubeCamera.updateCubeMap(this._world._engine._renderer,this._skyScene))}},{key:"getRenderTarget",value:function(){return this._cubeCamera.renderTarget}},{key:"setInclination",value:function(e){this._settings.inclination=e,this._updateSkybox=!0}},{key:"destroy",value:function(){this._world.off("preUpdate",this._throttledWorldUpdate),this._throttledWorldUpdate=null,this._world=null,this._light=null,this._cubeCamera=null,this._sky.mesh.geometry.dispose(),this._sky.mesh.geometry=null,this._sky.mesh.material.map&&(this._sky.mesh.material.map.dispose(),this._sky.mesh.material.map=null),this._sky.mesh.material.dispose(),this._sky.mesh.material=null,this._sky.mesh=null,this._sky=null,this._skyScene=null,this._sunSphere.geometry.dispose(),this._sunSphere.geometry=null,this._sunSphere.material.map&&(this._sunSphere.material.map.dispose(),this._sunSphere.material.map=null),this._sunSphere.material.dispose(),this._sunSphere.material=null,this._sunSphere=null,this._mesh.geometry.dispose(),this._mesh.geometry=null,this._mesh.material.map&&(this._mesh.material.map.dispose(),this._mesh.material.map=null),this._mesh.material.dispose(),this._mesh.material=null}}]),e}();t["default"]=p;var d=function(e,t){return new p(e,t)};t.skybox=d},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i);o["default"].ShaderLib.sky={uniforms:{luminance:{type:"f",value:1},turbidity:{type:"f",value:2},reileigh:{type:"f",value:1},mieCoefficient:{type:"f",value:.005},mieDirectionalG:{type:"f",value:.8},sunPosition:{type:"v3",value:new o["default"].Vector3}},vertexShader:["varying vec3 vWorldPosition;","void main() {","vec4 worldPosition = modelMatrix * vec4( position, 1.0 );","vWorldPosition = worldPosition.xyz;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D skySampler;","uniform vec3 sunPosition;","varying vec3 vWorldPosition;","vec3 cameraPos = vec3(0., 0., 0.);","// uniform sampler2D sDiffuse;","// const float turbidity = 10.0; //","// const float reileigh = 2.; //","// const float luminance = 1.0; //","// const float mieCoefficient = 0.005;","// const float mieDirectionalG = 0.8;","uniform float luminance;","uniform float turbidity;","uniform float reileigh;","uniform float mieCoefficient;","uniform float mieDirectionalG;","// constants for atmospheric scattering","const float e = 2.71828182845904523536028747135266249775724709369995957;","const float pi = 3.141592653589793238462643383279502884197169;","const float n = 1.0003; // refractive index of air","const float N = 2.545E25; // number of molecules per unit volume for air at","// 288.15K and 1013mb (sea level -45 celsius)","const float pn = 0.035; // depolatization factor for standard air","// wavelength of used primaries, according to preetham","const vec3 lambda = vec3(680E-9, 550E-9, 450E-9);","// mie stuff","// K coefficient for the primaries","const vec3 K = vec3(0.686, 0.678, 0.666);","const float v = 4.0;","// optical length at zenith for molecules","const float rayleighZenithLength = 8.4E3;","const float mieZenithLength = 1.25E3;","const vec3 up = vec3(0.0, 1.0, 0.0);","const float EE = 1000.0;","const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;","// 66 arc seconds -> degrees, and the cosine of that","// earth shadow hack","const float cutoffAngle = pi/1.95;","const float steepness = 1.5;","vec3 totalRayleigh(vec3 lambda)","{","return (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn));","}","// A simplied version of the total Reayleigh scattering to works on browsers that use ANGLE","vec3 simplifiedRayleigh()","{","return 0.0005 / vec3(94, 40, 18);","}","float rayleighPhase(float cosTheta)","{ ","return (3.0 / (16.0*pi)) * (1.0 + pow(cosTheta, 2.0));","// return (1.0 / (3.0*pi)) * (1.0 + pow(cosTheta, 2.0));","// return (3.0 / 4.0) * (1.0 + pow(cosTheta, 2.0));","}","vec3 totalMie(vec3 lambda, vec3 K, float T)","{","float c = (0.2 * T ) * 10E-18;","return 0.434 * c * pi * pow((2.0 * pi) / lambda, vec3(v - 2.0)) * K;","}","float hgPhase(float cosTheta, float g)","{","return (1.0 / (4.0*pi)) * ((1.0 - pow(g, 2.0)) / pow(1.0 - 2.0*g*cosTheta + pow(g, 2.0), 1.5));","}","float sunIntensity(float zenithAngleCos)","{","return EE * max(0.0, 1.0 - exp(-((cutoffAngle - acos(zenithAngleCos))/steepness)));","}","// float logLuminance(vec3 c)","// {","// return log(c.r * 0.2126 + c.g * 0.7152 + c.b * 0.0722);","// }","// Filmic ToneMapping http://filmicgames.com/archives/75","float A = 0.15;","float B = 0.50;","float C = 0.10;","float D = 0.20;","float E = 0.02;","float F = 0.30;","float W = 1000.0;","vec3 Uncharted2Tonemap(vec3 x)","{","return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;","}","void main() ","{","float sunfade = 1.0-clamp(1.0-exp((sunPosition.y/450000.0)),0.0,1.0);","// luminance = 1.0 ;// vWorldPosition.y / 450000. + 0.5; //sunPosition.y / 450000. * 1. + 0.5;","// gl_FragColor = vec4(sunfade, sunfade, sunfade, 1.0);","float reileighCoefficient = reileigh - (1.0* (1.0-sunfade));","vec3 sunDirection = normalize(sunPosition);","float sunE = sunIntensity(dot(sunDirection, up));","// extinction (absorbtion + out scattering) ","// rayleigh coefficients","vec3 betaR = simplifiedRayleigh() * reileighCoefficient;","// mie coefficients","vec3 betaM = totalMie(lambda, K, turbidity) * mieCoefficient;","// optical length","// cutoff angle at 90 to avoid singularity in next formula.","float zenithAngle = acos(max(0.0, dot(up, normalize(vWorldPosition - cameraPos))));","float sR = rayleighZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));","float sM = mieZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));","// combined extinction factor ","vec3 Fex = exp(-(betaR * sR + betaM * sM));","// in scattering","float cosTheta = dot(normalize(vWorldPosition - cameraPos), sunDirection);","float rPhase = rayleighPhase(cosTheta*0.5+0.5);","vec3 betaRTheta = betaR * rPhase;","float mPhase = hgPhase(cosTheta, mieDirectionalG);","vec3 betaMTheta = betaM * mPhase;","vec3 Lin = pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * (1.0 - Fex),vec3(1.5));","Lin *= mix(vec3(1.0),pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * Fex,vec3(1.0/2.0)),clamp(pow(1.0-dot(up, sunDirection),5.0),0.0,1.0));","//nightsky","vec3 direction = normalize(vWorldPosition - cameraPos);","float theta = acos(direction.y); // elevation --> y-axis, [-pi/2, pi/2]","float phi = atan(direction.z, direction.x); // azimuth --> x-axis [-pi/2, pi/2]","vec2 uv = vec2(phi, theta) / vec2(2.0*pi, pi) + vec2(0.5, 0.0);","// vec3 L0 = texture2D(skySampler, uv).rgb+0.1 * Fex;","vec3 L0 = vec3(0.1) * Fex;","// composition + solar disc","//if (cosTheta > sunAngularDiameterCos)","float sundisk = smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);","// if (normalize(vWorldPosition - cameraPos).y>0.0)","L0 += (sunE * 19000.0 * Fex)*sundisk;","vec3 whiteScale = 1.0/Uncharted2Tonemap(vec3(W));","vec3 texColor = (Lin+L0); ","texColor *= 0.04 ;","texColor += vec3(0.0,0.001,0.0025)*0.3;","float g_fMaxLuminance = 1.0;","float fLumScaled = 0.1 / luminance; ","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (g_fMaxLuminance * g_fMaxLuminance)))) / (1.0 + fLumScaled); ","float ExposureBias = fLumCompressed;","vec3 curr = Uncharted2Tonemap((log2(2.0/pow(luminance,4.0)))*texColor);","vec3 color = curr*whiteScale;","vec3 retColor = pow(color,vec3(1.0/(1.2+(1.2*sunfade))));","gl_FragColor.rgb = retColor;","gl_FragColor.a = 1.0;","}"].join("\n")};var a=function(){var e=o["default"].ShaderLib.sky,t=o["default"].UniformsUtils.clone(e.uniforms),n=new o["default"].ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:t,side:o["default"].BackSide}),r=new o["default"].SphereBufferGeometry(45e4,32,15),i=new o["default"].Mesh(r,n);this.mesh=i,this.uniforms=t};t["default"]=a,e.exports=t["default"]},function(e,t,n){function r(e,t,n){var r=!0,s=!0;if("function"!=typeof e)throw new TypeError(a);return i(n)&&(r="leading"in n?!!n.leading:r,s="trailing"in n?!!n.trailing:s),o(e,t,{leading:r,maxWait:t,trailing:s})}function i(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var o=n(35),a="Expected a function";e.exports=r},function(e,t){function n(e,t,n){function r(){g&&clearTimeout(g),p&&clearTimeout(p),x=0,h=p=y=g=b=void 0}function s(t,n){n&&clearTimeout(n),p=g=b=void 0,t&&(x=_(),d=e.apply(y,h),g||p||(h=y=void 0))}function u(){var e=t-(_()-v);0>=e||e>t?s(b,p):g=setTimeout(u,e)}function l(){return(g&&b||p&&O)&&(d=e.apply(y,h)),r(),d}function c(){s(O,g)}function f(){if(h=arguments,v=_(),y=this,b=O&&(g||!w),k===!1)var n=w&&!g;else{p||w||(x=v);var r=k-(v-x),i=0>=r||r>k;i?(p&&(p=clearTimeout(p)),x=v,d=e.apply(y,h)):p||(p=setTimeout(c,r))}return i&&g?g=clearTimeout(g):g||t===k||(g=setTimeout(u,t)),n&&(i=!0,d=e.apply(y,h)),!i||g||p||(h=y=void 0),d}var h,p,d,v,y,g,b,x=0,w=!1,k=!1,O=!0;if("function"!=typeof e)throw new TypeError(a);return t=o(t)||0,i(n)&&(w=!!n.leading,k="maxWait"in n&&m(o(n.maxWait)||0,t),O="trailing"in n?!!n.trailing:O),f.cancel=r,f.flush=l,f}function r(e){var t=i(e)?y.call(e):"";return t==u||t==l}function i(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function o(e){if(i(e)){var t=r(e.valueOf)?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(c,"");var n=h.test(e);return n||p.test(e)?d(e.slice(2),n?2:8):f.test(e)?s:+e}var a="Expected a function",s=NaN,u="[object Function]",l="[object GeneratorFunction]",c=/^\s+|\s+$/g,f=/^[-+]0x[0-9a-f]+$/i,h=/^0b[01]+$/i,p=/^0o[0-7]+$/i,d=parseInt,v=Object.prototype,y=v.toString,m=Math.max,_=Date.now;e.exports=n},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(37),o=r(i),a={Orbit:o["default"],orbit:i.orbit,orbit:i.orbit};t["default"]=a,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(2),l=r(u),c=n(24),f=(r(c),n(38)),h=r(f),p=function(e){function t(){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this)}return o(t,e),a(t,[{key:"_initEvents",value:function(){var e=this;this._controls.addEventListener("start",function(t){e._world.emit("controlsMoveStart",t.target.target)}),this._controls.addEventListener("change",function(t){e._world.emit("controlsMove",t.target.target)}),this._controls.addEventListener("end",function(t){e._world.emit("controlsMoveEnd",t.target.target)})}},{key:"_panTo",value:function(e,t){}},{key:"_panBy",value:function(e,t){}},{key:"_zoomTo",value:function(e,t){}},{key:"_zoomBy",value:function(e,t){}},{key:"_lookAt",value:function(e,t){}},{key:"_lookAtTarget",value:function(){}},{key:"_tiltTo",value:function(e,t){}},{key:"_tiltBy",value:function(e,t){}},{key:"_rotateTo",value:function(e,t){}},{key:"_rotateBy",value:function(e,t){}},{key:"_flyTo",value:function(e,t){}},{key:"update",value:function(){this._controls.update()}},{key:"addTo",value:function(e){return e.addControls(this),this}},{key:"_addToWorld",value:function(e){this._world=e,this._controls=new h["default"](e._engine._camera,e._container),this._controls.keys=!1,this._controls.maxPolarAngle=1.5533,this._initEvents(),this.emit("added")}},{key:"destroy",value:function(){this._controls.dispose(),this._world=null,this._controls=null}}]),t}(l["default"]);t["default"]=p;var d=function(){return new p};t.orbit=d},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i),a=n(39),s=r(a),u=function(e,t){function n(){return 2*Math.PI/60/60*z.autoRotateSpeed}function r(){return Math.pow(.95,z.zoomSpeed)}function i(e){V-=e}function a(e){B-=e}function u(e){z.object instanceof o["default"].PerspectiveCamera?G/=e:z.object instanceof o["default"].OrthographicCamera?(z.object.zoom=Math.max(z.minZoom,Math.min(z.maxZoom,z.object.zoom*e)),z.object.updateProjectionMatrix(),X=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),z.enableZoom=!1)}function l(e){z.object instanceof o["default"].PerspectiveCamera?G*=e:z.object instanceof o["default"].OrthographicCamera?(z.object.zoom=Math.max(z.minZoom,Math.min(z.maxZoom,z.object.zoom/e)),z.object.updateProjectionMatrix(),X=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),z.enableZoom=!1)}function c(e){Y.set(e.clientX,e.clientY)}function f(e){te.set(e.clientX,e.clientY)}function h(e){$.set(e.clientX,e.clientY)}function p(e){J.set(e.clientX,e.clientY),K.subVectors(J,Y);var t=z.domElement===document?z.domElement.body:z.domElement;i(2*Math.PI*K.x/t.clientWidth*z.rotateSpeed),a(2*Math.PI*K.y/t.clientHeight*z.rotateSpeed),Y.copy(J),z.update()}function d(e){ne.set(e.clientX,e.clientY),re.subVectors(ne,te),re.y>0?u(r()):re.y<0&&l(r()),te.copy(ne),z.update()}function v(e){Q.set(e.clientX,e.clientY),ee.subVectors(Q,$),ae(ee.x,ee.y),$.copy(Q),z.update()}function y(e){}function m(e){var t=0;void 0!==e.wheelDelta?t=e.wheelDelta:void 0!==e.detail&&(t=-e.detail),t>0?l(r()):0>t&&u(r()),z.update()}function _(e){switch(e.keyCode){case z.keys.UP:ae(0,z.keyPanSpeed),z.update();break;case z.keys.BOTTOM:ae(0,-z.keyPanSpeed),z.update();break;case z.keys.LEFT:ae(z.keyPanSpeed,0),z.update();break;case z.keys.RIGHT:ae(-z.keyPanSpeed,0),z.update()}}function g(e){Y.set(e.pointers[0].pageX,e.pointers[0].pageY)}function b(e){var t=e.pointers[0].pageX-e.pointers[1].pageX,n=e.pointers[0].pageY-e.pointers[1].pageY,r=Math.sqrt(t*t+n*n);te.set(0,r)}function x(e){$.set(e.deltaX,e.deltaY)}function w(e){J.set(e.pointers[0].pageX,e.pointers[0].pageY),K.subVectors(J,Y);var t=z.domElement===document?z.domElement.body:z.domElement;i(2*Math.PI*K.x/t.clientWidth*z.rotateSpeed),a(2*Math.PI*K.y/t.clientHeight*z.rotateSpeed),Y.copy(J),z.update()}function k(e){var t=e.pointers[0].pageX-e.pointers[1].pageX,n=e.pointers[0].pageY-e.pointers[1].pageY,i=Math.sqrt(t*t+n*n);ne.set(0,i),re.subVectors(ne,te),re.y>0?l(r()):re.y<0&&u(r()),te.copy(ne),z.update()}function O(e){Q.set(e.deltaX,e.deltaY),ee.subVectors(Q,$),ae(ee.x,ee.y),$.copy(Q),z.update()}function E(e){}function M(e){if(z.enabled!==!1){if(e.preventDefault(),e.button===z.mouseButtons.ORBIT){if(z.enableRotate===!1)return;c(e),H=W.ROTATE}else if(e.button===z.mouseButtons.ZOOM){if(z.enableZoom===!1)return;f(e),H=W.DOLLY}else if(e.button===z.mouseButtons.PAN){if(z.enablePan===!1)return;h(e),H=W.PAN}H!==W.NONE&&(document.addEventListener("mousemove",T,!1),document.addEventListener("mouseup",P,!1),document.addEventListener("mouseout",P,!1),z.dispatchEvent(N))}}function T(e){if(z.enabled!==!1)if(e.preventDefault(),H===W.ROTATE){if(z.enableRotate===!1)return;p(e)}else if(H===W.DOLLY){if(z.enableZoom===!1)return;d(e)}else if(H===W.PAN){if(z.enablePan===!1)return;v(e)}}function P(e){z.enabled!==!1&&(y(e),document.removeEventListener("mousemove",T,!1),document.removeEventListener("mouseup",P,!1),document.removeEventListener("mouseout",P,!1),z.dispatchEvent(q),H=W.NONE)}function j(e){z.enabled!==!1&&z.enableZoom!==!1&&H===W.NONE&&(e.preventDefault(),e.stopPropagation(),m(e),z.dispatchEvent(N),z.dispatchEvent(q))}function S(e){z.enabled!==!1&&z.enableKeys!==!1&&z.enablePan!==!1&&_(e)}function L(e){if(z.enabled!==!1){switch(e.touches.length){case 1:if(z.enableRotate===!1)return;g(e),H=W.TOUCH_ROTATE;break;case 2:if(z.enableZoom===!1)return;b(e),H=W.TOUCH_DOLLY;break;case 3:if(z.enablePan===!1)return;x(e),H=W.TOUCH_PAN;break;default:H=W.NONE}H!==W.NONE&&z.dispatchEvent(N)}}function C(e){if(z.enabled!==!1)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(z.enableRotate===!1)return;if(H!==W.TOUCH_ROTATE)return;w(e);break;case 2:if(z.enableZoom===!1)return;if(H!==W.TOUCH_DOLLY)return;k(e);break;case 3:if(z.enablePan===!1)return;if(H!==W.TOUCH_PAN)return;O(e);break;default:H=W.NONE}}function A(e){z.enabled!==!1&&(E(e),z.dispatchEvent(q),H=W.NONE)}function R(e){e.preventDefault()}this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new o["default"].Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-(1/0),this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:o["default"].MOUSE.LEFT,ZOOM:o["default"].MOUSE.MIDDLE,PAN:o["default"].MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return I},this.getAzimuthalAngle=function(){return D},this.reset=function(){z.target.copy(z.target0),z.object.position.copy(z.position0),z.object.zoom=z.zoom0,z.object.updateProjectionMatrix(),z.dispatchEvent(F),z.update(),H=W.NONE},this.update=function(){var t=new o["default"].Vector3,r=(new o["default"].Quaternion).setFromUnitVectors(e.up,new o["default"].Vector3(0,1,0)),a=r.clone().inverse(),s=new o["default"].Vector3,u=new o["default"].Quaternion;return function(){var e=z.object.position;t.copy(e).sub(z.target),t.applyQuaternion(r),D=Math.atan2(t.x,t.z),I=Math.atan2(Math.sqrt(t.x*t.x+t.z*t.z),t.y),z.autoRotate&&H===W.NONE&&i(n()),D+=V,I+=B,D=Math.max(z.minAzimuthAngle,Math.min(z.maxAzimuthAngle,D)),I=Math.max(z.minPolarAngle,Math.min(z.maxPolarAngle,I)),I=Math.max(U,Math.min(Math.PI-U,I));var o=t.length()*G;return o=Math.max(z.minDistance,Math.min(z.maxDistance,o)),z.target.add(Z),t.x=o*Math.sin(I)*Math.sin(D),t.y=o*Math.cos(I),t.z=o*Math.sin(I)*Math.cos(D),t.applyQuaternion(a),e.copy(z.target).add(t),z.object.lookAt(z.target),z.enableDamping===!0?(V*=1-z.dampingFactor,B*=1-z.dampingFactor):(V=0,B=0),G=1,Z.set(0,0,0),X||s.distanceToSquared(z.object.position)>U||8*(1-u.dot(z.object.quaternion))>U?(z.dispatchEvent(F),s.copy(z.object.position),u.copy(z.object.quaternion),X=!1,!0):!1}}(),this.dispose=function(){z.domElement.removeEventListener("contextmenu",R,!1),z.domElement.removeEventListener("mousedown",M,!1),z.domElement.removeEventListener("mousewheel",j,!1),z.domElement.removeEventListener("MozMousePixelScroll",j,!1),z.domElement.removeEventListener("touchstart",L,!1),z.domElement.removeEventListener("touchend",A,!1),z.domElement.removeEventListener("touchmove",C,!1),document.removeEventListener("mousemove",T,!1),document.removeEventListener("mouseup",P,!1),document.removeEventListener("mouseout",P,!1),window.removeEventListener("keydown",S,!1)};var D,I,z=this,F={type:"change"},N={type:"start"},q={type:"end"},W={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},H=W.NONE,U=1e-6,B=0,V=0,G=1,Z=new o["default"].Vector3,X=!1,Y=new o["default"].Vector2,J=new o["default"].Vector2,K=new o["default"].Vector2,$=new o["default"].Vector2,Q=new o["default"].Vector2,ee=new o["default"].Vector2,te=new o["default"].Vector2,ne=new o["default"].Vector2,re=new o["default"].Vector2,ie=function(){var e=new o["default"].Vector3;return function(t,n){var r=n.elements;e.set(r[0],0,r[2]),e.multiplyScalar(-t),Z.add(e)}}(),oe=function(){var e=new o["default"].Vector3;return function(t,n){var r=n.elements,i=t/Math.cos(I);e.set(r[4],0,r[6]),e.multiplyScalar(i),Z.add(e)}}(),ae=function(){var e=new o["default"].Vector3;return function(t,n){var r=z.domElement===document?z.domElement.body:z.domElement;if(z.object instanceof o["default"].PerspectiveCamera){var i=z.object.position;e.copy(i).sub(z.target);var a=e.length();a*=Math.tan(z.object.fov/2*Math.PI/180),ie(2*t*a/r.clientHeight,z.object.matrix),oe(2*n*a/r.clientHeight,z.object.matrix)}else z.object instanceof o["default"].OrthographicCamera?(ie(t*(z.object.right-z.object.left)/r.clientWidth,z.object.matrix),oe(n*(z.object.top-z.object.bottom)/r.clientHeight,z.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),z.enablePan=!1)}}();z.domElement.addEventListener("contextmenu",R,!1),z.domElement.addEventListener("mousedown",M,!1),z.domElement.addEventListener("mousewheel",j,!1),z.domElement.addEventListener("MozMousePixelScroll",j,!1),z.hammer=new s["default"](z.domElement),z.hammer.get("pan").set({pointers:0,direction:s["default"].DIRECTION_ALL}),z.hammer.get("pinch").set({enable:!0,threshold:.1}),z.hammer.on("panstart",function(e){if(z.enabled!==!1&&"mouse"!==e.pointerType){if(1===e.pointers.length){if(z.enablePan===!1)return;x(e),H=W.TOUCH_PAN}else if(2===e.pointers.length){if(z.enableRotate===!1)return;g(e),H=W.TOUCH_ROTATE}H!==W.NONE&&z.dispatchEvent(N)}}),z.hammer.on("panend",function(e){"mouse"!==e.pointerType&&A(e)}),z.hammer.on("panmove",function(e){if(z.enabled!==!1&&"mouse"!==e.pointerType)if(1===e.pointers.length){if(z.enablePan===!1)return;if(H!==W.TOUCH_PAN)return;O(e)}else if(2===e.pointers.length){if(z.enableRotate===!1)return;if(H!==W.TOUCH_ROTATE)return;w(e)}}),z.hammer.on("pinchstart",function(e){z.enabled!==!1&&"mouse"!==e.pointerType&&z.enableZoom!==!1&&(b(e),H=W.TOUCH_DOLLY,H!==W.NONE&&z.dispatchEvent(N))}),z.hammer.on("pinchend",function(e){"mouse"!==e.pointerType&&A(e)}),z.hammer.on("pinchmove",function(e){z.enabled!==!1&&"mouse"!==e.pointerType&&z.enableZoom!==!1&&H===W.TOUCH_DOLLY&&k(e)}),window.addEventListener("keydown",S,!1),this.update()};u.prototype=Object.create(o["default"].EventDispatcher.prototype),u.prototype.constructor=o["default"].OrbitControls,Object.defineProperties(u.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.constraint.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.constraint.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.constraint.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.constraint.dampingFactor=e}}}),t["default"]=u,e.exports=t["default"]},function(e,t,n){var r;!function(i,o,a,s){"use strict";function u(e,t,n){return setTimeout(p(e,n),t)}function l(e,t,n){return Array.isArray(e)?(c(e,n[t],n),!0):!1}function c(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==s)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function f(e,t,n){var r="DEPRECATED METHOD: "+t+"\n"+n+" AT \n";return function(){var t=new Error("get-stack-trace"),n=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=i.console&&(i.console.warn||i.console.log);return o&&o.call(i.console,r,n),e.apply(this,arguments)}}function h(e,t,n){var r,i=t.prototype;r=e.prototype=Object.create(i),r.constructor=e,r._super=i,n&&fe(r,n)}function p(e,t){return function(){return e.apply(t,arguments)}}function d(e,t){return typeof e==de?e.apply(t?t[0]||s:s,t):e}function v(e,t){return e===s?t:e}function y(e,t,n){c(b(t),function(t){e.addEventListener(t,n,!1)})}function m(e,t,n){c(b(t),function(t){e.removeEventListener(t,n,!1)})}function _(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1;
}function g(e,t){return e.indexOf(t)>-1}function b(e){return e.trim().split(/\s+/g)}function x(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function w(e){return Array.prototype.slice.call(e,0)}function k(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var a=t?e[o][t]:e[o];x(i,a)<0&&r.push(e[o]),i[o]=a,o++}return n&&(r=t?r.sort(function(e,n){return e[t]>n[t]}):r.sort()),r}function O(e,t){for(var n,r,i=t[0].toUpperCase()+t.slice(1),o=0;o<he.length;){if(n=he[o],r=n?n+i:t,r in e)return r;o++}return s}function E(){return be++}function M(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow||i}function T(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){d(e.options.enable,[e])&&n.handler(t)},this.init()}function P(e){var t,n=e.options.inputClass;return new(t=n?n:ke?H:Oe?V:we?Z:W)(e,j)}function j(e,t,n){var r=n.pointers.length,i=n.changedPointers.length,o=t&Se&&r-i===0,a=t&(Ce|Ae)&&r-i===0;n.isFirst=!!o,n.isFinal=!!a,o&&(e.session={}),n.eventType=t,S(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function S(e,t){var n=e.session,r=t.pointers,i=r.length;n.firstInput||(n.firstInput=A(t)),i>1&&!n.firstMultiple?n.firstMultiple=A(t):1===i&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,s=a?a.center:o.center,u=t.center=R(r);t.timeStamp=me(),t.deltaTime=t.timeStamp-o.timeStamp,t.angle=F(s,u),t.distance=z(s,u),L(n,t),t.offsetDirection=I(t.deltaX,t.deltaY);var l=D(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=l.x,t.overallVelocityY=l.y,t.overallVelocity=ye(l.x)>ye(l.y)?l.x:l.y,t.scale=a?q(a.pointers,r):1,t.rotation=a?N(a.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,C(n,t);var c=e.element;_(t.srcEvent.target,c)&&(c=t.srcEvent.target),t.target=c}function L(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};(t.eventType===Se||o.eventType===Ce)&&(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}function C(e,t){var n,r,i,o,a=e.lastInterval||t,u=t.timeStamp-a.timeStamp;if(t.eventType!=Ae&&(u>je||a.velocity===s)){var l=t.deltaX-a.deltaX,c=t.deltaY-a.deltaY,f=D(u,l,c);r=f.x,i=f.y,n=ye(f.x)>ye(f.y)?f.x:f.y,o=I(l,c),e.lastInterval=t}else n=a.velocity,r=a.velocityX,i=a.velocityY,o=a.direction;t.velocity=n,t.velocityX=r,t.velocityY=i,t.direction=o}function A(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:ve(e.pointers[n].clientX),clientY:ve(e.pointers[n].clientY)},n++;return{timeStamp:me(),pointers:t,center:R(t),deltaX:e.deltaX,deltaY:e.deltaY}}function R(e){var t=e.length;if(1===t)return{x:ve(e[0].clientX),y:ve(e[0].clientY)};for(var n=0,r=0,i=0;t>i;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:ve(n/t),y:ve(r/t)}}function D(e,t,n){return{x:t/e||0,y:n/e||0}}function I(e,t){return e===t?Re:ye(e)>=ye(t)?0>e?De:Ie:0>t?ze:Fe}function z(e,t,n){n||(n=He);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function F(e,t,n){n||(n=He);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}function N(e,t){return F(t[1],t[0],Ue)+F(e[1],e[0],Ue)}function q(e,t){return z(t[0],t[1],Ue)/z(e[0],e[1],Ue)}function W(){this.evEl=Ve,this.evWin=Ge,this.allow=!0,this.pressed=!1,T.apply(this,arguments)}function H(){this.evEl=Ye,this.evWin=Je,T.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function U(){this.evTarget=$e,this.evWin=Qe,this.started=!1,T.apply(this,arguments)}function B(e,t){var n=w(e.touches),r=w(e.changedTouches);return t&(Ce|Ae)&&(n=k(n.concat(r),"identifier",!0)),[n,r]}function V(){this.evTarget=tt,this.targetIds={},T.apply(this,arguments)}function G(e,t){var n=w(e.touches),r=this.targetIds;if(t&(Se|Le)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=w(e.changedTouches),s=[],u=this.target;if(o=n.filter(function(e){return _(e.target,u)}),t===Se)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<a.length;)r[a[i].identifier]&&s.push(a[i]),t&(Ce|Ae)&&delete r[a[i].identifier],i++;return s.length?[k(o.concat(s),"identifier",!0),s]:void 0}function Z(){T.apply(this,arguments);var e=p(this.handler,this);this.touch=new V(this.manager,e),this.mouse=new W(this.manager,e)}function X(e,t){this.manager=e,this.set(t)}function Y(e){if(g(e,st))return st;var t=g(e,ut),n=g(e,lt);return t&&n?st:t||n?t?ut:lt:g(e,at)?at:ot}function J(e){this.options=fe({},this.defaults,e||{}),this.id=E(),this.manager=null,this.options.enable=v(this.options.enable,!0),this.state=ct,this.simultaneous={},this.requireFail=[]}function K(e){return e&vt?"cancel":e&pt?"end":e&ht?"move":e&ft?"start":""}function $(e){return e==Fe?"down":e==ze?"up":e==De?"left":e==Ie?"right":""}function Q(e,t){var n=t.manager;return n?n.get(e):e}function ee(){J.apply(this,arguments)}function te(){ee.apply(this,arguments),this.pX=null,this.pY=null}function ne(){ee.apply(this,arguments)}function re(){J.apply(this,arguments),this._timer=null,this._input=null}function ie(){ee.apply(this,arguments)}function oe(){ee.apply(this,arguments)}function ae(){J.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function se(e,t){return t=t||{},t.recognizers=v(t.recognizers,se.defaults.preset),new ue(e,t)}function ue(e,t){this.options=fe({},se.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.element=e,this.input=P(this),this.touchAction=new X(this,this.options.touchAction),le(this,!0),c(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}function le(e,t){var n=e.element;n.style&&c(e.options.cssProps,function(e,r){n.style[O(n.style,r)]=t?e:""})}function ce(e,t){var n=o.createEvent("Event");n.initEvent(e,!0,!0),n.gesture=t,t.target.dispatchEvent(n)}var fe,he=["","webkit","Moz","MS","ms","o"],pe=o.createElement("div"),de="function",ve=Math.round,ye=Math.abs,me=Date.now;fe="function"!=typeof Object.assign?function(e){if(e===s||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==s&&null!==r)for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])}return t}:Object.assign;var _e=f(function(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;)(!n||n&&e[r[i]]===s)&&(e[r[i]]=t[r[i]]),i++;return e},"extend","Use `assign`."),ge=f(function(e,t){return _e(e,t,!0)},"merge","Use `assign`."),be=1,xe=/mobile|tablet|ip(ad|hone|od)|android/i,we="ontouchstart"in i,ke=O(i,"PointerEvent")!==s,Oe=we&&xe.test(navigator.userAgent),Ee="touch",Me="pen",Te="mouse",Pe="kinect",je=25,Se=1,Le=2,Ce=4,Ae=8,Re=1,De=2,Ie=4,ze=8,Fe=16,Ne=De|Ie,qe=ze|Fe,We=Ne|qe,He=["x","y"],Ue=["clientX","clientY"];T.prototype={handler:function(){},init:function(){this.evEl&&y(this.element,this.evEl,this.domHandler),this.evTarget&&y(this.target,this.evTarget,this.domHandler),this.evWin&&y(M(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(M(this.element),this.evWin,this.domHandler)}};var Be={mousedown:Se,mousemove:Le,mouseup:Ce},Ve="mousedown",Ge="mousemove mouseup";h(W,T,{handler:function(e){var t=Be[e.type];t&Se&&0===e.button&&(this.pressed=!0),t&Le&&1!==e.which&&(t=Ce),this.pressed&&this.allow&&(t&Ce&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:Te,srcEvent:e}))}});var Ze={pointerdown:Se,pointermove:Le,pointerup:Ce,pointercancel:Ae,pointerout:Ae},Xe={2:Ee,3:Me,4:Te,5:Pe},Ye="pointerdown",Je="pointermove pointerup pointercancel";i.MSPointerEvent&&!i.PointerEvent&&(Ye="MSPointerDown",Je="MSPointerMove MSPointerUp MSPointerCancel"),h(H,T,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=Ze[r],o=Xe[e.pointerType]||e.pointerType,a=o==Ee,s=x(t,e.pointerId,"pointerId");i&Se&&(0===e.button||a)?0>s&&(t.push(e),s=t.length-1):i&(Ce|Ae)&&(n=!0),0>s||(t[s]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var Ke={touchstart:Se,touchmove:Le,touchend:Ce,touchcancel:Ae},$e="touchstart",Qe="touchstart touchmove touchend touchcancel";h(U,T,{handler:function(e){var t=Ke[e.type];if(t===Se&&(this.started=!0),this.started){var n=B.call(this,e,t);t&(Ce|Ae)&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:Ee,srcEvent:e})}}});var et={touchstart:Se,touchmove:Le,touchend:Ce,touchcancel:Ae},tt="touchstart touchmove touchend touchcancel";h(V,T,{handler:function(e){var t=et[e.type],n=G.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:Ee,srcEvent:e})}}),h(Z,T,{handler:function(e,t,n){var r=n.pointerType==Ee,i=n.pointerType==Te;if(r)this.mouse.allow=!1;else if(i&&!this.mouse.allow)return;t&(Ce|Ae)&&(this.mouse.allow=!0),this.callback(e,t,n)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var nt=O(pe.style,"touchAction"),rt=nt!==s,it="compute",ot="auto",at="manipulation",st="none",ut="pan-x",lt="pan-y";X.prototype={set:function(e){e==it&&(e=this.compute()),rt&&this.manager.element.style&&(this.manager.element.style[nt]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return c(this.manager.recognizers,function(t){d(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),Y(e.join(" "))},preventDefaults:function(e){if(!rt){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)return void t.preventDefault();var r=this.actions,i=g(r,st),o=g(r,lt),a=g(r,ut);if(i){var s=1===e.pointers.length,u=e.distance<2,l=e.deltaTime<250;if(s&&u&&l)return}if(!a||!o)return i||o&&n&Ne||a&&n&qe?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var ct=1,ft=2,ht=4,pt=8,dt=pt,vt=16,yt=32;J.prototype={defaults:{},set:function(e){return fe(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(l(e,"recognizeWith",this))return this;var t=this.simultaneous;return e=Q(e,this),t[e.id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return l(e,"dropRecognizeWith",this)?this:(e=Q(e,this),delete this.simultaneous[e.id],this)},requireFailure:function(e){if(l(e,"requireFailure",this))return this;var t=this.requireFail;return e=Q(e,this),-1===x(t,e)&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(l(e,"dropRequireFailure",this))return this;e=Q(e,this);var t=x(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){function t(t){n.manager.emit(t,e)}var n=this,r=this.state;pt>r&&t(n.options.event+K(r)),t(n.options.event),e.additionalEvent&&t(e.additionalEvent),r>=pt&&t(n.options.event+K(r))},tryEmit:function(e){return this.canEmit()?this.emit(e):void(this.state=yt)},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(this.requireFail[e].state&(yt|ct)))return!1;e++}return!0},recognize:function(e){var t=fe({},e);return d(this.options.enable,[this,t])?(this.state&(dt|vt|yt)&&(this.state=ct),this.state=this.process(t),void(this.state&(ft|ht|pt|vt)&&this.tryEmit(t))):(this.reset(),void(this.state=yt))},process:function(e){},getTouchAction:function(){},reset:function(){}},h(ee,J,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=t&(ft|ht),i=this.attrTest(e);return r&&(n&Ae||!i)?t|vt:r||i?n&Ce?t|pt:t&ft?t|ht:ft:yt}}),h(te,ee,{defaults:{event:"pan",threshold:10,pointers:1,direction:We},getTouchAction:function(){var e=this.options.direction,t=[];return e&Ne&&t.push(lt),e&qe&&t.push(ut),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,a=e.deltaY;return i&t.direction||(t.direction&Ne?(i=0===o?Re:0>o?De:Ie,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===a?Re:0>a?ze:Fe,n=a!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return ee.prototype.attrTest.call(this,e)&&(this.state&ft||!(this.state&ft)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=$(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),h(ne,ee,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[st]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&ft)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),h(re,J,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ot]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||e.eventType&(Ce|Ae)&&!i)this.reset();else if(e.eventType&Se)this.reset(),this._timer=u(function(){this.state=dt,this.tryEmit()},t.time,this);else if(e.eventType&Ce)return dt;return yt},reset:function(){clearTimeout(this._timer)},emit:function(e){this.state===dt&&(e&&e.eventType&Ce?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=me(),this.manager.emit(this.options.event,this._input)))}}),h(ie,ee,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[st]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&ft)}}),h(oe,ee,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Ne|qe,pointers:1},getTouchAction:function(){return te.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(Ne|qe)?t=e.overallVelocity:n&Ne?t=e.overallVelocityX:n&qe&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&ye(t)>this.options.velocity&&e.eventType&Ce},emit:function(e){var t=$(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),h(ae,J,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[at]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),e.eventType&Se&&0===this.count)return this.failTimeout();if(r&&i&&n){if(e.eventType!=Ce)return this.failTimeout();var o=this.pTime?e.timeStamp-this.pTime<t.interval:!0,a=!this.pCenter||z(this.pCenter,e.center)<t.posThreshold;this.pTime=e.timeStamp,this.pCenter=e.center,a&&o?this.count+=1:this.count=1,this._input=e;var s=this.count%t.taps;if(0===s)return this.hasRequireFailures()?(this._timer=u(function(){this.state=dt,this.tryEmit()},t.interval,this),ft):dt}return yt},failTimeout:function(){return this._timer=u(function(){this.state=yt},this.options.interval,this),yt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==dt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),se.VERSION="2.0.6",se.defaults={domEvents:!1,touchAction:it,enable:!0,inputTarget:null,inputClass:null,preset:[[ie,{enable:!1}],[ne,{enable:!1},["rotate"]],[oe,{direction:Ne}],[te,{direction:Ne},["swipe"]],[ae],[ae,{event:"doubletap",taps:2},["tap"]],[re]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var mt=1,_t=2;ue.prototype={set:function(e){return fe(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?_t:mt},recognize:function(e){var t=this.session;if(!t.stopped){this.touchAction.preventDefaults(e);var n,r=this.recognizers,i=t.curRecognizer;(!i||i&&i.state&dt)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],t.stopped===_t||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&n.state&(ft|ht|pt)&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof J)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(l(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(l(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=x(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){var n=this.handlers;return c(b(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this},off:function(e,t){var n=this.handlers;return c(b(e),function(e){t?n[e]&&n[e].splice(x(n[e],t),1):delete n[e]}),this},emit:function(e,t){this.options.domEvents&&ce(e,t);var n=this.handlers[e]&&this.handlers[e].slice();if(n&&n.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](t),r++}},destroy:function(){this.element&&le(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},fe(se,{INPUT_START:Se,INPUT_MOVE:Le,INPUT_END:Ce,INPUT_CANCEL:Ae,STATE_POSSIBLE:ct,STATE_BEGAN:ft,STATE_CHANGED:ht,STATE_ENDED:pt,STATE_RECOGNIZED:dt,STATE_CANCELLED:vt,STATE_FAILED:yt,DIRECTION_NONE:Re,DIRECTION_LEFT:De,DIRECTION_RIGHT:Ie,DIRECTION_UP:ze,DIRECTION_DOWN:Fe,DIRECTION_HORIZONTAL:Ne,DIRECTION_VERTICAL:qe,DIRECTION_ALL:We,Manager:ue,Input:T,TouchAction:X,TouchInput:V,MouseInput:W,PointerEventInput:H,TouchMouseInput:Z,SingleTouchInput:U,Recognizer:J,AttrRecognizer:ee,Tap:ae,Pan:te,Swipe:oe,Pinch:ne,Rotate:ie,Press:re,on:y,off:m,each:c,merge:ge,extend:_e,assign:fe,inherit:h,bindFn:p,prefixed:O});var gt="undefined"!=typeof i?i:"undefined"!=typeof self?self:{};gt.Hammer=se,r=function(){return se}.call(t,n,t,e),!(r!==s&&(e.exports=r))}(window,document,"Hammer")},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(41),l=r(u),c=n(51),f=r(c),h=n(54),p=r(h),d=n(34),v=r(d),y=n(24),m=r(y),_=n(3),g=r(_),b=function(e){function t(e,n){i(this,t);var r={distance:4e4};n=(0,g["default"])({},r,n),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,n),this._path=e}return o(t,e),a(t,[{key:"_onAdd",value:function(e){var n=this;s(Object.getPrototypeOf(t.prototype),"_onAdd",this).call(this,e);var r,i=new m["default"].PlaneBufferGeometry(2e5,2e5,1);r=this._world._environment._skybox?(0,p["default"])("#f5f5f3",this._world._environment._skybox.getRenderTarget()):(0,p["default"])("#f5f5f3");var o=new m["default"].Mesh(i,r);o.renderOrder=0,o.rotation.x=-90*Math.PI/180,o.receiveShadow=!0,this._baseLayer=o,this.add(o),setTimeout(function(){n._calculateLOD(),n._initEvents()},0)}},{key:"_initEvents",value:function(){this._throttledWorldUpdate=(0,v["default"])(this._onWorldUpdate,100),this._world.on("preUpdate",this._throttledWorldUpdate,this),this._world.on("move",this._onWorldMove,this)}},{key:"_onWorldUpdate",value:function(){this._calculateLOD(),this._outputTiles()}},{key:"_onWorldMove",value:function(e,t){this._moveBaseLayer(t)}},{key:"_moveBaseLayer",value:function(e){this._baseLayer.position.x=e.x,this._baseLayer.position.z=e.y}},{key:"_createTile",value:function(e,t){return new f["default"](e,this._path,t)}},{key:"destroy",value:function(){this._world.off("preUpdate",this._throttledWorldUpdate),this._world.off("move",this._onWorldMove),this._throttledWorldUpdate=null,this._baseLayer.geometry.dispose(),this._baseLayer.geometry=null,this._baseLayer.material.map&&(this._baseLayer.material.map.dispose(),this._baseLayer.material.map=null),this._baseLayer.material.dispose(),this._baseLayer.material=null,this._baseLayer=null,s(Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}}]),t}(l["default"]);t["default"]=b;var x=function(e,t){return new b(e,t)};t.imageTileLayer=x},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(31),l=r(u),c=n(3),f=r(c),h=n(42),p=r(h),d=n(24),v=r(d),y=function(e){function t(e){var n=this;i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e);var r={picking:!1,maxCache:1e3,maxLOD:18};this._options=(0,f["default"])({},r,e),this._tileCache=new p["default"](this._options.maxCache,function(e){n._destroyTile(e)}),this._tileList=[],this._minLOD=3,this._maxLOD=this._options.maxLOD,this._frustum=new v["default"].Frustum,this._tiles=new v["default"].Object3D,this._tilesPicking=new v["default"].Object3D}return o(t,e),a(t,[{key:"_onAdd",value:function(e){this.addToPicking(this._tilesPicking),this.add(this._tiles)}},{key:"_updateFrustum",value:function(){var e=this._world.getCamera(),t=new v["default"].Matrix4;t.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromMatrix(e.projectionMatrix),this._frustum.setFromMatrix((new v["default"].Matrix4).multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse))}},{key:"_tileInFrustum",value:function(e){var t=e.getBounds();return this._frustum.intersectsBox(new v["default"].Box3(new v["default"].Vector3(t[0],0,t[3]),new v["default"].Vector3(t[2],0,t[1])))}},{key:"_outputTiles",value:function(){var e=this;this._tiles&&(this._removeTiles(),this._tileList.forEach(function(t){t.isReady()&&(e._tiles.add(t.getMesh()),t.getPickingMesh()&&e._tilesPicking.add(t.getPickingMesh()))}))}},{key:"_calculateLOD",value:function(){var e=this;if(!this._stop&&this._world){var t=this._world.getCamera();this._updateFrustum(this._frustum,t);var n=this._checklist;n=[],n.push(this._requestTile("0",this)),n.push(this._requestTile("1",this)),n.push(this._requestTile("2",this)),n.push(this._requestTile("3",this)),this._divide(n),this._tileList=n.filter(function(n,r){if(!e._tileInFrustum(n))return!1;if(e._options.distance&&e._options.distance>0){var i=n.getCenter(),o=new v["default"].Vector3(i[0],0,i[1]).sub(t.position).length();if(o>e._options.distance)return!1}return n.getMesh()||n.requestTileAsync(),!0})}}},{key:"_divide",value:function(e){for(var t,n,r=0;r!=e.length;)t=e[r],n=t.getQuadcode(),t.length!==this._maxLOD&&this._screenSpaceError(t)?(e.splice(r,1),e.push(this._requestTile(n+"0",this)),e.push(this._requestTile(n+"1",this)),e.push(this._requestTile(n+"2",this)),e.push(this._requestTile(n+"3",this))):r++}},{key:"_screenSpaceError",value:function(e){var t=this._minLOD,n=this._maxLOD,r=e.getQuadcode(),i=this._world.getCamera(),o=3;if(r.length===n)return!1;if(r.length<t)return!0;if(!this._tileInFrustum(e))return!1;var a=e.getCenter(),s=new v["default"].Vector3(a[0],0,a[1]).sub(i.position).length(),u=o*e.getSide()/s;return u>1}},{key:"_removeTiles",value:function(){if(this._tiles&&this._tiles.children){for(var e=this._tiles.children.length-1;e>=0;e--)this._tiles.remove(this._tiles.children[e]);if(this._tilesPicking&&this._tilesPicking.children)for(var e=this._tilesPicking.children.length-1;e>=0;e--)this._tilesPicking.remove(this._tilesPicking.children[e])}}},{key:"_createTile",value:function(e,t){}},{key:"_requestTile",value:function(e,t){var n=this._tileCache.getTile(e);return n||(n=this._createTile(e,t),this._tileCache.setTile(e,n)),n}},{key:"_destroyTile",value:function(e){this._tiles.remove(e.getMesh()),e.destroy()}},{key:"destroy",value:function(){if(this._tiles.children)for(var e=this._tiles.children.length-1;e>=0;e--)this._tiles.remove(this._tiles.children[e]);if(this.removeFromPicking(this._tilesPicking),this._tilesPicking.children)for(var e=this._tilesPicking.children.length-1;e>=0;e--)this._tilesPicking.remove(this._tilesPicking.children[e]);this._tileCache.destroy(),this._tileCache=null,this._tiles=null,this._tilesPicking=null,this._frustum=null,s(Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}}]),t}(l["default"]);t["default"]=y,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(43),s=r(a),u=function(){function e(t,n){i(this,e),this._cache=(0,s["default"])({max:t,dispose:function(e,t){n(t)}})}return o(e,[{key:"isReady",value:function(){return!1}},{key:"getTile",value:function(e){return this._cache.get(e)}},{key:"setTile",value:function(e,t){this._cache.set(e,t)}},{key:"destroy",value:function(){this._cache.reset(),this._cache=null}}]),e}();t["default"]=u;var l=function(e,t){return new u(e,t)};t.tileCache=l},function(e,t,n){function r(e,t,n){var r;return y[t]?r=y[t]:(r=h(t),y[t]=r),2===arguments.length?e[r]:(e[r]=n,n)}function i(){return 1}function o(e){if(!(this instanceof o))return new o(e);"number"==typeof e&&(e={max:e}),e||(e={});var t=r(this,"max",e.max);(!t||"number"!=typeof t||0>=t)&&r(this,"max",1/0);var n=e.length||i;"function"!=typeof n&&(n=i),r(this,"lengthCalculator",n),r(this,"allowStale",e.stale||!1),r(this,"maxAge",e.maxAge||0),r(this,"dispose",e.dispose),this.reset()}function a(e,t,n,i){var o=n.value;u(e,o)&&(c(e,n),r(e,"allowStale")||(o=void 0)),o&&t.call(i,o.value,o.key,e)}function s(e,t,n){var i=r(e,"cache").get(t);if(i){var o=i.value;u(e,o)?(c(e,i),r(e,"allowStale")||(o=void 0)):n&&r(e,"lruList").unshiftNode(i),o&&(o=o.value)}return o}function u(e,t){if(!t||!t.maxAge&&!r(e,"maxAge"))return!1;var n=!1,i=Date.now()-t.now;return n=t.maxAge?i>t.maxAge:r(e,"maxAge")&&i>r(e,"maxAge")}function l(e){if(r(e,"length")>r(e,"max"))for(var t=r(e,"lruList").tail;r(e,"length")>r(e,"max")&&null!==t;){var n=t.prev;c(e,t),t=n}}function c(e,t){if(t){var n=t.value;r(e,"dispose")&&r(e,"dispose").call(this,n.key,n.value),r(e,"length",r(e,"length")-n.length),r(e,"cache")["delete"](n.key),r(e,"lruList").removeNode(t)}}function f(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}e.exports=o;var h,p=n(44),d=n(47),v=n(50),y={},m="function"==typeof Symbol;h=m?function(e){return Symbol["for"](e)}:function(e){return"_"+e},Object.defineProperty(o.prototype,"max",{set:function(e){(!e||"number"!=typeof e||0>=e)&&(e=1/0),r(this,"max",e),l(this)},get:function(){return r(this,"max")},enumerable:!0}),Object.defineProperty(o.prototype,"allowStale",{set:function(e){r(this,"allowStale",!!e)},get:function(){return r(this,"allowStale")},enumerable:!0}),Object.defineProperty(o.prototype,"maxAge",{set:function(e){(!e||"number"!=typeof e||0>e)&&(e=0),r(this,"maxAge",e),l(this)},get:function(){return r(this,"maxAge")},enumerable:!0}),Object.defineProperty(o.prototype,"lengthCalculator",{set:function(e){"function"!=typeof e&&(e=i),e!==r(this,"lengthCalculator")&&(r(this,"lengthCalculator",e),r(this,"length",0),r(this,"lruList").forEach(function(e){e.length=r(this,"lengthCalculator").call(this,e.value,e.key),r(this,"length",r(this,"length")+e.length)},this)),l(this)},get:function(){return r(this,"lengthCalculator")},enumerable:!0}),Object.defineProperty(o.prototype,"length",{get:function(){return r(this,"length")},enumerable:!0}),Object.defineProperty(o.prototype,"itemCount",{get:function(){return r(this,"lruList").length},enumerable:!0}),o.prototype.rforEach=function(e,t){t=t||this;for(var n=r(this,"lruList").tail;null!==n;){var i=n.prev;a(this,e,n,t),n=i}},o.prototype.forEach=function(e,t){t=t||this;for(var n=r(this,"lruList").head;null!==n;){var i=n.next;a(this,e,n,t),n=i}},o.prototype.keys=function(){return r(this,"lruList").toArray().map(function(e){return e.key},this)},o.prototype.values=function(){return r(this,"lruList").toArray().map(function(e){return e.value},this)},o.prototype.reset=function(){r(this,"dispose")&&r(this,"lruList")&&r(this,"lruList").length&&r(this,"lruList").forEach(function(e){r(this,"dispose").call(this,e.key,e.value)},this),r(this,"cache",new p),r(this,"lruList",new v),r(this,"length",0)},o.prototype.dump=function(){return r(this,"lruList").map(function(e){return u(this,e)?void 0:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}},this).toArray().filter(function(e){return e})},o.prototype.dumpLru=function(){return r(this,"lruList")},o.prototype.inspect=function(e,t){var n="LRUCache {",o=!1,a=r(this,"allowStale");a&&(n+="\n allowStale: true",o=!0);var s=r(this,"max");s&&s!==1/0&&(o&&(n+=","),n+="\n max: "+d.inspect(s,t),o=!0);var l=r(this,"maxAge");l&&(o&&(n+=","),n+="\n maxAge: "+d.inspect(l,t),o=!0);var c=r(this,"lengthCalculator");c&&c!==i&&(o&&(n+=","),n+="\n length: "+d.inspect(r(this,"length"),t),o=!0);var f=!1;return r(this,"lruList").forEach(function(e){f?n+=",\n ":(o&&(n+=",\n"),f=!0,n+="\n ");var r=d.inspect(e.key).split("\n").join("\n "),a={value:e.value};e.maxAge!==l&&(a.maxAge=e.maxAge),c!==i&&(a.length=e.length),u(this,e)&&(a.stale=!0),a=d.inspect(a,t).split("\n").join("\n "),n+=r+" => "+a}),(f||o)&&(n+="\n"),n+="}"},o.prototype.set=function(e,t,n){n=n||r(this,"maxAge");var i=n?Date.now():0,o=r(this,"lengthCalculator").call(this,t,e);if(r(this,"cache").has(e)){if(o>r(this,"max"))return c(this,r(this,"cache").get(e)),!1;var a=r(this,"cache").get(e),s=a.value;return r(this,"dispose")&&r(this,"dispose").call(this,e,s.value),s.now=i,s.maxAge=n,s.value=t,r(this,"length",r(this,"length")+(o-s.length)),s.length=o,this.get(e),l(this),!0}var u=new f(e,t,o,i,n);return u.length>r(this,"max")?(r(this,"dispose")&&r(this,"dispose").call(this,e,t),!1):(r(this,"length",r(this,"length")+u.length),r(this,"lruList").unshift(u),r(this,"cache").set(e,r(this,"lruList").head),
l(this),!0)},o.prototype.has=function(e){if(!r(this,"cache").has(e))return!1;var t=r(this,"cache").get(e).value;return u(this,t)?!1:!0},o.prototype.get=function(e){return s(this,e,!0)},o.prototype.peek=function(e){return s(this,e,!1)},o.prototype.pop=function(){var e=r(this,"lruList").tail;return e?(c(this,e),e.value):null},o.prototype.del=function(e){c(this,r(this,"cache").get(e))},o.prototype.load=function(e){this.reset();for(var t=Date.now(),n=e.length-1;n>=0;n--){var r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{var o=i-t;o>0&&this.set(r.k,r.v,o)}}},o.prototype.prune=function(){var e=this;r(this,"cache").forEach(function(t,n){s(e,n,!1)})}},function(e,t,n){(function(t){"pseudomap"===t.env.npm_package_name&&"test"===t.env.npm_lifecycle_script&&(t.env.TEST_PSEUDOMAP="true"),"function"!=typeof Map||t.env.TEST_PSEUDOMAP?e.exports=n(46):e.exports=Map}).call(t,n(45))},function(e,t){function n(){l=!1,a.length?u=a.concat(u):c=-1,u.length&&r()}function r(){if(!l){var e=setTimeout(n);l=!0;for(var t=u.length;t;){for(a=u,u=[];++c<t;)a&&a[c].run();c=-1,t=u.length}a=null,l=!1,clearTimeout(e)}}function i(e,t){this.fun=e,this.array=t}function o(){}var a,s=e.exports={},u=[],l=!1,c=-1;s.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new i(e,t)),1!==u.length||l||setTimeout(r,0)},i.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=o,s.addListener=o,s.once=o,s.off=o,s.removeListener=o,s.removeAllListeners=o,s.emit=o,s.binding=function(e){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(e){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},function(e,t){function n(e){if(!(this instanceof n))throw new TypeError("Constructor PseudoMap requires 'new'");if(this.clear(),e)if(e instanceof n||"function"==typeof Map&&e instanceof Map)e.forEach(function(e,t){this.set(t,e)},this);else{if(!Array.isArray(e))throw new TypeError("invalid argument");e.forEach(function(e){this.set(e[0],e[1])},this)}}function r(e,t){return e===t||e!==e&&t!==t}function i(e,t,n){this.key=e,this.value=t,this._index=n}function o(e,t){for(var n=0,i="_"+t,o=i;s.call(e,o);o=i+n++)if(r(e[o].key,t))return e[o]}function a(e,t,n){for(var o=0,a="_"+t,u=a;s.call(e,u);u=a+o++)if(r(e[u].key,t))return void(e[u].value=n);e.size++,e[u]=new i(t,n,u)}var s=Object.prototype.hasOwnProperty;e.exports=n,n.prototype.forEach=function(e,t){t=t||this,Object.keys(this._data).forEach(function(n){"size"!==n&&e.call(t,this._data[n].value,this._data[n].key)},this)},n.prototype.has=function(e){return!!o(this._data,e)},n.prototype.get=function(e){var t=o(this._data,e);return t&&t.value},n.prototype.set=function(e,t){a(this._data,e,t)},n.prototype["delete"]=function(e){var t=o(this._data,e);t&&(delete this._data[t._index],this._data.size--)},n.prototype.clear=function(){var e=Object.create(null);e.size=0,Object.defineProperty(this,"_data",{value:e,enumerable:!1,configurable:!0,writable:!1})},Object.defineProperty(n.prototype,"size",{get:function(){return this._data.size},set:function(e){},enumerable:!0,configurable:!0}),n.prototype.values=n.prototype.keys=n.prototype.entries=function(){throw new Error("iterators are not implemented in this version")}},function(e,t,n){(function(e,r){function i(e,n){var r={seen:[],stylize:a};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),v(n)?r.showHidden=n:n&&t._extend(r,n),x(r.showHidden)&&(r.showHidden=!1),x(r.depth)&&(r.depth=2),x(r.colors)&&(r.colors=!1),x(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),u(r,e,r.depth)}function o(e,t){var n=i.styles[t];return n?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function a(e,t){return e}function s(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function u(e,n,r){if(e.customInspect&&n&&M(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return g(i)||(i=u(e,i,r)),i}var o=l(e,n);if(o)return o;var a=Object.keys(n),v=s(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),E(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return c(n);if(0===a.length){if(M(n)){var y=n.name?": "+n.name:"";return e.stylize("[Function"+y+"]","special")}if(w(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(O(n))return e.stylize(Date.prototype.toString.call(n),"date");if(E(n))return c(n)}var m="",_=!1,b=["{","}"];if(d(n)&&(_=!0,b=["[","]"]),M(n)){var x=n.name?": "+n.name:"";m=" [Function"+x+"]"}if(w(n)&&(m=" "+RegExp.prototype.toString.call(n)),O(n)&&(m=" "+Date.prototype.toUTCString.call(n)),E(n)&&(m=" "+c(n)),0===a.length&&(!_||0==n.length))return b[0]+m+b[1];if(0>r)return w(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special");e.seen.push(n);var k;return k=_?f(e,n,r,v,a):a.map(function(t){return h(e,n,r,v,t,_)}),e.seen.pop(),p(k,m,b)}function l(e,t){if(x(t))return e.stylize("undefined","undefined");if(g(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return _(t)?e.stylize(""+t,"number"):v(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,n,r,i){for(var o=[],a=0,s=t.length;s>a;++a)L(t,String(a))?o.push(h(e,t,n,r,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(h(e,t,n,r,i,!0))}),o}function h(e,t,n,r,i,o){var a,s,l;if(l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},l.get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),L(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=y(n)?u(e,l.value,null):u(e,l.value,n-1),s.indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n"))):s=e.stylize("[Circular]","special")),x(a)){if(o&&i.match(/^\d+$/))return s;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function p(e,t,n){var r=0,i=e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function d(e){return Array.isArray(e)}function v(e){return"boolean"==typeof e}function y(e){return null===e}function m(e){return null==e}function _(e){return"number"==typeof e}function g(e){return"string"==typeof e}function b(e){return"symbol"==typeof e}function x(e){return void 0===e}function w(e){return k(e)&&"[object RegExp]"===P(e)}function k(e){return"object"==typeof e&&null!==e}function O(e){return k(e)&&"[object Date]"===P(e)}function E(e){return k(e)&&("[object Error]"===P(e)||e instanceof Error)}function M(e){return"function"==typeof e}function T(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function P(e){return Object.prototype.toString.call(e)}function j(e){return 10>e?"0"+e.toString(10):e.toString(10)}function S(){var e=new Date,t=[j(e.getHours()),j(e.getMinutes()),j(e.getSeconds())].join(":");return[e.getDate(),D[e.getMonth()],t].join(" ")}function L(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var C=/%[sdj%]/g;t.format=function(e){if(!g(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(i(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,o=r.length,a=String(e).replace(C,function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return e}}),s=r[n];o>n;s=r[++n])a+=y(s)||!k(s)?" "+s:" "+i(s);return a},t.deprecate=function(n,i){function o(){if(!a){if(r.throwDeprecation)throw new Error(i);r.traceDeprecation?console.trace(i):console.error(i),a=!0}return n.apply(this,arguments)}if(x(e.process))return function(){return t.deprecate(n,i).apply(this,arguments)};if(r.noDeprecation===!0)return n;var a=!1;return o};var A,R={};t.debuglog=function(e){if(x(A)&&(A=r.env.NODE_DEBUG||""),e=e.toUpperCase(),!R[e])if(new RegExp("\\b"+e+"\\b","i").test(A)){var n=r.pid;R[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else R[e]=function(){};return R[e]},t.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=v,t.isNull=y,t.isNullOrUndefined=m,t.isNumber=_,t.isString=g,t.isSymbol=b,t.isUndefined=x,t.isRegExp=w,t.isObject=k,t.isDate=O,t.isError=E,t.isFunction=M,t.isPrimitive=T,t.isBuffer=n(48);var D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];t.log=function(){console.log("%s - %s",S(),t.format.apply(t,arguments))},t.inherits=n(49),t._extend=function(e,t){if(!t||!k(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(t,function(){return this}(),n(45))},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t){function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var r=0,i=arguments.length;i>r;r++)t.push(arguments[r]);return t}function r(e,t){e.tail=new o(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function i(e,t){e.head=new o(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function o(e,t,n,r){return this instanceof o?(this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,void(n?(n.prev=this,this.next=n):this.next=null)):new o(e,t,n,r)}e.exports=n,n.Node=o,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;t>e;e++)r(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;t>e;e++)i(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail.next=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head.prev=null,this.length--,e}},n.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},n.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&e>t;t++)n=n.next;return t===e&&null!==n?n.value:void 0},n.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&e>t;t++)n=n.prev;return t===e&&null!==n?n.value:void 0},n.prototype.map=function(e,t){t=t||this;for(var r=new n,i=this.head;null!==i;)r.push(e.call(t,i.value,this)),i=i.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,i=this.tail;null!==i;)r.push(e.call(t,i.value,this)),i=i.prev;return r},n.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},n.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},n.prototype.slice=function(e,t){t=t||this.length,0>t&&(t+=this.length),e=e||0,0>e&&(e+=this.length);var r=new n;if(e>t||0>t)return r;0>e&&(e=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&e>i;i++)o=o.next;for(;null!==o&&t>i;i++,o=o.next)r.push(o.value);return r},n.prototype.sliceReverse=function(e,t){t=t||this.length,0>t&&(t+=this.length),e=e||0,0>e&&(e+=this.length);var r=new n;if(e>t||0>t)return r;0>e&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)r.push(o.value);return r},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this}},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(52),l=r(u),c=n(53),f=(r(c),n(24)),h=r(f),p=function(e){function t(e,n,r){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,n,r)}return o(t,e),a(t,[{key:"requestTileAsync",value:function(){var e=this;setTimeout(function(){e._mesh||(e._mesh=e._createMesh(),e._requestTile())},0)}},{key:"destroy",value:function(){this._abortRequest(),this._image=null,s(Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"_createMesh",value:function(){if(this._center){var e,t=new h["default"].Object3D,n=new h["default"].PlaneBufferGeometry(this._side,this._side,1);this._world._environment._skybox?(e=new h["default"].MeshStandardMaterial({depthWrite:!1}),e.roughness=1,e.metalness=.1,e.envMap=this._world._environment._skybox.getRenderTarget()):e=new h["default"].MeshBasicMaterial({depthWrite:!1});var r=new h["default"].Mesh(n,e);return r.rotation.x=-90*Math.PI/180,r.receiveShadow=!0,t.add(r),t.renderOrder=.1,t.position.x=this._center[0],t.position.z=this._center[1],t}}},{key:"_createDebugMesh",value:function(){var e=document.createElement("canvas");e.width=256,e.height=256;var t=e.getContext("2d");t.font="Bold 20px Helvetica Neue, Verdana, Arial",t.fillStyle="#ff0000",t.fillText(this._quadcode,20,e.width/2-5),t.fillText(this._tile.toString(),20,e.width/2+25);var n=new h["default"].Texture(e);n.magFilter=h["default"].LinearFilter,n.minFilter=h["default"].LinearMipMapLinearFilter,n.anisotropy=4,n.needsUpdate=!0;var r=new h["default"].MeshBasicMaterial({map:n,transparent:!0,depthWrite:!1}),i=new h["default"].PlaneBufferGeometry(this._side,this._side,1),o=new h["default"].Mesh(i,r);return o.rotation.x=-90*Math.PI/180,o.position.y=.1,o}},{key:"_requestTile",value:function(){var e=this,t={x:this._tile[0],y:this._tile[1],z:this._tile[2]},n=this._getTileURL(t),r=document.createElement("img");r.addEventListener("load",function(t){var n=new h["default"].Texture;n.image=r,n.needsUpdate=!0,n.magFilter=h["default"].LinearFilter,n.minFilter=h["default"].LinearMipMapLinearFilter,n.anisotropy=4,n.needsUpdate=!0,e._mesh&&e._mesh.children[0]&&e._mesh.children[0].material&&(e._mesh.children[0].material.map=n,e._mesh.children[0].material.needsUpdate=!0,e._texture=n,e._ready=!0)},!1),r.crossOrigin="",r.src=n,this._image=r}},{key:"_abortRequest",value:function(){this._image&&(this._image.src="")}}]),t}(l["default"]);t["default"]=p;var d=function(e,t,n){return new p(e,t,n)};t.imageTile=d},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(11),s=n(10),u=n(24),l=r(u),c=180/Math.PI,f=/\{([szxy])\}/g,h=function(){function e(t,n,r){i(this,e),this._layer=r,this._world=r._world,this._quadcode=t,this._path=n,this._ready=!1,this._tile=this._quadcodeToTile(t),this._boundsLatLon=this._tileBoundsWGS84(this._tile),this._boundsWorld=this._tileBoundsFromWGS84(this._boundsLatLon),this._center=this._boundsToCenter(this._boundsWorld),this._centerLatlon=this._world.pointToLatLon((0,a.point)(this._center[0],this._center[1])),this._side=this._getSide(this._boundsWorld),this._pointScale=this._world.pointScale(this._centerLatlon)}return o(e,[{key:"isReady",value:function(){return this._ready}},{key:"requestTileAsync",value:function(){}},{key:"getQuadcode",value:function(){return this._quadcode}},{key:"getBounds",value:function(){return this._boundsWorld}},{key:"getCenter",value:function(){return this._center}},{key:"getSide",value:function(){return this._side}},{key:"getMesh",value:function(){return this._mesh}},{key:"getPickingMesh",value:function(){return this._pickingMesh}},{key:"destroy",value:function(){this._layer=null,this._world=null,this._boundsLatLon=null,this._boundsWorld=null,this._center=null,this._mesh&&(this._mesh.children?this._mesh.children.forEach(function(e){e.geometry.dispose(),e.geometry=null,e.material.map&&(e.material.map.dispose(),e.material.map=null),e.material.dispose(),e.material=null}):(this._mesh.geometry.dispose(),this._mesh.geometry=null,this._mesh.material.map&&(this._mesh.material.map.dispose(),this._mesh.material.map=null),this._mesh.material.dispose(),this._mesh.material=null))}},{key:"_createMesh",value:function(){}},{key:"_createDebugMesh",value:function(){}},{key:"_getTileURL",value:function(e){return e.s||(e.s=String.fromCharCode(97+Math.floor(3*Math.random()))),f.lastIndex=0,this._path.replace(f,function(t,n){return e[n]})}},{key:"_quadcodeToTile",value:function(e){for(var t=0,n=0,r=e.length,i=r;i>0;i--){var o=1<<i-1,a=+e[r-i];1===a&&(t|=o),2===a&&(n|=o),3===a&&(t|=o,n|=o)}return[t,n,r]}},{key:"_tileBoundsFromWGS84",value:function(e){var t=this._layer._world.latLonToPoint((0,s.latLon)(e[1],e[0])),n=this._layer._world.latLonToPoint((0,s.latLon)(e[3],e[2]));return[t.x,t.y,n.x,n.y]}},{key:"_tileBoundsWGS84",value:function(e){var t=this._tile2lon(e[0]+1,e[2]),n=this._tile2lon(e[0],e[2]),r=this._tile2lat(e[1]+1,e[2]),i=this._tile2lat(e[1],e[2]);return[n,r,t,i]}},{key:"_tile2lon",value:function(e,t){return e/Math.pow(2,t)*360-180}},{key:"_tile2lat",value:function(e,t){var n=Math.PI-2*Math.PI*e/Math.pow(2,t);return c*Math.atan(.5*(Math.exp(n)-Math.exp(-n)))}},{key:"_boundsToCenter",value:function(e){var t=e[0]+(e[2]-e[0])/2,n=e[1]+(e[3]-e[1])/2;return[t,n]}},{key:"_getSide",value:function(e){return new l["default"].Vector3(e[0],0,e[3]).sub(new l["default"].Vector3(e[0],0,e[1])).length()}}]),e}();t["default"]=h,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i);BoxHelper=function(e){var t=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Float32Array(24),r=new o["default"].BufferGeometry;r.setIndex(new o["default"].BufferAttribute(t,1)),r.addAttribute("position",new o["default"].BufferAttribute(n,3)),o["default"].LineSegments.call(this,r,new o["default"].LineBasicMaterial({linewidth:2,color:16711680})),void 0!==e&&this.update(e)},BoxHelper.prototype=Object.create(o["default"].LineSegments.prototype),BoxHelper.prototype.constructor=BoxHelper,BoxHelper.prototype.update=function(){var e=new o["default"].Box3;return function(t){if(e.setFromObject(t),!e.isEmpty()){var n=e.min,r=e.max,i=this.geometry.attributes.position,o=i.array;o[0]=r.x,o[1]=r.y,o[2]=r.z,o[3]=n.x,o[4]=r.y,o[5]=r.z,o[6]=n.x,o[7]=n.y,o[8]=r.z,o[9]=r.x,o[10]=n.y,o[11]=r.z,o[12]=r.x,o[13]=r.y,o[14]=n.z,o[15]=n.x,o[16]=r.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=r.x,o[22]=n.y,o[23]=n.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),t["default"]=BoxHelper,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i);t["default"]=function(e,t){var n=document.createElement("canvas");n.width=1,n.height=1;var r=n.getContext("2d");r.fillStyle=e,r.fillRect(0,0,n.width,n.height);var i=new o["default"].Texture(n);i.needsUpdate=!0;var a;return t?(a=new o["default"].MeshStandardMaterial({depthWrite:!1}),a.roughness=1,a.metalness=.1,a.envMap=t):a=new o["default"].MeshBasicMaterial({map:i,depthWrite:!1}),a},e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(41),l=r(u),c=n(3),f=r(c),h=n(56),p=r(h),d=n(34),v=r(d),y=n(24),m=(r(y),function(e){function t(e,n){i(this,t);var r={maxLOD:14,distance:2e3};n=(0,f["default"])({},r,n),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,n),this._path=e}return o(t,e),a(t,[{key:"_onAdd",value:function(e){var n=this;s(Object.getPrototypeOf(t.prototype),"_onAdd",this).call(this,e),setTimeout(function(){n._calculateLOD(),n._initEvents()},0)}},{key:"_initEvents",value:function(){this._throttledWorldUpdate=(0,v["default"])(this._onWorldUpdate,100),this._world.on("preUpdate",this._throttledWorldUpdate,this),this._world.on("move",this._onWorldMove,this),this._world.on("controlsMove",this._onControlsMove,this)}},{key:"_onWorldUpdate",value:function(){this._pauseOutput||this._outputTiles()}},{key:"_onWorldMove",value:function(e,t){this._pauseOutput=!1,this._calculateLOD()}},{key:"_onControlsMove",value:function(){this._pauseOutput=!0}},{key:"_createTile",value:function(e,t){var n={};return this._options.filter&&(n.filter=this._options.filter),this._options.style&&(n.style=this._options.style),this._options.topojson&&(n.topojson=!0),this._options.picking&&(n.picking=!0),this._options.onClick&&(n.onClick=this._options.onClick),new p["default"](e,this._path,t,n)}},{key:"destroy",value:function(){this._world.off("preUpdate",this._throttledWorldUpdate),this._world.off("move",this._onWorldMove),this._throttledWorldUpdate=null,s(Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}}]),t}(l["default"]));t["default"]=m;var _=function(e,t){return new m(e,t)};t.geoJSONTileLayer=_},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(52),l=r(u),c=n(53),f=(r(c),n(24)),h=r(f),p=n(57),d=r(p),v=n(11),y=n(10),m=n(3),_=r(m),g=n(59),b=r(g),x=n(65),w=r(x),k=n(66),O=r(k),E=function(e){function t(e,n,r,o){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,n,r),this._defaultStyle=b["default"].defaultStyle;var a={picking:!1,topojson:!1,filter:null,onClick:null,style:this._defaultStyle};this._options=(0,_["default"])({},a,o),"function"==typeof o.style?this._options.style=o.style:this._options.style=(0,_["default"])({},a.style,o.style)}return o(t,e),a(t,[{key:"requestTileAsync",value:function(){var e=this;setTimeout(function(){e._mesh||(e._mesh=e._createMesh(),e._options.picking&&(e._pickingMesh=e._createPickingMesh()),e._requestTile())},0)}},{key:"destroy",value:function(){this._abortRequest(),this._request=null,this._pickingMesh=null,s(Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}},{key:"_createMesh",value:function(){if(this._center){var e=new h["default"].Object3D;return e.position.x=this._center[0],e.position.z=this._center[1],e}}},{key:"_createPickingMesh",value:function(){if(this._center){var e=new h["default"].Object3D;return e.position.x=this._center[0],e.position.z=this._center[1],e}}},{key:"_createDebugMesh",value:function(){var e=document.createElement("canvas");e.width=256,e.height=256;var t=e.getContext("2d");t.font="Bold 20px Helvetica Neue, Verdana, Arial",t.fillStyle="#ff0000",t.fillText(this._quadcode,20,e.width/2-5),t.fillText(this._tile.toString(),20,e.width/2+25);var n=new h["default"].Texture(e);n.magFilter=h["default"].LinearFilter,n.minFilter=h["default"].LinearMipMapLinearFilter,n.anisotropy=4,n.needsUpdate=!0;var r=new h["default"].MeshBasicMaterial({map:n,transparent:!0,depthWrite:!1}),i=new h["default"].PlaneBufferGeometry(this._side,this._side,1),o=new h["default"].Mesh(i,r);return o.rotation.x=-90*Math.PI/180,o.position.y=.1,o}},{key:"_createShadowCanvas",value:function(){var e=document.createElement("canvas");return e.width=512,e.height=512,e}},{key:"_requestTile",value:function(){var e=this,t={x:this._tile[0],y:this._tile[1],z:this._tile[2]},n=this._getTileURL(t);this._request=(0,d["default"])({url:n,type:"json",crossOrigin:!0}).then(function(t){e._request=null,e._processTileData(t)})["catch"](function(t){console.error(t),e._request=null})}},{key:"_processTileData",value:function(e){var t=this;console.time(this._tile);var n=b["default"].mergeFeatures(e,this._options.topojson),r=n.features;this._options.filter&&(r=n.features.filter(this._options.filter));var i=this._options.style,o=(0,v.point)(0,0);o.x=-1*this._center[0],o.y=-1*this._center[1];var a={vertices:[],faces:[],colours:[],facesCount:0,allFlat:!0},s={vertices:[],colours:[],verticesCount:0};this._options.picking&&(a.pickingIds=[],s.pickingIds=[]);var u=new h["default"].Color;r.forEach(function(e){if("Polygon"===e.geometry.type||"LineString"===e.geometry.type||"MultiLineString"===e.geometry.type){"function"==typeof t._options.style&&(i=(0,_["default"])({},t._defaultStyle,t._options.style(e)));var n=e.geometry.coordinates;if("LineString"===e.geometry.type){u.set(i.lineColor),n=n.map(function(e){var n=(0,y.latLon)(e[1],e[0]),r=t._layer._world.latLonToPoint(n);return[r.x,r.y]});var r=0;i.lineHeight&&(r=t._world.metresToWorld(i.lineHeight,t._pointScale));var o=b["default"].lineStringAttributes(n,u,r);if(s.vertices.push(o.vertices),s.colours.push(o.colours),t._options.picking){var l=t._layer.getPickingId();s.pickingIds.push(l),t._options.onClick&&t._world.on("pick-"+l,function(n,r,i){t._options.onClick(e,n,r,i)})}s.verticesCount+=o.vertices.length}if("MultiLineString"===e.geometry.type){u.set(i.lineColor),n=n.map(function(e){return e.map(function(e){var n=(0,y.latLon)(e[1],e[0]),r=t._layer._world.latLonToPoint(n);return[r.x,r.y]})});var r=0;i.lineHeight&&(r=t._world.metresToWorld(i.lineHeight,t._pointScale));var c=b["default"].multiLineStringAttributes(n,u,r);if(s.vertices.push(c.vertices),s.colours.push(c.colours),t._options.picking){var l=t._layer.getPickingId();s.pickingIds.push(l),t._options.onClick&&t._world.on("pick-"+l,function(n,r,i){t._options.onClick(e,n,r,i)})}s.verticesCount+=c.vertices.length}if("Polygon"===e.geometry.type){u.set(i.color),n=n.map(function(e){return e.map(function(e){var n=(0,y.latLon)(e[1],e[0]),r=t._layer._world.latLonToPoint(n);return[r.x,r.y]})});var r=0;i.height&&(r=t._world.metresToWorld(i.height,t._pointScale));var f=b["default"].polygonAttributes(n,u,r);if(a.vertices.push(f.vertices),a.faces.push(f.faces),a.colours.push(f.colours),t._options.picking){var l=t._layer.getPickingId();a.pickingIds.push(l),t._options.onClick&&t._world.on("pick-"+l,function(n,r,i){t._options.onClick(e,n,r,i)})}a.allFlat&&!f.flat&&(a.allFlat=!1),a.facesCount+=f.faces.length}}});var l,c,f;if(s.vertices.length>0&&(l=w["default"].createLineGeometry(s,o),c=new h["default"].LineBasicMaterial({vertexColors:h["default"].VertexColors,linewidth:i.lineWidth,transparent:i.lineTransparent,opacity:i.lineOpacity,blending:i.lineBlending}),f=new h["default"].LineSegments(l,c),void 0!==i.lineRenderOrder&&(c.depthWrite=!1,f.renderOrder=i.lineRenderOrder),this._mesh.add(f),this._options.picking)){c=new O["default"],c.side=h["default"].BackSide,c.linewidth=i.lineWidth+c.linePadding;var p=new h["default"].LineSegments(l,c);this._pickingMesh.add(p)}if(a.facesCount>0&&(l=w["default"].createGeometry(a,o),this._world._environment._skybox?(c=new h["default"].MeshStandardMaterial({vertexColors:h["default"].VertexColors,side:h["default"].BackSide}),c.roughness=1,c.metalness=.1,c.envMapIntensity=3,c.envMap=this._world._environment._skybox.getRenderTarget()):c=new h["default"].MeshPhongMaterial({
vertexColors:h["default"].VertexColors,side:h["default"].BackSide}),f=new h["default"].Mesh(l,c),f.castShadow=!0,f.receiveShadow=!0,a.allFlat&&(c.depthWrite=!1,f.renderOrder=1),this._mesh.add(f),this._options.picking)){c=new O["default"],c.side=h["default"].BackSide;var p=new h["default"].Mesh(l,c);this._pickingMesh.add(p)}this._ready=!0,console.timeEnd(this._tile),console.log(this._tile+": "+r.length+" features")}},{key:"_abortRequest",value:function(){this._request&&this._request.abort()}}]),t}(l["default"]);t["default"]=E;var M=function(e,t,n,r){return new E(e,t,n,r)};t.geoJSONTile=M},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_RESULT__;!function(e,t,n){"undefined"!=typeof module&&module.exports?module.exports=n():(__WEBPACK_AMD_DEFINE_FACTORY__=n,__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof __WEBPACK_AMD_DEFINE_FACTORY__?__WEBPACK_AMD_DEFINE_FACTORY__.call(exports,__webpack_require__,exports,module):__WEBPACK_AMD_DEFINE_FACTORY__,!(void 0!==__WEBPACK_AMD_DEFINE_RESULT__&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))}("reqwest",this,function(){function succeed(e){var t=protocolRe.exec(e.url);return t=t&&t[1]||context.location.protocol,httpsRe.test(t)?twoHundo.test(e.request.status):!!e.request.response}function handleReadyState(e,t,n){return function(){return e._aborted?n(e.request):e._timedOut?n(e.request,"Request is aborted: timeout"):void(e.request&&4==e.request[readyState]&&(e.request.onreadystatechange=noop,succeed(e)?t(e.request):n(e.request)))}}function setHeaders(e,t){var n,r=t.headers||{};r.Accept=r.Accept||defaultHeaders.accept[t.type]||defaultHeaders.accept["*"];var i="undefined"!=typeof FormData&&t.data instanceof FormData;t.crossOrigin||r[requestedWith]||(r[requestedWith]=defaultHeaders.requestedWith),r[contentType]||i||(r[contentType]=t.contentType||defaultHeaders.contentType);for(n in r)r.hasOwnProperty(n)&&"setRequestHeader"in e&&e.setRequestHeader(n,r[n])}function setCredentials(e,t){"undefined"!=typeof t.withCredentials&&"undefined"!=typeof e.withCredentials&&(e.withCredentials=!!t.withCredentials)}function generalCallback(e){lastValue=e}function urlappend(e,t){return e+(/\?/.test(e)?"&":"?")+t}function handleJsonp(e,t,n,r){var i=uniqid++,o=e.jsonpCallback||"callback",a=e.jsonpCallbackName||reqwest.getcallbackPrefix(i),s=new RegExp("((^|\\?|&)"+o+")=([^&]+)"),u=r.match(s),l=doc.createElement("script"),c=0,f=-1!==navigator.userAgent.indexOf("MSIE 10.0");return u?"?"===u[3]?r=r.replace(s,"$1="+a):a=u[3]:r=urlappend(r,o+"="+a),context[a]=generalCallback,l.type="text/javascript",l.src=r,l.async=!0,"undefined"==typeof l.onreadystatechange||f||(l.htmlFor=l.id="_reqwest_"+i),l.onload=l.onreadystatechange=function(){return l[readyState]&&"complete"!==l[readyState]&&"loaded"!==l[readyState]||c?!1:(l.onload=l.onreadystatechange=null,l.onclick&&l.onclick(),t(lastValue),lastValue=void 0,head.removeChild(l),void(c=1))},head.appendChild(l),{abort:function(){l.onload=l.onreadystatechange=null,n({},"Request is aborted: timeout",{}),lastValue=void 0,head.removeChild(l),c=1}}}function getRequest(e,t){var n,r=this.o,i=(r.method||"GET").toUpperCase(),o="string"==typeof r?r:r.url,a=r.processData!==!1&&r.data&&"string"!=typeof r.data?reqwest.toQueryString(r.data):r.data||null,s=!1;return"jsonp"!=r.type&&"GET"!=i||!a||(o=urlappend(o,a),a=null),"jsonp"==r.type?handleJsonp(r,e,t,o):(n=r.xhr&&r.xhr(r)||xhr(r),n.open(i,o,r.async===!1?!1:!0),setHeaders(n,r),setCredentials(n,r),context[xDomainRequest]&&n instanceof context[xDomainRequest]?(n.onload=e,n.onerror=t,n.onprogress=function(){},s=!0):n.onreadystatechange=handleReadyState(this,e,t),r.before&&r.before(n),s?setTimeout(function(){n.send(a)},200):n.send(a),n)}function Reqwest(e,t){this.o=e,this.fn=t,init.apply(this,arguments)}function setType(e){return null!==e?e.match("json")?"json":e.match("javascript")?"js":e.match("text")?"html":e.match("xml")?"xml":void 0:void 0}function init(o,fn){function complete(e){for(o.timeout&&clearTimeout(self.timeout),self.timeout=null;self._completeHandlers.length>0;)self._completeHandlers.shift()(e)}function success(resp){var type=o.type||resp&&setType(resp.getResponseHeader("Content-Type"));resp="jsonp"!==type?self.request:resp;var filteredResponse=globalSetupOptions.dataFilter(resp.responseText,type),r=filteredResponse;try{resp.responseText=r}catch(e){}if(r)switch(type){case"json":try{resp=context.JSON?context.JSON.parse(r):eval("("+r+")")}catch(err){return error(resp,"Could not parse JSON in response",err)}break;case"js":resp=eval(r);break;case"html":resp=r;break;case"xml":resp=resp.responseXML&&resp.responseXML.parseError&&resp.responseXML.parseError.errorCode&&resp.responseXML.parseError.reason?null:resp.responseXML}for(self._responseArgs.resp=resp,self._fulfilled=!0,fn(resp),self._successHandler(resp);self._fulfillmentHandlers.length>0;)resp=self._fulfillmentHandlers.shift()(resp);complete(resp)}function timedOut(){self._timedOut=!0,self.request.abort()}function error(e,t,n){for(e=self.request,self._responseArgs.resp=e,self._responseArgs.msg=t,self._responseArgs.t=n,self._erred=!0;self._errorHandlers.length>0;)self._errorHandlers.shift()(e,t,n);complete(e)}this.url="string"==typeof o?o:o.url,this.timeout=null,this._fulfilled=!1,this._successHandler=function(){},this._fulfillmentHandlers=[],this._errorHandlers=[],this._completeHandlers=[],this._erred=!1,this._responseArgs={};var self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){timedOut()},o.timeout)),o.success&&(this._successHandler=function(){o.success.apply(o,arguments)}),o.error&&this._errorHandlers.push(function(){o.error.apply(o,arguments)}),o.complete&&this._completeHandlers.push(function(){o.complete.apply(o,arguments)}),this.request=getRequest.call(this,success,error)}function reqwest(e,t){return new Reqwest(e,t)}function normalize(e){return e?e.replace(/\r?\n/g,"\r\n"):""}function serial(e,t){var n,r,i,o,a=e.name,s=e.tagName.toLowerCase(),u=function(e){e&&!e.disabled&&t(a,normalize(e.attributes.value&&e.attributes.value.specified?e.value:e.text))};if(!e.disabled&&a)switch(s){case"input":/reset|button|image|file/i.test(e.type)||(n=/checkbox/i.test(e.type),r=/radio/i.test(e.type),i=e.value,(!(n||r)||e.checked)&&t(a,normalize(n&&""===i?"on":i)));break;case"textarea":t(a,normalize(e.value));break;case"select":if("select-one"===e.type.toLowerCase())u(e.selectedIndex>=0?e.options[e.selectedIndex]:null);else for(o=0;e.length&&o<e.length;o++)e.options[o].selected&&u(e.options[o])}}function eachFormElement(){var e,t,n=this,r=function(e,t){var r,i,o;for(r=0;r<t.length;r++)for(o=e[byTag](t[r]),i=0;i<o.length;i++)serial(o[i],n)};for(t=0;t<arguments.length;t++)e=arguments[t],/input|select|textarea/i.test(e.tagName)&&serial(e,n),r(e,["input","select","textarea"])}function serializeQueryString(){return reqwest.toQueryString(reqwest.serializeArray.apply(null,arguments))}function serializeHash(){var e={};return eachFormElement.apply(function(t,n){t in e?(e[t]&&!isArray(e[t])&&(e[t]=[e[t]]),e[t].push(n)):e[t]=n},arguments),e}function buildParams(e,t,n,r){var i,o,a,s=/\[\]$/;if(isArray(t))for(o=0;t&&o<t.length;o++)a=t[o],n||s.test(e)?r(e,a):buildParams(e+"["+("object"==typeof a?o:"")+"]",a,n,r);else if(t&&"[object Object]"===t.toString())for(i in t)buildParams(e+"["+i+"]",t[i],n,r);else r(e,t)}var context=this;if("window"in context)var doc=document,byTag="getElementsByTagName",head=doc[byTag]("head")[0];else{var XHR2;try{XHR2=__webpack_require__(58)}catch(ex){throw new Error("Peer dependency `xhr2` required! Please npm install xhr2")}}var httpsRe=/^http/,protocolRe=/(^\w+):\/\//,twoHundo=/^(20\d|1223)$/,readyState="readyState",contentType="Content-Type",requestedWith="X-Requested-With",uniqid=0,callbackPrefix="reqwest_"+ +new Date,lastValue,xmlHttpRequest="XMLHttpRequest",xDomainRequest="XDomainRequest",noop=function(){},isArray="function"==typeof Array.isArray?Array.isArray:function(e){return e instanceof Array},defaultHeaders={contentType:"application/x-www-form-urlencoded",requestedWith:xmlHttpRequest,accept:{"*":"text/javascript, text/html, application/xml, text/xml, */*",xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript",js:"application/javascript, text/javascript"}},xhr=function(e){if(e.crossOrigin===!0){var t=context[xmlHttpRequest]?new XMLHttpRequest:null;if(t&&"withCredentials"in t)return t;if(context[xDomainRequest])return new XDomainRequest;throw new Error("Browser does not support cross-origin requests")}return context[xmlHttpRequest]?new XMLHttpRequest:XHR2?new XHR2:new ActiveXObject("Microsoft.XMLHTTP")},globalSetupOptions={dataFilter:function(e){return e}};return Reqwest.prototype={abort:function(){this._aborted=!0,this.request.abort()},retry:function(){init.call(this,this.o,this.fn)},then:function(e,t){return e=e||function(){},t=t||function(){},this._fulfilled?this._responseArgs.resp=e(this._responseArgs.resp):this._erred?t(this._responseArgs.resp,this._responseArgs.msg,this._responseArgs.t):(this._fulfillmentHandlers.push(e),this._errorHandlers.push(t)),this},always:function(e){return this._fulfilled||this._erred?e(this._responseArgs.resp):this._completeHandlers.push(e),this},fail:function(e){return this._erred?e(this._responseArgs.resp,this._responseArgs.msg,this._responseArgs.t):this._errorHandlers.push(e),this},"catch":function(e){return this.fail(e)}},reqwest.serializeArray=function(){var e=[];return eachFormElement.apply(function(t,n){e.push({name:t,value:n})},arguments),e},reqwest.serialize=function(){if(0===arguments.length)return"";var e,t,n=Array.prototype.slice.call(arguments,0);return e=n.pop(),e&&e.nodeType&&n.push(e)&&(e=null),e&&(e=e.type),t="map"==e?serializeHash:"array"==e?reqwest.serializeArray:serializeQueryString,t.apply(null,n)},reqwest.toQueryString=function(e,t){var n,r,i=t||!1,o=[],a=encodeURIComponent,s=function(e,t){t="function"==typeof t?t():null==t?"":t,o[o.length]=a(e)+"="+a(t)};if(isArray(e))for(r=0;e&&r<e.length;r++)s(e[r].name,e[r].value);else for(n in e)e.hasOwnProperty(n)&&buildParams(n,e[n],i,s);return o.join("&").replace(/%20/g,"+")},reqwest.getcallbackPrefix=function(){return callbackPrefix},reqwest.compat=function(e,t){return e&&(e.type&&(e.method=e.type)&&delete e.type,e.dataType&&(e.type=e.dataType),e.jsonpCallback&&(e.jsonpCallbackName=e.jsonpCallback)&&delete e.jsonpCallback,e.jsonp&&(e.jsonpCallback=e.jsonp)),new Reqwest(e,t)},reqwest.ajaxSetup=function(e){e=e||{};for(var t in e)globalSetupOptions[t]=e[t]},reqwest})},function(e,t){},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(24),a=r(o),s=n(60),u=r(s),l=n(61),c=r(l),f=n(63),h=r(f),p=n(64),d=r(p),v=new a["default"].Color(16777215),y=new a["default"].Color(6710886),m=function(){var e={color:"#ffffff",height:0,lineOpacity:1,lineTransparent:!1,lineColor:"#ffffff",lineWidth:1,lineBlending:a["default"].NormalBlending},t=function(e,t){var n=[];if(t){for(var r in e.objects)n.push(u["default"].feature(e,e.objects[r]));return(0,c["default"])(n)}if(e.type)return Array.isArray(e)?(0,c["default"])(e):e;for(var i in e)e[i].type&&n.push(e[i]);return(0,c["default"])(n)},n=function(e,t,n){var r,i=[],o=[];return e.forEach(function(a,s){o.push([t.r,t.g,t.b]),i.push([a[0],n,a[1]]),r=e[s+1]?e[s+1]:a,o.push([t.r,t.g,t.b]),i.push([r[0],n,r[1]])}),{vertices:i,colours:o}},r=function(e,t,r){var i,o=[],a=[];return e.forEach(function(e){i=n(e,t,r),i.vertices.forEach(function(e){o.push(e)}),i.colours.forEach(function(e){a.push(e)})}),{vertices:o,colours:a}},o=function(e,t,n){var r=s(e),o=l(r.vertices,r.holes,r.dimensions),a=[];for(i=0,il=r.vertices.length;i<il;i+=r.dimensions)a.push(r.vertices.slice(i,i+r.dimensions));var u,c=(0,d["default"])(a,o,{bottom:0,top:n}),f=t.clone().multiply(v),h=t.clone().multiply(y),p=c.positions,m=[],_=[];c.top.forEach(function(e,n){u=[],u.push([t.r,t.g,t.b]),u.push([t.r,t.g,t.b]),u.push([t.r,t.g,t.b]),m.push(e),_.push(u)});var g=!0;return c.sides&&(g&&(g=!1),c.sides.forEach(function(e,t){u=[],t%2===0?(u.push([h.r,h.g,h.b]),u.push([h.r,h.g,h.b]),u.push([f.r,f.g,f.b])):(u.push([f.r,f.g,f.b]),u.push([f.r,f.g,f.b]),u.push([h.r,h.g,h.b])),m.push(e),_.push(u)})),{vertices:p,faces:m,colours:_,flat:g}},s=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var o=0;o<e[i].length;o++)for(var a=0;t>a;a++)n.vertices.push(e[i][o][a]);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n},l=function(e,t,n){var r=(0,h["default"])(e,t,n),o=[];for(i=0,il=r.length;i<il;i+=3)o.push(r.slice(i,i+3));return o};return{defaultStyle:e,mergeFeatures:t,lineStringAttributes:n,multiLineStringAttributes:r,polygonAttributes:o}}();t["default"]=m,e.exports=t["default"]},function(e,t,n){!function(e,n){n(t)}(this,function(e){"use strict";function t(){}function n(e){if(!e)return t;var n,r,i=e.scale[0],o=e.scale[1],a=e.translate[0],s=e.translate[1];return function(e,t){t||(n=r=0),e[0]=(n+=e[0])*i+a,e[1]=(r+=e[1])*o+s}}function r(e){if(!e)return t;var n,r,i=e.scale[0],o=e.scale[1],a=e.translate[0],s=e.translate[1];return function(e,t){t||(n=r=0);var u=(e[0]-a)/i|0,l=(e[1]-s)/o|0;e[0]=u-n,e[1]=l-r,n=u,r=l}}function i(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}function o(e,t){for(var n=0,r=e.length;r>n;){var i=n+r>>>1;e[i]<t?n=i+1:r=i}return n}function a(e,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return s(e,t)})}:s(e,t)}function s(e,t){var n={type:"Feature",id:t.id,properties:t.properties||{},geometry:u(e,t)};return null==t.id&&delete n.id,n}function u(e,t){function r(e,t){t.length&&t.pop();for(var n,r=f[0>e?~e:e],o=0,a=r.length;a>o;++o)t.push(n=r[o].slice()),c(n,o);0>e&&i(t,a)}function o(e){return e=e.slice(),c(e,0),e}function a(e){for(var t=[],n=0,i=e.length;i>n;++n)r(e[n],t);return t.length<2&&t.push(t[0].slice()),t}function s(e){for(var t=a(e);t.length<4;)t.push(t[0].slice());return t}function u(e){return e.map(s)}function l(e){var t=e.type;return"GeometryCollection"===t?{type:t,geometries:e.geometries.map(l)}:t in h?{type:t,coordinates:h[t](e)}:null}var c=n(e.transform),f=e.arcs,h={Point:function(e){return o(e.coordinates)},MultiPoint:function(e){return e.coordinates.map(o)},LineString:function(e){return a(e.arcs)},MultiLineString:function(e){return e.arcs.map(a)},Polygon:function(e){return u(e.arcs)},MultiPolygon:function(e){return e.arcs.map(u)}};return l(t)}function l(e,t){function n(t){var n,r=e.arcs[0>t?~t:t],i=r[0];return e.transform?(n=[0,0],r.forEach(function(e){n[0]+=e[0],n[1]+=e[1]})):n=r[r.length-1],0>t?[n,i]:[i,n]}function r(e,t){for(var n in e){var r=e[n];delete t[r.start],delete r.start,delete r.end,r.forEach(function(e){i[0>e?~e:e]=1}),s.push(r)}}var i={},o={},a={},s=[],u=-1;return t.forEach(function(n,r){var i,o=e.arcs[0>n?~n:n];o.length<3&&!o[1][0]&&!o[1][1]&&(i=t[++u],t[u]=n,t[r]=i)}),t.forEach(function(e){var t,r,i=n(e),s=i[0],u=i[1];if(t=a[s])if(delete a[t.end],t.push(e),t.end=u,r=o[u]){delete o[r.start];var l=r===t?t:t.concat(r);o[l.start=t.start]=a[l.end=r.end]=l}else o[t.start]=a[t.end]=t;else if(t=o[u])if(delete o[t.start],t.unshift(e),t.start=s,r=a[s]){delete a[r.end];var c=r===t?t:r.concat(t);o[c.start=r.start]=a[c.end=t.end]=c}else o[t.start]=a[t.end]=t;else t=[e],o[t.start=s]=a[t.end=u]=t}),r(a,o),r(o,a),t.forEach(function(e){i[0>e?~e:e]||s.push([e])}),s}function c(e){return u(e,f.apply(this,arguments))}function f(e,t,n){function r(e){var t=0>e?~e:e;(c[t]||(c[t]=[])).push({i:e,g:u})}function i(e){e.forEach(r)}function o(e){e.forEach(i)}function a(e){"GeometryCollection"===e.type?e.geometries.forEach(a):e.type in f&&(u=e,f[e.type](e.arcs))}var s=[];if(arguments.length>1){var u,c=[],f={LineString:i,MultiLineString:o,Polygon:o,MultiPolygon:function(e){e.forEach(o)}};a(t),c.forEach(arguments.length<3?function(e){s.push(e[0].i)}:function(e){n(e[0].g,e[e.length-1].g)&&s.push(e[0].i)})}else for(var h=0,p=e.arcs.length;p>h;++h)s.push(h);return{type:"MultiLineString",arcs:l(e,s)}}function h(e){var t=e[0],n=e[1],r=e[2];return Math.abs((t[0]-r[0])*(n[1]-t[1])-(t[0]-n[0])*(r[1]-t[1]))}function p(e){for(var t,n=-1,r=e.length,i=e[r-1],o=0;++n<r;)t=i,i=e[n],o+=t[0]*i[1]-t[1]*i[0];return o/2}function d(e){return u(e,v.apply(this,arguments))}function v(e,t){function n(e){e.forEach(function(t){t.forEach(function(t){(i[t=0>t?~t:t]||(i[t]=[])).push(e)})}),o.push(e)}function r(t){return p(u(e,{type:"Polygon",arcs:[t]}).coordinates[0])>0}var i={},o=[],a=[];return t.forEach(function(e){"Polygon"===e.type?n(e.arcs):"MultiPolygon"===e.type&&e.arcs.forEach(n)}),o.forEach(function(e){if(!e._){var t=[],n=[e];for(e._=1,a.push(t);e=n.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){i[0>e?~e:e].forEach(function(e){e._||(e._=1,n.push(e))})})})}}),o.forEach(function(e){delete e._}),{type:"MultiPolygon",arcs:a.map(function(t){var n,o=[];if(t.forEach(function(e){e.forEach(function(e){e.forEach(function(e){i[0>e?~e:e].length<2&&o.push(e)})})}),o=l(e,o),(n=o.length)>1)for(var a,s=r(t[0][0]),u=0;n>u;++u)if(s===r(o[u])){a=o[0],o[0]=o[u],o[u]=a;break}return o})}}function y(e){function t(e,t){e.forEach(function(e){0>e&&(e=~e);var n=i[e];n?n.push(t):i[e]=[t]})}function n(e,n){e.forEach(function(e){t(e,n)})}function r(e,t){"GeometryCollection"===e.type?e.geometries.forEach(function(e){r(e,t)}):e.type in s&&s[e.type](e.arcs,t)}var i={},a=e.map(function(){return[]}),s={LineString:t,MultiLineString:n,Polygon:n,MultiPolygon:function(e,t){e.forEach(function(e){n(e,t)})}};e.forEach(r);for(var u in i)for(var l=i[u],c=l.length,f=0;c>f;++f)for(var h=f+1;c>h;++h){var p,d=l[f],v=l[h];(p=a[d])[u=o(p,v)]!==v&&p.splice(u,0,v),(p=a[v])[u=o(p,d)]!==d&&p.splice(u,0,d)}return a}function m(e,t){return e[1][2]-t[1][2]}function _(){function e(e,t){for(;t>0;){var n=(t+1>>1)-1,i=r[n];if(m(e,i)>=0)break;r[i._=t]=i,r[e._=t=n]=e}}function t(e,t){for(;;){var n=t+1<<1,o=n-1,a=t,s=r[a];if(i>o&&m(r[o],s)<0&&(s=r[a=o]),i>n&&m(r[n],s)<0&&(s=r[a=n]),a===t)break;r[s._=t]=s,r[e._=t=a]=e}}var n={},r=[],i=0;return n.push=function(t){return e(r[t._=i]=t,i++),i},n.pop=function(){if(!(0>=i)){var e,n=r[0];return--i>0&&(e=r[i],t(r[e._=0]=e,0)),n}},n.remove=function(n){var o,a=n._;if(r[a]===n)return a!==--i&&(o=r[i],(m(o,n)<0?e:t)(r[o._=a]=o,a)),a},n}function g(e,t){function i(e){s.remove(e),e[1][2]=t(e),s.push(e)}var o=n(e.transform),a=r(e.transform),s=_();return t||(t=h),e.arcs.forEach(function(e){var n,r,u,l,c=[],f=0;for(r=0,u=e.length;u>r;++r)l=e[r],o(e[r]=[l[0],l[1],1/0],r);for(r=1,u=e.length-1;u>r;++r)n=e.slice(r-1,r+2),n[1][2]=t(n),c.push(n),s.push(n);for(r=0,u=c.length;u>r;++r)n=c[r],n.previous=c[r-1],n.next=c[r+1];for(;n=s.pop();){var h=n.previous,p=n.next;n[1][2]<f?n[1][2]=f:f=n[1][2],h&&(h.next=p,h[2]=n[2],i(h)),p&&(p.previous=h,p[0]=n[0],i(p))}e.forEach(a)}),e}var b="1.6.24";e.version=b,e.mesh=c,e.meshArcs=f,e.merge=d,e.mergeArcs=v,e.feature=a,e.neighbors=y,e.presimplify=g})},function(e,t,n){var r=n(62);e.exports=function(e){return{type:"FeatureCollection",features:e.reduce(function(e,t){return e.concat(r(t).features)},[])}}},function(e,t){function n(e){if(!e||!e.type)return null;var t=r[e.type];return t?"geometry"===t?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:e}]}:"feature"===t?{type:"FeatureCollection",features:[e]}:"featurecollection"===t?e:void 0:null}e.exports=n;var r={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"}},function(e,t){"use strict";function n(e,t,n){n=n||2;var i=t&&t.length,a=i?t[0]*n:e.length,s=r(e,0,a,n,!0),u=[];if(!s)return u;var l,f,h,p,d,v,y;if(i&&(s=c(e,t,s,n)),e.length>80*n){l=h=e[0],f=p=e[1];for(var m=n;a>m;m+=n)d=e[m],v=e[m+1],l>d&&(l=d),f>v&&(f=v),d>h&&(h=d),v>p&&(p=v);y=Math.max(h-l,p-f)}return o(s,u,n,l,f,y),u}function r(e,t,n,r,i){var o,a,s,u=0;for(o=t,a=n-r;n>o;o+=r)u+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;if(i===u>0)for(o=t;n>o;o+=r)s=T(o,e[o],e[o+1],s);else for(o=n-r;o>=t;o-=r)s=T(o,e[o],e[o+1],s);return s}function i(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!x(r,r.next)&&0!==b(r.prev,r,r.next))r=r.next;else{if(P(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function o(e,t,n,r,c,f,h){if(e){!h&&f&&d(e,r,c,f);for(var p,v,y=e;e.prev!==e.next;)if(p=e.prev,v=e.next,f?s(e,r,c,f):a(e))t.push(p.i/n),t.push(e.i/n),t.push(v.i/n),P(e),e=v.next,y=v.next;else if(e=v,e===y){h?1===h?(e=u(e,t,n),o(e,t,n,r,c,f,2)):2===h&&l(e,t,n,r,c,f):o(i(e),t,n,r,c,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(b(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(_(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&b(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function s(e,t,n,r){var i=e.prev,o=e,a=e.next;if(b(i,o,a)>=0)return!1;for(var s=i.x<o.x?i.x<a.x?i.x:a.x:o.x<a.x?o.x:a.x,u=i.y<o.y?i.y<a.y?i.y:a.y:o.y<a.y?o.y:a.y,l=i.x>o.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,c=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,f=y(s,u,t,n,r),h=y(l,c,t,n,r),p=e.nextZ;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&_(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=f;){if(p!==e.prev&&p!==e.next&&_(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function u(e,t,n){var r=e;do{var i=r.prev,o=r.next.next;w(i,r,r.next,o)&&O(i,o)&&O(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),P(r),P(r.next),r=e=o),r=r.next}while(r!==e);return r}function l(e,t,n,r,a,s){var u=e;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&g(u,l)){var c=M(u,l);return u=i(u,u.next),c=i(c,c.next),o(u,t,n,r,a,s),void o(c,t,n,r,a,s)}l=l.next}u=u.next}while(u!==e)}function c(e,t,n,o){var a,s,u,l,c,p=[];for(a=0,s=t.length;s>a;a++)u=t[a]*o,l=s-1>a?t[a+1]*o:e.length,c=r(e,u,l,o,!1),c===c.next&&(c.steiner=!0),p.push(m(c));for(p.sort(f),a=0;a<p.length;a++)h(p[a],n),n=i(n,n.next);return n}function f(e,t){return e.x-t.x}function h(e,t){if(t=p(e,t)){var n=M(t,e);i(n,n.next)}}function p(e,t){var n,r=t,i=e.x,o=e.y,a=-(1/0);do{if(o<=r.y&&o>=r.next.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);i>=s&&s>a&&(a=s,n=r.x<r.next.x?r:r.next)}r=r.next}while(r!==t);if(!n)return null;if(e.x===n.x)return n.prev;var u,l=n,c=1/0;for(r=n.next;r!==l;)i>=r.x&&r.x>=n.x&&_(o<n.y?i:a,o,n.x,n.y,o<n.y?a:i,o,r.x,r.y)&&(u=Math.abs(o-r.y)/(i-r.x),(c>u||u===c&&r.x>n.x)&&O(r,e)&&(n=r,c=u)),r=r.next;return n}function d(e,t,n,r){var i=e;do null===i.z&&(i.z=y(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,v(i)}function v(e){var t,n,r,i,o,a,s,u,l=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,r=n,s=0,t=0;l>t&&(s++,r=r.nextZ,r);t++);for(u=l;s>0||u>0&&r;)0===s?(i=r,r=r.nextZ,u--):0!==u&&r?n.z<=r.z?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--):(i=n,n=n.nextZ,s--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(a>1);return e}function y(e,t,n,r,i){return e=32767*(e-n)/i,t=32767*(t-r)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function m(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function _(e,t,n,r,i,o,a,s){return(i-a)*(t-s)-(e-a)*(o-s)>=0&&(e-a)*(r-s)-(n-a)*(t-s)>=0&&(n-a)*(o-s)-(i-a)*(r-s)>=0}function g(e,t){return x(e,t)||e.next.i!==t.i&&e.prev.i!==t.i&&!k(e,t)&&O(e,t)&&O(t,e)&&E(e,t)}function b(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function x(e,t){return e.x===t.x&&e.y===t.y}function w(e,t,n,r){return b(e,t,n)>0!=b(e,t,r)>0&&b(n,r,e)>0!=b(n,r,t)>0}function k(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&w(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function O(e,t){return b(e.prev,e,e.next)<0?b(e,t,e.next)>=0&&b(e,e.prev,t)>=0:b(e,t,e.prev)<0||b(e,e.next,t)<0}function E(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do n.y>o!=n.next.y>o&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function M(e,t){var n=new j(e.i,e.x,e.y),r=new j(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function T(e,t,n,r){var i=new j(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function P(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function j(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}e.exports=n},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(3),o=r(i),a=function(e,t,n){function r(){a=e.map(function(e){return[e[0],h.top,e[1]]}),s=t,u=t}function i(){a=[],e.forEach(function(e){a.push([e[0],h.top,e[1]])}),e.forEach(function(e){a.push([e[0],h.bottom,e[1]])}),s=[];for(var n=0;p>n;n++)n===p-1?(s.push([n+p,p,n]),s.push([0,n,p])):(s.push([n+p,n+p+1,n]),s.push([n+1,n,n+p+1]));if(c=[].concat(s),h.closed){var r=t,i=r.map(function(e){return e.map(function(e){return e+p})});i=i.map(function(e){return[e[0],e[2],e[1]]}),s=s.concat(r).concat(i),u=r,l=i}}var a,s,u,l,c,f={top:1,bottom:0,closed:!0},h=(0,o["default"])({},f,n),p=e.length;return h.top===h.bottom?r():i(),{positions:a,faces:s,top:u,bottom:l,sides:c}};t["default"]=a,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i),a=function(){var e=function(e,t){var n,r=new o["default"].BufferGeometry,i=new Float32Array(3*e.verticesCount),a=new Float32Array(3*e.verticesCount);e.pickingIds&&(n=new Float32Array(e.verticesCount));for(var s,u,l,c=0,f=0;f<e.vertices.length;f++){s=e.vertices[f],u=e.colours[f],n&&(l=e.pickingIds[f]);for(var h=0;h<s.length;h++){var p=s[h][0]+t.x,d=s[h][1],v=s[h][2]+t.y,y=u[h];i[3*c+0]=p,i[3*c+1]=d,i[3*c+2]=v,a[3*c+0]=y[0],a[3*c+1]=y[1],a[3*c+2]=y[2],n&&(n[c]=l),c++}}return r.addAttribute("position",new o["default"].BufferAttribute(i,3)),r.addAttribute("color",new o["default"].BufferAttribute(a,3)),n&&r.addAttribute("pickingId",new o["default"].BufferAttribute(n,1)),r.computeBoundingBox(),r},t=function(e,t){var n,r=new o["default"].BufferGeometry,i=new Float32Array(9*e.facesCount),a=new Float32Array(9*e.facesCount),s=new Float32Array(9*e.facesCount);e.pickingIds&&(n=new Float32Array(3*e.facesCount));for(var u,l,c,f,h,p=new o["default"].Vector3,d=new o["default"].Vector3,v=new o["default"].Vector3,y=new o["default"].Vector3,m=new o["default"].Vector3,_=0,g=0;g<e.faces.length;g++){l=e.faces[g],c=e.vertices[g],f=e.colours[g],n&&(h=e.pickingIds[g]);for(var b=0;b<l.length;b++){u=l[b][0];var x=c[u][0]+t.x,w=c[u][1],k=c[u][2]+t.y,O=f[b][0];u=l[b][1];var E=c[u][0]+t.x,M=c[u][1],T=c[u][2]+t.y,P=f[b][1];u=l[b][2];var j=c[u][0]+t.x,S=c[u][1],L=c[u][2]+t.y,C=f[b][2];p.set(x,w,k),d.set(E,M,T),v.set(j,S,L),y.subVectors(v,d),m.subVectors(p,d),y.cross(m),y.normalize();var A=y.x,R=y.y,D=y.z;i[9*_+0]=x,i[9*_+1]=w,i[9*_+2]=k,a[9*_+0]=A,a[9*_+1]=R,a[9*_+2]=D,s[9*_+0]=O[0],s[9*_+1]=O[1],s[9*_+2]=O[2],i[9*_+3]=E,i[9*_+4]=M,i[9*_+5]=T,a[9*_+3]=A,a[9*_+4]=R,a[9*_+5]=D,s[9*_+3]=P[0],s[9*_+4]=P[1],s[9*_+5]=P[2],i[9*_+6]=j,i[9*_+7]=S,i[9*_+8]=L,a[9*_+6]=A,a[9*_+7]=R,a[9*_+8]=D,s[9*_+6]=C[0],s[9*_+7]=C[1],s[9*_+8]=C[2],n&&(n[3*_+0]=h,n[3*_+1]=h,n[3*_+2]=h),_++}}return r.addAttribute("position",new o["default"].BufferAttribute(i,3)),r.addAttribute("normal",new o["default"].BufferAttribute(a,3)),r.addAttribute("color",new o["default"].BufferAttribute(s,3)),n&&r.addAttribute("pickingId",new o["default"].BufferAttribute(n,1)),r.computeBoundingBox(),r};return{createLineGeometry:e,createGeometry:t}}();t["default"]=a,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(24),o=r(i),a=n(67),s=r(a),u=function(){o["default"].ShaderMaterial.call(this,{uniforms:{size:{type:"f",value:.01},scale:{type:"f",value:400}},vertexShader:s["default"].vertexShader,fragmentShader:s["default"].fragmentShader}),this.linePadding=2};u.prototype=Object.create(o["default"].ShaderMaterial.prototype),u.prototype.constructor=u,u.prototype.setPointSize=function(e){this.uniforms.size.value=e},u.prototype.setPointScale=function(e){this.uniforms.scale.value=e},t["default"]=u,e.exports=t["default"]},function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n={vertexShader:["attribute float pickingId;","","varying vec4 worldId;","","void main() {"," vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );"," vec3 a = fract(vec3(1.0/255.0, 1.0/(255.0*255.0), 1.0/(255.0*255.0*255.0)) * pickingId);"," a -= a.xxy * vec3(0.0, 1.0/255.0, 1.0/255.0);"," worldId = vec4(a,1);"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#ifdef GL_ES\n","precision highp float;\n","#endif\n","","varying vec4 worldId;","","void main() {"," gl_FragColor = worldId;","}"].join("\n")};t["default"]=n,e.exports=t["default"]},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},s=n(55),u=r(s),l=n(3),c=r(l),f=function(e){function t(e,n){i(this,t);var r={topojson:!0};n=(0,c["default"])({},r,n),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,n)}return o(t,e),t}(u["default"]);t["default"]=f;var h=function(e,t){return new f(e,t)};t.topoJSONTileLayer=h},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},u=n(31),l=r(u),c=n(24),f=r(c),h=n(57),p=r(h),d=n(3),v=r(d),y=n(11),m=n(10),_=n(59),g=r(_),b=n(65),x=r(b),w=n(66),k=r(w),O=function(e){function t(e,n){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,n),this._geojson=e,this._defaultStyle=g["default"].defaultStyle;var r={picking:!1,topojson:!1,filter:null,onClick:null,style:this._defaultStyle};this._options=(0,v["default"])({},r,n),"function"==typeof n.style?this._options.style=n.style:this._options.style=(0,v["default"])({},r.style,n.style),this._pickingMesh=new f["default"].Object3D}return o(t,e),a(t,[{key:"_onAdd",value:function(e){this.addToPicking(this._pickingMesh),
"string"==typeof this._geojson?this._requestData(this._geojson):this._processData(this._geojson)}},{key:"_requestData",value:function(e){var t=this;this._request=(0,p["default"])({url:e,type:"json",crossOrigin:!0}).then(function(e){t._request=null,t._processData(e)})["catch"](function(e){console.error(e),t._request=null})}},{key:"_processData",value:function(e){var t=this;console.time("GeoJSON");var n=g["default"].mergeFeatures(e,this._options.topojson),r=n.features;this._options.filter&&(r=n.features.filter(this._options.filter));var i,o=this._options.style,a={vertices:[],faces:[],colours:[],facesCount:0,allFlat:!0},s={vertices:[],colours:[],verticesCount:0};this._options.picking&&(a.pickingIds=[],s.pickingIds=[]);var u=new f["default"].Color;r.forEach(function(e){if("Polygon"===e.geometry.type||"LineString"===e.geometry.type||"MultiLineString"===e.geometry.type){"function"==typeof t._options.style&&(o=(0,v["default"])(t._defaultStyle,t._options.style(e)));var n=e.geometry.coordinates;if("LineString"===e.geometry.type){u.set(o.lineColor),n=n.map(function(e){var n=(0,m.latLon)(e[1],e[0]),r=t._world.latLonToPoint(n);return i||(i=(0,y.point)(0,0),i.x=-1*r.x,i.y=-1*r.y,t._pointScale=t._world.pointScale(n)),[r.x,r.y]});var r=0;o.lineHeight&&(r=t._world.metresToWorld(o.lineHeight,t._pointScale));var l=g["default"].lineStringAttributes(n,u,r);if(s.vertices.push(l.vertices),s.colours.push(l.colours),t._options.picking){var c=t.getPickingId();s.pickingIds.push(c),t._options.onClick&&t._world.on("pick-"+c,function(n,r,i){t._options.onClick(e,n,r,i)})}s.verticesCount+=l.vertices.length}if("MultiLineString"===e.geometry.type){u.set(o.lineColor),n=n.map(function(e){return e.map(function(e){var n=(0,m.latLon)(e[1],e[0]),r=t._world.latLonToPoint(n);return i||(i=(0,y.point)(0,0),i.x=-1*r.x,i.y=-1*r.y,t._pointScale=t._world.pointScale(n)),[r.x,r.y]})});var r=0;o.lineHeight&&(r=t._world.metresToWorld(o.lineHeight,t._pointScale));var f=g["default"].multiLineStringAttributes(n,u,r);if(s.vertices.push(f.vertices),s.colours.push(f.colours),t._options.picking){var c=t.getPickingId();s.pickingIds.push(c),t._options.onClick&&t._world.on("pick-"+c,function(n,r,i){t._options.onClick(e,n,r,i)})}s.verticesCount+=f.vertices.length}if("Polygon"===e.geometry.type){u.set(o.color),n=n.map(function(e){return e.map(function(e){var n=(0,m.latLon)(e[1],e[0]),r=t._world.latLonToPoint(n);return i||(i=(0,y.point)(0,0),i.x=-1*r.x,i.y=-1*r.y,t._pointScale=t._world.pointScale(n)),[r.x,r.y]})});var r=0;o.height&&(r=t._world.metresToWorld(o.height,t._pointScale));var h=g["default"].polygonAttributes(n,u,r);if(a.vertices.push(h.vertices),a.faces.push(h.faces),a.colours.push(h.colours),t._options.picking){var c=t.getPickingId();a.pickingIds.push(c),t._options.onClick&&t._world.on("pick-"+c,function(n,r,i){t._options.onClick(e,n,r,i)})}a.allFlat&&!h.flat&&(a.allFlat=!1),a.facesCount+=h.faces.length}}});var l,c,h;if(this._options.picking&&(this._pickingMesh.position.x=-i.x,this._pickingMesh.position.z=-i.y),s.vertices.length>0&&(l=x["default"].createLineGeometry(s,i),c=new f["default"].LineBasicMaterial({vertexColors:f["default"].VertexColors,linewidth:o.lineWidth,transparent:o.lineTransparent,opacity:o.lineOpacity,blending:o.lineBlending}),h=new f["default"].LineSegments(l,c),void 0!==o.lineRenderOrder&&(c.depthWrite=!1,h.renderOrder=o.lineRenderOrder),this.add(h),this._options.picking)){c=new k["default"],c.side=f["default"].BackSide,c.linewidth=o.lineWidth+c.linePadding;var p=new f["default"].LineSegments(l,c);this._pickingMesh.add(p)}if(a.facesCount>0&&(l=x["default"].createGeometry(a,i),this._world._environment._skybox?(c=new f["default"].MeshStandardMaterial({vertexColors:f["default"].VertexColors,side:f["default"].BackSide}),c.roughness=1,c.metalness=.1,c.envMapIntensity=3,c.envMap=this._world._environment._skybox.getRenderTarget()):c=new f["default"].MeshPhongMaterial({vertexColors:f["default"].VertexColors,side:f["default"].BackSide}),h=new f["default"].Mesh(l,c),h.castShadow=!0,h.receiveShadow=!0,a.allFlat&&(c.depthWrite=!1,h.renderOrder=1),this.add(h),this._options.picking)){c=new k["default"],c.side=f["default"].BackSide;var p=new f["default"].Mesh(l,c);this._pickingMesh.add(p)}this._layer.position.x=-i.x,this._layer.position.z=-i.y,console.timeEnd("GeoJSON")}},{key:"_abortRequest",value:function(){this._request&&this._request.abort()}},{key:"destroy",value:function(){this._abortRequest(),this._request=null,this._pickingMesh=null,s(Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}}]),t}(l["default"]);t["default"]=O;var E=function(e,t){return new O(e,t)};t.geoJSONLayer=E},function(e,t,n){function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(e,t,n){for(var r=!0;r;){var i=e,o=t,a=n;r=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,o);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(a)}var l=Object.getPrototypeOf(i);if(null===l)return;e=l,t=o,n=a,r=!0,s=l=void 0}},s=n(69),u=r(s),l=n(3),c=r(l),f=function(e){function t(e,n){i(this,t);var r={topojson:!0};n=(0,c["default"])({},r,n),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,n)}return o(t,e),t}(u["default"]);t["default"]=f;var h=function(e,t){return new f(e,t)};t.topoJSONLayer=h}])});
//# sourceMappingURL=vizicities.min.js.map