From f722647c6fcc435d793fcef7f781ebc6c6f8d416 Mon Sep 17 00:00:00 2001 From: Tariq Soliman Date: Mon, 12 Jul 2021 17:52:03 -0700 Subject: [PATCH] WMS tile and projection support 1 --- dist/lithosphere.js | 2170 ++++++++++++++++++- dist/src/constants.d.ts | 1 - dist/src/controls/altitude.d.ts | 0 dist/src/controls/compass.d.ts | 15 - dist/src/controls/controls.d.ts | 0 dist/src/controls/coordinates.d.ts | 19 - dist/src/controls/crop.d.ts | 0 dist/src/controls/exaggerate.d.ts | 18 - dist/src/controls/home.d.ts | 13 - dist/src/controls/layers.d.ts | 17 - dist/src/controls/walk.d.ts | 16 - dist/src/core/CRS.d.ts | 12 + dist/src/core/projection.d.ts | 31 +- dist/src/layers/curtain.d.ts | 0 dist/src/layers/model.d.ts | 0 dist/src/layers/overlay.d.ts | 0 dist/src/layers/tile.d.ts | 8 - dist/src/parsers/demt.d.ts | 0 dist/src/secondary/OrbitControls.d.ts | 5 - dist/src/secondary/PNG/zlib.d.ts | 0 dist/src/secondary/PointerLockControls.d.ts | 1 - dist/src/secondary/loadingScreen.d.ts | 7 - dist/src/utils/index.d.ts | 2 + dist/src/utils/paths.d.ts | 21 + docs/pages/Constructor/constructor.markdown | 3 + example.html | 7 +- example2.html | 106 + package.json | 4 +- src/controls/observe.ts | 3 +- src/core/cameras.ts | 2 - src/core/crs.ts | 165 ++ src/core/events.ts | 11 +- src/core/projection.ts | 128 +- src/core/renderer.ts | 2 +- src/core/shaders.ts | 2 +- src/core/tiledWorld.ts | 261 ++- src/generalTypes.d.ts | 2 + src/layers/clamped.ts | 1 - src/layers/index.ts | 6 +- src/layers/tile3d.ts | 1 - src/layers/vector.ts | 6 +- src/lithosphere.ts | 14 +- src/parsers/rgba.ts | 4 +- src/secondary/PNG/png.ts | 4 +- src/secondary/sprites.ts | 5 +- src/utils/index.ts | 28 +- src/utils/paths.ts | 145 ++ 47 files changed, 2945 insertions(+), 321 deletions(-) delete mode 100644 dist/src/constants.d.ts delete mode 100644 dist/src/controls/altitude.d.ts delete mode 100644 dist/src/controls/compass.d.ts delete mode 100644 dist/src/controls/controls.d.ts delete mode 100644 dist/src/controls/coordinates.d.ts delete mode 100644 dist/src/controls/crop.d.ts delete mode 100644 dist/src/controls/exaggerate.d.ts delete mode 100644 dist/src/controls/home.d.ts delete mode 100644 dist/src/controls/layers.d.ts delete mode 100644 dist/src/controls/walk.d.ts create mode 100644 dist/src/core/CRS.d.ts delete mode 100644 dist/src/layers/curtain.d.ts delete mode 100644 dist/src/layers/model.d.ts delete mode 100644 dist/src/layers/overlay.d.ts delete mode 100644 dist/src/layers/tile.d.ts delete mode 100644 dist/src/parsers/demt.d.ts delete mode 100644 dist/src/secondary/OrbitControls.d.ts delete mode 100644 dist/src/secondary/PNG/zlib.d.ts delete mode 100644 dist/src/secondary/PointerLockControls.d.ts delete mode 100644 dist/src/secondary/loadingScreen.d.ts create mode 100644 dist/src/utils/paths.d.ts create mode 100644 example2.html create mode 100644 src/core/crs.ts create mode 100644 src/utils/paths.ts diff --git a/dist/lithosphere.js b/dist/lithosphere.js index eb5041e..e685340 100644 --- a/dist/lithosphere.js +++ b/dist/lithosphere.js @@ -1 +1,2169 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("LithoSphere",[],e):"object"==typeof exports?exports.LithoSphere=e():t.LithoSphere=e()}(this,(function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="C:\\Users\\tsoliman\\Documents\\Projects\\LithoSphere\\dist/",n(n.s=14)}([function(t,e,n){"use strict";n.r(e),n.d(e,"earthRadius",(function(){return i})),n.d(e,"factors",(function(){return r})),n.d(e,"unitsFactors",(function(){return s})),n.d(e,"areaFactors",(function(){return a})),n.d(e,"feature",(function(){return o})),n.d(e,"geometry",(function(){return l})),n.d(e,"point",(function(){return h})),n.d(e,"points",(function(){return c})),n.d(e,"polygon",(function(){return u})),n.d(e,"polygons",(function(){return d})),n.d(e,"lineString",(function(){return p})),n.d(e,"lineStrings",(function(){return f})),n.d(e,"featureCollection",(function(){return m})),n.d(e,"multiLineString",(function(){return g})),n.d(e,"multiPoint",(function(){return v})),n.d(e,"multiPolygon",(function(){return y})),n.d(e,"geometryCollection",(function(){return x})),n.d(e,"round",(function(){return _})),n.d(e,"radiansToLength",(function(){return b})),n.d(e,"lengthToRadians",(function(){return M})),n.d(e,"lengthToDegrees",(function(){return w})),n.d(e,"bearingToAzimuth",(function(){return S})),n.d(e,"radiansToDegrees",(function(){return E})),n.d(e,"degreesToRadians",(function(){return T})),n.d(e,"convertLength",(function(){return L})),n.d(e,"convertArea",(function(){return A})),n.d(e,"isNumber",(function(){return C})),n.d(e,"isObject",(function(){return P})),n.d(e,"validateBBox",(function(){return R})),n.d(e,"validateId",(function(){return O}));var i=6371008.8,r={centimeters:100*i,centimetres:100*i,degrees:i/111325,feet:3.28084*i,inches:39.37*i,kilometers:i/1e3,kilometres:i/1e3,meters:i,metres:i,miles:i/1609.344,millimeters:1e3*i,millimetres:1e3*i,nauticalmiles:i/1852,radians:1,yards:i/1.0936},s={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/i,yards:1/1.0936},a={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function o(t,e,n){void 0===n&&(n={});var i={type:"Feature"};return(0===n.id||n.id)&&(i.id=n.id),n.bbox&&(i.bbox=n.bbox),i.properties=e||{},i.geometry=t,i}function l(t,e,n){switch(void 0===n&&(n={}),t){case"Point":return h(e).geometry;case"LineString":return p(e).geometry;case"Polygon":return u(e).geometry;case"MultiPoint":return v(e).geometry;case"MultiLineString":return g(e).geometry;case"MultiPolygon":return y(e).geometry;default:throw new Error(t+" is invalid")}}function h(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!C(t[0])||!C(t[1]))throw new Error("coordinates must contain numbers");return o({type:"Point",coordinates:t},e,n)}function c(t,e,n){return void 0===n&&(n={}),m(t.map((function(t){return h(t,e)})),n)}function u(t,e,n){void 0===n&&(n={});for(var i=0,r=t;i=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n}function b(t,e){void 0===e&&(e="kilometers");var n=r[e];if(!n)throw new Error(e+" units is invalid");return t*n}function M(t,e){void 0===e&&(e="kilometers");var n=r[e];if(!n)throw new Error(e+" units is invalid");return t/n}function w(t,e){return E(M(t,e))}function S(t){var e=t%360;return e<0&&(e+=360),e}function E(t){return 180*(t%(2*Math.PI))/Math.PI}function T(t){return t%360*Math.PI/180}function L(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("length must be a positive number");return b(M(t,e),n)}function A(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=a[e];if(!i)throw new Error("invalid original units");var r=a[n];if(!r)throw new Error("invalid final units");return t/i*r}function C(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function P(t){return!!t&&t.constructor===Object}function R(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!C(t))throw new Error("bbox must only contain numbers")}))}function O(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}},function(t,e,n){"use strict";n.r(e),n.d(e,"coordEach",(function(){return r})),n.d(e,"coordReduce",(function(){return s})),n.d(e,"propEach",(function(){return a})),n.d(e,"propReduce",(function(){return o})),n.d(e,"featureEach",(function(){return l})),n.d(e,"featureReduce",(function(){return h})),n.d(e,"coordAll",(function(){return c})),n.d(e,"geomEach",(function(){return u})),n.d(e,"geomReduce",(function(){return d})),n.d(e,"flattenEach",(function(){return p})),n.d(e,"flattenReduce",(function(){return f})),n.d(e,"segmentEach",(function(){return m})),n.d(e,"segmentReduce",(function(){return g})),n.d(e,"lineEach",(function(){return v})),n.d(e,"lineReduce",(function(){return y})),n.d(e,"findSegment",(function(){return x})),n.d(e,"findPoint",(function(){return _}));var i=n(0);function r(t,e,n){if(null!==t)for(var i,s,a,o,l,h,c,u,d=0,p=0,f=t.type,m="FeatureCollection"===f,g="Feature"===f,v=m?t.features.length:1,y=0;yh||p>c||f>u)return l=r,h=n,c=p,u=f,void(a=0);var m=Object(i.lineString)([l,r],t.properties);if(!1===e(m,n,s,f,a))return!1;a++,l=r}))&&void 0}}}))}function g(t,e,n){var i=n,r=!1;return m(t,(function(t,s,a,o,l){i=!1===r&&void 0===n?t:e(i,t,s,a,o,l),r=!0})),i}function v(t,e){if(!t)throw new Error("geojson is required");p(t,(function(t,n,r){if(null!==t.geometry){var s=t.geometry.type,a=t.geometry.coordinates;switch(s){case"LineString":if(!1===e(t,n,r,0,0))return!1;break;case"Polygon":for(var o=0;o=0;i--){var r=t[i];"."===r?t.splice(i,1):".."===r?(t.splice(i,1),n++):n&&(t.splice(i,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function i(t,e){if(t.filter)return t.filter(e);for(var n=[],i=0;i=-1&&!r;s--){var a=s>=0?arguments[s]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(e=a+"/"+e,r="/"===a.charAt(0))}return(r?"/":"")+(e=n(i(e.split("/"),(function(t){return!!t})),!r).join("/"))||"."},e.normalize=function(t){var s=e.isAbsolute(t),a="/"===r(t,-1);return(t=n(i(t.split("/"),(function(t){return!!t})),!s).join("/"))||s||(t="."),t&&a&&(t+="/"),(s?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(i(t,(function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t})).join("/"))},e.relative=function(t,n){function i(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var r=i(t.split("/")),s=i(n.split("/")),a=Math.min(r.length,s.length),o=a,l=0;l=1;--s)if(47===(e=t.charCodeAt(s))){if(!r){i=s;break}}else r=!1;return-1===i?n?"/":".":n&&1===i?"/":t.slice(0,i)},e.basename=function(t,e){var n=function(t){"string"!=typeof t&&(t+="");var e,n=0,i=-1,r=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!r){n=e+1;break}}else-1===i&&(r=!1,i=e+1);return-1===i?"":t.slice(n,i)}(t);return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n},e.extname=function(t){"string"!=typeof t&&(t+="");for(var e=-1,n=0,i=-1,r=!0,s=0,a=t.length-1;a>=0;--a){var o=t.charCodeAt(a);if(47!==o)-1===i&&(r=!1,i=a+1),46===o?-1===e?e=a:1!==s&&(s=1):-1!==e&&(s=-1);else if(!r){n=a+1;break}}return-1===e||-1===i||0===s||1===s&&e===i-1&&e===n+1?"":t.slice(e,i)};var r="b"==="ab".substr(-1)?function(t,e,n){return t.substr(e,n)}:function(t,e,n){return e<0&&(e=t.length+e),t.substr(e,n)}}).call(this,n(10))},function(t,e,n){var i=n(7),r=n(0),s=n(1),a=n(9).default,o=s.featureEach,l=(s.coordEach,r.polygon,r.featureCollection);function h(t){var e=i(t);return e.insert=function(t){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:a(t),i.prototype.insert.call(this,t)},e.load=function(t){var e=[];return Array.isArray(t)?t.forEach((function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t),e.push(t)})):o(t,(function(t){if("Feature"!==t.type)throw new Error("invalid features");t.bbox=t.bbox?t.bbox:a(t),e.push(t)})),i.prototype.load.call(this,e)},e.remove=function(t,e){if("Feature"!==t.type)throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:a(t),i.prototype.remove.call(this,t,e)},e.clear=function(){return i.prototype.clear.call(this)},e.search=function(t){var e=i.prototype.search.call(this,this.toBBox(t));return l(e)},e.collides=function(t){return i.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=i.prototype.all.call(this);return l(t)},e.toJSON=function(){return i.prototype.toJSON.call(this)},e.fromJSON=function(t){return i.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&4===t.length)e=t;else if(Array.isArray(t)&&6===t.length)e=[t[0],t[1],t[3],t[4]];else if("Feature"===t.type)e=a(t);else{if("FeatureCollection"!==t.type)throw new Error("invalid geojson");e=a(t)}return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}t.exports=h,t.exports.default=h},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,i){"string"==typeof t&&(t=[[null,t,""]]);var r={};if(i)for(var s=0;si&&(n=i)}else{for(;!this.eof;)this.readBlock();n=this.bufferLength}return this.pos=n,this.buffer.subarray(e,n)},lookChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(t,e,n){for(var i=t+e;this.bufferLength<=i&&!this.eof;)this.readBlock();return new Stream(this.buffer,t,e,n)},skip:function(t){t||(t=1),this.pos+=t},reset:function(){this.pos=0}},t}(),window.FlateStream=function(){var t=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),e=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),n=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),i=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],r=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];function s(t){throw new Error(t)}function a(t){var e=0,n=t[e++],i=t[e++];-1!=n&&-1!=i||s("Invalid header in flate stream"),8!=(15&n)&&s("Unknown compression method in flate stream"),((n<<8)+i)%31!=0&&s("Bad FCHECK in flate stream"),32&i&&s("FDICT bit set in flate stream"),this.bytes=t,this.bytesPos=2,this.codeSize=0,this.codeBuf=0,DecodeStream.call(this)}return a.prototype=Object.create(DecodeStream.prototype),a.prototype.getBits=function(t){for(var e,n=this.codeSize,i=this.codeBuf,r=this.bytes,a=this.bytesPos;n>t,this.codeSize=n-=t,this.bytesPos=a,e},a.prototype.getCode=function(t){for(var e=t[0],n=t[1],i=this.codeSize,r=this.codeBuf,a=this.bytes,o=this.bytesPos;i>16,u=65535&h;return(0==i||i>c,this.codeSize=i-c,this.bytesPos=o,u},a.prototype.generateHuffmanTable=function(t){for(var e=t.length,n=0,i=0;in&&(n=t[i]);for(var r=1<>=1;for(i=c;i0;)e[f++]=r}var o=this.getBits(3);if(1&o&&(this.eof=!0),0!=(o>>=1)){var l,h;if(1==o)l=i,h=r;else if(2==o){for(var c=this.getBits(5)+257,u=this.getBits(5)+1,d=this.getBits(4)+4,p=Array(t.length),f=0;f=_&&(_=(O=this.ensureBuffer(b+1)).length),O[b++]=M;else{if(256==M)return void(this.bufferLength=b);var w=(M=e[M-=257])>>16;w>0&&(w=this.getBits(w));g=(65535&M)+w;M=this.getCode(h),(w=(M=n[M])>>16)>0&&(w=this.getBits(w));var S=(65535&M)+w;b+g>=_&&(_=(O=this.ensureBuffer(b+g)).length);for(var E=0;E0)for(e=0;ethis.data.length)throw new Error("Incomplete or corrupt PNG file")}}return t.load=function(e,n,i,r){var s=new XMLHttpRequest;return s.open("GET",e,!0),s.responseType="arraybuffer",s.withCredentials=n.withCredentials,s.onload=function(){var e=new Uint8Array(s.response||s.mozResponseArrayBuffer);if(404!==s.status){var n=new t(e);return"function"==typeof i?i(n):void 0}"function"==typeof r&&r(s.status)},s.send()},t.prototype.read=function(t){for(var e=new Array(t),n=0;n1&&n/r=t.minX&&e.maxY>=t.minY}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,e,n,r,s){for(var a,o=[e,n];o.length;)(n=o.pop())-(e=o.pop())<=r||(a=e+Math.ceil((n-e)/r/2)*r,i(t,a,e,n,s),o.push(e,a,a,n))}r.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],i=this.toBBox;if(!f(t,e))return n;for(var r,s,a,o,l=[];e;){for(r=0,s=e.children.length;r=0&&s[e].children.length>this._maxEntries;)this._split(s,e),e--;this._adjustParentBBoxes(r,s,e)},_split:function(t,e){var n=t[e],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);var s=this._chooseSplitIndex(n,r,i),o=m(n.children.splice(s,n.children.length-s));o.height=n.height,o.leaf=n.leaf,a(n,this.toBBox),a(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(n,o)},_splitRoot:function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var i,r,s,a,l,h,c,d,p,f,m,g,v,y;for(h=c=1/0,i=e;i<=n-e;i++)r=o(t,0,i,this.toBBox),s=o(t,i,n,this.toBBox),p=r,f=s,m=void 0,g=void 0,v=void 0,y=void 0,m=Math.max(p.minX,f.minX),g=Math.max(p.minY,f.minY),v=Math.min(p.maxX,f.maxX),y=Math.min(p.maxY,f.maxY),a=Math.max(0,v-m)*Math.max(0,y-g),l=u(r)+u(s),a=e;r--)s=t.children[r],l(c,t.leaf?a(s):s),u+=d(c);return u},_adjustParentBBoxes:function(t,e,n){for(var i=n;i>=0;i--)l(e[i],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():a(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},function(t,e,n){t.exports=function(){"use strict";function t(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function e(t,e){return te?1:0}return function(n,i,r,s,a){!function e(n,i,r,s,a){for(;s>r;){if(s-r>600){var o=s-r+1,l=i-r+1,h=Math.log(o),c=.5*Math.exp(2*h/3),u=.5*Math.sqrt(h*c*(o-c)/o)*(l-o/2<0?-1:1),d=Math.max(r,Math.floor(i-l*c/o+u)),p=Math.min(s,Math.floor(i+(o-l)*c/o+u));e(n,i,d,p,a)}var f=n[i],m=r,g=s;for(t(n,r,i),a(n[s],f)>0&&t(n,r,s);m0;)g--}0===a(n[r],f)?t(n,r,g):(g++,t(n,g,s)),g<=i&&(r=g+1),i<=g&&(s=g-1)}}(n,i,r||0,s||n.length-1,a||e)}}()},function(t,e,n){"use strict";n.r(e);var i=n(1);function r(t){var e=[1/0,1/0,-1/0,-1/0];return Object(i.coordEach)(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]1)for(var n=1;ndiv{width:60px;height:60px;background:rgba(255,255,255,0);position:absolute;left:50%;margin-left:-30px;top:50%;margin-top:-5px;border-radius:2px;border:2px solid rgba(255,255,255,0.7)}@-webkit-keyframes translateIn{30%{transform:rotateX(60deg) rotateY(0deg) rotateZ(45deg) translateZ(20px) scale(1);opacity:0.7;background:rgba(255,255,255,0.3)}100%{transform:rotateX(65deg) rotateY(0deg) rotateZ(45deg) translateZ(0px) scale(0.85);opacity:0;background:rgba(255,255,255,0)}}@keyframes translateIn{30%{transform:rotateX(60deg) rotateY(0deg) rotateZ(45deg) translateZ(20px) scale(1);opacity:0.7;background:rgba(255,255,255,0.3)}100%{transform:rotateX(65deg) rotateY(0deg) rotateZ(45deg) translateZ(0px) scale(0.85);opacity:0;background:rgba(255,255,255,0)}}._lithosphere_loadingscreen_loading>div{opacity:0}._lithosphere_loadingscreen_loading>div:nth-of-type(1){transform:rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(30px);-webkit-animation:translateIn 1.9s ease-in infinite 500ms;animation:translateIn 1.9s ease-in infinite 500ms}._lithosphere_loadingscreen_loading>div:nth-of-type(2){transform:rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(60px);-webkit-animation:translateIn 1.9s ease-in infinite 700ms;animation:translateIn 1.9s ease-in infinite 700ms}._lithosphere_loadingscreen_loading>div:nth-of-type(3){transform:rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(85px);-webkit-animation:translateIn 1.9s ease-in infinite 800ms;animation:translateIn 1.9s ease-in infinite 800ms}._lithosphere_loadingscreen_loading>div:nth-of-type(4){transform:rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(105px);-webkit-animation:translateIn 1.9s ease-in infinite 1000ms;animation:translateIn 1.9s ease-in infinite 1000ms}._lithosphere_loadingscreen_loading>div:nth-of-type(5){transform:rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(120px);-webkit-animation:translateIn 1.9s ease-in infinite 1200ms;animation:translateIn 1.9s ease-in infinite 1200ms}._lithosphere_loadingscreen_loading>div:nth-of-type(6){transform:rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(130px);-webkit-animation:translateIn 1.9s ease-in infinite 1400ms;animation:translateIn 1.9s ease-in infinite 1400ms}\n",""]),e.default=r},function(t,e,n){"use strict";n.r(e);const i=0,r=1,s=2;function a(){}Object.assign(a.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}},dispatchEvent:function(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,i=n.length;e>8&255]+o[t>>16&255]+o[t>>24&255]+"-"+o[255&e]+o[e>>8&255]+"-"+o[e>>16&15|64]+o[e>>24&255]+"-"+o[63&n|128]+o[n>>8&255]+"-"+o[n>>16&255]+o[n>>24&255]+o[255&i]+o[i>>8&255]+o[i>>16&255]+o[i>>24&255]).toUpperCase()},clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},damp:function(t,e,n,i){return h.lerp(t,e,1-Math.exp(-n*i))},pingpong:function(t,e=1){return e-Math.abs(h.euclideanModulo(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){return void 0!==t&&(l=t%2147483647),l=16807*l%2147483647,(l-1)/2147483646},degToRad:function(t){return t*h.DEG2RAD},radToDeg:function(t){return t*h.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,n,i,r){const s=Math.cos,a=Math.sin,o=s(n/2),l=a(n/2),h=s((e+i)/2),c=a((e+i)/2),u=s((e-i)/2),d=a((e-i)/2),p=s((i-e)/2),f=a((i-e)/2);switch(r){case"XYX":t.set(o*c,l*u,l*d,o*h);break;case"YZY":t.set(l*d,o*c,l*u,o*h);break;case"ZXZ":t.set(l*u,l*d,o*c,o*h);break;case"XZX":t.set(o*c,l*f,l*p,o*h);break;case"YXY":t.set(l*p,o*c,l*f,o*h);break;case"ZYZ":t.set(l*f,l*p,o*c,o*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}};class c{constructor(t=0,e=0){Object.defineProperty(this,"isVector2",{value:!0}),this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,s=this.y-t.y;return this.x=r*n-s*i+t.x,this.y=r*i+s*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}class u{constructor(){Object.defineProperty(this,"isMatrix3",{value:!0}),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(t,e,n,i,r,s,a,o,l){const h=this.elements;return h[0]=t,h[1]=i,h[2]=a,h[3]=e,h[4]=r,h[5]=o,h[6]=n,h[7]=s,h[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}clone(){return(new this.constructor).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[3],o=n[6],l=n[1],h=n[4],c=n[7],u=n[2],d=n[5],p=n[8],f=i[0],m=i[3],g=i[6],v=i[1],y=i[4],x=i[7],_=i[2],b=i[5],M=i[8];return r[0]=s*f+a*v+o*_,r[3]=s*m+a*y+o*b,r[6]=s*g+a*x+o*M,r[1]=l*f+h*v+c*_,r[4]=l*m+h*y+c*b,r[7]=l*g+h*x+c*M,r[2]=u*f+d*v+p*_,r[5]=u*m+d*y+p*b,r[8]=u*g+d*x+p*M,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],h=t[8];return e*s*h-e*a*l-n*r*h+n*a*o+i*r*l-i*s*o}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],h=t[8],c=h*s-a*l,u=a*o-h*r,d=l*r-s*o,p=e*c+n*u+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return t[0]=c*f,t[1]=(i*l-h*n)*f,t[2]=(a*n-i*s)*f,t[3]=u*f,t[4]=(h*e-i*o)*f,t[5]=(i*r-a*e)*f,t[6]=d*f,t[7]=(n*o-l*e)*f,t[8]=(s*e-n*r)*f,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).copy(this).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,s,a){const o=Math.cos(r),l=Math.sin(r);return this.set(n*o,n*l,-n*(o*s+l*a)+s+t,-i*l,i*o,-i*(-l*s+o*a)+a+e,0,0,1),this}scale(t,e){const n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this}rotate(t){const e=Math.cos(t),n=Math.sin(t),i=this.elements,r=i[0],s=i[3],a=i[6],o=i[1],l=i[4],h=i[7];return i[0]=e*r+n*o,i[3]=e*s+n*l,i[6]=e*a+n*h,i[1]=-n*r+e*o,i[4]=-n*s+e*l,i[7]=-n*a+e*h,this}translate(t,e){const n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}}let d;const p={getDataURL:function(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===d&&(d=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),d.width=t.width,d.height=t.height;const n=d.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=d}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}};let f=0;function m(t=m.DEFAULT_IMAGE,e=m.DEFAULT_MAPPING,n=1001,i=1001,r=1006,s=1008,a=1023,o=1009,l=1,d=3e3){Object.defineProperty(this,"id",{value:f++}),this.uuid=h.generateUUID(),this.name="",this.image=t,this.mipmaps=[],this.mapping=e,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=s,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=o,this.offset=new c(0,0),this.repeat=new c(1,1),this.center=new c(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new u,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=d,this.version=0,this.onUpdate=null}function g(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?p.getDataURL(t):t.data?{data:Array.prototype.slice.call(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}m.DEFAULT_IMAGE=void 0,m.DEFAULT_MAPPING=300,m.prototype=Object.assign(Object.create(a.prototype),{constructor:m,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){const i=this.image;if(void 0===i.uuid&&(i.uuid=h.generateUUID()),!e&&void 0===t.images[i.uuid]){let e;if(Array.isArray(i)){e=[];for(let t=0,n=i.length;t1)switch(this.wrapS){case 1e3:t.x=t.x-Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case 1e3:t.y=t.y-Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(m.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}});class v{constructor(t=0,e=0,n=0,i=1){Object.defineProperty(this,"isVector4",{value:!0}),this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i+s[12]*r,this.y=s[1]*e+s[5]*n+s[9]*i+s[13]*r,this.z=s[2]*e+s[6]*n+s[10]*i+s[14]*r,this.w=s[3]*e+s[7]*n+s[11]*i+s[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,r;const s=t.elements,a=s[0],o=s[4],l=s[8],h=s[1],c=s[5],u=s[9],d=s[2],p=s[6],f=s[10];if(Math.abs(o-h)<.01&&Math.abs(l-d)<.01&&Math.abs(u-p)<.01){if(Math.abs(o+h)<.1&&Math.abs(l+d)<.1&&Math.abs(u+p)<.1&&Math.abs(a+c+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const t=(a+1)/2,s=(c+1)/2,m=(f+1)/2,g=(o+h)/4,v=(l+d)/4,y=(u+p)/4;return t>s&&t>m?t<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(t),i=g/n,r=v/n):s>m?s<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(s),n=g/i,r=y/i):m<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(m),n=v/r,i=y/r),this.set(n,i,r,e),this}let m=Math.sqrt((p-u)*(p-u)+(l-d)*(l-d)+(h-o)*(h-o));return Math.abs(m)<.001&&(m=1),this.x=(p-u)/m,this.y=(l-d)/m,this.z=(h-o)/m,this.w=Math.acos((a+c+f-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}class y extends a{constructor(t,e,n){super(),Object.defineProperty(this,"isWebGLRenderTarget",{value:!0}),this.width=t,this.height=e,this.scissor=new v(0,0,t,e),this.scissorTest=!1,this.viewport=new v(0,0,t,e),n=n||{},this.texture=new m(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:1006,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}setSize(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}class x{constructor(t=0,e=0,n=0,i=1){Object.defineProperty(this,"isQuaternion",{value:!0}),this._x=t,this._y=e,this._z=n,this._w=i}static slerp(t,e,n,i){return n.copy(t).slerp(e,i)}static slerpFlat(t,e,n,i,r,s,a){let o=n[i+0],l=n[i+1],h=n[i+2],c=n[i+3];const u=r[s+0],d=r[s+1],p=r[s+2],f=r[s+3];if(c!==f||o!==u||l!==d||h!==p){let t=1-a;const e=o*u+l*d+h*p+c*f,n=e>=0?1:-1,i=1-e*e;if(i>Number.EPSILON){const r=Math.sqrt(i),s=Math.atan2(r,e*n);t=Math.sin(t*s)/r,a=Math.sin(a*s)/r}const r=a*n;if(o=o*t+u*r,l=l*t+d*r,h=h*t+p*r,c=c*t+f*r,t===1-a){const t=1/Math.sqrt(o*o+l*l+h*h+c*c);o*=t,l*=t,h*=t,c*=t}}t[e]=o,t[e+1]=l,t[e+2]=h,t[e+3]=c}static multiplyQuaternionsFlat(t,e,n,i,r,s){const a=n[i],o=n[i+1],l=n[i+2],h=n[i+3],c=r[s],u=r[s+1],d=r[s+2],p=r[s+3];return t[e]=a*p+h*c+o*d-l*u,t[e+1]=o*p+h*u+l*c-a*d,t[e+2]=l*p+h*d+a*u-o*c,t[e+3]=h*p-a*c-o*u-l*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=t._x,i=t._y,r=t._z,s=t._order,a=Math.cos,o=Math.sin,l=a(n/2),h=a(i/2),c=a(r/2),u=o(n/2),d=o(i/2),p=o(r/2);switch(s){case"XYZ":this._x=u*h*c+l*d*p,this._y=l*d*c-u*h*p,this._z=l*h*p+u*d*c,this._w=l*h*c-u*d*p;break;case"YXZ":this._x=u*h*c+l*d*p,this._y=l*d*c-u*h*p,this._z=l*h*p-u*d*c,this._w=l*h*c+u*d*p;break;case"ZXY":this._x=u*h*c-l*d*p,this._y=l*d*c+u*h*p,this._z=l*h*p+u*d*c,this._w=l*h*c-u*d*p;break;case"ZYX":this._x=u*h*c-l*d*p,this._y=l*d*c+u*h*p,this._z=l*h*p-u*d*c,this._w=l*h*c+u*d*p;break;case"YZX":this._x=u*h*c+l*d*p,this._y=l*d*c+u*h*p,this._z=l*h*p-u*d*c,this._w=l*h*c-u*d*p;break;case"XZY":this._x=u*h*c-l*d*p,this._y=l*d*c-u*h*p,this._z=l*h*p+u*d*c,this._w=l*h*c+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],r=e[8],s=e[1],a=e[5],o=e[9],l=e[2],h=e[6],c=e[10],u=n+a+c;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(h-o)*t,this._y=(r-l)*t,this._z=(s-i)*t}else if(n>a&&n>c){const t=2*Math.sqrt(1+n-a-c);this._w=(h-o)/t,this._x=.25*t,this._y=(i+s)/t,this._z=(r+l)/t}else if(a>c){const t=2*Math.sqrt(1+a-n-c);this._w=(r-l)/t,this._x=(i+s)/t,this._y=.25*t,this._z=(o+h)/t}else{const t=2*Math.sqrt(1+c-n-a);this._w=(s-i)/t,this._x=(r+l)/t,this._y=(o+h)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(h.clamp(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,s=t._w,a=e._x,o=e._y,l=e._z,h=e._w;return this._x=n*h+s*a+i*l-r*o,this._y=i*h+s*o+r*a-n*l,this._z=r*h+s*l+n*o-i*a,this._w=s*h-n*a-i*o-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,i=this._y,r=this._z,s=this._w;let a=s*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=s,this._x=n,this._y=i,this._z=r,this;const o=1-a*a;if(o<=Number.EPSILON){const t=1-e;return this._w=t*s+e*this._w,this._x=t*n+e*this._x,this._y=t*i+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(o),h=Math.atan2(l,a),c=Math.sin((1-e)*h)/l,u=Math.sin(e*h)/l;return this._w=s*c+this._w*u,this._x=n*c+this._x*u,this._y=i*c+this._y*u,this._z=r*c+this._z*u,this._onChangeCallback(),this}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}class _{constructor(t=0,e=0,n=0){Object.defineProperty(this,"isVector3",{value:!0}),this.x=t,this.y=e,this.z=n}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(M.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(M.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.elements,s=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*s,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*s,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*s,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,a=t.z,o=t.w,l=o*e+s*i-a*n,h=o*n+a*e-r*i,c=o*i+r*n-s*e,u=-r*e-s*n-a*i;return this.x=l*o+u*-r+h*-a-c*-s,this.y=h*o+u*-s+c*-r-l*-a,this.z=c*o+u*-a+l*-s-h*-r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=i*o-r*a,this.y=r*s-n*o,this.z=n*a-i*s,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return b.copy(this).projectOnVector(t),this.sub(b)}reflect(t){return this.sub(b.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(h.clamp(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}const b=new _,M=new x;class w{constructor(t,e){Object.defineProperty(this,"isBox3",{value:!0}),this.min=void 0!==t?t:new _(1/0,1/0,1/0),this.max=void 0!==e?e:new _(-1/0,-1/0,-1/0)}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,n=1/0,i=1/0,r=-1/0,s=-1/0,a=-1/0;for(let o=0,l=t.length;or&&(r=l),h>s&&(s=h),c>a&&(a=c)}return this.min.set(e,n,i),this.max.set(r,s,a),this}setFromBufferAttribute(t){let e=1/0,n=1/0,i=1/0,r=-1/0,s=-1/0,a=-1/0;for(let o=0,l=t.count;or&&(r=l),h>s&&(s=h),c>a&&(a=c)}return this.min.set(e,n,i),this.max.set(r,s,a),this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new _),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,T),T.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(D),N.subVectors(this.max,D),A.subVectors(t.a,D),C.subVectors(t.b,D),P.subVectors(t.c,D),R.subVectors(C,A),O.subVectors(P,C),I.subVectors(A,P);let e=[0,-R.z,R.y,0,-O.z,O.y,0,-I.z,I.y,R.z,0,-R.x,O.z,0,-O.x,I.z,0,-I.x,-R.y,R.x,0,-O.y,O.x,0,-I.y,I.x,0];return!!S(e,A,C,P,N)&&(e=[1,0,0,0,1,0,0,0,1],!!S(e,A,C,P,N)&&(z.crossVectors(R,O),e=[z.x,z.y,z.z],S(e,A,C,P,N)))}clampPoint(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new _),e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return T.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(T).length(),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(E[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),E[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),E[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),E[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),E[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),E[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),E[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),E[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(E)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}function S(t,e,n,i,r){for(let s=0,a=t.length-3;s<=a;s+=3){k.fromArray(t,s);const a=r.x*Math.abs(k.x)+r.y*Math.abs(k.y)+r.z*Math.abs(k.z),o=e.dot(k),l=n.dot(k),h=i.dot(k);if(Math.max(-Math.max(o,l,h),Math.min(o,l,h))>a)return!1}return!0}const E=[new _,new _,new _,new _,new _,new _,new _,new _],T=new _,L=new w,A=new _,C=new _,P=new _,R=new _,O=new _,I=new _,D=new _,N=new _,z=new _,k=new _,F=new w;class B{constructor(t,e){this.center=void 0!==t?t:new _,this.radius=void 0!==e?e:-1}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):F.setFromPoints(t).getCenter(n);let i=0;for(let e=0,r=t.length;ethis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new w),this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}}const U=new _,H=new _,j=new _,G=new _,V=new _,W=new _,q=new _;class X{constructor(t,e){this.origin=void 0!==t?t:new _,this.direction=void 0!==e?e:new _(0,0,-1)}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new _),e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,U)),this}closestPointToPoint(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new _),e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=U.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(U.copy(this.direction).multiplyScalar(e).add(this.origin),U.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){H.copy(t).add(e).multiplyScalar(.5),j.copy(e).sub(t).normalize(),G.copy(this.origin).sub(H);const r=.5*t.distanceTo(e),s=-this.direction.dot(j),a=G.dot(this.direction),o=-G.dot(j),l=G.lengthSq(),h=Math.abs(1-s*s);let c,u,d,p;if(h>0)if(c=s*o-a,u=s*a-o,p=r*h,c>=0)if(u>=-p)if(u<=p){const t=1/h;c*=t,u*=t,d=c*(c+s*u+2*a)+u*(s*c+u+2*o)+l}else u=r,c=Math.max(0,-(s*u+a)),d=-c*c+u*(u+2*o)+l;else u=-r,c=Math.max(0,-(s*u+a)),d=-c*c+u*(u+2*o)+l;else u<=-p?(c=Math.max(0,-(-s*r+a)),u=c>0?-r:Math.min(Math.max(-r,-o),r),d=-c*c+u*(u+2*o)+l):u<=p?(c=0,u=Math.min(Math.max(-r,-o),r),d=u*(u+2*o)+l):(c=Math.max(0,-(s*r+a)),u=c>0?r:Math.min(Math.max(-r,-o),r),d=-c*c+u*(u+2*o)+l);else u=s>0?-r:r,c=Math.max(0,-(s*u+a)),d=-c*c+u*(u+2*o)+l;return n&&n.copy(this.direction).multiplyScalar(c).add(this.origin),i&&i.copy(j).multiplyScalar(u).add(H),d}intersectSphere(t,e){U.subVectors(t.center,this.origin);const n=U.dot(this.direction),i=U.dot(U)-n*n,r=t.radius*t.radius;if(i>r)return null;const s=Math.sqrt(r-i),a=n-s,o=n+s;return a<0&&o<0?null:a<0?this.at(o,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,r,s,a,o;const l=1/this.direction.x,h=1/this.direction.y,c=1/this.direction.z,u=this.origin;return l>=0?(n=(t.min.x-u.x)*l,i=(t.max.x-u.x)*l):(n=(t.max.x-u.x)*l,i=(t.min.x-u.x)*l),h>=0?(r=(t.min.y-u.y)*h,s=(t.max.y-u.y)*h):(r=(t.max.y-u.y)*h,s=(t.min.y-u.y)*h),n>s||r>i?null:((r>n||n!=n)&&(n=r),(s=0?(a=(t.min.z-u.z)*c,o=(t.max.z-u.z)*c):(a=(t.max.z-u.z)*c,o=(t.min.z-u.z)*c),n>o||a>i?null:((a>n||n!=n)&&(n=a),(o=0?n:i,e)))}intersectsBox(t){return null!==this.intersectBox(t,U)}intersectTriangle(t,e,n,i,r){V.subVectors(e,t),W.subVectors(n,t),q.crossVectors(V,W);let s,a=this.direction.dot(q);if(a>0){if(i)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}G.subVectors(this.origin,t);const o=s*this.direction.dot(W.crossVectors(G,W));if(o<0)return null;const l=s*this.direction.dot(V.cross(G));if(l<0)return null;if(o+l>a)return null;const h=-s*G.dot(q);return h<0?null:this.at(h/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}class Y{constructor(){Object.defineProperty(this,"isMatrix4",{value:!0}),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(t,e,n,i,r,s,a,o,l,h,c,u,d,p,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=r,g[5]=s,g[9]=a,g[13]=o,g[2]=l,g[6]=h,g[10]=c,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Y).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,i=1/Z.setFromMatrixColumn(t,0).length(),r=1/Z.setFromMatrixColumn(t,1).length(),s=1/Z.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*s,e[9]=n[9]*s,e[10]=n[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const e=this.elements,n=t.x,i=t.y,r=t.z,s=Math.cos(n),a=Math.sin(n),o=Math.cos(i),l=Math.sin(i),h=Math.cos(r),c=Math.sin(r);if("XYZ"===t.order){const t=s*h,n=s*c,i=a*h,r=a*c;e[0]=o*h,e[4]=-o*c,e[8]=l,e[1]=n+i*l,e[5]=t-r*l,e[9]=-a*o,e[2]=r-t*l,e[6]=i+n*l,e[10]=s*o}else if("YXZ"===t.order){const t=o*h,n=o*c,i=l*h,r=l*c;e[0]=t+r*a,e[4]=i*a-n,e[8]=s*l,e[1]=s*c,e[5]=s*h,e[9]=-a,e[2]=n*a-i,e[6]=r+t*a,e[10]=s*o}else if("ZXY"===t.order){const t=o*h,n=o*c,i=l*h,r=l*c;e[0]=t-r*a,e[4]=-s*c,e[8]=i+n*a,e[1]=n+i*a,e[5]=s*h,e[9]=r-t*a,e[2]=-s*l,e[6]=a,e[10]=s*o}else if("ZYX"===t.order){const t=s*h,n=s*c,i=a*h,r=a*c;e[0]=o*h,e[4]=i*l-n,e[8]=t*l+r,e[1]=o*c,e[5]=r*l+t,e[9]=n*l-i,e[2]=-l,e[6]=a*o,e[10]=s*o}else if("YZX"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*h,e[4]=r-t*c,e[8]=i*c+n,e[1]=c,e[5]=s*h,e[9]=-a*h,e[2]=-l*h,e[6]=n*c+i,e[10]=t-r*c}else if("XZY"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*h,e[4]=-c,e[8]=l*h,e[1]=t*c+r,e[5]=s*h,e[9]=n*c-i,e[2]=i*c-n,e[6]=a*h,e[10]=r*c+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(K,t,Q)}lookAt(t,e,n){const i=this.elements;return et.subVectors(t,e),0===et.lengthSq()&&(et.z=1),et.normalize(),$.crossVectors(n,et),0===$.lengthSq()&&(1===Math.abs(n.z)?et.x+=1e-4:et.z+=1e-4,et.normalize(),$.crossVectors(n,et)),$.normalize(),tt.crossVectors(et,$),i[0]=$.x,i[4]=tt.x,i[8]=et.x,i[1]=$.y,i[5]=tt.y,i[9]=et.y,i[2]=$.z,i[6]=tt.z,i[10]=et.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[4],o=n[8],l=n[12],h=n[1],c=n[5],u=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],_=n[15],b=i[0],M=i[4],w=i[8],S=i[12],E=i[1],T=i[5],L=i[9],A=i[13],C=i[2],P=i[6],R=i[10],O=i[14],I=i[3],D=i[7],N=i[11],z=i[15];return r[0]=s*b+a*E+o*C+l*I,r[4]=s*M+a*T+o*P+l*D,r[8]=s*w+a*L+o*R+l*N,r[12]=s*S+a*A+o*O+l*z,r[1]=h*b+c*E+u*C+d*I,r[5]=h*M+c*T+u*P+d*D,r[9]=h*w+c*L+u*R+d*N,r[13]=h*S+c*A+u*O+d*z,r[2]=p*b+f*E+m*C+g*I,r[6]=p*M+f*T+m*P+g*D,r[10]=p*w+f*L+m*R+g*N,r[14]=p*S+f*A+m*O+g*z,r[3]=v*b+y*E+x*C+_*I,r[7]=v*M+y*T+x*P+_*D,r[11]=v*w+y*L+x*R+_*N,r[15]=v*S+y*A+x*O+_*z,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],s=t[1],a=t[5],o=t[9],l=t[13],h=t[2],c=t[6],u=t[10],d=t[14];return t[3]*(+r*o*c-i*l*c-r*a*u+n*l*u+i*a*d-n*o*d)+t[7]*(+e*o*d-e*l*u+r*s*u-i*s*d+i*l*h-r*o*h)+t[11]*(+e*l*c-e*a*d-r*s*c+n*s*d+r*a*h-n*l*h)+t[15]*(-i*a*h-e*o*c+e*a*u+i*s*c-n*s*u+n*o*h)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],h=t[8],c=t[9],u=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15],v=c*m*l-f*u*l+f*o*d-a*m*d-c*o*g+a*u*g,y=p*u*l-h*m*l-p*o*d+s*m*d+h*o*g-s*u*g,x=h*f*l-p*c*l+p*a*d-s*f*d-h*a*g+s*c*g,_=p*c*o-h*f*o-p*a*u+s*f*u+h*a*m-s*c*m,b=e*v+n*y+i*x+r*_;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const M=1/b;return t[0]=v*M,t[1]=(f*u*r-c*m*r-f*i*d+n*m*d+c*i*g-n*u*g)*M,t[2]=(a*m*r-f*o*r+f*i*l-n*m*l-a*i*g+n*o*g)*M,t[3]=(c*o*r-a*u*r-c*i*l+n*u*l+a*i*d-n*o*d)*M,t[4]=y*M,t[5]=(h*m*r-p*u*r+p*i*d-e*m*d-h*i*g+e*u*g)*M,t[6]=(p*o*r-s*m*r-p*i*l+e*m*l+s*i*g-e*o*g)*M,t[7]=(s*u*r-h*o*r+h*i*l-e*u*l-s*i*d+e*o*d)*M,t[8]=x*M,t[9]=(p*c*r-h*f*r-p*n*d+e*f*d+h*n*g-e*c*g)*M,t[10]=(s*f*r-p*a*r+p*n*l-e*f*l-s*n*g+e*a*g)*M,t[11]=(h*a*r-s*c*r-h*n*l+e*c*l+s*n*d-e*a*d)*M,t[12]=_*M,t[13]=(h*f*i-p*c*i+p*n*u-e*f*u-h*n*m+e*c*m)*M,t[14]=(p*a*i-s*f*i-p*n*o+e*f*o+s*n*m-e*a*m)*M,t[15]=(s*c*i-h*a*i+h*n*o-e*c*o-s*n*u+e*a*u)*M,this}scale(t){const e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,s=t.x,a=t.y,o=t.z,l=r*s,h=r*a;return this.set(l*s+n,l*a-i*o,l*o+i*a,0,l*a+i*o,h*a+n,h*o-i*s,0,l*o-i*a,h*o+i*s,r*o*o+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this}compose(t,e,n){const i=this.elements,r=e._x,s=e._y,a=e._z,o=e._w,l=r+r,h=s+s,c=a+a,u=r*l,d=r*h,p=r*c,f=s*h,m=s*c,g=a*c,v=o*l,y=o*h,x=o*c,_=n.x,b=n.y,M=n.z;return i[0]=(1-(f+g))*_,i[1]=(d+x)*_,i[2]=(p-y)*_,i[3]=0,i[4]=(d-x)*b,i[5]=(1-(u+g))*b,i[6]=(m+v)*b,i[7]=0,i[8]=(p+y)*M,i[9]=(m-v)*M,i[10]=(1-(u+f))*M,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.elements;let r=Z.set(i[0],i[1],i[2]).length();const s=Z.set(i[4],i[5],i[6]).length(),a=Z.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],J.copy(this);const o=1/r,l=1/s,h=1/a;return J.elements[0]*=o,J.elements[1]*=o,J.elements[2]*=o,J.elements[4]*=l,J.elements[5]*=l,J.elements[6]*=l,J.elements[8]*=h,J.elements[9]*=h,J.elements[10]*=h,e.setFromRotationMatrix(J),n.x=r,n.y=s,n.z=a,this}makePerspective(t,e,n,i,r,s){void 0===s&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const a=this.elements,o=2*r/(e-t),l=2*r/(n-i),h=(e+t)/(e-t),c=(n+i)/(n-i),u=-(s+r)/(s-r),d=-2*s*r/(s-r);return a[0]=o,a[4]=0,a[8]=h,a[12]=0,a[1]=0,a[5]=l,a[9]=c,a[13]=0,a[2]=0,a[6]=0,a[10]=u,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,n,i,r,s){const a=this.elements,o=1/(e-t),l=1/(n-i),h=1/(s-r),c=(e+t)*o,u=(n+i)*l,d=(s+r)*h;return a[0]=2*o,a[4]=0,a[8]=0,a[12]=-c,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-u,a[2]=0,a[6]=0,a[10]=-2*h,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<16;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}const Z=new _,J=new Y,K=new _(0,0,0),Q=new _(1,1,1),$=new _,tt=new _,et=new _;class nt{constructor(t=0,e=0,n=0,i=nt.DefaultOrder){Object.defineProperty(this,"isEuler",{value:!0}),this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._order=i||this._order,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e,n){const i=h.clamp,r=t.elements,s=r[0],a=r[4],o=r[8],l=r[1],c=r[5],u=r[9],d=r[2],p=r[6],f=r[10];switch(e=e||this._order){case"XYZ":this._y=Math.asin(i(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-i(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(i(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-d,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-i(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(i(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(o,f));break;case"XZY":this._z=Math.asin(-i(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!1!==n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return it.makeRotationFromQuaternion(t),this.setFromRotationMatrix(it,e,n)}setFromVector3(t,e){return this.set(t.x,t.y,t.z,e||this._order)}reorder(t){return rt.setFromEuler(this),this.setFromQuaternion(rt,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}toVector3(t){return t?t.set(this._x,this._y,this._z):new _(this._x,this._y,this._z)}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}nt.DefaultOrder="XYZ",nt.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];const it=new Y,rt=new x;class st{constructor(){this.mask=1}set(t){this.mask=1<1){for(let t=0;t1){for(let t=0;t0){i.children=[];for(let e=0;e0){i.animations=[];for(let e=0;e0&&(n.geometries=e),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),a.length>0&&(n.images=a),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),h.length>0&&(n.animations=h)}return n.object=i,n;function s(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e1?void 0:e.copy(n).multiplyScalar(r).add(t.start)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new _),t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||Mt.getNormalMatrix(t),i=this.coplanarPoint(_t).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}const St=new _,Et=new _,Tt=new _,Lt=new _,At=new _,Ct=new _,Pt=new _,Rt=new _,Ot=new _,It=new _;class Dt{constructor(t,e,n){this.a=void 0!==t?t:new _,this.b=void 0!==e?e:new _,this.c=void 0!==n?n:new _}static getNormal(t,e,n,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new _),i.subVectors(n,e),St.subVectors(t,e),i.cross(St);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(t,e,n,i,r){St.subVectors(i,e),Et.subVectors(n,e),Tt.subVectors(t,e);const s=St.dot(St),a=St.dot(Et),o=St.dot(Tt),l=Et.dot(Et),h=Et.dot(Tt),c=s*l-a*a;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new _),0===c)return r.set(-2,-1,-1);const u=1/c,d=(l*o-a*h)*u,p=(s*h-a*o)*u;return r.set(1-d-p,p,d)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,Lt),Lt.x>=0&&Lt.y>=0&&Lt.x+Lt.y<=1}static getUV(t,e,n,i,r,s,a,o){return this.getBarycoord(t,e,n,i,Lt),o.set(0,0),o.addScaledVector(r,Lt.x),o.addScaledVector(s,Lt.y),o.addScaledVector(a,Lt.z),o}static isFrontFacing(t,e,n,i){return St.subVectors(n,e),Et.subVectors(t,e),St.cross(Et).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return St.subVectors(this.c,this.b),Et.subVectors(this.a,this.b),.5*St.cross(Et).length()}getMidpoint(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new _),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Dt.getNormal(this.a,this.b,this.c,t)}getPlane(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new wt),t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Dt.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,i,r){return Dt.getUV(t,this.a,this.b,this.c,e,n,i,r)}containsPoint(t){return Dt.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Dt.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new _);const n=this.a,i=this.b,r=this.c;let s,a;At.subVectors(i,n),Ct.subVectors(r,n),Rt.subVectors(t,n);const o=At.dot(Rt),l=Ct.dot(Rt);if(o<=0&&l<=0)return e.copy(n);Ot.subVectors(t,i);const h=At.dot(Ot),c=Ct.dot(Ot);if(h>=0&&c<=h)return e.copy(i);const u=o*c-h*l;if(u<=0&&o>=0&&h<=0)return s=o/(o-h),e.copy(n).addScaledVector(At,s);It.subVectors(t,r);const d=At.dot(It),p=Ct.dot(It);if(p>=0&&d<=p)return e.copy(r);const f=d*l-o*p;if(f<=0&&l>=0&&p<=0)return a=l/(l-p),e.copy(n).addScaledVector(Ct,a);const m=h*p-d*c;if(m<=0&&c-h>=0&&d-p>=0)return Pt.subVectors(r,i),a=(c-h)/(c-h+(d-p)),e.copy(i).addScaledVector(Pt,a);const g=1/(m+f+u);return s=f*g,a=u*g,e.copy(n).addScaledVector(At,s).addScaledVector(Ct,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const Nt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},zt={h:0,s:0,l:0},kt={h:0,s:0,l:0};function Ft(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function Bt(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Ut(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class Ht{constructor(t,e,n){return Object.defineProperty(this,"isColor",{value:!0}),void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this}setRGB(t,e,n){return this.r=t,this.g=e,this.b=n,this}setHSL(t,e,n){if(t=h.euclideanModulo(t,1),e=h.clamp(e,0,1),n=h.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=Ft(r,i,t+1/3),this.g=Ft(r,i,t),this.b=Ft(r,i,t-1/3)}return this}setStyle(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const i=n[1],r=n[2];switch(i){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,e(t[4]),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,e(t[4]),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r)){const n=parseFloat(t[1])/360,i=parseInt(t[2],10)/100,r=parseInt(t[3],10)/100;return e(t[4]),this.setHSL(n,i,r)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=n[1],e=t.length;if(3===e)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this;if(6===e)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=Nt[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copyGammaToLinear(t,e=2){return this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this}copyLinearToGamma(t,e=2){const n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.r=Bt(t.r),this.g=Bt(t.g),this.b=Bt(t.b),this}copyLinearToSRGB(t){return this.r=Ut(t.r),this.g=Ut(t.g),this.b=Ut(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});const e=this.r,n=this.g,i=this.b,r=Math.max(e,n,i),s=Math.min(e,n,i);let a,o;const l=(s+r)/2;if(s===r)a=0,o=0;else{const t=r-s;switch(o=l<=.5?t/(r+s):t/(2-r-s),r){case e:a=(n-i)/t+(n0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){const e=i(t.textures),r=i(t.images);e.length>0&&(n.textures=e),r.length>0&&(n.images=r)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let i=0;i!==t;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Vt.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Wt.prototype=Object.create(Vt.prototype),Wt.prototype.constructor=Wt,Wt.prototype.isMeshBasicMaterial=!0,Wt.prototype.copy=function(t){return Vt.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this};const qt=new _,Xt=new c;function Yt(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function Zt(t,e,n){Yt.call(this,new Int8Array(t),e,n)}function Jt(t,e,n){Yt.call(this,new Uint8Array(t),e,n)}function Kt(t,e,n){Yt.call(this,new Uint8ClampedArray(t),e,n)}function Qt(t,e,n){Yt.call(this,new Int16Array(t),e,n)}function $t(t,e,n){Yt.call(this,new Uint16Array(t),e,n)}function te(t,e,n){Yt.call(this,new Int32Array(t),e,n)}function ee(t,e,n){Yt.call(this,new Uint32Array(t),e,n)}function ne(t,e,n){Yt.call(this,new Uint16Array(t),e,n)}function ie(t,e,n){Yt.call(this,new Float32Array(t),e,n)}function re(t,e,n){Yt.call(this,new Float64Array(t),e,n)}function se(t){if(0===t.length)return-1/0;let e=t[0];for(let n=1,i=t.length;ne&&(e=t[n]);return e}Object.defineProperty(Yt.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Yt.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i65535?ee:$t)(t,1):this.index=t,this},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},hasAttribute:function(t){return void 0!==this.attributes[t]},addGroup:function(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const e=(new u).getNormalMatrix(t);n.applyNormalMatrix(e),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return he.makeRotationX(t),this.applyMatrix4(he),this},rotateY:function(t){return he.makeRotationY(t),this.applyMatrix4(he),this},rotateZ:function(t){return he.makeRotationZ(t),this.applyMatrix4(he),this},translate:function(t,e,n){return he.makeTranslation(t,e,n),this.applyMatrix4(he),this},scale:function(t,e,n){return he.makeScale(t,e,n),this.applyMatrix4(he),this},lookAt:function(t){return ce.lookAt(t),ce.updateMatrix(),this.applyMatrix4(ce.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(ue).negate(),this.translate(ue.x,ue.y,ue.z),this},setFromPoints:function(t){const e=[];for(let n=0,i=t.length;n0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const i=n[e],r=i.toJSON(t.data);""!==i.name&&(r.name=i.name),t.data.attributes[e]=r}const i={};let r=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],s=[];for(let e=0,i=n.length;e0&&(i[e]=s,r=!0)}r&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return null!==a&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t},clone:function(){return(new me).copy(this)},copy:function(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const i=t.attributes;for(const t in i){const n=i[t];this.setAttribute(t,n.clone(e))}const r=t.morphAttributes;for(const t in r){const n=[],i=r[t];for(let t=0,r=i.length;tn.far?null:{distance:h,point:Oe.clone(),object:t}}(t,e,n,i,xe,_e,be,Re);if(f){o&&(Ae.fromBufferAttribute(o,h),Ce.fromBufferAttribute(o,u),Pe.fromBufferAttribute(o,d),f.uv=Dt.getUV(Re,xe,_e,be,Ae,Ce,Pe,new c)),l&&(Ae.fromBufferAttribute(l,h),Ce.fromBufferAttribute(l,u),Pe.fromBufferAttribute(l,d),f.uv2=Dt.getUV(Re,xe,_e,be,Ae,Ce,Pe,new c));const t=new jt(h,u,d);Dt.getNormal(xe,_e,be,t.normal),f.face=t}return f}Ie.prototype=Object.assign(Object.create(xt.prototype),{constructor:Ie,isMesh:!0,copy:function(t){return xt.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){const n=this.geometry,i=this.material,r=this.matrixWorld;if(void 0===i)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),ye.copy(n.boundingSphere),ye.applyMatrix4(r),!1===t.ray.intersectsSphere(ye))return;if(ge.copy(r).invert(),ve.copy(t.ray).applyMatrix4(ge),null!==n.boundingBox&&!1===ve.intersectsBox(n.boundingBox))return;let s;if(n.isBufferGeometry){const r=n.index,a=n.attributes.position,o=n.morphAttributes.position,l=n.morphTargetsRelative,h=n.attributes.uv,c=n.attributes.uv2,u=n.groups,d=n.drawRange;if(null!==r)if(Array.isArray(i))for(let n=0,p=u.length;n0?1:-1,h.push(A.x,A.y,A.z),c.push(o/m),c.push(1-s/g),T+=1}}for(let t=0;t0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;const n={};for(const t in this.extensions)!0===this.extensions[t]&&(n[t]=!0);return Object.keys(n).length>0&&(e.extensions=n),e},Ue.prototype=Object.assign(Object.create(xt.prototype),{constructor:Ue,isCamera:!0,copy:function(t,e){return xt.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new _),this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){xt.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()},updateWorldMatrix:function(t,e){xt.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()},clone:function(){return(new this.constructor).copy(this)}}),He.prototype=Object.assign(Object.create(Ue.prototype),{constructor:He,isPerspectiveCamera:!0,copy:function(t,e){return Ue.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){const e=.5*this.getFilmHeight()/t;this.fov=2*h.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){const t=Math.tan(.5*h.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*h.RAD2DEG*Math.atan(Math.tan(.5*h.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,n,i,r,s){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){const t=this.near;let e=t*Math.tan(.5*h.DEG2RAD*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,a=s.fullHeight;r+=s.offsetX*i/t,e-=s.offsetY*n/a,i*=s.width/t,n*=s.height/a}const a=this.filmOffset;0!==a&&(r+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(t){const e=xt.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}});function je(t,e,n){if(xt.call(this),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=n;const i=new He(90,1,t,e);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new _(1,0,0)),this.add(i);const r=new He(90,1,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new _(-1,0,0)),this.add(r);const s=new He(90,1,t,e);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new _(0,1,0)),this.add(s);const a=new He(90,1,t,e);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new _(0,-1,0)),this.add(a);const o=new He(90,1,t,e);o.layers=this.layers,o.up.set(0,-1,0),o.lookAt(new _(0,0,1)),this.add(o);const l=new He(90,1,t,e);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new _(0,0,-1)),this.add(l),this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();const h=t.xr.enabled,c=t.getRenderTarget();t.xr.enabled=!1;const u=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,i),t.setRenderTarget(n,1),t.render(e,r),t.setRenderTarget(n,2),t.render(e,s),t.setRenderTarget(n,3),t.render(e,a),t.setRenderTarget(n,4),t.render(e,o),n.texture.generateMipmaps=u,t.setRenderTarget(n,5),t.render(e,l),t.setRenderTarget(c),t.xr.enabled=h}}function Ge(t,e,n,i,r,s,a,o,l,h){t=void 0!==t?t:[],e=void 0!==e?e:301,a=void 0!==a?a:1022,m.call(this,t,e,n,i,r,s,a,o,l,h),this.flipY=!1,this._needsFlipEnvMap=!0}je.prototype=Object.create(xt.prototype),je.prototype.constructor=je,Ge.prototype=Object.create(m.prototype),Ge.prototype.constructor=Ge,Ge.prototype.isCubeTexture=!0,Object.defineProperty(Ge.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}});class Ve extends y{constructor(t,e,n){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=n),super(t,t,e),Object.defineProperty(this,"isWebGLCubeRenderTarget",{value:!0}),e=e||{},this.texture=new Ge(void 0,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.format=1023,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},i=new Ne(5,5,5),r=new Be({name:"CubemapFromEquirect",uniforms:ze(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=e;const s=new Ie(i,r),a=e.minFilter;1008===e.minFilter&&(e.minFilter=1006);return new je(1,10,this).update(t,s),e.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(t,e,n,i){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,n,i);t.setRenderTarget(r)}}function We(t,e,n,i,r,s,a,o,l,h,c,u){m.call(this,null,s,a,o,l,h,i,r,c,u),this.image={data:t||null,width:e||1,height:n||1},this.magFilter=void 0!==l?l:1003,this.minFilter=void 0!==h?h:1003,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}We.prototype=Object.create(m.prototype),We.prototype.constructor=We,We.prototype.isDataTexture=!0;const qe=new B,Xe=new _;class Ye{constructor(t,e,n,i,r,s){this.planes=[void 0!==t?t:new wt,void 0!==e?e:new wt,void 0!==n?n:new wt,void 0!==i?i:new wt,void 0!==r?r:new wt,void 0!==s?s:new wt]}set(t,e,n,i,r,s){const a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[5].copy(s),this}clone(){return(new this.constructor).copy(this)}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t){const e=this.planes,n=t.elements,i=n[0],r=n[1],s=n[2],a=n[3],o=n[4],l=n[5],h=n[6],c=n[7],u=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return e[0].setComponents(a-i,c-o,f-u,y-m).normalize(),e[1].setComponents(a+i,c+o,f+u,y+m).normalize(),e[2].setComponents(a+r,c+l,f+d,y+g).normalize(),e[3].setComponents(a-r,c-l,f-d,y-g).normalize(),e[4].setComponents(a-s,c-h,f-p,y-v).normalize(),e[5].setComponents(a+s,c+h,f+p,y+v).normalize(),this}intersectsObject(t){const e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),qe.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(qe)}intersectsSprite(t){return qe.center.set(0,0,0),qe.radius=.7071067811865476,qe.applyMatrix4(t.matrixWorld),this.intersectsSphere(qe)}intersectsSphere(t){const e=this.planes,n=t.center,i=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(n)0?t.max.x:t.min.x,Xe.y=i.normal.y>0?t.max.y:t.min.y,Xe.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(Xe)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}}function Ze(){let t=null,e=!1,n=null,i=null;function r(e,s){n(e,s),i=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==n&&(i=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function Je(t,e){const n=e.isWebGL2,i=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),i.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const n=i.get(e);n&&(t.deleteBuffer(n.buffer),i.delete(e))},update:function(e,r){if(e.isGLBufferAttribute){const t=i.get(e);return void((!t||t.version 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= mix( saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ), 1.0, metalness );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},$e={common:{diffuse:{value:new Ht(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new u},uv2Transform:{value:new u},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new c(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ht(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ht(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new u}},sprite:{diffuse:{value:new Ht(15658734)},opacity:{value:1},center:{value:new c(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new u}}},tn={basic:{uniforms:ke([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.fog]),vertexShader:Qe.meshbasic_vert,fragmentShader:Qe.meshbasic_frag},lambert:{uniforms:ke([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.fog,$e.lights,{emissive:{value:new Ht(0)}}]),vertexShader:Qe.meshlambert_vert,fragmentShader:Qe.meshlambert_frag},phong:{uniforms:ke([$e.common,$e.specularmap,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.fog,$e.lights,{emissive:{value:new Ht(0)},specular:{value:new Ht(1118481)},shininess:{value:30}}]),vertexShader:Qe.meshphong_vert,fragmentShader:Qe.meshphong_frag},standard:{uniforms:ke([$e.common,$e.envmap,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.roughnessmap,$e.metalnessmap,$e.fog,$e.lights,{emissive:{value:new Ht(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Qe.meshphysical_vert,fragmentShader:Qe.meshphysical_frag},toon:{uniforms:ke([$e.common,$e.aomap,$e.lightmap,$e.emissivemap,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.gradientmap,$e.fog,$e.lights,{emissive:{value:new Ht(0)}}]),vertexShader:Qe.meshtoon_vert,fragmentShader:Qe.meshtoon_frag},matcap:{uniforms:ke([$e.common,$e.bumpmap,$e.normalmap,$e.displacementmap,$e.fog,{matcap:{value:null}}]),vertexShader:Qe.meshmatcap_vert,fragmentShader:Qe.meshmatcap_frag},points:{uniforms:ke([$e.points,$e.fog]),vertexShader:Qe.points_vert,fragmentShader:Qe.points_frag},dashed:{uniforms:ke([$e.common,$e.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Qe.linedashed_vert,fragmentShader:Qe.linedashed_frag},depth:{uniforms:ke([$e.common,$e.displacementmap]),vertexShader:Qe.depth_vert,fragmentShader:Qe.depth_frag},normal:{uniforms:ke([$e.common,$e.bumpmap,$e.normalmap,$e.displacementmap,{opacity:{value:1}}]),vertexShader:Qe.normal_vert,fragmentShader:Qe.normal_frag},sprite:{uniforms:ke([$e.sprite,$e.fog]),vertexShader:Qe.sprite_vert,fragmentShader:Qe.sprite_frag},background:{uniforms:{uvTransform:{value:new u},t2D:{value:null}},vertexShader:Qe.background_vert,fragmentShader:Qe.background_frag},cube:{uniforms:ke([$e.envmap,{opacity:{value:1}}]),vertexShader:Qe.cube_vert,fragmentShader:Qe.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Qe.equirect_vert,fragmentShader:Qe.equirect_frag},distanceRGBA:{uniforms:ke([$e.common,$e.displacementmap,{referencePosition:{value:new _},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Qe.distanceRGBA_vert,fragmentShader:Qe.distanceRGBA_frag},shadow:{uniforms:ke([$e.lights,$e.fog,{color:{value:new Ht(0)},opacity:{value:1}}]),vertexShader:Qe.shadow_vert,fragmentShader:Qe.shadow_frag}};function en(t,e,n,i,r){const s=new Ht(0);let a,o,l=0,h=null,c=0,u=null;function d(t,e){n.buffers.color.setClear(t.r,t.g,t.b,e,r)}return{getClearColor:function(){return s},setClearColor:function(t,e=1){s.set(t),l=e,d(s,l)},getClearAlpha:function(){return l},setClearAlpha:function(t){l=t,d(s,l)},render:function(n,r,p,f){let m=!0===r.isScene?r.background:null;m&&m.isTexture&&(m=e.get(m));const g=t.xr,v=g.getSession&&g.getSession();v&&"additive"===v.environmentBlendMode&&(m=null),null===m?d(s,l):m&&m.isColor&&(d(m,1),f=!0),(t.autoClear||f)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),m&&(m.isCubeTexture||m.isWebGLCubeRenderTarget||306===m.mapping)?(void 0===o&&(o=new Ie(new Ne(1,1,1),new Be({name:"BackgroundCubeMaterial",uniforms:ze(tn.cube.uniforms),vertexShader:tn.cube.vertexShader,fragmentShader:tn.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.deleteAttribute("normal"),o.geometry.deleteAttribute("uv"),o.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(o.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(o)),m.isWebGLCubeRenderTarget&&(m=m.texture),o.material.uniforms.envMap.value=m,o.material.uniforms.flipEnvMap.value=m.isCubeTexture&&m._needsFlipEnvMap?-1:1,h===m&&c===m.version&&u===t.toneMapping||(o.material.needsUpdate=!0,h=m,c=m.version,u=t.toneMapping),n.unshift(o,o.geometry,o.material,0,0,null)):m&&m.isTexture&&(void 0===a&&(a=new Ie(new Ke(2,2),new Be({name:"BackgroundMaterial",uniforms:ze(tn.background.uniforms),vertexShader:tn.background.vertexShader,fragmentShader:tn.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(a)),a.material.uniforms.t2D.value=m,!0===m.matrixAutoUpdate&&m.updateMatrix(),a.material.uniforms.uvTransform.value.copy(m.matrix),h===m&&c===m.version&&u===t.toneMapping||(a.material.needsUpdate=!0,h=m,c=m.version,u=t.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null))}}}function nn(t,e,n,i){const r=t.getParameter(34921),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),a=i.isWebGL2||null!==s,o={},l=d(null);let h=l;function c(e){return i.isWebGL2?t.bindVertexArray(e):s.bindVertexArrayOES(e)}function u(e){return i.isWebGL2?t.deleteVertexArray(e):s.deleteVertexArrayOES(e)}function d(t){const e=[],n=[],i=[];for(let t=0;t=0){const s=l[e];if(void 0!==s){const e=s.normalized,r=s.itemSize,a=n.get(s);if(void 0===a)continue;const l=a.buffer,h=a.type,c=a.bytesPerElement;if(s.isInterleavedBufferAttribute){const n=s.data,a=n.stride,u=s.offset;n&&n.isInstancedInterleavedBuffer?(m(i,n.meshPerAttribute),void 0===o._maxInstanceCount&&(o._maxInstanceCount=n.meshPerAttribute*n.count)):f(i),t.bindBuffer(34962,l),v(i,r,h,e,a*c,u*c)}else s.isInstancedBufferAttribute?(m(i,s.meshPerAttribute),void 0===o._maxInstanceCount&&(o._maxInstanceCount=s.meshPerAttribute*s.count)):f(i),t.bindBuffer(34962,l),v(i,r,h,e,0,0)}else if("instanceMatrix"===e){const e=n.get(r.instanceMatrix);if(void 0===e)continue;const s=e.buffer,a=e.type;m(i+0,1),m(i+1,1),m(i+2,1),m(i+3,1),t.bindBuffer(34962,s),t.vertexAttribPointer(i+0,4,a,!1,64,0),t.vertexAttribPointer(i+1,4,a,!1,64,16),t.vertexAttribPointer(i+2,4,a,!1,64,32),t.vertexAttribPointer(i+3,4,a,!1,64,48)}else if("instanceColor"===e){const e=n.get(r.instanceColor);if(void 0===e)continue;const s=e.buffer,a=e.type;m(i,1),t.bindBuffer(34962,s),t.vertexAttribPointer(i,3,a,!1,12,0)}else if(void 0!==c){const n=c[e];if(void 0!==n)switch(n.length){case 2:t.vertexAttrib2fv(i,n);break;case 3:t.vertexAttrib3fv(i,n);break;case 4:t.vertexAttrib4fv(i,n);break;default:t.vertexAttrib1fv(i,n)}}}}g()}(r,l,u,y),null!==x&&t.bindBuffer(34963,n.get(x).buffer))},reset:y,resetDefaultState:x,dispose:function(){y();for(const t in o){const e=o[t];for(const t in e){const n=e[t];for(const t in n)u(n[t].object),delete n[t];delete e[t]}delete o[t]}},releaseStatesOfGeometry:function(t){if(void 0===o[t.id])return;const e=o[t.id];for(const t in e){const n=e[t];for(const t in n)u(n[t].object),delete n[t];delete e[t]}delete o[t.id]},releaseStatesOfProgram:function(t){for(const e in o){const n=o[e];if(void 0===n[t.id])continue;const i=n[t.id];for(const t in i)u(i[t].object),delete i[t];delete n[t.id]}},initAttributes:p,enableAttribute:f,disableUnusedAttributes:g}}function rn(t,e,n,i){const r=i.isWebGL2;let s;this.setMode=function(t){s=t},this.render=function(e,i){t.drawArrays(s,e,i),n.update(i,s,1)},this.renderInstances=function(i,a,o){if(0===o)return;let l,h;if(r)l=t,h="drawArraysInstanced";else if(l=e.get("ANGLE_instanced_arrays"),h="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[h](s,i,a,o),n.update(a,s,o)}}function sn(t,e,n){let i;function r(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext;let a=void 0!==n.precision?n.precision:"highp";const o=r(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);const l=!0===n.logarithmicDepthBuffer,h=t.getParameter(34930),c=t.getParameter(35660),u=t.getParameter(3379),d=t.getParameter(34076),p=t.getParameter(34921),f=t.getParameter(36347),m=t.getParameter(36348),g=t.getParameter(36349),v=c>0,y=s||!!e.get("OES_texture_float");return{isWebGL2:s,getMaxAnisotropy:function(){if(void 0!==i)return i;const n=e.get("EXT_texture_filter_anisotropic");return i=null!==n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,i},getMaxPrecision:r,precision:a,logarithmicDepthBuffer:l,maxTextures:h,maxVertexTextures:c,maxTextureSize:u,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:s?t.getParameter(36183):0}}function an(t){const e=this;let n=null,i=0,r=!1,s=!1;const a=new wt,o=new u,l={value:null,needsUpdate:!1};function h(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function c(t,n,i,r){const s=null!==t?t.length:0;let h=null;if(0!==s){if(h=l.value,!0!==r||null===h){const e=i+4*s,r=n.matrixWorldInverse;o.getNormalMatrix(r),(null===h||h.length0){const a=t.getRenderList(),o=t.getRenderTarget(),l=new Ve(s.height/2);return l.fromEquirectangularTexture(t,r),e.set(r,l),t.setRenderTarget(o),t.setRenderList(a),r.addEventListener("dispose",i),n(l.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}function ln(t){const e={};function n(n){if(void 0!==e[n])return e[n];let i;switch(n){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(n)}return e[n]=i,i}return{has:function(t){return null!==n(t)},init:function(t){t.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float")},get:function(t){const e=n(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function hn(t,e,n,i){const r={},s=new WeakMap;function a(t){const o=t.target;null!==o.index&&e.remove(o.index);for(const t in o.attributes)e.remove(o.attributes[t]);o.removeEventListener("dispose",a),delete r[o.id];const l=s.get(o);l&&(e.remove(l),s.delete(o)),i.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,n.memory.geometries--}function o(t){const n=[],i=t.index,r=t.attributes.position;let a=0;if(null!==i){const t=i.array;a=i.version;for(let e=0,i=t.length;e65535?ee:$t)(n,1);o.version=a;const l=s.get(t);l&&e.remove(l),s.set(t,o)}return{get:function(t,e){return!0===r[e.id]||(e.addEventListener("dispose",a),r[e.id]=!0,n.memory.geometries++),e},update:function(t){const n=t.attributes;for(const t in n)e.update(n[t],34962);const i=t.morphAttributes;for(const t in i){const n=i[t];for(let t=0,i=n.length;t0)return t;const r=e*n;let s=Mn[r];if(void 0===s&&(s=new Float32Array(r),Mn[r]=s),0!==e){i.toArray(s,0);for(let i=1,r=0;i!==e;++i)r+=n,t[i].toArray(s,r)}return s}function An(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n/gm;function Si(t){return t.replace(wi,Ei)}function Ei(t,e){const n=Qe[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Si(n)}const Ti=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Li=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Ai(t){return t.replace(Li,Pi).replace(Ti,Ci)}function Ci(t,e,n,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Pi(t,e,n,i)}function Pi(t,e,n,i){let r="";for(let t=parseInt(e);t0?t.gammaFactor:1,p=n.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(_i).join("\n")}(n),f=function(t){const e=[];for(const n in t){const i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}(s),m=r.createProgram();let g,v,y=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(g=[f].filter(_i).join("\n"),g.length>0&&(g+="\n"),v=[p,f].filter(_i).join("\n"),v.length>0&&(v+="\n")):(g=[Ri(n),"#define SHADER_NAME "+n.shaderName,f,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+d,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(_i).join("\n"),v=[p,Ri(n),"#define SHADER_NAME "+n.shaderName,f,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+d,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?Qe.tonemapping_pars_fragment:"",0!==n.toneMapping?xi("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",Qe.encodings_pars_fragment,n.map?vi("mapTexelToLinear",n.mapEncoding):"",n.matcap?vi("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?vi("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?vi("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?vi("lightMapTexelToLinear",n.lightMapEncoding):"",yi("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(_i).join("\n")),a=Si(a),a=bi(a,n),a=Mi(a,n),o=Si(o),o=bi(o,n),o=Mi(o,n),a=Ai(a),o=Ai(o),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(y="#version 300 es\n",g=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["#define varying in","300 es"===n.glslVersion?"":"out highp vec4 pc_fragColor;","300 es"===n.glslVersion?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+v);const x=y+v+o,_=pi(r,35633,y+g+a),b=pi(r,35632,x);if(r.attachShader(m,_),r.attachShader(m,b),void 0!==n.index0AttributeName?r.bindAttribLocation(m,0,n.index0AttributeName):!0===n.morphTargets&&r.bindAttribLocation(m,0,"position"),r.linkProgram(m),t.debug.checkShaderErrors){const t=r.getProgramInfoLog(m).trim(),e=r.getShaderInfoLog(_).trim(),n=r.getShaderInfoLog(b).trim();let i=!0,s=!0;if(!1===r.getProgramParameter(m,35714)){i=!1;const e=gi(r,_,"vertex"),n=gi(r,b,"fragment");console.error("THREE.WebGLProgram: shader error: ",r.getError(),"35715",r.getProgramParameter(m,35715),"gl.getProgramInfoLog",t,e,n)}else""!==t?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",t):""!==e&&""!==n||(s=!1);s&&(this.diagnostics={runnable:i,programLog:t,vertexShader:{log:e,prefix:g},fragmentShader:{log:n,prefix:v}})}let M,w;return r.deleteShader(_),r.deleteShader(b),this.getUniforms=function(){return void 0===M&&(M=new di(r,m)),M},this.getAttributes=function(){return void 0===w&&(w=function(t,e){const n={},i=t.getProgramParameter(e,35721);for(let r=0;r0,maxBones:M,useVertexTexture:h,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:r.dithering,shadowMapEnabled:t.shadowMap.enabled&&f.length>0,shadowMapType:t.shadowMap.type,toneMapping:r.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:2===r.side,flipSided:1===r.side,depthPacking:void 0!==r.depthPacking&&r.depthPacking,index0AttributeName:r.index0AttributeName,extensionDerivatives:r.extensions&&r.extensions.derivatives,extensionFragDepth:r.extensions&&r.extensions.fragDepth,extensionDrawBuffers:r.extensions&&r.extensions.drawBuffers,extensionShaderTextureLOD:r.extensions&&r.extensions.shaderTextureLOD,rendererExtensionFragDepth:o||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:o||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:o||n.has("EXT_shader_texture_lod"),customProgramCacheKey:r.customProgramCacheKey()}},getProgramCacheKey:function(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);if(!1===e.isRawShaderMaterial){for(let t=0;t1&&i.sort(t||Ni),r.length>1&&r.sort(e||zi)}}}function Fi(t){let e=new WeakMap;return{get:function(n,i){const r=e.get(n);let s;return void 0===r?(s=new ki(t),e.set(n,new WeakMap),e.get(n).set(i,s)):(s=r.get(i),void 0===s&&(s=new ki(t),r.set(i,s))),s},dispose:function(){e=new WeakMap}}}function Bi(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new _,color:new Ht};break;case"SpotLight":n={position:new _,direction:new _,color:new Ht,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new _,color:new Ht,distance:0,decay:0};break;case"HemisphereLight":n={direction:new _,skyColor:new Ht,groundColor:new Ht};break;case"RectAreaLight":n={color:new Ht,position:new _,halfWidth:new _,halfHeight:new _}}return t[e.id]=n,n}}}let Ui=0;function Hi(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function ji(t,e){const n=new Bi,i=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new c};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new c,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let t=0;t<9;t++)r.probe.push(new _);const s=new _,a=new Y,o=new Y;return{setup:function(s){let a=0,o=0,l=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let h=0,c=0,u=0,d=0,p=0,f=0,m=0,g=0;s.sort(Hi);for(let t=0,e=s.length;t0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=$e.LTC_FLOAT_1,r.rectAreaLTC2=$e.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=$e.LTC_HALF_1,r.rectAreaLTC2=$e.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=a,r.ambient[1]=o,r.ambient[2]=l;const v=r.hash;v.directionalLength===h&&v.pointLength===c&&v.spotLength===u&&v.rectAreaLength===d&&v.hemiLength===p&&v.numDirectionalShadows===f&&v.numPointShadows===m&&v.numSpotShadows===g||(r.directional.length=h,r.spot.length=u,r.rectArea.length=d,r.point.length=c,r.hemi.length=p,r.directionalShadow.length=f,r.directionalShadowMap.length=f,r.pointShadow.length=m,r.pointShadowMap.length=m,r.spotShadow.length=g,r.spotShadowMap.length=g,r.directionalShadowMatrix.length=f,r.pointShadowMatrix.length=m,r.spotShadowMatrix.length=g,v.directionalLength=h,v.pointLength=c,v.spotLength=u,v.rectAreaLength=d,v.hemiLength=p,v.numDirectionalShadows=f,v.numPointShadows=m,v.numSpotShadows=g,r.version=Ui++)},setupView:function(t,e){let n=0,i=0,l=0,h=0,c=0;const u=e.matrixWorldInverse;for(let e=0,d=t.length;e=n.get(i).length?(s=new Gi(t,e),n.get(i).push(s)):s=n.get(i)[r],s},dispose:function(){n=new WeakMap}}}function Wi(t){Vt.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(t)}function qi(t){Vt.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new _,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}Wi.prototype=Object.create(Vt.prototype),Wi.prototype.constructor=Wi,Wi.prototype.isMeshDepthMaterial=!0,Wi.prototype.copy=function(t){return Vt.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},qi.prototype=Object.create(Vt.prototype),qi.prototype.constructor=qi,qi.prototype.isMeshDistanceMaterial=!0,qi.prototype.copy=function(t){return Vt.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this};function Xi(t,e,n){let i=new Ye;const r=new c,s=new c,a=new v,o=[],l=[],h={},u={0:1,1:0,2:2},d=new Be({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new c},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),p=d.clone();p.defines.HORIZONTAL_PASS=1;const f=new me;f.setAttribute("position",new Yt(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const m=new Ie(f,d),g=this;function x(n,i){const r=e.update(m);d.uniforms.shadow_pass.value=n.map.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(i,null,r,d,m,null),p.uniforms.shadow_pass.value=n.mapPass.texture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(i,null,r,p,m,null)}function _(t,e,n){const i=t<<0|e<<1|n<<2;let r=o[i];return void 0===r&&(r=new Wi({depthPacking:3201,morphTargets:t,skinning:e}),o[i]=r),r}function b(t,e,n){const i=t<<0|e<<1|n<<2;let r=l[i];return void 0===r&&(r=new qi({morphTargets:t,skinning:e}),l[i]=r),r}function M(e,n,i,r,s,a,o){let l=null,c=_,d=e.customDepthMaterial;if(!0===r.isPointLight&&(c=b,d=e.customDistanceMaterial),void 0===d){let t=!1;!0===i.morphTargets&&(t=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);let r=!1;!0===e.isSkinnedMesh&&(!0===i.skinning?r=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e));l=c(t,r,!0===e.isInstancedMesh)}else l=d;if(t.localClippingEnabled&&!0===i.clipShadows&&0!==i.clippingPlanes.length){const t=l.uuid,e=i.uuid;let n=h[t];void 0===n&&(n={},h[t]=n);let r=n[e];void 0===r&&(r=l.clone(),n[e]=r),l=r}return l.visible=i.visible,l.wireframe=i.wireframe,l.side=3===o?null!==i.shadowSide?i.shadowSide:i.side:null!==i.shadowSide?i.shadowSide:u[i.side],l.clipShadows=i.clipShadows,l.clippingPlanes=i.clippingPlanes,l.clipIntersection=i.clipIntersection,l.wireframeLinewidth=i.wireframeLinewidth,l.linewidth=i.linewidth,!0===r.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(r.matrixWorld),l.nearDistance=s,l.farDistance=a),l}function w(n,r,s,a,o){if(!1===n.visible)return;if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===o)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const i=e.update(n),r=n.material;if(Array.isArray(r)){const e=i.groups;for(let l=0,h=e.length;ln||r.y>n)&&(r.x>n&&(s.x=Math.floor(n/p.x),r.x=s.x*p.x,u.mapSize.x=s.x),r.y>n&&(s.y=Math.floor(n/p.y),r.y=s.y*p.y,u.mapSize.y=s.y)),null===u.map&&!u.isPointLightShadow&&3===this.type){const t={minFilter:1006,magFilter:1006,format:1023};u.map=new y(r.x,r.y,t),u.map.texture.name=c.name+".shadowMap",u.mapPass=new y(r.x,r.y,t),u.camera.updateProjectionMatrix()}if(null===u.map){const t={minFilter:1003,magFilter:1003,format:1023};u.map=new y(r.x,r.y,t),u.map.texture.name=c.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const f=u.getViewportCount();for(let t=0;t=1):-1!==L.indexOf("OpenGL ES")&&(T=parseFloat(/^OpenGL ES (\d)/.exec(L)[1]),E=T>=2);let A=null,C={};const P=new v,R=new v;function O(e,n,i){const r=new Uint8Array(4),s=t.createTexture();t.bindTexture(e,s),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(let e=0;ei||t.height>i)&&(r=i/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const i=e?h.floorPowerOfTwo:Math.floor,s=i(r*t.width),a=i(r*t.height);void 0===f&&(f=g(s,a));const o=n?g(s,a):f;o.width=s,o.height=a;return o.getContext("2d").drawImage(t,0,0,s,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+a+")."),o}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function y(t){return h.isPowerOfTwo(t.width)&&h.isPowerOfTwo(t.height)}function x(t,e){return t.generateMipmaps&&e&&1003!==t.minFilter&&1006!==t.minFilter}function _(e,n,r,s){t.generateMipmap(e);i.get(n).__maxMipLevel=Math.log(Math.max(r,s))*Math.LOG2E}function b(n,i,r){if(!1===o)return i;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let s=i;return 6403===i&&(5126===r&&(s=33326),5131===r&&(s=33325),5121===r&&(s=33321)),6407===i&&(5126===r&&(s=34837),5131===r&&(s=34843),5121===r&&(s=32849)),6408===i&&(5126===r&&(s=34836),5131===r&&(s=34842),5121===r&&(s=32856)),33325!==s&&33326!==s&&34842!==s&&34836!==s||e.get("EXT_color_buffer_float"),s}function M(t){return 1003===t||1004===t||1005===t?9728:9729}function w(e){const n=e.target;n.removeEventListener("dispose",w),function(e){const n=i.get(e);if(void 0===n.__webglInit)return;t.deleteTexture(n.__webglTexture),i.remove(e)}(n),n.isVideoTexture&&p.delete(n),a.memory.textures--}function S(e){const n=e.target;n.removeEventListener("dispose",S),function(e){const n=i.get(e),r=i.get(e.texture);if(!e)return;void 0!==r.__webglTexture&&t.deleteTexture(r.__webglTexture);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(n.__webglFramebuffer[e]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[e]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&t.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&t.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&t.deleteRenderbuffer(n.__webglDepthRenderbuffer);i.remove(e.texture),i.remove(e)}(n),a.memory.textures--}let E=0;function T(t,e){const r=i.get(t);if(t.isVideoTexture&&function(t){const e=a.render.frame;p.get(t)!==e&&(p.set(t,e),t.update())}(t),t.version>0&&r.__version!==t.version){const n=t.image;if(void 0===n)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==n.complete)return void O(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+e),n.bindTexture(3553,r.__webglTexture)}function L(e,r){const a=i.get(e);e.version>0&&a.__version!==e.version?function(e,i,r){if(6!==i.image.length)return;R(e,i),n.activeTexture(33984+r),n.bindTexture(34067,e.__webglTexture),t.pixelStorei(37440,i.flipY),t.pixelStorei(37441,i.premultiplyAlpha),t.pixelStorei(3317,i.unpackAlignment);const a=i&&(i.isCompressedTexture||i.image[0].isCompressedTexture),l=i.image[0]&&i.image[0].isDataTexture,h=[];for(let t=0;t<6;t++)h[t]=a||l?l?i.image[t].image:i.image[t]:v(i.image[t],!1,!0,c);const u=h[0],d=y(u)||o,p=s.convert(i.format),f=s.convert(i.type),m=b(i.internalFormat,p,f);let g;if(P(34067,i,d),a){for(let t=0;t<6;t++){g=h[t].mipmaps;for(let e=0;e1||i.get(s).__currentAnisotropy)&&(t.texParameterf(n,l.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),i.get(s).__currentAnisotropy=s.anisotropy)}}function R(e,n){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",w),e.__webglTexture=t.createTexture(),a.memory.textures++)}function O(e,i,r){let a=3553;i.isDataTexture2DArray&&(a=35866),i.isDataTexture3D&&(a=32879),R(e,i),n.activeTexture(33984+r),n.bindTexture(a,e.__webglTexture),t.pixelStorei(37440,i.flipY),t.pixelStorei(37441,i.premultiplyAlpha),t.pixelStorei(3317,i.unpackAlignment);const l=function(t){return!o&&(1001!==t.wrapS||1001!==t.wrapT||1003!==t.minFilter&&1006!==t.minFilter)}(i)&&!1===y(i.image),h=v(i.image,l,!1,u),c=y(h)||o,d=s.convert(i.format);let p,f=s.convert(i.type),m=b(i.internalFormat,d,f);P(a,i,c);const g=i.mipmaps;if(i.isDepthTexture)m=6402,o?m=1015===i.type?36012:1014===i.type?33190:1020===i.type?35056:33189:1015===i.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===i.format&&6402===m&&1012!==i.type&&1014!==i.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=1012,f=s.convert(i.type)),1027===i.format&&6402===m&&(m=34041,1020!==i.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=1020,f=s.convert(i.type))),n.texImage2D(3553,0,m,h.width,h.height,0,d,f,null);else if(i.isDataTexture)if(g.length>0&&c){for(let t=0,e=g.length;t0&&c){for(let t=0,e=g.length;t=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),E+=1,t},this.resetTextureUnits=function(){E=0},this.setTexture2D=T,this.setTexture2DArray=function(t,e){const r=i.get(t);t.version>0&&r.__version!==t.version?O(r,t,e):(n.activeTexture(33984+e),n.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(t,e){const r=i.get(t);t.version>0&&r.__version!==t.version?O(r,t,e):(n.activeTexture(33984+e),n.bindTexture(32879,r.__webglTexture))},this.setTextureCube=L,this.setupRenderTarget=function(e){const r=i.get(e),l=i.get(e.texture);e.addEventListener("dispose",S),l.__webglTexture=t.createTexture(),a.memory.textures++;const h=!0===e.isWebGLCubeRenderTarget,c=!0===e.isWebGLMultisampleRenderTarget,u=y(e)||o;if(!o||1022!==e.texture.format||1015!==e.texture.type&&1016!==e.texture.type||(e.texture.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),h){r.__webglFramebuffer=[];for(let e=0;e<6;e++)r.__webglFramebuffer[e]=t.createFramebuffer()}else if(r.__webglFramebuffer=t.createFramebuffer(),c)if(o){r.__webglMultisampledFramebuffer=t.createFramebuffer(),r.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,r.__webglColorRenderbuffer);const n=s.convert(e.texture.format),i=s.convert(e.texture.type),a=b(e.texture.internalFormat,n,i),o=z(e);t.renderbufferStorageMultisample(36161,o,a,e.width,e.height),t.bindFramebuffer(36160,r.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,r.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(r.__webglDepthRenderbuffer=t.createRenderbuffer(),D(r.__webglDepthRenderbuffer,e,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(h){n.bindTexture(34067,l.__webglTexture),P(34067,e.texture,u);for(let t=0;t<6;t++)I(r.__webglFramebuffer[t],e,36064,34069+t);x(e.texture,u)&&_(34067,e.texture,e.width,e.height),n.bindTexture(34067,null)}else n.bindTexture(3553,l.__webglTexture),P(3553,e.texture,u),I(r.__webglFramebuffer,e,36064,3553),x(e.texture,u)&&_(3553,e.texture,e.width,e.height),n.bindTexture(3553,null);e.depthBuffer&&N(e)},this.updateRenderTargetMipmap=function(t){const e=t.texture;if(x(e,y(t)||o)){const r=t.isWebGLCubeRenderTarget?34067:3553,s=i.get(e).__webglTexture;n.bindTexture(r,s),_(r,e,t.width,t.height),n.bindTexture(r,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(o){const n=i.get(e);t.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,n.__webglFramebuffer);const r=e.width,s=e.height;let a=16384;e.depthBuffer&&(a|=256),e.stencilBuffer&&(a|=1024),t.blitFramebuffer(0,0,r,s,0,0,r,s,a,9728),t.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===k&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),k=!0),t=t.texture),T(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===F&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),F=!0),t=t.texture),L(t,e)}}function Ji(t,e,n){const i=n.isWebGL2;return{convert:function(t){let n;if(1009===t)return 5121;if(1017===t)return 32819;if(1018===t)return 32820;if(1019===t)return 33635;if(1010===t)return 5120;if(1011===t)return 5122;if(1012===t)return 5123;if(1013===t)return 5124;if(1014===t)return 5125;if(1015===t)return 5126;if(1016===t)return i?5131:(n=e.get("OES_texture_half_float"),null!==n?n.HALF_FLOAT_OES:null);if(1021===t)return 6406;if(1022===t)return 6407;if(1023===t)return 6408;if(1024===t)return 6409;if(1025===t)return 6410;if(1026===t)return 6402;if(1027===t)return 34041;if(1028===t)return 6403;if(1029===t)return 36244;if(1030===t)return 33319;if(1031===t)return 33320;if(1032===t)return 36248;if(1033===t)return 36249;if(33776===t||33777===t||33778===t||33779===t){if(n=e.get("WEBGL_compressed_texture_s3tc"),null===n)return null;if(33776===t)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===t)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===t)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===t)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===t||35841===t||35842===t||35843===t){if(n=e.get("WEBGL_compressed_texture_pvrtc"),null===n)return null;if(35840===t)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===t)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===t)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===t)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===t)return n=e.get("WEBGL_compressed_texture_etc1"),null!==n?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===t||37496===t)&&(n=e.get("WEBGL_compressed_texture_etc"),null!==n)){if(37492===t)return n.COMPRESSED_RGB8_ETC2;if(37496===t)return n.COMPRESSED_RGBA8_ETC2_EAC}return 37808===t||37809===t||37810===t||37811===t||37812===t||37813===t||37814===t||37815===t||37816===t||37817===t||37818===t||37819===t||37820===t||37821===t||37840===t||37841===t||37842===t||37843===t||37844===t||37845===t||37846===t||37847===t||37848===t||37849===t||37850===t||37851===t||37852===t||37853===t?(n=e.get("WEBGL_compressed_texture_astc"),null!==n?t:null):36492===t?(n=e.get("EXT_texture_compression_bptc"),null!==n?t:null):1020===t?i?34042:(n=e.get("WEBGL_depth_texture"),null!==n?n.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}function Ki(t=[]){He.call(this),this.cameras=t}function Qi(){xt.call(this),this.type="Group"}function $i(){this._targetRay=null,this._grip=null,this._hand=null}function tr(t,e){const n=this;let i=null,r=1,s=null,a="local-floor",o=null;const l=[],h=new Map,c=new He;c.layers.enable(1),c.viewport=new v;const u=new He;u.layers.enable(2),u.viewport=new v;const d=[c,u],p=new Ki;p.layers.enable(1),p.layers.enable(2);let f=null,m=null;function g(t){const e=h.get(t.inputSource);e&&e.dispatchEvent({type:t.type,data:t.inputSource})}function y(){h.forEach((function(t,e){t.disconnect(e)})),h.clear(),f=null,m=null,t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),E.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function x(t){const e=i.inputSources;for(let t=0;t0&&Et(s,t,e),a.length>0&&Et(a,t,e),!0===t.isScene&&t.onAfterRender(g,t,e),null!==w&&(K.updateRenderTargetMipmap(w),K.updateMultisampleRenderTarget(w)),X.buffers.depth.setTest(!0),X.buffers.depth.setMask(!0),X.buffers.color.setMask(!0),X.setPolygonOffset(!1),m.pop(),f=m.length>0?m[m.length-1]:null,p=null},this.setFramebuffer=function(t){x!==t&&null===w&&pt.bindFramebuffer(36160,t),x=t},this.getActiveCubeFace=function(){return b},this.getActiveMipmapLevel=function(){return M},this.getRenderList=function(){return p},this.setRenderList=function(t){p=t},this.getRenderTarget=function(){return w},this.setRenderTarget=function(t,e=0,n=0){w=t,b=e,M=n,t&&void 0===J.get(t).__webglFramebuffer&&K.setupRenderTarget(t);let i=x,r=!1;if(t){const n=J.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(i=n[e],r=!0):i=t.isWebGLMultisampleRenderTarget?J.get(t).__webglMultisampledFramebuffer:n,L.copy(t.viewport),A.copy(t.scissor),C=t.scissorTest}else L.copy(N).multiplyScalar(O).floor(),A.copy(z).multiplyScalar(O).floor(),C=k;if(S!==i&&(pt.bindFramebuffer(36160,i),S=i),X.viewport(L),X.scissor(A),X.setScissorTest(C),r){const i=J.get(t.texture);pt.framebufferTexture2D(36160,36064,34069+e,i.__webglTexture,n)}},this.readRenderTargetPixels=function(t,e,n,i,r,s,a){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=J.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){let a=!1;o!==S&&(pt.bindFramebuffer(36160,o),a=!0);try{const o=t.texture,l=o.format,h=o.type;if(1023!==l&&ut.convert(l)!==pt.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=1016===h&&(W.has("EXT_color_buffer_half_float")||q.isWebGL2&&W.has("EXT_color_buffer_float"));if(!(1009===h||ut.convert(h)===pt.getParameter(35738)||1015===h&&(q.isWebGL2||W.has("OES_texture_float")||W.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===pt.checkFramebufferStatus(36160)?e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&pt.readPixels(e,n,i,r,ut.convert(l),ut.convert(h),s):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{a&&pt.bindFramebuffer(36160,S)}}},this.copyFramebufferToTexture=function(t,e,n=0){const i=Math.pow(2,-n),r=Math.floor(e.image.width*i),s=Math.floor(e.image.height*i),a=ut.convert(e.format);K.setTexture2D(e,0),pt.copyTexImage2D(3553,n,a,t.x,t.y,r,s,0),X.unbindTexture()},this.copyTextureToTexture=function(t,e,n,i=0){const r=e.image.width,s=e.image.height,a=ut.convert(n.format),o=ut.convert(n.type);K.setTexture2D(n,0),pt.pixelStorei(37440,n.flipY),pt.pixelStorei(37441,n.premultiplyAlpha),pt.pixelStorei(3317,n.unpackAlignment),e.isDataTexture?pt.texSubImage2D(3553,i,t.x,t.y,r,s,a,o,e.image.data):e.isCompressedTexture?pt.compressedTexSubImage2D(3553,i,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data):pt.texSubImage2D(3553,i,t.x,t.y,a,o,e.image),0===i&&n.generateMipmaps&&pt.generateMipmap(3553),X.unbindTexture()},this.initTexture=function(t){K.setTexture2D(t,0),X.unbindTexture()},this.resetState=function(){X.reset(),dt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function ir(t){nr.call(this,t)}Ki.prototype=Object.assign(Object.create(He.prototype),{constructor:Ki,isArrayCamera:!0}),Qi.prototype=Object.assign(Object.create(xt.prototype),{constructor:Qi,isGroup:!0}),Object.assign($i.prototype,{constructor:$i,getHandSpace:function(){return null===this._hand&&(this._hand=new Qi,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new Qi,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new Qi,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this},disconnect:function(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(t,e,n){let i=null,r=null,s=null;const a=this._targetRay,o=this._grip,l=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState)if(l&&t.hand){s=!0;for(const i of t.hand.values()){const t=e.getJointPose(i,n);if(void 0===l.joints[i.jointName]){const t=new Qi;t.matrixAutoUpdate=!1,t.visible=!1,l.joints[i.jointName]=t,l.add(t)}const r=l.joints[i.jointName];null!==t&&(r.matrix.fromArray(t.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.jointRadius=t.radius),r.visible=null!==t}const i=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],a=i.position.distanceTo(r.position),o=.02,h=.005;l.inputState.pinching&&a>o+h?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&a<=o-h&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==a&&(i=e.getPose(t.targetRaySpace,n),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale))),null!==o&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale)));return null!==a&&(a.visible=null!==i),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==s),this}}),Object.assign(tr.prototype,a.prototype),ir.prototype=Object.assign(Object.create(nr.prototype),{constructor:ir,isWebGL1Renderer:!0});class rr extends xt{constructor(){super(),Object.defineProperty(this,"isScene",{value:!0}),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.environment&&(e.object.environment=this.environment.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}function sr(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=h.generateUUID()}Object.defineProperty(sr.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(sr.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(let i=0,r=this.stride;it.far||e.push({distance:o,point:cr.clone(),uv:Dt.getUV(cr,gr,vr,yr,xr,_r,br,new c),face:null,object:this})},copy:function(t){return xt.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}});const Sr=new _,Er=new _;function Tr(){xt.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}Tr.prototype=Object.assign(Object.create(xt.prototype),{constructor:Tr,isLOD:!0,copy:function(t){xt.prototype.copy.call(this,t,!1);const e=t.levels;for(let t=0,n=e.length;t0){let n,i;for(n=1,i=e.length;n0){Sr.setFromMatrixPosition(this.matrixWorld);const n=t.ray.origin.distanceTo(Sr);this.getObjectForDistance(n).raycast(t,e)}},update:function(t){const e=this.levels;if(e.length>1){Sr.setFromMatrixPosition(t.matrixWorld),Er.setFromMatrixPosition(this.matrixWorld);const n=Sr.distanceTo(Er)/t.zoom;let i,r;for(e[0].object.visible=!0,i=1,r=e.length;i=e[i].distance;i++)e[i-1].object.visible=!1,e[i].object.visible=!0;for(this._currentLevel=i-1;ia)continue;c.applyMatrix4(this.matrixWorld);const d=t.ray.origin.distanceTo(c);dt.far||e.push({distance:d,point:h.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else for(let n=0,i=r.count-1;na)continue;c.applyMatrix4(this.matrixWorld);const i=t.ray.origin.distanceTo(c);it.far||e.push({distance:i,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});const Zr=new _,Jr=new _;function Kr(t,e){Yr.call(this,t,e),this.type="LineSegments"}function Qr(t,e){Yr.call(this,t,e),this.type="LineLoop"}function $r(t){Vt.call(this),this.type="PointsMaterial",this.color=new Ht(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}Kr.prototype=Object.assign(Object.create(Yr.prototype),{constructor:Kr,isLineSegments:!0,computeLineDistances:function(){const t=this.geometry;if(t.isBufferGeometry)if(null===t.index){const e=t.attributes.position,n=[];for(let t=0,i=e.count;tr.far)return;s.push({distance:l,distanceToRay:Math.sqrt(o),point:n,index:e,face:null,object:a})}}function as(t,e,n,i,r,s,a,o,l){m.call(this,t,e,n,i,r,s,a,o,l),this.format=void 0!==a?a:1022,this.minFilter=void 0!==s?s:1006,this.magFilter=void 0!==r?r:1006,this.generateMipmaps=!1;const h=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback((function e(){h.needsUpdate=!0,t.requestVideoFrameCallback(e)}))}function os(t,e,n,i,r,s,a,o,l,h,c,u){m.call(this,null,s,a,o,l,h,i,r,c,u),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function ls(t,e,n,i,r,s,a,o,l){m.call(this,t,e,n,i,r,s,a,o,l),this.needsUpdate=!0}function hs(t,e,n,i,r,s,a,o,l,h){if(1026!==(h=void 0!==h?h:1026)&&1027!==h)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&1026===h&&(n=1012),void 0===n&&1027===h&&(n=1020),m.call(this,null,i,r,s,a,o,h,n,l),this.image={width:t,height:e},this.magFilter=void 0!==a?a:1003,this.minFilter=void 0!==o?o:1003,this.flipY=!1,this.generateMipmaps=!1}rs.prototype=Object.assign(Object.create(xt.prototype),{constructor:rs,isPoints:!0,copy:function(t){return xt.prototype.copy.call(this,t),this.material=t.material,this.geometry=t.geometry,this},raycast:function(t,e){const n=this.geometry,i=this.matrixWorld,r=t.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),ns.copy(n.boundingSphere),ns.applyMatrix4(i),ns.radius+=r,!1===t.ray.intersectsSphere(ns))return;ts.copy(i).invert(),es.copy(t.ray).applyMatrix4(ts);const s=r/((this.scale.x+this.scale.y+this.scale.z)/3),a=s*s;if(n.isBufferGeometry){const r=n.index,s=n.attributes.position;if(null!==r){const n=r.array;for(let r=0,o=n.length;r0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),as.prototype=Object.assign(Object.create(m.prototype),{constructor:as,clone:function(){return new this.constructor(this.image).copy(this)},isVideoTexture:!0,update:function(){const t=this.image;!1==="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),os.prototype=Object.create(m.prototype),os.prototype.constructor=os,os.prototype.isCompressedTexture=!0,ls.prototype=Object.create(m.prototype),ls.prototype.constructor=ls,ls.prototype.isCanvasTexture=!0,hs.prototype=Object.create(m.prototype),hs.prototype.constructor=hs,hs.prototype.isDepthTexture=!0;new _,new _,new _,new Dt;const cs=function(t,e,n){n=n||2;const i=e&&e.length,r=i?e[0]*n:t.length;let s=us(t,0,r,n,!0);const a=[];if(!s||s.next===s.prev)return a;let o,l,h,c,u,d,p;if(i&&(s=function(t,e,n,i){const r=[];let s,a,o,l,h;for(s=0,a=e.length;s80*n){o=h=t[0],l=c=t[1];for(let e=n;eh&&(h=u),d>c&&(c=d);p=Math.max(h-o,c-l),p=0!==p?1/p:0}return ps(s,a,n,o,l,p),a};function us(t,e,n,i,r){let s,a;if(r===function(t,e,n,i){let r=0;for(let s=e,a=n-i;s0)for(s=e;s=e;s-=i)a=Os(s,t[s],t[s+1],a);return a&&Ts(a,a.next)&&(Is(a),a=a.next),a}function ds(t,e){if(!t)return t;e||(e=t);let n,i=t;do{if(n=!1,i.steiner||!Ts(i,i.next)&&0!==Es(i.prev,i,i.next))i=i.next;else{if(Is(i),i=e=i.prev,i===i.next)break;n=!0}}while(n||i!==e);return e}function ps(t,e,n,i,r,s,a){if(!t)return;!a&&s&&function(t,e,n,i){let r=t;do{null===r.z&&(r.z=bs(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,n,i,r,s,a,o,l,h=1;do{for(n=t,t=null,s=null,a=0;n;){for(a++,i=n,o=0,e=0;e0||l>0&&i;)0!==o&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,o--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;n=i}s.nextZ=null,h*=2}while(a>1)}(r)}(t,i,r,s);let o,l,h=t;for(;t.prev!==t.next;)if(o=t.prev,l=t.next,s?ms(t,i,r,s):fs(t))e.push(o.i/n),e.push(t.i/n),e.push(l.i/n),Is(t),t=l.next,h=l.next;else if((t=l)===h){a?1===a?ps(t=gs(ds(t),e,n),e,n,i,r,s,2):2===a&&vs(t,e,n,i,r,s):ps(ds(t),e,n,i,r,s,1);break}}function fs(t){const e=t.prev,n=t,i=t.next;if(Es(e,n,i)>=0)return!1;let r=t.next.next;for(;r!==t.prev;){if(ws(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&Es(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function ms(t,e,n,i){const r=t.prev,s=t,a=t.next;if(Es(r,s,a)>=0)return!1;const o=r.xs.x?r.x>a.x?r.x:a.x:s.x>a.x?s.x:a.x,c=r.y>s.y?r.y>a.y?r.y:a.y:s.y>a.y?s.y:a.y,u=bs(o,l,e,n,i),d=bs(h,c,e,n,i);let p=t.prevZ,f=t.nextZ;for(;p&&p.z>=u&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&ws(r.x,r.y,s.x,s.y,a.x,a.y,p.x,p.y)&&Es(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&ws(r.x,r.y,s.x,s.y,a.x,a.y,f.x,f.y)&&Es(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=u;){if(p!==t.prev&&p!==t.next&&ws(r.x,r.y,s.x,s.y,a.x,a.y,p.x,p.y)&&Es(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&ws(r.x,r.y,s.x,s.y,a.x,a.y,f.x,f.y)&&Es(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function gs(t,e,n){let i=t;do{const r=i.prev,s=i.next.next;!Ts(r,s)&&Ls(r,i,i.next,s)&&Ps(r,s)&&Ps(s,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(s.i/n),Is(i),Is(i.next),i=t=s),i=i.next}while(i!==t);return ds(i)}function vs(t,e,n,i,r,s){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&Ss(a,t)){let o=Rs(a,t);return a=ds(a,a.next),o=ds(o,o.next),ps(a,e,n,i,r,s),void ps(o,e,n,i,r,s)}t=t.next}a=a.next}while(a!==t)}function ys(t,e){return t.x-e.x}function xs(t,e){if(e=function(t,e){let n=e;const i=t.x,r=t.y;let s,a=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){const t=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=i&&t>a){if(a=t,t===i){if(r===n.y)return n;if(r===n.next.y)return n.next}s=n.x=n.x&&n.x>=l&&i!==n.x&&ws(rs.x||n.x===s.x&&_s(s,n)))&&(s=n,u=c)),n=n.next}while(n!==o);return s}(t,e)){const n=Rs(e,t);ds(e,e.next),ds(n,n.next)}}function _s(t,e){return Es(t.prev,t,e.prev)<0&&Es(e.next,t,t.next)<0}function bs(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ms(t){let e=t,n=t;do{(e.x=0&&(t-a)*(i-o)-(n-a)*(e-o)>=0&&(n-a)*(s-o)-(r-a)*(i-o)>=0}function Ss(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Ls(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Ps(t,e)&&Ps(e,t)&&function(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(Es(t.prev,t,e.prev)||Es(t,e.prev,e))||Ts(t,e)&&Es(t.prev,t,t.next)>0&&Es(e.prev,e,e.next)>0)}function Es(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Ts(t,e){return t.x===e.x&&t.y===e.y}function Ls(t,e,n,i){const r=Cs(Es(t,e,n)),s=Cs(Es(t,e,i)),a=Cs(Es(n,i,t)),o=Cs(Es(n,i,e));return r!==s&&a!==o||(!(0!==r||!As(t,n,e))||(!(0!==s||!As(t,i,e))||(!(0!==a||!As(n,t,i))||!(0!==o||!As(n,e,i)))))}function As(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Cs(t){return t>0?1:t<0?-1:0}function Ps(t,e){return Es(t.prev,t,t.next)<0?Es(t,e,t.next)>=0&&Es(t,t.prev,e)>=0:Es(t,e,t.prev)<0||Es(t,t.next,e)<0}function Rs(t,e){const n=new Ds(t.i,t.x,t.y),i=new Ds(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function Os(t,e,n,i){const r=new Ds(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function Is(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ds(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}const Ns={area:function(t){const e=t.length;let n=0;for(let i=e-1,r=0;r2&&t[e-1].equals(t[0])&&t.pop()}function ks(t,e){for(let n=0;nNumber.EPSILON){const d=Math.sqrt(u),p=Math.sqrt(l*l+h*h),f=e.x-o/d,m=e.y+a/d,g=((n.x-h/p-f)*h-(n.y+l/p-m)*l)/(a*h-o*l);i=f+a*g-t.x,r=m+o*g-t.y;const v=i*i+r*r;if(v<=2)return new c(i,r);s=Math.sqrt(v/2)}else{let t=!1;a>Number.EPSILON?l>Number.EPSILON&&(t=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(o)===Math.sign(h)&&(t=!0),t?(i=-o,r=a,s=Math.sqrt(u)):(i=a,r=o,s=Math.sqrt(u/2))}return new c(i/s,r/s)}const I=[];for(let t=0,e=A.length,n=e-1,i=t+1;t=0;t--){const e=t/f,n=u*Math.cos(e*Math.PI/2),i=d*Math.sin(e*Math.PI/2)+p;for(let t=0,e=A.length;t=0;){const i=n;let r=n-1;r<0&&(r=t.length-1);for(let t=0,n=o+2*f;t=0?(t(i-o,p,c),u.subVectors(h,c)):(t(i+o,p,c),u.subVectors(c,h)),p-o>=0?(t(i,p-o,c),d.subVectors(h,c)):(t(i,p+o,c),d.subVectors(c,h)),l.crossVectors(u,d).normalize(),s.push(l.x,l.y,l.z),a.push(i,p)}}for(let t=0;t0)&&d.push(e,r,l),(t!==n-1||o=i)){l.push(e.times[t]);for(let n=0;ns.tracks[t].times[0]&&(o=s.tracks[t].times[0]);for(let t=0;t=i.times[u]){const t=u*l+o,e=t+l-o;d=ea.arraySlice(i.values,t,e)}else{const t=i.createInterpolant(),e=o,n=l-o;t.evaluate(s),d=ea.arraySlice(t.resultBuffer,e,n)}if("quaternion"===r){(new x).fromArray(d).normalize().conjugate().toArray(d)}const p=a.times.length;for(let t=0;t=r)break t;{const a=e[1];t=r)break e}s=n,n=0}}for(;n>>1;te;)--s;if(++s,0!==r||s!==i){r>=s&&(s=Math.max(s,1),r=s-1);const t=this.getValueSize();this.times=ea.arraySlice(n,r,s),this.values=ea.arraySlice(this.values,r*t,s*t)}return this},validate:function(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==r;e++){const i=n[e];if("number"==typeof i&&isNaN(i)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,i),t=!1;break}if(null!==s&&s>i){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,i,s),t=!1;break}s=i}if(void 0!==i&&ea.isTypedArray(i))for(let e=0,n=i.length;e!==n;++e){const n=i[e];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,n),t=!1;break}}return t},optimize:function(){const t=ea.arraySlice(this.times),e=ea.arraySlice(this.values),n=this.getValueSize(),i=2302===this.getInterpolation(),r=t.length-1;let s=1;for(let a=1;a0){t[s]=t[r];for(let t=r*n,i=s*n,a=0;a!==n;++a)e[i+a]=e[t+a];++s}return s!==t.length?(this.times=ea.arraySlice(t,0,s),this.values=ea.arraySlice(e,0,s*n)):(this.times=t,this.values=e),this},clone:function(){const t=ea.arraySlice(this.times,0),e=ea.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}),oa.prototype=Object.assign(Object.create(aa.prototype),{constructor:oa,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),la.prototype=Object.assign(Object.create(aa.prototype),{constructor:la,ValueTypeName:"color"}),ha.prototype=Object.assign(Object.create(aa.prototype),{constructor:ha,ValueTypeName:"number"}),ca.prototype=Object.assign(Object.create(na.prototype),{constructor:ca,interpolate_:function(t,e,n,i){const r=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=(n-e)/(i-e);let l=t*a;for(let t=l+a;l!==t;l+=4)x.slerpFlat(r,0,s,l-a,s,l,o);return r}}),ua.prototype=Object.assign(Object.create(aa.prototype),{constructor:ua,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(t){return new ca(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),da.prototype=Object.assign(Object.create(aa.prototype),{constructor:da,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),pa.prototype=Object.assign(Object.create(aa.prototype),{constructor:pa,ValueTypeName:"vector"}),Object.assign(fa,{parse:function(t){const e=[],n=t.tracks,i=1/(t.fps||1);for(let t=0,r=n.length;t!==r;++t)e.push(ma(n[t]).scale(i));const r=new fa(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r},toJSON:function(t){const e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,i=n.length;t!==i;++t)e.push(aa.toJSON(n[t]));return i},CreateFromMorphTargetSequence:function(t,e,n,i){const r=e.length,s=[];for(let t=0;t1){const t=s[1];let e=i[t];e||(i[t]=e=[]),e.push(n)}}const s=[];for(const t in i)s.push(fa.CreateFromMorphTargetSequence(t,i[t],e,n));return s},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(t,e,n,i,r){if(0!==n.length){const s=[],a=[];ea.flattenJSON(n,s,a,i),0!==s.length&&r.push(new t(e,s,a))}},i=[],r=t.name||"default",s=t.fps||30,a=t.blendMode;let o=t.length||-1;const l=t.hierarchy||[];for(let t=0;t0||0===t.search(/^data\:image\/jpeg/);r.format=i?1022:1023,r.needsUpdate=!0,void 0!==e&&e(r)}),n,i),r}}),Object.assign(Aa.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){const t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,i=this.getPoint(0),r=0;e.push(0);for(let s=1;s<=t;s++)n=this.getPoint(s/t),r+=n.distanceTo(i),e.push(r),i=n;return this.cacheArcLengths=e,e},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){const n=this.getLengths();let i=0;const r=n.length;let s;s=e||t*n[r-1];let a,o=0,l=r-1;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),a=n[i]-s,a<0)o=i+1;else{if(!(a>0)){l=i;break}l=i-1}if(i=l,n[i]===s)return i/(r-1);const h=n[i];return(i+(s-h)/(n[i+1]-h))/(r-1)},getTangent:function(t,e){let n=t-1e-4,i=t+1e-4;n<0&&(n=0),i>1&&(i=1);const r=this.getPoint(n),s=this.getPoint(i),a=e||(r.isVector2?new c:new _);return a.copy(s).sub(r).normalize(),a},getTangentAt:function(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)},computeFrenetFrames:function(t,e){const n=new _,i=[],r=[],s=[],a=new _,o=new Y;for(let e=0;e<=t;e++){const n=e/t;i[e]=this.getTangentAt(n,new _),i[e].normalize()}r[0]=new _,s[0]=new _;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),u=Math.abs(i[0].y),d=Math.abs(i[0].z);c<=l&&(l=c,n.set(1,0,0)),u<=l&&(l=u,n.set(0,1,0)),d<=l&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],a),s[0].crossVectors(i[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),s[e]=s[e-1].clone(),a.crossVectors(i[e-1],i[e]),a.length()>Number.EPSILON){a.normalize();const t=Math.acos(h.clamp(i[e-1].dot(i[e]),-1,1));r[e].applyMatrix4(o.makeRotationAxis(a,t))}s[e].crossVectors(i[e],r[e])}if(!0===e){let e=Math.acos(h.clamp(r[0].dot(r[t]),-1,1));e/=t,i[0].dot(a.crossVectors(r[0],r[t]))>0&&(e=-e);for(let n=1;n<=t;n++)r[n].applyMatrix4(o.makeRotationAxis(i[n],e*n)),s[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:s}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),Ca.prototype=Object.create(Aa.prototype),Ca.prototype.constructor=Ca,Ca.prototype.isEllipseCurve=!0,Ca.prototype.getPoint=function(t,e){const n=e||new c,i=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)i;)r-=i;r0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===h&&l===r-1&&(l=r-2,h=1),this.closed||l>0?a=i[(l-1)%r]:(Oa.subVectors(i[0],i[1]).add(i[0]),a=Oa);const c=i[l%r],u=i[(l+1)%r];if(this.closed||l+2i.length-2?i.length-1:s+1],u=i[s>i.length-3?i.length-1:s+2];return n.set(ka(a,o.x,l.x,h.x,u.x),ka(a,o.y,l.y,h.y,u.y)),n},qa.prototype.copy=function(t){Aa.prototype.copy.call(this,t),this.points=[];for(let e=0,n=t.points.length;e=e){const t=n[i]-e,r=this.curves[i],s=r.getLength(),a=0===s?0:1-t/s;return r.getPointAt(a)}i++}return null},getLength:function(){const t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,i=this.curves.length;n1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e},copy:function(t){Aa.prototype.copy.call(this,t),this.curves=[];for(let e=0,n=t.curves.length;e0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const h=l.getPoint(1);return this.currentPoint.copy(h),this},copy:function(t){return Ya.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){const t=Ya.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return Ya.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),Ja.prototype=Object.assign(Object.create(Za.prototype),{constructor:Ja,getPointsHoles:function(t){const e=[];for(let n=0,i=this.holes.length;n0:i.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const e in t.uniforms){const r=t.uniforms[e];switch(i.uniforms[e]={},r.type){case"t":i.uniforms[e].value=n(r.value);break;case"c":i.uniforms[e].value=(new Ht).setHex(r.value);break;case"v2":i.uniforms[e].value=(new c).fromArray(r.value);break;case"v3":i.uniforms[e].value=(new _).fromArray(r.value);break;case"v4":i.uniforms[e].value=(new v).fromArray(r.value);break;case"m3":i.uniforms[e].value=(new u).fromArray(r.value);break;case"m4":i.uniforms[e].value=(new Y).fromArray(r.value);break;default:i.uniforms[e].value=r.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(const e in t.extensions)i.extensions[e]=t.extensions[e];if(void 0!==t.shading&&(i.flatShading=1===t.shading),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=n(t.map)),void 0!==t.matcap&&(i.matcap=n(t.matcap)),void 0!==t.alphaMap&&(i.alphaMap=n(t.alphaMap)),void 0!==t.bumpMap&&(i.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),i.normalScale=(new c).fromArray(e)}return void 0!==t.displacementMap&&(i.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=n(t.specularMap)),void 0!==t.envMap&&(i.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(i.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(i.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(i.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=n(t.gradientMap)),void 0!==t.clearcoatMap&&(i.clearcoatMap=n(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=n(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(i.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(i.clearcoatNormalScale=(new c).fromArray(t.clearcoatNormalScale)),void 0!==t.transmission&&(i.transmission=t.transmission),void 0!==t.transmissionMap&&(i.transmissionMap=n(t.transmissionMap)),i},setTextures:function(t){return this.textures=t,this}});const po=function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let n=0,i=t.length;nNumber.EPSILON){if(l<0&&(n=e[s],o=-o,a=e[r],l=-l),t.ya.y)continue;if(t.y===n.y){if(t.x===n.x)return!0}else{const e=l*(t.x-n.x)-o*(t.y-n.y);if(0===e)return!0;if(e<0)continue;i=!i}}else{if(t.y!==n.y)continue;if(a.x<=t.x&&t.x<=n.x||n.x<=t.x&&t.x<=a.x)return!0}}return i}const r=Ns.isClockWise,s=this.subPaths;if(0===s.length)return[];if(!0===e)return n(s);let a,o,l;const h=[];if(1===s.length)return o=s[0],l=new Ja,l.curves=o.curves,h.push(l),h;let c=!r(s[0].getPoints());c=t?!c:c;const u=[],d=[];let p,f,m=[],g=0;d[g]=void 0,m[g]=[];for(let e=0,n=s.length;e1){let t=!1;const e=[];for(let t=0,e=d.length;t0&&(t||(m=u))}for(let t=0,e=d.length;t0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(n,i,this._addIndex*e,1,e);for(let t=e,r=e+e;t!==r;++t)if(n[t]!==n[t+e]){a.setValue(n,i);break}},saveOriginalState:function(){const t=this.binding,e=this.buffer,n=this.valueSize,i=n*this._origIndex;t.getValue(e,i);for(let t=n,r=i;t!==r;++t)e[t]=e[i+t%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_setAdditiveIdentityNumeric:function(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let n=t;n=.5)for(let i=0;i!==r;++i)t[e+i]=t[n+i]},_slerp:function(t,e,n,i){x.slerpFlat(t,e,t,e,t,n,i)},_slerpAdditive:function(t,e,n,i,r){const s=this._workIndex*r;x.multiplyQuaternionsFlat(t,s,t,e,t,n),x.slerpFlat(t,e,t,e,t,s,i)},_lerp:function(t,e,n,i,r){const s=1-i;for(let a=0;a!==r;++a){const r=e+a;t[r]=t[r]*s+t[n+a]*i}},_lerpAdditive:function(t,e,n,i,r){for(let s=0;s!==r;++s){const r=e+s;t[r]=t[r]+t[n+s]*i}}});const Oo=new RegExp("[\\[\\]\\.:\\/]","g"),Io="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Do=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),No=/(WCOD+)?/.source.replace("WCOD",Io),zo=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),ko=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Fo=new RegExp("^"+Do+No+zo+ko+"$"),Bo=["material","materials","bones"];function Uo(t,e,n){const i=n||Ho.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}function Ho(t,e,n){this.path=e,this.parsedPath=n||Ho.parseTrackName(e),this.node=Ho.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}Object.assign(Uo.prototype,{getValue:function(t,e){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(t,e)},setValue:function(t,e){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(t,e)},bind:function(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(Ho,{Composite:Uo,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new Ho.Composite(t,e,n):new Ho(t,e,n)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(Oo,"")},parseTrackName:function(t){const e=Fo.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const t=n.nodeName.substring(i+1);-1!==Bo.indexOf(t)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=t)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n},findNode:function(t,e){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){const n=function(t){for(let i=0;i=r){const s=r++,h=t[s];e[h.uuid]=l,t[l]=h,e[o]=s,t[s]=a;for(let t=0,e=i;t!==e;++t){const e=n[t],i=e[s],r=e[l];e[l]=i,e[s]=r}}}this.nCachedObjects_=r},uncache:function(){const t=this._objects,e=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_,s=t.length;for(let a=0,o=arguments.length;a!==o;++a){const o=arguments[a].uuid,l=e[o];if(void 0!==l)if(delete e[o],l0&&(e[a.uuid]=l),t[l]=a,t.pop();for(let t=0,e=i;t!==e;++t){const e=n[t];e[l]=e[r],e.pop()}}}this.nCachedObjects_=r},subscribe_:function(t,e){const n=this._bindingsIndicesByPath;let i=n[t];const r=this._bindings;if(void 0!==i)return r[i];const s=this._paths,a=this._parsedPaths,o=this._objects,l=o.length,h=this.nCachedObjects_,c=new Array(l);i=r.length,n[t]=i,s.push(t),a.push(e),r.push(c);for(let n=h,i=o.length;n!==i;++n){const i=o[n];c[n]=new Ho(i,t,e)}return c},unsubscribe_:function(t){const e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){const i=this._paths,r=this._parsedPaths,s=this._bindings,a=s.length-1,o=s[a];e[t[a]]=n,s[n]=o,s.pop(),r[n]=r[a],r.pop(),i[n]=i[a],i.pop()}}});class jo{constructor(t,e,n=null,i=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=n,this.blendMode=i;const r=e.tracks,s=r.length,a=new Array(s),o={endingStart:2400,endingEnd:2400};for(let t=0;t!==s;++t){const e=r[t].createInterpolant(null);a[t]=e,e.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){const n=this._clip.duration,i=t._clip.duration,r=i/n,s=n/i;t.warp(1,r,e),this.warp(s,1,e)}return this}crossFadeTo(t,e,n){return t.crossFadeFrom(this,e,n)}stopFading(){const t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,n){const i=this._mixer,r=i.time,s=this.timeScale;let a=this._timeScaleInterpolant;null===a&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const o=a.parameterPositions,l=a.sampleValues;return o[0]=r,o[1]=r+n,l[0]=t/s,l[1]=e/s,this}stopWarping(){const t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,n,i){if(!this.enabled)return void this._updateWeight(t);const r=this._startTime;if(null!==r){const i=(t-r)*n;if(i<0||0===n)return;this._startTime=null,e=n*i}e*=this._updateTimeScale(t);const s=this._updateTime(e),a=this._updateWeight(t);if(a>0){const t=this._interpolants,e=this._propertyBindings;switch(this.blendMode){case 2501:for(let n=0,i=t.length;n!==i;++n)t[n].evaluate(s),e[n].accumulateAdditive(a);break;case 2500:default:for(let n=0,r=t.length;n!==r;++n)t[n].evaluate(s),e[n].accumulate(i,a)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const n=this._weightInterpolant;if(null!==n){const i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,n=this.loop;let i=this.time+t,r=this._loopCount;const s=2202===n;if(0===t)return-1===r?i:s&&1==(1&r)?e-i:i;if(2200===n){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(i>=e)i=e;else{if(!(i<0)){this.time=i;break t}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),i>=e||i<0){const n=Math.floor(i/e);i-=e*n,r+=Math.abs(n);const a=this.repetitions-r;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=t>0?e:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===a){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=i;if(s&&1==(1&r))return e-i}return i}_setEndings(t,e,n){const i=this._interpolantSettings;n?(i.endingStart=2401,i.endingEnd=2401):(i.endingStart=t?this.zeroSlopeAtStart?2401:2400:2402,i.endingEnd=e?this.zeroSlopeAtEnd?2401:2400:2402)}_scheduleFading(t,e,n){const i=this._mixer,r=i.time;let s=this._weightInterpolant;null===s&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const a=s.parameterPositions,o=s.sampleValues;return a[0]=r,o[0]=e,a[1]=r+t,o[1]=n,this}}function Go(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}Go.prototype=Object.assign(Object.create(a.prototype),{constructor:Go,_bindAction:function(t,e){const n=t._localRoot||this._root,i=t._clip.tracks,r=i.length,s=t._propertyBindings,a=t._interpolants,o=n.uuid,l=this._bindingsByRootAndName;let h=l[o];void 0===h&&(h={},l[o]=h);for(let t=0;t!==r;++t){const r=i[t],l=r.name;let c=h[l];if(void 0!==c)s[t]=c;else{if(c=s[t],void 0!==c){null===c._cacheIndex&&(++c.referenceCount,this._addInactiveBinding(c,o,l));continue}const i=e&&e._propertyBindings[t].binding.parsedPath;c=new Ro(Ho.create(n,l,i),r.ValueTypeName,r.getValueSize()),++c.referenceCount,this._addInactiveBinding(c,o,l),s[t]=c}a[t].resultBuffer=c.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,n=t._clip.uuid,i=this._actionsByClip[n];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,n,e)}const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){const e=t._cacheIndex;return null!==e&&e=0;--e)t[e].stop();return this},update:function(t){t*=this.timeScale;const e=this._actions,n=this._nActiveActions,i=this.time+=t,r=Math.sign(t),s=this._accuIndex^=1;for(let a=0;a!==n;++a){e[a]._update(i,t,r,s)}const a=this._bindings,o=this._nActiveBindings;for(let t=0;t!==o;++t)a[t].apply(s);return this},setTime:function(t){this.time=0;for(let t=0;t4?a=al[r-8+4-1]:0==r&&(a=0),n.push(a);const o=1/(s-1),l=-o/2,h=1+o/2,c=[l,l,h,l,h,h,l,l,h,h,l,h],u=6,d=6,p=3,f=2,m=1,g=new Float32Array(p*d*u),v=new Float32Array(f*d*u),y=new Float32Array(m*d*u);for(let t=0;t2?0:-1,i=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];g.set(i,p*d*t),v.set(c,f*d*t);const r=[t,t,t,t,t,t];y.set(r,m*d*t)}const x=new me;x.setAttribute("position",new Yt(g,p)),x.setAttribute("uv",new Yt(v,f)),x.setAttribute("faceIndex",new Yt(y,m)),t.push(x),i>4&&i--}return{_lodPlanes:t,_sizeLods:e,_sigmas:n}}function pl(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),za.call(this,t),this.type="catmullrom"}Aa.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Aa.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(Za.prototype,{fromPoints:function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),Object.create(za.prototype),Object.create(za.prototype),pl.prototype=Object.create(za.prototype),Object.assign(pl.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),class extends Kr{constructor(t=10,e=10,n=4473924,i=8947848){n=new Ht(n),i=new Ht(i);const r=e/2,s=t/e,a=t/2,o=[],l=[];for(let t=0,h=0,c=-a;t<=e;t++,c+=s){o.push(-a,0,c,a,0,c),o.push(c,0,-a,c,0,a);const e=t===r?n:i;e.toArray(l,h),h+=3,e.toArray(l,h),h+=3,e.toArray(l,h),h+=3,e.toArray(l,h),h+=3}const h=new me;h.setAttribute("position",new ie(o,3)),h.setAttribute("color",new ie(l,3));super(h,new jr({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},class extends Kr{constructor(t){const e=function t(e){const n=[];e&&e.isBone&&n.push(e);for(let i=0;ithis.max.x||t.ythis.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new c),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)}clampPoint(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new c),e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return Ko.copy(t).clamp(this.min,this.max).sub(t).length()}intersect(t){return this.min.max(t.min),this.max.min(t.max),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(w.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(B.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),Ye.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},tl.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(h,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),h.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),h.ceilPowerOfTwo(t)}}),Object.assign(u.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},getInverse:function(t){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(t).invert()}}),Object.assign(Y.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new _).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,i,r,s){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,i,n,r,s)},getInverse:function(t){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(t).invert()}}),wt.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},Object.assign(x.prototype,{multiplyVector3:function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},inverse:function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()}}),Object.assign(X.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(Dt.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(Dt,{barycoordFromPoint:function(t,e,n,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Dt.getBarycoord(t,e,n,i,r)},normal:function(t,e,n,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Dt.getNormal(t,e,n,i)}}),Object.assign(Ja.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Fs(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Hs(this,t)}}),Object.assign(c.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(_.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(v.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(xt.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(xt.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(Ie.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(Ie.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(Tr.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(zr.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Or.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Aa.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),He.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(Ka.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(Yt.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),35048===this.usage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),Object.assign(Yt.prototype,{setDynamic:function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?35048:35044),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(me.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addAttribute:function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new Yt(arguments[1],arguments[2])))},addDrawCall:function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},applyMatrix:function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(me.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(mo.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(t){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=t}}}),Object.defineProperties(Xo.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(t){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=t}}}),Object.defineProperties(sr.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),35048===this.usage},set:function(t){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(t)}}}),Object.assign(sr.prototype,{setDynamic:function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?35048:35044),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Fs.prototype,{getArrays:function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")}}),Object.assign(rr.prototype,{dispose:function(){console.error("THREE.Scene: .dispose() has been removed.")}}),Object.defineProperties(Vo.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(Vt.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new Ht}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===t}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}}}),Object.defineProperties(Ys.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(Xs.prototype,{transparency:{get:function(){return console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission},set:function(t){console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission=t}}}),Object.defineProperties(Be.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(nr.prototype,{clearTarget:function(t,e,n,i){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,i)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(nr.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?3001:3e3}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(Xi.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(y.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(Po.prototype,{load:{value:function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this;return(new Eo).load(t,(function(t){e.setBuffer(t)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),class{constructor(t,e=2048){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=e,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let t=0;const e=this.getFrequencyData();for(let n=0;nv||8*(1-h.dot(u.object.quaternion))>v)&&(u.dispatchEvent(d),l.copy(u.object.position),h.copy(u.object.quaternion),S=!1,!0)}),this.dispose=function(){u.domElement.removeEventListener("contextmenu",et,!1),u.domElement.removeEventListener("mousedown",X,!1),u.domElement.removeEventListener("wheel",J,!1),u.domElement.removeEventListener("touchstart",Q,!1),u.domElement.removeEventListener("touchend",tt,!1),u.domElement.removeEventListener("touchmove",$,!1),document.removeEventListener("mousemove",Y,!1),document.removeEventListener("mouseup",Z,!1),window.removeEventListener("keydown",K,!1)};var u=this,d={type:"change"},p={type:"start"},f={type:"end"},m={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5,TOUCH_DOLLY_PAN:6},g=m.NONE,v=1e-6,y=new Jo,b=new Jo,M=1,w=new _,S=!1,E=new c,T=new c,L=new c,A=new c,C=new c,P=new c,R=new c,O=new c,I=new c;function D(){return u.domElement===document?u.domElement.body:u.domElement}function N(t){return t=t||1,Math.pow(.95,u.zoomSpeed*t)}function z(t){b.theta-=t}function k(t){b.phi-=t}this.rotateLeft=z,this.rotateUp=k;var F,B=(F=new _,function(t,e){var n=e.elements;u.flipPanUp?F.set(n[0],0,n[2]).normalize():F.set(n[0],n[1],0).normalize(),F.multiplyScalar(-t),w.add(F)}),U=function(){var t=new _;return function(e,n){var i=n.elements;u.flipPanUp?t.set(i[4],0,i[6]).normalize():t.set(i[4],i[5],0).normalize(),t.multiplyScalar(e),w.add(t)}}(),H=function(){var t=new _;return function(e,n){var i=D();if(u.object instanceof He){var r=u.object.position;t.copy(r).sub(u.target);var s=t.length();s*=Math.tan(u.object.fov/2*Math.PI/180),B(2*e*s/i.clientHeight,u.object.matrix),U(2*n*s/i.clientHeight,u.object.matrix)}else u.object instanceof ro?(B(e*(u.object.right-u.object.left)/u.object.zoom/i.clientWidth,u.object.matrix),U(n*(u.object.top-u.object.bottom)/u.object.zoom/i.clientHeight,u.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),u.enablePan=!1)}}();function j(t){u.object instanceof He?M/=t:u.object instanceof ro?(u.object.zoom=Math.max(u.minZoom,Math.min(u.maxZoom,u.object.zoom*t)),u.object.updateProjectionMatrix(),S=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),u.enableZoom=!1)}function G(t){u.object instanceof He?M*=t:u.object instanceof ro?(u.object.zoom=Math.max(u.minZoom,Math.min(u.maxZoom,u.object.zoom/t)),u.object.updateProjectionMatrix(),S=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),u.enableZoom=!1)}function V(t){t.deltaY<0?G(N()):t.deltaY>0&&j(N()),u.update()}function W(t){var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,i=Math.sqrt(e*e+n*n);R.set(0,i)}function q(t){var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,i=Math.sqrt(e*e+n*n);O.set(0,i),I.subVectors(O,R);var r=D(),s=Math.abs(I.y)/(.01*r.clientHeight);I.y>0?G(N(s)):I.y<0&&j(N(s)),R.copy(O),u.update()}function X(t){if(!1!==u.enabled){if(t.preventDefault(),t.button===u.mouseButtons.ORBIT){if(!1===u.enableRotate)return;!function(t){E.set(t.clientX,t.clientY)}(t),g=m.ROTATE}else if(t.button===u.mouseButtons.ZOOM){if(!1===u.enableZoom)return;!function(t){R.set(t.clientX,t.clientY)}(t),g=m.DOLLY}else if(t.button===u.mouseButtons.PAN){if(!1===u.enablePan)return;!function(t){A.set(t.clientX,t.clientY)}(t),g=m.PAN}g!==m.NONE&&(document.addEventListener("mousemove",Y,!1),document.addEventListener("mouseup",Z,!1),u.dispatchEvent(p))}}function Y(t){if(!1!==u.enabled)if(t.preventDefault(),g===m.ROTATE){if(!1===u.enableRotate)return;!function(t){T.set(t.clientX,t.clientY),L.subVectors(T,E);var e=D();z(2*Math.PI*L.x/e.clientWidth*u.rotateSpeed),k(2*Math.PI*L.y/e.clientHeight*u.rotateSpeed),E.copy(T),u.update()}(t)}else if(g===m.DOLLY){if(!1===u.enableZoom)return;!function(t){O.set(t.clientX,t.clientY),I.subVectors(O,R);var e=D(),n=Math.abs(I.y)/(.01*e.clientHeight);I.y>0?j(N(n)):I.y<0&&G(N(n)),R.copy(O),u.update()}(t)}else if(g===m.PAN){if(!1===u.enablePan)return;!function(t){C.set(t.clientX,t.clientY),P.subVectors(C,A),H(P.x,P.y),A.copy(C),u.update()}(t)}}function Z(t){!1!==u.enabled&&(document.removeEventListener("mousemove",Y,!1),document.removeEventListener("mouseup",Z,!1),u.dispatchEvent(f),g=m.NONE)}function J(t){!1===u.enabled||!1===u.enableZoom||g!==m.NONE&&g!==m.ROTATE||(t.preventDefault(),V(t),u.dispatchEvent(p),u.dispatchEvent(f))}function K(t){!1!==u.enabled&&!1!==u.enableKeys&&!1!==u.enablePan&&function(t){switch(t.keyCode){case u.keys.UP:H(0,u.keyPanSpeed),u.update();break;case u.keys.BOTTOM:H(0,-u.keyPanSpeed),u.update();break;case u.keys.LEFT:H(u.keyPanSpeed,0),u.update();break;case u.keys.RIGHT:H(-u.keyPanSpeed,0),u.update()}}(t)}function Q(t){if(!1!==u.enabled){switch(t.touches.length){case 1:if(!1===u.enableRotate)return;!function(t){E.set(t.touches[0].pageX,t.touches[0].pageY)}(t),g=m.TOUCH_ROTATE;break;case 2:if(!1===u.enableZoom&&!1===u.enablePan)return;if(!0===u.enableTwoFingerZoomPan)!function(t){if(!0===u.enableZoom&&W(t),!0===u.enablePan){var e=(t.touches[0].pageX+t.touches[1].pageX)/2,n=(t.touches[0].pageY+t.touches[1].pageY)/2;A.set(e,n)}}(t),g=!0===u.enableZoom&&!0===u.enablePan?m.TOUCH_DOLLY_PAN:!0===u.enableZoom&&!1===u.eanblePan?m.TOUCH_DOLLY:m.TOUCH_PAN;else{if(!1===u.enableZoom)return;W(t),g=m.TOUCH_DOLLY}break;case 3:if(!1===u.enablePan)return;if(!0===u.enableTwoFingerZoomPan)return;!function(t){A.set(t.touches[0].pageX,t.touches[0].pageY)}(t),g=m.TOUCH_PAN;break;default:g=m.NONE}g!==m.NONE&&u.dispatchEvent(p)}}function $(t){if(!1!==u.enabled)switch(t.preventDefault(),t.stopPropagation(),t.touches.length){case 1:if(!1===u.enableRotate)return;if(g!==m.TOUCH_ROTATE)return;!function(t){T.set(t.touches[0].pageX,t.touches[0].pageY),L.subVectors(T,E);var e=D();z(2*Math.PI*L.x/e.clientWidth*u.rotateSpeed),k(2*Math.PI*L.y/e.clientHeight*u.rotateSpeed),E.copy(T),u.update()}(t);break;case 2:if(!1===u.enableZoom&&!1===u.enablePan)return;if(g!==m.TOUCH_DOLLY&&g!==m.TOUCH_PAN&&g!==m.TOUCH_DOLLY_PAN)return;if(!0===u.enableTwoFingerZoomPan)!function(t){if(!0===u.enablePan){var e=(t.touches[0].pageX+t.touches[1].pageX)/2,n=(t.touches[0].pageY+t.touches[1].pageY)/2;C.set(e,n),P.subVectors(C,A),H(P.x,P.y),A.copy(C),!1===u.enableZoom&&u.update()}!0===u.enableZoom&&q(t)}(t);else{if(!1===u.enableZoom)return;q(t)}break;case 3:if(!1===u.enablePan)return;if(g!==m.TOUCH_PAN)return;!function(t){C.set(t.touches[0].pageX,t.touches[0].pageY),P.subVectors(C,A),H(P.x,P.y),A.copy(C),u.update()}(t);break;default:g=m.NONE}}function tt(t){!1!==u.enabled&&(u.dispatchEvent(f),g=m.NONE)}function et(t){t.preventDefault()}this.handleMouseWheel=V,u.domElement.addEventListener("contextmenu",et,!1),u.domElement.addEventListener("mousedown",X,!1),u.domElement.addEventListener("wheel",J,!1),u.domElement.addEventListener("touchstart",Q,!1),u.domElement.addEventListener("touchend",tt,!1),u.domElement.addEventListener("touchmove",$,!1),window.addEventListener("keydown",K,!1),this.update()}function gl(t){var e=this;t.rotation.set(0,0,0);var n=new xt;n.add(t);var i=new xt;i.position.y=10,i.add(n);var r,s,a=Math.PI/2,o=function(t){if(!1!==e.enabled){var r=t.movementX||t.mozMovementX||t.webkitMovementX||0,s=t.movementY||t.mozMovementY||t.webkitMovementY||0;i.rotation.y-=.002*r,n.rotation.x-=.002*s,n.rotation.x=Math.max(-a,Math.min(a,n.rotation.x))}};this.dispose=function(){document.removeEventListener("mousemove",o,!1)},document.addEventListener("mousemove",o,!1),this.enabled=!1,this.getObject=function(){return i},this.getPitchObject=function(){return n},this.getDirection=(r=new _(0,0,-1),s=new nt(0,0,0,"YXZ"),function(t){return s.set(n.rotation.x,i.rotation.y,0),t.copy(r).applyEuler(s),t})}ml.prototype=Object.create(a.prototype),ml.prototype.constructor=ml,Object.defineProperties(ml.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(t){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!t}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(t){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!t}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(t){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!t}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(t){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!t}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(t){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!t}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(t){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=t}}});var vl={getIn:function(t,e,n){if(null==t)return null!=n?n:null;if(null==e)return null!=n?n:null;for(var i=Object.assign({},t),r=0;r=0?n:n+e)},findHighestMaxZoom:function(t){var e=0;for(var n in t)"Vectors As Tiles"!=t[n].name&&t[n].maxZoom>e&&(e=t[n].maxZoom);return e},findLowestMinZoom:function(t){var e=1/0;for(var n in t)"_vectorsastile_"!==t[n].path&&t[n].minZoome[1]&&le[0],r=t.x+1,s=t.y+0,o=(a=n.tileXYZ2LatLng(r,s,t.z)).lat,l=a.lng,i=i||oe[1]&&le[0],r=t.x+1,s=t.y+1,o=(a=n.tileXYZ2LatLng(r,s,t.z)).lat,l=a.lng,i=i||oe[1]&&le[0],r=t.x+0,s=t.y+1,o=(a=n.tileXYZ2LatLng(r,s,t.z)).lat,l=a.lng,i=i||oe[1]&&le[0]}return i},clone:function(t){var e;if(null==t||"object"!=typeof t)return t;if(t instanceof Date)return(e=new Date).setTime(t.getTime()),e;if(t instanceof Array){e=[];for(var n=0,i=t.length;n3&&vl.lastTileContains.pop(),s},tileIsContained:function(t,e,n){for(var i=this.tileContains(t,e[2],n),r=0;r=this.text.length)return;t=this.text[this.place++]}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},Fl.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(zl.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},Fl.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},Fl.prototype.number=function(t){if(!kl.test(t)){if(zl.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},Fl.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},Fl.prototype.keyword=function(t){if(Nl.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=1)}if(!zl.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},Fl.prototype.neutral=function(t){if(Dl.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(kl.test(t))return this.word=t,void(this.state=3);if(!zl.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},Fl.prototype.output=function(){for(;this.place0?90:-90),t.lat_ts=t.lat1)}(r),r};function Gl(t){var e=this;if(2===arguments.length){var n=arguments[1];"string"==typeof n?"+"===n.charAt(0)?Gl[t]=Rl(arguments[1]):Gl[t]=jl(arguments[1]):Gl[t]=n}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?Gl.apply(e,t):Gl(t)}));if("string"==typeof t){if(t in Gl)return Gl[t]}else"EPSG"in t?Gl["EPSG:"+t.EPSG]=t:"ESRI"in t?Gl["ESRI:"+t.ESRI]=t:"IAU2000"in t?Gl["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(Gl);var Vl=Gl;var Wl=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var ql=["3857","900913","3785","102113"];var Xl=function(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in Vl}(t))return Vl[t];if(function(t){return Wl.some((function(e){return t.indexOf(e)>-1}))}(t)){var e=jl(t);if(function(t){var e=Pl(t,"authority");if(e){var n=Pl(e,"epsg");return n&&ql.indexOf(n)>-1}}(e))return Vl["EPSG:3857"];var n=function(t){var e=Pl(t,"extension");if(e)return Pl(e,"proj4")}(e);return n?Rl(n):e}return function(t){return"+"===t[0]}(t)?Rl(t):void 0},Yl=function(t,e){var n,i;if(t=t||{},!e)return t;for(i in e)void 0!==(n=e[i])&&(t[i]=n);return t},Zl=function(t,e,n){var i=t*e;return n/Math.sqrt(1-i*i)},Jl=function(t){return t<0?-1:1},Kl=function(t){return Math.abs(t)<=Tl?t:t-Jl(t)*El},Ql=function(t,e,n){var i=t*n,r=.5*t;return i=Math.pow((1-i)/(1+i),r),Math.tan(.5*(bl-e))/i},$l=function(t,e){for(var n,i,r=.5*t,s=bl-2*Math.atan(e),a=0;a<=15;a++)if(n=t*Math.sin(s),s+=i=bl-2*Math.atan(e*Math.pow((1-n)/(1+n),r))-s,Math.abs(i)<=1e-10)return s;return-9999};function th(t){return t}var eh=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Zl(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,n,i=t.x,r=t.y;if(r*wl>90&&r*wl<-90&&i*wl>180&&i*wl<-180)return null;if(Math.abs(Math.abs(r)-bl)<=1e-10)return null;if(this.sphere)e=this.x0+this.a*this.k0*Kl(i-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan(Sl+.5*r));else{var s=Math.sin(r),a=Ql(this.e,r,s);e=this.x0+this.a*this.k0*Kl(i-this.long0),n=this.y0-this.a*this.k0*Math.log(a)}return t.x=e,t.y=n,t},inverse:function(t){var e,n,i=t.x-this.x0,r=t.y-this.y0;if(this.sphere)n=bl-2*Math.atan(Math.exp(-r/(this.a*this.k0)));else{var s=Math.exp(-r/(this.a*this.k0));if(-9999===(n=$l(this.e,s)))return null}return e=Kl(this.long0+i/(this.a*this.k0)),t.x=e,t.y=n,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:th,inverse:th,names:["longlat","identity"]}],nh={},ih=[];function rh(t,e){var n=ih.length;return t.names?(ih[n]=t,t.names.forEach((function(t){nh[t.toLowerCase()]=n})),this):(console.log(e),!0)}var sh={start:function(){eh.forEach(rh)},add:rh,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==nh[e]&&ih[nh[e]]?ih[nh[e]]:void 0}},ah={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},oh=ah.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};ah.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var lh={};lh.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},lh.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},lh.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},lh.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},lh.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},lh.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},lh.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},lh.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},lh.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},lh.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},lh.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},lh.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},lh.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},lh.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},lh.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},lh.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},lh.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var hh=function(t,e,n,i,r,s,a){var o={};return o.datum_type=void 0===t||"none"===t?5:4,e&&(o.datum_params=e.map(parseFloat),0===o.datum_params[0]&&0===o.datum_params[1]&&0===o.datum_params[2]||(o.datum_type=1),o.datum_params.length>3&&(0===o.datum_params[3]&&0===o.datum_params[4]&&0===o.datum_params[5]&&0===o.datum_params[6]||(o.datum_type=2,o.datum_params[3]*=_l,o.datum_params[4]*=_l,o.datum_params[5]*=_l,o.datum_params[6]=o.datum_params[6]/1e6+1))),a&&(o.datum_type=3,o.grids=a),o.a=n,o.b=i,o.es=r,o.ep2=s,o},ch={};function uh(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:ch[t]||null,isNull:!1}}function dh(t){return t/3600*Math.PI/180}function ph(t,e,n){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,n)))}function fh(t){return t.map((function(t){return[dh(t.longitudeShift),dh(t.latitudeShift)]}))}function mh(t,e,n){return{name:ph(t,e+8,e+16).trim(),parent:ph(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,n),upperLatitude:t.getFloat64(e+88,n),lowerLongitude:t.getFloat64(e+104,n),upperLongitude:t.getFloat64(e+120,n),latitudeInterval:t.getFloat64(e+136,n),longitudeInterval:t.getFloat64(e+152,n),gridNodeCount:t.getInt32(e+168,n)}}function gh(t,e,n,i){for(var r=e+176,s=[],a=0;a-1.001*bl)l=-bl;else if(l>bl&&l<1.001*bl)l=bl;else{if(l<-bl)return{x:-1/0,y:-1/0,z:t.z};if(l>bl)return{x:1/0,y:1/0,z:t.z}}return o>Math.PI&&(o-=2*Math.PI),r=Math.sin(l),a=Math.cos(l),s=r*r,{x:((i=n/Math.sqrt(1-e*s))+h)*a*Math.cos(o),y:(i+h)*a*Math.sin(o),z:(i*(1-e)+h)*r}}function _h(t,e,n,i){var r,s,a,o,l,h,c,u,d,p,f,m,g,v,y,x=t.x,_=t.y,b=t.z?t.z:0;if(r=Math.sqrt(x*x+_*_),s=Math.sqrt(x*x+_*_+b*b),r/n<1e-12){if(v=0,s/n<1e-12)return bl,y=-i,{x:t.x,y:t.y,z:t.z}}else v=Math.atan2(_,x);a=b/s,u=(o=r/s)*(1-e)*(l=1/Math.sqrt(1-e*(2-e)*o*o)),d=a*l,g=0;do{g++,h=e*(c=n/Math.sqrt(1-e*d*d))/(c+(y=r*u+b*d-c*(1-e*d*d))),m=(f=a*(l=1/Math.sqrt(1-h*(2-h)*o*o)))*u-(p=o*(1-h)*l)*d,u=p,d=f}while(m*m>1e-24&&g<30);return{x:v,y:Math.atan(f/Math.abs(p)),z:y}}function bh(t){return 1===t||2===t}var Mh=function(t,e,n){if(function(t,e){return t.datum_type===e.datum_type&&(!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:2!==t.datum_type||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]))}(t,e))return n;if(5===t.datum_type||5===e.datum_type)return n;var i=t.a,r=t.es;if(3===t.datum_type){if(0!==wh(t,!1,n))return;i=6378137,r=.0066943799901413165}var s=e.a,a=e.b,o=e.es;if(3===e.datum_type&&(s=6378137,a=6356752.314,o=.0066943799901413165),r===o&&i===s&&!bh(t.datum_type)&&!bh(e.datum_type))return n;if((n=xh(n,r,i),bh(t.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x+n[0],y:t.y+n[1],z:t.z+n[2]};if(2===e){var i=n[0],r=n[1],s=n[2],a=n[3],o=n[4],l=n[5],h=n[6];return{x:h*(t.x-l*t.y+o*t.z)+i,y:h*(l*t.x+t.y-a*t.z)+r,z:h*(-o*t.x+a*t.y+t.z)+s}}}(n,t.datum_type,t.datum_params)),bh(e.datum_type)&&(n=function(t,e,n){if(1===e)return{x:t.x-n[0],y:t.y-n[1],z:t.z-n[2]};if(2===e){var i=n[0],r=n[1],s=n[2],a=n[3],o=n[4],l=n[5],h=n[6],c=(t.x-i)/h,u=(t.y-r)/h,d=(t.z-s)/h;return{x:c+l*u-o*d,y:-l*c+u+a*d,z:o*c-a*u+d}}}(n,e.datum_type,e.datum_params)),n=_h(n,o,s,a),3===e.datum_type)&&0!==wh(e,!0,n))return;return n};function wh(t,e,n){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;for(var i={x:-n.x,y:n.y},r={x:Number.NaN,y:Number.NaN},s=[],a=0;ai.y||c>i.x||p1e-12&&Math.abs(a.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),i;i.x=Kl(s.x+n.ll[0]),i.y=s.y+n.ll[1]}else isNaN(s.x)||(i.x=t.x+s.x,i.y=t.y+s.y);return i}function Eh(t,e){var n,i={x:t.x/e.del[0],y:t.y/e.del[1]},r=Math.floor(i.x),s=Math.floor(i.y),a=i.x-1*r,o=i.y-1*s,l={x:Number.NaN,y:Number.NaN};if(r<0||r>=e.lim[0])return l;if(s<0||s>=e.lim[1])return l;n=s*e.lim[0]+r;var h=e.cvs[n][0],c=e.cvs[n][1];n++;var u=e.cvs[n][0],d=e.cvs[n][1];n+=e.lim[0];var p=e.cvs[n][0],f=e.cvs[n][1];n--;var m=e.cvs[n][0],g=e.cvs[n][1],v=a*o,y=a*(1-o),x=(1-a)*(1-o),_=(1-a)*o;return l.x=x*h+y*u+_*m+v*p,l.y=x*c+y*d+_*g+v*f,l}var Th=function(t,e,n){var i,r,s,a=n.x,o=n.y,l=n.z||0,h={};for(s=0;s<3;s++)if(!e||2!==s||void 0!==n.z)switch(0===s?(i=a,r=-1!=="ew".indexOf(t.axis[s])?"x":"y"):1===s?(i=o,r=-1!=="ns".indexOf(t.axis[s])?"y":"x"):(i=l,r="z"),t.axis[s]){case"e":h[r]=i;break;case"w":h[r]=-i;break;case"n":h[r]=i;break;case"s":h[r]=-i;break;case"u":void 0!==n[r]&&(h.z=i);break;case"d":void 0!==n[r]&&(h.z=-i);break;default:return null}return h},Lh=function(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e};function Ah(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function Ch(t,e,n){var i;if(Array.isArray(n)&&(n=Lh(n)),function(t){Ah(t.x),Ah(t.y)}(n),t.datum&&e.datum&&function(t,e){return(1===t.datum.datum_type||2===t.datum.datum_type)&&"WGS84"!==e.datumCode||(1===e.datum.datum_type||2===e.datum.datum_type)&&"WGS84"!==t.datumCode}(t,e)&&(n=Ch(t,i=new yh("WGS84"),n),t=i),"enu"!==t.axis&&(n=Th(t,!1,n)),"longlat"===t.projName)n={x:n.x*Ml,y:n.y*Ml,z:n.z||0};else if(t.to_meter&&(n={x:n.x*t.to_meter,y:n.y*t.to_meter,z:n.z||0}),!(n=t.inverse(n)))return;if(t.from_greenwich&&(n.x+=t.from_greenwich),n=Mh(t.datum,e.datum,n))return e.from_greenwich&&(n={x:n.x-e.from_greenwich,y:n.y,z:n.z||0}),"longlat"===e.projName?n={x:n.x*wl,y:n.y*wl,z:n.z||0}:(n=e.forward(n),e.to_meter&&(n={x:n.x/e.to_meter,y:n.y/e.to_meter,z:n.z||0})),"enu"!==e.axis?Th(e,!0,n):n}var Ph=yh("WGS84");function Rh(t,e,n){var i,r,s;return Array.isArray(n)?(i=Ch(t,e,n)||{x:NaN,y:NaN},n.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof i.z?[i.x,i.y,i.z].concat(n.splice(3)):[i.x,i.y,n[2]].concat(n.splice(3)):[i.x,i.y].concat(n.splice(2)):[i.x,i.y]):(r=Ch(t,e,n),2===(s=Object.keys(n)).length||s.forEach((function(i){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===i||"y"===i||"z"===i)return}else if("x"===i||"y"===i)return;r[i]=n[i]})),r)}function Oh(t){return t instanceof yh?t:t.oProj?t.oProj:yh(t)}var Ih=function(t,e,n){t=Oh(t);var i,r=!1;return void 0===e?(e=t,t=Ph,r=!0):(void 0!==e.x||Array.isArray(e))&&(n=e,e=t,t=Ph,r=!0),e=Oh(e),n?Rh(t,e,n):(i={forward:function(n){return Rh(t,e,n)},inverse:function(n){return Rh(e,t,n)}},r&&(i.oProj=e),i)},Dh=73,Nh=79,zh={forward:kh,inverse:function(t){var e=Hh(Vh(t.toUpperCase()));if(e.lat&&e.lon)return[e.lon,e.lat,e.lon,e.lat];return[e.left,e.bottom,e.right,e.top]},toPoint:Fh};function kh(t,e){return e=e||5,function(t,e){var n="00000"+t.easting,i="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(p=t.easting,f=t.northing,m=t.zoneNumber,g=Gh(m),v=Math.floor(p/1e5),y=Math.floor(f/1e5)%20,r=v,s=y,a=g,o=a-1,l="AJSAJS".charCodeAt(o),h="AFAFAF".charCodeAt(o),c=l+r-1,u=h+s,d=!1,c>90&&(c=c-90+65-1,d=!0),(c===Dh||lDh||(c>Dh||lNh||(c>Nh||l90&&(c=c-90+65-1),u>86?(u=u-86+65-1,d=!0):d=!1,(u===Dh||hDh||(u>Dh||hNh||(u>Nh||h86&&(u=u-86+65-1),String.fromCharCode(c)+String.fromCharCode(u))+n.substr(n.length-5,e)+i.substr(i.length-5,e);var r,s,a,o,l,h,c,u,d;var p,f,m,g,v,y}(function(t){var e,n,i,r,s,a,o,l=t.lat,h=t.lon,c=6378137,u=Bh(l),d=Bh(h);o=Math.floor((h+180)/6)+1,180===h&&(o=60);l>=56&&l<64&&h>=3&&h<12&&(o=32);l>=72&&l<84&&(h>=0&&h<9?o=31:h>=9&&h<21?o=33:h>=21&&h<33?o=35:h>=33&&h<42&&(o=37));a=Bh(6*(o-1)-180+3),.006739496752268451,e=c/Math.sqrt(1-.00669438*Math.sin(u)*Math.sin(u)),n=Math.tan(u)*Math.tan(u),i=.006739496752268451*Math.cos(u)*Math.cos(u),r=Math.cos(u)*(d-a),s=c*(.9983242984503243*u-.002514607064228144*Math.sin(2*u)+2639046602129982e-21*Math.sin(4*u)-3.418046101696858e-9*Math.sin(6*u));var p=.9996*e*(r+(1-n+i)*r*r*r/6+(5-18*n+n*n+72*i-.39089081163157013)*r*r*r*r*r/120)+5e5,f=.9996*(s+e*Math.tan(u)*(r*r/2+(5-n+9*i+4*i*i)*r*r*r*r/24+(61-58*n+n*n+600*i-2.2240339282485886)*r*r*r*r*r*r/720));l<0&&(f+=1e7);return{northing:Math.round(f),easting:Math.round(p),zoneNumber:o,zoneLetter:jh(l)}}({lat:t[1],lon:t[0]}),e)}function Fh(t){var e=Hh(Vh(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Bh(t){return t*(Math.PI/180)}function Uh(t){return t/Math.PI*180}function Hh(t){var e=t.northing,n=t.easting,i=t.zoneLetter,r=t.zoneNumber;if(r<0||r>60)return null;var s,a,o,l,h,c,u,d,p=6378137,f=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),m=n-5e5,g=e;i<"N"&&(g-=1e7),c=6*(r-1)-180+3,d=(u=g/.9996/6367449.145945056)+(3*f/2-27*f*f*f/32)*Math.sin(2*u)+(21*f*f/16-55*f*f*f*f/32)*Math.sin(4*u)+151*f*f*f/96*Math.sin(6*u),s=p/Math.sqrt(1-.00669438*Math.sin(d)*Math.sin(d)),a=Math.tan(d)*Math.tan(d),o=.006739496752268451*Math.cos(d)*Math.cos(d),l=.99330562*p/Math.pow(1-.00669438*Math.sin(d)*Math.sin(d),1.5),h=m/(.9996*s);var v=d-s*Math.tan(d)/l*(h*h/2-(5+3*a+10*o-4*o*o-.06065547077041606)*h*h*h*h/24+(61+90*a+298*o+45*a*a-1.6983531815716497-3*o*o)*h*h*h*h*h*h/720);v=Uh(v);var y,x=(h-(1+2*a+o)*h*h*h/6+(5-2*o+28*a-3*o*o+.05391597401814761+24*a*a)*h*h*h*h*h/120)/Math.cos(d);if(x=c+Uh(x),t.accuracy){var _=Hh({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});y={top:_.lat,right:_.lon,bottom:v,left:x}}else y={lat:v,lon:x};return y}function jh(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function Gh(t){var e=t%6;return 0===e&&(e=6),e}function Vh(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,n=t.length,i=null,r="",s=0;!/[A-Z]/.test(e=t.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+t;r+=e,s++}var a=parseInt(r,10);if(0===s||s+3>n)throw"MGRSPoint bad conversion from: "+t;var o=t.charAt(s++);if(o<="A"||"B"===o||"Y"===o||o>="Z"||"I"===o||"O"===o)throw"MGRSPoint zone letter "+o+" not handled: "+t;i=t.substring(s,s+=2);for(var l=Gh(a),h=function(t,e){var n="AJSAJS".charCodeAt(e-1),i=1e5,r=!1;for(;n!==t.charCodeAt(0);){if(++n===Dh&&n++,n===Nh&&n++,n>90){if(r)throw"Bad character: "+t;n=65,r=!0}i+=1e5}return i}(i.charAt(0),l),c=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var n="AFAFAF".charCodeAt(e-1),i=0,r=!1;for(;n!==t.charCodeAt(0);){if(++n===Dh&&n++,n===Nh&&n++,n>86){if(r)throw"Bad character: "+t;n=65,r=!0}i+=1e5}return i}(i.charAt(1),l);c0&&(d=1e5/Math.pow(10,m),p=t.substring(s,s+m),g=parseFloat(p)*d,f=t.substring(s+m),v=parseFloat(f)*d),{easting:g+h,northing:v+c,zoneLetter:o,zoneNumber:a,accuracy:d}}function Wh(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function qh(t,e,n){if(!(this instanceof qh))return new qh(t,e,n);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var i=t.split(",");this.x=parseFloat(i[0],10),this.y=parseFloat(i[1],10),this.z=parseFloat(i[2],10)||0}else this.x=t,this.y=e,this.z=n||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}qh.fromMGRS=function(t){return new qh(Fh(t))},qh.prototype.toMGRS=function(t){return kh([this.x,this.y],t)};var Xh=qh,Yh=.01068115234375,Zh=function(t){var e=[];e[0]=1-t*(.25+t*(.046875+t*(.01953125+t*Yh))),e[1]=t*(.75-t*(.046875+t*(.01953125+t*Yh)));var n=t*t;return e[2]=n*(.46875-t*(.013020833333333334+.007120768229166667*t)),n*=t,e[3]=n*(.3645833333333333-.005696614583333333*t),e[4]=n*t*.3076171875,e},Jh=function(t,e,n,i){return n*=e,e*=e,i[0]*t-n*(i[1]+e*(i[2]+e*(i[3]+e*i[4])))},Kh=function(t,e,n){for(var i=1/(1-e),r=t,s=20;s;--s){var a=Math.sin(r),o=1-e*a*a;if(r-=o=(Jh(r,a,Math.cos(r),n)-t)*(o*Math.sqrt(o))*i,Math.abs(o)<1e-10)return r}return r};var Qh={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=Zh(this.es),this.ml0=Jh(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var e,n,i,r=t.x,s=t.y,a=Kl(r-this.long0),o=Math.sin(s),l=Math.cos(s);if(this.es){var h=l*a,c=Math.pow(h,2),u=this.ep2*Math.pow(l,2),d=Math.pow(u,2),p=Math.abs(l)>1e-10?Math.tan(s):0,f=Math.pow(p,2),m=Math.pow(f,2);e=1-this.es*Math.pow(o,2),h/=Math.sqrt(e);var g=Jh(s,o,l,this.en);n=this.a*(this.k0*h*(1+c/6*(1-f+u+c/20*(5-18*f+m+14*u-58*f*u+c/42*(61+179*m-m*f-479*f)))))+this.x0,i=this.a*(this.k0*(g-this.ml0+o*a*h/2*(1+c/12*(5-f+9*u+4*d+c/30*(61+m-58*f+270*u-330*f*u+c/56*(1385+543*m-m*f-3111*f))))))+this.y0}else{var v=l*Math.sin(a);if(Math.abs(Math.abs(v)-1)<1e-10)return 93;if(n=.5*this.a*this.k0*Math.log((1+v)/(1-v))+this.x0,i=l*Math.cos(a)/Math.sqrt(1-Math.pow(v,2)),(v=Math.abs(i))>=1){if(v-1>1e-10)return 93;i=0}else i=Math.acos(i);s<0&&(i=-i),i=this.a*this.k0*(i-this.lat0)+this.y0}return t.x=n,t.y=i,t},inverse:function(t){var e,n,i,r,s=(t.x-this.x0)*(1/this.a),a=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+a/this.k0,n=Kh(e,this.es,this.en),Math.abs(n)1e-10?Math.tan(n):0,c=this.ep2*Math.pow(l,2),u=Math.pow(c,2),d=Math.pow(h,2),p=Math.pow(d,2);e=1-this.es*Math.pow(o,2);var f=s*Math.sqrt(e)/this.k0,m=Math.pow(f,2);i=n-(e*=h)*m/(1-this.es)*.5*(1-m/12*(5+3*d-9*c*d+c-4*u-m/30*(61+90*d-252*c*d+45*p+46*c-m/56*(1385+3633*d+4095*p+1574*p*d)))),r=Kl(this.long0+f*(1-m/6*(1+2*d+c-m/20*(5+28*d+24*p+8*c*d+6*c-m/42*(61+662*d+1320*p+720*p*d))))/l)}else i=bl*Jl(a),r=0;else{var g=Math.exp(s/this.k0),v=.5*(g-1/g),y=this.lat0+a/this.k0,x=Math.cos(y);e=Math.sqrt((1-Math.pow(x,2))/(1+Math.pow(v,2))),i=Math.asin(e),a<0&&(i=-i),r=0===v&&0===x?0:Kl(Math.atan2(v,x)+this.long0)}return t.x=r,t.y=i,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},$h=function(t){var e=Math.exp(t);return e=(e-1/e)/2},tc=function(t,e){t=Math.abs(t),e=Math.abs(e);var n=Math.max(t,e),i=Math.min(t,e)/(n||1);return n*Math.sqrt(1+Math.pow(i,2))},ec=function(t){var e=Math.abs(t);return e=function(t){var e=1+t,n=e-1;return 0===n?t:t*Math.log(e)/n}(e*(1+e/(tc(1,e)+1))),t<0?-e:e},nc=function(t,e){for(var n,i=2*Math.cos(2*e),r=t.length-1,s=t[r],a=0;--r>=0;)n=i*s-a+t[r],a=s,s=n;return e+n*Math.sin(2*e)},ic=function(t,e,n){for(var i,r,s=Math.sin(e),a=Math.cos(e),o=$h(n),l=function(t){var e=Math.exp(t);return e=(e+1/e)/2}(n),h=2*a*l,c=-2*s*o,u=t.length-1,d=t[u],p=0,f=0,m=0;--u>=0;)i=f,r=p,d=h*(f=d)-i-c*(p=m)+t[u],m=c*f-r+h*p;return[(h=s*l)*d-(c=a*o)*m,h*m+c*d]};var rc={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(Qh.init.apply(this),this.forward=Qh.forward,this.inverse=Qh.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),n=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),n*=e,this.cgb[1]=n*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=n*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),n*=e,this.cgb[2]=n*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=n*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),n*=e,this.cgb[3]=n*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=n*(1237/630+e*(e*(-24832/14175)-2.4)),n*=e,this.cgb[4]=n*(4174/315+e*(-144838/6237)),this.cbg[4]=n*(-734/315+e*(109598/31185)),n*=e,this.cgb[5]=n*(601676/22275),this.cbg[5]=n*(444337/155925),n=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=n*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=n*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),n*=e,this.utg[2]=n*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=n*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),n*=e,this.utg[3]=n*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=n*(49561/161280+e*(-179/168+e*(6601661/7257600))),n*=e,this.utg[4]=n*(-4583/161280+e*(108847/3991680)),this.gtu[4]=n*(34729/80640+e*(-3418889/1995840)),n*=e,this.utg[5]=n*(-20648693/638668800),this.gtu[5]=.6650675310896665*n;var i=nc(this.cbg,this.lat0);this.Zb=-this.Qn*(i+function(t,e){for(var n,i=2*Math.cos(e),r=t.length-1,s=t[r],a=0;--r>=0;)n=i*s-a+t[r],a=s,s=n;return Math.sin(e)*n}(this.gtu,2*i))},forward:function(t){var e=Kl(t.x-this.long0),n=t.y;n=nc(this.cbg,n);var i=Math.sin(n),r=Math.cos(n),s=Math.sin(e),a=Math.cos(e);n=Math.atan2(i,a*r),e=Math.atan2(s*r,tc(i,r*a)),e=ec(Math.tan(e));var o,l,h=ic(this.gtu,2*n,2*e);return n+=h[0],e+=h[1],Math.abs(e)<=2.623395162778?(o=this.a*(this.Qn*e)+this.x0,l=this.a*(this.Qn*n+this.Zb)+this.y0):(o=1/0,l=1/0),t.x=o,t.y=l,t},inverse:function(t){var e,n,i=(t.x-this.x0)*(1/this.a),r=(t.y-this.y0)*(1/this.a);if(r=(r-this.Zb)/this.Qn,i/=this.Qn,Math.abs(i)<=2.623395162778){var s=ic(this.utg,2*r,2*i);r+=s[0],i+=s[1],i=Math.atan($h(i));var a=Math.sin(r),o=Math.cos(r),l=Math.sin(i),h=Math.cos(i);r=Math.atan2(a*h,tc(l,h*o)),i=Math.atan2(l,h*o),e=Kl(i+this.long0),n=nc(this.cgb,r)}else e=1/0,n=1/0;return t.x=e,t.y=n,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]};var sc={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(Kl(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*Ml,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,rc.init.apply(this),this.forward=rc.forward,this.inverse=rc.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},ac=function(t,e){return Math.pow((1-t)/(1+t),e)};var oc={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Sl)/(Math.pow(Math.tan(.5*this.lat0+Sl),this.C)*ac(this.e*t,this.ratexp))},forward:function(t){var e=t.x,n=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+Sl),this.C)*ac(this.e*Math.sin(n),this.ratexp))-bl,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,n=t.y,i=Math.pow(Math.tan(.5*n+Sl)/this.K,1/this.C),r=20;r>0&&(n=2*Math.atan(i*ac(this.e*Math.sin(t.y),-.5*this.e))-bl,!(Math.abs(n-t.y)<1e-14));--r)t.y=n;return r?(t.x=e,t.y=n,t):null},names:["gauss"]};var lc={init:function(){oc.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,n,i,r;return t.x=Kl(t.x-this.long0),oc.forward.apply(this,[t]),e=Math.sin(t.y),n=Math.cos(t.y),i=Math.cos(t.x),r=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*n*i),t.x=r*n*Math.sin(t.x),t.y=r*(this.cosc0*e-this.sinc0*n*i),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,n,i,r,s;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,s=Math.sqrt(t.x*t.x+t.y*t.y)){var a=2*Math.atan2(s,this.R2);e=Math.sin(a),n=Math.cos(a),r=Math.asin(n*this.sinc0+t.y*e*this.cosc0/s),i=Math.atan2(t.x*e,s*this.cosc0*n-t.y*this.sinc0*e)}else r=this.phic0,i=0;return t.x=i,t.y=r,oc.inverse.apply(this,[t]),t.x=Kl(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var hc={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*(1+Jl(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=1e-10&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=1e-10&&(this.k0=.5*this.cons*Zl(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Ql(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Zl(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-bl,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,n,i,r,s,a,o=t.x,l=t.y,h=Math.sin(l),c=Math.cos(l),u=Kl(o-this.long0);return Math.abs(Math.abs(o-this.long0)-Math.PI)<=1e-10&&Math.abs(l+this.lat0)<=1e-10?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*h+this.coslat0*c*Math.cos(u)),t.x=this.a*e*c*Math.sin(u)+this.x0,t.y=this.a*e*(this.coslat0*h-this.sinlat0*c*Math.cos(u))+this.y0,t):(n=2*Math.atan(this.ssfn_(l,h,this.e))-bl,r=Math.cos(n),i=Math.sin(n),Math.abs(this.coslat0)<=1e-10?(s=Ql(this.e,l*this.con,this.con*h),a=2*this.a*this.k0*s/this.cons,t.x=this.x0+a*Math.sin(o-this.long0),t.y=this.y0-this.con*a*Math.cos(o-this.long0),t):(Math.abs(this.sinlat0)<1e-10?(e=2*this.a*this.k0/(1+r*Math.cos(u)),t.y=e*i):(e=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*i+this.cosX0*r*Math.cos(u))),t.y=e*(this.cosX0*i-this.sinX0*r*Math.cos(u))+this.y0),t.x=e*r*Math.sin(u)+this.x0,t))},inverse:function(t){var e,n,i,r,s;t.x-=this.x0,t.y-=this.y0;var a=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var o=2*Math.atan(a/(2*this.a*this.k0));return e=this.long0,n=this.lat0,a<=1e-10?(t.x=e,t.y=n,t):(n=Math.asin(Math.cos(o)*this.sinlat0+t.y*Math.sin(o)*this.coslat0/a),e=Math.abs(this.coslat0)<1e-10?this.lat0>0?Kl(this.long0+Math.atan2(t.x,-1*t.y)):Kl(this.long0+Math.atan2(t.x,t.y)):Kl(this.long0+Math.atan2(t.x*Math.sin(o),a*this.coslat0*Math.cos(o)-t.y*this.sinlat0*Math.sin(o))),t.x=e,t.y=n,t)}if(Math.abs(this.coslat0)<=1e-10){if(a<=1e-10)return n=this.lat0,e=this.long0,t.x=e,t.y=n,t;t.x*=this.con,t.y*=this.con,i=a*this.cons/(2*this.a*this.k0),n=this.con*$l(this.e,i),e=this.con*Kl(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else r=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,a<=1e-10?s=this.X0:(s=Math.asin(Math.cos(r)*this.sinX0+t.y*Math.sin(r)*this.cosX0/a),e=Kl(this.long0+Math.atan2(t.x*Math.sin(r),a*this.cosX0*Math.cos(r)-t.y*this.sinX0*Math.sin(r)))),n=-1*$l(this.e,Math.tan(.5*(bl+s)));return t.x=e,t.y=n,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,e,n){return e*=n,Math.tan(.5*(bl+t))*Math.pow((1-e)/(1+e),.5*n)}};var cc={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),n=this.a,i=1/this.rf,r=2*i-Math.pow(i,2),s=this.e=Math.sqrt(r);this.R=this.k0*n*Math.sqrt(1-r)/(1-r*Math.pow(e,2)),this.alpha=Math.sqrt(1+r/(1-r)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),o=Math.log(Math.tan(Math.PI/4+t/2)),l=Math.log((1+s*e)/(1-s*e));this.K=a-this.alpha*o+this.alpha*s/2*l},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),i=-this.alpha*(e+n)+this.K,r=2*(Math.atan(Math.exp(i))-Math.PI/4),s=this.alpha*(t.x-this.lambda0),a=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(r)+Math.cos(this.b0)*Math.cos(s))),o=Math.asin(Math.cos(this.b0)*Math.sin(r)-Math.sin(this.b0)*Math.cos(r)*Math.cos(s));return t.y=this.R/2*Math.log((1+Math.sin(o))/(1-Math.sin(o)))+this.y0,t.x=this.R*a+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,n=t.y-this.y0,i=e/this.R,r=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(i)),a=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(r))),o=this.lambda0+a/this.alpha,l=0,h=s,c=-1e3,u=0;Math.abs(h-c)>1e-7;){if(++u>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(h))/2)),c=h,h=2*Math.atan(Math.exp(l))-Math.PI/2}return t.x=o,t.y=h,t},names:["somerc"]};var uc={init:function(){this.no_off=this.no_off||!1,this.no_rot=this.no_rot||!1,isNaN(this.k0)&&(this.k0=1);var t=Math.sin(this.lat0),e=Math.cos(this.lat0),n=this.e*t;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(e,4)),this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-n*n);var i,r,s=Ql(this.e,this.lat0,t),a=this.bl/e*Math.sqrt((1-this.es)/(1-n*n));if(a*a<1&&(a=1),isNaN(this.longc)){var o=Ql(this.e,this.lat1,Math.sin(this.lat1)),l=Ql(this.e,this.lat2,Math.sin(this.lat2));this.lat0>=0?this.el=(a+Math.sqrt(a*a-1))*Math.pow(s,this.bl):this.el=(a-Math.sqrt(a*a-1))*Math.pow(s,this.bl);var h=Math.pow(o,this.bl),c=Math.pow(l,this.bl);r=.5*((i=this.el/h)-1/i);var u=(this.el*this.el-c*h)/(this.el*this.el+c*h),d=(c-h)/(c+h),p=Kl(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(u*Math.tan(.5*this.bl*p)/d)/this.bl,this.long0=Kl(this.long0);var f=Kl(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*f)/r),this.alpha=Math.asin(a*Math.sin(this.gamma0))}else i=this.lat0>=0?a+Math.sqrt(a*a-1):a-Math.sqrt(a*a-1),this.el=i*Math.pow(s,this.bl),r=.5*(i-1/i),this.gamma0=Math.asin(Math.sin(this.alpha)/a),this.long0=this.longc-Math.asin(r*Math.tan(this.gamma0))/this.bl;this.no_off?this.uc=0:this.lat0>=0?this.uc=this.al/this.bl*Math.atan2(Math.sqrt(a*a-1),Math.cos(this.alpha)):this.uc=-1*this.al/this.bl*Math.atan2(Math.sqrt(a*a-1),Math.cos(this.alpha))},forward:function(t){var e,n,i,r=t.x,s=t.y,a=Kl(r-this.long0);if(Math.abs(Math.abs(s)-bl)<=1e-10)i=s>0?-1:1,n=this.al/this.bl*Math.log(Math.tan(Sl+i*this.gamma0*.5)),e=-1*i*bl*this.al/this.bl;else{var o=Ql(this.e,s,Math.sin(s)),l=this.el/Math.pow(o,this.bl),h=.5*(l-1/l),c=.5*(l+1/l),u=Math.sin(this.bl*a),d=(h*Math.sin(this.gamma0)-u*Math.cos(this.gamma0))/c;n=Math.abs(Math.abs(d)-1)<=1e-10?Number.POSITIVE_INFINITY:.5*this.al*Math.log((1-d)/(1+d))/this.bl,e=Math.abs(Math.cos(this.bl*a))<=1e-10?this.al*this.bl*a:this.al*Math.atan2(h*Math.cos(this.gamma0)+u*Math.sin(this.gamma0),Math.cos(this.bl*a))/this.bl}return this.no_rot?(t.x=this.x0+e,t.y=this.y0+n):(e-=this.uc,t.x=this.x0+n*Math.cos(this.alpha)+e*Math.sin(this.alpha),t.y=this.y0+e*Math.cos(this.alpha)-n*Math.sin(this.alpha)),t},inverse:function(t){var e,n;this.no_rot?(n=t.y-this.y0,e=t.x-this.x0):(n=(t.x-this.x0)*Math.cos(this.alpha)-(t.y-this.y0)*Math.sin(this.alpha),e=(t.y-this.y0)*Math.cos(this.alpha)+(t.x-this.x0)*Math.sin(this.alpha),e+=this.uc);var i=Math.exp(-1*this.bl*n/this.al),r=.5*(i-1/i),s=.5*(i+1/i),a=Math.sin(this.bl*e/this.al),o=(a*Math.cos(this.gamma0)+r*Math.sin(this.gamma0))/s,l=Math.pow(this.el/Math.sqrt((1+o)/(1-o)),1/this.bl);return Math.abs(o-1)<1e-10?(t.x=this.long0,t.y=bl):Math.abs(o+1)<1e-10?(t.x=this.long0,t.y=-1*bl):(t.y=$l(this.e,l),t.x=Kl(this.long0-Math.atan2(r*Math.cos(this.gamma0)-a*Math.sin(this.gamma0),Math.cos(this.bl*e/this.al))/this.bl)),t},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","omerc"]};var dc={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<1e-10)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),n=Math.cos(this.lat1),i=Zl(this.e,e,n),r=Ql(this.e,this.lat1,e),s=Math.sin(this.lat2),a=Math.cos(this.lat2),o=Zl(this.e,s,a),l=Ql(this.e,this.lat2,s),h=Ql(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>1e-10?this.ns=Math.log(i/o)/Math.log(r/l):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=i/(this.ns*Math.pow(r,this.ns)),this.rh=this.a*this.f0*Math.pow(h,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,n=t.y;Math.abs(2*Math.abs(n)-Math.PI)<=1e-10&&(n=Jl(n)*(bl-2e-10));var i,r,s=Math.abs(Math.abs(n)-bl);if(s>1e-10)i=Ql(this.e,n,Math.sin(n)),r=this.a*this.f0*Math.pow(i,this.ns);else{if((s=n*this.ns)<=0)return null;r=0}var a=this.ns*Kl(e-this.long0);return t.x=this.k0*(r*Math.sin(a))+this.x0,t.y=this.k0*(this.rh-r*Math.cos(a))+this.y0,t},inverse:function(t){var e,n,i,r,s,a=(t.x-this.x0)/this.k0,o=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(a*a+o*o),n=1):(e=-Math.sqrt(a*a+o*o),n=-1);var l=0;if(0!==e&&(l=Math.atan2(n*a,n*o)),0!==e||this.ns>0){if(n=1/this.ns,i=Math.pow(e/(this.a*this.f0),n),-9999===(r=$l(this.e,i)))return null}else r=-bl;return s=Kl(l/this.ns+this.long0),t.x=s,t.y=r,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"]};var pc={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,n,i,r,s,a,o,l=t.x,h=t.y,c=Kl(l-this.long0);return e=Math.pow((1+this.e*Math.sin(h))/(1-this.e*Math.sin(h)),this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.pow(Math.tan(h/2+this.s45),this.alfa)/e)-this.s45),i=-c*this.alfa,r=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(i)),s=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(r)),a=this.n*s,o=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(r/2+this.s45),this.n),t.y=o*Math.cos(a)/1,t.x=o*Math.sin(a)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,n,i,r,s,a,o,l=t.x;t.x=t.y,t.y=l,this.czech||(t.y*=-1,t.x*=-1),s=Math.sqrt(t.x*t.x+t.y*t.y),r=Math.atan2(t.y,t.x)/Math.sin(this.s0),i=2*(Math.atan(Math.pow(this.ro0/s,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(i)-Math.sin(this.ad)*Math.cos(i)*Math.cos(r)),n=Math.asin(Math.cos(i)*Math.sin(r)/Math.cos(e)),t.x=this.long0-n/this.alfa,a=e,o=0;var h=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-t.y)<1e-10&&(o=1),a=t.y,h+=1}while(0===o&&h<15);return h>=15?null:t},names:["Krovak","krovak"]},fc=function(t,e,n,i,r){return t*r-e*Math.sin(2*r)+n*Math.sin(4*r)-i*Math.sin(6*r)},mc=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))},gc=function(t){return.375*t*(1+.25*t*(1+.46875*t))},vc=function(t){return.05859375*t*t*(1+.75*t)},yc=function(t){return t*t*t*(35/3072)},xc=function(t,e,n){var i=e*n;return t/Math.sqrt(1-i*i)},_c=function(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(n=t*e)*n)-.5/t*Math.log((1-n)/(1+n))):2*e};var Sc={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-bl)<1e-10?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<1e-10?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=wc(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,n=[];return n[0]=.3333333333333333*t,e=t*t,n[0]+=.17222222222222222*e,n[1]=.06388888888888888*e,e*=t,n[0]+=.10257936507936508*e,n[1]+=.0664021164021164*e,n[2]=.016415012942191543*e,n}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=wc(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,n,i,r,s,a,o,l,h,c,u=t.x,d=t.y;if(u=Kl(u-this.long0),this.sphere){if(s=Math.sin(d),c=Math.cos(d),i=Math.cos(u),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((n=this.mode===this.EQUIT?1+c*i:1+this.sinph0*s+this.cosph0*c*i)<=1e-10)return null;e=(n=Math.sqrt(2/n))*c*Math.sin(u),n*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*c*i}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),Math.abs(d+this.lat0)<1e-10)return null;n=Sl-.5*d,e=(n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)))*Math.sin(u),n*=i}}else{switch(o=0,l=0,h=0,i=Math.cos(u),r=Math.sin(u),s=Math.sin(d),a=wc(this.e,s),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(o=a/this.qp,l=Math.sqrt(1-o*o)),this.mode){case this.OBLIQ:h=1+this.sinb1*o+this.cosb1*l*i;break;case this.EQUIT:h=1+l*i;break;case this.N_POLE:h=bl+d,a=this.qp-a;break;case this.S_POLE:h=d-bl,a=this.qp+a}if(Math.abs(h)<1e-10)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:h=Math.sqrt(2/h),n=this.mode===this.OBLIQ?this.ymf*h*(this.cosb1*o-this.sinb1*l*i):(h=Math.sqrt(2/(1+l*i)))*o*this.ymf,e=this.xmf*h*l*r;break;case this.N_POLE:case this.S_POLE:a>=0?(e=(h=Math.sqrt(a))*r,n=i*(this.mode===this.S_POLE?h:-h)):e=n=0}}return t.x=this.a*e+this.x0,t.y=this.a*n+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,n,i,r,s,a,o,l,h,c,u=t.x/this.a,d=t.y/this.a;if(this.sphere){var p,f=0,m=0;if((n=.5*(p=Math.sqrt(u*u+d*d)))>1)return null;switch(n=2*Math.asin(n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(m=Math.sin(n),f=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(p)<=1e-10?0:Math.asin(d*m/p),u*=m,d=f*p;break;case this.OBLIQ:n=Math.abs(p)<=1e-10?this.lat0:Math.asin(f*this.sinph0+d*m*this.cosph0/p),u*=m*this.cosph0,d=(f-Math.sin(n)*this.sinph0)*p;break;case this.N_POLE:d=-d,n=bl-n;break;case this.S_POLE:n-=bl}e=0!==d||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(u,d):0}else{if(o=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(u/=this.dd,d*=this.dd,(a=Math.sqrt(u*u+d*d))<1e-10)return t.x=this.long0,t.y=this.lat0,t;r=2*Math.asin(.5*a/this.rq),i=Math.cos(r),u*=r=Math.sin(r),this.mode===this.OBLIQ?(o=i*this.sinb1+d*r*this.cosb1/a,s=this.qp*o,d=a*this.cosb1*i-d*this.sinb1*r):(o=d*r/a,s=this.qp*o,d=a*i)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(d=-d),!(s=u*u+d*d))return t.x=this.long0,t.y=this.lat0,t;o=1-s/this.qp,this.mode===this.S_POLE&&(o=-o)}e=Math.atan2(u,d),l=Math.asin(o),h=this.apa,c=l+l,n=l+h[0]*Math.sin(c)+h[1]*Math.sin(c+c)+h[2]*Math.sin(c+c+c)}return t.x=Kl(this.long0+e),t.y=n,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},Ec=function(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)};var Tc={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=Zl(this.e3,this.sin_po,this.cos_po),this.qs1=wc(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=Zl(this.e3,this.sin_po,this.cos_po),this.qs2=wc(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=wc(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>1e-10?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,n=t.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var i=wc(this.e3,this.sin_phi,this.cos_phi),r=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,s=this.ns0*Kl(e-this.long0),a=r*Math.sin(s)+this.x0,o=this.rh-r*Math.cos(s)+this.y0;return t.x=a,t.y=o,t},inverse:function(t){var e,n,i,r,s,a;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1),r=0,0!==e&&(r=Math.atan2(i*t.x,i*t.y)),i=e*this.ns0/this.a,this.sphere?a=Math.asin((this.c-i*i)/(2*this.ns0)):(n=(this.c-i*i)/this.ns0,a=this.phi1z(this.e3,n)),s=Kl(r/this.ns0+this.long0),t.x=s,t.y=a,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var n,i,r,s,a=Ec(.5*e);if(t<1e-10)return a;for(var o=t*t,l=1;l<=25;l++)if(a+=s=.5*(r=1-(i=t*(n=Math.sin(a)))*i)*r/Math.cos(a)*(e/(1-o)-n/r+.5/t*Math.log((1-i)/(1+i))),Math.abs(s)<=1e-7)return a;return null}};var Lc={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var e,n,i,r,s,a,o,l=t.x,h=t.y;return i=Kl(l-this.long0),e=Math.sin(h),n=Math.cos(h),r=Math.cos(i),1,(s=this.sin_p14*e+this.cos_p14*n*r)>0||Math.abs(s)<=1e-10?(a=this.x0+1*this.a*n*Math.sin(i)/s,o=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*r)/s):(a=this.x0+this.infinity_dist*n*Math.sin(i),o=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*n*r)),t.x=a,t.y=o,t},inverse:function(t){var e,n,i,r,s,a;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(r=Math.atan2(e,this.rc),n=Math.sin(r),i=Math.cos(r),a=Ec(i*this.sin_p14+t.y*n*this.cos_p14/e),s=Math.atan2(t.x*n,e*this.cos_p14*i-t.y*this.sin_p14*n),s=Kl(this.long0+s)):(a=this.phic0,s=0),t.x=s,t.y=a,t},names:["gnom"]};var Ac={init:function(){this.sphere||(this.k0=Zl(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,n,i=t.x,r=t.y,s=Kl(i-this.long0);if(this.sphere)e=this.x0+this.a*s*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(r)/Math.cos(this.lat_ts);else{var a=wc(this.e,Math.sin(r));e=this.x0+this.a*this.k0*s,n=this.y0+this.a*a*.5/this.k0}return t.x=e,t.y=n,t},inverse:function(t){var e,n;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=Kl(this.long0+t.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(n=function(t,e){var n=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-n)<1e-6)return e<0?-1*bl:bl;for(var i,r,s,a,o=Math.asin(.5*e),l=0;l<30;l++)if(r=Math.sin(o),s=Math.cos(o),a=t*r,o+=i=Math.pow(1-a*a,2)/(2*s)*(e/(1-t*t)-r/(1-a*a)+.5/t*Math.log((1-a)/(1+a))),Math.abs(i)<=1e-10)return o;return NaN}(this.e,2*t.y*this.k0/this.a),e=Kl(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=n,t},names:["cea"]};var Cc={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,n=t.y,i=Kl(e-this.long0),r=_c(n-this.lat0);return t.x=this.x0+this.a*i*this.rc,t.y=this.y0+this.a*r,t},inverse:function(t){var e=t.x,n=t.y;return t.x=Kl(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=_c(this.lat0+(n-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]};var Pc={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=mc(this.es),this.e1=gc(this.es),this.e2=vc(this.es),this.e3=yc(this.es),this.ml0=this.a*fc(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,n,i,r=t.x,s=t.y,a=Kl(r-this.long0);if(i=a*Math.sin(s),this.sphere)Math.abs(s)<=1e-10?(e=this.a*a,n=-1*this.a*this.lat0):(e=this.a*Math.sin(i)/Math.tan(s),n=this.a*(_c(s-this.lat0)+(1-Math.cos(i))/Math.tan(s)));else if(Math.abs(s)<=1e-10)e=this.a*a,n=-1*this.ml0;else{var o=xc(this.a,this.e,Math.sin(s))/Math.tan(s);e=o*Math.sin(i),n=this.a*fc(this.e0,this.e1,this.e2,this.e3,s)-this.ml0+o*(1-Math.cos(i))}return t.x=e+this.x0,t.y=n+this.y0,t},inverse:function(t){var e,n,i,r,s,a,o,l,h;if(i=t.x-this.x0,r=t.y-this.y0,this.sphere)if(Math.abs(r+this.a*this.lat0)<=1e-10)e=Kl(i/this.a+this.long0),n=0;else{var c;for(a=this.lat0+r/this.a,o=i*i/this.a/this.a+a*a,l=a,s=20;s;--s)if(l+=h=-1*(a*(l*(c=Math.tan(l))+1)-l-.5*(l*l+o)*c)/((l-a)/c-1),Math.abs(h)<=1e-10){n=l;break}e=Kl(this.long0+Math.asin(i*Math.tan(l)/this.a)/Math.sin(n))}else if(Math.abs(r+this.ml0)<=1e-10)n=0,e=Kl(this.long0+i/this.a);else{var u,d,p,f,m;for(a=(this.ml0+r)/this.a,o=i*i/this.a/this.a+a*a,l=a,s=20;s;--s)if(m=this.e*Math.sin(l),u=Math.sqrt(1-m*m)*Math.tan(l),d=this.a*fc(this.e0,this.e1,this.e2,this.e3,l),p=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=h=(a*(u*(f=d/this.a)+1)-f-.5*u*(f*f+o))/(this.es*Math.sin(2*l)*(f*f+o-2*a*f)/(4*u)+(a-f)*(u*p-2/Math.sin(2*l))-p),Math.abs(h)<=1e-10){n=l;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(n),2))*Math.tan(n),e=Kl(this.long0+Math.asin(i*u/this.a)/Math.sin(n))}return t.x=e,t.y=n,t},names:["Polyconic","poly"]};var Rc={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,n=t.x,i=t.y-this.lat0,r=n-this.long0,s=i/_l*1e-5,a=r,o=1,l=0;for(e=1;e<=10;e++)o*=s,l+=this.A[e]*o;var h,c=l,u=a,d=1,p=0,f=0,m=0;for(e=1;e<=6;e++)h=p*c+d*u,d=d*c-p*u,p=h,f=f+this.B_re[e]*d-this.B_im[e]*p,m=m+this.B_im[e]*d+this.B_re[e]*p;return t.x=m*this.a+this.x0,t.y=f*this.a+this.y0,t},inverse:function(t){var e,n,i=t.x,r=t.y,s=i-this.x0,a=(r-this.y0)/this.a,o=s/this.a,l=1,h=0,c=0,u=0;for(e=1;e<=6;e++)n=h*a+l*o,l=l*a-h*o,h=n,c=c+this.C_re[e]*l-this.C_im[e]*h,u=u+this.C_im[e]*l+this.C_re[e]*h;for(var d=0;d.999999999999&&(n=.999999999999),e=Math.asin(n);var i=Kl(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));i<-Math.PI&&(i=-Math.PI),i>Math.PI&&(i=Math.PI),n=(2*e+Math.sin(2*e))/Math.PI,Math.abs(n)>1&&(n=1);var r=Math.asin(n);return t.x=i,t.y=r,t},names:["Mollweide","moll"]};var Nc={init:function(){Math.abs(this.lat1+this.lat2)<1e-10||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=mc(this.es),this.e1=gc(this.es),this.e2=vc(this.es),this.e3=yc(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=Zl(this.e,this.sinphi,this.cosphi),this.ml1=fc(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<1e-10?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=Zl(this.e,this.sinphi,this.cosphi),this.ml2=fc(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=fc(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var e,n=t.x,i=t.y;if(this.sphere)e=this.a*(this.g-i);else{var r=fc(this.e0,this.e1,this.e2,this.e3,i);e=this.a*(this.g-r)}var s=this.ns*Kl(n-this.long0),a=this.x0+e*Math.sin(s),o=this.y0+this.rh-e*Math.cos(s);return t.x=a,t.y=o,t},inverse:function(t){var e,n,i,r;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(n=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(n=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var s=0;if(0!==n&&(s=Math.atan2(e*t.x,e*t.y)),this.sphere)return r=Kl(this.long0+s/this.ns),i=_c(this.g-n/this.a),t.x=r,t.y=i,t;var a=this.g-n/this.a;return i=bc(a,this.e0,this.e1,this.e2,this.e3),r=Kl(this.long0+s/this.ns),t.x=r,t.y=i,t},names:["Equidistant_Conic","eqdc"]};var zc={init:function(){this.R=this.a},forward:function(t){var e,n,i=t.x,r=t.y,s=Kl(i-this.long0);Math.abs(r)<=1e-10&&(e=this.x0+this.R*s,n=this.y0);var a=Ec(2*Math.abs(r/Math.PI));(Math.abs(s)<=1e-10||Math.abs(Math.abs(r)-bl)<=1e-10)&&(e=this.x0,n=r>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var o=.5*Math.abs(Math.PI/s-s/Math.PI),l=o*o,h=Math.sin(a),c=Math.cos(a),u=c/(h+c-1),d=u*u,p=u*(2/h-1),f=p*p,m=Math.PI*this.R*(o*(u-f)+Math.sqrt(l*(u-f)*(u-f)-(f+l)*(d-f)))/(f+l);s<0&&(m=-m),e=this.x0+m;var g=l+u;return m=Math.PI*this.R*(p*g-o*Math.sqrt((f+l)*(l+1)-g*g))/(f+l),n=r>=0?this.y0+m:this.y0-m,t.x=e,t.y=n,t},inverse:function(t){var e,n,i,r,s,a,o,l,h,c,u,d;return t.x-=this.x0,t.y-=this.y0,u=Math.PI*this.R,s=(i=t.x/u)*i+(r=t.y/u)*r,u=3*(r*r/(l=-2*(a=-Math.abs(r)*(1+s))+1+2*r*r+s*s)+(2*(o=a-2*r*r+i*i)*o*o/l/l/l-9*a*o/l/l)/27)/(h=(a-o*o/3/l)/l)/(c=2*Math.sqrt(-h/3)),Math.abs(u)>1&&(u=u>=0?1:-1),d=Math.acos(u)/3,n=t.y>=0?(-c*Math.cos(d+Math.PI/3)-o/3/l)*Math.PI:-(-c*Math.cos(d+Math.PI/3)-o/3/l)*Math.PI,e=Math.abs(i)<1e-10?this.long0:Kl(this.long0+Math.PI*(s-1+Math.sqrt(1+2*(i*i-r*r)+s*s))/2/i),t.x=e,t.y=n,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};var kc={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var e,n,i,r,s,a,o,l,h,c,u,d,p,f,m,g,v,y,x,_,b,M,w=t.x,S=t.y,E=Math.sin(t.y),T=Math.cos(t.y),L=Kl(w-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=1e-10?(t.x=this.x0+this.a*(bl-S)*Math.sin(L),t.y=this.y0-this.a*(bl-S)*Math.cos(L),t):Math.abs(this.sin_p12+1)<=1e-10?(t.x=this.x0+this.a*(bl+S)*Math.sin(L),t.y=this.y0+this.a*(bl+S)*Math.cos(L),t):(y=this.sin_p12*E+this.cos_p12*T*Math.cos(L),v=(g=Math.acos(y))?g/Math.sin(g):1,t.x=this.x0+this.a*v*T*Math.sin(L),t.y=this.y0+this.a*v*(this.cos_p12*E-this.sin_p12*T*Math.cos(L)),t):(e=mc(this.es),n=gc(this.es),i=vc(this.es),r=yc(this.es),Math.abs(this.sin_p12-1)<=1e-10?(s=this.a*fc(e,n,i,r,bl),a=this.a*fc(e,n,i,r,S),t.x=this.x0+(s-a)*Math.sin(L),t.y=this.y0-(s-a)*Math.cos(L),t):Math.abs(this.sin_p12+1)<=1e-10?(s=this.a*fc(e,n,i,r,bl),a=this.a*fc(e,n,i,r,S),t.x=this.x0+(s+a)*Math.sin(L),t.y=this.y0+(s+a)*Math.cos(L),t):(o=E/T,l=xc(this.a,this.e,this.sin_p12),h=xc(this.a,this.e,E),c=Math.atan((1-this.es)*o+this.es*l*this.sin_p12/(h*T)),x=0===(u=Math.atan2(Math.sin(L),this.cos_p12*Math.tan(c)-this.sin_p12*Math.cos(L)))?Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.abs(Math.abs(u)-Math.PI)<=1e-10?-Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.asin(Math.sin(L)*Math.cos(c)/Math.sin(u)),d=this.e*this.sin_p12/Math.sqrt(1-this.es),g=l*x*(1-(_=x*x)*(m=(p=this.e*this.cos_p12*Math.cos(u)/Math.sqrt(1-this.es))*p)*(1-m)/6+(b=_*x)/8*(f=d*p)*(1-2*m)+(M=b*x)/120*(m*(4-7*m)-3*d*d*(1-7*m))-M*x/48*f),t.x=this.x0+g*Math.sin(u),t.y=this.y0+g*Math.cos(u),t))},inverse:function(t){var e,n,i,r,s,a,o,l,h,c,u,d,p,f,m,g,v,y,x,_,b,M,w;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((e=Math.sqrt(t.x*t.x+t.y*t.y))>2*bl*this.a)return;return n=e/this.a,i=Math.sin(n),r=Math.cos(n),s=this.long0,Math.abs(e)<=1e-10?a=this.lat0:(a=Ec(r*this.sin_p12+t.y*i*this.cos_p12/e),o=Math.abs(this.lat0)-bl,s=Math.abs(o)<=1e-10?this.lat0>=0?Kl(this.long0+Math.atan2(t.x,-t.y)):Kl(this.long0-Math.atan2(-t.x,t.y)):Kl(this.long0+Math.atan2(t.x*i,e*this.cos_p12*r-t.y*this.sin_p12*i))),t.x=s,t.y=a,t}return l=mc(this.es),h=gc(this.es),c=vc(this.es),u=yc(this.es),Math.abs(this.sin_p12-1)<=1e-10?(d=this.a*fc(l,h,c,u,bl),e=Math.sqrt(t.x*t.x+t.y*t.y),a=bc((d-e)/this.a,l,h,c,u),s=Kl(this.long0+Math.atan2(t.x,-1*t.y)),t.x=s,t.y=a,t):Math.abs(this.sin_p12+1)<=1e-10?(d=this.a*fc(l,h,c,u,bl),e=Math.sqrt(t.x*t.x+t.y*t.y),a=bc((e-d)/this.a,l,h,c,u),s=Kl(this.long0+Math.atan2(t.x,t.y)),t.x=s,t.y=a,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),m=Math.atan2(t.x,t.y),p=xc(this.a,this.e,this.sin_p12),g=Math.cos(m),y=-(v=this.e*this.cos_p12*g)*v/(1-this.es),x=3*this.es*(1-y)*this.sin_p12*this.cos_p12*g/(1-this.es),M=1-y*(b=(_=e/p)-y*(1+y)*Math.pow(_,3)/6-x*(1+3*y)*Math.pow(_,4)/24)*b/2-_*b*b*b/6,f=Math.asin(this.sin_p12*Math.cos(b)+this.cos_p12*Math.sin(b)*g),s=Kl(this.long0+Math.asin(Math.sin(m)*Math.sin(b)/Math.cos(f))),w=Math.sin(f),a=Math.atan2((w-this.es*M*this.sin_p12)*Math.tan(f),w*(1-this.es)),t.x=s,t.y=a,t)},names:["Azimuthal_Equidistant","aeqd"]};var Fc={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,n,i,r,s,a,o,l=t.x,h=t.y;return i=Kl(l-this.long0),e=Math.sin(h),n=Math.cos(h),r=Math.cos(i),1,((s=this.sin_p14*e+this.cos_p14*n*r)>0||Math.abs(s)<=1e-10)&&(a=1*this.a*n*Math.sin(i),o=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*n*r)),t.x=a,t.y=o,t},inverse:function(t){var e,n,i,r,s,a,o;return t.x-=this.x0,t.y-=this.y0,e=Math.sqrt(t.x*t.x+t.y*t.y),n=Ec(e/this.a),i=Math.sin(n),r=Math.cos(n),a=this.long0,Math.abs(e)<=1e-10?(o=this.lat0,t.x=a,t.y=o,t):(o=Ec(r*this.sin_p14+t.y*i*this.cos_p14/e),s=Math.abs(this.lat0)-bl,Math.abs(s)<=1e-10?(a=this.lat0>=0?Kl(this.long0+Math.atan2(t.x,-t.y)):Kl(this.long0-Math.atan2(-t.x,t.y)),t.x=a,t.y=o,t):(a=Kl(this.long0+Math.atan2(t.x*i,e*this.cos_p14*r-t.y*this.sin_p14*i)),t.x=a,t.y=o,t))},names:["ortho"]},Bc=1,Uc=2,Hc=3,jc=4,Gc=5,Vc=6,Wc=1,qc=2,Xc=3,Yc=4;function Zc(t,e,n,i){var r;return t<1e-10?(i.value=Wc,r=0):(r=Math.atan2(e,n),Math.abs(r)<=Sl?i.value=Wc:r>Sl&&r<=bl+Sl?(i.value=qc,r-=bl):r>bl+Sl||r<=-(bl+Sl)?(i.value=Xc,r=r>=0?r-Tl:r+Tl):(i.value=Yc,r+=bl)),r}function Jc(t,e){var n=t+e;return n<-Tl?n+=El:n>+Tl&&(n-=El),n}var Kc={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=bl-Sl/2?this.face=Gc:this.lat0<=-(bl-Sl/2)?this.face=Vc:Math.abs(this.long0)<=Sl?this.face=Bc:Math.abs(this.long0)<=bl+Sl?this.face=this.long0>0?Uc:jc:this.face=Hc,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,n,i,r,s,a,o={x:0,y:0},l={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,n=t.x,this.face===Gc)r=bl-e,n>=Sl&&n<=bl+Sl?(l.value=Wc,i=n-bl):n>bl+Sl||n<=-(bl+Sl)?(l.value=qc,i=n>0?n-Tl:n+Tl):n>-(bl+Sl)&&n<=-Sl?(l.value=Xc,i=n+bl):(l.value=Yc,i=n);else if(this.face===Vc)r=bl+e,n>=Sl&&n<=bl+Sl?(l.value=Wc,i=-n+bl):n=-Sl?(l.value=qc,i=-n):n<-Sl&&n>=-(bl+Sl)?(l.value=Xc,i=-n-bl):(l.value=Yc,i=n>0?-n+Tl:-n-Tl);else{var h,c,u,d,p,f;this.face===Uc?n=Jc(n,+bl):this.face===Hc?n=Jc(n,+Tl):this.face===jc&&(n=Jc(n,-bl)),d=Math.sin(e),p=Math.cos(e),f=Math.sin(n),h=p*Math.cos(n),c=p*f,u=d,this.face===Bc?i=Zc(r=Math.acos(h),u,c,l):this.face===Uc?i=Zc(r=Math.acos(c),u,-h,l):this.face===Hc?i=Zc(r=Math.acos(-h),u,-c,l):this.face===jc?i=Zc(r=Math.acos(-c),u,h,l):(r=i=0,l.value=Wc)}return a=Math.atan(12/Tl*(i+Math.acos(Math.sin(i)*Math.cos(Sl))-bl)),s=Math.sqrt((1-Math.cos(r))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(i))))),l.value===qc?a+=bl:l.value===Xc?a+=Tl:l.value===Yc&&(a+=1.5*Tl),o.x=s*Math.cos(a),o.y=s*Math.sin(a),o.x=o.x*this.a+this.x0,o.y=o.y*this.a+this.y0,t.x=o.x,t.y=o.y,t},inverse:function(t){var e,n,i,r,s,a,o,l,h,c,u,d,p={lam:0,phi:0},f={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,n=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?f.value=Wc:t.y>=0&&t.y>=Math.abs(t.x)?(f.value=qc,e-=bl):t.x<0&&-t.x>=Math.abs(t.y)?(f.value=Xc,e=e<0?e+Tl:e-Tl):(f.value=Yc,e+=bl),h=Tl/12*Math.tan(e),s=Math.sin(h)/(Math.cos(h)-1/Math.sqrt(2)),a=Math.atan(s),(o=1-(i=Math.cos(e))*i*(r=Math.tan(n))*r*(1-Math.cos(Math.atan(1/Math.cos(a)))))<-1?o=-1:o>1&&(o=1),this.face===Gc)l=Math.acos(o),p.phi=bl-l,f.value===Wc?p.lam=a+bl:f.value===qc?p.lam=a<0?a+Tl:a-Tl:f.value===Xc?p.lam=a-bl:p.lam=a;else if(this.face===Vc)l=Math.acos(o),p.phi=l-bl,f.value===Wc?p.lam=-a+bl:f.value===qc?p.lam=-a:f.value===Xc?p.lam=-a-bl:p.lam=a<0?-a-Tl:-a+Tl;else{var m,g,v;h=(m=o)*m,g=(h+=(v=h>=1?0:Math.sqrt(1-h)*Math.sin(a))*v)>=1?0:Math.sqrt(1-h),f.value===qc?(h=g,g=-v,v=h):f.value===Xc?(g=-g,v=-v):f.value===Yc&&(h=g,g=v,v=-h),this.face===Uc?(h=m,m=-g,g=h):this.face===Hc?(m=-m,g=-g):this.face===jc&&(h=m,m=g,g=-h),p.phi=Math.acos(-v)-bl,p.lam=Math.atan2(g,m),this.face===Uc?p.lam=Jc(p.lam,-bl):this.face===Hc?p.lam=Jc(p.lam,-Tl):this.face===jc&&(p.lam=Jc(p.lam,+bl))}return 0!==this.es&&(c=p.phi<0?1:0,u=Math.tan(p.phi),d=this.b/Math.sqrt(u*u+this.one_minus_f_squared),p.phi=Math.atan(Math.sqrt(this.a*this.a-d*d)/(this.one_minus_f*d)),c&&(p.phi=-p.phi)),p.lam+=this.long0,t.x=p.lam,t.y=p.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},Qc=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],$c=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],tu=wl/5,eu=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))};var nu={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=Kl(t.x-this.long0),n=Math.abs(t.y),i=Math.floor(n*tu);i<0?i=0:i>=18&&(i=17);var r={x:eu(Qc[i],n=wl*(n-.08726646259971647*i))*e,y:eu($c[i],n)};return t.y<0&&(r.y=-r.y),r.x=r.x*this.a*.8487+this.x0,r.y=r.y*this.a*1.3523+this.y0,r},inverse:function(t){var e={x:(t.x-this.x0)/(.8487*this.a),y:Math.abs(t.y-this.y0)/(1.3523*this.a)};if(e.y>=1)e.x/=Qc[18][0],e.y=t.y<0?-bl:bl;else{var n=Math.floor(18*e.y);for(n<0?n=0:n>=18&&(n=17);;)if($c[n][0]>e.y)--n;else{if(!($c[n+1][0]<=e.y))break;++n}var i=$c[n],r=5*(e.y-i[0])/($c[n+1][0]-i[0]);r=function(t,e,n,i){for(var r=e;i;--i){var s=t(r);if(r-=s,Math.abs(s)1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var s={header:r,subgrids:function(t,e,n){for(var i=[],r=0;r highestA ){ highestA = tA"+r+"; }\nvec4 C"+r+" = texture2D(t"+r+", vUv);\nC = vec4( C"+r+".rgb * (C"+r+".a * tA"+r+") + C.rgb * C.a * (1.0 - (C"+r+".a * tA"+r+")), 1);\n";i+="if (";for(r=0;r 0.4) { gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0); }","}"].join("\n");return new Be({uniforms:{coefficient:{value:.1},power:{value:6},opacity:{value:.5},glowColor:{value:new Ht(t||"#FFFFFF")}},vertexShader:e,fragmentShader:n,blending:2,transparent:!0,depthWrite:!1})}};n(5),n(6);function mu(t,e,n,i,r){return new Promise((function(e,n){PNG.load(t,{withCredentials:!1},(function(t){if(0!=t){for(var i,r=t.decode(),s=[],a=0;a0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]0){var r=function(){t.tilesToBeDrawn.length>0&&t.addTile(t.tilesToBeDrawn.pop(),r).catch((function(){r()}))};this.addTile(this.tilesToBeDrawn.pop(),r).catch((function(){r()}))}if(0==this.tilesToBeDrawn.length&&0==this.tilesBeingDrawn.length){for(e=0;e=0;a--)if(t.isLODTile==d.tilesDrawn[a].isLODTile&&t.LODLevel==d.tilesDrawn[a].LODLevel){var o=[d.tilesDrawn[a].x,d.tilesDrawn[a].y,d.tilesDrawn[a].z],l=[t.x,t.y,t.z];t.zd.tilesDrawn[a].z&&yl.tileIsContained(o,l)&&(d.tilesDrawn[a].contents.push(l),d.tilesDrawn[a].contents.length>=yl.tileContains(o,t.z).length&&s.push(a))}for(a=d.tilesBeingDrawn.length-1;a>=0;a--)if(d.tilesBeingDrawn[a].x==t.x&&d.tilesBeingDrawn[a].y==t.y&&d.tilesBeingDrawn[a].z==t.z&&d.tilesBeingDrawn[a].isLODTile==t.isLODTile&&d.tilesBeingDrawn[a].LODLevel==t.LODLevel){if(d.tilesBeingDrawn[a].make)t.isLODTile?d.p.planetsLOD[t.LODLevel].add(i):d.p.planet.add(i),d.updateRastersForTile(t),s.forEach((function(t){d.removeTile(t,!0)}));else{i.geometry.dispose(),i.material.dispose();for(var h=d.tilesDrawn.length-1;h>=0;h--)d.tilesDrawn[h].x==t.x&&d.tilesDrawn[h].y==t.y&&d.tilesDrawn[h].z==t.z&&d.tilesDrawn[a].isLODTile==t.isLODTile&&d.tilesDrawn[a].LODLevel==t.LODLevel&&d.tilesDrawn.splice(h,1)}return void d.tilesBeingDrawn.splice(a,1)}}},a=function(e){var r=0,a=Math.pow(d.p.options.tileResolution,2),o=new Float32Array(3*a);null==e&&(e=new Array(a).fill(0));for(var l=0,h=Math.floor(e.length/2),c=0;(null==l||l>d.p.projection.radiusOfPlanetMajor||l<-d.p.projection.radiusOfPlanetMajor)&&c75&&T<-88?T=90:y<-75&&T>88&&(T=-90)),b=d.p.projection.lonLatToVector3(L,T,_*d.p.options.exaggeration),i.geometry.attributes.position.array[M]=b.x-x.x,i.geometry.attributes.position.array[M+1]=b.y-x.y,i.geometry.attributes.position.array[M+2]=b.z-x.z,r+=1}i.geometry.attributes.position.needsUpdate=!0,i.geometry.computeVertexNormals(),i.geometry.computeBoundingSphere(),i.geometry.setAttribute("customColor",new Yt(o,3)),n.data=!0,s()}},o=!1,c=this.p.layers.tile.length-1;c>=0;c--)if(this.p.layers.tile[c].on&&(t.z>=this.p.layers.tile[c].minZoom&&t.z<=this.p.layers.tile[c].maxZoom&&yl.isInExtent(t,this.p.layers.tile[c].boundingBox,this.p.projection)||"_vectorsastile_"==this.p.layers.tile[c].path)&&(l=this.p.layers.tile[c].demPath,h=this.p.layers.tile[c],null!=l)){o=!0;break}return o?(null!=l&&(l=(l=(l=l.replace("{z}",t.z)).replace("{x}",t.x)).replace("{y}",r)),[4,xu(this.p.options.customParsers,l,h,{x:t.x,y:r,z:t.z},this.p.options.tileResolution,Math.pow(this.p.options.tileResolution,2))]):[3,2];case 1:return u=p.sent(),a(u),[3,3];case 2:a(),p.label=3;case 3:return[2]}}))}))},t.prototype.findTileDrawnBasedOnUUID=function(t){var e=null;return this.tilesDrawn.forEach((function(n){n.t.uuid!==t||(e=n)})),e},t.prototype.findTileDrawnBasedOnXYZLOD=function(t){var e=null;return this.tilesDrawn.forEach((function(n){n.x!==t.x||n.y!==t.y||n.z!==t.z||n.isLODTile!==t.isLODTile||n.LODLevel!=t.LODLevel||(e=n)})),e},t.prototype.updateRastersForTile=function(t){var e=this,n=this.findTileDrawnBasedOnXYZLOD(t);if(null!=n){for(var i=[],r=new Array(this.p.layers.tile.length).fill(!1),s=new Array(this.p.layers.clamped.length).fill(!1),a=function(){if(r.every(Boolean)&&s.every(Boolean)){if(0==i.length)return void(n.t.visible=!1);i.sort((function(t,e){return t.i-e.i})),n.from.rasters=[];for(var t=0,a=0;a=l.p.layers.tile[t].minZoom&&n.z<=l.p.layers.tile[t].maxZoom&&yl.isInExtent({x:n.x,y:n.y,z:n.z},l.p.layers.tile[t].boundingBox,l.p.projection)){var s=l.p.layers.tile[t].path;s=(s=(s=s.replace("{z}",n.z)).replace("{x}",n.x)).replace("{y}",n.yI),function(t){e._.loader.load(s,(function(n){n.magFilter=1003,n.minFilter=1003,e.p.layers.tile[t]&&i.push({name:e.p.layers.tile[t].name,type:"tile",texture:n,opacity:e.p.layers.tile[t].opacity,i:t}),r[t]=!0,a()}),(function(){console.log("")}),(function(){r[t]=!0,a()}))}(t)}else r[t]=!0,a()},l=this,h=0;h=this.p.layers.clamped[h].minZoom)&&(null==this.p.layers.clamped[h].maxZoom||n.z<=this.p.layers.clamped[h].maxZoom)&&(null==this.p.layers.clamped[h].boundingBox||yl.isInExtent({x:n.x,y:n.y,z:n.z},this.p.layers.clamped[h].boundingBox,this.p.projection))){var c=this.p.layers._.layerers.clamped.getClampedTexture(h,{x:n.x,y:n.y,z:n.z});n.contains=n.contains||{},n.contains[this.p.layers.clamped[h].name]=c.features;var u=new ls(c.canvas);u.magFilter=1003,u.minFilter=1003,this.p.layers.clamped[h]&&i.push({name:this.p.layers.clamped[h].name,type:"clamped",texture:u,opacity:this.p.layers.clamped[h].opacity,i:h}),s[h]=!0,a()}else s[h]=!0,a()}},t.prototype.updateClampedRasterForTile=function(t,e){if(!this.p.options.wireframeMode){for(var n=null,i=0;i=r.minZoom)&&(null==r.maxZoom||t.z<=r.maxZoom)&&(null==r.boundingBox||yl.isInExtent({x:t.x,y:t.y,z:t.z},r.boundingBox,this.p.projection))){var s=this.p.layers._.layerers.clamped.getClampedTexture(n,{x:t.x,y:t.y,z:t.z});t.contains=t.contains||{},t.contains[this.p.layers.clamped[n].name]=s.features;var a=new ls(s.canvas);a.magFilter=1003,a.minFilter=1003;for(i=0;ir?Math.min(this.tilesDrawn[t].t.material.uniforms["tA"+e].value+.07,i):Math.max(this.tilesDrawn[t].t.material.uniforms["tA"+e].value-.07,i)}}},t.prototype.fadeOutTiles=function(){for(var t=this.tilesDrawn.length-1;t>=0;t--)if(this.tilesDrawn[t].fadeOutAndRemove)for(var e=0;e=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Eu(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Tu(t){return"Feature"===t.type?t.geometry:t}function Lu(t,e,n,i){void 0===i&&(i={});var r=Su(t),s=Object(wu.degreesToRadians)(r[0]),a=Object(wu.degreesToRadians)(r[1]),o=Object(wu.degreesToRadians)(n),l=Object(wu.lengthToRadians)(e,i.units),h=Math.asin(Math.sin(a)*Math.cos(l)+Math.cos(a)*Math.sin(l)*Math.cos(o)),c=s+Math.atan2(Math.sin(o)*Math.sin(l)*Math.cos(a),Math.cos(l)-Math.sin(a)*Math.sin(h)),u=Object(wu.radiansToDegrees)(c),d=Object(wu.radiansToDegrees)(h);return Object(wu.point)([u,d],i.properties)}var Au=function(t,e,n){void 0===n&&(n={});for(var i=n.steps||64,r=n.properties?n.properties:!Array.isArray(t)&&"Feature"===t.type&&t.properties?t.properties:{},s=[],a=0;a=t[0]&&e[3]>=t[1]}(i,a))return!1;"Polygon"===s&&(o=[o]);for(var l=!1,h=0;ht[1]!=h>t[1]&&t[0]<(l-a)*(t[1]-o)/(h-o)+a&&(i=!i)}return i}var Ru=n(1);var Ou=function(t){if(!t)throw new Error("geojson is required");var e=[];return Object(Ru.flattenEach)(t,(function(t){!function(t,e){var n=[],i=t.geometry;if(null!==i){switch(i.type){case"Polygon":n=Eu(i);break;case"LineString":n=[Eu(i)]}n.forEach((function(n){(function(t,e){var n=[];return t.reduce((function(t,i){var r,s,a,o,l,h,c=Object(wu.lineString)([t,i],e);return c.bbox=(s=i,a=(r=t)[0],o=r[1],l=s[0],h=s[1],[al?a:l,o>h?o:h]),n.push(c),i})),n})(n,t.properties).forEach((function(t){t.id=e.length,e.push(t)}))}))}}(t,e)})),Object(wu.featureCollection)(e)},Iu=n(3),Du=n.n(Iu);function Nu(t,e){var n=Eu(t),i=Eu(e);if(2!==n.length)throw new Error(" line1 must only contain 2 coordinates");if(2!==i.length)throw new Error(" line2 must only contain 2 coordinates");var r=n[0][0],s=n[0][1],a=n[1][0],o=n[1][1],l=i[0][0],h=i[0][1],c=i[1][0],u=i[1][1],d=(u-h)*(a-r)-(c-l)*(o-s),p=(c-l)*(s-h)-(u-h)*(r-l),f=(a-r)*(s-h)-(o-s)*(r-l);if(0===d)return null;var m=p/d,g=f/d;if(m>=0&&m<=1&&g>=0&&g<=1){var v=r+m*(a-r),y=s+m*(o-s);return Object(wu.point)([v,y])}return null}var zu=function(t,e){var n={},i=[];if("LineString"===t.type&&(t=Object(wu.feature)(t)),"LineString"===e.type&&(e=Object(wu.feature)(e)),"Feature"===t.type&&"Feature"===e.type&&null!==t.geometry&&null!==e.geometry&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var r=Nu(t,e);return r&&i.push(r),Object(wu.featureCollection)(i)}var s=Du()();return s.load(Ou(e)),Object(Ru.featureEach)(Ou(t),(function(t){Object(Ru.featureEach)(s.search(t),(function(e){var r=Nu(t,e);if(r){var s=Eu(r).join(",");n[s]||(n[s]=!0,i.push(r))}}))})),Object(wu.featureCollection)(i)},ku=function(t,e){void 0===e&&(e={});var n=Tu(t);switch(e.properties||"Feature"!==t.type||(e.properties=t.properties),n.type){case"Polygon":return function(t,e){void 0===e&&(e={});var n=Tu(t).coordinates,i=e.properties?e.properties:"Feature"===t.type?t.properties:{};return Fu(n,i)}(n,e);case"MultiPolygon":return function(t,e){void 0===e&&(e={});var n=Tu(t).coordinates,i=e.properties?e.properties:"Feature"===t.type?t.properties:{},r=[];return n.forEach((function(t){r.push(Fu(t,i))})),Object(wu.featureCollection)(r)}(n,e);default:throw new Error("invalid poly")}};function Fu(t,e){return t.length>1?Object(wu.multiLineString)(t,e):Object(wu.lineString)(t[0],e)}function Bu(t,e){for(var n=0;n0}function Hu(t,e,n){var i=n[0]-t[0],r=n[1]-t[1],s=e[0]-t[0],a=e[1]-t[1];return 0==i*a-r*s&&(Math.abs(s)>=Math.abs(a)?s>0?t[0]<=n[0]&&n[0]<=e[0]:e[0]<=n[0]&&n[0]<=t[0]:a>0?t[1]<=n[1]&&n[1]<=e[1]:e[1]<=n[1]&&n[1]<=t[1])}var ju=function(t,e){var n=!0;return Object(Ru.flattenEach)(t,(function(t){Object(Ru.flattenEach)(e,(function(e){if(!1===n)return!1;n=function(t,e){switch(t.type){case"Point":switch(e.type){case"Point":return n=t.coordinates,i=e.coordinates,!(n[0]===i[0]&&n[1]===i[1]);case"LineString":return!Bu(e,t);case"Polygon":return!Cu(t,e)}break;case"LineString":switch(e.type){case"Point":return!Bu(t,e);case"LineString":return!function(t,e){if(zu(t,e).features.length>0)return!0;return!1}(t,e);case"Polygon":return!Uu(e,t)}break;case"Polygon":switch(e.type){case"Point":return!Cu(e,t);case"LineString":return!Uu(t,e);case"Polygon":return!function(t,e){for(var n=0,i=t.coordinates[0];n0)return!0;return!1}(e,t)}}var n,i;return!1}(t.geometry,e.geometry)}))})),n};function Gu(t,e){var n=!1;return Object(Ru.flattenEach)(t,(function(t){Object(Ru.flattenEach)(e,(function(e){if(!0===n)return!0;n=!ju(t.geometry,e.geometry)}))})),n}var Vu=function(){function t(t){var e=this;this._rotateGlobe=function(t,n){if(n&&(e._.prevMouseXY.x=n.x,e._.prevMouseXY.y=n.y),t){!t.pageX&&t.touches&&(t.pageX=yl.arrayAverage(t.touches,"pageX")),!t.pageY&&t.touches&&(t.pageY=yl.arrayAverage(t.touches,"pageY")),t.hasOwnProperty("x")&&t.hasOwnProperty("y")&&e.p._.cameras.isFirstPerson&&(e._.prevMouseXY.x=0,e._.prevMouseXY.y=0,t.pageX=t.x,t.pageY=t.y);var i=.5*yl.getRadiansPerPixel(e.p.trueZoom),r=0,s=new _(e.p._.cameras.orbit.camera.position.x,0,e.p._.cameras.orbit.camera.position.z);s.applyAxisAngle(new _(0,1,0),Math.PI/2);var a=new _(e.p._.cameras.orbit.camera.position.x,0,e.p._.cameras.orbit.camera.position.z);if(t.pageYe._.prevMouseXY.y&&(r=Math.abs(t.pageY-e._.prevMouseXY.y),e._rotateAroundArbAxis(s,-i*r)),t.pageX>e._.prevMouseXY.x?(r=Math.abs(t.pageX-e._.prevMouseXY.x),e._rotateAroundArbAxis(a,-i*r)):t.pageX2&&(e._.prevMouseXY.x=yl.arrayAverage(t.touches,"pageX"),e._.prevMouseXY.y=yl.arrayAverage(t.touches,"pageY"),e.p._.sceneContainer.addEventListener("touchmove",e._rotateGlobe,!1),e.p._.sceneContainer.addEventListener("touchend",e._rotateGlobe_MouseUp,!1))},this._rotateGlobe_MouseUp=function(t){e.p._.sceneContainer.removeEventListener("mousemove",e._rotateGlobe),e.p._.sceneContainer.removeEventListener("mouseup",e._rotateGlobe_MouseUp),e.p._.sceneContainer.removeEventListener("touchmove",e._rotateGlobe),e.p._.sceneContainer.removeEventListener("touchend",e._rotateGlobe_MouseUp)},this._onZoom=function(t){e._.zoomedSince=0;var n=e.p._.cameras.orbit.camera.position.distanceTo(e.p._.cameras.orbit.controls.target),i=8-(e.p.projection.radiusScale.toString().length-1),r=Math.ceil((i*Math.log(2)-Math.log(n/Math.pow(5,i-1)))/Math.log(2))+1;e._.desiredZoom=r,e._attenuate()},this._onTouchZoom=function(t){t.touches&&1==t.touches.length&&e._onZoom(t)},this._onClick=function(t){if(e.hoveredFeature&&e.hoverInfo){var n=e.p.layers.getLayerByName(e.hoveredFeature.layerName);n&&(e.setActiveFeature({layerName:e.hoveredFeature.layerName,type:e.hoveredFeature.type,obj:e.hoveredFeature.obj,feature:e.hoveredFeature.feature||e.hoveredFeature.obj.feature,lnglat:{lng:e.hoveredFeature.lnglat.lng,lat:e.hoveredFeature.lnglat.lat}}),"function"==typeof n.onClick&&n.onClick(JSON.parse(JSON.stringify(e.hoveredFeature.feature)),JSON.parse(JSON.stringify(e.hoveredFeature.lnglat)),n))}},this._onMouseMove=function(t){e.p._.mouseIsInScene=!0,e.p._.cameras.isFirstPerson?(e._.mouseXY.x=0,e._.mouseXY.y=0):(e._.mouseXY.x=(t.clientX-e.p._.renderer.domElement.getBoundingClientRect().left)/e.p._.renderer.domElement.clientWidth*2-1,e._.mouseXY.y=-(t.clientY-e.p._.renderer.domElement.getBoundingClientRect().top)/e.p._.renderer.domElement.clientHeight*2+1),e._.containerXY={x:t?t.offsetX:null,y:t?t.offsetY:null},e.updateHoverInfoPosition(),e.p._.raycaster.setFromCamera(e._.mouseXY,e.p._.cameras.camera);for(var n=[],i=0;i0){var a=s[0].object.type,o=null;switch(a){case"Sprite":case"Line2":o=s[0].object;break;case"Mesh":if(null==(o=e.p._.tiledWorld.findTileDrawnBasedOnUUID(s[0].object.uuid)))return;break;default:return}var l=s[0].point;s[0].point.y+=e.p.planetCenter.y,s[0].point=e.p.projection.rotatePoint3D(s[0].point,{x:-e.p.planet.rotation.x,y:0,z:0}),s[0].point=e.p.projection.rotatePoint3D(s[0].point,{x:0,y:-e.p.planet.rotation.y,z:0}),s[0].point=e.p.projection.rotatePoint3D(s[0].point,{x:0,y:0,z:-e.p.planet.rotation.z});var h=e.p.projection.vector3ToLatLng(s[0].point);h.height=l.length()*e.p.projection.radiusScale-e.p.projection.radii.major,e._updateMouseCoords(h.lng,h.lat,h.height),clearTimeout(e._.highlightTimeout),e._.highlightTimeout=setTimeout((function(){e._highlightFeature(h.lng,h.lat,a,o)}),10),e.p.controls._onMouseMove(h.lng,h.lat,h.height,t)}else e._updateMouseCoords(null,null,null),e._unhighlightHoveredFeature(),e.p.controls._onMouseMove(null,null,null,t)},this.p=t,this.activeFeature=null,this.hoveredFeature=null,this.hoverInfo=null,this._={mouseXY:{x:null,y:null},prevMouseXY:{x:null,y:null},containerXY:{x:null,y:null},lastZoomDelta:1,desiredZoom:null,zoomedSince:0,zoomWait:30,highlightTimeout:null},this._init()}return t.prototype._init=function(){var t=this;this._matchPlanetsLODToPlanet(),this.p._.sceneContainer.addEventListener("mousewheel",this._onZoom,!1),this.p._.sceneContainer.addEventListener("DOMMouseScroll",this._onZoom,!1),this.p._.sceneContainer.addEventListener("wheel",this._onZoom,!1),this.p._.sceneContainer.addEventListener("mouseleave",this.p.controls._onMouseOut,!1),this.p._.sceneContainer.addEventListener("touchend",this._onTouchZoom),this.p._.sceneContainer.addEventListener("mousedown",this._rotateGlobe_MouseDown,!1),this.p._.sceneContainer.addEventListener("mousemove",this._onMouseMove,!1),this.p._.sceneContainer.addEventListener("click",this._onClick,!1),this.p._.sceneContainer.addEventListener("mouseenter",(function(){t.p._.mouseIsInScene=!0}),!1),this.p._.sceneContainer.addEventListener("mouseleave",(function(){t.p._.mouseIsInScene=!1}),!1)},t.prototype._rotateAroundArbAxis=function(t,e,n){var i=new Y;i.makeRotationAxis(t.normalize(),e),!0!==n&&i.multiply(this.p.planet.matrix),this.p.planet.matrix=i,this.p.planet.rotation.setFromRotationMatrix(this.p.planet.matrix),this._matchPlanetsLODToPlanet(),this._refreshFrontGroupRotation()},t.prototype._checkDesiredZoom=function(){this._.zoomedSince++,null!=this._.desiredZoom&&(this.p._.cameras.setNearFarPlane(this._.desiredZoom<14),this._.zoomedSince>this._.zoomWait&&(this._.desiredZoom>=this.p._.minNativeZoom&&this._setZoom(this._.desiredZoom),this._.desiredZoom=null))},t.prototype._setZoom=function(t){var e=this.p.zoom;this.p.zoom=t,this.p.trueZoom=Math.max(0,t),this.p.zoom<0&&(this.p.zoom=0),this.p.zoomthis.p._.maxZoom&&(this.p.zoom=this.p._.maxZoom),this._.lastZoomDelta=Math.abs(this.p.zoom-e)},t.prototype._matchPlanetsLODToPlanet=function(){for(var t=0;t0?e.children.forEach((function(e){e instanceof Mr&&e.scale.set(t*e.style.radius,t*e.style.radius,t*e.style.radius)})):e instanceof Mr&&e.scale.set(t*mesh.style.radius,t*mesh.style.radius,t*mesh.style.radius)}))},t}(),Wu=n(2),qu=n.n(Wu);class Xu{constructor(){this.maxSize=800,this.minSize=600,this.unloadPercent=.05,this.itemSet=new Map,this.itemList=[],this.usedSet=new Set,this.callbacks=new Map,this.unloadPriorityCallback=null;const t=this.itemSet;this.defaultPriorityCallback=e=>t.get(e)}isFull(){return this.itemSet.size>=this.maxSize}add(t,e){const n=this.itemSet;if(n.has(t))return!1;if(this.isFull())return!1;const i=this.usedSet,r=this.itemList,s=this.callbacks;return r.push(t),i.add(t),n.set(t,Date.now()),s.set(t,e),!0}remove(t){const e=this.usedSet,n=this.itemSet,i=this.itemList,r=this.callbacks;if(n.has(t)){r.get(t)(t);const s=i.indexOf(t);return i.splice(s,1),e.delete(t),n.delete(t),r.delete(t),!0}return!1}markUsed(t){const e=this.itemSet,n=this.usedSet;e.has(t)&&!n.has(t)&&(e.set(t,Date.now()),n.add(t))}markAllUnused(){this.usedSet.clear()}unloadUnusedContent(){const t=this.unloadPercent,e=this.minSize,n=this.itemList,i=this.itemSet,r=this.usedSet,s=this.callbacks,a=n.length-r.size,o=n.length-e,l=this.unloadPriorityCallback||this.defaultPriorityCallback;if(o>0&&a>0){n.sort((t,e)=>{const n=r.has(t),i=r.has(e);return n&&i?0:n||i?n?1:-1:l(e)-l(t)});const h=Math.min(o,a),c=Math.max(e*t,h*t);let u=Math.min(c,a);u=Math.ceil(u);const d=n.splice(0,u);for(let t=0,e=d.length;t{this.scheduled=!1,this.unloadUnusedContent(),t&&this.markAllUnused()},Promise.resolve().then(e))}}class Yu{constructor(){this.maxJobs=6,this.items=[],this.callbacks=new Map,this.currJobs=0,this.scheduled=!1,this.autoUpdate=!0,this.priorityCallback=()=>{throw new Error("PriorityQueue: PriorityCallback function not defined.")}}sort(){const t=this.priorityCallback;this.items.sort((e,n)=>t(e)-t(n))}add(t,e){return new Promise((n,i)=>{const r=this.items,s=this.callbacks;r.push(t),s.set(t,(...t)=>e(...t).then(n).catch(i)),this.autoUpdate&&this.scheduleJobRun()})}remove(t){const e=this.items,n=this.callbacks,i=e.indexOf(t);-1!==i&&(e.splice(i,1),n.delete(t))}tryRunJobs(){this.sort();const t=this.items,e=this.callbacks,n=this.maxJobs;let i=this.currJobs;for(;n>i&&t.length>0;){i++;const n=t.pop(),r=e.get(n);e.delete(n),r(n).then(()=>{this.currJobs--,this.autoUpdate&&this.scheduleJobRun()}).catch(()=>{this.currJobs--,this.autoUpdate&&this.scheduleJobRun()})}this.currJobs=i}scheduleJobRun(){this.scheduled||(requestAnimationFrame(()=>{this.tryRunJobs(),this.scheduled=!1}),this.scheduled=!0)}}function Zu(t){return 3===t||4===t}function Ju(t,e){return t.__lastFrameVisited===e&&t.__used}function Ku(t,e){t.__lastFrameVisited!==e&&(t.__lastFrameVisited=e,t.__used=!1,t.__inFrustum=!1,t.__isLeaf=!1,t.__visible=!1,t.__active=!1,t.__error=0,t.__childrenWereVisible=!1,t.__allChildrenLoaded=!1)}function Qu(t,e,n){if(Ku(t,e),t.__used=!0,n.markUsed(t),t.__contentEmpty){const i=t.children;for(let t=0,r=i.length;t1/(t.__depthFromRenderedParent+1);function nd(t){let e="";for(let n=0,i=t.length;na+o)throw new Error("FeatureTable: Feature data read outside binary body length.");return d}}return s}}class rd extends id{constructor(t,e,n,i,r){super(t,n,i,r),this.batchSize=e}getData(t,e=null,n=null){return super.getData(t,this.batchSize,n,e)}}var sd=function(){function t(t){xa.call(this,t),this.dracoLoader=null,this.ddsLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(t){return new a(t)})),this.register((function(t){return new l(t)})),this.register((function(t){return new u(t)})),this.register((function(t){return new o(t)})),this.register((function(t){return new r(t)})),this.register((function(t){return new d(t)}))}function e(){var t={};return{get:function(e){return t[e]},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},removeAll:function(){t={}}}}t.prototype=Object.assign(Object.create(xa.prototype),{constructor:t,load:function(t,e,n,i){var r,s=this;r=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:fo(t),this.manager.itemStart(t);var a=function(e){i?i(e):console.error(e),s.manager.itemError(t),s.manager.itemEnd(t)},o=new ba(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,(function(n){try{s.parse(n,r,(function(n){e(n),s.manager.itemEnd(t)}),a)}catch(t){a(t)}}),n,a)},setDRACOLoader:function(t){return this.dracoLoader=t,this},setDDSLoader:function(t){return this.ddsLoader=t,this},setKTX2Loader:function(t){return this.ktx2Loader=t,this},setMeshoptDecoder:function(t){return this.meshoptDecoder=t,this},register:function(t){return-1===this.pluginCallbacks.indexOf(t)&&this.pluginCallbacks.push(t),this},unregister:function(t){return-1!==this.pluginCallbacks.indexOf(t)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this},parse:function(t,e,r,a){var o,l={},h={};if("string"==typeof t)o=t;else if(po(new Uint8Array(t,0,4))===p){try{l[n.KHR_BINARY_GLTF]=new g(t)}catch(t){return void(a&&a(t))}o=l[n.KHR_BINARY_GLTF].content}else o=po(new Uint8Array(t));var c=JSON.parse(o);if(void 0===c.asset||c.asset.version[0]<2)a&&a(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{var u=new Z(c,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(var d=0;d=0&&void 0===h[m]&&console.warn('THREE.GLTFLoader: Unknown extension "'+m+'".')}}u.setExtensions(l),u.setPlugins(h),u.parse(r,a)}}});var n={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function i(t){if(!t)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=n.MSFT_TEXTURE_DDS,this.ddsLoader=t}function r(t){this.parser=t,this.name=n.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}function s(){this.name=n.KHR_MATERIALS_UNLIT}function a(t){this.parser=t,this.name=n.KHR_MATERIALS_CLEARCOAT}function o(t){this.parser=t,this.name=n.KHR_MATERIALS_TRANSMISSION}function l(t){this.parser=t,this.name=n.KHR_TEXTURE_BASISU}function u(t){this.parser=t,this.name=n.EXT_TEXTURE_WEBP,this.isSupported=null}function d(t){this.name=n.EXT_MESHOPT_COMPRESSION,this.parser=t}r.prototype._markDefs=function(){for(var t=this.parser,e=this.parser.json.nodes||[],n=0,i=e.length;n=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,s,a)},u.prototype.loadTexture=function(t){var e=this.name,n=this.parser,i=n.json,r=i.textures[t];if(!r.extensions||!r.extensions[e])return null;var s=r.extensions[e],a=i.images[s.source],o=a.uri?n.options.manager.getHandler(a.uri):n.textureLoader;return this.detectSupport().then((function(r){if(r)return n.loadTextureImage(t,a,o);if(i.extensionsRequired&&i.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(t)}))},u.prototype.detectSupport=function(){return this.isSupported||(this.isSupported=new Promise((function(t){var e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){t(1===e.height)}}))),this.isSupported},d.prototype.loadBufferView=function(t){var e=this.parser.json,n=e.bufferViews[t];if(n.extensions&&n.extensions[this.name]){var i=n.extensions[this.name],r=this.parser.getDependency("buffer",i.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([r,s.ready]).then((function(t){var e=i.byteOffset||0,n=i.byteLength||0,r=i.count,a=i.byteStride,o=new ArrayBuffer(r*a),l=new Uint8Array(t[0],e,n);return s.decodeGltfBuffer(new Uint8Array(o),r,a,l,i.mode,i.filter),o}))}return null};var p="glTF",f=1313821514,m=5130562;function g(t){this.name=n.KHR_BINARY_GLTF,this.content=null,this.body=null;var e=new DataView(t,0,12);if(this.header={magic:po(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==p)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var i=this.header.length-12,r=new DataView(t,12),s=0;s",e).replace("#include ",n).replace("#include ",i).replace("#include ",r).replace("#include ",s)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(t){a.specular.value=t}},specularMap:{get:function(){return a.specularMap.value},set:function(t){a.specularMap.value=t,t?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(t){a.glossiness.value=t}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(t){a.glossinessMap.value=t,t?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(t)}function b(){return{name:n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return x},extendParams:function(t,e,n){var i=e.extensions[this.name];t.color=new Ht(1,1,1),t.opacity=1;var r=[];if(Array.isArray(i.diffuseFactor)){var s=i.diffuseFactor;t.color.fromArray(s),t.opacity=s[3]}if(void 0!==i.diffuseTexture&&r.push(n.assignTexture(t,"map",i.diffuseTexture)),t.emissive=new Ht(0,0,0),t.glossiness=void 0!==i.glossinessFactor?i.glossinessFactor:1,t.specular=new Ht(1,1,1),Array.isArray(i.specularFactor)&&t.specular.fromArray(i.specularFactor),void 0!==i.specularGlossinessTexture){var a=i.specularGlossinessTexture;r.push(n.assignTexture(t,"glossinessMap",a)),r.push(n.assignTexture(t,"specularMap",a))}return Promise.all(r)},createMaterial:function(t){var e=new x(t);return e.fog=!0,e.color=t.color,e.map=void 0===t.map?null:t.map,e.lightMap=null,e.lightMapIntensity=1,e.aoMap=void 0===t.aoMap?null:t.aoMap,e.aoMapIntensity=1,e.emissive=t.emissive,e.emissiveIntensity=1,e.emissiveMap=void 0===t.emissiveMap?null:t.emissiveMap,e.bumpMap=void 0===t.bumpMap?null:t.bumpMap,e.bumpScale=1,e.normalMap=void 0===t.normalMap?null:t.normalMap,e.normalMapType=0,t.normalScale&&(e.normalScale=t.normalScale),e.displacementMap=null,e.displacementScale=1,e.displacementBias=0,e.specularMap=void 0===t.specularMap?null:t.specularMap,e.specular=t.specular,e.glossinessMap=void 0===t.glossinessMap?null:t.glossinessMap,e.glossiness=t.glossiness,e.alphaMap=null,e.envMap=void 0===t.envMap?null:t.envMap,e.envMapIntensity=1,e.refractionRatio=.98,e}}}function M(){this.name=n.KHR_MESH_QUANTIZATION}function S(t,e,n,i){na.call(this,t,e,n,i)}v.prototype.decodePrimitive=function(t,e){var n=this.json,i=this.dracoLoader,r=t.extensions[this.name].bufferView,s=t.extensions[this.name].attributes,a={},o={},l={};for(var h in s){var c=z[h]||h.toLowerCase();a[c]=s[h]}for(h in t.attributes){c=z[h]||h.toLowerCase();if(void 0!==s[h]){var u=n.accessors[t.attributes[h]],d=O[u.componentType];l[c]=d,o[c]=!0===u.normalized}}return e.getDependency("bufferView",r).then((function(t){return new Promise((function(e){i.decodeDracoFile(t,(function(t){for(var n in t.attributes){var i=t.attributes[n],r=o[n];void 0!==r&&(i.normalized=r)}e(t)}),a,l)}))}))},y.prototype.extendTexture=function(t,e){return t=t.clone(),void 0!==e.offset&&t.offset.fromArray(e.offset),void 0!==e.rotation&&(t.rotation=e.rotation),void 0!==e.scale&&t.repeat.fromArray(e.scale),void 0!==e.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),t.needsUpdate=!0,t},x.prototype=Object.create(qs.prototype),x.prototype.constructor=x,x.prototype.copy=function(t){return qs.prototype.copy.call(this,t),this.specularMap=t.specularMap,this.specular.copy(t.specular),this.glossinessMap=t.glossinessMap,this.glossiness=t.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},S.prototype=Object.create(na.prototype),S.prototype.constructor=S,S.prototype.copySampleValue_=function(t){for(var e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=t*i*3+i,s=0;s!==i;s++)e[s]=n[r+s];return e},S.prototype.beforeStart_=S.prototype.copySampleValue_,S.prototype.afterEnd_=S.prototype.copySampleValue_,S.prototype.interpolate_=function(t,e,n,i){for(var r=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=2*a,l=3*a,h=i-e,c=(n-e)/h,u=c*c,d=u*c,p=t*l,f=p-l,m=-2*d+3*u,g=d-u,v=1-m,y=g-u+c,x=0;x!==a;x++){var _=s[f+x+a],b=s[f+x+o]*h,M=s[p+x+a],w=s[p+x]*h;r[x]=v*_+y*b+m*M+g*w}return r};var E=0,T=1,L=2,A=3,C=4,P=5,R=6,O={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},I={9728:1003,9729:1006,9984:1004,9985:1007,9986:1005,9987:1008},D={33071:1001,33648:1002,10497:1e3},N={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},z={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},k={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},F={CUBICSPLINE:void 0,LINEAR:2301,STEP:2300},U="OPAQUE",H="MASK",j="BLEND";function G(t,e){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:e+t)}function V(t,e,n){for(var i in n.extensions)void 0===t[i]&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[i]=n.extensions[i])}function W(t,e){void 0!==e.extras&&("object"==typeof e.extras?Object.assign(t.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function q(t,e){if(t.updateMorphTargets(),void 0!==e.weights)for(var n=0,i=e.weights.length;n=2&&r.setY(S,b[M*a+1]),a>=3&&r.setZ(S,b[M*a+2]),a>=4&&r.setW(S,b[M*a+3]),a>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return r}))},Z.prototype.loadTexture=function(t){var e,i,r=this.json,s=this.options,a=r.textures[t],o=a.extensions||{};return(e=o[n.MSFT_TEXTURE_DDS]?r.images[o[n.MSFT_TEXTURE_DDS].source]:r.images[a.source]).uri&&(i=s.manager.getHandler(e.uri)),i||(i=o[n.MSFT_TEXTURE_DDS]?this.extensions[n.MSFT_TEXTURE_DDS].ddsLoader:this.textureLoader),this.loadTextureImage(t,e,i)},Z.prototype.loadTextureImage=function(t,e,n){var i=this,r=this.json,s=this.options,a=r.textures[t],o=self.URL||self.webkitURL,l=e.uri,h=!1,c=!0;return"image/jpeg"===e.mimeType&&(c=!1),void 0!==e.bufferView&&(l=i.getDependency("bufferView",e.bufferView).then((function(t){if("image/png"===e.mimeType){var n=new DataView(t,25,1).getUint8(0,!1);c=6===n||4===n||3===n}h=!0;var i=new Blob([t],{type:e.mimeType});return l=o.createObjectURL(i)}))),Promise.resolve(l).then((function(t){return new Promise((function(e,i){var r=e;!0===n.isImageBitmapLoader&&(r=function(t){e(new ls(t))}),n.load(G(t,s.path),r,void 0,i)}))})).then((function(e){!0===h&&o.revokeObjectURL(l),e.flipY=!1,a.name&&(e.name=a.name),c||(e.format=1022);var n=(r.samplers||{})[a.sampler]||{};return e.magFilter=I[n.magFilter]||1006,e.minFilter=I[n.minFilter]||1008,e.wrapS=D[n.wrapS]||1e3,e.wrapT=D[n.wrapT]||1e3,i.associations.set(e,{type:"textures",index:t}),e}))},Z.prototype.assignTexture=function(t,e,i){var r=this;return this.getDependency("texture",i.index).then((function(s){if(void 0===i.texCoord||0==i.texCoord||"aoMap"===e&&1==i.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+i.texCoord+" for texture "+e+" not yet supported."),r.extensions[n.KHR_TEXTURE_TRANSFORM]){var a=void 0!==i.extensions?i.extensions[n.KHR_TEXTURE_TRANSFORM]:void 0;if(a){var o=r.associations.get(s);s=r.extensions[n.KHR_TEXTURE_TRANSFORM].extendTexture(s,a),r.associations.set(s,o)}}t[e]=s}))},Z.prototype.assignFinalMaterial=function(t){var e=t.geometry,n=t.material,i=void 0!==e.attributes.tangent,r=void 0!==e.attributes.color,s=void 0===e.attributes.normal,a=!0===t.isSkinnedMesh,o=Object.keys(e.morphAttributes).length>0,l=o&&void 0!==e.morphAttributes.normal;if(t.isPoints){var h="PointsMaterial:"+n.uuid,c=this.cache.get(h);c||(c=new $r,Vt.prototype.copy.call(c,n),c.color.copy(n.color),c.map=n.map,c.sizeAttenuation=!1,this.cache.add(h,c)),n=c}else if(t.isLine){h="LineBasicMaterial:"+n.uuid;var u=this.cache.get(h);u||(u=new jr,Vt.prototype.copy.call(u,n),u.color.copy(n.color),this.cache.add(h,u)),n=u}if(i||r||s||a||o){h="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(h+="specular-glossiness:"),a&&(h+="skinning:"),i&&(h+="vertex-tangents:"),r&&(h+="vertex-colors:"),s&&(h+="flat-shading:"),o&&(h+="morph-targets:"),l&&(h+="morph-normals:");var d=this.cache.get(h);d||(d=n.clone(),a&&(d.skinning=!0),r&&(d.vertexColors=!0),s&&(d.flatShading=!0),o&&(d.morphTargets=!0),l&&(d.morphNormals=!0),i&&(d.vertexTangents=!0,d.normalScale&&(d.normalScale.y*=-1),d.clearcoatNormalScale&&(d.clearcoatNormalScale.y*=-1)),this.cache.add(h,d),this.associations.set(d,this.associations.get(n))),n=d}n.aoMap&&void 0===e.attributes.uv2&&void 0!==e.attributes.uv&&e.setAttribute("uv2",e.attributes.uv),t.material=n},Z.prototype.getMaterialType=function(){return qs},Z.prototype.loadMaterial=function(t){var e,i=this,r=this.json,s=this.extensions,a=r.materials[t],o={},l=a.extensions||{},h=[];if(l[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=s[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];e=u.getMaterialType(),h.push(u.extendParams(o,a,i))}else if(l[n.KHR_MATERIALS_UNLIT]){var d=s[n.KHR_MATERIALS_UNLIT];e=d.getMaterialType(),h.push(d.extendParams(o,a,i))}else{var p=a.pbrMetallicRoughness||{};if(o.color=new Ht(1,1,1),o.opacity=1,Array.isArray(p.baseColorFactor)){var f=p.baseColorFactor;o.color.fromArray(f),o.opacity=f[3]}void 0!==p.baseColorTexture&&h.push(i.assignTexture(o,"map",p.baseColorTexture)),o.metalness=void 0!==p.metallicFactor?p.metallicFactor:1,o.roughness=void 0!==p.roughnessFactor?p.roughnessFactor:1,void 0!==p.metallicRoughnessTexture&&(h.push(i.assignTexture(o,"metalnessMap",p.metallicRoughnessTexture)),h.push(i.assignTexture(o,"roughnessMap",p.metallicRoughnessTexture))),e=this._invokeOne((function(e){return e.getMaterialType&&e.getMaterialType(t)})),h.push(Promise.all(this._invokeAll((function(e){return e.extendMaterialParams&&e.extendMaterialParams(t,o)}))))}!0===a.doubleSided&&(o.side=2);var m=a.alphaMode||U;return m===j?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,m===H&&(o.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&e!==Wt&&(h.push(i.assignTexture(o,"normalMap",a.normalTexture)),o.normalScale=new c(1,-1),void 0!==a.normalTexture.scale&&o.normalScale.set(a.normalTexture.scale,-a.normalTexture.scale)),void 0!==a.occlusionTexture&&e!==Wt&&(h.push(i.assignTexture(o,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(o.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&e!==Wt&&(o.emissive=(new Ht).fromArray(a.emissiveFactor)),void 0!==a.emissiveTexture&&e!==Wt&&h.push(i.assignTexture(o,"emissiveMap",a.emissiveTexture)),Promise.all(h).then((function(){var r;return r=e===x?s[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(o):new e(o),a.name&&(r.name=a.name),r.map&&(r.map.encoding=3001),r.emissiveMap&&(r.emissiveMap.encoding=3001),W(r,a),i.associations.set(r,{type:"materials",index:t}),a.extensions&&V(s,r,a),r}))},Z.prototype.createUniqueName=function(t){for(var e=Ho.sanitizeNodeName(t||""),n=e,i=1;this.nodeNamesUsed[n];++i)n=e+"_"+i;return this.nodeNamesUsed[n]=!0,n},Z.prototype.loadGeometries=function(t){var e=this,i=this.extensions,r=this.primitiveCache;function s(t){return i[n.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(t,e).then((function(n){return J(n,t,e)}))}for(var a,o,l=[],h=0,c=t.length;h0&&q(u,s),u.name=n.createUniqueName(s.name||"mesh_"+t),W(u,s),p.extensions&&V(r,u,p),n.assignFinalMaterial(u),l.push(u)}if(1===l.length)return l[0];var m=new Qi;for(h=0,c=l.length;h1?new Qi:1===e.length?e[0]:new xt)!==e[0])for(var o=0,l=e.length;o{if(!e.ok)throw new Error(`Failed to load file "${t}" with status ${e.status} : ${e.statusText}`);return e.arrayBuffer()}).then(t=>this.parse(t))}parse(t){const e=new DataView(t),n=String.fromCharCode(e.getUint8(0))+String.fromCharCode(e.getUint8(1))+String.fromCharCode(e.getUint8(2))+String.fromCharCode(e.getUint8(3));console.assert("b3dm"===n);const i=e.getUint32(4,!0);console.assert(1===i);const r=e.getUint32(8,!0);console.assert(r===t.byteLength);const s=e.getUint32(12,!0),a=e.getUint32(16,!0),o=e.getUint32(20,!0),l=e.getUint32(24,!0),h=t.slice(28,28+s+a),c=new id(h,0,s,a),u=28+s+a,d=t.slice(u,u+o+l),p=new rd(d,c.getData("BATCH_LENGTH"),0,o,l),f=u+o+l;return{version:i,featureTable:c,batchTable:p,glbBytes:new Uint8Array(t,f,r-f)}}}{constructor(t=ya){super(),this.manager=t}parse(t){const e=super.parse(t),n=e.glbBytes.slice().buffer;return new Promise((t,i)=>{const r=this.manager;(r.getHandler("path.gltf")||new sd(r)).parse(n,null,n=>{const{batchTable:i,featureTable:r}=e,{scene:s}=n,a=r.getData("RTC_CENTER");a&&(s.position.x+=a[0],s.position.y+=a[1],s.position.z+=a[2]),n.batchTable=i,n.featureTable=r,s.batchTable=i,s.featureTable=r,t(n)},i)})}}class od extends class{constructor(){this.fetchOptions={}}load(t){return fetch(t,this.fetchOptions).then(e=>{if(!e.ok)throw new Error(`Failed to load file "${t}" with status ${e.status} : ${e.statusText}`);return e.arrayBuffer()}).then(t=>this.parse(t))}parse(t){const e=new DataView(t),n=String.fromCharCode(e.getUint8(0))+String.fromCharCode(e.getUint8(1))+String.fromCharCode(e.getUint8(2))+String.fromCharCode(e.getUint8(3));console.assert("pnts"===n);const i=e.getUint32(4,!0);console.assert(1===i);const r=e.getUint32(8,!0);console.assert(r===t.byteLength);const s=e.getUint32(12,!0),a=e.getUint32(16,!0),o=e.getUint32(20,!0),l=e.getUint32(24,!0),h=t.slice(28,28+s+a),c=new id(h,0,s,a),u=28+s+a,d=t.slice(u,u+o+l),p=new rd(d,c.getData("BATCH_LENGTH")||c.getData("POINTS_LENGTH"),0,o,l);return{version:i,featureTable:c,batchTable:p}}}{constructor(t=ya){super(),this.manager=t}parse(t){const e=super.parse(t),{featureTable:n}=e,i=n.getData("POINTS_LENGTH"),r=n.getData("POSITION",i,"FLOAT","VEC3"),s=n.getData("RGB",i,"UNSIGNED_BYTE","VEC3");if(null===r)throw new Error("PNTSLoader : POSITION_QUANTIZED feature type is not supported.");const a=new me;a.setAttribute("position",new Yt(r,3,!1));const o=new $r;o.size=2,o.sizeAttenuation=!1,null!==s&&(a.setAttribute("color",new Yt(s,3,!0)),o.vertexColors=!0);const l=new rs(a,o);return e.scene=l,e.scene.featureTable=n,e}}const ld=new _,hd=new x,cd=new _,ud=new Y;class dd extends class{constructor(){this.fetchOptions={},this.workingPath=""}resolveExternalURL(t){return this.workingPath+"/"+t}load(t){return fetch(t,this.fetchOptions).then(e=>{if(!e.ok)throw new Error(`Failed to load file "${t}" with status ${e.status} : ${e.statusText}`);return e.arrayBuffer()}).then(e=>{if(""===this.workingPath){const e=t.split(/\\\//g);e.pop(),this.workingPath=e.join("/")}return this.parse(e)})}parse(t){const e=new DataView(t),n=String.fromCharCode(e.getUint8(0))+String.fromCharCode(e.getUint8(1))+String.fromCharCode(e.getUint8(2))+String.fromCharCode(e.getUint8(3));console.assert("i3dm"===n);const i=e.getUint32(4,!0);console.assert(1===i);const r=e.getUint32(8,!0);console.assert(r===t.byteLength);const s=e.getUint32(12,!0),a=e.getUint32(16,!0),o=e.getUint32(20,!0),l=e.getUint32(24,!0),h=e.getUint32(28,!0),c=t.slice(32,32+s+a),u=new id(c,0,s,a),d=32+s+a,p=t.slice(d,d+o+l),f=new rd(p,u.getData("INSTANCES_LENGTH"),0,o,l),m=d+o+l,g=new Uint8Array(t,m,r-m);let v=null,y=null;if(h)v=g,y=Promise.resolve();else{const t=this.resolveExternalURL(nd(g));y=fetch(t,this.fetchOptions).then(e=>{if(!e.ok)throw new Error(`I3DMLoaderBase : Failed to load file "${t}" with status ${e.status} : ${e.statusText}`);return e.arrayBuffer()}).then(t=>{v=new Uint8Array(t)})}return y.then(()=>({version:i,featureTable:u,batchTable:f,glbBytes:v}))}}{constructor(t=ya){super(),this.manager=t}resolveExternalURL(t){return this.manager.resolveURL(super.resolveExternalURL(t))}parse(t){return super.parse(t).then(t=>{const{featureTable:e,batchTable:n}=t,i=t.glbBytes.slice().buffer;return new Promise((t,r)=>{const s=this.manager;(s.getHandler("path.gltf")||new sd(s)).parse(i,null,i=>{const r=e.getData("INSTANCES_LENGTH"),s=e.getData("POSITION",r,"FLOAT","VEC3"),a=new Map,o=[];i.scene.traverse(t=>{if(t.isMesh){const{geometry:e,material:n}=t,i=new Hr(e,n,r);o.push(i),a.set(t,i)}});const l=new _;for(let t=0;t{const n=e.parent;n&&(n.remove(e),n.add(t),t.position.copy(l))});for(let t=0;t{if(!e.ok)throw new Error(`Failed to load file "${t}" with status ${e.status} : ${e.statusText}`);return e.arrayBuffer()}).then(e=>{if(""===this.workingPath){const e=t.split(/\\\//g);e.pop(),this.workingPath=e.join("/")}return this.parse(e)})}parse(t){const e=new DataView(t),n=String.fromCharCode(e.getUint8(0))+String.fromCharCode(e.getUint8(1))+String.fromCharCode(e.getUint8(2))+String.fromCharCode(e.getUint8(3));console.assert("cmpt"===n);const i=e.getUint32(4,!0);console.assert(1===i);const r=e.getUint32(8,!0);console.assert(r===t.byteLength);const s=e.getUint32(12,!0),a=[];let o=16;for(let e=0;e{r.push(t),i.add(t.scene)});s.push(e);break}case"pnts":{const t=o.slice(),e=new od(n).parse(t.buffer);r.push(e),i.add(e.scene);break}case"i3dm":{const t=o.slice(),e=new dd(n);e.workingPath=this.workingPath,e.fetchOptions=this.fetchOptions;const a=e.parse(t.buffer).then(t=>{r.push(t),i.add(t.scene)});s.push(a);break}}}return Promise.all(s).then(()=>({tiles:r,scene:i}))}}const fd=new Y;class md extends Qi{constructor(t){super(),this.tilesRenderer=t}raycast(t,e){this.tilesRenderer.raycast(t,e)}updateMatrixWorld(t){if(this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldNeedsUpdate||t){null===this.parent?fd.copy(this.matrix):fd.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1;const t=fd.elements,e=this.matrixWorld.elements;let n=!1;for(let i=0;i<16;i++){const r=t[i],s=e[i];if(Math.abs(r-s)>Number.EPSILON){n=!0;break}}if(n){this.matrixWorld.copy(fd);const t=this.children;for(let e=0,n=t.length;e{Object.getPrototypeOf(t).raycast.call(t,e,n)})}const Sd=Symbol("INITIAL_FRUSTUM_CULLED"),Ed=h.DEG2RAD,Td=new Y,Ld=new Y,Ad=new _,Cd=new _,Pd=new _,Rd=new _,Od=new _(1,0,0),Id=new _(0,1,0);function Dd(){}function Nd(t,e){t.traverse(t=>{t.frustumCulled=t[Sd]&&e})}class zd extends class{get rootTileSet(){const t=this.tileSets[this.rootURL];return!t||t instanceof Promise?null:t}get root(){const t=this.rootTileSet;return t?t.root:null}constructor(t){this.tileSets={},this.rootURL=t,this.fetchOptions={},this.preprocessURL=null;const e=new Xu;e.unloadPriorityCallback=ed;const n=new Yu;n.maxJobs=4,n.priorityCallback=ed;const i=new Yu;i.maxJobs=1,i.priorityCallback=ed,this.lruCache=e,this.downloadQueue=n,this.parseQueue=i,this.stats={parsing:0,downloading:0,failed:0,inFrustum:0,used:0,active:0,visible:0},this.frameCount=0,this.errorTarget=6,this.errorThreshold=1/0,this.loadSiblings=!0,this.displayActiveTiles=!1,this.maxDepth=1/0,this.stopAtEmptyTiles=!0}traverse(t,e){const n=this.tileSets[this.rootURL];n&&n.root&&td(n.root,t,e)}update(){const t=this.stats,e=this.lruCache,n=this.tileSets,i=n[this.rootURL];if(!(this.rootURL in n))return void this.loadRootTileSet(this.rootURL);if(!i||!i.root)return;const r=i.root;t.inFrustum=0,t.used=0,t.active=0,t.visible=0,this.frameCount++,function t(e,n){const i=n.stats,r=n.frameCount,s=n.errorTarget,a=n.maxDepth,o=n.loadSiblings,l=n.lruCache,h=n.stopAtEmptyTiles;if(Ku(e,r),!1===n.tileInView(e))return!1;if(e.__used=!0,l.markUsed(e),e.__inFrustum=!0,i.inFrustum++,(h||!e.__contentEmpty)&&!e.__externalTileSet){const t=n.calculateError(e);if(e.__error=t,t<=s)return!0;if(n.maxDepth>0&&e.__depth+1>=a)return!0}let c=!1;const u=e.children;for(let e=0,i=u.length;e{if(e.ok)return e.json();throw new Error(`TilesRenderer: Failed to load tileset "${t}" with status ${e.status} : ${e.statusText}`)}).then(e=>{const i=e.asset.version;console.assert("1.0"===i||"0.0"===i,'asset.version is expected to be a string of "1.0" or "0.0"');const r=qu.a.dirname(t);return td(e.root,(t,e)=>this.preprocessNode(t,e,r),null,n,n?n.__depth:0),e})}loadRootTileSet(t){const e=this.tileSets;if(t in e)return e[t]instanceof Error?Promise.reject(e[t]):Promise.resolve(e[t]);{const n=this.fetchTileSet(t,this.fetchOptions).then(n=>{e[t]=n});return n.catch(n=>{console.error(n),e[t]=n}),e[t]=n,n}}requestTileContents(t){if(0!==t.__loadingState)return;const e=this.stats,n=this.lruCache,i=this.downloadQueue,r=this.parseQueue,s=t.__externalTileSet;n.add(t,t=>{1===t.__loadingState?(t.__loadAbort.abort(),t.__loadAbort=null):s?t.children.length=0:this.disposeTile(t),1===t.__loadingState?e.downloading--:2===t.__loadingState&&e.parsing--,t.__loadingState=0,t.__loadIndex++,r.remove(t),i.remove(t)}),t.__loadIndex++;const a=t.__loadIndex,o=new AbortController,l=o.signal;e.downloading++,t.__loadAbort=o,t.__loadingState=1;const h=s=>{t.__loadIndex===a&&("AbortError"!==s.name?(r.remove(t),i.remove(t),2===t.__loadingState?e.parsing--:1===t.__loadingState&&e.downloading--,e.failed++,console.error(`TilesRenderer : Failed to load tile at url "${t.content.uri}".`),console.error(s),t.__loadingState=4):n.remove(t))};s?i.add(t,t=>{if(t.__loadIndex!==a)return Promise.resolve();const e=this.preprocessURL?this.preprocessURL(t.content.uri):t.content.uri;return this.fetchTileSet(e,Object.assign({signal:l},this.fetchOptions),t)}).then(n=>{t.__loadIndex===a&&(e.downloading--,t.__loadAbort=null,t.__loadingState=3,t.children.push(n.root))}).catch(h):i.add(t,t=>{if(t.__loadIndex!==a)return Promise.resolve();const e=this.preprocessURL?this.preprocessURL(t.content.uri):t.content.uri;return fetch(e,Object.assign({signal:l},this.fetchOptions))}).then(e=>{if(t.__loadIndex===a){if(e.ok)return e.arrayBuffer();throw new Error("Failed to load model with error code "+e.status)}}).then(n=>{if(t.__loadIndex===a)return e.downloading--,e.parsing++,t.__loadAbort=null,t.__loadingState=2,r.add(t,t=>{if(t.__loadIndex!==a)return Promise.resolve();const e=t.content.uri.split(/\./g).pop();return this.parseTile(n,t,e)})}).then(()=>{t.__loadIndex===a&&(e.parsing--,t.__loadingState=3,t.__wasSetVisible&&this.setTileVisible(t,!0),t.__wasSetActive&&this.setTileActive(t,!0))}).catch(h)}dispose(){const t=this.lruCache;this.traverse(e=>{t.remove(e)})}}{get autoDisableRendererCulling(){return this._autoDisableRendererCulling}set autoDisableRendererCulling(t){this._autoDisableRendererCulling!==t&&(super._autoDisableRendererCulling=t,this.traverse(e=>{e.scene&&Nd(e.scene,t)}))}constructor(...t){super(...t),this.group=new md(this),this.cameras=[],this.cameraMap=new Map,this.cameraInfo=[],this.activeTiles=new Set,this.visibleTiles=new Set,this._autoDisableRendererCulling=!0,this.onLoadTileSet=null,this.onLoadModel=null,this.onDisposeModel=null;const e=new va;e.setURLModifier(t=>this.preprocessURL?this.preprocessURL(t):t),this.manager=e}getBounds(t){if(!this.root)return!1;const e=this.root.cached,n=e.box,i=e.boxTransform;return!!n&&(t.copy(n),t.applyMatrix4(i),!0)}getOrientedBounds(t,e){if(!this.root)return!1;const n=this.root.cached,i=n.box,r=n.boxTransform;return!!t&&(t.copy(i),e.copy(r),!0)}forEachLoadedModel(t){this.traverse(e=>{const n=e.cached.scene;n&&t(n,e)})}raycast(t,e){if(this.root)if(t.firstHitOnly){const n=function t(e,n,i,r){if(i.has(e)){if(wd(e.cached.scene,r,bd),bd.length>0){bd.length>1&&bd.sort(Md);const t=bd[0];return bd.length=0,t}return null}const s=[],a=e.children;for(let t=0,e=a.length;t1e-6&&console.warn("ThreeTilesRenderer : Non uniform scale used for tile which may cause issues when raycasting.");let n={distance:1/0,tile:null};s.push(n),n.distance=yd.distanceToSquared(_d.origin)*t*t,n.tile=e}}}s.sort(Md);let o=1/0,l=null;for(let e=0,a=s.length;eo)break;{const e=a.tile,s=e.cached.scene;let h=null;if(i.has(e)?(wd(s,r,bd),bd.length>0&&(bd.length>1&&bd.sort(Md),h=bd[0])):h=t(e,n,i,r),h){const t=h.distance*h.distance;t{this.onLoadTileSet&&Promise.resolve().then(()=>{this.onLoadTileSet(e,t)})}),n}update(){const t=this.group,e=this.cameras,n=this.cameraMap,i=this.cameraInfo;if(0===e.length)return void console.warn("TilesRenderer: no cameras defined. Cannot update 3d tiles.");for(;i.length>e.length;)i.pop();for(;i.length1e-6&&console.warn("ThreeTilesRenderer : Non uniform scale used for tile which may cause issues when calculating screen space error.");for(let s=0,a=i.length;st.scene);break;case"pnts":l=Promise.resolve(new od(a).parse(t).scene);break;case"i3dm":{const e=new dd(a);e.workingPath=r,e.fetchOptions=s,l=e.parse(t).then(t=>t.scene);break}case"cmpt":{const e=new pd(a);e.workingPath=r,e.fetchOptions=s,l=e.parse(t).then(t=>t.scene);break}default:console.warn(`TilesRenderer: Content type "${n}" not supported.`),l=Promise.resolve(null)}return l.then(t=>{if(e._loadIndex!==o)return;const n=this.rootTileSet.asset&&this.rootTileSet.asset.gltfUpAxis||"y",i=e.cached,r=i.transform;switch(n.toLowerCase()){case"x":t.matrix.makeRotationAxis(Id,-Math.PI/2);break;case"y":t.matrix.makeRotationAxis(Od,Math.PI/2)}t.matrix.premultiply(r),t.matrix.decompose(t.position,t.quaternion,t.scale),t.traverse(t=>{t[Sd]=t.frustumCulled}),Nd(t,this.autoDisableRendererCulling),i.scene=t,t.traverse(t=>{t.raycast=Dd});const s=[],a=[],l=[];t.traverse(t=>{if(t.geometry&&a.push(t.geometry),t.material){const e=t.material;s.push(t.material);for(const t in e){const n=e[t];n&&n.isTexture&&l.push(n)}}}),i.materials=s,i.geometry=a,i.textures=l,this.onLoadModel&&this.onLoadModel(t,e)})}disposeTile(t){const e=t.cached;if(e.scene){const n=e.materials,i=e.geometry,r=e.textures;for(let t=0,e=i.length;t=t.minZoom&&e.p.p.zoom<=t.maxZoom&&e.p.p._.tiledWorld.removeAllTiles(),e.p.p._.maxZoom=e.p.findHighestMaxZoom(),e.p.p._.minNativeZoom=e.p.findLowestMinZoom()}else console.warn("Attempted to add an invalid tile layer.")}},this.toggle=function(t,n){if(!e.p.p._.wasInitialized)return!1;var i=!1;return e.p.tile.forEach((function(e){t===e.name&&(e.on=null!=n?n:!e.on,i=!0)})),!!i&&(e.p.p._.tiledWorld.outdateAllTiles(),e.p.p._.maxZoom=e.p.findHighestMaxZoom(),e.p.p._.minNativeZoom=e.p.findLowestMinZoom(),!0)},this.setOpacity=function(t,n){if(!e.p.p._.wasInitialized)return!1;for(var i=0;i=e.p.tile[n].minZoom&&e.p.p.zoom<=e.p.tile[n].maxZoom)for(var i=e.p.p._.tiledWorld.tilesDrawn.length,r=0;r=t.minZoom&&e.p.p.zoom<=t.maxZoom&&e.p.p._.tiledWorld.updateAllRasters(),"function"==typeof n&&n()};if(e.p.p._.tiledWorld.killDrawingTiles(),t.hasOwnProperty("name")&&t.hasOwnProperty("on")&&(!0===t.preDrawn&&t.hasOwnProperty("data")||(t.hasOwnProperty("geojsonPath")||t.hasOwnProperty("geojson"))&&t.hasOwnProperty("minZoom")&&t.hasOwnProperty("maxZoom")))if(t.hasOwnProperty("geojsonPath")&&!t.hasOwnProperty("geojson")){t.hasOwnProperty("opacity")||(t.opacity=1);var s=new XMLHttpRequest;s.open("GET",t.geojsonPath,!0),s.responseType="json",s.withCredentials=!0===t.withCredentials||!1,s.onload=function(){404!==s.status&&s.response?(t.geojson=s.response,r()):console.warn("Failed to fetch geojson data for clamped layer: "+t.name)},s.send()}else r();else console.warn("Attempted to add an invalid clamped layer: "+t.name)}},this.toggle=function(t,n){if(!e.p.p._.wasInitialized)return!1;var i=!1;return e.p.clamped.forEach((function(e){t===e.name&&(e.on=null!=n?n:!e.on,i=!0)})),!!i&&(e.p.p._.tiledWorld.updateAllRasters(),!0)},this.setOpacity=function(t,n){if(!e.p.p._.wasInitialized)return!1;for(var i=function(i){var r=e.p.clamped[i];if(t===r.name)return clearTimeout(Hd),Hd=setTimeout((function(){r.opacity=Math.max(Math.min(n,1),0),e.p.p.zoom>=r.minZoom&&e.p.p.zoom<=r.maxZoom&&(e.p.p._.tiledWorld.killDrawingTiles(),e.p.p._.tiledWorld.updateAllRasters())}),250),{value:!0}},r=0;r=i&&e.p.p.zoom<=r&&(e.p.p._.tiledWorld.killDrawingTiles(),e.p.p._.tiledWorld.updateAllRasters()),e.p.clamped.splice(n,1),!0}return!1},this.getClampedTexture=function(t,n){var i=.5,r=e.p.clamped[t],s=document.createElement("canvas");s.id="vectorsastile",s.width=256/i,i*=Math.pow(2,e.p.p.zoom-n.z),s.height=s.width;var a,o,l=s.getContext("2d"),h=[];if(i<128)if(r.preDrawn)l.imageSmoothingEnabled=!1,r.data&&r.data[n.z]&&r.data[n.z][n.x]&&null!=r.data[n.z][n.x][n.y]&&l.drawImage(r.data[n.z][n.x][n.y],0,0,s.width,s.height);else for(var c=0,u=r.geojson.features;c=0&&M=0&&w=0&&M=0&&w=0&&M=0&&w=0&&M=0&&w=0&&M=0&&w\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float dashOffset;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include \n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include \n\t\t\t#include \n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\n\t\t}\n\t\t"};var Wd=function(t){Be.call(this,{type:"LineMaterial",uniforms:Fe.clone(tn.line.uniforms),vertexShader:tn.line.vertexShader,fragmentShader:tn.line.fragmentShader,clipping:!0}),this.dashed=!1,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}}}),this.setValues(t)};(Wd.prototype=Object.create(Be.prototype)).constructor=Wd,Wd.prototype.isLineMaterial=!0;var qd,Xd,Yd=function(t,e){void 0===t&&(t=new Gd),void 0===e&&(e=new Wd({color:16777215*Math.random()})),Ie.call(this,t,e),this.type="LineSegments2"};Yd.prototype=Object.assign(Object.create(Ie.prototype),{constructor:Yd,isLineSegments2:!0,computeLineDistances:(qd=new _,Xd=new _,function(){for(var t=this.geometry,e=t.attributes.instanceStart,n=t.attributes.instanceEnd,i=new Float32Array(2*e.data.count),r=0,s=0,a=e.data.count;rb&&e.z>b)){if(t.z>b){const n=t.z-e.z,i=(t.z-b)/n;t.lerp(e,i)}else if(e.z>b){const n=e.z-t.z,i=(e.z-b)/n;e.lerp(t,i)}t.applyMatrix4(p),e.applyMatrix4(p),t.multiplyScalar(1/t.w),e.multiplyScalar(1/e.w),t.x*=g.x/2,t.y*=g.y/2,e.x*=g.x/2,e.y*=g.y/2,s.start.copy(t),s.start.z=0,s.end.copy(e),s.end.z=0;var E=s.closestPointToPointParameter(i,!0);s.at(E,a);var T=h.lerp(t.z,e.z,E),L=T>=-1&&T<=1,A=i.distanceTo(a)<.5*v;if(L&&A){s.start.fromBufferAttribute(y,w),s.end.fromBufferAttribute(x,w),s.start.applyMatrix4(M),s.end.applyMatrix4(M);var C=new _,P=new _;u.distanceSqToSegment(s.start,s.end,P,C),l.push({point:P,pointOnLine:C,distance:u.origin.distanceTo(P),object:this,face:null,faceIndex:w,uv:null,uv2:null})}}}}}()});var Zd=function(t,e){void 0===t&&(t=new Vd),void 0===e&&(e=new Wd({color:16777215*Math.random()})),Yd.call(this,t,e),this.type="Line2"};Zd.prototype=Object.assign(Object.create(Yd.prototype),{constructor:Zd,isLine2:!0});var Jd={spriteMaterials:{},makeMarkerSprite:function(t,e,n){var i=new Mr(Jd.makeMarkerMaterial(t,e,n));return i.style=i.style||{},i.style.radius=t.hasOwnProperty("radius")?t.radius:32,i},makeMarkerMaterial:function(t,e,n){if(e&&this.spriteMaterials.hasOwnProperty(e)&&!0!==n)return this.spriteMaterials[e];void 0===t&&(t={});var i=t.hasOwnProperty("radius")?t.radius:64;i=Math.max(i,64);var r=t.hasOwnProperty("fillColor")?t.fillColor:{r:255,g:255,b:255,a:null!=t.fillOpacity?t.fillOpacity:1},s=t.hasOwnProperty("weight")?t.weight:4,a=t.hasOwnProperty("color")?t.color:{r:0,g:0,b:0,a:1},o=document.createElement("canvas"),l=o.getContext("2d"),h=2*i,c=2*i;o.width=h,o.height=c,l.beginPath(),l.arc(o.width/2,o.height/2,i-s*(i/12),0,2*Math.PI,!1),l.fillStyle="object"==typeof r?"rgba("+r.r+","+r.g+","+r.b+","+r.a+")":r,l.fill(),l.lineWidth=s*(i/8),l.strokeStyle="object"==typeof a?"rgba("+a.r+","+a.g+","+a.b+","+a.a+")":a,l.stroke();var u=new m(o);u.needsUpdate=!0;var d=new lr({map:u,transparent:!0,alphaTest:.01});return e&&!0!==n&&(this.spriteMaterials[e]=d),d},makeTextSprite:function(t,e){void 0===e&&(e={});var n=e.hasOwnProperty("fontface")?e.fontface:"Arial",i=e.hasOwnProperty("fontsize")?e.fontsize:18,r=e.hasOwnProperty("strokeWeight")?e.strokeWeight:4,s=e.hasOwnProperty("strokeColor")?e.strokeColor:{r:0,g:0,b:0,a:1},a=e.hasOwnProperty("fontColor")?e.fontColor:{r:255,g:255,b:255,a:1},o=document.createElement("canvas"),l=o.getContext("2d");o.width=1024,o.height=64,l.font="Bold "+i+"px "+n;l.measureText(t).width;l.strokeStyle="rgba("+s.r+","+s.g+","+s.b+","+s.a+")",l.lineWidth=r,l.fillStyle="rgba("+a.r+","+a.g+","+a.b+","+a.a+")",l.textAlign="left",l.strokeText(t,512+i,64-i/1.8),l.fillText(t,512+i,64-i/1.8);var h=new m(o);h.needsUpdate=!0;var c=new Mr(new lr({map:h}));return c.scale.set(64,4,1),c}},Kd=Jd,Qd=function(t){var e=this;this.add=function(t,n){if(e.p.p._.wasInitialized){var i=!1,r=function(){for(var r=0;rt&&(t=e.tile[n].maxZoom);return t},this.findLowestMinZoom=function(){var t=1/0;for(var n in e.tile)e.tile[n].on&&e.tile[n].minZoom","
N
","","","","","","","","","
",""].join("")},this.attachEvents=function(){document.getElementById("_lithosphere_control_compass_azimuth").addEventListener("mouseenter",(function(t){t.target.style.opacity="1"})),document.getElementById("_lithosphere_control_compass_azimuth").addEventListener("mouseleave",(function(t){t.target.style.opacity="0"}))},this.onUpdate=function(){n.setDirection()},this.setDirection=function(){var t,e,i,r=n.p._.cameras.isFirstPerson?n.p._.cameras.firstPerson:n.p._.cameras.orbit;if(null!=r){if(n.p._.cameras.isFirstPerson)e=-(r.controls.getObject().rotation.y%(2*Math.PI)+Math.PI)*(180/Math.PI);else{var s=r.camera.position.x,a=r.camera.position.z;e=Math.atan2(s,a)*(180/Math.PI)}i=r.camera.fov}t=function(t,e,n,i,r){var s=ep(t,e,n,r),a=ep(t,e,n,i),o=r-i<=180?"0":"1";return["M",s.x,s.y,"A",n,n,0,o,0,a.x,a.y,"L",t,e].join(" ")}(20,20,20,e-i/2,e+i/2),document.getElementById("_lithosphere_control_compass_arc").setAttribute("d",t),e<0&&(e+=360),document.getElementById("_lithosphere_control_compass_azimuth").innerHTML=parseInt(e)+" °"},this.p=t,this.name=e,this._={},this.corner="BottomLeft"};function ep(t,e,n,i){var r=(i-90)*Math.PI/180;return{x:t+n*Math.cos(r),y:e+n*Math.sin(r)}}var np=function(t,e,n){var i=this;this.getControl=function(){var t=(null!=i.params.existingDivId?"display: none; ":"")+"background: black; padding: 5px; font-size: 14px;";return["
","
"].join("")},this.attachEvents=function(){},this.onUpdate=function(){(i.p._.mouseIsInScene||i.p._.cameras.isFirstPerson)&&i.updateMouseCoords()},this.updateMouseCoords=function(){var t="Outer Space";null!=i.p.mouse.lat&&null!=i.p.mouse.lng&&(t=i.p.mouse.lng.toFixed(8)+"°, "+i.p.mouse.lat.toFixed(8)+"°, "+i.p.mouse.elev.toFixed(3)+"m");var e=document.getElementById("_lithosphere_control_coordinate_root");if(e&&e.innerHTML!=t&&(e.innerHTML=t),null!=i.params.existingDivId){var n=document.getElementById(i.params.existingDivId);n&&n.innerHTML!=t&&(n.innerHTML=t)}},this.p=t,this.name=e,this.params=n||{},this._={},this.corner="BottomRight"},ip=function(t,e){var n=this;this.getControl=function(){return["
",'','',"","
"].join("")},this.attachEvents=function(){document.getElementById("_lithosphere_control_home_root").addEventListener("click",(function(){n.p.setCenter(n.p.options.initialView,null,!0)}))},this.p=t,this.name=e,this._={},this.corner="TopLeft"},rp=function(t,e){var n=this;this.getControl=function(){return["
",'
',n.getInactiveContent(),"
","",n.getActiveContent(),"","
"].join("")},this.attachEvents=function(){document.getElementById(n.id).addEventListener("mouseenter",(function(){document.getElementById(n.id+"_active").innerHTML=n.getActiveContent(),n.attachEventsInternal(),document.getElementById(n.id+"_active").style.pointerEvents="all",document.getElementById(n.id+"_active").style.opacity="1"})),document.getElementById(n.id+"_active").addEventListener("mouseleave",(function(){document.getElementById(n.id+"_active").style.pointerEvents="none",document.getElementById(n.id+"_active").style.opacity="0"}))},this.getInactiveContent=function(){return['','',""].join("")},this.getActiveContent=function(){var t=[];for(var e in n.p.layers.all)if(n.p.layers.all[e].length>0){for(var i=[],r=0,s=n.p.layers.all[e];r','
','',''+a.name+"","
",'
','',"
",""].join(""))}t.push(['
','
'+e+"
",'
    ',i.join(""),"
","
"].join(""))}return['
',t.join(""),"
"].join("")},this.attachEventsInternal=function(){for(var t=function(t){t.addEventListener("click",(function(e){n.p.toggleLayer(t.getAttribute("layer-name"))}))},e=0,i=document.getElementsByClassName(n.id+"_toggle");e",n.getInactiveContent(),"",n.getActiveContent(),"",""].join("")},this.attachEvents=function(){document.getElementById(n.id).addEventListener("mouseenter",(function(){document.getElementById(n.id+"_active").style.pointerEvents="all",document.getElementById(n.id+"_active").style.opacity="1"})),document.getElementById(n.id+"_active").addEventListener("mouseleave",(function(){document.getElementById(n.id+"_active").style.pointerEvents="none",document.getElementById(n.id+"_active").style.opacity="0"}));for(var t=document.getElementsByClassName(n.id+"_option"),e=function(e){t[e].addEventListener("click",(function(){for(var i=parseFloat(t[e].getAttribute("value")),r=0;r','','',"",""].join("")},this.getActiveContent=function(){return['
',n.getInactiveContent(),'
','
1x
','
2x
','
5x
',"
","
"].join("")},this.setExaggeration=function(t){n.p.options.exaggeration=t,n.p._.tiledWorld.removeAllTiles()},this.id="_lithosphere_control_exaggerate_root",this.p=t,this.name=e,this._={},this.corner="TopLeft",this.exaggeration=1},ap=function(t,e){var n=this;this.getControl=function(){return["
",n.getInactiveContent(),"",n.getActiveContent(),"","
"].join("")},this.getInactiveContent=function(){return["
",'','',"","
"].join("")},this.getActiveContent=function(){var t=n.p.getCenter();return['
',n.getInactiveContent(),'
',"
","
    ","
  • ","
    Field of View
    ","","
    °
    ","","
  • ","
  • ","
    Vertical FOV
    ","","
    °
    ","
  • ","
  • ","
    Focal Length
    ","","
    m
    m
    ","
  • ","
  • ","
    Azimuth
    ","","
    °
    ","
  • ","
  • ","
    Elevation
    ","","
    °
    ","
  • ","
  • ","
    Height
    ","","
    m
    ","
  • ","
  • ","
    Latitude
    ","","
    °
    ","
  • ","
  • ","
    Longitude
    ","","
    °
    ","
  • ","
","
","","
Observe
","
","
","
","
"].join("")},this.attachEvents=function(){document.getElementById(n.id).addEventListener("mouseenter",(function(){document.getElementById(n.id+"_active").style.pointerEvents="all",document.getElementById(n.id+"_active").style.opacity="1"})),document.getElementById(n.id+"_active").addEventListener("mouseleave",(function(){document.getElementById(n.id+"_active").style.pointerEvents="none",document.getElementById(n.id+"_active").style.opacity="0"})),document.getElementById("_lithosphere_WalkStand").addEventListener("click",(function(){n.setCamera(!0),n.toggleFOVOverlay(!0);var t=n.getObserverValues();n.updateFOVOverlayBounds(t.vfieldofview,t.elevation,t.fieldofview,t.azimuth),document.addEventListener("keydown",n.keydownObserverSettings);try{n.p.controls.controlContainer.removeChild(n.helpDiv)}catch(t){}var e=["
W
Up
","
A
Left
","
S
Down
","
D
Right
","
R
Higher
","
F
Lower
","
T
FOV +
","
G
FOV -
","
Y
vFOV +
","
H
vFOV -
","
SHIFT+
Fast
","
ESC
Quit
"].join("\n");n.helpDiv=document.createElement("div"),n.helpDiv.id="_lithosphere_control_walk_help",n.helpDiv.style="position: absolute; bottom: 47px; right: 15px; background: black; font-size: 13px;",n.helpDiv.innerHTML=e,n.p.controls.controlContainer.appendChild(n.helpDiv)}))},this.setCamera=function(t,e){var i=n.getObserverValues();n.p.setCenter({lat:i.latitude,lng:i.longitude,zoom:n.p.zoom},!0),n.p._.cameras.setFirstPersonHeight(i.height),n.p._.cameras.setCameraAzimuthElevation(i.azimuth,i.elevation,!0),n.p._.cameras.setFirstPersonFocalLength(i.focallength),n.p._.cameras.setFirstPersonFOV(Math.max(i.vfieldofview,60)),n.p._.cameras.swap(t,e),"onpointerlockchange"in document?document.addEventListener("pointerlockchange",n.leaveObserver,!1):"onmozpointerlockchange"in document&&document.addEventListener("mozpointerlockchange",n.leaveObserver,!1)},this.leaveObserver=function(){if(document.pointerLockElement===document.body||document.mozPointerLockElement===document.body);else try{n.p.controls.controlContainer.removeChild(n.helpDiv),n.toggleFOVOverlay(!1),document.removeEventListener("keydown",n.keydownObserverSettings)}catch(t){}},this.getObserverValues=function(){return{fieldofview:parseFloat(document.getElementById("_lithosphere_WalkSettingsFovValue").value)||60,fieldofviewRaw:parseFloat(document.getElementById("_lithosphere_WalkSettingsFovValueRaw").value)||60,vfieldofview:parseFloat(document.getElementById("_lithosphere_WalkSettingsVerticalFovValue").value)||60,focallength:parseFloat(document.getElementById("_lithosphere_WalkSettingsFocalLengthValue").value)||35,azimuth:parseFloat(document.getElementById("_lithosphere_WalkSettingsAzimuthValue").value)||0,elevation:parseFloat(document.getElementById("_lithosphere_WalkSettingsElevationValue").value)||0,height:parseFloat(document.getElementById("_lithosphere_WalkSettingsHeightValue").value)||3,latitude:parseFloat(document.getElementById("_lithosphere_WalkSettingsLatitudeValue").value)||n.p.getCenter().lat||0,longitude:parseFloat(document.getElementById("_lithosphere_WalkSettingsLongitudeValue").value)||n.p.getCenter().lon||0}},this.keydownObserverSettings=function(t){var e=n.getObserverValues();84===t.which?document.getElementById("_lithosphere_WalkSettingsFovValue").value=+(e.fieldofview+(t.shiftKey?1:.2)).toFixed(4):71===t.which?document.getElementById("_lithosphere_WalkSettingsFovValue").value=+(e.fieldofview-(t.shiftKey?1:.2)).toFixed(4):89===t.which?document.getElementById("_lithosphere_WalkSettingsVerticalFovValue").value=+(e.vfieldofview+(t.shiftKey?1:.2)).toFixed(4):72===t.which?document.getElementById("_lithosphere_WalkSettingsVerticalFovValue").value=+(e.vfieldofview-(t.shiftKey?1:.2)).toFixed(4):68===t.which?document.getElementById("_lithosphere_WalkSettingsAzimuthValue").value=+(e.azimuth+(t.shiftKey?1:.2)).toFixed(4):65===t.which?document.getElementById("_lithosphere_WalkSettingsAzimuthValue").value=+(e.azimuth-(t.shiftKey?1:.2)).toFixed(4):87===t.which?document.getElementById("_lithosphere_WalkSettingsElevationValue").value=+(e.elevation+(t.shiftKey?1:.2)).toFixed(4):83===t.which?document.getElementById("_lithosphere_WalkSettingsElevationValue").value=+(e.elevation-(t.shiftKey?1:.2)).toFixed(4):82===t.which?document.getElementById("_lithosphere_WalkSettingsHeightValue").value=+(e.height+(t.shiftKey?1:.2)).toFixed(4):70===t.which&&(document.getElementById("_lithosphere_WalkSettingsHeightValue").value=+(e.height-(t.shiftKey?1:.2)).toFixed(4));var i=n.getObserverValues();n.p._.cameras.setFirstPersonHeight(i.height),n.p._.cameras.setCameraAzimuthElevation(i.azimuth,i.elevation,!0),i.vfieldofview!==e.vfieldofview?(n.p._.cameras.setFirstPersonFOV(Math.max(i.vfieldofview,60)),document.getElementById("_lithosphere_WalkSettingsFocalLengthValue").value=+n.p._.cameras.getFirstPersonFocalLength().toFixed(4)):i.focallength!==e.focallength&&(n.p._.cameras.setFirstPersonFocalLength(i.focallength),document.getElementById("_lithosphere_WalkSettingsFovValue").value=+n.p._.cameras.getFirstPersonFOV().toFixed(4)),n.updateFOVOverlayBounds(i.vfieldofview,i.elevation,i.fieldofview,i.azimuth)},this.toggleFOVOverlay=function(t){var e=document.getElementById("_lithosphere_WalkFOVOverlay");if(t){if(null==e){var i=document.createElement("div");i.id="_lithosphere_WalkFOVOverlay",i.style=["position: absolute","left: 0","top: 0","width: 100%","height: 100%","pointer-events: none"].join(";"),i.innerHTML=["
","
","
","
","
","
","
","
"].join("\n"),n.p.getContainer().appendChild(i)}}else null!=e&&n.p.getContainer().removeChild(e)},this.updateFOVOverlayBounds=function(t,e,i,r){t=document.getElementById("_lithosphere_WalkSettingsVerticalFovValue").value;var s=n.p._.cameras.getFirstPersonFOV(),a=(n.p._.cameras.getFirstPersonAspect(),n.p.getContainer().getBoundingClientRect()),o=a.height*(t/s),l=(a.height/2-o/2)/a.height*100,h=(a.height/2+o/2)/a.height*100,c=a.height/s*i,u=(a.width/2-c/2)/a.width*100,d=(a.width/2+c/2)/a.width*100,p=document.getElementById("_lithosphere_Walk_NW");p.style.top="0%",p.style.height=l+"%",p.style.left="0%",p.style.width=u+"%";var f=document.getElementById("_lithosphere_Walk_N");f.style.top="0%",f.style.height=l+"%",f.style.left=u+"%",f.style.width=d-u+"%";var m=document.getElementById("_lithosphere_Walk_NE");m.style.top="0%",m.style.height=l+"%",m.style.left=d+"%",m.style.width=100-d+"%";var g=document.getElementById("_lithosphere_Walk_E");g.style.top=l+"%",g.style.height=h-l+"%",g.style.left=d+"%",g.style.width=100-d+"%";var v=document.getElementById("_lithosphere_Walk_SE");v.style.top=h+"%",v.style.height=100-h+"%",v.style.left=d+"%",v.style.width=100-d+"%";var y=document.getElementById("_lithosphere_Walk_S");y.style.top=h+"%",y.style.height=100-h+"%",y.style.left=u+"%",y.style.width=d-u+"%";var x=document.getElementById("_lithosphere_Walk_SW");x.style.top=h+"%",x.style.height=100-h+"%",x.style.left="0%",x.style.width=u+"%";var _=document.getElementById("_lithosphere_Walk_W");_.style.top=l+"%",_.style.height=h-l+"%",_.style.left="0%",_.style.width=u+"%"},this.p=t,this.name=e,this.id="_lithosphere_control_observe_root",this._={},this.corner="TopLeft"},op=function(t,e){var n=this;this.getControl=function(){return["
",'','',"","
"].join("")},this.attachEvents=function(){document.getElementById("_lithosphere_control_walk_root").addEventListener("click",(function(){n.setCamera(!1);try{n.p.controls.controlContainer.removeChild(n.helpDiv)}catch(t){}var t=["
W
Forward
","
A
Left
","
S
Back
","
D
Right
","
SHIFT+
Fast
","
ESC
Quit
"].join("\n");n.helpDiv=document.createElement("div"),n.helpDiv.id="_lithosphere_control_walk_help",n.helpDiv.style="position: absolute; bottom: 47px; right: 15px; background: black; font-size: 13px;",n.helpDiv.innerHTML=t,n.p.controls.controlContainer.appendChild(n.helpDiv)}))},this.setCamera=function(t,e){n.p._.cameras.swap(t,e),"onpointerlockchange"in document?document.addEventListener("pointerlockchange",n.leaveWalking,!1):"onmozpointerlockchange"in document&&document.addEventListener("mozpointerlockchange",n.leaveWalking,!1)},this.leaveWalking=function(){if(document.pointerLockElement===document.body||document.mozPointerLockElement===document.body);else try{n.p.controls.controlContainer.removeChild(n.helpDiv)}catch(t){}},this.p=t,this.name=e,this.helpDiv=null,this._={},this.corner="TopLeft"},lp=function(t,e,n){var i=this;this.getControl=function(){return[""].join("")},this.attachEvents=function(){document.getElementById("_lithosphere_control_link_root").addEventListener("click",(function(){i.return.isLinked=!i.return.isLinked;var t=document.getElementById("_lithosphere_control_link_root");i.return.isLinked?(t.style.background="#FBC02D",t.style.color="black"):(t.style.background="black",t.style.color="white"),"function"==typeof i.params.onToggle&&i.params.onToggle(i.return.isLinked)}))},this.getReturn=function(){return i.return},this.onMove=function(t,e,n){i.return.isLinked&&"function"==typeof i.params.onMove&&(i._.linkPanned=!0,i.params.onMove(t,e,n),clearTimeout(i._.linkPannedTimeout),i._.linkPannedTimeout=setTimeout((function(){i._.linkPanned=!1}),500))},this.onMouseMove=function(t,e,n){i.return.isLinked&&"function"==typeof i.params.onMouseMove&&i.params.onMouseMove(t,e,n)},this.onMouseOut=function(){i.return.isLinked&&"function"==typeof i.params.onMouseOut&&i.params.onMouseOut()},this.onFirstPersonUpdate=function(){"function"==typeof i.params.onFirstPersonUpdate&&i.params.onFirstPersonUpdate()},this.onOrbitalUpdate=function(){"function"==typeof i.params.onOrbitalUpdate&&i.params.onOrbitalUpdate()},this.setLink=function(t,e,n){if(i.p._.wasInitialized&&(null!=i._.targetPoint&&i.p.frontGroup.remove(i._.targetPoint),null!=t)){var r=new me,s=new Wt({color:65280});i._.targetPoint=new Ie(r,s);var a=i.p.getElevationAtLngLat(t.lng,t.lat);if(0!=a){var o=i.p.projection.lonLatToVector3(t.lng,t.lat,(a+.4)*i.p.options.exaggeration);e=e||{radius:8,fillColor:{r:0,g:255,b:0,a:.7},weight:2,color:"rgb(0,255,0)"},null==n&&(n="linkTargetPoint");var l=Kd.makeMarkerSprite(e,n);l.style=e,i._.targetPoint.attenuate=!0,i._.targetPoint.position.set(o.x,o.y,o.z),i._.targetPoint.add(l),i.p.frontGroup.add(i._.targetPoint),i.p._.events._attenuate(),i.p._.events._refreshFrontGroupRotation()}}},this.linkMove=function(t,e){i.return.isLinked&&!i._.linkPanned&&i.p.setCenter({lat:e,lng:t,z:0},!0)},this.linkMouseMove=function(t,e){i.return.isLinked&&i.setLink({lat:e,lng:t})},this.linkMouseOut=function(){i.setLink()},this.p=t,this.name=e,this.params=n||{},this._={linkPanned:!1,linkPannedTimeout:null},this.corner="TopLeft",this.return={isLinked:this.params.initiallyLinked||!1,linkMove:this.linkMove,linkMouseMove:this.linkMouseMove,linkMouseOut:this.linkMouseOut}},hp=function(t){var e=this;this.addControl=function(t,n,i,r){if(null==e.activeControls[t]){try{e.activeControls[t]=new n(e.p,t,i)}catch(n){return null!=e.activeControls[t]&&delete e.activeControls[t],void console.warn("Error adding UI Element with name '"+t+"' -",n)}r=r||e.activeControls[t].corner||"TopLeft";var s=document.createElement("div");return s.setAttribute("id","_lithosphere_control_"+t),s.innerHTML=e.activeControls[t].getControl(),s.style.marginRight="5px","TopLeft"!==r&&"TopRight"!==r||(s.style.marginBottom="5px"),e.corners[r].appendChild(s),e.activeControls[t].attachEvents(),e.activeControls[t].getReturn?e.activeControls[t].getReturn():void 0}console.warn("UI Control control with identifying name '"+t+"' already exists. Remove the existing one or pick a different name to add this control.")},this.removeControl=function(t){delete e.activeControls[t],document.getElementById("_lithosphere_control_"+t).remove()},this._onUpdateEvent=function(){Object.values(e.activeControls).forEach((function(t){"function"==typeof t.onUpdate&&t.onUpdate()}))},this._onMove=function(t,n,i){Object.values(e.activeControls).forEach((function(e){"function"==typeof e.onMove&&e.onMove(t,n,i)}))},this._onMouseMove=function(t,n,i){Object.values(e.activeControls).forEach((function(e){"function"==typeof e.onMouseMove&&e.onMouseMove(t,n,i)}))},this._onMouseOut=function(t){Object.values(e.activeControls).forEach((function(e){"function"==typeof e.onMouseOut&&e.onMouseOut(t)}))},this._onFirstPersonUpdate=function(){Object.values(e.activeControls).forEach((function(t){"function"==typeof t.onFirstPersonUpdate&&t.onFirstPersonUpdate()}))},this._onOrbitalUpdate=function(t){Object.values(e.activeControls).forEach((function(e){"function"==typeof e.onOrbitalUpdate&&e.onOrbitalUpdate(t)}))},this.p=t,this.activeControls={},this.controlContainer=document.createElement("div"),this.controlContainer.setAttribute("id","_lithosphere_controls"),this.controlContainer.style.position="absolute",this.controlContainer.style.top="0",this.controlContainer.style.left="0",this.controlContainer.style.width="100%",this.controlContainer.style.height="100%",this.controlContainer.style.pointerEvents="none",this.controlContainer.style.color="white",this.controlContainer.style.fontFamily="sans-serif",this.controlContainer.style.zIndex="1000",this.p._.container.appendChild(this.controlContainer),this.corners={TopLeft:null,TopRight:null,BottomLeft:null,BottomRight:null},this.corners.TopLeft=document.createElement("div"),this.corners.TopLeft.setAttribute("id","_lithosphere_controls_topleft"),this.corners.TopLeft.style.position="absolute",this.corners.TopLeft.style.top="10px",this.corners.TopLeft.style.left="10px",this.corners.TopLeft.style.pointerEvents="all",this.corners.TopLeft.style.display="flex",this.corners.TopLeft.style.flexFlow="column",this.controlContainer.appendChild(this.corners.TopLeft),this.corners.TopRight=document.createElement("div"),this.corners.TopRight.setAttribute("id","_lithosphere_controls_topright"),this.corners.TopRight.style.position="absolute",this.corners.TopRight.style.top="10px",this.corners.TopRight.style.right="10px",this.corners.TopRight.style.pointerEvents="all",this.corners.TopRight.style.display="flex",this.controlContainer.appendChild(this.corners.TopRight),this.corners.BottomLeft=document.createElement("div"),this.corners.BottomLeft.setAttribute("id","_lithosphere_controls_bottomleft"),this.corners.BottomLeft.style.position="absolute",this.corners.BottomLeft.style.bottom="10px",this.corners.BottomLeft.style.left="10px",this.corners.BottomLeft.style.pointerEvents="all",this.corners.BottomLeft.style.display="flex",this.controlContainer.appendChild(this.corners.BottomLeft),this.corners.BottomRight=document.createElement("div"),this.corners.BottomRight.setAttribute("id","_lithosphere_controls_bottomright"),this.corners.BottomRight.style.position="absolute",this.corners.BottomRight.style.bottom="10px",this.corners.BottomRight.style.right="10px",this.corners.BottomRight.style.pointerEvents="all",this.corners.BottomRight.style.display="flex",this.controlContainer.appendChild(this.corners.BottomRight),this.compass=tp,this.coordinates=np,this.home=ip,this.layers=rp,this.exaggerate=sp,this.observe=ap,this.walk=op,this.link=lp},cp=(n(11),function(t){var e=this;this.end=function(t){!1!==e.p.options.loadingScreen&&e.loadingContainer&&(e.loadingContainer.style.opacity="0",e.p._.sceneContainer.style.filter="blur(0px) brightness(1)",setTimeout((function(){e.loadingContainer.remove(),e.loadingContainer=null,e.p._.sceneContainer.style.filter=null,e.p._.sceneContainer.style.transition=null}),500))},this.p=t,!1!==this.p.options.loadingScreen&&(this.loadingContainer=document.createElement("div"),this.loadingContainer.setAttribute("id","_lithosphere_loadingscreen"),this.loadingContainer.style.position="absolute",this.loadingContainer.style.top="0",this.loadingContainer.style.left="0",this.loadingContainer.style.width="100%",this.loadingContainer.style.height="100%",this.loadingContainer.style.background="black",this.loadingContainer.style.color="white",this.loadingContainer.style.fontFamily="sans-serif",this.loadingContainer.style.zIndex="9001",this.loadingContainer.style.opacity="1",this.loadingContainer.style.transition="opacity 0.5s ease-in",this.loadingContainer.innerHTML=["
","
","
","
","
","
","
","
"].join("\n"),this.p._.container.appendChild(this.loadingContainer),this.p._.sceneContainer.style.filter="blur(10px) brightness(0.5)",this.p._.sceneContainer.style.transition="filter 0.5s ease-in-out")}),up=function(){return(up=Object.assign||function(t){for(var e,n=1,i=arguments.length;n0?(r[0].point.y+=n.planetCenter.y,r[0].point):new _(0,0,0)}var s={x:n.planetCenter.x,y:n.planetCenter.y,z:n.planetCenter.z};return s=n.projection.rotatePoint3D(s,{x:-n.planet.rotation.x,y:0,z:0}),s=n.projection.rotatePoint3D(s,{x:0,y:-n.planet.rotation.y,z:0}),s=n.projection.rotatePoint3D(s,{x:0,y:0,z:-n.planet.rotation.z}),new _(s.x,s.y,s.z)},this.getCenter=function(t){var e=n.getCenterXYZ(t);if(t){var i=JSON.parse(JSON.stringify(e));return i=n.projection.rotatePoint3D(i,{x:-n.planet.rotation.x,y:0,z:0}),i=n.projection.rotatePoint3D(i,{x:0,y:-n.planet.rotation.y,z:0}),i=n.projection.rotatePoint3D(i,{x:0,y:0,z:-n.planet.rotation.z}),(i=n.projection.vector3ToLatLng(i)).height=e.length()*n.projection.radiusScale-n.projection.radii.major,i}return n.projection.vector3ToLatLng(e)},this.getCenterElevation=function(){return n.getCenterXYZ(!0).length()*n.projection.radiusScale-n.projection.radii.major},this.getCenterElevationRaw=function(){var t=n.getCenterXYZ(!0).length();if(!(t<=.1&&t>=-.1))return t},this.getElevationAtLngLat=function(t,e){var i=n.projection.lonLatToVector3(t,e,1e5*n.options.exaggeration),r=new xt;r.position.set(0,-n.planetCenter.y,0),r.rotation.set(n.planet.rotation.x,n.planet.rotation.y,n.planet.rotation.z);var s=new Ie(new js(200,32,32),new Wt({color:16776960}));s.position.set(i.x,i.y,i.z),r.add(s),r.updateMatrixWorld();var a=new _;a.setFromMatrixPosition(s.matrixWorld),n._.raycaster.set(a,new _(0,-n.planetCenter.y,0).normalize());for(var o=[],l=0;l0?(h[h.length-1].point.y+=n.planetCenter.y,h[h.length-1].point.length()*n.projection.radiusScale-n.projection.radii.major):0},this.getCenterTile=function(){var t=n.getCenter();return n.projection.latLngZ2TileXYZ(t.lat,t.lng,n.zoom)},this.getCameras=function(){return{camera:n._.cameras.camera,isFirstPerson:n._.cameras.isFirstPerson,firstPerson:n._.cameras.firstPerson,orbit:n._.cameras.orbit}},this.getContainer=function(){return n._.container},this.invalidateSize=function(){n._.wasInitialized&&(n._.renderer.setSize(n._.sceneContainer.offsetWidth,n._.sceneContainer.offsetHeight),n._.cameras.updateSize())};var i=document.getElementById(t).appendChild(document.createElement("div"));i.id="_lithosphere_scene",i.style.width="100%",i.style.height="100%",this._={containerId:t,container:document.getElementById(t),sceneContainer:i,wasInitialized:!1,renderer:null,cameras:null,cameraPositionTarget:null,tiledWorld:null,events:null,maxZoom:0,minNativeZoom:0,loader:new La,raycaster:new Xo,updateEveryNthRender:2,counters:{update:0,frame:0},lastCameraWasFirst:!1,firstUpdate:!0,firstLoad:!1,loadingScreen:null,renderOnlyWhenOpen:!0,zCutOff:3,firstViewOverride:null,mouseIsInScene:!1},this._.container.style.position="relative",this.scene=new rr,this.scenesLOD=[new rr,new rr,new rr],this.sceneBack=new rr,this.sceneFront=new rr,this.planet=new xt,this.planetsLOD=[new xt,new xt,new xt],this.frontGroup=new xt;e=e||{},this.options=up(up({},{loadingScreen:!0,tileMapResource:null,customParsers:{},radiusOfTiles:4,useLOD:!0,LOD:[{radiusOfTiles:4,zoomsUp:3},{radiusOfTiles:2,zoomsUp:7},{radiusOfTiles:2,zoomsUp:11}],tileResolution:32,trueTileResolution:32,yInvert:!0,showAxes:!1,wireframeMode:!1,exaggeration:1,renderOnlyWhenOpen:!0,targetYOffset:0,highlightColor:"yellow",activeColor:"red"}),e),this._init()}return t.prototype._init=function(){if(this._.renderer=new fl(this._.sceneContainer).renderer,!this._.renderer)return!1;if(this._.wasInitialized=!0,this.projection=new pu(this.options.majorRadius,this.options.minorRadius,this.options.tileMapResource),this._.cameras=new xl(this._.container,this._.sceneContainer,this.scene,this.projection),this.layers=new $d(this),this.addLayer=this.layers.addLayer,this.removeLayer=this.layers.removeLayer,this.toggleLayer=this.layers.toggleLayer,this.setLayerOpacity=this.layers.setLayerOpacity,this._.tiledWorld=new Mu(this),this.zoom=10,this.trueZoom=this.zoom,this.mouse={lat:null,lng:null,elev:null},this.planetCenter=new _(0,-this.projection.radii.major/this.projection.radiusScale,0),this.planet.position.set(this.planetCenter.x,-this.planetCenter.y,this.planetCenter.z),this.scene.add(this.planet),this.scenesLOD[0].add(this.planetsLOD[0]),this.scenesLOD[1].add(this.planetsLOD[1]),this.scenesLOD[2].add(this.planetsLOD[2]),this.frontGroup.position.set(this.planetCenter.x,-this.planetCenter.y,this.planetCenter.z),this.sceneFront.add(this.frontGroup),this.scene.add(new oo(16711422)),this.options.starsphere){var t=new js(1e3*this.planetCenter.y,64,64),e=new Wt({color:this.options.starsphere.color||11184810});this.options.starsphere.url&&(e.map=this._.loader.load(this.options.starsphere.url)),e.opacity=1,this.starsphere=new Ie(t,e),this.sceneBack.add(this.starsphere)}if(this.options.atmosphere&&(this.atmosphere=new Ie(new js(1.5*this.planetCenter.y,128,128),fu.atmosphere(this.options.atmosphere.color)),this.sceneBack.add(this.atmosphere)),!0===this.options.showAxes){var n=new jr({color:16711680}),i=new Yr((new me).setFromPoints([new _(0,0,0),new _(2*this.planetCenter.y,0,0)]),n);this.scene.add(i);var r=new jr({color:65280}),s=new Yr((new me).setFromPoints([new _(0,0,0),new _(0,2*this.planetCenter.y,0)]),r);this.scene.add(s);var a=new jr({color:255}),o=new Yr((new me).setFromPoints([new _(0,0,0),new _(0,0,2*this.planetCenter.y)]),a);this.scene.add(o)}return this.controls=new hp(this),this.addControl=this.controls.addControl,this.removeControl=this.controls.removeControl,!1===this.options.renderOnlyWhenOpen&&(this._.renderOnlyWhenOpen=!1),this._.loadingScreen=new cp(this),this._.events=new Vu(this),this.setCenter(this.options.initialView),this._animate(),!0},t.prototype._render=function(){if(this._.renderer.clear(),this._.renderOnlyWhenOpen){var t=this._.container.getBoundingClientRect();if(t.width<=0||t.height<=0)return}this._.counters.update=(this._.counters.update+1)%this._.updateEveryNthRender,0===this._.counters.update?this._update():this._.cameras.isFirstPerson||this._.cameras.orbit.controls.update(),this.layers.tile3d.forEach((function(t){t.renderer.update()})),this._.renderer.render(this.sceneBack,this._.cameras.camera),this._.renderer.clearDepth(),this._.renderer.render(this.scenesLOD[2],this._.cameras.camera),this._.renderer.clearDepth(),this._.renderer.render(this.scenesLOD[1],this._.cameras.camera),this._.renderer.clearDepth(),this._.renderer.render(this.scenesLOD[0],this._.cameras.camera),this._.renderer.clearDepth(),this._.renderer.render(this.scene,this._.cameras.camera),this._.renderer.clearDepth(),this._.renderer.render(this.sceneFront,this._.cameras.camera)},t.prototype._update=function(){if(this._.wasInitialized){if(this._.counters.frame=(this._.counters.frame+1)%4,this.scene.rotation.x=0,this.scene.position.y=0,this._.firstUpdate||this._.tiledWorld.refreshTiles(),this._.events._checkDesiredZoom(),this.controls._onUpdateEvent(),this._.cameras.isFirstPerson){this._.lastCameraWasFirst=!0,this._.cameras.firstPerson.controls.getObject().position.y=this._.cameras.orbit.controls.target.y-this._.cameras.firstPerson.height/this.projection.radiusScale;var t=this._.cameras.update();this._.events._rotateGlobe(t),this._.events._onMouseMove(),this.controls._onFirstPersonUpdate()}else this._.lastCameraWasFirst&&(this._.lastCameraWasFirst=!1,this.controls._onOrbitalUpdate());if(this._.firstUpdate){null!=this._.firstViewOverride?this.setCenter(this._.firstViewOverride):this.setCenter(this.options.initialView,!0);var e=this._.cameras.orbit,n=e.camera,i=e.controls,r=n.position,s=i.target;this._.cameraPositionTarget=[r.x,r.y,r.z,s.x,s.y,s.z],this._.firstUpdate=!1}}},t}();e.default=dp}])})); \ No newline at end of file +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define("LithoSphere", [], factory); + else if(typeof exports === 'object') + exports["LithoSphere"] = factory(); + else + root["LithoSphere"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "C:\\Users\\tsoliman\\Documents\\Projects\\LithoSphere\\dist/"; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./src/lithosphere.ts"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "./node_modules/3d-tiles-renderer/src/base/B3DMLoaderBase.js": +/*!*******************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/base/B3DMLoaderBase.js ***! + \*******************************************************************/ +/*! exports provided: B3DMLoaderBase */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"B3DMLoaderBase\", function() { return B3DMLoaderBase; });\n/* harmony import */ var _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utilities/FeatureTable.js */ \"./node_modules/3d-tiles-renderer/src/utilities/FeatureTable.js\");\n// B3DM File Format\r\n// https://github.com/CesiumGS/3d-tiles/blob/master/specification/TileFormats/Batched3DModel/README.md\r\n\r\n\r\n\r\nclass B3DMLoaderBase {\r\n\r\n\tconstructor() {\r\n\r\n\t\tthis.fetchOptions = {};\r\n\r\n\t}\r\n\r\n\tload( url ) {\r\n\r\n\t\treturn fetch( url, this.fetchOptions )\r\n\t\t\t.then( res => {\r\n\r\n\t\t\t\tif ( ! res.ok ) {\r\n\r\n\t\t\t\t\tthrow new Error( `Failed to load file \"${ url }\" with status ${ res.status } : ${ res.statusText }` );\r\n\r\n\t\t\t\t}\r\n\t\t\t\treturn res.arrayBuffer();\r\n\r\n\t\t\t} )\r\n\t\t\t.then( buffer => this.parse( buffer ) );\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\t// TODO: this should be able to take a uint8array with an offset and length\r\n\t\tconst dataView = new DataView( buffer );\r\n\r\n\t\t// 28-byte header\r\n\r\n\t\t// 4 bytes\r\n\t\tconst magic =\r\n\t\t\tString.fromCharCode( dataView.getUint8( 0 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 1 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 2 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 3 ) );\r\n\r\n\t\tconsole.assert( magic === 'b3dm' );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst version = dataView.getUint32( 4, true );\r\n\r\n\t\tconsole.assert( version === 1 );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst byteLength = dataView.getUint32( 8, true );\r\n\r\n\t\tconsole.assert( byteLength === buffer.byteLength );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst featureTableJSONByteLength = dataView.getUint32( 12, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst featureTableBinaryByteLength = dataView.getUint32( 16, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst batchTableJSONByteLength = dataView.getUint32( 20, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst batchTableBinaryByteLength = dataView.getUint32( 24, true );\r\n\r\n\t\t// Feature Table\r\n\t\tconst featureTableStart = 28;\r\n\t\tconst featureTableBuffer = buffer.slice(\r\n\t\t\tfeatureTableStart,\r\n\t\t\tfeatureTableStart + featureTableJSONByteLength + featureTableBinaryByteLength,\r\n\t\t);\r\n\t\tconst featureTable = new _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__[\"FeatureTable\"](\r\n\t\t\tfeatureTableBuffer,\r\n\t\t\t0,\r\n\t\t\tfeatureTableJSONByteLength,\r\n\t\t\tfeatureTableBinaryByteLength,\r\n\t\t);\r\n\r\n\t\t// Batch Table\r\n\t\tconst batchTableStart = featureTableStart + featureTableJSONByteLength + featureTableBinaryByteLength;\r\n\t\tconst batchTableBuffer = buffer.slice(\r\n\t\t\tbatchTableStart,\r\n\t\t\tbatchTableStart + batchTableJSONByteLength + batchTableBinaryByteLength,\r\n\t\t);\r\n\t\tconst batchTable = new _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__[\"BatchTable\"](\r\n\t\t\tbatchTableBuffer,\r\n\t\t\tfeatureTable.getData( 'BATCH_LENGTH' ),\r\n\t\t\t0,\r\n\t\t\tbatchTableJSONByteLength,\r\n\t\t\tbatchTableBinaryByteLength,\r\n\t\t);\r\n\r\n\t\tconst glbStart = batchTableStart + batchTableJSONByteLength + batchTableBinaryByteLength;\r\n\t\tconst glbBytes = new Uint8Array( buffer, glbStart, byteLength - glbStart );\r\n\r\n\t\treturn {\r\n\t\t\tversion,\r\n\t\t\tfeatureTable,\r\n\t\t\tbatchTable,\r\n\t\t\tglbBytes,\r\n\t\t};\r\n\r\n\t}\r\n\r\n}\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/B3DMLoaderBase.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/base/CMPTLoaderBase.js": +/*!*******************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/base/CMPTLoaderBase.js ***! + \*******************************************************************/ +/*! exports provided: CMPTLoaderBase */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CMPTLoaderBase\", function() { return CMPTLoaderBase; });\n// CMPT File Format\r\n// https://github.com/CesiumGS/3d-tiles/blob/master/specification/TileFormats/Composite/README.md\r\n\r\nclass CMPTLoaderBase {\r\n\r\n\tconstructor() {\r\n\r\n\t\tthis.fetchOptions = {};\r\n\t\tthis.workingPath = '';\r\n\r\n\t}\r\n\r\n\tload( url ) {\r\n\r\n\t\treturn fetch( url, this.fetchOptions )\r\n\t\t\t.then( res => {\r\n\r\n\t\t\t\tif ( ! res.ok ) {\r\n\r\n\t\t\t\t\tthrow new Error( `Failed to load file \"${ url }\" with status ${ res.status } : ${ res.statusText }` );\r\n\r\n\t\t\t\t}\r\n\t\t\t\treturn res.arrayBuffer();\r\n\r\n\t\t\t} )\r\n\t\t\t.then( buffer => {\r\n\r\n\t\t\t\tif ( this.workingPath === '' ) {\r\n\r\n\t\t\t\t\tconst splits = url.split( /\\\\\\//g );\r\n\t\t\t\t\tsplits.pop();\r\n\t\t\t\t\tthis.workingPath = splits.join( '/' );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn this.parse( buffer );\r\n\r\n\t\t\t} );\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\tconst dataView = new DataView( buffer );\r\n\r\n\t\t// 16-byte header\r\n\r\n\t\t// 4 bytes\r\n\t\tconst magic =\r\n\t\t\tString.fromCharCode( dataView.getUint8( 0 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 1 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 2 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 3 ) );\r\n\r\n\t\tconsole.assert( magic === 'cmpt' );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst version = dataView.getUint32( 4, true );\r\n\r\n\t\tconsole.assert( version === 1 );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst byteLength = dataView.getUint32( 8, true );\r\n\r\n\t\tconsole.assert( byteLength === buffer.byteLength );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst tilesLength = dataView.getUint32( 12, true );\r\n\r\n\t\tconst tiles = [];\r\n\t\tlet offset = 16;\r\n\t\tfor ( let i = 0; i < tilesLength; i ++ ) {\r\n\r\n\t\t\tconst tileView = new DataView( buffer, offset, 12 );\r\n\t\t\tconst tileMagic =\r\n\t\t\t\tString.fromCharCode( tileView.getUint8( 0 ) ) +\r\n\t\t\t\tString.fromCharCode( tileView.getUint8( 1 ) ) +\r\n\t\t\t\tString.fromCharCode( tileView.getUint8( 2 ) ) +\r\n\t\t\t\tString.fromCharCode( tileView.getUint8( 3 ) );\r\n\t\t\tconst tileVersion = tileView.getUint32( 4, true );\r\n\t\t\tconst byteLength = tileView.getUint32( 8, true );\r\n\r\n\t\t\tconst tileBuffer = new Uint8Array( buffer, offset, byteLength );\r\n\t\t\ttiles.push( {\r\n\r\n\t\t\t\ttype: tileMagic,\r\n\t\t\t\tbuffer: tileBuffer,\r\n\t\t\t\tversion: tileVersion,\r\n\r\n\t\t\t} );\r\n\t\t\toffset += byteLength;\r\n\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\tversion,\r\n\t\t\ttiles,\r\n\t\t};\r\n\r\n\t}\r\n\r\n}\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/CMPTLoaderBase.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/base/I3DMLoaderBase.js": +/*!*******************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/base/I3DMLoaderBase.js ***! + \*******************************************************************/ +/*! exports provided: I3DMLoaderBase */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"I3DMLoaderBase\", function() { return I3DMLoaderBase; });\n/* harmony import */ var _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utilities/FeatureTable.js */ \"./node_modules/3d-tiles-renderer/src/utilities/FeatureTable.js\");\n/* harmony import */ var _utilities_arrayToString_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utilities/arrayToString.js */ \"./node_modules/3d-tiles-renderer/src/utilities/arrayToString.js\");\n// I3DM File Format\r\n// https://github.com/CesiumGS/3d-tiles/blob/master/specification/TileFormats/Instanced3DModel/README.md\r\n\r\n\r\n\r\n\r\nclass I3DMLoaderBase {\r\n\r\n\tconstructor() {\r\n\r\n\t\tthis.fetchOptions = {};\r\n\t\tthis.workingPath = '';\r\n\r\n\t}\r\n\r\n\tresolveExternalURL( url ) {\r\n\r\n\t\tif ( /^[^\\\\/]/ ) {\r\n\r\n\t\t\treturn this.workingPath + '/' + url;\r\n\r\n\t\t} else {}\r\n\r\n\t}\r\n\r\n\tload( url ) {\r\n\r\n\t\treturn fetch( url, this.fetchOptions )\r\n\t\t\t.then( res => {\r\n\r\n\t\t\t\tif ( ! res.ok ) {\r\n\r\n\t\t\t\t\tthrow new Error( `Failed to load file \"${ url }\" with status ${ res.status } : ${ res.statusText }` );\r\n\r\n\t\t\t\t}\r\n\t\t\t\treturn res.arrayBuffer();\r\n\r\n\t\t\t} )\r\n\t\t\t.then( buffer => {\r\n\r\n\t\t\t\tif ( this.workingPath === '' ) {\r\n\r\n\t\t\t\t\tconst splits = url.split( /\\\\\\//g );\r\n\t\t\t\t\tsplits.pop();\r\n\t\t\t\t\tthis.workingPath = splits.join( '/' );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn this.parse( buffer );\r\n\r\n\t\t\t} );\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\tconst dataView = new DataView( buffer );\r\n\r\n\t\t// 32-byte header\r\n\r\n\t\t// 4 bytes\r\n\t\tconst magic =\r\n\t\t\tString.fromCharCode( dataView.getUint8( 0 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 1 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 2 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 3 ) );\r\n\r\n\t\tconsole.assert( magic === 'i3dm' );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst version = dataView.getUint32( 4, true );\r\n\r\n\t\tconsole.assert( version === 1 );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst byteLength = dataView.getUint32( 8, true );\r\n\r\n\t\tconsole.assert( byteLength === buffer.byteLength );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst featureTableJSONByteLength = dataView.getUint32( 12, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst featureTableBinaryByteLength = dataView.getUint32( 16, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst batchTableJSONByteLength = dataView.getUint32( 20, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst batchTableBinaryByteLength = dataView.getUint32( 24, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst gltfFormat = dataView.getUint32( 28, true );\r\n\r\n\t\t// Feature Table\r\n\t\tconst featureTableStart = 32;\r\n\t\tconst featureTableBuffer = buffer.slice(\r\n\t\t\tfeatureTableStart,\r\n\t\t\tfeatureTableStart + featureTableJSONByteLength + featureTableBinaryByteLength,\r\n\t\t);\r\n\t\tconst featureTable = new _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__[\"FeatureTable\"](\r\n\t\t\tfeatureTableBuffer,\r\n\t\t\t0,\r\n\t\t\tfeatureTableJSONByteLength,\r\n\t\t\tfeatureTableBinaryByteLength,\r\n\t\t);\r\n\r\n\t\t// Batch Table\r\n\t\tconst batchTableStart = featureTableStart + featureTableJSONByteLength + featureTableBinaryByteLength;\r\n\t\tconst batchTableBuffer = buffer.slice(\r\n\t\t\tbatchTableStart,\r\n\t\t\tbatchTableStart + batchTableJSONByteLength + batchTableBinaryByteLength,\r\n\t\t);\r\n\t\tconst batchTable = new _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__[\"BatchTable\"](\r\n\t\t\tbatchTableBuffer,\r\n\t\t\tfeatureTable.getData( 'INSTANCES_LENGTH' ),\r\n\t\t\t0,\r\n\t\t\tbatchTableJSONByteLength,\r\n\t\t\tbatchTableBinaryByteLength,\r\n\t\t);\r\n\r\n\t\tconst glbStart = batchTableStart + batchTableJSONByteLength + batchTableBinaryByteLength;\r\n\t\tconst bodyBytes = new Uint8Array( buffer, glbStart, byteLength - glbStart );\r\n\r\n\t\tlet glbBytes = null;\r\n\t\tlet promise = null;\r\n\t\tif ( gltfFormat ) {\r\n\r\n\t\t\tglbBytes = bodyBytes;\r\n\t\t\tpromise = Promise.resolve();\r\n\r\n\t\t} else {\r\n\r\n\t\t\tconst externalUri = this.resolveExternalURL( Object(_utilities_arrayToString_js__WEBPACK_IMPORTED_MODULE_1__[\"arrayToString\"])( bodyBytes ) );\r\n\t\t\tpromise = fetch( externalUri, this.fetchOptions )\r\n\t\t\t\t.then( res => {\r\n\r\n\t\t\t\t\tif ( ! res.ok ) {\r\n\r\n\t\t\t\t\t\tthrow new Error( `I3DMLoaderBase : Failed to load file \"${ externalUri }\" with status ${ res.status } : ${ res.statusText }` );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn res.arrayBuffer();\r\n\r\n\t\t\t\t} )\r\n\t\t\t\t.then( buffer => {\r\n\r\n\t\t\t\t\tglbBytes = new Uint8Array( buffer );\r\n\r\n\t\t\t\t} );\r\n\r\n\t\t}\r\n\r\n\t\treturn promise.then( () => {\r\n\r\n\t\t\treturn {\r\n\t\t\t\tversion,\r\n\t\t\t\tfeatureTable,\r\n\t\t\t\tbatchTable,\r\n\t\t\t\tglbBytes,\r\n\t\t\t};\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n}\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/I3DMLoaderBase.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/base/PNTSLoaderBase.js": +/*!*******************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/base/PNTSLoaderBase.js ***! + \*******************************************************************/ +/*! exports provided: PNTSLoaderBase */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PNTSLoaderBase\", function() { return PNTSLoaderBase; });\n/* harmony import */ var _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utilities/FeatureTable.js */ \"./node_modules/3d-tiles-renderer/src/utilities/FeatureTable.js\");\n// PNTS File Format\r\n// https://github.com/CesiumGS/3d-tiles/blob/master/specification/TileFormats/PointCloud/README.md\r\n\r\n\r\n\r\nclass PNTSLoaderBase {\r\n\r\n\tconstructor() {\r\n\r\n\t\tthis.fetchOptions = {};\r\n\r\n\t}\r\n\r\n\tload( url ) {\r\n\r\n\t\treturn fetch( url, this.fetchOptions )\r\n\t\t\t.then( res => {\r\n\r\n\t\t\t\tif ( ! res.ok ) {\r\n\r\n\t\t\t\t\tthrow new Error( `Failed to load file \"${ url }\" with status ${ res.status } : ${ res.statusText }` );\r\n\r\n\t\t\t\t}\r\n\t\t\t\treturn res.arrayBuffer();\r\n\r\n\t\t\t} )\r\n\t\t\t.then( buffer => this.parse( buffer ) );\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\tconst dataView = new DataView( buffer );\r\n\r\n\t\t// 28-byte header\r\n\r\n\t\t// 4 bytes\r\n\t\tconst magic =\r\n\t\t\tString.fromCharCode( dataView.getUint8( 0 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 1 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 2 ) ) +\r\n\t\t\tString.fromCharCode( dataView.getUint8( 3 ) );\r\n\r\n\t\tconsole.assert( magic === 'pnts' );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst version = dataView.getUint32( 4, true );\r\n\r\n\t\tconsole.assert( version === 1 );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst byteLength = dataView.getUint32( 8, true );\r\n\r\n\t\tconsole.assert( byteLength === buffer.byteLength );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst featureTableJSONByteLength = dataView.getUint32( 12, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst featureTableBinaryByteLength = dataView.getUint32( 16, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst batchTableJSONByteLength = dataView.getUint32( 20, true );\r\n\r\n\t\t// 4 bytes\r\n\t\tconst batchTableBinaryByteLength = dataView.getUint32( 24, true );\r\n\r\n\t\t// Feature Table\r\n\t\tconst featureTableStart = 28;\r\n\t\tconst featureTableBuffer = buffer.slice(\r\n\t\t\tfeatureTableStart,\r\n\t\t\tfeatureTableStart + featureTableJSONByteLength + featureTableBinaryByteLength,\r\n\t\t);\r\n\t\tconst featureTable = new _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__[\"FeatureTable\"](\r\n\t\t\tfeatureTableBuffer,\r\n\t\t\t0,\r\n\t\t\tfeatureTableJSONByteLength,\r\n\t\t\tfeatureTableBinaryByteLength,\r\n\t\t);\r\n\r\n\t\t// Batch Table\r\n\t\tconst batchTableStart = featureTableStart + featureTableJSONByteLength + featureTableBinaryByteLength;\r\n\t\tconst batchTableBuffer = buffer.slice(\r\n\t\t\tbatchTableStart,\r\n\t\t\tbatchTableStart + batchTableJSONByteLength + batchTableBinaryByteLength,\r\n\t\t);\r\n\t\tconst batchTable = new _utilities_FeatureTable_js__WEBPACK_IMPORTED_MODULE_0__[\"BatchTable\"](\r\n\t\t\tbatchTableBuffer,\r\n\t\t\tfeatureTable.getData( 'BATCH_LENGTH' ) || featureTable.getData( 'POINTS_LENGTH' ),\r\n\t\t\t0,\r\n\t\t\tbatchTableJSONByteLength,\r\n\t\t\tbatchTableBinaryByteLength,\r\n\t\t);\r\n\r\n\t\treturn {\r\n\t\t\tversion,\r\n\t\t\tfeatureTable,\r\n\t\t\tbatchTable,\r\n\t\t};\r\n\r\n\t}\r\n\r\n}\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/PNTSLoaderBase.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/base/TilesRendererBase.js": +/*!**********************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/base/TilesRendererBase.js ***! + \**********************************************************************/ +/*! exports provided: TilesRendererBase */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TilesRendererBase\", function() { return TilesRendererBase; });\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ \"./node_modules/path-browserify/index.js\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _utilities_urlJoin_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utilities/urlJoin.js */ \"./node_modules/3d-tiles-renderer/src/utilities/urlJoin.js\");\n/* harmony import */ var _utilities_LRUCache_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utilities/LRUCache.js */ \"./node_modules/3d-tiles-renderer/src/utilities/LRUCache.js\");\n/* harmony import */ var _utilities_PriorityQueue_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utilities/PriorityQueue.js */ \"./node_modules/3d-tiles-renderer/src/utilities/PriorityQueue.js\");\n/* harmony import */ var _traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./traverseFunctions.js */ \"./node_modules/3d-tiles-renderer/src/base/traverseFunctions.js\");\n/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constants.js */ \"./node_modules/3d-tiles-renderer/src/base/constants.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n// Function for sorting the evicted LRU items. We should evict the shallowest depth first.\r\nconst priorityCallback = tile => 1 / ( tile.__depthFromRenderedParent + 1 );\r\n\r\nclass TilesRendererBase {\r\n\r\n\tget rootTileSet() {\r\n\r\n\t\tconst tileSet = this.tileSets[ this.rootURL ];\r\n\t\tif ( ! tileSet || tileSet instanceof Promise ) {\r\n\r\n\t\t\treturn null;\r\n\r\n\t\t} else {\r\n\r\n\t\t\treturn tileSet;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tget root() {\r\n\r\n\t\tconst tileSet = this.rootTileSet;\r\n\t\treturn tileSet ? tileSet.root : null;\r\n\r\n\t}\r\n\r\n\tconstructor( url ) {\r\n\r\n\t\t// state\r\n\t\tthis.tileSets = {};\r\n\t\tthis.rootURL = url;\r\n\t\tthis.fetchOptions = {};\r\n\r\n\t\tthis.preprocessURL = null;\r\n\r\n\t\tconst lruCache = new _utilities_LRUCache_js__WEBPACK_IMPORTED_MODULE_2__[\"LRUCache\"]();\r\n\t\tlruCache.unloadPriorityCallback = priorityCallback;\r\n\r\n\t\tconst downloadQueue = new _utilities_PriorityQueue_js__WEBPACK_IMPORTED_MODULE_3__[\"PriorityQueue\"]();\r\n\t\tdownloadQueue.maxJobs = 4;\r\n\t\tdownloadQueue.priorityCallback = priorityCallback;\r\n\r\n\t\tconst parseQueue = new _utilities_PriorityQueue_js__WEBPACK_IMPORTED_MODULE_3__[\"PriorityQueue\"]();\r\n\t\tparseQueue.maxJobs = 1;\r\n\t\tparseQueue.priorityCallback = priorityCallback;\r\n\r\n\t\tthis.lruCache = lruCache;\r\n\t\tthis.downloadQueue = downloadQueue;\r\n\t\tthis.parseQueue = parseQueue;\r\n\t\tthis.stats = {\r\n\t\t\tparsing: 0,\r\n\t\t\tdownloading: 0,\r\n\t\t\tfailed: 0,\r\n\t\t\tinFrustum: 0,\r\n\t\t\tused: 0,\r\n\t\t\tactive: 0,\r\n\t\t\tvisible: 0,\r\n\t\t};\r\n\t\tthis.frameCount = 0;\r\n\r\n\t\t// options\r\n\t\tthis.errorTarget = 6.0;\r\n\t\tthis.errorThreshold = Infinity;\r\n\t\tthis.loadSiblings = true;\r\n\t\tthis.displayActiveTiles = false;\r\n\t\tthis.maxDepth = Infinity;\r\n\t\tthis.stopAtEmptyTiles = true;\r\n\r\n\t}\r\n\r\n\ttraverse( beforecb, aftercb ) {\r\n\r\n\t\tconst tileSets = this.tileSets;\r\n\t\tconst rootTileSet = tileSets[ this.rootURL ];\r\n\t\tif ( ! rootTileSet || ! rootTileSet.root ) return;\r\n\r\n\t\tObject(_traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__[\"traverseSet\"])( rootTileSet.root, beforecb, aftercb );\r\n\r\n\t}\r\n\r\n\t// Public API\r\n\tupdate() {\r\n\r\n\t\tconst stats = this.stats;\r\n\t\tconst lruCache = this.lruCache;\r\n\t\tconst tileSets = this.tileSets;\r\n\t\tconst rootTileSet = tileSets[ this.rootURL ];\r\n\t\tif ( ! ( this.rootURL in tileSets ) ) {\r\n\r\n\t\t\tthis.loadRootTileSet( this.rootURL );\r\n\t\t\treturn;\r\n\r\n\t\t} else if ( ! rootTileSet || ! rootTileSet.root ) {\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t\tconst root = rootTileSet.root;\r\n\r\n\t\tstats.inFrustum = 0,\r\n\t\tstats.used = 0,\r\n\t\tstats.active = 0,\r\n\t\tstats.visible = 0,\r\n\t\tthis.frameCount ++;\r\n\r\n\t\tObject(_traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__[\"determineFrustumSet\"])( root, this );\r\n\t\tObject(_traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__[\"markUsedSetLeaves\"])( root, this );\r\n\t\tObject(_traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__[\"skipTraversal\"])( root, this );\r\n\t\tObject(_traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__[\"toggleTiles\"])( root, this );\r\n\r\n\t\tlruCache.scheduleUnload();\r\n\r\n\t}\r\n\r\n\t// Overrideable\r\n\tparseTile( buffer, tile, extension ) {\r\n\r\n\t\treturn null;\r\n\r\n\t}\r\n\r\n\tdisposeTile( tile ) {\r\n\r\n\t}\r\n\r\n\tpreprocessNode( tile, parentTile, tileSetDir ) {\r\n\r\n\t\tif ( tile.content ) {\r\n\r\n\t\t\t// Fix old file formats\r\n\t\t\tif ( ! ( 'uri' in tile.content ) && 'url' in tile.content ) {\r\n\r\n\t\t\t\ttile.content.uri = tile.content.url;\r\n\t\t\t\tdelete tile.content.url;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( tile.content.uri ) {\r\n\r\n\t\t\t\ttile.content.uri = Object(_utilities_urlJoin_js__WEBPACK_IMPORTED_MODULE_1__[\"urlJoin\"])( tileSetDir, tile.content.uri );\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// NOTE: fix for some cases where tilesets provide the bounding volume\r\n\t\t\t// but volumes are not present.\r\n\t\t\tif (\r\n\t\t\t\ttile.content.boundingVolume &&\r\n\t\t\t\t! (\r\n\t\t\t\t\t'box' in tile.content.boundingVolume ||\r\n\t\t\t\t\t'sphere' in tile.content.boundingVolume ||\r\n\t\t\t\t\t'region' in tile.content.boundingVolume\r\n\t\t\t\t)\r\n\t\t\t) {\r\n\r\n\t\t\t\tdelete tile.content.boundingVolume;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\ttile.parent = parentTile;\r\n\t\ttile.children = tile.children || [];\r\n\r\n\t\tconst uri = tile.content && tile.content.uri;\r\n\t\tif ( uri ) {\r\n\r\n\t\t\t// \"content\" should only indicate loadable meshes, not external tile sets\r\n\t\t\tconst isExternalTileSet = /\\.json$/i.test( tile.content.uri );\r\n\t\t\ttile.__externalTileSet = isExternalTileSet;\r\n\t\t\ttile.__contentEmpty = isExternalTileSet;\r\n\r\n\t\t} else {\r\n\r\n\t\t\ttile.__externalTileSet = false;\r\n\t\t\ttile.__contentEmpty = true;\r\n\r\n\t\t}\r\n\r\n\t\ttile.__error = 0.0;\r\n\t\ttile.__inFrustum = false;\r\n\t\ttile.__isLeaf = false;\r\n\r\n\t\ttile.__usedLastFrame = false;\r\n\t\ttile.__used = false;\r\n\r\n\t\ttile.__wasSetVisible = false;\r\n\t\ttile.__visible = false;\r\n\t\ttile.__childrenWereVisible = false;\r\n\t\ttile.__allChildrenLoaded = false;\r\n\r\n\t\ttile.__wasSetActive = false;\r\n\t\ttile.__active = false;\r\n\r\n\t\ttile.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"UNLOADED\"];\r\n\t\ttile.__loadIndex = 0;\r\n\r\n\t\ttile.__loadAbort = null;\r\n\r\n\t\ttile.__depthFromRenderedParent = - 1;\r\n\t\tif ( parentTile === null ) {\r\n\r\n\t\t\ttile.__depth = 0;\r\n\t\t\ttile.refine = tile.refine || 'REPLACE';\r\n\r\n\t\t} else {\r\n\r\n\t\t\ttile.__depth = parentTile.__depth + 1;\r\n\t\t\ttile.refine = tile.refine || parentTile.refine;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tsetTileActive( tile, state ) {\r\n\r\n\t}\r\n\r\n\tsetTileVisible( tile, state ) {\r\n\r\n\t}\r\n\r\n\tcalculateError( tile ) {\r\n\r\n\t\treturn 0;\r\n\r\n\t}\r\n\r\n\ttileInView( tile ) {\r\n\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\t// Private Functions\r\n\tfetchTileSet( url, fetchOptions, parent = null ) {\r\n\r\n\t\treturn fetch( url, fetchOptions )\r\n\t\t\t.then( res => {\r\n\r\n\t\t\t\tif ( res.ok ) {\r\n\r\n\t\t\t\t\treturn res.json();\r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tthrow new Error( `TilesRenderer: Failed to load tileset \"${ url }\" with status ${ res.status } : ${ res.statusText }` );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} )\r\n\t\t\t.then( json => {\r\n\r\n\t\t\t\tconst version = json.asset.version;\r\n\t\t\t\tconsole.assert(\r\n\t\t\t\t\tversion === '1.0' || version === '0.0',\r\n\t\t\t\t\t'asset.version is expected to be a string of \"1.0\" or \"0.0\"'\r\n\t\t\t\t);\r\n\r\n\t\t\t\tconst basePath = path__WEBPACK_IMPORTED_MODULE_0___default.a.dirname( url );\r\n\r\n\t\t\t\tObject(_traverseFunctions_js__WEBPACK_IMPORTED_MODULE_4__[\"traverseSet\"])(\r\n\t\t\t\t\tjson.root,\r\n\t\t\t\t\t( node, parent ) => this.preprocessNode( node, parent, basePath ),\r\n\t\t\t\t\tnull,\r\n\t\t\t\t\tparent,\r\n\t\t\t\t\tparent ? parent.__depth : 0,\r\n\t\t\t\t);\r\n\r\n\t\t\t\treturn json;\r\n\r\n\t\t\t} );\r\n\r\n\t}\r\n\r\n\tloadRootTileSet( url ) {\r\n\r\n\t\tconst tileSets = this.tileSets;\r\n\t\tif ( ! ( url in tileSets ) ) {\r\n\r\n\t\t\tconst pr = this\r\n\t\t\t\t.fetchTileSet( url, this.fetchOptions )\r\n\t\t\t\t.then( json => {\r\n\r\n\t\t\t\t\ttileSets[ url ] = json;\r\n\r\n\t\t\t\t} );\r\n\r\n\t\t\tpr.catch( err => {\r\n\r\n\t\t\t\tconsole.error( err );\r\n\t\t\t\ttileSets[ url ] = err;\r\n\r\n\t\t\t} );\r\n\r\n\t\t\ttileSets[ url ] = pr;\r\n\r\n\t\t\treturn pr;\r\n\r\n\t\t} else if ( tileSets[ url ] instanceof Error ) {\r\n\r\n\t\t\treturn Promise.reject( tileSets[ url ] );\r\n\r\n\t\t} else {\r\n\r\n\t\t\treturn Promise.resolve( tileSets[ url ] );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\trequestTileContents( tile ) {\r\n\r\n\t\t// If the tile is already being loaded then don't\r\n\t\t// start it again.\r\n\t\tif ( tile.__loadingState !== _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"UNLOADED\"] ) {\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t\tconst stats = this.stats;\r\n\t\tconst lruCache = this.lruCache;\r\n\t\tconst downloadQueue = this.downloadQueue;\r\n\t\tconst parseQueue = this.parseQueue;\r\n\t\tconst isExternalTileSet = tile.__externalTileSet;\r\n\t\tlruCache.add( tile, t => {\r\n\r\n\t\t\t// Stop the load if it's started\r\n\t\t\tif ( t.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"LOADING\"] ) {\r\n\r\n\t\t\t\tt.__loadAbort.abort();\r\n\t\t\t\tt.__loadAbort = null;\r\n\r\n\t\t\t} else if ( isExternalTileSet ) {\r\n\r\n\t\t\t\tt.children.length = 0;\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\tthis.disposeTile( t );\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// Decrement stats\r\n\t\t\tif ( t.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"LOADING\"] ) {\r\n\r\n\t\t\t\tstats.downloading --;\r\n\r\n\t\t\t} else if ( t.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"PARSING\"] ) {\r\n\r\n\t\t\t\tstats.parsing --;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tt.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"UNLOADED\"];\r\n\t\t\tt.__loadIndex ++;\r\n\r\n\t\t\tparseQueue.remove( t );\r\n\t\t\tdownloadQueue.remove( t );\r\n\r\n\t\t} );\r\n\r\n\t\t// Track a new load index so we avoid the condition where this load is stopped and\r\n\t\t// another begins soon after so we don't parse twice.\r\n\t\ttile.__loadIndex ++;\r\n\t\tconst loadIndex = tile.__loadIndex;\r\n\t\tconst controller = new AbortController();\r\n\t\tconst signal = controller.signal;\r\n\r\n\t\tstats.downloading ++;\r\n\t\ttile.__loadAbort = controller;\r\n\t\ttile.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"LOADING\"];\r\n\r\n\t\tconst errorCallback = e => {\r\n\r\n\t\t\t// if it has been unloaded then the tile has been disposed\r\n\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\treturn;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( e.name !== 'AbortError' ) {\r\n\r\n\t\t\t\tparseQueue.remove( tile );\r\n\t\t\t\tdownloadQueue.remove( tile );\r\n\r\n\t\t\t\tif ( tile.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"PARSING\"] ) {\r\n\r\n\t\t\t\t\tstats.parsing --;\r\n\r\n\t\t\t\t} else if ( tile.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"LOADING\"] ) {\r\n\r\n\t\t\t\t\tstats.downloading --;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tstats.failed ++;\r\n\r\n\t\t\t\tconsole.error( `TilesRenderer : Failed to load tile at url \"${ tile.content.uri }\".` );\r\n\t\t\t\tconsole.error( e );\r\n\t\t\t\ttile.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"FAILED\"];\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\tlruCache.remove( tile );\r\n\r\n\t\t\t}\r\n\r\n\t\t};\r\n\r\n\t\tif ( isExternalTileSet ) {\r\n\r\n\t\t\tdownloadQueue.add( tile, tile => {\r\n\r\n\t\t\t\t// if it has been unloaded then the tile has been disposed\r\n\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\treturn Promise.resolve();\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst uri = this.preprocessURL ? this.preprocessURL( tile.content.uri ) : tile.content.uri;\r\n\t\t\t\treturn this.fetchTileSet( uri, Object.assign( { signal }, this.fetchOptions ), tile );\r\n\r\n\t\t\t} )\r\n\t\t\t\t.then( json => {\r\n\r\n\t\t\t\t\t// if it has been unloaded then the tile has been disposed\r\n\t\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tstats.downloading --;\r\n\t\t\t\t\ttile.__loadAbort = null;\r\n\t\t\t\t\ttile.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"LOADED\"];\r\n\r\n\t\t\t\t\ttile.children.push( json.root );\r\n\r\n\t\t\t\t} )\r\n\t\t\t\t.catch( errorCallback );\r\n\r\n\t\t} else {\r\n\r\n\t\t\tdownloadQueue.add( tile, tile => {\r\n\r\n\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\treturn Promise.resolve();\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst uri = this.preprocessURL ? this.preprocessURL( tile.content.uri ) : tile.content.uri;\r\n\t\t\t\treturn fetch( uri, Object.assign( { signal }, this.fetchOptions ) );\r\n\r\n\t\t\t} )\r\n\t\t\t\t.then( res => {\r\n\r\n\t\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ( res.ok ) {\r\n\r\n\t\t\t\t\t\treturn res.arrayBuffer();\r\n\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\tthrow new Error( `Failed to load model with error code ${res.status}` );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} )\r\n\t\t\t\t.then( buffer => {\r\n\r\n\t\t\t\t\t// if it has been unloaded then the tile has been disposed\r\n\t\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tstats.downloading --;\r\n\t\t\t\t\tstats.parsing ++;\r\n\t\t\t\t\ttile.__loadAbort = null;\r\n\t\t\t\t\ttile.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"PARSING\"];\r\n\r\n\t\t\t\t\treturn parseQueue.add( tile, tile => {\r\n\r\n\t\t\t\t\t\t// if it has been unloaded then the tile has been disposed\r\n\t\t\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\t\t\treturn Promise.resolve();\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tconst uri = tile.content.uri;\r\n\t\t\t\t\t\tconst extension = uri.split( /\\./g ).pop();\r\n\r\n\t\t\t\t\t\treturn this.parseTile( buffer, tile, extension );\r\n\r\n\t\t\t\t\t} );\r\n\r\n\t\t\t\t} )\r\n\t\t\t\t.then( () => {\r\n\r\n\t\t\t\t\t// if it has been unloaded then the tile has been disposed\r\n\t\t\t\t\tif ( tile.__loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tstats.parsing --;\r\n\t\t\t\t\ttile.__loadingState = _constants_js__WEBPACK_IMPORTED_MODULE_5__[\"LOADED\"];\r\n\r\n\t\t\t\t\tif ( tile.__wasSetVisible ) {\r\n\r\n\t\t\t\t\t\tthis.setTileVisible( tile, true );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ( tile.__wasSetActive ) {\r\n\r\n\t\t\t\t\t\tthis.setTileActive( tile, true );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} )\r\n\t\t\t\t.catch( errorCallback );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tdispose() {\r\n\r\n\t\tconst lruCache = this.lruCache;\r\n\t\tthis.traverse( tile => {\r\n\r\n\t\t\tlruCache.remove( tile );\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/TilesRendererBase.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/base/constants.js": +/*!**************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/base/constants.js ***! + \**************************************************************/ +/*! exports provided: UNLOADED, LOADING, PARSING, LOADED, FAILED */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"UNLOADED\", function() { return UNLOADED; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LOADING\", function() { return LOADING; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PARSING\", function() { return PARSING; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LOADED\", function() { return LOADED; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FAILED\", function() { return FAILED; });\nconst UNLOADED = 0;\nconst LOADING = 1;\nconst PARSING = 2;\nconst LOADED = 3;\nconst FAILED = 4;\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/constants.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/base/traverseFunctions.js": +/*!**********************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/base/traverseFunctions.js ***! + \**********************************************************************/ +/*! exports provided: traverseSet, determineFrustumSet, markUsedSetLeaves, skipTraversal, toggleTiles */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"traverseSet\", function() { return traverseSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determineFrustumSet\", function() { return determineFrustumSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"markUsedSetLeaves\", function() { return markUsedSetLeaves; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"skipTraversal\", function() { return skipTraversal; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toggleTiles\", function() { return toggleTiles; });\n/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants.js */ \"./node_modules/3d-tiles-renderer/src/base/constants.js\");\n\r\n\r\nfunction isDownloadFinished( value ) {\r\n\r\n\treturn value === _constants_js__WEBPACK_IMPORTED_MODULE_0__[\"LOADED\"] || value === _constants_js__WEBPACK_IMPORTED_MODULE_0__[\"FAILED\"];\r\n\r\n}\r\n\r\n// Checks whether this tile was last used on the given frame.\r\nfunction isUsedThisFrame( tile, frameCount ) {\r\n\r\n\treturn tile.__lastFrameVisited === frameCount && tile.__used;\r\n\r\n}\r\n\r\n// Resets the frame frame information for the given tile\r\nfunction resetFrameState( tile, frameCount ) {\r\n\r\n\tif ( tile.__lastFrameVisited !== frameCount ) {\r\n\r\n\t\ttile.__lastFrameVisited = frameCount;\r\n\t\ttile.__used = false;\r\n\t\ttile.__inFrustum = false;\r\n\t\ttile.__isLeaf = false;\r\n\t\ttile.__visible = false;\r\n\t\ttile.__active = false;\r\n\t\ttile.__error = 0;\r\n\t\ttile.__childrenWereVisible = false;\r\n\t\ttile.__allChildrenLoaded = false;\r\n\r\n\t}\r\n\r\n}\r\n\r\n// Recursively mark tiles used down to the next tile with content\r\nfunction recursivelyMarkUsed( tile, frameCount, lruCache ) {\r\n\r\n\tresetFrameState( tile, frameCount );\r\n\r\n\ttile.__used = true;\r\n\tlruCache.markUsed( tile );\r\n\tif ( tile.__contentEmpty ) {\r\n\r\n\t\tconst children = tile.children;\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\trecursivelyMarkUsed( children[ i ], frameCount, lruCache );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\r\nfunction recursivelyLoadTiles( tile, depthFromRenderedParent, renderer ) {\r\n\r\n\t// Try to load any external tile set children if the external tile set has loaded.\r\n\tconst doTraverse =\r\n\t\ttile.__contentEmpty && (\r\n\t\t\t! tile.__externalTileSet ||\r\n\t\t\tisDownloadFinished( tile.__loadingState )\r\n\t\t);\r\n\tif ( doTraverse ) {\r\n\r\n\t\tconst children = tile.children;\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\t// don't increment depth to rendered parent here because we should treat\r\n\t\t\t// the next layer of rendered children as just a single depth away for the\r\n\t\t\t// sake of sorting.\r\n\t\t\tconst child = children[ i ];\r\n\t\t\tchild.__depthFromRenderedParent = depthFromRenderedParent;\r\n\t\t\trecursivelyLoadTiles( child, depthFromRenderedParent, renderer );\r\n\r\n\t\t}\r\n\r\n\t} else {\r\n\r\n\t\trenderer.requestTileContents( tile );\r\n\r\n\t}\r\n\r\n}\r\n\r\n// Helper function for recursively traversing a tile set. If `beforeCb` returns `true` then the\r\n// traversal will end early.\r\nfunction traverseSet( tile, beforeCb = null, afterCb = null, parent = null, depth = 0 ) {\r\n\r\n\tif ( beforeCb && beforeCb( tile, parent, depth ) ) {\r\n\r\n\t\tif ( afterCb ) {\r\n\r\n\t\t\tafterCb( tile, parent, depth );\r\n\r\n\t\t}\r\n\r\n\t\treturn;\r\n\r\n\t}\r\n\r\n\tconst children = tile.children;\r\n\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\ttraverseSet( children[ i ], beforeCb, afterCb, tile, depth + 1 );\r\n\r\n\t}\r\n\r\n\tif ( afterCb ) {\r\n\r\n\t\tafterCb( tile, parent, depth );\r\n\r\n\t}\r\n\r\n}\r\n\r\n// Determine which tiles are within the camera frustum.\r\n// TODO: this is marking items as used in the lrucache, which means some data is\r\n// being kept around that isn't being used -- is that okay?\r\nfunction determineFrustumSet( tile, renderer ) {\r\n\r\n\tconst stats = renderer.stats;\r\n\tconst frameCount = renderer.frameCount;\r\n\tconst errorTarget = renderer.errorTarget;\r\n\tconst maxDepth = renderer.maxDepth;\r\n\tconst loadSiblings = renderer.loadSiblings;\r\n\tconst lruCache = renderer.lruCache;\r\n\tconst stopAtEmptyTiles = renderer.stopAtEmptyTiles;\r\n\tresetFrameState( tile, frameCount );\r\n\r\n\t// Early out if this tile is not within view.\r\n\tconst inFrustum = renderer.tileInView( tile );\r\n\tif ( inFrustum === false ) {\r\n\r\n\t\treturn false;\r\n\r\n\t}\r\n\r\n\ttile.__used = true;\r\n\tlruCache.markUsed( tile );\r\n\r\n\ttile.__inFrustum = true;\r\n\tstats.inFrustum ++;\r\n\r\n\t// Early out if this tile has less error than we're targeting but don't stop\r\n\t// at an external tile set.\r\n\tif ( ( stopAtEmptyTiles || ! tile.__contentEmpty ) && ! tile.__externalTileSet ) {\r\n\r\n\t\tconst error = renderer.calculateError( tile );\r\n\t\ttile.__error = error;\r\n\t\tif ( error <= errorTarget ) {\r\n\r\n\t\t\treturn true;\r\n\r\n\t\t}\r\n\r\n\t\t// Early out if we've reached the maximum allowed depth.\r\n\t\tif ( renderer.maxDepth > 0 && tile.__depth + 1 >= maxDepth ) {\r\n\r\n\t\t\treturn true;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// Traverse children and see if any children are in view.\r\n\tlet anyChildrenUsed = false;\r\n\tconst children = tile.children;\r\n\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\tconst c = children[ i ];\r\n\t\tconst r = determineFrustumSet( c, renderer );\r\n\t\tanyChildrenUsed = anyChildrenUsed || r;\r\n\r\n\t}\r\n\r\n\t// If there are children within view and we are loading siblings then mark\r\n\t// all sibling tiles as used, as well.\r\n\tif ( anyChildrenUsed && loadSiblings ) {\r\n\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\tconst c = children[ i ];\r\n\t\t\trecursivelyMarkUsed( c, frameCount, lruCache );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\treturn true;\r\n\r\n}\r\n\r\n// Traverse and mark the tiles that are at the leaf nodes of the \"used\" tree.\r\nfunction markUsedSetLeaves( tile, renderer ) {\r\n\r\n\tconst stats = renderer.stats;\r\n\tconst frameCount = renderer.frameCount;\r\n\tif ( ! isUsedThisFrame( tile, frameCount ) ) {\r\n\r\n\t\treturn;\r\n\r\n\t}\r\n\r\n\tstats.used ++;\r\n\r\n\t// This tile is a leaf if none of the children had been used.\r\n\tconst children = tile.children;\r\n\tlet anyChildrenUsed = false;\r\n\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\tconst c = children[ i ];\r\n\t\tanyChildrenUsed = anyChildrenUsed || isUsedThisFrame( c, frameCount );\r\n\r\n\t}\r\n\r\n\r\n\tif ( ! anyChildrenUsed ) {\r\n\r\n\t\t// TODO: This isn't necessarily right because it's possible that a parent tile is considered in the\r\n\t\t// frustum while the child tiles are not, making them unused. If all children have loaded and were properly\r\n\t\t// considered to be in the used set then we shouldn't set ourselves to a leaf here.\r\n\t\ttile.__isLeaf = true;\r\n\r\n\t} else {\r\n\r\n\t\tlet childrenWereVisible = false;\r\n\t\tlet allChildrenLoaded = true;\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\tconst c = children[ i ];\r\n\t\t\tmarkUsedSetLeaves( c, renderer );\r\n\t\t\tchildrenWereVisible = childrenWereVisible || c.__wasSetVisible || c.__childrenWereVisible;\r\n\r\n\t\t\tif ( isUsedThisFrame( c, frameCount ) ) {\r\n\r\n\t\t\t\tconst childLoaded =\r\n\t\t\t\t\tc.__allChildrenLoaded ||\r\n\t\t\t\t\t( ! c.__contentEmpty && isDownloadFinished( c.__loadingState ) ) ||\r\n\t\t\t\t\t( c.__externalTileSet && c.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_0__[\"FAILED\"] );\r\n\t\t\t\tallChildrenLoaded = allChildrenLoaded && childLoaded;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\ttile.__childrenWereVisible = childrenWereVisible;\r\n\t\ttile.__allChildrenLoaded = allChildrenLoaded;\r\n\r\n\r\n\t}\r\n\r\n}\r\n\r\n// Skip past tiles we consider unrenderable because they are outside the error threshold.\r\nfunction skipTraversal( tile, renderer ) {\r\n\r\n\tconst stats = renderer.stats;\r\n\tconst frameCount = renderer.frameCount;\r\n\tif ( ! isUsedThisFrame( tile, frameCount ) ) {\r\n\r\n\t\treturn;\r\n\r\n\t}\r\n\r\n\tconst parent = tile.parent;\r\n\tconst parentDepthToParent = parent ? parent.__depthFromRenderedParent : - 1;\r\n\ttile.__depthFromRenderedParent = parentDepthToParent;\r\n\r\n\t// Request the tile contents or mark it as visible if we've found a leaf.\r\n\tconst lruCache = renderer.lruCache;\r\n\tif ( tile.__isLeaf ) {\r\n\r\n\t\ttile.__depthFromRenderedParent ++;\r\n\r\n\t\tif ( tile.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_0__[\"LOADED\"] ) {\r\n\r\n\t\t\tif ( tile.__inFrustum ) {\r\n\r\n\t\t\t\ttile.__visible = true;\r\n\t\t\t\tstats.visible ++;\r\n\r\n\t\t\t}\r\n\t\t\ttile.__active = true;\r\n\t\t\tstats.active ++;\r\n\r\n\t\t} else if ( ! lruCache.isFull() && ( ! tile.__contentEmpty || tile.__externalTileSet ) ) {\r\n\r\n\t\t\trenderer.requestTileContents( tile );\r\n\r\n\t\t}\r\n\r\n\t\treturn;\r\n\r\n\t}\r\n\r\n\tconst errorRequirement = ( renderer.errorTarget + 1 ) * renderer.errorThreshold;\r\n\tconst meetsSSE = tile.__error <= errorRequirement;\r\n\tconst includeTile = meetsSSE || tile.refine === 'ADD';\r\n\tconst hasModel = ! tile.__contentEmpty;\r\n\tconst hasContent = hasModel || tile.__externalTileSet;\r\n\tconst loadedContent = isDownloadFinished( tile.__loadingState ) && hasContent;\r\n\tconst childrenWereVisible = tile.__childrenWereVisible;\r\n\tconst children = tile.children;\r\n\tlet allChildrenHaveContent = tile.__allChildrenLoaded;\r\n\r\n\t// Increment the relative depth of the node to the nearest rendered parent if it has content\r\n\t// and is being rendered.\r\n\tif ( includeTile && hasModel ) {\r\n\r\n\t\ttile.__depthFromRenderedParent ++;\r\n\r\n\t}\r\n\r\n\t// If we've met the SSE requirements and we can load content then fire a fetch.\r\n\tif ( includeTile && ! loadedContent && ! lruCache.isFull() && hasContent ) {\r\n\r\n\t\trenderer.requestTileContents( tile );\r\n\r\n\t}\r\n\r\n\t// Only mark this tile as visible if it meets the screen space error requirements, has loaded content, not\r\n\t// all children have loaded yet, and if no children were visible last frame. We want to keep children visible\r\n\t// that _were_ visible to avoid a pop in level of detail as the camera moves around and parent / sibling tiles\r\n\t// load in.\r\n\r\n\t// Skip the tile entirely if there's no content to load\r\n\tif (\r\n\t\t( meetsSSE && ! allChildrenHaveContent && ! childrenWereVisible && loadedContent )\r\n\t\t\t|| ( tile.refine === 'ADD' && loadedContent )\r\n\t) {\r\n\r\n\t\tif ( tile.__inFrustum ) {\r\n\r\n\t\t\ttile.__visible = true;\r\n\t\t\tstats.visible ++;\r\n\r\n\t\t}\r\n\t\ttile.__active = true;\r\n\t\tstats.active ++;\r\n\r\n\t}\r\n\r\n\t// If we're additive then don't stop the traversal here because it doesn't matter whether the children load in\r\n\t// at the same rate.\r\n\tif ( tile.refine !== 'ADD' && meetsSSE && ! allChildrenHaveContent && loadedContent ) {\r\n\r\n\t\t// load the child content if we've found that we've been loaded so we can move down to the next tile\r\n\t\t// layer when the data has loaded.\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\tconst c = children[ i ];\r\n\t\t\tif ( isUsedThisFrame( c, frameCount ) && ! lruCache.isFull() ) {\r\n\r\n\t\t\t\tc.__depthFromRenderedParent = tile.__depthFromRenderedParent + 1;\r\n\t\t\t\trecursivelyLoadTiles( c, c.__depthFromRenderedParent, renderer );\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t} else {\r\n\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\tconst c = children[ i ];\r\n\t\t\tif ( isUsedThisFrame( c, frameCount ) ) {\r\n\r\n\t\t\t\tskipTraversal( c, renderer );\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\r\n// Final traverse to toggle tile visibility.\r\nfunction toggleTiles( tile, renderer ) {\r\n\r\n\tconst frameCount = renderer.frameCount;\r\n\tconst isUsed = isUsedThisFrame( tile, frameCount );\r\n\tif ( isUsed || tile.__usedLastFrame ) {\r\n\r\n\t\tlet setActive = false;\r\n\t\tlet setVisible = false;\r\n\t\tif ( isUsed ) {\r\n\r\n\t\t\t// enable visibility if active due to shadows\r\n\t\t\tsetActive = tile.__active;\r\n\t\t\tif ( renderer.displayActiveTiles ) {\r\n\r\n\t\t\t\tsetVisible = tile.__active || tile.__visible;\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\tsetVisible = tile.__visible;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t// If the active or visible state changed then call the functions.\r\n\t\tif ( ! tile.__contentEmpty && tile.__loadingState === _constants_js__WEBPACK_IMPORTED_MODULE_0__[\"LOADED\"] ) {\r\n\r\n\t\t\tif ( tile.__wasSetActive !== setActive ) {\r\n\r\n\t\t\t\trenderer.setTileActive( tile, setActive );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( tile.__wasSetVisible !== setVisible ) {\r\n\r\n\t\t\t\trenderer.setTileVisible( tile, setVisible );\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\ttile.__wasSetActive = setActive;\r\n\t\ttile.__wasSetVisible = setVisible;\r\n\t\ttile.__usedLastFrame = isUsed;\r\n\r\n\t\tconst children = tile.children;\r\n\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\tconst c = children[ i ];\r\n\t\t\ttoggleTiles( c, renderer );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/base/traverseFunctions.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/index.js": +/*!*****************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/index.js ***! + \*****************************************************/ +/*! exports provided: DebugTilesRenderer, TilesRenderer, B3DMLoader, PNTSLoader, I3DMLoader, CMPTLoader, TilesRendererBase, B3DMLoaderBase, I3DMLoaderBase, PNTSLoaderBase, CMPTLoaderBase, LRUCache, PriorityQueue, NONE, SCREEN_ERROR, GEOMETRIC_ERROR, DISTANCE, DEPTH, RELATIVE_DEPTH, IS_LEAF, RANDOM_COLOR */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./three/DebugTilesRenderer.js */ \"./node_modules/3d-tiles-renderer/src/three/DebugTilesRenderer.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"DebugTilesRenderer\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"DebugTilesRenderer\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"NONE\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"NONE\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SCREEN_ERROR\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"SCREEN_ERROR\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"GEOMETRIC_ERROR\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"GEOMETRIC_ERROR\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"DISTANCE\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"DISTANCE\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"DEPTH\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"DEPTH\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"RELATIVE_DEPTH\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"RELATIVE_DEPTH\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"IS_LEAF\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"IS_LEAF\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"RANDOM_COLOR\", function() { return _three_DebugTilesRenderer_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM_COLOR\"]; });\n\n/* harmony import */ var _three_TilesRenderer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./three/TilesRenderer.js */ \"./node_modules/3d-tiles-renderer/src/three/TilesRenderer.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TilesRenderer\", function() { return _three_TilesRenderer_js__WEBPACK_IMPORTED_MODULE_1__[\"TilesRenderer\"]; });\n\n/* harmony import */ var _three_B3DMLoader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./three/B3DMLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/B3DMLoader.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"B3DMLoader\", function() { return _three_B3DMLoader_js__WEBPACK_IMPORTED_MODULE_2__[\"B3DMLoader\"]; });\n\n/* harmony import */ var _three_PNTSLoader_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./three/PNTSLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/PNTSLoader.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PNTSLoader\", function() { return _three_PNTSLoader_js__WEBPACK_IMPORTED_MODULE_3__[\"PNTSLoader\"]; });\n\n/* harmony import */ var _three_I3DMLoader_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./three/I3DMLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/I3DMLoader.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"I3DMLoader\", function() { return _three_I3DMLoader_js__WEBPACK_IMPORTED_MODULE_4__[\"I3DMLoader\"]; });\n\n/* harmony import */ var _three_CMPTLoader_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./three/CMPTLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/CMPTLoader.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"CMPTLoader\", function() { return _three_CMPTLoader_js__WEBPACK_IMPORTED_MODULE_5__[\"CMPTLoader\"]; });\n\n/* harmony import */ var _base_TilesRendererBase_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./base/TilesRendererBase.js */ \"./node_modules/3d-tiles-renderer/src/base/TilesRendererBase.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TilesRendererBase\", function() { return _base_TilesRendererBase_js__WEBPACK_IMPORTED_MODULE_6__[\"TilesRendererBase\"]; });\n\n/* harmony import */ var _base_B3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./base/B3DMLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/B3DMLoaderBase.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"B3DMLoaderBase\", function() { return _base_B3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_7__[\"B3DMLoaderBase\"]; });\n\n/* harmony import */ var _base_I3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./base/I3DMLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/I3DMLoaderBase.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"I3DMLoaderBase\", function() { return _base_I3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_8__[\"I3DMLoaderBase\"]; });\n\n/* harmony import */ var _base_PNTSLoaderBase_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./base/PNTSLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/PNTSLoaderBase.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PNTSLoaderBase\", function() { return _base_PNTSLoaderBase_js__WEBPACK_IMPORTED_MODULE_9__[\"PNTSLoaderBase\"]; });\n\n/* harmony import */ var _base_CMPTLoaderBase_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./base/CMPTLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/CMPTLoaderBase.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"CMPTLoaderBase\", function() { return _base_CMPTLoaderBase_js__WEBPACK_IMPORTED_MODULE_10__[\"CMPTLoaderBase\"]; });\n\n/* harmony import */ var _utilities_LRUCache_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utilities/LRUCache.js */ \"./node_modules/3d-tiles-renderer/src/utilities/LRUCache.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"LRUCache\", function() { return _utilities_LRUCache_js__WEBPACK_IMPORTED_MODULE_11__[\"LRUCache\"]; });\n\n/* harmony import */ var _utilities_PriorityQueue_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utilities/PriorityQueue.js */ \"./node_modules/3d-tiles-renderer/src/utilities/PriorityQueue.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PriorityQueue\", function() { return _utilities_PriorityQueue_js__WEBPACK_IMPORTED_MODULE_12__[\"PriorityQueue\"]; });\n\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/index.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/three/B3DMLoader.js": +/*!****************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/three/B3DMLoader.js ***! + \****************************************************************/ +/*! exports provided: B3DMLoader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"B3DMLoader\", function() { return B3DMLoader; });\n/* harmony import */ var _base_B3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/B3DMLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/B3DMLoaderBase.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var three_examples_jsm_loaders_GLTFLoader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! three/examples/jsm/loaders/GLTFLoader.js */ \"./node_modules/three/examples/jsm/loaders/GLTFLoader.js\");\n\r\n\r\n\r\n\r\nclass B3DMLoader extends _base_B3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_0__[\"B3DMLoaderBase\"] {\r\n\r\n\tconstructor( manager = three__WEBPACK_IMPORTED_MODULE_1__[\"DefaultLoadingManager\"] ) {\r\n\r\n\t\tsuper();\r\n\t\tthis.manager = manager;\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\tconst b3dm = super.parse( buffer );\r\n\t\tconst gltfBuffer = b3dm.glbBytes.slice().buffer;\r\n\t\treturn new Promise( ( resolve, reject ) => {\r\n\r\n\t\t\tconst manager = this.manager;\r\n\t\t\tconst loader = manager.getHandler( 'path.gltf' ) || new three_examples_jsm_loaders_GLTFLoader_js__WEBPACK_IMPORTED_MODULE_2__[\"GLTFLoader\"]( manager );\r\n\t\t\tloader.parse( gltfBuffer, null, model => {\r\n\r\n\t\t\t\tconst { batchTable, featureTable } = b3dm;\r\n\t\t\t\tconst { scene } = model;\r\n\r\n\t\t\t\tconst rtcCenter = featureTable.getData( 'RTC_CENTER' );\r\n\t\t\t\tif ( rtcCenter ) {\r\n\r\n\t\t\t\t\tscene.position.x += rtcCenter[ 0 ];\r\n\t\t\t\t\tscene.position.y += rtcCenter[ 1 ];\r\n\t\t\t\t\tscene.position.z += rtcCenter[ 2 ];\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tmodel.batchTable = batchTable;\r\n\t\t\t\tmodel.featureTable = featureTable;\r\n\r\n\t\t\t\tscene.batchTable = batchTable;\r\n\t\t\t\tscene.featureTable = featureTable;\r\n\r\n\t\t\t\tresolve( model );\r\n\r\n\t\t\t}, reject );\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/B3DMLoader.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/three/CMPTLoader.js": +/*!****************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/three/CMPTLoader.js ***! + \****************************************************************/ +/*! exports provided: CMPTLoader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CMPTLoader\", function() { return CMPTLoader; });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _base_CMPTLoaderBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../base/CMPTLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/CMPTLoaderBase.js\");\n/* harmony import */ var _B3DMLoader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./B3DMLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/B3DMLoader.js\");\n/* harmony import */ var _PNTSLoader_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PNTSLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/PNTSLoader.js\");\n/* harmony import */ var _I3DMLoader_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./I3DMLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/I3DMLoader.js\");\n\r\n\r\n\r\n\r\n\r\n\r\nclass CMPTLoader extends _base_CMPTLoaderBase_js__WEBPACK_IMPORTED_MODULE_1__[\"CMPTLoaderBase\"] {\r\n\r\n\tconstructor( manager = three__WEBPACK_IMPORTED_MODULE_0__[\"DefaultLoadingManager\"] ) {\r\n\r\n\t\tsuper();\r\n\t\tthis.manager = manager;\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\tconst result = super.parse( buffer );\r\n\t\tconst manager = this.manager;\r\n\t\tconst group = new three__WEBPACK_IMPORTED_MODULE_0__[\"Group\"]();\r\n\t\tconst results = [];\r\n\t\tconst promises = [];\r\n\r\n\t\tfor ( const i in result.tiles ) {\r\n\r\n\t\t\tconst { type, buffer } = result.tiles[ i ];\r\n\t\t\tswitch ( type ) {\r\n\r\n\t\t\t\tcase 'b3dm': {\r\n\r\n\t\t\t\t\tconst slicedBuffer = buffer.slice();\r\n\t\t\t\t\tconst promise = new _B3DMLoader_js__WEBPACK_IMPORTED_MODULE_2__[\"B3DMLoader\"]( manager )\r\n\t\t\t\t\t\t.parse( slicedBuffer.buffer )\r\n\t\t\t\t\t\t.then( res => {\r\n\r\n\t\t\t\t\t\t\tresults.push( res );\r\n\t\t\t\t\t\t\tgroup.add( res.scene );\r\n\r\n\t\t\t\t\t\t} );\r\n\r\n\t\t\t\t\tpromises.push( promise );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcase 'pnts': {\r\n\r\n\t\t\t\t\tconst slicedBuffer = buffer.slice();\r\n\t\t\t\t\tconst pointsResult = new _PNTSLoader_js__WEBPACK_IMPORTED_MODULE_3__[\"PNTSLoader\"]( manager ).parse( slicedBuffer.buffer );\r\n\t\t\t\t\tresults.push( pointsResult );\r\n\t\t\t\t\tgroup.add( pointsResult.scene );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcase 'i3dm': {\r\n\r\n\t\t\t\t\tconst slicedBuffer = buffer.slice();\r\n\t\t\t\t\tconst loader = new _I3DMLoader_js__WEBPACK_IMPORTED_MODULE_4__[\"I3DMLoader\"]( manager );\r\n\t\t\t\t\tloader.workingPath = this.workingPath;\r\n\t\t\t\t\tloader.fetchOptions = this.fetchOptions;\r\n\r\n\t\t\t\t\tconst promise = loader\r\n\t\t\t\t\t\t.parse( slicedBuffer.buffer )\r\n\t\t\t\t\t\t.then( res => {\r\n\r\n\t\t\t\t\t\t\tresults.push( res );\r\n\t\t\t\t\t\t\tgroup.add( res.scene );\r\n\r\n\t\t\t\t\t\t} );\r\n\t\t\t\t\tpromises.push( promise );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn Promise.all( promises ).then( () => {\r\n\r\n\t\t\treturn {\r\n\r\n\t\t\t\ttiles: results,\r\n\t\t\t\tscene: group,\r\n\r\n\t\t\t};\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/CMPTLoader.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/three/DebugTilesRenderer.js": +/*!************************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/three/DebugTilesRenderer.js ***! + \************************************************************************/ +/*! exports provided: NONE, SCREEN_ERROR, GEOMETRIC_ERROR, DISTANCE, DEPTH, RELATIVE_DEPTH, IS_LEAF, RANDOM_COLOR, DebugTilesRenderer */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NONE\", function() { return NONE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SCREEN_ERROR\", function() { return SCREEN_ERROR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GEOMETRIC_ERROR\", function() { return GEOMETRIC_ERROR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DISTANCE\", function() { return DISTANCE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEPTH\", function() { return DEPTH; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RELATIVE_DEPTH\", function() { return RELATIVE_DEPTH; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"IS_LEAF\", function() { return IS_LEAF; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RANDOM_COLOR\", function() { return RANDOM_COLOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DebugTilesRenderer\", function() { return DebugTilesRenderer; });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _TilesRenderer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TilesRenderer.js */ \"./node_modules/3d-tiles-renderer/src/three/TilesRenderer.js\");\n/* harmony import */ var _SphereHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SphereHelper.js */ \"./node_modules/3d-tiles-renderer/src/three/SphereHelper.js\");\n\r\n\r\n\r\n\r\nconst ORIGINAL_MATERIAL = Symbol( 'ORIGINAL_MATERIAL' );\r\nconst HAS_RANDOM_COLOR = Symbol( 'HAS_RANDOM_COLOR' );\r\n\r\nfunction emptyRaycast() {}\r\n\r\nconst NONE = 0;\r\nconst SCREEN_ERROR = 1;\r\nconst GEOMETRIC_ERROR = 2;\r\nconst DISTANCE = 3;\r\nconst DEPTH = 4;\r\nconst RELATIVE_DEPTH = 5;\r\nconst IS_LEAF = 6;\r\nconst RANDOM_COLOR = 7;\r\n\r\nclass DebugTilesRenderer extends _TilesRenderer_js__WEBPACK_IMPORTED_MODULE_1__[\"TilesRenderer\"] {\r\n\r\n\tconstructor( ...args ) {\r\n\r\n\t\tsuper( ...args );\r\n\r\n\t\tconst tilesGroup = this.group;\r\n\t\tconst boxGroup = new three__WEBPACK_IMPORTED_MODULE_0__[\"Group\"]();\r\n\t\ttilesGroup.add( boxGroup );\r\n\r\n\t\tconst sphereGroup = new three__WEBPACK_IMPORTED_MODULE_0__[\"Group\"]();\r\n\t\ttilesGroup.add( sphereGroup );\r\n\r\n\t\tthis.displayBoxBounds = false;\r\n\t\tthis.displaySphereBounds = false;\r\n\t\tthis.colorMode = NONE;\r\n\t\tthis.boxGroup = boxGroup;\r\n\t\tthis.sphereGroup = sphereGroup;\r\n\t\tthis.maxDebugDepth = - 1;\r\n\t\tthis.maxDebugDistance = - 1;\r\n\t\tthis.maxDebugError = - 1;\r\n\r\n\t\tthis.extremeDebugDepth = - 1;\r\n\t\tthis.extremeDebugError = - 1;\r\n\r\n\t}\r\n\r\n\tinitExtremes() {\r\n\r\n\t\t// initialize the extreme values of the hierarchy\r\n\t\tlet maxDepth = - 1;\r\n\t\tthis.traverse( tile => {\r\n\r\n\t\t\tmaxDepth = Math.max( maxDepth, tile.__depth );\r\n\r\n\t\t} );\r\n\r\n\t\tlet maxError = - 1;\r\n\t\tthis.traverse( tile => {\r\n\r\n\t\t\tmaxError = Math.max( maxError, tile.geometricError );\r\n\r\n\t\t} );\r\n\r\n\t\tthis.extremeDebugDepth = maxDepth;\r\n\t\tthis.extremeDebugError = maxError;\r\n\r\n\t}\r\n\r\n\tloadTileSet( ...args ) {\r\n\r\n\t\tconst pr = super.loadTileSet( ...args );\r\n\t\tpr\r\n\t\t\t.then( () => this.initExtremes() )\r\n\t\t\t.catch( () => {\r\n\r\n\t\t\t\t// error is logged internally\r\n\r\n\t\t\t} );\r\n\r\n\t\treturn pr;\r\n\r\n\t}\r\n\r\n\tgetTileInformationFromActiveObject( object ) {\r\n\r\n\t\t// Find which tile this scene is associated with. This is slow and\r\n\t\t// intended for debug purposes only.\r\n\t\tlet targetTile = null;\r\n\t\tconst activeTiles = this.activeTiles;\r\n\t\tactiveTiles.forEach( tile => {\r\n\r\n\t\t\tif ( targetTile ) {\r\n\r\n\t\t\t\treturn true;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tconst scene = tile.cached.scene;\r\n\t\t\tif ( scene ) {\r\n\r\n\t\t\t\tscene.traverse( c => {\r\n\r\n\t\t\t\t\tif ( c === object ) {\r\n\r\n\t\t\t\t\t\ttargetTile = tile;\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} );\r\n\r\n\t\t\t}\r\n\r\n\t\t} );\r\n\r\n\t\tif ( targetTile ) {\r\n\r\n\t\t\treturn {\r\n\r\n\t\t\t\tdistanceToCamera: targetTile.cached.distance,\r\n\t\t\t\tgeometricError: targetTile.geometricError,\r\n\t\t\t\tscreenSpaceError: targetTile.__error,\r\n\t\t\t\tdepth: targetTile.__depth,\r\n\t\t\t\tisLeaf: targetTile.__isLeaf\r\n\r\n\t\t\t};\r\n\r\n\t\t} else {\r\n\r\n\t\t\treturn null;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tupdate() {\r\n\r\n\t\tsuper.update();\r\n\r\n\t\tif ( ! this.root ) {\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t\t// set box or sphere visibility\r\n\t\tthis.boxGroup.visible = this.displayBoxBounds;\r\n\t\tthis.sphereGroup.visible = this.displaySphereBounds;\r\n\r\n\t\t// get max values to use for materials\r\n\t\tlet maxDepth = - 1;\r\n\t\tif ( this.maxDebugDepth === - 1 ) {\r\n\r\n\t\t\tmaxDepth = this.extremeDebugDepth;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tmaxDepth = this.maxDebugDepth;\r\n\r\n\t\t}\r\n\r\n\t\tlet maxError = - 1;\r\n\t\tif ( this.maxDebugError === - 1 ) {\r\n\r\n\t\t\tmaxError = this.extremeDebugError;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tmaxError = this.maxDebugError;\r\n\r\n\t\t}\r\n\r\n\t\tlet maxDistance = - 1;\r\n\t\tif ( this.maxDebugDistance === - 1 ) {\r\n\r\n\t\t\tmaxDistance = this.root.cached.sphere.radius;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tmaxDistance = this.maxDebugDistance;\r\n\r\n\t\t}\r\n\r\n\t\tconst errorTarget = this.errorTarget;\r\n\t\tconst colorMode = this.colorMode;\r\n\t\tconst visibleTiles = this.visibleTiles;\r\n\t\tvisibleTiles.forEach( tile => {\r\n\r\n\t\t\tconst scene = tile.cached.scene;\r\n\r\n\t\t\t// create a random color per-tile\r\n\t\t\tlet h, s, l;\r\n\t\t\tif ( colorMode === RANDOM_COLOR ) {\r\n\r\n\t\t\t\th = Math.random();\r\n\t\t\t\ts = 0.5 + Math.random() * 0.5;\r\n\t\t\t\tl = 0.375 + Math.random() * 0.25;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tscene.traverse( c => {\r\n\r\n\t\t\t\tconst currMaterial = c.material;\r\n\t\t\t\tif ( currMaterial ) {\r\n\r\n\t\t\t\t\t// Reset the material if needed\r\n\t\t\t\t\tconst originalMaterial = c[ ORIGINAL_MATERIAL ];\r\n\t\t\t\t\tif ( colorMode === NONE && currMaterial !== originalMaterial ) {\r\n\r\n\t\t\t\t\t\tc.material.dispose();\r\n\t\t\t\t\t\tc.material = c[ ORIGINAL_MATERIAL ];\r\n\r\n\t\t\t\t\t} else if ( colorMode !== NONE && currMaterial === originalMaterial ) {\r\n\r\n\t\t\t\t\t\tif ( c.isPoints ) {\r\n\r\n\t\t\t\t\t\t\tconst pointsMaterial = new three__WEBPACK_IMPORTED_MODULE_0__[\"PointsMaterial\"]();\r\n\t\t\t\t\t\t\tpointsMaterial.size = originalMaterial.size;\r\n\t\t\t\t\t\t\tpointsMaterial.sizeAttenuation = originalMaterial.sizeAttenuation;\r\n\t\t\t\t\t\t\tc.material = pointsMaterial;\r\n\r\n\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\tc.material = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]();\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ( colorMode !== RANDOM_COLOR ) {\r\n\r\n\t\t\t\t\t\tdelete c.material[ HAS_RANDOM_COLOR ];\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Set the color on the basic material\r\n\t\t\t\t\tswitch ( colorMode ) {\r\n\r\n\t\t\t\t\t\tcase DEPTH: {\r\n\r\n\t\t\t\t\t\t\tconst val = tile.__depth / maxDepth;\r\n\t\t\t\t\t\t\tc.material.color.setRGB( val, val, val );\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase RELATIVE_DEPTH: {\r\n\r\n\t\t\t\t\t\t\tconst val = tile.__depthFromRenderedParent / maxDepth;\r\n\t\t\t\t\t\t\tc.material.color.setRGB( val, val, val );\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase SCREEN_ERROR: {\r\n\r\n\t\t\t\t\t\t\tconst val = tile.__error / errorTarget;\r\n\t\t\t\t\t\t\tif ( val > 1.0 ) {\r\n\r\n\t\t\t\t\t\t\t\tc.material.color.setRGB( 1.0, 0.0, 0.0 );\r\n\r\n\t\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\t\tc.material.color.setRGB( val, val, val );\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase GEOMETRIC_ERROR: {\r\n\r\n\t\t\t\t\t\t\tconst val = Math.min( tile.geometricError / maxError, 1 );\r\n\t\t\t\t\t\t\tc.material.color.setRGB( val, val, val );\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase DISTANCE: {\r\n\r\n\t\t\t\t\t\t\t// We don't update the distance if the geometric error is 0.0 so\r\n\t\t\t\t\t\t\t// it will always be black.\r\n\t\t\t\t\t\t\tconst val = Math.min( tile.cached.distance / maxDistance, 1 );\r\n\t\t\t\t\t\t\tc.material.color.setRGB( val, val, val );\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase IS_LEAF: {\r\n\r\n\t\t\t\t\t\t\tif ( ! tile.children || tile.children.length === 0 ) {\r\n\r\n\t\t\t\t\t\t\t\tc.material.color.set( 0xffffff );\r\n\r\n\t\t\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t\t\tc.material.color.set( 0 );\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcase RANDOM_COLOR: {\r\n\r\n\t\t\t\t\t\t\tif ( ! c.material[ HAS_RANDOM_COLOR ] ) {\r\n\r\n\t\t\t\t\t\t\t\tc.material.color.setHSL( h, s, l );\r\n\t\t\t\t\t\t\t\tc.material[ HAS_RANDOM_COLOR ] = true;\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} );\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n\tsetTileVisible( tile, visible ) {\r\n\r\n\t\tsuper.setTileVisible( tile, visible );\r\n\r\n\t\tconst cached = tile.cached;\r\n\t\tconst sphereGroup = this.sphereGroup;\r\n\t\tconst boxGroup = this.boxGroup;\r\n\t\tconst boxHelperGroup = cached.boxHelperGroup;\r\n\t\tconst sphereHelper = cached.sphereHelper;\r\n\r\n\t\tif ( ! visible ) {\r\n\r\n\t\t\tboxGroup.remove( boxHelperGroup );\r\n\t\t\tsphereGroup.remove( sphereHelper );\r\n\r\n\t\t} else {\r\n\r\n\t\t\tboxGroup.add( boxHelperGroup );\r\n\t\t\tboxHelperGroup.updateMatrixWorld( true );\r\n\r\n\t\t\tsphereGroup.add( sphereHelper );\r\n\t\t\tsphereHelper.updateMatrixWorld( true );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tparseTile( buffer, tile, extension ) {\r\n\r\n\t\treturn super\r\n\t\t\t.parseTile( buffer, tile, extension )\r\n\t\t\t.then( () => {\r\n\r\n\t\t\t\tconst cached = tile.cached;\r\n\t\t\t\tconst scene = cached.scene;\r\n\t\t\t\tif ( scene ) {\r\n\r\n\t\t\t\t\tconst cachedBox = cached.box;\r\n\t\t\t\t\tconst cachedBoxMat = cached.boxTransform;\r\n\r\n\t\t\t\t\t// Create debug bounding box\r\n\t\t\t\t\tconst boxHelperGroup = new three__WEBPACK_IMPORTED_MODULE_0__[\"Group\"]();\r\n\t\t\t\t\tboxHelperGroup.matrix.copy( cachedBoxMat );\r\n\t\t\t\t\tboxHelperGroup.matrix.decompose( boxHelperGroup.position, boxHelperGroup.quaternion, boxHelperGroup.scale );\r\n\r\n\t\t\t\t\tconst boxHelper = new three__WEBPACK_IMPORTED_MODULE_0__[\"Box3Helper\"]( cachedBox );\r\n\t\t\t\t\tboxHelper.raycast = emptyRaycast;\r\n\t\t\t\t\tboxHelperGroup.add( boxHelper );\r\n\r\n\t\t\t\t\tcached.boxHelperGroup = boxHelperGroup;\r\n\r\n\t\t\t\t\tif ( this.visibleTiles.has( tile ) && this.displayBoxBounds ) {\r\n\r\n\t\t\t\t\t\tthis.boxGroup.add( boxHelperGroup );\r\n\t\t\t\t\t\tboxHelperGroup.updateMatrixWorld( true );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Create debugbounding sphere\r\n\t\t\t\t\tconst cachedSphere = cached.sphere;\r\n\t\t\t\t\tconst sphereHelper = new _SphereHelper_js__WEBPACK_IMPORTED_MODULE_2__[\"SphereHelper\"]( cachedSphere );\r\n\t\t\t\t\tsphereHelper.raycast = emptyRaycast;\r\n\t\t\t\t\tcached.sphereHelper = sphereHelper;\r\n\r\n\t\t\t\t\tif ( this.visibleTiles.has( tile ) && this.displaySphereBounds ) {\r\n\r\n\t\t\t\t\t\tthis.sphereGroup.add( sphereHelper );\r\n\t\t\t\t\t\tsphereHelper.updateMatrixWorld( true );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Cache the original materials\r\n\t\t\t\t\tscene.traverse( c => {\r\n\r\n\t\t\t\t\t\tconst material = c.material;\r\n\t\t\t\t\t\tif ( material ) {\r\n\r\n\t\t\t\t\t\t\tc[ ORIGINAL_MATERIAL ] = material;\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} );\r\n\r\n\t}\r\n\r\n\tdisposeTile( tile ) {\r\n\r\n\t\tsuper.disposeTile( tile );\r\n\r\n\t\tconst cached = tile.cached;\r\n\t\tif ( cached.boxHelperGroup ) {\r\n\r\n\t\t\tcached.boxHelperGroup.children[ 0 ].geometry.dispose();\r\n\t\t\tcached.sphereHelper.geometry.dispose();\r\n\r\n\t\t\tdelete cached.boxHelperGroup;\r\n\t\t\tdelete cached.sphereHelper;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/DebugTilesRenderer.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/three/I3DMLoader.js": +/*!****************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/three/I3DMLoader.js ***! + \****************************************************************/ +/*! exports provided: I3DMLoader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"I3DMLoader\", function() { return I3DMLoader; });\n/* harmony import */ var _base_I3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/I3DMLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/I3DMLoaderBase.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var three_examples_jsm_loaders_GLTFLoader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! three/examples/jsm/loaders/GLTFLoader.js */ \"./node_modules/three/examples/jsm/loaders/GLTFLoader.js\");\n\r\n\r\n\r\n\r\nconst tempPos = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"]();\r\nconst tempQuat = new three__WEBPACK_IMPORTED_MODULE_1__[\"Quaternion\"]();\r\nconst tempSca = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"]();\r\nconst tempMat = new three__WEBPACK_IMPORTED_MODULE_1__[\"Matrix4\"]();\r\nclass I3DMLoader extends _base_I3DMLoaderBase_js__WEBPACK_IMPORTED_MODULE_0__[\"I3DMLoaderBase\"] {\r\n\r\n\tconstructor( manager = three__WEBPACK_IMPORTED_MODULE_1__[\"DefaultLoadingManager\"] ) {\r\n\r\n\t\tsuper();\r\n\t\tthis.manager = manager;\r\n\r\n\t}\r\n\r\n\tresolveExternalURL( url ) {\r\n\r\n\t\treturn this.manager.resolveURL( super.resolveExternalURL( url ) );\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\treturn super\r\n\t\t\t.parse( buffer )\r\n\t\t\t.then( i3dm => {\r\n\r\n\t\t\t\tconst { featureTable, batchTable } = i3dm;\r\n\t\t\t\tconst gltfBuffer = i3dm.glbBytes.slice().buffer;\r\n\t\t\t\treturn new Promise( ( resolve, reject ) => {\r\n\r\n\t\t\t\t\tconst manager = this.manager;\r\n\t\t\t\t\tconst loader = manager.getHandler( 'path.gltf' ) || new three_examples_jsm_loaders_GLTFLoader_js__WEBPACK_IMPORTED_MODULE_2__[\"GLTFLoader\"]( manager );\r\n\t\t\t\t\tloader.parse( gltfBuffer, null, model => {\r\n\r\n\t\t\t\t\t\tconst INSTANCES_LENGTH = featureTable.getData( 'INSTANCES_LENGTH' );\r\n\r\n\t\t\t\t\t\t// RTC_CENTER\r\n\t\t\t\t\t\t// QUANTIZED_VOLUME_OFFSET\r\n\t\t\t\t\t\t// QUANTIZED_VOLUME_SCALE\r\n\t\t\t\t\t\t// EAST_NORTH_UP\r\n\r\n\t\t\t\t\t\tconst POSITION = featureTable.getData( 'POSITION', INSTANCES_LENGTH, 'FLOAT', 'VEC3' );\r\n\r\n\t\t\t\t\t\t// POSITION_QUANTIZED\r\n\t\t\t\t\t\t// NORMAL_UP\r\n\t\t\t\t\t\t// NORMAL_RIGHT\r\n\t\t\t\t\t\t// NORMAL_UP_OCT32P\r\n\t\t\t\t\t\t// NORMAL_RIGHT_OCT32P\r\n\t\t\t\t\t\t// SCALE\r\n\t\t\t\t\t\t// SCALE_NON_UNIFORM\r\n\t\t\t\t\t\t// BATCH_ID\r\n\r\n\t\t\t\t\t\tconst instanceMap = new Map();\r\n\t\t\t\t\t\tconst instances = [];\r\n\t\t\t\t\t\tmodel.scene.traverse( child => {\r\n\r\n\t\t\t\t\t\t\tif ( child.isMesh ) {\r\n\r\n\t\t\t\t\t\t\t\tconst { geometry, material } = child;\r\n\t\t\t\t\t\t\t\tconst instancedMesh = new three__WEBPACK_IMPORTED_MODULE_1__[\"InstancedMesh\"]( geometry, material, INSTANCES_LENGTH );\r\n\t\t\t\t\t\t\t\tinstances.push( instancedMesh );\r\n\t\t\t\t\t\t\t\tinstanceMap.set( child, instancedMesh );\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t} );\r\n\r\n\t\t\t\t\t\tconst averageVector = new three__WEBPACK_IMPORTED_MODULE_1__[\"Vector3\"]();\r\n\t\t\t\t\t\tfor ( let i = 0; i < INSTANCES_LENGTH; i ++ ) {\r\n\r\n\t\t\t\t\t\t\t// TODO: handle quantized position\r\n\t\t\t\t\t\t\taverageVector.x += POSITION[ i * 3 + 0 ] / INSTANCES_LENGTH;\r\n\t\t\t\t\t\t\taverageVector.y += POSITION[ i * 3 + 1 ] / INSTANCES_LENGTH;\r\n\t\t\t\t\t\t\taverageVector.z += POSITION[ i * 3 + 2 ] / INSTANCES_LENGTH;\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// replace the meshes with instanced meshes\r\n\t\t\t\t\t\tinstanceMap.forEach( ( instancedMesh, mesh ) => {\r\n\r\n\t\t\t\t\t\t\tconst parent = mesh.parent;\r\n\t\t\t\t\t\t\tif ( parent ) {\r\n\r\n\t\t\t\t\t\t\t\t// Mesh have no children\r\n\t\t\t\t\t\t\t\tparent.remove( mesh );\r\n\t\t\t\t\t\t\t\tparent.add( instancedMesh );\r\n\r\n\t\t\t\t\t\t\t\t// Center the instance around an average point to avoid jitter at large scales.\r\n\t\t\t\t\t\t\t\tinstancedMesh\r\n\t\t\t\t\t\t\t\t\t.position\r\n\t\t\t\t\t\t\t\t\t.copy( averageVector );\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t} );\r\n\r\n\t\t\t\t\t\tfor ( let i = 0; i < INSTANCES_LENGTH; i ++ ) {\r\n\r\n\t\t\t\t\t\t\t// TODO: handle quantized position\r\n\t\t\t\t\t\t\ttempPos.set(\r\n\t\t\t\t\t\t\t\tPOSITION[ i * 3 + 0 ] - averageVector.x,\r\n\t\t\t\t\t\t\t\tPOSITION[ i * 3 + 1 ] - averageVector.y,\r\n\t\t\t\t\t\t\t\tPOSITION[ i * 3 + 2 ] - averageVector.z,\r\n\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\t// TODO: handle normal orientation features\r\n\t\t\t\t\t\t\ttempQuat.set( 0, 0, 0, 1 );\r\n\r\n\t\t\t\t\t\t\t// TODO: handle scale features\r\n\t\t\t\t\t\t\ttempSca.set( 1, 1, 1 );\r\n\r\n\t\t\t\t\t\t\ttempMat.compose( tempPos, tempQuat, tempSca );\r\n\r\n\t\t\t\t\t\t\tfor ( let j = 0, l = instances.length; j < l; j ++ ) {\r\n\r\n\t\t\t\t\t\t\t\tconst instance = instances[ j ];\r\n\t\t\t\t\t\t\t\tinstance.setMatrixAt( i, tempMat );\r\n\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tmodel.batchTable = batchTable;\r\n\t\t\t\t\t\tmodel.featureTable = featureTable;\r\n\r\n\t\t\t\t\t\tmodel.scene.batchTable = batchTable;\r\n\t\t\t\t\t\tmodel.scene.featureTable = featureTable;\r\n\r\n\t\t\t\t\t\tresolve( model );\r\n\r\n\t\t\t\t\t}, reject );\r\n\r\n\t\t\t\t} );\r\n\r\n\t\t\t} );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/I3DMLoader.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/three/PNTSLoader.js": +/*!****************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/three/PNTSLoader.js ***! + \****************************************************************/ +/*! exports provided: PNTSLoader */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PNTSLoader\", function() { return PNTSLoader; });\n/* harmony import */ var _base_PNTSLoaderBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/PNTSLoaderBase.js */ \"./node_modules/3d-tiles-renderer/src/base/PNTSLoaderBase.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n\r\n\r\n\r\nclass PNTSLoader extends _base_PNTSLoaderBase_js__WEBPACK_IMPORTED_MODULE_0__[\"PNTSLoaderBase\"] {\r\n\r\n\tconstructor( manager = three__WEBPACK_IMPORTED_MODULE_1__[\"DefaultLoadingManager\"] ) {\r\n\r\n\t\tsuper();\r\n\t\tthis.manager = manager;\r\n\r\n\t}\r\n\r\n\tparse( buffer ) {\r\n\r\n\t\tconst result = super.parse( buffer );\r\n\t\tconst { featureTable } = result;\r\n\r\n\t\t// global semantics\r\n\t\tconst POINTS_LENGTH = featureTable.getData( 'POINTS_LENGTH' );\r\n\r\n\t\t// RTC_CENTER\r\n\t\t// QUANTIZED_VOLUME_OFFSET\r\n\t\t// QUANTIZED_VOLUME_SCALE\r\n\t\t// CONSTANT_RGBA\r\n\t\t// BATCH_LENGTH\r\n\r\n\t\tconst POSITION = featureTable.getData( 'POSITION', POINTS_LENGTH, 'FLOAT', 'VEC3' );\r\n\t\tconst RGB = featureTable.getData( 'RGB', POINTS_LENGTH, 'UNSIGNED_BYTE', 'VEC3' );\r\n\r\n\t\t// POSITION_QUANTIZED\r\n\t\t// RGBA\r\n\t\t// RGB565\r\n\t\t// NORMAL\r\n\t\t// NORMAL_OCT16P\r\n\t\t// BATCH_ID\r\n\r\n\t\tif ( POSITION === null ) {\r\n\r\n\t\t\tthrow new Error( 'PNTSLoader : POSITION_QUANTIZED feature type is not supported.' );\r\n\r\n\t\t}\r\n\r\n\t\tconst geometry = new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferGeometry\"]();\r\n\t\tgeometry.setAttribute( 'position', new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferAttribute\"]( POSITION, 3, false ) );\r\n\r\n\t\tconst material = new three__WEBPACK_IMPORTED_MODULE_1__[\"PointsMaterial\"]();\r\n\t\tmaterial.size = 2;\r\n\t\tmaterial.sizeAttenuation = false;\r\n\r\n\t\tif ( RGB !== null ) {\r\n\r\n\t\t\tgeometry.setAttribute( 'color', new three__WEBPACK_IMPORTED_MODULE_1__[\"BufferAttribute\"]( RGB, 3, true ) );\r\n\t\t\tmaterial.vertexColors = true;\r\n\r\n\t\t}\r\n\r\n\t\tconst object = new three__WEBPACK_IMPORTED_MODULE_1__[\"Points\"]( geometry, material );\r\n\t\tresult.scene = object;\r\n\t\tresult.scene.featureTable = featureTable;\r\n\r\n\t\treturn result;\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/PNTSLoader.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/three/SphereHelper.js": +/*!******************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/three/SphereHelper.js ***! + \******************************************************************/ +/*! exports provided: SphereHelper */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SphereHelper\", function() { return SphereHelper; });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n\r\n\r\nconst _vector = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\nconst axes = [ 'x', 'y', 'z' ];\r\nclass SphereHelper extends three__WEBPACK_IMPORTED_MODULE_0__[\"LineSegments\"] {\r\n\r\n\tconstructor( sphere, color = 0xffff00, angleSteps = 40 ) {\r\n\r\n\t\tconst geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"BufferGeometry\"]();\r\n\t\tconst positions = [];\r\n\t\tfor ( let i = 0; i < 3; i ++ ) {\r\n\r\n\t\t\tconst axis1 = axes[ i ];\r\n\t\t\tconst axis2 = axes[ ( i + 1 ) % 3 ];\r\n\t\t\t_vector.set( 0, 0, 0 );\r\n\r\n\t\t\tfor ( let a = 0; a < angleSteps; a ++ ) {\r\n\r\n\t\t\t\tlet angle;\r\n\t\t\t\tangle = 2 * Math.PI * a / ( angleSteps - 1 );\r\n\t\t\t\t_vector[ axis1 ] = Math.sin( angle );\r\n\t\t\t\t_vector[ axis2 ] = Math.cos( angle );\r\n\r\n\t\t\t\tpositions.push( _vector.x, _vector.y, _vector.z );\r\n\r\n\t\t\t\tangle = 2 * Math.PI * ( a + 1 ) / ( angleSteps - 1 );\r\n\t\t\t\t_vector[ axis1 ] = Math.sin( angle );\r\n\t\t\t\t_vector[ axis2 ] = Math.cos( angle );\r\n\r\n\t\t\t\tpositions.push( _vector.x, _vector.y, _vector.z );\r\n\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\r\n\t\tgeometry.setAttribute( 'position', new three__WEBPACK_IMPORTED_MODULE_0__[\"BufferAttribute\"]( new Float32Array( positions ), 3 ) );\r\n\t\tgeometry.computeBoundingSphere();\r\n\r\n\t\tsuper( geometry, new three__WEBPACK_IMPORTED_MODULE_0__[\"LineBasicMaterial\"]( { color: color, toneMapped: false } ) );\r\n\t\tthis.sphere = sphere;\r\n\t\tthis.type = 'SphereHelper';\r\n\r\n\t}\r\n\r\n\tupdateMatrixWorld( force ) {\r\n\r\n\t\tconst sphere = this.sphere;\r\n\t\tthis.position.copy( sphere.center );\r\n\t\tthis.scale.setScalar( sphere.radius );\r\n\t\tsuper.updateMatrixWorld( force );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/SphereHelper.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/three/TilesGroup.js": +/*!****************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/three/TilesGroup.js ***! + \****************************************************************/ +/*! exports provided: TilesGroup */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TilesGroup\", function() { return TilesGroup; });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n\r\n\r\n// Specialization of \"Group\" that only updates world matrices of children if\r\n// the transform has changed since the last update and ignores the \"force\"\r\n// parameter under the assumption that the children tiles will not move.\r\nconst tempMat = new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]();\r\nclass TilesGroup extends three__WEBPACK_IMPORTED_MODULE_0__[\"Group\"] {\r\n\r\n\tconstructor( tilesRenderer ) {\r\n\r\n\t\tsuper();\r\n\t\tthis.tilesRenderer = tilesRenderer;\r\n\r\n\t}\r\n\r\n\traycast( raycaster, intersects ) {\r\n\r\n\t\tthis.tilesRenderer.raycast( raycaster, intersects );\r\n\r\n\t}\r\n\r\n\tupdateMatrixWorld( force ) {\r\n\r\n\t\tif ( this.matrixAutoUpdate ) {\r\n\r\n\t\t\tthis.updateMatrix();\r\n\r\n\t\t}\r\n\r\n\t\tif ( this.matrixWorldNeedsUpdate || force ) {\r\n\r\n\t\t\tif ( this.parent === null ) {\r\n\r\n\t\t\t\ttempMat.copy( this.matrix );\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\ttempMat.multiplyMatrices( this.parent.matrixWorld, this.matrix );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tthis.matrixWorldNeedsUpdate = false;\r\n\r\n\t\t\t// check if the matrix changed relative to what it was.\r\n\t\t\tconst elA = tempMat.elements;\r\n\t\t\tconst elB = this.matrixWorld.elements;\r\n\t\t\tlet isDifferent = false;\r\n\t\t\tfor ( let i = 0; i < 16; i ++ ) {\r\n\r\n\t\t\t\tconst itemA = elA[ i ];\r\n\t\t\t\tconst itemB = elB[ i ];\r\n\t\t\t\tconst diff = Math.abs( itemA - itemB );\r\n\r\n\t\t\t\tif ( diff > Number.EPSILON ) {\r\n\r\n\t\t\t\t\tisDifferent = true;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( isDifferent ) {\r\n\r\n\t\t\t\tthis.matrixWorld.copy( tempMat );\r\n\r\n\t\t\t\t// update children\r\n\t\t\t\t// the children will not have to change unless the parent group has updated\r\n\t\t\t\tconst children = this.children;\r\n\t\t\t\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\t\t\t\tchildren[ i ].updateMatrixWorld();\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/TilesGroup.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/three/TilesRenderer.js": +/*!*******************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/three/TilesRenderer.js ***! + \*******************************************************************/ +/*! exports provided: TilesRenderer */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TilesRenderer\", function() { return TilesRenderer; });\n/* harmony import */ var _base_TilesRendererBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base/TilesRendererBase.js */ \"./node_modules/3d-tiles-renderer/src/base/TilesRendererBase.js\");\n/* harmony import */ var _B3DMLoader_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./B3DMLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/B3DMLoader.js\");\n/* harmony import */ var _PNTSLoader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PNTSLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/PNTSLoader.js\");\n/* harmony import */ var _I3DMLoader_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./I3DMLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/I3DMLoader.js\");\n/* harmony import */ var _CMPTLoader_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CMPTLoader.js */ \"./node_modules/3d-tiles-renderer/src/three/CMPTLoader.js\");\n/* harmony import */ var _TilesGroup_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./TilesGroup.js */ \"./node_modules/3d-tiles-renderer/src/three/TilesGroup.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _raycastTraverse_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./raycastTraverse.js */ \"./node_modules/3d-tiles-renderer/src/three/raycastTraverse.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nconst INITIAL_FRUSTUM_CULLED = Symbol( 'INITIAL_FRUSTUM_CULLED' );\r\nconst DEG2RAD = three__WEBPACK_IMPORTED_MODULE_6__[\"Math\"].DEG2RAD;\r\nconst tempMat = new three__WEBPACK_IMPORTED_MODULE_6__[\"Matrix4\"]();\r\nconst tempMat2 = new three__WEBPACK_IMPORTED_MODULE_6__[\"Matrix4\"]();\r\nconst tempVector = new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"]();\r\nconst vecX = new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"]();\r\nconst vecY = new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"]();\r\nconst vecZ = new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"]();\r\n\r\nconst X_AXIS = new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"]( 1, 0, 0 );\r\nconst Y_AXIS = new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"]( 0, 1, 0 );\r\n\r\nfunction emptyRaycast() {}\r\n\r\nfunction updateFrustumCulled( object, toInitialValue ) {\r\n\r\n\tobject.traverse( c => {\r\n\r\n\t\tc.frustumCulled = c[ INITIAL_FRUSTUM_CULLED ] && toInitialValue;\r\n\r\n\t} );\r\n\r\n}\r\n\r\nclass TilesRenderer extends _base_TilesRendererBase_js__WEBPACK_IMPORTED_MODULE_0__[\"TilesRendererBase\"] {\r\n\r\n\tget autoDisableRendererCulling() {\r\n\r\n\t\treturn this._autoDisableRendererCulling;\r\n\r\n\t}\r\n\r\n\tset autoDisableRendererCulling( value ) {\r\n\r\n\t\tif ( this._autoDisableRendererCulling !== value ) {\r\n\r\n\t\t\tsuper._autoDisableRendererCulling = value;\r\n\t\t\tthis.traverse( tile => {\r\n\r\n\t\t\t\tif ( tile.scene ) {\r\n\r\n\t\t\t\t\tupdateFrustumCulled( tile.scene, value );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tconstructor( ...args ) {\r\n\r\n\t\tsuper( ...args );\r\n\t\tthis.group = new _TilesGroup_js__WEBPACK_IMPORTED_MODULE_5__[\"TilesGroup\"]( this );\r\n\t\tthis.cameras = [];\r\n\t\tthis.cameraMap = new Map();\r\n\t\tthis.cameraInfo = [];\r\n\t\tthis.activeTiles = new Set();\r\n\t\tthis.visibleTiles = new Set();\r\n\t\tthis._autoDisableRendererCulling = true;\r\n\r\n\t\tthis.onLoadTileSet = null;\r\n\t\tthis.onLoadModel = null;\r\n\t\tthis.onDisposeModel = null;\r\n\r\n\t\tconst manager = new three__WEBPACK_IMPORTED_MODULE_6__[\"LoadingManager\"]();\r\n\t\tmanager.setURLModifier( url => {\r\n\r\n\t\t\tif ( this.preprocessURL ) {\r\n\r\n\t\t\t\treturn this.preprocessURL( url );\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\treturn url;\r\n\r\n\t\t\t}\r\n\r\n\t\t} );\r\n\t\tthis.manager = manager;\r\n\r\n\t}\r\n\r\n\t/* Public API */\r\n\tgetBounds( box ) {\r\n\r\n\t\tif ( ! this.root ) {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t\tconst cached = this.root.cached;\r\n\t\tconst boundingBox = cached.box;\r\n\t\tconst obbMat = cached.boxTransform;\r\n\r\n\t\tif ( boundingBox ) {\r\n\r\n\t\t\tbox.copy( boundingBox );\r\n\t\t\tbox.applyMatrix4( obbMat );\r\n\r\n\t\t\treturn true;\r\n\r\n\t\t} else {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tgetOrientedBounds( box, matrix ) {\r\n\r\n\t\tif ( ! this.root ) {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t\tconst cached = this.root.cached;\r\n\t\tconst boundingBox = cached.box;\r\n\t\tconst obbMat = cached.boxTransform;\r\n\r\n\t\tif ( box ) {\r\n\r\n\t\t\tbox.copy( boundingBox );\r\n\t\t\tmatrix.copy( obbMat );\r\n\r\n\t\t\treturn true;\r\n\r\n\t\t} else {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tforEachLoadedModel( callback ) {\r\n\r\n\t\tthis.traverse( tile => {\r\n\r\n\t\t\tconst scene = tile.cached.scene;\r\n\t\t\tif ( scene ) {\r\n\r\n\t\t\t\tcallback( scene, tile );\r\n\r\n\t\t\t}\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n\traycast( raycaster, intersects ) {\r\n\r\n\t\tif ( ! this.root ) {\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t\tif ( raycaster.firstHitOnly ) {\r\n\r\n\t\t\tconst hit = Object(_raycastTraverse_js__WEBPACK_IMPORTED_MODULE_7__[\"raycastTraverseFirstHit\"])( this.root, this.group, this.activeTiles, raycaster );\r\n\t\t\tif ( hit ) {\r\n\r\n\t\t\t\tintersects.push( hit );\r\n\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\r\n\t\t\tObject(_raycastTraverse_js__WEBPACK_IMPORTED_MODULE_7__[\"raycastTraverse\"])( this.root, this.group, this.activeTiles, raycaster, intersects );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\thasCamera( camera ) {\r\n\r\n\t\treturn this.cameraMap.has( camera );\r\n\r\n\t}\r\n\r\n\tsetCamera( camera ) {\r\n\r\n\t\tconst cameras = this.cameras;\r\n\t\tconst cameraMap = this.cameraMap;\r\n\t\tif ( ! cameraMap.has( camera ) ) {\r\n\r\n\t\t\tcameraMap.set( camera, new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector2\"]() );\r\n\t\t\tcameras.push( camera );\r\n\t\t\treturn true;\r\n\r\n\t\t}\r\n\t\treturn false;\r\n\r\n\t}\r\n\r\n\tsetResolution( camera, xOrVec, y ) {\r\n\r\n\t\tconst cameraMap = this.cameraMap;\r\n\t\tif ( ! cameraMap.has( camera ) ) {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t\tif ( xOrVec instanceof three__WEBPACK_IMPORTED_MODULE_6__[\"Vector2\"] ) {\r\n\r\n\t\t\tcameraMap.get( camera ).copy( xOrVec );\r\n\r\n\t\t} else {\r\n\r\n\t\t\tcameraMap.get( camera ).set( xOrVec, y );\r\n\r\n\t\t}\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\tsetResolutionFromRenderer( camera, renderer ) {\r\n\r\n\t\tconst cameraMap = this.cameraMap;\r\n\t\tif ( ! cameraMap.has( camera ) ) {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t\tconst resolution = cameraMap.get( camera );\r\n\t\trenderer.getSize( resolution );\r\n\t\tresolution.multiplyScalar( renderer.getPixelRatio() );\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\tdeleteCamera( camera ) {\r\n\r\n\t\tconst cameras = this.cameras;\r\n\t\tconst cameraMap = this.cameraMap;\r\n\t\tif ( cameraMap.has( camera ) ) {\r\n\r\n\t\t\tconst index = cameras.indexOf( camera );\r\n\t\t\tcameras.splice( index, 1 );\r\n\t\t\tcameraMap.delete( camera );\r\n\t\t\treturn true;\r\n\r\n\t\t}\r\n\t\treturn false;\r\n\r\n\t}\r\n\r\n\t/* Overriden */\r\n\tfetchTileSet( url, ...rest ) {\r\n\r\n\t\tconst pr = super.fetchTileSet( url, ...rest );\r\n\t\tpr.then( json => {\r\n\r\n\t\t\tif ( this.onLoadTileSet ) {\r\n\r\n\t\t\t\t// Push this onto the end of the event stack to ensure this runs\r\n\t\t\t\t// after the base renderer has placed the provided json where it\r\n\t\t\t\t// needs to be placed and is ready for an update.\r\n\t\t\t\tPromise.resolve().then( () => {\r\n\r\n\t\t\t\t\tthis.onLoadTileSet( json, url );\r\n\r\n\t\t\t\t} );\r\n\r\n\t\t\t}\r\n\r\n\t\t} );\r\n\t\treturn pr;\r\n\r\n\t}\r\n\r\n\tupdate() {\r\n\r\n\t\tconst group = this.group;\r\n\t\tconst cameras = this.cameras;\r\n\t\tconst cameraMap = this.cameraMap;\r\n\t\tconst cameraInfo = this.cameraInfo;\r\n\r\n\t\tif ( cameras.length === 0 ) {\r\n\r\n\t\t\tconsole.warn( 'TilesRenderer: no cameras defined. Cannot update 3d tiles.' );\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t\t// automatically scale the array of cameraInfo to match the cameras\r\n\t\twhile ( cameraInfo.length > cameras.length ) {\r\n\r\n\t\t\tcameraInfo.pop();\r\n\r\n\t\t}\r\n\r\n\t\twhile ( cameraInfo.length < cameras.length ) {\r\n\r\n\t\t\tcameraInfo.push( {\r\n\r\n\t\t\t\tfrustum: new three__WEBPACK_IMPORTED_MODULE_6__[\"Frustum\"](),\r\n\t\t\t\tsseDenominator: - 1,\r\n\t\t\t\tposition: new three__WEBPACK_IMPORTED_MODULE_6__[\"Vector3\"](),\r\n\t\t\t\tinvScale: - 1,\r\n\t\t\t\tpixelSize: 0,\r\n\r\n\t\t\t} );\r\n\r\n\t\t}\r\n\r\n\t\t// extract scale of group container\r\n\t\ttempMat2.copy( group.matrixWorld ).invert();\r\n\r\n\t\tlet invScale;\r\n\t\ttempVector.setFromMatrixScale( tempMat2 );\r\n\t\tinvScale = tempVector.x;\r\n\r\n\t\tif ( Math.abs( Math.max( tempVector.x - tempVector.y, tempVector.x - tempVector.z ) ) > 1e-6 ) {\r\n\r\n\t\t\tconsole.warn( 'ThreeTilesRenderer : Non uniform scale used for tile which may cause issues when calculating screen space error.' );\r\n\r\n\t\t}\r\n\r\n\t\t// store the camera cameraInfo in the 3d tiles root frame\r\n\t\tfor ( let i = 0, l = cameraInfo.length; i < l; i ++ ) {\r\n\r\n\t\t\tconst camera = cameras[ i ];\r\n\t\t\tconst info = cameraInfo[ i ];\r\n\t\t\tconst frustum = info.frustum;\r\n\t\t\tconst position = info.position;\r\n\t\t\tconst resolution = cameraMap.get( camera );\r\n\r\n\t\t\tif ( resolution.width === 0 || resolution.height === 0 ) {\r\n\r\n\t\t\t\tconsole.warn( 'TilesRenderer: resolution for camera error calculation is not set.' );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( camera.isPerspectiveCamera ) {\r\n\r\n\t\t\t\tinfo.sseDenominator = 2 * Math.tan( 0.5 * camera.fov * DEG2RAD ) / resolution.height;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( camera.isOrthographicCamera ) {\r\n\r\n\t\t\t\tconst w = camera.right - camera.left;\r\n\t\t\t\tconst h = camera.top - camera.bottom;\r\n\t\t\t\tinfo.pixelSize = Math.max( h / resolution.height, w / resolution.width );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tinfo.invScale = invScale;\r\n\r\n\t\t\t// get frustum in group root frame\r\n\t\t\ttempMat.copy( group.matrixWorld );\r\n\t\t\ttempMat.premultiply( camera.matrixWorldInverse );\r\n\t\t\ttempMat.premultiply( camera.projectionMatrix );\r\n\r\n\t\t\tfrustum.setFromProjectionMatrix( tempMat );\r\n\r\n\t\t\t// get transform position in group root frame\r\n\t\t\tposition.set( 0, 0, 0 );\r\n\t\t\tposition.applyMatrix4( camera.matrixWorld );\r\n\t\t\tposition.applyMatrix4( tempMat2 );\r\n\r\n\t\t}\r\n\r\n\t\tsuper.update();\r\n\r\n\t}\r\n\r\n\tpreprocessNode( tile, parentTile, tileSetDir ) {\r\n\r\n\t\tsuper.preprocessNode( tile, parentTile, tileSetDir );\r\n\r\n\t\tconst transform = new three__WEBPACK_IMPORTED_MODULE_6__[\"Matrix4\"]();\r\n\t\tif ( tile.transform ) {\r\n\r\n\t\t\tconst transformArr = tile.transform;\r\n\t\t\tfor ( let i = 0; i < 16; i ++ ) {\r\n\r\n\t\t\t\ttransform.elements[ i ] = transformArr[ i ];\r\n\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\r\n\t\t\ttransform.identity();\r\n\r\n\t\t}\r\n\r\n\t\tif ( parentTile ) {\r\n\r\n\t\t\ttransform.premultiply( parentTile.cached.transform );\r\n\r\n\t\t}\r\n\r\n\t\tlet box = null;\r\n\t\tlet boxTransform = null;\r\n\t\tlet boxTransformInverse = null;\r\n\t\tif ( 'box' in tile.boundingVolume ) {\r\n\r\n\t\t\tconst data = tile.boundingVolume.box;\r\n\t\t\tbox = new three__WEBPACK_IMPORTED_MODULE_6__[\"Box3\"]();\r\n\t\t\tboxTransform = new three__WEBPACK_IMPORTED_MODULE_6__[\"Matrix4\"]();\r\n\t\t\tboxTransformInverse = new three__WEBPACK_IMPORTED_MODULE_6__[\"Matrix4\"]();\r\n\r\n\t\t\t// get the extents of the bounds in each axis\r\n\t\t\tvecX.set( data[ 3 ], data[ 4 ], data[ 5 ] );\r\n\t\t\tvecY.set( data[ 6 ], data[ 7 ], data[ 8 ] );\r\n\t\t\tvecZ.set( data[ 9 ], data[ 10 ], data[ 11 ] );\r\n\r\n\t\t\tconst scaleX = vecX.length();\r\n\t\t\tconst scaleY = vecY.length();\r\n\t\t\tconst scaleZ = vecZ.length();\r\n\r\n\t\t\tvecX.normalize();\r\n\t\t\tvecY.normalize();\r\n\t\t\tvecZ.normalize();\r\n\r\n\t\t\t// create the oriented frame that the box exists in\r\n\t\t\tboxTransform.set(\r\n\t\t\t\tvecX.x, vecY.x, vecZ.x, data[ 0 ],\r\n\t\t\t\tvecX.y, vecY.y, vecZ.y, data[ 1 ],\r\n\t\t\t\tvecX.z, vecY.z, vecZ.z, data[ 2 ],\r\n\t\t\t\t0, 0, 0, 1\r\n\t\t\t);\r\n\t\t\tboxTransform.premultiply( transform );\r\n\t\t\tboxTransformInverse.copy( boxTransform ).invert();\r\n\r\n\t\t\t// scale the box by the extents\r\n\t\t\tbox.min.set( - scaleX, - scaleY, - scaleZ );\r\n\t\t\tbox.max.set( scaleX, scaleY, scaleZ );\r\n\r\n\t\t}\r\n\r\n\t\tlet sphere = null;\r\n\t\tif ( 'sphere' in tile.boundingVolume ) {\r\n\r\n\t\t\tconst data = tile.boundingVolume.sphere;\r\n\t\t\tsphere = new three__WEBPACK_IMPORTED_MODULE_6__[\"Sphere\"]();\r\n\t\t\tsphere.center.set( data[ 0 ], data[ 1 ], data[ 2 ] );\r\n\t\t\tsphere.radius = data[ 3 ];\r\n\t\t\tsphere.applyMatrix4( transform );\r\n\r\n\t\t} else if ( 'box' in tile.boundingVolume ) {\r\n\r\n\t\t\tconst data = tile.boundingVolume.box;\r\n\t\t\tsphere = new three__WEBPACK_IMPORTED_MODULE_6__[\"Sphere\"]();\r\n\t\t\tbox.getBoundingSphere( sphere );\r\n\t\t\tsphere.center.set( data[ 0 ], data[ 1 ], data[ 2 ] );\r\n\t\t\tsphere.applyMatrix4( transform );\r\n\r\n\t\t}\r\n\r\n\t\tlet region = null;\r\n\t\tif ( 'region' in tile.boundingVolume ) {\r\n\r\n\t\t\tconsole.warn( 'ThreeTilesRenderer: region bounding volume not supported.' );\r\n\r\n\t\t}\r\n\r\n\t\ttile.cached = {\r\n\r\n\t\t\tloadIndex: 0,\r\n\t\t\ttransform,\r\n\t\t\tactive: false,\r\n\t\t\tinFrustum: [],\r\n\r\n\t\t\tbox,\r\n\t\t\tboxTransform,\r\n\t\t\tboxTransformInverse,\r\n\t\t\tsphere,\r\n\t\t\tregion,\r\n\r\n\t\t\tscene: null,\r\n\t\t\tgeometry: null,\r\n\t\t\tmaterial: null,\r\n\t\t\tdistance: Infinity\r\n\r\n\t\t};\r\n\r\n\t}\r\n\r\n\tparseTile( buffer, tile, extension ) {\r\n\r\n\t\ttile._loadIndex = tile._loadIndex || 0;\r\n\t\ttile._loadIndex ++;\r\n\r\n\t\tconst uri = tile.content.uri;\r\n\t\tconst uriSplits = uri.split( /[\\\\\\/]/g );\r\n\t\turiSplits.pop();\r\n\t\tconst workingPath = uriSplits.join( '/' );\r\n\t\tconst fetchOptions = this.fetchOptions;\r\n\r\n\t\tconst manager = this.manager;\r\n\t\tconst loadIndex = tile._loadIndex;\r\n\t\tlet promise = null;\r\n\r\n\t\tswitch ( extension ) {\r\n\r\n\t\t\tcase 'b3dm':\r\n\t\t\t\tpromise = new _B3DMLoader_js__WEBPACK_IMPORTED_MODULE_1__[\"B3DMLoader\"]( manager )\r\n\t\t\t\t\t.parse( buffer )\r\n\t\t\t\t\t.then( res => res.scene );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'pnts':\r\n\t\t\t\tpromise = Promise.resolve( new _PNTSLoader_js__WEBPACK_IMPORTED_MODULE_2__[\"PNTSLoader\"]( manager ).parse( buffer ).scene );\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'i3dm': {\r\n\r\n\t\t\t\tconst loader = new _I3DMLoader_js__WEBPACK_IMPORTED_MODULE_3__[\"I3DMLoader\"]( manager );\r\n\t\t\t\tloader.workingPath = workingPath;\r\n\t\t\t\tloader.fetchOptions = fetchOptions;\r\n\t\t\t\tpromise = loader\r\n\t\t\t\t\t.parse( buffer )\r\n\t\t\t\t\t.then( res => res.scene );\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tcase 'cmpt': {\r\n\r\n\t\t\t\tconst loader = new _CMPTLoader_js__WEBPACK_IMPORTED_MODULE_4__[\"CMPTLoader\"]( manager );\r\n\t\t\t\tloader.workingPath = workingPath;\r\n\t\t\t\tloader.fetchOptions = fetchOptions;\r\n\t\t\t\tpromise = loader\r\n\t\t\t\t\t.parse( buffer )\r\n\t\t\t\t\t.then( res => res.scene\t);\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tconsole.warn( `TilesRenderer: Content type \"${ extension }\" not supported.` );\r\n\t\t\t\tpromise = Promise.resolve( null );\r\n\t\t\t\tbreak;\r\n\r\n\t\t}\r\n\r\n\t\treturn promise.then( scene => {\r\n\r\n\t\t\tif ( tile._loadIndex !== loadIndex ) {\r\n\r\n\t\t\t\treturn;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tconst upAxis = this.rootTileSet.asset && this.rootTileSet.asset.gltfUpAxis || 'y';\r\n\t\t\tconst cached = tile.cached;\r\n\t\t\tconst cachedTransform = cached.transform;\r\n\r\n\t\t\tswitch ( upAxis.toLowerCase() ) {\r\n\r\n\t\t\t\tcase 'x':\r\n\t\t\t\t\tscene.matrix.makeRotationAxis( Y_AXIS, - Math.PI / 2 );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'y':\r\n\t\t\t\t\tscene.matrix.makeRotationAxis( X_AXIS, Math.PI / 2 );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'z':\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\tscene.matrix.premultiply( cachedTransform );\r\n\t\t\tscene.matrix.decompose( scene.position, scene.quaternion, scene.scale );\r\n\t\t\tscene.traverse( c => {\r\n\r\n\t\t\t\tc[ INITIAL_FRUSTUM_CULLED ] = c.frustumCulled;\r\n\r\n\t\t\t} );\r\n\t\t\tupdateFrustumCulled( scene, this.autoDisableRendererCulling );\r\n\r\n\t\t\tcached.scene = scene;\r\n\r\n\t\t\t// We handle raycasting in a custom way so remove it from here\r\n\t\t\tscene.traverse( c => {\r\n\r\n\t\t\t\tc.raycast = emptyRaycast;\r\n\r\n\t\t\t} );\r\n\r\n\t\t\tconst materials = [];\r\n\t\t\tconst geometry = [];\r\n\t\t\tconst textures = [];\r\n\t\t\tscene.traverse( c => {\r\n\r\n\t\t\t\tif ( c.geometry ) {\r\n\r\n\t\t\t\t\tgeometry.push( c.geometry );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ( c.material ) {\r\n\r\n\t\t\t\t\tconst material = c.material;\r\n\t\t\t\t\tmaterials.push( c.material );\r\n\r\n\t\t\t\t\tfor ( const key in material ) {\r\n\r\n\t\t\t\t\t\tconst value = material[ key ];\r\n\t\t\t\t\t\tif ( value && value.isTexture ) {\r\n\r\n\t\t\t\t\t\t\ttextures.push( value );\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} );\r\n\r\n\t\t\tcached.materials = materials;\r\n\t\t\tcached.geometry = geometry;\r\n\t\t\tcached.textures = textures;\r\n\r\n\t\t\tif ( this.onLoadModel ) {\r\n\r\n\t\t\t\tthis.onLoadModel( scene, tile );\r\n\r\n\t\t\t}\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n\tdisposeTile( tile ) {\r\n\r\n\t\t// This could get called before the tile has finished downloading\r\n\t\tconst cached = tile.cached;\r\n\t\tif ( cached.scene ) {\r\n\r\n\t\t\tconst materials = cached.materials;\r\n\t\t\tconst geometry = cached.geometry;\r\n\t\t\tconst textures = cached.textures;\r\n\r\n\t\t\tfor ( let i = 0, l = geometry.length; i < l; i ++ ) {\r\n\r\n\t\t\t\tgeometry[ i ].dispose();\r\n\r\n\t\t\t}\r\n\r\n\t\t\tfor ( let i = 0, l = materials.length; i < l; i ++ ) {\r\n\r\n\t\t\t\tmaterials[ i ].dispose();\r\n\r\n\t\t\t}\r\n\r\n\t\t\tfor ( let i = 0, l = textures.length; i < l; i ++ ) {\r\n\r\n\t\t\t\tconst texture = textures[ i ];\r\n\t\t\t\ttexture.dispose();\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( this.onDisposeModel ) {\r\n\r\n\t\t\t\tthis.onDisposeModel( cached.scene, tile );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tcached.scene = null;\r\n\t\t\tcached.materials = null;\r\n\t\t\tcached.textures = null;\r\n\t\t\tcached.geometry = null;\r\n\r\n\t\t}\r\n\r\n\t\ttile._loadIndex ++;\r\n\r\n\t}\r\n\r\n\tsetTileVisible( tile, visible ) {\r\n\r\n\t\tconst scene = tile.cached.scene;\r\n\t\tconst visibleTiles = this.visibleTiles;\r\n\t\tconst group = this.group;\r\n\t\tif ( visible ) {\r\n\r\n\t\t\tgroup.add( scene );\r\n\t\t\tvisibleTiles.add( tile );\r\n\t\t\tscene.updateMatrixWorld( true );\r\n\r\n\t\t} else {\r\n\r\n\t\t\tgroup.remove( scene );\r\n\t\t\tvisibleTiles.delete( tile );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tsetTileActive( tile, active ) {\r\n\r\n\t\tconst activeTiles = this.activeTiles;\r\n\t\tif ( active ) {\r\n\r\n\t\t\tactiveTiles.add( tile );\r\n\r\n\t\t} else {\r\n\r\n\t\t\tactiveTiles.delete( tile );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tcalculateError( tile ) {\r\n\r\n\t\tif ( tile.geometricError === 0.0 ) {\r\n\r\n\t\t\treturn 0.0;\r\n\r\n\t\t}\r\n\r\n\t\tconst cached = tile.cached;\r\n\t\tconst inFrustum = cached.inFrustum;\r\n\t\tconst cameras = this.cameras;\r\n\t\tconst cameraInfo = this.cameraInfo;\r\n\r\n\t\t// TODO: Use the content bounding volume here?\r\n\t\tconst boundingVolume = tile.boundingVolume;\r\n\t\tif ( 'box' in boundingVolume ) {\r\n\r\n\t\t\tconst boundingBox = cached.box;\r\n\t\t\tconst boxTransformInverse = cached.boxTransformInverse;\r\n\r\n\t\t\tlet maxError = - Infinity;\r\n\t\t\tlet minDistance = Infinity;\r\n\t\t\tfor ( let i = 0, l = cameras.length; i < l; i ++ ) {\r\n\r\n\t\t\t\tif ( ! inFrustum[ i ] ) {\r\n\r\n\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// transform camera position into local frame of the tile bounding box\r\n\t\t\t\tconst camera = cameras[ i ];\r\n\t\t\t\tconst info = cameraInfo[ i ];\r\n\t\t\t\tconst invScale = info.invScale;\r\n\t\t\t\ttempVector.copy( info.position );\r\n\t\t\t\ttempVector.applyMatrix4( boxTransformInverse );\r\n\r\n\t\t\t\tlet error;\r\n\t\t\t\tif ( camera.isOrthographicCamera ) {\r\n\r\n\t\t\t\t\tconst pixelSize = info.pixelSize;\r\n\t\t\t\t\terror = tile.geometricError / ( pixelSize * invScale );\r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tconst distance = boundingBox.distanceToPoint( tempVector );\r\n\t\t\t\t\tconst scaledDistance = distance * invScale;\r\n\t\t\t\t\tconst sseDenominator = info.sseDenominator;\r\n\t\t\t\t\terror = tile.geometricError / ( scaledDistance * sseDenominator );\r\n\r\n\t\t\t\t\tminDistance = Math.min( minDistance, scaledDistance );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tmaxError = Math.max( maxError, error );\r\n\r\n\t\t\t}\r\n\r\n\t\t\ttile.cached.distance = minDistance;\r\n\r\n\t\t\treturn maxError;\r\n\r\n\t\t} else if ( 'sphere' in boundingVolume ) {\r\n\r\n\t\t\t// const sphere = cached.sphere;\r\n\r\n\t\t\tconsole.warn( 'ThreeTilesRenderer : Sphere bounds not supported.' );\r\n\r\n\t\t} else if ( 'region' in boundingVolume ) {\r\n\r\n\t\t\t// unsupported\r\n\t\t\tconsole.warn( 'ThreeTilesRenderer : Region bounds not supported.' );\r\n\r\n\t\t}\r\n\r\n\t\treturn Infinity;\r\n\r\n\t}\r\n\r\n\ttileInView( tile ) {\r\n\r\n\t\t// TODO: we should use the more precise bounding volumes here if possible\r\n\t\t// cache the root-space planes\r\n\t\t// Use separating axis theorem for frustum and obb\r\n\r\n\t\tconst cached = tile.cached;\r\n\t\tconst sphere = cached.sphere;\r\n\t\tconst inFrustum = cached.inFrustum;\r\n\t\tif ( sphere ) {\r\n\r\n\t\t\tconst cameraInfo = this.cameraInfo;\r\n\t\t\tlet inView = false;\r\n\t\t\tfor ( let i = 0, l = cameraInfo.length; i < l; i ++ ) {\r\n\r\n\t\t\t\t// Track which camera frustums this tile is in so we can use it\r\n\t\t\t\t// to ignore the error calculations for cameras that can't see it\r\n\t\t\t\tconst frustum = cameraInfo[ i ].frustum;\r\n\t\t\t\tif ( frustum.intersectsSphere( sphere ) ) {\r\n\r\n\t\t\t\t\tinView = true;\r\n\t\t\t\t\tinFrustum[ i ] = true;\r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tinFrustum[ i ] = false;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn inView;\r\n\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/TilesRenderer.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/three/raycastTraverse.js": +/*!*********************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/three/raycastTraverse.js ***! + \*********************************************************************/ +/*! exports provided: raycastTraverseFirstHit, raycastTraverse */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"raycastTraverseFirstHit\", function() { return raycastTraverseFirstHit; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"raycastTraverse\", function() { return raycastTraverse; });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n\r\nconst _sphere = new three__WEBPACK_IMPORTED_MODULE_0__[\"Sphere\"]();\r\nconst _mat = new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]();\r\nconst _vec = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\nconst _vec2 = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\nconst _ray = new three__WEBPACK_IMPORTED_MODULE_0__[\"Ray\"]();\r\n\r\nconst _hitArray = [];\r\n\r\nfunction distanceSort( a, b ) {\r\n\r\n\treturn a.distance - b.distance;\r\n\r\n}\r\n\r\nfunction intersectTileScene( scene, raycaster, intersects ) {\r\n\r\n\t// Don't intersect the box3 helpers because those are used for debugging\r\n\tscene.traverse( c => {\r\n\r\n\t\t// We set the default raycast function to empty so three.js doesn't automatically cast against it\r\n\t\tObject.getPrototypeOf( c ).raycast.call( c, raycaster, intersects );\r\n\r\n\t} );\r\n\r\n}\r\n\r\n// Returns the closest hit when traversing the tree\r\nfunction raycastTraverseFirstHit( root, group, activeTiles, raycaster ) {\r\n\r\n\t// If the root is active make sure we've checked it\r\n\tif ( activeTiles.has( root ) ) {\r\n\r\n\t\tintersectTileScene( root.cached.scene, raycaster, _hitArray );\r\n\r\n\t\tif ( _hitArray.length > 0 ) {\r\n\r\n\t\t\tif ( _hitArray.length > 1 ) {\r\n\r\n\t\t\t\t_hitArray.sort( distanceSort );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tconst res = _hitArray[ 0 ];\r\n\t\t\t_hitArray.length = 0;\r\n\t\t\treturn res;\r\n\r\n\t\t} else {\r\n\r\n\t\t\treturn null;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// TODO: can we avoid creating a new array here every time to save on memory?\r\n\tconst array = [];\r\n\tconst children = root.children;\r\n\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\tconst tile = children[ i ];\r\n\t\tconst cached = tile.cached;\r\n\t\tconst groupMatrixWorld = group.matrixWorld;\r\n\r\n\t\t_mat.copy( groupMatrixWorld );\r\n\r\n\t\t// if we don't hit the sphere then early out\r\n\t\tconst sphere = cached.sphere;\r\n\t\tif ( sphere ) {\r\n\r\n\t\t\t_sphere.copy( sphere );\r\n\t\t\t_sphere.applyMatrix4( _mat );\r\n\t\t\tif ( ! raycaster.ray.intersectsSphere( _sphere ) ) {\r\n\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t// TODO: check region?\r\n\r\n\t\tconst boundingBox = cached.box;\r\n\t\tconst obbMat = cached.boxTransform;\r\n\t\tif ( boundingBox ) {\r\n\r\n\t\t\t_mat.multiply( obbMat ).invert();\r\n\t\t\t_ray.copy( raycaster.ray );\r\n\t\t\t_ray.applyMatrix4( _mat );\r\n\t\t\tif ( _ray.intersectBox( boundingBox, _vec ) ) {\r\n\r\n\t\t\t\t// account for tile scale\r\n\t\t\t\tlet invScale;\r\n\t\t\t\t_vec2.setFromMatrixScale( _mat );\r\n\t\t\t\tinvScale = _vec2.x;\r\n\r\n\t\t\t\tif ( Math.abs( Math.max( _vec2.x - _vec2.y, _vec2.x - _vec2.z ) ) > 1e-6 ) {\r\n\r\n\t\t\t\t\tconsole.warn( 'ThreeTilesRenderer : Non uniform scale used for tile which may cause issues when raycasting.' );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// if we intersect the box save the distance to the tile bounds\r\n\t\t\t\tlet data = {\r\n\t\t\t\t\tdistance: Infinity,\r\n\t\t\t\t\ttile: null\r\n\t\t\t\t};\r\n\t\t\t\tarray.push( data );\r\n\r\n\t\t\t\tdata.distance = _vec.distanceToSquared( _ray.origin ) * invScale * invScale;\r\n\t\t\t\tdata.tile = tile;\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\tcontinue;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// sort them by ascending distance\r\n\tarray.sort( distanceSort );\r\n\r\n\t// traverse until we find the best hit and early out if a tile bounds\r\n\t// couldn't possible include a best hit\r\n\tlet bestDistanceSquared = Infinity;\r\n\tlet bestHit = null;\r\n\tfor ( let i = 0, l = array.length; i < l; i ++ ) {\r\n\r\n\t\tconst data = array[ i ];\r\n\t\tconst distanceSquared = data.distance;\r\n\t\tif ( distanceSquared > bestDistanceSquared ) {\r\n\r\n\t\t\tbreak;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tconst tile = data.tile;\r\n\t\t\tconst scene = tile.cached.scene;\r\n\r\n\t\t\tlet hit = null;\r\n\t\t\tif ( activeTiles.has( tile ) ) {\r\n\r\n\t\t\t\t// save the hit if it's closer\r\n\t\t\t\tintersectTileScene( scene, raycaster, _hitArray );\r\n\t\t\t\tif ( _hitArray.length > 0 ) {\r\n\r\n\t\t\t\t\tif ( _hitArray.length > 1 ) {\r\n\r\n\t\t\t\t\t\t_hitArray.sort( distanceSort );\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\thit = _hitArray[ 0 ];\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\thit = raycastTraverseFirstHit( tile, group, activeTiles, raycaster );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tif ( hit ) {\r\n\r\n\t\t\t\tconst hitDistanceSquared = hit.distance * hit.distance;\r\n\t\t\t\tif ( hitDistanceSquared < bestDistanceSquared ) {\r\n\r\n\t\t\t\t\tbestDistanceSquared = hitDistanceSquared;\r\n\t\t\t\t\tbestHit = hit;\r\n\r\n\t\t\t\t}\r\n\t\t\t\t_hitArray.length = 0;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\treturn bestHit;\r\n\r\n}\r\n\r\nfunction raycastTraverse( tile, group, activeTiles, raycaster, intersects ) {\r\n\r\n\tconst cached = tile.cached;\r\n\tconst groupMatrixWorld = group.matrixWorld;\r\n\r\n\t_mat.copy( groupMatrixWorld );\r\n\r\n\t// Early out if we don't hit this tile sphere\r\n\tconst sphere = cached.sphere;\r\n\tif ( sphere ) {\r\n\r\n\t\t_sphere.copy( sphere );\r\n\t\t_sphere.applyMatrix4( _mat );\r\n\t\tif ( ! raycaster.ray.intersectsSphere( _sphere ) ) {\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// Early out if we don't this this tile box\r\n\tconst boundingBox = cached.box;\r\n\tconst obbMat = cached.boxTransform;\r\n\tif ( boundingBox ) {\r\n\r\n\t\t_mat.multiply( obbMat ).invert();\r\n\t\t_ray.copy( raycaster.ray ).applyMatrix4( _mat );\r\n\t\tif ( ! _ray.intersectsBox( boundingBox ) ) {\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// TODO: check region\r\n\r\n\tconst scene = cached.scene;\r\n\tif ( activeTiles.has( tile ) ) {\r\n\r\n\t\tintersectTileScene( scene, raycaster, intersects );\r\n\t\treturn;\r\n\r\n\t}\r\n\r\n\tconst children = tile.children;\r\n\tfor ( let i = 0, l = children.length; i < l; i ++ ) {\r\n\r\n\t\traycastTraverse( children[ i ], group, activeTiles, raycaster, intersects );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/three/raycastTraverse.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/utilities/FeatureTable.js": +/*!**********************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/utilities/FeatureTable.js ***! + \**********************************************************************/ +/*! exports provided: FeatureTable, BatchTable */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FeatureTable\", function() { return FeatureTable; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BatchTable\", function() { return BatchTable; });\n/* harmony import */ var _arrayToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayToString.js */ \"./node_modules/3d-tiles-renderer/src/utilities/arrayToString.js\");\n\r\n\r\nclass FeatureTable {\r\n\r\n\tconstructor( buffer, start, headerLength, binLength ) {\r\n\r\n\t\tthis.buffer = buffer;\r\n\t\tthis.binOffset = start + headerLength;\r\n\t\tthis.binLength = binLength;\r\n\r\n\t\tlet header = null;\r\n\t\tif ( headerLength !== 0 ) {\r\n\r\n\t\t\tconst headerData = new Uint8Array( buffer, start, headerLength );\r\n\t\t\theader = JSON.parse( Object(_arrayToString_js__WEBPACK_IMPORTED_MODULE_0__[\"arrayToString\"])( headerData ) );\r\n\r\n\t\t} else {\r\n\r\n\t\t\theader = {};\r\n\r\n\t\t}\r\n\t\tthis.header = header;\r\n\r\n\t}\r\n\r\n\tgetKeys() {\r\n\r\n\t\treturn Object.keys( this.header );\r\n\r\n\t}\r\n\r\n\tgetData( key, count, defaultComponentType = null, defaultType = null ) {\r\n\r\n\t\tconst header = this.header;\r\n\r\n\t\tif ( ! ( key in header ) ) {\r\n\r\n\t\t\treturn null;\r\n\r\n\t\t}\r\n\r\n\t\tconst feature = header[ key ];\r\n\t\tif ( ! ( feature instanceof Object ) ) {\r\n\r\n\t\t\treturn feature;\r\n\r\n\t\t} else if ( Array.isArray( feature ) ) {\r\n\r\n\t\t\treturn feature;\r\n\r\n\t\t} else {\r\n\r\n\t\t\tconst { buffer, binOffset, binLength } = this;\r\n\t\t\tconst byteOffset = feature.byteOffset || 0;\r\n\t\t\tconst featureType = feature.type || defaultType;\r\n\t\t\tconst featureComponentType = feature.componentType || defaultComponentType;\r\n\r\n\t\t\tif ( 'type' in feature && defaultType && feature.type !== defaultType ) {\r\n\r\n\t\t\t\tthrow new Error( 'FeatureTable: Specified type does not match expected type.' );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tlet stride;\r\n\t\t\tswitch ( featureType ) {\r\n\r\n\t\t\t\tcase 'SCALAR':\r\n\t\t\t\t\tstride = 1;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'VEC2':\r\n\t\t\t\t\tstride = 2;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'VEC3':\r\n\t\t\t\t\tstride = 3;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'VEC4':\r\n\t\t\t\t\tstride = 4;\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthrow new Error( `FeatureTable : Feature type not provided for \"${ key }\".` );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tlet data;\r\n\t\t\tconst arrayStart = binOffset + byteOffset;\r\n\t\t\tconst arrayLength = count * stride;\r\n\r\n\t\t\tswitch ( featureComponentType ) {\r\n\r\n\t\t\t\tcase 'BYTE':\r\n\t\t\t\t\tdata = new Int8Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'UNSIGNED_BYTE':\r\n\t\t\t\t\tdata = new Uint8Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'SHORT':\r\n\t\t\t\t\tdata = new Int16Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'UNSIGNED_SHORT':\r\n\t\t\t\t\tdata = new Uint16Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'INT':\r\n\t\t\t\t\tdata = new Int32Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'UNSIGNED_INT':\r\n\t\t\t\t\tdata = new Uint32Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'FLOAT':\r\n\t\t\t\t\tdata = new Float32Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tcase 'DOUBLE':\r\n\t\t\t\t\tdata = new Float64Array( buffer, arrayStart, arrayLength );\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tthrow new Error( `FeatureTable : Feature component type not provided for \"${ key }\".` );\r\n\r\n\t\t\t}\r\n\r\n\t\t\tconst dataEnd = arrayStart + arrayLength * data.BYTES_PER_ELEMENT;\r\n\t\t\tif ( dataEnd > binOffset + binLength ) {\r\n\r\n\t\t\t\tthrow new Error( 'FeatureTable: Feature data read outside binary body length.' );\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn data;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\r\nclass BatchTable extends FeatureTable {\r\n\r\n\tconstructor( buffer, batchSize, start, headerLength, binLength ) {\r\n\r\n\t\tsuper( buffer, start, headerLength, binLength );\r\n\t\tthis.batchSize = batchSize;\r\n\r\n\t}\r\n\r\n\tgetData( key, componentType = null, type = null ) {\r\n\r\n\t\treturn super.getData( key, this.batchSize, type, componentType );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/utilities/FeatureTable.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/utilities/LRUCache.js": +/*!******************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/utilities/LRUCache.js ***! + \******************************************************************/ +/*! exports provided: LRUCache */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LRUCache\", function() { return LRUCache; });\n// Fires at the end of the frame and before the next one\r\nfunction enqueueMicrotask( callback ) {\r\n\r\n\tPromise.resolve().then( callback );\r\n\r\n}\r\n\r\nclass LRUCache {\r\n\r\n\tconstructor() {\r\n\r\n\t\t// options\r\n\t\tthis.maxSize = 800;\r\n\t\tthis.minSize = 600;\r\n\t\tthis.unloadPercent = 0.05;\r\n\r\n\t\t// \"itemSet\" doubles as both the list of the full set of items currently\r\n\t\t// stored in the cache (keys) as well as a map to the time the item was last\r\n\t\t// used so it can be sorted appropriately.\r\n\t\tthis.itemSet = new Map();\r\n\t\tthis.itemList = [];\r\n\t\tthis.usedSet = new Set();\r\n\t\tthis.callbacks = new Map();\r\n\r\n\t\tthis.unloadPriorityCallback = null;\r\n\r\n\t\tconst itemSet = this.itemSet;\r\n\t\tthis.defaultPriorityCallback = item => itemSet.get( item );\r\n\r\n\t}\r\n\r\n\t// Returns whether or not the cache has reached the maximum size\r\n\tisFull() {\r\n\r\n\t\treturn this.itemSet.size >= this.maxSize;\r\n\r\n\t}\r\n\r\n\tadd( item, removeCb ) {\r\n\r\n\t\tconst itemSet = this.itemSet;\r\n\t\tif ( itemSet.has( item ) ) {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t\tif ( this.isFull() ) {\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}\r\n\r\n\t\tconst usedSet = this.usedSet;\r\n\t\tconst itemList = this.itemList;\r\n\t\tconst callbacks = this.callbacks;\r\n\t\titemList.push( item );\r\n\t\tusedSet.add( item );\r\n\t\titemSet.set( item, Date.now() );\r\n\t\tcallbacks.set( item, removeCb );\r\n\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\tremove( item ) {\r\n\r\n\t\tconst usedSet = this.usedSet;\r\n\t\tconst itemSet = this.itemSet;\r\n\t\tconst itemList = this.itemList;\r\n\t\tconst callbacks = this.callbacks;\r\n\r\n\t\tif ( itemSet.has( item ) ) {\r\n\r\n\t\t\tcallbacks.get( item )( item );\r\n\r\n\t\t\tconst index = itemList.indexOf( item );\r\n\t\t\titemList.splice( index, 1 );\r\n\t\t\tusedSet.delete( item );\r\n\t\t\titemSet.delete( item );\r\n\t\t\tcallbacks.delete( item );\r\n\r\n\t\t\treturn true;\r\n\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\r\n\t}\r\n\r\n\tmarkUsed( item ) {\r\n\r\n\t\tconst itemSet = this.itemSet;\r\n\t\tconst usedSet = this.usedSet;\r\n\t\tif ( itemSet.has( item ) && ! usedSet.has( item ) ) {\r\n\r\n\t\t\titemSet.set( item, Date.now() );\r\n\t\t\tusedSet.add( item );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tmarkAllUnused() {\r\n\r\n\t\tthis.usedSet.clear();\r\n\r\n\t}\r\n\r\n\t// TODO: this should be renamed because it's not necessarily unloading all unused content\r\n\t// Maybe call it \"cleanup\" or \"unloadToMinSize\"\r\n\tunloadUnusedContent() {\r\n\r\n\t\tconst unloadPercent = this.unloadPercent;\r\n\t\tconst targetSize = this.minSize;\r\n\t\tconst itemList = this.itemList;\r\n\t\tconst itemSet = this.itemSet;\r\n\t\tconst usedSet = this.usedSet;\r\n\t\tconst callbacks = this.callbacks;\r\n\t\tconst unused = itemList.length - usedSet.size;\r\n\t\tconst excess = itemList.length - targetSize;\r\n\t\tconst unloadPriorityCallback = this.unloadPriorityCallback || this.defaultPriorityCallback;\r\n\r\n\t\tif ( excess > 0 && unused > 0 ) {\r\n\r\n\t\t\t// used items should be at the end of the array\r\n\t\t\titemList.sort( ( a, b ) => {\r\n\r\n\t\t\t\tconst usedA = usedSet.has( a );\r\n\t\t\t\tconst usedB = usedSet.has( b );\r\n\t\t\t\tif ( usedA && usedB ) {\r\n\r\n\t\t\t\t\t// If they're both used then don't bother moving them\r\n\t\t\t\t\treturn 0;\r\n\r\n\t\t\t\t} else if ( ! usedA && ! usedB ) {\r\n\r\n\t\t\t\t\t// Use the sort function otherwise\r\n\t\t\t\t\t// higher priority should be further to the left\r\n\t\t\t\t\treturn unloadPriorityCallback( b ) - unloadPriorityCallback( a );\r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\t// If one is used and the other is not move the used one towards the end of the array\r\n\t\t\t\t\treturn usedA ? 1 : - 1;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} );\r\n\r\n\t\t\t// address corner cases where the minSize might be zero or smaller than maxSize - minSize,\r\n\t\t\t// which would result in a very small or no items being unloaded.\r\n\t\t\tconst unusedExcess = Math.min( excess, unused );\r\n\t\t\tconst maxUnload = Math.max( targetSize * unloadPercent, unusedExcess * unloadPercent );\r\n\t\t\tlet nodesToUnload = Math.min( maxUnload, unused );\r\n\t\t\tnodesToUnload = Math.ceil( nodesToUnload );\r\n\r\n\t\t\tconst removedItems = itemList.splice( 0, nodesToUnload );\r\n\t\t\tfor ( let i = 0, l = removedItems.length; i < l; i ++ ) {\r\n\r\n\t\t\t\tconst item = removedItems[ i ];\r\n\t\t\t\tcallbacks.get( item )( item );\r\n\t\t\t\titemSet.delete( item );\r\n\t\t\t\tcallbacks.delete( item );\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tscheduleUnload( markAllUnused = true ) {\r\n\r\n\t\tif ( ! this.scheduled ) {\r\n\r\n\t\t\tthis.scheduled = true;\r\n\t\t\tenqueueMicrotask( () => {\r\n\r\n\t\t\t\tthis.scheduled = false;\r\n\t\t\t\tthis.unloadUnusedContent();\r\n\t\t\t\tif ( markAllUnused ) {\r\n\r\n\t\t\t\t\tthis.markAllUnused();\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/utilities/LRUCache.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/utilities/PriorityQueue.js": +/*!***********************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/utilities/PriorityQueue.js ***! + \***********************************************************************/ +/*! exports provided: PriorityQueue */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PriorityQueue\", function() { return PriorityQueue; });\nclass PriorityQueue {\r\n\r\n\tconstructor() {\r\n\r\n\t\t// options\r\n\t\tthis.maxJobs = 6;\r\n\r\n\t\tthis.items = [];\r\n\t\tthis.callbacks = new Map();\r\n\t\tthis.currJobs = 0;\r\n\t\tthis.scheduled = false;\r\n\t\tthis.autoUpdate = true;\r\n\r\n\t\tthis.priorityCallback = () => {\r\n\r\n\t\t\tthrow new Error( 'PriorityQueue: PriorityCallback function not defined.' );\r\n\r\n\t\t};\r\n\r\n\t}\r\n\r\n\tsort() {\r\n\r\n\t\tconst priorityCallback = this.priorityCallback;\r\n\t\tconst items = this.items;\r\n\t\titems.sort( ( a, b ) => {\r\n\r\n\t\t\treturn priorityCallback( a ) - priorityCallback( b );\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n\tadd( item, callback ) {\r\n\r\n\t\treturn new Promise( ( resolve, reject ) => {\r\n\r\n\t\t\tconst prCallback = ( ...args ) => callback( ...args ).then( resolve ).catch( reject );\r\n\t\t\tconst items = this.items;\r\n\t\t\tconst callbacks = this.callbacks;\r\n\r\n\t\t\titems.push( item );\r\n\t\t\tcallbacks.set( item, prCallback );\r\n\r\n\t\t\tif ( this.autoUpdate ) {\r\n\r\n\t\t\t\tthis.scheduleJobRun();\r\n\r\n\t\t\t}\r\n\r\n\t\t} );\r\n\r\n\t}\r\n\r\n\tremove( item ) {\r\n\r\n\t\tconst items = this.items;\r\n\t\tconst callbacks = this.callbacks;\r\n\r\n\t\tconst index = items.indexOf( item );\r\n\t\tif ( index !== - 1 ) {\r\n\r\n\t\t\titems.splice( index, 1 );\r\n\t\t\tcallbacks.delete( item );\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\ttryRunJobs() {\r\n\r\n\t\tthis.sort();\r\n\r\n\t\tconst items = this.items;\r\n\t\tconst callbacks = this.callbacks;\r\n\t\tconst maxJobs = this.maxJobs;\r\n\t\tlet currJobs = this.currJobs;\r\n\t\twhile ( maxJobs > currJobs && items.length > 0 ) {\r\n\r\n\t\t\tcurrJobs ++;\r\n\t\t\tconst item = items.pop();\r\n\t\t\tconst callback = callbacks.get( item );\r\n\t\t\tcallbacks.delete( item );\r\n\t\t\tcallback( item )\r\n\t\t\t\t.then( () => {\r\n\r\n\t\t\t\t\tthis.currJobs --;\r\n\r\n\t\t\t\t\tif ( this.autoUpdate ) {\r\n\r\n\t\t\t\t\t\tthis.scheduleJobRun();\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} )\r\n\t\t\t\t.catch( () => {\r\n\r\n\t\t\t\t\tthis.currJobs --;\r\n\r\n\t\t\t\t\tif ( this.autoUpdate ) {\r\n\r\n\t\t\t\t\t\tthis.scheduleJobRun();\r\n\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} );\r\n\r\n\t\t}\r\n\t\tthis.currJobs = currJobs;\r\n\r\n\t}\r\n\r\n\tscheduleJobRun() {\r\n\r\n\t\tif ( ! this.scheduled ) {\r\n\r\n\t\t\trequestAnimationFrame( () => {\r\n\r\n\t\t\t\tthis.tryRunJobs();\r\n\t\t\t\tthis.scheduled = false;\r\n\r\n\t\t\t} );\r\n\t\t\tthis.scheduled = true;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n}\r\n\r\n\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/utilities/PriorityQueue.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/utilities/arrayToString.js": +/*!***********************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/utilities/arrayToString.js ***! + \***********************************************************************/ +/*! exports provided: arrayToString */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"arrayToString\", function() { return arrayToString; });\nfunction arrayToString( array ) {\r\n\r\n\tlet str = '';\r\n\tfor ( let i = 0, l = array.length; i < l; i ++ ) {\r\n\r\n\t\tstr += String.fromCharCode( array[ i ] );\r\n\r\n\t}\r\n\r\n\treturn str;\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/utilities/arrayToString.js?"); + +/***/ }), + +/***/ "./node_modules/3d-tiles-renderer/src/utilities/urlJoin.js": +/*!*****************************************************************!*\ + !*** ./node_modules/3d-tiles-renderer/src/utilities/urlJoin.js ***! + \*****************************************************************/ +/*! exports provided: urlJoin */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"urlJoin\", function() { return urlJoin; });\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! path */ \"./node_modules/path-browserify/index.js\");\n/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_0__);\n\r\n\r\n// Function that properly handles path resolution for parts that have\r\n// a protocol component like \"http://\".\r\nfunction urlJoin( ...args ) {\r\n\r\n\tconst protocolRegex = /^[a-zA-Z]+:\\/\\//;\r\n\tlet lastRoot = - 1;\r\n\tfor ( let i = 0, l = args.length; i < l; i ++ ) {\r\n\r\n\t\tif ( protocolRegex.test( args[ i ] ) ) {\r\n\r\n\t\t\tlastRoot = i;\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\tif ( lastRoot === - 1 ) {\r\n\r\n\t\treturn path__WEBPACK_IMPORTED_MODULE_0___default.a.join( ...args ).replace( /\\\\/g, '/' );\r\n\r\n\t} else {\r\n\r\n\t\tconst parts = lastRoot <= 0 ? args : args.slice( lastRoot );\r\n\t\tconst protocol = parts[ 0 ].match( protocolRegex )[ 0 ];\r\n\t\tparts[ 0 ] = parts[ 0 ].substring( protocol.length );\r\n\r\n\t\treturn ( protocol + path__WEBPACK_IMPORTED_MODULE_0___default.a.join( ...parts ) ).replace( /\\\\/g, '/' );\r\n\r\n\t}\r\n\r\n}\r\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/3d-tiles-renderer/src/utilities/urlJoin.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/bbox/dist/es/index.js": +/*!**************************************************!*\ + !*** ./node_modules/@turf/bbox/dist/es/index.js ***! + \**************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _turf_meta__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/meta */ \"./node_modules/@turf/meta/dist/es/index.js\");\n\n/**\n * Takes a set of features, calculates the bbox of all input features, and returns a bounding box.\n *\n * @name bbox\n * @param {GeoJSON} geojson any GeoJSON object\n * @returns {BBox} bbox extent in [minX, minY, maxX, maxY] order\n * @example\n * var line = turf.lineString([[-74, 40], [-78, 42], [-82, 35]]);\n * var bbox = turf.bbox(line);\n * var bboxPolygon = turf.bboxPolygon(bbox);\n *\n * //addToMap\n * var addToMap = [line, bboxPolygon]\n */\nfunction bbox(geojson) {\n var result = [Infinity, Infinity, -Infinity, -Infinity];\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_0__[\"coordEach\"])(geojson, function (coord) {\n if (result[0] > coord[0]) {\n result[0] = coord[0];\n }\n if (result[1] > coord[1]) {\n result[1] = coord[1];\n }\n if (result[2] < coord[0]) {\n result[2] = coord[0];\n }\n if (result[3] < coord[1]) {\n result[3] = coord[1];\n }\n });\n return result;\n}\nbbox[\"default\"] = bbox;\n/* harmony default export */ __webpack_exports__[\"default\"] = (bbox);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/bbox/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/boolean-disjoint/dist/es/index.js": +/*!**************************************************************!*\ + !*** ./node_modules/@turf/boolean-disjoint/dist/es/index.js ***! + \**************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _turf_boolean_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/boolean-point-in-polygon */ \"./node_modules/@turf/boolean-point-in-polygon/dist/es/index.js\");\n/* harmony import */ var _turf_line_intersect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/line-intersect */ \"./node_modules/@turf/line-intersect/dist/es/index.js\");\n/* harmony import */ var _turf_meta__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @turf/meta */ \"./node_modules/@turf/meta/dist/es/index.js\");\n/* harmony import */ var _turf_polygon_to_line__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @turf/polygon-to-line */ \"./node_modules/@turf/polygon-to-line/dist/es/index.js\");\n\n\n\n\n/**\n * Boolean-disjoint returns (TRUE) if the intersection of the two geometries is an empty set.\n *\n * @name booleanDisjoint\n * @param {Geometry|Feature} feature1 GeoJSON Feature or Geometry\n * @param {Geometry|Feature} feature2 GeoJSON Feature or Geometry\n * @returns {boolean} true/false\n * @example\n * var point = turf.point([2, 2]);\n * var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);\n *\n * turf.booleanDisjoint(line, point);\n * //=true\n */\nfunction booleanDisjoint(feature1, feature2) {\n var bool = true;\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_2__[\"flattenEach\"])(feature1, function (flatten1) {\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_2__[\"flattenEach\"])(feature2, function (flatten2) {\n if (bool === false) {\n return false;\n }\n bool = disjoint(flatten1.geometry, flatten2.geometry);\n });\n });\n return bool;\n}\n/**\n * Disjoint operation for simple Geometries (Point/LineString/Polygon)\n *\n * @private\n * @param {Geometry} geom1 GeoJSON Geometry\n * @param {Geometry} geom2 GeoJSON Geometry\n * @returns {boolean} true/false\n */\nfunction disjoint(geom1, geom2) {\n switch (geom1.type) {\n case \"Point\":\n switch (geom2.type) {\n case \"Point\":\n return !compareCoords(geom1.coordinates, geom2.coordinates);\n case \"LineString\":\n return !isPointOnLine(geom2, geom1);\n case \"Polygon\":\n return !Object(_turf_boolean_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(geom1, geom2);\n }\n /* istanbul ignore next */\n break;\n case \"LineString\":\n switch (geom2.type) {\n case \"Point\":\n return !isPointOnLine(geom1, geom2);\n case \"LineString\":\n return !isLineOnLine(geom1, geom2);\n case \"Polygon\":\n return !isLineInPoly(geom2, geom1);\n }\n /* istanbul ignore next */\n break;\n case \"Polygon\":\n switch (geom2.type) {\n case \"Point\":\n return !Object(_turf_boolean_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(geom2, geom1);\n case \"LineString\":\n return !isLineInPoly(geom1, geom2);\n case \"Polygon\":\n return !isPolyInPoly(geom2, geom1);\n }\n }\n return false;\n}\n// http://stackoverflow.com/a/11908158/1979085\nfunction isPointOnLine(lineString, pt) {\n for (var i = 0; i < lineString.coordinates.length - 1; i++) {\n if (isPointOnLineSegment(lineString.coordinates[i], lineString.coordinates[i + 1], pt.coordinates)) {\n return true;\n }\n }\n return false;\n}\nfunction isLineOnLine(lineString1, lineString2) {\n var doLinesIntersect = Object(_turf_line_intersect__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lineString1, lineString2);\n if (doLinesIntersect.features.length > 0) {\n return true;\n }\n return false;\n}\nfunction isLineInPoly(polygon, lineString) {\n for (var _i = 0, _a = lineString.coordinates; _i < _a.length; _i++) {\n var coord = _a[_i];\n if (Object(_turf_boolean_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(coord, polygon)) {\n return true;\n }\n }\n var doLinesIntersect = Object(_turf_line_intersect__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lineString, Object(_turf_polygon_to_line__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(polygon));\n if (doLinesIntersect.features.length > 0) {\n return true;\n }\n return false;\n}\n/**\n * Is Polygon (geom1) in Polygon (geom2)\n * Only takes into account outer rings\n * See http://stackoverflow.com/a/4833823/1979085\n *\n * @private\n * @param {Geometry|Feature} feature1 Polygon1\n * @param {Geometry|Feature} feature2 Polygon2\n * @returns {boolean} true/false\n */\nfunction isPolyInPoly(feature1, feature2) {\n for (var _i = 0, _a = feature1.coordinates[0]; _i < _a.length; _i++) {\n var coord1 = _a[_i];\n if (Object(_turf_boolean_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(coord1, feature2)) {\n return true;\n }\n }\n for (var _b = 0, _c = feature2.coordinates[0]; _b < _c.length; _b++) {\n var coord2 = _c[_b];\n if (Object(_turf_boolean_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(coord2, feature1)) {\n return true;\n }\n }\n var doLinesIntersect = Object(_turf_line_intersect__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Object(_turf_polygon_to_line__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(feature1), Object(_turf_polygon_to_line__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(feature2));\n if (doLinesIntersect.features.length > 0) {\n return true;\n }\n return false;\n}\nfunction isPointOnLineSegment(lineSegmentStart, lineSegmentEnd, pt) {\n var dxc = pt[0] - lineSegmentStart[0];\n var dyc = pt[1] - lineSegmentStart[1];\n var dxl = lineSegmentEnd[0] - lineSegmentStart[0];\n var dyl = lineSegmentEnd[1] - lineSegmentStart[1];\n var cross = dxc * dyl - dyc * dxl;\n if (cross !== 0) {\n return false;\n }\n if (Math.abs(dxl) >= Math.abs(dyl)) {\n if (dxl > 0) {\n return lineSegmentStart[0] <= pt[0] && pt[0] <= lineSegmentEnd[0];\n }\n else {\n return lineSegmentEnd[0] <= pt[0] && pt[0] <= lineSegmentStart[0];\n }\n }\n else if (dyl > 0) {\n return lineSegmentStart[1] <= pt[1] && pt[1] <= lineSegmentEnd[1];\n }\n else {\n return lineSegmentEnd[1] <= pt[1] && pt[1] <= lineSegmentStart[1];\n }\n}\n/**\n * compareCoords\n *\n * @private\n * @param {Position} pair1 point [x,y]\n * @param {Position} pair2 point [x,y]\n * @returns {boolean} true/false if coord pairs match\n */\nfunction compareCoords(pair1, pair2) {\n return pair1[0] === pair2[0] && pair1[1] === pair2[1];\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (booleanDisjoint);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/boolean-disjoint/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/boolean-intersects/dist/es/index.js": +/*!****************************************************************!*\ + !*** ./node_modules/@turf/boolean-intersects/dist/es/index.js ***! + \****************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return booleanIntersects; });\n/* harmony import */ var _turf_boolean_disjoint__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/boolean-disjoint */ \"./node_modules/@turf/boolean-disjoint/dist/es/index.js\");\n/* harmony import */ var _turf_meta__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/meta */ \"./node_modules/@turf/meta/dist/es/index.js\");\n\n\n/**\n * Boolean-intersects returns (TRUE) two geometries intersect.\n *\n * @name booleanIntersects\n * @param {Geometry|Feature} feature1 GeoJSON Feature or Geometry\n * @param {Geometry|Feature} feature2 GeoJSON Feature or Geometry\n * @returns {boolean} true/false\n * @example\n * var point = turf.point([2, 2]);\n * var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);\n *\n * turf.booleanIntersects(line, point);\n * //=true\n */\nfunction booleanIntersects(feature1, feature2) {\n var bool = false;\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_1__[\"flattenEach\"])(feature1, function (flatten1) {\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_1__[\"flattenEach\"])(feature2, function (flatten2) {\n if (bool === true) {\n return true;\n }\n bool = !Object(_turf_boolean_disjoint__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(flatten1.geometry, flatten2.geometry);\n });\n });\n return bool;\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/boolean-intersects/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/boolean-point-in-polygon/dist/es/index.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@turf/boolean-point-in-polygon/dist/es/index.js ***! + \**********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return booleanPointInPolygon; });\n/* harmony import */ var _turf_invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/invariant */ \"./node_modules/@turf/invariant/dist/es/index.js\");\n\n// http://en.wikipedia.org/wiki/Even%E2%80%93odd_rule\n// modified from: https://github.com/substack/point-in-polygon/blob/master/index.js\n// which was modified from http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html\n/**\n * Takes a {@link Point} and a {@link Polygon} or {@link MultiPolygon} and determines if the point\n * resides inside the polygon. The polygon can be convex or concave. The function accounts for holes.\n *\n * @name booleanPointInPolygon\n * @param {Coord} point input point\n * @param {Feature} polygon input polygon or multipolygon\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.ignoreBoundary=false] True if polygon boundary should be ignored when determining if\n * the point is inside the polygon otherwise false.\n * @returns {boolean} `true` if the Point is inside the Polygon; `false` if the Point is not inside the Polygon\n * @example\n * var pt = turf.point([-77, 44]);\n * var poly = turf.polygon([[\n * [-81, 41],\n * [-81, 47],\n * [-72, 47],\n * [-72, 41],\n * [-81, 41]\n * ]]);\n *\n * turf.booleanPointInPolygon(pt, poly);\n * //= true\n */\nfunction booleanPointInPolygon(point, polygon, options) {\n if (options === void 0) { options = {}; }\n // validation\n if (!point) {\n throw new Error(\"point is required\");\n }\n if (!polygon) {\n throw new Error(\"polygon is required\");\n }\n var pt = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_0__[\"getCoord\"])(point);\n var geom = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_0__[\"getGeom\"])(polygon);\n var type = geom.type;\n var bbox = polygon.bbox;\n var polys = geom.coordinates;\n // Quick elimination if point is not inside bbox\n if (bbox && inBBox(pt, bbox) === false) {\n return false;\n }\n // normalize to multipolygon\n if (type === \"Polygon\") {\n polys = [polys];\n }\n var insidePoly = false;\n for (var i = 0; i < polys.length && !insidePoly; i++) {\n // check if it is in the outer ring first\n if (inRing(pt, polys[i][0], options.ignoreBoundary)) {\n var inHole = false;\n var k = 1;\n // check for the point in any of the holes\n while (k < polys[i].length && !inHole) {\n if (inRing(pt, polys[i][k], !options.ignoreBoundary)) {\n inHole = true;\n }\n k++;\n }\n if (!inHole) {\n insidePoly = true;\n }\n }\n }\n return insidePoly;\n}\n/**\n * inRing\n *\n * @private\n * @param {Array} pt [x,y]\n * @param {Array>} ring [[x,y], [x,y],..]\n * @param {boolean} ignoreBoundary ignoreBoundary\n * @returns {boolean} inRing\n */\nfunction inRing(pt, ring, ignoreBoundary) {\n var isInside = false;\n if (ring[0][0] === ring[ring.length - 1][0] &&\n ring[0][1] === ring[ring.length - 1][1]) {\n ring = ring.slice(0, ring.length - 1);\n }\n for (var i = 0, j = ring.length - 1; i < ring.length; j = i++) {\n var xi = ring[i][0];\n var yi = ring[i][1];\n var xj = ring[j][0];\n var yj = ring[j][1];\n var onBoundary = pt[1] * (xi - xj) + yi * (xj - pt[0]) + yj * (pt[0] - xi) === 0 &&\n (xi - pt[0]) * (xj - pt[0]) <= 0 &&\n (yi - pt[1]) * (yj - pt[1]) <= 0;\n if (onBoundary) {\n return !ignoreBoundary;\n }\n var intersect = yi > pt[1] !== yj > pt[1] &&\n pt[0] < ((xj - xi) * (pt[1] - yi)) / (yj - yi) + xi;\n if (intersect) {\n isInside = !isInside;\n }\n }\n return isInside;\n}\n/**\n * inBBox\n *\n * @private\n * @param {Position} pt point [x,y]\n * @param {BBox} bbox BBox [west, south, east, north]\n * @returns {boolean} true/false if point is inside BBox\n */\nfunction inBBox(pt, bbox) {\n return (bbox[0] <= pt[0] && bbox[1] <= pt[1] && bbox[2] >= pt[0] && bbox[3] >= pt[1]);\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/boolean-point-in-polygon/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/circle/dist/es/index.js": +/*!****************************************************!*\ + !*** ./node_modules/@turf/circle/dist/es/index.js ***! + \****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _turf_destination__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/destination */ \"./node_modules/@turf/destination/dist/es/index.js\");\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n\n\n/**\n * Takes a {@link Point} and calculates the circle polygon given a radius in degrees, radians, miles, or kilometers; and steps for precision.\n *\n * @name circle\n * @param {Feature|number[]} center center point\n * @param {number} radius radius of the circle\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.steps=64] number of steps\n * @param {string} [options.units='kilometers'] miles, kilometers, degrees, or radians\n * @param {Object} [options.properties={}] properties\n * @returns {Feature} circle polygon\n * @example\n * var center = [-75.343, 39.984];\n * var radius = 5;\n * var options = {steps: 10, units: 'kilometers', properties: {foo: 'bar'}};\n * var circle = turf.circle(center, radius, options);\n *\n * //addToMap\n * var addToMap = [turf.point(center), circle]\n */\nfunction circle(center, radius, options) {\n if (options === void 0) { options = {}; }\n // default params\n var steps = options.steps || 64;\n var properties = options.properties\n ? options.properties\n : !Array.isArray(center) && center.type === \"Feature\" && center.properties\n ? center.properties\n : {};\n // main\n var coordinates = [];\n for (var i = 0; i < steps; i++) {\n coordinates.push(Object(_turf_destination__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(center, radius, (i * -360) / steps, options).geometry\n .coordinates);\n }\n coordinates.push(coordinates[0]);\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_1__[\"polygon\"])([coordinates], properties);\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (circle);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/circle/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/destination/dist/es/index.js": +/*!*********************************************************!*\ + !*** ./node_modules/@turf/destination/dist/es/index.js ***! + \*********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return destination; });\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n/* harmony import */ var _turf_invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/invariant */ \"./node_modules/@turf/invariant/dist/es/index.js\");\n// http://en.wikipedia.org/wiki/Haversine_formula\n// http://www.movable-type.co.uk/scripts/latlong.html\n\n\n/**\n * Takes a {@link Point} and calculates the location of a destination point given a distance in\n * degrees, radians, miles, or kilometers; and bearing in degrees.\n * This uses the [Haversine formula](http://en.wikipedia.org/wiki/Haversine_formula) to account for global curvature.\n *\n * @name destination\n * @param {Coord} origin starting point\n * @param {number} distance distance from the origin point\n * @param {number} bearing ranging from -180 to 180\n * @param {Object} [options={}] Optional parameters\n * @param {string} [options.units='kilometers'] miles, kilometers, degrees, or radians\n * @param {Object} [options.properties={}] Translate properties to Point\n * @returns {Feature} destination point\n * @example\n * var point = turf.point([-75.343, 39.984]);\n * var distance = 50;\n * var bearing = 90;\n * var options = {units: 'miles'};\n *\n * var destination = turf.destination(point, distance, bearing, options);\n *\n * //addToMap\n * var addToMap = [point, destination]\n * destination.properties['marker-color'] = '#f00';\n * point.properties['marker-color'] = '#0f0';\n */\nfunction destination(origin, distance, bearing, options) {\n if (options === void 0) { options = {}; }\n // Handle input\n var coordinates1 = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getCoord\"])(origin);\n var longitude1 = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"degreesToRadians\"])(coordinates1[0]);\n var latitude1 = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"degreesToRadians\"])(coordinates1[1]);\n var bearingRad = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"degreesToRadians\"])(bearing);\n var radians = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lengthToRadians\"])(distance, options.units);\n // Main\n var latitude2 = Math.asin(Math.sin(latitude1) * Math.cos(radians) +\n Math.cos(latitude1) * Math.sin(radians) * Math.cos(bearingRad));\n var longitude2 = longitude1 +\n Math.atan2(Math.sin(bearingRad) * Math.sin(radians) * Math.cos(latitude1), Math.cos(radians) - Math.sin(latitude1) * Math.sin(latitude2));\n var lng = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"radiansToDegrees\"])(longitude2);\n var lat = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"radiansToDegrees\"])(latitude2);\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])([lng, lat], options.properties);\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/destination/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/helpers/dist/es/index.js": +/*!*****************************************************!*\ + !*** ./node_modules/@turf/helpers/dist/es/index.js ***! + \*****************************************************/ +/*! exports provided: earthRadius, factors, unitsFactors, areaFactors, feature, geometry, point, points, polygon, polygons, lineString, lineStrings, featureCollection, multiLineString, multiPoint, multiPolygon, geometryCollection, round, radiansToLength, lengthToRadians, lengthToDegrees, bearingToAzimuth, radiansToDegrees, degreesToRadians, convertLength, convertArea, isNumber, isObject, validateBBox, validateId */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"earthRadius\", function() { return earthRadius; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"factors\", function() { return factors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"unitsFactors\", function() { return unitsFactors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"areaFactors\", function() { return areaFactors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"feature\", function() { return feature; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geometry\", function() { return geometry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"point\", function() { return point; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"points\", function() { return points; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"polygon\", function() { return polygon; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"polygons\", function() { return polygons; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lineString\", function() { return lineString; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lineStrings\", function() { return lineStrings; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"featureCollection\", function() { return featureCollection; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiLineString\", function() { return multiLineString; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiPoint\", function() { return multiPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiPolygon\", function() { return multiPolygon; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geometryCollection\", function() { return geometryCollection; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"round\", function() { return round; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"radiansToLength\", function() { return radiansToLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lengthToRadians\", function() { return lengthToRadians; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lengthToDegrees\", function() { return lengthToDegrees; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bearingToAzimuth\", function() { return bearingToAzimuth; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"radiansToDegrees\", function() { return radiansToDegrees; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"degreesToRadians\", function() { return degreesToRadians; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"convertLength\", function() { return convertLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"convertArea\", function() { return convertArea; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNumber\", function() { return isNumber; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObject\", function() { return isObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"validateBBox\", function() { return validateBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"validateId\", function() { return validateId; });\n/**\n * @module helpers\n */\n/**\n * Earth Radius used with the Harvesine formula and approximates using a spherical (non-ellipsoid) Earth.\n *\n * @memberof helpers\n * @type {number}\n */\nvar earthRadius = 6371008.8;\n/**\n * Unit of measurement factors using a spherical (non-ellipsoid) earth radius.\n *\n * @memberof helpers\n * @type {Object}\n */\nvar factors = {\n centimeters: earthRadius * 100,\n centimetres: earthRadius * 100,\n degrees: earthRadius / 111325,\n feet: earthRadius * 3.28084,\n inches: earthRadius * 39.37,\n kilometers: earthRadius / 1000,\n kilometres: earthRadius / 1000,\n meters: earthRadius,\n metres: earthRadius,\n miles: earthRadius / 1609.344,\n millimeters: earthRadius * 1000,\n millimetres: earthRadius * 1000,\n nauticalmiles: earthRadius / 1852,\n radians: 1,\n yards: earthRadius / 1.0936,\n};\n/**\n * Units of measurement factors based on 1 meter.\n *\n * @memberof helpers\n * @type {Object}\n */\nvar unitsFactors = {\n centimeters: 100,\n centimetres: 100,\n degrees: 1 / 111325,\n feet: 3.28084,\n inches: 39.37,\n kilometers: 1 / 1000,\n kilometres: 1 / 1000,\n meters: 1,\n metres: 1,\n miles: 1 / 1609.344,\n millimeters: 1000,\n millimetres: 1000,\n nauticalmiles: 1 / 1852,\n radians: 1 / earthRadius,\n yards: 1 / 1.0936,\n};\n/**\n * Area of measurement factors based on 1 square meter.\n *\n * @memberof helpers\n * @type {Object}\n */\nvar areaFactors = {\n acres: 0.000247105,\n centimeters: 10000,\n centimetres: 10000,\n feet: 10.763910417,\n hectares: 0.0001,\n inches: 1550.003100006,\n kilometers: 0.000001,\n kilometres: 0.000001,\n meters: 1,\n metres: 1,\n miles: 3.86e-7,\n millimeters: 1000000,\n millimetres: 1000000,\n yards: 1.195990046,\n};\n/**\n * Wraps a GeoJSON {@link Geometry} in a GeoJSON {@link Feature}.\n *\n * @name feature\n * @param {Geometry} geometry input geometry\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a GeoJSON Feature\n * @example\n * var geometry = {\n * \"type\": \"Point\",\n * \"coordinates\": [110, 50]\n * };\n *\n * var feature = turf.feature(geometry);\n *\n * //=feature\n */\nfunction feature(geom, properties, options) {\n if (options === void 0) { options = {}; }\n var feat = { type: \"Feature\" };\n if (options.id === 0 || options.id) {\n feat.id = options.id;\n }\n if (options.bbox) {\n feat.bbox = options.bbox;\n }\n feat.properties = properties || {};\n feat.geometry = geom;\n return feat;\n}\n/**\n * Creates a GeoJSON {@link Geometry} from a Geometry string type & coordinates.\n * For GeometryCollection type use `helpers.geometryCollection`\n *\n * @name geometry\n * @param {string} type Geometry Type\n * @param {Array} coordinates Coordinates\n * @param {Object} [options={}] Optional Parameters\n * @returns {Geometry} a GeoJSON Geometry\n * @example\n * var type = \"Point\";\n * var coordinates = [110, 50];\n * var geometry = turf.geometry(type, coordinates);\n * // => geometry\n */\nfunction geometry(type, coordinates, _options) {\n if (_options === void 0) { _options = {}; }\n switch (type) {\n case \"Point\":\n return point(coordinates).geometry;\n case \"LineString\":\n return lineString(coordinates).geometry;\n case \"Polygon\":\n return polygon(coordinates).geometry;\n case \"MultiPoint\":\n return multiPoint(coordinates).geometry;\n case \"MultiLineString\":\n return multiLineString(coordinates).geometry;\n case \"MultiPolygon\":\n return multiPolygon(coordinates).geometry;\n default:\n throw new Error(type + \" is invalid\");\n }\n}\n/**\n * Creates a {@link Point} {@link Feature} from a Position.\n *\n * @name point\n * @param {Array} coordinates longitude, latitude position (each in decimal degrees)\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a Point feature\n * @example\n * var point = turf.point([-75.343, 39.984]);\n *\n * //=point\n */\nfunction point(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n if (!coordinates) {\n throw new Error(\"coordinates is required\");\n }\n if (!Array.isArray(coordinates)) {\n throw new Error(\"coordinates must be an Array\");\n }\n if (coordinates.length < 2) {\n throw new Error(\"coordinates must be at least 2 numbers long\");\n }\n if (!isNumber(coordinates[0]) || !isNumber(coordinates[1])) {\n throw new Error(\"coordinates must contain numbers\");\n }\n var geom = {\n type: \"Point\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\n/**\n * Creates a {@link Point} {@link FeatureCollection} from an Array of Point coordinates.\n *\n * @name points\n * @param {Array>} coordinates an array of Points\n * @param {Object} [properties={}] Translate these properties to each Feature\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north]\n * associated with the FeatureCollection\n * @param {string|number} [options.id] Identifier associated with the FeatureCollection\n * @returns {FeatureCollection} Point Feature\n * @example\n * var points = turf.points([\n * [-75, 39],\n * [-80, 45],\n * [-78, 50]\n * ]);\n *\n * //=points\n */\nfunction points(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n return featureCollection(coordinates.map(function (coords) {\n return point(coords, properties);\n }), options);\n}\n/**\n * Creates a {@link Polygon} {@link Feature} from an Array of LinearRings.\n *\n * @name polygon\n * @param {Array>>} coordinates an array of LinearRings\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} Polygon Feature\n * @example\n * var polygon = turf.polygon([[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]], { name: 'poly1' });\n *\n * //=polygon\n */\nfunction polygon(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n for (var _i = 0, coordinates_1 = coordinates; _i < coordinates_1.length; _i++) {\n var ring = coordinates_1[_i];\n if (ring.length < 4) {\n throw new Error(\"Each LinearRing of a Polygon must have 4 or more Positions.\");\n }\n for (var j = 0; j < ring[ring.length - 1].length; j++) {\n // Check if first point of Polygon contains two numbers\n if (ring[ring.length - 1][j] !== ring[0][j]) {\n throw new Error(\"First and last Position are not equivalent.\");\n }\n }\n }\n var geom = {\n type: \"Polygon\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\n/**\n * Creates a {@link Polygon} {@link FeatureCollection} from an Array of Polygon coordinates.\n *\n * @name polygons\n * @param {Array>>>} coordinates an array of Polygon coordinates\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the FeatureCollection\n * @returns {FeatureCollection} Polygon FeatureCollection\n * @example\n * var polygons = turf.polygons([\n * [[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]],\n * [[[-15, 42], [-14, 46], [-12, 41], [-17, 44], [-15, 42]]],\n * ]);\n *\n * //=polygons\n */\nfunction polygons(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n return featureCollection(coordinates.map(function (coords) {\n return polygon(coords, properties);\n }), options);\n}\n/**\n * Creates a {@link LineString} {@link Feature} from an Array of Positions.\n *\n * @name lineString\n * @param {Array>} coordinates an array of Positions\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} LineString Feature\n * @example\n * var linestring1 = turf.lineString([[-24, 63], [-23, 60], [-25, 65], [-20, 69]], {name: 'line 1'});\n * var linestring2 = turf.lineString([[-14, 43], [-13, 40], [-15, 45], [-10, 49]], {name: 'line 2'});\n *\n * //=linestring1\n * //=linestring2\n */\nfunction lineString(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n if (coordinates.length < 2) {\n throw new Error(\"coordinates must be an array of two or more positions\");\n }\n var geom = {\n type: \"LineString\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\n/**\n * Creates a {@link LineString} {@link FeatureCollection} from an Array of LineString coordinates.\n *\n * @name lineStrings\n * @param {Array>>} coordinates an array of LinearRings\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north]\n * associated with the FeatureCollection\n * @param {string|number} [options.id] Identifier associated with the FeatureCollection\n * @returns {FeatureCollection} LineString FeatureCollection\n * @example\n * var linestrings = turf.lineStrings([\n * [[-24, 63], [-23, 60], [-25, 65], [-20, 69]],\n * [[-14, 43], [-13, 40], [-15, 45], [-10, 49]]\n * ]);\n *\n * //=linestrings\n */\nfunction lineStrings(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n return featureCollection(coordinates.map(function (coords) {\n return lineString(coords, properties);\n }), options);\n}\n/**\n * Takes one or more {@link Feature|Features} and creates a {@link FeatureCollection}.\n *\n * @name featureCollection\n * @param {Feature[]} features input features\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {FeatureCollection} FeatureCollection of Features\n * @example\n * var locationA = turf.point([-75.343, 39.984], {name: 'Location A'});\n * var locationB = turf.point([-75.833, 39.284], {name: 'Location B'});\n * var locationC = turf.point([-75.534, 39.123], {name: 'Location C'});\n *\n * var collection = turf.featureCollection([\n * locationA,\n * locationB,\n * locationC\n * ]);\n *\n * //=collection\n */\nfunction featureCollection(features, options) {\n if (options === void 0) { options = {}; }\n var fc = { type: \"FeatureCollection\" };\n if (options.id) {\n fc.id = options.id;\n }\n if (options.bbox) {\n fc.bbox = options.bbox;\n }\n fc.features = features;\n return fc;\n}\n/**\n * Creates a {@link Feature} based on a\n * coordinate array. Properties can be added optionally.\n *\n * @name multiLineString\n * @param {Array>>} coordinates an array of LineStrings\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a MultiLineString feature\n * @throws {Error} if no coordinates are passed\n * @example\n * var multiLine = turf.multiLineString([[[0,0],[10,10]]]);\n *\n * //=multiLine\n */\nfunction multiLineString(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n var geom = {\n type: \"MultiLineString\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\n/**\n * Creates a {@link Feature} based on a\n * coordinate array. Properties can be added optionally.\n *\n * @name multiPoint\n * @param {Array>} coordinates an array of Positions\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a MultiPoint feature\n * @throws {Error} if no coordinates are passed\n * @example\n * var multiPt = turf.multiPoint([[0,0],[10,10]]);\n *\n * //=multiPt\n */\nfunction multiPoint(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n var geom = {\n type: \"MultiPoint\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\n/**\n * Creates a {@link Feature} based on a\n * coordinate array. Properties can be added optionally.\n *\n * @name multiPolygon\n * @param {Array>>>} coordinates an array of Polygons\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a multipolygon feature\n * @throws {Error} if no coordinates are passed\n * @example\n * var multiPoly = turf.multiPolygon([[[[0,0],[0,10],[10,10],[10,0],[0,0]]]]);\n *\n * //=multiPoly\n *\n */\nfunction multiPolygon(coordinates, properties, options) {\n if (options === void 0) { options = {}; }\n var geom = {\n type: \"MultiPolygon\",\n coordinates: coordinates,\n };\n return feature(geom, properties, options);\n}\n/**\n * Creates a {@link Feature} based on a\n * coordinate array. Properties can be added optionally.\n *\n * @name geometryCollection\n * @param {Array} geometries an array of GeoJSON Geometries\n * @param {Object} [properties={}] an Object of key-value pairs to add as properties\n * @param {Object} [options={}] Optional Parameters\n * @param {Array} [options.bbox] Bounding Box Array [west, south, east, north] associated with the Feature\n * @param {string|number} [options.id] Identifier associated with the Feature\n * @returns {Feature} a GeoJSON GeometryCollection Feature\n * @example\n * var pt = turf.geometry(\"Point\", [100, 0]);\n * var line = turf.geometry(\"LineString\", [[101, 0], [102, 1]]);\n * var collection = turf.geometryCollection([pt, line]);\n *\n * // => collection\n */\nfunction geometryCollection(geometries, properties, options) {\n if (options === void 0) { options = {}; }\n var geom = {\n type: \"GeometryCollection\",\n geometries: geometries,\n };\n return feature(geom, properties, options);\n}\n/**\n * Round number to precision\n *\n * @param {number} num Number\n * @param {number} [precision=0] Precision\n * @returns {number} rounded number\n * @example\n * turf.round(120.4321)\n * //=120\n *\n * turf.round(120.4321, 2)\n * //=120.43\n */\nfunction round(num, precision) {\n if (precision === void 0) { precision = 0; }\n if (precision && !(precision >= 0)) {\n throw new Error(\"precision must be a positive number\");\n }\n var multiplier = Math.pow(10, precision || 0);\n return Math.round(num * multiplier) / multiplier;\n}\n/**\n * Convert a distance measurement (assuming a spherical Earth) from radians to a more friendly unit.\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet\n *\n * @name radiansToLength\n * @param {number} radians in radians across the sphere\n * @param {string} [units=\"kilometers\"] can be degrees, radians, miles, inches, yards, metres,\n * meters, kilometres, kilometers.\n * @returns {number} distance\n */\nfunction radiansToLength(radians, units) {\n if (units === void 0) { units = \"kilometers\"; }\n var factor = factors[units];\n if (!factor) {\n throw new Error(units + \" units is invalid\");\n }\n return radians * factor;\n}\n/**\n * Convert a distance measurement (assuming a spherical Earth) from a real-world unit into radians\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet\n *\n * @name lengthToRadians\n * @param {number} distance in real units\n * @param {string} [units=\"kilometers\"] can be degrees, radians, miles, inches, yards, metres,\n * meters, kilometres, kilometers.\n * @returns {number} radians\n */\nfunction lengthToRadians(distance, units) {\n if (units === void 0) { units = \"kilometers\"; }\n var factor = factors[units];\n if (!factor) {\n throw new Error(units + \" units is invalid\");\n }\n return distance / factor;\n}\n/**\n * Convert a distance measurement (assuming a spherical Earth) from a real-world unit into degrees\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, centimeters, kilometres, feet\n *\n * @name lengthToDegrees\n * @param {number} distance in real units\n * @param {string} [units=\"kilometers\"] can be degrees, radians, miles, inches, yards, metres,\n * meters, kilometres, kilometers.\n * @returns {number} degrees\n */\nfunction lengthToDegrees(distance, units) {\n return radiansToDegrees(lengthToRadians(distance, units));\n}\n/**\n * Converts any bearing angle from the north line direction (positive clockwise)\n * and returns an angle between 0-360 degrees (positive clockwise), 0 being the north line\n *\n * @name bearingToAzimuth\n * @param {number} bearing angle, between -180 and +180 degrees\n * @returns {number} angle between 0 and 360 degrees\n */\nfunction bearingToAzimuth(bearing) {\n var angle = bearing % 360;\n if (angle < 0) {\n angle += 360;\n }\n return angle;\n}\n/**\n * Converts an angle in radians to degrees\n *\n * @name radiansToDegrees\n * @param {number} radians angle in radians\n * @returns {number} degrees between 0 and 360 degrees\n */\nfunction radiansToDegrees(radians) {\n var degrees = radians % (2 * Math.PI);\n return (degrees * 180) / Math.PI;\n}\n/**\n * Converts an angle in degrees to radians\n *\n * @name degreesToRadians\n * @param {number} degrees angle between 0 and 360 degrees\n * @returns {number} angle in radians\n */\nfunction degreesToRadians(degrees) {\n var radians = degrees % 360;\n return (radians * Math.PI) / 180;\n}\n/**\n * Converts a length to the requested unit.\n * Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet\n *\n * @param {number} length to be converted\n * @param {Units} [originalUnit=\"kilometers\"] of the length\n * @param {Units} [finalUnit=\"kilometers\"] returned unit\n * @returns {number} the converted length\n */\nfunction convertLength(length, originalUnit, finalUnit) {\n if (originalUnit === void 0) { originalUnit = \"kilometers\"; }\n if (finalUnit === void 0) { finalUnit = \"kilometers\"; }\n if (!(length >= 0)) {\n throw new Error(\"length must be a positive number\");\n }\n return radiansToLength(lengthToRadians(length, originalUnit), finalUnit);\n}\n/**\n * Converts a area to the requested unit.\n * Valid units: kilometers, kilometres, meters, metres, centimetres, millimeters, acres, miles, yards, feet, inches, hectares\n * @param {number} area to be converted\n * @param {Units} [originalUnit=\"meters\"] of the distance\n * @param {Units} [finalUnit=\"kilometers\"] returned unit\n * @returns {number} the converted area\n */\nfunction convertArea(area, originalUnit, finalUnit) {\n if (originalUnit === void 0) { originalUnit = \"meters\"; }\n if (finalUnit === void 0) { finalUnit = \"kilometers\"; }\n if (!(area >= 0)) {\n throw new Error(\"area must be a positive number\");\n }\n var startFactor = areaFactors[originalUnit];\n if (!startFactor) {\n throw new Error(\"invalid original units\");\n }\n var finalFactor = areaFactors[finalUnit];\n if (!finalFactor) {\n throw new Error(\"invalid final units\");\n }\n return (area / startFactor) * finalFactor;\n}\n/**\n * isNumber\n *\n * @param {*} num Number to validate\n * @returns {boolean} true/false\n * @example\n * turf.isNumber(123)\n * //=true\n * turf.isNumber('foo')\n * //=false\n */\nfunction isNumber(num) {\n return !isNaN(num) && num !== null && !Array.isArray(num);\n}\n/**\n * isObject\n *\n * @param {*} input variable to validate\n * @returns {boolean} true/false\n * @example\n * turf.isObject({elevation: 10})\n * //=true\n * turf.isObject('foo')\n * //=false\n */\nfunction isObject(input) {\n return !!input && input.constructor === Object;\n}\n/**\n * Validate BBox\n *\n * @private\n * @param {Array} bbox BBox to validate\n * @returns {void}\n * @throws Error if BBox is not valid\n * @example\n * validateBBox([-180, -40, 110, 50])\n * //=OK\n * validateBBox([-180, -40])\n * //=Error\n * validateBBox('Foo')\n * //=Error\n * validateBBox(5)\n * //=Error\n * validateBBox(null)\n * //=Error\n * validateBBox(undefined)\n * //=Error\n */\nfunction validateBBox(bbox) {\n if (!bbox) {\n throw new Error(\"bbox is required\");\n }\n if (!Array.isArray(bbox)) {\n throw new Error(\"bbox must be an Array\");\n }\n if (bbox.length !== 4 && bbox.length !== 6) {\n throw new Error(\"bbox must be an Array of 4 or 6 numbers\");\n }\n bbox.forEach(function (num) {\n if (!isNumber(num)) {\n throw new Error(\"bbox must only contain numbers\");\n }\n });\n}\n/**\n * Validate Id\n *\n * @private\n * @param {string|number} id Id to validate\n * @returns {void}\n * @throws Error if Id is not valid\n * @example\n * validateId([-180, -40, 110, 50])\n * //=Error\n * validateId([-180, -40])\n * //=Error\n * validateId('Foo')\n * //=OK\n * validateId(5)\n * //=OK\n * validateId(null)\n * //=Error\n * validateId(undefined)\n * //=Error\n */\nfunction validateId(id) {\n if (!id) {\n throw new Error(\"id is required\");\n }\n if ([\"string\", \"number\"].indexOf(typeof id) === -1) {\n throw new Error(\"id must be a number or a string\");\n }\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/helpers/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/invariant/dist/es/index.js": +/*!*******************************************************!*\ + !*** ./node_modules/@turf/invariant/dist/es/index.js ***! + \*******************************************************/ +/*! exports provided: getCoord, getCoords, containsNumber, geojsonType, featureOf, collectionOf, getGeom, getType */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getCoord\", function() { return getCoord; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getCoords\", function() { return getCoords; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"containsNumber\", function() { return containsNumber; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geojsonType\", function() { return geojsonType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"featureOf\", function() { return featureOf; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"collectionOf\", function() { return collectionOf; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getGeom\", function() { return getGeom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getType\", function() { return getType; });\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n\n/**\n * Unwrap a coordinate from a Point Feature, Geometry or a single coordinate.\n *\n * @name getCoord\n * @param {Array|Geometry|Feature} coord GeoJSON Point or an Array of numbers\n * @returns {Array} coordinates\n * @example\n * var pt = turf.point([10, 10]);\n *\n * var coord = turf.getCoord(pt);\n * //= [10, 10]\n */\nfunction getCoord(coord) {\n if (!coord) {\n throw new Error(\"coord is required\");\n }\n if (!Array.isArray(coord)) {\n if (coord.type === \"Feature\" &&\n coord.geometry !== null &&\n coord.geometry.type === \"Point\") {\n return coord.geometry.coordinates;\n }\n if (coord.type === \"Point\") {\n return coord.coordinates;\n }\n }\n if (Array.isArray(coord) &&\n coord.length >= 2 &&\n !Array.isArray(coord[0]) &&\n !Array.isArray(coord[1])) {\n return coord;\n }\n throw new Error(\"coord must be GeoJSON Point or an Array of numbers\");\n}\n/**\n * Unwrap coordinates from a Feature, Geometry Object or an Array\n *\n * @name getCoords\n * @param {Array|Geometry|Feature} coords Feature, Geometry Object or an Array\n * @returns {Array} coordinates\n * @example\n * var poly = turf.polygon([[[119.32, -8.7], [119.55, -8.69], [119.51, -8.54], [119.32, -8.7]]]);\n *\n * var coords = turf.getCoords(poly);\n * //= [[[119.32, -8.7], [119.55, -8.69], [119.51, -8.54], [119.32, -8.7]]]\n */\nfunction getCoords(coords) {\n if (Array.isArray(coords)) {\n return coords;\n }\n // Feature\n if (coords.type === \"Feature\") {\n if (coords.geometry !== null) {\n return coords.geometry.coordinates;\n }\n }\n else {\n // Geometry\n if (coords.coordinates) {\n return coords.coordinates;\n }\n }\n throw new Error(\"coords must be GeoJSON Feature, Geometry Object or an Array\");\n}\n/**\n * Checks if coordinates contains a number\n *\n * @name containsNumber\n * @param {Array} coordinates GeoJSON Coordinates\n * @returns {boolean} true if Array contains a number\n */\nfunction containsNumber(coordinates) {\n if (coordinates.length > 1 &&\n Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(coordinates[0]) &&\n Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(coordinates[1])) {\n return true;\n }\n if (Array.isArray(coordinates[0]) && coordinates[0].length) {\n return containsNumber(coordinates[0]);\n }\n throw new Error(\"coordinates must only contain numbers\");\n}\n/**\n * Enforce expectations about types of GeoJSON objects for Turf.\n *\n * @name geojsonType\n * @param {GeoJSON} value any GeoJSON object\n * @param {string} type expected GeoJSON type\n * @param {string} name name of calling function\n * @throws {Error} if value is not the expected type.\n */\nfunction geojsonType(value, type, name) {\n if (!type || !name) {\n throw new Error(\"type and name required\");\n }\n if (!value || value.type !== type) {\n throw new Error(\"Invalid input to \" +\n name +\n \": must be a \" +\n type +\n \", given \" +\n value.type);\n }\n}\n/**\n * Enforce expectations about types of {@link Feature} inputs for Turf.\n * Internally this uses {@link geojsonType} to judge geometry types.\n *\n * @name featureOf\n * @param {Feature} feature a feature with an expected geometry type\n * @param {string} type expected GeoJSON type\n * @param {string} name name of calling function\n * @throws {Error} error if value is not the expected type.\n */\nfunction featureOf(feature, type, name) {\n if (!feature) {\n throw new Error(\"No feature passed\");\n }\n if (!name) {\n throw new Error(\".featureOf() requires a name\");\n }\n if (!feature || feature.type !== \"Feature\" || !feature.geometry) {\n throw new Error(\"Invalid input to \" + name + \", Feature with geometry required\");\n }\n if (!feature.geometry || feature.geometry.type !== type) {\n throw new Error(\"Invalid input to \" +\n name +\n \": must be a \" +\n type +\n \", given \" +\n feature.geometry.type);\n }\n}\n/**\n * Enforce expectations about types of {@link FeatureCollection} inputs for Turf.\n * Internally this uses {@link geojsonType} to judge geometry types.\n *\n * @name collectionOf\n * @param {FeatureCollection} featureCollection a FeatureCollection for which features will be judged\n * @param {string} type expected GeoJSON type\n * @param {string} name name of calling function\n * @throws {Error} if value is not the expected type.\n */\nfunction collectionOf(featureCollection, type, name) {\n if (!featureCollection) {\n throw new Error(\"No featureCollection passed\");\n }\n if (!name) {\n throw new Error(\".collectionOf() requires a name\");\n }\n if (!featureCollection || featureCollection.type !== \"FeatureCollection\") {\n throw new Error(\"Invalid input to \" + name + \", FeatureCollection required\");\n }\n for (var _i = 0, _a = featureCollection.features; _i < _a.length; _i++) {\n var feature = _a[_i];\n if (!feature || feature.type !== \"Feature\" || !feature.geometry) {\n throw new Error(\"Invalid input to \" + name + \", Feature with geometry required\");\n }\n if (!feature.geometry || feature.geometry.type !== type) {\n throw new Error(\"Invalid input to \" +\n name +\n \": must be a \" +\n type +\n \", given \" +\n feature.geometry.type);\n }\n }\n}\n/**\n * Get Geometry from Feature or Geometry Object\n *\n * @param {Feature|Geometry} geojson GeoJSON Feature or Geometry Object\n * @returns {Geometry|null} GeoJSON Geometry Object\n * @throws {Error} if geojson is not a Feature or Geometry Object\n * @example\n * var point = {\n * \"type\": \"Feature\",\n * \"properties\": {},\n * \"geometry\": {\n * \"type\": \"Point\",\n * \"coordinates\": [110, 40]\n * }\n * }\n * var geom = turf.getGeom(point)\n * //={\"type\": \"Point\", \"coordinates\": [110, 40]}\n */\nfunction getGeom(geojson) {\n if (geojson.type === \"Feature\") {\n return geojson.geometry;\n }\n return geojson;\n}\n/**\n * Get GeoJSON object's type, Geometry type is prioritize.\n *\n * @param {GeoJSON} geojson GeoJSON object\n * @param {string} [name=\"geojson\"] name of the variable to display in error message (unused)\n * @returns {string} GeoJSON type\n * @example\n * var point = {\n * \"type\": \"Feature\",\n * \"properties\": {},\n * \"geometry\": {\n * \"type\": \"Point\",\n * \"coordinates\": [110, 40]\n * }\n * }\n * var geom = turf.getType(point)\n * //=\"Point\"\n */\nfunction getType(geojson, _name) {\n if (geojson.type === \"FeatureCollection\") {\n return \"FeatureCollection\";\n }\n if (geojson.type === \"GeometryCollection\") {\n return \"GeometryCollection\";\n }\n if (geojson.type === \"Feature\" && geojson.geometry !== null) {\n return geojson.geometry.type;\n }\n return geojson.type;\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/invariant/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/line-intersect/dist/es/index.js": +/*!************************************************************!*\ + !*** ./node_modules/@turf/line-intersect/dist/es/index.js ***! + \************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n/* harmony import */ var _turf_invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/invariant */ \"./node_modules/@turf/invariant/dist/es/index.js\");\n/* harmony import */ var _turf_line_segment__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @turf/line-segment */ \"./node_modules/@turf/line-segment/dist/es/index.js\");\n/* harmony import */ var _turf_meta__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @turf/meta */ \"./node_modules/@turf/meta/dist/es/index.js\");\n/* harmony import */ var geojson_rbush__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! geojson-rbush */ \"./node_modules/geojson-rbush/index.js\");\n/* harmony import */ var geojson_rbush__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(geojson_rbush__WEBPACK_IMPORTED_MODULE_4__);\n\n\n\n\n\n/**\n * Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).\n *\n * @name lineIntersect\n * @param {GeoJSON} line1 any LineString or Polygon\n * @param {GeoJSON} line2 any LineString or Polygon\n * @returns {FeatureCollection} point(s) that intersect both\n * @example\n * var line1 = turf.lineString([[126, -11], [129, -21]]);\n * var line2 = turf.lineString([[123, -18], [131, -14]]);\n * var intersects = turf.lineIntersect(line1, line2);\n *\n * //addToMap\n * var addToMap = [line1, line2, intersects]\n */\nfunction lineIntersect(line1, line2) {\n var unique = {};\n var results = [];\n // First, normalize geometries to features\n // Then, handle simple 2-vertex segments\n if (line1.type === \"LineString\") {\n line1 = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"feature\"])(line1);\n }\n if (line2.type === \"LineString\") {\n line2 = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"feature\"])(line2);\n }\n if (line1.type === \"Feature\" &&\n line2.type === \"Feature\" &&\n line1.geometry !== null &&\n line2.geometry !== null &&\n line1.geometry.type === \"LineString\" &&\n line2.geometry.type === \"LineString\" &&\n line1.geometry.coordinates.length === 2 &&\n line2.geometry.coordinates.length === 2) {\n var intersect = intersects(line1, line2);\n if (intersect) {\n results.push(intersect);\n }\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"featureCollection\"])(results);\n }\n // Handles complex GeoJSON Geometries\n var tree = geojson_rbush__WEBPACK_IMPORTED_MODULE_4___default()();\n tree.load(Object(_turf_line_segment__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(line2));\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_3__[\"featureEach\"])(Object(_turf_line_segment__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(line1), function (segment) {\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_3__[\"featureEach\"])(tree.search(segment), function (match) {\n var intersect = intersects(segment, match);\n if (intersect) {\n // prevent duplicate points https://github.com/Turfjs/turf/issues/688\n var key = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getCoords\"])(intersect).join(\",\");\n if (!unique[key]) {\n unique[key] = true;\n results.push(intersect);\n }\n }\n });\n });\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"featureCollection\"])(results);\n}\n/**\n * Find a point that intersects LineStrings with two coordinates each\n *\n * @private\n * @param {Feature} line1 GeoJSON LineString (Must only contain 2 coordinates)\n * @param {Feature} line2 GeoJSON LineString (Must only contain 2 coordinates)\n * @returns {Feature} intersecting GeoJSON Point\n */\nfunction intersects(line1, line2) {\n var coords1 = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getCoords\"])(line1);\n var coords2 = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getCoords\"])(line2);\n if (coords1.length !== 2) {\n throw new Error(\" line1 must only contain 2 coordinates\");\n }\n if (coords2.length !== 2) {\n throw new Error(\" line2 must only contain 2 coordinates\");\n }\n var x1 = coords1[0][0];\n var y1 = coords1[0][1];\n var x2 = coords1[1][0];\n var y2 = coords1[1][1];\n var x3 = coords2[0][0];\n var y3 = coords2[0][1];\n var x4 = coords2[1][0];\n var y4 = coords2[1][1];\n var denom = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);\n var numeA = (x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3);\n var numeB = (x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3);\n if (denom === 0) {\n if (numeA === 0 && numeB === 0) {\n return null;\n }\n return null;\n }\n var uA = numeA / denom;\n var uB = numeB / denom;\n if (uA >= 0 && uA <= 1 && uB >= 0 && uB <= 1) {\n var x = x1 + uA * (x2 - x1);\n var y = y1 + uA * (y2 - y1);\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])([x, y]);\n }\n return null;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (lineIntersect);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/line-intersect/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/line-segment/dist/es/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/@turf/line-segment/dist/es/index.js ***! + \**********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n/* harmony import */ var _turf_invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/invariant */ \"./node_modules/@turf/invariant/dist/es/index.js\");\n/* harmony import */ var _turf_meta__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @turf/meta */ \"./node_modules/@turf/meta/dist/es/index.js\");\n\n\n\n/**\n * Creates a {@link FeatureCollection} of 2-vertex {@link LineString} segments from a\n * {@link LineString|(Multi)LineString} or {@link Polygon|(Multi)Polygon}.\n *\n * @name lineSegment\n * @param {GeoJSON} geojson GeoJSON Polygon or LineString\n * @returns {FeatureCollection} 2-vertex line segments\n * @example\n * var polygon = turf.polygon([[[-50, 5], [-40, -10], [-50, -10], [-40, 5], [-50, 5]]]);\n * var segments = turf.lineSegment(polygon);\n *\n * //addToMap\n * var addToMap = [polygon, segments]\n */\nfunction lineSegment(geojson) {\n if (!geojson) {\n throw new Error(\"geojson is required\");\n }\n var results = [];\n Object(_turf_meta__WEBPACK_IMPORTED_MODULE_2__[\"flattenEach\"])(geojson, function (feature) {\n lineSegmentFeature(feature, results);\n });\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"featureCollection\"])(results);\n}\n/**\n * Line Segment\n *\n * @private\n * @param {Feature} geojson Line or polygon feature\n * @param {Array} results push to results\n * @returns {void}\n */\nfunction lineSegmentFeature(geojson, results) {\n var coords = [];\n var geometry = geojson.geometry;\n if (geometry !== null) {\n switch (geometry.type) {\n case \"Polygon\":\n coords = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getCoords\"])(geometry);\n break;\n case \"LineString\":\n coords = [Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getCoords\"])(geometry)];\n }\n coords.forEach(function (coord) {\n var segments = createSegments(coord, geojson.properties);\n segments.forEach(function (segment) {\n segment.id = results.length;\n results.push(segment);\n });\n });\n }\n}\n/**\n * Create Segments from LineString coordinates\n *\n * @private\n * @param {Array>} coords LineString coordinates\n * @param {*} properties GeoJSON properties\n * @returns {Array>} line segments\n */\nfunction createSegments(coords, properties) {\n var segments = [];\n coords.reduce(function (previousCoords, currentCoords) {\n var segment = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])([previousCoords, currentCoords], properties);\n segment.bbox = bbox(previousCoords, currentCoords);\n segments.push(segment);\n return currentCoords;\n });\n return segments;\n}\n/**\n * Create BBox between two coordinates (faster than @turf/bbox)\n *\n * @private\n * @param {Array} coords1 Point coordinate\n * @param {Array} coords2 Point coordinate\n * @returns {BBox} [west, south, east, north]\n */\nfunction bbox(coords1, coords2) {\n var x1 = coords1[0];\n var y1 = coords1[1];\n var x2 = coords2[0];\n var y2 = coords2[1];\n var west = x1 < x2 ? x1 : x2;\n var south = y1 < y2 ? y1 : y2;\n var east = x1 > x2 ? x1 : x2;\n var north = y1 > y2 ? y1 : y2;\n return [west, south, east, north];\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (lineSegment);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/line-segment/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/meta/dist/es/index.js": +/*!**************************************************!*\ + !*** ./node_modules/@turf/meta/dist/es/index.js ***! + \**************************************************/ +/*! exports provided: coordEach, coordReduce, propEach, propReduce, featureEach, featureReduce, coordAll, geomEach, geomReduce, flattenEach, flattenReduce, segmentEach, segmentReduce, lineEach, lineReduce, findSegment, findPoint */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"coordEach\", function() { return coordEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"coordReduce\", function() { return coordReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"propEach\", function() { return propEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"propReduce\", function() { return propReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"featureEach\", function() { return featureEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"featureReduce\", function() { return featureReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"coordAll\", function() { return coordAll; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geomEach\", function() { return geomEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geomReduce\", function() { return geomReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flattenEach\", function() { return flattenEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flattenReduce\", function() { return flattenReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"segmentEach\", function() { return segmentEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"segmentReduce\", function() { return segmentReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lineEach\", function() { return lineEach; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lineReduce\", function() { return lineReduce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findSegment\", function() { return findSegment; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findPoint\", function() { return findPoint; });\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n\n\n/**\n * Callback for coordEach\n *\n * @callback coordEachCallback\n * @param {Array} currentCoord The current coordinate being processed.\n * @param {number} coordIndex The current index of the coordinate being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed.\n * @param {number} geometryIndex The current index of the Geometry being processed.\n */\n\n/**\n * Iterate over coordinates in any GeoJSON object, similar to Array.forEach()\n *\n * @name coordEach\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (currentCoord, coordIndex, featureIndex, multiFeatureIndex)\n * @param {boolean} [excludeWrapCoord=false] whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration.\n * @returns {void}\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {\"foo\": \"bar\"}),\n * turf.point([36, 53], {\"hello\": \"world\"})\n * ]);\n *\n * turf.coordEach(features, function (currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) {\n * //=currentCoord\n * //=coordIndex\n * //=featureIndex\n * //=multiFeatureIndex\n * //=geometryIndex\n * });\n */\nfunction coordEach(geojson, callback, excludeWrapCoord) {\n // Handles null Geometry -- Skips this GeoJSON\n if (geojson === null) return;\n var j,\n k,\n l,\n geometry,\n stopG,\n coords,\n geometryMaybeCollection,\n wrapShrink = 0,\n coordIndex = 0,\n isGeometryCollection,\n type = geojson.type,\n isFeatureCollection = type === \"FeatureCollection\",\n isFeature = type === \"Feature\",\n stop = isFeatureCollection ? geojson.features.length : 1;\n\n // This logic may look a little weird. The reason why it is that way\n // is because it's trying to be fast. GeoJSON supports multiple kinds\n // of objects at its root: FeatureCollection, Features, Geometries.\n // This function has the responsibility of handling all of them, and that\n // means that some of the `for` loops you see below actually just don't apply\n // to certain inputs. For instance, if you give this just a\n // Point geometry, then both loops are short-circuited and all we do\n // is gradually rename the input until it's called 'geometry'.\n //\n // This also aims to allocate as few resources as possible: just a\n // few numbers and booleans, rather than any temporary arrays as would\n // be required with the normalization approach.\n for (var featureIndex = 0; featureIndex < stop; featureIndex++) {\n geometryMaybeCollection = isFeatureCollection\n ? geojson.features[featureIndex].geometry\n : isFeature\n ? geojson.geometry\n : geojson;\n isGeometryCollection = geometryMaybeCollection\n ? geometryMaybeCollection.type === \"GeometryCollection\"\n : false;\n stopG = isGeometryCollection\n ? geometryMaybeCollection.geometries.length\n : 1;\n\n for (var geomIndex = 0; geomIndex < stopG; geomIndex++) {\n var multiFeatureIndex = 0;\n var geometryIndex = 0;\n geometry = isGeometryCollection\n ? geometryMaybeCollection.geometries[geomIndex]\n : geometryMaybeCollection;\n\n // Handles null Geometry -- Skips this geometry\n if (geometry === null) continue;\n coords = geometry.coordinates;\n var geomType = geometry.type;\n\n wrapShrink =\n excludeWrapCoord &&\n (geomType === \"Polygon\" || geomType === \"MultiPolygon\")\n ? 1\n : 0;\n\n switch (geomType) {\n case null:\n break;\n case \"Point\":\n if (\n callback(\n coords,\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false\n )\n return false;\n coordIndex++;\n multiFeatureIndex++;\n break;\n case \"LineString\":\n case \"MultiPoint\":\n for (j = 0; j < coords.length; j++) {\n if (\n callback(\n coords[j],\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false\n )\n return false;\n coordIndex++;\n if (geomType === \"MultiPoint\") multiFeatureIndex++;\n }\n if (geomType === \"LineString\") multiFeatureIndex++;\n break;\n case \"Polygon\":\n case \"MultiLineString\":\n for (j = 0; j < coords.length; j++) {\n for (k = 0; k < coords[j].length - wrapShrink; k++) {\n if (\n callback(\n coords[j][k],\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false\n )\n return false;\n coordIndex++;\n }\n if (geomType === \"MultiLineString\") multiFeatureIndex++;\n if (geomType === \"Polygon\") geometryIndex++;\n }\n if (geomType === \"Polygon\") multiFeatureIndex++;\n break;\n case \"MultiPolygon\":\n for (j = 0; j < coords.length; j++) {\n geometryIndex = 0;\n for (k = 0; k < coords[j].length; k++) {\n for (l = 0; l < coords[j][k].length - wrapShrink; l++) {\n if (\n callback(\n coords[j][k][l],\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false\n )\n return false;\n coordIndex++;\n }\n geometryIndex++;\n }\n multiFeatureIndex++;\n }\n break;\n case \"GeometryCollection\":\n for (j = 0; j < geometry.geometries.length; j++)\n if (\n coordEach(geometry.geometries[j], callback, excludeWrapCoord) ===\n false\n )\n return false;\n break;\n default:\n throw new Error(\"Unknown Geometry Type\");\n }\n }\n }\n}\n\n/**\n * Callback for coordReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback coordReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {Array} currentCoord The current coordinate being processed.\n * @param {number} coordIndex The current index of the coordinate being processed.\n * Starts at index 0, if an initialValue is provided, and at index 1 otherwise.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed.\n * @param {number} geometryIndex The current index of the Geometry being processed.\n */\n\n/**\n * Reduce coordinates in any GeoJSON object, similar to Array.reduce()\n *\n * @name coordReduce\n * @param {FeatureCollection|Geometry|Feature} geojson any GeoJSON object\n * @param {Function} callback a method that takes (previousValue, currentCoord, coordIndex)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @param {boolean} [excludeWrapCoord=false] whether or not to include the final coordinate of LinearRings that wraps the ring in its iteration.\n * @returns {*} The value that results from the reduction.\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {\"foo\": \"bar\"}),\n * turf.point([36, 53], {\"hello\": \"world\"})\n * ]);\n *\n * turf.coordReduce(features, function (previousValue, currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) {\n * //=previousValue\n * //=currentCoord\n * //=coordIndex\n * //=featureIndex\n * //=multiFeatureIndex\n * //=geometryIndex\n * return currentCoord;\n * });\n */\nfunction coordReduce(geojson, callback, initialValue, excludeWrapCoord) {\n var previousValue = initialValue;\n coordEach(\n geojson,\n function (\n currentCoord,\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) {\n if (coordIndex === 0 && initialValue === undefined)\n previousValue = currentCoord;\n else\n previousValue = callback(\n previousValue,\n currentCoord,\n coordIndex,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n );\n },\n excludeWrapCoord\n );\n return previousValue;\n}\n\n/**\n * Callback for propEach\n *\n * @callback propEachCallback\n * @param {Object} currentProperties The current Properties being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n */\n\n/**\n * Iterate over properties in any GeoJSON object, similar to Array.forEach()\n *\n * @name propEach\n * @param {FeatureCollection|Feature} geojson any GeoJSON object\n * @param {Function} callback a method that takes (currentProperties, featureIndex)\n * @returns {void}\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.point([36, 53], {hello: 'world'})\n * ]);\n *\n * turf.propEach(features, function (currentProperties, featureIndex) {\n * //=currentProperties\n * //=featureIndex\n * });\n */\nfunction propEach(geojson, callback) {\n var i;\n switch (geojson.type) {\n case \"FeatureCollection\":\n for (i = 0; i < geojson.features.length; i++) {\n if (callback(geojson.features[i].properties, i) === false) break;\n }\n break;\n case \"Feature\":\n callback(geojson.properties, 0);\n break;\n }\n}\n\n/**\n * Callback for propReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback propReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {*} currentProperties The current Properties being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n */\n\n/**\n * Reduce properties in any GeoJSON object into a single value,\n * similar to how Array.reduce works. However, in this case we lazily run\n * the reduction, so an array of all properties is unnecessary.\n *\n * @name propReduce\n * @param {FeatureCollection|Feature} geojson any GeoJSON object\n * @param {Function} callback a method that takes (previousValue, currentProperties, featureIndex)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {*} The value that results from the reduction.\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.point([36, 53], {hello: 'world'})\n * ]);\n *\n * turf.propReduce(features, function (previousValue, currentProperties, featureIndex) {\n * //=previousValue\n * //=currentProperties\n * //=featureIndex\n * return currentProperties\n * });\n */\nfunction propReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n propEach(geojson, function (currentProperties, featureIndex) {\n if (featureIndex === 0 && initialValue === undefined)\n previousValue = currentProperties;\n else\n previousValue = callback(previousValue, currentProperties, featureIndex);\n });\n return previousValue;\n}\n\n/**\n * Callback for featureEach\n *\n * @callback featureEachCallback\n * @param {Feature} currentFeature The current Feature being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n */\n\n/**\n * Iterate over features in any GeoJSON object, similar to\n * Array.forEach.\n *\n * @name featureEach\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (currentFeature, featureIndex)\n * @returns {void}\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.point([36, 53], {hello: 'world'})\n * ]);\n *\n * turf.featureEach(features, function (currentFeature, featureIndex) {\n * //=currentFeature\n * //=featureIndex\n * });\n */\nfunction featureEach(geojson, callback) {\n if (geojson.type === \"Feature\") {\n callback(geojson, 0);\n } else if (geojson.type === \"FeatureCollection\") {\n for (var i = 0; i < geojson.features.length; i++) {\n if (callback(geojson.features[i], i) === false) break;\n }\n }\n}\n\n/**\n * Callback for featureReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback featureReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {Feature} currentFeature The current Feature being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n */\n\n/**\n * Reduce features in any GeoJSON object, similar to Array.reduce().\n *\n * @name featureReduce\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (previousValue, currentFeature, featureIndex)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {*} The value that results from the reduction.\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {\"foo\": \"bar\"}),\n * turf.point([36, 53], {\"hello\": \"world\"})\n * ]);\n *\n * turf.featureReduce(features, function (previousValue, currentFeature, featureIndex) {\n * //=previousValue\n * //=currentFeature\n * //=featureIndex\n * return currentFeature\n * });\n */\nfunction featureReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n featureEach(geojson, function (currentFeature, featureIndex) {\n if (featureIndex === 0 && initialValue === undefined)\n previousValue = currentFeature;\n else previousValue = callback(previousValue, currentFeature, featureIndex);\n });\n return previousValue;\n}\n\n/**\n * Get all coordinates from any GeoJSON object.\n *\n * @name coordAll\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @returns {Array>} coordinate position array\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.point([36, 53], {hello: 'world'})\n * ]);\n *\n * var coords = turf.coordAll(features);\n * //= [[26, 37], [36, 53]]\n */\nfunction coordAll(geojson) {\n var coords = [];\n coordEach(geojson, function (coord) {\n coords.push(coord);\n });\n return coords;\n}\n\n/**\n * Callback for geomEach\n *\n * @callback geomEachCallback\n * @param {Geometry} currentGeometry The current Geometry being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {Object} featureProperties The current Feature Properties being processed.\n * @param {Array} featureBBox The current Feature BBox being processed.\n * @param {number|string} featureId The current Feature Id being processed.\n */\n\n/**\n * Iterate over each geometry in any GeoJSON object, similar to Array.forEach()\n *\n * @name geomEach\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (currentGeometry, featureIndex, featureProperties, featureBBox, featureId)\n * @returns {void}\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.point([36, 53], {hello: 'world'})\n * ]);\n *\n * turf.geomEach(features, function (currentGeometry, featureIndex, featureProperties, featureBBox, featureId) {\n * //=currentGeometry\n * //=featureIndex\n * //=featureProperties\n * //=featureBBox\n * //=featureId\n * });\n */\nfunction geomEach(geojson, callback) {\n var i,\n j,\n g,\n geometry,\n stopG,\n geometryMaybeCollection,\n isGeometryCollection,\n featureProperties,\n featureBBox,\n featureId,\n featureIndex = 0,\n isFeatureCollection = geojson.type === \"FeatureCollection\",\n isFeature = geojson.type === \"Feature\",\n stop = isFeatureCollection ? geojson.features.length : 1;\n\n // This logic may look a little weird. The reason why it is that way\n // is because it's trying to be fast. GeoJSON supports multiple kinds\n // of objects at its root: FeatureCollection, Features, Geometries.\n // This function has the responsibility of handling all of them, and that\n // means that some of the `for` loops you see below actually just don't apply\n // to certain inputs. For instance, if you give this just a\n // Point geometry, then both loops are short-circuited and all we do\n // is gradually rename the input until it's called 'geometry'.\n //\n // This also aims to allocate as few resources as possible: just a\n // few numbers and booleans, rather than any temporary arrays as would\n // be required with the normalization approach.\n for (i = 0; i < stop; i++) {\n geometryMaybeCollection = isFeatureCollection\n ? geojson.features[i].geometry\n : isFeature\n ? geojson.geometry\n : geojson;\n featureProperties = isFeatureCollection\n ? geojson.features[i].properties\n : isFeature\n ? geojson.properties\n : {};\n featureBBox = isFeatureCollection\n ? geojson.features[i].bbox\n : isFeature\n ? geojson.bbox\n : undefined;\n featureId = isFeatureCollection\n ? geojson.features[i].id\n : isFeature\n ? geojson.id\n : undefined;\n isGeometryCollection = geometryMaybeCollection\n ? geometryMaybeCollection.type === \"GeometryCollection\"\n : false;\n stopG = isGeometryCollection\n ? geometryMaybeCollection.geometries.length\n : 1;\n\n for (g = 0; g < stopG; g++) {\n geometry = isGeometryCollection\n ? geometryMaybeCollection.geometries[g]\n : geometryMaybeCollection;\n\n // Handle null Geometry\n if (geometry === null) {\n if (\n callback(\n null,\n featureIndex,\n featureProperties,\n featureBBox,\n featureId\n ) === false\n )\n return false;\n continue;\n }\n switch (geometry.type) {\n case \"Point\":\n case \"LineString\":\n case \"MultiPoint\":\n case \"Polygon\":\n case \"MultiLineString\":\n case \"MultiPolygon\": {\n if (\n callback(\n geometry,\n featureIndex,\n featureProperties,\n featureBBox,\n featureId\n ) === false\n )\n return false;\n break;\n }\n case \"GeometryCollection\": {\n for (j = 0; j < geometry.geometries.length; j++) {\n if (\n callback(\n geometry.geometries[j],\n featureIndex,\n featureProperties,\n featureBBox,\n featureId\n ) === false\n )\n return false;\n }\n break;\n }\n default:\n throw new Error(\"Unknown Geometry Type\");\n }\n }\n // Only increase `featureIndex` per each feature\n featureIndex++;\n }\n}\n\n/**\n * Callback for geomReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback geomReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {Geometry} currentGeometry The current Geometry being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {Object} featureProperties The current Feature Properties being processed.\n * @param {Array} featureBBox The current Feature BBox being processed.\n * @param {number|string} featureId The current Feature Id being processed.\n */\n\n/**\n * Reduce geometry in any GeoJSON object, similar to Array.reduce().\n *\n * @name geomReduce\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (previousValue, currentGeometry, featureIndex, featureProperties, featureBBox, featureId)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {*} The value that results from the reduction.\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.point([36, 53], {hello: 'world'})\n * ]);\n *\n * turf.geomReduce(features, function (previousValue, currentGeometry, featureIndex, featureProperties, featureBBox, featureId) {\n * //=previousValue\n * //=currentGeometry\n * //=featureIndex\n * //=featureProperties\n * //=featureBBox\n * //=featureId\n * return currentGeometry\n * });\n */\nfunction geomReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n geomEach(\n geojson,\n function (\n currentGeometry,\n featureIndex,\n featureProperties,\n featureBBox,\n featureId\n ) {\n if (featureIndex === 0 && initialValue === undefined)\n previousValue = currentGeometry;\n else\n previousValue = callback(\n previousValue,\n currentGeometry,\n featureIndex,\n featureProperties,\n featureBBox,\n featureId\n );\n }\n );\n return previousValue;\n}\n\n/**\n * Callback for flattenEach\n *\n * @callback flattenEachCallback\n * @param {Feature} currentFeature The current flattened feature being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed.\n */\n\n/**\n * Iterate over flattened features in any GeoJSON object, similar to\n * Array.forEach.\n *\n * @name flattenEach\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (currentFeature, featureIndex, multiFeatureIndex)\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.multiPoint([[40, 30], [36, 53]], {hello: 'world'})\n * ]);\n *\n * turf.flattenEach(features, function (currentFeature, featureIndex, multiFeatureIndex) {\n * //=currentFeature\n * //=featureIndex\n * //=multiFeatureIndex\n * });\n */\nfunction flattenEach(geojson, callback) {\n geomEach(geojson, function (geometry, featureIndex, properties, bbox, id) {\n // Callback for single geometry\n var type = geometry === null ? null : geometry.type;\n switch (type) {\n case null:\n case \"Point\":\n case \"LineString\":\n case \"Polygon\":\n if (\n callback(\n Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"feature\"])(geometry, properties, { bbox: bbox, id: id }),\n featureIndex,\n 0\n ) === false\n )\n return false;\n return;\n }\n\n var geomType;\n\n // Callback for multi-geometry\n switch (type) {\n case \"MultiPoint\":\n geomType = \"Point\";\n break;\n case \"MultiLineString\":\n geomType = \"LineString\";\n break;\n case \"MultiPolygon\":\n geomType = \"Polygon\";\n break;\n }\n\n for (\n var multiFeatureIndex = 0;\n multiFeatureIndex < geometry.coordinates.length;\n multiFeatureIndex++\n ) {\n var coordinate = geometry.coordinates[multiFeatureIndex];\n var geom = {\n type: geomType,\n coordinates: coordinate,\n };\n if (\n callback(Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"feature\"])(geom, properties), featureIndex, multiFeatureIndex) ===\n false\n )\n return false;\n }\n });\n}\n\n/**\n * Callback for flattenReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback flattenReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {Feature} currentFeature The current Feature being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed.\n */\n\n/**\n * Reduce flattened features in any GeoJSON object, similar to Array.reduce().\n *\n * @name flattenReduce\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON object\n * @param {Function} callback a method that takes (previousValue, currentFeature, featureIndex, multiFeatureIndex)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {*} The value that results from the reduction.\n * @example\n * var features = turf.featureCollection([\n * turf.point([26, 37], {foo: 'bar'}),\n * turf.multiPoint([[40, 30], [36, 53]], {hello: 'world'})\n * ]);\n *\n * turf.flattenReduce(features, function (previousValue, currentFeature, featureIndex, multiFeatureIndex) {\n * //=previousValue\n * //=currentFeature\n * //=featureIndex\n * //=multiFeatureIndex\n * return currentFeature\n * });\n */\nfunction flattenReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n flattenEach(\n geojson,\n function (currentFeature, featureIndex, multiFeatureIndex) {\n if (\n featureIndex === 0 &&\n multiFeatureIndex === 0 &&\n initialValue === undefined\n )\n previousValue = currentFeature;\n else\n previousValue = callback(\n previousValue,\n currentFeature,\n featureIndex,\n multiFeatureIndex\n );\n }\n );\n return previousValue;\n}\n\n/**\n * Callback for segmentEach\n *\n * @callback segmentEachCallback\n * @param {Feature} currentSegment The current Segment being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed.\n * @param {number} geometryIndex The current index of the Geometry being processed.\n * @param {number} segmentIndex The current index of the Segment being processed.\n * @returns {void}\n */\n\n/**\n * Iterate over 2-vertex line segment in any GeoJSON object, similar to Array.forEach()\n * (Multi)Point geometries do not contain segments therefore they are ignored during this operation.\n *\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON\n * @param {Function} callback a method that takes (currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex)\n * @returns {void}\n * @example\n * var polygon = turf.polygon([[[-50, 5], [-40, -10], [-50, -10], [-40, 5], [-50, 5]]]);\n *\n * // Iterate over GeoJSON by 2-vertex segments\n * turf.segmentEach(polygon, function (currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex) {\n * //=currentSegment\n * //=featureIndex\n * //=multiFeatureIndex\n * //=geometryIndex\n * //=segmentIndex\n * });\n *\n * // Calculate the total number of segments\n * var total = 0;\n * turf.segmentEach(polygon, function () {\n * total++;\n * });\n */\nfunction segmentEach(geojson, callback) {\n flattenEach(geojson, function (feature$$1, featureIndex, multiFeatureIndex) {\n var segmentIndex = 0;\n\n // Exclude null Geometries\n if (!feature$$1.geometry) return;\n // (Multi)Point geometries do not contain segments therefore they are ignored during this operation.\n var type = feature$$1.geometry.type;\n if (type === \"Point\" || type === \"MultiPoint\") return;\n\n // Generate 2-vertex line segments\n var previousCoords;\n var previousFeatureIndex = 0;\n var previousMultiIndex = 0;\n var prevGeomIndex = 0;\n if (\n coordEach(\n feature$$1,\n function (\n currentCoord,\n coordIndex,\n featureIndexCoord,\n multiPartIndexCoord,\n geometryIndex\n ) {\n // Simulating a meta.coordReduce() since `reduce` operations cannot be stopped by returning `false`\n if (\n previousCoords === undefined ||\n featureIndex > previousFeatureIndex ||\n multiPartIndexCoord > previousMultiIndex ||\n geometryIndex > prevGeomIndex\n ) {\n previousCoords = currentCoord;\n previousFeatureIndex = featureIndex;\n previousMultiIndex = multiPartIndexCoord;\n prevGeomIndex = geometryIndex;\n segmentIndex = 0;\n return;\n }\n var currentSegment = Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(\n [previousCoords, currentCoord],\n feature$$1.properties\n );\n if (\n callback(\n currentSegment,\n featureIndex,\n multiFeatureIndex,\n geometryIndex,\n segmentIndex\n ) === false\n )\n return false;\n segmentIndex++;\n previousCoords = currentCoord;\n }\n ) === false\n )\n return false;\n });\n}\n\n/**\n * Callback for segmentReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback segmentReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {Feature} currentSegment The current Segment being processed.\n * @param {number} featureIndex The current index of the Feature being processed.\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed.\n * @param {number} geometryIndex The current index of the Geometry being processed.\n * @param {number} segmentIndex The current index of the Segment being processed.\n */\n\n/**\n * Reduce 2-vertex line segment in any GeoJSON object, similar to Array.reduce()\n * (Multi)Point geometries do not contain segments therefore they are ignored during this operation.\n *\n * @param {FeatureCollection|Feature|Geometry} geojson any GeoJSON\n * @param {Function} callback a method that takes (previousValue, currentSegment, currentIndex)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {void}\n * @example\n * var polygon = turf.polygon([[[-50, 5], [-40, -10], [-50, -10], [-40, 5], [-50, 5]]]);\n *\n * // Iterate over GeoJSON by 2-vertex segments\n * turf.segmentReduce(polygon, function (previousSegment, currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex) {\n * //= previousSegment\n * //= currentSegment\n * //= featureIndex\n * //= multiFeatureIndex\n * //= geometryIndex\n * //= segmentIndex\n * return currentSegment\n * });\n *\n * // Calculate the total number of segments\n * var initialValue = 0\n * var total = turf.segmentReduce(polygon, function (previousValue) {\n * previousValue++;\n * return previousValue;\n * }, initialValue);\n */\nfunction segmentReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n var started = false;\n segmentEach(\n geojson,\n function (\n currentSegment,\n featureIndex,\n multiFeatureIndex,\n geometryIndex,\n segmentIndex\n ) {\n if (started === false && initialValue === undefined)\n previousValue = currentSegment;\n else\n previousValue = callback(\n previousValue,\n currentSegment,\n featureIndex,\n multiFeatureIndex,\n geometryIndex,\n segmentIndex\n );\n started = true;\n }\n );\n return previousValue;\n}\n\n/**\n * Callback for lineEach\n *\n * @callback lineEachCallback\n * @param {Feature} currentLine The current LineString|LinearRing being processed\n * @param {number} featureIndex The current index of the Feature being processed\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed\n * @param {number} geometryIndex The current index of the Geometry being processed\n */\n\n/**\n * Iterate over line or ring coordinates in LineString, Polygon, MultiLineString, MultiPolygon Features or Geometries,\n * similar to Array.forEach.\n *\n * @name lineEach\n * @param {Geometry|Feature} geojson object\n * @param {Function} callback a method that takes (currentLine, featureIndex, multiFeatureIndex, geometryIndex)\n * @example\n * var multiLine = turf.multiLineString([\n * [[26, 37], [35, 45]],\n * [[36, 53], [38, 50], [41, 55]]\n * ]);\n *\n * turf.lineEach(multiLine, function (currentLine, featureIndex, multiFeatureIndex, geometryIndex) {\n * //=currentLine\n * //=featureIndex\n * //=multiFeatureIndex\n * //=geometryIndex\n * });\n */\nfunction lineEach(geojson, callback) {\n // validation\n if (!geojson) throw new Error(\"geojson is required\");\n\n flattenEach(geojson, function (feature$$1, featureIndex, multiFeatureIndex) {\n if (feature$$1.geometry === null) return;\n var type = feature$$1.geometry.type;\n var coords = feature$$1.geometry.coordinates;\n switch (type) {\n case \"LineString\":\n if (callback(feature$$1, featureIndex, multiFeatureIndex, 0, 0) === false)\n return false;\n break;\n case \"Polygon\":\n for (\n var geometryIndex = 0;\n geometryIndex < coords.length;\n geometryIndex++\n ) {\n if (\n callback(\n Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(coords[geometryIndex], feature$$1.properties),\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n ) === false\n )\n return false;\n }\n break;\n }\n });\n}\n\n/**\n * Callback for lineReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback lineReduceCallback\n * @param {*} previousValue The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {Feature} currentLine The current LineString|LinearRing being processed.\n * @param {number} featureIndex The current index of the Feature being processed\n * @param {number} multiFeatureIndex The current index of the Multi-Feature being processed\n * @param {number} geometryIndex The current index of the Geometry being processed\n */\n\n/**\n * Reduce features in any GeoJSON object, similar to Array.reduce().\n *\n * @name lineReduce\n * @param {Geometry|Feature} geojson object\n * @param {Function} callback a method that takes (previousValue, currentLine, featureIndex, multiFeatureIndex, geometryIndex)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {*} The value that results from the reduction.\n * @example\n * var multiPoly = turf.multiPolygon([\n * turf.polygon([[[12,48],[2,41],[24,38],[12,48]], [[9,44],[13,41],[13,45],[9,44]]]),\n * turf.polygon([[[5, 5], [0, 0], [2, 2], [4, 4], [5, 5]]])\n * ]);\n *\n * turf.lineReduce(multiPoly, function (previousValue, currentLine, featureIndex, multiFeatureIndex, geometryIndex) {\n * //=previousValue\n * //=currentLine\n * //=featureIndex\n * //=multiFeatureIndex\n * //=geometryIndex\n * return currentLine\n * });\n */\nfunction lineReduce(geojson, callback, initialValue) {\n var previousValue = initialValue;\n lineEach(\n geojson,\n function (currentLine, featureIndex, multiFeatureIndex, geometryIndex) {\n if (featureIndex === 0 && initialValue === undefined)\n previousValue = currentLine;\n else\n previousValue = callback(\n previousValue,\n currentLine,\n featureIndex,\n multiFeatureIndex,\n geometryIndex\n );\n }\n );\n return previousValue;\n}\n\n/**\n * Finds a particular 2-vertex LineString Segment from a GeoJSON using `@turf/meta` indexes.\n *\n * Negative indexes are permitted.\n * Point & MultiPoint will always return null.\n *\n * @param {FeatureCollection|Feature|Geometry} geojson Any GeoJSON Feature or Geometry\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.featureIndex=0] Feature Index\n * @param {number} [options.multiFeatureIndex=0] Multi-Feature Index\n * @param {number} [options.geometryIndex=0] Geometry Index\n * @param {number} [options.segmentIndex=0] Segment Index\n * @param {Object} [options.properties={}] Translate Properties to output LineString\n * @param {BBox} [options.bbox={}] Translate BBox to output LineString\n * @param {number|string} [options.id={}] Translate Id to output LineString\n * @returns {Feature} 2-vertex GeoJSON Feature LineString\n * @example\n * var multiLine = turf.multiLineString([\n * [[10, 10], [50, 30], [30, 40]],\n * [[-10, -10], [-50, -30], [-30, -40]]\n * ]);\n *\n * // First Segment (defaults are 0)\n * turf.findSegment(multiLine);\n * // => Feature>\n *\n * // First Segment of 2nd Multi Feature\n * turf.findSegment(multiLine, {multiFeatureIndex: 1});\n * // => Feature>\n *\n * // Last Segment of Last Multi Feature\n * turf.findSegment(multiLine, {multiFeatureIndex: -1, segmentIndex: -1});\n * // => Feature>\n */\nfunction findSegment(geojson, options) {\n // Optional Parameters\n options = options || {};\n if (!Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"isObject\"])(options)) throw new Error(\"options is invalid\");\n var featureIndex = options.featureIndex || 0;\n var multiFeatureIndex = options.multiFeatureIndex || 0;\n var geometryIndex = options.geometryIndex || 0;\n var segmentIndex = options.segmentIndex || 0;\n\n // Find FeatureIndex\n var properties = options.properties;\n var geometry;\n\n switch (geojson.type) {\n case \"FeatureCollection\":\n if (featureIndex < 0)\n featureIndex = geojson.features.length + featureIndex;\n properties = properties || geojson.features[featureIndex].properties;\n geometry = geojson.features[featureIndex].geometry;\n break;\n case \"Feature\":\n properties = properties || geojson.properties;\n geometry = geojson.geometry;\n break;\n case \"Point\":\n case \"MultiPoint\":\n return null;\n case \"LineString\":\n case \"Polygon\":\n case \"MultiLineString\":\n case \"MultiPolygon\":\n geometry = geojson;\n break;\n default:\n throw new Error(\"geojson is invalid\");\n }\n\n // Find SegmentIndex\n if (geometry === null) return null;\n var coords = geometry.coordinates;\n switch (geometry.type) {\n case \"Point\":\n case \"MultiPoint\":\n return null;\n case \"LineString\":\n if (segmentIndex < 0) segmentIndex = coords.length + segmentIndex - 1;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(\n [coords[segmentIndex], coords[segmentIndex + 1]],\n properties,\n options\n );\n case \"Polygon\":\n if (geometryIndex < 0) geometryIndex = coords.length + geometryIndex;\n if (segmentIndex < 0)\n segmentIndex = coords[geometryIndex].length + segmentIndex - 1;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(\n [\n coords[geometryIndex][segmentIndex],\n coords[geometryIndex][segmentIndex + 1],\n ],\n properties,\n options\n );\n case \"MultiLineString\":\n if (multiFeatureIndex < 0)\n multiFeatureIndex = coords.length + multiFeatureIndex;\n if (segmentIndex < 0)\n segmentIndex = coords[multiFeatureIndex].length + segmentIndex - 1;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(\n [\n coords[multiFeatureIndex][segmentIndex],\n coords[multiFeatureIndex][segmentIndex + 1],\n ],\n properties,\n options\n );\n case \"MultiPolygon\":\n if (multiFeatureIndex < 0)\n multiFeatureIndex = coords.length + multiFeatureIndex;\n if (geometryIndex < 0)\n geometryIndex = coords[multiFeatureIndex].length + geometryIndex;\n if (segmentIndex < 0)\n segmentIndex =\n coords[multiFeatureIndex][geometryIndex].length - segmentIndex - 1;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(\n [\n coords[multiFeatureIndex][geometryIndex][segmentIndex],\n coords[multiFeatureIndex][geometryIndex][segmentIndex + 1],\n ],\n properties,\n options\n );\n }\n throw new Error(\"geojson is invalid\");\n}\n\n/**\n * Finds a particular Point from a GeoJSON using `@turf/meta` indexes.\n *\n * Negative indexes are permitted.\n *\n * @param {FeatureCollection|Feature|Geometry} geojson Any GeoJSON Feature or Geometry\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.featureIndex=0] Feature Index\n * @param {number} [options.multiFeatureIndex=0] Multi-Feature Index\n * @param {number} [options.geometryIndex=0] Geometry Index\n * @param {number} [options.coordIndex=0] Coord Index\n * @param {Object} [options.properties={}] Translate Properties to output Point\n * @param {BBox} [options.bbox={}] Translate BBox to output Point\n * @param {number|string} [options.id={}] Translate Id to output Point\n * @returns {Feature} 2-vertex GeoJSON Feature Point\n * @example\n * var multiLine = turf.multiLineString([\n * [[10, 10], [50, 30], [30, 40]],\n * [[-10, -10], [-50, -30], [-30, -40]]\n * ]);\n *\n * // First Segment (defaults are 0)\n * turf.findPoint(multiLine);\n * // => Feature>\n *\n * // First Segment of the 2nd Multi-Feature\n * turf.findPoint(multiLine, {multiFeatureIndex: 1});\n * // => Feature>\n *\n * // Last Segment of last Multi-Feature\n * turf.findPoint(multiLine, {multiFeatureIndex: -1, coordIndex: -1});\n * // => Feature>\n */\nfunction findPoint(geojson, options) {\n // Optional Parameters\n options = options || {};\n if (!Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"isObject\"])(options)) throw new Error(\"options is invalid\");\n var featureIndex = options.featureIndex || 0;\n var multiFeatureIndex = options.multiFeatureIndex || 0;\n var geometryIndex = options.geometryIndex || 0;\n var coordIndex = options.coordIndex || 0;\n\n // Find FeatureIndex\n var properties = options.properties;\n var geometry;\n\n switch (geojson.type) {\n case \"FeatureCollection\":\n if (featureIndex < 0)\n featureIndex = geojson.features.length + featureIndex;\n properties = properties || geojson.features[featureIndex].properties;\n geometry = geojson.features[featureIndex].geometry;\n break;\n case \"Feature\":\n properties = properties || geojson.properties;\n geometry = geojson.geometry;\n break;\n case \"Point\":\n case \"MultiPoint\":\n return null;\n case \"LineString\":\n case \"Polygon\":\n case \"MultiLineString\":\n case \"MultiPolygon\":\n geometry = geojson;\n break;\n default:\n throw new Error(\"geojson is invalid\");\n }\n\n // Find Coord Index\n if (geometry === null) return null;\n var coords = geometry.coordinates;\n switch (geometry.type) {\n case \"Point\":\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])(coords, properties, options);\n case \"MultiPoint\":\n if (multiFeatureIndex < 0)\n multiFeatureIndex = coords.length + multiFeatureIndex;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])(coords[multiFeatureIndex], properties, options);\n case \"LineString\":\n if (coordIndex < 0) coordIndex = coords.length + coordIndex;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])(coords[coordIndex], properties, options);\n case \"Polygon\":\n if (geometryIndex < 0) geometryIndex = coords.length + geometryIndex;\n if (coordIndex < 0)\n coordIndex = coords[geometryIndex].length + coordIndex;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])(coords[geometryIndex][coordIndex], properties, options);\n case \"MultiLineString\":\n if (multiFeatureIndex < 0)\n multiFeatureIndex = coords.length + multiFeatureIndex;\n if (coordIndex < 0)\n coordIndex = coords[multiFeatureIndex].length + coordIndex;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])(coords[multiFeatureIndex][coordIndex], properties, options);\n case \"MultiPolygon\":\n if (multiFeatureIndex < 0)\n multiFeatureIndex = coords.length + multiFeatureIndex;\n if (geometryIndex < 0)\n geometryIndex = coords[multiFeatureIndex].length + geometryIndex;\n if (coordIndex < 0)\n coordIndex =\n coords[multiFeatureIndex][geometryIndex].length - coordIndex;\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"point\"])(\n coords[multiFeatureIndex][geometryIndex][coordIndex],\n properties,\n options\n );\n }\n throw new Error(\"geojson is invalid\");\n}\n\n\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/meta/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/@turf/polygon-to-line/dist/es/index.js": +/*!*************************************************************!*\ + !*** ./node_modules/@turf/polygon-to-line/dist/es/index.js ***! + \*************************************************************/ +/*! exports provided: default, polygonToLine, multiPolygonToLine, coordsToLine */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"polygonToLine\", function() { return polygonToLine; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiPolygonToLine\", function() { return multiPolygonToLine; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"coordsToLine\", function() { return coordsToLine; });\n/* harmony import */ var _turf_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\n/* harmony import */ var _turf_invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @turf/invariant */ \"./node_modules/@turf/invariant/dist/es/index.js\");\n\n\n/**\n * Converts a {@link Polygon} to {@link LineString|(Multi)LineString} or {@link MultiPolygon} to a\n * {@link FeatureCollection} of {@link LineString|(Multi)LineString}.\n *\n * @name polygonToLine\n * @param {Feature} poly Feature to convert\n * @param {Object} [options={}] Optional parameters\n * @param {Object} [options.properties={}] translates GeoJSON properties to Feature\n * @returns {FeatureCollection|Feature} converted (Multi)Polygon to (Multi)LineString\n * @example\n * var poly = turf.polygon([[[125, -30], [145, -30], [145, -20], [125, -20], [125, -30]]]);\n *\n * var line = turf.polygonToLine(poly);\n *\n * //addToMap\n * var addToMap = [line];\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (poly, options) {\n if (options === void 0) { options = {}; }\n var geom = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getGeom\"])(poly);\n if (!options.properties && poly.type === \"Feature\") {\n options.properties = poly.properties;\n }\n switch (geom.type) {\n case \"Polygon\":\n return polygonToLine(geom, options);\n case \"MultiPolygon\":\n return multiPolygonToLine(geom, options);\n default:\n throw new Error(\"invalid poly\");\n }\n});\n/**\n * @private\n */\nfunction polygonToLine(poly, options) {\n if (options === void 0) { options = {}; }\n var geom = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getGeom\"])(poly);\n var coords = geom.coordinates;\n var properties = options.properties\n ? options.properties\n : poly.type === \"Feature\"\n ? poly.properties\n : {};\n return coordsToLine(coords, properties);\n}\n/**\n * @private\n */\nfunction multiPolygonToLine(multiPoly, options) {\n if (options === void 0) { options = {}; }\n var geom = Object(_turf_invariant__WEBPACK_IMPORTED_MODULE_1__[\"getGeom\"])(multiPoly);\n var coords = geom.coordinates;\n var properties = options.properties\n ? options.properties\n : multiPoly.type === \"Feature\"\n ? multiPoly.properties\n : {};\n var lines = [];\n coords.forEach(function (coord) {\n lines.push(coordsToLine(coord, properties));\n });\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"featureCollection\"])(lines);\n}\n/**\n * @private\n */\nfunction coordsToLine(coords, properties) {\n if (coords.length > 1) {\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"multiLineString\"])(coords, properties);\n }\n return Object(_turf_helpers__WEBPACK_IMPORTED_MODULE_0__[\"lineString\"])(coords[0], properties);\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/@turf/polygon-to-line/dist/es/index.js?"); + +/***/ }), + +/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js?!./node_modules/sass-loader/dist/cjs.js!./src/secondary/loadingScreen.scss": +/*!***************************************************************************************************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/sass-loader/dist/cjs.js!./src/secondary/loadingScreen.scss ***! + \***************************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);\n// Imports\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});\n// Module\n___CSS_LOADER_EXPORT___.push([module.i, \"._lithosphere_loadingscreen_loading {\\n position: absolute;\\n width: 100%;\\n height: 100%;\\n perspective: 160px;\\n top: 0;\\n left: 0; }\\n\\n._lithosphere_loadingscreen_loading > div {\\n width: 60px;\\n height: 60px;\\n background: rgba(255, 255, 255, 0);\\n position: absolute;\\n left: 50%;\\n margin-left: -30px;\\n top: 50%;\\n margin-top: -5px;\\n border-radius: 2px;\\n border: 2px solid rgba(255, 255, 255, 0.7); }\\n\\n@-webkit-keyframes translateIn {\\n 30% {\\n transform: rotateX(60deg) rotateY(0deg) rotateZ(45deg) translateZ(20px) scale(1);\\n opacity: 0.7;\\n background: rgba(255, 255, 255, 0.3); }\\n 100% {\\n transform: rotateX(65deg) rotateY(0deg) rotateZ(45deg) translateZ(0px) scale(0.85);\\n opacity: 0;\\n background: rgba(255, 255, 255, 0); } }\\n\\n@keyframes translateIn {\\n 30% {\\n transform: rotateX(60deg) rotateY(0deg) rotateZ(45deg) translateZ(20px) scale(1);\\n opacity: 0.7;\\n background: rgba(255, 255, 255, 0.3); }\\n 100% {\\n transform: rotateX(65deg) rotateY(0deg) rotateZ(45deg) translateZ(0px) scale(0.85);\\n opacity: 0;\\n background: rgba(255, 255, 255, 0); } }\\n\\n._lithosphere_loadingscreen_loading > div {\\n opacity: 0; }\\n ._lithosphere_loadingscreen_loading > div:nth-of-type(1) {\\n transform: rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(30px);\\n -webkit-animation: translateIn 1.9s ease-in infinite 500ms;\\n animation: translateIn 1.9s ease-in infinite 500ms; }\\n ._lithosphere_loadingscreen_loading > div:nth-of-type(2) {\\n transform: rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(60px);\\n -webkit-animation: translateIn 1.9s ease-in infinite 700ms;\\n animation: translateIn 1.9s ease-in infinite 700ms; }\\n ._lithosphere_loadingscreen_loading > div:nth-of-type(3) {\\n transform: rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(85px);\\n -webkit-animation: translateIn 1.9s ease-in infinite 800ms;\\n animation: translateIn 1.9s ease-in infinite 800ms; }\\n ._lithosphere_loadingscreen_loading > div:nth-of-type(4) {\\n transform: rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(105px);\\n -webkit-animation: translateIn 1.9s ease-in infinite 1000ms;\\n animation: translateIn 1.9s ease-in infinite 1000ms; }\\n ._lithosphere_loadingscreen_loading > div:nth-of-type(5) {\\n transform: rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(120px);\\n -webkit-animation: translateIn 1.9s ease-in infinite 1200ms;\\n animation: translateIn 1.9s ease-in infinite 1200ms; }\\n ._lithosphere_loadingscreen_loading > div:nth-of-type(6) {\\n transform: rotateX(70deg) rotateY(0deg) rotateZ(45deg) translateZ(130px);\\n -webkit-animation: translateIn 1.9s ease-in infinite 1400ms;\\n animation: translateIn 1.9s ease-in infinite 1400ms; }\\n\", \"\"]);\n// Exports\n/* harmony default export */ __webpack_exports__[\"default\"] = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://LithoSphere/./src/secondary/loadingScreen.scss?./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/dist/cjs.js??ref--5-2!./node_modules/sass-loader/dist/cjs.js"); + +/***/ }), + +/***/ "./node_modules/css-loader/dist/runtime/api.js": +/*!*****************************************************!*\ + !*** ./node_modules/css-loader/dist/runtime/api.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (cssWithMappingToString) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \" {\").concat(content, \"}\");\n }\n\n return content;\n }).join(\"\");\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery, dedupe) {\n if (typeof modules === \"string\") {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, \"\"]];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = [].concat(modules[_i]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n // eslint-disable-next-line no-continue\n continue;\n }\n\n if (mediaQuery) {\n if (!item[2]) {\n item[2] = mediaQuery;\n } else {\n item[2] = \"\".concat(mediaQuery, \" and \").concat(item[2]);\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};\n\n//# sourceURL=webpack://LithoSphere/./node_modules/css-loader/dist/runtime/api.js?"); + +/***/ }), + +/***/ "./node_modules/geojson-rbush/index.js": +/*!*********************************************!*\ + !*** ./node_modules/geojson-rbush/index.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var rbush = __webpack_require__(/*! rbush */ \"./node_modules/rbush/index.js\");\nvar helpers = __webpack_require__(/*! @turf/helpers */ \"./node_modules/@turf/helpers/dist/es/index.js\");\nvar meta = __webpack_require__(/*! @turf/meta */ \"./node_modules/@turf/meta/dist/es/index.js\");\nvar turfBBox = __webpack_require__(/*! @turf/bbox */ \"./node_modules/@turf/bbox/dist/es/index.js\").default;\nvar featureEach = meta.featureEach;\nvar coordEach = meta.coordEach;\nvar polygon = helpers.polygon;\nvar featureCollection = helpers.featureCollection;\n\n/**\n * GeoJSON implementation of [RBush](https://github.com/mourner/rbush#rbush) spatial index.\n *\n * @name rbush\n * @param {number} [maxEntries=9] defines the maximum number of entries in a tree node. 9 (used by default) is a\n * reasonable choice for most applications. Higher value means faster insertion and slower search, and vice versa.\n * @returns {RBush} GeoJSON RBush\n * @example\n * var geojsonRbush = require('geojson-rbush').default;\n * var tree = geojsonRbush();\n */\nfunction geojsonRbush(maxEntries) {\n var tree = rbush(maxEntries);\n /**\n * [insert](https://github.com/mourner/rbush#data-format)\n *\n * @param {Feature} feature insert single GeoJSON Feature\n * @returns {RBush} GeoJSON RBush\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n * tree.insert(poly)\n */\n tree.insert = function (feature) {\n if (feature.type !== 'Feature') throw new Error('invalid feature');\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n return rbush.prototype.insert.call(this, feature);\n };\n\n /**\n * [load](https://github.com/mourner/rbush#bulk-inserting-data)\n *\n * @param {FeatureCollection|Array} features load entire GeoJSON FeatureCollection\n * @returns {RBush} GeoJSON RBush\n * @example\n * var polys = turf.polygons([\n * [[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]],\n * [[[-93, 32], [-83, 32], [-83, 39], [-93, 39], [-93, 32]]]\n * ]);\n * tree.load(polys);\n */\n tree.load = function (features) {\n var load = [];\n // Load an Array of Features\n if (Array.isArray(features)) {\n features.forEach(function (feature) {\n if (feature.type !== 'Feature') throw new Error('invalid features');\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n load.push(feature);\n });\n } else {\n // Load a FeatureCollection\n featureEach(features, function (feature) {\n if (feature.type !== 'Feature') throw new Error('invalid features');\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n load.push(feature);\n });\n }\n return rbush.prototype.load.call(this, load);\n };\n\n /**\n * [remove](https://github.com/mourner/rbush#removing-data)\n *\n * @param {Feature} feature remove single GeoJSON Feature\n * @param {Function} equals Pass a custom equals function to compare by value for removal.\n * @returns {RBush} GeoJSON RBush\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.remove(poly);\n */\n tree.remove = function (feature, equals) {\n if (feature.type !== 'Feature') throw new Error('invalid feature');\n feature.bbox = feature.bbox ? feature.bbox : turfBBox(feature);\n return rbush.prototype.remove.call(this, feature, equals);\n };\n\n /**\n * [clear](https://github.com/mourner/rbush#removing-data)\n *\n * @returns {RBush} GeoJSON Rbush\n * @example\n * tree.clear()\n */\n tree.clear = function () {\n return rbush.prototype.clear.call(this);\n };\n\n /**\n * [search](https://github.com/mourner/rbush#search)\n *\n * @param {BBox|FeatureCollection|Feature} geojson search with GeoJSON\n * @returns {FeatureCollection} all features that intersects with the given GeoJSON.\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.search(poly);\n */\n tree.search = function (geojson) {\n var features = rbush.prototype.search.call(this, this.toBBox(geojson));\n return featureCollection(features);\n };\n\n /**\n * [collides](https://github.com/mourner/rbush#collisions)\n *\n * @param {BBox|FeatureCollection|Feature} geojson collides with GeoJSON\n * @returns {boolean} true if there are any items intersecting the given GeoJSON, otherwise false.\n * @example\n * var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]);\n *\n * tree.collides(poly);\n */\n tree.collides = function (geojson) {\n return rbush.prototype.collides.call(this, this.toBBox(geojson));\n };\n\n /**\n * [all](https://github.com/mourner/rbush#search)\n *\n * @returns {FeatureCollection} all the features in RBush\n * @example\n * tree.all()\n */\n tree.all = function () {\n var features = rbush.prototype.all.call(this);\n return featureCollection(features);\n };\n\n /**\n * [toJSON](https://github.com/mourner/rbush#export-and-import)\n *\n * @returns {any} export data as JSON object\n * @example\n * var exported = tree.toJSON()\n */\n tree.toJSON = function () {\n return rbush.prototype.toJSON.call(this);\n };\n\n /**\n * [fromJSON](https://github.com/mourner/rbush#export-and-import)\n *\n * @param {any} json import previously exported data\n * @returns {RBush} GeoJSON RBush\n * @example\n * var exported = {\n * \"children\": [\n * {\n * \"type\": \"Feature\",\n * \"geometry\": {\n * \"type\": \"Point\",\n * \"coordinates\": [110, 50]\n * },\n * \"properties\": {},\n * \"bbox\": [110, 50, 110, 50]\n * }\n * ],\n * \"height\": 1,\n * \"leaf\": true,\n * \"minX\": 110,\n * \"minY\": 50,\n * \"maxX\": 110,\n * \"maxY\": 50\n * }\n * tree.fromJSON(exported)\n */\n tree.fromJSON = function (json) {\n return rbush.prototype.fromJSON.call(this, json);\n };\n\n /**\n * Converts GeoJSON to {minX, minY, maxX, maxY} schema\n *\n * @private\n * @param {BBox|FeatureCollection|Feature} geojson feature(s) to retrieve BBox from\n * @returns {Object} converted to {minX, minY, maxX, maxY}\n */\n tree.toBBox = function (geojson) {\n var bbox;\n if (geojson.bbox) bbox = geojson.bbox;\n else if (Array.isArray(geojson) && geojson.length === 4) bbox = geojson;\n else if (Array.isArray(geojson) && geojson.length === 6) bbox = [geojson[0], geojson[1], geojson[3], geojson[4]];\n else if (geojson.type === 'Feature') bbox = turfBBox(geojson);\n else if (geojson.type === 'FeatureCollection') bbox = turfBBox(geojson);\n else throw new Error('invalid geojson')\n\n return {\n minX: bbox[0],\n minY: bbox[1],\n maxX: bbox[2],\n maxY: bbox[3]\n };\n };\n return tree;\n}\n\nmodule.exports = geojsonRbush;\nmodule.exports.default = geojsonRbush;\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/geojson-rbush/index.js?"); + +/***/ }), + +/***/ "./node_modules/mgrs/mgrs.js": +/*!***********************************!*\ + !*** ./node_modules/mgrs/mgrs.js ***! + \***********************************/ +/*! exports provided: default, forward, inverse, toPoint */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toPoint\", function() { return toPoint; });\n\n\n\n/**\n * UTM zones are grouped, and assigned to one of a group of 6\n * sets.\n *\n * {int} @private\n */\nvar NUM_100K_SETS = 6;\n\n/**\n * The column letters (for easting) of the lower left value, per\n * set.\n *\n * {string} @private\n */\nvar SET_ORIGIN_COLUMN_LETTERS = 'AJSAJS';\n\n/**\n * The row letters (for northing) of the lower left value, per\n * set.\n *\n * {string} @private\n */\nvar SET_ORIGIN_ROW_LETTERS = 'AFAFAF';\n\nvar A = 65; // A\nvar I = 73; // I\nvar O = 79; // O\nvar V = 86; // V\nvar Z = 90; // Z\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n forward: forward,\n inverse: inverse,\n toPoint: toPoint\n});\n/**\n * Conversion of lat/lon to MGRS.\n *\n * @param {object} ll Object literal with lat and lon properties on a\n * WGS84 ellipsoid.\n * @param {int} accuracy Accuracy in digits (5 for 1 m, 4 for 10 m, 3 for\n * 100 m, 2 for 1000 m or 1 for 10000 m). Optional, default is 5.\n * @return {string} the MGRS string for the given location and accuracy.\n */\nfunction forward(ll, accuracy) {\n accuracy = accuracy || 5; // default accuracy 1m\n return encode(LLtoUTM({\n lat: ll[1],\n lon: ll[0]\n }), accuracy);\n};\n\n/**\n * Conversion of MGRS to lat/lon.\n *\n * @param {string} mgrs MGRS string.\n * @return {array} An array with left (longitude), bottom (latitude), right\n * (longitude) and top (latitude) values in WGS84, representing the\n * bounding box for the provided MGRS reference.\n */\nfunction inverse(mgrs) {\n var bbox = UTMtoLL(decode(mgrs.toUpperCase()));\n if (bbox.lat && bbox.lon) {\n return [bbox.lon, bbox.lat, bbox.lon, bbox.lat];\n }\n return [bbox.left, bbox.bottom, bbox.right, bbox.top];\n};\n\nfunction toPoint(mgrs) {\n var bbox = UTMtoLL(decode(mgrs.toUpperCase()));\n if (bbox.lat && bbox.lon) {\n return [bbox.lon, bbox.lat];\n }\n return [(bbox.left + bbox.right) / 2, (bbox.top + bbox.bottom) / 2];\n};\n/**\n * Conversion from degrees to radians.\n *\n * @private\n * @param {number} deg the angle in degrees.\n * @return {number} the angle in radians.\n */\nfunction degToRad(deg) {\n return (deg * (Math.PI / 180.0));\n}\n\n/**\n * Conversion from radians to degrees.\n *\n * @private\n * @param {number} rad the angle in radians.\n * @return {number} the angle in degrees.\n */\nfunction radToDeg(rad) {\n return (180.0 * (rad / Math.PI));\n}\n\n/**\n * Converts a set of Longitude and Latitude co-ordinates to UTM\n * using the WGS84 ellipsoid.\n *\n * @private\n * @param {object} ll Object literal with lat and lon properties\n * representing the WGS84 coordinate to be converted.\n * @return {object} Object literal containing the UTM value with easting,\n * northing, zoneNumber and zoneLetter properties, and an optional\n * accuracy property in digits. Returns null if the conversion failed.\n */\nfunction LLtoUTM(ll) {\n var Lat = ll.lat;\n var Long = ll.lon;\n var a = 6378137.0; //ellip.radius;\n var eccSquared = 0.00669438; //ellip.eccsq;\n var k0 = 0.9996;\n var LongOrigin;\n var eccPrimeSquared;\n var N, T, C, A, M;\n var LatRad = degToRad(Lat);\n var LongRad = degToRad(Long);\n var LongOriginRad;\n var ZoneNumber;\n // (int)\n ZoneNumber = Math.floor((Long + 180) / 6) + 1;\n\n //Make sure the longitude 180.00 is in Zone 60\n if (Long === 180) {\n ZoneNumber = 60;\n }\n\n // Special zone for Norway\n if (Lat >= 56.0 && Lat < 64.0 && Long >= 3.0 && Long < 12.0) {\n ZoneNumber = 32;\n }\n\n // Special zones for Svalbard\n if (Lat >= 72.0 && Lat < 84.0) {\n if (Long >= 0.0 && Long < 9.0) {\n ZoneNumber = 31;\n }\n else if (Long >= 9.0 && Long < 21.0) {\n ZoneNumber = 33;\n }\n else if (Long >= 21.0 && Long < 33.0) {\n ZoneNumber = 35;\n }\n else if (Long >= 33.0 && Long < 42.0) {\n ZoneNumber = 37;\n }\n }\n\n LongOrigin = (ZoneNumber - 1) * 6 - 180 + 3; //+3 puts origin\n // in middle of\n // zone\n LongOriginRad = degToRad(LongOrigin);\n\n eccPrimeSquared = (eccSquared) / (1 - eccSquared);\n\n N = a / Math.sqrt(1 - eccSquared * Math.sin(LatRad) * Math.sin(LatRad));\n T = Math.tan(LatRad) * Math.tan(LatRad);\n C = eccPrimeSquared * Math.cos(LatRad) * Math.cos(LatRad);\n A = Math.cos(LatRad) * (LongRad - LongOriginRad);\n\n M = a * ((1 - eccSquared / 4 - 3 * eccSquared * eccSquared / 64 - 5 * eccSquared * eccSquared * eccSquared / 256) * LatRad - (3 * eccSquared / 8 + 3 * eccSquared * eccSquared / 32 + 45 * eccSquared * eccSquared * eccSquared / 1024) * Math.sin(2 * LatRad) + (15 * eccSquared * eccSquared / 256 + 45 * eccSquared * eccSquared * eccSquared / 1024) * Math.sin(4 * LatRad) - (35 * eccSquared * eccSquared * eccSquared / 3072) * Math.sin(6 * LatRad));\n\n var UTMEasting = (k0 * N * (A + (1 - T + C) * A * A * A / 6.0 + (5 - 18 * T + T * T + 72 * C - 58 * eccPrimeSquared) * A * A * A * A * A / 120.0) + 500000.0);\n\n var UTMNorthing = (k0 * (M + N * Math.tan(LatRad) * (A * A / 2 + (5 - T + 9 * C + 4 * C * C) * A * A * A * A / 24.0 + (61 - 58 * T + T * T + 600 * C - 330 * eccPrimeSquared) * A * A * A * A * A * A / 720.0)));\n if (Lat < 0.0) {\n UTMNorthing += 10000000.0; //10000000 meter offset for\n // southern hemisphere\n }\n\n return {\n northing: Math.round(UTMNorthing),\n easting: Math.round(UTMEasting),\n zoneNumber: ZoneNumber,\n zoneLetter: getLetterDesignator(Lat)\n };\n}\n\n/**\n * Converts UTM coords to lat/long, using the WGS84 ellipsoid. This is a convenience\n * class where the Zone can be specified as a single string eg.\"60N\" which\n * is then broken down into the ZoneNumber and ZoneLetter.\n *\n * @private\n * @param {object} utm An object literal with northing, easting, zoneNumber\n * and zoneLetter properties. If an optional accuracy property is\n * provided (in meters), a bounding box will be returned instead of\n * latitude and longitude.\n * @return {object} An object literal containing either lat and lon values\n * (if no accuracy was provided), or top, right, bottom and left values\n * for the bounding box calculated according to the provided accuracy.\n * Returns null if the conversion failed.\n */\nfunction UTMtoLL(utm) {\n\n var UTMNorthing = utm.northing;\n var UTMEasting = utm.easting;\n var zoneLetter = utm.zoneLetter;\n var zoneNumber = utm.zoneNumber;\n // check the ZoneNummber is valid\n if (zoneNumber < 0 || zoneNumber > 60) {\n return null;\n }\n\n var k0 = 0.9996;\n var a = 6378137.0; //ellip.radius;\n var eccSquared = 0.00669438; //ellip.eccsq;\n var eccPrimeSquared;\n var e1 = (1 - Math.sqrt(1 - eccSquared)) / (1 + Math.sqrt(1 - eccSquared));\n var N1, T1, C1, R1, D, M;\n var LongOrigin;\n var mu, phi1Rad;\n\n // remove 500,000 meter offset for longitude\n var x = UTMEasting - 500000.0;\n var y = UTMNorthing;\n\n // We must know somehow if we are in the Northern or Southern\n // hemisphere, this is the only time we use the letter So even\n // if the Zone letter isn't exactly correct it should indicate\n // the hemisphere correctly\n if (zoneLetter < 'N') {\n y -= 10000000.0; // remove 10,000,000 meter offset used\n // for southern hemisphere\n }\n\n // There are 60 zones with zone 1 being at West -180 to -174\n LongOrigin = (zoneNumber - 1) * 6 - 180 + 3; // +3 puts origin\n // in middle of\n // zone\n\n eccPrimeSquared = (eccSquared) / (1 - eccSquared);\n\n M = y / k0;\n mu = M / (a * (1 - eccSquared / 4 - 3 * eccSquared * eccSquared / 64 - 5 * eccSquared * eccSquared * eccSquared / 256));\n\n phi1Rad = mu + (3 * e1 / 2 - 27 * e1 * e1 * e1 / 32) * Math.sin(2 * mu) + (21 * e1 * e1 / 16 - 55 * e1 * e1 * e1 * e1 / 32) * Math.sin(4 * mu) + (151 * e1 * e1 * e1 / 96) * Math.sin(6 * mu);\n // double phi1 = ProjMath.radToDeg(phi1Rad);\n\n N1 = a / Math.sqrt(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad));\n T1 = Math.tan(phi1Rad) * Math.tan(phi1Rad);\n C1 = eccPrimeSquared * Math.cos(phi1Rad) * Math.cos(phi1Rad);\n R1 = a * (1 - eccSquared) / Math.pow(1 - eccSquared * Math.sin(phi1Rad) * Math.sin(phi1Rad), 1.5);\n D = x / (N1 * k0);\n\n var lat = phi1Rad - (N1 * Math.tan(phi1Rad) / R1) * (D * D / 2 - (5 + 3 * T1 + 10 * C1 - 4 * C1 * C1 - 9 * eccPrimeSquared) * D * D * D * D / 24 + (61 + 90 * T1 + 298 * C1 + 45 * T1 * T1 - 252 * eccPrimeSquared - 3 * C1 * C1) * D * D * D * D * D * D / 720);\n lat = radToDeg(lat);\n\n var lon = (D - (1 + 2 * T1 + C1) * D * D * D / 6 + (5 - 2 * C1 + 28 * T1 - 3 * C1 * C1 + 8 * eccPrimeSquared + 24 * T1 * T1) * D * D * D * D * D / 120) / Math.cos(phi1Rad);\n lon = LongOrigin + radToDeg(lon);\n\n var result;\n if (utm.accuracy) {\n var topRight = UTMtoLL({\n northing: utm.northing + utm.accuracy,\n easting: utm.easting + utm.accuracy,\n zoneLetter: utm.zoneLetter,\n zoneNumber: utm.zoneNumber\n });\n result = {\n top: topRight.lat,\n right: topRight.lon,\n bottom: lat,\n left: lon\n };\n }\n else {\n result = {\n lat: lat,\n lon: lon\n };\n }\n return result;\n}\n\n/**\n * Calculates the MGRS letter designator for the given latitude.\n *\n * @private\n * @param {number} lat The latitude in WGS84 to get the letter designator\n * for.\n * @return {char} The letter designator.\n */\nfunction getLetterDesignator(lat) {\n //This is here as an error flag to show that the Latitude is\n //outside MGRS limits\n var LetterDesignator = 'Z';\n\n if ((84 >= lat) && (lat >= 72)) {\n LetterDesignator = 'X';\n }\n else if ((72 > lat) && (lat >= 64)) {\n LetterDesignator = 'W';\n }\n else if ((64 > lat) && (lat >= 56)) {\n LetterDesignator = 'V';\n }\n else if ((56 > lat) && (lat >= 48)) {\n LetterDesignator = 'U';\n }\n else if ((48 > lat) && (lat >= 40)) {\n LetterDesignator = 'T';\n }\n else if ((40 > lat) && (lat >= 32)) {\n LetterDesignator = 'S';\n }\n else if ((32 > lat) && (lat >= 24)) {\n LetterDesignator = 'R';\n }\n else if ((24 > lat) && (lat >= 16)) {\n LetterDesignator = 'Q';\n }\n else if ((16 > lat) && (lat >= 8)) {\n LetterDesignator = 'P';\n }\n else if ((8 > lat) && (lat >= 0)) {\n LetterDesignator = 'N';\n }\n else if ((0 > lat) && (lat >= -8)) {\n LetterDesignator = 'M';\n }\n else if ((-8 > lat) && (lat >= -16)) {\n LetterDesignator = 'L';\n }\n else if ((-16 > lat) && (lat >= -24)) {\n LetterDesignator = 'K';\n }\n else if ((-24 > lat) && (lat >= -32)) {\n LetterDesignator = 'J';\n }\n else if ((-32 > lat) && (lat >= -40)) {\n LetterDesignator = 'H';\n }\n else if ((-40 > lat) && (lat >= -48)) {\n LetterDesignator = 'G';\n }\n else if ((-48 > lat) && (lat >= -56)) {\n LetterDesignator = 'F';\n }\n else if ((-56 > lat) && (lat >= -64)) {\n LetterDesignator = 'E';\n }\n else if ((-64 > lat) && (lat >= -72)) {\n LetterDesignator = 'D';\n }\n else if ((-72 > lat) && (lat >= -80)) {\n LetterDesignator = 'C';\n }\n return LetterDesignator;\n}\n\n/**\n * Encodes a UTM location as MGRS string.\n *\n * @private\n * @param {object} utm An object literal with easting, northing,\n * zoneLetter, zoneNumber\n * @param {number} accuracy Accuracy in digits (1-5).\n * @return {string} MGRS string for the given UTM location.\n */\nfunction encode(utm, accuracy) {\n // prepend with leading zeroes\n var seasting = \"00000\" + utm.easting,\n snorthing = \"00000\" + utm.northing;\n\n return utm.zoneNumber + utm.zoneLetter + get100kID(utm.easting, utm.northing, utm.zoneNumber) + seasting.substr(seasting.length - 5, accuracy) + snorthing.substr(snorthing.length - 5, accuracy);\n}\n\n/**\n * Get the two letter 100k designator for a given UTM easting,\n * northing and zone number value.\n *\n * @private\n * @param {number} easting\n * @param {number} northing\n * @param {number} zoneNumber\n * @return the two letter 100k designator for the given UTM location.\n */\nfunction get100kID(easting, northing, zoneNumber) {\n var setParm = get100kSetForZone(zoneNumber);\n var setColumn = Math.floor(easting / 100000);\n var setRow = Math.floor(northing / 100000) % 20;\n return getLetter100kID(setColumn, setRow, setParm);\n}\n\n/**\n * Given a UTM zone number, figure out the MGRS 100K set it is in.\n *\n * @private\n * @param {number} i An UTM zone number.\n * @return {number} the 100k set the UTM zone is in.\n */\nfunction get100kSetForZone(i) {\n var setParm = i % NUM_100K_SETS;\n if (setParm === 0) {\n setParm = NUM_100K_SETS;\n }\n\n return setParm;\n}\n\n/**\n * Get the two-letter MGRS 100k designator given information\n * translated from the UTM northing, easting and zone number.\n *\n * @private\n * @param {number} column the column index as it relates to the MGRS\n * 100k set spreadsheet, created from the UTM easting.\n * Values are 1-8.\n * @param {number} row the row index as it relates to the MGRS 100k set\n * spreadsheet, created from the UTM northing value. Values\n * are from 0-19.\n * @param {number} parm the set block, as it relates to the MGRS 100k set\n * spreadsheet, created from the UTM zone. Values are from\n * 1-60.\n * @return two letter MGRS 100k code.\n */\nfunction getLetter100kID(column, row, parm) {\n // colOrigin and rowOrigin are the letters at the origin of the set\n var index = parm - 1;\n var colOrigin = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(index);\n var rowOrigin = SET_ORIGIN_ROW_LETTERS.charCodeAt(index);\n\n // colInt and rowInt are the letters to build to return\n var colInt = colOrigin + column - 1;\n var rowInt = rowOrigin + row;\n var rollover = false;\n\n if (colInt > Z) {\n colInt = colInt - Z + A - 1;\n rollover = true;\n }\n\n if (colInt === I || (colOrigin < I && colInt > I) || ((colInt > I || colOrigin < I) && rollover)) {\n colInt++;\n }\n\n if (colInt === O || (colOrigin < O && colInt > O) || ((colInt > O || colOrigin < O) && rollover)) {\n colInt++;\n\n if (colInt === I) {\n colInt++;\n }\n }\n\n if (colInt > Z) {\n colInt = colInt - Z + A - 1;\n }\n\n if (rowInt > V) {\n rowInt = rowInt - V + A - 1;\n rollover = true;\n }\n else {\n rollover = false;\n }\n\n if (((rowInt === I) || ((rowOrigin < I) && (rowInt > I))) || (((rowInt > I) || (rowOrigin < I)) && rollover)) {\n rowInt++;\n }\n\n if (((rowInt === O) || ((rowOrigin < O) && (rowInt > O))) || (((rowInt > O) || (rowOrigin < O)) && rollover)) {\n rowInt++;\n\n if (rowInt === I) {\n rowInt++;\n }\n }\n\n if (rowInt > V) {\n rowInt = rowInt - V + A - 1;\n }\n\n var twoLetter = String.fromCharCode(colInt) + String.fromCharCode(rowInt);\n return twoLetter;\n}\n\n/**\n * Decode the UTM parameters from a MGRS string.\n *\n * @private\n * @param {string} mgrsString an UPPERCASE coordinate string is expected.\n * @return {object} An object literal with easting, northing, zoneLetter,\n * zoneNumber and accuracy (in meters) properties.\n */\nfunction decode(mgrsString) {\n\n if (mgrsString && mgrsString.length === 0) {\n throw (\"MGRSPoint coverting from nothing\");\n }\n\n var length = mgrsString.length;\n\n var hunK = null;\n var sb = \"\";\n var testChar;\n var i = 0;\n\n // get Zone number\n while (!(/[A-Z]/).test(testChar = mgrsString.charAt(i))) {\n if (i >= 2) {\n throw (\"MGRSPoint bad conversion from: \" + mgrsString);\n }\n sb += testChar;\n i++;\n }\n\n var zoneNumber = parseInt(sb, 10);\n\n if (i === 0 || i + 3 > length) {\n // A good MGRS string has to be 4-5 digits long,\n // ##AAA/#AAA at least.\n throw (\"MGRSPoint bad conversion from: \" + mgrsString);\n }\n\n var zoneLetter = mgrsString.charAt(i++);\n\n // Should we check the zone letter here? Why not.\n if (zoneLetter <= 'A' || zoneLetter === 'B' || zoneLetter === 'Y' || zoneLetter >= 'Z' || zoneLetter === 'I' || zoneLetter === 'O') {\n throw (\"MGRSPoint zone letter \" + zoneLetter + \" not handled: \" + mgrsString);\n }\n\n hunK = mgrsString.substring(i, i += 2);\n\n var set = get100kSetForZone(zoneNumber);\n\n var east100k = getEastingFromChar(hunK.charAt(0), set);\n var north100k = getNorthingFromChar(hunK.charAt(1), set);\n\n // We have a bug where the northing may be 2000000 too low.\n // How\n // do we know when to roll over?\n\n while (north100k < getMinNorthing(zoneLetter)) {\n north100k += 2000000;\n }\n\n // calculate the char index for easting/northing separator\n var remainder = length - i;\n\n if (remainder % 2 !== 0) {\n throw (\"MGRSPoint has to have an even number \\nof digits after the zone letter and two 100km letters - front \\nhalf for easting meters, second half for \\nnorthing meters\" + mgrsString);\n }\n\n var sep = remainder / 2;\n\n var sepEasting = 0.0;\n var sepNorthing = 0.0;\n var accuracyBonus, sepEastingString, sepNorthingString, easting, northing;\n if (sep > 0) {\n accuracyBonus = 100000.0 / Math.pow(10, sep);\n sepEastingString = mgrsString.substring(i, i + sep);\n sepEasting = parseFloat(sepEastingString) * accuracyBonus;\n sepNorthingString = mgrsString.substring(i + sep);\n sepNorthing = parseFloat(sepNorthingString) * accuracyBonus;\n }\n\n easting = sepEasting + east100k;\n northing = sepNorthing + north100k;\n\n return {\n easting: easting,\n northing: northing,\n zoneLetter: zoneLetter,\n zoneNumber: zoneNumber,\n accuracy: accuracyBonus\n };\n}\n\n/**\n * Given the first letter from a two-letter MGRS 100k zone, and given the\n * MGRS table set for the zone number, figure out the easting value that\n * should be added to the other, secondary easting value.\n *\n * @private\n * @param {char} e The first letter from a two-letter MGRS 100´k zone.\n * @param {number} set The MGRS table set for the zone number.\n * @return {number} The easting value for the given letter and set.\n */\nfunction getEastingFromChar(e, set) {\n // colOrigin is the letter at the origin of the set for the\n // column\n var curCol = SET_ORIGIN_COLUMN_LETTERS.charCodeAt(set - 1);\n var eastingValue = 100000.0;\n var rewindMarker = false;\n\n while (curCol !== e.charCodeAt(0)) {\n curCol++;\n if (curCol === I) {\n curCol++;\n }\n if (curCol === O) {\n curCol++;\n }\n if (curCol > Z) {\n if (rewindMarker) {\n throw (\"Bad character: \" + e);\n }\n curCol = A;\n rewindMarker = true;\n }\n eastingValue += 100000.0;\n }\n\n return eastingValue;\n}\n\n/**\n * Given the second letter from a two-letter MGRS 100k zone, and given the\n * MGRS table set for the zone number, figure out the northing value that\n * should be added to the other, secondary northing value. You have to\n * remember that Northings are determined from the equator, and the vertical\n * cycle of letters mean a 2000000 additional northing meters. This happens\n * approx. every 18 degrees of latitude. This method does *NOT* count any\n * additional northings. You have to figure out how many 2000000 meters need\n * to be added for the zone letter of the MGRS coordinate.\n *\n * @private\n * @param {char} n Second letter of the MGRS 100k zone\n * @param {number} set The MGRS table set number, which is dependent on the\n * UTM zone number.\n * @return {number} The northing value for the given letter and set.\n */\nfunction getNorthingFromChar(n, set) {\n\n if (n > 'V') {\n throw (\"MGRSPoint given invalid Northing \" + n);\n }\n\n // rowOrigin is the letter at the origin of the set for the\n // column\n var curRow = SET_ORIGIN_ROW_LETTERS.charCodeAt(set - 1);\n var northingValue = 0.0;\n var rewindMarker = false;\n\n while (curRow !== n.charCodeAt(0)) {\n curRow++;\n if (curRow === I) {\n curRow++;\n }\n if (curRow === O) {\n curRow++;\n }\n // fixing a bug making whole application hang in this loop\n // when 'n' is a wrong character\n if (curRow > V) {\n if (rewindMarker) { // making sure that this loop ends\n throw (\"Bad character: \" + n);\n }\n curRow = A;\n rewindMarker = true;\n }\n northingValue += 100000.0;\n }\n\n return northingValue;\n}\n\n/**\n * The function getMinNorthing returns the minimum northing value of a MGRS\n * zone.\n *\n * Ported from Geotrans' c Lattitude_Band_Value structure table.\n *\n * @private\n * @param {char} zoneLetter The MGRS zone to get the min northing for.\n * @return {number}\n */\nfunction getMinNorthing(zoneLetter) {\n var northing;\n switch (zoneLetter) {\n case 'C':\n northing = 1100000.0;\n break;\n case 'D':\n northing = 2000000.0;\n break;\n case 'E':\n northing = 2800000.0;\n break;\n case 'F':\n northing = 3700000.0;\n break;\n case 'G':\n northing = 4600000.0;\n break;\n case 'H':\n northing = 5500000.0;\n break;\n case 'J':\n northing = 6400000.0;\n break;\n case 'K':\n northing = 7300000.0;\n break;\n case 'L':\n northing = 8200000.0;\n break;\n case 'M':\n northing = 9100000.0;\n break;\n case 'N':\n northing = 0.0;\n break;\n case 'P':\n northing = 800000.0;\n break;\n case 'Q':\n northing = 1700000.0;\n break;\n case 'R':\n northing = 2600000.0;\n break;\n case 'S':\n northing = 3500000.0;\n break;\n case 'T':\n northing = 4400000.0;\n break;\n case 'U':\n northing = 5300000.0;\n break;\n case 'V':\n northing = 6200000.0;\n break;\n case 'W':\n northing = 7000000.0;\n break;\n case 'X':\n northing = 7900000.0;\n break;\n default:\n northing = -1.0;\n }\n if (northing >= 0.0) {\n return northing;\n }\n else {\n throw (\"Invalid zone letter: \" + zoneLetter);\n }\n\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/mgrs/mgrs.js?"); + +/***/ }), + +/***/ "./node_modules/path-browserify/index.js": +/*!***********************************************!*\ + !*** ./node_modules/path-browserify/index.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("/* WEBPACK VAR INJECTION */(function(process) {// .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1,\n// backported and transplited with Babel, with backwards-compat fixes\n\n// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length - 1; i >= 0; i--) {\n var last = parts[i];\n if (last === '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\n var resolvedPath = '',\n resolvedAbsolute = false;\n\n for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0) ? arguments[i] : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string') {\n throw new TypeError('Arguments to path.resolve must be strings');\n } else if (!path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n }\n\n // At this point the path should be resolved to a full absolute path, but\n // handle relative paths to be safe (might happen when process.cwd() fails)\n\n // Normalize the path\n resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\n var isAbsolute = exports.isAbsolute(path),\n trailingSlash = substr(path, -1) === '/';\n\n // Normalize the path\n path = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n\n return (isAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexports.isAbsolute = function(path) {\n return path.charAt(0) === '/';\n};\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n if (typeof p !== 'string') {\n throw new TypeError('Arguments to path.join must be strings');\n }\n return p;\n }).join('/'));\n};\n\n\n// path.relative(from, to)\n// posix version\nexports.relative = function(from, to) {\n from = exports.resolve(from).substr(1);\n to = exports.resolve(to).substr(1);\n\n function trim(arr) {\n var start = 0;\n for (; start < arr.length; start++) {\n if (arr[start] !== '') break;\n }\n\n var end = arr.length - 1;\n for (; end >= 0; end--) {\n if (arr[end] !== '') break;\n }\n\n if (start > end) return [];\n return arr.slice(start, end - start + 1);\n }\n\n var fromParts = trim(from.split('/'));\n var toParts = trim(to.split('/'));\n\n var length = Math.min(fromParts.length, toParts.length);\n var samePartsLength = length;\n for (var i = 0; i < length; i++) {\n if (fromParts[i] !== toParts[i]) {\n samePartsLength = i;\n break;\n }\n }\n\n var outputParts = [];\n for (var i = samePartsLength; i < fromParts.length; i++) {\n outputParts.push('..');\n }\n\n outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n return outputParts.join('/');\n};\n\nexports.sep = '/';\nexports.delimiter = ':';\n\nexports.dirname = function (path) {\n if (typeof path !== 'string') path = path + '';\n if (path.length === 0) return '.';\n var code = path.charCodeAt(0);\n var hasRoot = code === 47 /*/*/;\n var end = -1;\n var matchedSlash = true;\n for (var i = path.length - 1; i >= 1; --i) {\n code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n if (!matchedSlash) {\n end = i;\n break;\n }\n } else {\n // We saw the first non-path separator\n matchedSlash = false;\n }\n }\n\n if (end === -1) return hasRoot ? '/' : '.';\n if (hasRoot && end === 1) {\n // return '//';\n // Backwards-compat fix:\n return '/';\n }\n return path.slice(0, end);\n};\n\nfunction basename(path) {\n if (typeof path !== 'string') path = path + '';\n\n var start = 0;\n var end = -1;\n var matchedSlash = true;\n var i;\n\n for (i = path.length - 1; i >= 0; --i) {\n if (path.charCodeAt(i) === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n start = i + 1;\n break;\n }\n } else if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // path component\n matchedSlash = false;\n end = i + 1;\n }\n }\n\n if (end === -1) return '';\n return path.slice(start, end);\n}\n\n// Uses a mixed approach for backwards-compatibility, as ext behavior changed\n// in new Node.js versions, so only basename() above is backported here\nexports.basename = function (path, ext) {\n var f = basename(path);\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\nexports.extname = function (path) {\n if (typeof path !== 'string') path = path + '';\n var startDot = -1;\n var startPart = 0;\n var end = -1;\n var matchedSlash = true;\n // Track the state of characters (if any) we see before our first dot and\n // after any path separator we find\n var preDotState = 0;\n for (var i = path.length - 1; i >= 0; --i) {\n var code = path.charCodeAt(i);\n if (code === 47 /*/*/) {\n // If we reached a path separator that was not part of a set of path\n // separators at the end of the string, stop now\n if (!matchedSlash) {\n startPart = i + 1;\n break;\n }\n continue;\n }\n if (end === -1) {\n // We saw the first non-path separator, mark this as the end of our\n // extension\n matchedSlash = false;\n end = i + 1;\n }\n if (code === 46 /*.*/) {\n // If this is our first dot, mark it as the start of our extension\n if (startDot === -1)\n startDot = i;\n else if (preDotState !== 1)\n preDotState = 1;\n } else if (startDot !== -1) {\n // We saw a non-dot and non-path separator before our dot, so we should\n // have a good chance at having a non-empty extension\n preDotState = -1;\n }\n }\n\n if (startDot === -1 || end === -1 ||\n // We saw a non-dot character immediately before the dot\n preDotState === 0 ||\n // The (right-most) trimmed path component is exactly '..'\n preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {\n return '';\n }\n return path.slice(startDot, end);\n};\n\nfunction filter (xs, f) {\n if (xs.filter) return xs.filter(f);\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (f(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b'\n ? function (str, start, len) { return str.substr(start, len) }\n : function (str, start, len) {\n if (start < 0) start = str.length + start;\n return str.substr(start, len);\n }\n;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack://LithoSphere/./node_modules/path-browserify/index.js?"); + +/***/ }), + +/***/ "./node_modules/process/browser.js": +/*!*****************************************!*\ + !*** ./node_modules/process/browser.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/process/browser.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/Point.js": +/*!*****************************************!*\ + !*** ./node_modules/proj4/lib/Point.js ***! + \*****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var mgrs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mgrs */ \"./node_modules/mgrs/mgrs.js\");\n\n\nfunction Point(x, y, z) {\n if (!(this instanceof Point)) {\n return new Point(x, y, z);\n }\n if (Array.isArray(x)) {\n this.x = x[0];\n this.y = x[1];\n this.z = x[2] || 0.0;\n } else if(typeof x === 'object') {\n this.x = x.x;\n this.y = x.y;\n this.z = x.z || 0.0;\n } else if (typeof x === 'string' && typeof y === 'undefined') {\n var coords = x.split(',');\n this.x = parseFloat(coords[0], 10);\n this.y = parseFloat(coords[1], 10);\n this.z = parseFloat(coords[2], 10) || 0.0;\n } else {\n this.x = x;\n this.y = y;\n this.z = z || 0.0;\n }\n console.warn('proj4.Point will be removed in version 3, use proj4.toPoint');\n}\n\nPoint.fromMGRS = function(mgrsStr) {\n return new Point(Object(mgrs__WEBPACK_IMPORTED_MODULE_0__[\"toPoint\"])(mgrsStr));\n};\nPoint.prototype.toMGRS = function(accuracy) {\n return Object(mgrs__WEBPACK_IMPORTED_MODULE_0__[\"forward\"])([this.x, this.y], accuracy);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Point);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/Point.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/Proj.js": +/*!****************************************!*\ + !*** ./node_modules/proj4/lib/Proj.js ***! + \****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _parseCode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parseCode */ \"./node_modules/proj4/lib/parseCode.js\");\n/* harmony import */ var _extend__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./extend */ \"./node_modules/proj4/lib/extend.js\");\n/* harmony import */ var _projections__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./projections */ \"./node_modules/proj4/lib/projections.js\");\n/* harmony import */ var _deriveConstants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./deriveConstants */ \"./node_modules/proj4/lib/deriveConstants.js\");\n/* harmony import */ var _constants_Datum__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants/Datum */ \"./node_modules/proj4/lib/constants/Datum.js\");\n/* harmony import */ var _datum__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./datum */ \"./node_modules/proj4/lib/datum.js\");\n/* harmony import */ var _match__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./match */ \"./node_modules/proj4/lib/match.js\");\n/* harmony import */ var _nadgrid__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./nadgrid */ \"./node_modules/proj4/lib/nadgrid.js\");\n\n\n\n\n\n\n\n\n\nfunction Projection(srsCode,callback) {\n if (!(this instanceof Projection)) {\n return new Projection(srsCode);\n }\n callback = callback || function(error){\n if(error){\n throw error;\n }\n };\n var json = Object(_parseCode__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(srsCode);\n if(typeof json !== 'object'){\n callback(srsCode);\n return;\n }\n var ourProj = Projection.projections.get(json.projName);\n if(!ourProj){\n callback(srsCode);\n return;\n }\n if (json.datumCode && json.datumCode !== 'none') {\n var datumDef = Object(_match__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(_constants_Datum__WEBPACK_IMPORTED_MODULE_4__[\"default\"], json.datumCode);\n if (datumDef) {\n json.datum_params = datumDef.towgs84 ? datumDef.towgs84.split(',') : null;\n json.ellps = datumDef.ellipse;\n json.datumName = datumDef.datumName ? datumDef.datumName : json.datumCode;\n }\n }\n json.k0 = json.k0 || 1.0;\n json.axis = json.axis || 'enu';\n json.ellps = json.ellps || 'wgs84';\n var sphere_ = Object(_deriveConstants__WEBPACK_IMPORTED_MODULE_3__[\"sphere\"])(json.a, json.b, json.rf, json.ellps, json.sphere);\n var ecc = Object(_deriveConstants__WEBPACK_IMPORTED_MODULE_3__[\"eccentricity\"])(sphere_.a, sphere_.b, sphere_.rf, json.R_A);\n var nadgrids = Object(_nadgrid__WEBPACK_IMPORTED_MODULE_7__[\"getNadgrids\"])(json.nadgrids);\n var datumObj = json.datum || Object(_datum__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(json.datumCode, json.datum_params, sphere_.a, sphere_.b, ecc.es, ecc.ep2,\n nadgrids);\n\n Object(_extend__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this, json); // transfer everything over from the projection because we don't know what we'll need\n Object(_extend__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this, ourProj); // transfer all the methods from the projection\n\n // copy the 4 things over we calulated in deriveConstants.sphere\n this.a = sphere_.a;\n this.b = sphere_.b;\n this.rf = sphere_.rf;\n this.sphere = sphere_.sphere;\n\n // copy the 3 things we calculated in deriveConstants.eccentricity\n this.es = ecc.es;\n this.e = ecc.e;\n this.ep2 = ecc.ep2;\n\n // add in the datum object\n this.datum = datumObj;\n\n // init the projection\n this.init();\n\n // legecy callback from back in the day when it went to spatialreference.org\n callback(null, this);\n\n}\nProjection.projections = _projections__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\nProjection.projections.start();\n/* harmony default export */ __webpack_exports__[\"default\"] = (Projection);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/Proj.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/adjust_axis.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/adjust_axis.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(crs, denorm, point) {\n var xin = point.x,\n yin = point.y,\n zin = point.z || 0.0;\n var v, t, i;\n var out = {};\n for (i = 0; i < 3; i++) {\n if (denorm && i === 2 && point.z === undefined) {\n continue;\n }\n if (i === 0) {\n v = xin;\n if (\"ew\".indexOf(crs.axis[i]) !== -1) {\n t = 'x';\n } else {\n t = 'y';\n }\n\n }\n else if (i === 1) {\n v = yin;\n if (\"ns\".indexOf(crs.axis[i]) !== -1) {\n t = 'y';\n } else {\n t = 'x';\n }\n }\n else {\n v = zin;\n t = 'z';\n }\n switch (crs.axis[i]) {\n case 'e':\n out[t] = v;\n break;\n case 'w':\n out[t] = -v;\n break;\n case 'n':\n out[t] = v;\n break;\n case 's':\n out[t] = -v;\n break;\n case 'u':\n if (point[t] !== undefined) {\n out.z = v;\n }\n break;\n case 'd':\n if (point[t] !== undefined) {\n out.z = -v;\n }\n break;\n default:\n //console.log(\"ERROR: unknow axis (\"+crs.axis[i]+\") - check definition of \"+crs.projName);\n return null;\n }\n }\n return out;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/adjust_axis.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/checkSanity.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/checkSanity.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (point) {\n checkCoord(point.x);\n checkCoord(point.y);\n});\nfunction checkCoord(num) {\n if (typeof Number.isFinite === 'function') {\n if (Number.isFinite(num)) {\n return;\n }\n throw new TypeError('coordinates must be finite numbers');\n }\n if (typeof num !== 'number' || num !== num || !isFinite(num)) {\n throw new TypeError('coordinates must be finite numbers');\n }\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/checkSanity.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/adjust_lat.js": +/*!*****************************************************!*\ + !*** ./node_modules/proj4/lib/common/adjust_lat.js ***! + \*****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _sign__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./sign */ \"./node_modules/proj4/lib/common/sign.js\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return (Math.abs(x) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) ? x : (x - (Object(_sign__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(x) * Math.PI));\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/adjust_lat.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/adjust_lon.js": +/*!*****************************************************!*\ + !*** ./node_modules/proj4/lib/common/adjust_lon.js ***! + \*****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _sign__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./sign */ \"./node_modules/proj4/lib/common/sign.js\");\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return (Math.abs(x) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]) ? x : (x - (Object(_sign__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(x) * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"TWO_PI\"]));\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/adjust_lon.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/adjust_zone.js": +/*!******************************************************!*\ + !*** ./node_modules/proj4/lib/common/adjust_zone.js ***! + \******************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(zone, lon) {\n if (zone === undefined) {\n zone = Math.floor((Object(_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon) + Math.PI) * 30 / Math.PI) + 1;\n\n if (zone < 0) {\n return 0;\n } else if (zone > 60) {\n return 60;\n }\n }\n return zone;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/adjust_zone.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/asinhy.js": +/*!*************************************************!*\ + !*** ./node_modules/proj4/lib/common/asinhy.js ***! + \*************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _hypot__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hypot */ \"./node_modules/proj4/lib/common/hypot.js\");\n/* harmony import */ var _log1py__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./log1py */ \"./node_modules/proj4/lib/common/log1py.js\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n var y = Math.abs(x);\n y = Object(_log1py__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(y * (1 + y / (Object(_hypot__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(1, y) + 1)));\n\n return x < 0 ? -y : y;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/asinhy.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/asinz.js": +/*!************************************************!*\ + !*** ./node_modules/proj4/lib/common/asinz.js ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n if (Math.abs(x) > 1) {\n x = (x > 1) ? 1 : -1;\n }\n return Math.asin(x);\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/asinz.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/clens.js": +/*!************************************************!*\ + !*** ./node_modules/proj4/lib/common/clens.js ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(pp, arg_r) {\n var r = 2 * Math.cos(arg_r);\n var i = pp.length - 1;\n var hr1 = pp[i];\n var hr2 = 0;\n var hr;\n\n while (--i >= 0) {\n hr = -hr2 + r * hr1 + pp[i];\n hr2 = hr1;\n hr1 = hr;\n }\n\n return Math.sin(arg_r) * hr;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/clens.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/clens_cmplx.js": +/*!******************************************************!*\ + !*** ./node_modules/proj4/lib/common/clens_cmplx.js ***! + \******************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _sinh__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./sinh */ \"./node_modules/proj4/lib/common/sinh.js\");\n/* harmony import */ var _cosh__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cosh */ \"./node_modules/proj4/lib/common/cosh.js\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(pp, arg_r, arg_i) {\n var sin_arg_r = Math.sin(arg_r);\n var cos_arg_r = Math.cos(arg_r);\n var sinh_arg_i = Object(_sinh__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arg_i);\n var cosh_arg_i = Object(_cosh__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arg_i);\n var r = 2 * cos_arg_r * cosh_arg_i;\n var i = -2 * sin_arg_r * sinh_arg_i;\n var j = pp.length - 1;\n var hr = pp[j];\n var hi1 = 0;\n var hr1 = 0;\n var hi = 0;\n var hr2;\n var hi2;\n\n while (--j >= 0) {\n hr2 = hr1;\n hi2 = hi1;\n hr1 = hr;\n hi1 = hi;\n hr = -hr2 + r * hr1 - i * hi1 + pp[j];\n hi = -hi2 + i * hr1 + r * hi1;\n }\n\n r = sin_arg_r * cosh_arg_i;\n i = cos_arg_r * sinh_arg_i;\n\n return [r * hr - i * hi, r * hi + i * hr];\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/clens_cmplx.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/cosh.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/common/cosh.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n var r = Math.exp(x);\n r = (r + 1 / r) / 2;\n return r;\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/cosh.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/e0fn.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/common/e0fn.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return (1 - 0.25 * x * (1 + x / 16 * (3 + 1.25 * x)));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/e0fn.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/e1fn.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/common/e1fn.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return (0.375 * x * (1 + 0.25 * x * (1 + 0.46875 * x)));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/e1fn.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/e2fn.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/common/e2fn.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return (0.05859375 * x * x * (1 + 0.75 * x));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/e2fn.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/e3fn.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/common/e3fn.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return (x * x * x * (35 / 3072));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/e3fn.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/gN.js": +/*!*********************************************!*\ + !*** ./node_modules/proj4/lib/common/gN.js ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, e, sinphi) {\n var temp = e * sinphi;\n return a / Math.sqrt(1 - temp * temp);\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/gN.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/gatg.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/common/gatg.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(pp, B) {\n var cos_2B = 2 * Math.cos(2 * B);\n var i = pp.length - 1;\n var h1 = pp[i];\n var h2 = 0;\n var h;\n\n while (--i >= 0) {\n h = -h2 + cos_2B * h1 + pp[i];\n h2 = h1;\n h1 = h;\n }\n\n return (B + h * Math.sin(2 * B));\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/gatg.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/hypot.js": +/*!************************************************!*\ + !*** ./node_modules/proj4/lib/common/hypot.js ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x, y) {\n x = Math.abs(x);\n y = Math.abs(y);\n var a = Math.max(x, y);\n var b = Math.min(x, y) / (a ? a : 1);\n\n return a * Math.sqrt(1 + Math.pow(b, 2));\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/hypot.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/imlfn.js": +/*!************************************************!*\ + !*** ./node_modules/proj4/lib/common/imlfn.js ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(ml, e0, e1, e2, e3) {\n var phi;\n var dphi;\n\n phi = ml / e0;\n for (var i = 0; i < 15; i++) {\n dphi = (ml - (e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi))) / (e0 - 2 * e1 * Math.cos(2 * phi) + 4 * e2 * Math.cos(4 * phi) - 6 * e3 * Math.cos(6 * phi));\n phi += dphi;\n if (Math.abs(dphi) <= 0.0000000001) {\n return phi;\n }\n }\n\n //..reportError(\"IMLFN-CONV:Latitude failed to converge after 15 iterations\");\n return NaN;\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/imlfn.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/iqsfnz.js": +/*!*************************************************!*\ + !*** ./node_modules/proj4/lib/common/iqsfnz.js ***! + \*************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(eccent, q) {\n var temp = 1 - (1 - eccent * eccent) / (2 * eccent) * Math.log((1 - eccent) / (1 + eccent));\n if (Math.abs(Math.abs(q) - temp) < 1.0E-6) {\n if (q < 0) {\n return (-1 * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]);\n }\n else {\n return _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n }\n }\n //var phi = 0.5* q/(1-eccent*eccent);\n var phi = Math.asin(0.5 * q);\n var dphi;\n var sin_phi;\n var cos_phi;\n var con;\n for (var i = 0; i < 30; i++) {\n sin_phi = Math.sin(phi);\n cos_phi = Math.cos(phi);\n con = eccent * sin_phi;\n dphi = Math.pow(1 - con * con, 2) / (2 * cos_phi) * (q / (1 - eccent * eccent) - sin_phi / (1 - con * con) + 0.5 / eccent * Math.log((1 - con) / (1 + con)));\n phi += dphi;\n if (Math.abs(dphi) <= 0.0000000001) {\n return phi;\n }\n }\n\n //console.log(\"IQSFN-CONV:Latitude failed to converge after 30 iterations\");\n return NaN;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/iqsfnz.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/log1py.js": +/*!*************************************************!*\ + !*** ./node_modules/proj4/lib/common/log1py.js ***! + \*************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n var y = 1 + x;\n var z = y - 1;\n\n return z === 0 ? x : x * Math.log(y) / z;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/log1py.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/mlfn.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/common/mlfn.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(e0, e1, e2, e3, phi) {\n return (e0 * phi - e1 * Math.sin(2 * phi) + e2 * Math.sin(4 * phi) - e3 * Math.sin(6 * phi));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/mlfn.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/msfnz.js": +/*!************************************************!*\ + !*** ./node_modules/proj4/lib/common/msfnz.js ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(eccent, sinphi, cosphi) {\n var con = eccent * sinphi;\n return cosphi / (Math.sqrt(1 - con * con));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/msfnz.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/phi2z.js": +/*!************************************************!*\ + !*** ./node_modules/proj4/lib/common/phi2z.js ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(eccent, ts) {\n var eccnth = 0.5 * eccent;\n var con, dphi;\n var phi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - 2 * Math.atan(ts);\n for (var i = 0; i <= 15; i++) {\n con = eccent * Math.sin(phi);\n dphi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - 2 * Math.atan(ts * (Math.pow(((1 - con) / (1 + con)), eccnth))) - phi;\n phi += dphi;\n if (Math.abs(dphi) <= 0.0000000001) {\n return phi;\n }\n }\n //console.log(\"phi2z has NoConvergence\");\n return -9999;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/phi2z.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/pj_enfn.js": +/*!**************************************************!*\ + !*** ./node_modules/proj4/lib/common/pj_enfn.js ***! + \**************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nvar C00 = 1;\nvar C02 = 0.25;\nvar C04 = 0.046875;\nvar C06 = 0.01953125;\nvar C08 = 0.01068115234375;\nvar C22 = 0.75;\nvar C44 = 0.46875;\nvar C46 = 0.01302083333333333333;\nvar C48 = 0.00712076822916666666;\nvar C66 = 0.36458333333333333333;\nvar C68 = 0.00569661458333333333;\nvar C88 = 0.3076171875;\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(es) {\n var en = [];\n en[0] = C00 - es * (C02 + es * (C04 + es * (C06 + es * C08)));\n en[1] = es * (C22 - es * (C04 + es * (C06 + es * C08)));\n var t = es * es;\n en[2] = t * (C44 - es * (C46 + es * C48));\n t *= es;\n en[3] = t * (C66 - es * C68);\n en[4] = t * es * C88;\n return en;\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/pj_enfn.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/pj_inv_mlfn.js": +/*!******************************************************!*\ + !*** ./node_modules/proj4/lib/common/pj_inv_mlfn.js ***! + \******************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _pj_mlfn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pj_mlfn */ \"./node_modules/proj4/lib/common/pj_mlfn.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\nvar MAX_ITER = 20;\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(arg, es, en) {\n var k = 1 / (1 - es);\n var phi = arg;\n for (var i = MAX_ITER; i; --i) { /* rarely goes over 2 iterations */\n var s = Math.sin(phi);\n var t = 1 - es * s * s;\n //t = this.pj_mlfn(phi, s, Math.cos(phi), en) - arg;\n //phi -= t * (t * Math.sqrt(t)) * k;\n t = (Object(_pj_mlfn__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(phi, s, Math.cos(phi), en) - arg) * (t * Math.sqrt(t)) * k;\n phi -= t;\n if (Math.abs(t) < _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n return phi;\n }\n }\n //..reportError(\"cass:pj_inv_mlfn: Convergence error\");\n return phi;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/pj_inv_mlfn.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/pj_mlfn.js": +/*!**************************************************!*\ + !*** ./node_modules/proj4/lib/common/pj_mlfn.js ***! + \**************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(phi, sphi, cphi, en) {\n cphi *= sphi;\n sphi *= sphi;\n return (en[0] * phi - cphi * (en[1] + sphi * (en[2] + sphi * (en[3] + sphi * en[4]))));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/pj_mlfn.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/qsfnz.js": +/*!************************************************!*\ + !*** ./node_modules/proj4/lib/common/qsfnz.js ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(eccent, sinphi) {\n var con;\n if (eccent > 1.0e-7) {\n con = eccent * sinphi;\n return ((1 - eccent * eccent) * (sinphi / (1 - con * con) - (0.5 / eccent) * Math.log((1 - con) / (1 + con))));\n }\n else {\n return (2 * sinphi);\n }\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/qsfnz.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/sign.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/common/sign.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return x<0 ? -1 : 1;\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/sign.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/sinh.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/common/sinh.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n var r = Math.exp(x);\n r = (r - 1 / r) / 2;\n return r;\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/sinh.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/srat.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/common/srat.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(esinp, exp) {\n return (Math.pow((1 - esinp) / (1 + esinp), exp));\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/srat.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/toPoint.js": +/*!**************************************************!*\ + !*** ./node_modules/proj4/lib/common/toPoint.js ***! + \**************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (array){\n var out = {\n x: array[0],\n y: array[1]\n };\n if (array.length>2) {\n out.z = array[2];\n }\n if (array.length>3) {\n out.m = array[3];\n }\n return out;\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/toPoint.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/common/tsfnz.js": +/*!************************************************!*\ + !*** ./node_modules/proj4/lib/common/tsfnz.js ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(eccent, phi, sinphi) {\n var con = eccent * sinphi;\n var com = 0.5 * eccent;\n con = Math.pow(((1 - con) / (1 + con)), com);\n return (Math.tan(0.5 * (_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - phi)) / con);\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/common/tsfnz.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/constants/Datum.js": +/*!***************************************************!*\ + !*** ./node_modules/proj4/lib/constants/Datum.js ***! + \***************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return exports; });\nvar exports = {};\n\nexports.wgs84 = {\n towgs84: \"0,0,0\",\n ellipse: \"WGS84\",\n datumName: \"WGS84\"\n};\n\nexports.ch1903 = {\n towgs84: \"674.374,15.056,405.346\",\n ellipse: \"bessel\",\n datumName: \"swiss\"\n};\n\nexports.ggrs87 = {\n towgs84: \"-199.87,74.79,246.62\",\n ellipse: \"GRS80\",\n datumName: \"Greek_Geodetic_Reference_System_1987\"\n};\n\nexports.nad83 = {\n towgs84: \"0,0,0\",\n ellipse: \"GRS80\",\n datumName: \"North_American_Datum_1983\"\n};\n\nexports.nad27 = {\n nadgrids: \"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat\",\n ellipse: \"clrk66\",\n datumName: \"North_American_Datum_1927\"\n};\n\nexports.potsdam = {\n towgs84: \"606.0,23.0,413.0\",\n ellipse: \"bessel\",\n datumName: \"Potsdam Rauenberg 1950 DHDN\"\n};\n\nexports.carthage = {\n towgs84: \"-263.0,6.0,431.0\",\n ellipse: \"clark80\",\n datumName: \"Carthage 1934 Tunisia\"\n};\n\nexports.hermannskogel = {\n towgs84: \"653.0,-212.0,449.0\",\n ellipse: \"bessel\",\n datumName: \"Hermannskogel\"\n};\n\nexports.osni52 = {\n towgs84: \"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15\",\n ellipse: \"airy\",\n datumName: \"Irish National\"\n};\n\nexports.ire65 = {\n towgs84: \"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15\",\n ellipse: \"mod_airy\",\n datumName: \"Ireland 1965\"\n};\n\nexports.rassadiran = {\n towgs84: \"-133.63,-157.5,-158.62\",\n ellipse: \"intl\",\n datumName: \"Rassadiran\"\n};\n\nexports.nzgd49 = {\n towgs84: \"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993\",\n ellipse: \"intl\",\n datumName: \"New Zealand Geodetic Datum 1949\"\n};\n\nexports.osgb36 = {\n towgs84: \"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894\",\n ellipse: \"airy\",\n datumName: \"Airy 1830\"\n};\n\nexports.s_jtsk = {\n towgs84: \"589,76,480\",\n ellipse: 'bessel',\n datumName: 'S-JTSK (Ferro)'\n};\n\nexports.beduaram = {\n towgs84: '-106,-87,188',\n ellipse: 'clrk80',\n datumName: 'Beduaram'\n};\n\nexports.gunung_segara = {\n towgs84: '-403,684,41',\n ellipse: 'bessel',\n datumName: 'Gunung Segara Jakarta'\n};\n\nexports.rnb72 = {\n towgs84: \"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1\",\n ellipse: \"intl\",\n datumName: \"Reseau National Belge 1972\"\n};\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/constants/Datum.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/constants/Ellipsoid.js": +/*!*******************************************************!*\ + !*** ./node_modules/proj4/lib/constants/Ellipsoid.js ***! + \*******************************************************/ +/*! exports provided: default, WGS84 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return exports; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WGS84\", function() { return WGS84; });\nvar exports = {};\n\nexports.MERIT = {\n a: 6378137.0,\n rf: 298.257,\n ellipseName: \"MERIT 1983\"\n};\n\nexports.SGS85 = {\n a: 6378136.0,\n rf: 298.257,\n ellipseName: \"Soviet Geodetic System 85\"\n};\n\nexports.GRS80 = {\n a: 6378137.0,\n rf: 298.257222101,\n ellipseName: \"GRS 1980(IUGG, 1980)\"\n};\n\nexports.IAU76 = {\n a: 6378140.0,\n rf: 298.257,\n ellipseName: \"IAU 1976\"\n};\n\nexports.airy = {\n a: 6377563.396,\n b: 6356256.910,\n ellipseName: \"Airy 1830\"\n};\n\nexports.APL4 = {\n a: 6378137,\n rf: 298.25,\n ellipseName: \"Appl. Physics. 1965\"\n};\n\nexports.NWL9D = {\n a: 6378145.0,\n rf: 298.25,\n ellipseName: \"Naval Weapons Lab., 1965\"\n};\n\nexports.mod_airy = {\n a: 6377340.189,\n b: 6356034.446,\n ellipseName: \"Modified Airy\"\n};\n\nexports.andrae = {\n a: 6377104.43,\n rf: 300.0,\n ellipseName: \"Andrae 1876 (Den., Iclnd.)\"\n};\n\nexports.aust_SA = {\n a: 6378160.0,\n rf: 298.25,\n ellipseName: \"Australian Natl & S. Amer. 1969\"\n};\n\nexports.GRS67 = {\n a: 6378160.0,\n rf: 298.2471674270,\n ellipseName: \"GRS 67(IUGG 1967)\"\n};\n\nexports.bessel = {\n a: 6377397.155,\n rf: 299.1528128,\n ellipseName: \"Bessel 1841\"\n};\n\nexports.bess_nam = {\n a: 6377483.865,\n rf: 299.1528128,\n ellipseName: \"Bessel 1841 (Namibia)\"\n};\n\nexports.clrk66 = {\n a: 6378206.4,\n b: 6356583.8,\n ellipseName: \"Clarke 1866\"\n};\n\nexports.clrk80 = {\n a: 6378249.145,\n rf: 293.4663,\n ellipseName: \"Clarke 1880 mod.\"\n};\n\nexports.clrk58 = {\n a: 6378293.645208759,\n rf: 294.2606763692654,\n ellipseName: \"Clarke 1858\"\n};\n\nexports.CPM = {\n a: 6375738.7,\n rf: 334.29,\n ellipseName: \"Comm. des Poids et Mesures 1799\"\n};\n\nexports.delmbr = {\n a: 6376428.0,\n rf: 311.5,\n ellipseName: \"Delambre 1810 (Belgium)\"\n};\n\nexports.engelis = {\n a: 6378136.05,\n rf: 298.2566,\n ellipseName: \"Engelis 1985\"\n};\n\nexports.evrst30 = {\n a: 6377276.345,\n rf: 300.8017,\n ellipseName: \"Everest 1830\"\n};\n\nexports.evrst48 = {\n a: 6377304.063,\n rf: 300.8017,\n ellipseName: \"Everest 1948\"\n};\n\nexports.evrst56 = {\n a: 6377301.243,\n rf: 300.8017,\n ellipseName: \"Everest 1956\"\n};\n\nexports.evrst69 = {\n a: 6377295.664,\n rf: 300.8017,\n ellipseName: \"Everest 1969\"\n};\n\nexports.evrstSS = {\n a: 6377298.556,\n rf: 300.8017,\n ellipseName: \"Everest (Sabah & Sarawak)\"\n};\n\nexports.fschr60 = {\n a: 6378166.0,\n rf: 298.3,\n ellipseName: \"Fischer (Mercury Datum) 1960\"\n};\n\nexports.fschr60m = {\n a: 6378155.0,\n rf: 298.3,\n ellipseName: \"Fischer 1960\"\n};\n\nexports.fschr68 = {\n a: 6378150.0,\n rf: 298.3,\n ellipseName: \"Fischer 1968\"\n};\n\nexports.helmert = {\n a: 6378200.0,\n rf: 298.3,\n ellipseName: \"Helmert 1906\"\n};\n\nexports.hough = {\n a: 6378270.0,\n rf: 297.0,\n ellipseName: \"Hough\"\n};\n\nexports.intl = {\n a: 6378388.0,\n rf: 297.0,\n ellipseName: \"International 1909 (Hayford)\"\n};\n\nexports.kaula = {\n a: 6378163.0,\n rf: 298.24,\n ellipseName: \"Kaula 1961\"\n};\n\nexports.lerch = {\n a: 6378139.0,\n rf: 298.257,\n ellipseName: \"Lerch 1979\"\n};\n\nexports.mprts = {\n a: 6397300.0,\n rf: 191.0,\n ellipseName: \"Maupertius 1738\"\n};\n\nexports.new_intl = {\n a: 6378157.5,\n b: 6356772.2,\n ellipseName: \"New International 1967\"\n};\n\nexports.plessis = {\n a: 6376523.0,\n rf: 6355863.0,\n ellipseName: \"Plessis 1817 (France)\"\n};\n\nexports.krass = {\n a: 6378245.0,\n rf: 298.3,\n ellipseName: \"Krassovsky, 1942\"\n};\n\nexports.SEasia = {\n a: 6378155.0,\n b: 6356773.3205,\n ellipseName: \"Southeast Asia\"\n};\n\nexports.walbeck = {\n a: 6376896.0,\n b: 6355834.8467,\n ellipseName: \"Walbeck\"\n};\n\nexports.WGS60 = {\n a: 6378165.0,\n rf: 298.3,\n ellipseName: \"WGS 60\"\n};\n\nexports.WGS66 = {\n a: 6378145.0,\n rf: 298.25,\n ellipseName: \"WGS 66\"\n};\n\nexports.WGS7 = {\n a: 6378135.0,\n rf: 298.26,\n ellipseName: \"WGS 72\"\n};\n\nvar WGS84 = exports.WGS84 = {\n a: 6378137.0,\n rf: 298.257223563,\n ellipseName: \"WGS 84\"\n};\n\nexports.sphere = {\n a: 6370997.0,\n b: 6370997.0,\n ellipseName: \"Normal Sphere (r=6370997)\"\n};\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/constants/Ellipsoid.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/constants/PrimeMeridian.js": +/*!***********************************************************!*\ + !*** ./node_modules/proj4/lib/constants/PrimeMeridian.js ***! + \***********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return exports; });\nvar exports = {};\n\n\nexports.greenwich = 0.0; //\"0dE\",\nexports.lisbon = -9.131906111111; //\"9d07'54.862\\\"W\",\nexports.paris = 2.337229166667; //\"2d20'14.025\\\"E\",\nexports.bogota = -74.080916666667; //\"74d04'51.3\\\"W\",\nexports.madrid = -3.687938888889; //\"3d41'16.58\\\"W\",\nexports.rome = 12.452333333333; //\"12d27'8.4\\\"E\",\nexports.bern = 7.439583333333; //\"7d26'22.5\\\"E\",\nexports.jakarta = 106.807719444444; //\"106d48'27.79\\\"E\",\nexports.ferro = -17.666666666667; //\"17d40'W\",\nexports.brussels = 4.367975; //\"4d22'4.71\\\"E\",\nexports.stockholm = 18.058277777778; //\"18d3'29.8\\\"E\",\nexports.athens = 23.7163375; //\"23d42'58.815\\\"E\",\nexports.oslo = 10.722916666667; //\"10d43'22.5\\\"E\"\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/constants/PrimeMeridian.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/constants/units.js": +/*!***************************************************!*\ + !*** ./node_modules/proj4/lib/constants/units.js ***! + \***************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n ft: {to_meter: 0.3048},\n 'us-ft': {to_meter: 1200 / 3937}\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/constants/units.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/constants/values.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/constants/values.js ***! + \****************************************************/ +/*! exports provided: PJD_3PARAM, PJD_7PARAM, PJD_GRIDSHIFT, PJD_WGS84, PJD_NODATUM, SRS_WGS84_SEMIMAJOR, SRS_WGS84_SEMIMINOR, SRS_WGS84_ESQUARED, SEC_TO_RAD, HALF_PI, SIXTH, RA4, RA6, EPSLN, D2R, R2D, FORTPI, TWO_PI, SPI */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PJD_3PARAM\", function() { return PJD_3PARAM; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PJD_7PARAM\", function() { return PJD_7PARAM; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PJD_GRIDSHIFT\", function() { return PJD_GRIDSHIFT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PJD_WGS84\", function() { return PJD_WGS84; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PJD_NODATUM\", function() { return PJD_NODATUM; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SRS_WGS84_SEMIMAJOR\", function() { return SRS_WGS84_SEMIMAJOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SRS_WGS84_SEMIMINOR\", function() { return SRS_WGS84_SEMIMINOR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SRS_WGS84_ESQUARED\", function() { return SRS_WGS84_ESQUARED; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SEC_TO_RAD\", function() { return SEC_TO_RAD; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HALF_PI\", function() { return HALF_PI; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SIXTH\", function() { return SIXTH; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RA4\", function() { return RA4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RA6\", function() { return RA6; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EPSLN\", function() { return EPSLN; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"D2R\", function() { return D2R; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"R2D\", function() { return R2D; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FORTPI\", function() { return FORTPI; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TWO_PI\", function() { return TWO_PI; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SPI\", function() { return SPI; });\nvar PJD_3PARAM = 1;\nvar PJD_7PARAM = 2;\nvar PJD_GRIDSHIFT = 3;\nvar PJD_WGS84 = 4; // WGS84 or equivalent\nvar PJD_NODATUM = 5; // WGS84 or equivalent\nvar SRS_WGS84_SEMIMAJOR = 6378137.0; // only used in grid shift transforms\nvar SRS_WGS84_SEMIMINOR = 6356752.314; // only used in grid shift transforms\nvar SRS_WGS84_ESQUARED = 0.0066943799901413165; // only used in grid shift transforms\nvar SEC_TO_RAD = 4.84813681109535993589914102357e-6;\nvar HALF_PI = Math.PI/2;\n// ellipoid pj_set_ell.c\nvar SIXTH = 0.1666666666666666667;\n/* 1/6 */\nvar RA4 = 0.04722222222222222222;\n/* 17/360 */\nvar RA6 = 0.02215608465608465608;\nvar EPSLN = 1.0e-10;\n// you'd think you could use Number.EPSILON above but that makes\n// Mollweide get into an infinate loop.\n\nvar D2R = 0.01745329251994329577;\nvar R2D = 57.29577951308232088;\nvar FORTPI = Math.PI/4;\nvar TWO_PI = Math.PI * 2;\n// SPI is slightly greater than Math.PI, so values that exceed the -180..180\n// degree range by a tiny amount don't get wrapped. This prevents points that\n// have drifted from their original location along the 180th meridian (due to\n// floating point error) from changing their sign.\nvar SPI = 3.14159265359;\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/constants/values.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/core.js": +/*!****************************************!*\ + !*** ./node_modules/proj4/lib/core.js ***! + \****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Proj__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Proj */ \"./node_modules/proj4/lib/Proj.js\");\n/* harmony import */ var _transform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transform */ \"./node_modules/proj4/lib/transform.js\");\n\n\nvar wgs84 = Object(_Proj__WEBPACK_IMPORTED_MODULE_0__[\"default\"])('WGS84');\n\nfunction transformer(from, to, coords) {\n var transformedArray, out, keys;\n if (Array.isArray(coords)) {\n transformedArray = Object(_transform__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(from, to, coords) || {x: NaN, y: NaN};\n if (coords.length > 2) {\n if ((typeof from.name !== 'undefined' && from.name === 'geocent') || (typeof to.name !== 'undefined' && to.name === 'geocent')) {\n if (typeof transformedArray.z === 'number') {\n return [transformedArray.x, transformedArray.y, transformedArray.z].concat(coords.splice(3));\n } else {\n return [transformedArray.x, transformedArray.y, coords[2]].concat(coords.splice(3));\n }\n } else {\n return [transformedArray.x, transformedArray.y].concat(coords.splice(2));\n }\n } else {\n return [transformedArray.x, transformedArray.y];\n }\n } else {\n out = Object(_transform__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(from, to, coords);\n keys = Object.keys(coords);\n if (keys.length === 2) {\n return out;\n }\n keys.forEach(function (key) {\n if ((typeof from.name !== 'undefined' && from.name === 'geocent') || (typeof to.name !== 'undefined' && to.name === 'geocent')) {\n if (key === 'x' || key === 'y' || key === 'z') {\n return;\n }\n } else {\n if (key === 'x' || key === 'y') {\n return;\n }\n }\n out[key] = coords[key];\n });\n return out;\n }\n}\n\nfunction checkProj(item) {\n if (item instanceof _Proj__WEBPACK_IMPORTED_MODULE_0__[\"default\"]) {\n return item;\n }\n if (item.oProj) {\n return item.oProj;\n }\n return Object(_Proj__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(item);\n}\n\nfunction proj4(fromProj, toProj, coord) {\n fromProj = checkProj(fromProj);\n var single = false;\n var obj;\n if (typeof toProj === 'undefined') {\n toProj = fromProj;\n fromProj = wgs84;\n single = true;\n } else if (typeof toProj.x !== 'undefined' || Array.isArray(toProj)) {\n coord = toProj;\n toProj = fromProj;\n fromProj = wgs84;\n single = true;\n }\n toProj = checkProj(toProj);\n if (coord) {\n return transformer(fromProj, toProj, coord);\n } else {\n obj = {\n forward: function (coords) {\n return transformer(fromProj, toProj, coords);\n },\n inverse: function (coords) {\n return transformer(toProj, fromProj, coords);\n }\n };\n if (single) {\n obj.oProj = toProj;\n }\n return obj;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (proj4);\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/core.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/datum.js": +/*!*****************************************!*\ + !*** ./node_modules/proj4/lib/datum.js ***! + \*****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\nfunction datum(datumCode, datum_params, a, b, es, ep2, nadgrids) {\n var out = {};\n\n if (datumCode === undefined || datumCode === 'none') {\n out.datum_type = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_NODATUM\"];\n } else {\n out.datum_type = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_WGS84\"];\n }\n\n if (datum_params) {\n out.datum_params = datum_params.map(parseFloat);\n if (out.datum_params[0] !== 0 || out.datum_params[1] !== 0 || out.datum_params[2] !== 0) {\n out.datum_type = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"];\n }\n if (out.datum_params.length > 3) {\n if (out.datum_params[3] !== 0 || out.datum_params[4] !== 0 || out.datum_params[5] !== 0 || out.datum_params[6] !== 0) {\n out.datum_type = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"];\n out.datum_params[3] *= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SEC_TO_RAD\"];\n out.datum_params[4] *= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SEC_TO_RAD\"];\n out.datum_params[5] *= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SEC_TO_RAD\"];\n out.datum_params[6] = (out.datum_params[6] / 1000000.0) + 1.0;\n }\n }\n }\n\n if (nadgrids) {\n out.datum_type = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_GRIDSHIFT\"];\n out.grids = nadgrids;\n }\n out.a = a; //datum object also uses these values\n out.b = b;\n out.es = es;\n out.ep2 = ep2;\n return out;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (datum);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/datum.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/datumUtils.js": +/*!**********************************************!*\ + !*** ./node_modules/proj4/lib/datumUtils.js ***! + \**********************************************/ +/*! exports provided: compareDatums, geodeticToGeocentric, geocentricToGeodetic, geocentricToWgs84, geocentricFromWgs84 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"compareDatums\", function() { return compareDatums; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geodeticToGeocentric\", function() { return geodeticToGeocentric; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geocentricToGeodetic\", function() { return geocentricToGeodetic; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geocentricToWgs84\", function() { return geocentricToWgs84; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geocentricFromWgs84\", function() { return geocentricFromWgs84; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\nfunction compareDatums(source, dest) {\n if (source.datum_type !== dest.datum_type) {\n return false; // false, datums are not equal\n } else if (source.a !== dest.a || Math.abs(source.es - dest.es) > 0.000000000050) {\n // the tolerance for es is to ensure that GRS80 and WGS84\n // are considered identical\n return false;\n } else if (source.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"]) {\n return (source.datum_params[0] === dest.datum_params[0] && source.datum_params[1] === dest.datum_params[1] && source.datum_params[2] === dest.datum_params[2]);\n } else if (source.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"]) {\n return (source.datum_params[0] === dest.datum_params[0] && source.datum_params[1] === dest.datum_params[1] && source.datum_params[2] === dest.datum_params[2] && source.datum_params[3] === dest.datum_params[3] && source.datum_params[4] === dest.datum_params[4] && source.datum_params[5] === dest.datum_params[5] && source.datum_params[6] === dest.datum_params[6]);\n } else {\n return true; // datums are equal\n }\n} // cs_compare_datums()\n\n/*\n * The function Convert_Geodetic_To_Geocentric converts geodetic coordinates\n * (latitude, longitude, and height) to geocentric coordinates (X, Y, Z),\n * according to the current ellipsoid parameters.\n *\n * Latitude : Geodetic latitude in radians (input)\n * Longitude : Geodetic longitude in radians (input)\n * Height : Geodetic height, in meters (input)\n * X : Calculated Geocentric X coordinate, in meters (output)\n * Y : Calculated Geocentric Y coordinate, in meters (output)\n * Z : Calculated Geocentric Z coordinate, in meters (output)\n *\n */\nfunction geodeticToGeocentric(p, es, a) {\n var Longitude = p.x;\n var Latitude = p.y;\n var Height = p.z ? p.z : 0; //Z value not always supplied\n\n var Rn; /* Earth radius at location */\n var Sin_Lat; /* Math.sin(Latitude) */\n var Sin2_Lat; /* Square of Math.sin(Latitude) */\n var Cos_Lat; /* Math.cos(Latitude) */\n\n /*\n ** Don't blow up if Latitude is just a little out of the value\n ** range as it may just be a rounding issue. Also removed longitude\n ** test, it should be wrapped by Math.cos() and Math.sin(). NFW for PROJ.4, Sep/2001.\n */\n if (Latitude < -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] && Latitude > -1.001 * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) {\n Latitude = -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (Latitude > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] && Latitude < 1.001 * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) {\n Latitude = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (Latitude < -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) {\n /* Latitude out of range */\n //..reportError('geocent:lat out of range:' + Latitude);\n return { x: -Infinity, y: -Infinity, z: p.z };\n } else if (Latitude > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) {\n /* Latitude out of range */\n return { x: Infinity, y: Infinity, z: p.z };\n }\n\n if (Longitude > Math.PI) {\n Longitude -= (2 * Math.PI);\n }\n Sin_Lat = Math.sin(Latitude);\n Cos_Lat = Math.cos(Latitude);\n Sin2_Lat = Sin_Lat * Sin_Lat;\n Rn = a / (Math.sqrt(1.0e0 - es * Sin2_Lat));\n return {\n x: (Rn + Height) * Cos_Lat * Math.cos(Longitude),\n y: (Rn + Height) * Cos_Lat * Math.sin(Longitude),\n z: ((Rn * (1 - es)) + Height) * Sin_Lat\n };\n} // cs_geodetic_to_geocentric()\n\nfunction geocentricToGeodetic(p, es, a, b) {\n /* local defintions and variables */\n /* end-criterium of loop, accuracy of sin(Latitude) */\n var genau = 1e-12;\n var genau2 = (genau * genau);\n var maxiter = 30;\n\n var P; /* distance between semi-minor axis and location */\n var RR; /* distance between center and location */\n var CT; /* sin of geocentric latitude */\n var ST; /* cos of geocentric latitude */\n var RX;\n var RK;\n var RN; /* Earth radius at location */\n var CPHI0; /* cos of start or old geodetic latitude in iterations */\n var SPHI0; /* sin of start or old geodetic latitude in iterations */\n var CPHI; /* cos of searched geodetic latitude */\n var SPHI; /* sin of searched geodetic latitude */\n var SDPHI; /* end-criterium: addition-theorem of sin(Latitude(iter)-Latitude(iter-1)) */\n var iter; /* # of continous iteration, max. 30 is always enough (s.a.) */\n\n var X = p.x;\n var Y = p.y;\n var Z = p.z ? p.z : 0.0; //Z value not always supplied\n var Longitude;\n var Latitude;\n var Height;\n\n P = Math.sqrt(X * X + Y * Y);\n RR = Math.sqrt(X * X + Y * Y + Z * Z);\n\n /* special cases for latitude and longitude */\n if (P / a < genau) {\n\n /* special case, if P=0. (X=0., Y=0.) */\n Longitude = 0.0;\n\n /* if (X,Y,Z)=(0.,0.,0.) then Height becomes semi-minor axis\n * of ellipsoid (=center of mass), Latitude becomes PI/2 */\n if (RR / a < genau) {\n Latitude = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n Height = -b;\n return {\n x: p.x,\n y: p.y,\n z: p.z\n };\n }\n } else {\n /* ellipsoidal (geodetic) longitude\n * interval: -PI < Longitude <= +PI */\n Longitude = Math.atan2(Y, X);\n }\n\n /* --------------------------------------------------------------\n * Following iterative algorithm was developped by\n * \"Institut for Erdmessung\", University of Hannover, July 1988.\n * Internet: www.ife.uni-hannover.de\n * Iterative computation of CPHI,SPHI and Height.\n * Iteration of CPHI and SPHI to 10**-12 radian resp.\n * 2*10**-7 arcsec.\n * --------------------------------------------------------------\n */\n CT = Z / RR;\n ST = P / RR;\n RX = 1.0 / Math.sqrt(1.0 - es * (2.0 - es) * ST * ST);\n CPHI0 = ST * (1.0 - es) * RX;\n SPHI0 = CT * RX;\n iter = 0;\n\n /* loop to find sin(Latitude) resp. Latitude\n * until |sin(Latitude(iter)-Latitude(iter-1))| < genau */\n do {\n iter++;\n RN = a / Math.sqrt(1.0 - es * SPHI0 * SPHI0);\n\n /* ellipsoidal (geodetic) height */\n Height = P * CPHI0 + Z * SPHI0 - RN * (1.0 - es * SPHI0 * SPHI0);\n\n RK = es * RN / (RN + Height);\n RX = 1.0 / Math.sqrt(1.0 - RK * (2.0 - RK) * ST * ST);\n CPHI = ST * (1.0 - RK) * RX;\n SPHI = CT * RX;\n SDPHI = SPHI * CPHI0 - CPHI * SPHI0;\n CPHI0 = CPHI;\n SPHI0 = SPHI;\n }\n while (SDPHI * SDPHI > genau2 && iter < maxiter);\n\n /* ellipsoidal (geodetic) latitude */\n Latitude = Math.atan(SPHI / Math.abs(CPHI));\n return {\n x: Longitude,\n y: Latitude,\n z: Height\n };\n} // cs_geocentric_to_geodetic()\n\n/****************************************************************/\n// pj_geocentic_to_wgs84( p )\n// p = point to transform in geocentric coordinates (x,y,z)\n\n\n/** point object, nothing fancy, just allows values to be\n passed back and forth by reference rather than by value.\n Other point classes may be used as long as they have\n x and y properties, which will get modified in the transform method.\n*/\nfunction geocentricToWgs84(p, datum_type, datum_params) {\n\n if (datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"]) {\n // if( x[io] === HUGE_VAL )\n // continue;\n return {\n x: p.x + datum_params[0],\n y: p.y + datum_params[1],\n z: p.z + datum_params[2],\n };\n } else if (datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"]) {\n var Dx_BF = datum_params[0];\n var Dy_BF = datum_params[1];\n var Dz_BF = datum_params[2];\n var Rx_BF = datum_params[3];\n var Ry_BF = datum_params[4];\n var Rz_BF = datum_params[5];\n var M_BF = datum_params[6];\n // if( x[io] === HUGE_VAL )\n // continue;\n return {\n x: M_BF * (p.x - Rz_BF * p.y + Ry_BF * p.z) + Dx_BF,\n y: M_BF * (Rz_BF * p.x + p.y - Rx_BF * p.z) + Dy_BF,\n z: M_BF * (-Ry_BF * p.x + Rx_BF * p.y + p.z) + Dz_BF\n };\n }\n} // cs_geocentric_to_wgs84\n\n/****************************************************************/\n// pj_geocentic_from_wgs84()\n// coordinate system definition,\n// point to transform in geocentric coordinates (x,y,z)\nfunction geocentricFromWgs84(p, datum_type, datum_params) {\n\n if (datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"]) {\n //if( x[io] === HUGE_VAL )\n // continue;\n return {\n x: p.x - datum_params[0],\n y: p.y - datum_params[1],\n z: p.z - datum_params[2],\n };\n\n } else if (datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"]) {\n var Dx_BF = datum_params[0];\n var Dy_BF = datum_params[1];\n var Dz_BF = datum_params[2];\n var Rx_BF = datum_params[3];\n var Ry_BF = datum_params[4];\n var Rz_BF = datum_params[5];\n var M_BF = datum_params[6];\n var x_tmp = (p.x - Dx_BF) / M_BF;\n var y_tmp = (p.y - Dy_BF) / M_BF;\n var z_tmp = (p.z - Dz_BF) / M_BF;\n //if( x[io] === HUGE_VAL )\n // continue;\n\n return {\n x: x_tmp + Rz_BF * y_tmp - Ry_BF * z_tmp,\n y: -Rz_BF * x_tmp + y_tmp + Rx_BF * z_tmp,\n z: Ry_BF * x_tmp - Rx_BF * y_tmp + z_tmp\n };\n } //cs_geocentric_from_wgs84()\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/datumUtils.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/datum_transform.js": +/*!***************************************************!*\ + !*** ./node_modules/proj4/lib/datum_transform.js ***! + \***************************************************/ +/*! exports provided: default, applyGridShift */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"applyGridShift\", function() { return applyGridShift; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _datumUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./datumUtils */ \"./node_modules/proj4/lib/datumUtils.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\n\n\nfunction checkParams(type) {\n return (type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"] || type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"]);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(source, dest, point) {\n // Short cut if the datums are identical.\n if (Object(_datumUtils__WEBPACK_IMPORTED_MODULE_1__[\"compareDatums\"])(source, dest)) {\n return point; // in this case, zero is sucess,\n // whereas cs_compare_datums returns 1 to indicate TRUE\n // confusing, should fix this\n }\n\n // Explicitly skip datum transform by setting 'datum=none' as parameter for either source or dest\n if (source.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_NODATUM\"] || dest.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_NODATUM\"]) {\n return point;\n }\n\n // If this datum requires grid shifts, then apply it to geodetic coordinates.\n var source_a = source.a;\n var source_es = source.es;\n if (source.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_GRIDSHIFT\"]) {\n var gridShiftCode = applyGridShift(source, false, point);\n if (gridShiftCode !== 0) {\n return undefined;\n }\n source_a = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SRS_WGS84_SEMIMAJOR\"];\n source_es = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SRS_WGS84_ESQUARED\"];\n }\n\n var dest_a = dest.a;\n var dest_b = dest.b;\n var dest_es = dest.es;\n if (dest.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_GRIDSHIFT\"]) {\n dest_a = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SRS_WGS84_SEMIMAJOR\"];\n dest_b = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SRS_WGS84_SEMIMINOR\"];\n dest_es = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SRS_WGS84_ESQUARED\"];\n }\n\n // Do we need to go through geocentric coordinates?\n if (source_es === dest_es && source_a === dest_a && !checkParams(source.datum_type) && !checkParams(dest.datum_type)) {\n return point;\n }\n\n // Convert to geocentric coordinates.\n point = Object(_datumUtils__WEBPACK_IMPORTED_MODULE_1__[\"geodeticToGeocentric\"])(point, source_es, source_a);\n // Convert between datums\n if (checkParams(source.datum_type)) {\n point = Object(_datumUtils__WEBPACK_IMPORTED_MODULE_1__[\"geocentricToWgs84\"])(point, source.datum_type, source.datum_params);\n }\n if (checkParams(dest.datum_type)) {\n point = Object(_datumUtils__WEBPACK_IMPORTED_MODULE_1__[\"geocentricFromWgs84\"])(point, dest.datum_type, dest.datum_params);\n }\n point = Object(_datumUtils__WEBPACK_IMPORTED_MODULE_1__[\"geocentricToGeodetic\"])(point, dest_es, dest_a, dest_b);\n\n if (dest.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_GRIDSHIFT\"]) {\n var destGridShiftResult = applyGridShift(dest, true, point);\n if (destGridShiftResult !== 0) {\n return undefined;\n }\n }\n\n return point;\n});\n\nfunction applyGridShift(source, inverse, point) {\n if (source.grids === null || source.grids.length === 0) {\n console.log('Grid shift grids not found');\n return -1;\n }\n var input = {x: -point.x, y: point.y};\n var output = {x: Number.NaN, y: Number.NaN};\n var onlyMandatoryGrids = false;\n var attemptedGrids = [];\n for (var i = 0; i < source.grids.length; i++) {\n var grid = source.grids[i];\n attemptedGrids.push(grid.name);\n if (grid.isNull) {\n output = input;\n break;\n }\n onlyMandatoryGrids = grid.mandatory;\n if (grid.grid === null) {\n if (grid.mandatory) {\n console.log(\"Unable to find mandatory grid '\" + grid.name + \"'\");\n return -1;\n }\n continue;\n }\n var subgrid = grid.grid.subgrids[0];\n // skip tables that don't match our point at all\n var epsilon = (Math.abs(subgrid.del[1]) + Math.abs(subgrid.del[0])) / 10000.0;\n var minX = subgrid.ll[0] - epsilon;\n var minY = subgrid.ll[1] - epsilon;\n var maxX = subgrid.ll[0] + (subgrid.lim[0] - 1) * subgrid.del[0] + epsilon;\n var maxY = subgrid.ll[1] + (subgrid.lim[1] - 1) * subgrid.del[1] + epsilon;\n if (minY > input.y || minX > input.x || maxY < input.y || maxX < input.x ) {\n continue;\n }\n output = applySubgridShift(input, inverse, subgrid);\n if (!isNaN(output.x)) {\n break;\n }\n }\n if (isNaN(output.x)) {\n console.log(\"Failed to find a grid shift table for location '\"+\n -input.x * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"R2D\"] + \" \" + input.y * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"R2D\"] + \" tried: '\" + attemptedGrids + \"'\");\n return -1;\n }\n point.x = -output.x;\n point.y = output.y;\n return 0;\n}\n\nfunction applySubgridShift(pin, inverse, ct) {\n var val = {x: Number.NaN, y: Number.NaN};\n if (isNaN(pin.x)) { return val; }\n var tb = {x: pin.x, y: pin.y};\n tb.x -= ct.ll[0];\n tb.y -= ct.ll[1];\n tb.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(tb.x - Math.PI) + Math.PI;\n var t = nadInterpolate(tb, ct);\n if (inverse) {\n if (isNaN(t.x)) {\n return val;\n }\n t.x = tb.x - t.x;\n t.y = tb.y - t.y;\n var i = 9, tol = 1e-12;\n var dif, del;\n do {\n del = nadInterpolate(t, ct);\n if (isNaN(del.x)) {\n console.log(\"Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.\");\n break;\n }\n dif = {x: tb.x - (del.x + t.x), y: tb.y - (del.y + t.y)};\n t.x += dif.x;\n t.y += dif.y;\n } while (i-- && Math.abs(dif.x) > tol && Math.abs(dif.y) > tol);\n if (i < 0) {\n console.log(\"Inverse grid shift iterator failed to converge.\");\n return val;\n }\n val.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(t.x + ct.ll[0]);\n val.y = t.y + ct.ll[1];\n } else {\n if (!isNaN(t.x)) {\n val.x = pin.x + t.x;\n val.y = pin.y + t.y;\n }\n }\n return val;\n}\n\nfunction nadInterpolate(pin, ct) {\n var t = {x: pin.x / ct.del[0], y: pin.y / ct.del[1]};\n var indx = {x: Math.floor(t.x), y: Math.floor(t.y)};\n var frct = {x: t.x - 1.0 * indx.x, y: t.y - 1.0 * indx.y};\n var val= {x: Number.NaN, y: Number.NaN};\n var inx;\n if (indx.x < 0 || indx.x >= ct.lim[0]) {\n return val;\n }\n if (indx.y < 0 || indx.y >= ct.lim[1]) {\n return val;\n }\n inx = (indx.y * ct.lim[0]) + indx.x;\n var f00 = {x: ct.cvs[inx][0], y: ct.cvs[inx][1]};\n inx++;\n var f10= {x: ct.cvs[inx][0], y: ct.cvs[inx][1]};\n inx += ct.lim[0];\n var f11 = {x: ct.cvs[inx][0], y: ct.cvs[inx][1]};\n inx--;\n var f01 = {x: ct.cvs[inx][0], y: ct.cvs[inx][1]};\n var m11 = frct.x * frct.y, m10 = frct.x * (1.0 - frct.y),\n m00 = (1.0 - frct.x) * (1.0 - frct.y), m01 = (1.0 - frct.x) * frct.y;\n val.x = (m00 * f00.x + m10 * f10.x + m01 * f01.x + m11 * f11.x);\n val.y = (m00 * f00.y + m10 * f10.y + m01 * f01.y + m11 * f11.y);\n return val;\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/datum_transform.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/defs.js": +/*!****************************************!*\ + !*** ./node_modules/proj4/lib/defs.js ***! + \****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./global */ \"./node_modules/proj4/lib/global.js\");\n/* harmony import */ var _projString__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./projString */ \"./node_modules/proj4/lib/projString.js\");\n/* harmony import */ var wkt_parser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! wkt-parser */ \"./node_modules/wkt-parser/index.js\");\n\n\n\n\nfunction defs(name) {\n /*global console*/\n var that = this;\n if (arguments.length === 2) {\n var def = arguments[1];\n if (typeof def === 'string') {\n if (def.charAt(0) === '+') {\n defs[name] = Object(_projString__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arguments[1]);\n }\n else {\n defs[name] = Object(wkt_parser__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(arguments[1]);\n }\n } else {\n defs[name] = def;\n }\n }\n else if (arguments.length === 1) {\n if (Array.isArray(name)) {\n return name.map(function(v) {\n if (Array.isArray(v)) {\n defs.apply(that, v);\n }\n else {\n defs(v);\n }\n });\n }\n else if (typeof name === 'string') {\n if (name in defs) {\n return defs[name];\n }\n }\n else if ('EPSG' in name) {\n defs['EPSG:' + name.EPSG] = name;\n }\n else if ('ESRI' in name) {\n defs['ESRI:' + name.ESRI] = name;\n }\n else if ('IAU2000' in name) {\n defs['IAU2000:' + name.IAU2000] = name;\n }\n else {\n console.log(name);\n }\n return;\n }\n\n\n}\nObject(_global__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(defs);\n/* harmony default export */ __webpack_exports__[\"default\"] = (defs);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/defs.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/deriveConstants.js": +/*!***************************************************!*\ + !*** ./node_modules/proj4/lib/deriveConstants.js ***! + \***************************************************/ +/*! exports provided: eccentricity, sphere */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"eccentricity\", function() { return eccentricity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sphere\", function() { return sphere; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _constants_Ellipsoid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants/Ellipsoid */ \"./node_modules/proj4/lib/constants/Ellipsoid.js\");\n/* harmony import */ var _match__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./match */ \"./node_modules/proj4/lib/match.js\");\n\n\n\n\nfunction eccentricity(a, b, rf, R_A) {\n var a2 = a * a; // used in geocentric\n var b2 = b * b; // used in geocentric\n var es = (a2 - b2) / a2; // e ^ 2\n var e = 0;\n if (R_A) {\n a *= 1 - es * (_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SIXTH\"] + es * (_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"RA4\"] + es * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"RA6\"]));\n a2 = a * a;\n es = 0;\n } else {\n e = Math.sqrt(es); // eccentricity\n }\n var ep2 = (a2 - b2) / b2; // used in geocentric\n return {\n es: es,\n e: e,\n ep2: ep2\n };\n}\nfunction sphere(a, b, rf, ellps, sphere) {\n if (!a) { // do we have an ellipsoid?\n var ellipse = Object(_match__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(_constants_Ellipsoid__WEBPACK_IMPORTED_MODULE_1__[\"default\"], ellps);\n if (!ellipse) {\n ellipse = _constants_Ellipsoid__WEBPACK_IMPORTED_MODULE_1__[\"WGS84\"];\n }\n a = ellipse.a;\n b = ellipse.b;\n rf = ellipse.rf;\n }\n\n if (rf && !b) {\n b = (1.0 - 1.0 / rf) * a;\n }\n if (rf === 0 || Math.abs(a - b) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n sphere = true;\n b = a;\n }\n return {\n a: a,\n b: b,\n rf: rf,\n sphere: sphere\n };\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/deriveConstants.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/extend.js": +/*!******************************************!*\ + !*** ./node_modules/proj4/lib/extend.js ***! + \******************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(destination, source) {\n destination = destination || {};\n var value, property;\n if (!source) {\n return destination;\n }\n for (property in source) {\n value = source[property];\n if (value !== undefined) {\n destination[property] = value;\n }\n }\n return destination;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/extend.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/global.js": +/*!******************************************!*\ + !*** ./node_modules/proj4/lib/global.js ***! + \******************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(defs) {\n defs('EPSG:4326', \"+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees\");\n defs('EPSG:4269', \"+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees\");\n defs('EPSG:3857', \"+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs\");\n\n defs.WGS84 = defs['EPSG:4326'];\n defs['EPSG:3785'] = defs['EPSG:3857']; // maintain backward compat, official code is 3857\n defs.GOOGLE = defs['EPSG:3857'];\n defs['EPSG:900913'] = defs['EPSG:3857'];\n defs['EPSG:102113'] = defs['EPSG:3857'];\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/global.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/index.js": +/*!*****************************************!*\ + !*** ./node_modules/proj4/lib/index.js ***! + \*****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core */ \"./node_modules/proj4/lib/core.js\");\n/* harmony import */ var _Proj__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Proj */ \"./node_modules/proj4/lib/Proj.js\");\n/* harmony import */ var _Point__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Point */ \"./node_modules/proj4/lib/Point.js\");\n/* harmony import */ var _common_toPoint__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./common/toPoint */ \"./node_modules/proj4/lib/common/toPoint.js\");\n/* harmony import */ var _defs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./defs */ \"./node_modules/proj4/lib/defs.js\");\n/* harmony import */ var _nadgrid__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./nadgrid */ \"./node_modules/proj4/lib/nadgrid.js\");\n/* harmony import */ var _transform__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./transform */ \"./node_modules/proj4/lib/transform.js\");\n/* harmony import */ var mgrs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! mgrs */ \"./node_modules/mgrs/mgrs.js\");\n/* harmony import */ var _projs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../projs */ \"./node_modules/proj4/projs.js\");\n\n\n\n\n\n\n\n\n\n\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].defaultDatum = 'WGS84'; //default datum\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Proj = _Proj__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].WGS84 = new _core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Proj('WGS84');\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Point = _Point__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toPoint = _common_toPoint__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].defs = _defs__WEBPACK_IMPORTED_MODULE_4__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].nadgrid = _nadgrid__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].transform = _transform__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].mgrs = mgrs__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\n_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"].version = '__VERSION__';\nObject(_projs__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (_core__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/index.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/match.js": +/*!*****************************************!*\ + !*** ./node_modules/proj4/lib/match.js ***! + \*****************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return match; });\nvar ignoredChar = /[\\s_\\-\\/\\(\\)]/g;\nfunction match(obj, key) {\n if (obj[key]) {\n return obj[key];\n }\n var keys = Object.keys(obj);\n var lkey = key.toLowerCase().replace(ignoredChar, '');\n var i = -1;\n var testkey, processedKey;\n while (++i < keys.length) {\n testkey = keys[i];\n processedKey = testkey.toLowerCase().replace(ignoredChar, '');\n if (processedKey === lkey) {\n return obj[testkey];\n }\n }\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/match.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/nadgrid.js": +/*!*******************************************!*\ + !*** ./node_modules/proj4/lib/nadgrid.js ***! + \*******************************************/ +/*! exports provided: default, getNadgrids */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return nadgrid; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getNadgrids\", function() { return getNadgrids; });\n/**\n * Resources for details of NTv2 file formats:\n * - https://web.archive.org/web/20140127204822if_/http://www.mgs.gov.on.ca:80/stdprodconsume/groups/content/@mgs/@iandit/documents/resourcelist/stel02_047447.pdf\n * - http://mimaka.com/help/gs/html/004_NTV2%20Data%20Format.htm\n */\n\nvar loadedNadgrids = {};\n\n/**\n * Load a binary NTv2 file (.gsb) to a key that can be used in a proj string like +nadgrids=. Pass the NTv2 file\n * as an ArrayBuffer.\n */\nfunction nadgrid(key, data) {\n var view = new DataView(data);\n var isLittleEndian = detectLittleEndian(view);\n var header = readHeader(view, isLittleEndian);\n if (header.nSubgrids > 1) {\n console.log('Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored');\n }\n var subgrids = readSubgrids(view, header, isLittleEndian);\n var nadgrid = {header: header, subgrids: subgrids};\n loadedNadgrids[key] = nadgrid;\n return nadgrid;\n}\n\n/**\n * Given a proj4 value for nadgrids, return an array of loaded grids\n */\nfunction getNadgrids(nadgrids) {\n // Format details: http://proj.maptools.org/gen_parms.html\n if (nadgrids === undefined) { return null; }\n var grids = nadgrids.split(',');\n return grids.map(parseNadgridString);\n}\n\nfunction parseNadgridString(value) {\n if (value.length === 0) {\n return null;\n }\n var optional = value[0] === '@';\n if (optional) {\n value = value.slice(1);\n }\n if (value === 'null') {\n return {name: 'null', mandatory: !optional, grid: null, isNull: true};\n }\n return {\n name: value,\n mandatory: !optional,\n grid: loadedNadgrids[value] || null,\n isNull: false\n };\n}\n\nfunction secondsToRadians(seconds) {\n return (seconds / 3600) * Math.PI / 180;\n}\n\nfunction detectLittleEndian(view) {\n var nFields = view.getInt32(8, false);\n if (nFields === 11) {\n return false;\n }\n nFields = view.getInt32(8, true);\n if (nFields !== 11) {\n console.warn('Failed to detect nadgrid endian-ness, defaulting to little-endian');\n }\n return true;\n}\n\nfunction readHeader(view, isLittleEndian) {\n return {\n nFields: view.getInt32(8, isLittleEndian),\n nSubgridFields: view.getInt32(24, isLittleEndian),\n nSubgrids: view.getInt32(40, isLittleEndian),\n shiftType: decodeString(view, 56, 56 + 8).trim(),\n fromSemiMajorAxis: view.getFloat64(120, isLittleEndian),\n fromSemiMinorAxis: view.getFloat64(136, isLittleEndian),\n toSemiMajorAxis: view.getFloat64(152, isLittleEndian),\n toSemiMinorAxis: view.getFloat64(168, isLittleEndian),\n };\n}\n\nfunction decodeString(view, start, end) {\n return String.fromCharCode.apply(null, new Uint8Array(view.buffer.slice(start, end)));\n}\n\nfunction readSubgrids(view, header, isLittleEndian) {\n var gridOffset = 176;\n var grids = [];\n for (var i = 0; i < header.nSubgrids; i++) {\n var subHeader = readGridHeader(view, gridOffset, isLittleEndian);\n var nodes = readGridNodes(view, gridOffset, subHeader, isLittleEndian);\n var lngColumnCount = Math.round(\n 1 + (subHeader.upperLongitude - subHeader.lowerLongitude) / subHeader.longitudeInterval);\n var latColumnCount = Math.round(\n 1 + (subHeader.upperLatitude - subHeader.lowerLatitude) / subHeader.latitudeInterval);\n // Proj4 operates on radians whereas the coordinates are in seconds in the grid\n grids.push({\n ll: [secondsToRadians(subHeader.lowerLongitude), secondsToRadians(subHeader.lowerLatitude)],\n del: [secondsToRadians(subHeader.longitudeInterval), secondsToRadians(subHeader.latitudeInterval)],\n lim: [lngColumnCount, latColumnCount],\n count: subHeader.gridNodeCount,\n cvs: mapNodes(nodes)\n });\n }\n return grids;\n}\n\nfunction mapNodes(nodes) {\n return nodes.map(function (r) {return [secondsToRadians(r.longitudeShift), secondsToRadians(r.latitudeShift)];});\n}\n\nfunction readGridHeader(view, offset, isLittleEndian) {\n return {\n name: decodeString(view, offset + 8, offset + 16).trim(),\n parent: decodeString(view, offset + 24, offset + 24 + 8).trim(),\n lowerLatitude: view.getFloat64(offset + 72, isLittleEndian),\n upperLatitude: view.getFloat64(offset + 88, isLittleEndian),\n lowerLongitude: view.getFloat64(offset + 104, isLittleEndian),\n upperLongitude: view.getFloat64(offset + 120, isLittleEndian),\n latitudeInterval: view.getFloat64(offset + 136, isLittleEndian),\n longitudeInterval: view.getFloat64(offset + 152, isLittleEndian),\n gridNodeCount: view.getInt32(offset + 168, isLittleEndian)\n };\n}\n\nfunction readGridNodes(view, offset, gridHeader, isLittleEndian) {\n var nodesOffset = offset + 176;\n var gridRecordLength = 16;\n var gridShiftRecords = [];\n for (var i = 0; i < gridHeader.gridNodeCount; i++) {\n var record = {\n latitudeShift: view.getFloat32(nodesOffset + i * gridRecordLength, isLittleEndian),\n longitudeShift: view.getFloat32(nodesOffset + i * gridRecordLength + 4, isLittleEndian),\n latitudeAccuracy: view.getFloat32(nodesOffset + i * gridRecordLength + 8, isLittleEndian),\n longitudeAccuracy: view.getFloat32(nodesOffset + i * gridRecordLength + 12, isLittleEndian),\n };\n gridShiftRecords.push(record);\n }\n return gridShiftRecords;\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/nadgrid.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/parseCode.js": +/*!*********************************************!*\ + !*** ./node_modules/proj4/lib/parseCode.js ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _defs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defs */ \"./node_modules/proj4/lib/defs.js\");\n/* harmony import */ var wkt_parser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! wkt-parser */ \"./node_modules/wkt-parser/index.js\");\n/* harmony import */ var _projString__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./projString */ \"./node_modules/proj4/lib/projString.js\");\n/* harmony import */ var _match__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./match */ \"./node_modules/proj4/lib/match.js\");\n\n\n\n\nfunction testObj(code){\n return typeof code === 'string';\n}\nfunction testDef(code){\n return code in _defs__WEBPACK_IMPORTED_MODULE_0__[\"default\"];\n}\nvar codeWords = ['PROJECTEDCRS', 'PROJCRS', 'GEOGCS','GEOCCS','PROJCS','LOCAL_CS', 'GEODCRS', 'GEODETICCRS', 'GEODETICDATUM', 'ENGCRS', 'ENGINEERINGCRS'];\nfunction testWKT(code){\n return codeWords.some(function (word) {\n return code.indexOf(word) > -1;\n });\n}\nvar codes = ['3857', '900913', '3785', '102113'];\nfunction checkMercator(item) {\n var auth = Object(_match__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(item, 'authority');\n if (!auth) {\n return;\n }\n var code = Object(_match__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(auth, 'epsg');\n return code && codes.indexOf(code) > -1;\n}\nfunction checkProjStr(item) {\n var ext = Object(_match__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(item, 'extension');\n if (!ext) {\n return;\n }\n return Object(_match__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(ext, 'proj4');\n}\nfunction testProj(code){\n return code[0] === '+';\n}\nfunction parse(code){\n if (testObj(code)) {\n //check to see if this is a WKT string\n if (testDef(code)) {\n return _defs__WEBPACK_IMPORTED_MODULE_0__[\"default\"][code];\n }\n if (testWKT(code)) {\n var out = Object(wkt_parser__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(code);\n // test of spetial case, due to this being a very common and often malformed\n if (checkMercator(out)) {\n return _defs__WEBPACK_IMPORTED_MODULE_0__[\"default\"]['EPSG:3857'];\n }\n var maybeProjStr = checkProjStr(out);\n if (maybeProjStr) {\n return Object(_projString__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(maybeProjStr);\n }\n return out;\n }\n if (testProj(code)) {\n return Object(_projString__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(code);\n }\n }else{\n return code;\n }\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (parse);\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/parseCode.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projString.js": +/*!**********************************************!*\ + !*** ./node_modules/proj4/lib/projString.js ***! + \**********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _constants_PrimeMeridian__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants/PrimeMeridian */ \"./node_modules/proj4/lib/constants/PrimeMeridian.js\");\n/* harmony import */ var _constants_units__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants/units */ \"./node_modules/proj4/lib/constants/units.js\");\n/* harmony import */ var _match__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./match */ \"./node_modules/proj4/lib/match.js\");\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(defData) {\n var self = {};\n var paramObj = defData.split('+').map(function(v) {\n return v.trim();\n }).filter(function(a) {\n return a;\n }).reduce(function(p, a) {\n var split = a.split('=');\n split.push(true);\n p[split[0].toLowerCase()] = split[1];\n return p;\n }, {});\n var paramName, paramVal, paramOutname;\n var params = {\n proj: 'projName',\n datum: 'datumCode',\n rf: function(v) {\n self.rf = parseFloat(v);\n },\n lat_0: function(v) {\n self.lat0 = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lat_1: function(v) {\n self.lat1 = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lat_2: function(v) {\n self.lat2 = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lat_ts: function(v) {\n self.lat_ts = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lon_0: function(v) {\n self.long0 = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lon_1: function(v) {\n self.long1 = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lon_2: function(v) {\n self.long2 = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n alpha: function(v) {\n self.alpha = parseFloat(v) * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n lonc: function(v) {\n self.longc = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n x_0: function(v) {\n self.x0 = parseFloat(v);\n },\n y_0: function(v) {\n self.y0 = parseFloat(v);\n },\n k_0: function(v) {\n self.k0 = parseFloat(v);\n },\n k: function(v) {\n self.k0 = parseFloat(v);\n },\n a: function(v) {\n self.a = parseFloat(v);\n },\n b: function(v) {\n self.b = parseFloat(v);\n },\n r_a: function() {\n self.R_A = true;\n },\n zone: function(v) {\n self.zone = parseInt(v, 10);\n },\n south: function() {\n self.utmSouth = true;\n },\n towgs84: function(v) {\n self.datum_params = v.split(\",\").map(function(a) {\n return parseFloat(a);\n });\n },\n to_meter: function(v) {\n self.to_meter = parseFloat(v);\n },\n units: function(v) {\n self.units = v;\n var unit = Object(_match__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(_constants_units__WEBPACK_IMPORTED_MODULE_2__[\"default\"], v);\n if (unit) {\n self.to_meter = unit.to_meter;\n }\n },\n from_greenwich: function(v) {\n self.from_greenwich = v * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n pm: function(v) {\n var pm = Object(_match__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(_constants_PrimeMeridian__WEBPACK_IMPORTED_MODULE_1__[\"default\"], v);\n self.from_greenwich = (pm ? pm : parseFloat(v)) * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n },\n nadgrids: function(v) {\n if (v === '@null') {\n self.datumCode = 'none';\n }\n else {\n self.nadgrids = v;\n }\n },\n axis: function(v) {\n var legalAxis = \"ewnsud\";\n if (v.length === 3 && legalAxis.indexOf(v.substr(0, 1)) !== -1 && legalAxis.indexOf(v.substr(1, 1)) !== -1 && legalAxis.indexOf(v.substr(2, 1)) !== -1) {\n self.axis = v;\n }\n },\n approx: function() {\n self.approx = true;\n }\n };\n for (paramName in paramObj) {\n paramVal = paramObj[paramName];\n if (paramName in params) {\n paramOutname = params[paramName];\n if (typeof paramOutname === 'function') {\n paramOutname(paramVal);\n }\n else {\n self[paramOutname] = paramVal;\n }\n }\n else {\n self[paramName] = paramVal;\n }\n }\n if(typeof self.datumCode === 'string' && self.datumCode !== \"WGS84\"){\n self.datumCode = self.datumCode.toLowerCase();\n }\n return self;\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projString.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections.js": +/*!***********************************************!*\ + !*** ./node_modules/proj4/lib/projections.js ***! + \***********************************************/ +/*! exports provided: add, get, start, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return get; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"start\", function() { return start; });\n/* harmony import */ var _projections_merc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./projections/merc */ \"./node_modules/proj4/lib/projections/merc.js\");\n/* harmony import */ var _projections_longlat__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./projections/longlat */ \"./node_modules/proj4/lib/projections/longlat.js\");\n\n\nvar projs = [_projections_merc__WEBPACK_IMPORTED_MODULE_0__[\"default\"], _projections_longlat__WEBPACK_IMPORTED_MODULE_1__[\"default\"]];\nvar names = {};\nvar projStore = [];\n\nfunction add(proj, i) {\n var len = projStore.length;\n if (!proj.names) {\n console.log(i);\n return true;\n }\n projStore[len] = proj;\n proj.names.forEach(function(n) {\n names[n.toLowerCase()] = len;\n });\n return this;\n}\n\n\n\nfunction get(name) {\n if (!name) {\n return false;\n }\n var n = name.toLowerCase();\n if (typeof names[n] !== 'undefined' && projStore[names[n]]) {\n return projStore[names[n]];\n }\n}\n\nfunction start() {\n projs.forEach(add);\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n start: start,\n add: add,\n get: get\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/aea.js": +/*!***************************************************!*\ + !*** ./node_modules/proj4/lib/projections/aea.js ***! + \***************************************************/ +/*! exports provided: init, forward, inverse, phi1z, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"phi1z\", function() { return phi1z; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_msfnz__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/msfnz */ \"./node_modules/proj4/lib/common/msfnz.js\");\n/* harmony import */ var _common_qsfnz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/qsfnz */ \"./node_modules/proj4/lib/common/qsfnz.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_asinz__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/asinz */ \"./node_modules/proj4/lib/common/asinz.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n\n\nfunction init() {\n\n if (Math.abs(this.lat1 + this.lat2) < _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n return;\n }\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2);\n this.e3 = Math.sqrt(this.es);\n\n this.sin_po = Math.sin(this.lat1);\n this.cos_po = Math.cos(this.lat1);\n this.t1 = this.sin_po;\n this.con = this.sin_po;\n this.ms1 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e3, this.sin_po, this.cos_po);\n this.qs1 = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e3, this.sin_po, this.cos_po);\n\n this.sin_po = Math.sin(this.lat2);\n this.cos_po = Math.cos(this.lat2);\n this.t2 = this.sin_po;\n this.ms2 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e3, this.sin_po, this.cos_po);\n this.qs2 = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e3, this.sin_po, this.cos_po);\n\n this.sin_po = Math.sin(this.lat0);\n this.cos_po = Math.cos(this.lat0);\n this.t3 = this.sin_po;\n this.qs0 = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e3, this.sin_po, this.cos_po);\n\n if (Math.abs(this.lat1 - this.lat2) > _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n this.ns0 = (this.ms1 * this.ms1 - this.ms2 * this.ms2) / (this.qs2 - this.qs1);\n }\n else {\n this.ns0 = this.con;\n }\n this.c = this.ms1 * this.ms1 + this.ns0 * this.qs1;\n this.rh = this.a * Math.sqrt(this.c - this.ns0 * this.qs0) / this.ns0;\n}\n\n/* Albers Conical Equal Area forward equations--mapping lat,long to x,y\n -------------------------------------------------------------------*/\nfunction forward(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n this.sin_phi = Math.sin(lat);\n this.cos_phi = Math.cos(lat);\n\n var qs = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e3, this.sin_phi, this.cos_phi);\n var rh1 = this.a * Math.sqrt(this.c - this.ns0 * qs) / this.ns0;\n var theta = this.ns0 * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(lon - this.long0);\n var x = rh1 * Math.sin(theta) + this.x0;\n var y = this.rh - rh1 * Math.cos(theta) + this.y0;\n\n p.x = x;\n p.y = y;\n return p;\n}\n\nfunction inverse(p) {\n var rh1, qs, con, theta, lon, lat;\n\n p.x -= this.x0;\n p.y = this.rh - p.y + this.y0;\n if (this.ns0 >= 0) {\n rh1 = Math.sqrt(p.x * p.x + p.y * p.y);\n con = 1;\n }\n else {\n rh1 = -Math.sqrt(p.x * p.x + p.y * p.y);\n con = -1;\n }\n theta = 0;\n if (rh1 !== 0) {\n theta = Math.atan2(con * p.x, con * p.y);\n }\n con = rh1 * this.ns0 / this.a;\n if (this.sphere) {\n lat = Math.asin((this.c - con * con) / (2 * this.ns0));\n }\n else {\n qs = (this.c - con * con) / this.ns0;\n lat = this.phi1z(this.e3, qs);\n }\n\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(theta / this.ns0 + this.long0);\n p.x = lon;\n p.y = lat;\n return p;\n}\n\n/* Function to compute phi1, the latitude for the inverse of the\n Albers Conical Equal-Area projection.\n-------------------------------------------*/\nfunction phi1z(eccent, qs) {\n var sinphi, cosphi, con, com, dphi;\n var phi = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(0.5 * qs);\n if (eccent < _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n return phi;\n }\n\n var eccnts = eccent * eccent;\n for (var i = 1; i <= 25; i++) {\n sinphi = Math.sin(phi);\n cosphi = Math.cos(phi);\n con = eccent * sinphi;\n com = 1 - con * con;\n dphi = 0.5 * com * com / cosphi * (qs / (1 - eccnts) - sinphi / com + 0.5 / eccent * Math.log((1 - con) / (1 + con)));\n phi = phi + dphi;\n if (Math.abs(dphi) <= 1e-7) {\n return phi;\n }\n }\n return null;\n}\n\nvar names = [\"Albers_Conic_Equal_Area\", \"Albers\", \"aea\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names,\n phi1z: phi1z\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/aea.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/aeqd.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/aeqd.js ***! + \****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_mlfn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/mlfn */ \"./node_modules/proj4/lib/common/mlfn.js\");\n/* harmony import */ var _common_e0fn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/e0fn */ \"./node_modules/proj4/lib/common/e0fn.js\");\n/* harmony import */ var _common_e1fn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/e1fn */ \"./node_modules/proj4/lib/common/e1fn.js\");\n/* harmony import */ var _common_e2fn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/e2fn */ \"./node_modules/proj4/lib/common/e2fn.js\");\n/* harmony import */ var _common_e3fn__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/e3fn */ \"./node_modules/proj4/lib/common/e3fn.js\");\n/* harmony import */ var _common_gN__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/gN */ \"./node_modules/proj4/lib/common/gN.js\");\n/* harmony import */ var _common_asinz__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/asinz */ \"./node_modules/proj4/lib/common/asinz.js\");\n/* harmony import */ var _common_imlfn__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../common/imlfn */ \"./node_modules/proj4/lib/common/imlfn.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction init() {\n this.sin_p12 = Math.sin(this.lat0);\n this.cos_p12 = Math.cos(this.lat0);\n}\n\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n var sinphi = Math.sin(p.y);\n var cosphi = Math.cos(p.y);\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n var e0, e1, e2, e3, Mlp, Ml, tanphi, Nl1, Nl, psi, Az, G, H, GH, Hs, c, kp, cos_c, s, s2, s3, s4, s5;\n if (this.sphere) {\n if (Math.abs(this.sin_p12 - 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n //North Pole case\n p.x = this.x0 + this.a * (_constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"] - lat) * Math.sin(dlon);\n p.y = this.y0 - this.a * (_constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"] - lat) * Math.cos(dlon);\n return p;\n }\n else if (Math.abs(this.sin_p12 + 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n //South Pole case\n p.x = this.x0 + this.a * (_constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"] + lat) * Math.sin(dlon);\n p.y = this.y0 + this.a * (_constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"] + lat) * Math.cos(dlon);\n return p;\n }\n else {\n //default case\n cos_c = this.sin_p12 * sinphi + this.cos_p12 * cosphi * Math.cos(dlon);\n c = Math.acos(cos_c);\n kp = c ? c / Math.sin(c) : 1;\n p.x = this.x0 + this.a * kp * cosphi * Math.sin(dlon);\n p.y = this.y0 + this.a * kp * (this.cos_p12 * sinphi - this.sin_p12 * cosphi * Math.cos(dlon));\n return p;\n }\n }\n else {\n e0 = Object(_common_e0fn__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.es);\n e1 = Object(_common_e1fn__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.es);\n e2 = Object(_common_e2fn__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.es);\n e3 = Object(_common_e3fn__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.es);\n if (Math.abs(this.sin_p12 - 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n //North Pole case\n Mlp = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e0, e1, e2, e3, _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"]);\n Ml = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e0, e1, e2, e3, lat);\n p.x = this.x0 + (Mlp - Ml) * Math.sin(dlon);\n p.y = this.y0 - (Mlp - Ml) * Math.cos(dlon);\n return p;\n }\n else if (Math.abs(this.sin_p12 + 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n //South Pole case\n Mlp = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e0, e1, e2, e3, _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"]);\n Ml = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e0, e1, e2, e3, lat);\n p.x = this.x0 + (Mlp + Ml) * Math.sin(dlon);\n p.y = this.y0 + (Mlp + Ml) * Math.cos(dlon);\n return p;\n }\n else {\n //Default case\n tanphi = sinphi / cosphi;\n Nl1 = Object(_common_gN__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(this.a, this.e, this.sin_p12);\n Nl = Object(_common_gN__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(this.a, this.e, sinphi);\n psi = Math.atan((1 - this.es) * tanphi + this.es * Nl1 * this.sin_p12 / (Nl * cosphi));\n Az = Math.atan2(Math.sin(dlon), this.cos_p12 * Math.tan(psi) - this.sin_p12 * Math.cos(dlon));\n if (Az === 0) {\n s = Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi));\n }\n else if (Math.abs(Math.abs(Az) - Math.PI) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n s = -Math.asin(this.cos_p12 * Math.sin(psi) - this.sin_p12 * Math.cos(psi));\n }\n else {\n s = Math.asin(Math.sin(dlon) * Math.cos(psi) / Math.sin(Az));\n }\n G = this.e * this.sin_p12 / Math.sqrt(1 - this.es);\n H = this.e * this.cos_p12 * Math.cos(Az) / Math.sqrt(1 - this.es);\n GH = G * H;\n Hs = H * H;\n s2 = s * s;\n s3 = s2 * s;\n s4 = s3 * s;\n s5 = s4 * s;\n c = Nl1 * s * (1 - s2 * Hs * (1 - Hs) / 6 + s3 / 8 * GH * (1 - 2 * Hs) + s4 / 120 * (Hs * (4 - 7 * Hs) - 3 * G * G * (1 - 7 * Hs)) - s5 / 48 * GH);\n p.x = this.x0 + c * Math.sin(Az);\n p.y = this.y0 + c * Math.cos(Az);\n return p;\n }\n }\n\n\n}\n\nfunction inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var rh, z, sinz, cosz, lon, lat, con, e0, e1, e2, e3, Mlp, M, N1, psi, Az, cosAz, tmp, A, B, D, Ee, F, sinpsi;\n if (this.sphere) {\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n if (rh > (2 * _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"] * this.a)) {\n return;\n }\n z = rh / this.a;\n\n sinz = Math.sin(z);\n cosz = Math.cos(z);\n\n lon = this.long0;\n if (Math.abs(rh) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n lat = this.lat0;\n }\n else {\n lat = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(cosz * this.sin_p12 + (p.y * sinz * this.cos_p12) / rh);\n con = Math.abs(this.lat0) - _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"];\n if (Math.abs(con) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n if (this.lat0 >= 0) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.atan2(p.x, - p.y));\n }\n else {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 - Math.atan2(-p.x, p.y));\n }\n }\n else {\n /*con = cosz - this.sin_p12 * Math.sin(lat);\n if ((Math.abs(con) < EPSLN) && (Math.abs(p.x) < EPSLN)) {\n //no-op, just keep the lon value as is\n } else {\n var temp = Math.atan2((p.x * sinz * this.cos_p12), (con * rh));\n lon = adjust_lon(this.long0 + Math.atan2((p.x * sinz * this.cos_p12), (con * rh)));\n }*/\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.atan2(p.x * sinz, rh * this.cos_p12 * cosz - p.y * this.sin_p12 * sinz));\n }\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n e0 = Object(_common_e0fn__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.es);\n e1 = Object(_common_e1fn__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.es);\n e2 = Object(_common_e2fn__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.es);\n e3 = Object(_common_e3fn__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.es);\n if (Math.abs(this.sin_p12 - 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n //North pole case\n Mlp = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e0, e1, e2, e3, _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"]);\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n M = Mlp - rh;\n lat = Object(_common_imlfn__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(M / this.a, e0, e1, e2, e3);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.atan2(p.x, - 1 * p.y));\n p.x = lon;\n p.y = lat;\n return p;\n }\n else if (Math.abs(this.sin_p12 + 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n //South pole case\n Mlp = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e0, e1, e2, e3, _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"]);\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n M = rh - Mlp;\n\n lat = Object(_common_imlfn__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(M / this.a, e0, e1, e2, e3);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.atan2(p.x, p.y));\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n //default case\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n Az = Math.atan2(p.x, p.y);\n N1 = Object(_common_gN__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(this.a, this.e, this.sin_p12);\n cosAz = Math.cos(Az);\n tmp = this.e * this.cos_p12 * cosAz;\n A = -tmp * tmp / (1 - this.es);\n B = 3 * this.es * (1 - A) * this.sin_p12 * this.cos_p12 * cosAz / (1 - this.es);\n D = rh / N1;\n Ee = D - A * (1 + A) * Math.pow(D, 3) / 6 - B * (1 + 3 * A) * Math.pow(D, 4) / 24;\n F = 1 - A * Ee * Ee / 2 - D * Ee * Ee * Ee / 6;\n psi = Math.asin(this.sin_p12 * Math.cos(Ee) + this.cos_p12 * Math.sin(Ee) * cosAz);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.asin(Math.sin(Az) * Math.sin(Ee) / Math.cos(psi)));\n sinpsi = Math.sin(psi);\n lat = Math.atan2((sinpsi - this.es * F * this.sin_p12) * Math.tan(psi), sinpsi * (1 - this.es));\n p.x = lon;\n p.y = lat;\n return p;\n }\n }\n\n}\n\nvar names = [\"Azimuthal_Equidistant\", \"aeqd\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/aeqd.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/cass.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/cass.js ***! + \****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_mlfn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/mlfn */ \"./node_modules/proj4/lib/common/mlfn.js\");\n/* harmony import */ var _common_e0fn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/e0fn */ \"./node_modules/proj4/lib/common/e0fn.js\");\n/* harmony import */ var _common_e1fn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/e1fn */ \"./node_modules/proj4/lib/common/e1fn.js\");\n/* harmony import */ var _common_e2fn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/e2fn */ \"./node_modules/proj4/lib/common/e2fn.js\");\n/* harmony import */ var _common_e3fn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/e3fn */ \"./node_modules/proj4/lib/common/e3fn.js\");\n/* harmony import */ var _common_gN__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/gN */ \"./node_modules/proj4/lib/common/gN.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_adjust_lat__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/adjust_lat */ \"./node_modules/proj4/lib/common/adjust_lat.js\");\n/* harmony import */ var _common_imlfn__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/imlfn */ \"./node_modules/proj4/lib/common/imlfn.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n\n\n\n\n\n\n\nfunction init() {\n if (!this.sphere) {\n this.e0 = Object(_common_e0fn__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.es);\n this.e1 = Object(_common_e1fn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.es);\n this.e2 = Object(_common_e2fn__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.es);\n this.e3 = Object(_common_e3fn__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.es);\n this.ml0 = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e0, this.e1, this.e2, this.e3, this.lat0);\n }\n}\n\n/* Cassini forward equations--mapping lat,long to x,y\n -----------------------------------------------------------------------*/\nfunction forward(p) {\n\n /* Forward equations\n -----------------*/\n var x, y;\n var lam = p.x;\n var phi = p.y;\n lam = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(lam - this.long0);\n\n if (this.sphere) {\n x = this.a * Math.asin(Math.cos(phi) * Math.sin(lam));\n y = this.a * (Math.atan2(Math.tan(phi), Math.cos(lam)) - this.lat0);\n }\n else {\n //ellipsoid\n var sinphi = Math.sin(phi);\n var cosphi = Math.cos(phi);\n var nl = Object(_common_gN__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.a, this.e, sinphi);\n var tl = Math.tan(phi) * Math.tan(phi);\n var al = lam * Math.cos(phi);\n var asq = al * al;\n var cl = this.es * cosphi * cosphi / (1 - this.es);\n var ml = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e0, this.e1, this.e2, this.e3, phi);\n\n x = nl * al * (1 - asq * tl * (1 / 6 - (8 - tl + 8 * cl) * asq / 120));\n y = ml - this.ml0 + nl * sinphi / cosphi * asq * (0.5 + (5 - tl + 6 * cl) * asq / 24);\n\n\n }\n\n p.x = x + this.x0;\n p.y = y + this.y0;\n return p;\n}\n\n/* Inverse equations\n -----------------*/\nfunction inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var x = p.x / this.a;\n var y = p.y / this.a;\n var phi, lam;\n\n if (this.sphere) {\n var dd = y + this.lat0;\n phi = Math.asin(Math.sin(dd) * Math.cos(x));\n lam = Math.atan2(Math.tan(x), Math.cos(dd));\n }\n else {\n /* ellipsoid */\n var ml1 = this.ml0 / this.a + y;\n var phi1 = Object(_common_imlfn__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(ml1, this.e0, this.e1, this.e2, this.e3);\n if (Math.abs(Math.abs(phi1) - _constants_values__WEBPACK_IMPORTED_MODULE_9__[\"HALF_PI\"]) <= _constants_values__WEBPACK_IMPORTED_MODULE_9__[\"EPSLN\"]) {\n p.x = this.long0;\n p.y = _constants_values__WEBPACK_IMPORTED_MODULE_9__[\"HALF_PI\"];\n if (y < 0) {\n p.y *= -1;\n }\n return p;\n }\n var nl1 = Object(_common_gN__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.a, this.e, Math.sin(phi1));\n\n var rl1 = nl1 * nl1 * nl1 / this.a / this.a * (1 - this.es);\n var tl1 = Math.pow(Math.tan(phi1), 2);\n var dl = x * this.a / nl1;\n var dsq = dl * dl;\n phi = phi1 - nl1 * Math.tan(phi1) / rl1 * dl * dl * (0.5 - (1 + 3 * tl1) * dl * dl / 24);\n lam = dl * (1 - dsq * (tl1 / 3 + (1 + 3 * tl1) * tl1 * dsq / 15)) / Math.cos(phi1);\n\n }\n\n p.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(lam + this.long0);\n p.y = Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(phi);\n return p;\n\n}\n\nvar names = [\"Cassini\", \"Cassini_Soldner\", \"cass\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/cass.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/cea.js": +/*!***************************************************!*\ + !*** ./node_modules/proj4/lib/projections/cea.js ***! + \***************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_qsfnz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/qsfnz */ \"./node_modules/proj4/lib/common/qsfnz.js\");\n/* harmony import */ var _common_msfnz__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/msfnz */ \"./node_modules/proj4/lib/common/msfnz.js\");\n/* harmony import */ var _common_iqsfnz__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/iqsfnz */ \"./node_modules/proj4/lib/common/iqsfnz.js\");\n\n\n\n\n\n/*\n reference:\n \"Cartographic Projection Procedures for the UNIX Environment-\n A User's Manual\" by Gerald I. Evenden,\n USGS Open File Report 90-284and Release 4 Interim Reports (2003)\n*/\nfunction init() {\n //no-op\n if (!this.sphere) {\n this.k0 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));\n }\n}\n\n/* Cylindrical Equal Area forward equations--mapping lat,long to x,y\n ------------------------------------------------------------*/\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n var x, y;\n /* Forward equations\n -----------------*/\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n if (this.sphere) {\n x = this.x0 + this.a * dlon * Math.cos(this.lat_ts);\n y = this.y0 + this.a * Math.sin(lat) / Math.cos(this.lat_ts);\n }\n else {\n var qs = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, Math.sin(lat));\n x = this.x0 + this.a * this.k0 * dlon;\n y = this.y0 + this.a * qs * 0.5 / this.k0;\n }\n\n p.x = x;\n p.y = y;\n return p;\n}\n\n/* Cylindrical Equal Area inverse equations--mapping x,y to lat/long\n ------------------------------------------------------------*/\nfunction inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var lon, lat;\n\n if (this.sphere) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + (p.x / this.a) / Math.cos(this.lat_ts));\n lat = Math.asin((p.y / this.a) * Math.cos(this.lat_ts));\n }\n else {\n lat = Object(_common_iqsfnz__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.e, 2 * p.y * this.k0 / this.a);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + p.x / (this.a * this.k0));\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"cea\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/cea.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/eqc.js": +/*!***************************************************!*\ + !*** ./node_modules/proj4/lib/projections/eqc.js ***! + \***************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_adjust_lat__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/adjust_lat */ \"./node_modules/proj4/lib/common/adjust_lat.js\");\n\n\n\nfunction init() {\n\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n this.lat0 = this.lat0 || 0;\n this.long0 = this.long0 || 0;\n this.lat_ts = this.lat_ts || 0;\n this.title = this.title || \"Equidistant Cylindrical (Plate Carre)\";\n\n this.rc = Math.cos(this.lat_ts);\n}\n\n// forward equations--mapping lat,long to x,y\n// -----------------------------------------------------------------\nfunction forward(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n var dlat = Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lat - this.lat0);\n p.x = this.x0 + (this.a * dlon * this.rc);\n p.y = this.y0 + (this.a * dlat);\n return p;\n}\n\n// inverse equations--mapping x,y to lat/long\n// -----------------------------------------------------------------\nfunction inverse(p) {\n\n var x = p.x;\n var y = p.y;\n\n p.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + ((x - this.x0) / (this.a * this.rc)));\n p.y = Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.lat0 + ((y - this.y0) / (this.a)));\n return p;\n}\n\nvar names = [\"Equirectangular\", \"Equidistant_Cylindrical\", \"eqc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/eqc.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/eqdc.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/eqdc.js ***! + \****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_e0fn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/e0fn */ \"./node_modules/proj4/lib/common/e0fn.js\");\n/* harmony import */ var _common_e1fn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/e1fn */ \"./node_modules/proj4/lib/common/e1fn.js\");\n/* harmony import */ var _common_e2fn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/e2fn */ \"./node_modules/proj4/lib/common/e2fn.js\");\n/* harmony import */ var _common_e3fn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/e3fn */ \"./node_modules/proj4/lib/common/e3fn.js\");\n/* harmony import */ var _common_msfnz__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/msfnz */ \"./node_modules/proj4/lib/common/msfnz.js\");\n/* harmony import */ var _common_mlfn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/mlfn */ \"./node_modules/proj4/lib/common/mlfn.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_adjust_lat__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/adjust_lat */ \"./node_modules/proj4/lib/common/adjust_lat.js\");\n/* harmony import */ var _common_imlfn__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/imlfn */ \"./node_modules/proj4/lib/common/imlfn.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n\n\n\n\n\n\n\nfunction init() {\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n // Standard Parallels cannot be equal and on opposite sides of the equator\n if (Math.abs(this.lat1 + this.lat2) < _constants_values__WEBPACK_IMPORTED_MODULE_9__[\"EPSLN\"]) {\n return;\n }\n this.lat2 = this.lat2 || this.lat1;\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2);\n this.e = Math.sqrt(this.es);\n this.e0 = Object(_common_e0fn__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.es);\n this.e1 = Object(_common_e1fn__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.es);\n this.e2 = Object(_common_e2fn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.es);\n this.e3 = Object(_common_e3fn__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.es);\n\n this.sinphi = Math.sin(this.lat1);\n this.cosphi = Math.cos(this.lat1);\n\n this.ms1 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.e, this.sinphi, this.cosphi);\n this.ml1 = Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.e0, this.e1, this.e2, this.e3, this.lat1);\n\n if (Math.abs(this.lat1 - this.lat2) < _constants_values__WEBPACK_IMPORTED_MODULE_9__[\"EPSLN\"]) {\n this.ns = this.sinphi;\n }\n else {\n this.sinphi = Math.sin(this.lat2);\n this.cosphi = Math.cos(this.lat2);\n this.ms2 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.e, this.sinphi, this.cosphi);\n this.ml2 = Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.e0, this.e1, this.e2, this.e3, this.lat2);\n this.ns = (this.ms1 - this.ms2) / (this.ml2 - this.ml1);\n }\n this.g = this.ml1 + this.ms1 / this.ns;\n this.ml0 = Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.e0, this.e1, this.e2, this.e3, this.lat0);\n this.rh = this.a * (this.g - this.ml0);\n}\n\n/* Equidistant Conic forward equations--mapping lat,long to x,y\n -----------------------------------------------------------*/\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n var rh1;\n\n /* Forward equations\n -----------------*/\n if (this.sphere) {\n rh1 = this.a * (this.g - lat);\n }\n else {\n var ml = Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.e0, this.e1, this.e2, this.e3, lat);\n rh1 = this.a * (this.g - ml);\n }\n var theta = this.ns * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(lon - this.long0);\n var x = this.x0 + rh1 * Math.sin(theta);\n var y = this.y0 + this.rh - rh1 * Math.cos(theta);\n p.x = x;\n p.y = y;\n return p;\n}\n\n/* Inverse equations\n -----------------*/\nfunction inverse(p) {\n p.x -= this.x0;\n p.y = this.rh - p.y + this.y0;\n var con, rh1, lat, lon;\n if (this.ns >= 0) {\n rh1 = Math.sqrt(p.x * p.x + p.y * p.y);\n con = 1;\n }\n else {\n rh1 = -Math.sqrt(p.x * p.x + p.y * p.y);\n con = -1;\n }\n var theta = 0;\n if (rh1 !== 0) {\n theta = Math.atan2(con * p.x, con * p.y);\n }\n\n if (this.sphere) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.long0 + theta / this.ns);\n lat = Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(this.g - rh1 / this.a);\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n var ml = this.g - rh1 / this.a;\n lat = Object(_common_imlfn__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(ml, this.e0, this.e1, this.e2, this.e3);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.long0 + theta / this.ns);\n p.x = lon;\n p.y = lat;\n return p;\n }\n\n}\n\nvar names = [\"Equidistant_Conic\", \"eqdc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/eqdc.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/etmerc.js": +/*!******************************************************!*\ + !*** ./node_modules/proj4/lib/projections/etmerc.js ***! + \******************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _projections_tmerc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../projections/tmerc */ \"./node_modules/proj4/lib/projections/tmerc.js\");\n/* harmony import */ var _common_sinh__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/sinh */ \"./node_modules/proj4/lib/common/sinh.js\");\n/* harmony import */ var _common_hypot__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/hypot */ \"./node_modules/proj4/lib/common/hypot.js\");\n/* harmony import */ var _common_asinhy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/asinhy */ \"./node_modules/proj4/lib/common/asinhy.js\");\n/* harmony import */ var _common_gatg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/gatg */ \"./node_modules/proj4/lib/common/gatg.js\");\n/* harmony import */ var _common_clens__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/clens */ \"./node_modules/proj4/lib/common/clens.js\");\n/* harmony import */ var _common_clens_cmplx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/clens_cmplx */ \"./node_modules/proj4/lib/common/clens_cmplx.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n// Heavily based on this etmerc projection implementation\n// https://github.com/mbloch/mapshaper-proj/blob/master/src/projections/etmerc.js\n\n\n\n\n\n\n\n\n\n\nfunction init() {\n if (!this.approx && (isNaN(this.es) || this.es <= 0)) {\n throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION[\"Fast_Transverse_Mercator\"] in the WKT.');\n }\n if (this.approx) {\n // When '+approx' is set, use tmerc instead\n _projections_tmerc__WEBPACK_IMPORTED_MODULE_0__[\"default\"].init.apply(this);\n this.forward = _projections_tmerc__WEBPACK_IMPORTED_MODULE_0__[\"default\"].forward;\n this.inverse = _projections_tmerc__WEBPACK_IMPORTED_MODULE_0__[\"default\"].inverse;\n }\n\n this.x0 = this.x0 !== undefined ? this.x0 : 0;\n this.y0 = this.y0 !== undefined ? this.y0 : 0;\n this.long0 = this.long0 !== undefined ? this.long0 : 0;\n this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;\n\n this.cgb = [];\n this.cbg = [];\n this.utg = [];\n this.gtu = [];\n\n var f = this.es / (1 + Math.sqrt(1 - this.es));\n var n = f / (2 - f);\n var np = n;\n\n this.cgb[0] = n * (2 + n * (-2 / 3 + n * (-2 + n * (116 / 45 + n * (26 / 45 + n * (-2854 / 675 ))))));\n this.cbg[0] = n * (-2 + n * ( 2 / 3 + n * ( 4 / 3 + n * (-82 / 45 + n * (32 / 45 + n * (4642 / 4725))))));\n\n np = np * n;\n this.cgb[1] = np * (7 / 3 + n * (-8 / 5 + n * (-227 / 45 + n * (2704 / 315 + n * (2323 / 945)))));\n this.cbg[1] = np * (5 / 3 + n * (-16 / 15 + n * ( -13 / 9 + n * (904 / 315 + n * (-1522 / 945)))));\n\n np = np * n;\n this.cgb[2] = np * (56 / 15 + n * (-136 / 35 + n * (-1262 / 105 + n * (73814 / 2835))));\n this.cbg[2] = np * (-26 / 15 + n * (34 / 21 + n * (8 / 5 + n * (-12686 / 2835))));\n\n np = np * n;\n this.cgb[3] = np * (4279 / 630 + n * (-332 / 35 + n * (-399572 / 14175)));\n this.cbg[3] = np * (1237 / 630 + n * (-12 / 5 + n * ( -24832 / 14175)));\n\n np = np * n;\n this.cgb[4] = np * (4174 / 315 + n * (-144838 / 6237));\n this.cbg[4] = np * (-734 / 315 + n * (109598 / 31185));\n\n np = np * n;\n this.cgb[5] = np * (601676 / 22275);\n this.cbg[5] = np * (444337 / 155925);\n\n np = Math.pow(n, 2);\n this.Qn = this.k0 / (1 + n) * (1 + np * (1 / 4 + np * (1 / 64 + np / 256)));\n\n this.utg[0] = n * (-0.5 + n * ( 2 / 3 + n * (-37 / 96 + n * ( 1 / 360 + n * (81 / 512 + n * (-96199 / 604800))))));\n this.gtu[0] = n * (0.5 + n * (-2 / 3 + n * (5 / 16 + n * (41 / 180 + n * (-127 / 288 + n * (7891 / 37800))))));\n\n this.utg[1] = np * (-1 / 48 + n * (-1 / 15 + n * (437 / 1440 + n * (-46 / 105 + n * (1118711 / 3870720)))));\n this.gtu[1] = np * (13 / 48 + n * (-3 / 5 + n * (557 / 1440 + n * (281 / 630 + n * (-1983433 / 1935360)))));\n\n np = np * n;\n this.utg[2] = np * (-17 / 480 + n * (37 / 840 + n * (209 / 4480 + n * (-5569 / 90720 ))));\n this.gtu[2] = np * (61 / 240 + n * (-103 / 140 + n * (15061 / 26880 + n * (167603 / 181440))));\n\n np = np * n;\n this.utg[3] = np * (-4397 / 161280 + n * (11 / 504 + n * (830251 / 7257600)));\n this.gtu[3] = np * (49561 / 161280 + n * (-179 / 168 + n * (6601661 / 7257600)));\n\n np = np * n;\n this.utg[4] = np * (-4583 / 161280 + n * (108847 / 3991680));\n this.gtu[4] = np * (34729 / 80640 + n * (-3418889 / 1995840));\n\n np = np * n;\n this.utg[5] = np * (-20648693 / 638668800);\n this.gtu[5] = np * (212378941 / 319334400);\n\n var Z = Object(_common_gatg__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.cbg, this.lat0);\n this.Zb = -this.Qn * (Z + Object(_common_clens__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.gtu, 2 * Z));\n}\n\nfunction forward(p) {\n var Ce = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(p.x - this.long0);\n var Cn = p.y;\n\n Cn = Object(_common_gatg__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.cbg, Cn);\n var sin_Cn = Math.sin(Cn);\n var cos_Cn = Math.cos(Cn);\n var sin_Ce = Math.sin(Ce);\n var cos_Ce = Math.cos(Ce);\n\n Cn = Math.atan2(sin_Cn, cos_Ce * cos_Cn);\n Ce = Math.atan2(sin_Ce * cos_Cn, Object(_common_hypot__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(sin_Cn, cos_Cn * cos_Ce));\n Ce = Object(_common_asinhy__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(Math.tan(Ce));\n\n var tmp = Object(_common_clens_cmplx__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.gtu, 2 * Cn, 2 * Ce);\n\n Cn = Cn + tmp[0];\n Ce = Ce + tmp[1];\n\n var x;\n var y;\n\n if (Math.abs(Ce) <= 2.623395162778) {\n x = this.a * (this.Qn * Ce) + this.x0;\n y = this.a * (this.Qn * Cn + this.Zb) + this.y0;\n }\n else {\n x = Infinity;\n y = Infinity;\n }\n\n p.x = x;\n p.y = y;\n\n return p;\n}\n\nfunction inverse(p) {\n var Ce = (p.x - this.x0) * (1 / this.a);\n var Cn = (p.y - this.y0) * (1 / this.a);\n\n Cn = (Cn - this.Zb) / this.Qn;\n Ce = Ce / this.Qn;\n\n var lon;\n var lat;\n\n if (Math.abs(Ce) <= 2.623395162778) {\n var tmp = Object(_common_clens_cmplx__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.utg, 2 * Cn, 2 * Ce);\n\n Cn = Cn + tmp[0];\n Ce = Ce + tmp[1];\n Ce = Math.atan(Object(_common_sinh__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Ce));\n\n var sin_Cn = Math.sin(Cn);\n var cos_Cn = Math.cos(Cn);\n var sin_Ce = Math.sin(Ce);\n var cos_Ce = Math.cos(Ce);\n\n Cn = Math.atan2(sin_Cn * cos_Ce, Object(_common_hypot__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(sin_Ce, cos_Ce * cos_Cn));\n Ce = Math.atan2(sin_Ce, cos_Ce * cos_Cn);\n\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(Ce + this.long0);\n lat = Object(_common_gatg__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.cgb, Cn);\n }\n else {\n lon = Infinity;\n lat = Infinity;\n }\n\n p.x = lon;\n p.y = lat;\n\n return p;\n}\n\nvar names = [\"Extended_Transverse_Mercator\", \"Extended Transverse Mercator\", \"etmerc\", \"Transverse_Mercator\", \"Transverse Mercator\", \"tmerc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/etmerc.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/gauss.js": +/*!*****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/gauss.js ***! + \*****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_srat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/srat */ \"./node_modules/proj4/lib/common/srat.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\nvar MAX_ITER = 20;\n\n\nfunction init() {\n var sphi = Math.sin(this.lat0);\n var cphi = Math.cos(this.lat0);\n cphi *= cphi;\n this.rc = Math.sqrt(1 - this.es) / (1 - this.es * sphi * sphi);\n this.C = Math.sqrt(1 + this.es * cphi * cphi / (1 - this.es));\n this.phic0 = Math.asin(sphi / this.C);\n this.ratexp = 0.5 * this.C * this.e;\n this.K = Math.tan(0.5 * this.phic0 + _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"FORTPI\"]) / (Math.pow(Math.tan(0.5 * this.lat0 + _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"FORTPI\"]), this.C) * Object(_common_srat__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e * sphi, this.ratexp));\n}\n\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n\n p.y = 2 * Math.atan(this.K * Math.pow(Math.tan(0.5 * lat + _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"FORTPI\"]), this.C) * Object(_common_srat__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e * Math.sin(lat), this.ratexp)) - _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"];\n p.x = this.C * lon;\n return p;\n}\n\nfunction inverse(p) {\n var DEL_TOL = 1e-14;\n var lon = p.x / this.C;\n var lat = p.y;\n var num = Math.pow(Math.tan(0.5 * lat + _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"FORTPI\"]) / this.K, 1 / this.C);\n for (var i = MAX_ITER; i > 0; --i) {\n lat = 2 * Math.atan(num * Object(_common_srat__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e * Math.sin(p.y), - 0.5 * this.e)) - _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"];\n if (Math.abs(lat - p.y) < DEL_TOL) {\n break;\n }\n p.y = lat;\n }\n /* convergence failed */\n if (!i) {\n return null;\n }\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"gauss\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/gauss.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/geocent.js": +/*!*******************************************************!*\ + !*** ./node_modules/proj4/lib/projections/geocent.js ***! + \*******************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _datumUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../datumUtils */ \"./node_modules/proj4/lib/datumUtils.js\");\n\n\nfunction init() {\n this.name = 'geocent';\n\n}\n\nfunction forward(p) {\n var point = Object(_datumUtils__WEBPACK_IMPORTED_MODULE_0__[\"geodeticToGeocentric\"])(p, this.es, this.a);\n return point;\n}\n\nfunction inverse(p) {\n var point = Object(_datumUtils__WEBPACK_IMPORTED_MODULE_0__[\"geocentricToGeodetic\"])(p, this.es, this.a, this.b);\n return point;\n}\n\nvar names = [\"Geocentric\", 'geocentric', \"geocent\", \"Geocent\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/geocent.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/gnom.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/gnom.js ***! + \****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_asinz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/asinz */ \"./node_modules/proj4/lib/common/asinz.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n/*\n reference:\n Wolfram Mathworld \"Gnomonic Projection\"\n http://mathworld.wolfram.com/GnomonicProjection.html\n Accessed: 12th November 2009\n */\nfunction init() {\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n this.sin_p14 = Math.sin(this.lat0);\n this.cos_p14 = Math.cos(this.lat0);\n // Approximation for projecting points to the horizon (infinity)\n this.infinity_dist = 1000 * this.a;\n this.rc = 1;\n}\n\n/* Gnomonic forward equations--mapping lat,long to x,y\n ---------------------------------------------------*/\nfunction forward(p) {\n var sinphi, cosphi; /* sin and cos value */\n var dlon; /* delta longitude value */\n var coslon; /* cos of longitude */\n var ksp; /* scale factor */\n var g;\n var x, y;\n var lon = p.x;\n var lat = p.y;\n /* Forward equations\n -----------------*/\n dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n\n sinphi = Math.sin(lat);\n cosphi = Math.cos(lat);\n\n coslon = Math.cos(dlon);\n g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon;\n ksp = 1;\n if ((g > 0) || (Math.abs(g) <= _constants_values__WEBPACK_IMPORTED_MODULE_2__[\"EPSLN\"])) {\n x = this.x0 + this.a * ksp * cosphi * Math.sin(dlon) / g;\n y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon) / g;\n }\n else {\n\n // Point is in the opposing hemisphere and is unprojectable\n // We still need to return a reasonable point, so we project\n // to infinity, on a bearing\n // equivalent to the northern hemisphere equivalent\n // This is a reasonable approximation for short shapes and lines that\n // straddle the horizon.\n\n x = this.x0 + this.infinity_dist * cosphi * Math.sin(dlon);\n y = this.y0 + this.infinity_dist * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);\n\n }\n p.x = x;\n p.y = y;\n return p;\n}\n\nfunction inverse(p) {\n var rh; /* Rho */\n var sinc, cosc;\n var c;\n var lon, lat;\n\n /* Inverse equations\n -----------------*/\n p.x = (p.x - this.x0) / this.a;\n p.y = (p.y - this.y0) / this.a;\n\n p.x /= this.k0;\n p.y /= this.k0;\n\n if ((rh = Math.sqrt(p.x * p.x + p.y * p.y))) {\n c = Math.atan2(rh, this.rc);\n sinc = Math.sin(c);\n cosc = Math.cos(c);\n\n lat = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(cosc * this.sin_p14 + (p.y * sinc * this.cos_p14) / rh);\n lon = Math.atan2(p.x * sinc, rh * this.cos_p14 * cosc - p.y * this.sin_p14 * sinc);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + lon);\n }\n else {\n lat = this.phic0;\n lon = 0;\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"gnom\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/gnom.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/krovak.js": +/*!******************************************************!*\ + !*** ./node_modules/proj4/lib/projections/krovak.js ***! + \******************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\nfunction init() {\n this.a = 6377397.155;\n this.es = 0.006674372230614;\n this.e = Math.sqrt(this.es);\n if (!this.lat0) {\n this.lat0 = 0.863937979737193;\n }\n if (!this.long0) {\n this.long0 = 0.7417649320975901 - 0.308341501185665;\n }\n /* if scale not set default to 0.9999 */\n if (!this.k0) {\n this.k0 = 0.9999;\n }\n this.s45 = 0.785398163397448; /* 45 */\n this.s90 = 2 * this.s45;\n this.fi0 = this.lat0;\n this.e2 = this.es;\n this.e = Math.sqrt(this.e2);\n this.alfa = Math.sqrt(1 + (this.e2 * Math.pow(Math.cos(this.fi0), 4)) / (1 - this.e2));\n this.uq = 1.04216856380474;\n this.u0 = Math.asin(Math.sin(this.fi0) / this.alfa);\n this.g = Math.pow((1 + this.e * Math.sin(this.fi0)) / (1 - this.e * Math.sin(this.fi0)), this.alfa * this.e / 2);\n this.k = Math.tan(this.u0 / 2 + this.s45) / Math.pow(Math.tan(this.fi0 / 2 + this.s45), this.alfa) * this.g;\n this.k1 = this.k0;\n this.n0 = this.a * Math.sqrt(1 - this.e2) / (1 - this.e2 * Math.pow(Math.sin(this.fi0), 2));\n this.s0 = 1.37008346281555;\n this.n = Math.sin(this.s0);\n this.ro0 = this.k1 * this.n0 / Math.tan(this.s0);\n this.ad = this.s90 - this.uq;\n}\n\n/* ellipsoid */\n/* calculate xy from lat/lon */\n/* Constants, identical to inverse transform function */\nfunction forward(p) {\n var gfi, u, deltav, s, d, eps, ro;\n var lon = p.x;\n var lat = p.y;\n var delta_lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n /* Transformation */\n gfi = Math.pow(((1 + this.e * Math.sin(lat)) / (1 - this.e * Math.sin(lat))), (this.alfa * this.e / 2));\n u = 2 * (Math.atan(this.k * Math.pow(Math.tan(lat / 2 + this.s45), this.alfa) / gfi) - this.s45);\n deltav = -delta_lon * this.alfa;\n s = Math.asin(Math.cos(this.ad) * Math.sin(u) + Math.sin(this.ad) * Math.cos(u) * Math.cos(deltav));\n d = Math.asin(Math.cos(u) * Math.sin(deltav) / Math.cos(s));\n eps = this.n * d;\n ro = this.ro0 * Math.pow(Math.tan(this.s0 / 2 + this.s45), this.n) / Math.pow(Math.tan(s / 2 + this.s45), this.n);\n p.y = ro * Math.cos(eps) / 1;\n p.x = ro * Math.sin(eps) / 1;\n\n if (!this.czech) {\n p.y *= -1;\n p.x *= -1;\n }\n return (p);\n}\n\n/* calculate lat/lon from xy */\nfunction inverse(p) {\n var u, deltav, s, d, eps, ro, fi1;\n var ok;\n\n /* Transformation */\n /* revert y, x*/\n var tmp = p.x;\n p.x = p.y;\n p.y = tmp;\n if (!this.czech) {\n p.y *= -1;\n p.x *= -1;\n }\n ro = Math.sqrt(p.x * p.x + p.y * p.y);\n eps = Math.atan2(p.y, p.x);\n d = eps / Math.sin(this.s0);\n s = 2 * (Math.atan(Math.pow(this.ro0 / ro, 1 / this.n) * Math.tan(this.s0 / 2 + this.s45)) - this.s45);\n u = Math.asin(Math.cos(this.ad) * Math.sin(s) - Math.sin(this.ad) * Math.cos(s) * Math.cos(d));\n deltav = Math.asin(Math.cos(s) * Math.sin(d) / Math.cos(u));\n p.x = this.long0 - deltav / this.alfa;\n fi1 = u;\n ok = 0;\n var iter = 0;\n do {\n p.y = 2 * (Math.atan(Math.pow(this.k, - 1 / this.alfa) * Math.pow(Math.tan(u / 2 + this.s45), 1 / this.alfa) * Math.pow((1 + this.e * Math.sin(fi1)) / (1 - this.e * Math.sin(fi1)), this.e / 2)) - this.s45);\n if (Math.abs(fi1 - p.y) < 0.0000000001) {\n ok = 1;\n }\n fi1 = p.y;\n iter += 1;\n } while (ok === 0 && iter < 15);\n if (iter >= 15) {\n return null;\n }\n\n return (p);\n}\n\nvar names = [\"Krovak\", \"krovak\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/krovak.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/laea.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/laea.js ***! + \****************************************************/ +/*! exports provided: S_POLE, N_POLE, EQUIT, OBLIQ, init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"S_POLE\", function() { return S_POLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"N_POLE\", function() { return N_POLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EQUIT\", function() { return EQUIT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"OBLIQ\", function() { return OBLIQ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_qsfnz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/qsfnz */ \"./node_modules/proj4/lib/common/qsfnz.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\n\n\n\n\n/*\n reference\n \"New Equal-Area Map Projections for Noncircular Regions\", John P. Snyder,\n The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.\n */\n\nvar S_POLE = 1;\n\nvar N_POLE = 2;\nvar EQUIT = 3;\nvar OBLIQ = 4;\n\n/* Initialize the Lambert Azimuthal Equal Area projection\n ------------------------------------------------------*/\nfunction init() {\n var t = Math.abs(this.lat0);\n if (Math.abs(t - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.mode = this.lat0 < 0 ? this.S_POLE : this.N_POLE;\n }\n else if (Math.abs(t) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.mode = this.EQUIT;\n }\n else {\n this.mode = this.OBLIQ;\n }\n if (this.es > 0) {\n var sinphi;\n\n this.qp = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, 1);\n this.mmf = 0.5 / (1 - this.es);\n this.apa = authset(this.es);\n switch (this.mode) {\n case this.N_POLE:\n this.dd = 1;\n break;\n case this.S_POLE:\n this.dd = 1;\n break;\n case this.EQUIT:\n this.rq = Math.sqrt(0.5 * this.qp);\n this.dd = 1 / this.rq;\n this.xmf = 1;\n this.ymf = 0.5 * this.qp;\n break;\n case this.OBLIQ:\n this.rq = Math.sqrt(0.5 * this.qp);\n sinphi = Math.sin(this.lat0);\n this.sinb1 = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, sinphi) / this.qp;\n this.cosb1 = Math.sqrt(1 - this.sinb1 * this.sinb1);\n this.dd = Math.cos(this.lat0) / (Math.sqrt(1 - this.es * sinphi * sinphi) * this.rq * this.cosb1);\n this.ymf = (this.xmf = this.rq) / this.dd;\n this.xmf *= this.dd;\n break;\n }\n }\n else {\n if (this.mode === this.OBLIQ) {\n this.sinph0 = Math.sin(this.lat0);\n this.cosph0 = Math.cos(this.lat0);\n }\n }\n}\n\n/* Lambert Azimuthal Equal Area forward equations--mapping lat,long to x,y\n -----------------------------------------------------------------------*/\nfunction forward(p) {\n\n /* Forward equations\n -----------------*/\n var x, y, coslam, sinlam, sinphi, q, sinb, cosb, b, cosphi;\n var lam = p.x;\n var phi = p.y;\n\n lam = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(lam - this.long0);\n if (this.sphere) {\n sinphi = Math.sin(phi);\n cosphi = Math.cos(phi);\n coslam = Math.cos(lam);\n if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {\n y = (this.mode === this.EQUIT) ? 1 + cosphi * coslam : 1 + this.sinph0 * sinphi + this.cosph0 * cosphi * coslam;\n if (y <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n return null;\n }\n y = Math.sqrt(2 / y);\n x = y * cosphi * Math.sin(lam);\n y *= (this.mode === this.EQUIT) ? sinphi : this.cosph0 * sinphi - this.sinph0 * cosphi * coslam;\n }\n else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {\n if (this.mode === this.N_POLE) {\n coslam = -coslam;\n }\n if (Math.abs(phi + this.lat0) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n return null;\n }\n y = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] - phi * 0.5;\n y = 2 * ((this.mode === this.S_POLE) ? Math.cos(y) : Math.sin(y));\n x = y * Math.sin(lam);\n y *= coslam;\n }\n }\n else {\n sinb = 0;\n cosb = 0;\n b = 0;\n coslam = Math.cos(lam);\n sinlam = Math.sin(lam);\n sinphi = Math.sin(phi);\n q = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, sinphi);\n if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {\n sinb = q / this.qp;\n cosb = Math.sqrt(1 - sinb * sinb);\n }\n switch (this.mode) {\n case this.OBLIQ:\n b = 1 + this.sinb1 * sinb + this.cosb1 * cosb * coslam;\n break;\n case this.EQUIT:\n b = 1 + cosb * coslam;\n break;\n case this.N_POLE:\n b = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + phi;\n q = this.qp - q;\n break;\n case this.S_POLE:\n b = phi - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n q = this.qp + q;\n break;\n }\n if (Math.abs(b) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n return null;\n }\n switch (this.mode) {\n case this.OBLIQ:\n case this.EQUIT:\n b = Math.sqrt(2 / b);\n if (this.mode === this.OBLIQ) {\n y = this.ymf * b * (this.cosb1 * sinb - this.sinb1 * cosb * coslam);\n }\n else {\n y = (b = Math.sqrt(2 / (1 + cosb * coslam))) * sinb * this.ymf;\n }\n x = this.xmf * b * cosb * sinlam;\n break;\n case this.N_POLE:\n case this.S_POLE:\n if (q >= 0) {\n x = (b = Math.sqrt(q)) * sinlam;\n y = coslam * ((this.mode === this.S_POLE) ? b : -b);\n }\n else {\n x = y = 0;\n }\n break;\n }\n }\n\n p.x = this.a * x + this.x0;\n p.y = this.a * y + this.y0;\n return p;\n}\n\n/* Inverse equations\n -----------------*/\nfunction inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var x = p.x / this.a;\n var y = p.y / this.a;\n var lam, phi, cCe, sCe, q, rho, ab;\n if (this.sphere) {\n var cosz = 0,\n rh, sinz = 0;\n\n rh = Math.sqrt(x * x + y * y);\n phi = rh * 0.5;\n if (phi > 1) {\n return null;\n }\n phi = 2 * Math.asin(phi);\n if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {\n sinz = Math.sin(phi);\n cosz = Math.cos(phi);\n }\n switch (this.mode) {\n case this.EQUIT:\n phi = (Math.abs(rh) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) ? 0 : Math.asin(y * sinz / rh);\n x *= sinz;\n y = cosz * rh;\n break;\n case this.OBLIQ:\n phi = (Math.abs(rh) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) ? this.lat0 : Math.asin(cosz * this.sinph0 + y * sinz * this.cosph0 / rh);\n x *= sinz * this.cosph0;\n y = (cosz - Math.sin(phi) * this.sinph0) * rh;\n break;\n case this.N_POLE:\n y = -y;\n phi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - phi;\n break;\n case this.S_POLE:\n phi -= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n break;\n }\n lam = (y === 0 && (this.mode === this.EQUIT || this.mode === this.OBLIQ)) ? 0 : Math.atan2(x, y);\n }\n else {\n ab = 0;\n if (this.mode === this.OBLIQ || this.mode === this.EQUIT) {\n x /= this.dd;\n y *= this.dd;\n rho = Math.sqrt(x * x + y * y);\n if (rho < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n p.x = this.long0;\n p.y = this.lat0;\n return p;\n }\n sCe = 2 * Math.asin(0.5 * rho / this.rq);\n cCe = Math.cos(sCe);\n x *= (sCe = Math.sin(sCe));\n if (this.mode === this.OBLIQ) {\n ab = cCe * this.sinb1 + y * sCe * this.cosb1 / rho;\n q = this.qp * ab;\n y = rho * this.cosb1 * cCe - y * this.sinb1 * sCe;\n }\n else {\n ab = y * sCe / rho;\n q = this.qp * ab;\n y = rho * cCe;\n }\n }\n else if (this.mode === this.N_POLE || this.mode === this.S_POLE) {\n if (this.mode === this.N_POLE) {\n y = -y;\n }\n q = (x * x + y * y);\n if (!q) {\n p.x = this.long0;\n p.y = this.lat0;\n return p;\n }\n ab = 1 - q / this.qp;\n if (this.mode === this.S_POLE) {\n ab = -ab;\n }\n }\n lam = Math.atan2(x, y);\n phi = authlat(Math.asin(ab), this.apa);\n }\n\n p.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.long0 + lam);\n p.y = phi;\n return p;\n}\n\n/* determine latitude from authalic latitude */\nvar P00 = 0.33333333333333333333;\n\nvar P01 = 0.17222222222222222222;\nvar P02 = 0.10257936507936507936;\nvar P10 = 0.06388888888888888888;\nvar P11 = 0.06640211640211640211;\nvar P20 = 0.01641501294219154443;\n\nfunction authset(es) {\n var t;\n var APA = [];\n APA[0] = es * P00;\n t = es * es;\n APA[0] += t * P01;\n APA[1] = t * P10;\n t *= es;\n APA[0] += t * P02;\n APA[1] += t * P11;\n APA[2] = t * P20;\n return APA;\n}\n\nfunction authlat(beta, APA) {\n var t = beta + beta;\n return (beta + APA[0] * Math.sin(t) + APA[1] * Math.sin(t + t) + APA[2] * Math.sin(t + t + t));\n}\n\nvar names = [\"Lambert Azimuthal Equal Area\", \"Lambert_Azimuthal_Equal_Area\", \"laea\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names,\n S_POLE: S_POLE,\n N_POLE: N_POLE,\n EQUIT: EQUIT,\n OBLIQ: OBLIQ\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/laea.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/lcc.js": +/*!***************************************************!*\ + !*** ./node_modules/proj4/lib/projections/lcc.js ***! + \***************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_msfnz__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/msfnz */ \"./node_modules/proj4/lib/common/msfnz.js\");\n/* harmony import */ var _common_tsfnz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/tsfnz */ \"./node_modules/proj4/lib/common/tsfnz.js\");\n/* harmony import */ var _common_sign__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/sign */ \"./node_modules/proj4/lib/common/sign.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_phi2z__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/phi2z */ \"./node_modules/proj4/lib/common/phi2z.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n\n\nfunction init() {\n\n // array of: r_maj,r_min,lat1,lat2,c_lon,c_lat,false_east,false_north\n //double c_lat; /* center latitude */\n //double c_lon; /* center longitude */\n //double lat1; /* first standard parallel */\n //double lat2; /* second standard parallel */\n //double r_maj; /* major axis */\n //double r_min; /* minor axis */\n //double false_east; /* x offset in meters */\n //double false_north; /* y offset in meters */\n\n if (!this.lat2) {\n this.lat2 = this.lat1;\n } //if lat2 is not defined\n if (!this.k0) {\n this.k0 = 1;\n }\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n // Standard Parallels cannot be equal and on opposite sides of the equator\n if (Math.abs(this.lat1 + this.lat2) < _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]) {\n return;\n }\n\n var temp = this.b / this.a;\n this.e = Math.sqrt(1 - temp * temp);\n\n var sin1 = Math.sin(this.lat1);\n var cos1 = Math.cos(this.lat1);\n var ms1 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, sin1, cos1);\n var ts1 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, this.lat1, sin1);\n\n var sin2 = Math.sin(this.lat2);\n var cos2 = Math.cos(this.lat2);\n var ms2 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, sin2, cos2);\n var ts2 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, this.lat2, sin2);\n\n var ts0 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, this.lat0, Math.sin(this.lat0));\n\n if (Math.abs(this.lat1 - this.lat2) > _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]) {\n this.ns = Math.log(ms1 / ms2) / Math.log(ts1 / ts2);\n }\n else {\n this.ns = sin1;\n }\n if (isNaN(this.ns)) {\n this.ns = sin1;\n }\n this.f0 = ms1 / (this.ns * Math.pow(ts1, this.ns));\n this.rh = this.a * this.f0 * Math.pow(ts0, this.ns);\n if (!this.title) {\n this.title = \"Lambert Conformal Conic\";\n }\n}\n\n// Lambert Conformal conic forward equations--mapping lat,long to x,y\n// -----------------------------------------------------------------\nfunction forward(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n // singular cases :\n if (Math.abs(2 * Math.abs(lat) - Math.PI) <= _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]) {\n lat = Object(_common_sign__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(lat) * (_constants_values__WEBPACK_IMPORTED_MODULE_5__[\"HALF_PI\"] - 2 * _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]);\n }\n\n var con = Math.abs(Math.abs(lat) - _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"HALF_PI\"]);\n var ts, rh1;\n if (con > _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]) {\n ts = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, lat, Math.sin(lat));\n rh1 = this.a * this.f0 * Math.pow(ts, this.ns);\n }\n else {\n con = lat * this.ns;\n if (con <= 0) {\n return null;\n }\n rh1 = 0;\n }\n var theta = this.ns * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(lon - this.long0);\n p.x = this.k0 * (rh1 * Math.sin(theta)) + this.x0;\n p.y = this.k0 * (this.rh - rh1 * Math.cos(theta)) + this.y0;\n\n return p;\n}\n\n// Lambert Conformal Conic inverse equations--mapping x,y to lat/long\n// -----------------------------------------------------------------\nfunction inverse(p) {\n\n var rh1, con, ts;\n var lat, lon;\n var x = (p.x - this.x0) / this.k0;\n var y = (this.rh - (p.y - this.y0) / this.k0);\n if (this.ns > 0) {\n rh1 = Math.sqrt(x * x + y * y);\n con = 1;\n }\n else {\n rh1 = -Math.sqrt(x * x + y * y);\n con = -1;\n }\n var theta = 0;\n if (rh1 !== 0) {\n theta = Math.atan2((con * x), (con * y));\n }\n if ((rh1 !== 0) || (this.ns > 0)) {\n con = 1 / this.ns;\n ts = Math.pow((rh1 / (this.a * this.f0)), con);\n lat = Object(_common_phi2z__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.e, ts);\n if (lat === -9999) {\n return null;\n }\n }\n else {\n lat = -_constants_values__WEBPACK_IMPORTED_MODULE_5__[\"HALF_PI\"];\n }\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(theta / this.ns + this.long0);\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Lambert Tangential Conformal Conic Projection\", \"Lambert_Conformal_Conic\", \"Lambert_Conformal_Conic_2SP\", \"lcc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/lcc.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/longlat.js": +/*!*******************************************************!*\ + !*** ./node_modules/proj4/lib/projections/longlat.js ***! + \*******************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\nfunction init() {\n //no-op for longlat\n}\n\nfunction identity(pt) {\n return pt;\n}\n\n\nvar names = [\"longlat\", \"identity\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: identity,\n inverse: identity,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/longlat.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/merc.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/merc.js ***! + \****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_msfnz__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/msfnz */ \"./node_modules/proj4/lib/common/msfnz.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_tsfnz__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/tsfnz */ \"./node_modules/proj4/lib/common/tsfnz.js\");\n/* harmony import */ var _common_phi2z__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/phi2z */ \"./node_modules/proj4/lib/common/phi2z.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n\n\nfunction init() {\n var con = this.b / this.a;\n this.es = 1 - con * con;\n if(!('x0' in this)){\n this.x0 = 0;\n }\n if(!('y0' in this)){\n this.y0 = 0;\n }\n this.e = Math.sqrt(this.es);\n if (this.lat_ts) {\n if (this.sphere) {\n this.k0 = Math.cos(this.lat_ts);\n }\n else {\n this.k0 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));\n }\n }\n else {\n if (!this.k0) {\n if (this.k) {\n this.k0 = this.k;\n }\n else {\n this.k0 = 1;\n }\n }\n }\n}\n\n/* Mercator forward equations--mapping lat,long to x,y\n --------------------------------------------------*/\n\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n // convert to radians\n if (lat * _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"R2D\"] > 90 && lat * _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"R2D\"] < -90 && lon * _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"R2D\"] > 180 && lon * _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"R2D\"] < -180) {\n return null;\n }\n\n var x, y;\n if (Math.abs(Math.abs(lat) - _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"HALF_PI\"]) <= _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n return null;\n }\n else {\n if (this.sphere) {\n x = this.x0 + this.a * this.k0 * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lon - this.long0);\n y = this.y0 + this.a * this.k0 * Math.log(Math.tan(_constants_values__WEBPACK_IMPORTED_MODULE_4__[\"FORTPI\"] + 0.5 * lat));\n }\n else {\n var sinphi = Math.sin(lat);\n var ts = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.e, lat, sinphi);\n x = this.x0 + this.a * this.k0 * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lon - this.long0);\n y = this.y0 - this.a * this.k0 * Math.log(ts);\n }\n p.x = x;\n p.y = y;\n return p;\n }\n}\n\n/* Mercator inverse equations--mapping x,y to lat/long\n --------------------------------------------------*/\nfunction inverse(p) {\n\n var x = p.x - this.x0;\n var y = p.y - this.y0;\n var lon, lat;\n\n if (this.sphere) {\n lat = _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"HALF_PI\"] - 2 * Math.atan(Math.exp(-y / (this.a * this.k0)));\n }\n else {\n var ts = Math.exp(-y / (this.a * this.k0));\n lat = Object(_common_phi2z__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.e, ts);\n if (lat === -9999) {\n return null;\n }\n }\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.long0 + x / (this.a * this.k0));\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Mercator\", \"Popular Visualisation Pseudo Mercator\", \"Mercator_1SP\", \"Mercator_Auxiliary_Sphere\", \"merc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/merc.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/mill.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/mill.js ***! + \****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\n/*\n reference\n \"New Equal-Area Map Projections for Noncircular Regions\", John P. Snyder,\n The American Cartographer, Vol 15, No. 4, October 1988, pp. 341-355.\n */\n\n\n/* Initialize the Miller Cylindrical projection\n -------------------------------------------*/\nfunction init() {\n //no-op\n}\n\n/* Miller Cylindrical forward equations--mapping lat,long to x,y\n ------------------------------------------------------------*/\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n /* Forward equations\n -----------------*/\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n var x = this.x0 + this.a * dlon;\n var y = this.y0 + this.a * Math.log(Math.tan((Math.PI / 4) + (lat / 2.5))) * 1.25;\n\n p.x = x;\n p.y = y;\n return p;\n}\n\n/* Miller Cylindrical inverse equations--mapping x,y to lat/long\n ------------------------------------------------------------*/\nfunction inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n\n var lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + p.x / this.a);\n var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4);\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Miller_Cylindrical\", \"mill\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/mill.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/moll.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/moll.js ***! + \****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\nfunction init() {}\n\n/* Mollweide forward equations--mapping lat,long to x,y\n ----------------------------------------------------*/\nfunction forward(p) {\n\n /* Forward equations\n -----------------*/\n var lon = p.x;\n var lat = p.y;\n\n var delta_lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n var theta = lat;\n var con = Math.PI * Math.sin(lat);\n\n /* Iterate using the Newton-Raphson method to find theta\n -----------------------------------------------------*/\n while (true) {\n var delta_theta = -(theta + Math.sin(theta) - con) / (1 + Math.cos(theta));\n theta += delta_theta;\n if (Math.abs(delta_theta) < _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n break;\n }\n }\n theta /= 2;\n\n /* If the latitude is 90 deg, force the x coordinate to be \"0 + false easting\"\n this is done here because of precision problems with \"cos(theta)\"\n --------------------------------------------------------------------------*/\n if (Math.PI / 2 - Math.abs(lat) < _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n delta_lon = 0;\n }\n var x = 0.900316316158 * this.a * delta_lon * Math.cos(theta) + this.x0;\n var y = 1.4142135623731 * this.a * Math.sin(theta) + this.y0;\n\n p.x = x;\n p.y = y;\n return p;\n}\n\nfunction inverse(p) {\n var theta;\n var arg;\n\n /* Inverse equations\n -----------------*/\n p.x -= this.x0;\n p.y -= this.y0;\n arg = p.y / (1.4142135623731 * this.a);\n\n /* Because of division by zero problems, 'arg' can not be 1. Therefore\n a number very close to one is used instead.\n -------------------------------------------------------------------*/\n if (Math.abs(arg) > 0.999999999999) {\n arg = 0.999999999999;\n }\n theta = Math.asin(arg);\n var lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + (p.x / (0.900316316158 * this.a * Math.cos(theta))));\n if (lon < (-Math.PI)) {\n lon = -Math.PI;\n }\n if (lon > Math.PI) {\n lon = Math.PI;\n }\n arg = (2 * theta + Math.sin(2 * theta)) / Math.PI;\n if (Math.abs(arg) > 1) {\n arg = 1;\n }\n var lat = Math.asin(arg);\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Mollweide\", \"moll\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/moll.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/nzmg.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/nzmg.js ***! + \****************************************************/ +/*! exports provided: iterations, init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"iterations\", function() { return iterations; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n/*\n reference\n Department of Land and Survey Technical Circular 1973/32\n http://www.linz.govt.nz/docs/miscellaneous/nz-map-definition.pdf\n OSG Technical Report 4.1\n http://www.linz.govt.nz/docs/miscellaneous/nzmg.pdf\n */\n\n/**\n * iterations: Number of iterations to refine inverse transform.\n * 0 -> km accuracy\n * 1 -> m accuracy -- suitable for most mapping applications\n * 2 -> mm accuracy\n */\nvar iterations = 1;\n\nfunction init() {\n this.A = [];\n this.A[1] = 0.6399175073;\n this.A[2] = -0.1358797613;\n this.A[3] = 0.063294409;\n this.A[4] = -0.02526853;\n this.A[5] = 0.0117879;\n this.A[6] = -0.0055161;\n this.A[7] = 0.0026906;\n this.A[8] = -0.001333;\n this.A[9] = 0.00067;\n this.A[10] = -0.00034;\n\n this.B_re = [];\n this.B_im = [];\n this.B_re[1] = 0.7557853228;\n this.B_im[1] = 0;\n this.B_re[2] = 0.249204646;\n this.B_im[2] = 0.003371507;\n this.B_re[3] = -0.001541739;\n this.B_im[3] = 0.041058560;\n this.B_re[4] = -0.10162907;\n this.B_im[4] = 0.01727609;\n this.B_re[5] = -0.26623489;\n this.B_im[5] = -0.36249218;\n this.B_re[6] = -0.6870983;\n this.B_im[6] = -1.1651967;\n\n this.C_re = [];\n this.C_im = [];\n this.C_re[1] = 1.3231270439;\n this.C_im[1] = 0;\n this.C_re[2] = -0.577245789;\n this.C_im[2] = -0.007809598;\n this.C_re[3] = 0.508307513;\n this.C_im[3] = -0.112208952;\n this.C_re[4] = -0.15094762;\n this.C_im[4] = 0.18200602;\n this.C_re[5] = 1.01418179;\n this.C_im[5] = 1.64497696;\n this.C_re[6] = 1.9660549;\n this.C_im[6] = 2.5127645;\n\n this.D = [];\n this.D[1] = 1.5627014243;\n this.D[2] = 0.5185406398;\n this.D[3] = -0.03333098;\n this.D[4] = -0.1052906;\n this.D[5] = -0.0368594;\n this.D[6] = 0.007317;\n this.D[7] = 0.01220;\n this.D[8] = 0.00394;\n this.D[9] = -0.0013;\n}\n\n/**\n New Zealand Map Grid Forward - long/lat to x/y\n long/lat in radians\n */\nfunction forward(p) {\n var n;\n var lon = p.x;\n var lat = p.y;\n\n var delta_lat = lat - this.lat0;\n var delta_lon = lon - this.long0;\n\n // 1. Calculate d_phi and d_psi ... // and d_lambda\n // For this algorithm, delta_latitude is in seconds of arc x 10-5, so we need to scale to those units. Longitude is radians.\n var d_phi = delta_lat / _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SEC_TO_RAD\"] * 1E-5;\n var d_lambda = delta_lon;\n var d_phi_n = 1; // d_phi^0\n\n var d_psi = 0;\n for (n = 1; n <= 10; n++) {\n d_phi_n = d_phi_n * d_phi;\n d_psi = d_psi + this.A[n] * d_phi_n;\n }\n\n // 2. Calculate theta\n var th_re = d_psi;\n var th_im = d_lambda;\n\n // 3. Calculate z\n var th_n_re = 1;\n var th_n_im = 0; // theta^0\n var th_n_re1;\n var th_n_im1;\n\n var z_re = 0;\n var z_im = 0;\n for (n = 1; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n z_re = z_re + this.B_re[n] * th_n_re - this.B_im[n] * th_n_im;\n z_im = z_im + this.B_im[n] * th_n_re + this.B_re[n] * th_n_im;\n }\n\n // 4. Calculate easting and northing\n p.x = (z_im * this.a) + this.x0;\n p.y = (z_re * this.a) + this.y0;\n\n return p;\n}\n\n/**\n New Zealand Map Grid Inverse - x/y to long/lat\n */\nfunction inverse(p) {\n var n;\n var x = p.x;\n var y = p.y;\n\n var delta_x = x - this.x0;\n var delta_y = y - this.y0;\n\n // 1. Calculate z\n var z_re = delta_y / this.a;\n var z_im = delta_x / this.a;\n\n // 2a. Calculate theta - first approximation gives km accuracy\n var z_n_re = 1;\n var z_n_im = 0; // z^0\n var z_n_re1;\n var z_n_im1;\n\n var th_re = 0;\n var th_im = 0;\n for (n = 1; n <= 6; n++) {\n z_n_re1 = z_n_re * z_re - z_n_im * z_im;\n z_n_im1 = z_n_im * z_re + z_n_re * z_im;\n z_n_re = z_n_re1;\n z_n_im = z_n_im1;\n th_re = th_re + this.C_re[n] * z_n_re - this.C_im[n] * z_n_im;\n th_im = th_im + this.C_im[n] * z_n_re + this.C_re[n] * z_n_im;\n }\n\n // 2b. Iterate to refine the accuracy of the calculation\n // 0 iterations gives km accuracy\n // 1 iteration gives m accuracy -- good enough for most mapping applications\n // 2 iterations bives mm accuracy\n for (var i = 0; i < this.iterations; i++) {\n var th_n_re = th_re;\n var th_n_im = th_im;\n var th_n_re1;\n var th_n_im1;\n\n var num_re = z_re;\n var num_im = z_im;\n for (n = 2; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n num_re = num_re + (n - 1) * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);\n num_im = num_im + (n - 1) * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);\n }\n\n th_n_re = 1;\n th_n_im = 0;\n var den_re = this.B_re[1];\n var den_im = this.B_im[1];\n for (n = 2; n <= 6; n++) {\n th_n_re1 = th_n_re * th_re - th_n_im * th_im;\n th_n_im1 = th_n_im * th_re + th_n_re * th_im;\n th_n_re = th_n_re1;\n th_n_im = th_n_im1;\n den_re = den_re + n * (this.B_re[n] * th_n_re - this.B_im[n] * th_n_im);\n den_im = den_im + n * (this.B_im[n] * th_n_re + this.B_re[n] * th_n_im);\n }\n\n // Complex division\n var den2 = den_re * den_re + den_im * den_im;\n th_re = (num_re * den_re + num_im * den_im) / den2;\n th_im = (num_im * den_re - num_re * den_im) / den2;\n }\n\n // 3. Calculate d_phi ... // and d_lambda\n var d_psi = th_re;\n var d_lambda = th_im;\n var d_psi_n = 1; // d_psi^0\n\n var d_phi = 0;\n for (n = 1; n <= 9; n++) {\n d_psi_n = d_psi_n * d_psi;\n d_phi = d_phi + this.D[n] * d_psi_n;\n }\n\n // 4. Calculate latitude and longitude\n // d_phi is calcuated in second of arc * 10^-5, so we need to scale back to radians. d_lambda is in radians.\n var lat = this.lat0 + (d_phi * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SEC_TO_RAD\"] * 1E5);\n var lon = this.long0 + d_lambda;\n\n p.x = lon;\n p.y = lat;\n\n return p;\n}\n\nvar names = [\"New_Zealand_Map_Grid\", \"nzmg\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/nzmg.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/omerc.js": +/*!*****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/omerc.js ***! + \*****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_tsfnz__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/tsfnz */ \"./node_modules/proj4/lib/common/tsfnz.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_phi2z__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/phi2z */ \"./node_modules/proj4/lib/common/phi2z.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\n\n/* Initialize the Oblique Mercator projection\n ------------------------------------------*/\nfunction init() {\n this.no_off = this.no_off || false;\n this.no_rot = this.no_rot || false;\n\n if (isNaN(this.k0)) {\n this.k0 = 1;\n }\n var sinlat = Math.sin(this.lat0);\n var coslat = Math.cos(this.lat0);\n var con = this.e * sinlat;\n\n this.bl = Math.sqrt(1 + this.es / (1 - this.es) * Math.pow(coslat, 4));\n this.al = this.a * this.bl * this.k0 * Math.sqrt(1 - this.es) / (1 - con * con);\n var t0 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, this.lat0, sinlat);\n var dl = this.bl / coslat * Math.sqrt((1 - this.es) / (1 - con * con));\n if (dl * dl < 1) {\n dl = 1;\n }\n var fl;\n var gl;\n if (!isNaN(this.longc)) {\n //Central point and azimuth method\n\n if (this.lat0 >= 0) {\n fl = dl + Math.sqrt(dl * dl - 1);\n }\n else {\n fl = dl - Math.sqrt(dl * dl - 1);\n }\n this.el = fl * Math.pow(t0, this.bl);\n gl = 0.5 * (fl - 1 / fl);\n this.gamma0 = Math.asin(Math.sin(this.alpha) / dl);\n this.long0 = this.longc - Math.asin(gl * Math.tan(this.gamma0)) / this.bl;\n\n }\n else {\n //2 points method\n var t1 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, this.lat1, Math.sin(this.lat1));\n var t2 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, this.lat2, Math.sin(this.lat2));\n if (this.lat0 >= 0) {\n this.el = (dl + Math.sqrt(dl * dl - 1)) * Math.pow(t0, this.bl);\n }\n else {\n this.el = (dl - Math.sqrt(dl * dl - 1)) * Math.pow(t0, this.bl);\n }\n var hl = Math.pow(t1, this.bl);\n var ll = Math.pow(t2, this.bl);\n fl = this.el / hl;\n gl = 0.5 * (fl - 1 / fl);\n var jl = (this.el * this.el - ll * hl) / (this.el * this.el + ll * hl);\n var pl = (ll - hl) / (ll + hl);\n var dlon12 = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.long1 - this.long2);\n this.long0 = 0.5 * (this.long1 + this.long2) - Math.atan(jl * Math.tan(0.5 * this.bl * (dlon12)) / pl) / this.bl;\n this.long0 = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.long0);\n var dlon10 = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.long1 - this.long0);\n this.gamma0 = Math.atan(Math.sin(this.bl * (dlon10)) / gl);\n this.alpha = Math.asin(dl * Math.sin(this.gamma0));\n }\n\n if (this.no_off) {\n this.uc = 0;\n }\n else {\n if (this.lat0 >= 0) {\n this.uc = this.al / this.bl * Math.atan2(Math.sqrt(dl * dl - 1), Math.cos(this.alpha));\n }\n else {\n this.uc = -1 * this.al / this.bl * Math.atan2(Math.sqrt(dl * dl - 1), Math.cos(this.alpha));\n }\n }\n\n}\n\n/* Oblique Mercator forward equations--mapping lat,long to x,y\n ----------------------------------------------------------*/\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lon - this.long0);\n var us, vs;\n var con;\n if (Math.abs(Math.abs(lat) - _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"HALF_PI\"]) <= _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n if (lat > 0) {\n con = -1;\n }\n else {\n con = 1;\n }\n vs = this.al / this.bl * Math.log(Math.tan(_constants_values__WEBPACK_IMPORTED_MODULE_3__[\"FORTPI\"] + con * this.gamma0 * 0.5));\n us = -1 * con * _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"HALF_PI\"] * this.al / this.bl;\n }\n else {\n var t = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, lat, Math.sin(lat));\n var ql = this.el / Math.pow(t, this.bl);\n var sl = 0.5 * (ql - 1 / ql);\n var tl = 0.5 * (ql + 1 / ql);\n var vl = Math.sin(this.bl * (dlon));\n var ul = (sl * Math.sin(this.gamma0) - vl * Math.cos(this.gamma0)) / tl;\n if (Math.abs(Math.abs(ul) - 1) <= _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n vs = Number.POSITIVE_INFINITY;\n }\n else {\n vs = 0.5 * this.al * Math.log((1 - ul) / (1 + ul)) / this.bl;\n }\n if (Math.abs(Math.cos(this.bl * (dlon))) <= _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n us = this.al * this.bl * (dlon);\n }\n else {\n us = this.al * Math.atan2(sl * Math.cos(this.gamma0) + vl * Math.sin(this.gamma0), Math.cos(this.bl * dlon)) / this.bl;\n }\n }\n\n if (this.no_rot) {\n p.x = this.x0 + us;\n p.y = this.y0 + vs;\n }\n else {\n\n us -= this.uc;\n p.x = this.x0 + vs * Math.cos(this.alpha) + us * Math.sin(this.alpha);\n p.y = this.y0 + us * Math.cos(this.alpha) - vs * Math.sin(this.alpha);\n }\n return p;\n}\n\nfunction inverse(p) {\n var us, vs;\n if (this.no_rot) {\n vs = p.y - this.y0;\n us = p.x - this.x0;\n }\n else {\n vs = (p.x - this.x0) * Math.cos(this.alpha) - (p.y - this.y0) * Math.sin(this.alpha);\n us = (p.y - this.y0) * Math.cos(this.alpha) + (p.x - this.x0) * Math.sin(this.alpha);\n us += this.uc;\n }\n var qp = Math.exp(-1 * this.bl * vs / this.al);\n var sp = 0.5 * (qp - 1 / qp);\n var tp = 0.5 * (qp + 1 / qp);\n var vp = Math.sin(this.bl * us / this.al);\n var up = (vp * Math.cos(this.gamma0) + sp * Math.sin(this.gamma0)) / tp;\n var ts = Math.pow(this.el / Math.sqrt((1 + up) / (1 - up)), 1 / this.bl);\n if (Math.abs(up - 1) < _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n p.x = this.long0;\n p.y = _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"HALF_PI\"];\n }\n else if (Math.abs(up + 1) < _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"EPSLN\"]) {\n p.x = this.long0;\n p.y = -1 * _constants_values__WEBPACK_IMPORTED_MODULE_3__[\"HALF_PI\"];\n }\n else {\n p.y = Object(_common_phi2z__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.e, ts);\n p.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.long0 - Math.atan2(sp * Math.cos(this.gamma0) - vp * Math.sin(this.gamma0), Math.cos(this.bl * us / this.al)) / this.bl);\n }\n return p;\n}\n\nvar names = [\"Hotine_Oblique_Mercator\", \"Hotine Oblique Mercator\", \"Hotine_Oblique_Mercator_Azimuth_Natural_Origin\", \"Hotine_Oblique_Mercator_Azimuth_Center\", \"omerc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/omerc.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/ortho.js": +/*!*****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/ortho.js ***! + \*****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_asinz__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/asinz */ \"./node_modules/proj4/lib/common/asinz.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\n\n\nfunction init() {\n //double temp; /* temporary variable */\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n this.sin_p14 = Math.sin(this.lat0);\n this.cos_p14 = Math.cos(this.lat0);\n}\n\n/* Orthographic forward equations--mapping lat,long to x,y\n ---------------------------------------------------*/\nfunction forward(p) {\n var sinphi, cosphi; /* sin and cos value */\n var dlon; /* delta longitude value */\n var coslon; /* cos of longitude */\n var ksp; /* scale factor */\n var g, x, y;\n var lon = p.x;\n var lat = p.y;\n /* Forward equations\n -----------------*/\n dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n\n sinphi = Math.sin(lat);\n cosphi = Math.cos(lat);\n\n coslon = Math.cos(dlon);\n g = this.sin_p14 * sinphi + this.cos_p14 * cosphi * coslon;\n ksp = 1;\n if ((g > 0) || (Math.abs(g) <= _constants_values__WEBPACK_IMPORTED_MODULE_2__[\"EPSLN\"])) {\n x = this.a * ksp * cosphi * Math.sin(dlon);\n y = this.y0 + this.a * ksp * (this.cos_p14 * sinphi - this.sin_p14 * cosphi * coslon);\n }\n p.x = x;\n p.y = y;\n return p;\n}\n\nfunction inverse(p) {\n var rh; /* height above ellipsoid */\n var z; /* angle */\n var sinz, cosz; /* sin of z and cos of z */\n var con;\n var lon, lat;\n /* Inverse equations\n -----------------*/\n p.x -= this.x0;\n p.y -= this.y0;\n rh = Math.sqrt(p.x * p.x + p.y * p.y);\n z = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(rh / this.a);\n\n sinz = Math.sin(z);\n cosz = Math.cos(z);\n\n lon = this.long0;\n if (Math.abs(rh) <= _constants_values__WEBPACK_IMPORTED_MODULE_2__[\"EPSLN\"]) {\n lat = this.lat0;\n p.x = lon;\n p.y = lat;\n return p;\n }\n lat = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(cosz * this.sin_p14 + (p.y * sinz * this.cos_p14) / rh);\n con = Math.abs(this.lat0) - _constants_values__WEBPACK_IMPORTED_MODULE_2__[\"HALF_PI\"];\n if (Math.abs(con) <= _constants_values__WEBPACK_IMPORTED_MODULE_2__[\"EPSLN\"]) {\n if (this.lat0 >= 0) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.atan2(p.x, - p.y));\n }\n else {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 - Math.atan2(-p.x, p.y));\n }\n p.x = lon;\n p.y = lat;\n return p;\n }\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.atan2((p.x * sinz), rh * this.cos_p14 * cosz - p.y * this.sin_p14 * sinz));\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"ortho\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/ortho.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/poly.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/poly.js ***! + \****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_e0fn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/e0fn */ \"./node_modules/proj4/lib/common/e0fn.js\");\n/* harmony import */ var _common_e1fn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/e1fn */ \"./node_modules/proj4/lib/common/e1fn.js\");\n/* harmony import */ var _common_e2fn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/e2fn */ \"./node_modules/proj4/lib/common/e2fn.js\");\n/* harmony import */ var _common_e3fn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/e3fn */ \"./node_modules/proj4/lib/common/e3fn.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_adjust_lat__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/adjust_lat */ \"./node_modules/proj4/lib/common/adjust_lat.js\");\n/* harmony import */ var _common_mlfn__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/mlfn */ \"./node_modules/proj4/lib/common/mlfn.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_gN__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/gN */ \"./node_modules/proj4/lib/common/gN.js\");\n\n\n\n\n\n\n\n\n\n\nvar MAX_ITER = 20;\n\nfunction init() {\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2); // devait etre dans tmerc.js mais n y est pas donc je commente sinon retour de valeurs nulles\n this.e = Math.sqrt(this.es);\n this.e0 = Object(_common_e0fn__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.es);\n this.e1 = Object(_common_e1fn__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.es);\n this.e2 = Object(_common_e2fn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.es);\n this.e3 = Object(_common_e3fn__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.es);\n this.ml0 = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.e0, this.e1, this.e2, this.e3, this.lat0); //si que des zeros le calcul ne se fait pas\n}\n\n/* Polyconic forward equations--mapping lat,long to x,y\n ---------------------------------------------------*/\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n var x, y, el;\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(lon - this.long0);\n el = dlon * Math.sin(lat);\n if (this.sphere) {\n if (Math.abs(lat) <= _constants_values__WEBPACK_IMPORTED_MODULE_7__[\"EPSLN\"]) {\n x = this.a * dlon;\n y = -1 * this.a * this.lat0;\n }\n else {\n x = this.a * Math.sin(el) / Math.tan(lat);\n y = this.a * (Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(lat - this.lat0) + (1 - Math.cos(el)) / Math.tan(lat));\n }\n }\n else {\n if (Math.abs(lat) <= _constants_values__WEBPACK_IMPORTED_MODULE_7__[\"EPSLN\"]) {\n x = this.a * dlon;\n y = -1 * this.ml0;\n }\n else {\n var nl = Object(_common_gN__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(this.a, this.e, Math.sin(lat)) / Math.tan(lat);\n x = nl * Math.sin(el);\n y = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.e0, this.e1, this.e2, this.e3, lat) - this.ml0 + nl * (1 - Math.cos(el));\n }\n\n }\n p.x = x + this.x0;\n p.y = y + this.y0;\n return p;\n}\n\n/* Inverse equations\n -----------------*/\nfunction inverse(p) {\n var lon, lat, x, y, i;\n var al, bl;\n var phi, dphi;\n x = p.x - this.x0;\n y = p.y - this.y0;\n\n if (this.sphere) {\n if (Math.abs(y + this.a * this.lat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_7__[\"EPSLN\"]) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(x / this.a + this.long0);\n lat = 0;\n }\n else {\n al = this.lat0 + y / this.a;\n bl = x * x / this.a / this.a + al * al;\n phi = al;\n var tanphi;\n for (i = MAX_ITER; i; --i) {\n tanphi = Math.tan(phi);\n dphi = -1 * (al * (phi * tanphi + 1) - phi - 0.5 * (phi * phi + bl) * tanphi) / ((phi - al) / tanphi - 1);\n phi += dphi;\n if (Math.abs(dphi) <= _constants_values__WEBPACK_IMPORTED_MODULE_7__[\"EPSLN\"]) {\n lat = phi;\n break;\n }\n }\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.long0 + (Math.asin(x * Math.tan(phi) / this.a)) / Math.sin(lat));\n }\n }\n else {\n if (Math.abs(y + this.ml0) <= _constants_values__WEBPACK_IMPORTED_MODULE_7__[\"EPSLN\"]) {\n lat = 0;\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.long0 + x / this.a);\n }\n else {\n\n al = (this.ml0 + y) / this.a;\n bl = x * x / this.a / this.a + al * al;\n phi = al;\n var cl, mln, mlnp, ma;\n var con;\n for (i = MAX_ITER; i; --i) {\n con = this.e * Math.sin(phi);\n cl = Math.sqrt(1 - con * con) * Math.tan(phi);\n mln = this.a * Object(_common_mlfn__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(this.e0, this.e1, this.e2, this.e3, phi);\n mlnp = this.e0 - 2 * this.e1 * Math.cos(2 * phi) + 4 * this.e2 * Math.cos(4 * phi) - 6 * this.e3 * Math.cos(6 * phi);\n ma = mln / this.a;\n dphi = (al * (cl * ma + 1) - ma - 0.5 * cl * (ma * ma + bl)) / (this.es * Math.sin(2 * phi) * (ma * ma + bl - 2 * al * ma) / (4 * cl) + (al - ma) * (cl * mlnp - 2 / Math.sin(2 * phi)) - mlnp);\n phi -= dphi;\n if (Math.abs(dphi) <= _constants_values__WEBPACK_IMPORTED_MODULE_7__[\"EPSLN\"]) {\n lat = phi;\n break;\n }\n }\n\n //lat=phi4z(this.e,this.e0,this.e1,this.e2,this.e3,al,bl,0,0);\n cl = Math.sqrt(1 - this.es * Math.pow(Math.sin(lat), 2)) * Math.tan(lat);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.long0 + Math.asin(x * cl / this.a) / Math.sin(lat));\n }\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Polyconic\", \"poly\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/poly.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/qsc.js": +/*!***************************************************!*\ + !*** ./node_modules/proj4/lib/projections/qsc.js ***! + \***************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n// QSC projection rewritten from the original PROJ4\n// https://github.com/OSGeo/proj.4/blob/master/src/PJ_qsc.c\n\n\n\n/* constants */\nvar FACE_ENUM = {\n FRONT: 1,\n RIGHT: 2,\n BACK: 3,\n LEFT: 4,\n TOP: 5,\n BOTTOM: 6\n};\n\nvar AREA_ENUM = {\n AREA_0: 1,\n AREA_1: 2,\n AREA_2: 3,\n AREA_3: 4\n};\n\nfunction init() {\n\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n this.lat0 = this.lat0 || 0;\n this.long0 = this.long0 || 0;\n this.lat_ts = this.lat_ts || 0;\n this.title = this.title || \"Quadrilateralized Spherical Cube\";\n\n /* Determine the cube face from the center of projection. */\n if (this.lat0 >= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] / 2.0) {\n this.face = FACE_ENUM.TOP;\n } else if (this.lat0 <= -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] / 2.0)) {\n this.face = FACE_ENUM.BOTTOM;\n } else if (Math.abs(this.long0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n this.face = FACE_ENUM.FRONT;\n } else if (Math.abs(this.long0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n this.face = this.long0 > 0.0 ? FACE_ENUM.RIGHT : FACE_ENUM.LEFT;\n } else {\n this.face = FACE_ENUM.BACK;\n }\n\n /* Fill in useful values for the ellipsoid <-> sphere shift\n * described in [LK12]. */\n if (this.es !== 0) {\n this.one_minus_f = 1 - (this.a - this.b) / this.a;\n this.one_minus_f_squared = this.one_minus_f * this.one_minus_f;\n }\n}\n\n// QSC forward equations--mapping lat,long to x,y\n// -----------------------------------------------------------------\nfunction forward(p) {\n var xy = {x: 0, y: 0};\n var lat, lon;\n var theta, phi;\n var t, mu;\n /* nu; */\n var area = {value: 0};\n\n // move lon according to projection's lon\n p.x -= this.long0;\n\n /* Convert the geodetic latitude to a geocentric latitude.\n * This corresponds to the shift from the ellipsoid to the sphere\n * described in [LK12]. */\n if (this.es !== 0) {//if (P->es != 0) {\n lat = Math.atan(this.one_minus_f_squared * Math.tan(p.y));\n } else {\n lat = p.y;\n }\n\n /* Convert the input lat, lon into theta, phi as used by QSC.\n * This depends on the cube face and the area on it.\n * For the top and bottom face, we can compute theta and phi\n * directly from phi, lam. For the other faces, we must use\n * unit sphere cartesian coordinates as an intermediate step. */\n lon = p.x; //lon = lp.lam;\n if (this.face === FACE_ENUM.TOP) {\n phi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - lat;\n if (lon >= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && lon <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_0;\n theta = lon - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (lon > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] || lon <= -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"])) {\n area.value = AREA_ENUM.AREA_1;\n theta = (lon > 0.0 ? lon - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : lon + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else if (lon > -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) && lon <= -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_2;\n theta = lon + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta = lon;\n }\n } else if (this.face === FACE_ENUM.BOTTOM) {\n phi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + lat;\n if (lon >= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && lon <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_0;\n theta = -lon + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (lon < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && lon >= -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_1;\n theta = -lon;\n } else if (lon < -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && lon >= -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"])) {\n area.value = AREA_ENUM.AREA_2;\n theta = -lon - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta = (lon > 0.0 ? -lon + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : -lon - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n }\n } else {\n var q, r, s;\n var sinlat, coslat;\n var sinlon, coslon;\n\n if (this.face === FACE_ENUM.RIGHT) {\n lon = qsc_shift_lon_origin(lon, +_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]);\n } else if (this.face === FACE_ENUM.BACK) {\n lon = qsc_shift_lon_origin(lon, +_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else if (this.face === FACE_ENUM.LEFT) {\n lon = qsc_shift_lon_origin(lon, -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]);\n }\n sinlat = Math.sin(lat);\n coslat = Math.cos(lat);\n sinlon = Math.sin(lon);\n coslon = Math.cos(lon);\n q = coslat * coslon;\n r = coslat * sinlon;\n s = sinlat;\n\n if (this.face === FACE_ENUM.FRONT) {\n phi = Math.acos(q);\n theta = qsc_fwd_equat_face_theta(phi, s, r, area);\n } else if (this.face === FACE_ENUM.RIGHT) {\n phi = Math.acos(r);\n theta = qsc_fwd_equat_face_theta(phi, s, -q, area);\n } else if (this.face === FACE_ENUM.BACK) {\n phi = Math.acos(-q);\n theta = qsc_fwd_equat_face_theta(phi, s, -r, area);\n } else if (this.face === FACE_ENUM.LEFT) {\n phi = Math.acos(-r);\n theta = qsc_fwd_equat_face_theta(phi, s, q, area);\n } else {\n /* Impossible */\n phi = theta = 0;\n area.value = AREA_ENUM.AREA_0;\n }\n }\n\n /* Compute mu and nu for the area of definition.\n * For mu, see Eq. (3-21) in [OL76], but note the typos:\n * compare with Eq. (3-14). For nu, see Eq. (3-38). */\n mu = Math.atan((12 / _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]) * (theta + Math.acos(Math.sin(theta) * Math.cos(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"])) - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]));\n t = Math.sqrt((1 - Math.cos(phi)) / (Math.cos(mu) * Math.cos(mu)) / (1 - Math.cos(Math.atan(1 / Math.cos(theta)))));\n\n /* Apply the result to the real area. */\n if (area.value === AREA_ENUM.AREA_1) {\n mu += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (area.value === AREA_ENUM.AREA_2) {\n mu += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"];\n } else if (area.value === AREA_ENUM.AREA_3) {\n mu += 1.5 * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"];\n }\n\n /* Now compute x, y from mu and nu */\n xy.x = t * Math.cos(mu);\n xy.y = t * Math.sin(mu);\n xy.x = xy.x * this.a + this.x0;\n xy.y = xy.y * this.a + this.y0;\n\n p.x = xy.x;\n p.y = xy.y;\n return p;\n}\n\n// QSC inverse equations--mapping x,y to lat/long\n// -----------------------------------------------------------------\nfunction inverse(p) {\n var lp = {lam: 0, phi: 0};\n var mu, nu, cosmu, tannu;\n var tantheta, theta, cosphi, phi;\n var t;\n var area = {value: 0};\n\n /* de-offset */\n p.x = (p.x - this.x0) / this.a;\n p.y = (p.y - this.y0) / this.a;\n\n /* Convert the input x, y to the mu and nu angles as used by QSC.\n * This depends on the area of the cube face. */\n nu = Math.atan(Math.sqrt(p.x * p.x + p.y * p.y));\n mu = Math.atan2(p.y, p.x);\n if (p.x >= 0.0 && p.x >= Math.abs(p.y)) {\n area.value = AREA_ENUM.AREA_0;\n } else if (p.y >= 0.0 && p.y >= Math.abs(p.x)) {\n area.value = AREA_ENUM.AREA_1;\n mu -= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (p.x < 0.0 && -p.x >= Math.abs(p.y)) {\n area.value = AREA_ENUM.AREA_2;\n mu = (mu < 0.0 ? mu + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : mu - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else {\n area.value = AREA_ENUM.AREA_3;\n mu += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n }\n\n /* Compute phi and theta for the area of definition.\n * The inverse projection is not described in the original paper, but some\n * good hints can be found here (as of 2011-12-14):\n * http://fits.gsfc.nasa.gov/fitsbits/saf.93/saf.9302\n * (search for \"Message-Id: <9302181759.AA25477 at fits.cv.nrao.edu>\") */\n t = (_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] / 12) * Math.tan(mu);\n tantheta = Math.sin(t) / (Math.cos(t) - (1 / Math.sqrt(2)));\n theta = Math.atan(tantheta);\n cosmu = Math.cos(mu);\n tannu = Math.tan(nu);\n cosphi = 1 - cosmu * cosmu * tannu * tannu * (1 - Math.cos(Math.atan(1 / Math.cos(theta))));\n if (cosphi < -1) {\n cosphi = -1;\n } else if (cosphi > +1) {\n cosphi = +1;\n }\n\n /* Apply the result to the real area on the cube face.\n * For the top and bottom face, we can compute phi and lam directly.\n * For the other faces, we must use unit sphere cartesian coordinates\n * as an intermediate step. */\n if (this.face === FACE_ENUM.TOP) {\n phi = Math.acos(cosphi);\n lp.phi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] - phi;\n if (area.value === AREA_ENUM.AREA_0) {\n lp.lam = theta + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (area.value === AREA_ENUM.AREA_1) {\n lp.lam = (theta < 0.0 ? theta + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : theta - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else if (area.value === AREA_ENUM.AREA_2) {\n lp.lam = theta - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else /* area.value == AREA_ENUM.AREA_3 */ {\n lp.lam = theta;\n }\n } else if (this.face === FACE_ENUM.BOTTOM) {\n phi = Math.acos(cosphi);\n lp.phi = phi - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n if (area.value === AREA_ENUM.AREA_0) {\n lp.lam = -theta + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (area.value === AREA_ENUM.AREA_1) {\n lp.lam = -theta;\n } else if (area.value === AREA_ENUM.AREA_2) {\n lp.lam = -theta - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else /* area.value == AREA_ENUM.AREA_3 */ {\n lp.lam = (theta < 0.0 ? -theta - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : -theta + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n }\n } else {\n /* Compute phi and lam via cartesian unit sphere coordinates. */\n var q, r, s;\n q = cosphi;\n t = q * q;\n if (t >= 1) {\n s = 0;\n } else {\n s = Math.sqrt(1 - t) * Math.sin(theta);\n }\n t += s * s;\n if (t >= 1) {\n r = 0;\n } else {\n r = Math.sqrt(1 - t);\n }\n /* Rotate q,r,s into the correct area. */\n if (area.value === AREA_ENUM.AREA_1) {\n t = r;\n r = -s;\n s = t;\n } else if (area.value === AREA_ENUM.AREA_2) {\n r = -r;\n s = -s;\n } else if (area.value === AREA_ENUM.AREA_3) {\n t = r;\n r = s;\n s = -t;\n }\n /* Rotate q,r,s into the correct cube face. */\n if (this.face === FACE_ENUM.RIGHT) {\n t = q;\n q = -r;\n r = t;\n } else if (this.face === FACE_ENUM.BACK) {\n q = -q;\n r = -r;\n } else if (this.face === FACE_ENUM.LEFT) {\n t = q;\n q = r;\n r = -t;\n }\n /* Now compute phi and lam from the unit sphere coordinates. */\n lp.phi = Math.acos(-s) - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n lp.lam = Math.atan2(r, q);\n if (this.face === FACE_ENUM.RIGHT) {\n lp.lam = qsc_shift_lon_origin(lp.lam, -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]);\n } else if (this.face === FACE_ENUM.BACK) {\n lp.lam = qsc_shift_lon_origin(lp.lam, -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else if (this.face === FACE_ENUM.LEFT) {\n lp.lam = qsc_shift_lon_origin(lp.lam, +_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]);\n }\n }\n\n /* Apply the shift from the sphere to the ellipsoid as described\n * in [LK12]. */\n if (this.es !== 0) {\n var invert_sign;\n var tanphi, xa;\n invert_sign = (lp.phi < 0 ? 1 : 0);\n tanphi = Math.tan(lp.phi);\n xa = this.b / Math.sqrt(tanphi * tanphi + this.one_minus_f_squared);\n lp.phi = Math.atan(Math.sqrt(this.a * this.a - xa * xa) / (this.one_minus_f * xa));\n if (invert_sign) {\n lp.phi = -lp.phi;\n }\n }\n\n lp.lam += this.long0;\n p.x = lp.lam;\n p.y = lp.phi;\n return p;\n}\n\n/* Helper function for forward projection: compute the theta angle\n * and determine the area number. */\nfunction qsc_fwd_equat_face_theta(phi, y, x, area) {\n var theta;\n if (phi < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n area.value = AREA_ENUM.AREA_0;\n theta = 0.0;\n } else {\n theta = Math.atan2(y, x);\n if (Math.abs(theta) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_0;\n } else if (theta > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] && theta <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"]) {\n area.value = AREA_ENUM.AREA_1;\n theta -= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else if (theta > _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"] || theta <= -(_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"FORTPI\"])) {\n area.value = AREA_ENUM.AREA_2;\n theta = (theta >= 0.0 ? theta - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"] : theta + _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]);\n } else {\n area.value = AREA_ENUM.AREA_3;\n theta += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n }\n }\n return theta;\n}\n\n/* Helper function: shift the longitude. */\nfunction qsc_shift_lon_origin(lon, offset) {\n var slon = lon + offset;\n if (slon < -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]) {\n slon += _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"TWO_PI\"];\n } else if (slon > +_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"SPI\"]) {\n slon -= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"TWO_PI\"];\n }\n return slon;\n}\n\nvar names = [\"Quadrilateralized Spherical Cube\", \"Quadrilateralized_Spherical_Cube\", \"qsc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/qsc.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/robin.js": +/*!*****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/robin.js ***! + \*****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n// Robinson projection\n// Based on https://github.com/OSGeo/proj.4/blob/master/src/PJ_robin.c\n// Polynomial coeficients from http://article.gmane.org/gmane.comp.gis.proj-4.devel/6039\n\n\n\n\nvar COEFS_X = [\n [1.0000, 2.2199e-17, -7.15515e-05, 3.1103e-06],\n [0.9986, -0.000482243, -2.4897e-05, -1.3309e-06],\n [0.9954, -0.00083103, -4.48605e-05, -9.86701e-07],\n [0.9900, -0.00135364, -5.9661e-05, 3.6777e-06],\n [0.9822, -0.00167442, -4.49547e-06, -5.72411e-06],\n [0.9730, -0.00214868, -9.03571e-05, 1.8736e-08],\n [0.9600, -0.00305085, -9.00761e-05, 1.64917e-06],\n [0.9427, -0.00382792, -6.53386e-05, -2.6154e-06],\n [0.9216, -0.00467746, -0.00010457, 4.81243e-06],\n [0.8962, -0.00536223, -3.23831e-05, -5.43432e-06],\n [0.8679, -0.00609363, -0.000113898, 3.32484e-06],\n [0.8350, -0.00698325, -6.40253e-05, 9.34959e-07],\n [0.7986, -0.00755338, -5.00009e-05, 9.35324e-07],\n [0.7597, -0.00798324, -3.5971e-05, -2.27626e-06],\n [0.7186, -0.00851367, -7.01149e-05, -8.6303e-06],\n [0.6732, -0.00986209, -0.000199569, 1.91974e-05],\n [0.6213, -0.010418, 8.83923e-05, 6.24051e-06],\n [0.5722, -0.00906601, 0.000182, 6.24051e-06],\n [0.5322, -0.00677797, 0.000275608, 6.24051e-06]\n];\n\nvar COEFS_Y = [\n [-5.20417e-18, 0.0124, 1.21431e-18, -8.45284e-11],\n [0.0620, 0.0124, -1.26793e-09, 4.22642e-10],\n [0.1240, 0.0124, 5.07171e-09, -1.60604e-09],\n [0.1860, 0.0123999, -1.90189e-08, 6.00152e-09],\n [0.2480, 0.0124002, 7.10039e-08, -2.24e-08],\n [0.3100, 0.0123992, -2.64997e-07, 8.35986e-08],\n [0.3720, 0.0124029, 9.88983e-07, -3.11994e-07],\n [0.4340, 0.0123893, -3.69093e-06, -4.35621e-07],\n [0.4958, 0.0123198, -1.02252e-05, -3.45523e-07],\n [0.5571, 0.0121916, -1.54081e-05, -5.82288e-07],\n [0.6176, 0.0119938, -2.41424e-05, -5.25327e-07],\n [0.6769, 0.011713, -3.20223e-05, -5.16405e-07],\n [0.7346, 0.0113541, -3.97684e-05, -6.09052e-07],\n [0.7903, 0.0109107, -4.89042e-05, -1.04739e-06],\n [0.8435, 0.0103431, -6.4615e-05, -1.40374e-09],\n [0.8936, 0.00969686, -6.4636e-05, -8.547e-06],\n [0.9394, 0.00840947, -0.000192841, -4.2106e-06],\n [0.9761, 0.00616527, -0.000256, -4.2106e-06],\n [1.0000, 0.00328947, -0.000319159, -4.2106e-06]\n];\n\nvar FXC = 0.8487;\nvar FYC = 1.3523;\nvar C1 = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"R2D\"]/5; // rad to 5-degree interval\nvar RC1 = 1/C1;\nvar NODES = 18;\n\nvar poly3_val = function(coefs, x) {\n return coefs[0] + x * (coefs[1] + x * (coefs[2] + x * coefs[3]));\n};\n\nvar poly3_der = function(coefs, x) {\n return coefs[1] + x * (2 * coefs[2] + x * 3 * coefs[3]);\n};\n\nfunction newton_rapshon(f_df, start, max_err, iters) {\n var x = start;\n for (; iters; --iters) {\n var upd = f_df(x);\n x -= upd;\n if (Math.abs(upd) < max_err) {\n break;\n }\n }\n return x;\n}\n\nfunction init() {\n this.x0 = this.x0 || 0;\n this.y0 = this.y0 || 0;\n this.long0 = this.long0 || 0;\n this.es = 0;\n this.title = this.title || \"Robinson\";\n}\n\nfunction forward(ll) {\n var lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(ll.x - this.long0);\n\n var dphi = Math.abs(ll.y);\n var i = Math.floor(dphi * C1);\n if (i < 0) {\n i = 0;\n } else if (i >= NODES) {\n i = NODES - 1;\n }\n dphi = _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"R2D\"] * (dphi - RC1 * i);\n var xy = {\n x: poly3_val(COEFS_X[i], dphi) * lon,\n y: poly3_val(COEFS_Y[i], dphi)\n };\n if (ll.y < 0) {\n xy.y = -xy.y;\n }\n\n xy.x = xy.x * this.a * FXC + this.x0;\n xy.y = xy.y * this.a * FYC + this.y0;\n return xy;\n}\n\nfunction inverse(xy) {\n var ll = {\n x: (xy.x - this.x0) / (this.a * FXC),\n y: Math.abs(xy.y - this.y0) / (this.a * FYC)\n };\n\n if (ll.y >= 1) { // pathologic case\n ll.x /= COEFS_X[NODES][0];\n ll.y = xy.y < 0 ? -_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] : _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n } else {\n // find table interval\n var i = Math.floor(ll.y * NODES);\n if (i < 0) {\n i = 0;\n } else if (i >= NODES) {\n i = NODES - 1;\n }\n for (;;) {\n if (COEFS_Y[i][0] > ll.y) {\n --i;\n } else if (COEFS_Y[i+1][0] <= ll.y) {\n ++i;\n } else {\n break;\n }\n }\n // linear interpolation in 5 degree interval\n var coefs = COEFS_Y[i];\n var t = 5 * (ll.y - coefs[0]) / (COEFS_Y[i+1][0] - coefs[0]);\n // find t so that poly3_val(coefs, t) = ll.y\n t = newton_rapshon(function(x) {\n return (poly3_val(coefs, x) - ll.y) / poly3_der(coefs, x);\n }, t, _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"], 100);\n\n ll.x /= poly3_val(COEFS_X[i], t);\n ll.y = (5 * i + t) * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n if (xy.y < 0) {\n ll.y = -ll.y;\n }\n }\n\n ll.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(ll.x + this.long0);\n return ll;\n}\n\nvar names = [\"Robinson\", \"robin\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/robin.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/sinu.js": +/*!****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/sinu.js ***! + \****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _common_adjust_lat__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/adjust_lat */ \"./node_modules/proj4/lib/common/adjust_lat.js\");\n/* harmony import */ var _common_pj_enfn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pj_enfn */ \"./node_modules/proj4/lib/common/pj_enfn.js\");\n/* harmony import */ var _common_pj_mlfn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/pj_mlfn */ \"./node_modules/proj4/lib/common/pj_mlfn.js\");\n/* harmony import */ var _common_pj_inv_mlfn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/pj_inv_mlfn */ \"./node_modules/proj4/lib/common/pj_inv_mlfn.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_asinz__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../common/asinz */ \"./node_modules/proj4/lib/common/asinz.js\");\n\n\n\nvar MAX_ITER = 20;\n\n\n\n\n\n\n\nfunction init() {\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n\n\n if (!this.sphere) {\n this.en = Object(_common_pj_enfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.es);\n }\n else {\n this.n = 1;\n this.m = 0;\n this.es = 0;\n this.C_y = Math.sqrt((this.m + 1) / this.n);\n this.C_x = this.C_y / (this.m + 1);\n }\n\n}\n\n/* Sinusoidal forward equations--mapping lat,long to x,y\n -----------------------------------------------------*/\nfunction forward(p) {\n var x, y;\n var lon = p.x;\n var lat = p.y;\n /* Forward equations\n -----------------*/\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n\n if (this.sphere) {\n if (!this.m) {\n lat = this.n !== 1 ? Math.asin(this.n * Math.sin(lat)) : lat;\n }\n else {\n var k = this.n * Math.sin(lat);\n for (var i = MAX_ITER; i; --i) {\n var V = (this.m * lat + Math.sin(lat) - k) / (this.m + Math.cos(lat));\n lat -= V;\n if (Math.abs(V) < _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]) {\n break;\n }\n }\n }\n x = this.a * this.C_x * lon * (this.m + Math.cos(lat));\n y = this.a * this.C_y * lat;\n\n }\n else {\n\n var s = Math.sin(lat);\n var c = Math.cos(lat);\n y = this.a * Object(_common_pj_mlfn__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(lat, s, c, this.en);\n x = this.a * lon * c / Math.sqrt(1 - this.es * s * s);\n }\n\n p.x = x;\n p.y = y;\n return p;\n}\n\nfunction inverse(p) {\n var lat, temp, lon, s;\n\n p.x -= this.x0;\n lon = p.x / this.a;\n p.y -= this.y0;\n lat = p.y / this.a;\n\n if (this.sphere) {\n lat /= this.C_y;\n lon = lon / (this.C_x * (this.m + Math.cos(lat)));\n if (this.m) {\n lat = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_6__[\"default\"])((this.m * lat + Math.sin(lat)) / this.n);\n }\n else if (this.n !== 1) {\n lat = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(Math.sin(lat) / this.n);\n }\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon + this.long0);\n lat = Object(_common_adjust_lat__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lat);\n }\n else {\n lat = Object(_common_pj_inv_mlfn__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(p.y / this.a, this.es, this.en);\n s = Math.abs(lat);\n if (s < _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"HALF_PI\"]) {\n s = Math.sin(lat);\n temp = this.long0 + p.x * Math.sqrt(1 - this.es * s * s) / (this.a * Math.cos(lat));\n //temp = this.long0 + p.x / (this.a * Math.cos(lat));\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(temp);\n }\n else if ((s - _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"EPSLN\"]) < _constants_values__WEBPACK_IMPORTED_MODULE_5__[\"HALF_PI\"]) {\n lon = this.long0;\n }\n }\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Sinusoidal\", \"sinu\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/sinu.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/somerc.js": +/*!******************************************************!*\ + !*** ./node_modules/proj4/lib/projections/somerc.js ***! + \******************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/*\n references:\n Formules et constantes pour le Calcul pour la\n projection cylindrique conforme à axe oblique et pour la transformation entre\n des systèmes de référence.\n http://www.swisstopo.admin.ch/internet/swisstopo/fr/home/topics/survey/sys/refsys/switzerland.parsysrelated1.31216.downloadList.77004.DownloadFile.tmp/swissprojectionfr.pdf\n */\n\nfunction init() {\n var phy0 = this.lat0;\n this.lambda0 = this.long0;\n var sinPhy0 = Math.sin(phy0);\n var semiMajorAxis = this.a;\n var invF = this.rf;\n var flattening = 1 / invF;\n var e2 = 2 * flattening - Math.pow(flattening, 2);\n var e = this.e = Math.sqrt(e2);\n this.R = this.k0 * semiMajorAxis * Math.sqrt(1 - e2) / (1 - e2 * Math.pow(sinPhy0, 2));\n this.alpha = Math.sqrt(1 + e2 / (1 - e2) * Math.pow(Math.cos(phy0), 4));\n this.b0 = Math.asin(sinPhy0 / this.alpha);\n var k1 = Math.log(Math.tan(Math.PI / 4 + this.b0 / 2));\n var k2 = Math.log(Math.tan(Math.PI / 4 + phy0 / 2));\n var k3 = Math.log((1 + e * sinPhy0) / (1 - e * sinPhy0));\n this.K = k1 - this.alpha * k2 + this.alpha * e / 2 * k3;\n}\n\nfunction forward(p) {\n var Sa1 = Math.log(Math.tan(Math.PI / 4 - p.y / 2));\n var Sa2 = this.e / 2 * Math.log((1 + this.e * Math.sin(p.y)) / (1 - this.e * Math.sin(p.y)));\n var S = -this.alpha * (Sa1 + Sa2) + this.K;\n\n // spheric latitude\n var b = 2 * (Math.atan(Math.exp(S)) - Math.PI / 4);\n\n // spheric longitude\n var I = this.alpha * (p.x - this.lambda0);\n\n // psoeudo equatorial rotation\n var rotI = Math.atan(Math.sin(I) / (Math.sin(this.b0) * Math.tan(b) + Math.cos(this.b0) * Math.cos(I)));\n\n var rotB = Math.asin(Math.cos(this.b0) * Math.sin(b) - Math.sin(this.b0) * Math.cos(b) * Math.cos(I));\n\n p.y = this.R / 2 * Math.log((1 + Math.sin(rotB)) / (1 - Math.sin(rotB))) + this.y0;\n p.x = this.R * rotI + this.x0;\n return p;\n}\n\nfunction inverse(p) {\n var Y = p.x - this.x0;\n var X = p.y - this.y0;\n\n var rotI = Y / this.R;\n var rotB = 2 * (Math.atan(Math.exp(X / this.R)) - Math.PI / 4);\n\n var b = Math.asin(Math.cos(this.b0) * Math.sin(rotB) + Math.sin(this.b0) * Math.cos(rotB) * Math.cos(rotI));\n var I = Math.atan(Math.sin(rotI) / (Math.cos(this.b0) * Math.cos(rotI) - Math.sin(this.b0) * Math.tan(rotB)));\n\n var lambda = this.lambda0 + I / this.alpha;\n\n var S = 0;\n var phy = b;\n var prevPhy = -1000;\n var iteration = 0;\n while (Math.abs(phy - prevPhy) > 0.0000001) {\n if (++iteration > 20) {\n //...reportError(\"omercFwdInfinity\");\n return;\n }\n //S = Math.log(Math.tan(Math.PI / 4 + phy / 2));\n S = 1 / this.alpha * (Math.log(Math.tan(Math.PI / 4 + b / 2)) - this.K) + this.e * Math.log(Math.tan(Math.PI / 4 + Math.asin(this.e * Math.sin(phy)) / 2));\n prevPhy = phy;\n phy = 2 * Math.atan(Math.exp(S)) - Math.PI / 2;\n }\n\n p.x = lambda;\n p.y = phy;\n return p;\n}\n\nvar names = [\"somerc\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/somerc.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/stere.js": +/*!*****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/stere.js ***! + \*****************************************************/ +/*! exports provided: ssfn_, init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ssfn_\", function() { return ssfn_; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_sign__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/sign */ \"./node_modules/proj4/lib/common/sign.js\");\n/* harmony import */ var _common_msfnz__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/msfnz */ \"./node_modules/proj4/lib/common/msfnz.js\");\n/* harmony import */ var _common_tsfnz__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/tsfnz */ \"./node_modules/proj4/lib/common/tsfnz.js\");\n/* harmony import */ var _common_phi2z__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common/phi2z */ \"./node_modules/proj4/lib/common/phi2z.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\n\n\n\n\n\n\nfunction ssfn_(phit, sinphi, eccen) {\n sinphi *= eccen;\n return (Math.tan(0.5 * (_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + phit)) * Math.pow((1 - sinphi) / (1 + sinphi), 0.5 * eccen));\n}\n\nfunction init() {\n this.coslat0 = Math.cos(this.lat0);\n this.sinlat0 = Math.sin(this.lat0);\n if (this.sphere) {\n if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.k0 = 0.5 * (1 + Object(_common_sign__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.lat0) * Math.sin(this.lat_ts));\n }\n }\n else {\n if (Math.abs(this.coslat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n if (this.lat0 > 0) {\n //North pole\n //trace('stere:north pole');\n this.con = 1;\n }\n else {\n //South pole\n //trace('stere:south pole');\n this.con = -1;\n }\n }\n this.cons = Math.sqrt(Math.pow(1 + this.e, 1 + this.e) * Math.pow(1 - this.e, 1 - this.e));\n if (this.k0 === 1 && !isNaN(this.lat_ts) && Math.abs(this.coslat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.k0 = 0.5 * this.cons * Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts)) / Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.e, this.con * this.lat_ts, this.con * Math.sin(this.lat_ts));\n }\n this.ms1 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.e, this.sinlat0, this.coslat0);\n this.X0 = 2 * Math.atan(this.ssfn_(this.lat0, this.sinlat0, this.e)) - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n this.cosX0 = Math.cos(this.X0);\n this.sinX0 = Math.sin(this.X0);\n }\n}\n\n// Stereographic forward equations--mapping lat,long to x,y\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n var sinlat = Math.sin(lat);\n var coslat = Math.cos(lat);\n var A, X, sinX, cosX, ts, rh;\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(lon - this.long0);\n\n if (Math.abs(Math.abs(lon - this.long0) - Math.PI) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"] && Math.abs(lat + this.lat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n //case of the origine point\n //trace('stere:this is the origin point');\n p.x = NaN;\n p.y = NaN;\n return p;\n }\n if (this.sphere) {\n //trace('stere:sphere case');\n A = 2 * this.k0 / (1 + this.sinlat0 * sinlat + this.coslat0 * coslat * Math.cos(dlon));\n p.x = this.a * A * coslat * Math.sin(dlon) + this.x0;\n p.y = this.a * A * (this.coslat0 * sinlat - this.sinlat0 * coslat * Math.cos(dlon)) + this.y0;\n return p;\n }\n else {\n X = 2 * Math.atan(this.ssfn_(lat, sinlat, this.e)) - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"];\n cosX = Math.cos(X);\n sinX = Math.sin(X);\n if (Math.abs(this.coslat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n ts = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.e, lat * this.con, this.con * sinlat);\n rh = 2 * this.a * this.k0 * ts / this.cons;\n p.x = this.x0 + rh * Math.sin(lon - this.long0);\n p.y = this.y0 - this.con * rh * Math.cos(lon - this.long0);\n //trace(p.toString());\n return p;\n }\n else if (Math.abs(this.sinlat0) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n //Eq\n //trace('stere:equateur');\n A = 2 * this.a * this.k0 / (1 + cosX * Math.cos(dlon));\n p.y = A * sinX;\n }\n else {\n //other case\n //trace('stere:normal case');\n A = 2 * this.a * this.k0 * this.ms1 / (this.cosX0 * (1 + this.sinX0 * sinX + this.cosX0 * cosX * Math.cos(dlon)));\n p.y = A * (this.cosX0 * sinX - this.sinX0 * cosX * Math.cos(dlon)) + this.y0;\n }\n p.x = A * cosX * Math.sin(dlon) + this.x0;\n }\n //trace(p.toString());\n return p;\n}\n\n//* Stereographic inverse equations--mapping x,y to lat/long\nfunction inverse(p) {\n p.x -= this.x0;\n p.y -= this.y0;\n var lon, lat, ts, ce, Chi;\n var rh = Math.sqrt(p.x * p.x + p.y * p.y);\n if (this.sphere) {\n var c = 2 * Math.atan(rh / (2 * this.a * this.k0));\n lon = this.long0;\n lat = this.lat0;\n if (rh <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n p.x = lon;\n p.y = lat;\n return p;\n }\n lat = Math.asin(Math.cos(c) * this.sinlat0 + p.y * Math.sin(c) * this.coslat0 / rh);\n if (Math.abs(this.coslat0) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n if (this.lat0 > 0) {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.long0 + Math.atan2(p.x, - 1 * p.y));\n }\n else {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.long0 + Math.atan2(p.x, p.y));\n }\n }\n else {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.long0 + Math.atan2(p.x * Math.sin(c), rh * this.coslat0 * Math.cos(c) - p.y * this.sinlat0 * Math.sin(c)));\n }\n p.x = lon;\n p.y = lat;\n return p;\n }\n else {\n if (Math.abs(this.coslat0) <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n if (rh <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n lat = this.lat0;\n lon = this.long0;\n p.x = lon;\n p.y = lat;\n //trace(p.toString());\n return p;\n }\n p.x *= this.con;\n p.y *= this.con;\n ts = rh * this.cons / (2 * this.a * this.k0);\n lat = this.con * Object(_common_phi2z__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.e, ts);\n lon = this.con * Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.con * this.long0 + Math.atan2(p.x, - 1 * p.y));\n }\n else {\n ce = 2 * Math.atan(rh * this.cosX0 / (2 * this.a * this.k0 * this.ms1));\n lon = this.long0;\n if (rh <= _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n Chi = this.X0;\n }\n else {\n Chi = Math.asin(Math.cos(ce) * this.sinX0 + p.y * Math.sin(ce) * this.cosX0 / rh);\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(this.long0 + Math.atan2(p.x * Math.sin(ce), rh * this.cosX0 * Math.cos(ce) - p.y * this.sinX0 * Math.sin(ce)));\n }\n lat = -1 * Object(_common_phi2z__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.e, Math.tan(0.5 * (_constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"] + Chi)));\n }\n }\n p.x = lon;\n p.y = lat;\n\n //trace(p.toString());\n return p;\n\n}\n\nvar names = [\"stere\", \"Stereographic_South_Pole\", \"Polar Stereographic (variant B)\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names,\n ssfn_: ssfn_\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/stere.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/sterea.js": +/*!******************************************************!*\ + !*** ./node_modules/proj4/lib/projections/sterea.js ***! + \******************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _gauss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./gauss */ \"./node_modules/proj4/lib/projections/gauss.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n\n\n\nfunction init() {\n _gauss__WEBPACK_IMPORTED_MODULE_0__[\"default\"].init.apply(this);\n if (!this.rc) {\n return;\n }\n this.sinc0 = Math.sin(this.phic0);\n this.cosc0 = Math.cos(this.phic0);\n this.R2 = 2 * this.rc;\n if (!this.title) {\n this.title = \"Oblique Stereographic Alternative\";\n }\n}\n\nfunction forward(p) {\n var sinc, cosc, cosl, k;\n p.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(p.x - this.long0);\n _gauss__WEBPACK_IMPORTED_MODULE_0__[\"default\"].forward.apply(this, [p]);\n sinc = Math.sin(p.y);\n cosc = Math.cos(p.y);\n cosl = Math.cos(p.x);\n k = this.k0 * this.R2 / (1 + this.sinc0 * sinc + this.cosc0 * cosc * cosl);\n p.x = k * cosc * Math.sin(p.x);\n p.y = k * (this.cosc0 * sinc - this.sinc0 * cosc * cosl);\n p.x = this.a * p.x + this.x0;\n p.y = this.a * p.y + this.y0;\n return p;\n}\n\nfunction inverse(p) {\n var sinc, cosc, lon, lat, rho;\n p.x = (p.x - this.x0) / this.a;\n p.y = (p.y - this.y0) / this.a;\n\n p.x /= this.k0;\n p.y /= this.k0;\n if ((rho = Math.sqrt(p.x * p.x + p.y * p.y))) {\n var c = 2 * Math.atan2(rho, this.R2);\n sinc = Math.sin(c);\n cosc = Math.cos(c);\n lat = Math.asin(cosc * this.sinc0 + p.y * sinc * this.cosc0 / rho);\n lon = Math.atan2(p.x * sinc, rho * this.cosc0 * cosc - p.y * this.sinc0 * sinc);\n }\n else {\n lat = this.phic0;\n lon = 0;\n }\n\n p.x = lon;\n p.y = lat;\n _gauss__WEBPACK_IMPORTED_MODULE_0__[\"default\"].inverse.apply(this, [p]);\n p.x = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(p.x + this.long0);\n return p;\n}\n\nvar names = [\"Stereographic_North_Pole\", \"Oblique_Stereographic\", \"Polar_Stereographic\", \"sterea\",\"Oblique Stereographic Alternative\",\"Double_Stereographic\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/sterea.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/tmerc.js": +/*!*****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/tmerc.js ***! + \*****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_pj_enfn__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/pj_enfn */ \"./node_modules/proj4/lib/common/pj_enfn.js\");\n/* harmony import */ var _common_pj_mlfn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/pj_mlfn */ \"./node_modules/proj4/lib/common/pj_mlfn.js\");\n/* harmony import */ var _common_pj_inv_mlfn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/pj_inv_mlfn */ \"./node_modules/proj4/lib/common/pj_inv_mlfn.js\");\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_sign__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/sign */ \"./node_modules/proj4/lib/common/sign.js\");\n// Heavily based on this tmerc projection implementation\n// https://github.com/mbloch/mapshaper-proj/blob/master/src/projections/tmerc.js\n\n\n\n\n\n\n\n\n\nfunction init() {\n this.x0 = this.x0 !== undefined ? this.x0 : 0;\n this.y0 = this.y0 !== undefined ? this.y0 : 0;\n this.long0 = this.long0 !== undefined ? this.long0 : 0;\n this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;\n\n if (this.es) {\n this.en = Object(_common_pj_enfn__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.es);\n this.ml0 = Object(_common_pj_mlfn__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en);\n }\n}\n\n/**\n Transverse Mercator Forward - long/lat to x/y\n long/lat in radians\n */\nfunction forward(p) {\n var lon = p.x;\n var lat = p.y;\n\n var delta_lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(lon - this.long0);\n var con;\n var x, y;\n var sin_phi = Math.sin(lat);\n var cos_phi = Math.cos(lat);\n\n if (!this.es) {\n var b = cos_phi * Math.sin(delta_lon);\n\n if ((Math.abs(Math.abs(b) - 1)) < _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n return (93);\n }\n else {\n x = 0.5 * this.a * this.k0 * Math.log((1 + b) / (1 - b)) + this.x0;\n y = cos_phi * Math.cos(delta_lon) / Math.sqrt(1 - Math.pow(b, 2));\n b = Math.abs(y);\n\n if (b >= 1) {\n if ((b - 1) > _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"]) {\n return (93);\n }\n else {\n y = 0;\n }\n }\n else {\n y = Math.acos(y);\n }\n\n if (lat < 0) {\n y = -y;\n }\n\n y = this.a * this.k0 * (y - this.lat0) + this.y0;\n }\n }\n else {\n var al = cos_phi * delta_lon;\n var als = Math.pow(al, 2);\n var c = this.ep2 * Math.pow(cos_phi, 2);\n var cs = Math.pow(c, 2);\n var tq = Math.abs(cos_phi) > _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"] ? Math.tan(lat) : 0;\n var t = Math.pow(tq, 2);\n var ts = Math.pow(t, 2);\n con = 1 - this.es * Math.pow(sin_phi, 2);\n al = al / Math.sqrt(con);\n var ml = Object(_common_pj_mlfn__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(lat, sin_phi, cos_phi, this.en);\n\n x = this.a * (this.k0 * al * (1 +\n als / 6 * (1 - t + c +\n als / 20 * (5 - 18 * t + ts + 14 * c - 58 * t * c +\n als / 42 * (61 + 179 * ts - ts * t - 479 * t))))) +\n this.x0;\n\n y = this.a * (this.k0 * (ml - this.ml0 +\n sin_phi * delta_lon * al / 2 * (1 +\n als / 12 * (5 - t + 9 * c + 4 * cs +\n als / 30 * (61 + ts - 58 * t + 270 * c - 330 * t * c +\n als / 56 * (1385 + 543 * ts - ts * t - 3111 * t)))))) +\n this.y0;\n }\n\n p.x = x;\n p.y = y;\n\n return p;\n}\n\n/**\n Transverse Mercator Inverse - x/y to long/lat\n */\nfunction inverse(p) {\n var con, phi;\n var lat, lon;\n var x = (p.x - this.x0) * (1 / this.a);\n var y = (p.y - this.y0) * (1 / this.a);\n\n if (!this.es) {\n var f = Math.exp(x / this.k0);\n var g = 0.5 * (f - 1 / f);\n var temp = this.lat0 + y / this.k0;\n var h = Math.cos(temp);\n con = Math.sqrt((1 - Math.pow(h, 2)) / (1 + Math.pow(g, 2)));\n lat = Math.asin(con);\n\n if (y < 0) {\n lat = -lat;\n }\n\n if ((g === 0) && (h === 0)) {\n lon = 0;\n }\n else {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(Math.atan2(g, h) + this.long0);\n }\n }\n else { // ellipsoidal form\n con = this.ml0 + y / this.k0;\n phi = Object(_common_pj_inv_mlfn__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(con, this.es, this.en);\n\n if (Math.abs(phi) < _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"HALF_PI\"]) {\n var sin_phi = Math.sin(phi);\n var cos_phi = Math.cos(phi);\n var tan_phi = Math.abs(cos_phi) > _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"EPSLN\"] ? Math.tan(phi) : 0;\n var c = this.ep2 * Math.pow(cos_phi, 2);\n var cs = Math.pow(c, 2);\n var t = Math.pow(tan_phi, 2);\n var ts = Math.pow(t, 2);\n con = 1 - this.es * Math.pow(sin_phi, 2);\n var d = x * Math.sqrt(con) / this.k0;\n var ds = Math.pow(d, 2);\n con = con * tan_phi;\n\n lat = phi - (con * ds / (1 - this.es)) * 0.5 * (1 -\n ds / 12 * (5 + 3 * t - 9 * c * t + c - 4 * cs -\n ds / 30 * (61 + 90 * t - 252 * c * t + 45 * ts + 46 * c -\n ds / 56 * (1385 + 3633 * t + 4095 * ts + 1574 * ts * t))));\n\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.long0 + (d * (1 -\n ds / 6 * (1 + 2 * t + c -\n ds / 20 * (5 + 28 * t + 24 * ts + 8 * c * t + 6 * c -\n ds / 42 * (61 + 662 * t + 1320 * ts + 720 * ts * t)))) / cos_phi));\n }\n else {\n lat = _constants_values__WEBPACK_IMPORTED_MODULE_4__[\"HALF_PI\"] * Object(_common_sign__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(y);\n lon = 0;\n }\n }\n\n p.x = lon;\n p.y = lat;\n\n return p;\n}\n\nvar names = [\"Fast_Transverse_Mercator\", \"Fast Transverse Mercator\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/tmerc.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/tpers.js": +/*!*****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/tpers.js ***! + \*****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_hypot__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common/hypot */ \"./node_modules/proj4/lib/common/hypot.js\");\n\nvar mode = {\n N_POLE: 0,\n S_POLE: 1,\n EQUIT: 2,\n OBLIQ: 3\n};\n\n\n\n\nvar params = {\n h: { def: 100000, num: true }, // default is Karman line, no default in PROJ.7\n azi: { def: 0, num: true, degrees: true }, // default is North\n tilt: { def: 0, num: true, degrees: true }, // default is Nadir\n long0: { def: 0, num: true }, // default is Greenwich, conversion to rad is automatic\n lat0: { def: 0, num: true } // default is Equator, conversion to rad is automatic\n};\n\nfunction init() {\n Object.keys(params).forEach(function (p) {\n if (typeof this[p] === \"undefined\") {\n this[p] = params[p].def;\n } else if (params[p].num && isNaN(this[p])) {\n throw new Error(\"Invalid parameter value, must be numeric \" + p + \" = \" + this[p]);\n } else if (params[p].num) {\n this[p] = parseFloat(this[p]);\n }\n if (params[p].degrees) {\n this[p] = this[p] * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"];\n }\n }.bind(this));\n\n if (Math.abs((Math.abs(this.lat0) - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"])) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.mode = this.lat0 < 0 ? mode.S_POLE : mode.N_POLE;\n } else if (Math.abs(this.lat0) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.mode = mode.EQUIT;\n } else {\n this.mode = mode.OBLIQ;\n this.sinph0 = Math.sin(this.lat0);\n this.cosph0 = Math.cos(this.lat0);\n }\n\n this.pn1 = this.h / this.a; // Normalize relative to the Earth's radius\n\n if (this.pn1 <= 0 || this.pn1 > 1e10) {\n throw new Error(\"Invalid height\");\n }\n \n this.p = 1 + this.pn1;\n this.rp = 1 / this.p;\n this.h1 = 1 / this.pn1;\n this.pfact = (this.p + 1) * this.h1;\n this.es = 0;\n\n var omega = this.tilt;\n var gamma = this.azi;\n this.cg = Math.cos(gamma);\n this.sg = Math.sin(gamma);\n this.cw = Math.cos(omega);\n this.sw = Math.sin(omega);\n}\n\nfunction forward(p) {\n p.x -= this.long0;\n var sinphi = Math.sin(p.y);\n var cosphi = Math.cos(p.y);\n var coslam = Math.cos(p.x);\n var x, y;\n switch (this.mode) {\n case mode.OBLIQ:\n y = this.sinph0 * sinphi + this.cosph0 * cosphi * coslam;\n break;\n case mode.EQUIT:\n y = cosphi * coslam;\n break;\n case mode.S_POLE:\n y = -sinphi;\n break;\n case mode.N_POLE:\n y = sinphi;\n break;\n }\n y = this.pn1 / (this.p - y);\n x = y * cosphi * Math.sin(p.x);\n\n switch (this.mode) {\n case mode.OBLIQ:\n y *= this.cosph0 * sinphi - this.sinph0 * cosphi * coslam;\n break;\n case mode.EQUIT:\n y *= sinphi;\n break;\n case mode.N_POLE:\n y *= -(cosphi * coslam);\n break;\n case mode.S_POLE:\n y *= cosphi * coslam;\n break;\n }\n\n // Tilt \n var yt, ba;\n yt = y * this.cg + x * this.sg;\n ba = 1 / (yt * this.sw * this.h1 + this.cw);\n x = (x * this.cg - y * this.sg) * this.cw * ba;\n y = yt * ba;\n\n p.x = x * this.a;\n p.y = y * this.a;\n return p;\n}\n\nfunction inverse(p) {\n p.x /= this.a;\n p.y /= this.a;\n var r = { x: p.x, y: p.y };\n\n // Un-Tilt\n var bm, bq, yt;\n yt = 1 / (this.pn1 - p.y * this.sw);\n bm = this.pn1 * p.x * yt;\n bq = this.pn1 * p.y * this.cw * yt;\n p.x = bm * this.cg + bq * this.sg;\n p.y = bq * this.cg - bm * this.sg;\n\n var rh = Object(_common_hypot__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(p.x, p.y);\n if (Math.abs(rh) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n r.x = 0;\n r.y = p.y;\n } else {\n var cosz, sinz;\n sinz = 1 - rh * rh * this.pfact;\n sinz = (this.p - Math.sqrt(sinz)) / (this.pn1 / rh + rh / this.pn1);\n cosz = Math.sqrt(1 - sinz * sinz);\n switch (this.mode) {\n case mode.OBLIQ:\n r.y = Math.asin(cosz * this.sinph0 + p.y * sinz * this.cosph0 / rh);\n p.y = (cosz - this.sinph0 * Math.sin(r.y)) * rh;\n p.x *= sinz * this.cosph0;\n break;\n case mode.EQUIT:\n r.y = Math.asin(p.y * sinz / rh);\n p.y = cosz * rh;\n p.x *= sinz;\n break;\n case mode.N_POLE:\n r.y = Math.asin(cosz);\n p.y = -p.y;\n break;\n case mode.S_POLE:\n r.y = -Math.asin(cosz);\n break;\n }\n r.x = Math.atan2(p.x, p.y);\n }\n\n p.x = r.x + this.long0;\n p.y = r.y;\n return p;\n}\n\nvar names = [\"Tilted_Perspective\", \"tpers\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/tpers.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/utm.js": +/*!***************************************************!*\ + !*** ./node_modules/proj4/lib/projections/utm.js ***! + \***************************************************/ +/*! exports provided: dependsOn, init, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dependsOn\", function() { return dependsOn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_zone__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_zone */ \"./node_modules/proj4/lib/common/adjust_zone.js\");\n/* harmony import */ var _etmerc__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./etmerc */ \"./node_modules/proj4/lib/projections/etmerc.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n\n\nvar dependsOn = 'etmerc';\n\n\n\nfunction init() {\n var zone = Object(_common_adjust_zone__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.zone, this.long0);\n if (zone === undefined) {\n throw new Error('unknown utm zone');\n }\n this.lat0 = 0;\n this.long0 = ((6 * Math.abs(zone)) - 183) * _constants_values__WEBPACK_IMPORTED_MODULE_2__[\"D2R\"];\n this.x0 = 500000;\n this.y0 = this.utmSouth ? 10000000 : 0;\n this.k0 = 0.9996;\n\n _etmerc__WEBPACK_IMPORTED_MODULE_1__[\"default\"].init.apply(this);\n this.forward = _etmerc__WEBPACK_IMPORTED_MODULE_1__[\"default\"].forward;\n this.inverse = _etmerc__WEBPACK_IMPORTED_MODULE_1__[\"default\"].inverse;\n}\n\nvar names = [\"Universal Transverse Mercator System\", \"utm\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n names: names,\n dependsOn: dependsOn\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/utm.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/projections/vandg.js": +/*!*****************************************************!*\ + !*** ./node_modules/proj4/lib/projections/vandg.js ***! + \*****************************************************/ +/*! exports provided: init, forward, inverse, names, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"init\", function() { return init; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forward\", function() { return forward; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"names\", function() { return names; });\n/* harmony import */ var _common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../common/adjust_lon */ \"./node_modules/proj4/lib/common/adjust_lon.js\");\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _common_asinz__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/asinz */ \"./node_modules/proj4/lib/common/asinz.js\");\n\n\n\n\n\n\n/* Initialize the Van Der Grinten projection\n ----------------------------------------*/\nfunction init() {\n //this.R = 6370997; //Radius of earth\n this.R = this.a;\n}\n\nfunction forward(p) {\n\n var lon = p.x;\n var lat = p.y;\n\n /* Forward equations\n -----------------*/\n var dlon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(lon - this.long0);\n var x, y;\n\n if (Math.abs(lat) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n x = this.x0 + this.R * dlon;\n y = this.y0;\n }\n var theta = Object(_common_asinz__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(2 * Math.abs(lat / Math.PI));\n if ((Math.abs(dlon) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) || (Math.abs(Math.abs(lat) - _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"HALF_PI\"]) <= _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"])) {\n x = this.x0;\n if (lat >= 0) {\n y = this.y0 + Math.PI * this.R * Math.tan(0.5 * theta);\n }\n else {\n y = this.y0 + Math.PI * this.R * -Math.tan(0.5 * theta);\n }\n // return(OK);\n }\n var al = 0.5 * Math.abs((Math.PI / dlon) - (dlon / Math.PI));\n var asq = al * al;\n var sinth = Math.sin(theta);\n var costh = Math.cos(theta);\n\n var g = costh / (sinth + costh - 1);\n var gsq = g * g;\n var m = g * (2 / sinth - 1);\n var msq = m * m;\n var con = Math.PI * this.R * (al * (g - msq) + Math.sqrt(asq * (g - msq) * (g - msq) - (msq + asq) * (gsq - msq))) / (msq + asq);\n if (dlon < 0) {\n con = -con;\n }\n x = this.x0 + con;\n //con = Math.abs(con / (Math.PI * this.R));\n var q = asq + g;\n con = Math.PI * this.R * (m * q - al * Math.sqrt((msq + asq) * (asq + 1) - q * q)) / (msq + asq);\n if (lat >= 0) {\n //y = this.y0 + Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con);\n y = this.y0 + con;\n }\n else {\n //y = this.y0 - Math.PI * this.R * Math.sqrt(1 - con * con - 2 * al * con);\n y = this.y0 - con;\n }\n p.x = x;\n p.y = y;\n return p;\n}\n\n/* Van Der Grinten inverse equations--mapping x,y to lat/long\n ---------------------------------------------------------*/\nfunction inverse(p) {\n var lon, lat;\n var xx, yy, xys, c1, c2, c3;\n var a1;\n var m1;\n var con;\n var th1;\n var d;\n\n /* inverse equations\n -----------------*/\n p.x -= this.x0;\n p.y -= this.y0;\n con = Math.PI * this.R;\n xx = p.x / con;\n yy = p.y / con;\n xys = xx * xx + yy * yy;\n c1 = -Math.abs(yy) * (1 + xys);\n c2 = c1 - 2 * yy * yy + xx * xx;\n c3 = -2 * c1 + 1 + 2 * yy * yy + xys * xys;\n d = yy * yy / c3 + (2 * c2 * c2 * c2 / c3 / c3 / c3 - 9 * c1 * c2 / c3 / c3) / 27;\n a1 = (c1 - c2 * c2 / 3 / c3) / c3;\n m1 = 2 * Math.sqrt(-a1 / 3);\n con = ((3 * d) / a1) / m1;\n if (Math.abs(con) > 1) {\n if (con >= 0) {\n con = 1;\n }\n else {\n con = -1;\n }\n }\n th1 = Math.acos(con) / 3;\n if (p.y >= 0) {\n lat = (-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;\n }\n else {\n lat = -(-m1 * Math.cos(th1 + Math.PI / 3) - c2 / 3 / c3) * Math.PI;\n }\n\n if (Math.abs(xx) < _constants_values__WEBPACK_IMPORTED_MODULE_1__[\"EPSLN\"]) {\n lon = this.long0;\n }\n else {\n lon = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.long0 + Math.PI * (xys - 1 + Math.sqrt(1 + 2 * (xx * xx - yy * yy) + xys * xys)) / 2 / xx);\n }\n\n p.x = lon;\n p.y = lat;\n return p;\n}\n\nvar names = [\"Van_der_Grinten_I\", \"VanDerGrinten\", \"vandg\"];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n init: init,\n forward: forward,\n inverse: inverse,\n names: names\n});\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/projections/vandg.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/lib/transform.js": +/*!*********************************************!*\ + !*** ./node_modules/proj4/lib/transform.js ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return transform; });\n/* harmony import */ var _constants_values__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants/values */ \"./node_modules/proj4/lib/constants/values.js\");\n/* harmony import */ var _datum_transform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./datum_transform */ \"./node_modules/proj4/lib/datum_transform.js\");\n/* harmony import */ var _adjust_axis__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./adjust_axis */ \"./node_modules/proj4/lib/adjust_axis.js\");\n/* harmony import */ var _Proj__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Proj */ \"./node_modules/proj4/lib/Proj.js\");\n/* harmony import */ var _common_toPoint__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./common/toPoint */ \"./node_modules/proj4/lib/common/toPoint.js\");\n/* harmony import */ var _checkSanity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./checkSanity */ \"./node_modules/proj4/lib/checkSanity.js\");\n\n\n\n\n\n\n\nfunction checkNotWGS(source, dest) {\n return ((source.datum.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"] || source.datum.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"]) && dest.datumCode !== 'WGS84') || ((dest.datum.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_3PARAM\"] || dest.datum.datum_type === _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"PJD_7PARAM\"]) && source.datumCode !== 'WGS84');\n}\n\nfunction transform(source, dest, point) {\n var wgs84;\n if (Array.isArray(point)) {\n point = Object(_common_toPoint__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(point);\n }\n Object(_checkSanity__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(point);\n // Workaround for datum shifts towgs84, if either source or destination projection is not wgs84\n if (source.datum && dest.datum && checkNotWGS(source, dest)) {\n wgs84 = new _Proj__WEBPACK_IMPORTED_MODULE_3__[\"default\"]('WGS84');\n point = transform(source, wgs84, point);\n source = wgs84;\n }\n // DGR, 2010/11/12\n if (source.axis !== 'enu') {\n point = Object(_adjust_axis__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(source, false, point);\n }\n // Transform source points to long/lat, if they aren't already.\n if (source.projName === 'longlat') {\n point = {\n x: point.x * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"],\n y: point.y * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"D2R\"],\n z: point.z || 0\n };\n } else {\n if (source.to_meter) {\n point = {\n x: point.x * source.to_meter,\n y: point.y * source.to_meter,\n z: point.z || 0\n };\n }\n point = source.inverse(point); // Convert Cartesian to longlat\n if (!point) {\n return;\n }\n }\n // Adjust for the prime meridian if necessary\n if (source.from_greenwich) {\n point.x += source.from_greenwich;\n }\n\n // Convert datums if needed, and if possible.\n point = Object(_datum_transform__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(source.datum, dest.datum, point);\n if (!point) {\n return;\n }\n\n // Adjust for the prime meridian if necessary\n if (dest.from_greenwich) {\n point = {\n x: point.x - dest.from_greenwich,\n y: point.y,\n z: point.z || 0\n };\n }\n\n if (dest.projName === 'longlat') {\n // convert radians to decimal degrees\n point = {\n x: point.x * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"R2D\"],\n y: point.y * _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"R2D\"],\n z: point.z || 0\n };\n } else { // else project\n point = dest.forward(point);\n if (dest.to_meter) {\n point = {\n x: point.x / dest.to_meter,\n y: point.y / dest.to_meter,\n z: point.z || 0\n };\n }\n }\n\n // DGR, 2010/11/12\n if (dest.axis !== 'enu') {\n return Object(_adjust_axis__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(dest, true, point);\n }\n\n return point;\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/lib/transform.js?"); + +/***/ }), + +/***/ "./node_modules/proj4/projs.js": +/*!*************************************!*\ + !*** ./node_modules/proj4/projs.js ***! + \*************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _lib_projections_tmerc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/projections/tmerc */ \"./node_modules/proj4/lib/projections/tmerc.js\");\n/* harmony import */ var _lib_projections_etmerc__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/projections/etmerc */ \"./node_modules/proj4/lib/projections/etmerc.js\");\n/* harmony import */ var _lib_projections_utm__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/projections/utm */ \"./node_modules/proj4/lib/projections/utm.js\");\n/* harmony import */ var _lib_projections_sterea__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/projections/sterea */ \"./node_modules/proj4/lib/projections/sterea.js\");\n/* harmony import */ var _lib_projections_stere__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/projections/stere */ \"./node_modules/proj4/lib/projections/stere.js\");\n/* harmony import */ var _lib_projections_somerc__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/projections/somerc */ \"./node_modules/proj4/lib/projections/somerc.js\");\n/* harmony import */ var _lib_projections_omerc__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./lib/projections/omerc */ \"./node_modules/proj4/lib/projections/omerc.js\");\n/* harmony import */ var _lib_projections_lcc__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./lib/projections/lcc */ \"./node_modules/proj4/lib/projections/lcc.js\");\n/* harmony import */ var _lib_projections_krovak__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./lib/projections/krovak */ \"./node_modules/proj4/lib/projections/krovak.js\");\n/* harmony import */ var _lib_projections_cass__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./lib/projections/cass */ \"./node_modules/proj4/lib/projections/cass.js\");\n/* harmony import */ var _lib_projections_laea__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./lib/projections/laea */ \"./node_modules/proj4/lib/projections/laea.js\");\n/* harmony import */ var _lib_projections_aea__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./lib/projections/aea */ \"./node_modules/proj4/lib/projections/aea.js\");\n/* harmony import */ var _lib_projections_gnom__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./lib/projections/gnom */ \"./node_modules/proj4/lib/projections/gnom.js\");\n/* harmony import */ var _lib_projections_cea__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./lib/projections/cea */ \"./node_modules/proj4/lib/projections/cea.js\");\n/* harmony import */ var _lib_projections_eqc__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./lib/projections/eqc */ \"./node_modules/proj4/lib/projections/eqc.js\");\n/* harmony import */ var _lib_projections_poly__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./lib/projections/poly */ \"./node_modules/proj4/lib/projections/poly.js\");\n/* harmony import */ var _lib_projections_nzmg__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./lib/projections/nzmg */ \"./node_modules/proj4/lib/projections/nzmg.js\");\n/* harmony import */ var _lib_projections_mill__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./lib/projections/mill */ \"./node_modules/proj4/lib/projections/mill.js\");\n/* harmony import */ var _lib_projections_sinu__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./lib/projections/sinu */ \"./node_modules/proj4/lib/projections/sinu.js\");\n/* harmony import */ var _lib_projections_moll__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./lib/projections/moll */ \"./node_modules/proj4/lib/projections/moll.js\");\n/* harmony import */ var _lib_projections_eqdc__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./lib/projections/eqdc */ \"./node_modules/proj4/lib/projections/eqdc.js\");\n/* harmony import */ var _lib_projections_vandg__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./lib/projections/vandg */ \"./node_modules/proj4/lib/projections/vandg.js\");\n/* harmony import */ var _lib_projections_aeqd__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./lib/projections/aeqd */ \"./node_modules/proj4/lib/projections/aeqd.js\");\n/* harmony import */ var _lib_projections_ortho__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./lib/projections/ortho */ \"./node_modules/proj4/lib/projections/ortho.js\");\n/* harmony import */ var _lib_projections_qsc__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./lib/projections/qsc */ \"./node_modules/proj4/lib/projections/qsc.js\");\n/* harmony import */ var _lib_projections_robin__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./lib/projections/robin */ \"./node_modules/proj4/lib/projections/robin.js\");\n/* harmony import */ var _lib_projections_geocent__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./lib/projections/geocent */ \"./node_modules/proj4/lib/projections/geocent.js\");\n/* harmony import */ var _lib_projections_tpers__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./lib/projections/tpers */ \"./node_modules/proj4/lib/projections/tpers.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(proj4){\n proj4.Proj.projections.add(_lib_projections_tmerc__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_etmerc__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_utm__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_sterea__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_stere__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_somerc__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_omerc__WEBPACK_IMPORTED_MODULE_6__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_lcc__WEBPACK_IMPORTED_MODULE_7__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_krovak__WEBPACK_IMPORTED_MODULE_8__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_cass__WEBPACK_IMPORTED_MODULE_9__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_laea__WEBPACK_IMPORTED_MODULE_10__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_aea__WEBPACK_IMPORTED_MODULE_11__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_gnom__WEBPACK_IMPORTED_MODULE_12__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_cea__WEBPACK_IMPORTED_MODULE_13__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_eqc__WEBPACK_IMPORTED_MODULE_14__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_poly__WEBPACK_IMPORTED_MODULE_15__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_nzmg__WEBPACK_IMPORTED_MODULE_16__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_mill__WEBPACK_IMPORTED_MODULE_17__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_sinu__WEBPACK_IMPORTED_MODULE_18__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_moll__WEBPACK_IMPORTED_MODULE_19__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_eqdc__WEBPACK_IMPORTED_MODULE_20__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_vandg__WEBPACK_IMPORTED_MODULE_21__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_aeqd__WEBPACK_IMPORTED_MODULE_22__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_ortho__WEBPACK_IMPORTED_MODULE_23__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_qsc__WEBPACK_IMPORTED_MODULE_24__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_robin__WEBPACK_IMPORTED_MODULE_25__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_geocent__WEBPACK_IMPORTED_MODULE_26__[\"default\"]);\n proj4.Proj.projections.add(_lib_projections_tpers__WEBPACK_IMPORTED_MODULE_27__[\"default\"]);\n});\n\n//# sourceURL=webpack://LithoSphere/./node_modules/proj4/projs.js?"); + +/***/ }), + +/***/ "./node_modules/quickselect/quickselect.js": +/*!*************************************************!*\ + !*** ./node_modules/quickselect/quickselect.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("(function (global, factory) {\n\t true ? module.exports = factory() :\n\tundefined;\n}(this, (function () { 'use strict';\n\nfunction quickselect(arr, k, left, right, compare) {\n quickselectStep(arr, k, left || 0, right || (arr.length - 1), compare || defaultCompare);\n}\n\nfunction quickselectStep(arr, k, left, right, compare) {\n\n while (right > left) {\n if (right - left > 600) {\n var n = right - left + 1;\n var m = k - left + 1;\n var z = Math.log(n);\n var s = 0.5 * Math.exp(2 * z / 3);\n var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n var newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n quickselectStep(arr, k, newLeft, newRight, compare);\n }\n\n var t = arr[k];\n var i = left;\n var j = right;\n\n swap(arr, left, k);\n if (compare(arr[right], t) > 0) swap(arr, left, right);\n\n while (i < j) {\n swap(arr, i, j);\n i++;\n j--;\n while (compare(arr[i], t) < 0) i++;\n while (compare(arr[j], t) > 0) j--;\n }\n\n if (compare(arr[left], t) === 0) swap(arr, left, j);\n else {\n j++;\n swap(arr, j, right);\n }\n\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n}\n\nfunction swap(arr, i, j) {\n var tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n}\n\nfunction defaultCompare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\nreturn quickselect;\n\n})));\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/quickselect/quickselect.js?"); + +/***/ }), + +/***/ "./node_modules/rbush/index.js": +/*!*************************************!*\ + !*** ./node_modules/rbush/index.js ***! + \*************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nmodule.exports = rbush;\nmodule.exports.default = rbush;\n\nvar quickselect = __webpack_require__(/*! quickselect */ \"./node_modules/quickselect/quickselect.js\");\n\nfunction rbush(maxEntries, format) {\n if (!(this instanceof rbush)) return new rbush(maxEntries, format);\n\n // max entries in a node is 9 by default; min node fill is 40% for best performance\n this._maxEntries = Math.max(4, maxEntries || 9);\n this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4));\n\n if (format) {\n this._initFormat(format);\n }\n\n this.clear();\n}\n\nrbush.prototype = {\n\n all: function () {\n return this._all(this.data, []);\n },\n\n search: function (bbox) {\n\n var node = this.data,\n result = [],\n toBBox = this.toBBox;\n\n if (!intersects(bbox, node)) return result;\n\n var nodesToSearch = [],\n i, len, child, childBBox;\n\n while (node) {\n for (i = 0, len = node.children.length; i < len; i++) {\n\n child = node.children[i];\n childBBox = node.leaf ? toBBox(child) : child;\n\n if (intersects(bbox, childBBox)) {\n if (node.leaf) result.push(child);\n else if (contains(bbox, childBBox)) this._all(child, result);\n else nodesToSearch.push(child);\n }\n }\n node = nodesToSearch.pop();\n }\n\n return result;\n },\n\n collides: function (bbox) {\n\n var node = this.data,\n toBBox = this.toBBox;\n\n if (!intersects(bbox, node)) return false;\n\n var nodesToSearch = [],\n i, len, child, childBBox;\n\n while (node) {\n for (i = 0, len = node.children.length; i < len; i++) {\n\n child = node.children[i];\n childBBox = node.leaf ? toBBox(child) : child;\n\n if (intersects(bbox, childBBox)) {\n if (node.leaf || contains(bbox, childBBox)) return true;\n nodesToSearch.push(child);\n }\n }\n node = nodesToSearch.pop();\n }\n\n return false;\n },\n\n load: function (data) {\n if (!(data && data.length)) return this;\n\n if (data.length < this._minEntries) {\n for (var i = 0, len = data.length; i < len; i++) {\n this.insert(data[i]);\n }\n return this;\n }\n\n // recursively build the tree with the given data from scratch using OMT algorithm\n var node = this._build(data.slice(), 0, data.length - 1, 0);\n\n if (!this.data.children.length) {\n // save as is if tree is empty\n this.data = node;\n\n } else if (this.data.height === node.height) {\n // split root if trees have the same height\n this._splitRoot(this.data, node);\n\n } else {\n if (this.data.height < node.height) {\n // swap trees if inserted one is bigger\n var tmpNode = this.data;\n this.data = node;\n node = tmpNode;\n }\n\n // insert the small tree into the large tree at appropriate level\n this._insert(node, this.data.height - node.height - 1, true);\n }\n\n return this;\n },\n\n insert: function (item) {\n if (item) this._insert(item, this.data.height - 1);\n return this;\n },\n\n clear: function () {\n this.data = createNode([]);\n return this;\n },\n\n remove: function (item, equalsFn) {\n if (!item) return this;\n\n var node = this.data,\n bbox = this.toBBox(item),\n path = [],\n indexes = [],\n i, parent, index, goingUp;\n\n // depth-first iterative tree traversal\n while (node || path.length) {\n\n if (!node) { // go up\n node = path.pop();\n parent = path[path.length - 1];\n i = indexes.pop();\n goingUp = true;\n }\n\n if (node.leaf) { // check current node\n index = findItem(item, node.children, equalsFn);\n\n if (index !== -1) {\n // item found, remove the item and condense tree upwards\n node.children.splice(index, 1);\n path.push(node);\n this._condense(path);\n return this;\n }\n }\n\n if (!goingUp && !node.leaf && contains(node, bbox)) { // go down\n path.push(node);\n indexes.push(i);\n i = 0;\n parent = node;\n node = node.children[0];\n\n } else if (parent) { // go right\n i++;\n node = parent.children[i];\n goingUp = false;\n\n } else node = null; // nothing found\n }\n\n return this;\n },\n\n toBBox: function (item) { return item; },\n\n compareMinX: compareNodeMinX,\n compareMinY: compareNodeMinY,\n\n toJSON: function () { return this.data; },\n\n fromJSON: function (data) {\n this.data = data;\n return this;\n },\n\n _all: function (node, result) {\n var nodesToSearch = [];\n while (node) {\n if (node.leaf) result.push.apply(result, node.children);\n else nodesToSearch.push.apply(nodesToSearch, node.children);\n\n node = nodesToSearch.pop();\n }\n return result;\n },\n\n _build: function (items, left, right, height) {\n\n var N = right - left + 1,\n M = this._maxEntries,\n node;\n\n if (N <= M) {\n // reached leaf level; return leaf\n node = createNode(items.slice(left, right + 1));\n calcBBox(node, this.toBBox);\n return node;\n }\n\n if (!height) {\n // target height of the bulk-loaded tree\n height = Math.ceil(Math.log(N) / Math.log(M));\n\n // target number of root entries to maximize storage utilization\n M = Math.ceil(N / Math.pow(M, height - 1));\n }\n\n node = createNode([]);\n node.leaf = false;\n node.height = height;\n\n // split the items into M mostly square tiles\n\n var N2 = Math.ceil(N / M),\n N1 = N2 * Math.ceil(Math.sqrt(M)),\n i, j, right2, right3;\n\n multiSelect(items, left, right, N1, this.compareMinX);\n\n for (i = left; i <= right; i += N1) {\n\n right2 = Math.min(i + N1 - 1, right);\n\n multiSelect(items, i, right2, N2, this.compareMinY);\n\n for (j = i; j <= right2; j += N2) {\n\n right3 = Math.min(j + N2 - 1, right2);\n\n // pack each entry recursively\n node.children.push(this._build(items, j, right3, height - 1));\n }\n }\n\n calcBBox(node, this.toBBox);\n\n return node;\n },\n\n _chooseSubtree: function (bbox, node, level, path) {\n\n var i, len, child, targetNode, area, enlargement, minArea, minEnlargement;\n\n while (true) {\n path.push(node);\n\n if (node.leaf || path.length - 1 === level) break;\n\n minArea = minEnlargement = Infinity;\n\n for (i = 0, len = node.children.length; i < len; i++) {\n child = node.children[i];\n area = bboxArea(child);\n enlargement = enlargedArea(bbox, child) - area;\n\n // choose entry with the least area enlargement\n if (enlargement < minEnlargement) {\n minEnlargement = enlargement;\n minArea = area < minArea ? area : minArea;\n targetNode = child;\n\n } else if (enlargement === minEnlargement) {\n // otherwise choose one with the smallest area\n if (area < minArea) {\n minArea = area;\n targetNode = child;\n }\n }\n }\n\n node = targetNode || node.children[0];\n }\n\n return node;\n },\n\n _insert: function (item, level, isNode) {\n\n var toBBox = this.toBBox,\n bbox = isNode ? item : toBBox(item),\n insertPath = [];\n\n // find the best node for accommodating the item, saving all nodes along the path too\n var node = this._chooseSubtree(bbox, this.data, level, insertPath);\n\n // put the item into the node\n node.children.push(item);\n extend(node, bbox);\n\n // split on node overflow; propagate upwards if necessary\n while (level >= 0) {\n if (insertPath[level].children.length > this._maxEntries) {\n this._split(insertPath, level);\n level--;\n } else break;\n }\n\n // adjust bboxes along the insertion path\n this._adjustParentBBoxes(bbox, insertPath, level);\n },\n\n // split overflowed node into two\n _split: function (insertPath, level) {\n\n var node = insertPath[level],\n M = node.children.length,\n m = this._minEntries;\n\n this._chooseSplitAxis(node, m, M);\n\n var splitIndex = this._chooseSplitIndex(node, m, M);\n\n var newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex));\n newNode.height = node.height;\n newNode.leaf = node.leaf;\n\n calcBBox(node, this.toBBox);\n calcBBox(newNode, this.toBBox);\n\n if (level) insertPath[level - 1].children.push(newNode);\n else this._splitRoot(node, newNode);\n },\n\n _splitRoot: function (node, newNode) {\n // split root node\n this.data = createNode([node, newNode]);\n this.data.height = node.height + 1;\n this.data.leaf = false;\n calcBBox(this.data, this.toBBox);\n },\n\n _chooseSplitIndex: function (node, m, M) {\n\n var i, bbox1, bbox2, overlap, area, minOverlap, minArea, index;\n\n minOverlap = minArea = Infinity;\n\n for (i = m; i <= M - m; i++) {\n bbox1 = distBBox(node, 0, i, this.toBBox);\n bbox2 = distBBox(node, i, M, this.toBBox);\n\n overlap = intersectionArea(bbox1, bbox2);\n area = bboxArea(bbox1) + bboxArea(bbox2);\n\n // choose distribution with minimum overlap\n if (overlap < minOverlap) {\n minOverlap = overlap;\n index = i;\n\n minArea = area < minArea ? area : minArea;\n\n } else if (overlap === minOverlap) {\n // otherwise choose distribution with minimum area\n if (area < minArea) {\n minArea = area;\n index = i;\n }\n }\n }\n\n return index;\n },\n\n // sorts node children by the best axis for split\n _chooseSplitAxis: function (node, m, M) {\n\n var compareMinX = node.leaf ? this.compareMinX : compareNodeMinX,\n compareMinY = node.leaf ? this.compareMinY : compareNodeMinY,\n xMargin = this._allDistMargin(node, m, M, compareMinX),\n yMargin = this._allDistMargin(node, m, M, compareMinY);\n\n // if total distributions margin value is minimal for x, sort by minX,\n // otherwise it's already sorted by minY\n if (xMargin < yMargin) node.children.sort(compareMinX);\n },\n\n // total margin of all possible split distributions where each node is at least m full\n _allDistMargin: function (node, m, M, compare) {\n\n node.children.sort(compare);\n\n var toBBox = this.toBBox,\n leftBBox = distBBox(node, 0, m, toBBox),\n rightBBox = distBBox(node, M - m, M, toBBox),\n margin = bboxMargin(leftBBox) + bboxMargin(rightBBox),\n i, child;\n\n for (i = m; i < M - m; i++) {\n child = node.children[i];\n extend(leftBBox, node.leaf ? toBBox(child) : child);\n margin += bboxMargin(leftBBox);\n }\n\n for (i = M - m - 1; i >= m; i--) {\n child = node.children[i];\n extend(rightBBox, node.leaf ? toBBox(child) : child);\n margin += bboxMargin(rightBBox);\n }\n\n return margin;\n },\n\n _adjustParentBBoxes: function (bbox, path, level) {\n // adjust bboxes along the given tree path\n for (var i = level; i >= 0; i--) {\n extend(path[i], bbox);\n }\n },\n\n _condense: function (path) {\n // go through the path, removing empty nodes and updating bboxes\n for (var i = path.length - 1, siblings; i >= 0; i--) {\n if (path[i].children.length === 0) {\n if (i > 0) {\n siblings = path[i - 1].children;\n siblings.splice(siblings.indexOf(path[i]), 1);\n\n } else this.clear();\n\n } else calcBBox(path[i], this.toBBox);\n }\n },\n\n _initFormat: function (format) {\n // data format (minX, minY, maxX, maxY accessors)\n\n // uses eval-type function compilation instead of just accepting a toBBox function\n // because the algorithms are very sensitive to sorting functions performance,\n // so they should be dead simple and without inner calls\n\n var compareArr = ['return a', ' - b', ';'];\n\n this.compareMinX = new Function('a', 'b', compareArr.join(format[0]));\n this.compareMinY = new Function('a', 'b', compareArr.join(format[1]));\n\n this.toBBox = new Function('a',\n 'return {minX: a' + format[0] +\n ', minY: a' + format[1] +\n ', maxX: a' + format[2] +\n ', maxY: a' + format[3] + '};');\n }\n};\n\nfunction findItem(item, items, equalsFn) {\n if (!equalsFn) return items.indexOf(item);\n\n for (var i = 0; i < items.length; i++) {\n if (equalsFn(item, items[i])) return i;\n }\n return -1;\n}\n\n// calculate node's bbox from bboxes of its children\nfunction calcBBox(node, toBBox) {\n distBBox(node, 0, node.children.length, toBBox, node);\n}\n\n// min bounding rectangle of node children from k to p-1\nfunction distBBox(node, k, p, toBBox, destNode) {\n if (!destNode) destNode = createNode(null);\n destNode.minX = Infinity;\n destNode.minY = Infinity;\n destNode.maxX = -Infinity;\n destNode.maxY = -Infinity;\n\n for (var i = k, child; i < p; i++) {\n child = node.children[i];\n extend(destNode, node.leaf ? toBBox(child) : child);\n }\n\n return destNode;\n}\n\nfunction extend(a, b) {\n a.minX = Math.min(a.minX, b.minX);\n a.minY = Math.min(a.minY, b.minY);\n a.maxX = Math.max(a.maxX, b.maxX);\n a.maxY = Math.max(a.maxY, b.maxY);\n return a;\n}\n\nfunction compareNodeMinX(a, b) { return a.minX - b.minX; }\nfunction compareNodeMinY(a, b) { return a.minY - b.minY; }\n\nfunction bboxArea(a) { return (a.maxX - a.minX) * (a.maxY - a.minY); }\nfunction bboxMargin(a) { return (a.maxX - a.minX) + (a.maxY - a.minY); }\n\nfunction enlargedArea(a, b) {\n return (Math.max(b.maxX, a.maxX) - Math.min(b.minX, a.minX)) *\n (Math.max(b.maxY, a.maxY) - Math.min(b.minY, a.minY));\n}\n\nfunction intersectionArea(a, b) {\n var minX = Math.max(a.minX, b.minX),\n minY = Math.max(a.minY, b.minY),\n maxX = Math.min(a.maxX, b.maxX),\n maxY = Math.min(a.maxY, b.maxY);\n\n return Math.max(0, maxX - minX) *\n Math.max(0, maxY - minY);\n}\n\nfunction contains(a, b) {\n return a.minX <= b.minX &&\n a.minY <= b.minY &&\n b.maxX <= a.maxX &&\n b.maxY <= a.maxY;\n}\n\nfunction intersects(a, b) {\n return b.minX <= a.maxX &&\n b.minY <= a.maxY &&\n b.maxX >= a.minX &&\n b.maxY >= a.minY;\n}\n\nfunction createNode(children) {\n return {\n children: children,\n height: 1,\n leaf: true,\n minX: Infinity,\n minY: Infinity,\n maxX: -Infinity,\n maxY: -Infinity\n };\n}\n\n// sort an array so that items come in groups of n unsorted items, with groups sorted between each other;\n// combines selection algorithm with binary divide & conquer approach\n\nfunction multiSelect(arr, left, right, n, compare) {\n var stack = [left, right],\n mid;\n\n while (stack.length) {\n right = stack.pop();\n left = stack.pop();\n\n if (right - left <= n) continue;\n\n mid = left + Math.ceil((right - left) / n / 2) * n;\n quickselect(arr, mid, left, right, compare);\n\n stack.push(left, mid, mid, right);\n }\n}\n\n\n//# sourceURL=webpack://LithoSphere/./node_modules/rbush/index.js?"); + +/***/ }), + +/***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js": +/*!****************************************************************************!*\ + !*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nvar stylesInDom = [];\n\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n\n for (var i = 0; i < stylesInDom.length; i++) {\n if (stylesInDom[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n\n return result;\n}\n\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var index = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3]\n };\n\n if (index !== -1) {\n stylesInDom[index].references++;\n stylesInDom[index].updater(obj);\n } else {\n stylesInDom.push({\n identifier: identifier,\n updater: addStyle(obj, options),\n references: 1\n });\n }\n\n identifiers.push(identifier);\n }\n\n return identifiers;\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n var attributes = options.attributes || {};\n\n if (typeof attributes.nonce === 'undefined') {\n var nonce = true ? __webpack_require__.nc : undefined;\n\n if (nonce) {\n attributes.nonce = nonce;\n }\n }\n\n Object.keys(attributes).forEach(function (key) {\n style.setAttribute(key, attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.media ? \"@media \".concat(obj.media, \" {\").concat(obj.css, \"}\") : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n } else {\n style.removeAttribute('media');\n }\n\n if (sourceMap && typeof btoa !== 'undefined') {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of + + +
+ + + + diff --git a/package.json b/package.json index afe8b98..39f2dec 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "lithosphere", - "version": "1.0.0", - "description": "A GIS library for building 3D tile-based globes.", + "version": "1.0.1", + "description": "LithoSphere is a GIS JavaScript library for building 3D tile-based globes in the web browser.", "author": "Tariq Soliman", "license": "Apache-2.0", "bugs": { diff --git a/src/controls/observe.ts b/src/controls/observe.ts index 52023f5..58573dd 100644 --- a/src/controls/observe.ts +++ b/src/controls/observe.ts @@ -168,7 +168,7 @@ export default class Observe { } private setCamera = (lockControls, skipLock?: boolean) => { - var w = this.getObserverValues() + const w = this.getObserverValues() this.p.setCenter( { lat: w.latitude, lng: w.longitude, zoom: this.p.zoom }, true @@ -405,7 +405,6 @@ export default class Observe { elFOV = document.getElementById('_lithosphere_WalkSettingsVerticalFovValue').value const screenFOV = this.p._.cameras.getFirstPersonFOV() - const screenAspect = this.p._.cameras.getFirstPersonAspect() const rect = this.p.getContainer().getBoundingClientRect() // Percents from top or left where inner fov bounds will be diff --git a/src/core/cameras.ts b/src/core/cameras.ts index e8f6735..fd4034c 100644 --- a/src/core/cameras.ts +++ b/src/core/cameras.ts @@ -241,8 +241,6 @@ export default class Camera { ) // Ask the browser to lock the pointer - element.requestPointerLock = element.requestPointerLock - if (/Firefox/i.test(navigator.userAgent)) { const fullscreenchange = function () { if (document.fullscreenElement === element) { diff --git a/src/core/crs.ts b/src/core/crs.ts new file mode 100644 index 0000000..ed32af9 --- /dev/null +++ b/src/core/crs.ts @@ -0,0 +1,165 @@ +// A lot of functions in here are adapted from Leaflet and/or proj4Leaflet +import Utils from '../utils' +import proj4 from 'proj4' + +export default class CRS { + options: any + transformation: any + projection: any + _scales: number[] + R: number + + constructor(code: string, proj: string, options: any, radius: number) { + this.options = options || {} + this.options.bounds = options.bounds || [] + this.options.transformation = new Transformation(1, 0, -1, 0) + if (this.options.origin) { + this.transformation = new Transformation( + 1, + -this.options.origin[0], + -1, + this.options.origin[1] + ) + } + + this.projection = new CRSProjection( + code, + proj, + bounds(options.bounds[0], options.bounds[1]) + ) + this.R = radius + + if (this.options.scales) { + this._scales = this.options.scales + } else if (this.options.resolutions) { + this._scales = [] + for (let i = this.options.resolutions.length - 1; i >= 0; i--) { + if (this.options.resolutions[i]) { + this._scales[i] = 1 / this.options.resolutions[i] + } + } + } + } + + project(latlng) { + return this.projection.project(latlng) + } + + unproject(point, zoom) { + return this.projection.unproject(point) + } + + pointToLatLng(point, zoom) { + const scale = this.scale(zoom) + const untransformedPoint = this.transformation.untransform(point, scale) + return this.projection.unproject(untransformedPoint) + } + + scale(zoom: number): number { + const iZoom = Math.floor(zoom) + let baseScale + let nextScale + let scaleDiff + let zDiff + + if (zoom === iZoom) { + return this._scales[zoom] + } else { + // Non-integer zoom, interpolate + baseScale = this._scales[iZoom] + nextScale = this._scales[iZoom + 1] + scaleDiff = nextScale - baseScale + zDiff = zoom - iZoom + return baseScale + scaleDiff * zDiff + } + } +} + +class CRSProjection { + _proj: any + bounds: number[] + + constructor(code, def, bounds) { + const isP4 = _isProj4Obj(code) + this._proj = isP4 ? code : this._projFromCodeDef(code, def) + this.bounds = isP4 ? def : bounds + } + project(latlng) { + const point = this._proj.forward([latlng.lng, latlng.lat]) + return { x: point[0], y: point[1] } + } + + unproject(point) { + const point2 = this._proj.inverse([point.x, point.y]) + return { lat: point2[1], lng: point2[0] } + } + + _projFromCodeDef(code, def) { + if (def) { + proj4.defs(code, def) + } else if (proj4.defs[code] === undefined) { + const urn = code.split(':') + if (urn.length > 3) { + code = urn[urn.length - 3] + ':' + urn[urn.length - 1] + } + if (proj4.defs[code] === undefined) { + throw 'No projection definition for code ' + code + } + } + // @ts-ignore + return proj4(code) + } +} + +class Transformation { + _a: number + _b: number + _c: number + _d: number + + constructor(a, b, c, d) { + if (Utils.isArray(a)) { + // use array properties + this._a = a[0] + this._b = a[1] + this._c = a[2] + this._d = a[3] + return + } + this._a = a + this._b = b + this._c = c + this._d = d + } + + transform(point, scale) { + return this._transform({ x: point.x, y: point.y }, scale) + } + + _transform(point, scale) { + scale = scale != null ? scale : 1 + point.x = scale * (this._a * point.x + this._b) + point.y = scale * (this._c * point.y + this._d) + return point + } + + untransform(point, scale) { + scale = scale != null ? scale : 1 + + return { + x: (point.x / scale - this._b) / this._a, + y: (point.y / scale - this._d) / this._c, + } + } +} + +function _isProj4Obj(a) { + return typeof a.inverse !== 'undefined' && typeof a.forward !== 'undefined' +} + +function bounds(a, b) { + return { + min: { x: a[0], y: a[1] }, + max: { x: b[0], y: b[1] }, + } +} diff --git a/src/core/events.ts b/src/core/events.ts index 1aa4173..fd72961 100644 --- a/src/core/events.ts +++ b/src/core/events.ts @@ -1,11 +1,9 @@ -import { Vector3, Matrix4 } from 'three' +import { Vector3, Matrix4, Sprite } from 'three' import circle from '@turf/circle' import booleanIntersects from '@turf/boolean-intersects' import Utils from '../utils' -import { Sprite } from 'three' - interface Private { mouseXY: { x: number; y: number } prevMouseXY: { x: number; y: number } @@ -20,7 +18,6 @@ interface Private { zoomWait: number highlightTimeout: any } -let flag = false export default class Events { _: Private @@ -307,7 +304,9 @@ export default class Events { Math.ceil( (nf * Math.log(2) - Math.log(zoomDist / Math.pow(5, nf - 1))) / Math.log(2) - ) + 1 + ) + + 2 - + Math.round(3396190 / this.p.projection.radii.major) this._.desiredZoom = dZoom @@ -555,7 +554,7 @@ export default class Events { // Gets features from tile.features private _highlightFeature(lng, lat, type, obj) { - const radiansPerPixel = Utils.getRadiansPerPixel(this.p.zoom) + //const radiansPerPixel = Utils.getRadiansPerPixel(this.p.zoom) const cursor = { type: 'Point', coordinates: [lng, lat] } diff --git a/src/core/projection.ts b/src/core/projection.ts index 7f6ef72..1e85439 100644 --- a/src/core/projection.ts +++ b/src/core/projection.ts @@ -1,4 +1,5 @@ -import { TileMapResource, LatLng, LatLngH, XYZ } from '../generalTypes' +import { TileMapResource, LatLng, LatLngH, XY, XYZ } from '../generalTypes' +import CRS from './CRS' import proj4 from 'proj4' interface Private { @@ -20,6 +21,8 @@ export default class Projection { radiusScale: number radii: Radii tileMapResource: TileMapResource + crs: any + trueTileResolution: number res: any e: number ep: number // eprime @@ -28,7 +31,8 @@ export default class Projection { constructor( majorRadius?: number, minorRadius?: number, - tileMapResource?: TileMapResource + tileMapResource?: TileMapResource, + trueTileResolution?: number ) { this._reset() @@ -37,10 +41,16 @@ export default class Projection { this.tileMapResource = tileMapResource || { bounds: null, origin: null, + crsCode: null, + epsg: null, proj: null, resunitsperpixel: null, reszoomlevel: null, } + this.tileMapResource.crsCode = + this.tileMapResource.crsCode || 'EPSG:4326' + + this.trueTileResolution = trueTileResolution || 256 // Populate Resolutions if ( @@ -56,6 +66,27 @@ export default class Projection { } this.res = res } + + const tmr = this.tileMapResource + this.crs = new CRS( + Number.isFinite(parseInt(tmr.crsCode[0])) + ? `EPSG:${tmr.epsg}` + : tmr.crsCode, + tmr.proj, + { + // @ts-ignore + origin: [parseFloat(tmr.origin[0]), parseFloat(tmr.origin[1])], + resolutions: this.res, + bounds: [ + // @ts-ignore + [parseFloat(tmr.bounds[0]), parseFloat(tmr.bounds[1])], + // @ts-ignore + [parseFloat(tmr.bounds[2]), parseFloat(tmr.bounds[3])], + ], + }, + // @ts-ignore + parseFloat(this.radii.major) + ) } _reset(): void { @@ -69,6 +100,7 @@ export default class Projection { this.tileMapResource = { bounds: null, origin: null, + crsCode: 'EPSG:4326', proj: null, resunitsperpixel: null, reszoomlevel: null, @@ -82,18 +114,50 @@ export default class Projection { if (which.toLowerCase() == 'major') this.radii.major = radius || this.baseRadius else if (which.toLowerCase() == 'minor') - this.radii.minor = radius || this.baseRadius + this.radii.minor = radius || this.radii.major || this.baseRadius + } + + invertY = (y: number, z: number): number => Math.pow(2, z) - 1 - y + + toBounds = (a: XY, b: XY) => { + const bounds = { + min: { x: null, y: null }, + max: { x: null, y: null }, + } + + bounds.min.x = Math.min(a.x, b.x) + bounds.max.x = Math.max(a.x, b.x) + bounds.min.y = Math.min(a.y, b.y) + bounds.max.y = Math.max(a.y, b.y) + + return bounds } - invertY = (y: number, z: number): number => { - return Math.pow(2, z) - 1 - y + tileXYZ2NwSe = (xyz: XYZ, tileResolution: number, asBounds?: boolean) => { + if (this.tileMapResource.proj == null) return null + + const nwPoint = { x: xyz.x * tileResolution, y: xyz.y * tileResolution } + const sePoint = { + x: nwPoint.x + tileResolution, + y: nwPoint.y + tileResolution, + } + const nw = this.crs.pointToLatLng(nwPoint, xyz.z) + const se = this.crs.pointToLatLng(sePoint, xyz.z) + + if (asBounds) + return this.toBounds(this.crs.project(nw), this.crs.project(se)) + + return { + nw, + se, + } } tileXYZ2LatLng = ( x: number, y: number, z: number, - flatXYZ: XYZ + flatXYZ?: XYZ ): LatLng => { if (this.tileMapResource.proj == null) { const lng = (x / Math.pow(2, z)) * 360 - 180 @@ -102,32 +166,27 @@ export default class Projection { (180 / Math.PI) * Math.atan(0.5 * (Math.exp(n) - Math.exp(-n))) return { lat: lat, lng: lng } } else { - // TODO //In these projections the origin is bottom left instead of top left //So flip the decimal value - + /* const dec = y % 1 if (dec != 0) y = Math.floor(y) + (1 - dec) else if (flatXYZ) { if (y == flatXYZ.y) y = flatXYZ.y + 1 else y = flatXYZ.y } + */ + + y = -y // For WMS const easting = - 256 * x * this.res[z] + this.tileMapResource.origin[0] + this.trueTileResolution * x * this.res[z] + + this.tileMapResource.origin[0] const northing = - 256 * y * this.res[z] + this.tileMapResource.origin[1] + this.trueTileResolution * y * this.res[z] + + this.tileMapResource.origin[1] - // @ts-ignore - const p = proj4(this.tileMapResource.proj).inverse([ - easting, - northing, - ]) - - return { - lat: p[1], - lng: p[0], - } + return this.crs.unproject({ x: easting, y: northing }) } } @@ -155,21 +214,22 @@ export default class Projection { return { x: x, y: y, z: z } } else { - // @ts-ignore - const p = proj4(this.tileMapResource.proj).forward([lng, lat]) + const p = this.crs.project({ lng: lng, lat: lat }) - const easting = p[0] - const northing = p[1] + const easting = p.x + const northing = p.y const x = - (easting - this.tileMapResource.origin[0]) / (256 * this.res[z]) + (easting - this.tileMapResource.origin[0]) / + (this.trueTileResolution * this.res[z]) let y = (northing - this.tileMapResource.origin[1]) / - (256 * this.res[z]) + (this.trueTileResolution * this.res[z]) //In these projections the origin is bottom left instead of top left //So flip the decimal value back - y = Math.floor(y) + (1 - (y % 1)) + //y = Math.floor(y) + (1 - (y % 1)) + y = -y // For WMS return { x: x, y: y, z: z } } } @@ -288,16 +348,16 @@ export default class Projection { lon2: number, lat2: number ): number => { - var R = this.radii.major / this.radiusScale - var φ1 = lat1 * (Math.PI / 180) - var φ2 = lat2 * (Math.PI / 180) - var Δφ = (lat2 - lat1) * (Math.PI / 180) - var Δλ = (lon2 - lon1) * (Math.PI / 180) + const R = this.radii.major / this.radiusScale + const φ1 = lat1 * (Math.PI / 180) + const φ2 = lat2 * (Math.PI / 180) + const Δφ = (lat2 - lat1) * (Math.PI / 180) + const Δλ = (lon2 - lon1) * (Math.PI / 180) - var a = + const a = Math.sin(Δφ / 2) * Math.sin(Δφ / 2) + Math.cos(φ1) * Math.cos(φ2) * Math.sin(Δλ / 2) * Math.sin(Δλ / 2) - var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)) + const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)) return R * c } diff --git a/src/core/renderer.ts b/src/core/renderer.ts index 05c4b9d..a0067c6 100644 --- a/src/core/renderer.ts +++ b/src/core/renderer.ts @@ -34,7 +34,7 @@ export default class Renderer { this.renderer.sortObjects = false this.renderer.autoClear = false - const gl = this.renderer.getContext() + //const gl = this.renderer.getContext() this.container.appendChild(this.renderer.domElement) diff --git a/src/core/shaders.ts b/src/core/shaders.ts index 57cedcb..8358625 100644 --- a/src/core/shaders.ts +++ b/src/core/shaders.ts @@ -1,6 +1,6 @@ // prettier-ignore import { ShaderMaterial, Color, AdditiveBlending } from 'three' -import { NO_DATA_VALUE_INTERNAL } from '../constants' +//import { NO_DATA_VALUE_INTERNAL } from '../constants' const Shaders = { simplePoint: function (): ShaderMaterial { diff --git a/src/core/tiledWorld.ts b/src/core/tiledWorld.ts index ea5aa6b..acd39dd 100644 --- a/src/core/tiledWorld.ts +++ b/src/core/tiledWorld.ts @@ -12,6 +12,7 @@ import { import load from '../parsers' import Utils from '../utils' +import Paths from '../utils/paths' import { XYZ, XYZLOD } from '../generalTypes' @@ -202,8 +203,14 @@ export default class TiledWorld { d = Math.pow(x - xCenter, 2) + Math.pow(y - yCenter, 2) if (d <= r * r) { this.tilesWanted.push({ - x: Utils.mod(x, Math.pow(2, this.p.zoom)), - y: Utils.mod(y, Math.pow(2, this.p.zoom)), + x: this.p.projection.tileMapResource.proj + ? // @ts-ignore + parseInt(x) + : Utils.mod(x, Math.pow(2, this.p.zoom)), + y: this.p.projection.tileMapResource.proj + ? // @ts-ignore + parseInt(y) + : Utils.mod(y, Math.pow(2, this.p.zoom)), z: this.p.zoom, d: d, make: true, @@ -240,8 +247,14 @@ export default class TiledWorld { d = Math.pow(x - xCenter, 2) + Math.pow(y - yCenter, 2) if (d <= lr * lr) { this.tilesWanted.push({ - x: Utils.mod(x, Math.pow(2, z)), - y: Utils.mod(y, Math.pow(2, z)), + x: this.p.projection.tileMapResource.proj + ? // @ts-ignore + parseInt(x) + : Utils.mod(x, Math.pow(2, z)), + y: this.p.projection.tileMapResource.proj + ? // @ts-ignore + parseInt(y) + : Utils.mod(y, Math.pow(2, z)), z: z, d: d, make: true, @@ -289,15 +302,6 @@ export default class TiledWorld { }) ) - // Invert y if needed. TMS tiles differ from WMTS tiles with inverted ys - let yI = xyz.y - if ( - this.p.options - .yInvert /*TODO && - window.window.mmgisglobal.customCRS == null */ - ) - yI = this.p.projection.invertY(xyz.y, xyz.z) - // State that we're in the process of drawing this tile this.tilesBeingDrawn.push({ x: xyz.x, @@ -313,7 +317,6 @@ export default class TiledWorld { x: xyz.x, y: xyz.y, z: xyz.z, - yI: yI, isLODTile: xyz.isLODTile, LODLevel: xyz.LODLevel, t: t, @@ -336,8 +339,7 @@ export default class TiledWorld { //Make sure both parts loaded if (tileLoaded.data) { - let lowerZoomTileIRemove - let differentZoomTilesToRemove = [] + const differentZoomTilesToRemove = [] // If a lower zoom tile exists that this one covers, remove it // It's just a faster remove -- instead of checking to remove once // all new tiles are loaded @@ -565,7 +567,7 @@ export default class TiledWorld { let loadDemTile = false let filledDemPath - let layerObj + let layerI = null for (let i = this.p.layers.tile.length - 1; i >= 0; i--) { //Check if on and in right zoom range if ( @@ -579,9 +581,8 @@ export default class TiledWorld { )) || this.p.layers.tile[i].path == '_vectorsastile_') //TODO: Check this vec as tile ) { - filledDemPath = this.p.layers.tile[i].demPath - layerObj = this.p.layers.tile[i] - if (filledDemPath != undefined) { + layerI = i + if (this.p.layers.tile[i].demPath != undefined) { loadDemTile = true // Find only the first valid dem break @@ -589,22 +590,29 @@ export default class TiledWorld { } } - if (loadDemTile) { - if (filledDemPath != undefined) { - filledDemPath = filledDemPath.replace('{z}', xyz.z) - filledDemPath = filledDemPath.replace('{x}', xyz.x) - filledDemPath = filledDemPath.replace('{y}', yI) - } - // Load is from are parsers and wraps potentially a bunch of tile formats - const heightArr = await load( - this.p.options.customParsers, - filledDemPath, - layerObj, - { x: xyz.x, y: yI, z: xyz.z }, - this.p.options.tileResolution, - Math.pow(this.p.options.tileResolution, 2) + if (loadDemTile && layerI != null) { + const builtDemPath = Paths.buildPath( + this.p.layers.tile[layerI].format, + this.p.layers.tile[layerI].demPath, + xyz, + this.p.projection, + this.p.options.trueTileResolution, + this.p.layers.tile[layerI].demFormatOptions, + true ) - tileGeometry(heightArr) + let heightArr = null + if (builtDemPath) + // Load is from are parsers and wraps potentially a bunch of tile formats + heightArr = await load( + this.p.options.customParsers, + builtDemPath.path, + this.p.layers.tile[layerI], + builtDemPath.xyz, + this.p.options.tileResolution, + Math.pow(this.p.options.tileResolution, 2) + ).catch(() => {}) + + tileGeometry(heightArr || null) } else { //Make a flat (still curved to the globe) tile tileGeometry() @@ -657,9 +665,10 @@ export default class TiledWorld { // Tile layers are joined at the pixel level -- not the geometry level const onceTexturesLoaded = () => { // Ensure that all textures are in fact loaded + // LOD tiles don't get clamped rasters since it looks ugly if ( tileLayersComplete.every(Boolean) && - clampedLayersComplete.every(Boolean) + (xyz.isLODTile || clampedLayersComplete.every(Boolean)) ) { // And if there weren't any textures, just pass it through if (textures.length == 0) { @@ -725,43 +734,51 @@ export default class TiledWorld { this.p.projection ) ) { - //console.log(this.p.layers.tile[i].name) //Load the tile - //Closure to save the index - let filledPath = this.p.layers.tile[i].path - filledPath = filledPath.replace('{z}', tD.z) - filledPath = filledPath.replace('{x}', tD.x) - filledPath = filledPath.replace('{y}', tD.yI) - ;((i) => { - this._.loader.load( - filledPath, - (texture) => { - //on success - texture.magFilter = NearestFilter - texture.minFilter = NearestFilter - - //Attach the index to it so we know then intended order later - if (this.p.layers.tile[i]) - textures.push({ - name: this.p.layers.tile[i].name, - type: 'tile', - texture: texture, - opacity: this.p.layers.tile[i].opacity, - i: i, - }) - tileLayersComplete[i] = true - onceTexturesLoaded() - }, - () => { - console.log('') - }, //in progress - () => { - //on error - tileLayersComplete[i] = true - onceTexturesLoaded() - } - ) - })(i) + const builtPath = Paths.buildPath( + this.p.layers.tile[i].format, + this.p.layers.tile[i].path, + tD, + this.p.projection, + this.p.options.trueTileResolution, + this.p.layers.tile[i].formatOptions + ) + if (builtPath) { + //Closure to save the index + ;((i) => { + this._.loader.load( + builtPath, + (texture) => { + //on success + texture.magFilter = NearestFilter + texture.minFilter = NearestFilter + + //Attach the index to it so we know then intended order later + if (this.p.layers.tile[i]) + textures.push({ + name: this.p.layers.tile[i].name, + type: 'tile', + texture: texture, + opacity: this.p.layers.tile[i].opacity, + i: i, + }) + tileLayersComplete[i] = true + onceTexturesLoaded() + }, + () => { + console.log('') + }, //in progress + () => { + //on error + tileLayersComplete[i] = true + onceTexturesLoaded() + } + ) + })(i) + } else { + tileLayersComplete[i] = true + onceTexturesLoaded() + } } else { tileLayersComplete[i] = true onceTexturesLoaded() @@ -769,8 +786,11 @@ export default class TiledWorld { } // =============== Generate the Raster clamped textures ============= - for (let i = 0; i < this.p.layers.clamped.length; i++) { - /* + + // LOD tiles don't get clamped rasters since it looks ugly + if (!xyz.isLODTile) { + for (let i = 0; i < this.p.layers.clamped.length; i++) { + /* console.log( 'on:', this.p.layers.clamped[i].on) console.log( 'minZoom:', this.p.layers.clamped[i].minZoom) console.log( 'z >= minz:', tD.z >= this.p.layers.clamped[i].minZoom) @@ -783,56 +803,57 @@ export default class TiledWorld { this.p.projection ))) */ - //Check if on and in right zoom range - if ( - this.p.layers.clamped[i].on && - (this.p.layers.clamped[i].minZoom == null || - tD.z >= this.p.layers.clamped[i].minZoom) && - (this.p.layers.clamped[i].maxZoom == null || - tD.z <= this.p.layers.clamped[i].maxZoom) && - (this.p.layers.clamped[i].boundingBox == null || - Utils.isInExtent( - { x: tD.x, y: tD.y, z: tD.z }, - this.p.layers.clamped[i].boundingBox, - this.p.projection - )) - ) { - //Load the tile - const clampedTexture = this.p.layers._.layerers.clamped.getClampedTexture( - i, - { x: tD.x, y: tD.y, z: tD.z } - ) - tD.contains = tD.contains || {} - tD.contains[this.p.layers.clamped[i].name] = - clampedTexture.features - - const texture = new CanvasTexture(clampedTexture.canvas) - - texture.magFilter = NearestFilter - texture.minFilter = NearestFilter - - //Attach the index to it so we know then intended order later - if (this.p.layers.clamped[i]) - textures.push({ - name: this.p.layers.clamped[i].name, - type: 'clamped', - texture: texture, - opacity: this.p.layers.clamped[i].opacity, - i: i, - }) - clampedLayersComplete[i] = true - onceTexturesLoaded() - } else { - clampedLayersComplete[i] = true - onceTexturesLoaded() + //Check if on and in right zoom range + if ( + this.p.layers.clamped[i].on && + (this.p.layers.clamped[i].minZoom == null || + tD.z >= this.p.layers.clamped[i].minZoom) && + (this.p.layers.clamped[i].maxZoom == null || + tD.z <= this.p.layers.clamped[i].maxZoom) && + (this.p.layers.clamped[i].boundingBox == null || + Utils.isInExtent( + { x: tD.x, y: tD.y, z: tD.z }, + this.p.layers.clamped[i].boundingBox, + this.p.projection + )) + ) { + //Load the tile + const clampedTexture = this.p.layers._.layerers.clamped.getClampedTexture( + i, + { x: tD.x, y: tD.y, z: tD.z } + ) + tD.contains = tD.contains || {} + tD.contains[this.p.layers.clamped[i].name] = + clampedTexture.features + + const texture = new CanvasTexture(clampedTexture.canvas) + + texture.magFilter = NearestFilter + texture.minFilter = NearestFilter + + //Attach the index to it so we know then intended order later + if (this.p.layers.clamped[i]) + textures.push({ + name: this.p.layers.clamped[i].name, + type: 'clamped', + texture: texture, + opacity: this.p.layers.clamped[i].opacity, + i: i, + }) + clampedLayersComplete[i] = true + onceTexturesLoaded() + } else { + clampedLayersComplete[i] = true + onceTexturesLoaded() + } } } } // tD = tileDrawn as always updateClampedRasterForTile(tD, layerName) { - // Don't update if this mode is on - if (this.p.options.wireframeMode) return + // Don't update if this mode is on or is LOD + if (this.p.options.wireframeMode || tD.isLODTile) return let clampedLayerI = null for (let i = 0; i < this.p.layers.clamped.length; i++) { @@ -925,8 +946,7 @@ export default class TiledWorld { removeAllTiles(): void { this.killDrawingTiles() //Remove all tiles so that they'll be recreated - const startingLength = this.tilesDrawn.length - for (let j = 0; j < startingLength; j++) { + for (let j = 0; j < this.tilesDrawn.length; j++) { this.removeTile(0) } } @@ -1027,6 +1047,7 @@ export default class TiledWorld { if (this.tilesDrawn[i].fadeOutAndRemove) { for ( let n = 0; + this.tilesDrawn[i] && n < this.tilesDrawn[i].from.rasters.length; n++ ) { diff --git a/src/generalTypes.d.ts b/src/generalTypes.d.ts index d1f1469..715027e 100644 --- a/src/generalTypes.d.ts +++ b/src/generalTypes.d.ts @@ -1,6 +1,8 @@ export interface TileMapResource { bounds: number[] origin: number[] + crsCode: string + epsg?: string proj: string resunitsperpixel: number reszoomlevel: number diff --git a/src/layers/clamped.ts b/src/layers/clamped.ts index 17fe5d8..c91bc52 100644 --- a/src/layers/clamped.ts +++ b/src/layers/clamped.ts @@ -420,7 +420,6 @@ export default class ClampedLayerer { } } } else if (f.geometry.type.toLowerCase() === 'point') { - let radiusInMeters = 0 let lnglat = { lng: 0, lat: 0, diff --git a/src/layers/index.ts b/src/layers/index.ts index a38c352..b221878 100644 --- a/src/layers/index.ts +++ b/src/layers/index.ts @@ -1,5 +1,3 @@ -import { TileMapResource, LatLng, LatLngH, XYZ } from '../generalTypes' - import Utils from '../utils' import Tile3dLayerer from './tile3d' @@ -71,7 +69,7 @@ export default class Layers { callback?: Function, sI?: number ): void => { - if (sI == undefined) sI = 0 + //if (sI == undefined) sI = 0 // Support 1/0 on params if (layerObj.on == 1) layerObj.on = true @@ -168,7 +166,7 @@ export default class Layers { } getLayerByName = (layerName: string): any => { - for (let type in this.all) { + for (const type in this.all) { for (let i = 0; i < this.all[type].length; i++) { if (this.all[type][i].name === layerName) return this.all[type][i] diff --git a/src/layers/tile3d.ts b/src/layers/tile3d.ts index fdeb69c..8d66c45 100644 --- a/src/layers/tile3d.ts +++ b/src/layers/tile3d.ts @@ -116,7 +116,6 @@ export default class Tile3dLayerer { private localizeTile3ds = (layerObj: any, tilesRenderer: any) => { // position - const position = layerObj.position || {} const v = this.p.p.projection.lonLatToVector3( layerObj.position.longitude || layerObj.position.lng || 0, layerObj.position.latitude || layerObj.position.lat || 0, diff --git a/src/layers/vector.ts b/src/layers/vector.ts index 6fef29d..c80483a 100644 --- a/src/layers/vector.ts +++ b/src/layers/vector.ts @@ -59,9 +59,7 @@ export default class VectorLayerer { layerObj.hasOwnProperty('on') && (layerObj.hasOwnProperty('geojsonPath') || layerObj.hasOwnProperty('geojson')) && - layerObj.hasOwnProperty('opacity') && - layerObj.hasOwnProperty('minZoom') && - layerObj.hasOwnProperty('maxZoom') + layerObj.hasOwnProperty('opacity') ) { if ( layerObj.hasOwnProperty('geojsonPath') && @@ -152,7 +150,7 @@ export default class VectorLayerer { const pointType = layerObj.style ? layerObj.style.pointType : '' const lineType = layerObj.style ? layerObj.style.lineType : '' - const polygonType = layerObj.style ? layerObj.style.polygonType : '' + //const polygonType = layerObj.style ? layerObj.style.polygonType : '' for (const f of features) { const type = f.geometry.type diff --git a/src/lithosphere.ts b/src/lithosphere.ts index 761b97f..8784d45 100644 --- a/src/lithosphere.ts +++ b/src/lithosphere.ts @@ -10,20 +10,18 @@ import { Scene, Object3D, AmbientLight, - Vector2, Vector3, SphereBufferGeometry, Mesh, MeshBasicMaterial, TextureLoader, Raycaster, - Matrix4, BufferGeometry, LineBasicMaterial, Line, } from 'three' -import Utils from './utils' +//import Utils from './utils' import Layers from './layers' import Controls from './controls' @@ -91,7 +89,7 @@ export default class LithoSphere { constructor(containerId: string, options: Options) { // Add a sub container specifically for the scene - let sceneContainer = document + const sceneContainer = document .getElementById(containerId) .appendChild(document.createElement('div')) sceneContainer.id = '_lithosphere_scene' @@ -149,8 +147,7 @@ export default class LithoSphere { { radiusOfTiles: 2, zoomsUp: 11 }, ], tileResolution: 32, - trueTileResolution: 32, - yInvert: true, + trueTileResolution: 256, showAxes: false, wireframeMode: false, exaggeration: 1, @@ -178,7 +175,8 @@ export default class LithoSphere { this.projection = new Projection( this.options.majorRadius, this.options.minorRadius, - this.options.tileMapResource + this.options.tileMapResource, + this.options.trueTileResolution ) // Camera(s) @@ -459,7 +457,7 @@ export default class LithoSphere { this._.events._matchPlanetsLODToPlanet() //Change zoom - if (latLngZoom.zoom && ignoreZoom != true) { + if (latLngZoom.zoom != null && ignoreZoom != true) { this.zoom = latLngZoom.zoom // Globe_.updateZoomDependents() //TODO diff --git a/src/parsers/rgba.ts b/src/parsers/rgba.ts index 733eefb..80894f5 100644 --- a/src/parsers/rgba.ts +++ b/src/parsers/rgba.ts @@ -1,8 +1,8 @@ import '../secondary/PNG/zlib' import '../secondary/PNG/png' -import { NO_DATA_VALUE_INTERNAL } from '../constants' -import Utils from '../utils' +//import { NO_DATA_VALUE_INTERNAL } from '../constants' +//import Utils from '../utils' export default function RGBAParser( tilePath: string, diff --git a/src/secondary/PNG/png.ts b/src/secondary/PNG/png.ts index 1c7e07b..cda091d 100644 --- a/src/secondary/PNG/png.ts +++ b/src/secondary/PNG/png.ts @@ -21,11 +21,11 @@ // @ts-nocheck window.PNG = (function () { - let APNG_DISPOSE_OP_NONE = 0 + //let APNG_DISPOSE_OP_NONE = 0 let APNG_DISPOSE_OP_BACKGROUND = 1 let APNG_DISPOSE_OP_PREVIOUS = 2 let APNG_BLEND_OP_SOURCE = 0 - let APNG_BLEND_OP_OVER = 1 + //let APNG_BLEND_OP_OVER = 1 let scratchCanvas = document.createElement('canvas') let scratchCtx = scratchCanvas.getContext('2d') let makeImage = function (imageData) { diff --git a/src/secondary/sprites.ts b/src/secondary/sprites.ts index bdc5bd9..048fa15 100644 --- a/src/secondary/sprites.ts +++ b/src/secondary/sprites.ts @@ -155,8 +155,9 @@ const Sprites = { context.font = 'Bold ' + fontsize + 'px ' + fontface // get size data (height depends only on font size) - const metrics = context.measureText(message) - const textWidth = metrics.width + // TODO + //const metrics = context.measureText(message) + //const textWidth = metrics.width // background color // border color diff --git a/src/utils/index.ts b/src/utils/index.ts index 94e8992..4f2beb9 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,4 +1,4 @@ -import { Vector3, Matrix4, Quaternion } from 'three' +import { Quaternion } from 'three' import { XY, XYZ } from '../generalTypes' const Utils = { @@ -255,13 +255,35 @@ const Utils = { object.rotation.setFromRotationMatrix(object.matrix) */ object.updateWorldMatrix(true) - let invWorldRot = object.getWorldQuaternion(new Quaternion()).invert() + const invWorldRot = object.getWorldQuaternion(new Quaternion()).invert() axis.applyQuaternion(invWorldRot) - let deltaLocalRot = new Quaternion() + const deltaLocalRot = new Quaternion() deltaLocalRot.setFromAxisAngle(axis, radians) object.quaternion.multiply(deltaLocalRot) }, + // + getParamString( + params: any, + baseUrl: string, + isUppercase?: boolean + ): string { + const str = [] + + for (const o in params) + str.push( + encodeURIComponent(isUppercase ? o.toUpperCase() : o) + + '=' + + encodeURIComponent(params[o]) + ) + + return ( + (baseUrl && baseUrl.indexOf('?') !== -1 ? '&' : '?') + str.join('&') + ) + }, + isArray(object: any): boolean { + return Object.prototype.toString.call(object) === '[object Array]' + }, } export default Utils diff --git a/src/utils/paths.ts b/src/utils/paths.ts new file mode 100644 index 0000000..64e7810 --- /dev/null +++ b/src/utils/paths.ts @@ -0,0 +1,145 @@ +// Constructs tile URLs + +import Utils from './' + +const Paths = { + buildPath: function ( + format: string, + basePath: string, + tD: any, + projection: any, + tileResolution: number, + options?: any, + asObject?: boolean + ): any { + format = format || 'tms' + + let path + const xyz = { x: tD.x, y: tD.y, z: tD.z } + + switch (format) { + case 'wmts': + path = basePath + path = path.replace('{z}', xyz.z) + path = path.replace('{x}', xyz.x) + path = path.replace('{y}', xyz.y) + break + case 'wms': + path = Paths.wmsExtension.buildPath( + basePath, + xyz, + projection, + tileResolution, + options + ) + break + default: + // 'tms' + path = basePath + path = path.replace('{z}', xyz.z) + path = path.replace('{x}', xyz.x) + xyz.y = projection.invertY(xyz.y, xyz.z) + path = path.replace('{y}', xyz.y) + } + + if (asObject) + return { + path: path, + xyz: xyz, + } + return path + }, + wmsExtension: { + // If any custom options not documented here are used, they will be sent to the + // WMS server as extra parameters in each request URL. This can be useful for + // [non-standard vendor WMS parameters](http://docs.geoserver.org/stable/en/user/services/wms/vendor.html). + defaultWmsParams: { + SERVICE: 'WMS', + REQUEST: 'GetMap', + + // @option layers: String = '' + // **(required)** Comma-separated list of WMS layers to show. + //LAYERS: '', + + // @option styles: String = '' + // Comma-separated list of WMS styles. + //STYLES: '', + + // @option format: String = 'image/jpeg' + // WMS image format (use `'image/png'` for layers with transparency). + FORMAT: 'image/png', + + // @option transparent: Boolean = false + // If `true`, the WMS service will return images with transparency. + TRANSPARENT: true, + + // @option version: String = '1.1.1' + // Version of the WMS service to use + VERSION: '1.1.1', + wmsVersion: null, + //SRS: 'helloworld', + + WIDTH: null, + HEIGHT: null, + }, + extensionOptions: { + // @option crs: CRS = EPSG:4326 + // Coordinate Reference System to use for the WMS requests). + crsCode: 'EPSG:4326', + + // @option uppercase: Boolean = false + // If `true`, WMS request parameter keys will be uppercase. + uppercase: true, + }, + buildPath: function ( + basePath: string, + xyz: any, + projection: any, + tileResolution: number, + options: any + ): string { + const wmsParams = { ...Paths.wmsExtension.defaultWmsParams } + + if (options) + for (const i in options) { + if (!(i in Paths.wmsExtension.extensionOptions)) { + wmsParams[i] = options[i] + } + } + + wmsParams.VERSION = options.wmsVersion || wmsParams.VERSION + + wmsParams.WIDTH = wmsParams.HEIGHT = tileResolution + + const crsCode = + projection.tileMapResource.crsCode || + Paths.wmsExtension.extensionOptions.crsCode + wmsParams[ + parseFloat(wmsParams.wmsVersion) >= 1.3 ? 'CRS' : 'SRS' + ] = crsCode + + const bounds = projection.tileXYZ2NwSe(xyz, tileResolution, true) + + const bbox = (parseFloat(wmsParams.VERSION) >= 1.3 && + crsCode === 'EPSG:4326' + ? [bounds.min.y, bounds.min.x, bounds.max.y, bounds.max.x] + : [bounds.min.x, bounds.min.y, bounds.max.x, bounds.max.y] + ).join(',') + + return ( + basePath + + Utils.getParamString( + wmsParams, + basePath, + Paths.wmsExtension.extensionOptions.uppercase + ) + + (Paths.wmsExtension.extensionOptions.uppercase + ? '&BBOX=' + : '&bbox=') + + bbox + ) + }, + }, +} + +export default Paths