|
|
var AMRT=function(e){"use strict";function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function n(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){c(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function i(){
|
|
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
|
i=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function A(e,t,n,i){var r=t&&t.prototype instanceof u?t:u,a=Object.create(r.prototype),o=new C(i||[]);return a._invoke=function(e,t,n){var i="suspendedStart";return function(r,a){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw a;return E()}for(n.method=r,n.arg=a;;){var o=n.delegate;if(o){var s=x(o,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=c(e,t,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}(e,n,o),a}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=A;var h={};function u(){}function d(){}function f(){}var p={};l(p,a,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(B([])));v&&v!==t&&n.call(v,a)&&(p=v);var g=f.prototype=u.prototype=Object.create(p);function y(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function i(r,a,o,s){var l=c(e[r],e,a);if("throw"!==l.type){var A=l.arg,h=A.value;return h&&"object"==typeof h&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){i("next",e,o,s)}),(function(e){i("throw",e,o,s)})):t.resolve(h).then((function(e){A.value=e,o(A)}),(function(e){return i("throw",e,o,s)}))}s(l.arg)}var r;this._invoke=function(e,n){function a(){return new t((function(t,r){i(e,n,t,r)}))}return r=r?r.then(a,a):a()}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var i=c(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var r=i.arg;return r?r.done?(t[e.resultName]=r.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):r:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function b(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function M(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(b,this),this.reset(!0)}function B(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,r=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:E}}function E(){return{value:void 0,done:!0}}return d.prototype=f,l(g,"constructor",f),l(f,"constructor",d),d.displayName=l(f,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,l(e,s,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},y(w.prototype),l(w.prototype,o,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,i,r,a){void 0===a&&(a=Promise);var o=new w(A(t,n,i,r),a);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},y(g),l(g,s,"Generator"),l(g,a,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},e.values=B,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(M),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return o.type="throw",o.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r],o=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(s&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var a=r;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),M(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;M(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:B(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},e}function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function a(e,t,n,i,r,a,o){try{var s=e[a](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(i,r)}function o(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function s(e){a(o,i,r,s,l,"next",e)}function l(e){a(o,i,r,s,l,"throw",e)}s(void 0)}))}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function A(e,t,n){return t&&l(e.prototype,t),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function p(e,t,n){return p=f()?Reflect.construct.bind():function(e,t,n){var i=[null];i.push.apply(i,t);var r=new(Function.bind.apply(e,i));return n&&d(r,n.prototype),r},p.apply(null,arguments)}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return v(e)}function y(e){var t=f();return function(){var n,i=u(e);if(t){var r=u(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return g(this,n)}}function x(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=u(e)););return e}function b(){return b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=x(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},b.apply(this,arguments)}function M(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var i,r,a=[],o=!0,s=!1;try{for(n=n.call(e);!(o=(i=n.next()).done)&&(a.push(i.value),!t||a.length!==t);o=!0);}catch(e){s=!0,r=e}finally{try{o||null==n.return||n.return()}finally{if(s)throw r}}return a}(e,t)||B(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e){return function(e){if(Array.isArray(e))return E(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||B(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function S(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=B(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}Array.prototype.insert=function(e,t){this.splice(t,0,e)},Array.prototype.removeAt=function(e){return!(isNaN(e)||e>=this.length)&&this.splice(e,1)[0]},Array.prototype.remove=function(e){var t=this.indexOf(e);t>-1&&this.splice(t,1)},"function"!=typeof String.prototype.startsWith&&(String.prototype.startsWith=function(e){return this.slice(0,e.length)===e}),"function"!=typeof String.prototype.endsWith&&(String.prototype.endsWith=function(e){return-1!==this.indexOf(e,this.length-e.length)}),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t});var T="111",_={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},I=100,L=200,F=201,k=202,P=204,U=205,D=206,R=208,O=300,N=301,z=302,Q=304,G=306,H=307,V=1e3,j=1001,W=1002,X=1003,Y=1004,K=1005,Z=1006,J=1007,q=1008,$=1009,ee=1012,te=1014,ne=1015,ie=1016,re=1017,ae=1018,oe=1019,se=1020,le=1021,Ae=1022,ce=1023,he=1024,ue=1025,de=ce,fe=1026,pe=1027,me=1028,ve=33776,ge=33777,ye=33778,we=33779,xe=35840,be=35841,Me=35842,Ce=35843,Be=36196,Ee=37808,Se=36492,Te=37492,_e=37496,Ie=2200,Le=2201,Fe=2300,ke=2301,Pe=2302,Ue=2400,De=2401,Re=2402,Oe=3e3,Ne=3001,ze=3007,Qe=3002,Ge=3004,He=3005,Ve=3006,je=3201,We=7680,Xe=35044,Ye=35048,Ke=5e3,Ze=2e3;function Je(){}Object.assign(Je.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[e]&&-1!==n[e].indexOf(t)},removeEventListener:function(e,t){if(void 0!==this._listeners){var n=this._listeners[e];if(void 0!==n){var i=n.indexOf(t);-1!==i&&n.splice(i,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners[e.type];if(void 0!==t){e.target=this;for(var n=t.slice(0),i=0,r=n.length;i<r;i++)n[i].call(this,e)}}}});for(var qe=[],$e=0;$e<256;$e++)qe[$e]=($e<16?"0":"")+$e.toString(16);var et={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(qe[255&e]+qe[e>>8&255]+qe[e>>16&255]+qe[e>>24&255]+"-"+qe[255&t]+qe[t>>8&255]+"-"+qe[t>>16&15|64]+qe[t>>24&255]+"-"+qe[63&n|128]+qe[n>>8&255]+"-"+qe[n>>16&255]+qe[n>>24&255]+qe[255&i]+qe[i>>8&255]+qe[i>>16&255]+qe[i>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,i,r){return i+(e-t)*(r-i)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*et.DEG2RAD},radToDeg:function(e){return e*et.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){var t=Math.log(e)/Math.LN2;return t=t-Math.floor(t)<=.5?Math.floor(t):Math.ceil(t),Math.pow(2,t)}};function tt(e,t){this.x=e||0,this.y=t||0}function nt(e,t,n,i){this._x=e||0,this._y=t||0,this._z=n||0,this._w=void 0!==i?i:1}Object.defineProperties(tt.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(tt.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?this.addVectors(e,t):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?this.subVectors(e,t):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){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:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},cross:function(e){return this.x*e.y-this.y*e.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,n){return this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*i+e.x,this.y=r*i+a*n+e.y,this}}),Object.assign(nt,{slerp:function(e,t,n,i){return n.copy(e).slerp(t,i)},slerpFlat:function(e,t,n,i,r,a,o){var s=n[i+0],l=n[i+1],A=n[i+2],c=n[i+3],h=r[a+0],u=r[a+1],d=r[a+2],f=r[a+3];if(c!==f||s!==h||l!==u||A!==d){var p=1-o,m=s*h+l*u+A*d+c*f,v=m>=0?1:-1,g=1-m*m;if(g>Number.EPSILON){var y=Math.sqrt(g),w=Math.atan2(y,m*v);p=Math.sin(p*w)/y,o=Math.sin(o*w)/y}var x=o*v;if(s=s*p+h*x,l=l*p+u*x,A=A*p+d*x,c=c*p+f*x,p===1-o){var b=1/Math.sqrt(s*s+l*l+A*A+c*c);s*=b,l*=b,A*=b,c*=b}}e[t]=s,e[t+1]=l,e[t+2]=A,e[t+3]=c}}),Object.defineProperties(nt.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this._onChangeCallback()}}}),Object.assign(nt.prototype,{isQuaternion:!0,set:function(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=e._x,i=e._y,r=e._z,a=e.order,o=Math.cos,s=Math.sin,l=o(n/2),A=o(i/2),c=o(r/2),h=s(n/2),u=s(i/2),d=s(r/2);return"XYZ"===a?(this._x=h*A*c+l*u*d,this._y=l*u*c-h*A*d,this._z=l*A*d+h*u*c,this._w=l*A*c-h*u*d):"YXZ"===a?(this._x=h*A*c+l*u*d,this._y=l*u*c-h*A*d,this._z=l*A*d-h*u*c,this._w=l*A*c+h*u*d):"ZXY"===a?(this._x=h*A*c-l*u*d,this._y=l*u*c+h*A*d,this._z=l*A*d+h*u*c,this._w=l*A*c-h*u*d):"ZYX"===a?(this._x=h*A*c-l*u*d,this._y=l*u*c+h*A*d,this._z=l*A*d-h*u*c,this._w=l*A*c+h*u*d):"YZX"===a?(this._x=h*A*c+l*u*d,this._y=l*u*c+h*A*d,this._z=l*A*d-h*u*c,this._w=l*A*c-h*u*d):"XZY"===a&&(this._x=h*A*c-l*u*d,this._y=l*u*c-h*A*d,this._z=l*A*d+h*u*c,this._w=l*A*c+h*u*d),!1!==t&&this._onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(e){var t,n=e.elements,i=n[0],r=n[4],a=n[8],o=n[1],s=n[5],l=n[9],A=n[2],c=n[6],h=n[10],u=i+s+h;return u>0?(t=.5/Math.sqrt(u+1),this._w=.25/t,this._x=(c-l)*t,this._y=(a-A)*t,this._z=(o-r)*t):i>s&&i>h?(t=2*Math.sqrt(1+i-s-h),this._w=(c-l)/t,this._x=.25*t,this._y=(r+o)/t,this._z=(a+A)/t):s>h?(t=2*Math.sqrt(1+s-i-h),this._w=(a-A)/t,this._x=(r+o)/t,this._y=.25*t,this._z=(l+c)/t):(t=2*Math.sqrt(1+h-i-s),this._w=(o-r)/t,this._x=(a+A)/t,this._y=(l+c)/t,this._z=.25*t),this._onChangeCallback(),this},setFromUnitVectors:function(e,t){var n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()},angleTo:function(e){return 2*Math.acos(Math.abs(et.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var n=this.angleTo(e);if(0===n)return this;var i=Math.min(1,t/n);return this.slerp(e,i),this},inverse:function(){return this.conjugate()},invert:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,i=e._y,r=e._z,a=e._w,o=t._x,s=t._y,l=t._z,A=t._w;return this._x=n*A+a*o+i*l-r*s,this._y=i*A+a*s+r*o-n*l,this._z=r*A+a*l+n*s-i*o,this._w=a*A-n*o-i*s-r*l,this._onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var n=this._x,i=this._y,r=this._z,a=this._w,o=a*e._w+n*e._x+i*e._y+r*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=i,this._z=r,this;var s=1-o*o;if(s<=Number.EPSILON){var l=1-t;return this._w=l*a+t*this._w,this._x=l*n+t*this._x,this._y=l*i+t*this._y,this._z=l*r+t*this._z,this.normalize(),this._onChangeCallback(),this}var A=Math.sqrt(s),c=Math.atan2(A,o),h=Math.sin((1-t)*c)/A,u=Math.sin(t*c)/A;return this._w=a*h+this._w*u,this._x=n*h+this._x*u,this._y=i*h+this._y*u,this._z=r*h+this._z*u,this._onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},slerpQuaternions:function(e,t,n){return this.copy(e).slerp(t,n)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});var it=new at,rt=new nt;function at(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}Object.assign(at.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(e){return e&&e.isEuler||console.error("Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(rt.setFromEuler(e))},applyAxisAngle:function(e,t){return this.applyQuaternion(rt.setFromAxisAngle(e,t))},applyMatrix3:function(e){var t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this},applyNormalMatrix:function(e){return this.applyMatrix3(e).normalize()},applyMatrix4:function(e){var t=this.x,n=this.y,i=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*a,this},applyQuaternion:function(e){var t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,o=e.z,s=e.w,l=s*t+a*i-o*n,A=s*n+o*t-r*i,c=s*i+r*n-a*t,h=-r*t-a*n-o*i;return this.x=l*s+h*-r+A*-o-c*-a,this.y=A*s+h*-a+c*-r-l*-o,this.z=c*s+h*-o+l*-a-A*-r,this},project:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},unproject:function(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)},transformDirection:function(e){var t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){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:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},cross:function(e,t){return void 0!==t?(console.warn("Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,i=e.y,r=e.z,a=t.x,o=t.y,s=t.z;return this.x=i*s-r*o,this.y=r*a-n*s,this.z=n*o-i*a,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:function(e){return it.copy(this).projectOnVector(e),this.sub(it)},reflect:function(e){return this.sub(it.copy(e).multiplyScalar(2*this.dot(e)))},angleTo:function(e){var t=Math.sqrt(this.lengthSq()*e.lengthSq());0===t&&console.error("Vector3: angleTo() can't handle zero length vectors.");var n=this.dot(e)/t;return Math.acos(et.clamp(n,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},setFromSphericalCoords:function(e,t,n){var i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn("Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}});var ot,st=new at;function lt(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.assign(lt.prototype,{isMatrix3:!0,set:function(e,t,n,i,r,a,o,s,l){var A=this.elements;return A[0]=e,A[1]=i,A[2]=o,A[3]=t,A[4]=r,A[5]=s,A[6]=n,A[7]=a,A[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},applyToBufferAttribute:function(e){for(var t=0,n=e.count;t<n;t++)st.x=e.getX(t),st.y=e.getY(t),st.z=e.getZ(t),st.applyMatrix3(this),e.setXYZ(t,st.x,st.y,st.z);return e},multiply:function(e){return this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[3],s=n[6],l=n[1],A=n[4],c=n[7],h=n[2],u=n[5],d=n[8],f=i[0],p=i[3],m=i[6],v=i[1],g=i[4],y=i[7],w=i[2],x=i[5],b=i[8];return r[0]=a*f+o*v+s*w,r[3]=a*p+o*g+s*x,r[6]=a*m+o*y+s*b,r[1]=l*f+A*v+c*w,r[4]=l*p+A*g+c*x,r[7]=l*m+A*y+c*b,r[2]=h*f+u*v+d*w,r[5]=h*p+u*g+d*x,r[8]=h*m+u*y+d*b,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],l=e[7],A=e[8];return t*a*A-t*o*l-n*r*A+n*o*s+i*r*l-i*a*s},getInverse:function(e,t){e&&e.isMatrix4&&console.error("Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=e.elements,i=this.elements,r=n[0],a=n[1],o=n[2],s=n[3],l=n[4],A=n[5],c=n[6],h=n[7],u=n[8],d=u*l-A*h,f=A*c-u*s,p=h*s-l*c,m=r*d+a*f+o*p;if(0===m){var v="Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(v);return console.warn(v),this.identity()}var g=1/m;return i[0]=d*g,i[1]=(o*h-u*a)*g,i[2]=(A*a-o*l)*g,i[3]=f*g,i[4]=(u*r-o*c)*g,i[5]=(o*s-A*r)*g,i[6]=p*g,i[7]=(a*c-h*r)*g,i[8]=(l*r-a*s)*g,this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},setUvTransform:function(e,t,n,i,r,a,o){var s=Math.cos(r),l=Math.sin(r);this.set(n*s,n*l,-n*(s*a+l*o)+a+e,-i*l,i*s,-i*(-l*a+s*o)+o+t,0,0,1)},scale:function(e,t){var n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this},rotate:function(e){var t=Math.cos(e),n=Math.sin(e),i=this.elements,r=i[0],a=i[3],o=i[6],s=i[1],l=i[4],A=i[7];return i[0]=t*r+n*s,i[3]=t*a+n*l,i[6]=t*o+n*A,i[1]=-n*r+t*s,i[4]=-n*a+t*l,i[7]=-n*o+t*A,this},rotateY:function(e){var t=Math.cos(e),n=Math.sin(e),i=this.elements;return i[0]=t,i[6]=-n,i[2]=n,i[8]=t,this},translate:function(e,t){var n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this},equals:function(e){for(var t=this.elements,n=e.elements,i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<9;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}});var At={getDataURL:function(e){var t;if("undefined"==typeof HTMLCanvasElement)return e.src;if(e instanceof HTMLCanvasElement)t=e;else{void 0===ot&&(ot=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),ot.width=e.width,ot.height=e.height;var n=ot.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=ot}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}},ct=0;function ht(e,t,n,i,r,a,o,s,l,A){Object.defineProperty(this,"id",{value:ct++}),this.uuid=et.generateUUID(),this.name="",this.image=void 0!==e?e:ht.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:ht.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:j,this.wrapT=void 0!==i?i:j,this.magFilter=void 0!==r?r:Z,this.minFilter=void 0!==a?a:q,this.anisotropy=void 0!==l?l:1,this.format=void 0!==o?o:ce,this.type=void 0!==s?s:$,this.offset=new tt(0,0),this.repeat=new tt(1,1),this.center=new tt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new lt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==A?A:Oe,this.version=0,this.onUpdate=null}function ut(e,t,n,i){this.x=e||0,this.y=t||0,this.z=n||0,this.w=void 0!==i?i:1}function dt(e,t,n){this.width=e,this.height=t,this.scissor=new ut(0,0,e,t),this.scissorTest=!1,this.viewport=new ut(0,0,e,t),n=n||{},this.texture=new ht(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:Z,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}function ft(e,t,n){dt.call(this,e,t,n),this.samples=4}ht.DEFAULT_IMAGE=void 0,ht.DEFAULT_MAPPING=O,ht.prototype=Object.assign(Object.create(Je.prototype),{constructor:ht,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(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var 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){var i=this.image;if(void 0===i.uuid&&(i.uuid=et.generateUUID()),!t&&void 0===e.images[i.uuid]){var r;if(Array.isArray(i)){r=[];for(var a=0,o=i.length;a<o;a++)r.push(At.getDataURL(i[a]))}else r=At.getDataURL(i);e.images[i.uuid]={uuid:i.uuid,url:r}}n.image=i.uuid}return t||(e.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(this.mapping!==O)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case V:e.x=e.x-Math.floor(e.x);break;case j:e.x=e.x<0?0:1;break;case W:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case V:e.y=e.y-Math.floor(e.y);break;case j:e.y=e.y<0?0:1;break;case W:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(ht.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.defineProperties(ut.prototype,{width:{get:function(){return this.z},set:function(e){this.z=e}},height:{get:function(){return this.w},set:function(e){this.w=e}}}),Object.assign(ut.prototype,{isVector4:!0,set:function(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){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: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?this.addVectors(e,t):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0!==t?this.subVectors(e,t):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this},applyMatrix4:function(e){var t=this.x,n=this.y,i=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*r,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,n,i,r,a=.01,o=.1,s=e.elements,l=s[0],A=s[4],c=s[8],h=s[1],u=s[5],d=s[9],f=s[2],p=s[6],m=s[10];if(Math.abs(A-h)<a&&Math.abs(c-f)<a&&Math.abs(d-p)<a){if(Math.abs(A+h)<o&&Math.abs(c+f)<o&&Math.abs(d+p)<o&&Math.abs(l+u+m-3)<o)return this.set(1,0,0,0),this;t=Math.PI;var v=(l+1)/2,g=(u+1)/2,y=(m+1)/2,w=(A+h)/4,x=(c+f)/4,b=(d+p)/4;return v>g&&v>y?v<a?(n=0,i=.707106781,r=.707106781):(i=w/(n=Math.sqrt(v)),r=x/n):g>y?g<a?(n=.707106781,i=0,r=.707106781):(n=w/(i=Math.sqrt(g)),r=b/i):y<a?(n=.707106781,i=.707106781,r=0):(n=x/(r=Math.sqrt(y)),i=b/r),this.set(n,i,r,t),this}var M=Math.sqrt((p-d)*(p-d)+(c-f)*(c-f)+(h-A)*(h-A));return Math.abs(M)<.001&&(M=1),this.x=(p-d)/M,this.y=(c-f)/M,this.z=(h-A)/M,this.w=Math.acos((l+u+m-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this},clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))},floor:function(){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:function(){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:function(){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:function(){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:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,n){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),dt.prototype=Object.assign(Object.create(Je.prototype),{constructor:dt,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),ft.prototype=Object.assign(Object.create(dt.prototype),{constructor:ft,isWebGLMultisampleRenderTarget:!0,copy:function(e){return dt.prototype.copy.call(this,e),this.samples=e.samples,this}});var pt=new at,mt=new bt,vt=new at(0,0,0),gt=new at(1,1,1),yt=new at,wt=new at,xt=new at;function bt(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("Matrix4: the constructor no longer reads arguments. use .set() instead.")}Object.assign(bt.prototype,{isMatrix4:!0,set:function(e,t,n,i,r,a,o,s,l,A,c,h,u,d,f,p){var m=this.elements;return m[0]=e,m[4]=t,m[8]=n,m[12]=i,m[1]=r,m[5]=a,m[9]=o,m[13]=s,m[2]=l,m[6]=A,m[10]=c,m[14]=h,m[3]=u,m[7]=d,m[11]=f,m[15]=p,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new bt).fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this},copyPosition:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this},extractRotation:function(e){var t=this.elements,n=e.elements,i=1/pt.setFromMatrixColumn(e,0).length(),r=1/pt.setFromMatrixColumn(e,1).length(),a=1/pt.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromEuler:function(e){e&&e.isEuler||console.error("Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,i=e.y,r=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(i),l=Math.sin(i),A=Math.cos(r),c=Math.sin(r);if("XYZ"===e.order){var h=a*A,u=a*c,d=o*A,f=o*c;t[0]=s*A,t[4]=-s*c,t[8]=l,t[1]=u+d*l,t[5]=h-f*l,t[9]=-o*s,t[2]=f-h*l,t[6]=d+u*l,t[10]=a*s}else if("YXZ"===e.order){var p=s*A,m=s*c,v=l*A,g=l*c;t[0]=p+g*o,t[4]=v*o-m,t[8]=a*l,t[1]=a*c,t[5]=a*A,t[9]=-o,t[2]=m*o-v,t[6]=g+p*o,t[10]=a*s}else if("ZXY"===e.order){p=s*A,m=s*c,v=l*A,g=l*c;t[0]=p-g*o,t[4]=-a*c,t[8]=v+m*o,t[1]=m+v*o,t[5]=a*A,t[9]=g-p*o,t[2]=-a*l,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){h=a*A,u=a*c,d=o*A,f=o*c;t[0]=s*A,t[4]=d*l-u,t[8]=h*l+f,t[1]=s*c,t[5]=f*l+h,t[9]=u*l-d,t[2]=-l,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){var y=a*s,w=a*l,x=o*s,b=o*l;t[0]=s*A,t[4]=b-y*c,t[8]=x*c+w,t[1]=c,t[5]=a*A,t[9]=-o*A,t[2]=-l*A,t[6]=w*c+x,t[10]=y-b*c}else if("XZY"===e.order){y=a*s,w=a*l,x=o*s,b=o*l;t[0]=s*A,t[4]=-c,t[8]=l*A,t[1]=y*c+b,t[5]=a*A,t[9]=w*c-x,t[2]=x*c-w,t[6]=o*A,t[10]=b*c+y}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(e){return this.compose(vt,e,gt)},lookAt:function(e,t,n){var i=this.elements;return xt.subVectors(e,t),0===xt.lengthSq()&&(xt.z=1),xt.normalize(),yt.crossVectors(n,xt),0===yt.lengthSq()&&(1===Math.abs(n.z)?xt.x+=1e-4:xt.z+=1e-4,xt.normalize(),yt.crossVectors(n,xt)),yt.normalize(),wt.crossVectors(xt,yt),i[0]=yt.x,i[4]=wt.x,i[8]=xt.x,i[1]=yt.y,i[5]=wt.y,i[9]=xt.y,i[2]=yt.z,i[6]=wt.z,i[10]=xt.z,this},multiply:function(e,t){return void 0!==t?(console.warn("Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[4],s=n[8],l=n[12],A=n[1],c=n[5],h=n[9],u=n[13],d=n[2],f=n[6],p=n[10],m=n[14],v=n[3],g=n[7],y=n[11],w=n[15],x=i[0],b=i[4],M=i[8],C=i[12],B=i[1],E=i[5],S=i[9],T=i[13],_=i[2],I=i[6],L=i[10],F=i[14],k=i[3],P=i[7],U=i[11],D=i[15];return r[0]=a*x+o*B+s*_+l*k,r[4]=a*b+o*E+s*I+l*P,r[8]=a*M+o*S+s*L+l*U,r[12]=a*C+o*T+s*F+l*D,r[1]=A*x+c*B+h*_+u*k,r[5]=A*b+c*E+h*I+u*P,r[9]=A*M+c*S+h*L+u*U,r[13]=A*C+c*T+h*F+u*D,r[2]=d*x+f*B+p*_+m*k,r[6]=d*b+f*E+p*I+m*P,r[10]=d*M+f*S+p*L+m*U,r[14]=d*C+f*T+p*F+m*D,r[3]=v*x+g*B+y*_+w*k,r[7]=v*b+g*E+y*I+w*P,r[11]=v*M+g*S+y*L+w*U,r[15]=v*C+g*T+y*F+w*D,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},applyToBufferAttribute:function(e){for(var t=0,n=e.count;t<n;t++)pt.x=e.getX(t),pt.y=e.getY(t),pt.z=e.getZ(t),pt.applyMatrix4(this),e.setXYZ(t,pt.x,pt.y,pt.z);return e},determinant:function(){var e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],a=e[1],o=e[5],s=e[9],l=e[13],A=e[2],c=e[6],h=e[10],u=e[14];return e[3]*(+r*s*c-i*l*c-r*o*h+n*l*h+i*o*u-n*s*u)+e[7]*(+t*s*u-t*l*h+r*a*h-i*a*u+i*l*A-r*s*A)+e[11]*(+t*l*c-t*o*u-r*a*c+n*a*u+r*o*A-n*l*A)+e[15]*(-i*o*A-t*s*c+t*o*h+i*a*c-n*a*h+n*s*A)},transpose:function(){var e,t=this.elements;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:function(e,t,n){var i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this},getInverse:function(e,t){var n=this.elements,i=e.elements,r=i[0],a=i[1],o=i[2],s=i[3],l=i[4],A=i[5],c=i[6],h=i[7],u=i[8],d=i[9],f=i[10],p=i[11],m=i[12],v=i[13],g=i[14],y=i[15],w=d*g*h-v*f*h+v*c*p-A*g*p-d*c*y+A*f*y,x=m*f*h-u*g*h-m*c*p+l*g*p+u*c*y-l*f*y,b=u*v*h-m*d*h+m*A*p-l*v*p-u*A*y+l*d*y,M=m*d*c-u*v*c-m*A*f+l*v*f+u*A*g-l*d*g,C=r*w+a*x+o*b+s*M;if(0===C){var B="Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===t)throw new Error(B);return console.warn(B),this.identity()}var E=1/C;return n[0]=w*E,n[1]=(v*f*s-d*g*s-v*o*p+a*g*p+d*o*y-a*f*y)*E,n[2]=(A*g*s-v*c*s+v*o*h-a*g*h-A*o*y+a*c*y)*E,n[3]=(d*c*s-A*f*s-d*o*h+a*f*h+A*o*p-a*c*p)*E,n[4]=x*E,n[5]=(u*g*s-m*f*s+m*o*p-r*g*p-u*o*y+r*f*y)*E,n[6]=(m*c*s-l*g*s-m*o*h+r*g*h+l*o*y-r*c*y)*E,n[7]=(l*f*s-u*c*s+u*o*h-r*f*h-l*o*p+r*c*p)*E,n[8]=b*E,n[9]=(m*d*s-u*v*s-m*a*p+r*v*p+u*a*y-r*d*y)*E,n[10]=(l*v*s-m*A*s+m*a*h-r*v*h-l*a*y+r*A*y)*E,n[11]=(u*A*s-l*d*s-u*a*h+r*d*h+l*a*p-r*A*p)*E,n[12]=M*E,n[13]=(u*v*o-m*d*o+m*a*f-r*v*f-u*a*g+r*d*g)*E,n[14]=(m*A*o-l*v*o-m*a*c+r*v*c+l*a*g-r*A*g)*E,n[15]=(l*d*o-u*A*o+u*a*c-r*d*c-l*a*f+r*A*f)*E,this},scale:function(e){var t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))},makeTranslation:function(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var n=Math.cos(t),i=Math.sin(t),r=1-n,a=e.x,o=e.y,s=e.z,l=r*a,A=r*o;return this.set(l*a+n,l*o-i*s,l*s+i*o,0,l*o+i*s,A*o+n,A*s-i*a,0,l*s-i*o,A*s+i*a,r*s*s+n,0,0,0,0,1),this},makeScale:function(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,n){var i=this.elements,r=t._x,a=t._y,o=t._z,s=t._w,l=r+r,A=a+a,c=o+o,h=r*l,u=r*A,d=r*c,f=a*A,p=a*c,m=o*c,v=s*l,g=s*A,y=s*c,w=n.x,x=n.y,b=n.z;return i[0]=(1-(f+m))*w,i[1]=(u+y)*w,i[2]=(d-g)*w,i[3]=0,i[4]=(u-y)*x,i[5]=(1-(h+m))*x,i[6]=(p+v)*x,i[7]=0,i[8]=(d+g)*b,i[9]=(p-v)*b,i[10]=(1-(h+f))*b,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},decompose:function(e,t,n){var i=this.elements,r=pt.set(i[0],i[1],i[2]).length(),a=pt.set(i[4],i[5],i[6]).length(),o=pt.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],mt.copy(this);var s=1/r,l=1/a,A=1/o;return mt.elements[0]*=s,mt.elements[1]*=s,mt.elements[2]*=s,mt.elements[4]*=l,mt.elements[5]*=l,mt.elements[6]*=l,mt.elements[8]*=A,mt.elements[9]*=A,mt.elements[10]*=A,t.setFromRotationMatrix(mt),n.x=r,n.y=a,n.z=o,this},makePerspective:function(e,t,n,i,r,a){void 0===a&&console.warn("Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var o=this.elements,s=2*r/(t-e),l=2*r/(n-i),A=(t+e)/(t-e),c=(n+i)/(n-i),h=-(a+r)/(a-r),u=-2*a*r/(a-r);return o[0]=s,o[4]=0,o[8]=A,o[12]=0,o[1]=0,o[5]=l,o[9]=c,o[13]=0,o[2]=0,o[6]=0,o[10]=h,o[14]=u,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makeOrthographic:function(e,t,n,i,r,a){var o=this.elements,s=1/(t-e),l=1/(n-i),A=1/(a-r),c=(t+e)*s,h=(n+i)*l,u=(a+r)*A;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-c,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-h,o[2]=0,o[6]=0,o[10]=-2*A,o[14]=-u,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var n=0;n<16;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e},invert:function(){var e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],s=e[6],l=e[7],A=e[8],c=e[9],h=e[10],u=e[11],d=e[12],f=e[13],p=e[14],m=e[15],v=c*p*l-f*h*l+f*s*u-o*p*u-c*s*m+o*h*m,g=d*h*l-A*p*l-d*s*u+a*p*u+A*s*m-a*h*m,y=A*f*l-d*c*l+d*o*u-a*f*u-A*o*m+a*c*m,w=d*c*s-A*f*s-d*o*h+a*f*h+A*o*p-a*c*p,x=t*v+n*g+i*y+r*w;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);var b=1/x;return e[0]=v*b,e[1]=(f*h*r-c*p*r-f*i*u+n*p*u+c*i*m-n*h*m)*b,e[2]=(o*p*r-f*s*r+f*i*l-n*p*l-o*i*m+n*s*m)*b,e[3]=(c*s*r-o*h*r-c*i*l+n*h*l+o*i*u-n*s*u)*b,e[4]=g*b,e[5]=(A*p*r-d*h*r+d*i*u-t*p*u-A*i*m+t*h*m)*b,e[6]=(d*s*r-a*p*r-d*i*l+t*p*l+a*i*m-t*s*m)*b,e[7]=(a*h*r-A*s*r+A*i*l-t*h*l-a*i*u+t*s*u)*b,e[8]=y*b,e[9]=(d*c*r-A*f*r-d*n*u+t*f*u+A*n*m-t*c*m)*b,e[10]=(a*f*r-d*o*r+d*n*l-t*f*l-a*n*m+t*o*m)*b,e[11]=(A*o*r-a*c*r-A*n*l+t*c*l+a*n*u-t*o*u)*b,e[12]=w*b,e[13]=(A*f*i-d*c*i+d*n*h-t*f*h-A*n*p+t*c*p)*b,e[14]=(d*o*i-a*f*i-d*n*s+t*f*s+a*n*p-t*o*p)*b,e[15]=(a*c*i-A*o*i+A*n*s-t*c*s-a*n*h+t*o*h)*b,this}});var Mt=new bt,Ct=new nt;function Bt(e,t,n,i){this._x=e||0,this._y=t||0,this._z=n||0,this._order=i||Bt.DefaultOrder}function Et(){this._mask=1}Bt.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],Bt.DefaultOrder="XYZ",Object.defineProperties(Bt.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this._onChangeCallback()}}}),Object.assign(Bt.prototype,{isEuler:!0,set:function(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._order=i||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var i=et.clamp,r=e.elements,a=r[0],o=r[4],s=r[8],l=r[1],A=r[5],c=r[9],h=r[2],u=r[6],d=r[10];return"XYZ"===(t=t||this._order)?(this._y=Math.asin(i(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-c,d),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(u,A),this._z=0)):"YXZ"===t?(this._x=Math.asin(-i(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(s,d),this._z=Math.atan2(l,A)):(this._y=Math.atan2(-h,a),this._z=0)):"ZXY"===t?(this._x=Math.asin(i(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-h,d),this._z=Math.atan2(-o,A)):(this._y=0,this._z=Math.atan2(l,a))):"ZYX"===t?(this._y=Math.asin(-i(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-o,A))):"YZX"===t?(this._z=Math.asin(i(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-c,A),this._y=Math.atan2(-h,a)):(this._x=0,this._y=Math.atan2(s,d))):"XZY"===t?(this._z=Math.asin(-i(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(u,A),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-c,d),this._y=0)):console.warn("Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,!1!==n&&this._onChangeCallback(),this},setFromQuaternion:function(e,t,n){return Mt.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Mt,t,n)},setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(e){return Ct.setFromEuler(this),this.setFromQuaternion(Ct,e)},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new at(this._x,this._y,this._z)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}}),Object.defineProperties(Et.prototype,{mask:{get:function(){return this._mask},set:function(e){this._mask=e,this._onChangeCallback()}}}),Object.assign(Et.prototype,{set:function(e){this.mask=1<<e|0,this._onChangeCallback()},enable:function(e){this.mask|=1<<e|0,this._onChangeCallback()},enableAll:function(){this.mask=-1,this._onChangeCallback()},toggle:function(e){this.mask^=1<<e|0,this._onChangeCallback()},disable:function(e){this.mask&=~(1<<e|0),this._onChangeCallback()},disableAll:function(){this.mask=0,this._onChangeCallback()},test:function(e){return 0!=(this.mask&e.mask)},_onChange:function(e){return this._onChangeCallback=e,this},_onChangeCallback:function(){}});var St=0,Tt=new at,_t=new nt,It=new bt,Lt=new at,Ft=new at,kt=new at,Pt=new nt,Ut=new at(1,0,0),Dt=new at(0,1,0),Rt=new at(0,0,1),Ot={type:"added"},Nt={type:"removed"};function zt(){Object.defineProperty(this,"id",{value:St++}),this.viewer=null,this.uuid=et.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=zt.DefaultUp.clone();var e=new at,t=new Bt,n=new nt,i=new at(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new bt},normalMatrix:{value:new lt}}),this.matrix=new bt,this.matrixWorld=new bt,this.matrixAutoUpdate=zt.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Et;var r=this;this.layers._onChange((function(){r.viewer&&r.viewer.renderManager.render()})),this._visible=!0,this._castShadow=!1,this._receiveShadow=!1,this._frustumCulled=!0,this._renderOrder=0,this.userData={},this.isDirty=!1}function Qt(){zt.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}zt.DefaultUp=new at(0,1,0),zt.DefaultMatrixAutoUpdate=!0,Object.defineProperties(zt.prototype,{visible:{get:function(){return this._visible},set:function(e){this._visible!==e&&(this.viewer&&this.viewer.renderManager.render(),this.activeCallback(this._visible)),this._visible=e}},castShadow:{get:function(){return this._castShadow},set:function(e){this._castShadow!==e&&this.viewer&&this.viewer.renderManager.render(),this._castShadow=e}},receiveShadow:{get:function(){return this._receiveShadow},set:function(e){this._receiveShadow!==e&&this.viewer&&this.viewer.renderManager.render(),this._receiveShadow=e}},frustumCulled:{get:function(){return this._frustumCulled},set:function(e){this._frustumCulled!==e&&this.viewer&&this.viewer.renderManager.render(),this._frustumCulled=e}},renderOrder:{get:function(){return this._renderOrder},set:function(e){this._renderOrder!==e&&this.viewer&&this.viewer.renderManager.render(),this._renderOrder=e}}}),Object.assign(zt.prototype,Je.prototype),zt.prototype=Object.assign(zt.prototype,{constructor:zt,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},setDirty:function(){this.isDirty=!0},activeCallback:function(e){},applyMatrix:function(e){this.viewer&&this.viewer.renderManager.render(),this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyMatrix4:function(e){this.applyMatrix(e)},applyQuaternion:function(e){return this.quaternion.premultiply(e),this},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(e,t){return _t.setFromAxisAngle(e,t),this.quaternion.multiply(_t),this},rotateOnWorldAxis:function(e,t){return _t.setFromAxisAngle(e,t),this.quaternion.premultiply(_t),this},rotateX:function(e){return this.rotateOnAxis(Ut,e)},rotateY:function(e){return this.rotateOnAxis(Dt,e)},rotateZ:function(e){return this.rotateOnAxis(Rt,e)},setRotation:function(e,t,n){void 0!==e&&(this.rotation.x=et.degToRad(e)),void 0!==t&&(this.rotation.y=et.degToRad(t)),void 0!==n&&(this.rotation.z=et.degToRad(n))},getRotation:function(){return{x:et.radToDeg(this.rotation.x),y:et.radToDeg(this.rotation.y),z:et.radToDeg(this.rotation.z)}},setScale:function(e,t,n){this.scale.set(e,t,n)},translateOnAxis:function(e,t){return Tt.copy(e).applyQuaternion(this.quaternion),this.position.add(Tt.multiplyScalar(t)),this},translateX:function(e){return this.translateOnAxis(Ut,e)},translateY:function(e){return this.translateOnAxis(Dt,e)},translateZ:function(e){return this.translateOnAxis(Rt,e)},localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(e){return e.applyMatrix4(It.getInverse(this.matrixWorld))},lookAt:function(e,t,n){e.isVector3?Lt.copy(e):Lt.set(e,t,n);var i=this.parent;this.updateWorldMatrix(!0,!1),Ft.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?It.lookAt(Ft,Lt,this.up):It.lookAt(Lt,Ft,this.up),this.quaternion.setFromRotationMatrix(It),i&&(It.extractRotation(i.matrixWorld),_t.setFromRotationMatrix(It),this.quaternion.premultiply(_t.inverse()))},add:function(e){if(this.viewer&&this.viewer.renderManager.render(),arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,this.viewer&&(e.viewer=this.viewer),this.children.push(e),e.dispatchEvent(Ot)):console.error("Object3D.add: object not an instance of Object3D.",e),this)},remove:function(e){if(this.viewer&&this.viewer.renderManager.render(),arguments.length>1){for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}var n=this.children.indexOf(e);return-1!==n&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(Nt)),this},attach:function(e){return this.updateWorldMatrix(!0,!1),It.getInverse(this.matrixWorld),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),It.multiply(e.parent.matrixWorld)),e.applyMatrix(It),e.updateWorldMatrix(!1,!1),this.add(e),this},applyWorldMatrix4:function(e){this.parent?(It.getInverse(this.parent.matrixWorld),this.applyMatrix(e),this.applyMatrix(It),this.updateWorldMatrix(!1,!1)):this.applyMatrix4(e)},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var n=0,i=this.children.length;n<i;n++){var r=this.children[n].getObjectByProperty(e,t);if(void 0!==r)return r}},getWorldPosition:function(e){return void 0===e&&(console.warn("Object3D: .getWorldPosition() target is now required"),e=new at),this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(e){return void 0===e&&(console.warn("Object3D: .getWorldQuaternion() target is now required"),e=new nt),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Ft,e,kt),e},getWorldScale:function(e){return void 0===e&&(console.warn("Object3D: .getWorldScale() target is now required"),e=new at),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Ft,Pt,e),e},getWorldDirection:function(e){void 0===e&&(console.warn("Object3D: .getWorldDirection() target is now required"),e=new at),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()},raycast:function(){},traverse:function(e){e(this);for(var t=this.children,n=0,i=t.length;n<i;n++)t[n].traverse(e)},traverseVisible:function(e){if(!1!==this.visible){e(this);for(var t=this.children,n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){var e=this.matrix.clone();this.matrix.compose(this.position,this.quaternion,this.scale),this.matrix.equals(e)||this.viewer&&this.viewer.renderManager.render(),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){if(this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldNeedsUpdate||e){var t=this.matrixWorld.clone();null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0,this.matrixWorld.equals(t)||(this.viewer&&this.viewer.renderManager.render(),this.setDirty())}for(var n=this.children,i=0,r=n.length;i<r;i++)n[i].updateMatrixWorld(e)},updateWorldMatrix:function(e,t){this.viewer&&this.viewer.renderManager.render();var n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===t)for(var i=this.children,r=0,a=i.length;r<a;r++)i[r].updateWorldMatrix(!1,!0)},toJSON:function(e){var t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var i={};function r(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isMesh&&0!==this.drawMode&&(i.drawMode=this.drawMode),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);var a=this.geometry.parameters;if(void 0!==a&&void 0!==a.shapes){var o=a.shapes;if(Array.isArray(o))for(var s=0,l=o.length;s<l;s++){var A=o[s];r(e.shapes,A)}else r(e.shapes,o)}}if(void 0!==this.material)if(Array.isArray(this.material)){var c=[];for(s=0,l=this.material.length;s<l;s++)c.push(r(e.materials,this.material[s]));i.material=c}else i.material=r(e.materials,this.material);if(this.children.length>0){i.children=[];for(s=0;s<this.children.length;s++)i.children.push(this.children[s].toJSON(e).object)}if(t){var h=p(e.geometries),u=p(e.materials),d=p(e.textures),f=p(e.images);o=p(e.shapes);h.length>0&&(n.geometries=h),u.length>0&&(n.materials=u),d.length>0&&(n.textures=d),f.length>0&&(n.images=f),o.length>0&&(n.shapes=o)}return n.object=i,n;function p(e){var t=[];for(var n in e){var i=e[n];delete i.metadata,t.push(i)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(this.viewer&&this.viewer.renderManager.render(),void 0===t&&(t=!0),this.name=e.name,this.lastUUID=e.uuid,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,e.ID&&(this.ID=e.ID),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var n=0;n<e.children.length;n++){var i=e.children[n];this.add(i.clone())}return this}}),Qt.prototype=Object.assign(Object.create(zt.prototype),{constructor:Qt,isScene:!0,copy:function(e,t){return zt.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},toJSON:function(e){var t=zt.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Gt=[new at,new at,new at,new at,new at,new at,new at,new at],Ht=new at,Vt=new tn,jt=new at,Wt=new at,Xt=new at,Yt=new at,Kt=new at,Zt=new at,Jt=new at,qt=new at,$t=new at,en=new at;function tn(e,t){this.min=void 0!==e?e:new at(1/0,1/0,1/0),this.max=void 0!==t?t:new at(-1/0,-1/0,-1/0)}function nn(e,t,n,i,r){var a,o;for(a=0,o=e.length-3;a<=o;a+=3){en.fromArray(e,a);var s=r.x*Math.abs(en.x)+r.y*Math.abs(en.y)+r.z*Math.abs(en.z),l=t.dot(en),A=n.dot(en),c=i.dot(en);if(Math.max(-Math.max(l,A,c),Math.min(l,A,c))>s)return!1}return!0}Object.assign(tn.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,l=e.length;s<l;s+=3){var A=e[s],c=e[s+1],h=e[s+2];A<t&&(t=A),c<n&&(n=c),h<i&&(i=h),A>r&&(r=A),c>a&&(a=c),h>o&&(o=h)}return this.min.set(t,n,i),this.max.set(r,a,o),this},setFromBufferAttribute:function(e){for(var t=1/0,n=1/0,i=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,l=e.count;s<l;s++){var A=e.getX(s),c=e.getY(s),h=e.getZ(s);A<t&&(t=A),c<n&&(n=c),h<i&&(i=h),A>r&&(r=A),c>a&&(a=c),h>o&&(o=h)}return this.min.set(t,n,i),this.max.set(r,a,o),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=Ht.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},setFromObject:function(e){return this.makeEmpty(),this.expandByObject(e)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){return void 0===e&&(console.warn("Box3: .getCenter() target is now required"),e=new at),this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(console.warn("Box3: .getSize() target is now required"),e=new at),this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},expandByObject:function(e){e.updateWorldMatrix(!1,!1);var t=e.geometry;if(t){if(t||console.log(e),null===t.boundingBox&&t.computeBoundingBox(),Vt.copy(t.boundingBox),Vt.applyMatrix4(e.matrixWorld),isNaN(Vt.min.x)||isNaN(Vt.max.x))return;this.expandByPoint(Vt.min),this.expandByPoint(Vt.max)}for(var n=e.children,i=0,r=n.length;i<r;i++)void 0===n[i].isAmrtAlphaHotSpotEntity&&this.expandByObject(n[i]);return this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return void 0===t&&(console.warn("Box3: .getParameter() target is now required"),t=new at),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},intersectsSphere:function(e){return this.clampPoint(e.center,Ht),Ht.distanceToSquared(e.center)<=e.radius*e.radius},intersectsPlane:function(e){var t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant},intersectsTriangle:function(e){if(this.isEmpty())return!1;this.getCenter(Jt),qt.subVectors(this.max,Jt),jt.subVectors(e.a,Jt),Wt.subVectors(e.b,Jt),Xt.subVectors(e.c,Jt),Yt.subVectors(Wt,jt),Kt.subVectors(Xt,Wt),Zt.subVectors(jt,Xt);var t=[0,-Yt.z,Yt.y,0,-Kt.z,Kt.y,0,-Zt.z,Zt.y,Yt.z,0,-Yt.x,Kt.z,0,-Kt.x,Zt.z,0,-Zt.x,-Yt.y,Yt.x,0,-Kt.y,Kt.x,0,-Zt.y,Zt.x,0];return!!nn(t,jt,Wt,Xt,qt)&&(!!nn(t=[1,0,0,0,1,0,0,0,1],jt,Wt,Xt,qt)&&($t.crossVectors(Yt,Kt),nn(t=[$t.x,$t.y,$t.z],jt,Wt,Xt,qt)))},clampPoint:function(e,t){return void 0===t&&(console.warn("Box3: .clampPoint() target is now required"),t=new at),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return Ht.copy(e).clamp(this.min,this.max).sub(e).length()},getBoundingSphere:function(e){return void 0===e&&console.error("Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(Ht).length(),e},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(e){return this.isEmpty()||(Gt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Gt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Gt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Gt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Gt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Gt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Gt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Gt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Gt)),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var rn=new tn;function an(e,t){this.center=void 0!==e?e:new at,this.radius=void 0!==t?t:0}Object.assign(an.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(e,t){var n=this.center;void 0!==t?n.copy(t):rn.setFromPoints(e).getCenter(n);for(var i=0,r=0,a=e.length;r<a;r++)i=Math.max(i,n.distanceToSquared(e[r]));return this.radius=Math.sqrt(i),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var n=this.center.distanceToSquared(e);return void 0===t&&(t=new at),t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},getBoundingBox:function(e){return void 0===e&&(e=new tn),e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}});var on=new at,sn=new at,ln=new at,An=new at,cn=new at,hn=new at,un=new at;function dn(e,t){this.origin=void 0!==e?e:new at,this.direction=void 0!==t?t:new at(0,0,-1)}Object.assign(dn.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return void 0===t&&(t=new at),t.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(e){return this.origin.copy(this.at(e,on)),this},closestPointToPoint:function(e,t){void 0===t&&(console.warn("Ray: .closestPointToPoint() target is now required"),t=new at),t.subVectors(e,this.origin);var n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(e){var t=on.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(on.copy(this.direction).multiplyScalar(t).add(this.origin),on.distanceToSquared(e))},distanceSqToSegment:function(e,t,n,i){sn.copy(e).add(t).multiplyScalar(.5),ln.copy(t).sub(e).normalize(),An.copy(this.origin).sub(sn);var r,a,o,s,l=.5*e.distanceTo(t),A=-this.direction.dot(ln),c=An.dot(this.direction),h=-An.dot(ln),u=An.lengthSq(),d=Math.abs(1-A*A);if(d>0)if(a=A*c-h,s=l*d,(r=A*h-c)>=0)if(a>=-s)if(a<=s){var f=1/d;o=(r*=f)*(r+A*(a*=f)+2*c)+a*(A*r+a+2*h)+u}else a=l,o=-(r=Math.max(0,-(A*a+c)))*r+a*(a+2*h)+u;else a=-l,o=-(r=Math.max(0,-(A*a+c)))*r+a*(a+2*h)+u;else a<=-s?o=-(r=Math.max(0,-(-A*l+c)))*r+(a=r>0?-l:Math.min(Math.max(-l,-h),l))*(a+2*h)+u:a<=s?(r=0,o=(a=Math.min(Math.max(-l,-h),l))*(a+2*h)+u):o=-(r=Math.max(0,-(A*l+c)))*r+(a=r>0?l:Math.min(Math.max(-l,-h),l))*(a+2*h)+u;else a=A>0?-l:l,o=-(r=Math.max(0,-(A*a+c)))*r+a*(a+2*h)+u;return n&&n.copy(this.direction).multiplyScalar(r).add(this.origin),i&&i.copy(ln).multiplyScalar(a).add(sn),o},intersectSphere:function(e,t){on.subVectors(e.center,this.origin);var n=on.dot(this.direction),i=on.dot(on)-n*n,r=e.radius*e.radius;if(i>r)return null;var a=Math.sqrt(r-i),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,t):this.at(o,t)},intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null},intersectPlane:function(e,t){var n=this.distanceToPlane(e);return null===n?null:this.at(n,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},intersectBox:function(e,t){var n,i,r,a,o,s,l=1/this.direction.x,A=1/this.direction.y,c=1/this.direction.z,h=this.origin;return l>=0?(n=(e.min.x-h.x)*l,i=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,i=(e.min.x-h.x)*l),A>=0?(r=(e.min.y-h.y)*A,a=(e.max.y-h.y)*A):(r=(e.max.y-h.y)*A,a=(e.min.y-h.y)*A),n>a||r>i?null:((r>n||n!=n)&&(n=r),(a<i||i!=i)&&(i=a),c>=0?(o=(e.min.z-h.z)*c,s=(e.max.z-h.z)*c):(o=(e.max.z-h.z)*c,s=(e.min.z-h.z)*c),n>s||o>i?null:((o>n||n!=n)&&(n=o),(s<i||i!=i)&&(i=s),i<0?null:this.at(n>=0?n:i,t)))},intersectsBox:function(e){return null!==this.intersectBox(e,on)},intersectTriangle:function(e,t,n,i,r){cn.subVectors(t,e),hn.subVectors(n,e),un.crossVectors(cn,hn);var a,o=this.direction.dot(un);if(o>0){if(i)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}An.subVectors(this.origin,e);var s=a*this.direction.dot(hn.crossVectors(An,hn));if(s<0)return null;var l=a*this.direction.dot(cn.cross(An));if(l<0)return null;if(s+l>o)return null;var A=-a*An.dot(un);return A<0?null:this.at(A/o,r)},applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}});var fn=new at,pn=new at,mn=new lt;function vn(e,t){this.normal=void 0!==e?e:new at(1,0,0),this.constant=void 0!==t?t:0}Object.assign(vn.prototype,{isPlane:!0,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(e,t,n){var i=fn.subVectors(n,t).cross(pn.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return void 0===t&&(console.warn("Plane: .projectPoint() target is now required"),t=new at),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(e,t){void 0===t&&(console.warn("Plane: .intersectLine() target is now required"),t=new at);var n=e.delta(fn),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(e.start)?t.copy(e.start):void 0;var r=-(e.start.dot(this.normal)+this.constant)/i;return r<0||r>1?void 0:t.copy(n).multiplyScalar(r).add(e.start)},intersectsLine:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return void 0===e&&(console.warn("Plane: .coplanarPoint() target is now required"),e=new at),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(e,t){var n=t||mn.getNormalMatrix(e),i=this.coplanarPoint(fn).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this},translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}});var gn=new at,yn=new at,wn=new at,xn=new at,bn=new at,Mn=new at,Cn=new at,Bn=new at,En=new at,Sn=new at;function Tn(e,t,n){this.a=void 0!==e?e:new at,this.b=void 0!==t?t:new at,this.c=void 0!==n?n:new at}Object.assign(Tn,{getNormal:function(e,t,n,i){void 0===i&&(i=new at),i.subVectors(n,t),gn.subVectors(e,t),i.cross(gn);var r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)},getBarycoord:function(e,t,n,i,r){gn.subVectors(i,t),yn.subVectors(n,t),wn.subVectors(e,t);var a=gn.dot(gn),o=gn.dot(yn),s=gn.dot(wn),l=yn.dot(yn),A=yn.dot(wn),c=a*l-o*o;if(void 0===r&&(r=new at),0===c)return r.set(-2,-1,-1);var h=1/c,u=(l*s-o*A)*h,d=(a*A-o*s)*h;return r.set(1-u-d,d,u)},containsPoint:function(e,t,n,i){return Tn.getBarycoord(e,t,n,i,xn),xn.x>=0&&xn.y>=0&&xn.x+xn.y<=1},getUV:function(e,t,n,i,r,a,o,s){return this.getBarycoord(e,t,n,i,xn),s.set(0,0),s.addScaledVector(r,xn.x),s.addScaledVector(a,xn.y),s.addScaledVector(o,xn.z),s},isFrontFacing:function(e,t,n,i){return gn.subVectors(n,t),yn.subVectors(e,t),gn.cross(yn).dot(i)<0}}),Object.assign(Tn.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},getArea:function(){return gn.subVectors(this.c,this.b),yn.subVectors(this.a,this.b),.5*gn.cross(yn).length()},getMidpoint:function(e){return void 0===e&&(e=new at),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return Tn.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return void 0===e&&(e=new vn),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return Tn.getBarycoord(e,this.a,this.b,this.c,t)},getUV:function(e,t,n,i,r){return Tn.getUV(e,this.a,this.b,this.c,t,n,i,r)},containsPoint:function(e){return Tn.containsPoint(e,this.a,this.b,this.c)},isFrontFacing:function(e){return Tn.isFrontFacing(this.a,this.b,this.c,e)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(e,t){void 0===t&&(t=new at);var n,i,r=this.a,a=this.b,o=this.c;bn.subVectors(a,r),Mn.subVectors(o,r),Bn.subVectors(e,r);var s=bn.dot(Bn),l=Mn.dot(Bn);if(s<=0&&l<=0)return t.copy(r);En.subVectors(e,a);var A=bn.dot(En),c=Mn.dot(En);if(A>=0&&c<=A)return t.copy(a);var h=s*c-A*l;if(h<=0&&s>=0&&A<=0)return n=s/(s-A),t.copy(r).addScaledVector(bn,n);Sn.subVectors(e,o);var u=bn.dot(Sn),d=Mn.dot(Sn);if(d>=0&&u<=d)return t.copy(o);var f=u*l-s*d;if(f<=0&&l>=0&&d<=0)return i=l/(l-d),t.copy(r).addScaledVector(Mn,i);var p=A*d-u*c;if(p<=0&&c-A>=0&&u-d>=0)return Cn.subVectors(o,a),i=(c-A)/(c-A+(u-d)),t.copy(a).addScaledVector(Cn,i);var m=1/(p+f+h);return n=f*m,i=h*m,t.copy(r).addScaledVector(bn,n).addScaledVector(Mn,i)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}});var _n={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},In={h:0,s:0,l:0},Ln={h:0,s:0,l:0};function Fn(e,t,n){return void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}function kn(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function Pn(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function Un(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}function Dn(e,t,n,i,r,a){this.a=e,this.b=t,this.c=n,this.normal=i&&i.isVector3?i:new at,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new Fn,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==a?a:0}Object.assign(Fn.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(e,t,n){if(e=et.euclideanModulo(e,1),t=et.clamp(t,0,1),n=et.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{var i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i;this.r=kn(r,i,e+1/3),this.g=kn(r,i,e),this.b=kn(r,i,e-1/3)}return this},setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("Color: Alpha component of "+e+" will be ignored.")}var n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var i,r=n[1],a=n[2];switch(r){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(i[1])/360,s=parseInt(i[2],10)/100,l=parseInt(i[3],10)/100;return t(i[5]),this.setHSL(o,s,l)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(e)){var A=n[1],c=A.length;if(3===c)return this.r=parseInt(A.charAt(0)+A.charAt(0),16)/255,this.g=parseInt(A.charAt(1)+A.charAt(1),16)/255,this.b=parseInt(A.charAt(2)+A.charAt(2),16)/255,this;if(6===c)return this.r=parseInt(A.charAt(0)+A.charAt(1),16)/255,this.g=parseInt(A.charAt(2)+A.charAt(3),16)/255,this.b=parseInt(A.charAt(4)+A.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this},setColorName:function(e){var t=_n[e];return void 0!==t?this.setHex(t):console.warn("Color: Unknown color "+e),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this},convertGammaToLinear:function(e){return this.copyGammaToLinear(this,e),this},convertLinearToGamma:function(e){return this.copyLinearToGamma(this,e),this},copySRGBToLinear:function(e){return this.r=Pn(e.r),this.g=Pn(e.g),this.b=Pn(e.b),this},copyLinearToSRGB:function(e){return this.r=Un(e.r),this.g=Un(e.g),this.b=Un(e.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){void 0===e&&(console.warn("Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,n,i=this.r,r=this.g,a=this.b,o=Math.max(i,r,a),s=Math.min(i,r,a),l=(s+o)/2;if(s===o)t=0,n=0;else{var A=o-s;switch(n=l<=.5?A/(o+s):A/(2-o-s),o){case i:t=(r-a)/A+(r<a?6:0);break;case r:t=(a-i)/A+2;break;case a:t=(i-r)/A+4}t/=6}return e.h=t,e.s=n,e.l=l,e},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,n){return this.getHSL(In),In.h+=e,In.s+=t,In.l+=n,this.setHSL(In.h,In.s,In.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},lerpHSL:function(e,t){this.getHSL(In),e.getHSL(Ln);var n=et.lerp(In.h,Ln.h,t),i=et.lerp(In.s,Ln.s,t),r=et.lerp(In.l,Ln.l,t);return this.setHSL(n,i,r),this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}}),Fn.NAMES=_n,Object.assign(Dn.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,n=e.vertexNormals.length;t<n;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(t=0,n=e.vertexColors.length;t<n;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}});var Rn=0;function On(){Object.defineProperty(this,"id",{value:Rn++}),this.uuid=et.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.flatShading=!1,this.vertexTangents=!1,this.vertexColors=0,this.opacity=1,this.transparent=!1,this.blendSrc=P,this.blendDst=U,this.blendEquation=I,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=We,this.stencilZFail=We,this.stencilZPass=We,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function Nn(e){On.call(this),this.type="MeshBasicMaterial",this.color=new Fn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(e)}function zn(e,t,n){if(Array.isArray(e))throw new TypeError("BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=Xe,this.updateRange={offset:0,count:-1},this.version=0}function Qn(e,t,n){zn.call(this,new Int8Array(e),t,n)}function Gn(e,t,n){zn.call(this,new Uint8Array(e),t,n)}function Hn(e,t,n){zn.call(this,new Uint8ClampedArray(e),t,n)}function Vn(e,t,n){zn.call(this,new Int16Array(e),t,n)}function jn(e,t,n){zn.call(this,new Uint16Array(e),t,n)}function Wn(e,t,n){zn.call(this,new Int32Array(e),t,n)}function Xn(e,t,n){zn.call(this,new Uint32Array(e),t,n)}function Yn(e,t,n){zn.call(this,new Float32Array(e),t,n)}function Kn(e,t,n){zn.call(this,new Float64Array(e),t,n)}function Zn(e,t,n){zn.call(this,e,t,n)}function Jn(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function qn(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,i=e.length;n<i;++n)e[n]>t&&(t=e[n]);return t}On.prototype=Object.assign(Object.create(Je.prototype),{constructor:On,isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n)if("shading"!==t){var i=this[t];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n:console.warn(this.type+": '"+t+"' is not a property of this material.")}else console.warn(this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;else console.warn("Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){var t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function i(e){var t=[];for(var n in e){var i=e[n];delete i.metadata,t.push(i)}return t}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),0!==this.side&&(n.side=this.side),0!==this.vertexColors&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(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),t){var r=i(e.textures),a=i(e.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexTangents=e.vertexTangents,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;var t=e.clippingPlanes,n=null;if(null!==t){var i=t.length;n=new Array(i);for(var r=0;r!==i;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(On.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Nn.prototype=Object.create(On.prototype),Nn.prototype.constructor=Nn,Nn.prototype.isMeshBasicMaterial=!0,Nn.prototype.copy=function(e){return On.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this},Object.defineProperty(zn.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(zn.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("BufferAttribute.copyColorsArray(): color is undefined",i),a=new Fn),t[n++]=a.r,t[n++]=a.g,t[n++]=a.b}return this},copyVector2sArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("BufferAttribute.copyVector2sArray(): vector is undefined",i),a=new tt),t[n++]=a.x,t[n++]=a.y}return this},copyVector3sArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("BufferAttribute.copyVector3sArray(): vector is undefined",i),a=new at),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z}return this},copyVector4sArray:function(e){for(var t=this.array,n=0,i=0,r=e.length;i<r;i++){var a=e[i];void 0===a&&(console.warn("BufferAttribute.copyVector4sArray(): vector is undefined",i),a=new ut),t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n++]=a.w}return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this},setXYZ:function(e,t,n,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this},setXYZW:function(e,t,n,i,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),Qn.prototype=Object.create(zn.prototype),Qn.prototype.constructor=Qn,Gn.prototype=Object.create(zn.prototype),Gn.prototype.constructor=Gn,Hn.prototype=Object.create(zn.prototype),Hn.prototype.constructor=Hn,Vn.prototype=Object.create(zn.prototype),Vn.prototype.constructor=Vn,jn.prototype=Object.create(zn.prototype),jn.prototype.constructor=jn,Wn.prototype=Object.create(zn.prototype),Wn.prototype.constructor=Wn,Xn.prototype=Object.create(zn.prototype),Xn.prototype.constructor=Xn,Yn.prototype=Object.create(zn.prototype),Yn.prototype.constructor=Yn,Kn.prototype=Object.create(zn.prototype),Kn.prototype.constructor=Kn,Zn.prototype=Object.create(zn.prototype),Zn.prototype.constructor=Zn,Object.assign(Jn.prototype,{computeGroups:function(e){for(var t,n=[],i=void 0,r=e.faces,a=0;a<r.length;a++){var o=r[a];o.materialIndex!==i&&(i=o.materialIndex,void 0!==t&&(t.count=3*a-t.start,n.push(t)),t={start:3*a,materialIndex:i})}void 0!==t&&(t.count=3*a-t.start,n.push(t)),this.groups=n},fromGeometry:function(e){var t,n=e.faces,i=e.vertices,r=e.faceVertexUvs,a=r[0]&&r[0].length>0,o=r[1]&&r[1].length>0,s=e.morphTargets,l=s.length;if(l>0){t=[];for(var A=0;A<l;A++)t[A]={name:s[A].name,data:[]};this.morphTargets.position=t}var c,h=e.morphNormals,u=h.length;if(u>0){c=[];for(A=0;A<u;A++)c[A]={name:h[A].name,data:[]};this.morphTargets.normal=c}var d=e.skinIndices,f=e.skinWeights,p=d.length===i.length,m=f.length===i.length;i.length>0&&0===n.length&&console.error("DirectGeometry: Faceless geometries are not supported.");for(A=0;A<n.length;A++){var v=n[A];this.vertices.push(i[v.a],i[v.b],i[v.c]);var g=v.vertexNormals;if(3===g.length)this.normals.push(g[0],g[1],g[2]);else{var y=v.normal;this.normals.push(y,y,y)}var w,x=v.vertexColors;if(3===x.length)this.colors.push(x[0],x[1],x[2]);else{var b=v.color;this.colors.push(b,b,b)}if(!0===a)void 0!==(w=r[0][A])?this.uvs.push(w[0],w[1],w[2]):(console.warn("DirectGeometry.fromGeometry(): Undefined vertexUv ",A),this.uvs.push(new tt,new tt,new tt));if(!0===o)void 0!==(w=r[1][A])?this.uvs2.push(w[0],w[1],w[2]):(console.warn("DirectGeometry.fromGeometry(): Undefined vertexUv2 ",A),this.uvs2.push(new tt,new tt,new tt));for(var M=0;M<l;M++){var C=s[M].vertices;t[M].data.push(C[v.a],C[v.b],C[v.c])}for(M=0;M<u;M++){var B=h[M].vertexNormals[A];c[M].data.push(B.a,B.b,B.c)}p&&this.skinIndices.push(d[v.a],d[v.b],d[v.c]),m&&this.skinWeights.push(f[v.a],f[v.b],f[v.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this}});var $n=1,ei=new bt,ti=new zt,ni=new at,ii=new tn,ri=new tn,ai=new at,oi=new at;function si(){Object.defineProperty(this,"id",{value:$n+=2}),this.uuid=et.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}function li(e,t,n,i,r,a,o,s,l){ht.call(this,e,t,n,i,r,a,o,s,l),this.format=void 0!==o?o:Ae,this.minFilter=void 0!==a?a:Z,this.magFilter=void 0!==r?r:Z,this.generateMipmaps=!1}si.prototype=Object.assign(Object.create(Je.prototype),{constructor:si,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){Array.isArray(e)?this.index=new(qn(e)>65535?Xn:jn)(e,1):this.index=e},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,n){this.groups.push({start:e,count:t,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix:function(e){var t=this.attributes.position;void 0!==t&&(e.applyToBufferAttribute(t),t.needsUpdate=!0);var n=this.attributes.normal;void 0!==n&&((new lt).getNormalMatrix(e).applyToBufferAttribute(n),n.needsUpdate=!0);var i=this.attributes.tangent;void 0!==i&&((new lt).getNormalMatrix(e).applyToBufferAttribute(i),i.needsUpdate=!0);return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},applyMatrix4:function(e){return this.applyMatrix(e),this},rotateX:function(e){return ei.makeRotationX(e),this.applyMatrix(ei),this},rotateY:function(e){return ei.makeRotationY(e),this.applyMatrix(ei),this},rotateZ:function(e){return ei.makeRotationZ(e),this.applyMatrix(ei),this},translate:function(e,t,n){return ei.makeTranslation(e,t,n),this.applyMatrix(ei),this},scale:function(e,t,n){return ei.makeScale(e,t,n),this.applyMatrix(ei),this},lookAt:function(e){return ti.lookAt(e),ti.updateMatrix(),this.applyMatrix(ti.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(ni).negate(),this.translate(ni.x,ni.y,ni.z),this},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var n=new Yn(3*t.vertices.length,3),i=new Yn(3*t.colors.length,3);if(this.setAttribute("position",n.copyVector3sArray(t.vertices)),this.setAttribute("color",i.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var r=new Yn(t.lineDistances.length,1);this.setAttribute("lineDistance",r.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],n=0,i=e.length;n<i;n++){var r=e[n];t.push(r.x,r.y,r.z||0)}return this.setAttribute("position",new Yn(t,3)),this},updateFromObject:function(e){var t,n=e.geometry;if(e.isMesh){var i=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(i=void 0,n.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(n);i.verticesNeedUpdate=n.verticesNeedUpdate,i.normalsNeedUpdate=n.normalsNeedUpdate,i.colorsNeedUpdate=n.colorsNeedUpdate,i.uvsNeedUpdate=n.uvsNeedUpdate,i.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=i}return!0===n.verticesNeedUpdate&&(void 0!==(t=this.attributes.position)&&(t.copyVector3sArray(n.vertices),t.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(t=this.attributes.normal)&&(t.copyVector3sArray(n.normals),t.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(t=this.attributes.color)&&(t.copyColorsArray(n.colors),t.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(t=this.attributes.uv)&&(t.copyVector2sArray(n.uvs),t.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(t=this.attributes.lineDistance)&&(t.copyArray(n.lineDistances),t.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(e.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new Jn).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.setAttribute("position",new zn(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var n=new Float32Array(3*e.normals.length);this.setAttribute("normal",new zn(n,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var i=new Float32Array(3*e.colors.length);this.setAttribute("color",new zn(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var r=new Float32Array(2*e.uvs.length);this.setAttribute("uv",new zn(r,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var a=new Float32Array(2*e.uvs2.length);this.setAttribute("uv2",new zn(a,2).copyVector2sArray(e.uvs2))}for(var o in this.groups=e.groups,e.morphTargets){for(var s=[],l=e.morphTargets[o],A=0,c=l.length;A<c;A++){var h=l[A],u=new Yn(3*h.data.length,3);u.name=h.name,s.push(u.copyVector3sArray(h.data))}this.morphAttributes[o]=s}if(e.skinIndices.length>0){var d=new Yn(4*e.skinIndices.length,4);this.setAttribute("skinIndex",d.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var f=new Yn(4*e.skinWeights.length,4);this.setAttribute("skinWeight",f.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new tn);var e=this.attributes.position,t=this.morphAttributes.position;if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(var n=0,i=t.length;n<i;n++){var r=t[n];ii.setFromBufferAttribute(r),this.morphTargetsRelative?(ai.addVectors(this.boundingBox.min,ii.min),this.boundingBox.expandByPoint(ai),ai.addVectors(this.boundingBox.max,ii.max),this.boundingBox.expandByPoint(ai)):(this.boundingBox.expandByPoint(ii.min),this.boundingBox.expandByPoint(ii.max))}}else this.boundingBox.makeEmpty();this.boundingBox.getSize(oi),oi.x>.01&&oi.y>.01&&oi.z<.01?this.boundingBox.max.z+=.01:oi.x>.01&&oi.y<.01&&oi.z>.01?this.boundingBox.max.y+=.01:oi.x<.01&&oi.y>.01&&oi.z>.01&&(this.boundingBox.max.x+=.01),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new an);var e=this.attributes.position,t=this.morphAttributes.position;if(e){var n=this.boundingSphere.center;if(ii.setFromBufferAttribute(e),t)for(var i=0,r=t.length;i<r;i++){var a=t[i];ri.setFromBufferAttribute(a),this.morphTargetsRelative?(ai.addVectors(ii.min,ri.min),ii.expandByPoint(ai),ai.addVectors(ii.max,ri.max),ii.expandByPoint(ai)):(ii.expandByPoint(ri.min),ii.expandByPoint(ri.max))}ii.getCenter(n);var o=0;for(i=0,r=e.count;i<r;i++)ai.fromBufferAttribute(e,i),o=Math.max(o,n.distanceToSquared(ai));if(t)for(i=0,r=t.length;i<r;i++){a=t[i];for(var s=this.morphTargetsRelative,l=0,A=a.count;l<A;l++)ai.fromBufferAttribute(a,l),s&&(ni.fromBufferAttribute(e,l),ai.add(ni)),o=Math.max(o,n.distanceToSquared(ai))}this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius)&&console.error('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.attributes;if(t.position){var n=t.position.array;if(void 0===t.normal)this.setAttribute("normal",new zn(new Float32Array(n.length),3));else for(var i=t.normal.array,r=0,a=i.length;r<a;r++)i[r]=0;var o,s,l,A=t.normal.array,c=new at,h=new at,u=new at,d=new at,f=new at;if(e){var p=e.array;for(r=0,a=e.count;r<a;r+=3)o=3*p[r+0],s=3*p[r+1],l=3*p[r+2],c.fromArray(n,o),h.fromArray(n,s),u.fromArray(n,l),d.subVectors(u,h),f.subVectors(c,h),d.cross(f),A[o]+=d.x,A[o+1]+=d.y,A[o+2]+=d.z,A[s]+=d.x,A[s+1]+=d.y,A[s+2]+=d.z,A[l]+=d.x,A[l+1]+=d.y,A[l+2]+=d.z}else for(r=0,a=n.length;r<a;r+=9)c.fromArray(n,r),h.fromArray(n,r+3),u.fromArray(n,r+6),d.subVectors(u,h),f.subVectors(c,h),d.cross(f),A[r]=d.x,A[r+1]=d.y,A[r+2]=d.z,A[r+3]=d.x,A[r+4]=d.y,A[r+5]=d.z,A[r+6]=d.x,A[r+7]=d.y,A[r+8]=d.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if(e&&e.isBufferGeometry){void 0===t&&(t=0,console.warn("BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n=this.attributes;for(var i in n)if(void 0!==e.attributes[i])for(var r=n[i].array,a=e.attributes[i],o=a.array,s=a.itemSize*t,l=Math.min(o.length,r.length-s),A=0,c=s;A<l;A++,c++)r[c]=o[A];return this}console.error("BufferGeometry.merge(): geometry not an instance of BufferGeometry.",e)},normalizeNormals:function(){for(var e=this.attributes.normal,t=0,n=e.count;t<n;t++)ai.x=e.getX(t),ai.y=e.getY(t),ai.z=e.getZ(t),ai.normalize(),e.setXYZ(t,ai.x,ai.y,ai.z)},toNonIndexed:function(){function e(e,t){for(var n=e.array,i=e.itemSize,r=new n.constructor(t.length*i),a=0,o=0,s=0,l=t.length;s<l;s++){a=t[s]*i;for(var A=0;A<i;A++)r[o++]=n[a++]}return new zn(r,i)}if(null===this.index)return console.warn("BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new si,n=this.index.array,i=this.attributes;for(var r in i){var a=e(i[r],n);t.setAttribute(r,a)}var o=this.morphAttributes;for(r in o){for(var s=[],l=o[r],A=0,c=l.length;A<c;A++){a=e(l[A],n);s.push(a)}t.morphAttributes[r]=s}t.morphTargetsRelative=this.morphTargetsRelative;for(var h=this.groups,u=(A=0,h.length);A<u;A++){var d=h[A];t.addGroup(d.start,d.count,d.materialIndex)}return t},toJSON:function(){var e={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};var i=this.index;null!==i&&(e.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});var r=this.attributes;for(var n in r){var a=(u=r[n]).toJSON();""!==u.name&&(a.name=u.name),e.data.attributes[n]=a}var o={},s=!1;for(var n in this.morphAttributes){for(var l=this.morphAttributes[n],A=[],c=0,h=l.length;c<h;c++){var u;a=(u=l[c]).toJSON();""!==u.name&&(a.name=u.name),A.push(a)}A.length>0&&(o[n]=A,s=!0)}s&&(e.data.morphAttributes=o,e.data.morphTargetsRelative=this.morphTargetsRelative);var d=this.groups;d.length>0&&(e.data.groups=JSON.parse(JSON.stringify(d)));var f=this.boundingSphere;return null!==f&&(e.data.boundingSphere={center:f.center.toArray(),radius:f.radius}),e},clone:function(){return(new si).copy(this)},copy:function(e){var t,n,i;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var r=e.index;null!==r&&this.setIndex(r.clone());var a=e.attributes;for(t in a){var o=a[t];this.setAttribute(t,o.clone())}var s=e.morphAttributes;for(t in s){var l=[],A=s[t];for(n=0,i=A.length;n<i;n++)l.push(A[n].clone());this.morphAttributes[t]=l}this.morphTargetsRelative=e.morphTargetsRelative;var c=e.groups;for(n=0,i=c.length;n<i;n++){var h=c[n];this.addGroup(h.start,h.count,h.materialIndex)}var u=e.boundingBox;null!==u&&(this.boundingBox=u.clone());var d=e.boundingSphere;return null!==d&&(this.boundingSphere=d.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),li.prototype=Object.assign(Object.create(ht.prototype),{constructor:li,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}});var Ai=new bt,ci=new dn,hi=new an,ui=new at,di=new at,fi=new at,pi=new at,mi=new at,vi=new at,gi=new at,yi=new at,wi=new at,xi=new tt,bi=new tt,Mi=new tt,Ci=new at,Bi=new at;function Ei(e,t){zt.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new si,this.material=void 0!==t?t:new Nn({color:16777215*Math.random()}),this.drawMode=0,this.updateMorphTargets()}Ei.prototype=Object.assign(Object.create(zt.prototype),{constructor:Ei,isMesh:!0,setDrawMode:function(e){this.drawMode=e},copy:function(e){return zt.prototype.copy.call(this,e),this.drawMode=e.drawMode,void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e,t,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,a=Object.keys(r);if(a.length>0){var o=r[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=i.morphTargets;void 0!==s&&s.length>0&&console.error("Mesh.updateMorphTargets() no longer supports Geometry. Use BufferGeometry instead.")}},raycast:function(e,t){var n,i=this.geometry,r=this.material,a=this.matrixWorld;if(void 0!==r&&(null===i.boundingSphere&&i.computeBoundingSphere(),hi.copy(i.boundingSphere),hi.applyMatrix4(a),!1!==e.ray.intersectsSphere(hi)&&(Ai.getInverse(a),ci.copy(e.ray).applyMatrix4(Ai),null===i.boundingBox||!1!==ci.intersectsBox(i.boundingBox))))if(0===this.drawMode){if(i.isBufferGeometry){var o,s,l,A,c,h,u,d,f,p=i.index,m=i.attributes.position,v=i.morphAttributes.position,g=i.morphTargetsRelative,y=i.attributes.uv,w=i.attributes.uv2,x=i.groups,b=i.drawRange;if(null!==p)if(Array.isArray(r))for(A=0,h=x.length;A<h;A++)for(f=r[(d=x[A]).materialIndex],c=Math.max(d.start,b.start),u=Math.min(d.start+d.count,b.start+b.count);c<u;c+=3)o=p.getX(c),s=p.getX(c+1),l=p.getX(c+2),(n=this.checkBufferGeometryIntersection(this,f,e,ci,m,v,g,y,w,o,s,l))&&(n.faceIndex=Math.floor(c/3),n.face.materialIndex=d.materialIndex,t.push(n));else for(A=Math.max(0,b.start),h=Math.min(p.count,b.start+b.count);A<h;A+=3)o=p.getX(A),s=p.getX(A+1),l=p.getX(A+2),(n=this.checkBufferGeometryIntersection(this,r,e,ci,m,v,g,y,w,o,s,l))&&(n.faceIndex=Math.floor(A/3),t.push(n));else if(void 0!==m)if(Array.isArray(r))for(A=0,h=x.length;A<h;A++)for(f=r[(d=x[A]).materialIndex],c=Math.max(d.start,b.start),u=Math.min(d.start+d.count,b.start+b.count);c<u;c+=3)o=c,s=c+1,l=c+2,(n=this.checkBufferGeometryIntersection(this,f,e,ci,m,v,g,y,w,o,s,l))&&(n.faceIndex=Math.floor(c/3),n.face.materialIndex=d.materialIndex,t.push(n));else for(A=Math.max(0,b.start),h=Math.min(m.count,b.start+b.count);A<h;A+=3)o=A,s=A+1,l=A+2,(n=this.checkBufferGeometryIntersection(this,r,e,ci,m,v,g,y,w,o,s,l))&&(n.faceIndex=Math.floor(A/3),t.push(n))}else if(i.isGeometry){var M,C,B,E,S=Array.isArray(r),T=i.vertices,_=i.faces,I=i.faceVertexUvs[0];I.length>0&&(E=I);for(var L=0,F=_.length;L<F;L++){var k=_[L],P=S?r[k.materialIndex]:r;if(void 0!==P&&(M=T[k.a],C=T[k.b],B=T[k.c],n=this.checkIntersection(this,P,e,ci,M,C,B,Ci))){if(E&&E[L]){var U=E[L];xi.copy(U[0]),bi.copy(U[1]),Mi.copy(U[2]),n.uv=Tn.getUV(Ci,M,C,B,xi,bi,Mi,new tt)}n.face=k,n.faceIndex=L,t.push(n)}}}}else console.warn("Mesh: TriangleStripDrawMode and TriangleFanDrawMode are not supported by .raycast().")},clone:function(){var e=this.cloneMat(this.material),t=new this.constructor(this.geometry,e).copy(this);return this.material1&&(t.material=this.cloneMat(this.material1)),this.onBeforeRender1&&(t.onBeforeRender=this.onBeforeRender1),t},cloneMat:function(e){var t;if(Array.isArray(e)){t=[];for(var n=0;n<e.length;n++)t.push(e[n].clone())}else t=e.clone();return t},checkIntersection:function(e,t,n,i,r,a,o,s){if(null===(1===t.side?i.intersectTriangle(o,a,r,!0,s):i.intersectTriangle(r,a,o,2!==t.side,s)))return null;Bi.copy(s),Bi.applyMatrix4(e.matrixWorld);var l=n.ray.origin.distanceTo(Bi);return l<n.near||l>n.far?null:{distance:l,point:Bi.clone(),object:e}},checkBufferGeometryIntersection:function(e,t,n,i,r,a,o,s,l,A,c,h){this.getVertexByIndex(ui,r,A),this.getVertexByIndex(di,r,c),this.getVertexByIndex(fi,r,h);var u=e.morphTargetInfluences;if(t.morphTargets&&a&&u){gi.set(0,0,0),yi.set(0,0,0),wi.set(0,0,0);for(var d=0,f=a.length;d<f;d++){var p=u[d],m=a[d];0!==p&&(pi.fromBufferAttribute(m,A),mi.fromBufferAttribute(m,c),vi.fromBufferAttribute(m,h),o?(gi.addScaledVector(pi,p),yi.addScaledVector(mi,p),wi.addScaledVector(vi,p)):(gi.addScaledVector(pi.sub(ui),p),yi.addScaledVector(mi.sub(di),p),wi.addScaledVector(vi.sub(fi),p)))}ui.add(gi),di.add(yi),fi.add(wi)}var v=this.checkIntersection(e,t,n,i,ui,di,fi,Ci);if(v){s&&(xi.fromBufferAttribute(s,A),bi.fromBufferAttribute(s,c),Mi.fromBufferAttribute(s,h),v.uv=Tn.getUV(Ci,ui,di,fi,xi,bi,Mi,new tt)),l&&(xi.fromBufferAttribute(l,A),bi.fromBufferAttribute(l,c),Mi.fromBufferAttribute(l,h),v.uv2=Tn.getUV(Ci,ui,di,fi,xi,bi,Mi,new tt));var g=new Dn(A,c,h);Tn.getNormal(ui,di,fi,g.normal),v.face=g}return v},getVertexByIndex:function(e,t,n){e.fromBufferAttribute(t,n)}}),Ei.prototype.setVideoTexture=function(e){var t=this.viewer;e.addEventListener("play",(function(e){t.renderManager.renderEnabled=!0}));var n=new li(e);n.minFilter=Z,n.magFilter=Z,n.format=Ae,(Array.isArray(this.material)?this.material:[this.material]).forEach((function(e){e.albedo0||(e.albedo0=e.albedo),e.albedo=n,e.color.setStyle("#ffffff"),e.needsUpdate=!0}))},Ei.prototype.clearVideoTexture=function(){(Array.isArray(this.material)?this.material:[this.material]).forEach((function(e){void 0!==e.albedo0&&(e.albedo=e.albedo0),e.needsUpdate=!0}))};var Si=0,Ti=new bt,_i=new zt,Ii=new at;function Li(){Object.defineProperty(this,"id",{value:Si+=2}),this.uuid=et.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1,this._verticesNeedUpdate=!1}Object.defineProperties(Li.prototype,{verticesNeedUpdate:{get:function(){return this._verticesNeedUpdate},set:function(e){this._verticesNeedUpdate=e}}}),Li.prototype=Object.assign(Object.create(Je.prototype),{constructor:Li,isGeometry:!0,applyMatrix:function(e){for(var t=(new lt).getNormalMatrix(e),n=0,i=this.vertices.length;n<i;n++){this.vertices[n].applyMatrix4(e)}for(n=0,i=this.faces.length;n<i;n++){var r=this.faces[n];r.normal.applyMatrix3(t).normalize();for(var a=0,o=r.vertexNormals.length;a<o;a++)r.vertexNormals[a].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},applyMatrix4:function(e){return this.applyMatrix(e),this},rotateX:function(e){return Ti.makeRotationX(e),this.applyMatrix(Ti),this},rotateY:function(e){return Ti.makeRotationY(e),this.applyMatrix(Ti),this},rotateZ:function(e){return Ti.makeRotationZ(e),this.applyMatrix(Ti),this},translate:function(e,t,n){return Ti.makeTranslation(e,t,n),this.applyMatrix(Ti),this},scale:function(e,t,n){return Ti.makeScale(e,t,n),this.applyMatrix(Ti),this},lookAt:function(e){return _i.lookAt(e),_i.updateMatrix(),this.applyMatrix(_i.matrix),this},fromBufferGeometry:function(e){var t=this,n=null!==e.index?e.index.array:void 0,i=e.attributes;if(void 0===i.position)return console.error("Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;var r=i.position.array,a=void 0!==i.normal?i.normal.array:void 0,o=void 0!==i.color?i.color.array:void 0,s=void 0!==i.uv?i.uv.array:void 0,l=void 0!==i.uv2?i.uv2.array:void 0;void 0!==l&&(this.faceVertexUvs[1]=[]);for(var A=0;A<r.length;A+=3)t.vertices.push((new at).fromArray(r,A)),void 0!==o&&t.colors.push((new Fn).fromArray(o,A));function c(e,n,i,r){var A=void 0===o?[]:[t.colors[e].clone(),t.colors[n].clone(),t.colors[i].clone()],c=new Dn(e,n,i,void 0===a?[]:[(new at).fromArray(a,3*e),(new at).fromArray(a,3*n),(new at).fromArray(a,3*i)],A,r);t.faces.push(c),void 0!==s&&t.faceVertexUvs[0].push([(new tt).fromArray(s,2*e),(new tt).fromArray(s,2*n),(new tt).fromArray(s,2*i)]),void 0!==l&&t.faceVertexUvs[1].push([(new tt).fromArray(l,2*e),(new tt).fromArray(l,2*n),(new tt).fromArray(l,2*i)])}var h=e.groups;if(h.length>0)for(A=0;A<h.length;A++)for(var u=h[A],d=u.start,f=d,p=d+u.count;f<p;f+=3)void 0!==n?c(n[f],n[f+1],n[f+2],u.materialIndex):c(f,f+1,f+2,u.materialIndex);else if(void 0!==n)for(A=0;A<n.length;A+=3)c(n[A],n[A+1],n[A+2]);else for(A=0;A<r.length/3;A+=3)c(A,A+1,A+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Ii).negate(),this.translate(Ii.x,Ii.y,Ii.z),this},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,n=0===t?1:1/t,i=new bt;return i.set(n,0,0,-n*e.x,0,n,0,-n*e.y,0,0,n,-n*e.z,0,0,0,1),this.applyMatrix(i),this},computeFaceNormals:function(){for(var e=new at,t=new at,n=0,i=this.faces.length;n<i;n++){var r=this.faces[n],a=this.vertices[r.a],o=this.vertices[r.b],s=this.vertices[r.c];e.subVectors(s,o),t.subVectors(a,o),e.cross(t),e.normalize(),r.normal.copy(e)}},computeVertexNormals:function(e){var t,n,i,r,a,o;for(void 0===e&&(e=!0),o=new Array(this.vertices.length),t=0,n=this.vertices.length;t<n;t++)o[t]=new at;if(e){var s,l,A,c=new at,h=new at;for(i=0,r=this.faces.length;i<r;i++)a=this.faces[i],s=this.vertices[a.a],l=this.vertices[a.b],A=this.vertices[a.c],c.subVectors(A,l),h.subVectors(s,l),c.cross(h),o[a.a].add(c),o[a.b].add(c),o[a.c].add(c)}else for(this.computeFaceNormals(),i=0,r=this.faces.length;i<r;i++)o[(a=this.faces[i]).a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(t=0,n=this.vertices.length;t<n;t++)o[t].normalize();for(i=0,r=this.faces.length;i<r;i++){var u=(a=this.faces[i]).vertexNormals;3===u.length?(u[0].copy(o[a.a]),u[1].copy(o[a.b]),u[2].copy(o[a.c])):(u[0]=o[a.a].clone(),u[1]=o[a.b].clone(),u[2]=o[a.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,n;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){var i=(n=this.faces[e]).vertexNormals;3===i.length?(i[0].copy(n.normal),i[1].copy(n.normal),i[2].copy(n.normal)):(i[0]=n.normal.clone(),i[1]=n.normal.clone(),i[2]=n.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,n,i,r;for(n=0,i=this.faces.length;n<i;n++)for((r=this.faces[n]).__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),e=0,t=r.vertexNormals.length;e<t;e++)r.__originalVertexNormals[e]?r.__originalVertexNormals[e].copy(r.vertexNormals[e]):r.__originalVertexNormals[e]=r.vertexNormals[e].clone();var a=new Li;for(a.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var o=this.morphNormals[e].faceNormals,s=this.morphNormals[e].vertexNormals;for(n=0,i=this.faces.length;n<i;n++)l=new at,A={a:new at,b:new at,c:new at},o.push(l),s.push(A)}var l,A,c=this.morphNormals[e];for(a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals(),n=0,i=this.faces.length;n<i;n++)r=this.faces[n],l=c.faceNormals[n],A=c.vertexNormals[n],l.copy(r.normal),A.a.copy(r.vertexNormals[0]),A.b.copy(r.vertexNormals[1]),A.c.copy(r.vertexNormals[2])}for(n=0,i=this.faces.length;n<i;n++)(r=this.faces[n]).normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new tn),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new an),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(e&&e.isGeometry){var i,r=this.vertices.length,a=this.vertices,o=e.vertices,s=this.faces,l=e.faces,A=this.colors,c=e.colors;void 0===n&&(n=0),void 0!==t&&(i=(new lt).getNormalMatrix(t));for(var h=0,u=o.length;h<u;h++){var d=o[h].clone();void 0!==t&&d.applyMatrix4(t),a.push(d)}for(h=0,u=c.length;h<u;h++)A.push(c[h].clone());for(h=0,u=l.length;h<u;h++){var f,p,m,v=l[h],g=v.vertexNormals,y=v.vertexColors;(f=new Dn(v.a+r,v.b+r,v.c+r)).normal.copy(v.normal),void 0!==i&&f.normal.applyMatrix3(i).normalize();for(var w=0,x=g.length;w<x;w++)p=g[w].clone(),void 0!==i&&p.applyMatrix3(i).normalize(),f.vertexNormals.push(p);f.color.copy(v.color);for(w=0,x=y.length;w<x;w++)m=y[w],f.vertexColors.push(m.clone());f.materialIndex=v.materialIndex+n,s.push(f)}for(h=0,u=e.faceVertexUvs.length;h<u;h++){var b=e.faceVertexUvs[h];void 0===this.faceVertexUvs[h]&&(this.faceVertexUvs[h]=[]);for(w=0,x=b.length;w<x;w++){for(var M=b[w],C=[],B=0,E=M.length;B<E;B++)C.push(M[B].clone());this.faceVertexUvs[h].push(C)}}}else console.error("Geometry.merge(): geometry not an instance of Geometry.",e)},mergeMesh:function(e){e&&e.isMesh?(e.matrixAutoUpdate&&e.updateMatrix(),this.merge(e.geometry,e.matrix)):console.error("Geometry.mergeMesh(): mesh not an instance of Mesh.",e)},mergeVertices:function(){var e,t,n,i,r,a,o,s,l={},A=[],c=[],h=Math.pow(10,4);for(n=0,i=this.vertices.length;n<i;n++)e=this.vertices[n],void 0===l[t=Math.round(e.x*h)+"_"+Math.round(e.y*h)+"_"+Math.round(e.z*h)]?(l[t]=n,A.push(this.vertices[n]),c[n]=A.length-1):c[n]=c[l[t]];var u=[];for(n=0,i=this.faces.length;n<i;n++){(r=this.faces[n]).a=c[r.a],r.b=c[r.b],r.c=c[r.c],a=[r.a,r.b,r.c];for(var d=0;d<3;d++)if(a[d]===a[(d+1)%3]){u.push(n);break}}for(n=u.length-1;n>=0;n--){var f=u[n];for(this.faces.splice(f,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(f,1)}var p=this.vertices.length-A.length;return this.vertices=A,p},setFromPoints:function(e){this.vertices=[];for(var t=0,n=e.length;t<n;t++){var i=e[t];this.vertices.push(new at(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var e=this.faces,t=e.length,n=0;n<t;n++)e[n]._id=n;e.sort((function(e,t){return e.materialIndex-t.materialIndex}));var i,r,a=this.faceVertexUvs[0],o=this.faceVertexUvs[1];a&&a.length===t&&(i=[]),o&&o.length===t&&(r=[]);for(n=0;n<t;n++){var s=e[n]._id;i&&i.push(a[s]),r&&r.push(o[s])}i&&(this.faceVertexUvs[0]=i),r&&(this.faceVertexUvs[1]=r)},toJSON:function(){var e={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var n in t)void 0!==t[n]&&(e[n]=t[n]);return e}for(var i=[],r=0;r<this.vertices.length;r++){var a=this.vertices[r];i.push(a.x,a.y,a.z)}var o=[],s=[],l={},A=[],c={},h=[],u={};for(r=0;r<this.faces.length;r++){var d=this.faces[r],f=void 0!==this.faceVertexUvs[0][r],p=d.normal.length()>0,m=d.vertexNormals.length>0,v=1!==d.color.r||1!==d.color.g||1!==d.color.b,g=d.vertexColors.length>0,y=0;if(y=M(y,0,0),y=M(y,1,!0),y=M(y,2,!1),y=M(y,3,f),y=M(y,4,p),y=M(y,5,m),y=M(y,6,v),y=M(y,7,g),o.push(y),o.push(d.a,d.b,d.c),o.push(d.materialIndex),f){var w=this.faceVertexUvs[0][r];o.push(E(w[0]),E(w[1]),E(w[2]))}if(p&&o.push(C(d.normal)),m){var x=d.vertexNormals;o.push(C(x[0]),C(x[1]),C(x[2]))}if(v&&o.push(B(d.color)),g){var b=d.vertexColors;o.push(B(b[0]),B(b[1]),B(b[2]))}}function M(e,t,n){return n?e|1<<t:e&~(1<<t)}function C(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==l[t]||(l[t]=s.length/3,s.push(e.x,e.y,e.z)),l[t]}function B(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==c[t]||(c[t]=A.length,A.push(e.getHex())),c[t]}function E(e){var t=e.x.toString()+e.y.toString();return void 0!==u[t]||(u[t]=h.length/2,h.push(e.x,e.y)),u[t]}return e.data={},e.data.vertices=i,e.data.normals=s,A.length>0&&(e.data.colors=A),h.length>0&&(e.data.uvs=[h]),e.data.faces=o,e},clone:function(){return(new Li).copy(this)},copy:function(e){var t,n,i,r,a,o;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var s=e.vertices;for(t=0,n=s.length;t<n;t++)this.vertices.push(s[t].clone());var l=e.colors;for(t=0,n=l.length;t<n;t++)this.colors.push(l[t].clone());var A=e.faces;for(t=0,n=A.length;t<n;t++)this.faces.push(A[t].clone());for(t=0,n=e.faceVertexUvs.length;t<n;t++){var c=e.faceVertexUvs[t];for(void 0===this.faceVertexUvs[t]&&(this.faceVertexUvs[t]=[]),i=0,r=c.length;i<r;i++){var h=c[i],u=[];for(a=0,o=h.length;a<o;a++){var d=h[a];u.push(d.clone())}this.faceVertexUvs[t].push(u)}}var f=e.morphTargets;for(t=0,n=f.length;t<n;t++){var p={};if(p.name=f[t].name,void 0!==f[t].vertices)for(p.vertices=[],i=0,r=f[t].vertices.length;i<r;i++)p.vertices.push(f[t].vertices[i].clone());if(void 0!==f[t].normals)for(p.normals=[],i=0,r=f[t].normals.length;i<r;i++)p.normals.push(f[t].normals[i].clone());this.morphTargets.push(p)}var m=e.morphNormals;for(t=0,n=m.length;t<n;t++){var v={};if(void 0!==m[t].vertexNormals)for(v.vertexNormals=[],i=0,r=m[t].vertexNormals.length;i<r;i++){var g=m[t].vertexNormals[i],y={};y.a=g.a.clone(),y.b=g.b.clone(),y.c=g.c.clone(),v.vertexNormals.push(y)}if(void 0!==m[t].faceNormals)for(v.faceNormals=[],i=0,r=m[t].faceNormals.length;i<r;i++)v.faceNormals.push(m[t].faceNormals[i].clone());this.morphNormals.push(v)}var w=e.skinWeights;for(t=0,n=w.length;t<n;t++)this.skinWeights.push(w[t].clone());var x=e.skinIndices;for(t=0,n=x.length;t<n;t++)this.skinIndices.push(x[t].clone());var b=e.lineDistances;for(t=0,n=b.length;t<n;t++)this.lineDistances.push(b[t]);var M=e.boundingBox;null!==M&&(this.boundingBox=M.clone());var C=e.boundingSphere;return null!==C&&(this.boundingSphere=C.clone()),this.elementsNeedUpdate=e.elementsNeedUpdate,this.verticesNeedUpdate=e.verticesNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.lineDistancesNeedUpdate=e.lineDistancesNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Fi=function(e){h(n,e);var t=y(n);function n(e,i,r,a,o,l){var A;return s(this,n),(A=t.call(this)).type="BoxGeometry",A.parameters={width:e,height:i,depth:r,widthSegments:a,heightSegments:o,depthSegments:l},A.fromBufferGeometry(new ki(e,i,r,a,o,l)),A.mergeVertices(),A}return A(n)}(Li),ki=function(e){h(n,e);var t=y(n);function n(e,i,r,a,o,l){var A;s(this,n),(A=t.call(this)).type="BoxBufferGeometry",A.parameters={width:e,height:i,depth:r,widthSegments:a,heightSegments:o,depthSegments:l};var c=v(A);e=e||1,i=i||1,r=r||1,a=Math.floor(a)||1,o=Math.floor(o)||1,l=Math.floor(l)||1;var h=[],u=[],d=[],f=[],p=0,m=0;function g(e,t,n,i,r,a,o,s,l,A,v){var g,y,w=a/l,x=o/A,b=a/2,M=o/2,C=s/2,B=l+1,E=A+1,S=0,T=0,_=new at;for(y=0;y<E;y++){var I=y*x-M;for(g=0;g<B;g++){var L=g*w-b;_[e]=L*i,_[t]=I*r,_[n]=C,u.push(_.x,_.y,_.z),_[e]=0,_[t]=0,_[n]=s>0?1:-1,d.push(_.x,_.y,_.z),f.push(g/l),f.push(1-y/A),S+=1}}for(y=0;y<A;y++)for(g=0;g<l;g++){var F=p+g+B*y,k=p+g+B*(y+1),P=p+(g+1)+B*(y+1),U=p+(g+1)+B*y;h.push(F,k,U),h.push(k,P,U),T+=6}c.addGroup(m,T,v),m+=T,p+=S}return g("z","y","x",-1,-1,r,i,e,l,o,0),g("z","y","x",1,-1,r,i,-e,l,o,1),g("x","z","y",1,1,e,r,i,a,l,2),g("x","z","y",1,-1,e,r,-i,a,l,3),g("x","y","z",1,-1,e,i,r,a,o,4),g("x","y","z",-1,-1,e,i,-r,a,o,5),A.setIndex(h),A.setAttribute("position",new Yn(u,3)),A.setAttribute("normal",new Yn(d,3)),A.setAttribute("uv",new Yn(f,2)),A}return A(n)}(si);function Pi(e){var t={};for(var n in e)for(var i in t[n]={},e[n]){var r=e[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?t[n][i]=r.clone():Array.isArray(r)?t[n][i]=r.slice():t[n][i]=r}return t}function Ui(e){for(var t={},n=0;n<e.length;n++){var i=Pi(e[n]);for(var r in i)t[r]=i[r]}return t}var Di={clone:Pi,merge:Ui};function Ri(e){On.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="\nvoid main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",this.fragmentShader="\nvoid main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}\n",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==e&&(void 0!==e.attributes&&console.error("ShaderMaterial: attributes should now be defined in BufferGeometry instead."),this.setValues(e))}function Oi(){zt.call(this),this.type="Camera",this.matrixWorldInverse=new bt,this.matrixWorldInverseR=new bt,this.rotateMatrix=(new bt).makeRotationFromEuler(new Bt(0,1.570863267948966,0)),this.projectionMatrix=new bt,this.projectionMatrixInverse=new bt}function Ni(e,t,n,i){Oi.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==i?i:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}Ri.prototype=Object.create(On.prototype),Ri.prototype.constructor=Ri,Ri.prototype.isShaderMaterial=!0,Ri.prototype.copy=function(e){return On.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Pi(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},Ri.prototype.toJSON=function(e){var t=On.prototype.toJSON.call(this,e);for(var n in t.uniforms={},this.uniforms){var i=this.uniforms[n].value;i&&i.isTexture?t.uniforms[n]={type:"t",value:i.toJSON(e).uuid}:i&&i.isColor?t.uniforms[n]={type:"c",value:i.getHex()}:i&&i.isVector2?t.uniforms[n]={type:"v2",value:i.toArray()}:i&&i.isVector3?t.uniforms[n]={type:"v3",value:i.toArray()}:i&&i.isVector4?t.uniforms[n]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?t.uniforms[n]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?t.uniforms[n]={type:"m4",value:i.toArray()}:t.uniforms[n]={value:i}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;var r={};for(var a in this.extensions)!0===this.extensions[a]&&(r[a]=!0);return Object.keys(r).length>0&&(t.extensions=r),t},Oi.prototype=Object.assign(Object.create(zt.prototype),{constructor:Oi,isCamera:!0,copy:function(e,t){return zt.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("Camera: .getWorldDirection() target is now required"),e=new at),this.updateMatrixWorld(!0);var t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){zt.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverseR.getInverse(this.matrixWorld.clone().multiply(this.rotateMatrix)),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Ni.prototype=Object.assign(Object.create(Oi.prototype),{constructor:Ni,isPerspectiveCamera:!0,copy:function(e,t){return Oi.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*et.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*et.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*et.RAD2DEG*Math.atan(Math.tan(.5*et.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(e,t,n,i,r,a){this.aspect=e/t,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=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*et.DEG2RAD*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i,a=this.view;if(null!==this.view&&this.view.enabled){var o=a.fullWidth,s=a.fullHeight;r+=a.offsetX*i/o,t-=a.offsetY*n/s,i*=a.width/o,n*=a.height/s}var l=this.filmOffset;0!==l&&(r+=e*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=zt.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});var zi=90;function Qi(e,t,n,i){zt.call(this),this.type="CubeCamera";var r=new Ni(zi,1,e,t);r.up.set(0,-1,0),r.lookAt(new at(1,0,0)),this.add(r);var a=new Ni(zi,1,e,t);a.up.set(0,-1,0),a.lookAt(new at(-1,0,0)),this.add(a);var o=new Ni(zi,1,e,t);o.up.set(0,0,1),o.lookAt(new at(0,1,0)),this.add(o);var s=new Ni(zi,1,e,t);s.up.set(0,0,-1),s.lookAt(new at(0,-1,0)),this.add(s);var l=new Ni(zi,1,e,t);l.up.set(0,-1,0),l.lookAt(new at(0,0,1)),this.add(l);var A=new Ni(zi,1,e,t);A.up.set(0,-1,0),A.lookAt(new at(0,0,-1)),this.add(A),i=i||{format:Ae,magFilter:Z,minFilter:Z},this.renderTarget=new Gi(n,n,i),this.renderTarget.texture.name="CubeCamera",this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var n=e.getRenderTarget(),i=this.renderTarget,c=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0),e.render(t,r),e.setRenderTarget(i,1),e.render(t,a),e.setRenderTarget(i,2),e.render(t,o),e.setRenderTarget(i,3),e.render(t,s),e.setRenderTarget(i,4),e.render(t,l),i.texture.generateMipmaps=c,e.setRenderTarget(i,5),e.render(t,A),e.setRenderTarget(n)},this.clear=function(e,t,n,i){for(var r=e.getRenderTarget(),a=this.renderTarget,o=0;o<6;o++)e.setRenderTarget(a,o),e.clear(t,n,i);e.setRenderTarget(r)}}function Gi(e,t,n){dt.call(this,e,t,n)}function Hi(e,t,n,i,r,a,o,s,l,A,c,h){ht.call(this,null,a,o,s,l,A,i,r,c,h),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==l?l:X,this.minFilter=void 0!==A?A:X,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}Qi.prototype=Object.create(zt.prototype),Qi.prototype.constructor=Qi,Gi.prototype=Object.create(dt.prototype),Gi.prototype.constructor=Gi,Gi.prototype.isWebGLRenderTargetCube=!0,Gi.prototype.fromEquirectangularTexture=function(e,t){this.texture.type=t.type,this.texture.format=t.format,this.texture.encoding=t.encoding;var n=new Qt,i={uniforms:{tEquirect:{value:null}},vertexShader:["varying vec3 vWorldDirection;","vec3 transformDirection( in vec3 dir, in mat4 matrix ) {","\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );","}","void main() {","\tvWorldDirection = transformDirection( position, modelMatrix );","\t#include <begin_vertex>","\t#include <project_vertex>","}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","varying vec3 vWorldDirection;","#define RECIPROCAL_PI 0.31830988618","#define RECIPROCAL_PI2 0.15915494","void main() {","\tvec3 direction = normalize( vWorldDirection );","\tvec2 sampleUV;","\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;","\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","\tgl_FragColor = texture2D( tEquirect, sampleUV );","}"].join("\n")},r=new Ri({type:"CubemapFromEquirect",uniforms:Pi(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=t;var a=new Ei(new ki(5,5,5),r);n.add(a);var o=new Qi(1,10,1);return o.renderTarget=this,o.renderTarget.texture.name="CubeCameraTexture",o.update(e,n),a.geometry.dispose(),a.material.dispose(),this},Hi.prototype=Object.create(ht.prototype),Hi.prototype.constructor=Hi,Hi.prototype.isDataTexture=!0;var Vi=new an,ji=new at;function Wi(e,t,n,i,r,a){this.planes=[void 0!==e?e:new vn,void 0!==t?t:new vn,void 0!==n?n:new vn,void 0!==i?i:new vn,void 0!==r?r:new vn,void 0!==a?a:new vn]}Object.assign(Wi.prototype,{set:function(e,t,n,i,r,a){var o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(i),o[4].copy(r),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this},setFromMatrix:function(e){var t=this.planes,n=e.elements,i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],l=n[5],A=n[6],c=n[7],h=n[8],u=n[9],d=n[10],f=n[11],p=n[12],m=n[13],v=n[14],g=n[15];return t[0].setComponents(o-i,c-s,f-h,g-p).normalize(),t[1].setComponents(o+i,c+s,f+h,g+p).normalize(),t[2].setComponents(o+r,c+l,f+u,g+m).normalize(),t[3].setComponents(o-r,c-l,f-u,g-m).normalize(),t[4].setComponents(o-a,c-A,f-d,g-v).normalize(),t[5].setComponents(o+a,c+A,f+d,g+v).normalize(),this},intersectsObject:function(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),Vi.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(Vi)},intersectsSprite:function(e){return Vi.center.set(0,0,0),Vi.radius=.7071067811865476,Vi.applyMatrix4(e.matrixWorld),this.intersectsSphere(Vi)},intersectsSphere:function(e){for(var t=this.planes,n=e.center,i=-e.radius,r=0;r<6;r++){if(t[r].distanceToPoint(n)<i)return!1}return!0},intersectsBox:function(e){for(var t=this.planes,n=0;n<6;n++){var i=t[n];if(ji.x=i.normal.x>0?e.max.x:e.min.x,ji.y=i.normal.y>0?e.max.y:e.min.y,ji.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(ji)<0)return!1}return!0},containsPoint:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0},toArray:function(){for(var e=[],t=0;t<6;t++){var n=this.planes[t].normal.toArray();e.push.apply(e,n),n=null,e.push(this.planes[t].constant)}return e},setFromProjectionMatrix:function(e){var t=this.planes,n=e.elements,i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],l=n[5],A=n[6],c=n[7],h=n[8],u=n[9],d=n[10],f=n[11],p=n[12],m=n[13],v=n[14],g=n[15];return t[0].setComponents(o-i,c-s,f-h,g-p).normalize(),t[1].setComponents(o+i,c+s,f+h,g+p).normalize(),t[2].setComponents(o+r,c+l,f+u,g+m).normalize(),t[3].setComponents(o-r,c-l,f-u,g-m).normalize(),t[4].setComponents(o-a,c-A,f-d,g-v).normalize(),t[5].setComponents(o+a,c+A,f+d,g+v).normalize(),this}});var Xi={alphamap_fragment:"\n#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n",alphamap_pars_fragment:"\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",alphatest_fragment:"\n#ifdef ALPHATEST\n\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n\n#endif\n",aomap_fragment:"\n#ifdef USE_AOMAP\n\n\t// reads channel R, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\n\t#endif\n\n#endif\n",aomap_pars_fragment:"\n#ifdef USE_AOMAP\n\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n\n#endif\n",begin_vertex:"\nvec3 transformed = vec3( position );\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n\n#ifdef USE_TANGENT\n\n\tvec3 objectTangent = vec3( tangent.xyz );\n\n#endif\n",bsdfs:'\n\n// Analytical approximation of the DFG LUT, one half of the\n// split-sum approximation used in indirect specular lighting.\n// via \'environmentBRDF\' from "Physically Based Shading on Mobile"\n// https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\nvec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\n\tvec4 r = roughness * c0 + c1;\n\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n\n}\n\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\n\t// based upon Frostbite 3 Moving to Physically-based Rendering\n\t// page 32, equation 26: E[window1]\n\t// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\n\t// this is intended to be used on spot and point lights who are represented as luminous intensity\n\t// but who must be converted to luminous irradiance for surface lighting calculation\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\n\tif( cutoffDistance > 0.0 ) {\n\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\n\t}\n\n\treturn distanceFalloff;\n\n#else\n\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\n\t}\n\n\treturn 1.0;\n\n#endif\n\n}\n\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\n\treturn RECIPROCAL_PI * diffuseColor;\n\n} // validated\n\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\n\t// Original approximation by Christophe Schlick \'94\n\t// float fresnel = pow( 1.0 - dotLH, 5.0 );\n\n\t// Optimized variant (presented by Epic at SIGGRAPH \'13)\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n\n} // validated\n\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\n\t// See F_Schlick\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\n\treturn Fr * fresnel + F0;\n\n}\n\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (34)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is "roughness squared" in Disney’s reparameterization\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\n\t// geometry term (normalized) = G(l)⋅G(v) / 4(n⋅l)(n⋅v)\n\t// also see #12151\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\n\treturn 1.0 / ( gl * gv );\n\n} // validated\n\n// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2\n// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\n\tfloat a2 = pow2( alpha );\n\n\t// dotNL and dotNV are explicitly swapped. This is not a mistake.\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\n\treturn 0.5 / max( gv + gl, EPSILON );\n\n}\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (33)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is "roughness squared" in Disney’s reparameterization\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1\n\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n\n}\n\n// GGX Distribution, Schlick Fresnel, GGX-Smith Visibility\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\n\tfloat alpha = pow2( roughness ); // UE4\'s roughness\n\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\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\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\n\tfloat D = D_GGX( alpha, dotNH );\n\n\treturn F * ( G * D );\n\n} // validated\n\n// Rect Area Light\n\n// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines\n// by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt\n// code: https://github.com/selfshadow/ltc_code/\n\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\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\n\tfloat dotNV = saturate( dot( N, V ) );\n\n\t// texture parameterized by sqrt( GGX alpha ) and sqrt( 1 - cos( theta ) )\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\treturn uv;\n\n}\n\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\n\t// Real-Time Area Lighting: a Journey from Research to Production (p.102)\n\t// An approximation of the form factor of a horizon-clipped rectangle.\n\n\tfloat l = length( f );\n\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n\n}\n\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\n\tfloat x = dot( v1, v2 );\n\n\tfloat y = abs( x );\n\n\t// rational polynomial approximation to theta / sin( theta ) / 2PI\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\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\n\treturn cross( v1, v2 ) * theta_sintheta;\n\n}\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\n\t// bail if point is on back side of plane of light\n\t// assumes ccw winding order of light vertices\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\n\t// construct orthonormal basis around N\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system\n\n\t// compute transform\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\n\t// transform rect\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\n\t// project rect onto sphere\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\n\t// calculate vector form factor\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\n\t// adjust for horizon clipping\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\n/*\n\t// alternate method of adjusting for horizon clipping (see referece)\n\t// refactoring required\n\tfloat len = length( vectorFormFactor );\n\tfloat z = vectorFormFactor.z / len;\n\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\n\t// tabulated horizon-clipped sphere, apparently...\n\tvec2 uv = vec2( z * 0.5 + 0.5, len );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\tfloat scale = texture2D( ltc_2, uv ).w;\n\n\tfloat result = len * scale;\n*/\n\n\treturn vec3( result );\n\n}\n\n// End Rect Area Light\n\n// ref: https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\n\treturn specularColor * brdf.x + brdf.y;\n\n} // validated\n\n// Fdez-Agüera\'s "Multiple-Scattering Microfacet Model for Real-Time Image Based Lighting"\n// Approximates multiscattering in order to preserve energy.\n// http://www.jcgt.org/published/0008/01/03/\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; // 1/21\n\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n\n}\n\nfloat G_BlinnPhong_Implicit( /* const in float dotNL, const in float dotNV */ ) {\n\n\t// geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v)\n\treturn 0.25;\n\n}\n\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n\n}\n\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\n\t//float dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\t//float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\n\tfloat G = G_BlinnPhong_Implicit( /* dotNL, dotNV */ );\n\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\n\treturn F * ( G * D );\n\n} // validated\n\n// source: http://simonstechblog.blogspot.ca/2011/12/microfacet-brdf.html\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\n\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n\n#if defined( USE_SHEEN )\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs#L94\nfloat D_Charlie(float roughness, float NoH) {\n\t// Estevez and Kulla 2017, "Production Friendly Microfacet Sheen BRDF"\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125); // 2^(-14/2), so sin2h^2 > 0 in fp16\n\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs#L136\nfloat V_Neubelt(float NoV, float NoL) {\n\t// Neubelt and Pettineo 2013, "Crafting a Next-gen Material Pipeline for The Order: 1886"\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\n\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n\n}\n\n#endif\n',bumpmap_pars_fragment:"\n#ifdef USE_BUMPMAP\n\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\n\t// Bump Mapping Unparametrized Surfaces on the GPU by Morten S. Mikkelsen\n\t// http://api.unrealengine.com/attachments/Engine/Rendering/LightingAndShadows/BumpMappingWithoutTangentSpace/mm_sfgrad_bump.pdf\n\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n\tvec2 dHdxy_fwd() {\n\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\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\n\t\treturn vec2( dBx, dBy );\n\n\t}\n\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\n\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;\t\t// normalized\n\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\n\t}\n\n#endif\n",clipping_planes_fragment:"\nfloat clipping_opacity = 1.0;\n#if NUM_CLIPPING_PLANES > 0\n\n\tvec4 plane;\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w && clippingTransparent ) clipping_opacity= 0.3;\n if ( dot( vViewPosition, plane.xyz ) > plane.w && !clippingTransparent ) discard;\n\t\t\n\t}\n\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\n\t\tbool clipped = true;\n\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t\n\n\t\t}\n\n\t\tif ( clipped ){\n\t\t if(clippingTransparent)\n\t\t clipping_opacity= 0.3;\n\t\t else\n\t\t discard;\n\t\t}\n\n\t#endif\n\n#endif\n",clipping_planes_pars_fragment:"\n#if NUM_CLIPPING_PLANES > 0\n\n\t#if ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n\n#endif\n",clipping_planes_pars_vertex:"\n#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif\n",clipping_planes_vertex:"\n#if NUM_CLIPPING_PLANES > 0 && ! defined( STANDARD ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n",color_fragment:"\n#ifdef USE_COLOR\n\n\tdiffuseColor.rgb *= vColor;\n\n#endif\n",color_pars_fragment:"\n#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif\n",color_pars_vertex:"\n#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif\n",color_vertex:"\n#ifdef USE_COLOR\n\n\tvColor.xyz = color.xyz;\n\n#endif\n",common:"\n#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n\n#ifndef saturate\n// <tonemapping_pars_fragment> may have defined saturate() already\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\n\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 ) ); }\n// expects values in the range of [0,1]x[0,1], returns values in the [0,1] range.\n// do not collapse into a single function per: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\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\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\n\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\n\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\n\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n}\n\n// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n\n}\n\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\n\treturn - distance * planeNormal + point;\n\n}\n\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n\n}\n\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n\n}\n\nmat3 transposeMat3( const in mat3 m ) {\n\n\tmat3 tmp;\n\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\n\treturn tmp;\n\n}\n\n// https://en.wikipedia.org/wiki/Relative_luminance\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\n\treturn dot( weights, color.rgb );\n\n}\n\n \nbool isPerspectiveMatrix( mat4 m ) {\n\n return m[ 2 ][ 3 ] == - 1.0;\n\n}\n",cube_uv_reflection_fragment:"\n#ifdef ENVMAP_TYPE_CUBE_UV\n\n#define cubeUV_textureSize (1024.0)\n\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\n\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\t// Clamp the value to the max mip level counts. hard coded to 6 mips\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\n\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\t// float powScale = exp2(roughnessLevel + mipLevel);\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\t// float scale = 1.0 / exp2(roughnessLevel + 2.0 + mipLevel);\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\t// float mipOffset = 0.75*(1.0 - 1.0/exp2(mipLevel))/exp2(roughnessLevel);\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\n\tfloat rcpPowScale = 1.0 / powScale;\n\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\n\nvec4 textureCubeUV( sampler2D envMap, vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\n\t// round to nearest mipmap if we are not interpolating.\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\n\t// Tri linear interpolation.\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\n\tvec4 result = mix(color10, color20, t);\n\n\treturn vec4(result.rgb, 1.0);\n}\n\nvec4 textureCubeUVSample( sampler2D envMap, vec3 reflectedDirection) {\n\n\tvec2 uv_10 = getCubeUV(reflectedDirection, 0.0, 0.0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\n\treturn color10;\n}\n\n#endif\n",defaultnormal_vertex:"\nvec3 transformedNormal = objectNormal;\n\n#ifdef USE_INSTANCING\n\n\ttransformedNormal = mat3( instanceMatrix ) * transformedNormal;\n\n#endif\n\ntransformedNormal = normalMatrix * transformedNormal;\n\n#ifdef FLIP_SIDED\n\n\ttransformedNormal = - transformedNormal;\n\n#endif\n\n#ifdef USE_TANGENT\n\n\tvec3 transformedTangent = normalMatrix * objectTangent;\n\n\t#ifdef FLIP_SIDED\n\n\t\ttransformedTangent = - transformedTangent;\n\n\t#endif\n\n#endif\n",displacementmap_pars_vertex:"\n#ifdef USE_DISPLACEMENTMAP\n\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n\n#endif\n",displacementmap_vertex:"\n#ifdef USE_DISPLACEMENTMAP\n\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n\n#endif\n",emissivemap_fragment:"\n#ifdef USE_EMISSIVEMAP\n\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n\n#endif\n",emissivemap_pars_fragment:"\n#ifdef USE_EMISSIVEMAP\n\n\tuniform sampler2D emissiveMap;\n\n#endif\n",encodings_fragment:"\ngl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\n// For a discussion of what this is, please read this: http://lousodrome.net/blog/light/2013/05/26/gamma-correct-and-hdr-rendering-in-a-32-bits-buffer/\n\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\n\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\n\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\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}\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}\n\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\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// return vec4( value.brg, ( 3.0 + 128.0 ) / 256.0 );\n}\n\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\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}\n\n// reference: http://iwasbeingirony.blogspot.ca/2010/06/difference-between-rgbm-and-rgbd.html\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\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 = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\n\n// LogLuv reference: http://graphicrants.blogspot.ca/2009/04/rgbm-color-encoding.html\n\n// M matrix, for encoding\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}\n\n// Inverse M matrix, for decoding\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}\n",envmap_fragment:"\n#ifdef USE_ENVMAP\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\n\t\t} else {\n\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\n\t\t}\n\n\t\t// Transforming Normal Vectors with the Inverse Transformation\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\n\t\t#else\n\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#else\n\n\t\tvec3 reflectVec = vReflect;\n\n\t#endif\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\n\t\tvec2 sampleUV;\n\n\t\treflectVec = normalize( reflectVec );\n\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\n\t\treflectVec = normalize( reflectVec );\n\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\n\t#else\n\n\t\tvec4 envColor = vec4( 0.0 );\n\n\t#endif\n\n\tenvColor = envMapTexelToLinear( envColor );\n\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n\t#endif\n\n#endif\n",envmap_common_pars_fragment:"\n#ifdef USE_ENVMAP\n\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\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\n",envmap_pars_fragment:"\n#ifdef USE_ENVMAP\n\n\tuniform float reflectivity;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\t#define ENV_WORLDPOS\n\n\t#endif\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n\n#endif\n",envmap_pars_vertex:"\n#ifdef USE_ENVMAP\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\n\t\t#define ENV_WORLDPOS\n\n\t#endif\n\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\n\t#else\n\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\n\t#endif\n\n#endif\n",envmap_physical_pars_fragment:"\n#if defined( USE_ENVMAP )\n\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\n\tvec3 getLightProbeIndirectIrradiance( /*const in SpecularLightProbe specularLightProbe,*/ const in GeometricContext geometry, const in int maxMIPLevel ) {\n\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\n\t\t\t// TODO: replace with properly filtered cubemaps and access the irradiance LOD level, be it the last LOD level\n\t\t\t// of a specular cubemap, or just the default level of a specially created irradiance cubemap.\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\n\t\t\t#else\n\n\t\t\t\t// force the bias high to get the last LOD level as it is the most blurred.\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryVec, 1.0 );\n\n\t\t#else\n\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\n\t\t#endif\n \n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\n\t}\n\n\t// Trowbridge-Reitz distribution to Mip level, following the logic of http://casual-effects.blogspot.ca/2011/08/plausible-environment-lighting-in-two.html\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\n\t\t// clamp to allowable LOD ranges.\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\n\t}\n\n\tvec3 getLightProbeIndirectRadiance( /*const in SpecularLightProbe specularLightProbe,*/ const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\n\t\t // Mixing the reflection with the normal is more accurate and keeps rough objects from gathering light from behind their tangent plane.\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\n\t\t#else\n\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\n\t\t#endif\n\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\n\t\t\t#else\n\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryReflectVec, roughness );\n\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\n\t\t\t#else\n\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\n\t\t\t#else\n\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\n\t}\n\n#endif\n",envmap_vertex:"\n#ifdef USE_ENVMAP\n\n\t#ifdef ENV_WORLDPOS\n\n\t\tvWorldPosition = worldPosition.xyz;\n\n\t#else\n\n\t\tvec3 cameraToVertex;\n\n\t\tif ( isOrthographic ) { \n\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\n\t\t} else {\n\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\t\t}\n\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t\t#else\n\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#endif\n\n#endif\n",fog_vertex:"\n#ifdef USE_FOG\n\n\tfogDepth = -mvPosition.z;\n\n#endif\n",fog_pars_vertex:"\n#ifdef USE_FOG\n\n\tvarying float fogDepth;\n\n#endif\n",fog_fragment:"\n#ifdef USE_FOG\n\n\t#ifdef FOG_EXP2\n\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\n\t#else\n\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\n\t#endif\n\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n\n#endif\n",fog_pars_fragment:"\n#ifdef USE_FOG\n\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\n\t#ifdef FOG_EXP2\n\n\t\tuniform float fogDensity;\n\n\t#else\n\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\n\t#endif\n\n#endif\n",gradientmap_pars_fragment:"\n#ifdef TOON\n\n\tuniform sampler2D gradientMap;\n\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\n\t\t// dotNL will be from -1.0 to 1.0\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\n\t\t#ifdef USE_GRADIENTMAP\n\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\n\t\t#else\n\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\n\t\t#endif\n\n\n\t}\n\n#endif\n",lightmap_fragment:"\n#ifdef USE_LIGHTMAP\n\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity; // factor of PI should not be present; included here to prevent breakage\n\n#endif\n",lightmap_pars_fragment:"\n#ifdef USE_LIGHTMAP\n\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n\n#endif\n",lights_lambert_vertex:"\nvec3 diffuse = vec3( 1.0 );\n\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\n\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\n\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\n\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n\n#if NUM_POINT_LIGHTS > 0\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\n\t}\n\n#endif\n\n#if NUM_SPOT_LIGHTS > 0\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\t}\n\n#endif\n\n/*\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\t// TODO (abelnation): implement\n\n\t}\n\n#endif\n*/\n\n#if NUM_DIR_LIGHTS > 0\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\n\t\t#endif\n\n\t}\n\n#endif\n\n#if NUM_HEMI_LIGHTS > 0\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\n\t\t#endif\n\n\t}\n\n#endif\n",lights_pars_begin:"\nuniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\n\n// get the irradiance (radiance convolved with cosine lobe) at the point 'normal' on the unit sphere\n// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\n\t// normal is assumed to have unit length\n\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\n\t// band 0\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\n\t// band 1\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\n\t// band 2\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\n\treturn result;\n\n}\n\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\n\treturn irradiance;\n\n}\n\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\n\tvec3 irradiance = ambientLightColor;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI;\n\n\t#endif\n\n\treturn irradiance;\n\n}\n\n#if NUM_DIR_LIGHTS > 0\n\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\n\t}\n\n#endif\n\n\n#if NUM_POINT_LIGHTS > 0\n\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\n\t\tfloat lightDistance = length( lVector );\n\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\n\t}\n\n#endif\n\n\n#if NUM_SPOT_LIGHTS > 0\n\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\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\n\t// directLight is an out parameter as having it as a return value caused compiler errors on some devices\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\n\t\tif ( angleCos > spotLight.coneCos ) {\n\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\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\n\t\t} else {\n\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\n\t\t}\n\t}\n\n#endif\n\n\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\n\t// Pre-computed values of LinearTransformedCosine approximation of BRDF\n\t// BRDF approximation Texture is 64x64\n\tuniform sampler2D ltc_1; // RGBA Float\n\tuniform sampler2D ltc_2; // RGBA Float\n\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n\n#endif\n\n\n#if NUM_HEMI_LIGHTS > 0\n\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tirradiance *= PI;\n\n\t\t#endif\n\n\t\treturn irradiance;\n\n\t}\n\n#endif\n",lights_phong_fragment:"\nBlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n\nstruct BlinnPhongMaterial {\n\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n\n};\n\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\n\t#ifdef TOON\n\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\n\t#else\n\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\n\t#endif\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI; // punctual light\n\n\t#endif\n\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n\n}\n\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n}\n\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n\n#define Material_LightProbeLOD( material )\t(0)\n",lights_physical_fragment:"\nPhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n\n#ifdef REFLECTIVITY\n\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\n#else\n\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n\n#endif\n\n#ifdef CLEARCOAT\n\n\tmaterial.clearcoat = saturate( clearcoat ); // Burley clearcoat model\n\tmaterial.clearcoatRoughness = clamp( clearcoatRoughness, 0.04, 1.0 );\n\n#endif\n#ifdef USE_SHEEN\n\n\tmaterial.sheenColor = sheen;\n\n#endif\n",lights_physical_pars_fragment:"\nstruct PhysicalMaterial {\n\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n\n};\n\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\n\n// Clear coat directional hemishperical reflectance (this approximation should be improved)\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n\n}\n\n#if NUM_RECT_AREA_LIGHTS > 0\n\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\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\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight; // counterclockwise; light shines in local neg z direction\n\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\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\n\t\t// LTC Fresnel Approximation by Stephen Hill\n\t\t// http://blog.selfshadow.com/publications/s2016-advances/s2016_ltc_fresnel.pdf\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\n\t}\n\n#endif\n\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\n\tvec3 irradiance = dotNL * directLight.color;\n\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\tirradiance *= PI; // punctual light\n\n\t#endif\n\n\t#ifdef CLEARCOAT\n\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tccIrradiance *= PI; // punctual light\n\n\t\t#endif\n\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\n\t#else\n\n\t\tfloat clearcoatDHR = 0.0;\n\n\t#endif\n\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\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\n}\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\n\t#ifdef CLEARCOAT\n\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\n\t#else\n\n\t\tfloat clearcoatDHR = 0.0;\n\n\t#endif\n\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\n\t// Both indirect specular and indirect diffuse light accumulate here\n\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n\n}\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\n\n// ref: https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n\n}\n",lights_fragment_begin:"\n/**\n * This is a template that can be used to light a material, it uses pluggable\n * RenderEquations (RE)for specific lighting scenarios.\n *\n * Instructions for use:\n * - Ensure that both RE_Direct, RE_IndirectDiffuse and RE_IndirectSpecular are defined\n * - If you have defined an RE_IndirectSpecular, you need to also provide a Material_LightProbeLOD. <---- ???\n * - Create a material parameter that is to be passed as the third parameter to your lighting functions.\n *\n * TODO:\n * - Add area light support.\n * - Add sphere light support.\n * - Add diffuse light probe (irradiance cubemap) support.\n */\n\nGeometricContext geometry;\n\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n\n#ifdef CLEARCOAT\n\n\tgeometry.clearcoatNormal = clearcoatNormal;\n\n#endif\n\nIncidentLight directLight;\n\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tPointLight pointLight;\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tpointLight = pointLights[ i ];\n\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( pointLight.shadow, directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\n#endif\n\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tSpotLight spotLight;\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tspotLight = spotLights[ i ];\n\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( spotLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\n#endif\n\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tDirectionalLight directionalLight;\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( directionalLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\n#endif\n\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\n\tRectAreaLight rectAreaLight;\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\n\t}\n\n#endif\n\n#if defined( RE_IndirectDiffuse )\n\n\tvec3 iblIrradiance = vec3( 0.0 );\n\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\n\t\t}\n\n\t#endif\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n\n#endif\n",lights_fragment_maps:"\n#if defined( RE_IndirectDiffuse )\n\n\t#ifdef USE_LIGHTMAP\n\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tlightMapIrradiance *= PI; // factor of PI should not be present; included here to prevent breakage\n\n\t\t#endif\n\n\t\tirradiance += lightMapIrradiance;\n\n\t#endif\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( /*lightProbe,*/ geometry, maxMipLevel );\n\n\t#endif\n\n#endif\n\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\n\tradiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\n\t#ifdef CLEARCOAT\n\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\n\t#endif\n\n#endif\n",lights_fragment_end:"\n#if defined( RE_IndirectDiffuse )\n\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n \n#endif\n",logdepthbuf_fragment:"\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\t// Doing a strict comparison with == 1.0 can cause noise artifacts\n\t// on some platforms. See issue #17623.\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n\n#endif\n",logdepthbuf_pars_fragment:"\n#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n\n#endif\n",logdepthbuf_pars_vertex:"\n#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\n\t#else\n\n\t\tuniform float logDepthBufFC;\n\n\t#endif\n\n#endif\n",logdepthbuf_vertex:"\n#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\n\t#else\n\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\n\t\t\tgl_Position.z *= gl_Position.w;\n\n\t\t}\n\n\t#endif\n\n#endif\n",map_fragment:"\n#ifdef USE_MAP\n\n\tvec4 texelColor = texture2D( map, vUv );\n\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n\n#endif\n",map_pars_fragment:"\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif\n",map_particle_fragment:"\n#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\n#endif\n\n#ifdef USE_MAP\n\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n\n#endif\n",map_particle_pars_fragment:"\n#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\n\tuniform mat3 uvTransform;\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",metalnessmap_fragment:"\nfloat metalnessFactor = metalness;\n\n#ifdef USE_METALNESSMAP\n\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\n\t// reads channel B, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\tmetalnessFactor *= texelMetalness.b;\n\n#endif\n",metalnessmap_pars_fragment:"\n#ifdef USE_METALNESSMAP\n\n\tuniform sampler2D metalnessMap;\n\n#endif\n",morphnormal_vertex:"\n#ifdef USE_MORPHNORMALS\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in normal = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\n#endif\n",morphtarget_pars_vertex:"\n#ifdef USE_MORPHTARGETS\n\n\tuniform float morphTargetBaseInfluence;\n\n\t#ifndef USE_MORPHNORMALS\n\n\tuniform float morphTargetInfluences[ 8 ];\n\n\t#else\n\n\tuniform float morphTargetInfluences[ 4 ];\n\n\t#endif\n\n#endif\n",morphtarget_vertex:"\n#ifdef USE_MORPHTARGETS\n\n\t// morphTargetBaseInfluence is set based on BufferGeometry.morphTargetsRelative value:\n\t// When morphTargetsRelative is false, this is set to 1 - sum(influences); this results in position = sum((target - base) * influence)\n\t// When morphTargetsRelative is true, this is set to 1; as a result, all morph targets are simply added to the base after weighting\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\n\t#ifndef USE_MORPHNORMALS\n\n\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\n\t#endif\n\n#endif\n",normal_fragment_begin:"\n#ifdef FLAT_SHADED\n\n\t// Workaround for Adreno/Nexus5 not able able to do dFdx( vViewPosition ) ...\n\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\n#else\n\n\tvec3 normal = normalize( vNormal );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t#endif\n\n\t#ifdef USE_TANGENT\n\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\n\t\t#ifdef DOUBLE_SIDED\n\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\n\t\t#endif\n\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\n\t\t#endif\n\n\t#endif\n\n#endif\n\n// non perturbed normal for clearcoat among others\n\nvec3 geometryNormal = normal;\n\n",normal_fragment_maps:"\n\n#ifdef OBJECTSPACE_NORMALMAP\n\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; // overrides both flatShading and attribute normals\n\n\t#ifdef FLIP_SIDED\n\n\t\tnormal = - normal;\n\n\t#endif\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t#endif\n\n\tnormal = normalize( normalMatrix * normal );\n\n#elif defined( TANGENTSPACE_NORMALMAP )\n\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\n\t#ifdef USE_TANGENT\n\n\t\tnormal = normalize( vTBN * mapN );\n\n\t#else\n\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\n\t#endif\n\n#elif defined( USE_BUMPMAP )\n\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n",normalmap_pars_fragment:"\n#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\n#endif\n\n#ifdef OBJECTSPACE_NORMALMAP\n\n\tuniform mat3 normalMatrix;\n\n#endif\n\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\n\t// Per-Pixel Tangent Space Normal Mapping\n\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\n\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\n\t\t// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988\n\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\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s ); // we do not care about the magnitude\n\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\n\t\tmat3 tsn = mat3( S, T, N );\n\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n\t\treturn normalize( tsn * mapN );\n\n\t}\n\n#endif\n",clearcoat_normal_fragment_begin:"\n#ifdef CLEARCOAT\n\n\tvec3 clearcoatNormal = geometryNormal;\n\n#endif\n",clearcoat_normal_fragment_maps:"\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\n\t#ifdef USE_TANGENT\n\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\n\t#else\n\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\n\t#endif\n\n#endif\n",clearcoat_normalmap_pars_fragment:"\n#ifdef USE_CLEARCOAT_NORMALMAP\n\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n\n#endif\n",packing:"\nvec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\n\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\n\nconst float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1)\nconst float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1)\n\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\n\nconst float ShiftRight8 = 1. / 256.;\n\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8; // tidy overflow\n\treturn r * PackUpscale;\n}\n\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\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 unpack2HalfToRGBA( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\n\n// NOTE: viewZ/eyeZ is < 0 when in front of the camera per OpenGL conventions\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}\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}\n",premultiplied_alpha_fragment:"\n#ifdef PREMULTIPLIED_ALPHA\n\n\t// Get get normal blending with premultipled, use with CustomBlending, OneFactor, OneMinusSrcAlphaFactor, AddEquation.\n\tgl_FragColor.rgb *= gl_FragColor.a;\n\n#endif\n",project_vertex:"\nvec4 mvPosition = vec4( transformed, 1.0 );\n\n#ifdef USE_INSTANCING\n\n\tmvPosition = instanceMatrix * mvPosition;\n\n#endif\n\nmvPosition = modelViewMatrix * mvPosition;\n\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"\n#ifdef DITHERING\n\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n\n#endif\n",dithering_pars_fragment:"\n#ifdef DITHERING\n\n\t// based on https://www.shadertoy.com/view/MslGR8\n\tvec3 dithering( vec3 color ) {\n\t\t//Calculate grid position\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\n\t\t//Shift the individual colors differently, thus making it even harder to see the dithering pattern\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\n\t\t//modify shift acording to grid position.\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\n\t\t//shift the color by dither_shift\n\t\treturn color + dither_shift_RGB;\n\t}\n\n#endif\n",roughnessmap_fragment:"\nfloat roughnessFactor = roughness;\n\n#ifdef USE_ROUGHNESSMAP\n\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\n\t// reads channel G, compatible with a combined OcclusionRoughnessMetallic (RGB) texture\n\troughnessFactor *= texelRoughness.g;\n\n#endif\n",roughnessmap_pars_fragment:"\n#ifdef USE_ROUGHNESSMAP\n\n\tuniform sampler2D roughnessMap;\n\n#endif\n",shadowmap_pars_fragment:"\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): create uniforms for area light shadows\n\n\t#endif\n\t*/\n\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\n\t}\n\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\n\t\treturn unpack2HalfToRGBA( texture2D( shadow, uv ) );\n\n\t}\n\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\n\t\tfloat occlusion = 1.0;\n\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\n\t\tfloat hard_shadow = step( compare , distribution.x ); // Hard Shadow\n\n\t\tif (hard_shadow != 1.0 ) {\n\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 ); // Chebeyshevs inequality\n\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); // 0.3 reduces light bleed\n\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\n\t\t}\n\t\treturn occlusion;\n\n\t}\n\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = ( floor( uv * size - 0.5 ) + 0.5 ) * texelSize;\n\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\n\t\tvec2 f = fract( uv * size + 0.5 );\n\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\n\t\treturn c;\n\n\t}\n\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\n\t\tfloat shadow = 1.0;\n\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\n\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\n\t\t// if ( all( something, something ) ) using this instead\n\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\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n\t\tbool frustumTest = all( frustumTestVec );\n\n\t\tif ( frustumTest ) {\n\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\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\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\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\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\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n\t\t#else // no percentage-closer filtering:\n\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\n\t\t#endif\n\n\t\t}\n\n\t\treturn shadow;\n\n\t}\n\n\t// cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D\n\t// vector suitable for 2D texture mapping. This code uses the following layout for the\n\t// 2D texture:\n\t//\n\t// xzXZ\n\t// y Y\n\t//\n\t// Y - Positive y direction\n\t// y - Negative y direction\n\t// X - Positive x direction\n\t// x - Negative x direction\n\t// Z - Positive z direction\n\t// z - Negative z direction\n\t//\n\t// Source and test bed:\n\t// https://gist.github.com/tschw/da10c43c467ce8afd0c4\n\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\n\t\t// Number of texels to avoid at the edge of each square\n\n\t\tvec3 absV = abs( v );\n\n\t\t// Intersect unit cube\n\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\n\t\t// Apply scale to avoid seams\n\n\t\t// two texels less per square (one texel will do for NEAREST)\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\n\t\t// Unwrap\n\n\t\t// space: -1 ... 1 range for each square\n\t\t//\n\t\t// #X##\t\tdim := ( 4 , 2 )\n\t\t// # #\t\tcenter := ( 1 , 1 )\n\n\t\tvec2 planar = v.xy;\n\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\n\t\tif ( absV.z >= almostOne ) {\n\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\n\t\t} else if ( absV.x >= almostOne ) {\n\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\n\t\t} else if ( absV.y >= almostOne ) {\n\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\n\t\t}\n\n\t\t// Transform to UV space\n\n\t\t// scale := 0.5 / dim\n\t\t// translate := ( center + 0.5 ) / dim\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\n\t}\n\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\n\t\t// for point lights, the uniform @vShadowCoord is re-purposed to hold\n\t\t// the vector from the light to the world-space position of the fragment.\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\n\t\t// dp = normalized distance from light to fragment position\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); // need to clamp?\n\t\tdp += shadowBias;\n\n\t\t// bd3D = base direction 3D\n\t\tvec3 bd3D = normalize( lightToPosition );\n\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\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\n\t\t#else // no percentage-closer filtering\n\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\n\t\t#endif\n\n\t}\n\n#endif\n",shadowmap_pars_vertex:"\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): uniforms for area light shadows\n\n\t#endif\n\t*/\n\n#endif\n",shadowmap_vertex:"\n#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\n\t}\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\n\t}\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\n\t}\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update vAreaShadowCoord with area light info\n\n\t#endif\n\t*/\n\n#endif\n",shadowmask_pars_fragment:"\nfloat getShadowMask() {\n\n\tfloat shadow = 1.0;\n\n\t#ifdef USE_SHADOWMAP\n\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\n\tDirectionalLight directionalLight;\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= all( bvec2( directionalLight.shadow, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\n\t}\n\n\t#endif\n\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\n\tSpotLight spotLight;\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= all( bvec2( spotLight.shadow, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\n\t}\n\n\t#endif\n\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\n\tPointLight pointLight;\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= all( bvec2( pointLight.shadow, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\n\t}\n\n\t#endif\n\n\t/*\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\n\t\t// TODO (abelnation): update shadow for Area light\n\n\t#endif\n\t*/\n\n\t#endif\n\n\treturn shadow;\n\n}\n",skinbase_vertex:"\n#ifdef USE_SKINNING\n\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\n#endif\n",skinning_pars_vertex:"\n#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\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\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\n\t\t\ty = dy * ( y + 0.5 );\n\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\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n",skinning_vertex:"\n#ifdef USE_SKINNING\n\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\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\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n\n#endif\n",skinnormal_vertex:"\n#ifdef USE_SKINNING\n\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\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\n\t#ifdef USE_TANGENT\n\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\n\t#endif\n\n#endif\n",specularmap_fragment:"\nfloat specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n\n#else\n\n\tspecularStrength = 1.0;\n\n#endif\n",specularmap_pars_fragment:"\n#ifdef USE_SPECULARMAP\n\n\tuniform sampler2D specularMap;\n\n#endif\n",tonemapping_fragment:"\n#if defined( TONE_MAPPING )\n\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n\n#endif\n",tonemapping_pars_fragment:"\n#ifndef saturate\n// <common> may have defined saturate() already\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\n\n// exposure only\nvec3 LinearToneMapping( vec3 color ) {\n\n\treturn toneMappingExposure * color;\n\n}\n\n// source: https://www.cs.utah.edu/~reinhard/cdrom/\nvec3 ReinhardToneMapping( vec3 color ) {\n\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n\n}\n\n// source: http://filmicgames.com/archives/75\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\n\t// John Hable's filmic operator from Uncharted 2 video game\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n\n}\n\n// source: http://filmicgames.com/archives/75\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\n\t// optimized filmic operator by Jim Hejl and Richard Burgess-Dawson\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\n}\n\n// source: https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n\n}\n",uv_pars_fragment:"\n#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\n\tvarying vec2 vUv;\n\n#endif\n",uv_pars_vertex:"\n#ifdef USE_UV\n\n\t#ifdef UVS_VERTEX_ONLY\n\n\t\tvec2 vUv;\n\n\t#else\n\n\t\tvarying vec2 vUv;\n\n\t#endif\n\n\tuniform mat3 uvTransform;\n\n#endif\n",uv_vertex:"\n#ifdef USE_UV\n\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n#endif\n",uv2_pars_fragment:"\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tvarying vec2 vUv2;\n\n#endif\n",uv2_pars_vertex:"\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\n#endif\n",uv2_vertex:"\n#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tvUv2 = uv2;\n\n#endif\n",worldpos_vertex:"\n#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\n\t#ifdef USE_INSTANCING\n\n\t\tworldPosition = instanceMatrix * worldPosition;\n\n\t#endif\n\n\tworldPosition = modelMatrix * worldPosition;\n\n#endif\n",amrt_aomap_fragment:"\n#if defined(USE_AOMAP)\n float ambientOcclusion = mix(1.0, aoMapTexelToLinear(texture2D( aoMap, vUvAO )).g, aoScale);\n reflectedLight.indirectDiffuse *= ambientOcclusion;\n #if defined( USE_ENVMAP ) && defined( STANDARD )\n\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\n\t#endif\n#endif\n",amrt_emissivemap_fragment:"\n#if defined(USE_EMISSIVEMAP)\n vec4 emissiveColor = texture2D( emissiveMap, vUvEmissive );\n\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",amrt_map_fragment:"\n#if defined( USE_ALBEDO )\n vec4 texelColor = texture2D( albedo, vUvAlbedo );\n texelColor = albedoTexelToLinear( texelColor );\n diffuseColor *= texelColor;\n#endif\n",amrt_map_pars_fragment:"\n\n// struct MapData\n// {\n// vec3 Normal;\n// vec3 Albedo;\n// float Emission;\n// float Metallic;\n// float Smoothness;\n// float Occlusion;\n// float Alpha;\n// };\n\n#ifdef USE_ALBEDO\n\n\tuniform sampler2D albedo;\n\n#endif\n\n#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform float normalScale;\n\n#endif\n\n#ifdef USE_NORMALMAP2\n\n\tuniform sampler2D normalMap2;\n\tuniform float normalScale2;\n\n#endif\n\n#ifdef USE_METALLICMAP\n\n\tuniform sampler2D metallicMap;\n\n#endif\n\n#ifdef USE_ROUGHNESSMAP\n\n\tuniform sampler2D roughnessMap;\n\n#endif\n\n#ifdef USE_AOMAP\n\n\tuniform sampler2D aoMap;\n\tuniform float aoScale;\n\n#endif\n\n#ifdef USE_EMISSIVEMAP\n\n\tuniform sampler2D emissiveMap;\n\n#endif\n\n#ifdef USE_REFLECTMAP\n #ifdef USE_REFLECTMAP_UV\n uniform sampler2D reflectMap;\n #else\n uniform samplerCube reflectMap;\n #endif\n\tuniform float reflectIntensity;\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n\n#ifdef USE_DISSOLVE\n uniform vec3 dissolveColor;\n uniform float dissolveRatio;\n\tuniform sampler2D dissolveMap;\n#endif\n\n",amrt_metalnessmap_fragment:"\nfloat metalnessFactor = metalness;\n#if defined(USE_METALLICMAP)\n metalnessFactor = metallicMapTexelToLinear(texture2D( metallicMap, vUvMetal )).r;\n#endif\n",amrt_alphamap_fragment:"\n#ifdef USE_ALPHAMAP\n\n\tgl_FragColor.a = texture2D( alphaMap, vUvAlpha ).g;\n\n#endif\n",amrt_normal_fragment_maps:"\n\n#if defined( USE_NORMALMAP ) || defined( USE_NORMALMAP2 )\n\n #if defined( USE_NORMALMAP ) && defined( USE_NORMALMAP2 )\n vec3 mapN = BlendNormals( UnpackScaleNormal( normalMapTexelToLinear(texture2D( normalMap, vUvNormal )), normalScale ) , UnpackScaleNormal( normalMap2TexelToLinear(texture2D( normalMap2, vUvNormal2 )), normalScale2 ) );\n #elif defined( USE_NORMALMAP )\n vec3 mapN = normalize(UnpackScaleNormal( normalMapTexelToLinear(texture2D( normalMap, vUvNormal )), normalScale));\n #elif defined( USE_NORMALMAP2 )\n vec3 mapN = normalize(UnpackScaleNormal( normalMap2TexelToLinear(texture2D( normalMap2, vUvNormal2 )), normalScale2));\n #endif\n \n #ifdef USE_TANGENT\n \n normal = normalize( vTBN * mapN );\n \n #else\n \n normal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n \n #endif\n \n#endif\n",amrt_roughnessmap_fragment:"\n#if defined(USE_ROUGHNESSMAP)\n roughnessFactor = roughnessMapTexelToLinear(texture2D( roughnessMap, vUvRough )).r;\n#endif\n",amrt_uv_pars_fragment:"\n\n#ifdef USE_ALBEDO\n\n\tvarying vec2 vUvAlbedo;\n\n#endif\n\n#ifdef USE_NORMALMAP\n\n\tvarying vec2 vUvNormal;\n\n#endif\n\n#ifdef USE_NORMALMAP2\n\n\tvarying vec2 vUvNormal2;\n\n#endif\n\n#ifdef USE_METALLICMAP\n\n\tvarying vec2 vUvMetal;\n\n#endif\n\n#ifdef USE_ROUGHNESSMAP\n\n\tvarying vec2 vUvRough;\n\n#endif\n\n#ifdef USE_AOMAP\n\n\tvarying vec2 vUvAO;\n\n#endif\n\n#ifdef USE_EMISSIVEMAP\n\n\tvarying vec2 vUvEmissive;\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tvarying vec2 vUvAlpha;\n\n#endif\n\n#ifdef USE_DISSOLVE\n\n varying vec2 vUv;\n \n#endif\n",amrt_uv_pars_vertex:"\n\nattribute vec2 uv2;\n\n#ifdef USE_ALBEDO\n\n\tvarying vec2 vUvAlbedo;\n\tuniform mat3 albedoUVTransform;\n\n#endif\n\n#ifdef USE_NORMALMAP\n\n\tvarying vec2 vUvNormal;\n\tuniform mat3 normalUVTransform;\n\n#endif\n\n#ifdef USE_NORMALMAP2\n\n\tvarying vec2 vUvNormal2;\n\tuniform mat3 normal2UVTransform;\n\n#endif\n\n#ifdef USE_METALLICMAP\n\n\tvarying vec2 vUvMetal;\n\tuniform mat3 metalUVTransform;\n\n#endif\n\n#ifdef USE_ROUGHNESSMAP\n\n\tvarying vec2 vUvRough;\n\tuniform mat3 roughUVTransform;\n\n#endif\n\n#ifdef USE_AOMAP\n\n\tvarying vec2 vUvAO;\n\tuniform mat3 aoUVTransform;\n\n#endif\n\n#ifdef USE_EMISSIVEMAP\n\n\tvarying vec2 vUvEmissive;\n\tuniform mat3 emissiveUVTransform;\n\n#endif\n\n#ifdef USE_ALPHAMAP\n\n\tvarying vec2 vUvAlpha;\n uniform mat3 alphaUVTransform;\n\n#endif\n\n#ifdef USE_DISSOLVE\n\n\tvarying vec2 vUv;\n\n#endif\n\n",amrt_uv_vertex:"\n\n#ifdef USE_ALBEDO\n\t\n\t#ifdef ALBEDO_UV1\n\n\t\tvUvAlbedo = ( albedoUVTransform * vec3( uv, 1 ) ).xy;\n\n\t#else\n\n\t\tvUvAlbedo = ( albedoUVTransform * vec3( uv2, 1 ) ).xy;\n\n\t#endif\n\n#endif\n\n#ifdef USE_NORMALMAP\n\n vUvNormal = ( normalUVTransform * vec3( uv, 1 ) ).xy;\n\n#endif\n\n#ifdef USE_NORMALMAP2\n\n vUvNormal2 = ( normal2UVTransform * vec3( uv2, 1 ) ).xy;\n\n#endif\n\n#ifdef USE_METALLICMAP\n\n vUvMetal = ( metalUVTransform * vec3( uv, 1 ) ).xy;\n\n#endif\n\n#ifdef USE_ROUGHNESSMAP\n \n vUvRough = ( roughUVTransform * vec3( uv, 1 ) ).xy;\n\n#endif\n\n#ifdef USE_ALPHAMAP\n \n vUvAlpha = ( alphaUVTransform * vec3( uv, 1 ) ).xy;\n\n#endif\n\n#ifdef USE_AOMAP\n\t\n\t#ifdef AO_UV1\n\n\t\tvUvAO = ( aoUVTransform * vec3( uv, 1 ) ).xy;\n\n\t#else\n\n\t\tvUvAO = ( aoUVTransform * vec3( uv2, 1 ) ).xy;\n\n\t#endif\n\n#endif\n\n#ifdef USE_EMISSIVEMAP\n\t\n\t#ifdef EMISSIVE_UV1\n\n\t\tvUvEmissive = ( emissiveUVTransform * vec3( uv, 1 ) ).xy;\n\n\t#else\n\n\t\tvUvEmissive = ( emissiveUVTransform * vec3( uv2, 1 ) ).xy;\n\n\t#endif\n\n#endif\n\n#ifdef USE_DISSOLVE\n\n vUv = uv;\n \n#endif\n",amrt_worldpos_vertex:"\n#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_REFLECTMAP )\n\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\n\t#ifdef USE_INSTANCING\n\n\t\tworldPosition = instanceMatrix * worldPosition;\n\n\t#endif\n\n\tworldPosition = modelMatrix * worldPosition;\n#endif\n",amrt_envmap_physical_pars_fragment:"\n#if defined( USE_ENVMAP )\n\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\n\tvec3 getLightProbeIndirectIrradiance( /*const in SpecularLightProbe specularLightProbe,*/ const in GeometricContext geometry, const in int maxMIPLevel ) {\n \n\n vec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t\n\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\n\t\t\t// TODO: replace with properly filtered cubemaps and access the irradiance LOD level, be it the last LOD level\n\t\t\t// of a specular cubemap, or just the default level of a specially created irradiance cubemap.\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\n\t\t\t#else\n\n\t\t\t\t// force the bias high to get the last LOD level as it is the most blurred.\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\n\t\t#endif\n \n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\n\t}\n\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n float maxMIPLevelScalar = float( maxMIPLevel );\n\n float sigma = PI * roughness * roughness / ( 1.0 + roughness ) + 0.000001;\n float desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n // clamp to allowable LOD ranges.\n return clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n \n\n\tvec3 getLightProbeIndirectRadiance( /*const in SpecularLightProbe specularLightProbe,*/ const in vec3 viewDir, const in vec3 normal, const in float roughness, const in float rroughness,const in int maxMIPLevel ) {\n \n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\n\t\t // Mixing the reflection with the normal is more accurate and keeps rough objects from gathering light from behind their tangent plane.\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\n\t\t#else\n\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\n\t\t#endif\n\n #ifdef ENVMAP_TYPE_CUBE_UV\n\t\t reflectVec = inverseTransformDirection( reflectVec, viewMatrixR );\n #else\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n #endif\n \n reflectVec *= envYMatrix;\n \n float specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\n\t\t\t#else\n\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\t\n vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\n\t\t\t#else\n\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\n\t\t\t#else\n\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\n\t\t\t#endif\n\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\n\t\t#endif\n\t\t\n\t\t\n\t\tenvMapColor = LinearTosRGB(envMapColor);\n\t\treturn envMapColor.rgb * envMapIntensity;\n\n\t}\n\n#endif\n",amrt_cube_uv_reflection_fragment:"\n#if defined(ENVMAP_TYPE_CUBE_UV) || defined(USE_REFLECTMAP_UV)\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\n// These shader functions convert between the UV coordinates of a single face of\n// a cubemap, the 0-5 integer index of a cube face, and the direction vector for\n// sampling a textureCube (not generally normalized).\nfloat getFace(vec3 direction) {\n vec3 absDirection = abs(direction);\n float face = -1.0;\n if (absDirection.x > absDirection.z) {\n if (absDirection.x > absDirection.y)\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if (absDirection.z > absDirection.y)\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n}\nvec2 getUV(vec3 direction, float face) {\n vec2 uv;\n if (face == 0.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x);\n } else if (face == 1.0) {\n uv = vec2(direction.x, -direction.z) / abs(direction.y);\n } else if (face == 2.0) {\n uv = direction.xy / abs(direction.z);\n } else if (face == 3.0) {\n uv = vec2(direction.z, direction.y) / abs(direction.x);\n } else if (face == 4.0) {\n uv = direction.xz / abs(direction.y);\n } else {\n uv = vec2(-direction.x, direction.y) / abs(direction.z);\n }\n return 0.5 * (uv + 1.0);\n}\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n\nvec3 bilinearCubeUVR(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n vec3 tl = reflectMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = reflectMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = reflectMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = reflectMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n\n// These defines must match with PMREMGenerator\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\nfloat roughnessToMip(float roughness) {\n float mip = 0.0;\n if (roughness >= r1) {\n mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n } else if (roughness >= r4) {\n mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n } else if (roughness >= r5) {\n mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n } else if (roughness >= r6) {\n mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n } else {\n mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25\n }\n return mip;\n}\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n\nvec4 textureCubeUVR(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n vec3 color0 = bilinearCubeUVR(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUVR(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n#endif\n",amrt_lights_fragment_maps:"\n#if defined( RE_IndirectDiffuse )\n\n\t#ifdef USE_LIGHTMAP\n\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tlightMapIrradiance *= PI; // factor of PI should not be present; included here to prevent breakage\n\n\t\t#endif\n\n\t\tirradiance += lightMapIrradiance;\n\n\t#endif\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( /*lightProbe,*/ geometry, maxMipLevel );\n\n\t#endif\n\n#endif\n\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\n\tradiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.normal, material.specularRoughness,roughnessFactor, maxMipLevel );\n\n\t#ifdef CLEARCOAT\n\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\n\t#endif\n\n#endif\n\n#if defined( USE_REFLECTMAP )\n vec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n \n #ifdef USE_REFLECTMAP_UV\n reflectVec = inverseTransformDirection( reflectVec, viewMatrixR ); \n vec4 reflectdiffuse = textureCubeUVR( reflectMap, reflectVec, 0.0 );\n reflectdiffuse = LinearTosRGB(reflectdiffuse);\n radiance += reflectdiffuse.rgb * reflectIntensity;\n #else\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n reflectVec = vec3( -1.0 * reflectVec.x, reflectVec.yz );\n vec4 reflectdiffuse = textureCube( reflectMap, reflectVec );\n reflectdiffuse.rgb = reflectMapTexelToLinear(reflectdiffuse).rgb;\n reflectdiffuse = LinearTosRGB(reflectdiffuse);\n radiance += reflectdiffuse.rgb * reflectIntensity;\n #endif\n#endif\n",amrt_bsdfs:'\n\n// Analytical approximation of the DFG LUT, one half of the\n// split-sum approximation used in indirect specular lighting.\n// via \'environmentBRDF\' from "Physically Based Shading on Mobile"\n// https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\nvec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\n\tvec4 r = roughness * c0 + c1;\n\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\n\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n\n}\n\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\n\t// based upon Frostbite 3 Moving to Physically-based Rendering\n\t// page 32, equation 26: E[window1]\n\t// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\n\t// this is intended to be used on spot and point lights who are represented as luminous intensity\n\t// but who must be converted to luminous irradiance for surface lighting calculation\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\n\tif( cutoffDistance > 0.0 ) {\n\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\n\t}\n\n\treturn distanceFalloff;\n\n#else\n\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\n\t}\n\n\treturn 1.0;\n\n#endif\n\n}\n\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\n\treturn RECIPROCAL_PI * diffuseColor;\n\n} // validated\n\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\n\t// Original approximation by Christophe Schlick \'94\n\t// float fresnel = pow( 1.0 - dotLH, 5.0 );\n\n\t// Optimized variant (presented by Epic at SIGGRAPH \'13)\n\t// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n\n} // validated\n\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\n\t// See F_Schlick\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\n\treturn Fr * fresnel + F0;\n\n}\n\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (34)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is "roughness squared" in Disney’s reparameterization\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\n\t// geometry term (normalized) = G(l)⋅G(v) / 4(n⋅l)(n⋅v)\n\t// also see #12151\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\n\treturn 1.0 / ( gl * gv );\n\n} // validated\n\n// Moving Frostbite to Physically Based Rendering 3.0 - page 12, listing 2\n// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\n\tfloat a2 = pow2( alpha );\n\n\t// dotNL and dotNV are explicitly swapped. This is not a mistake.\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\n\treturn 0.5 / max( gv + gl, EPSILON );\n\n}\n\n// Microfacet Models for Refraction through Rough Surfaces - equation (33)\n// http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html\n// alpha is "roughness squared" in Disney’s reparameterization\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\n\tfloat a2 = pow2( alpha );\n\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; // avoid alpha = 0 with dotNH = 1\n\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n\n}\n\n// GGX Distribution, Schlick Fresnel, GGX-Smith Visibility\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\n\tfloat alpha = pow2( roughness ); // UE4\'s roughness\n\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\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\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\n\tfloat D = D_GGX( alpha, dotNH );\n\n\treturn F * ( G * D );\n\n} // validated\n\n// Rect Area Light\n\n// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines\n// by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt\n// code: https://github.com/selfshadow/ltc_code/\n\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\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\n\tfloat dotNV = saturate( dot( N, V ) );\n\n\t// texture parameterized by sqrt( GGX alpha ) and sqrt( 1 - cos( theta ) )\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\treturn uv;\n\n}\n\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\n\t// Real-Time Area Lighting: a Journey from Research to Production (p.102)\n\t// An approximation of the form factor of a horizon-clipped rectangle.\n\n\tfloat l = length( f );\n\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n\n}\n\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\n\tfloat x = dot( v1, v2 );\n\n\tfloat y = abs( x );\n\n\t// rational polynomial approximation to theta / sin( theta ) / 2PI\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\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\n\treturn cross( v1, v2 ) * theta_sintheta;\n\n}\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\n\t// bail if point is on back side of plane of light\n\t// assumes ccw winding order of light vertices\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\n\t// construct orthonormal basis around N\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 ); // negated from paper; possibly due to a different handedness of world coordinate system\n\n\t// compute transform\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\n\t// transform rect\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\n\t// project rect onto sphere\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\n\t// calculate vector form factor\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\n\t// adjust for horizon clipping\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\n/*\n\t// alternate method of adjusting for horizon clipping (see referece)\n\t// refactoring required\n\tfloat len = length( vectorFormFactor );\n\tfloat z = vectorFormFactor.z / len;\n\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\n\t// tabulated horizon-clipped sphere, apparently...\n\tvec2 uv = vec2( z * 0.5 + 0.5, len );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\n\tfloat scale = texture2D( ltc_2, uv ).w;\n\n\tfloat result = len * scale;\n*/\n\n\treturn vec3( result );\n\n}\n\n// End Rect Area Light\n\n// ref: https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\n\treturn specularColor * brdf.x + brdf.y;\n\n} // validated\n\n// Fdez-Agüera\'s "Multiple-Scattering Microfacet Model for Real-Time Image Based Lighting"\n// Approximates multiscattering in order to preserve energy.\n// http://www.jcgt.org/published/0008/01/03/\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619; // 1/21\n\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n\n}\n\nfloat G_BlinnPhong_Implicit( /* const in float dotNL, const in float dotNV */ ) {\n\n\t// geometry term is (n dot l)(n dot v) / 4(n dot l)(n dot v)\n\treturn 0.25;\n\n}\n\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n\n}\n\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\n\t//float dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\t//float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\n\tfloat G = G_BlinnPhong_Implicit( /* dotNL, dotNV */ );\n\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\n\treturn F * ( G * D );\n\n} // validated\n\n// source: http://simonstechblog.blogspot.ca/2011/12/microfacet-brdf.html\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\n\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n\n#if defined( USE_SHEEN )\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs#L94\nfloat D_Charlie(float roughness, float NoH) {\n\t// Estevez and Kulla 2017, "Production Friendly Microfacet Sheen BRDF"\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125); // 2^(-14/2), so sin2h^2 > 0 in fp16\n\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\n\n// https://github.com/google/filament/blob/master/shaders/src/brdf.fs#L136\nfloat V_Neubelt(float NoV, float NoL) {\n\t// Neubelt and Pettineo 2013, "Crafting a Next-gen Material Pipeline for The Order: 1886"\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\n\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n\n}\n\n#endif\n',amrt_lights_physical_fragment:"\nGeometricContext geometry;\n\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n\n#ifdef CLEARCOAT\n\n\tgeometry.clearcoatNormal = clearcoatNormal;\n\n#endif\n\n#if defined( USE_REFLECTMAP )\n vec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n \n #ifdef USE_REFLECTMAP_UV\n reflectVec = inverseTransformDirection( reflectVec, viewMatrixR );\n reflectVec*=reflecYMatrix;\n vec4 reflectdiffuse = textureCubeUVR( reflectMap, reflectVec, 0.0 );\n reflectdiffuse = LinearTosRGB(reflectdiffuse);\n diffuseColor.rgb += reflectdiffuse.rgb * reflectIntensity;\n #else\n reflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n reflectVec = vec3( -1.0 * reflectVec.x, reflectVec.yz );\n reflectVec*=reflecYMatrix;\n vec4 reflectdiffuse = textureCube( reflectMap, reflectVec );\n reflectdiffuse.rgb = reflectMapTexelToLinear(reflectdiffuse).rgb;\n reflectdiffuse = LinearTosRGB(reflectdiffuse);\n diffuseColor.rgb += reflectdiffuse.rgb * reflectIntensity;\n #endif\n#endif\n\nPhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ) * 0.779083699;\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n\n#ifdef REFLECTIVITY\n\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\n#else\n\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n\n#endif\n\n#ifdef CLEARCOAT\n\n\tmaterial.clearcoat = saturate( clearcoat ); // Burley clearcoat model\n\tmaterial.clearcoatRoughness = clamp( clearcoatRoughness, 0.04, 1.0 );\n\n#endif\n#ifdef USE_SHEEN\n\n\tmaterial.sheenColor = sheen;\n\n#endif\n\nIncidentLight directLight;\n\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tPointLight pointLight;\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\tpointLight = pointLights[ i ];\n\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( pointLight.shadow, directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n #ifdef TRANSPARENCY\n directLight.color *= (1.0 - transparency);\n #endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\n#endif\n\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tSpotLight spotLight;\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\tspotLight = spotLights[ i ];\n\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( spotLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n #ifdef TRANSPARENCY\n directLight.color *= (1.0 - transparency);\n #endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\n#endif\n\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\n\tDirectionalLight directionalLight;\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\tdirectionalLight = directionalLights[ i ];\n\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectLight.color *= all( bvec3( directionalLight.shadow, directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n #ifdef TRANSPARENCY\n directLight.color *= (1.0 - transparency);\n #endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t}\n\n#endif\n\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\n\tRectAreaLight rectAreaLight;\n\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\n\t}\n\n#endif\n\n#if defined( RE_IndirectDiffuse )\n\n\tvec3 iblIrradiance = vec3( 0.0 );\n\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#ifdef TRANSPARENCY\n irradiance *= (1.0 - transparency);\n #endif\n\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\n\t\t}\n\n\t#endif\n\n#endif\n\n#if defined( RE_IndirectSpecular )\n\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n\n#endif\n\n#if defined( RE_IndirectDiffuse )\n\n\t#ifdef USE_LIGHTMAP\n\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\tlightMapIrradiance *= PI; // factor of PI should not be present; included here to prevent breakage\n\n\t\t#endif\n\n\t\tirradiance += lightMapIrradiance;\n\n\t#endif\n\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( /*lightProbe,*/ geometry, maxMipLevel );\n\n\t#endif\n\n#endif\n\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\n\tradiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.normal, material.specularRoughness,roughnessFactor, maxMipLevel );\n\n\t#ifdef CLEARCOAT\n\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\n\t#endif\n\n#endif\n",amrt_dissolve_fragment:"\n#if defined( USE_DISSOLVE )\n vec4 dissove = texture2D( dissolveMap, vUv );\n if(dissove.r < dissolveRatio) discard;\n if(abs(dissove.r - dissolveRatio) < 0.05){\n gl_FragColor.rgb = dissolveColor;\n }\n#endif\n",background_frag:"\nuniform sampler2D t2D;\n\nvarying vec2 vUv;\n\nvoid main() {\n\n\tvec4 texColor = texture2D( t2D, vUv );\n\n\tgl_FragColor = mapTexelToLinear( texColor );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",background_vert:"\nvarying vec2 vUv;\nuniform mat3 uvTransform;\n\nvoid main() {\n\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n\n}\n",cube_frag:"\nuniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nuniform float brightness;\nvarying vec3 vWorldDirection;\n\nvoid main() {\n\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\n\tgl_FragColor = mapTexelToLinear( texColor );\n gl_FragColor *= brightness;\n\tgl_FragColor.a *= opacity;\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",cube_vert:"\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\n\tgl_Position.z = gl_Position.w; // set z to camera.far\n\n}\n",depth_frag:"\n#if DEPTH_PACKING == 3200\n\n\tuniform float opacity;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tdiffuseColor.a = opacity;\n\n\t#endif\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\t#include <logdepthbuf_fragment>\n\n\t#if DEPTH_PACKING == 3200\n\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\n\t#elif DEPTH_PACKING == 3201\n\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\n\t#endif\n\n}\n",depth_vert:"\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n//#include <skinning_pars_vertex>\n#include <amrt_skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <amrt_skinbase_vertex>\n\t//#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t//#include <skinnormal_vertex>\n\t\t#include <amrt_skinnormal_vertex>\n\n\t#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t//#include <skinning_vertex>\n\t#include <amrt_skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n}\n",distanceRGBA_frag:"\n#define DISTANCE\n\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main () {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( 1.0 );\n\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist ); // clamp to [ 0, 1 ]\n\n\tgl_FragColor = packDepthToRGBA( dist );\n\n}\n",distanceRGBA_vert:"\n#define DISTANCE\n\nvarying vec3 vWorldPosition;\n\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_DISPLACEMENTMAP\n\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\n\t#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvWorldPosition = worldPosition.xyz;\n\n}\n",equirect_frag:"\nuniform sampler2D tEquirect;\n\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvec3 direction = normalize( vWorldDirection );\n\n\tvec2 sampleUV;\n\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\n\tgl_FragColor = mapTexelToLinear( texColor );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\n}\n",equirect_vert:"\nvarying vec3 vWorldDirection;\n\n#include <common>\n\nvoid main() {\n\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\n}\n",linedashed_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\nuniform float dashSize;\nuniform float totalSize;\n\nvarying float vLineDistance;\n\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\n\t\tdiscard;\n\n\t}\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\n\toutgoingLight = diffuseColor.rgb; // simple shader\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n",linedashed_vert:"\nuniform float scale;\nattribute float lineDistance;\n\nvarying float vLineDistance;\n\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <color_vertex>\n\n\tvLineDistance = scale * lineDistance;\n\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n}\n",meshbasic_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\n\t// accumulation (baked indirect lighting only)\n\t#ifdef USE_LIGHTMAP\n\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\n\t#endif\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n",meshbasic_vert:"\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\n\t#ifdef USE_ENVMAP\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n\t#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshlambert_frag:"\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\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\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\n\t// accumulation\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\n\t#else\n\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\n\t#endif\n\n\t#include <lightmap_fragment>\n\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\n\t#else\n\n\t\treflectedLight.directDiffuse = vLightFront;\n\n\t#endif\n\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}\n",meshlambert_vert:"\n#define LAMBERT\n\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}\n",meshmatcap_frag:"\n#define MATCAP\n\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\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; // 0.495 to remove artifacts caused by undersized matcap disks\n\n\t#ifdef USE_MATCAP\n\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\n\t#else\n\n\t\tvec4 matcapColor = vec4( 1.0 );\n\n\t#endif\n\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n",meshmatcap_vert:"\n#define MATCAP\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n\t#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\t\tvNormal = normalize( transformedNormal );\n\n\t#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n}\n",meshphong_frag:"\n#define PHONG\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\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\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\n\t// accumulation\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\t#include <envmap_fragment>\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n",meshphong_vert:"\n#define PHONG\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",meshphysical_frag:"\n#define STANDARD\n\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\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\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\n\t// accumulation\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\t// this is a stub for the transparency model\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1. - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n}\n",meshphysical_vert:"\n#define STANDARD\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n\t#ifdef USE_TANGENT\n\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\n\t#endif\n\n#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",normal_frag:"\n#define NORMAL\n\nuniform float opacity;\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvarying vec3 vViewPosition;\n\n#endif\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\n}\n",normal_vert:"\n#define NORMAL\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvarying vec3 vViewPosition;\n\n#endif\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n//#include <skinning_pars_vertex>\n#include <amrt_skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t//#include <uv_vertex>\n\t#include <amrt_uv_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <amrt_skinbase_vertex>\n\t#include <amrt_skinnormal_vertex>\n\t//#include <skinbase_vertex>\n\t//#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n\t#ifdef USE_TANGENT\n\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\n\t#endif\n\n#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t//#include <skinning_vertex>\n\t#include <amrt_skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\n\tvViewPosition = - mvPosition.xyz;\n\n#endif\n\n}\n",points_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\n\toutgoingLight = diffuseColor.rgb;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n",points_vert:"\nuniform float size;\nuniform float scale;\n\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\n\tgl_PointSize = size;\n\n\t#ifdef USE_SIZEATTENUATION\n\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\n\t#endif\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n\n}\n",shadow_frag:"\nuniform vec3 color;\nuniform float opacity;\n\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n\nvoid main() {\n\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\n\t#include <fog_fragment>\n\n}\n",shadow_vert:"\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\n\nvoid main() {\n\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",sprite_frag:"\nuniform vec3 diffuse;\nuniform float opacity;\n\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\n\toutgoingLight = diffuseColor.rgb;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n",sprite_vert:"\nuniform float rotation;\nuniform vec2 center;\n\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\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\n\t#ifndef USE_SIZEATTENUATION\n\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\n\t#endif\n\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\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\n\tmvPosition.xy += rotatedPosition;\n\n\tgl_Position = projectionMatrix * mvPosition;\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\n}\n",amrtbasic_vert:"\n#define STANDARD\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\n#include <common>\n#include <amrt_uv_pars_vertex>\n\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <amrt_skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#include <amrt_ssr_uv_vertex>\nvoid main() {\n\n\t#include <amrt_ssr_vertex>\n\t#include <amrt_uv_vertex>\n\t#include <color_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <amrt_skinbase_vertex>\n\t#include <amrt_skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n\t#ifdef USE_TANGENT\n\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\n\t#endif\n\n#endif\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <amrt_skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <amrt_worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n}\n",amrtbasic_frag:"\n\nprecision mediump sampler2D;\n#define STANDARD\n\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSPARENCY\n#endif\n#define REFLECTIVITY\n//#define TRANSPARENCY\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float smoothness;\nuniform float metalness;\nuniform float opacity;\nuniform mat3 envYMatrix;\nuniform mat3 reflecYMatrix;\nuniform bool clippingTransparent;\n\n#ifdef TRANSPARENCY\n\tuniform float transparency;\n#endif\n\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n\t#ifdef USE_TANGENT\n\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\n\t#endif\n\n#endif\n\nvec3 BlendNormals(vec3 n1, vec3 n2)\n{\n return normalize(vec3(n1.xy + n2.xy, n1.z*n2.z));\n}\n\nvec3 UnpackScaleNormal(vec4 packednormal, float bumpScale)\n{\n vec3 normal = packednormal.xyz * 2.0 - 1.0;\n normal.xy *= bumpScale;\n return normal;\n}\nfloat Pow5( const in float x ) { float x2 = x*x; return x2*x2*x; }\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <amrt_uv_pars_fragment>\n\n\nvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\n vec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n vec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n \n vec2 vUvs;\n #if defined( USE_NORMALMAP2 )\n vUvs = vUvNormal2;\n #elif defined( USE_NORMALMAP )\n vUvs = vUvNormal;\n #endif\n \n vec2 st0 = dFdx( vUvs.st );\n vec2 st1 = dFdy( vUvs.st );\n\n float scale = sign( st1.t * st0.s - st0.t * st1.s ); // we do not care about the magnitude\n\n vec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n vec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n vec3 N = normalize( surf_norm );\n\n mat3 tsn = mat3( S, T, N );\n\n mapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\n return normalize( tsn * mapN );\n\n}\n\n#include <amrt_map_pars_fragment>\n\n#include <amrt_bsdfs>\n#include <amrt_cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <amrt_envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n#include <amrt_ssr_uniform_fragment>\n\nvoid main() {\n\n float roughnessFactor = 1.0 - smoothness;\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include <logdepthbuf_fragment>\n\t#include <amrt_map_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <amrt_roughnessmap_fragment>\n\t#include <amrt_metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <amrt_normal_fragment_maps>\n\t\n\t#include <amrt_emissivemap_fragment>\n\n \n\n\t// accumulation\n\t#include <amrt_lights_physical_fragment>\n\t// #include <lights_fragment_begin>\n\t// #include <amrt_lights_fragment_maps>\n\t#include <lights_fragment_end>\n\n\t// modulation\n\t#include <amrt_aomap_fragment>\n\t\n\t//ssr\n\t#include <amrt_ssr_fragment>\n\n vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n \n\t// this is a stub for the transparency model\n\t#ifdef TRANSPARENCY\n\t\tdiffuseColor.a *= saturate( 1.0 - transparency + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular));\n\t#endif\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\n #include <amrt_dissolve_fragment>\n #include <amrt_alphamap_fragment>\n \n if(clippingTransparent)gl_FragColor.a *= clipping_opacity;\n}\n",amrtshadow_vert:"\n#include <common>\n#include <fog_pars_vertex>\n#include <clipping_planes_pars_fragment>\n#include <amrt_skinning_pars_vertex>\n\nuniform vec4 shadowPlane;\nuniform vec3 lightDirection;\nuniform vec3 center;\n\nvarying vec4 worldPosition;\nvarying vec3 projectionPosition;\nvarying vec3 projectionCenter;\n\nvoid main() {\n vec3 objectNormal = vec3( normal );\n vec3 transformed = vec3( position );\n\n #include <amrt_skinbase_vertex>\n\t#include <amrt_skinnormal_vertex>\n #include <amrt_skinning_vertex>\n\n vec4 mvPosition = vec4( transformed, 1.0 );\n #ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n #endif\n\n worldPosition = modelMatrix * mvPosition;\n\n #ifdef USE_SKINNING\n projectionCenter = (shadowSkinMatrix * vec4(center, 1.0)).xyz;\n #else\n projectionCenter = center;\n #endif\n\n projectionCenter = projectOnPlane(projectionCenter, shadowPlane.xyz * shadowPlane.w, shadowPlane.xyz);\n\n projectionPosition = linePlaneIntersect(worldPosition.xyz, -lightDirection, shadowPlane.xyz * shadowPlane.w, shadowPlane.xyz);\n gl_Position = projectionMatrix * viewMatrix * vec4(projectionPosition, 1.0);\n \n\t#include <fog_vertex>\n}\n",amrtshadow_frag:"\nuniform float opacity;\n\n#include <common>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nuniform vec3 color;\nuniform vec4 shadowPlane;\nuniform float shadowLength;\nuniform float shadowStrength;\nuniform vec3 lightDirection;\n\nvarying vec4 worldPosition;\nvarying vec3 projectionPosition;\nvarying vec3 projectionCenter;\n\nvoid main() {\n\n if(sideOfPlane(cameraPosition, shadowPlane.xyz * shadowPlane.w, shadowPlane.xyz) > 0.0) discard;\n if(dot(lightDirection, shadowPlane.xyz) < 0.0) discard;\n\n #include <clipping_planes_fragment>\n\n float dis = distance(projectionPosition, projectionCenter) / shadowLength;\n dis = smoothstep(0.05, 0.9, dis);\n\n gl_FragColor = vec4(color, pow(max(1.0 - dis, 0.0), 2.0) * shadowStrength);\n\n\t#include <fog_fragment>\n}\n",acf_vert:"\n#ifdef USE_UV\n varying vec2 vUv;\n#endif\n\nvoid main() {\n\n\t#ifdef USE_UV\n\n vUv = uv;\n \n #endif\n\n\tvec4 mvPosition = vec4( position, 1.0 );\n \n mvPosition = modelViewMatrix * mvPosition;\n \n gl_Position = projectionMatrix * mvPosition;\n}\n",acf_frag:"\nuniform vec3 diffuse;\n\n#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n\nvoid main() {\n\n\tvec4 diffuseColor = vec4( diffuse, 1.0 );\n\n\t#ifdef USE_MAP\n vec4 texelColor = texture2D( map, vUv );\n diffuseColor *= texelColor;\n #endif\n \n\tgl_FragColor = diffuseColor;\n}\n",amrt_skinbase_vertex:"\n#ifdef USE_SKINNING\n\n mat4 boneMatX = getBoneMatrix( skinIndex_4.x );\n mat4 boneMatY = getBoneMatrix( skinIndex_4.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex_4.z );\n mat4 boneMatW = getBoneMatrix( skinIndex_4.w );\n \n \n #ifdef BONE_8\n mat4 boneMatX_8 = getBoneMatrix( skinIndex_8.x );\n mat4 boneMatY_8 = getBoneMatrix( skinIndex_8.y );\n mat4 boneMatZ_8 = getBoneMatrix( skinIndex_8.z );\n mat4 boneMatW_8 = getBoneMatrix( skinIndex_8.w );\n #endif\n \n #ifdef BONE_12\n mat4 boneMatX_12 = getBoneMatrix( skinIndex_12.x );\n mat4 boneMatY_12 = getBoneMatrix( skinIndex_12.y );\n mat4 boneMatZ_12 = getBoneMatrix( skinIndex_12.z );\n mat4 boneMatW_12 = getBoneMatrix( skinIndex_12.w );\n #endif\n \n #ifdef BONE_16\n mat4 boneMatX_16 = getBoneMatrix( skinIndex_16.x );\n mat4 boneMatY_16 = getBoneMatrix( skinIndex_16.y );\n mat4 boneMatZ_16 = getBoneMatrix( skinIndex_16.z );\n mat4 boneMatW_16 = getBoneMatrix( skinIndex_16.w );\n #endif\n\n#endif\n",amrt_skinning_pars_vertex:"\n#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t\n attribute vec4 skinIndex_4;\n\tattribute vec4 skinWeight_4;\n\t\n\t#ifdef BONE_8\n attribute vec4 skinIndex_8;\n attribute vec4 skinWeight_8;\n \n\t#endif\n\t\n\t#ifdef BONE_12\n attribute vec4 skinIndex_12;\n attribute vec4 skinWeight_12;\n\t#endif\n\t\n\t#ifdef BONE_16\n attribute vec4 skinIndex_16;\n attribute vec4 skinWeight_16;\n\t#endif\n\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\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\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\n\t\t\ty = dy * ( y + 0.5 );\n\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\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\t\t\n\t\tvec4 getSkinVertex(vec4 skinVertex, vec4 skinIndexTmp,vec4 skinWeightTmp){\n\t\t\n\t\t mat4 boneMatX = getBoneMatrix( skinIndexTmp.x );\n mat4 boneMatY = getBoneMatrix( skinIndexTmp.y );\n mat4 boneMatZ = getBoneMatrix( skinIndexTmp.z );\n mat4 boneMatW = getBoneMatrix( skinIndexTmp.w );\n \n vec4 skinned = vec4( 0.0 );\n\n skinned += boneMatX * skinVertex * skinWeightTmp.x;\n skinned += boneMatY * skinVertex * skinWeightTmp.y;\n skinned += boneMatZ * skinVertex * skinWeightTmp.z;\n skinned += boneMatW * skinVertex * skinWeightTmp.w;\n return skinned;\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n",amrt_skinning_vertex:"\n\n#ifdef USE_SKINNING\n\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n \n vec4 skinned = vec4( 0.0 );\n \n skinned += boneMatX * skinVertex * skinWeight_4.x;\n skinned += boneMatY * skinVertex * skinWeight_4.y;\n skinned += boneMatZ * skinVertex * skinWeight_4.z;\n skinned += boneMatW * skinVertex * skinWeight_4.w;\n \n #ifdef BONE_8\n skinned += boneMatX_8 * skinVertex * skinWeight_8.x;\n skinned += boneMatY_8 * skinVertex * skinWeight_8.y;\n skinned += boneMatZ_8 * skinVertex * skinWeight_8.z;\n skinned += boneMatW_8 * skinVertex * skinWeight_8.w;\n\n #endif\n \n #ifdef BONE_12\n skinned += boneMatX_12 * skinVertex * skinWeight_12.x;\n skinned += boneMatY_12 * skinVertex * skinWeight_12.y;\n skinned += boneMatZ_12 * skinVertex * skinWeight_12.z;\n skinned += boneMatW_12 * skinVertex * skinWeight_12.w;\n #endif\n \n #ifdef BONE_16\n skinned += boneMatX_16 * skinVertex * skinWeight_16.x;\n skinned += boneMatY_16 * skinVertex * skinWeight_16.y;\n skinned += boneMatZ_16 * skinVertex * skinWeight_16.z;\n skinned += boneMatW_16 * skinVertex * skinWeight_16.w;\n #endif\n \n transformed = ( bindMatrixInverse * skinned ).xyz;\n\n#endif\n",amrt_skinnormal_vertex:"\n#ifdef USE_SKINNING\n\n\t mat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight_4.x * boneMatX;\n\tskinMatrix += skinWeight_4.y * boneMatY;\n\tskinMatrix += skinWeight_4.z * boneMatZ;\n\tskinMatrix += skinWeight_4.w * boneMatW;\n\t\n\t#ifdef BONE_8\n skinMatrix += skinWeight_8.x * boneMatX_8;\n skinMatrix += skinWeight_8.y * boneMatY_8;\n skinMatrix += skinWeight_8.z * boneMatZ_8;\n skinMatrix += skinWeight_8.w * boneMatW_8;\n\t#endif\n\t\n\t#ifdef BONE_12\n skinMatrix += skinWeight_12.x * boneMatX_12;\n skinMatrix += skinWeight_12.y * boneMatY_12;\n skinMatrix += skinWeight_12.z * boneMatZ_12;\n skinMatrix += skinWeight_12.w * boneMatW_12;\n\t#endif\n\t\n\t#ifdef BONE_16\n skinMatrix += skinWeight_16.x * boneMatX_16;\n skinMatrix += skinWeight_16.y * boneMatY_16;\n skinMatrix += skinWeight_16.z * boneMatZ_16;\n skinMatrix += skinWeight_16.w * boneMatW_16;\n\t#endif\n\t\n mat4 shadowSkinMatrix = skinMatrix;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\t\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\n\t#ifdef USE_TANGENT\n\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\n\t#endif\n\n#endif\n",amrt_ssr_uniform_fragment:"\n\n#ifdef USE_SSR\n\t\nuniform sampler2D ssrTexture;\nuniform sampler2D tDepth;\nuniform float maxDistance;\nuniform float ssrOpacity;\nuniform float fresnelCoe;\nuniform float virtualCameraNear;\nuniform float virtualCameraFar;\nuniform mat4 virtualCameraProjectionMatrix;\nuniform mat4 virtualCameraProjectionMatrixInverse;\nuniform mat4 virtualCameraMatrixWorld;\nuniform vec2 resolution;\nvarying vec4 ssrUV;\nuniform float planeOffset;\n\n\nfloat getDepth( const in vec2 uv ) {\n return texture2D( tDepth, uv ).x;\n}\nfloat getViewZ( const in float depth ) {\n return perspectiveDepthToViewZ( depth, virtualCameraNear, virtualCameraFar );\n}\nvec3 getViewPosition( const in vec2 uv, const in float depth/*clip space*/, const in float clipW ) {\n vec4 clipPosition = vec4( ( vec3( uv, depth ) - 0.5 ) * 2.0, 1.0 );//ndc\n clipPosition *= clipW; //clip\n return ( virtualCameraProjectionMatrixInverse * clipPosition ).xyz;//view\n}\n\n#define ssr_maxMipLevel 8.0\n#define ssr_minMipLevel 4.0\n// #define ssr_maxTileSize 256.0\n// #define ssr_minTileSize 16.0\n#define MAXSIZE 1024.0\n\nvec3 sampleTexture(sampler2D envMap,vec2 uv,vec2 xRange,vec2 yRange){\n\n float sx = 0.5 / MAXSIZE;\n float maxY = (MAXSIZE + MAXSIZE / 2.0);\n float sy = 0.5 / maxY;\n if(uv.x > xRange.y){\n uv.x = xRange.y - sx;\n }\n if(uv.y > yRange.y - sy){\n uv.y = yRange.y - sy;\n // return vec3(1.0,0.0,0.0);\n }\n\n return texture2D(envMap, uv).rgb;\n}\n\nvec3 ssrbilinearCubeUV(sampler2D envMap,vec2 vUv, float mipInt) {\n\n float maxY = (MAXSIZE + MAXSIZE / 2.0);\n vUv = fract(vUv);\n vec2 uv = vUv;\n float expInt = mipInt;\n if(mipInt > 4.0){\n expInt = 4.0;\n }\n float e = exp2(expInt);\n \n float texSize = MAXSIZE / e;\n \n vec2 xRange = vec2(0.0,1.0);\n vec2 yRange = vec2(0.0,1.0);\n\n if(mipInt == 0.0 ){\n float uvx = vUv.x;\n float uvy = vUv.y * (texSize / maxY);\n yRange.y = texSize / maxY;\n uv = vec2(uvx,uvy);\n }\n else\n {\n xRange.x = (MAXSIZE - 2.0 * texSize) / MAXSIZE;\n xRange.y = xRange.x + texSize / MAXSIZE;\n float uvx = xRange.x + (texSize / MAXSIZE) * vUv.x;\n float uvy = vUv.y;\n if(mipInt < 5.0){\n yRange.x = MAXSIZE / maxY;\n yRange.y = yRange.x + texSize / maxY;\n uvy = yRange.x + texSize / maxY * vUv.y;\n }\n if(mipInt > 4.0){\n yRange.x = (MAXSIZE + (mipInt - 4.0) * texSize) / maxY;\n yRange.y = yRange.x + texSize / maxY;\n uvy = yRange.x + texSize / maxY * vUv.y;\n }\n uv = vec2(uvx,uvy);\n }\n\n float sx = 0.5 / MAXSIZE;\n float sy = 0.5 / maxY;\n\n float maxx = uv.x / sx;\n float maxy = uv.y / sy;\n\n float fx = fract(maxx);\n float fy = fract(maxy);\n \n vec3 mx0 = sampleTexture(envMap, uv,xRange,yRange).rgb;\n // return mx0;\n vec3 mx1 = sampleTexture(envMap, uv + vec2(sx,0.0),xRange,yRange).rgb;\n\n vec3 my0 = sampleTexture(envMap, uv + vec2(0.0,sy),xRange,yRange).rgb;\n vec3 my1 = sampleTexture(envMap, uv + vec2(sx,sy),xRange,yRange).rgb;\n vec3 tm = mix(mx0,mx1,fx);\n vec3 tm1 = mix(my0,my1,fx);\n\n return mix(tm,tm1,fy);\n}\n\n\nfloat ssrroughnessToMip(float roughness) {\n float mip = 0.0;\n\n if(roughness >= 0.8){\n mip = 9.0 + (roughness - 0.8) / 0.2;\n }else if(roughness >= 0.4){\n mip = 6.0 + 3.0 * (roughness - 0.4) / 0.4;\n }else if(roughness >= 0.305){\n mip = 5.0 + (roughness - 0.305) / 0.095;\n }else if(roughness >= 0.21){\n mip = 4.0 + (roughness - 0.21) / 0.095;\n }else{\n mip = 4.0 * roughness / 0.21;\n }\n\n return mip;\n}\n\nvec4 ssrtextureCubeUV(sampler2D envMap, vec2 vUv,float roughness) {\n float mip = ssrroughnessToMip(roughness);//clamp(ssrroughnessToMip(roughness), ssrm0, ssr_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n\n // vec3 color11 = ssrbilinearCubeUV(envMap, vUv,10.0);\n // return vec4(color11,1.0);\n\n vec3 color0 = ssrbilinearCubeUV(envMap, vUv,mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = ssrbilinearCubeUV(envMap, vUv,mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n#endif\n\n",amrt_ssr_fragment:"\n\n#ifdef USE_SSR\n\t\n \n vec2 newssrUV = vec2(ssrUV.x / ssrUV.w,ssrUV.y / ssrUV.w);\n // vec4 ssrColor = texture2D(ssrTexture,newssrUV);\n // // // vec4 ssrColor = texture2DProj( ssrTexture, ssrUV );\n // reflectedLight.indirectSpecular = ssrColor.rgb;\n\n vec4 ssrColor = ssrtextureCubeUV(ssrTexture,newssrUV,material.specularRoughness);\n vec2 uv=(gl_FragCoord.xy-.5)/resolution.xy;\n uv.x=1.-uv.x;\n float depth = texture2DProj( tDepth, ssrUV ).r;\n float viewZ = getViewZ( depth );\n float clipW = virtualCameraProjectionMatrix[2][3] * viewZ+virtualCameraProjectionMatrix[3][3];\n vec3 viewPosition=getViewPosition( uv, depth, clipW );\n vec3 worldPosition=(virtualCameraMatrixWorld*vec4(viewPosition,1)).xyz;\n float ratio= saturate(1.0 - (abs(worldPosition.y - planeOffset)/maxDistance));\n float attenuation=ratio*ratio;\n float op = ssrOpacity*attenuation;// * fresnelCoe;\n reflectedLight.indirectSpecular = ssrColor.rgb * op; // * op\n \n\n\n#endif\n\n",amrt_ssr_uv_vertex:"\n\n#ifdef USE_SSR\n\t\nvarying vec4 ssrUV;\nuniform mat4 ssrTextureMatrix;\n\n#endif\n\n",amrt_ssr_vertex:"\n#ifdef USE_SSR\n ssrUV = ssrTextureMatrix * vec4( position, 1.0 );\n#endif\n\n"},Yi={common:{diffuse:{value:new Fn(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new lt},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 tt(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 Fn(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new Fn(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new lt}},sprite:{diffuse:{value:new Fn(15658734)},opacity:{value:1},center:{value:new tt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new lt}},amrtbasic:{diffuse:{value:new Fn(.5,.5,.5)},opacity:{value:1},emissive:{value:new Fn(0)},smoothness:{value:.5},metalness:{value:.5},transparency:{value:0},cutout:{value:1},albedo:{value:null},normalMap:{value:null},normalScale:{value:1},normalMap2:{value:null},normalScale2:{value:1},metallicMap:{value:null},roughnessMap:{value:null},aoMap:{value:null},aoScale:{value:1},emissiveMap:{value:null},reflectMap:{value:null},reflectIntensity:{value:0},envMapIntensity:{value:1},alphaMap:{value:null},dissolveMap:{value:null},dissolveRatio:{value:1},dissolveColor:{value:new Fn(0)},ssrTextureMatrix:{value:new bt},ssrTexture:{value:null},maxDistance:{value:10},ssrOpacity:{value:1},fresnelCoe:{value:0},virtualCameraNear:{value:.1},virtualCameraFar:{value:1e3},virtualCameraMatrixWorld:{value:new bt},virtualCameraProjectionMatrix:{value:new bt},virtualCameraProjectionMatrixInverse:{value:new bt},resolution:{value:new tt},tDepth:{value:null},albedoUVTransform:{value:new lt},normalUVTransform:{value:new lt},normal2UVTransform:{value:new lt},metalUVTransform:{value:new lt},roughUVTransform:{value:new lt},aoUVTransform:{value:new lt},emissiveUVTransform:{value:new lt},alphaUVTransform:{value:new lt},clippingTransparent:{value:!1},planeOffset:{value:0}},amrtshadow:{color:{value:new Fn(0)},shadowPlane:{value:new vn(new at(0,-1),0)},shadowStrength:{value:1},lightDirection:{value:new at(-1,-1,-1)},shadowLength:{value:1},center:{value:new at(0,0,0)}}},Ki={basic:{uniforms:Ui([Yi.common,Yi.specularmap,Yi.envmap,Yi.aomap,Yi.lightmap,Yi.fog]),vertexShader:Xi.meshbasic_vert,fragmentShader:Xi.meshbasic_frag},lambert:{uniforms:Ui([Yi.common,Yi.specularmap,Yi.envmap,Yi.aomap,Yi.lightmap,Yi.emissivemap,Yi.fog,Yi.lights,{emissive:{value:new Fn(0)}}]),vertexShader:Xi.meshlambert_vert,fragmentShader:Xi.meshlambert_frag},phong:{uniforms:Ui([Yi.common,Yi.specularmap,Yi.envmap,Yi.aomap,Yi.lightmap,Yi.emissivemap,Yi.bumpmap,Yi.normalmap,Yi.displacementmap,Yi.gradientmap,Yi.fog,Yi.lights,{emissive:{value:new Fn(0)},specular:{value:new Fn(1118481)},shininess:{value:30}}]),vertexShader:Xi.meshphong_vert,fragmentShader:Xi.meshphong_frag},standard:{uniforms:Ui([Yi.common,Yi.envmap,Yi.aomap,Yi.lightmap,Yi.emissivemap,Yi.bumpmap,Yi.normalmap,Yi.displacementmap,Yi.roughnessmap,Yi.metalnessmap,Yi.fog,Yi.lights,{emissive:{value:new Fn(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:Xi.meshphysical_vert,fragmentShader:Xi.meshphysical_frag},matcap:{uniforms:Ui([Yi.common,Yi.bumpmap,Yi.normalmap,Yi.displacementmap,Yi.fog,{matcap:{value:null}}]),vertexShader:Xi.meshmatcap_vert,fragmentShader:Xi.meshmatcap_frag},points:{uniforms:Ui([Yi.points,Yi.fog]),vertexShader:Xi.points_vert,fragmentShader:Xi.points_frag},dashed:{uniforms:Ui([Yi.common,Yi.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Xi.linedashed_vert,fragmentShader:Xi.linedashed_frag},depth:{uniforms:Ui([Yi.common,Yi.displacementmap]),vertexShader:Xi.depth_vert,fragmentShader:Xi.depth_frag},normal:{uniforms:Ui([Yi.common,Yi.bumpmap,Yi.normalmap,Yi.displacementmap,{opacity:{value:1}}]),vertexShader:Xi.normal_vert,fragmentShader:Xi.normal_frag},sprite:{uniforms:Ui([Yi.sprite,Yi.fog]),vertexShader:Xi.sprite_vert,fragmentShader:Xi.sprite_frag},background:{uniforms:{uvTransform:{value:new lt},t2D:{value:null}},vertexShader:Xi.background_vert,fragmentShader:Xi.background_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1},brightness:{value:1}},vertexShader:Xi.cube_vert,fragmentShader:Xi.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Xi.equirect_vert,fragmentShader:Xi.equirect_frag},distanceRGBA:{uniforms:Ui([Yi.common,Yi.displacementmap,{referencePosition:{value:new at},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Xi.distanceRGBA_vert,fragmentShader:Xi.distanceRGBA_frag},shadow:{uniforms:Ui([Yi.lights,Yi.fog,{color:{value:new Fn(0)},opacity:{value:1}}]),vertexShader:Xi.shadow_vert,fragmentShader:Xi.shadow_frag},acf:{uniforms:{diffuse:{value:new Fn(0)},map:{value:null}},vertexShader:Xi.acf_vert,fragmentShader:Xi.acf_frag}};function Zi(){var e=null,t=!1,n=null;function i(r,a){!1!==t&&(n(r,a),e.requestAnimationFrame(i))}return{start:function(){!0!==t&&null!==n&&(e.requestAnimationFrame(i),t=!0)},stop:function(){t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function Ji(e){var t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);var i=t.get(n);i&&(e.deleteBuffer(i.buffer),t.delete(n))},update:function(n,i){n.isInterleavedBufferAttribute&&(n=n.data);var r=t.get(n);void 0===r?t.set(n,function(t,n){var i=t.array,r=t.usage,a=e.createBuffer();e.bindBuffer(n,a),e.bufferData(n,i,r),t.onUploadCallback();var o=e.FLOAT;return i instanceof Float32Array?o=e.FLOAT:i instanceof Float64Array?console.warn("WebGLAttributes: Unsupported data buffer format: Float64Array."):i instanceof Uint16Array?o=e.UNSIGNED_SHORT:i instanceof Int16Array?o=e.SHORT:i instanceof Uint32Array?o=e.UNSIGNED_INT:i instanceof Int32Array?o=e.INT:i instanceof Int8Array?o=e.BYTE:i instanceof Uint8Array&&(o=e.UNSIGNED_BYTE),{buffer:a,type:o,bytesPerElement:i.BYTES_PER_ELEMENT,version:t.version}}(n,i)):r.version<n.version&&(!function(t,n,i){var r=n.array,a=n.updateRange;e.bindBuffer(i,t),-1===a.count?e.bufferSubData(i,0,r):(e.bufferSubData(i,a.offset*r.BYTES_PER_ELEMENT,r.subarray(a.offset,a.offset+a.count)),a.count=-1)}(r.buffer,n,i),r.version=n.version)}}}function qi(e,t,n,i){Li.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i},this.fromBufferGeometry(new $i(e,t,n,i)),this.mergeVertices()}function $i(e,t,n,i){si.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};var r,a,o=(e=e||1)/2,s=(t=t||1)/2,l=Math.floor(n)||1,A=Math.floor(i)||1,c=l+1,h=A+1,u=e/l,d=t/A,f=[],p=[],m=[],v=[];for(a=0;a<h;a++){var g=a*d-s;for(r=0;r<c;r++){var y=r*u-o;p.push(y,-g,0),m.push(0,0,1),v.push(r/l),v.push(1-a/A)}}for(a=0;a<A;a++)for(r=0;r<l;r++){var w=r+c*a,x=r+c*(a+1),b=r+1+c*(a+1),M=r+1+c*a;f.push(w,x,M),f.push(x,b,M)}this.setIndex(f),this.setAttribute("position",new Yn(p,3)),this.setAttribute("normal",new Yn(m,3)),this.setAttribute("uv",new Yn(v,2))}function er(e,t,n,i){var r,a,o=new Fn(0),s=0,l=null,A=0;function c(e,n){t.buffers.color.setClear(e.r,e.g,e.b,n,i)}return{getClearColor:function(){return o},setClearColor:function(e,t){o.set(e),c(o,s=void 0!==t?t:1)},getClearAlpha:function(){return s},setClearAlpha:function(e){c(o,s=e)},render:function(t,i,h,u){var d=i.background,f=e.vr,p=f.getSession&&f.getSession();if(p&&"additive"===p.environmentBlendMode&&(d=null),null===d?(c(o,s),l=null,A=0):d&&d.isColor&&(c(d,1),u=!0,l=null,A=0),(e.autoClear||u)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),d&&(d.isCubeTexture||d.isWebGLRenderTargetCube)){void 0===a&&((a=new Ei(new ki(1,1,1),new Ri({type:"BackgroundCubeMaterial",uniforms:Pi(Ki.cube.uniforms),vertexShader:Ki.cube.vertexShader,fragmentShader:Ki.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.tCube.value}}),n.update(a));var m=d.isWebGLRenderTargetCube?d.texture:d;a.material.uniforms.tCube.value=m,a.material.uniforms.tFlip.value=d.isWebGLRenderTargetCube?1:-1,a.material.uniforms.brightness.value=null==d.brightness||null==d.brightness?1:d.brightness,l===d&&A===m.version||(a.material.needsUpdate=!0,l=d,A=m.version),t.unshift(a,a.geometry,a.material,0,0,null)}else d&&d.isTexture&&(void 0===r&&((r=new Ei(new $i(2,2),new Ri({type:"BackgroundMaterial",uniforms:Pi(Ki.background.uniforms),vertexShader:Ki.background.vertexShader,fragmentShader:Ki.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(r.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(r)),r.material.uniforms.t2D.value=d,!0===d.matrixAutoUpdate&&d.updateMatrix(),r.material.uniforms.uvTransform.value.copy(d.matrix),l===d&&A===d.version||(r.material.needsUpdate=!0,l=d,A=d.version),t.unshift(r,r.geometry,r.material,0,0,null))}}}function tr(e,t,n,i){var r,a=i.isWebGL2;this.setMode=function(e){r=e},this.render=function(t,i){e.drawArrays(r,t,i),n.update(i,r)},this.renderInstances=function(i,o,s,l){if(0!==l){var A,c;if(a)A=e,c="drawArraysInstanced";else if(c="drawArraysInstancedANGLE",null===(A=t.get("ANGLE_instanced_arrays")))return void console.error("WebGLBufferRenderer: using InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");A[c](r,o,s,l),n.update(s,r,l)}}}function nr(e,t,n){var i;function r(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var a="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext,o=void 0!==n.precision?n.precision:"highp",s=r(o);s!==o&&(console.warn("WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);var l=!0===n.logarithmicDepthBuffer,A=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),c=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_TEXTURE_SIZE),u=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),d=e.getParameter(e.MAX_VERTEX_ATTRIBS),f=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),p=e.getParameter(e.MAX_VARYING_VECTORS),m=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),v=c>0,g=a||!!t.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==i)return i;var n=t.get("EXT_texture_filter_anisotropic");return i=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:l,maxTextures:A,maxVertexTextures:c,maxTextureSize:h,maxCubemapSize:u,maxAttributes:d,maxVertexUniforms:f,maxVaryings:p,maxFragmentUniforms:m,vertexTextures:v,floatFragmentTextures:g,floatVertexTextures:v&&g,maxSamples:a?e.getParameter(e.MAX_SAMPLES):0}}function ir(){var e=this,t=null,n=0,i=!1,r=!1,a=new vn,o=new lt,s={value:null,needsUpdate:!1};function l(){s.value!==t&&(s.value=t,s.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function A(t,n,i,r){var l=null!==t?t.length:0,A=null;if(0!==l){if(A=s.value,!0!==r||null===A){var c=i+4*l,h=n.matrixWorldInverse;o.getNormalMatrix(h),(null===A||A.length<c)&&(A=new Float32Array(c));for(var u=0,d=i;u!==l;++u,d+=4)a.copy(t[u]).applyMatrix4(h,o),a.normal.toArray(A,d),A[d+3]=a.constant}s.value=A,s.needsUpdate=!0}return e.numPlanes=l,A}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(e,r,a){var o=0!==e.length||r||0!==n||i;return i=r,t=A(e,a,0),n=e.length,o},this.beginShadows=function(){r=!0,A(null)},this.endShadows=function(){r=!1,l()},this.setState=function(e,a,o,c,h,u){if(!i||null===e||0===e.length||r&&!o)r?A(null):l();else{var d=r?0:n,f=4*d,p=h.clippingState||null;s.value=p,p=A(e,c,f,u);for(var m=0;m!==f;++m)p[m]=t[m];h.clippingState=p,this.numIntersection=a?this.numPlanes:0,this.numPlanes+=d}}}function rr(e){var t={};function n(n){if(void 0!==t[n])return t[n];var i;switch(n){case"WEBGL_depth_texture":i=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=e.getExtension(n)}return t[n]=i,i}return{has:function(e){return null!==n(e)},init:function(e){e.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(e){var t=n(e);return null===t&&console.warn("WebGLRenderer: "+e+" extension not supported."),t}}}function ar(e,t,n){var i=new WeakMap,r=new WeakMap;function a(e){var o=e.target,s=i.get(o);for(var l in null!==s.index&&t.remove(s.index),s.attributes)t.remove(s.attributes[l]);o.removeEventListener("dispose",a),i.delete(o);var A=r.get(s);A&&(t.remove(A),r.delete(s)),n.memory.geometries--}function o(n){var i=[],a=n.index,o=n.attributes.position,s=0;if(null!==a){var l=a.array;s=a.version;for(var A=0,c=l.length;A<c;A+=3){var h=l[A+0],u=l[A+1],d=l[A+2];i.push(h,u,u,d,d,h)}}else{l=o.array;s=o.version;for(A=0,c=l.length/3-1;A<c;A+=3){h=A+0,u=A+1,d=A+2;i.push(h,u,u,d,d,h)}}var f=new(qn(i)>65535?Xn:jn)(i,1);f.version=s,t.update(f,e.ELEMENT_ARRAY_BUFFER);var p=r.get(n);p&&t.remove(p),r.set(n,f)}return{get:function(e,t){var r=i.get(t);return r||(t.addEventListener("dispose",a),t.isBufferGeometry?r=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new si).setFromObject(e)),r=t._bufferGeometry),i.set(t,r),n.memory.geometries++,r)},update:function(n){var i=n.index,r=n.attributes;for(var a in null!==i&&t.update(i,e.ELEMENT_ARRAY_BUFFER),r)t.update(r[a],e.ARRAY_BUFFER);var o=n.morphAttributes;for(var a in o)for(var s=o[a],l=0,A=s.length;l<A;l++)t.update(s[l],e.ARRAY_BUFFER)},getWireframeAttribute:function(e){var t=r.get(e);if(t){var n=e.index;null!==n&&t.version<n.version&&o(e)}else o(e);return r.get(e)}}}function or(e,t,n,i){var r,a,o,s=i.isWebGL2;this.setMode=function(e){r=e},this.setIndex=function(e){a=e.type,o=e.bytesPerElement},this.render=function(t,i){e.drawElements(r,i,a,t*o),n.update(i,r)},this.renderInstances=function(i,l,A,c){if(0!==c){var h,u;if(s)h=e,u="drawElementsInstanced";else if(u="drawElementsInstancedANGLE",null===(h=t.get("ANGLE_instanced_arrays")))return void console.error("WebGLIndexedBufferRenderer: using InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[u](r,A,a,l*o,c),n.update(A,r,c)}}}function sr(e){var t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.frame++,t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(n,i,r){switch(r=r||1,t.calls++,i){case e.TRIANGLES:t.triangles+=r*(n/3);break;case e.TRIANGLE_STRIP:case e.TRIANGLE_FAN:t.triangles+=r*(n-2);break;case e.LINES:t.lines+=r*(n/2);break;case e.LINE_STRIP:t.lines+=r*(n-1);break;case e.LINE_LOOP:t.lines+=r*n;break;case e.POINTS:t.points+=r*n;break;default:console.error("WebGLInfo: Unknown draw mode:",i)}}}}function lr(e,t){return Math.abs(t[1])-Math.abs(e[1])}function Ar(e){var t={},n=new Float32Array(8);return{update:function(i,r,a,o){var s=i.morphTargetInfluences,l=s.length,A=t[r.id];if(void 0===A){A=[];for(var c=0;c<l;c++)A[c]=[c,0];t[r.id]=A}var h=a.morphTargets&&r.morphAttributes.position,u=a.morphNormals&&r.morphAttributes.normal;for(c=0;c<l;c++){0!==(f=A[c])[1]&&(h&&r.deleteAttribute("morphTarget"+c),u&&r.deleteAttribute("morphNormal"+c))}for(c=0;c<l;c++){(f=A[c])[0]=c,f[1]=s[c]}A.sort(lr);var d=0;for(c=0;c<8;c++){var f;if(f=A[c]){var p=f[0],m=f[1];if(m){h&&r.setAttribute("morphTarget"+c,h[p]),u&&r.setAttribute("morphNormal"+c,u[p]),n[c]=m,d+=m;continue}}n[c]=0}var v=r.morphTargetsRelative?1:1-d;o.getUniforms().setValue(e,"morphTargetBaseInfluence",v),o.getUniforms().setValue(e,"morphTargetInfluences",n)}}}function cr(e,t,n,i){var r={};return{update:function(a){var o=i.render.frame,s=a.geometry,l=t.get(a,s);return r[l.id]!==o&&(s.isGeometry&&l.updateFromObject(a),t.update(l),r[l.id]=o),a.isInstancedMesh&&n.update(a.instanceMatrix,e.ARRAY_BUFFER),l},dispose:function(){r={}}}}function hr(e,t,n,i,r,a,o,s,l,A){e=void 0!==e?e:[],t=void 0!==t?t:N,o=void 0!==o?o:Ae,ht.call(this,e,t,n,i,r,a,o,s,l,A),this.flipY=!1}function ur(e,t,n,i){ht.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:i||1},this.magFilter=X,this.minFilter=X,this.wrapR=j,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function dr(e,t,n,i){ht.call(this,null),this.image={data:e||null,width:t||1,height:n||1,depth:i||1},this.magFilter=X,this.minFilter=X,this.wrapR=j,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}Ki.physical={uniforms:Ui([Ki.standard.uniforms,{transparency:{value:0},clearcoat:{value:0},clearcoatRoughness:{value:0},sheen:{value:new Fn(0)},clearcoatNormalScale:{value:new tt(1,1)},clearcoatNormalMap:{value:null}}]),vertexShader:Xi.meshphysical_vert,fragmentShader:Xi.meshphysical_frag},Ki.amrtbasic={uniforms:Ui([Yi.envmap,Yi.amrtbasic,Yi.fog,Yi.lights,{envYMatrix:{value:new lt},reflecYMatrix:{value:new lt}}]),vertexShader:Xi.amrtbasic_vert,fragmentShader:Xi.amrtbasic_frag},Ki.amrtshadow={uniforms:Ui([Yi.fog,Yi.amrtshadow,Yi.lights]),vertexShader:Xi.amrtshadow_vert,fragmentShader:Xi.amrtshadow_frag},qi.prototype=Object.create(Li.prototype),qi.prototype.constructor=qi,$i.prototype=Object.create(si.prototype),$i.prototype.constructor=$i,hr.prototype=Object.create(ht.prototype),hr.prototype.constructor=hr,hr.prototype.isCubeTexture=!0,Object.defineProperty(hr.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}}),ur.prototype=Object.create(ht.prototype),ur.prototype.constructor=ur,ur.prototype.isDataTexture2DArray=!0,dr.prototype=Object.create(ht.prototype),dr.prototype.constructor=dr,dr.prototype.isDataTexture3D=!0;var fr=new ht,pr=new ur,mr=new dr,vr=new hr,gr=[],yr=[],wr=new Float32Array(16),xr=new Float32Array(9),br=new Float32Array(4);function Mr(e,t,n){var i=e[0];if(i<=0||i>0)return e;var r=t*n,a=gr[r];if(void 0===a&&(a=new Float32Array(r),gr[r]=a),0!==t){i.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=n,e[o].toArray(a,s)}return a}function Cr(e,t){if(e.length!==t.length)return!1;for(var n=0,i=e.length;n<i;n++)if(e[n]!==t[n])return!1;return!0}function Br(e,t){for(var n=0,i=t.length;n<i;n++)e[n]=t[n]}function Er(e,t){var n=yr[t];void 0===n&&(n=new Int32Array(t),yr[t]=n);for(var i=0;i!==t;++i)n[i]=e.allocateTextureUnit();return n}function Sr(e,t){var n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function Tr(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(Cr(n,t))return;e.uniform2fv(this.addr,t),Br(n,t)}}function _r(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(Cr(n,t))return;e.uniform3fv(this.addr,t),Br(n,t)}}function Ir(e,t){var n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(Cr(n,t))return;e.uniform4fv(this.addr,t),Br(n,t)}}function Lr(e,t){var n=this.cache,i=t.elements;if(void 0===i){if(Cr(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),Br(n,t)}else{if(Cr(n,i))return;br.set(i),e.uniformMatrix2fv(this.addr,!1,br),Br(n,i)}}function Fr(e,t){var n=this.cache,i=t.elements;if(void 0===i){if(Cr(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),Br(n,t)}else{if(Cr(n,i))return;xr.set(i),e.uniformMatrix3fv(this.addr,!1,xr),Br(n,i)}}function kr(e,t){var n=this.cache,i=t.elements;if(void 0===i){if(Cr(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),Br(n,t)}else{if(Cr(n,i))return;wr.set(i),e.uniformMatrix4fv(this.addr,!1,wr),Br(n,i)}}function Pr(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.safeSetTexture2D(t||fr,r)}function Ur(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(t||pr,r)}function Dr(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(t||mr,r)}function Rr(e,t,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(e.uniform1i(this.addr,r),i[0]=r),n.safeSetTextureCube(t||vr,r)}function Or(e,t){var n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function Nr(e,t){var n=this.cache;Cr(n,t)||(e.uniform2iv(this.addr,t),Br(n,t))}function zr(e,t){var n=this.cache;Cr(n,t)||(e.uniform3iv(this.addr,t),Br(n,t))}function Qr(e,t){var n=this.cache;Cr(n,t)||(e.uniform4iv(this.addr,t),Br(n,t))}function Gr(e,t){e.uniform1fv(this.addr,t)}function Hr(e,t){e.uniform1iv(this.addr,t)}function Vr(e,t){e.uniform2iv(this.addr,t)}function jr(e,t){e.uniform3iv(this.addr,t)}function Wr(e,t){e.uniform4iv(this.addr,t)}function Xr(e,t){var n=Mr(t,this.size,2);e.uniform2fv(this.addr,n)}function Yr(e,t){var n=Mr(t,this.size,3);e.uniform3fv(this.addr,n)}function Kr(e,t){var n=Mr(t,this.size,4);e.uniform4fv(this.addr,n)}function Zr(e,t){var n=Mr(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function Jr(e,t){var n=Mr(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function qr(e,t){var n=Mr(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function $r(e,t,n){var i=t.length,r=Er(n,i);e.uniform1iv(this.addr,r);for(var a=0;a!==i;++a)n.safeSetTexture2D(t[a]||fr,r[a])}function ea(e,t,n){var i=t.length,r=Er(n,i);e.uniform1iv(this.addr,r);for(var a=0;a!==i;++a)n.safeSetTextureCube(t[a]||vr,r[a])}function ta(e,t,n){this.id=e,this.addr=n,this.cache=[],this.setValue=function(e){switch(e){case 5126:return Sr;case 35664:return Tr;case 35665:return _r;case 35666:return Ir;case 35674:return Lr;case 35675:return Fr;case 35676:return kr;case 35678:case 36198:return Pr;case 35679:return Dr;case 35680:return Rr;case 36289:return Ur;case 5124:case 35670:return Or;case 35667:case 35671:return Nr;case 35668:case 35672:return zr;case 35669:case 35673:return Qr}}(t.type)}function na(e,t,n){this.id=e,this.addr=n,this.cache=[],this.size=t.size,this.setValue=function(e){switch(e){case 5126:return Gr;case 35664:return Xr;case 35665:return Yr;case 35666:return Kr;case 35674:return Zr;case 35675:return Jr;case 35676:return qr;case 35678:return $r;case 35680:return ea;case 5124:case 35670:return Hr;case 35667:case 35671:return Vr;case 35668:case 35672:return jr;case 35669:case 35673:return Wr}}(t.type)}function ia(e){this.id=e,this.seq=[],this.map={}}na.prototype.updateCache=function(e){var t=this.cache;e instanceof Float32Array&&t.length!==e.length&&(this.cache=new Float32Array(e.length)),Br(t,e)},ia.prototype.setValue=function(e,t,n){for(var i=this.seq,r=0,a=i.length;r!==a;++r){var o=i[r];o.setValue(e,t[o.id],n)}};var ra=/([\w\d_]+)(\])?(\[|\.)?/g;function aa(e,t){e.seq.push(t),e.map[t.id]=t}function oa(e,t,n){var i=e.name,r=i.length;for(ra.lastIndex=0;;){var a=ra.exec(i),o=ra.lastIndex,s=a[1],l="]"===a[2],A=a[3];if(l&&(s|=0),void 0===A||"["===A&&o+2===r){aa(n,void 0===A?new ta(s,e,t):new na(s,e,t));break}var c=n.map[s];void 0===c&&aa(n,c=new ia(s)),n=c}}function sa(e,t){this.seq=[],this.map={};for(var n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),i=0;i<n;++i){var r=e.getActiveUniform(t,i);oa(r,e.getUniformLocation(t,r.name),this)}}function la(e,t,n){var i=e.createShader(t);return e.shaderSource(i,n),e.compileShader(i),i}sa.prototype.setValue=function(e,t,n,i){var r=this.map[t];void 0!==r&&r.setValue(e,n,i)},sa.prototype.setOptional=function(e,t,n){var i=t[n];void 0!==i&&this.setValue(e,n,i)},sa.upload=function(e,t,n,i){for(var r=0,a=t.length;r!==a;++r){var o=t[r],s=n[o.id];!1!==s.needsUpdate&&o.setValue(e,s.value,i)}},sa.seqWithValue=function(e,t){for(var n=[],i=0,r=e.length;i!==r;++i){var a=e[i];a.id in t&&n.push(a)}return n};var Aa=0;function ca(e){switch(e){case Oe:return["Linear","( value )"];case Ne:return["sRGB","( value )"];case Qe:return["RGBE","( value )"];case Ge:return["RGBM","( value, 7.0 )"];case He:return["RGBM","( value, 16.0 )"];case Ve:return["RGBD","( value, 256.0 )"];case ze:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case 3003:return["LogLuv","( value )"];default:throw new Error("unsupported encoding: "+e)}}function ha(e,t,n){var i=e.getShaderParameter(t,e.COMPILE_STATUS),r=e.getShaderInfoLog(t).trim();return i&&""===r?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+r+function(e){for(var t=e.split("\n"),n=0;n<t.length;n++)t[n]=n+1+": "+t[n];return t.join("\n")}(e.getShaderSource(t))}function ua(e,t){var n=ca(t);return"vec4 "+e+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function da(e,t){var n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="Uncharted2";break;case 4:n="OptimizedCineon";break;case 5:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function fa(e){return""!==e}function pa(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function ma(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}var va=/^[ \t]*#include +<([\w\d./]+)>/gm;function ga(e){return e.replace(va,ya)}function ya(e,t){var n=Xi[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return ga(n)}var wa=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;function xa(e){return e.replace(wa,ba)}function ba(e,t,n,i){for(var r="",a=parseInt(t);a<parseInt(n);a++)r+=i.replace(/\[ i \]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return r}function Ma(e){var t="precision "+e.precision+" float;\nprecision "+e.precision+" int;";return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function Ca(e,t,n,i,r,a){var o,s,l,A,c,h=e.getContext(),u=i.defines,d=r.vertexShader,f=r.fragmentShader,p=function(e){var t="SHADOWMAP_TYPE_BASIC";return 1===e.shadowMapType?t="SHADOWMAP_TYPE_PCF":2===e.shadowMapType?t="SHADOWMAP_TYPE_PCF_SOFT":3===e.shadowMapType&&(t="SHADOWMAP_TYPE_VSM"),t}(a),m=function(e){var t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case N:case z:t="ENVMAP_TYPE_CUBE";break;case G:case H:t="ENVMAP_TYPE_CUBE_UV";break;case 303:case Q:t="ENVMAP_TYPE_EQUIREC";break;case 305:t="ENVMAP_TYPE_SPHERE"}return t}(a),v=function(e){var t="ENVMAP_MODE_REFLECTION";if(e.envMap)switch(e.envMapMode){case z:case Q:t="ENVMAP_MODE_REFRACTION"}return t}(a),g=function(e){var t="ENVMAP_BLENDING_MULTIPLY";if(e.envMap)switch(e.combine){case 0:t="ENVMAP_BLENDING_MULTIPLY";break;case 1:t="ENVMAP_BLENDING_MIX";break;case 2:t="ENVMAP_BLENDING_ADD"}return t}(a),y=e.gammaFactor>0?e.gammaFactor:1,w=a.isWebGL2?"":function(e,t,n){return[(e=e||{}).derivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||!t.vertexTangents?"#extension GL_OES_standard_derivatives : enable":"",(e.fragDepth||t.logarithmicDepthBuffer)&&n.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",e.drawBuffers&&n.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(e.shaderTextureLOD||t.envMap)&&n.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":"",n.get("OES_texture_half_float")?"#extension OES_texture_half_float : enable":""].filter(fa).join("\n")}(i.extensions,a,t),x=function(e){var t=[];for(var n in e){var i=e[n];!1!==i&&t.push("#define "+n+" "+i)}return t.join("\n")}(u),b=h.createProgram(),M=a.numMultiviewViews;if(i.isRawShaderMaterial?((o=[x].filter(fa).join("\n")).length>0&&(o+="\n"),(s=[w,x].filter(fa).join("\n")).length>0&&(s+="\n")):(o=[Ma(a),"#define SHADER_NAME "+r.name,x,a.instancing?"#define USE_INSTANCING":"",a.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+y,"#define MAX_BONES "+a.maxBones,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp2?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+v:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.normalMap&&a.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",a.normalMap&&a.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",a.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",a.displacementMap&&a.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.dissolveMap?"#define USE_DISSOLVE":"",a.vertexTangents?"#define USE_TANGENT":"",a.vertexColors?"#define USE_COLOR":"",a.vertexUvs?"#define USE_UV":"",a.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",a.flatShading?"#define FLAT_SHADED":"",a.skinning?"#define USE_SKINNING":"",a.useVertexTexture?"#define BONE_TEXTURE":"",a.morphTargets?"#define USE_MORPHTARGETS":"",a.morphNormals&&!1===a.flatShading?"#define USE_MORPHNORMALS":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+p:"",a.sizeAttenuation?"#define USE_SIZEATTENUATION":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&(a.isWebGL2||t.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",a.albedo?"#define USE_ALBEDO":"",1===a.albedoUV?"#define ALBEDO_UV2":"#define ALBEDO_UV1",a.normalMap2?"#define USE_NORMALMAP2":"",a.metallicMap?"#define USE_METALLICMAP":"",1===a.aoUV?"#define AO_UV2":"#define AO_UV1",1===a.emissiveUV?"#define EMISSIVE_UV2":"#define EMISSIVE_UV1",a.reflectMap?"#define USE_REFLECTMAP":"",a.boneNum>4?"#define BONE_8":"",a.boneNum>8?"#define BONE_12":"",a.boneNum>12?"#define BONE_16":"",a.ssrTexture?"#define USE_SSR":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#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","\n"].filter(fa).join("\n"),s=[w,Ma(a),"#define SHADER_NAME "+r.name,x,a.alphaTest?"#define ALPHATEST "+a.alphaTest+(a.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+y,a.useFog&&a.fog?"#define USE_FOG":"",a.useFog&&a.fogExp2?"#define FOG_EXP2":"",a.map?"#define USE_MAP":"",a.matcap?"#define USE_MATCAP":"",a.envMap?"#define USE_ENVMAP":"",a.envMap?"#define "+m:"",a.envMap?"#define "+v:"",a.envMap?"#define "+g:"",a.lightMap?"#define USE_LIGHTMAP":"",a.aoMap?"#define USE_AOMAP":"",a.emissiveMap?"#define USE_EMISSIVEMAP":"",a.bumpMap?"#define USE_BUMPMAP":"",a.normalMap?"#define USE_NORMALMAP":"",a.normalMap&&a.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",a.normalMap&&a.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",a.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",a.specularMap?"#define USE_SPECULARMAP":"",a.roughnessMap?"#define USE_ROUGHNESSMAP":"",a.metalnessMap?"#define USE_METALNESSMAP":"",a.alphaMap?"#define USE_ALPHAMAP":"",a.dissolveMap?"#define USE_DISSOLVE":"",a.sheen?"#define USE_SHEEN":"",a.vertexTangents?"#define USE_TANGENT":"",a.vertexColors?"#define USE_COLOR":"",a.vertexUvs?"#define USE_UV":"",a.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",a.gradientMap?"#define USE_GRADIENTMAP":"",a.flatShading?"#define FLAT_SHADED":"",a.doubleSided?"#define DOUBLE_SIDED":"",a.flipSided?"#define FLIP_SIDED":"",a.shadowMapEnabled?"#define USE_SHADOWMAP":"",a.shadowMapEnabled?"#define "+p:"",a.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",a.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",a.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",a.logarithmicDepthBuffer&&(a.isWebGL2||t.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",(i.extensions&&i.extensions.shaderTextureLOD||a.envMap||a.reflectMap)&&(a.isWebGL2||t.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform mat4 viewMatrixR;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==a.toneMapping?"#define TONE_MAPPING":"",0!==a.toneMapping?Xi.tonemapping_pars_fragment:"",0!==a.toneMapping?da("toneMapping",a.toneMapping):"",a.dithering?"#define DITHERING":"",a.outputEncoding||a.mapEncoding||a.matcapEncoding||a.envMapEncoding||a.emissiveMapEncoding?Xi.encodings_pars_fragment:"",a.mapEncoding?ua("mapTexelToLinear",a.mapEncoding):"",a.matcapEncoding?ua("matcapTexelToLinear",a.matcapEncoding):"",a.envMapEncoding?ua("envMapTexelToLinear",a.envMapEncoding):"",a.emissiveMapEncoding?ua("emissiveMapTexelToLinear",a.emissiveMapEncoding):"",a.outputEncoding?(l="linearToOutputTexel",A=a.outputEncoding,c=ca(A),"vec4 "+l+"( vec4 value ) { return LinearTo"+c[0]+c[1]+"; }"):"",a.albedoEncoding?ua("albedoTexelToLinear",a.albedoEncoding):"",a.normalMapEncoding?ua("normalMapTexelToLinear",a.normalMapEncoding):"",a.normalMap2Encoding?ua("normalMap2TexelToLinear",a.normalMap2Encoding):"",a.metallicMapEncoding?ua("metallicMapTexelToLinear",a.metallicMapEncoding):"",a.roughnessMapEncoding?ua("roughnessMapTexelToLinear",a.roughnessMapEncoding):"",a.aoMapEncoding?ua("aoMapTexelToLinear",a.aoMapEncoding):"",a.reflectMapEncoding?ua("reflectMapTexelToLinear",a.reflectMapEncoding):"",a.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"",a.albedo?"#define USE_ALBEDO":"",1===a.albedoUV?"#define ALBEDO_UV2":"#define ALBEDO_UV1",a.normalMap2?"#define USE_NORMALMAP2":"",a.metallicMap?"#define USE_METALLICMAP":"",1===a.aoUV?"#define AO_UV2":"#define AO_UV1",1===a.emissiveUV?"#define EMISSIVE_UV2":"#define EMISSIVE_UV1",a.reflectMap?"#define USE_REFLECTMAP":"",a.reflectMapUV?"#define USE_REFLECTMAP_UV":"",a.transparency?"#define TRANSPARENCY":"",a.ssrTexture?"#define USE_SSR":"","\n"].filter(fa).join("\n")),d=ma(d=pa(d=ga(d),a),a),f=ma(f=pa(f=ga(f),a),a),d=xa(d),f=xa(f),a.isWebGL2&&!i.isRawShaderMaterial){var C=!1,B=/^\s*#version\s+300\s+es\s*\n/;i.isShaderMaterial&&null!==d.match(B)&&null!==f.match(B)&&(C=!0,d=d.replace(B,""),f=f.replace(B,"")),o=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+o,s=["#version 300 es\n","#define varying in",C?"":"out highp vec4 pc_fragColor;",C?"":"#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"+s,M>0&&(o=(o=o.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","layout(num_views = "+M+") in;","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace(["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;"].join("\n"),["uniform mat4 modelViewMatrices["+M+"];","uniform mat4 projectionMatrices["+M+"];","uniform mat4 viewMatrices["+M+"];","uniform mat3 normalMatrices["+M+"];","#define modelViewMatrix modelViewMatrices[VIEW_ID]","#define projectionMatrix projectionMatrices[VIEW_ID]","#define viewMatrix viewMatrices[VIEW_ID]","#define normalMatrix normalMatrices[VIEW_ID]"].join("\n")),s=(s=s.replace("#version 300 es\n",["#version 300 es\n","#extension GL_OVR_multiview2 : require","#define VIEW_ID gl_ViewID_OVR"].join("\n"))).replace("uniform mat4 viewMatrix;",["uniform mat4 viewMatrices["+M+"];","#define viewMatrix viewMatrices[VIEW_ID]"].join("\n")))}var E,S,T=o+d,_=s+f,I=la(h,h.VERTEX_SHADER,T),L=la(h,h.FRAGMENT_SHADER,_);if(h.attachShader(b,I),h.attachShader(b,L),void 0!==i.index0AttributeName?h.bindAttribLocation(b,0,i.index0AttributeName):!0===a.morphTargets&&h.bindAttribLocation(b,0,"position"),h.linkProgram(b),e.debug.checkShaderErrors){var F=h.getProgramInfoLog(b).trim(),k=h.getShaderInfoLog(I).trim(),P=h.getShaderInfoLog(L).trim(),U=!0,D=!0;if(!1===h.getProgramParameter(b,h.LINK_STATUS)){U=!1;var R=ha(h,I,"vertex"),O=ha(h,L,"fragment");console.error("WebGLProgram: shader error: ",h.getError(),"gl.VALIDATE_STATUS",h.getProgramParameter(b,h.VALIDATE_STATUS),"gl.getProgramInfoLog",F,R,O)}else""!==F?console.warn("WebGLProgram: gl.getProgramInfoLog()",F):""!==k&&""!==P||(D=!1);D&&(this.diagnostics={runnable:U,material:i,programLog:F,vertexShader:{log:k,prefix:o},fragmentShader:{log:P,prefix:s}})}return h.deleteShader(I),h.deleteShader(L),this.getUniforms=function(){return void 0===E&&(E=new sa(h,b)),E},this.getAttributes=function(){return void 0===S&&(S=function(e,t){for(var n={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),r=0;r<i;r++){var a=e.getActiveAttrib(t,r).name;n[a]=e.getAttribLocation(t,a)}return n}(h,b)),S},this.destroy=function(){h.deleteProgram(b),this.program=void 0},this.name=r.name,this.id=Aa++,this.cacheKey=n,this.usedTimes=1,this.program=b,this.vertexShader=I,this.fragmentShader=L,this.numMultiviewViews=M,this}function Ba(e,t,n){var i=[],r=n.isWebGL2,a=n.logarithmicDepthBuffer,o=n.floatVertexTextures,s=n.precision,l=n.maxVertexUniforms,A=n.vertexTextures,c={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite",AMRTBasicMaterial:"amrtbasic",ACFBasicMaterial:"acf",AMRTShadowMaterial:"amrtshadow"},h=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","numMultiviewViews","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","albedo","albedoEncoding","albedoUV","normalMap2","metallicMap","aoUV","emissiveUV","reflectMap","reflectMapUV","reflectMapEncoding","normalMapEncoding","normalMap2Encoding","metallicMapEncoding","roughnessMapEncoding","aoMapEncoding","transparency","boneNum","dissolveMap","dissolveRatio","ssrTexture"];function u(e,t){var n;return e?e.isTexture?n=e.encoding:e.isWebGLRenderTarget&&(console.warn("WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=e.texture.encoding):n=Oe,n===Oe&&t&&(n=ze),n}this.getParameters=function(t,i,h,d,f,p,m){var v=c[t.type],g=m.isSkinnedMesh?function(e){var t=e.skeleton.bones;if(o)return 1024;var n=l,i=Math.floor((n-20)/4),r=Math.min(i,t.length);return r<t.length?(console.warn("WebGLRenderer: Skeleton has "+t.length+" bones. This GPU supports "+r+"."),0):r}(m):0,y=m.boneNum?m.boneNum:0;null!==t.precision&&(s=n.getMaxPrecision(t.precision))!==t.precision&&console.warn("WebGLProgram.getParameters:",t.precision,"not supported, using",s,"instead.");var w=e.getRenderTarget(),x=w&&w.isWebGLMultiviewRenderTarget?w.numViews:0;return{isWebGL2:r,shaderID:v,precision:s,instancing:!0===m.isInstancedMesh,supportsVertexTextures:A,numMultiviewViews:x,outputEncoding:u(w?w.texture:null,e.gammaOutput),map:!!t.map,mapEncoding:u(t.map,e.gammaInput),matcap:!!t.matcap,matcapEncoding:u(t.matcap,e.gammaInput),envMap:!!t.envMap,envMapMode:t.envMap&&t.envMap.mapping,envMapEncoding:u(t.envMap,e.gammaInput),envMapCubeUV:!!t.envMap&&(t.envMap.mapping===G||t.envMap.mapping===H),lightMap:!!t.lightMap,aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:u(t.emissiveMap,e.gammaInput),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,objectSpaceNormalMap:1===t.normalMapType,tangentSpaceNormalMap:0===t.normalMapType,clearcoatNormalMap:!!t.clearcoatNormalMap,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,sheen:!!t.sheen,combine:t.combine,vertexTangents:t.normalMap&&t.vertexTangents,vertexColors:t.vertexColors,vertexUvs:!!(t.map||t.bumpMap||t.normalMap||t.specularMap||t.alphaMap||t.emissiveMap||t.roughnessMap||t.metalnessMap||t.clearcoatNormalMap||t.displacementMap),uvsVertexOnly:!(t.map||t.bumpMap||t.normalMap||t.specularMap||t.alphaMap||t.emissiveMap||t.roughnessMap||t.metalnessMap||t.clearcoatNormalMap||!t.displacementMap),fog:!!d,useFog:t.fog,fogExp2:d&&d.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:a,skinning:t.skinning&&g>0,maxBones:g,useVertexTexture:o,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:i.directional.length,numPointLights:i.point.length,numSpotLights:i.spot.length,numRectAreaLights:i.rectArea.length,numHemiLights:i.hemi.length,numDirLightShadows:i.directionalShadowMap.length,numPointLightShadows:i.pointShadowMap.length,numSpotLightShadows:i.spotShadowMap.length,numClippingPlanes:f,numClipIntersection:p,dithering:t.dithering,shadowMapEnabled:e.shadowMap.enabled&&h.length>0,shadowMapType:e.shadowMap.type,toneMapping:t.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:2===t.side,flipSided:1===t.side,depthPacking:void 0!==t.depthPacking&&t.depthPacking,albedo:!!t.albedo,albedoUV:t.albedoUV,normalMap2:!!t.normalMap2,metallicMap:!!t.metallicMap,aoUV:t.aoUV,emissiveUV:t.emissiveUV,reflectMap:!!t.reflectMap,reflectMapUV:!!t.reflectMap&&!t.reflectMap.isCubeTexture,aoMapEncoding:u(t.aoMap,e.gammaInput),roughnessMapEncoding:u(t.roughnessMap,e.gammaInput),metallicMapEncoding:u(t.metallicMap,e.gammaInput),normalMapEncoding:u(t.normalMap,e.gammaInput),normalMap2Encoding:u(t.normalMap2,e.gammaInput),albedoEncoding:u(t.albedo,e.gammaInput),reflectMapEncoding:u(t.reflectMap,e.gammaInput),transparency:void 0!==t.transparency&&t.transparency>0,boneNum:y,dissolveMap:!!t.dissolveMap,dissolveRatio:t.dissolveRatio,ssrTexture:!!t.ssrTexture}},this.getProgramCacheKey=function(t,n){var i=[];if(n.shaderID?i.push(n.shaderID):(i.push(t.fragmentShader),i.push(t.vertexShader)),void 0!==t.defines)for(var r in t.defines)i.push(r),i.push(t.defines[r]);for(var a=0;a<h.length;a++)i.push(n[h[a]]);return i.push(t.onBeforeCompile.toString()),i.push(e.gammaOutput),i.push(e.gammaFactor),i.join()},this.acquireProgram=function(n,r,a,o){for(var s,l=0,A=i.length;l<A;l++){var c=i[l];if(c.cacheKey===o){++(s=c).usedTimes;break}}return void 0===s&&(s=new Ca(e,t,o,n,r,a),i.push(s)),s},this.releaseProgram=function(e){if(0==--e.usedTimes){var t=i.indexOf(e);i[t]=i[i.length-1],i.pop(),e.destroy()}},this.programs=i}function Ea(){var e=new WeakMap;return{get:function(t){var n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,i){e.get(t)[n]=i},dispose:function(){e=new WeakMap}}}function Sa(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.program!==t.program?e.program.id-t.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function Ta(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function _a(){var e=[],t=0,n=[],i=[],r={id:-1};function a(n,i,a,o,s,l){var A=e[t];return void 0===A?(A={id:n.id,object:n,geometry:i,material:a,program:a.program||r,groupOrder:o,renderOrder:n.renderOrder,z:s,group:l},e[t]=A):(A.id=n.id,A.object=n,A.geometry=i,A.material=a,A.program=a.program||r,A.groupOrder=o,A.renderOrder=n.renderOrder,A.z=s,A.group=l),t++,A}return{opaque:n,transparent:i,init:function(){t=0,n.length=0,i.length=0},push:function(e,t,r,o,s,l){var A=a(e,t,r,o,s,l);(!0===r.transparent?i:n).push(A)},unshift:function(e,t,r,o,s,l){var A=a(e,t,r,o,s,l);(!0===r.transparent?i:n).unshift(A)},sort:function(){n.length>1&&n.sort(Sa),i.length>1&&i.sort(Ta)}}}function Ia(){var e=new WeakMap;function t(n){var i=n.target;i.removeEventListener("dispose",t),e.delete(i)}return{get:function(n,i){var r,a=e.get(n);return void 0===a?(r=new _a,e.set(n,new WeakMap),e.get(n).set(i,r),n.addEventListener("dispose",t)):void 0===(r=a.get(i))&&(r=new _a,a.set(i,r)),r},dispose:function(){e=new WeakMap}}}function La(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var n;switch(t.type){case"DirectionalLight":n={direction:new at,color:new Fn,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new tt};break;case"SpotLight":n={position:new at,direction:new at,color:new Fn,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new tt};break;case"PointLight":n={position:new at,color:new Fn,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new tt,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":n={direction:new at,skyColor:new Fn,groundColor:new Fn};break;case"RectAreaLight":n={color:new Fn,position:new at,halfWidth:new at,halfHeight:new at}}return e[t.id]=n,n}}}var Fa=0;function ka(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function Pa(){for(var e=new La,t={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:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},n=0;n<9;n++)t.probe.push(new at);var i=new at,r=new bt,a=new bt;return{setup:function(n,o,s){for(var l=0,A=0,c=0,h=0;h<9;h++)t.probe[h].set(0,0,0);var u=0,d=0,f=0,p=0,m=0,v=0,g=0,y=0,w=s.matrixWorldInverse;n.sort(ka),h=0;for(var x=n.length;h<x;h++){var b=n[h],M=b.color,C=b.intensity,B=b.distance,E=b.shadow&&b.shadow.map?b.shadow.map.texture:null;if(b.isAmbientLight)l+=M.r*C,A+=M.g*C,c+=M.b*C;else if(b.isLightProbe)for(var S=0;S<9;S++)t.probe[S].addScaledVector(b.sh.coefficients[S],C);else if(b.isDirectionalLight){if((_=e.get(b)).color.copy(b.color).multiplyScalar(b.intensity),_.direction.setFromMatrixPosition(b.matrixWorld),i.setFromMatrixPosition(b.target.matrixWorld),_.direction.sub(i),_.direction.transformDirection(w),_.shadow=b.castShadow,b.castShadow){var T=b.shadow;_.shadowBias=T.bias,_.shadowRadius=T.radius,_.shadowMapSize=T.mapSize,t.directionalShadowMap[u]=E,t.directionalShadowMatrix[u]=b.shadow.matrix,v++}t.directional[u]=_,u++}else if(b.isSpotLight){if((_=e.get(b)).position.setFromMatrixPosition(b.matrixWorld),_.position.applyMatrix4(w),_.color.copy(M).multiplyScalar(C),_.distance=B,_.direction.setFromMatrixPosition(b.matrixWorld),i.setFromMatrixPosition(b.target.matrixWorld),_.direction.sub(i),_.direction.transformDirection(w),_.coneCos=Math.cos(b.angle),_.penumbraCos=Math.cos(b.angle*(1-b.penumbra)),_.decay=b.decay,_.shadow=b.castShadow,b.castShadow){T=b.shadow;_.shadowBias=T.bias,_.shadowRadius=T.radius,_.shadowMapSize=T.mapSize,t.spotShadowMap[f]=E,t.spotShadowMatrix[f]=b.shadow.matrix,y++}t.spot[f]=_,f++}else if(b.isRectAreaLight){(_=e.get(b)).color.copy(M).multiplyScalar(C),_.position.setFromMatrixPosition(b.matrixWorld),_.position.applyMatrix4(w),a.identity(),r.copy(b.matrixWorld),r.premultiply(w),a.extractRotation(r),_.halfWidth.set(.5*b.width,0,0),_.halfHeight.set(0,.5*b.height,0),_.halfWidth.applyMatrix4(a),_.halfHeight.applyMatrix4(a),t.rectArea[p]=_,p++}else if(b.isPointLight){if((_=e.get(b)).position.setFromMatrixPosition(b.matrixWorld),_.position.applyMatrix4(w),_.color.copy(b.color).multiplyScalar(b.intensity),_.distance=b.distance,_.decay=b.decay,_.shadow=b.castShadow,b.castShadow){T=b.shadow;_.shadowBias=T.bias,_.shadowRadius=T.radius,_.shadowMapSize=T.mapSize,_.shadowCameraNear=T.camera.near,_.shadowCameraFar=T.camera.far,t.pointShadowMap[d]=E,t.pointShadowMatrix[d]=b.shadow.matrix,g++}t.point[d]=_,d++}else if(b.isHemisphereLight){var _;(_=e.get(b)).direction.setFromMatrixPosition(b.matrixWorld),_.direction.transformDirection(w),_.direction.normalize(),_.skyColor.copy(b.color).multiplyScalar(C),_.groundColor.copy(b.groundColor).multiplyScalar(C),t.hemi[m]=_,m++}}t.ambient[0]=l,t.ambient[1]=A,t.ambient[2]=c;var I=t.hash;I.directionalLength===u&&I.pointLength===d&&I.spotLength===f&&I.rectAreaLength===p&&I.hemiLength===m&&I.numDirectionalShadows===v&&I.numPointShadows===g&&I.numSpotShadows===y||(t.directional.length=u,t.spot.length=f,t.rectArea.length=p,t.point.length=d,t.hemi.length=m,t.directionalShadowMap.length=v,t.pointShadowMap.length=g,t.spotShadowMap.length=y,t.directionalShadowMatrix.length=v,t.pointShadowMatrix.length=g,t.spotShadowMatrix.length=y,I.directionalLength=u,I.pointLength=d,I.spotLength=f,I.rectAreaLength=p,I.hemiLength=m,I.numDirectionalShadows=v,I.numPointShadows=g,I.numSpotShadows=y,t.version=Fa++)},state:t}}function Ua(){var e=new Pa,t=[],n=[];return{init:function(){t.length=0,n.length=0},state:{lightsArray:t,shadowsArray:n,lights:e},setupLights:function(i){e.setup(t,n,i)},pushLight:function(e){t.push(e)},pushShadow:function(e){n.push(e)}}}function Da(){var e=new WeakMap;function t(n){var i=n.target;i.removeEventListener("dispose",t),e.delete(i)}return{get:function(n,i){var r;return!1===e.has(n)?(r=new Ua,e.set(n,new WeakMap),e.get(n).set(i,r),n.addEventListener("dispose",t)):!1===e.get(n).has(i)?(r=new Ua,e.get(n).set(i,r)):r=e.get(n).get(i),r},dispose:function(){e=new WeakMap}}}function Ra(e){On.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(e)}function Oa(e){On.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new at,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(e)}Ra.prototype=Object.create(On.prototype),Ra.prototype.constructor=Ra,Ra.prototype.isMeshDepthMaterial=!0,Ra.prototype.copy=function(e){return On.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},Oa.prototype=Object.create(On.prototype),Oa.prototype.constructor=Oa,Oa.prototype.isMeshDistanceMaterial=!0,Oa.prototype.copy=function(e){return On.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this};function Na(e,t,n){var i=new Wi,r=new tt,a=new tt,o=new ut,s=[],l=[],A={},c={0:1,1:0,2:2},h=new Ri({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new tt},radius:{value:4}},vertexShader:"\n\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}\n\n",fragmentShader:"\nuniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n\n#include <packing>\n\nvoid main() {\n\n float mean = 0.0;\n float squared_mean = 0.0;\n\n\t// This seems totally useless but it's a crazy work around for a Adreno compiler bug\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\n #ifdef HORIZONAL_PASS\n\n vec2 distribution = unpack2HalfToRGBA ( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\n #else\n\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n\n #endif\n\n }\n\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n\n float std_dev = sqrt( squared_mean - mean * mean );\n\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n\n}\n"}),u=h.clone();u.defines.HORIZONAL_PASS=1;var d=new si;d.setAttribute("position",new zn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));var f=new Ei(d,h),p=this;function m(n,i){var r=t.update(f);h.uniforms.shadow_pass.value=n.map.texture,h.uniforms.resolution.value=n.mapSize,h.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(i,null,r,h,f,null),u.uniforms.shadow_pass.value=n.mapPass.texture,u.uniforms.resolution.value=n.mapSize,u.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(i,null,r,u,f,null)}function v(e,t,n){var i=e<<0|t<<1|n<<2,r=s[i];return void 0===r&&(r=new Ra({depthPacking:je,morphTargets:e,skinning:t}),s[i]=r),r}function g(e,t,n){var i=e<<0|t<<1|n<<2,r=l[i];return void 0===r&&(r=new Oa({morphTargets:e,skinning:t}),l[i]=r),r}function y(t,n,i,r,a,o){var s=t.geometry,l=null,h=v,u=t.customDepthMaterial;if(!0===i.isPointLight&&(h=g,u=t.customDistanceMaterial),void 0===u){var d=!1;!0===n.morphTargets&&(!0===s.isBufferGeometry?d=s.morphAttributes&&s.morphAttributes.position&&s.morphAttributes.position.length>0:!0===s.isGeometry&&(d=s.morphTargets&&s.morphTargets.length>0));var f=!1;!0===t.isSkinnedMesh&&!0===n.skinning&&(f=!0),l=h(d,f,!0===t.isInstancedMesh)}else l=u;if(e.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){var p=l.uuid,m=n.uuid,y=A[p];void 0===y&&(y={},A[p]=y);var w=y[m];void 0===w&&(w=l.clone(),y[m]=w),l=w}return l.visible=n.visible,l.wireframe=n.wireframe,l.side=3===o?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:c[n.side],l.clipShadows=n.clipShadows,l.clippingPlanes=n.clippingPlanes,l.clipIntersection=n.clipIntersection,l.wireframeLinewidth=n.wireframeLinewidth,l.linewidth=n.linewidth,!0===i.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(i.matrixWorld),l.nearDistance=r,l.farDistance=a),l}function w(n,r,a,o,s){if(!1!==n.visible){if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);var l=t.update(n),A=n.material;if(Array.isArray(A))for(var c=l.groups,h=0,u=c.length;h<u;h++){var d=c[h],f=A[d.materialIndex];if(f&&f.visible){var p=y(n,f,o,a.near,a.far,s);e.renderBufferDirect(a,null,l,p,n,d)}}else if(A.visible){p=y(n,A,o,a.near,a.far,s);e.renderBufferDirect(a,null,l,p,n,null)}}for(var m=n.children,v=0,g=m.length;v<g;v++)w(m[v],r,a,o,s)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.render=function(t,s,l){if(!1!==p.enabled&&(!1!==p.autoUpdate||!1!==p.needsUpdate)&&0!==t.length){var A=e.getRenderTarget(),c=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),u=e.state;u.setBlending(0),u.buffers.color.setClear(1,1,1,1),u.buffers.depth.setTest(!0),u.setScissorTest(!1);for(var d=0,f=t.length;d<f;d++){var v=t[d],g=v.shadow;if(void 0!==g){r.copy(g.mapSize);var y=g.getFrameExtents();if(r.multiply(y),a.copy(g.mapSize),(r.x>n||r.y>n)&&(console.warn("WebGLShadowMap:",v,"has shadow exceeding max texture size, reducing"),r.x>n&&(a.x=Math.floor(n/y.x),r.x=a.x*y.x,g.mapSize.x=a.x),r.y>n&&(a.y=Math.floor(n/y.y),r.y=a.y*y.y,g.mapSize.y=a.y)),null===g.map&&!g.isPointLightShadow&&3===this.type){var x={minFilter:Z,magFilter:Z,format:ce};g.map=new dt(r.x,r.y,x),g.map.texture.name=v.name+".shadowMap",g.mapPass=new dt(r.x,r.y,x),g.camera.updateProjectionMatrix()}if(null===g.map){x={minFilter:X,magFilter:X,format:ce};g.map=new dt(r.x,r.y,x),g.map.texture.name=v.name+".shadowMap",g.camera.updateProjectionMatrix()}e.setRenderTarget(g.map),e.clear();for(var b=g.getViewportCount(),M=0;M<b;M++){var C=g.getViewport(M);o.set(a.x*C.x,a.y*C.y,a.x*C.z,a.y*C.w),u.viewport(o),g.updateMatrices(v,M),i=g.getFrustum(),w(s,l,g.camera,v,this.type)}g.isPointLightShadow||3!==this.type||m(g,l)}else console.warn("WebGLShadowMap:",v,"has no shadow.")}p.needsUpdate=!1,e.setRenderTarget(A,c,h)}}}function za(e,t,n){var i,r,a=n.isWebGL2;var o=new function(){var t=!1,n=new ut,i=null,r=new ut(0,0,0,0);return{setMask:function(n){i===n||t||(e.colorMask(n,n,n,n),i=n)},setLocked:function(e){t=e},setClear:function(t,i,a,o,s){!0===s&&(t*=o,i*=o,a*=o),n.set(t,i,a,o),!1===r.equals(n)&&(e.clearColor(t,i,a,o),r.copy(n))},reset:function(){t=!1,i=null,r.set(-1,0,0,0)}}},s=new function(){var t=!1,n=null,i=null,r=null;return{setTest:function(t){t?K(e.DEPTH_TEST):Z(e.DEPTH_TEST)},setMask:function(i){n===i||t||(e.depthMask(i),n=i)},setFunc:function(t){if(i!==t){if(t)switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:default:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL)}else e.depthFunc(e.LEQUAL);i=t}},setLocked:function(e){t=e},setClear:function(t){r!==t&&(e.clearDepth(t),r=t)},reset:function(){t=!1,n=null,i=null,r=null}}},l=new function(){var t=!1,n=null,i=null,r=null,a=null,o=null,s=null,l=null,A=null;return{setTest:function(n){t||(n?K(e.STENCIL_TEST):Z(e.STENCIL_TEST))},setMask:function(i){n===i||t||(e.stencilMask(i),n=i)},setFunc:function(t,n,o){i===t&&r===n&&a===o||(e.stencilFunc(t,n,o),i=t,r=n,a=o)},setOp:function(t,n,i){o===t&&s===n&&l===i||(e.stencilOp(t,n,i),o=t,s=n,l=i)},setLocked:function(e){t=e},setClear:function(t){A!==t&&(e.clearStencil(t),A=t)},reset:function(){t=!1,n=null,i=null,r=null,a=null,o=null,s=null,l=null,A=null}}},A=e.getParameter(e.MAX_VERTEX_ATTRIBS),h=new Uint8Array(A),u=new Uint8Array(A),d=new Uint8Array(A),f={},p=null,m=null,v=null,g=null,y=null,w=null,x=null,b=null,M=null,C=!1,B=null,E=null,S=null,T=null,_=null,O=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),N=!1,z=0,Q=e.getParameter(e.VERSION);-1!==Q.indexOf("WebGL")?(z=parseFloat(/^WebGL\ ([0-9])/.exec(Q)[1]),N=z>=1):-1!==Q.indexOf("OpenGL ES")&&(z=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(Q)[1]),N=z>=2);var G=null,H={},V=new ut,j=new ut;function W(t,n,i){var r=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(var o=0;o<i;o++)e.texImage2D(n+o,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,r);return a}var X={};function Y(n,i){(h[n]=1,0===u[n]&&(e.enableVertexAttribArray(n),u[n]=1),d[n]!==i)&&((a?e:t.get("ANGLE_instanced_arrays"))[a?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,i),d[n]=i)}function K(t){!0!==f[t]&&(e.enable(t),f[t]=!0)}function Z(t){!1!==f[t]&&(e.disable(t),f[t]=!1)}X[e.TEXTURE_2D]=W(e.TEXTURE_2D,e.TEXTURE_2D,1),X[e.TEXTURE_CUBE_MAP]=W(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),o.setClear(0,0,0,1),s.setClear(1),l.setClear(0),K(e.DEPTH_TEST),s.setFunc(3),te(!1),ne(1),K(e.CULL_FACE),ee(0);var J=(c(i={},I,e.FUNC_ADD),c(i,101,e.FUNC_SUBTRACT),c(i,102,e.FUNC_REVERSE_SUBTRACT),i);if(a)J[103]=e.MIN,J[104]=e.MAX;else{var q=t.get("EXT_blend_minmax");q&&null!==q&&(J[103]=q.MIN_EXT,J[104]=q.MAX_EXT)}var $=(c(r={},L,e.ZERO),c(r,F,e.ONE),c(r,k,e.SRC_COLOR),c(r,P,e.SRC_ALPHA),c(r,210,e.SRC_ALPHA_SATURATE),c(r,R,e.DST_COLOR),c(r,D,e.DST_ALPHA),c(r,203,e.ONE_MINUS_SRC_COLOR),c(r,U,e.ONE_MINUS_SRC_ALPHA),c(r,209,e.ONE_MINUS_DST_COLOR),c(r,207,e.ONE_MINUS_DST_ALPHA),r);function ee(t,n,i,r,a,o,s,l){if(0!==t){if(m||(K(e.BLEND),m=!0),5===t)a=a||n,o=o||i,s=s||r,n===g&&a===x||(e.blendEquationSeparate(J[n],J[a]),g=n,x=a),i===y&&r===w&&o===b&&s===M||(e.blendFuncSeparate($[i],$[r],$[o],$[s]),y=i,w=r,b=o,M=s),v=t,C=null;else if(t!==v||l!==C){if(g===I&&x===I||(e.blendEquation(e.FUNC_ADD),g=I,x=I),l)switch(t){case 1:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.ONE,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ONE_MINUS_SRC_ALPHA);break;case 4:e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA);break;default:console.error("WebGLState: Invalid blending: ",t)}else switch(t){case 1:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.SRC_ALPHA,e.ONE);break;case 3:e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_COLOR);break;case 4:e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:console.error("WebGLState: Invalid blending: ",t)}y=null,w=null,b=null,M=null,v=t,C=l}}else m&&(Z(e.BLEND),m=!1)}function te(t){B!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),B=t)}function ne(t){0!==t?(K(e.CULL_FACE),t!==E&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):Z(e.CULL_FACE),E=t}function ie(t,n,i){t?(K(e.POLYGON_OFFSET_FILL),T===n&&_===i||(e.polygonOffset(n,i),T=n,_=i)):Z(e.POLYGON_OFFSET_FILL)}function re(t){void 0===t&&(t=e.TEXTURE0+O-1),G!==t&&(e.activeTexture(t),G=t)}return{buffers:{color:o,depth:s,stencil:l},initAttributes:function(){for(var e=0,t=h.length;e<t;e++)h[e]=0},enableAttribute:function(e){Y(e,0)},enableAttributeAndDivisor:Y,disableUnusedAttributes:function(){for(var t=0,n=u.length;t!==n;++t)u[t]!==h[t]&&(e.disableVertexAttribArray(t),u[t]=0)},enable:K,disable:Z,useProgram:function(t){return p!==t&&(e.useProgram(t),p=t,!0)},setBlending:ee,setMaterial:function(t,n){2===t.side?Z(e.CULL_FACE):K(e.CULL_FACE);var i=1===t.side;n&&(i=!i),te(i),1===t.blending&&!1===t.transparent?ee(0):ee(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),s.setFunc(t.depthFunc),s.setTest(t.depthTest),s.setMask(t.depthWrite),o.setMask(t.colorWrite);var r=t.stencilWrite;l.setTest(r),r&&(l.setMask(t.stencilWriteMask),l.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),l.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),ie(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:te,setCullFace:ne,setLineWidth:function(t){t!==S&&(N&&e.lineWidth(t),S=t)},setPolygonOffset:ie,setScissorTest:function(t){t?K(e.SCISSOR_TEST):Z(e.SCISSOR_TEST)},activeTexture:re,bindTexture:function(t,n){null===G&&re();var i=H[G];void 0===i&&(i={type:void 0,texture:void 0},H[G]=i),i.type===t&&i.texture===n||(e.bindTexture(t,n||X[t]),i.type=t,i.texture=n)},unbindTexture:function(){var t=H[G];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error("WebGLState:",e)}},texImage2D:function(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error("WebGLState:",e)}},texImage3D:function(){try{e.texImage3D.apply(e,arguments)}catch(e){console.error("WebGLState:",e)}},scissor:function(t){!1===V.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),V.copy(t))},viewport:function(t){!1===j.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),j.copy(t))},reset:function(){for(var t=0;t<u.length;t++)1===u[t]&&(e.disableVertexAttribArray(t),u[t]=0);f={},G=null,H={},p=null,v=null,B=null,E=null,o.reset(),s.reset(),l.reset()}}}function Qa(e,t,n,i,r,a,o){var s,l,A,h=r.isWebGL2,u=r.maxTextures,d=r.maxCubemapSize,f=r.maxTextureSize,p=r.maxSamples,m=new WeakMap,v="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d");function g(e,t){return v?new OffscreenCanvas(e,t):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function y(e,t,n,i){var r=1;if((e.width>i||e.height>i)&&(r=i/Math.max(e.width,e.height)),r<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){var a=t?et.floorPowerOfTwo:Math.floor,o=a(r*e.width),s=a(r*e.height);void 0===A&&(A=g(o,s));var l=n?g(o,s):A;return l.width=o,l.height=s,l.getContext("2d").drawImage(e,0,0,o,s),console.warn("Texture has been resized from ("+e.width+"x"+e.height+") to ("+o+"x"+s+")."),l}return"data"in e&&console.warn("Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function w(e){return et.isPowerOfTwo(e.width)&&et.isPowerOfTwo(e.height)}function x(e,t){return e.generateMipmaps&&t&&e.minFilter!==X&&e.minFilter!==Z}function b(t,n,r,a){e.generateMipmap(t),i.get(n).__maxMipLevel=Math.log(Math.max(r,a))*Math.LOG2E}function M(n,i){if(!1===h)return n;var r=n;return n===e.RED&&(i===e.FLOAT&&(r=e.R32F),i===e.HALF_FLOAT&&(r=e.R16F),i===e.UNSIGNED_BYTE&&(r=e.R8)),n===e.RGB&&(i===e.FLOAT&&(r=e.RGB32F),i===e.HALF_FLOAT&&(r=e.RGB16F),i===e.UNSIGNED_BYTE&&(r=e.RGB8)),n===e.RGBA&&(i===e.FLOAT&&(r=e.RGBA32F),i===e.HALF_FLOAT&&(r=e.RGBA16F),i===e.UNSIGNED_BYTE&&(r=e.RGBA8)),r===e.R16F||r===e.R32F||r===e.RGBA16F||r===e.RGBA32F?t.get("EXT_color_buffer_float"):r!==e.RGB16F&&r!==e.RGB32F||console.warn("Floating point textures with RGB format not supported. Please use RGBA instead."),r}function C(t){return t===X||t===Y||t===K?e.NEAREST:e.LINEAR}function B(t){var n=t.target;n.removeEventListener("dispose",B),function(t){var n=i.get(t);if(void 0===n.__webglInit)return;e.deleteTexture(n.__webglTexture),i.remove(t)}(n),n.isVideoTexture&&m.delete(n),o.memory.textures--}function E(t){var n=t.target;n.removeEventListener("dispose",E),function(t){var n=i.get(t),r=i.get(t.texture);if(!t)return;void 0!==r.__webglTexture&&e.deleteTexture(r.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLRenderTargetCube)for(var a=0;a<6;a++)e.deleteFramebuffer(n.__webglFramebuffer[a]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[a]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer);if(t.isWebGLMultiviewRenderTarget){e.deleteTexture(n.__webglColorTexture),e.deleteTexture(n.__webglDepthStencilTexture),o.memory.textures-=2;a=0;for(var s=n.__webglViewFramebuffers.length;a<s;a++)e.deleteFramebuffer(n.__webglViewFramebuffers[a])}i.remove(t.texture),i.remove(t)}(n),o.memory.textures--}var S=0;function T(t,r){var a=i.get(t);if(t.isVideoTexture&&function(e){var t=o.render.frame;m.get(e)!==t&&(m.set(e,t),e.update())}(t),t.version>0&&a.__version!==t.version){var s=t.image;if(void 0===s)console.warn("Texture marked for update but image is undefined");else if(!1!==s.complete)return void U(a,t,r)}n.activeTexture(e.TEXTURE0+r),n.bindTexture(e.TEXTURE_2D,a.__webglTexture)}function _(t,r){if(6===t.image.length){var o=i.get(t);if(t.version>0&&o.__version!==t.version){P(o,t),n.activeTexture(e.TEXTURE0+r),n.bindTexture(e.TEXTURE_CUBE_MAP,o.__webglTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var s=t&&t.isCompressedTexture,l=t.image[0]&&t.image[0].isDataTexture,A=[],c=0;c<6;c++)A[c]=s||l?l?t.image[c].image:t.image[c]:y(t.image[c],!1,!0,d);var u,f=A[0],p=w(f)||h,m=a.convert(t.format),v=a.convert(t.type),g=M(m,v);if(k(e.TEXTURE_CUBE_MAP,t,p),s){for(c=0;c<6;c++){u=A[c].mipmaps;for(var C=0;C<u.length;C++){var B=u[C];t.format!==ce&&t.format!==Ae?null!==m?n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+c,C,g,B.width,B.height,0,B.data):console.warn("Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+c,C,g,B.width,B.height,0,m,v,B.data)}}o.__maxMipLevel=u.length-1}else{u=t.mipmaps;for(c=0;c<6;c++)if(l){n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,g,A[c].width,A[c].height,0,m,v,A[c].data);for(C=0;C<u.length;C++){var E=(B=u[C]).image[c].image;n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+c,C+1,g,E.width,E.height,0,m,v,E.data)}}else{n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,g,m,v,A[c]);for(C=0;C<u.length;C++){B=u[C];n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+c,C+1,g,m,v,B.image[c])}}o.__maxMipLevel=u.length}x(t,p)&&b(e.TEXTURE_CUBE_MAP,t,f.width,f.height),o.__version=t.version,t.onUpdate&&t.onUpdate(t)}else n.activeTexture(e.TEXTURE0+r),n.bindTexture(e.TEXTURE_CUBE_MAP,o.__webglTexture)}}function I(t,r){n.activeTexture(e.TEXTURE0+r),n.bindTexture(e.TEXTURE_CUBE_MAP,i.get(t).__webglTexture)}var L=(c(s={},V,e.REPEAT),c(s,j,e.CLAMP_TO_EDGE),c(s,W,e.MIRRORED_REPEAT),s),F=(c(l={},X,e.NEAREST),c(l,Y,e.NEAREST_MIPMAP_NEAREST),c(l,K,e.NEAREST_MIPMAP_LINEAR),c(l,Z,e.LINEAR),c(l,J,e.LINEAR_MIPMAP_NEAREST),c(l,q,e.LINEAR_MIPMAP_LINEAR),l);function k(n,a,o){o?(e.texParameteri(n,e.TEXTURE_WRAP_S,L[a.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,L[a.wrapT]),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,L[a.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,F[a.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,F[a.minFilter])):(e.texParameteri(n,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(n,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,e.CLAMP_TO_EDGE),a.wrapS===j&&a.wrapT===j||console.warn("Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(n,e.TEXTURE_MAG_FILTER,C(a.magFilter)),e.texParameteri(n,e.TEXTURE_MIN_FILTER,C(a.minFilter)),a.minFilter!==X&&a.minFilter!==Z&&console.warn("Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));var s=t.get("EXT_texture_filter_anisotropic");if(s){if(a.type===ne&&null===t.get("OES_texture_float_linear"))return;if(a.type===ie&&null===(h||t.get("OES_texture_half_float_linear")))return;(a.anisotropy>1||i.get(a).__currentAnisotropy)&&(e.texParameterf(n,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),i.get(a).__currentAnisotropy=a.anisotropy)}}function P(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",B),t.__webglTexture=e.createTexture(),o.memory.textures++)}function U(t,i,r){var o=e.TEXTURE_2D;i.isDataTexture2DArray&&(o=e.TEXTURE_2D_ARRAY),i.isDataTexture3D&&(o=e.TEXTURE_3D),P(t,i),n.activeTexture(e.TEXTURE0+r),n.bindTexture(o,t.__webglTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,i.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,i.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,i.unpackAlignment);var s=function(e){return!h&&(e.wrapS!==j||e.wrapT!==j||e.minFilter!==X&&e.minFilter!==Z)}(i)&&!1===w(i.image),l=y(i.image,s,!1,f),A=w(l)||h,c=a.convert(i.format),u=a.convert(i.type),d=M(c,u);k(o,i,A);var p,m=i.mipmaps;if(i.isDepthTexture){if(d=e.DEPTH_COMPONENT,i.type===ne){if(!1===h)throw new Error("Float Depth Texture only supported in WebGL2.0");d=e.DEPTH_COMPONENT32F}else h&&(d=e.DEPTH_COMPONENT16);i.format===fe&&d===e.DEPTH_COMPONENT&&i.type!==ee&&i.type!==te&&(console.warn("Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=ee,u=a.convert(i.type)),i.format===pe&&(d=e.DEPTH_STENCIL,i.type!==se&&(console.warn(" Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=se,u=a.convert(i.type))),n.texImage2D(e.TEXTURE_2D,0,d,l.width,l.height,0,c,u,null)}else if(i.isDataTexture)if(m.length>0&&A){for(var v=0,g=m.length;v<g;v++)p=m[v],n.texImage2D(e.TEXTURE_2D,v,d,p.width,p.height,0,c,u,p.data);i.generateMipmaps=!1,t.__maxMipLevel=m.length-1}else n.texImage2D(e.TEXTURE_2D,0,d,l.width,l.height,0,c,u,l.data),t.__maxMipLevel=0;else if(i.isCompressedTexture){for(v=0,g=m.length;v<g;v++)p=m[v],i.format!==ce&&i.format!==Ae?null!==c?n.compressedTexImage2D(e.TEXTURE_2D,v,d,p.width,p.height,0,p.data):console.warn(" Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(e.TEXTURE_2D,v,d,p.width,p.height,0,c,u,p.data);t.__maxMipLevel=m.length-1}else if(i.isDataTexture2DArray)n.texImage3D(e.TEXTURE_2D_ARRAY,0,d,l.width,l.height,l.depth,0,c,u,l.data),t.__maxMipLevel=0;else if(i.isDataTexture3D)n.texImage3D(e.TEXTURE_3D,0,d,l.width,l.height,l.depth,0,c,u,l.data),t.__maxMipLevel=0;else if(m.length>0&&A){for(v=0,g=m.length;v<g;v++)p=m[v],n.texImage2D(e.TEXTURE_2D,v,d,c,u,p);i.generateMipmaps=!1,t.__maxMipLevel=m.length-1}else n.texImage2D(e.TEXTURE_2D,0,d,c,u,l),t.__maxMipLevel=0;x(i,A)&&b(e.TEXTURE_2D,i,l.width,l.height),t.__version=i.version,i.onUpdate&&i.onUpdate(i)}function D(t,r,o,s){var l=a.convert(r.texture.format),A=a.convert(r.texture.type),c=M(l,A);n.texImage2D(s,0,c,r.width,r.height,0,l,A,null),e.bindFramebuffer(e.FRAMEBUFFER,t),e.framebufferTexture2D(e.FRAMEBUFFER,o,s,i.get(r.texture).__webglTexture,0),e.bindFramebuffer(e.FRAMEBUFFER,null)}function R(t,n,i){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer&&!n.stencilBuffer){if(i){var r=N(n);e.renderbufferStorageMultisample(e.RENDERBUFFER,r,e.DEPTH_COMPONENT16,n.width,n.height)}else e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,n.width,n.height);e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t)}else if(n.depthBuffer&&n.stencilBuffer){if(i){r=N(n);e.renderbufferStorageMultisample(e.RENDERBUFFER,r,e.DEPTH24_STENCIL8,n.width,n.height)}else e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,n.width,n.height);e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t)}else{var o=M(a.convert(n.texture.format),a.convert(n.texture.type));if(i){r=N(n);e.renderbufferStorageMultisample(e.RENDERBUFFER,r,o,n.width,n.height)}else e.renderbufferStorage(e.RENDERBUFFER,o,n.width,n.height)}e.bindRenderbuffer(e.RENDERBUFFER,null)}function O(t){var n=i.get(t),r=!0===t.isWebGLRenderTargetCube;if(t.depthTexture){if(r)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,n){if(n&&n.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported");if(e.bindFramebuffer(e.FRAMEBUFFER,t),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),T(n.depthTexture,0);var r=i.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===fe)e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,r,0);else{if(n.depthTexture.format!==pe)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,r,0)}}(n.__webglFramebuffer,t)}else if(r){n.__webglDepthbuffer=[];for(var a=0;a<6;a++)e.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer[a]),n.__webglDepthbuffer[a]=e.createRenderbuffer(),R(n.__webglDepthbuffer[a],t)}else e.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),R(n.__webglDepthbuffer,t);e.bindFramebuffer(e.FRAMEBUFFER,null)}function N(e){return h&&e.isWebGLMultisampleRenderTarget?Math.min(p,e.samples):0}var z=!1,Q=!1;this.allocateTextureUnit=function(){var e=S;return e>=u&&console.warn("Trying to use "+e+" texture units while this GPU supports only "+u),S+=1,e},this.resetTextureUnits=function(){S=0},this.setTexture2D=T,this.setTexture2DArray=function(t,r){var a=i.get(t);t.version>0&&a.__version!==t.version?U(a,t,r):(n.activeTexture(e.TEXTURE0+r),n.bindTexture(e.TEXTURE_2D_ARRAY,a.__webglTexture))},this.setTexture3D=function(t,r){var a=i.get(t);t.version>0&&a.__version!==t.version?U(a,t,r):(n.activeTexture(e.TEXTURE0+r),n.bindTexture(e.TEXTURE_3D,a.__webglTexture))},this.setTextureCube=_,this.setTextureCubeDynamic=I,this.setupRenderTarget=function(r){var s=i.get(r),l=i.get(r.texture);r.addEventListener("dispose",E),l.__webglTexture=e.createTexture(),o.memory.textures++;var A=!0===r.isWebGLRenderTargetCube,c=!0===r.isWebGLMultisampleRenderTarget,u=!0===r.isWebGLMultiviewRenderTarget,d=w(r)||h;if(A){s.__webglFramebuffer=[];for(var f=0;f<6;f++)s.__webglFramebuffer[f]=e.createFramebuffer()}else if(s.__webglFramebuffer=e.createFramebuffer(),c)if(h){s.__webglMultisampledFramebuffer=e.createFramebuffer(),s.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,s.__webglColorRenderbuffer);var p=M(a.convert(r.texture.format),a.convert(r.texture.type)),m=N(r);e.renderbufferStorageMultisample(e.RENDERBUFFER,m,p,r.width,r.height),e.bindFramebuffer(e.FRAMEBUFFER,s.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,s.__webglColorRenderbuffer),e.bindRenderbuffer(e.RENDERBUFFER,null),r.depthBuffer&&(s.__webglDepthRenderbuffer=e.createRenderbuffer(),R(s.__webglDepthRenderbuffer,r,!0)),e.bindFramebuffer(e.FRAMEBUFFER,null)}else console.warn("WebGLMultisampleRenderTarget can only be used with WebGL2.");else if(u){var v=r.width,g=r.height,y=r.numViews;e.bindFramebuffer(e.FRAMEBUFFER,s.__webglFramebuffer);var C=t.get("OVR_multiview2");o.memory.textures+=2;var B=e.createTexture();e.bindTexture(e.TEXTURE_2D_ARRAY,B),e.texParameteri(e.TEXTURE_2D_ARRAY,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D_ARRAY,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texImage3D(e.TEXTURE_2D_ARRAY,0,e.RGBA8,v,g,y,0,e.RGBA,e.UNSIGNED_BYTE,null),C.framebufferTextureMultiviewOVR(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,B,0,0,y);var S=e.createTexture();e.bindTexture(e.TEXTURE_2D_ARRAY,S),e.texParameteri(e.TEXTURE_2D_ARRAY,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D_ARRAY,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texImage3D(e.TEXTURE_2D_ARRAY,0,e.DEPTH24_STENCIL8,v,g,y,0,e.DEPTH_STENCIL,e.UNSIGNED_INT_24_8,null),C.framebufferTextureMultiviewOVR(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,S,0,0,y);var T=new Array(y);for(f=0;f<y;++f)T[f]=e.createFramebuffer(),e.bindFramebuffer(e.FRAMEBUFFER,T[f]),e.framebufferTextureLayer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,B,0,f);s.__webglColorTexture=B,s.__webglDepthStencilTexture=S,s.__webglViewFramebuffers=T,e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindTexture(e.TEXTURE_2D_ARRAY,null)}if(A){n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),k(e.TEXTURE_CUBE_MAP,r.texture,d);for(f=0;f<6;f++)D(s.__webglFramebuffer[f],r,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+f);x(r.texture,d)&&b(e.TEXTURE_CUBE_MAP,r.texture,r.width,r.height),n.bindTexture(e.TEXTURE_CUBE_MAP,null)}else u||(n.bindTexture(e.TEXTURE_2D,l.__webglTexture),k(e.TEXTURE_2D,r.texture,d),D(s.__webglFramebuffer,r,e.COLOR_ATTACHMENT0,e.TEXTURE_2D),x(r.texture,d)&&b(e.TEXTURE_2D,r.texture,r.width,r.height),n.bindTexture(e.TEXTURE_2D,null));r.depthBuffer&&O(r)},this.updateRenderTargetMipmap=function(t){var r=t.texture;if(x(r,w(t)||h)){var a=t.isWebGLRenderTargetCube?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,o=i.get(r).__webglTexture;n.bindTexture(a,o),b(a,r,t.width,t.height),n.bindTexture(a,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(h){var n=i.get(t);e.bindFramebuffer(e.READ_FRAMEBUFFER,n.__webglMultisampledFramebuffer),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,n.__webglFramebuffer);var r=t.width,a=t.height,o=e.COLOR_BUFFER_BIT;t.depthBuffer&&(o|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&(o|=e.STENCIL_BUFFER_BIT),e.blitFramebuffer(0,0,r,a,0,0,r,a,o,e.NEAREST)}else console.warn(" WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===z&&(console.warn(" don't use render targets as textures. Use their .texture property instead."),z=!0),e=e.texture),T(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLRenderTargetCube&&(!1===Q&&(console.warn(" don't use cube render targets as textures. Use their .texture property instead."),Q=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?_(e,t):I(e,t)}}function Ga(e,t,n){var i=n.isWebGL2;return{convert:function(n){var r;if(n===$)return e.UNSIGNED_BYTE;if(n===re)return e.UNSIGNED_SHORT_4_4_4_4;if(n===ae)return e.UNSIGNED_SHORT_5_5_5_1;if(n===oe)return e.UNSIGNED_SHORT_5_6_5;if(1010===n)return e.BYTE;if(1011===n)return e.SHORT;if(n===ee)return e.UNSIGNED_SHORT;if(1013===n)return e.INT;if(n===te)return e.UNSIGNED_INT;if(n===ne)return e.FLOAT;if(n===ie)return i?e.HALF_FLOAT:null!==(r=t.get("OES_texture_half_float"))?r.HALF_FLOAT_OES:null;if(n===le)return e.ALPHA;if(n===Ae)return e.RGB;if(n===ce)return e.RGBA;if(n===he)return e.LUMINANCE;if(n===ue)return e.LUMINANCE_ALPHA;if(n===fe)return e.DEPTH_COMPONENT;if(n===pe)return e.DEPTH_STENCIL;if(n===me)return e.RED;if(n===ve||n===ge||n===ye||n===we){if(null===(r=t.get("WEBGL_compressed_texture_s3tc")))return null;if(n===ve)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===ge)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===ye)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===we)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===xe||n===be||n===Me||n===Ce){if(null===(r=t.get("WEBGL_compressed_texture_pvrtc")))return null;if(n===xe)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===be)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Me)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Ce)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===Be)return null!==(r=t.get("WEBGL_compressed_texture_etc1"))?r.COMPRESSED_RGB_ETC1_WEBGL:null;if((n===Te||n===_e)&&null!==(r=t.get("WEBGL_compressed_texture_etc"))){if(n===Te)return r.COMPRESSED_RGB8_ETC2;if(n===_e)return r.COMPRESSED_RGBA8_ETC2_EAC}return n===Ee||37809===n||37810===n||37811===n||37812===n||37813===n||37814===n||37815===n||37816===n||37817===n||37818===n||37819===n||37820===n||37821===n?null!==(r=t.get("WEBGL_compressed_texture_astc"))?n:null:n===Se?null!==(r=t.get("EXT_texture_compression_bptc"))?n:null:n===se?i?e.UNSIGNED_INT_24_8:null!==(r=t.get("WEBGL_depth_texture"))?r.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function Ha(e,t,n,i){dt.call(this,e,t,i),this.depthBuffer=!1,this.stencilBuffer=!1,this.numViews=n}function Va(e,t){var n,i,r,a,o,s,l,A=e.extensions,c=e.properties,h=0;function u(e){return e.isArrayCamera?e.cameras:(o[0]=e,o)}this.isAvailable=function(){if(void 0===l){var e=A.get("OVR_multiview2");if(l=null!==e&&!1===t.getContextAttributes().antialias){h=t.getParameter(e.MAX_VIEWS_OVR),n=new Ha(0,0,2),s=new tt,a=[],r=[],o=[];for(var i=0;i<h;i++)a[i]=new bt,r[i]=new lt}}return l},this.attachCamera=function(t){!1!==function(e){if(void 0===e.isArrayCamera)return!0;var t=e.cameras;if(t.length>h)return!1;for(var n=1,i=t.length;n<i;n++)if(t[0].viewport.z!==t[n].viewport.z||t[0].viewport.w!==t[n].viewport.w)return!1;return!0}(t)&&(i=e.getRenderTarget(),function(t){if(i?s.set(i.width,i.height):e.getDrawingBufferSize(s),t.isArrayCamera){var r=t.cameras[0].viewport;n.setSize(r.z,r.w),n.setNumViews(t.cameras.length)}else n.setSize(s.x,s.y),n.setNumViews(2)}(t),e.setRenderTarget(n))},this.detachCamera=function(r){n===e.getRenderTarget()&&(e.setRenderTarget(i),function(e){var i=n,r=i.numViews,a=c.get(i).__webglViewFramebuffers,o=i.width,l=i.height;if(e.isArrayCamera)for(var A=0;A<r;A++){var h=e.cameras[A].viewport,u=h.x,d=h.y,f=u+h.z,p=d+h.w;t.bindFramebuffer(t.READ_FRAMEBUFFER,a[A]),t.blitFramebuffer(0,0,o,l,u,d,f,p,t.COLOR_BUFFER_BIT,t.NEAREST)}else t.bindFramebuffer(t.READ_FRAMEBUFFER,a[0]),t.blitFramebuffer(0,0,o,l,0,0,s.x,s.y,t.COLOR_BUFFER_BIT,t.NEAREST)}(r))},this.updateCameraProjectionMatricesUniform=function(e,n){for(var i=u(e),r=0;r<i.length;r++)a[r].copy(i[r].projectionMatrix);n.setValue(t,"projectionMatrices",a)},this.updateCameraViewMatricesUniform=function(e,n){for(var i=u(e),r=0;r<i.length;r++)a[r].copy(i[r].matrixWorldInverse);n.setValue(t,"viewMatrices",a)},this.updateObjectMatricesUniforms=function(e,n,i){for(var o=u(n),s=0;s<o.length;s++)a[s].multiplyMatrices(o[s].matrixWorldInverse,e.matrixWorld),r[s].getNormalMatrix(a[s]);i.setValue(t,"modelViewMatrices",a),i.setValue(t,"normalMatrices",r)}}function ja(){zt.call(this),this.type="Group"}function Wa(e){Ni.call(this),this.cameras=e||[]}Ha.prototype=Object.assign(Object.create(dt.prototype),{constructor:Ha,isWebGLMultiviewRenderTarget:!0,copy:function(e){return dt.prototype.copy.call(this,e),this.numViews=e.numViews,this},setNumViews:function(e){return this.numViews!==e&&(this.numViews=e,this.dispose()),this}}),ja.prototype=Object.assign(Object.create(zt.prototype),{constructor:ja,isGroup:!0}),Wa.prototype=Object.assign(Object.create(Ni.prototype),{constructor:Wa,isArrayCamera:!0});var Xa,Ya=new at,Ka=new at;function Za(e,t,n){Ya.setFromMatrixPosition(t.matrixWorld),Ka.setFromMatrixPosition(n.matrixWorld);var i=Ya.distanceTo(Ka),r=t.projectionMatrix.elements,a=n.projectionMatrix.elements,o=r[14]/(r[10]-1),s=r[14]/(r[10]+1),l=(r[9]+1)/r[5],A=(r[9]-1)/r[5],c=(r[8]-1)/r[0],h=(a[8]+1)/a[0],u=o*c,d=o*h,f=i/(-c+h),p=f*-c;t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(p),e.translateZ(f),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.getInverse(e.matrixWorld);var m=o+f,v=s+f,g=u-p,y=d+(i-p),w=l*s/v*m,x=A*s/v*m;e.projectionMatrix.makePerspective(g,y,w,x,m,v)}function Ja(e){var t,n,i=this,r=null,a=null,o=[],s=new bt,l=new bt,A=1,c="local-floor";"undefined"!=typeof window&&"VRFrameData"in window&&(a=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",x,!1));var h=new bt,u=new nt,d=new at,f=new Ni,p=new Ni;p.viewport=new ut,p.layers.enable(1);var m=new Ni;m.viewport=new ut,m.layers.enable(2);var v=new Wa([p,m]);function g(){return null!==r&&!0===r.isPresenting}v.layers.enable(1),v.layers.enable(2);var y,w=new tt;function x(){if(g()){var a=r.getEyeParameters("left");t=2*a.renderWidth*A,n=a.renderHeight*A,y=e.getPixelRatio(),e.getSize(w),e.setDrawingBufferSize(t,n,1),p.viewport.set(0,0,t/2,n),m.viewport.set(t/2,0,t/2,n),E.start(),i.dispatchEvent({type:"sessionstart"})}else i.enabled&&e.setDrawingBufferSize(w.width,w.height,y),E.stop(),i.dispatchEvent({type:"sessionend"})}var b=[],M=[];function C(e){for(var t=navigator.getGamepads&&navigator.getGamepads(),n=0,i=t.length;n<i;n++){var r=t[n];if(r&&("Daydream Controller"===r.id||"Gear VR Controller"===r.id||"Oculus Go Controller"===r.id||"OpenVR Gamepad"===r.id||r.id.startsWith("Oculus Touch")||r.id.startsWith("HTC Vive Focus")||r.id.startsWith("Spatial Controller"))){var a=r.hand;if(0===e&&(""===a||"right"===a))return r;if(1===e&&"left"===a)return r}}}function B(e,i){null!==i&&4===i.length&&e.set(i[0]*t,i[1]*n,i[2]*t,i[3]*n)}this.enabled=!1,this.getController=function(e){var t=o[e];return void 0===t&&((t=new ja).matrixAutoUpdate=!1,t.visible=!1,o[e]=t),t},this.getDevice=function(){return r},this.setDevice=function(e){void 0!==e&&(r=e),E.setContext(e)},this.setFramebufferScaleFactor=function(e){A=e},this.setReferenceSpaceType=function(e){c=e},this.getCamera=function(e){var t="local-floor"===c?1.6:0;if(r.depthNear=e.near,r.depthFar=e.far,r.getFrameData(a),"local-floor"===c){var n=r.stageParameters;n?s.fromArray(n.sittingToStandingTransform):s.makeTranslation(0,t,0)}var i=a.pose;f.matrix.copy(s),f.matrix.decompose(f.position,f.quaternion,f.scale),null!==i.orientation&&(u.fromArray(i.orientation),f.quaternion.multiply(u)),null!==i.position&&(u.setFromRotationMatrix(s),d.fromArray(i.position),d.applyQuaternion(u),f.position.add(d)),f.updateMatrixWorld(),e.matrixWorld.copy(f.matrixWorld);for(var A=e.children,g=0,y=A.length;g<y;g++)A[g].updateMatrixWorld(!0);p.near=e.near,m.near=e.near,p.far=e.far,m.far=e.far,p.matrixWorldInverse.fromArray(a.leftViewMatrix),m.matrixWorldInverse.fromArray(a.rightViewMatrix),l.getInverse(s),"local-floor"===c&&(p.matrixWorldInverse.multiply(l),m.matrixWorldInverse.multiply(l));var w=e.parent;null!==w&&(h.getInverse(w.matrixWorld),p.matrixWorldInverse.multiply(h),m.matrixWorldInverse.multiply(h)),p.matrixWorld.getInverse(p.matrixWorldInverse),m.matrixWorld.getInverse(m.matrixWorldInverse),p.projectionMatrix.fromArray(a.leftProjectionMatrix),m.projectionMatrix.fromArray(a.rightProjectionMatrix),Za(v,p,m);var x=r.getLayers();if(x.length){var E=x[0];B(p.viewport,E.leftBounds),B(m.viewport,E.rightBounds)}return function(){for(var e=0;e<o.length;e++){var t=o[e],n=C(e);if(void 0!==n&&void 0!==n.pose){if(null===n.pose)return;var i=n.pose;!1===i.hasPosition&&t.position.set(.2,-.6,-.05),null!==i.position&&t.position.fromArray(i.position),null!==i.orientation&&t.quaternion.fromArray(i.orientation),t.matrix.compose(t.position,t.quaternion,t.scale),t.matrix.premultiply(s),t.matrix.decompose(t.position,t.quaternion,t.scale),t.matrixWorldNeedsUpdate=!0,t.visible=!0;var r="Daydream Controller"===n.id?0:1;void 0===b[e]&&(b[e]=!1),b[e]!==n.buttons[r].pressed&&(b[e]=n.buttons[r].pressed,!0===b[e]?t.dispatchEvent({type:"selectstart"}):(t.dispatchEvent({type:"selectend"}),t.dispatchEvent({type:"select"}))),r=2,void 0===M[e]&&(M[e]=!1),void 0!==n.buttons[r]&&M[e]!==n.buttons[r].pressed&&(M[e]=n.buttons[r].pressed,!0===M[e]?t.dispatchEvent({type:"squeezestart"}):(t.dispatchEvent({type:"squeezeend"}),t.dispatchEvent({type:"squeeze"})))}else t.visible=!1}}(),v},this.getStandingMatrix=function(){return s},this.isPresenting=g;var E=new Zi;this.setAnimationLoop=function(e){E.setAnimationLoop(e),g()&&E.start()},this.submitFrame=function(){g()&&r.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",x)},this.setFrameOfReferenceType=function(){console.warn("setFrameOfReferenceType() has been deprecated.")}}function qa(e,t){var n=this,i=null,r=null,a="local-floor",o=null,s=[],l=[];var A=new Ni;A.layers.enable(1),A.viewport=new ut;var c=new Ni;c.layers.enable(2),c.viewport=new ut;var h=new Wa([A,c]);function u(e){for(var t=0;t<s.length;t++)l[t]===e.inputSource&&s[t].dispatchEvent({type:e.type})}function d(){e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),y.stop(),n.dispatchEvent({type:"sessionend"})}function f(e){r=e,y.setContext(i),y.start(),n.dispatchEvent({type:"sessionstart"})}function p(){for(var e=0;e<s.length;e++)l[e]=m(e)}function m(e){for(var t=i.inputSources,n=0;n<t.length;n++){var r=t[n],a=r.handedness;if(0===e&&("none"===a||"right"===a))return r;if(1===e&&"left"===a)return r}}function v(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.getInverse(e.matrixWorld)}h.layers.enable(1),h.layers.enable(2),this.enabled=!1,this.getController=function(e){var t=s[e];return void 0===t&&((t=new ja).matrixAutoUpdate=!1,t.visible=!1,s[e]=t),t},this.setFramebufferScaleFactor=function(){},this.setReferenceSpaceType=function(e){a=e},this.getSession=function(){return i},this.setSession=function(e){null!==(i=e)&&(i.addEventListener("select",u),i.addEventListener("selectstart",u),i.addEventListener("selectend",u),i.addEventListener("squeeze",u),i.addEventListener("squeezestart",u),i.addEventListener("squeezeend",u),i.addEventListener("end",d),i.updateRenderState({baseLayer:new XRWebGLLayer(i,t)}),i.requestReferenceSpace(a).then(f),i.addEventListener("inputsourceschange",p),p())},this.getCamera=function(e){var t=e.parent,n=h.cameras;v(h,t);for(var i=0;i<n.length;i++)v(n[i],t);e.matrixWorld.copy(h.matrixWorld);for(var r=e.children,a=(i=0,r.length);i<a;i++)r[i].updateMatrixWorld(!0);return Za(h,A,c),h},this.isPresenting=function(){return null!==i&&null!==r};var g=null;var y=new Zi;y.setAnimationLoop((function(t,n){if(null!==(o=n.getViewerPose(r))){var a=o.views,A=i.renderState.baseLayer;e.setFramebuffer(A.framebuffer);for(var c=0;c<a.length;c++){var u=a[c],d=A.getViewport(u),f=u.transform.inverse.matrix,p=h.cameras[c];p.matrix.fromArray(f).getInverse(p.matrix),p.projectionMatrix.fromArray(u.projectionMatrix),p.viewport.set(d.x,d.y,d.width,d.height),0===c&&h.matrix.copy(p.matrix)}}for(c=0;c<s.length;c++){var m=s[c],v=l[c];if(v){var y=n.getPose(v.targetRaySpace,r);if(null!==y){m.matrix.fromArray(y.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.visible=!0;continue}}m.visible=!1}g&&g(t)})),this.setAnimationLoop=function(e){g=e},this.dispose=function(){},this.getStandingMatrix=function(){return console.warn("getStandingMatrix() is no longer needed."),new bt},this.getDevice=function(){console.warn("getDevice() has been deprecated.")},this.setDevice=function(){console.warn("etDevice() has been deprecated.")},this.setFrameOfReferenceType=function(){console.warn("setFrameOfReferenceType() has been deprecated.")},this.submitFrame=function(){}}function $a(e){var t=void 0!==(e=e||{}).canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==e.context?e.context:null,i=void 0!==e.alpha&&e.alpha,r=void 0===e.depth||e.depth,a=void 0===e.stencil||e.stencil,o=void 0!==e.antialias&&e.antialias,s=void 0===e.premultipliedAlpha||e.premultipliedAlpha,l=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,A=void 0!==e.powerPreference?e.powerPreference:"default",c=void 0!==e.failIfMajorPerformanceCaveat&&e.failIfMajorPerformanceCaveat,h=null,u=null;this.domElement=t,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=1,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var d,f,p,m,v,g,y,w,x,b,M,C,B,E,S,T,_,I,L=this,F=!1,k=null,P=0,U=0,D=null,R=null,O=-1,N={geometry:null,program:null,wireframe:!1},z=null,Q=null,G=new ut,H=new ut,V=null,j=t.width,W=t.height,X=1,Y=new ut(0,0,j,W),K=new ut(0,0,j,W),Z=!1,J=new Wi,q=new ir,ee=!1,te=!1,re=new bt,ae=new at;function oe(){return null===D?X:1}this.acfFrustum=J;try{var se={alpha:i,depth:r,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:l,powerPreference:A,failIfMajorPerformanceCaveat:c,xrCompatible:!0};t.addEventListener("webglcontextlost",fe,!1),t.addEventListener("webglcontextrestored",pe,!1);try{le=le||{}}catch(e){var le={}}if(null===(d=n||t.getContext(le&&le.isWebGL2?"webgl2":"webgl",se)||t.getContext("experimental-webgl",se)))throw null!==t.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===d.getShaderPrecisionFormat&&(d.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(e){throw console.error(e.message),e}function Ae(){f=new rr(d),!1===(p=new nr(d,f,e)).isWebGL2&&(f.get("WEBGL_depth_texture"),f.get("OES_texture_float"),f.get("OES_texture_half_float"),f.get("OES_texture_half_float_linear"),f.get("OES_standard_derivatives"),f.get("OES_element_index_uint"),f.get("ANGLE_instanced_arrays")),f.get("OES_texture_float_linear"),I=new Ga(d,f,p),(m=new za(d,f,p)).scissor(H.copy(K).multiplyScalar(X).floor()),m.viewport(G.copy(Y).multiplyScalar(X).floor()),v=new sr(d),g=new Ea,y=new Qa(d,f,m,g,p,I,v),w=new Ji(d),x=new ar(d,w,v),b=new cr(d,x,w,v),S=new Ar(d),M=new Ba(L,f,p),C=new Ia,B=new Da,E=new er(L,m,b,s),T=new tr(d,f,v,p),_=new or(d,f,v,p),v.programs=M.programs,L.capabilities=p,L.extensions=f,L.properties=g,L.renderLists=C,L.state=m,L.info=v}Ae();var he="undefined"!=typeof navigator&&"xr"in navigator?new qa(L,d):new Ja(L);this.vr=he;var ue=new Va(L,d),de=new Na(L,b,p.maxTextureSize);function fe(e){e.preventDefault(),console.log("Context Lost."),F=!0}function pe(){console.log("Context Restored."),F=!1,Ae()}function me(e){var t=e.target;t.removeEventListener("dispose",me),function(e){ve(e),g.remove(e)}(t)}function ve(e){var t=g.get(e).program;e.program=void 0,void 0!==t&&M.releaseProgram(t)}this.shadowMap=de,this.getContext=function(){return d},this.getContextAttributes=function(){return d.getContextAttributes()},this.forceContextLoss=function(){var e=f.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){var e=f.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return X},this.setPixelRatio=function(e){void 0!==e&&(X=e,this.setSize(j,W,!1))},this.getSize=function(e){return void 0===e&&(e=new tt),e.set(j,W)},this.setSize=function(e,n,i){he.isPresenting()?console.warn("Can't change size while VR device is presenting."):(j=e,W=n,t.width=Math.floor(e*X),t.height=Math.floor(n*X),!1!==i&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return void 0===e&&(e=new tt),e.set(j*X,W*X).floor()},this.setDrawingBufferSize=function(e,n,i){j=e,W=n,X=i,t.width=Math.floor(e*i),t.height=Math.floor(n*i),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return void 0===e&&(e=new ut),e.copy(G)},this.getViewport=function(e){return e.copy(Y)},this.setViewport=function(e,t,n,i){e.isVector4?Y.set(e.x,e.y,e.z,e.w):Y.set(e,t,n,i),m.viewport(G.copy(Y).multiplyScalar(X).floor())},this.getScissor=function(e){return e.copy(K)},this.setScissor=function(e,t,n,i){e.isVector4?K.set(e.x,e.y,e.z,e.w):K.set(e,t,n,i),m.scissor(H.copy(K).multiplyScalar(X).floor())},this.getScissorTest=function(){return Z},this.setScissorTest=function(e){m.setScissorTest(Z=e)},this.getClearColor=function(){return E.getClearColor()},this.setClearColor=function(){E.setClearColor.apply(E,arguments)},this.getClearAlpha=function(){return E.getClearAlpha()},this.setClearAlpha=function(){E.setClearAlpha.apply(E,arguments)},this.clear=function(e,t,n){var i=0;(void 0===e||e)&&(i|=d.COLOR_BUFFER_BIT),(void 0===t||t)&&(i|=d.DEPTH_BUFFER_BIT),(void 0===n||n)&&(i|=d.STENCIL_BUFFER_BIT),d.clear(i)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",fe,!1),t.removeEventListener("webglcontextrestored",pe,!1),C.dispose(),B.dispose(),g.dispose(),b.dispose(),he.dispose(),ye.stop()},this.renderBufferImmediate=function(e,t){m.initAttributes();var n=g.get(e);e.hasPositions&&!n.position&&(n.position=d.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=d.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=d.createBuffer()),e.hasColors&&!n.color&&(n.color=d.createBuffer());var i=t.getAttributes();e.hasPositions&&(d.bindBuffer(d.ARRAY_BUFFER,n.position),d.bufferData(d.ARRAY_BUFFER,e.positionArray,d.DYNAMIC_DRAW),m.enableAttribute(i.position),d.vertexAttribPointer(i.position,3,d.FLOAT,!1,0,0)),e.hasNormals&&(d.bindBuffer(d.ARRAY_BUFFER,n.normal),d.bufferData(d.ARRAY_BUFFER,e.normalArray,d.DYNAMIC_DRAW),m.enableAttribute(i.normal),d.vertexAttribPointer(i.normal,3,d.FLOAT,!1,0,0)),e.hasUvs&&(d.bindBuffer(d.ARRAY_BUFFER,n.uv),d.bufferData(d.ARRAY_BUFFER,e.uvArray,d.DYNAMIC_DRAW),m.enableAttribute(i.uv),d.vertexAttribPointer(i.uv,2,d.FLOAT,!1,0,0)),e.hasColors&&(d.bindBuffer(d.ARRAY_BUFFER,n.color),d.bufferData(d.ARRAY_BUFFER,e.colorArray,d.DYNAMIC_DRAW),m.enableAttribute(i.color),d.vertexAttribPointer(i.color,3,d.FLOAT,!1,0,0)),m.disableUnusedAttributes(),d.drawArrays(d.TRIANGLES,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,n,i,r,a){var o=r.isMesh&&r.matrixWorld.determinant()<0;m.setMaterial(i,o);var s=Be(e,t,i,r),l=!1;N.geometry===n.id&&N.program===s.id&&N.wireframe===(!0===i.wireframe)||(N.geometry=n.id,N.program=s.id,N.wireframe=!0===i.wireframe,l=!0),r.morphTargetInfluences&&(S.update(r,n,i,s),l=!0);var A=n.index,c=n.attributes.position;if((null===A||0!==A.count)&&void 0!==c&&0!==c.count){var h,u=1;!0===i.wireframe&&(A=x.getWireframeAttribute(n),u=2);var v=T;null!==A&&(h=w.get(A),(v=_).setIndex(h)),l&&(!function(e,t,n,i){if(!1===p.isWebGL2&&(e.isInstancedMesh||t.isInstancedBufferGeometry)&&null===f.get("ANGLE_instanced_arrays"))return;m.initAttributes();var r=t.attributes,a=i.getAttributes(),o=n.defaultAttributeValues;for(var s in a){var l=a[s];if(l>=0){var A=r[s];if(void 0!==A){var c=A.normalized,h=A.itemSize;if(void 0===(M=w.get(A)))continue;var u=M.buffer,v=M.type,g=M.bytesPerElement;if(A.isInterleavedBufferAttribute){var y=A.data,x=y.stride,b=A.offset;y&&y.isInstancedInterleavedBuffer?(m.enableAttributeAndDivisor(l,y.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=y.meshPerAttribute*y.count)):m.enableAttribute(l),d.bindBuffer(d.ARRAY_BUFFER,u),d.vertexAttribPointer(l,h,v,c,x*g,b*g)}else A.isInstancedBufferAttribute?(m.enableAttributeAndDivisor(l,A.meshPerAttribute),void 0===t.maxInstancedCount&&(t.maxInstancedCount=A.meshPerAttribute*A.count)):m.enableAttribute(l),d.bindBuffer(d.ARRAY_BUFFER,u),d.vertexAttribPointer(l,h,v,c,0,0)}else if("instanceMatrix"===s){if(void 0===e.instanceMatrix)continue;var M;if(void 0===(M=w.get(e.instanceMatrix)))continue;u=M.buffer,v=M.type;m.enableAttributeAndDivisor(l+0,1),m.enableAttributeAndDivisor(l+1,1),m.enableAttributeAndDivisor(l+2,1),m.enableAttributeAndDivisor(l+3,1),d.bindBuffer(d.ARRAY_BUFFER,u),d.vertexAttribPointer(l+0,4,v,!1,64,0),d.vertexAttribPointer(l+1,4,v,!1,64,16),d.vertexAttribPointer(l+2,4,v,!1,64,32),d.vertexAttribPointer(l+3,4,v,!1,64,48)}else if(void 0!==o){var C=o[s];if(void 0!==C)switch(C.length){case 2:d.vertexAttrib2fv(l,C);break;case 3:d.vertexAttrib3fv(l,C);break;case 4:d.vertexAttrib4fv(l,C);break;default:d.vertexAttrib1fv(l,C)}}}}m.disableUnusedAttributes()}(r,n,i,s),null!==A&&d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,h.buffer));var g=1/0;null!==A?g=A.count:void 0!==c&&(g=c.count);var y=n.drawRange.start*u,b=n.drawRange.count*u,M=null!==a?a.start*u:0,C=null!==a?a.count*u:1/0,B=Math.max(y,M),E=Math.min(g,y+b,M+C)-1,I=Math.max(0,E-B+1);if(0!==I){if(r.isMesh)if(!0===i.wireframe)m.setLineWidth(i.wireframeLinewidth*oe()),v.setMode(d.LINES);else switch(r.drawMode){case 0:v.setMode(d.TRIANGLES);break;case 1:v.setMode(d.TRIANGLE_STRIP);break;case 2:v.setMode(d.TRIANGLE_FAN)}else if(r.isLine){var L=i.linewidth;void 0===L&&(L=1),m.setLineWidth(L*oe()),r.isLineSegments?v.setMode(d.LINES):r.isLineLoop?v.setMode(d.LINE_LOOP):v.setMode(d.LINE_STRIP)}else r.isPoints?v.setMode(d.POINTS):r.isSprite&&v.setMode(d.TRIANGLES);r.isInstancedMesh?v.renderInstances(n,B,I,r.count):n.isInstancedBufferGeometry?v.renderInstances(n,B,I,n.maxInstancedCount):v.render(B,I)}}},this.compile=function(e,t){(u=B.get(e,t)).init(),e.traverse((function(e){e.isLight&&(u.pushLight(e),e.castShadow&&u.pushShadow(e))})),u.setupLights(t),e.traverse((function(t){if(t.material)if(Array.isArray(t.material))for(var n=0;n<t.material.length;n++)Ce(t.material[n],e.fog,t);else Ce(t.material,e.fog,t)}))};var ge=null;var ye=new Zi;function we(e,t,n,i){if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)u.pushLight(e),e.castShadow&&u.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||J.intersectsSprite(e)){i&&ae.setFromMatrixPosition(e.matrixWorld).applyMatrix4(re);var r=b.update(e);(a=e.material).visible&&h.push(e,r,a,n,ae.z,null)}}else if(e.isImmediateRenderObject)i&&ae.setFromMatrixPosition(e.matrixWorld).applyMatrix4(re),h.push(e,null,e.material,n,ae.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton&&e.skeleton.frame!==v.render.frame&&(e.skeleton.update(),e.skeleton.frame=v.render.frame),!e.frustumCulled||J.intersectsObject(e))){i&&ae.setFromMatrixPosition(e.matrixWorld).applyMatrix4(re);r=b.update(e);var a=e.material;if(Array.isArray(a))for(var o=r.groups,s=0,l=o.length;s<l;s++){var A=o[s],c=a[A.materialIndex];c&&c.visible&&h.push(e,r,c,n,ae.z,A)}else a.visible&&h.push(e,r,a,n,ae.z,null)}}function xe(e,t,n,i){if(!1!==e.visible){if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)u.pushLight(e),e.castShadow&&u.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||J.intersectsSprite(e)){i&&ae.setFromMatrixPosition(e.matrixWorld).applyMatrix4(re);var r=b.update(e);(a=e.material).visible&&h.push(e,r,a,n,ae.z,null)}}else if(e.isImmediateRenderObject)i&&ae.setFromMatrixPosition(e.matrixWorld).applyMatrix4(re),h.push(e,null,e.material,n,ae.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton&&e.skeleton.frame!==v.render.frame&&(e.skeleton.update(),e.skeleton.frame=v.render.frame),!e.frustumCulled||J.intersectsObject(e))){i&&ae.setFromMatrixPosition(e.matrixWorld).applyMatrix4(re);r=b.update(e);var a=e.material;if(Array.isArray(a))for(var o=r.groups,s=0,l=o.length;s<l;s++){var A=o[s],c=a[A.materialIndex];c&&c.visible&&h.push(e,r,c,n,ae.z,A)}else a.visible&&h.push(e,r,a,n,ae.z,null)}var d=e.children;for(s=0,l=d.length;s<l;s++)xe(d[s],t,n,i)}}function be(e,t,n,i){for(var r=0,a=e.length;r<a;r++){var o=e[r],s=o.object,l=o.geometry,A=void 0===i?o.material:i;i&&s&&(s.sceneMaterial?s.sceneMaterial.srcUID!==i.uuid&&(s.sceneMaterial=i.clone(),s.sceneMaterial.srcUID=i.uuid,s.sceneMaterial.needsUpdate=!0):(s.sceneMaterial=i.clone(),s.sceneMaterial.srcUID=i.uuid,s.sceneMaterial.needsUpdate=!0),A=s.sceneMaterial,o.material&&(A.skinning=s.isSkinnedMesh));var c=o.group;if(n.isArrayCamera)if(Q=n,he.enabled&&ue.isAvailable())Me(s,t,n,l,A,c);else for(var h=n.cameras,d=0,f=h.length;d<f;d++){var p=h[d];s.layers.test(p.layers)&&(m.viewport(G.copy(p.viewport)),u.setupLights(p),Me(s,t,p,l,A,c))}else Q=null,Me(s,t,n,l,A,c)}}function Me(e,t,n,i,r,a){if(e.onBeforeRender(L,t,n,i,r,a),u=B.get(t,Q||n),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),e.isImmediateRenderObject){m.setMaterial(r);var o=Be(n,t.fog,r,e);N.geometry=null,N.program=null,N.wireframe=!1,function(e,t){e.render((function(e){L.renderBufferImmediate(e,t)}))}(e,o)}else L.renderBufferDirect(n,t.fog,i,r,e,a);e.onAfterRender(L,t,n,i,r,a),u=B.get(t,Q||n)}function Ce(e,t,n){var i=g.get(e),r=u.state.lights,a=u.state.shadowsArray,o=r.state.version,s=M.getParameters(e,r.state,a,t,q.numPlanes,q.numIntersection,n),l=M.getProgramCacheKey(e,s),A=i.program,c=!0;if(void 0===A)e.addEventListener("dispose",me);else if(A.cacheKey!==l)ve(e);else if(i.lightsStateVersion!==o)i.lightsStateVersion=o,c=!1;else{if(void 0!==s.shaderID)return;c=!1}if(c){if(s.shaderID){var h=Ki[s.shaderID];i.shader={name:e.type,uniforms:Pi(h.uniforms),vertexShader:h.vertexShader,fragmentShader:h.fragmentShader}}else i.shader={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};e.onBeforeCompile(i.shader,L),l=M.getProgramCacheKey(e,s),A=M.acquireProgram(e,i.shader,s,l),i.program=A,e.program=A}var d=A.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var f=0;f<L.maxMorphTargets;f++)d["morphTarget"+f]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;for(f=0;f<L.maxMorphNormals;f++)d["morphNormal"+f]>=0&&e.numSupportedMorphNormals++}var p=i.shader.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(i.numClippingPlanes=q.numPlanes,i.numIntersection=q.numIntersection,p.clippingPlanes=q.uniform),i.fog=t,i.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isAMRTBasicMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),i.lightsStateVersion=o,i.needsLights&&(p.ambientLightColor.value=r.state.ambient,p.lightProbe.value=r.state.probe,p.directionalLights.value=r.state.directional,p.spotLights.value=r.state.spot,p.rectAreaLights.value=r.state.rectArea,p.pointLights.value=r.state.point,p.hemisphereLights.value=r.state.hemi,p.directionalShadowMap.value=r.state.directionalShadowMap,p.directionalShadowMatrix.value=r.state.directionalShadowMatrix,p.spotShadowMap.value=r.state.spotShadowMap,p.spotShadowMatrix.value=r.state.spotShadowMatrix,p.pointShadowMap.value=r.state.pointShadowMap,p.pointShadowMatrix.value=r.state.pointShadowMatrix);var m=i.program.getUniforms(),v=sa.seqWithValue(m.seq,p);i.uniformsList=v}function Be(e,t,n,i){y.resetTextureUnits();var r=g.get(n),a=u.state.lights;if(ee&&(te||e!==z)){var o=e===z&&n.id===O;q.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,e,r,o)}n.version===r.__version&&(void 0===r.program||n.fog&&r.fog!==t||r.needsLights&&r.lightsStateVersion!==a.state.version?n.needsUpdate=!0:void 0===r.numClippingPlanes||r.numClippingPlanes===q.numPlanes&&r.numIntersection===q.numIntersection||(n.needsUpdate=!0)),n.version!==r.__version&&(Ce(n,t,i),r.__version=n.version);var s,l,A=!1,c=!1,h=!1,f=r.program,v=f.getUniforms(),w=r.shader.uniforms;if(m.useProgram(f.program)&&(A=!0,c=!0,h=!0),n.id!==O&&(O=n.id,c=!0),A||z!==e){if(f.numMultiviewViews>0?ue.updateCameraProjectionMatricesUniform(e,v):v.setValue(d,"projectionMatrix",e.projectionMatrix),p.logarithmicDepthBuffer&&v.setValue(d,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),z!==e&&(z=e,c=!0,h=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.isAMRTBasicMaterial||n.isACFBasicMaterial||n.isAMRTShadowMaterial||n.envMap){var x=v.map.cameraPosition;void 0!==x&&x.setValue(d,ae.setFromMatrixPosition(e.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isAMRTBasicMaterial||n.isACFBasicMaterial||n.isShaderMaterial)&&v.setValue(d,"isOrthographic",!0===e.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isAMRTBasicMaterial||n.isACFBasicMaterial||n.isShaderMaterial||n.skinning||n.isAMRTShadowMaterial)&&(f.numMultiviewViews>0?ue.updateCameraViewMatricesUniform(e,v):(v.setValue(d,"viewMatrix",e.matrixWorldInverse),v.setValue(d,"viewMatrixR",e.matrixWorldInverseR)))}if(n.skinning){v.setOptional(d,i,"bindMatrix"),v.setOptional(d,i,"bindMatrixInverse");var b=i.skeleton;if(b){var M=b.bones;if(p.floatVertexTextures){if(void 0===b.boneTexture){var C=Math.sqrt(4*M.length);C=et.ceilPowerOfTwo(C),C=Math.max(C,4);var B=new Float32Array(C*C*4);B.set(b.boneMatrices);var E=new Hi(B,C,C,ce,ne);b.boneMatrices=B,b.boneTexture=E,b.boneTextureSize=C}v.setValue(d,"boneTexture",b.boneTexture,y),v.setValue(d,"boneTextureSize",b.boneTextureSize)}else v.setOptional(d,b,"boneMatrices")}}return(c||r.receiveShadow!==i.receiveShadow)&&(r.receiveShadow=i.receiveShadow,v.setValue(d,"receiveShadow",i.receiveShadow)),c&&(v.setValue(d,"toneMappingExposure",L.toneMappingExposure),v.setValue(d,"toneMappingWhitePoint",L.toneMappingWhitePoint),r.needsLights&&(l=h,(s=w).ambientLightColor.needsUpdate=l,s.lightProbe.needsUpdate=l,s.directionalLights.needsUpdate=l,s.pointLights.needsUpdate=l,s.spotLights.needsUpdate=l,s.rectAreaLights.needsUpdate=l,s.hemisphereLights.needsUpdate=l),t&&n.fog&&function(e,t){e.fogColor.value.copy(t.color),t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)}(w,t),n.isMeshBasicMaterial?Ee(w,n):n.isMeshLambertMaterial?(Ee(w,n),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(w,n)):n.isMeshPhongMaterial?(Ee(w,n),n.isMeshToonMaterial?function(e,t){Se(e,t),t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(w,n):Se(w,n)):n.isMeshStandardMaterial?(Ee(w,n),n.isMeshPhysicalMaterial?function(e,t){Te(e,t),e.reflectivity.value=t.reflectivity,e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.sheen&&e.sheen.value.copy(t.sheen);t.clearcoatNormalMap&&(e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),e.clearcoatNormalMap.value=t.clearcoatNormalMap,1===t.side&&e.clearcoatNormalScale.value.negate());e.transparency.value=t.transparency}(w,n):Te(w,n)):n.isAMRTBasicMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.emissive.value.copy(t.emissive),e.smoothness.value=t.smoothness,e.metalness.value=t.metallic,e.reflectivity.value=t.reflectivity,e.transparency.value=t.transparency,e.envYMatrix.value.copy(t.envYMatrix),e.reflecYMatrix.value.copy(t.reflecYMatrix),e.clippingTransparent.value=t.clippingTransparent,e.planeOffset.value=t.planeOffset,t.albedo&&(e.albedo.value=t.albedo,!0===t.albedo.matrixAutoUpdate&&t.albedo.updateMatrix(),e.albedoUVTransform.value.copy(t.albedo.matrix));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value=t.normalScale,!0===t.normalMap.matrixAutoUpdate&&t.normalMap.updateMatrix(),e.normalUVTransform.value.copy(t.normalMap.matrix));t.normalMap2&&(e.normalMap2.value=t.normalMap2,e.normalScale2.value=t.normalScale2,!0===t.normalMap2.matrixAutoUpdate&&t.normalMap2.updateMatrix(),e.normal2UVTransform.value.copy(t.normalMap2.matrix));t.metallicMap&&(e.metallicMap.value=t.metallicMap,!0===t.metallicMap.matrixAutoUpdate&&t.metallicMap.updateMatrix(),e.metalUVTransform.value.copy(t.metallicMap.matrix));t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,!0===t.roughnessMap.matrixAutoUpdate&&t.roughnessMap.updateMatrix(),e.roughUVTransform.value.copy(t.roughnessMap.matrix));t.aoMap&&(e.aoMap.value=t.aoMap,e.aoScale.value=t.aoScale,!0===t.aoMap.matrixAutoUpdate&&t.aoMap.updateMatrix(),e.aoUVTransform.value.copy(t.aoMap.matrix));t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap,!0===t.emissiveMap.matrixAutoUpdate&&t.emissiveMap.updateMatrix(),e.emissiveUVTransform.value.copy(t.emissiveMap.matrix));t.reflectMap&&(e.reflectMap.value=t.reflectMap,e.reflectIntensity.value=t.reflectIntensity);e.cutout.value=t.cutout,t.envMap&&(e.envMap.value=t.envMap,e.envMapIntensity.value=t.envMapIntensity,e.flipEnvMap.value=t.envMap.isCubeTexture?-1:1,e.refractionRatio.value=t.refractionRatio,e.maxMipLevel.value=8);t.alphaMap&&(e.alphaMap.value=t.alphaMap,!0===t.alphaMap.matrixAutoUpdate&&t.alphaMap.updateMatrix(),e.alphaUVTransform.value.copy(t.alphaMap.matrix));t.dissolveMap&&(e.dissolveMap.value=t.dissolveMap,e.dissolveRatio.value=t.dissolveRatio,e.dissolveColor.value=t.dissolveColor,!0===t.dissolveMap.matrixAutoUpdate&&t.dissolveMap.updateMatrix());t.ssrTexture&&(e.ssrTexture.value=t.ssrTexture,e.ssrTextureMatrix.value=t.ssrTextureMatrix,e.maxDistance.value=t.maxDistance,e.ssrOpacity.value=t.ssrOpacity,e.fresnelCoe.value=t.fresnelCoe,e.virtualCameraNear.value=t.virtualCameraNear,e.virtualCameraFar.value=t.virtualCameraFar,e.virtualCameraMatrixWorld.value=t.virtualCameraMatrixWorld,e.virtualCameraProjectionMatrix.value=t.virtualCameraProjectionMatrix,e.virtualCameraProjectionMatrixInverse.value=t.virtualCameraProjectionMatrixInverse,e.resolution.value=t.resolution,e.tDepth.value=t.depthTexture,!0===t.ssrTexture.matrixAutoUpdate&&t.ssrTexture.updateMatrix())}(w,n):n.isAMRTShadowMaterial?function(e,t){e.color.value=t.color,e.shadowPlane.value=t.shadowPlane,e.lightDirection.value=t.lightDirection,e.shadowLength.value=t.shadowLength,e.center.value=t.center,e.shadowStrength.value=t.shadowStrength}(w,n):n.isMeshMatcapMaterial?(Ee(w,n),function(e,t){t.matcap&&(e.matcap.value=t.matcap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(w,n)):n.isMeshDepthMaterial?(Ee(w,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(w,n)):n.isMeshDistanceMaterial?(Ee(w,n),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias);e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(w,n)):n.isMeshNormalMaterial?(Ee(w,n),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(w,n)):n.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity}(w,n),n.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(w,n)):n.isPointsMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*X,e.scale.value=.5*W,t.map&&(e.map.value=t.map);t.alphaMap&&(e.alphaMap.value=t.alphaMap);var n;t.map?n=t.map:t.alphaMap&&(n=t.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(w,n):n.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map);t.alphaMap&&(e.alphaMap.value=t.alphaMap);var n;t.map?n=t.map:t.alphaMap&&(n=t.alphaMap);void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}(w,n):n.isShadowMaterial?(w.color.value.copy(n.color),w.opacity.value=n.opacity):n.isACFBasicMaterial&&(n.color&&w.diffuse.value.copy(n.color),n.map&&(w.map.value=n.map)),void 0!==w.ltc_1&&(w.ltc_1.value=Yi.LTC_1),void 0!==w.ltc_2&&(w.ltc_2.value=Yi.LTC_2),sa.upload(d,r.uniformsList,w,y),n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(sa.upload(d,r.uniformsList,w,y),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&v.setValue(d,"center",i.center),f.numMultiviewViews>0?ue.updateObjectMatricesUniforms(i,e,v):(v.setValue(d,"modelViewMatrix",i.modelViewMatrix),v.setValue(d,"normalMatrix",i.normalMatrix)),v.setValue(d,"modelMatrix",i.matrixWorld),f}function Ee(e,t){var n;e.opacity.value=t.opacity,t.color&&e.diffuse.value.copy(t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap),t.envMap&&(e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio,e.maxMipLevel.value=g.get(t.envMap).__maxMipLevel),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity),t.map?n=t.map:t.specularMap?n=t.specularMap:t.displacementMap?n=t.displacementMap:t.normalMap?n=t.normalMap:t.bumpMap?n=t.bumpMap:t.roughnessMap?n=t.roughnessMap:t.metalnessMap?n=t.metalnessMap:t.alphaMap?n=t.alphaMap:t.emissiveMap&&(n=t.emissiveMap),void 0!==n&&(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate&&n.updateMatrix(),e.uvTransform.value.copy(n.matrix))}function Se(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function Te(e,t){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,1===t.side&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),1===t.side&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}ye.setAnimationLoop((function(e){he.isPresenting()||ge&&ge(e)})),"undefined"!=typeof window&&ye.setContext(window),this.setAnimationLoop=function(e){ge=e,he.setAnimationLoop(e),ye.start()},this.render=function(e,t){var n,i;if(void 0!==arguments[2]&&(console.warn("the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("the forceClear argument has been removed. Use .clear() instead."),i=arguments[3]),t&&t.isCamera){if(!F){N.geometry=null,N.program=null,N.wireframe=!1,O=-1,z=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),he.enabled&&he.isPresenting()&&(t=he.getCamera(t)),(u=B.get(e,t)).init(),e.onBeforeRender(L,e,t,n||D),re.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),J.setFromMatrix(re),te=this.localClippingEnabled,ee=q.init(this.clippingPlanes,te,t),(h=C.get(e,t)).init(),xe(e,t,0,L.sortObjects),!0===L.sortObjects&&h.sort(),ee&&q.beginShadows();var r=u.state.shadowsArray;de.render(r,e,t),u.setupLights(t),ee&&q.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),he.enabled&&ue.isAvailable()&&ue.attachCamera(t),E.render(h,e,t,i);var a=h.opaque,o=h.transparent;if(e.overrideMaterial){var s=e.overrideMaterial;a.length&&be(a,e,t,s),o.length&&be(o,e,t,s)}else a.length&&be(a,e,t),o.length&&be(o,e,t);e.onAfterRender(L,e,t),null!==D&&(y.updateRenderTargetMipmap(D),y.updateMultisampleRenderTarget(D)),m.buffers.depth.setTest(!0),m.buffers.depth.setMask(!0),m.buffers.color.setMask(!0),m.setPolygonOffset(!1),he.enabled&&(ue.isAvailable()&&ue.detachCamera(t),he.submitFrame()),h=null,u=null}}else console.error("camera is not an instance of Camera.")},this.renderArray=function(e,t,n){if(!F){N.geometry=null,N.program=null,N.wireframe=!1,O=-1,z=null,null===n.parent&&n.updateMatrixWorld(),(u=B.get(t,n)).init(),re.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),J.setFromMatrix(re),te=this.localClippingEnabled,ee=q.init(this.clippingPlanes,te,n),(h=C.get(t,n)).init();for(var i=0;i<e.length;i++)we(e[i],n,0,L.sortObjects);!0===L.sortObjects&&h.sort(),ee&&q.beginShadows();var r=u.state.shadowsArray;de.render(r,t,n),u.setupLights(n),ee&&q.endShadows();var a=h.opaque,o=h.transparent;if(t.overrideMaterial){var s=t.overrideMaterial;a.length&&be(a,t,n,s),o.length&&be(o,t,n,s)}else a.length&&be(a,t,n),o.length&&be(o,t,n);null!==D&&(y.updateRenderTargetMipmap(D),y.updateMultisampleRenderTarget(D)),m.buffers.depth.setTest(!0),m.buffers.depth.setMask(!0),m.buffers.color.setMask(!0),m.setPolygonOffset(!1),h=null,u=null}},this.setFramebuffer=function(e){k!==e&&null===D&&d.bindFramebuffer(d.FRAMEBUFFER,e),k=e},this.getActiveCubeFace=function(){return P},this.getActiveMipmapLevel=function(){return U},this.getRenderTarget=function(){return D},this.setRenderTarget=function(e,t,n){D=e,P=t,U=n,e&&void 0===g.get(e).__webglFramebuffer&&y.setupRenderTarget(e);var i=k,r=!1;if(e){var a=g.get(e).__webglFramebuffer;e.isWebGLRenderTargetCube?(i=a[t||0],r=!0):i=e.isWebGLMultisampleRenderTarget?g.get(e).__webglMultisampledFramebuffer:a,G.copy(e.viewport),H.copy(e.scissor),V=e.scissorTest}else G.copy(Y).multiplyScalar(X).floor(),H.copy(K).multiplyScalar(X).floor(),V=Z;if(R!==i&&(d.bindFramebuffer(d.FRAMEBUFFER,i),R=i),m.viewport(G),m.scissor(H),m.setScissorTest(V),r){var o=g.get(e.texture);d.framebufferTexture2D(d.FRAMEBUFFER,d.COLOR_ATTACHMENT0,d.TEXTURE_CUBE_MAP_POSITIVE_X+(t||0),o.__webglTexture,n||0)}},this.readRenderTargetPixels=function(e,t,n,i,r,a,o){if(e&&e.isWebGLRenderTarget){var s=g.get(e).__webglFramebuffer;if(e.isWebGLRenderTargetCube&&void 0!==o&&(s=s[o]),s){var l=!1;s!==R&&(d.bindFramebuffer(d.FRAMEBUFFER,s),l=!0);try{var A=e.texture,c=A.format,h=A.type;if(c!==ce&&I.convert(c)!==d.getParameter(d.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("renderTarget is not in RGBA or implementation defined format.");if(!(h===$||I.convert(h)===d.getParameter(d.IMPLEMENTATION_COLOR_READ_TYPE)||h===ne&&(p.isWebGL2||f.get("OES_texture_float")||f.get("WEBGL_color_buffer_float"))||h===ie&&(p.isWebGL2?f.get("EXT_color_buffer_float"):f.get("EXT_color_buffer_half_float"))))return void console.error("renderTarget is not in UnsignedByteType or implementation defined type.");d.checkFramebufferStatus(d.FRAMEBUFFER)===d.FRAMEBUFFER_COMPLETE?t>=0&&t<=e.width-i&&n>=0&&n<=e.height-r&&d.readPixels(t,n,i,r,I.convert(c),I.convert(h),a):console.error("readPixels from renderTarget failed. Framebuffer not complete.")}finally{l&&d.bindFramebuffer(d.FRAMEBUFFER,R)}}}else console.error("renderTarget is not WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,n){void 0===n&&(n=0);var i=Math.pow(2,-n),r=Math.floor(t.image.width*i),a=Math.floor(t.image.height*i),o=I.convert(t.format);y.setTexture2D(t,0),d.copyTexImage2D(d.TEXTURE_2D,n,o,e.x,e.y,r,a,0),m.unbindTexture()},this.copyTextureToTexture=function(e,t,n,i){var r=t.image.width,a=t.image.height,o=I.convert(n.format),s=I.convert(n.type);y.setTexture2D(n,0),t.isDataTexture?d.texSubImage2D(d.TEXTURE_2D,i||0,e.x,e.y,r,a,o,s,t.image.data):d.texSubImage2D(d.TEXTURE_2D,i||0,e.x,e.y,o,s,t.image),m.unbindTexture()},this.initTexture=function(e){y.setTexture2D(e,0),m.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function eo(e,t){this.name="",this.color=new Fn(e),this.density=void 0!==t?t:25e-5}function to(e,t,n){this.name="",this.color=new Fn(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3}function no(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=Xe,this.updateRange={offset:0,count:-1},this.version=0}function io(e,t,n,i){this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===i}function ro(e){On.call(this),this.type="SpriteMaterial",this.color=new Fn(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(e)}Object.assign(Ja.prototype,Je.prototype),Object.assign(qa.prototype,Je.prototype),Object.assign(eo.prototype,{isFogExp2:!0,clone:function(){return new eo(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(to.prototype,{isFog:!0,clone:function(){return new to(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(no.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(no.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(var i=0,r=this.stride;i<r;i++)this.array[e+i]=t.array[n+i];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(e){return this.onUploadCallback=e,this}}),Object.defineProperties(io.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(io.prototype,{isInterleavedBufferAttribute:!0,setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this},setXYZ:function(e,t,n,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this},setXYZW:function(e,t,n,i,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=r,this}}),ro.prototype=Object.create(On.prototype),ro.prototype.constructor=ro,ro.prototype.isSpriteMaterial=!0,ro.prototype.copy=function(e){return On.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this};var ao=new at,oo=new at,so=new at,lo=new tt,Ao=new tt,co=new bt,ho=new at,uo=new at,fo=new at,po=new tt,mo=new tt,vo=new tt;function go(e){if(zt.call(this),this.type="Sprite",void 0===Xa){Xa=new si;var t=new no(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);Xa.setIndex([0,1,2,0,2,3]),Xa.setAttribute("position",new io(t,3,0,!1)),Xa.setAttribute("uv",new io(t,2,3,!1))}this.geometry=Xa,this.material=void 0!==e?e:new ro,this.center=new tt(.5,.5)}function yo(e,t,n,i,r,a){lo.subVectors(e,n).addScalar(.5).multiply(i),void 0!==r?(Ao.x=a*lo.x-r*lo.y,Ao.y=r*lo.x+a*lo.y):Ao.copy(lo),e.copy(t),e.x+=Ao.x,e.y+=Ao.y,e.applyMatrix4(co)}go.prototype=Object.assign(Object.create(zt.prototype),{constructor:go,isSprite:!0,raycast:function(e,t){null===e.camera&&console.error('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),oo.setFromMatrixScale(this.matrixWorld),co.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),so.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&oo.multiplyScalar(-so.z);var n,i,r=this.material.rotation;0!==r&&(i=Math.cos(r),n=Math.sin(r));var a=this.center;yo(ho.set(-.5,-.5,0),so,a,oo,n,i),yo(uo.set(.5,-.5,0),so,a,oo,n,i),yo(fo.set(.5,.5,0),so,a,oo,n,i),po.set(0,0),mo.set(1,0),vo.set(1,1);var o=e.ray.intersectTriangle(ho,uo,fo,!1,ao);if(null!==o||(yo(uo.set(-.5,.5,0),so,a,oo,n,i),mo.set(0,1),null!==(o=e.ray.intersectTriangle(ho,fo,uo,!1,ao)))){var s=e.ray.origin.distanceTo(ao);s<e.near||s>e.far||t.push({distance:s,point:ao.clone(),uv:Tn.getUV(ao,ho,uo,fo,po,mo,vo,new tt),face:null,object:this})}},clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return zt.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}});var wo=new at,xo=new at;function bo(){zt.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}bo.prototype=Object.assign(Object.create(zt.prototype),{constructor:bo,isLOD:!0,copy:function(e){zt.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,i=t.length;n<i;n++){var r=t[n];this.addLevel(r.object.clone(),r.distance)}return this.autoUpdate=e.autoUpdate,this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var n=this.levels,i=0;i<n.length&&!(t<n[i].distance);i++);return n.splice(i,0,{distance:t,object:e}),this.add(e),this},getObjectForDistance:function(e){var t=this.levels;if(t.length>0){for(var n=1,i=t.length;n<i&&!(e<t[n].distance);n++);return t[n-1].object}return null},raycast:function(e,t){if(this.levels.length>0){wo.setFromMatrixPosition(this.matrixWorld);var n=e.ray.origin.distanceTo(wo);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){var t=this.levels;if(t.length>1){wo.setFromMatrixPosition(e.matrixWorld),xo.setFromMatrixPosition(this.matrixWorld);var n=wo.distanceTo(xo);t[0].object.visible=!0;for(var i=1,r=t.length;i<r&&n>=t[i].distance;i++)t[i-1].object.visible=!1,t[i].object.visible=!0;for(;i<r;i++)t[i].object.visible=!1}},toJSON:function(e){var t=zt.prototype.toJSON.call(this,e);!1===this.autoUpdate&&(t.object.autoUpdate=!1),t.object.levels=[];for(var n=this.levels,i=0,r=n.length;i<r;i++){var a=n[i];t.object.levels.push({object:a.object.uuid,distance:a.distance})}return t}});var Mo=new bt,Co=new at;function Bo(e,t){e&&e.isGeometry&&console.error("SkinnedMesh no longer supports Geometry. Use BufferGeometry instead."),Ei.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new bt,this.bindMatrixInverse=new bt}Bo.prototype=Object.assign(Object.create(Ei.prototype),{constructor:Bo,isSkinnedMesh:!0,bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var e=new ut,t=this.geometry.attributes.skinWeight,n=0,i=t.count;n<i;n++){e.x=t.getX(n),e.y=t.getY(n),e.z=t.getZ(n),e.w=t.getW(n);var r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}},updateMatrixWorld:function(e){Ei.prototype.updateMatrixWorld.call(this,e),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},copy:function(e){return Ei.prototype.copy.call(this,e),this.isSkinnedMesh=!0,e.boneNum&&(this.boneNum=e.boneNum),this.skeleton=e.skeleton,this},getVertex:function(e,t){var n=this.geometry.attributes.position;if(!(e>=n.count)&&this.geometry.attributes.skinIndex_4){Co.set(n.array[3*e],n.array[3*e+1],n.array[3*e+2]);var i=t;i||(i=new at(0,0,0)),Co.applyMatrix4(this.bindMatrix);var r=this.geometry.attributes.skinIndex_4.array,a=this.geometry.attributes.skinWeight_4.array;return i.copy(this.getVertexByWeight(r[4*e],a[4*e],Co)),i.add(this.getVertexByWeight(r[4*e+1],a[4*e+1],Co)),i.add(this.getVertexByWeight(r[4*e+2],a[4*e+2],Co)),i.add(this.getVertexByWeight(r[4*e+3],a[4*e+3],Co)),this.boneNum>4&&(r=this.geometry.attributes.skinIndex_8.array,a=this.geometry.attributes.skinWeight_8.array,i.add(this.getVertexByWeight(r[4*e],a[4*e],Co)),i.add(this.getVertexByWeight(r[4*e+1],a[4*e+1],Co)),i.add(this.getVertexByWeight(r[4*e+2],a[4*e+2],Co)),i.add(this.getVertexByWeight(r[4*e+3],a[4*e+3],Co))),i.applyMatrix4(this.bindMatrixInverse),i}},getVertexByWeight:function(e,t,n){if(e<this.skeleton.bones.length){var i=this.skeleton.bones[e].matrixWorld;return Mo.multiplyMatrices(i,this.skeleton.boneInverses[e]),n.clone().applyMatrix4(Mo).multiplyScalar(t)}return new at}});var Eo=new bt,So=new bt;function To(e,t,n){if(this.meshId=t,e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===n)this.calculateInverses();else if(this.bones.length===n.length)this.boneInverses=n.slice(0);else{console.warn("Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var i=0,r=this.bones.length;i<r;i++)this.boneInverses.push(new bt)}}function _o(){zt.call(this),this.type="Bone"}Object.assign(To.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var n=new bt;if(this.bones[e])if(this.bones[e].meshdata){for(var i=this.bones[e].meshdata,r=!1,a=0;a<i.length;a++){for(var o=0;o<i[a].meshList.length;o++)if(i[a].meshList[o]===this.meshId){r=!0,n.getInverse((new bt).fromArray(i[a].matrix));break}if(r)break}r||(this.bones[e].version>=3?n.getInverse(this.bones[e].offsetMatrix):n.getInverse(this.bones[e].matrixWorld))}else this.bones[e].version>=3?n.getInverse(this.bones[e].offsetMatrix):n.getInverse(this.bones[e].matrixWorld);this.boneInverses.push(n)}},pose:function(){var e,t,n;for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&e.matrixWorld.getInverse(this.boneInverses[t]);for(t=0,n=this.bones.length;t<n;t++)(e=this.bones[t])&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},update:function(){for(var e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture,r=0,a=e.length;r<a;r++){var o=e[r]?e[r].matrixWorld:So;Eo.multiplyMatrices(o,t[r]),Eo.toArray(n,16*r)}void 0!==i&&(i.needsUpdate=!0)},clone:function(){return new To(this.bones,this.boneInverses)},getBoneByName:function(e){for(var t=0,n=this.bones.length;t<n;t++){var i=this.bones[t];if(i.name===e)return i}}}),_o.prototype=Object.assign(Object.create(zt.prototype),{constructor:_o,isBone:!0});var Io=new bt,Lo=new bt,Fo=[],ko=new Ei,Po=new tn;function Uo(e,t,n){Ei.call(this,e,t),this.bufferArray=new Float32Array(16*n),this.instanceMatrix=new zn(this.bufferArray,16),this.count=n,this.objects=[],null==this.geometry.boundingBox&&this.geometry.computeBoundingBox(),Po.copy(this.geometry.boundingBox)}function Do(e){On.call(this),this.type="LineBasicMaterial",this.color=new Fn(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.setValues(e)}Uo.prototype=Object.assign(Object.create(Ei.prototype),{constructor:Uo,isInstancedMesh:!0,getMatrixAt:function(e,t){t.fromArray(this.instanceMatrix.array,16*e)},raycast:function(e,t){var n=this.matrixWorld,i=this.count;if(ko.geometry=this.geometry,ko.material=this.material,void 0!==ko.material)for(var r=0;r<i;r++)this.getMatrixAt(r,Io),Lo.multiplyMatrices(n,Io),ko.matrixWorld=Lo,ko.raycast(e,Fo),Fo.length>0&&(Fo[0].instanceId=r,Fo[0].object=this,t.push(Fo[0]),Fo.length=0)},setMatrixAt:function(e,t){t.toArray(this.instanceMatrix.array,16*e),0===e?(this.geometry.boundingBox.copy((new tn).copy(Po).applyMatrix4(t)),null==this.geometry.boundingSphere&&(this.geometry.boundingSphere=new an)):this.geometry.boundingBox.union((new tn).copy(Po).applyMatrix4(t)),this.geometry.boundingBox.getBoundingSphere(this.geometry.boundingSphere)},updateMorphTargets:function(){}}),Do.prototype=Object.create(On.prototype),Do.prototype.constructor=Do,Do.prototype.isLineBasicMaterial=!0,Do.prototype.copy=function(e){return On.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this};var Ro=new at,Oo=new at,No=new bt,zo=new dn,Qo=new an;function Go(e,t,n){1===n&&console.error("Line: parameter LinePieces no longer supported. Use LineSegments instead."),zt.call(this),this.type="Line",this.geometry=void 0!==e?e:new si,this.material=void 0!==t?t:new Do({color:16777215*Math.random()})}Go.prototype=Object.assign(Object.create(zt.prototype),{constructor:Go,isLine:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[0],i=1,r=t.count;i<r;i++)Ro.fromBufferAttribute(t,i-1),Oo.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=Ro.distanceTo(Oo);e.setAttribute("lineDistance",new Yn(n,1))}else console.warn("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices;(n=e.lineDistances)[0]=0;for(i=1,r=a.length;i<r;i++)n[i]=n[i-1],n[i]+=a[i-1].distanceTo(a[i])}return this},raycast:function(e,t){var n=e.linePrecision,i=this.geometry,r=this.matrixWorld;if(null===i.boundingSphere&&i.computeBoundingSphere(),Qo.copy(i.boundingSphere),Qo.applyMatrix4(r),Qo.radius+=n,!1!==e.ray.intersectsSphere(Qo)){No.getInverse(r),zo.copy(e.ray).applyMatrix4(No);var a=n/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,s=new at,l=new at,A=new at,c=new at,h=this&&this.isLineSegments?2:1;if(i.isBufferGeometry){var u=i.index,d=i.attributes.position.array;if(null!==u)for(var f=u.array,p=0,m=f.length-1;p<m;p+=h){var v=f[p],g=f[p+1];if(s.fromArray(d,3*v),l.fromArray(d,3*g),!(zo.distanceSqToSegment(s,l,c,A)>o))c.applyMatrix4(this.matrixWorld),(x=e.ray.origin.distanceTo(c))<e.near||x>e.far||t.push({distance:x,point:A.clone().applyMatrix4(this.matrixWorld),index:p,face:null,faceIndex:null,object:this})}else for(p=0,m=d.length/3-1;p<m;p+=h){if(s.fromArray(d,3*p),l.fromArray(d,3*p+3),!(zo.distanceSqToSegment(s,l,c,A)>o))c.applyMatrix4(this.matrixWorld),(x=e.ray.origin.distanceTo(c))<e.near||x>e.far||t.push({distance:x,point:A.clone().applyMatrix4(this.matrixWorld),index:p,face:null,faceIndex:null,object:this})}}else if(i.isGeometry){var y=i.vertices,w=y.length;for(p=0;p<w-1;p+=h){var x;if(!(zo.distanceSqToSegment(y[p],y[p+1],c,A)>o))c.applyMatrix4(this.matrixWorld),(x=e.ray.origin.distanceTo(c))<e.near||x>e.far||t.push({distance:x,point:A.clone().applyMatrix4(this.matrixWorld),index:p,face:null,faceIndex:null,object:this})}}}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}});var Ho=new at,Vo=new at;function jo(e,t){Go.call(this,e,t),this.type="LineSegments"}function Wo(e,t){Go.call(this,e,t),this.type="LineLoop"}function Xo(e){On.call(this),this.type="PointsMaterial",this.color=new Fn(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}jo.prototype=Object.assign(Object.create(Go.prototype),{constructor:jo,isLineSegments:!0,computeLineDistances:function(){var e=this.geometry;if(e.isBufferGeometry)if(null===e.index){for(var t=e.attributes.position,n=[],i=0,r=t.count;i<r;i+=2)Ho.fromBufferAttribute(t,i),Vo.fromBufferAttribute(t,i+1),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+Ho.distanceTo(Vo);e.setAttribute("lineDistance",new Yn(n,1))}else console.warn("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(e.isGeometry){var a=e.vertices;for(n=e.lineDistances,i=0,r=a.length;i<r;i+=2)Ho.copy(a[i]),Vo.copy(a[i+1]),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+Ho.distanceTo(Vo)}return this}}),Wo.prototype=Object.assign(Object.create(Go.prototype),{constructor:Wo,isLineLoop:!0}),Xo.prototype=Object.create(On.prototype),Xo.prototype.constructor=Xo,Xo.prototype.isPointsMaterial=!0,Xo.prototype.copy=function(e){return On.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.morphTargets=e.morphTargets,this};var Yo=new bt,Ko=new dn,Zo=new an,Jo=new at;function qo(e,t){zt.call(this),this.type="Points",this.geometry=void 0!==e?e:new si,this.material=void 0!==t?t:new Xo({color:16777215*Math.random()}),this.updateMorphTargets()}function $o(e,t,n,i,r,a,o){var s=Ko.distanceSqToPoint(e);if(s<n){var l=new at;Ko.closestPointToPoint(e,l),l.applyMatrix4(i);var A=r.ray.origin.distanceTo(l);if(A<r.near||A>r.far)return;a.push({distance:A,distanceToRay:Math.sqrt(s),point:l,index:t,face:null,object:o})}}function es(e,t,n,i,r,a,o,s,l,A,c,h){ht.call(this,null,a,o,s,l,A,i,r,c,h),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function ts(e,t,n,i,r,a,o,s,l){ht.call(this,e,t,n,i,r,a,o,s,l),this.needsUpdate=!0}function ns(e,t,n,i,r,a,o,s,l,A){if((A=void 0!==A?A:fe)!==fe&&A!==pe)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&A===fe&&(n=ee),void 0===n&&A===pe&&(n=se),ht.call(this,null,i,r,a,o,s,A,n,l),this.image={width:e,height:t},this.magFilter=void 0!==o?o:X,this.minFilter=void 0!==s?s:X,this.flipY=!1,this.generateMipmaps=!1}function is(e){si.call(this),this.type="WireframeGeometry";var t,n,i,r,a,o,s,l,A,c,h=[],u=[0,0],d={},f=["a","b","c"];if(e&&e.isGeometry){var p=e.faces;for(t=0,i=p.length;t<i;t++){var m=p[t];for(n=0;n<3;n++)s=m[f[n]],l=m[f[(n+1)%3]],u[0]=Math.min(s,l),u[1]=Math.max(s,l),void 0===d[A=u[0]+","+u[1]]&&(d[A]={index1:u[0],index2:u[1]})}for(A in d)o=d[A],c=e.vertices[o.index1],h.push(c.x,c.y,c.z),c=e.vertices[o.index2],h.push(c.x,c.y,c.z)}else if(e&&e.isBufferGeometry){var v,g,y,w,x,b,M;if(c=new at,null!==e.index){for(v=e.attributes.position,g=e.index,0===(y=e.groups).length&&(y=[{start:0,count:g.count,materialIndex:0}]),r=0,a=y.length;r<a;++r)for(t=x=(w=y[r]).start,i=x+w.count;t<i;t+=3)for(n=0;n<3;n++)s=g.getX(t+n),l=g.getX(t+(n+1)%3),u[0]=Math.min(s,l),u[1]=Math.max(s,l),void 0===d[A=u[0]+","+u[1]]&&(d[A]={index1:u[0],index2:u[1]});for(A in d)o=d[A],c.fromBufferAttribute(v,o.index1),h.push(c.x,c.y,c.z),c.fromBufferAttribute(v,o.index2),h.push(c.x,c.y,c.z)}else for(t=0,i=(v=e.attributes.position).count/3;t<i;t++)for(n=0;n<3;n++)b=3*t+n,c.fromBufferAttribute(v,b),h.push(c.x,c.y,c.z),M=3*t+(n+1)%3,c.fromBufferAttribute(v,M),h.push(c.x,c.y,c.z)}this.setAttribute("position",new Yn(h,3))}function rs(e,t,n){Li.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new as(e,t,n)),this.mergeVertices()}function as(e,t,n){si.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:n};var i,r,a=[],o=[],s=[],l=[],A=1e-5,c=new at,h=new at,u=new at,d=new at,f=new at;e.length<3&&console.error("ParametricGeometry: Function must now modify a Vector3 as third parameter.");var p=t+1;for(i=0;i<=n;i++){var m=i/n;for(r=0;r<=t;r++){var v=r/t;e(v,m,h),o.push(h.x,h.y,h.z),v-A>=0?(e(v-A,m,u),d.subVectors(h,u)):(e(v+A,m,u),d.subVectors(u,h)),m-A>=0?(e(v,m-A,u),f.subVectors(h,u)):(e(v,m+A,u),f.subVectors(u,h)),c.crossVectors(d,f).normalize(),s.push(c.x,c.y,c.z),l.push(v,m)}}for(i=0;i<n;i++)for(r=0;r<t;r++){var g=i*p+r,y=i*p+r+1,w=(i+1)*p+r+1,x=(i+1)*p+r;a.push(g,y,x),a.push(y,w,x)}this.setIndex(a),this.setAttribute("position",new Yn(o,3)),this.setAttribute("normal",new Yn(s,3)),this.setAttribute("uv",new Yn(l,2))}function os(e,t,n,i){Li.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i},this.fromBufferGeometry(new ss(e,t,n,i)),this.mergeVertices()}function ss(e,t,n,i){si.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i},n=n||1;var r=[],a=[];function o(e,t,n,i){var r,a,o=Math.pow(2,i),l=[];for(r=0;r<=o;r++){l[r]=[];var A=e.clone().lerp(n,r/o),c=t.clone().lerp(n,r/o),h=o-r;for(a=0;a<=h;a++)l[r][a]=0===a&&r===o?A:A.clone().lerp(c,a/h)}for(r=0;r<o;r++)for(a=0;a<2*(o-r)-1;a++){var u=Math.floor(a/2);a%2==0?(s(l[r][u+1]),s(l[r+1][u]),s(l[r][u])):(s(l[r][u+1]),s(l[r+1][u+1]),s(l[r+1][u]))}}function s(e){r.push(e.x,e.y,e.z)}function l(t,n){var i=3*t;n.x=e[i+0],n.y=e[i+1],n.z=e[i+2]}function A(e,t,n,i){i<0&&1===e.x&&(a[t]=e.x-1),0===n.x&&0===n.z&&(a[t]=i/2/Math.PI+.5)}function c(e){return Math.atan2(e.z,-e.x)}function h(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}!function(e){for(var n=new at,i=new at,r=new at,a=0;a<t.length;a+=3)l(t[a+0],n),l(t[a+1],i),l(t[a+2],r),o(n,i,r,e)}(i=i||0),function(e){for(var t=new at,n=0;n<r.length;n+=3)t.x=r[n+0],t.y=r[n+1],t.z=r[n+2],t.normalize().multiplyScalar(e),r[n+0]=t.x,r[n+1]=t.y,r[n+2]=t.z}(n),function(){for(var e=new at,t=0;t<r.length;t+=3){e.x=r[t+0],e.y=r[t+1],e.z=r[t+2];var n=c(e)/2/Math.PI+.5,i=h(e)/Math.PI+.5;a.push(n,1-i)}(function(){for(var e=new at,t=new at,n=new at,i=new at,o=new tt,s=new tt,l=new tt,h=0,u=0;h<r.length;h+=9,u+=6){e.set(r[h+0],r[h+1],r[h+2]),t.set(r[h+3],r[h+4],r[h+5]),n.set(r[h+6],r[h+7],r[h+8]),o.set(a[u+0],a[u+1]),s.set(a[u+2],a[u+3]),l.set(a[u+4],a[u+5]),i.copy(e).add(t).add(n).divideScalar(3);var d=c(i);A(o,u+0,e,d),A(s,u+2,t,d),A(l,u+4,n,d)}})(),function(){for(var e=0;e<a.length;e+=6){var t=a[e+0],n=a[e+2],i=a[e+4],r=Math.max(t,n,i),o=Math.min(t,n,i);r>.9&&o<.1&&(t<.2&&(a[e+0]+=1),n<.2&&(a[e+2]+=1),i<.2&&(a[e+4]+=1))}}()}(),this.setAttribute("position",new Yn(r,3)),this.setAttribute("normal",new Yn(r.slice(),3)),this.setAttribute("uv",new Yn(a,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}function ls(e,t){Li.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new As(e,t)),this.mergeVertices()}function As(e,t){ss.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function cs(e,t){Li.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new hs(e,t)),this.mergeVertices()}function hs(e,t){ss.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function us(e,t){Li.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new ds(e,t)),this.mergeVertices()}function ds(e,t){var n=(1+Math.sqrt(5))/2,i=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];ss.call(this,i,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function fs(e,t){Li.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new ps(e,t)),this.mergeVertices()}function ps(e,t){var n=(1+Math.sqrt(5))/2,i=1/n,r=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i];ss.call(this,r,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function ms(e,t,n,i,r,a){Li.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:r},void 0!==a&&console.warn("TubeGeometry: taper has been removed.");var o=new vs(e,t,n,i,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function vs(e,t,n,i,r){si.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:r},t=t||64,n=n||1,i=i||8,r=r||!1;var a=e.computeFrenetFrames(t,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;var o,s,l=new at,A=new at,c=new tt,h=new at,u=[],d=[],f=[],p=[];function m(r){h=e.getPointAt(r/t,h);var o=a.normals[r],c=a.binormals[r];for(s=0;s<=i;s++){var f=s/i*Math.PI*2,p=Math.sin(f),m=-Math.cos(f);A.x=m*o.x+p*c.x,A.y=m*o.y+p*c.y,A.z=m*o.z+p*c.z,A.normalize(),d.push(A.x,A.y,A.z),l.x=h.x+n*A.x,l.y=h.y+n*A.y,l.z=h.z+n*A.z,u.push(l.x,l.y,l.z)}}!function(){for(o=0;o<t;o++)m(o);m(!1===r?t:0),function(){for(o=0;o<=t;o++)for(s=0;s<=i;s++)c.x=o/t,c.y=s/i,f.push(c.x,c.y)}(),function(){for(s=1;s<=t;s++)for(o=1;o<=i;o++){var e=(i+1)*(s-1)+(o-1),n=(i+1)*s+(o-1),r=(i+1)*s+o,a=(i+1)*(s-1)+o;p.push(e,n,a),p.push(n,r,a)}}()}(),this.setIndex(p),this.setAttribute("position",new Yn(u,3)),this.setAttribute("normal",new Yn(d,3)),this.setAttribute("uv",new Yn(f,2))}function gs(e,t,n,i,r,a,o){Li.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:r,q:a},void 0!==o&&console.warn("TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new ys(e,t,n,i,r,a)),this.mergeVertices()}function ys(e,t,n,i,r,a){si.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:i,p:r,q:a},e=e||1,t=t||.4,n=Math.floor(n)||64,i=Math.floor(i)||8,r=r||2,a=a||3;var o,s,l=[],A=[],c=[],h=[],u=new at,d=new at,f=new at,p=new at,m=new at,v=new at,g=new at;for(o=0;o<=n;++o){var y=o/n*r*Math.PI*2;for(S(y,r,a,e,f),S(y+.01,r,a,e,p),v.subVectors(p,f),g.addVectors(p,f),m.crossVectors(v,g),g.crossVectors(m,v),m.normalize(),g.normalize(),s=0;s<=i;++s){var w=s/i*Math.PI*2,x=-t*Math.cos(w),b=t*Math.sin(w);u.x=f.x+(x*g.x+b*m.x),u.y=f.y+(x*g.y+b*m.y),u.z=f.z+(x*g.z+b*m.z),A.push(u.x,u.y,u.z),d.subVectors(u,f).normalize(),c.push(d.x,d.y,d.z),h.push(o/n),h.push(s/i)}}for(s=1;s<=n;s++)for(o=1;o<=i;o++){var M=(i+1)*(s-1)+(o-1),C=(i+1)*s+(o-1),B=(i+1)*s+o,E=(i+1)*(s-1)+o;l.push(M,C,E),l.push(C,B,E)}function S(e,t,n,i,r){var a=Math.cos(e),o=Math.sin(e),s=n/t*e,l=Math.cos(s);r.x=i*(2+l)*.5*a,r.y=i*(2+l)*o*.5,r.z=i*Math.sin(s)*.5}this.setIndex(l),this.setAttribute("position",new Yn(A,3)),this.setAttribute("normal",new Yn(c,3)),this.setAttribute("uv",new Yn(h,2))}function ws(e,t,n,i,r){Li.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:r},this.fromBufferGeometry(new xs(e,t,n,i,r)),this.mergeVertices()}function xs(e,t,n,i,r){si.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:r},e=e||1,t=t||.4,n=Math.floor(n)||8,i=Math.floor(i)||6,r=r||2*Math.PI;var a,o,s=[],l=[],A=[],c=[],h=new at,u=new at,d=new at;for(a=0;a<=n;a++)for(o=0;o<=i;o++){var f=o/i*r,p=a/n*Math.PI*2;u.x=(e+t*Math.cos(p))*Math.cos(f),u.y=(e+t*Math.cos(p))*Math.sin(f),u.z=t*Math.sin(p),l.push(u.x,u.y,u.z),h.x=e*Math.cos(f),h.y=e*Math.sin(f),d.subVectors(u,h).normalize(),A.push(d.x,d.y,d.z),c.push(o/i),c.push(a/n)}for(a=1;a<=n;a++)for(o=1;o<=i;o++){var m=(i+1)*a+o-1,v=(i+1)*(a-1)+o-1,g=(i+1)*(a-1)+o,y=(i+1)*a+o;s.push(m,v,y),s.push(v,g,y)}this.setIndex(s),this.setAttribute("position",new Yn(l,3)),this.setAttribute("normal",new Yn(A,3)),this.setAttribute("uv",new Yn(c,2))}qo.prototype=Object.assign(Object.create(zt.prototype),{constructor:qo,isPoints:!0,raycast:function(e,t){var n=this.geometry,i=this.matrixWorld,r=e.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),Zo.copy(n.boundingSphere),Zo.applyMatrix4(i),Zo.radius+=r,!1!==e.ray.intersectsSphere(Zo)){Yo.getInverse(i),Ko.copy(e.ray).applyMatrix4(Yo);var a=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(n.isBufferGeometry){var s=n.index,l=n.attributes.position.array;if(null!==s)for(var A=s.array,c=0,h=A.length;c<h;c++){var u=A[c];Jo.fromArray(l,3*u),$o(Jo,u,o,i,e,t,this)}else{c=0;for(var d=l.length/3;c<d;c++)Jo.fromArray(l,3*c),$o(Jo,c,o,i,e,t,this)}}else{var f=n.vertices;for(c=0,d=f.length;c<d;c++)$o(f[c],c,o,i,e,t,this)}}},updateMorphTargets:function(){var e,t,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,a=Object.keys(r);if(a.length>0){var o=r[a[0]];if(void 0!==o)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=o.length;e<t;e++)n=o[e].name||String(e),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}else{var s=i.morphTargets;void 0!==s&&s.length>0&&console.error("Points.updateMorphTargets() does not support Geometry. Use BufferGeometry instead.")}},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),es.prototype=Object.create(ht.prototype),es.prototype.constructor=es,es.prototype.isCompressedTexture=!0,ts.prototype=Object.create(ht.prototype),ts.prototype.constructor=ts,ts.prototype.isCanvasTexture=!0,ns.prototype=Object.create(ht.prototype),ns.prototype.constructor=ns,ns.prototype.isDepthTexture=!0,is.prototype=Object.create(si.prototype),is.prototype.constructor=is,rs.prototype=Object.create(Li.prototype),rs.prototype.constructor=rs,as.prototype=Object.create(si.prototype),as.prototype.constructor=as,os.prototype=Object.create(Li.prototype),os.prototype.constructor=os,ss.prototype=Object.create(si.prototype),ss.prototype.constructor=ss,ls.prototype=Object.create(Li.prototype),ls.prototype.constructor=ls,As.prototype=Object.create(ss.prototype),As.prototype.constructor=As,cs.prototype=Object.create(Li.prototype),cs.prototype.constructor=cs,hs.prototype=Object.create(ss.prototype),hs.prototype.constructor=hs,us.prototype=Object.create(Li.prototype),us.prototype.constructor=us,ds.prototype=Object.create(ss.prototype),ds.prototype.constructor=ds,fs.prototype=Object.create(Li.prototype),fs.prototype.constructor=fs,ps.prototype=Object.create(ss.prototype),ps.prototype.constructor=ps,ms.prototype=Object.create(Li.prototype),ms.prototype.constructor=ms,vs.prototype=Object.create(si.prototype),vs.prototype.constructor=vs,vs.prototype.toJSON=function(){var e=si.prototype.toJSON.call(this);return e.path=this.parameters.path.toJSON(),e},gs.prototype=Object.create(Li.prototype),gs.prototype.constructor=gs,ys.prototype=Object.create(si.prototype),ys.prototype.constructor=ys,ws.prototype=Object.create(Li.prototype),ws.prototype.constructor=ws,xs.prototype=Object.create(si.prototype),xs.prototype.constructor=xs;var bs=function(e,t,n){n=n||2;var i,r,a,o,s,l,A,c=t&&t.length,h=c?t[0]*n:e.length,u=Ms(e,0,h,n,!0),d=[];if(!u||u.next===u.prev)return d;if(c&&(u=function(e,t,n,i){var r,a,o,s=[];for(r=0,a=t.length;r<a;r++)(o=Ms(e,t[r]*i,r<a-1?t[r+1]*i:e.length,i,!1))===o.next&&(o.steiner=!0),s.push(ks(o));for(s.sort(Is),r=0;r<s.length;r++)Ls(s[r],n),n=Cs(n,n.next);return n}(e,t,u,n)),e.length>80*n){i=a=e[0],r=o=e[1];for(var f=n;f<h;f+=n)(s=e[f])<i&&(i=s),(l=e[f+1])<r&&(r=l),s>a&&(a=s),l>o&&(o=l);A=0!==(A=Math.max(a-i,o-r))?1/A:0}return Bs(u,d,n,i,r,A),d};function Ms(e,t,n,i,r){var a,o;if(r===function(e,t,n,i){for(var r=0,a=t,o=n-i;a<n;a+=i)r+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return r}(e,t,n,i)>0)for(a=t;a<n;a+=i)o=Qs(a,e[a],e[a+1],o);else for(a=n-i;a>=t;a-=i)o=Qs(a,e[a],e[a+1],o);return o&&Rs(o,o.next)&&(Gs(o),o=o.next),o}function Cs(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!Rs(i,i.next)&&0!==Ds(i.prev,i,i.next))i=i.next;else{if(Gs(i),(i=t=i.prev)===i.next)break;n=!0}}while(n||i!==t);return t}function Bs(e,t,n,i,r,a,o){if(e){!o&&a&&function(e,t,n,i){var r=e;do{null===r.z&&(r.z=Fs(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,a,o,s,l,A=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,i=n,s=0,t=0;t<A&&(s++,i=i.nextZ);t++);for(l=A;s>0||l>0&&i;)0!==s&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,l--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;n=i}a.nextZ=null,A*=2}while(o>1)}(r)}(e,i,r,a);for(var s,l,A=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?Ss(e,i,r,a):Es(e))t.push(s.i/n),t.push(e.i/n),t.push(l.i/n),Gs(e),e=l.next,A=l.next;else if((e=l)===A){o?1===o?Bs(e=Ts(e,t,n),t,n,i,r,a,2):2===o&&_s(e,t,n,i,r,a):Bs(Cs(e),t,n,i,r,a,1);break}}}function Es(e){var t=e.prev,n=e,i=e.next;if(Ds(t,n,i)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(Ps(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&Ds(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Ss(e,t,n,i){var r=e.prev,a=e,o=e.next;if(Ds(r,a,o)>=0)return!1;for(var s=r.x<a.x?r.x<o.x?r.x:o.x:a.x<o.x?a.x:o.x,l=r.y<a.y?r.y<o.y?r.y:o.y:a.y<o.y?a.y:o.y,A=r.x>a.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,c=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,h=Fs(s,l,t,n,i),u=Fs(A,c,t,n,i),d=e.prevZ,f=e.nextZ;d&&d.z>=h&&f&&f.z<=u;){if(d!==e.prev&&d!==e.next&&Ps(r.x,r.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Ds(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,f!==e.prev&&f!==e.next&&Ps(r.x,r.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Ds(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;d&&d.z>=h;){if(d!==e.prev&&d!==e.next&&Ps(r.x,r.y,a.x,a.y,o.x,o.y,d.x,d.y)&&Ds(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;f&&f.z<=u;){if(f!==e.prev&&f!==e.next&&Ps(r.x,r.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Ds(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Ts(e,t,n){var i=e;do{var r=i.prev,a=i.next.next;!Rs(r,a)&&Os(r,i,i.next,a)&&Ns(r,a)&&Ns(a,r)&&(t.push(r.i/n),t.push(i.i/n),t.push(a.i/n),Gs(i),Gs(i.next),i=e=a),i=i.next}while(i!==e);return i}function _s(e,t,n,i,r,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&Us(o,s)){var l=zs(o,s);return o=Cs(o,o.next),l=Cs(l,l.next),Bs(o,t,n,i,r,a),void Bs(l,t,n,i,r,a)}s=s.next}o=o.next}while(o!==e)}function Is(e,t){return e.x-t.x}function Ls(e,t){if(t=function(e,t){var n,i=t,r=e.x,a=e.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==t);if(!n)return null;if(r===o)return n.prev;var l,A=n,c=n.x,h=n.y,u=1/0;i=n.next;for(;i!==A;)r>=i.x&&i.x>=c&&r!==i.x&&Ps(a<h?r:o,a,c,h,a<h?o:r,a,i.x,i.y)&&((l=Math.abs(a-i.y)/(r-i.x))<u||l===u&&i.x>n.x)&&Ns(i,e)&&(n=i,u=l),i=i.next;return n}(e,t),t){var n=zs(t,e);Cs(n,n.next)}}function Fs(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function ks(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function Ps(e,t,n,i,r,a,o,s){return(r-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(i-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function Us(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Os(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&Ns(e,t)&&Ns(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)}function Ds(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Rs(e,t){return e.x===t.x&&e.y===t.y}function Os(e,t,n,i){return!!(Rs(e,n)&&Rs(t,i)||Rs(e,i)&&Rs(n,t))||Ds(e,t,n)>0!=Ds(e,t,i)>0&&Ds(n,i,e)>0!=Ds(n,i,t)>0}function Ns(e,t){return Ds(e.prev,e,e.next)<0?Ds(e,t,e.next)>=0&&Ds(e,e.prev,t)>=0:Ds(e,t,e.prev)<0||Ds(e,e.next,t)<0}function zs(e,t){var n=new Hs(e.i,e.x,e.y),i=new Hs(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function Qs(e,t,n,i){var r=new Hs(e,t,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 Gs(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Hs(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var Vs={area:function(e){for(var t=e.length,n=0,i=t-1,r=0;r<t;i=r++)n+=e[i].x*e[r].y-e[r].x*e[i].y;return.5*n},isClockWise:function(e){return Vs.area(e)<0},triangulateShape:function(e,t){var n=[],i=[],r=[];js(e),Ws(n,e);var a=e.length;t.forEach(js);for(var o=0;o<t.length;o++)i.push(a),a+=t[o].length,Ws(n,t[o]);var s=bs(n,i);for(o=0;o<s.length;o+=3)r.push(s.slice(o,o+3));return r}};function js(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function Ws(e,t){for(var n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}function Xs(e,t){Li.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new Ys(e,t)),this.mergeVertices()}function Ys(e,t){si.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];for(var n=this,i=[],r=[],a=0,o=e.length;a<o;a++){s(e[a])}function s(e){var a=[],o=void 0!==t.curveSegments?t.curveSegments:12,s=void 0!==t.steps?t.steps:1,l=void 0!==t.depth?t.depth:100,A=void 0===t.bevelEnabled||t.bevelEnabled,c=void 0!==t.bevelThickness?t.bevelThickness:6,h=void 0!==t.bevelSize?t.bevelSize:c-2,u=void 0!==t.bevelOffset?t.bevelOffset:0,d=void 0!==t.bevelSegments?t.bevelSegments:3,f=t.extrudePath,p=void 0!==t.UVGenerator?t.UVGenerator:Ks;void 0!==t.amount&&(console.warn("ExtrudeBufferGeometry: amount has been renamed to depth."),l=t.amount);var m,v,g,y,w,x,b,M,C=!1;f&&(m=f.getSpacedPoints(s),C=!0,A=!1,v=f.computeFrenetFrames(s,!1),g=new at,y=new at,w=new at),A||(d=0,c=0,h=0,u=0);var B=e.extractPoints(o),E=B.shape,S=B.holes;if(!Vs.isClockWise(E))for(E=E.reverse(),b=0,M=S.length;b<M;b++)x=S[b],Vs.isClockWise(x)&&(S[b]=x.reverse());var T=Vs.triangulateShape(E,S),_=E;for(b=0,M=S.length;b<M;b++)x=S[b],E=E.concat(x);function I(e,t,n){return t||console.error("ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(n).add(e)}var L,F,k,P,U,D,R=E.length,O=T.length;function N(e,t,n){var i,r,a,o=e.x-t.x,s=e.y-t.y,l=n.x-e.x,A=n.y-e.y,c=o*o+s*s,h=o*A-s*l;if(Math.abs(h)>Number.EPSILON){var u=Math.sqrt(c),d=Math.sqrt(l*l+A*A),f=t.x-s/u,p=t.y+o/u,m=((n.x-A/d-f)*A-(n.y+l/d-p)*l)/(o*A-s*l),v=(i=f+o*m-e.x)*i+(r=p+s*m-e.y)*r;if(v<=2)return new tt(i,r);a=Math.sqrt(v/2)}else{var g=!1;o>Number.EPSILON?l>Number.EPSILON&&(g=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(g=!0):Math.sign(s)===Math.sign(A)&&(g=!0),g?(i=-s,r=o,a=Math.sqrt(c)):(i=o,r=s,a=Math.sqrt(c/2))}return new tt(i/a,r/a)}for(var z=[],Q=0,G=_.length,H=G-1,V=Q+1;Q<G;Q++,H++,V++)H===G&&(H=0),V===G&&(V=0),z[Q]=N(_[Q],_[H],_[V]);var j,W,X=[],Y=z.concat();for(b=0,M=S.length;b<M;b++){for(x=S[b],j=[],Q=0,H=(G=x.length)-1,V=Q+1;Q<G;Q++,H++,V++)H===G&&(H=0),V===G&&(V=0),j[Q]=N(x[Q],x[H],x[V]);X.push(j),Y=Y.concat(j)}for(L=0;L<d;L++){for(k=L/d,P=c*Math.cos(k*Math.PI/2),F=h*Math.sin(k*Math.PI/2)+u,Q=0,G=_.length;Q<G;Q++)Z((U=I(_[Q],z[Q],F)).x,U.y,-P);for(b=0,M=S.length;b<M;b++)for(x=S[b],j=X[b],Q=0,G=x.length;Q<G;Q++)Z((U=I(x[Q],j[Q],F)).x,U.y,-P)}for(F=h+u,Q=0;Q<R;Q++)U=A?I(E[Q],Y[Q],F):E[Q],C?(y.copy(v.normals[0]).multiplyScalar(U.x),g.copy(v.binormals[0]).multiplyScalar(U.y),w.copy(m[0]).add(y).add(g),Z(w.x,w.y,w.z)):Z(U.x,U.y,0);for(W=1;W<=s;W++)for(Q=0;Q<R;Q++)U=A?I(E[Q],Y[Q],F):E[Q],C?(y.copy(v.normals[W]).multiplyScalar(U.x),g.copy(v.binormals[W]).multiplyScalar(U.y),w.copy(m[W]).add(y).add(g),Z(w.x,w.y,w.z)):Z(U.x,U.y,l/s*W);for(L=d-1;L>=0;L--){for(k=L/d,P=c*Math.cos(k*Math.PI/2),F=h*Math.sin(k*Math.PI/2)+u,Q=0,G=_.length;Q<G;Q++)Z((U=I(_[Q],z[Q],F)).x,U.y,l+P);for(b=0,M=S.length;b<M;b++)for(x=S[b],j=X[b],Q=0,G=x.length;Q<G;Q++)U=I(x[Q],j[Q],F),C?Z(U.x,U.y+m[s-1].y,m[s-1].x+P):Z(U.x,U.y,l+P)}function K(e,t){var n,i;for(Q=e.length;--Q>=0;){n=Q,(i=Q-1)<0&&(i=e.length-1);var r=0,a=s+2*d;for(r=0;r<a;r++){var o=R*r,l=R*(r+1);q(t+n+o,t+i+o,t+i+l,t+n+l)}}}function Z(e,t,n){a.push(e),a.push(t),a.push(n)}function J(e,t,r){$(e),$(t),$(r);var a=i.length/3,o=p.generateTopUV(n,i,a-3,a-2,a-1);ee(o[0]),ee(o[1]),ee(o[2])}function q(e,t,r,a){$(e),$(t),$(a),$(t),$(r),$(a);var o=i.length/3,s=p.generateSideWallUV(n,i,o-6,o-3,o-2,o-1);ee(s[0]),ee(s[1]),ee(s[3]),ee(s[1]),ee(s[2]),ee(s[3])}function $(e){i.push(a[3*e+0]),i.push(a[3*e+1]),i.push(a[3*e+2])}function ee(e){r.push(e.x),r.push(e.y)}!function(){var e=i.length/3;if(A){var t=0,r=R*t;for(Q=0;Q<O;Q++)J((D=T[Q])[2]+r,D[1]+r,D[0]+r);for(r=R*(t=s+2*d),Q=0;Q<O;Q++)J((D=T[Q])[0]+r,D[1]+r,D[2]+r)}else{for(Q=0;Q<O;Q++)J((D=T[Q])[2],D[1],D[0]);for(Q=0;Q<O;Q++)J((D=T[Q])[0]+R*s,D[1]+R*s,D[2]+R*s)}n.addGroup(e,i.length/3-e,0)}(),function(){var e=i.length/3,t=0;for(K(_,t),t+=_.length,b=0,M=S.length;b<M;b++)K(x=S[b],t),t+=x.length;n.addGroup(e,i.length/3-e,1)}()}this.setAttribute("position",new Yn(i,3)),this.setAttribute("uv",new Yn(r,2)),this.computeVertexNormals()}Xs.prototype=Object.create(Li.prototype),Xs.prototype.constructor=Xs,Xs.prototype.toJSON=function(){var e=Li.prototype.toJSON.call(this);return Zs(this.parameters.shapes,this.parameters.options,e)},Ys.prototype=Object.create(si.prototype),Ys.prototype.constructor=Ys,Ys.prototype.toJSON=function(){var e=si.prototype.toJSON.call(this);return Zs(this.parameters.shapes,this.parameters.options,e)};var Ks={generateTopUV:function(e,t,n,i,r){var a=t[3*n],o=t[3*n+1],s=t[3*i],l=t[3*i+1],A=t[3*r],c=t[3*r+1];return[new tt(a,o),new tt(s,l),new tt(A,c)]},generateSideWallUV:function(e,t,n,i,r,a){var o=t[3*n],s=t[3*n+1],l=t[3*n+2],A=t[3*i],c=t[3*i+1],h=t[3*i+2],u=t[3*r],d=t[3*r+1],f=t[3*r+2],p=t[3*a],m=t[3*a+1],v=t[3*a+2];return Math.abs(s-c)<.01?[new tt(o,1-l),new tt(A,1-h),new tt(u,1-f),new tt(p,1-v)]:[new tt(s,1-l),new tt(c,1-h),new tt(d,1-f),new tt(m,1-v)]}};function Zs(e,t,n){if(n.shapes=[],Array.isArray(e))for(var i=0,r=e.length;i<r;i++){var a=e[i];n.shapes.push(a.uuid)}else n.shapes.push(e.uuid);return void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}function Js(e,t){Li.call(this),this.type="TextGeometry",this.parameters={text:e,parameters:t},this.fromBufferGeometry(new qs(e,t)),this.mergeVertices()}function qs(e,t){var n=(t=t||{}).font;if(!n||!n.isFont)return console.error("TextGeometry: font parameter is not an instance of Font."),new Li;var i=n.generateShapes(e,t.size);t.depth=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),Ys.call(this,i,t),this.type="TextBufferGeometry"}function $s(e,t,n,i,r,a,o){Li.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new el(e,t,n,i,r,a,o)),this.mergeVertices()}function el(e,t,n,i,r,a,o){si.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},e=e||1,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI,a=void 0!==a?a:0,o=void 0!==o?o:Math.PI;var s,l,A=Math.min(a+o,Math.PI),c=0,h=[],u=new at,d=new at,f=[],p=[],m=[],v=[];for(l=0;l<=n;l++){var g=[],y=l/n,w=0;for(0==l&&0==a?w=.5/t:l==n&&A==Math.PI&&(w=-.5/t),s=0;s<=t;s++){var x=s/t;u.x=-e*Math.cos(i+x*r)*Math.sin(a+y*o),u.y=e*Math.cos(a+y*o),u.z=e*Math.sin(i+x*r)*Math.sin(a+y*o),p.push(u.x,u.y,u.z),d.copy(u).normalize(),m.push(d.x,d.y,d.z),v.push(x+w,1-y),g.push(c++)}h.push(g)}for(l=0;l<n;l++)for(s=0;s<t;s++){var b=h[l][s+1],M=h[l][s],C=h[l+1][s],B=h[l+1][s+1];(0!==l||a>0)&&f.push(b,M,B),(l!==n-1||A<Math.PI)&&f.push(M,C,B)}this.setIndex(f),this.setAttribute("position",new Yn(p,3)),this.setAttribute("normal",new Yn(m,3)),this.setAttribute("uv",new Yn(v,2))}function tl(e,t,n,i,r,a){Li.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:a},this.fromBufferGeometry(new nl(e,t,n,i,r,a)),this.mergeVertices()}function nl(e,t,n,i,r,a){si.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:a},e=e||.5,t=t||1,r=void 0!==r?r:0,a=void 0!==a?a:2*Math.PI,n=void 0!==n?Math.max(3,n):8;var o,s,l,A=[],c=[],h=[],u=[],d=e,f=(t-e)/(i=void 0!==i?Math.max(1,i):1),p=new at,m=new tt;for(s=0;s<=i;s++){for(l=0;l<=n;l++)o=r+l/n*a,p.x=d*Math.cos(o),p.y=d*Math.sin(o),c.push(p.x,p.y,p.z),h.push(0,0,1),m.x=(p.x/t+1)/2,m.y=(p.y/t+1)/2,u.push(m.x,m.y);d+=f}for(s=0;s<i;s++){var v=s*(n+1);for(l=0;l<n;l++){var g=o=l+v,y=o+n+1,w=o+n+2,x=o+1;A.push(g,y,x),A.push(y,w,x)}}this.setIndex(A),this.setAttribute("position",new Yn(c,3)),this.setAttribute("normal",new Yn(h,3)),this.setAttribute("uv",new Yn(u,2))}function il(e,t,n,i){Li.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},this.fromBufferGeometry(new rl(e,t,n,i)),this.mergeVertices()}function rl(e,t,n,i){si.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t)||12,n=n||0,i=i||2*Math.PI,i=et.clamp(i,0,2*Math.PI);var r,a,o,s=[],l=[],A=[],c=1/t,h=new at,u=new tt;for(a=0;a<=t;a++){var d=n+a*c*i,f=Math.sin(d),p=Math.cos(d);for(o=0;o<=e.length-1;o++)h.x=e[o].x*f,h.y=e[o].y,h.z=e[o].x*p,l.push(h.x,h.y,h.z),u.x=a/t,u.y=o/(e.length-1),A.push(u.x,u.y)}for(a=0;a<t;a++)for(o=0;o<e.length-1;o++){var m=r=o+a*e.length,v=r+e.length,g=r+e.length+1,y=r+1;s.push(m,v,y),s.push(v,g,y)}if(this.setIndex(s),this.setAttribute("position",new Yn(l,3)),this.setAttribute("uv",new Yn(A,2)),this.computeVertexNormals(),i===2*Math.PI){var w=this.attributes.normal.array,x=new at,b=new at,M=new at;for(r=t*e.length*3,a=0,o=0;a<e.length;a++,o+=3)x.x=w[o+0],x.y=w[o+1],x.z=w[o+2],b.x=w[r+o+0],b.y=w[r+o+1],b.z=w[r+o+2],M.addVectors(x,b).normalize(),w[o+0]=w[r+o+0]=M.x,w[o+1]=w[r+o+1]=M.y,w[o+2]=w[r+o+2]=M.z}}function al(e,t){Li.call(this),this.type="ShapeGeometry","object"===r(t)&&(console.warn("ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new ol(e,t)),this.mergeVertices()}function ol(e,t,n){si.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12,n=n||!1;var i=[],r=[],a=[],o=[],s=0,l=0;if(!1===Array.isArray(e))c(e);else for(var A=0;A<e.length;A++)c(e[A]),n||(this.addGroup(s,l,A),s+=l,l=0);function c(e){var n,s,A,c=r.length/3,h=e.extractPoints(t),u=h.shape,d=h.holes;for(!1===Vs.isClockWise(u)&&(u=u.reverse()),n=0,s=d.length;n<s;n++)A=d[n],!0===Vs.isClockWise(A)&&(d[n]=A.reverse());var f=Vs.triangulateShape(u,d);for(n=0,s=d.length;n<s;n++)A=d[n],u=u.concat(A);for(n=0,s=u.length;n<s;n++){var p=u[n];r.push(p.x,p.y,0),a.push(0,0,1),o.push(p.x,p.y)}for(n=0,s=f.length;n<s;n++){var m=f[n],v=m[0]+c,g=m[1]+c,y=m[2]+c;i.push(v,g,y),l+=3}}this.setIndex(i),this.setAttribute("position",new Yn(r,3)),this.setAttribute("normal",new Yn(a,3)),this.setAttribute("uv",new Yn(o,2))}function sl(e,t){if(t.shapes=[],Array.isArray(e))for(var n=0,i=e.length;n<i;n++){var r=e[n];t.shapes.push(r.uuid)}else t.shapes.push(e.uuid);return t}function ll(e,t){si.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:t},t=void 0!==t?t:1;var n,i,r,a,o=[],s=Math.cos(et.DEG2RAD*t),l=[0,0],A={},c=["a","b","c"];e.isBufferGeometry?(a=new Li).fromBufferGeometry(e):a=e.clone(),a.mergeVertices(),a.computeFaceNormals();for(var h=a.vertices,u=a.faces,d=0,f=u.length;d<f;d++)for(var p=u[d],m=0;m<3;m++)n=p[c[m]],i=p[c[(m+1)%3]],l[0]=Math.min(n,i),l[1]=Math.max(n,i),void 0===A[r=l[0]+","+l[1]]?A[r]={index1:l[0],index2:l[1],face1:d,face2:void 0}:A[r].face2=d;for(r in A){var v=A[r];if(void 0===v.face2||u[v.face1].normal.dot(u[v.face2].normal)<=s){var g=h[v.index1];o.push(g.x,g.y,g.z),g=h[v.index2],o.push(g.x,g.y,g.z)}}this.setAttribute("position",new Yn(o,3))}function Al(e,t,n,i,r,a,o,s){Li.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new cl(e,t,n,i,r,a,o,s)),this.mergeVertices()}function cl(e,t,n,i,r,a,o,s){si.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s};var l=this;e=void 0!==e?e:1,t=void 0!==t?t:1,n=n||1,i=Math.floor(i)||8,r=Math.floor(r)||1,a=void 0!==a&&a,o=void 0!==o?o:0,s=void 0!==s?s:2*Math.PI;var A=[],c=[],h=[],u=[],d=0,f=[],p=n/2,m=0;function v(n){var r,a,f,v=new tt,g=new at,y=0,w=!0===n?e:t,x=!0===n?1:-1;for(a=d,r=1;r<=i;r++)c.push(0,p*x,0),h.push(0,x,0),u.push(.5,.5),d++;for(f=d,r=0;r<=i;r++){var b=r/i*s+o,M=Math.cos(b),C=Math.sin(b);g.x=w*C,g.y=p*x,g.z=w*M,c.push(g.x,g.y,g.z),h.push(0,x,0),v.x=.5*M+.5,v.y=.5*C*x+.5,u.push(v.x,v.y),d++}for(r=0;r<i;r++){var B=a+r,E=f+r;!0===n?A.push(E,E+1,B):A.push(E+1,E,B),y+=3}l.addGroup(m,y,!0===n?1:2),m+=y}!function(){var a,v,g=new at,y=new at,w=0,x=(t-e)/n;for(v=0;v<=r;v++){var b=[],M=v/r,C=M*(t-e)+e;for(a=0;a<=i;a++){var B=a/i,E=B*s+o,S=Math.sin(E),T=Math.cos(E);y.x=C*S,y.y=-M*n+p,y.z=C*T,c.push(y.x,y.y,y.z),g.set(S,x,T).normalize(),h.push(g.x,g.y,g.z),u.push(B,1-M),b.push(d++)}f.push(b)}for(a=0;a<i;a++)for(v=0;v<r;v++){var _=f[v][a],I=f[v+1][a],L=f[v+1][a+1],F=f[v][a+1];A.push(_,I,F),A.push(I,L,F),w+=6}l.addGroup(m,w,0),m+=w}(),!1===a&&(e>0&&v(!0),t>0&&v(!1)),this.setIndex(A),this.setAttribute("position",new Yn(c,3)),this.setAttribute("normal",new Yn(h,3)),this.setAttribute("uv",new Yn(u,2))}function hl(e,t,n,i,r,a,o){Al.call(this,0,e,t,n,i,r,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:o}}function ul(e,t,n,i,r,a,o){cl.call(this,0,e,t,n,i,r,a,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:a,thetaLength:o}}function dl(e,t,n,i){Li.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},this.fromBufferGeometry(new fl(e,t,n,i)),this.mergeVertices()}function fl(e,t,n,i){si.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},e=e||1,t=void 0!==t?Math.max(3,t):8,n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;var r,a,o=[],s=[],l=[],A=[],c=new at,h=new tt;for(s.push(0,0,0),l.push(0,0,1),A.push(.5,.5),a=0,r=3;a<=t;a++,r+=3){var u=n+a/t*i;c.x=e*Math.cos(u),c.y=e*Math.sin(u),s.push(c.x,c.y,c.z),l.push(0,0,1),h.x=(s[r]/e+1)/2,h.y=(s[r+1]/e+1)/2,A.push(h.x,h.y)}for(r=1;r<=t;r++)o.push(r,r+1,0);this.setIndex(o),this.setAttribute("position",new Yn(s,3)),this.setAttribute("normal",new Yn(l,3)),this.setAttribute("uv",new Yn(A,2))}Js.prototype=Object.create(Li.prototype),Js.prototype.constructor=Js,qs.prototype=Object.create(Ys.prototype),qs.prototype.constructor=qs,$s.prototype=Object.create(Li.prototype),$s.prototype.constructor=$s,el.prototype=Object.create(si.prototype),el.prototype.constructor=el,tl.prototype=Object.create(Li.prototype),tl.prototype.constructor=tl,nl.prototype=Object.create(si.prototype),nl.prototype.constructor=nl,il.prototype=Object.create(Li.prototype),il.prototype.constructor=il,rl.prototype=Object.create(si.prototype),rl.prototype.constructor=rl,al.prototype=Object.create(Li.prototype),al.prototype.constructor=al,al.prototype.toJSON=function(){var e=Li.prototype.toJSON.call(this);return sl(this.parameters.shapes,e)},ol.prototype=Object.create(si.prototype),ol.prototype.constructor=ol,ol.prototype.toJSON=function(){var e=si.prototype.toJSON.call(this);return sl(this.parameters.shapes,e)},ll.prototype=Object.create(si.prototype),ll.prototype.constructor=ll,Al.prototype=Object.create(Li.prototype),Al.prototype.constructor=Al,cl.prototype=Object.create(si.prototype),cl.prototype.constructor=cl,hl.prototype=Object.create(Al.prototype),hl.prototype.constructor=hl,ul.prototype=Object.create(cl.prototype),ul.prototype.constructor=ul,dl.prototype=Object.create(Li.prototype),dl.prototype.constructor=dl,fl.prototype=Object.create(si.prototype),fl.prototype.constructor=fl;var pl=Object.freeze({__proto__:null,WireframeGeometry:is,ParametricGeometry:rs,ParametricBufferGeometry:as,TetrahedronGeometry:ls,TetrahedronBufferGeometry:As,OctahedronGeometry:cs,OctahedronBufferGeometry:hs,IcosahedronGeometry:us,IcosahedronBufferGeometry:ds,DodecahedronGeometry:fs,DodecahedronBufferGeometry:ps,PolyhedronGeometry:os,PolyhedronBufferGeometry:ss,TubeGeometry:ms,TubeBufferGeometry:vs,TorusKnotGeometry:gs,TorusKnotBufferGeometry:ys,TorusGeometry:ws,TorusBufferGeometry:xs,TextGeometry:Js,TextBufferGeometry:qs,SphereGeometry:$s,SphereBufferGeometry:el,RingGeometry:tl,RingBufferGeometry:nl,PlaneGeometry:qi,PlaneBufferGeometry:$i,LatheGeometry:il,LatheBufferGeometry:rl,ShapeGeometry:al,ShapeBufferGeometry:ol,ExtrudeGeometry:Xs,ExtrudeBufferGeometry:Ys,EdgesGeometry:ll,ConeGeometry:hl,ConeBufferGeometry:ul,CylinderGeometry:Al,CylinderBufferGeometry:cl,CircleGeometry:dl,CircleBufferGeometry:fl,BoxGeometry:Fi,BoxBufferGeometry:ki});function ml(e){On.call(this),this.type="ShadowMaterial",this.color=new Fn(0),this.transparent=!0,this.setValues(e)}function vl(e){Ri.call(this,e),this.type="RawShaderMaterial"}function gl(e){On.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Fn(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Fn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new tt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function yl(e){gl.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearcoat=0,this.clearcoatRoughness=0,this.sheen=null,this.clearcoatNormalScale=new tt(1,1),this.clearcoatNormalMap=null,this.transparency=0,this.setValues(e)}function wl(e){On.call(this),this.type="MeshPhongMaterial",this.color=new Fn(16777215),this.specular=new Fn(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Fn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new tt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function xl(e){wl.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(e)}function bl(e){On.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new tt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Ml(e){On.call(this),this.type="MeshLambertMaterial",this.color=new Fn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Fn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Cl(e){On.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Fn(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new tt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function Bl(e){Do.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}function El(e){On.call(this),this.defines={STANDARD:""},this.type="AMRTBasicMaterial",this.color=new Fn(16777215),this.albedo=null,this.albedoUV=0,this.normalMap=null,this.normalScale=1,this.normalMap2=null,this.normalScale2=1,this.metallicMap=null,this.metallic=0,this.roughnessMap=null,this.smoothness=0,this.aoMap=null,this.aoScale=1,this.aoUV=0,this.emissive=new Fn(0),this.emissiveMap=null,this.emissiveUV=0,this.reflectMap=null,this.reflectIntensity=0,this.cutout=.5,this.reflectivity=1,this.transparency=0,this.opacity=1,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.vertexTangents=!0,this.normalMapType=0,this.envRotateY=0,this.envYMatrix=new lt,this.reflectRotateY=0,this.reflecYMatrix=new lt,this.dissolveMap=null,this.dissolveRatio=0,this.dissolveColor=new Fn(16774921),this.ssrTextureMatrix=new bt,this.ssrTexture=null,this.maxDistance=10,this.ssrOpacity=1,this.fresnelCoe=0,this.depthTexture=null,this.planeOffset=0,this.virtualCameraNear=.1,this.virtualCameraFar=1e3,this.virtualCameraMatrixWorld=new bt,this.virtualCameraProjectionMatrix=new bt,this.virtualCameraProjectionMatrixInverse=new bt,this.resolution=new tt,this.setValues(e),this.__defineSetter__("envRotateY",(function(e){this.envYMatrix=(new lt).rotateY(e)})),this.__defineSetter__("reflectRotateY",(function(e){this.reflecYMatrix=(new lt).rotateY(e)}))}function Sl(e){On.call(this),this.type="AMRTShadowMaterial",this.color=new Fn(0),this.shadowPlane=new vn(new at(0,-1,0),0),this.lightDirection=new at(-1,-1,-1),this.shadowLength=1,this.center=new at(0,0,0),this.shadowStrength=1,this.skinning=!1,this.morphTargets=!1,this.transparent=!0,this.depthWrite=!1,this.stencilWrite=!0,this.stencilRef=0,this.stencilFunc=514,this.stencilFail=We,this.stencilZFail=We,this.stencilZPass=7682,this.setValues(e)}ml.prototype=Object.create(On.prototype),ml.prototype.constructor=ml,ml.prototype.isShadowMaterial=!0,ml.prototype.copy=function(e){return On.prototype.copy.call(this,e),this.color.copy(e.color),this},vl.prototype=Object.create(Ri.prototype),vl.prototype.constructor=vl,vl.prototype.isRawShaderMaterial=!0,gl.prototype=Object.create(On.prototype),gl.prototype.constructor=gl,gl.prototype.isMeshStandardMaterial=!0,gl.prototype.copy=function(e){return On.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},yl.prototype=Object.create(gl.prototype),yl.prototype.constructor=yl,yl.prototype.isMeshPhysicalMaterial=!0,yl.prototype.copy=function(e){return gl.prototype.copy.call(this,e),this.defines={STANDARD:"",PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearcoat=e.clearcoat,this.clearcoatRoughness=e.clearcoatRoughness,e.sheen?this.sheen=(this.sheen||new Fn).copy(e.sheen):this.sheen=null,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.transparency=e.transparency,this},wl.prototype=Object.create(On.prototype),wl.prototype.constructor=wl,wl.prototype.isMeshPhongMaterial=!0,wl.prototype.copy=function(e){return On.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},xl.prototype=Object.create(wl.prototype),xl.prototype.constructor=xl,xl.prototype.isMeshToonMaterial=!0,xl.prototype.copy=function(e){return wl.prototype.copy.call(this,e),this.gradientMap=e.gradientMap,this},bl.prototype=Object.create(On.prototype),bl.prototype.constructor=bl,bl.prototype.isMeshNormalMaterial=!0,bl.prototype.copy=function(e){return On.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Ml.prototype=Object.create(On.prototype),Ml.prototype.constructor=Ml,Ml.prototype.isMeshLambertMaterial=!0,Ml.prototype.copy=function(e){return On.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Cl.prototype=Object.create(On.prototype),Cl.prototype.constructor=Cl,Cl.prototype.isMeshMatcapMaterial=!0,Cl.prototype.copy=function(e){return On.prototype.copy.call(this,e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Bl.prototype=Object.create(Do.prototype),Bl.prototype.constructor=Bl,Bl.prototype.isLineDashedMaterial=!0,Bl.prototype.copy=function(e){return Do.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this},El.prototype=Object.create(On.prototype),El.prototype.constructor=El,El.prototype.isAMRTBasicMaterial=!0,El.prototype.clone=function(){return(new this.constructor).copy(this)},El.prototype.copy=function(e){return On.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.albedo=e.albedo,this.albedoUV=e.albedoUV,this.normalMap=e.normalMap,this.normalScale=e.normalScale,this.normalMap2=e.normalMap2,this.normalScale2=e.normalScale2,this.metallicMap=e.metallicMap,this.metallic=e.metallic,this.roughnessMap=e.roughnessMap,this.smoothness=e.smoothness,this.aoMap=e.aoMap,this.aoScale=e.aoScale,this.aoUV=e.aoUV,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveUV=e.emissiveUV,this.reflectMap=e.reflectMap,this.reflectIntensity=e.reflectIntensity,this.cutout=e.cutout,this.reflectivity=e.reflectivity,this.transparency=e.transparency,this.opacity=e.opacity,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.vertexTangents=e.vertexTangents,this.normalMapType=e.normalMapType,this.envRotateY=e.envRotateY,this.envYMatrix=e.envYMatrix,this.reflectRotateY=e.reflectRotateY,this.reflecYMatrix=e.reflecYMatrix,this},El.prototype.dispose=function(){On.prototype.dispose.call(this),this.albedo&&this.albedo.dispose(),this.metallicMap&&this.metallicMap.dispose(),this.roughnessMap&&this.roughnessMap.dispose(),this.aoMap&&this.aoMap.dispose(),this.emissiveMap&&this.emissiveMap.dispose(),this.reflectMap&&this.reflectMap.dispose(),this.envMap&&this.envMap.dispose()},Object.defineProperty(El.prototype,"alphaMap",{get(){return this._alphaMap||null},set(e){this._alphaMap=e,e&&(this.transparent=!0)}}),Sl.prototype=Object.create(On.prototype),Sl.prototype.constructor=Sl,Sl.prototype.isAMRTShadowMaterial=!0,Sl.prototype.clone=function(){return(new this.constructor).copy(this)},Sl.prototype.copy=function(e){return On.prototype.copy.call(this,e),this.color.copy(e.color),this.shadowPlane=e.shadowPlane.clone(),this.lightDirection.copy(e.lightDirection),this.shadowLength=e.shadowLength,this.shadowStrength=e.shadowStrength,this.center.copy(e.center),this};var Tl=Object.freeze({__proto__:null,ShadowMaterial:ml,SpriteMaterial:ro,RawShaderMaterial:vl,ShaderMaterial:Ri,PointsMaterial:Xo,MeshPhysicalMaterial:yl,MeshStandardMaterial:gl,MeshPhongMaterial:wl,MeshToonMaterial:xl,MeshNormalMaterial:bl,MeshLambertMaterial:Ml,MeshDepthMaterial:Ra,MeshDistanceMaterial:Oa,MeshBasicMaterial:Nn,MeshMatcapMaterial:Cl,LineDashedMaterial:Bl,LineBasicMaterial:Do,AMRTBasicMaterial:El,AMRTShadowMaterial:Sl,Material:On}),_l={arraySlice:function(e,t,n){return _l.isTypedArray(e)?new e.constructor(e.subarray(t,void 0!==n?n:e.length)):e.slice(t,n)},convertArray:function(e,t,n){return!e||!n&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){for(var t=e.length,n=new Array(t),i=0;i!==t;++i)n[i]=i;return n.sort((function(t,n){return e[t]-e[n]})),n},sortedArray:function(e,t,n){for(var i=e.length,r=new e.constructor(i),a=0,o=0;o!==i;++a)for(var s=n[a]*t,l=0;l!==t;++l)r[o++]=e[s+l];return r},flattenJSON:function(e,t,n,i){for(var r=1,a=e[0];void 0!==a&&void 0===a[i];)a=e[r++];if(void 0!==a){var o=a[i];if(void 0!==o)if(Array.isArray(o))do{void 0!==(o=a[i])&&(t.push(a.time),n.push.apply(n,o)),a=e[r++]}while(void 0!==a);else if(void 0!==o.toArray)do{void 0!==(o=a[i])&&(t.push(a.time),o.toArray(n,n.length)),a=e[r++]}while(void 0!==a);else do{void 0!==(o=a[i])&&(t.push(a.time),n.push(o)),a=e[r++]}while(void 0!==a)}},subclip:function(e,t,n,i,r){r=r||30;var a=e.clone();a.name=t;for(var o=[],s=0;s<a.tracks.length;++s){for(var l=a.tracks[s],A=l.getValueSize(),c=[],h=[],u=0;u<l.times.length;++u){var d=l.times[u]*r;if(!(d<n||d>=i)){c.push(l.times[u]);for(var f=0;f<A;++f)h.push(l.values[u*A+f])}}0!==c.length&&(l.times=_l.convertArray(c,l.times.constructor),l.values=_l.convertArray(h,l.values.constructor),o.push(l))}a.tracks=o;var p=1/0;for(s=0;s<a.tracks.length;++s)p>a.tracks[s].times[0]&&(p=a.tracks[s].times[0]);for(s=0;s<a.tracks.length;++s)a.tracks[s].shift(-1*p);return a.resetDuration(),a}};function Il(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n}function Ll(e,t,n,i){Il.call(this,e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Fl(e,t,n,i){Il.call(this,e,t,n,i)}function kl(e,t,n,i){Il.call(this,e,t,n,i)}function Pl(e,t,n,i){if(void 0===e)throw new Error("KeyframeTrack: track name is undefined");if(void 0===t||0===t.length)throw new Error("KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=_l.convertArray(t,this.TimeBufferType),this.values=_l.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function Ul(e,t,n){Pl.call(this,e,t,n)}function Dl(e,t,n,i){Pl.call(this,e,t,n,i)}function Rl(e,t,n,i){Pl.call(this,e,t,n,i)}function Ol(e,t,n,i){Il.call(this,e,t,n,i)}function Nl(e,t,n,i){Pl.call(this,e,t,n,i)}function zl(e,t,n,i){Pl.call(this,e,t,n,i)}function Ql(e,t,n,i){Pl.call(this,e,t,n,i)}function Gl(e,t,n){this.name=e,this.tracks=n,this.duration=void 0!==t?t:-1,this.uuid=et.generateUUID(),this.duration<0&&this.resetDuration()}function Hl(e){if(void 0===e.type)throw new Error("KeyframeTrack: track type undefined, can not parse");var t=function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Rl;case"vector":case"vector2":case"vector3":case"vector4":return Ql;case"color":return Dl;case"quaternion":return Nl;case"bool":case"boolean":return Ul;case"string":return zl}throw new Error("KeyframeTrack: Unsupported typeName: "+e)}(e.type);if(void 0===e.times){var n=[],i=[];_l.flattenJSON(e.keys,n,i,"value"),e.times=n,e.values=i}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)}function Vl(e,t,n){var i=this,r=!1,a=0,o=0,s=void 0,l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===r&&void 0!==i.onStart&&i.onStart(e,a,o),r=!0},this.itemEnd=function(e){a++,void 0!==i.onProgress&&i.onProgress(e,a,o),a===o&&(r=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(e){void 0!==i.onError&&i.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){var t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(var t=0,n=l.length;t<n;t+=2){var i=l[t],r=l[t+1];if(i.global&&(i.lastIndex=0),i.test(e))return r}return null}}Object.assign(Il.prototype,{evaluate:function(e){var t=this.parameterPositions,n=this._cachedIndex,i=t[n],r=t[n-1];e:{t:{var a;n:{i:if(!(e<i)){for(var o=n+2;;){if(void 0===i){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,e,r)}if(n===o)break;if(r=i,e<(i=t[++n]))break t}a=t.length;break n}if(e>=r)break e;var s=t[1];e<s&&(n=2,r=s);for(o=n-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,e,i);if(n===o)break;if(i=r,e>=(r=t[--n-1]))break t}a=n,n=0}for(;n<a;){var l=n+a>>>1;e<t[l]?a=l:n=l+1}if(i=t[n],void 0===(r=t[n-1]))return this._cachedIndex=0,this.beforeStart_(0,e,i);if(void 0===i)return n=t.length,this._cachedIndex=n,this.afterEnd_(n-1,r,e)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,e,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i,a=0;a!==i;++a)t[a]=n[r+a];return t},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),//!\ DECLARE ALIAS AFTER assign prototype !
|
|
|
Object.assign(Il.prototype,{beforeStart_:Il.prototype.copySampleValue_,afterEnd_:Il.prototype.copySampleValue_}),Ll.prototype=Object.assign(Object.create(Il.prototype),{constructor:Ll,DefaultSettings_:{endingStart:Ue,endingEnd:Ue},intervalChanged_:function(e,t,n){var i=this.parameterPositions,r=e-2,a=e+1,o=i[r],s=i[a];if(void 0===o)switch(this.getSettings_().endingStart){case De:r=e,o=2*t-n;break;case Re:o=t+i[r=i.length-2]-i[r+1];break;default:r=e,o=n}if(void 0===s)switch(this.getSettings_().endingEnd){case De:a=e,s=2*n-t;break;case Re:a=1,s=n+i[1]-i[0];break;default:a=e-1,s=t}var l=.5*(n-t),A=this.valueSize;this._weightPrev=l/(t-o),this._weightNext=l/(s-n),this._offsetPrev=r*A,this._offsetNext=a*A},interpolate_:function(e,t,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,A=this._offsetPrev,c=this._offsetNext,h=this._weightPrev,u=this._weightNext,d=(n-t)/(i-t),f=d*d,p=f*d,m=-h*p+2*h*f-h*d,v=(1+h)*p+(-1.5-2*h)*f+(-.5+h)*d+1,g=(-1-u)*p+(1.5+u)*f+.5*d,y=u*p-u*f,w=0;w!==o;++w)r[w]=m*a[A+w]+v*a[l+w]+g*a[s+w]+y*a[c+w];return r}}),Fl.prototype=Object.assign(Object.create(Il.prototype),{constructor:Fl,interpolate_:function(e,t,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=s-o,A=(n-t)/(i-t),c=1-A,h=0;h!==o;++h)r[h]=a[l+h]*c+a[s+h]*A;return r}}),kl.prototype=Object.assign(Object.create(Il.prototype),{constructor:kl,interpolate_:function(e){return this.copySampleValue_(e-1)}}),Object.assign(Pl,{toJSON:function(e){var t,n=e.constructor;if(void 0!==n.toJSON)t=n.toJSON(e);else{t={name:e.name,times:_l.convertArray(e.times,Array),values:_l.convertArray(e.values,Array)};var i=e.getInterpolation();i!==e.DefaultInterpolation&&(t.interpolation=i)}return t.type=e.ValueTypeName,t}}),Object.assign(Pl.prototype,{constructor:Pl,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:ke,InterpolantFactoryMethodDiscrete:function(e){return new kl(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new Fl(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new Ll(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case Fe:t=this.InterpolantFactoryMethodDiscrete;break;case ke:t=this.InterpolantFactoryMethodLinear;break;case Pe:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("KeyframeTrack:",n),this}return this.createInterpolant=t,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Fe;case this.InterpolantFactoryMethodLinear:return ke;case this.InterpolantFactoryMethodSmooth:return Pe}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,n=0,i=t.length;n!==i;++n)t[n]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,n=0,i=t.length;n!==i;++n)t[n]*=e;return this},trim:function(e,t){for(var n=this.times,i=n.length,r=0,a=i-1;r!==i&&n[r]<e;)++r;for(;-1!==a&&n[a]>t;)--a;if(++a,0!==r||a!==i){r>=a&&(r=(a=Math.max(a,1))-1);var o=this.getValueSize();this.times=_l.arraySlice(n,r,a),this.values=_l.arraySlice(this.values,r*o,a*o)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("KeyframeTrack: Invalid value size in track.",this),e=!1);var n=this.times,i=this.values,r=n.length;0===r&&(console.error("KeyframeTrack: Track is empty.",this),e=!1);for(var a=null,o=0;o!==r;o++){var s=n[o];if("number"==typeof s&&isNaN(s)){console.error("KeyframeTrack: Time is not a valid number.",this,o,s),e=!1;break}if(null!==a&&a>s){console.error("KeyframeTrack: Out of order keys.",this,o,s,a),e=!1;break}a=s}if(void 0!==i&&_l.isTypedArray(i)){o=0;for(var l=i.length;o!==l;++o){var A=i[o];if(isNaN(A)){console.error("KeyframeTrack: Value is not a valid number.",this,o,A),e=!1;break}}}return e},optimize:function(){for(var e=this.times,t=this.values,n=this.getValueSize(),i=this.getInterpolation()===Pe,r=1,a=e.length-1,o=1;o<a;++o){var s=!1,l=e[o];if(l!==e[o+1]&&(1!==o||l!==l[0]))if(i)s=!0;else for(var A=o*n,c=A-n,h=A+n,u=0;u!==n;++u){var d=t[A+u];if(d!==t[c+u]||d!==t[h+u]){s=!0;break}}if(s){if(o!==r){e[r]=e[o];var f=o*n,p=r*n;for(u=0;u!==n;++u)t[p+u]=t[f+u]}++r}}if(a>0){e[r]=e[a];for(f=a*n,p=r*n,u=0;u!==n;++u)t[p+u]=t[f+u];++r}return r!==e.length&&(this.times=_l.arraySlice(e,0,r),this.values=_l.arraySlice(t,0,r*n)),this},clone:function(){var e=_l.arraySlice(this.times,0),t=_l.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),Ul.prototype=Object.assign(Object.create(Pl.prototype),{constructor:Ul,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Fe,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Dl.prototype=Object.assign(Object.create(Pl.prototype),{constructor:Dl,ValueTypeName:"color"}),Rl.prototype=Object.assign(Object.create(Pl.prototype),{constructor:Rl,ValueTypeName:"number"}),Ol.prototype=Object.assign(Object.create(Il.prototype),{constructor:Ol,interpolate_:function(e,t,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=e*o,l=(n-t)/(i-t),A=s+o;s!==A;s+=4)nt.slerpFlat(r,0,a,s-o,a,s,l);return r}}),Nl.prototype=Object.assign(Object.create(Pl.prototype),{constructor:Nl,ValueTypeName:"quaternion",DefaultInterpolation:ke,InterpolantFactoryMethodLinear:function(e){return new Ol(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),zl.prototype=Object.assign(Object.create(Pl.prototype),{constructor:zl,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Fe,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Ql.prototype=Object.assign(Object.create(Pl.prototype),{constructor:Ql,ValueTypeName:"vector"}),Object.assign(Gl,{parse:function(e){for(var t=[],n=e.tracks,i=1/(e.fps||1),r=0,a=n.length;r!==a;++r)t.push(Hl(n[r]).scale(i));return new Gl(e.name,e.duration,t)},toJSON:function(e){for(var t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid},r=0,a=n.length;r!==a;++r)t.push(Pl.toJSON(n[r]));return i},CreateFromMorphTargetSequence:function(e,t,n,i){for(var r=t.length,a=[],o=0;o<r;o++){var s=[],l=[];s.push((o+r-1)%r,o,(o+1)%r),l.push(0,1,0);var A=_l.getKeyframeOrder(s);s=_l.sortedArray(s,1,A),l=_l.sortedArray(l,1,A),i||0!==s[0]||(s.push(r),l.push(l[0])),a.push(new Rl(".morphTargetInfluences["+t[o].name+"]",s,l).scale(1/n))}return new Gl(e,-1,a)},findByName:function(e,t){var n=e;if(!Array.isArray(e)){var i=e;n=i.geometry&&i.geometry.animations||i.animations}for(var r=0;r<n.length;r++)if(n[r].name===t)return n[r];return null},CreateClipsFromMorphTargetSequences:function(e,t,n){for(var i={},r=/^([\w-]*?)([\d]+)$/,a=0,o=e.length;a<o;a++){var s=e[a],l=s.name.match(r);if(l&&l.length>1){var A=i[h=l[1]];A||(i[h]=A=[]),A.push(s)}}var c=[];for(var h in i)c.push(Gl.CreateFromMorphTargetSequence(h,i[h],t,n));return c},parseAnimation:function(e,t){if(!e)return console.error("AnimationClip: No animation in JSONLoader data."),null;for(var n=function(e,t,n,i,r){if(0!==n.length){var a=[],o=[];_l.flattenJSON(n,a,o,i),0!==a.length&&r.push(new e(t,a,o))}},i=[],r=e.name||"default",a=e.length||-1,o=e.fps||30,s=e.hierarchy||[],l=0;l<s.length;l++){var A=s[l].keys;if(A&&0!==A.length)if(A[0].morphTargets){for(var c={},h=0;h<A.length;h++)if(A[h].morphTargets)for(var u=0;u<A[h].morphTargets.length;u++)c[A[h].morphTargets[u]]=-1;for(var d in c){var f=[],p=[];for(u=0;u!==A[h].morphTargets.length;++u){var m=A[h];f.push(m.time),p.push(m.morphTarget===d?1:0)}i.push(new Rl(".morphTargetInfluence["+d+"]",f,p))}a=c.length*(o||1)}else{var v=".bones["+t[l].name+"]";n(Ql,v+".position",A,"pos",i),n(Nl,v+".quaternion",A,"rot",i),n(Ql,v+".scale",A,"scl",i)}}return 0===i.length?null:new Gl(r,a,i)}}),Object.assign(Gl.prototype,{resetDuration:function(){for(var e=0,t=0,n=this.tracks.length;t!==n;++t){var i=this.tracks[t];e=Math.max(e,i.times[i.times.length-1])}return this.duration=e,this},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},validate:function(){for(var e=!0,t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this},clone:function(){for(var e=[],t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new Gl(this.name,this.duration,e)}}),Gl.prototype.slice=function(e){var t=[],n=0,i=this;return e.forEach((function(e,r){var a=[];i.tracks.forEach((function(t){var i,r=t.constructor==Ql?3:4,o=t.times.toArray().concat([]).slice(e[0],e[1]+1),s=t.values.toArray().concat([]).slice(e[0]*r,(e[1]+1)*r);0==o.length&&(o.push(0),s=t.values.toArray().concat([])),o.forEach((function(e,t){o[t]-=n})),t.constructor==Ql?i=new Ql(t.name,o,s):t.constructor==Nl&&(i=new Nl(t.name,o,s)),a.push(i)}));var o=new Gl("Take_"+r,-1,a);t.push(o),n=o.duration})),t},Float32Array.prototype.toArray=function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e};var jl=new Vl;function Wl(e){this.manager=void 0!==e?e:jl,this.crossOrigin="anonymous",this.path="",this.resourcePath=""}Object.assign(Wl.prototype,{load:function(){},parse:function(){},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this},setResourcePath:function(e){return this.resourcePath=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}});var Xl={enabled:!0,files:{},add:function(e,t){!1!==this.enabled&&(e.indexOf("?time=")>-1&&(e=e.substring(0,e.indexOf("?time="))),this.files[e]=t)},get:function(e){if(!1!==this.enabled)return e.indexOf("?time=")>-1&&(e=e.substring(0,e.indexOf("?time="))),this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},Yl={};function Kl(e){Wl.call(this,e)}function Zl(e){Wl.call(this,e)}function Jl(e){Wl.call(this,e)}function ql(e){Wl.call(this,e)}function $l(e){Wl.call(this,e)}function eA(e){Wl.call(this,e)}function tA(e){Wl.call(this,e)}function nA(){this.type="Curve",this.arcLengthDivisions=200}function iA(e,t,n,i,r,a,o,s){nA.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=n||1,this.yRadius=i||1,this.aStartAngle=r||0,this.aEndAngle=a||2*Math.PI,this.aClockwise=o||!1,this.aRotation=s||0}function rA(e,t,n,i,r,a){iA.call(this,e,t,n,n,i,r,a),this.type="ArcCurve"}function aA(){var e=0,t=0,n=0,i=0;function r(r,a,o,s){e=r,t=o,n=-3*r+3*a-2*o-s,i=2*r-2*a+o+s}return{initCatmullRom:function(e,t,n,i,a){r(t,n,a*(n-e),a*(i-t))},initNonuniformCatmullRom:function(e,t,n,i,a,o,s){var l=(t-e)/a-(n-e)/(a+o)+(n-t)/o,A=(n-t)/o-(i-t)/(o+s)+(i-n)/s;r(t,n,l*=o,A*=o)},calc:function(r){var a=r*r;return e+t*r+n*a+i*(a*r)}}}Kl.prototype=Object.assign(Object.create(Wl.prototype),{constructor:Kl,load:function(e,t,n,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var r=this;if(void 0===Yl[e]){var a=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(a){var o=a[1],s=!!a[2],l=a[3];l=decodeURIComponent(l),s&&(l=atob(l));try{var A,c=(this.responseType||"").toLowerCase();switch(c){case"arraybuffer":case"blob":for(var h=new Uint8Array(l.length),u=0;u<l.length;u++)h[u]=l.charCodeAt(u);A="blob"===c?new Blob([h.buffer],{type:o}):h.buffer;break;case"document":var d=new DOMParser;A=d.parseFromString(l,o);break;case"json":A=JSON.parse(l);break;default:A=l}setTimeout((function(){t&&t(A),r.manager.itemEnd(e)}),0)}catch(t){setTimeout((function(){i&&i(t),r.manager.itemError(e),r.manager.itemEnd(e)}),0)}}else{Yl[e]=[],Yl[e].push({onLoad:t,onProgress:n,onError:i});var f=new XMLHttpRequest;for(var p in f.open("GET",e,!0),f.addEventListener("load",(function(t){var n=this.response,i=Yl[e];if(delete Yl[e],200===this.status||0===this.status){0===this.status&&console.warn("FileLoader: HTTP Status 0 received."),Xl.add(e,n);for(var a=0,o=i.length;a<o;a++){(s=i[a]).onLoad&&s.onLoad(n)}r.manager.itemEnd(e)}else{for(a=0,o=i.length;a<o;a++){var s;(s=i[a]).onError&&s.onError(t)}r.manager.itemError(e),r.manager.itemEnd(e)}}),!1),f.addEventListener("progress",(function(t){for(var n=Yl[e],i=0,r=n.length;i<r;i++){var a=n[i];a.onProgress&&a.onProgress(t)}}),!1),f.addEventListener("error",(function(t){var n=Yl[e];delete Yl[e];for(var i=0,a=n.length;i<a;i++){var o=n[i];o.onError&&o.onError(t)}r.manager.itemError(e),r.manager.itemEnd(e)}),!1),f.addEventListener("abort",(function(t){var n=Yl[e];delete Yl[e];for(var i=0,a=n.length;i<a;i++){var o=n[i];o.onError&&o.onError(t)}r.manager.itemError(e),r.manager.itemEnd(e)}),!1),void 0!==this.responseType&&(f.responseType=this.responseType),void 0!==this.withCredentials&&(f.withCredentials=this.withCredentials),f.overrideMimeType&&f.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)f.setRequestHeader(p,this.requestHeader[p]);f.send(null)}return r.manager.itemStart(e),f}Yl[e].push({onLoad:t,onProgress:n,onError:i})},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this},setRequestHeader:function(e){return this.requestHeader=e,this}}),Zl.prototype=Object.assign(Object.create(Wl.prototype),{constructor:Zl,load:function(e,t,n,i){var r=this,a=new Kl(r.manager);a.setPath(r.path),a.load(e,(function(e){t(r.parse(JSON.parse(e)))}),n,i)},parse:function(e){for(var t=[],n=0;n<e.length;n++){var i=Gl.parse(e[n]);t.push(i)}return t}}),Jl.prototype=Object.assign(Object.create(Wl.prototype),{constructor:Jl,load:function(e,t,n,i){var r=this,a=[],o=new es;o.image=a;var s=new Kl(this.manager);function l(l){s.load(e[l],(function(e){var n=r.parse(e,!0);a[l]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(A+=1)&&(1===n.mipmapCount&&(o.minFilter=Z),o.format=n.format,o.needsUpdate=!0,t&&t(o))}),n,i)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(e))for(var A=0,c=0,h=e.length;c<h;++c)l(c);else s.load(e,(function(e){var n=r.parse(e,!0);if(n.isCubemap)for(var i=n.mipmaps.length/n.mipmapCount,s=0;s<i;s++){a[s]={mipmaps:[]};for(var l=0;l<n.mipmapCount;l++)a[s].mipmaps.push(n.mipmaps[s*n.mipmapCount+l]),a[s].format=n.format,a[s].width=n.width,a[s].height=n.height}else o.image.width=n.width,o.image.height=n.height,o.mipmaps=n.mipmaps;1===n.mipmapCount&&(o.minFilter=Z),o.format=n.format,o.needsUpdate=!0,t&&t(o)}),n,i);return o}}),ql.prototype=Object.assign(Object.create(Wl.prototype),{constructor:ql,load:function(e,t,n,i){var r=this,a=new Hi,o=new Kl(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(e,(function(e){var n=r.parse(e);n&&(void 0!==n.image?a.image=n.image:void 0!==n.data&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data),a.wrapS=void 0!==n.wrapS?n.wrapS:j,a.wrapT=void 0!==n.wrapT?n.wrapT:j,a.magFilter=void 0!==n.magFilter?n.magFilter:Z,a.minFilter=void 0!==n.minFilter?n.minFilter:Z,a.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(a.format=n.format),void 0!==n.type&&(a.type=n.type),void 0!==n.mipmaps&&(a.mipmaps=n.mipmaps,a.minFilter=q),1===n.mipmapCount&&(a.minFilter=Z),a.needsUpdate=!0,t&&t(a,n))}),n,i),a}}),$l.prototype=Object.assign(Object.create(Wl.prototype),{constructor:$l,load:function(e,t,n,i){void 0===this.path||e.startsWith("data:")||(e=this.path+e),e=this.manager.resolveURL(e);var r=this,a=Xl.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout((function(){t&&t(a),r.manager.itemEnd(e)}),0),a;var o=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1),t&&t(this),r.manager.itemEnd(e)}function l(t){o.removeEventListener("load",s,!1),o.removeEventListener("error",l,!1),i&&i(t),r.manager.itemError(e),r.manager.itemEnd(e)}return Xl.add(e,o),o.addEventListener("load",s,!1),o.addEventListener("error",l,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(e),o.src=e,o}}),eA.prototype=Object.assign(Object.create(Wl.prototype),{constructor:eA,load:function(e,t,n,i){var r=new hr,a=new $l(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);var o=0;function s(n){a.load(e[n],(function(e){r.images[n]=e,6===++o&&(r.needsUpdate=!0,t&&t(r))}),void 0,i)}for(var l=0;l<e.length;++l)s(l);return r}}),tA.prototype=Object.assign(Object.create(Wl.prototype),{constructor:tA,load:function(e,t,n,i){var r=new ht,a=new $l(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,(function(n){r.image=n;var i=e.search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/);r.format=i?Ae:ce,r.needsUpdate=!0,void 0!==t&&t(r)}),n,i),r}}),Object.assign(nA.prototype,{getPoint:function(){return console.warn("Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,n,i=[],r=this.getPoint(0),a=0;for(i.push(0),n=1;n<=e;n++)a+=(t=this.getPoint(n/e)).distanceTo(r),i.push(a),r=t;return this.cacheArcLengths=i,i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var n,i=this.getLengths(),r=0,a=i.length;n=t||e*i[a-1];for(var o,s=0,l=a-1;s<=l;)if((o=i[r=Math.floor(s+(l-s)/2)]-n)<0)s=r+1;else{if(!(o>0)){l=r;break}l=r-1}if(i[r=l]===n)return r/(a-1);var A=i[r];return(r+(n-A)/(i[r+1]-A))/(a-1)},getTangent:function(e){var t=1e-4,n=e-t,i=e+t;n<0&&(n=0),i>1&&(i=1);var r=this.getPoint(n);return this.getPoint(i).clone().sub(r).normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var n,i,r,a=new at,o=[],s=[],l=[],A=new at,c=new bt;for(n=0;n<=e;n++)i=n/e,o[n]=this.getTangentAt(i),o[n].normalize();s[0]=new at,l[0]=new at;var h=Number.MAX_VALUE,u=Math.abs(o[0].x),d=Math.abs(o[0].y),f=Math.abs(o[0].z);for(u<=h&&(h=u,a.set(1,0,0)),d<=h&&(h=d,a.set(0,1,0)),f<=h&&a.set(0,0,1),A.crossVectors(o[0],a).normalize(),s[0].crossVectors(o[0],A),l[0].crossVectors(o[0],s[0]),n=1;n<=e;n++)s[n]=s[n-1].clone(),l[n]=l[n-1].clone(),A.crossVectors(o[n-1],o[n]),A.length()>Number.EPSILON&&(A.normalize(),r=Math.acos(et.clamp(o[n-1].dot(o[n]),-1,1)),s[n].applyMatrix4(c.makeRotationAxis(A,r))),l[n].crossVectors(o[n],s[n]);if(!0===t)for(r=Math.acos(et.clamp(s[0].dot(s[e]),-1,1)),r/=e,o[0].dot(A.crossVectors(s[0],s[e]))>0&&(r=-r),n=1;n<=e;n++)s[n].applyMatrix4(c.makeRotationAxis(o[n],r*n)),l[n].crossVectors(o[n],s[n]);return{tangents:o,normals:s,binormals:l}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),iA.prototype=Object.create(nA.prototype),iA.prototype.constructor=iA,iA.prototype.isEllipseCurve=!0,iA.prototype.getPoint=function(e,t){for(var n=t||new tt,i=2*Math.PI,r=this.aEndAngle-this.aStartAngle,a=Math.abs(r)<Number.EPSILON;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(r=a?0:i),!0!==this.aClockwise||a||(r===i?r=-i:r-=i);var o=this.aStartAngle+e*r,s=this.aX+this.xRadius*Math.cos(o),l=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var A=Math.cos(this.aRotation),c=Math.sin(this.aRotation),h=s-this.aX,u=l-this.aY;s=h*A-u*c+this.aX,l=h*c+u*A+this.aY}return n.set(s,l)},iA.prototype.copy=function(e){return nA.prototype.copy.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},iA.prototype.toJSON=function(){var e=nA.prototype.toJSON.call(this);return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e},iA.prototype.fromJSON=function(e){return nA.prototype.fromJSON.call(this,e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this},rA.prototype=Object.create(iA.prototype),rA.prototype.constructor=rA,rA.prototype.isArcCurve=!0;var oA=new at,sA=new aA,lA=new aA,AA=new aA;function cA(e,t,n,i){nA.call(this),this.type="CatmullRomCurve3",this.points=e||[],this.closed=t||!1,this.curveType=n||"centripetal",this.tension=i||.5}function hA(e,t,n,i,r){var a=.5*(i-t),o=.5*(r-n),s=e*e;return(2*n-2*i+a+o)*(e*s)+(-3*n+3*i-2*a-o)*s+a*e+n}function uA(e,t,n,i){return function(e,t){var n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,i)}function dA(e,t,n,i,r){return function(e,t){var n=1-e;return n*n*n*t}(e,t)+function(e,t){var n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,i)+function(e,t){return e*e*e*t}(e,r)}function fA(e,t,n,i){nA.call(this),this.type="CubicBezierCurve",this.v0=e||new tt,this.v1=t||new tt,this.v2=n||new tt,this.v3=i||new tt}function pA(e,t,n,i){nA.call(this),this.type="CubicBezierCurve3",this.v0=e||new at,this.v1=t||new at,this.v2=n||new at,this.v3=i||new at}function mA(e,t){nA.call(this),this.type="LineCurve",this.v1=e||new tt,this.v2=t||new tt}function vA(e,t){nA.call(this),this.type="LineCurve3",this.v1=e||new at,this.v2=t||new at}function gA(e,t,n){nA.call(this),this.type="QuadraticBezierCurve",this.v0=e||new tt,this.v1=t||new tt,this.v2=n||new tt}function yA(e,t,n){nA.call(this),this.type="QuadraticBezierCurve3",this.v0=e||new at,this.v1=t||new at,this.v2=n||new at}function wA(e){nA.call(this),this.type="SplineCurve",this.points=e||[]}cA.prototype=Object.create(nA.prototype),cA.prototype.constructor=cA,cA.prototype.isCatmullRomCurve3=!0,cA.prototype.getPoint=function(e,t){var n,i,r,a,o=t||new at,s=this.points,l=s.length,A=(l-(this.closed?0:1))*e,c=Math.floor(A),h=A-c;if(this.closed?c+=c>0?0:(Math.floor(Math.abs(c)/l)+1)*l:0===h&&c===l-1&&(c=l-2,h=1),this.closed||c>0?n=s[(c-1)%l]:(oA.subVectors(s[0],s[1]).add(s[0]),n=oA),i=s[c%l],r=s[(c+1)%l],this.closed||c+2<l?a=s[(c+2)%l]:(oA.subVectors(s[l-1],s[l-2]).add(s[l-1]),a=oA),"centripetal"===this.curveType||"chordal"===this.curveType){var u="chordal"===this.curveType?.5:.25,d=Math.pow(n.distanceToSquared(i),u),f=Math.pow(i.distanceToSquared(r),u),p=Math.pow(r.distanceToSquared(a),u);f<1e-4&&(f=1),d<1e-4&&(d=f),p<1e-4&&(p=f),sA.initNonuniformCatmullRom(n.x,i.x,r.x,a.x,d,f,p),lA.initNonuniformCatmullRom(n.y,i.y,r.y,a.y,d,f,p),AA.initNonuniformCatmullRom(n.z,i.z,r.z,a.z,d,f,p)}else"catmullrom"===this.curveType&&(sA.initCatmullRom(n.x,i.x,r.x,a.x,this.tension),lA.initCatmullRom(n.y,i.y,r.y,a.y,this.tension),AA.initCatmullRom(n.z,i.z,r.z,a.z,this.tension));return o.set(sA.calc(h),lA.calc(h),AA.calc(h)),o},cA.prototype.copy=function(e){nA.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},cA.prototype.toJSON=function(){var e=nA.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e},cA.prototype.fromJSON=function(e){nA.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push((new at).fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this},fA.prototype=Object.create(nA.prototype),fA.prototype.constructor=fA,fA.prototype.isCubicBezierCurve=!0,fA.prototype.getPoint=function(e,t){var n=t||new tt,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(dA(e,i.x,r.x,a.x,o.x),dA(e,i.y,r.y,a.y,o.y)),n},fA.prototype.copy=function(e){return nA.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},fA.prototype.toJSON=function(){var e=nA.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},fA.prototype.fromJSON=function(e){return nA.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},pA.prototype=Object.create(nA.prototype),pA.prototype.constructor=pA,pA.prototype.isCubicBezierCurve3=!0,pA.prototype.getPoint=function(e,t){var n=t||new at,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(dA(e,i.x,r.x,a.x,o.x),dA(e,i.y,r.y,a.y,o.y),dA(e,i.z,r.z,a.z,o.z)),n},pA.prototype.copy=function(e){return nA.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this},pA.prototype.toJSON=function(){var e=nA.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e},pA.prototype.fromJSON=function(e){return nA.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this},mA.prototype=Object.create(nA.prototype),mA.prototype.constructor=mA,mA.prototype.isLineCurve=!0,mA.prototype.getPoint=function(e,t){var n=t||new tt;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},mA.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},mA.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},mA.prototype.copy=function(e){return nA.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},mA.prototype.toJSON=function(){var e=nA.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},mA.prototype.fromJSON=function(e){return nA.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},vA.prototype=Object.create(nA.prototype),vA.prototype.constructor=vA,vA.prototype.isLineCurve3=!0,vA.prototype.getPoint=function(e,t){var n=t||new at;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n},vA.prototype.getPointAt=function(e,t){return this.getPoint(e,t)},vA.prototype.copy=function(e){return nA.prototype.copy.call(this,e),this.v1.copy(e.v1),this.v2.copy(e.v2),this},vA.prototype.toJSON=function(){var e=nA.prototype.toJSON.call(this);return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},vA.prototype.fromJSON=function(e){return nA.prototype.fromJSON.call(this,e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},gA.prototype=Object.create(nA.prototype),gA.prototype.constructor=gA,gA.prototype.isQuadraticBezierCurve=!0,gA.prototype.getPoint=function(e,t){var n=t||new tt,i=this.v0,r=this.v1,a=this.v2;return n.set(uA(e,i.x,r.x,a.x),uA(e,i.y,r.y,a.y)),n},gA.prototype.copy=function(e){return nA.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},gA.prototype.toJSON=function(){var e=nA.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},gA.prototype.fromJSON=function(e){return nA.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},yA.prototype=Object.create(nA.prototype),yA.prototype.constructor=yA,yA.prototype.isQuadraticBezierCurve3=!0,yA.prototype.getPoint=function(e,t){var n=t||new at,i=this.v0,r=this.v1,a=this.v2;return n.set(uA(e,i.x,r.x,a.x),uA(e,i.y,r.y,a.y),uA(e,i.z,r.z,a.z)),n},yA.prototype.copy=function(e){return nA.prototype.copy.call(this,e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this},yA.prototype.toJSON=function(){var e=nA.prototype.toJSON.call(this);return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e},yA.prototype.fromJSON=function(e){return nA.prototype.fromJSON.call(this,e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this},wA.prototype=Object.create(nA.prototype),wA.prototype.constructor=wA,wA.prototype.isSplineCurve=!0,wA.prototype.getPoint=function(e,t){var n=t||new tt,i=this.points,r=(i.length-1)*e,a=Math.floor(r),o=r-a,s=i[0===a?a:a-1],l=i[a],A=i[a>i.length-2?i.length-1:a+1],c=i[a>i.length-3?i.length-1:a+2];return n.set(hA(o,s.x,l.x,A.x,c.x),hA(o,s.y,l.y,A.y,c.y)),n},wA.prototype.copy=function(e){nA.prototype.copy.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push(i.clone())}return this},wA.prototype.toJSON=function(){var e=nA.prototype.toJSON.call(this);e.points=[];for(var t=0,n=this.points.length;t<n;t++){var i=this.points[t];e.points.push(i.toArray())}return e},wA.prototype.fromJSON=function(e){nA.prototype.fromJSON.call(this,e),this.points=[];for(var t=0,n=e.points.length;t<n;t++){var i=e.points[t];this.points.push((new tt).fromArray(i))}return this};var xA=Object.freeze({__proto__:null,ArcCurve:rA,CatmullRomCurve3:cA,CubicBezierCurve:fA,CubicBezierCurve3:pA,EllipseCurve:iA,LineCurve:mA,LineCurve3:vA,QuadraticBezierCurve:gA,QuadraticBezierCurve3:yA,SplineCurve:wA});function bA(){nA.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function MA(e){bA.call(this),this.type="Path",this.currentPoint=new tt,e&&this.setFromPoints(e)}function CA(e){MA.call(this,e),this.uuid=et.generateUUID(),this.type="Shape",this.holes=[]}function BA(e,t){zt.call(this),this.type="Light",this.color=new Fn(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function EA(e,t,n){BA.call(this,e,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(zt.DefaultUp),this.updateMatrix(),this.groundColor=new Fn(t)}function SA(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new tt(512,512),this.map=null,this.mapPass=null,this.matrix=new bt,this._frustum=new Wi,this._frameExtents=new tt(1,1),this._viewportCount=1,this._viewports=[new ut(0,0,1,1)]}function TA(){SA.call(this,new Ni(50,1,.5,500))}function _A(e,t,n,i,r,a){BA.call(this,e,t),this.type="SpotLight",this.position.copy(zt.DefaultUp),this.updateMatrix(),this.target=new zt,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==i?i:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==a?a:1,this.shadow=new TA}function IA(){SA.call(this,new Ni(90,1,.5,500)),this._frameExtents=new tt(4,2),this._viewportCount=6,this._viewports=[new ut(2,1,1,1),new ut(0,1,1,1),new ut(3,1,1,1),new ut(1,1,1,1),new ut(3,0,1,1),new ut(1,0,1,1)],this._cubeDirections=[new at(1,0,0),new at(-1,0,0),new at(0,0,1),new at(0,0,-1),new at(0,1,0),new at(0,-1,0)],this._cubeUps=[new at(0,1,0),new at(0,1,0),new at(0,1,0),new at(0,1,0),new at(0,0,1),new at(0,0,-1)]}function LA(e,t,n,i){BA.call(this,e,t),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(e){this.intensity=e/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==i?i:1,this.shadow=new IA}function FA(e,t,n,i,r,a){Oi.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==e?e:-1,this.right=void 0!==t?t:1,this.top=void 0!==n?n:1,this.bottom=void 0!==i?i:-1,this.near=void 0!==r?r:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function kA(){SA.call(this,new FA(-5,5,5,-5,.5,500))}function PA(e,t){BA.call(this,e,t),this.type="DirectionalLight",this.position.copy(zt.DefaultUp),this.updateMatrix(),this.target=new zt,this.shadow=new kA}function UA(e,t){BA.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function DA(e,t,n,i){BA.call(this,e,t),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==i?i:10}function RA(e){Wl.call(this,e),this.textures={}}bA.prototype=Object.assign(Object.create(nA.prototype),{constructor:bA,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new mA(t,e))},getPoint:function(e){for(var t=e*this.getLength(),n=this.getCurveLengths(),i=0;i<n.length;){if(n[i]>=t){var r=n[i]-t,a=this.curves[i],o=a.getLength(),s=0===o?0:1-r/o;return a.getPointAt(s)}i++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.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;for(var e=[],t=0,n=0,i=this.curves.length;n<i;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){void 0===e&&(e=40);for(var t=[],n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,n=[],i=0,r=this.curves;i<r.length;i++)for(var a=r[i],o=a&&a.isEllipseCurve?2*e:a&&(a.isLineCurve||a.isLineCurve3)?1:a&&a.isSplineCurve?e*a.points.length:e,s=a.getPoints(o),l=0;l<s.length;l++){var A=s[l];t&&t.equals(A)||(n.push(A),t=A)}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(e){nA.prototype.copy.call(this,e),this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var i=e.curves[t];this.curves.push(i.clone())}return this.autoClose=e.autoClose,this},toJSON:function(){var e=nA.prototype.toJSON.call(this);e.autoClose=this.autoClose,e.curves=[];for(var t=0,n=this.curves.length;t<n;t++){var i=this.curves[t];e.curves.push(i.toJSON())}return e},fromJSON:function(e){nA.prototype.fromJSON.call(this,e),this.autoClose=e.autoClose,this.curves=[];for(var t=0,n=e.curves.length;t<n;t++){var i=e.curves[t];this.curves.push((new xA[i.type]).fromJSON(i))}return this}}),MA.prototype=Object.assign(Object.create(bA.prototype),{constructor:MA,setFromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this},moveTo:function(e,t){return this.currentPoint.set(e,t),this},lineTo:function(e,t){var n=new mA(this.currentPoint.clone(),new tt(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this},quadraticCurveTo:function(e,t,n,i){var r=new gA(this.currentPoint.clone(),new tt(e,t),new tt(n,i));return this.curves.push(r),this.currentPoint.set(n,i),this},bezierCurveTo:function(e,t,n,i,r,a){var o=new fA(this.currentPoint.clone(),new tt(e,t),new tt(n,i),new tt(r,a));return this.curves.push(o),this.currentPoint.set(r,a),this},splineThru:function(e){var t=new wA([this.currentPoint.clone()].concat(e));return this.curves.push(t),this.currentPoint.copy(e[e.length-1]),this},arc:function(e,t,n,i,r,a){var o=this.currentPoint.x,s=this.currentPoint.y;return this.absarc(e+o,t+s,n,i,r,a),this},absarc:function(e,t,n,i,r,a){return this.absellipse(e,t,n,n,i,r,a),this},ellipse:function(e,t,n,i,r,a,o,s){var l=this.currentPoint.x,A=this.currentPoint.y;return this.absellipse(e+l,t+A,n,i,r,a,o,s),this},absellipse:function(e,t,n,i,r,a,o,s){var l=new iA(e,t,n,i,r,a,o,s);if(this.curves.length>0){var A=l.getPoint(0);A.equals(this.currentPoint)||this.lineTo(A.x,A.y)}this.curves.push(l);var c=l.getPoint(1);return this.currentPoint.copy(c),this},copy:function(e){return bA.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=bA.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return bA.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),CA.prototype=Object.assign(Object.create(MA.prototype),{constructor:CA,getPointsHoles:function(e){for(var t=[],n=0,i=this.holes.length;n<i;n++)t[n]=this.holes[n].getPoints(e);return t},extractPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},copy:function(e){MA.prototype.copy.call(this,e),this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var i=e.holes[t];this.holes.push(i.clone())}return this},toJSON:function(){var e=MA.prototype.toJSON.call(this);e.uuid=this.uuid,e.holes=[];for(var t=0,n=this.holes.length;t<n;t++){var i=this.holes[t];e.holes.push(i.toJSON())}return e},fromJSON:function(e){MA.prototype.fromJSON.call(this,e),this.uuid=e.uuid,this.holes=[];for(var t=0,n=e.holes.length;t<n;t++){var i=e.holes[t];this.holes.push((new MA).fromJSON(i))}return this}}),BA.prototype=Object.assign(Object.create(zt.prototype),{constructor:BA,isLight:!0,copy:function(e){return zt.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=zt.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),EA.prototype=Object.assign(Object.create(BA.prototype),{constructor:EA,isHemisphereLight:!0,copy:function(e){return BA.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(SA.prototype,{_projScreenMatrix:new bt,_lightPositionWorld:new at,_lookTarget:new at,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(e){var t=this.camera,n=this.matrix,i=this._projScreenMatrix,r=this._lookTarget,a=this._lightPositionWorld;a.setFromMatrixPosition(e.matrixWorld),t.position.copy(a),r.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(r),t.updateMatrixWorld(),i.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromMatrix(i),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(t.projectionMatrix),n.multiply(t.matrixWorldInverse)},getViewport:function(e){return this._viewports[e]},getFrameExtents:function(){return this._frameExtents},copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),TA.prototype=Object.assign(Object.create(SA.prototype),{constructor:TA,isSpotLightShadow:!0,updateMatrices:function(e){var t=this.camera,n=2*et.RAD2DEG*e.angle,i=this.mapSize.width/this.mapSize.height,r=e.distance||t.far;n===t.fov&&i===t.aspect&&r===t.far||(t.fov=n,t.aspect=i,t.far=r,t.updateProjectionMatrix()),SA.prototype.updateMatrices.call(this,e)}}),_A.prototype=Object.assign(Object.create(BA.prototype),{constructor:_A,isSpotLight:!0,copy:function(e){return BA.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),IA.prototype=Object.assign(Object.create(SA.prototype),{constructor:IA,isPointLightShadow:!0,updateMatrices:function(e,t){void 0===t&&(t=0);var n=this.camera,i=this.matrix,r=this._lightPositionWorld,a=this._lookTarget,o=this._projScreenMatrix;r.setFromMatrixPosition(e.matrixWorld),n.position.copy(r),a.copy(n.position),a.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(a),n.updateMatrixWorld(),i.makeTranslation(-r.x,-r.y,-r.z),o.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromMatrix(o)}}),LA.prototype=Object.assign(Object.create(BA.prototype),{constructor:LA,isPointLight:!0,copy:function(e){return BA.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),FA.prototype=Object.assign(Object.create(Oi.prototype),{constructor:FA,isOrthographicCamera:!0,copy:function(e,t){return Oi.prototype.copy.call(this,e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this},setViewOffset:function(e,t,n,i,r,a){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=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=n-e,a=n+e,o=i+t,s=i-t;if(null!==this.view&&this.view.enabled){var l=this.zoom/(this.view.width/this.view.fullWidth),A=this.zoom/(this.view.height/this.view.fullHeight),c=(this.right-this.left)/this.view.width,h=(this.top-this.bottom)/this.view.height;a=(r+=c*(this.view.offsetX/l))+c*(this.view.width/l),s=(o-=h*(this.view.offsetY/A))-h*(this.view.height/A)}this.projectionMatrix.makeOrthographic(r,a,o,s,this.near,this.far),this.top2=o,this.bottom2=s,this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(e){var t=zt.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}),kA.prototype=Object.assign(Object.create(SA.prototype),{constructor:kA,isDirectionalLightShadow:!0,updateMatrices:function(e){SA.prototype.updateMatrices.call(this,e)}}),PA.prototype=Object.assign(Object.create(BA.prototype),{constructor:PA,isDirectionalLight:!0,copy:function(e){return BA.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),UA.prototype=Object.assign(Object.create(BA.prototype),{constructor:UA,isAmbientLight:!0}),DA.prototype=Object.assign(Object.create(BA.prototype),{constructor:DA,isRectAreaLight:!0,copy:function(e){return BA.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this},toJSON:function(e){var t=BA.prototype.toJSON.call(this,e);return t.object.width=this.width,t.object.height=this.height,t}}),RA.prototype=Object.assign(Object.create(Wl.prototype),{constructor:RA,load:function(e,t,n,i){var r=this,a=new Kl(r.manager);a.setPath(r.path),a.load(e,(function(e){t(r.parse(JSON.parse(e)))}),n,i)},parse:function(e){var t=this.textures;function n(e){return void 0===t[e]&&console.warn("MaterialLoader: Undefined texture",e),t[e]}var i=new Tl[e.type];if(void 0!==e.uuid&&(i.uuid=e.uuid),void 0!==e.name&&(i.name=e.name),void 0!==e.color&&i.color.setHex(e.color),void 0!==e.roughness&&(i.roughness=e.roughness),void 0!==e.metalness&&(i.metalness=e.metalness),void 0!==e.sheen&&(i.sheen=(new Fn).setHex(e.sheen)),void 0!==e.emissive&&i.emissive.setHex(e.emissive),void 0!==e.specular&&i.specular.setHex(e.specular),void 0!==e.shininess&&(i.shininess=e.shininess),void 0!==e.clearcoat&&(i.clearcoat=e.clearcoat),void 0!==e.clearcoatRoughness&&(i.clearcoatRoughness=e.clearcoatRoughness),void 0!==e.vertexColors&&(i.vertexColors=e.vertexColors),void 0!==e.fog&&(i.fog=e.fog),void 0!==e.flatShading&&(i.flatShading=e.flatShading),void 0!==e.blending&&(i.blending=e.blending),void 0!==e.combine&&(i.combine=e.combine),void 0!==e.side&&(i.side=e.side),void 0!==e.opacity&&(i.opacity=e.opacity),void 0!==e.transparent&&(i.transparent=e.transparent),void 0!==e.alphaTest&&(i.alphaTest=e.alphaTest),void 0!==e.depthTest&&(i.depthTest=e.depthTest),void 0!==e.depthWrite&&(i.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(i.colorWrite=e.colorWrite),void 0!==e.stencilWrite&&(i.stencilWrite=e.stencilWrite),void 0!==e.stencilWriteMask&&(i.stencilWriteMask=e.stencilWriteMask),void 0!==e.stencilFunc&&(i.stencilFunc=e.stencilFunc),void 0!==e.stencilRef&&(i.stencilRef=e.stencilRef),void 0!==e.stencilFuncMask&&(i.stencilFuncMask=e.stencilFuncMask),void 0!==e.stencilFail&&(i.stencilFail=e.stencilFail),void 0!==e.stencilZFail&&(i.stencilZFail=e.stencilZFail),void 0!==e.stencilZPass&&(i.stencilZPass=e.stencilZPass),void 0!==e.wireframe&&(i.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(i.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(i.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(i.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.rotation&&(i.rotation=e.rotation),1!==e.linewidth&&(i.linewidth=e.linewidth),void 0!==e.dashSize&&(i.dashSize=e.dashSize),void 0!==e.gapSize&&(i.gapSize=e.gapSize),void 0!==e.scale&&(i.scale=e.scale),void 0!==e.polygonOffset&&(i.polygonOffset=e.polygonOffset),void 0!==e.polygonOffsetFactor&&(i.polygonOffsetFactor=e.polygonOffsetFactor),void 0!==e.polygonOffsetUnits&&(i.polygonOffsetUnits=e.polygonOffsetUnits),void 0!==e.skinning&&(i.skinning=e.skinning),void 0!==e.morphTargets&&(i.morphTargets=e.morphTargets),void 0!==e.morphNormals&&(i.morphNormals=e.morphNormals),void 0!==e.dithering&&(i.dithering=e.dithering),void 0!==e.visible&&(i.visible=e.visible),void 0!==e.toneMapped&&(i.toneMapped=e.toneMapped),void 0!==e.userData&&(i.userData=e.userData),void 0!==e.uniforms)for(var r in e.uniforms){var a=e.uniforms[r];switch(i.uniforms[r]={},a.type){case"t":i.uniforms[r].value=n(a.value);break;case"c":i.uniforms[r].value=(new Fn).setHex(a.value);break;case"v2":i.uniforms[r].value=(new tt).fromArray(a.value);break;case"v3":i.uniforms[r].value=(new at).fromArray(a.value);break;case"v4":i.uniforms[r].value=(new ut).fromArray(a.value);break;case"m3":i.uniforms[r].value=(new lt).fromArray(a.value);case"m4":i.uniforms[r].value=(new bt).fromArray(a.value);break;default:i.uniforms[r].value=a.value}}if(void 0!==e.defines&&(i.defines=e.defines),void 0!==e.vertexShader&&(i.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(i.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(var o in e.extensions)i.extensions[o]=e.extensions[o];if(void 0!==e.shading&&(i.flatShading=1===e.shading),void 0!==e.size&&(i.size=e.size),void 0!==e.sizeAttenuation&&(i.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(i.map=n(e.map)),void 0!==e.matcap&&(i.matcap=n(e.matcap)),void 0!==e.alphaMap&&(i.alphaMap=n(e.alphaMap),i.transparent=!0),void 0!==e.bumpMap&&(i.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(i.bumpScale=e.bumpScale),void 0!==e.normalMap&&(i.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(i.normalMapType=e.normalMapType),void 0!==e.normalScale){var s=e.normalScale;!1===Array.isArray(s)&&(s=[s,s]),i.normalScale=(new tt).fromArray(s)}return void 0!==e.displacementMap&&(i.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(i.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(i.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(i.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(i.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(i.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(i.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(i.specularMap=n(e.specularMap)),void 0!==e.envMap&&(i.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(i.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(i.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(i.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(i.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(i.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(i.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(i.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(i.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatNormalMap&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(i.clearcoatNormalScale=(new tt).fromArray(e.clearcoatNormalScale)),i},setTextures:function(e){return this.textures=e,this}});var OA={decodeText:function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}},extractUrlBase:function(e){var t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)}};function NA(){si.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function zA(e,t,n,i){"number"==typeof n&&(i=n,n=!1,console.error("InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),zn.call(this,e,t,n),this.meshPerAttribute=i||1}function QA(e){Wl.call(this,e)}NA.prototype=Object.assign(Object.create(si.prototype),{constructor:NA,isInstancedBufferGeometry:!0,copy:function(e){return si.prototype.copy.call(this,e),this.maxInstancedCount=e.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e=si.prototype.toJSON.call(this);return e.maxInstancedCount=this.maxInstancedCount,e.isInstancedBufferGeometry=!0,e}}),zA.prototype=Object.assign(Object.create(zn.prototype),{constructor:zA,isInstancedBufferAttribute:!0,copy:function(e){return zn.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){var e=zn.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}),QA.prototype=Object.assign(Object.create(Wl.prototype),{constructor:QA,load:function(e,t,n,i){var r=this,a=new Kl(r.manager);a.setPath(r.path),a.load(e,(function(e){t(r.parse(JSON.parse(e)))}),n,i)},parse:function(e){var t=e.isInstancedBufferGeometry?new NA:new si,n=e.data.index;if(void 0!==n){var i=new GA[n.type](n.array);t.setIndex(new zn(i,1))}var r=e.data.attributes;for(var a in r){var o=r[a],s=(i=new GA[o.type](o.array),new(o.isInstancedBufferAttribute?zA:zn)(i,o.itemSize,o.normalized));void 0!==o.name&&(s.name=o.name),t.setAttribute(a,s)}var l=e.data.morphAttributes;if(l)for(var a in l){for(var A=l[a],c=[],h=0,u=A.length;h<u;h++){o=A[h],s=new zn(i=new GA[o.type](o.array),o.itemSize,o.normalized);void 0!==o.name&&(s.name=o.name),c.push(s)}t.morphAttributes[a]=c}e.data.morphTargetsRelative&&(t.morphTargetsRelative=!0);var d=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==d){h=0;for(var f=d.length;h!==f;++h){var p=d[h];t.addGroup(p.start,p.count,p.materialIndex)}}var m=e.data.boundingSphere;if(void 0!==m){var v=new at;void 0!==m.center&&v.fromArray(m.center),t.boundingSphere=new an(v,m.radius)}return e.name&&(t.name=e.name),e.userData&&(t.userData=e.userData),t}});var GA={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function HA(e){Wl.call(this,e)}HA.prototype=Object.assign(Object.create(Wl.prototype),{constructor:HA,load:function(e,t,n,i){var r=this,a=""===this.path?OA.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;var o=new Kl(r.manager);o.setPath(this.path),o.load(e,(function(n){var a=null;try{a=JSON.parse(n)}catch(t){return void 0!==i&&i(t),void console.error("ObjectLoader: Can't parse "+e+".",t.message)}var o=a.metadata;void 0!==o&&void 0!==o.type&&"geometry"!==o.type.toLowerCase()?r.parse(a,t):console.error("ObjectLoader: Can't load "+e)}),n,i)},parse:function(e,t){var n=this.parseShape(e.shapes),i=this.parseGeometries(e.geometries,n),r=this.parseImages(e.images,(function(){void 0!==t&&t(s)})),a=this.parseTextures(e.textures,r),o=this.parseMaterials(e.materials,a),s=this.parseObject(e.object,i,o);return e.animations&&(s.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0!==t&&t(s),s},parseShape:function(e){var t={};if(void 0!==e)for(var n=0,i=e.length;n<i;n++){var r=(new CA).fromJSON(e[n]);t[r.uuid]=r}return t},parseGeometries:function(e,t){var n={};if(void 0!==e)for(var i=new QA,r=0,a=e.length;r<a;r++){var o,s=e[r];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new pl[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new pl[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new pl[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new pl[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new pl[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new pl[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":o=new pl[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new pl[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new pl[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new pl[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":o=new pl[s.type]((new xA[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":o=new pl[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":o=new pl[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var l=[],A=0,c=s.shapes.length;A<c;A++){var h=t[s.shapes[A]];l.push(h)}o=new pl[s.type](l,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(l=[],A=0,c=s.shapes.length;A<c;A++){h=t[s.shapes[A]];l.push(h)}var u=s.options.extrudePath;void 0!==u&&(s.options.extrudePath=(new xA[u.type]).fromJSON(u)),o=new pl[s.type](l,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":o=i.parse(s);break;case"Geometry":if("THREE"in window&&"LegacyJSONLoader"in THREE)o=(new THREE.LegacyJSONLoader).parse(s,this.resourcePath).geometry;else console.error('ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');break;default:console.warn('ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),!0===o.isBufferGeometry&&void 0!==s.userData&&(o.userData=s.userData),n[s.uuid]=o}return n},parseMaterials:function(e,t){var n={},i={};if(void 0!==e){var r=new RA;r.setTextures(t);for(var a=0,o=e.length;a<o;a++){var s=e[a];if("MultiMaterial"===s.type){for(var l=[],A=0;A<s.materials.length;A++){var c=s.materials[A];void 0===n[c.uuid]&&(n[c.uuid]=r.parse(c)),l.push(n[c.uuid])}i[s.uuid]=l}else void 0===n[s.uuid]&&(n[s.uuid]=r.parse(s)),i[s.uuid]=n[s.uuid]}}return i},parseAnimations:function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n],r=Gl.parse(i);void 0!==i.uuid&&(r.uuid=i.uuid),t.push(r)}return t},parseImages:function(e,t){var n=this,i={};function r(e){return n.manager.itemStart(e),a.load(e,(function(){n.manager.itemEnd(e)}),void 0,(function(){n.manager.itemError(e),n.manager.itemEnd(e)}))}if(void 0!==e&&e.length>0){var a=new $l(new Vl(t));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=e.length;o<s;o++){var l=e[o],A=l.url;if(Array.isArray(A)){i[l.uuid]=[];for(var c=0,h=A.length;c<h;c++){var u=A[c],d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(u)?u:n.resourcePath+u;i[l.uuid].push(r(d))}}else{d=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l.url)?l.url:n.resourcePath+l.url;i[l.uuid]=r(d)}}}return i},parseTextures:function(e,t){function n(e,t){return"number"==typeof e?e:(console.warn("ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var i={};if(void 0!==e)for(var r=0,a=e.length;r<a;r++){var o,s=e[r];void 0===s.image&&console.warn('ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("ObjectLoader: Undefined image",s.image),(o=Array.isArray(t[s.image])?new hr(t[s.image]):new ht(t[s.image])).needsUpdate=!0,o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),void 0!==s.mapping&&(o.mapping=n(s.mapping,jA)),void 0!==s.offset&&o.offset.fromArray(s.offset),void 0!==s.repeat&&o.repeat.fromArray(s.repeat),void 0!==s.center&&o.center.fromArray(s.center),void 0!==s.rotation&&(o.rotation=s.rotation),void 0!==s.wrap&&(o.wrapS=n(s.wrap[0],WA),o.wrapT=n(s.wrap[1],WA)),void 0!==s.format&&(o.format=s.format),void 0!==s.type&&(o.type=s.type),void 0!==s.encoding&&(o.encoding=s.encoding),void 0!==s.minFilter&&(o.minFilter=n(s.minFilter,XA)),void 0!==s.magFilter&&(o.magFilter=n(s.magFilter,XA)),void 0!==s.anisotropy&&(o.anisotropy=s.anisotropy),void 0!==s.flipY&&(o.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(o.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(o.unpackAlignment=s.unpackAlignment),i[s.uuid]=o}return i},parseObject:function(e,t,n){var i;function r(e){return void 0===t[e]&&console.warn("ObjectLoader: Undefined geometry",e),t[e]}function a(e){if(void 0!==e){if(Array.isArray(e)){for(var t=[],i=0,r=e.length;i<r;i++){var a=e[i];void 0===n[a]&&console.warn("ObjectLoader: Undefined material",a),t.push(n[a])}return t}return void 0===n[e]&&console.warn("ObjectLoader: Undefined material",e),n[e]}}switch(e.type){case"Scene":i=new Qt,void 0!==e.background&&Number.isInteger(e.background)&&(i.background=new Fn(e.background)),void 0!==e.fog&&("Fog"===e.fog.type?i.fog=new to(e.fog.color,e.fog.near,e.fog.far):"FogExp2"===e.fog.type&&(i.fog=new eo(e.fog.color,e.fog.density)));break;case"PerspectiveCamera":i=new Ni(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(i.focus=e.focus),void 0!==e.zoom&&(i.zoom=e.zoom),void 0!==e.filmGauge&&(i.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(i.filmOffset=e.filmOffset),void 0!==e.view&&(i.view=Object.assign({},e.view));break;case"OrthographicCamera":i=new FA(e.left,e.right,e.top,e.bottom,e.near,e.far),void 0!==e.zoom&&(i.zoom=e.zoom),void 0!==e.view&&(i.view=Object.assign({},e.view));break;case"AmbientLight":i=new UA(e.color,e.intensity);break;case"DirectionalLight":i=new PA(e.color,e.intensity);break;case"PointLight":i=new LA(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":i=new DA(e.color,e.intensity,e.width,e.height);break;case"SpotLight":i=new _A(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":i=new EA(e.color,e.groundColor,e.intensity);break;case"SkinnedMesh":console.warn("ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var o=r(e.geometry),s=a(e.material);i=o.bones&&o.bones.length>0?new Bo(o,s):new Ei(o,s);break;case"InstancedMesh":o=r(e.geometry),s=a(e.material);var l=e.count,A=e.instanceMatrix;(i=new Uo(o,s,l)).instanceMatrix=new zn(new Float32Array(A.array),16);break;case"LOD":i=new bo;break;case"Line":i=new Go(r(e.geometry),a(e.material),e.mode);break;case"LineLoop":i=new Wo(r(e.geometry),a(e.material));break;case"LineSegments":i=new jo(r(e.geometry),a(e.material));break;case"PointCloud":case"Points":i=new qo(r(e.geometry),a(e.material));break;case"Sprite":i=new go(a(e.material));break;case"Group":i=new ja;break;default:i=new zt}if(i.uuid=e.uuid,void 0!==e.name&&(i.name=e.name),void 0!==e.matrix?(i.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(i.matrixAutoUpdate=e.matrixAutoUpdate),i.matrixAutoUpdate&&i.matrix.decompose(i.position,i.quaternion,i.scale)):(void 0!==e.position&&i.position.fromArray(e.position),void 0!==e.rotation&&i.rotation.fromArray(e.rotation),void 0!==e.quaternion&&i.quaternion.fromArray(e.quaternion),void 0!==e.scale&&i.scale.fromArray(e.scale)),void 0!==e.castShadow&&(i.castShadow=e.castShadow),void 0!==e.receiveShadow&&(i.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(i.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(i.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&i.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(i.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(i.visible=e.visible),void 0!==e.frustumCulled&&(i.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(i.renderOrder=e.renderOrder),void 0!==e.userData&&(i.userData=e.userData),void 0!==e.layers&&(i.layers.mask=e.layers),void 0!==e.drawMode&&i.setDrawMode(e.drawMode),void 0!==e.children)for(var c=e.children,h=0;h<c.length;h++)i.add(this.parseObject(c[h],t,n));if("LOD"===e.type){void 0!==e.autoUpdate&&(i.autoUpdate=e.autoUpdate);for(var u=e.levels,d=0;d<u.length;d++){var f=u[d],p=i.getObjectByProperty("uuid",f.object);void 0!==p&&i.addLevel(p,f.distance)}}return i}});var VA,jA={UVMapping:O,CubeReflectionMapping:N,CubeRefractionMapping:z,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:Q,SphericalReflectionMapping:305,CubeUVReflectionMapping:G,CubeUVRefractionMapping:H},WA={RepeatWrapping:V,ClampToEdgeWrapping:j,MirroredRepeatWrapping:W},XA={NearestFilter:X,NearestMipmapNearestFilter:Y,NearestMipmapLinearFilter:K,LinearFilter:Z,LinearMipmapNearestFilter:J,LinearMipmapLinearFilter:q};function YA(e){"undefined"==typeof createImageBitmap&&console.warn("ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("ImageBitmapLoader: fetch() not supported."),Wl.call(this,e),this.options=void 0}function KA(){this.type="ShapePath",this.color=new Fn,this.subPaths=[],this.currentPath=null}function ZA(e){this.type="Font",this.data=e}function JA(e,t,n,i,r){var a=r.glyphs[e]||r.glyphs["?"];if(a){var o,s,l,A,c,h,u,d,f=new KA;if(a.o)for(var p=a._cachedOutline||(a._cachedOutline=a.o.split(" ")),m=0,v=p.length;m<v;){switch(p[m++]){case"m":o=p[m++]*t+n,s=p[m++]*t+i,f.moveTo(o,s);break;case"l":o=p[m++]*t+n,s=p[m++]*t+i,f.lineTo(o,s);break;case"q":l=p[m++]*t+n,A=p[m++]*t+i,c=p[m++]*t+n,h=p[m++]*t+i,f.quadraticCurveTo(c,h,l,A);break;case"b":l=p[m++]*t+n,A=p[m++]*t+i,c=p[m++]*t+n,h=p[m++]*t+i,u=p[m++]*t+n,d=p[m++]*t+i,f.bezierCurveTo(c,h,u,d,l,A)}}return{offsetX:a.ha*t,path:f}}console.error('Font: character "'+e+'" does not exists in font family '+r.familyName+".")}function qA(e){Wl.call(this,e)}YA.prototype=Object.assign(Object.create(Wl.prototype),{constructor:YA,setOptions:function(e){return this.options=e,this},load:function(e,t,n,i){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var r=this,a=Xl.get(e);if(void 0!==a)return r.manager.itemStart(e),setTimeout((function(){t&&t(a),r.manager.itemEnd(e)}),0),a;fetch(e).then((function(e){return e.blob()})).then((function(e){return void 0===r.options?createImageBitmap(e):createImageBitmap(e,r.options)})).then((function(n){Xl.add(e,n),t&&t(n),r.manager.itemEnd(e)})).catch((function(t){i&&i(t),r.manager.itemError(e),r.manager.itemEnd(e)})),r.manager.itemStart(e)}}),Object.assign(KA.prototype,{moveTo:function(e,t){return this.currentPath=new MA,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this},lineTo:function(e,t){return this.currentPath.lineTo(e,t),this},quadraticCurveTo:function(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this},bezierCurveTo:function(e,t,n,i,r,a){return this.currentPath.bezierCurveTo(e,t,n,i,r,a),this},splineThru:function(e){return this.currentPath.splineThru(e),this},toShapes:function(e,t){function n(e){for(var t=[],n=0,i=e.length;n<i;n++){var r=e[n],a=new CA;a.curves=r.curves,t.push(a)}return t}function i(e,t){for(var n=t.length,i=!1,r=n-1,a=0;a<n;r=a++){var o=t[r],s=t[a],l=s.x-o.x,A=s.y-o.y;if(Math.abs(A)>Number.EPSILON){if(A<0&&(o=t[a],l=-l,s=t[r],A=-A),e.y<o.y||e.y>s.y)continue;if(e.y===o.y){if(e.x===o.x)return!0}else{var c=A*(e.x-o.x)-l*(e.y-o.y);if(0===c)return!0;if(c<0)continue;i=!i}}else{if(e.y!==o.y)continue;if(s.x<=e.x&&e.x<=o.x||o.x<=e.x&&e.x<=s.x)return!0}}return i}var r=Vs.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===t)return n(a);var o,s,l,A=[];if(1===a.length)return s=a[0],(l=new CA).curves=s.curves,A.push(l),A;var c=!r(a[0].getPoints());c=e?!c:c;var h,u,d=[],f=[],p=[],m=0;f[m]=void 0,p[m]=[];for(var v=0,g=a.length;v<g;v++)o=r(h=(s=a[v]).getPoints()),(o=e?!o:o)?(!c&&f[m]&&m++,f[m]={s:new CA,p:h},f[m].s.curves=s.curves,c&&m++,p[m]=[]):p[m].push({h:s,p:h[0]});if(!f[0])return n(a);if(f.length>1){for(var y=!1,w=[],x=0,b=f.length;x<b;x++)d[x]=[];for(x=0,b=f.length;x<b;x++)for(var M=p[x],C=0;C<M.length;C++){for(var B=M[C],E=!0,S=0;S<f.length;S++)i(B.p,f[S].p)&&(x!==S&&w.push({froms:x,tos:S,hole:C}),E?(E=!1,d[S].push(B)):y=!0);E&&d[x].push(B)}w.length>0&&(y||(p=d))}v=0;for(var T=f.length;v<T;v++){l=f[v].s,A.push(l);for(var _=0,I=(u=p[v]).length;_<I;_++)l.holes.push(u[_].h)}return A}}),Object.assign(ZA.prototype,{isFont:!0,generateShapes:function(e,t){void 0===t&&(t=100);for(var n=[],i=function(e,t,n){for(var i=Array.from?Array.from(e):String(e).split(""),r=t/n.resolution,a=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*r,o=[],s=0,l=0,A=0;A<i.length;A++){var c=i[A];if("\n"===c)s=0,l-=a;else{var h=JA(c,r,s,l,n);s+=h.offsetX,o.push(h.path)}}return o}(e,t,this.data),r=0,a=i.length;r<a;r++)Array.prototype.push.apply(n,i[r].toShapes());return n}}),qA.prototype=Object.assign(Object.create(Wl.prototype),{constructor:qA,load:function(e,t,n,i){var r=this,a=new Kl(this.manager);a.setPath(this.path),a.load(e,(function(e){var n;try{n=JSON.parse(e)}catch(t){console.warn("FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}var i=r.parse(n);t&&t(i)}),n,i)},parse:function(e){return new ZA(e)}});var $A={getContext:function(){return void 0===VA&&(VA=new(window.AudioContext||window.webkitAudioContext)),VA},setContext:function(e){VA=e}};function ec(e){Wl.call(this,e)}function tc(){this.coefficients=[];for(var e=0;e<9;e++)this.coefficients.push(new at)}function nc(e,t){BA.call(this,void 0,t),this.sh=void 0!==e?e:new tc}function ic(e,t,n){nc.call(this,void 0,n);var i=(new Fn).set(e),r=(new Fn).set(t),a=new at(i.r,i.g,i.b),o=new at(r.r,r.g,r.b),s=Math.sqrt(Math.PI),l=s*Math.sqrt(.75);this.sh.coefficients[0].copy(a).add(o).multiplyScalar(s),this.sh.coefficients[1].copy(a).sub(o).multiplyScalar(l)}function rc(e,t){nc.call(this,void 0,t);var n=(new Fn).set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}ec.prototype=Object.assign(Object.create(Wl.prototype),{constructor:ec,load:function(e,t,n,i){var r=new Kl(this.manager);r.setResponseType("arraybuffer"),r.setPath(this.path),r.load(e,(function(e){var n=e.slice(0);$A.getContext().decodeAudioData(n,(function(e){t(e)}))}),n,i)}}),Object.assign(tc.prototype,{isSphericalHarmonics3:!0,set:function(e){for(var t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this},zero:function(){for(var e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this},getAt:function(e,t){var n=e.x,i=e.y,r=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScale(a[1],.488603*i),t.addScale(a[2],.488603*r),t.addScale(a[3],.488603*n),t.addScale(a[4],n*i*1.092548),t.addScale(a[5],i*r*1.092548),t.addScale(a[6],.315392*(3*r*r-1)),t.addScale(a[7],n*r*1.092548),t.addScale(a[8],.546274*(n*n-i*i)),t},getIrradianceAt:function(e,t){var n=e.x,i=e.y,r=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScale(a[1],1.023328*i),t.addScale(a[2],1.023328*r),t.addScale(a[3],1.023328*n),t.addScale(a[4],.858086*n*i),t.addScale(a[5],.858086*i*r),t.addScale(a[6],.743125*r*r-.247708),t.addScale(a[7],.858086*n*r),t.addScale(a[8],.429043*(n*n-i*i)),t},add:function(e){for(var t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this},scale:function(e){for(var t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this},lerp:function(e,t){for(var n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this},equals:function(e){for(var t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0},copy:function(e){return this.set(e.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(e,t){void 0===t&&(t=0);for(var n=this.coefficients,i=0;i<9;i++)n[i].fromArray(e,t+3*i);return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);for(var n=this.coefficients,i=0;i<9;i++)n[i].toArray(e,t+3*i);return e}}),Object.assign(tc,{getBasisAt:function(e,t){var n=e.x,i=e.y,r=e.z;t[0]=.282095,t[1]=.488603*i,t[2]=.488603*r,t[3]=.488603*n,t[4]=1.092548*n*i,t[5]=1.092548*i*r,t[6]=.315392*(3*r*r-1),t[7]=1.092548*n*r,t[8]=.546274*(n*n-i*i)}}),nc.prototype=Object.assign(Object.create(BA.prototype),{constructor:nc,isLightProbe:!0,copy:function(e){return BA.prototype.copy.call(this,e),this.sh.copy(e.sh),this.intensity=e.intensity,this},toJSON:function(e){return BA.prototype.toJSON.call(this,e)}}),ic.prototype=Object.assign(Object.create(nc.prototype),{constructor:ic,isHemisphereLightProbe:!0,copy:function(e){return nc.prototype.copy.call(this,e),this},toJSON:function(e){return nc.prototype.toJSON.call(this,e)}}),rc.prototype=Object.assign(Object.create(nc.prototype),{constructor:rc,isAmbientLightProbe:!0,copy:function(e){return nc.prototype.copy.call(this,e),this},toJSON:function(e){return nc.prototype.toJSON.call(this,e)}});var ac=new bt,oc=new bt;function sc(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Ni,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Ni,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}function lc(e){this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}Object.assign(sc.prototype,{update:function(e){var t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep;var n,i,r=e.projectionMatrix.clone(),a=t.eyeSep/2,o=a*t.near/t.focus,s=t.near*Math.tan(et.DEG2RAD*t.fov*.5)/t.zoom;oc.elements[12]=-a,ac.elements[12]=a,n=-s*t.aspect+o,i=s*t.aspect+o,r.elements[0]=2*t.near/(i-n),r.elements[8]=(i+n)/(i-n),this.cameraL.projectionMatrix.copy(r),n=-s*t.aspect-o,i=s*t.aspect-o,r.elements[0]=2*t.near/(i-n),r.elements[8]=(i+n)/(i-n),this.cameraR.projectionMatrix.copy(r)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(oc),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(ac)}}),Object.assign(lc.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var t=("undefined"==typeof performance?Date:performance).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}});var Ac=new at,cc=new nt,hc=new at,uc=new at;function dc(){zt.call(this),this.type="AudioListener",this.context=$A.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new lc}function fc(e){zt.call(this),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this._startedAt=0,this._pausedAt=0,this.filters=[]}dc.prototype=Object.assign(Object.create(zt.prototype),{constructor:dc,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(e){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this},updateMatrixWorld:function(e){zt.prototype.updateMatrixWorld.call(this,e);var t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Ac,cc,hc),uc.set(0,0,-1).applyQuaternion(cc),t.positionX){var i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Ac.x,i),t.positionY.linearRampToValueAtTime(Ac.y,i),t.positionZ.linearRampToValueAtTime(Ac.z,i),t.forwardX.linearRampToValueAtTime(uc.x,i),t.forwardY.linearRampToValueAtTime(uc.y,i),t.forwardZ.linearRampToValueAtTime(uc.z,i),t.upX.linearRampToValueAtTime(n.x,i),t.upY.linearRampToValueAtTime(n.y,i),t.upZ.linearRampToValueAtTime(n.z,i)}else t.setPosition(Ac.x,Ac.y,Ac.z),t.setOrientation(uc.x,uc.y,uc.z,n.x,n.y,n.z)}}),fc.prototype=Object.assign(Object.create(zt.prototype),{constructor:fc,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setMediaElementSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this},setMediaStreamSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(e){if(void 0===e&&(e=0),!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){this._startedAt=this.context.currentTime+e;var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._pausedAt+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("Audio: this Audio has no playback control.")}else console.warn("Audio: Audio is already playing.")},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._pausedAt=(this.context.currentTime-this._startedAt)*this.playbackRate,this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this._pausedAt=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(e){return e||(e=[]),!0===this.isPlaying?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},setDetune:function(e){if(this.detune=e,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){if(!1!==this.hasPlaybackControl)return this.playbackRate=e,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(e){if(!1!==this.hasPlaybackControl)return this.loop=e,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("Audio: this Audio has no playback control.")},setLoopStart:function(e){return this.loopStart=e,this},setLoopEnd:function(e){return this.loopEnd=e,this},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}});var pc=new at,mc=new nt,vc=new at,gc=new at;function yc(e){fc.call(this,e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function wc(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=void 0!==t?t:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function xc(e,t,n){this.binding=e,this.valueSize=n;var i,r=Float64Array;switch(t){case"quaternion":i=this._slerp;break;case"string":case"bool":r=Array,i=this._select;break;default:i=this._lerp}this.buffer=new r(4*n),this._mixBufferRegion=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}yc.prototype=Object.assign(Object.create(fc.prototype),{constructor:yc,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){return this.panner.refDistance=e,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){return this.panner.rolloffFactor=e,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){return this.panner.distanceModel=e,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){return this.panner.maxDistance=e,this},setDirectionalCone:function(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(e){if(zt.prototype.updateMatrixWorld.call(this,e),!0!==this.hasPlaybackControl||!1!==this.isPlaying){this.matrixWorld.decompose(pc,mc,vc),gc.set(0,0,1).applyQuaternion(mc);var t=this.panner;if(t.positionX){var n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(pc.x,n),t.positionY.linearRampToValueAtTime(pc.y,n),t.positionZ.linearRampToValueAtTime(pc.z,n),t.orientationX.linearRampToValueAtTime(gc.x,n),t.orientationY.linearRampToValueAtTime(gc.y,n),t.orientationZ.linearRampToValueAtTime(gc.z,n)}else t.setPosition(pc.x,pc.y,pc.z),t.setOrientation(gc.x,gc.y,gc.z)}}}),Object.assign(wc.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),n=0;n<t.length;n++)e+=t[n];return e/t.length}}),Object.assign(xc.prototype,{accumulate:function(e,t){var n=this.buffer,i=this.valueSize,r=e*i+i,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==i;++o)n[r+o]=n[o];a=t}else{var s=t/(a+=t);this._mixBufferRegion(n,r,0,s,i)}this.cumulativeWeight=a},apply:function(e){var t=this.valueSize,n=this.buffer,i=e*t+t,r=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,r<1){var o=3*t;this._mixBufferRegion(n,i,o,1-r,t)}for(var s=t,l=t+t;s!==l;++s)if(n[s]!==n[s+t]){a.setValue(n,i);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,i=3*n;e.getValue(t,i);for(var r=n,a=i;r!==a;++r)t[r]=t[i+r%n];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,n,i,r){if(i>=.5)for(var a=0;a!==r;++a)e[t+a]=e[n+a]},_slerp:function(e,t,n,i){nt.slerpFlat(e,t,e,t,e,n,i)},_lerp:function(e,t,n,i,r){for(var a=1-i,o=0;o!==r;++o){var s=t+o;e[s]=e[s]*a+e[n+o]*i}}});var bc="\\[\\]\\.:\\/",Mc=new RegExp("[\\[\\]\\.:\\/]","g"),Cc="[^\\[\\]\\.:\\/]",Bc="[^"+bc.replace("\\.","")+"]",Ec=/((?:WC+[\/:])*)/.source.replace("WC",Cc),Sc=/(WCOD+)?/.source.replace("WCOD",Bc),Tc=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Cc),_c=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Cc),Ic=new RegExp("^"+Ec+Sc+Tc+_c+"$"),Lc=["material","materials","bones"];function Fc(e,t,n){var i=n||kc.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}function kc(e,t,n){this.path=t,this.parsedPath=n||kc.parseTrackName(t),this.node=kc.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function Pc(){this.uuid=et.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,n=arguments.length;t!==n;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}function Uc(e,t,n){this._mixer=e,this._clip=t,this._localRoot=n||null;for(var i=t.tracks,r=i.length,a=new Array(r),o={endingStart:Ue,endingEnd:Ue},s=0;s!==r;++s){var l=i[s].createInterpolant(null);a[s]=l,l.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Le,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}function Dc(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Rc(e){"string"==typeof e&&(console.warn("Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}function Oc(e,t,n){no.call(this,e,t),this.meshPerAttribute=n||1}function Nc(e,t,n,i){this.ray=new dn(e,t),this.near=n||0,this.far=i||1/0,this.camera=null,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function zc(e,t){return e.distance-t.distance}function Qc(e,t,n,i){if(!1!==e.visible&&!e.locked&&(e.raycast(t,n),!0===i))for(var r=e.children,a=0,o=r.length;a<o;a++)Qc(r[a],t,n,!0)}function Gc(e,t,n){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==n?n:0,this}function Hc(e,t,n){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==n?n:0,this}Object.assign(Fc.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(e,t)},setValue:function(e,t){for(var n=this._bindings,i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(kc,{Composite:Fc,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new kc.Composite(e,t,n):new kc(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(Mc,"")},parseTrackName:function(e){var t=Ic.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){var r=n.nodeName.substring(i+1);-1!==Lc.indexOf(r)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=r)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n},findNode:function(e,t){if(!t||""===t||"root"===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){var i=function e(n){for(var i=0;i<n.length;i++){var r=n[i];if(r.name===t||r.uuid===t)return r;var a=e(r.children);if(a)return a}return null}(e.children);if(i)return i}return null}}),Object.assign(kc.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)e[t++]=n[i]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.targetObject[this.propertyName]=e[t]},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=e[t++]},function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,n=t.objectName,i=t.propertyName,r=t.propertyIndex;if(e||(e=kc.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,e){if(n){var a=t.objectIndex;switch(n){case"materials":if(!e.material)return void console.error("PropertyBinding: Can not bind to material as node does not have a material.",this);if(!e.material.materials)return void console.error("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);e=e.skeleton.bones;for(var o=0;o<e.length;o++)if(e[o].name===a){a=o;break}break;default:if(void 0===e[n])return void console.error("PropertyBinding: Can not bind to objectName of node undefined.",this);e=e[n]}if(void 0!==a){if(void 0===e[a])return void console.error("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);e=e[a]}}var s=e[i];if(void 0!==s){var l=this.Versioning.None;this.targetObject=e,void 0!==e.needsUpdate?l=this.Versioning.NeedsUpdate:void 0!==e.matrixWorldNeedsUpdate&&(l=this.Versioning.MatrixWorldNeedsUpdate);var A=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){if(!e.geometry)return void console.error("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(e.geometry.isBufferGeometry){if(!e.geometry.morphAttributes)return void console.error("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(o=0;o<this.node.geometry.morphAttributes.position.length;o++)if(e.geometry.morphAttributes.position[o].name===r){r=o;break}}else{if(!e.geometry.morphTargets)return void console.error("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(o=0;o<this.node.geometry.morphTargets.length;o++)if(e.geometry.morphTargets[o].name===r){r=o;break}}}A=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(A=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(A=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=i;this.getValue=this.GetterByBindingType[A],this.setValue=this.SetterByBindingTypeAndVersioning[A][l]}else{var c=t.nodeName;console.error("PropertyBinding: Trying to update property for track: "+c+"."+i+" but it wasn't found.",e)}}else console.error("PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),//!\ DECLARE ALIAS AFTER assign prototype !
|
|
|
Object.assign(kc.prototype,{_getValue_unbound:kc.prototype.getValue,_setValue_unbound:kc.prototype.setValue}),Object.assign(Pc.prototype,{isAnimationObjectGroup:!0,add:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._paths,a=this._parsedPaths,o=this._bindings,s=o.length,l=void 0,A=0,c=arguments.length;A!==c;++A){var h=arguments[A],u=h.uuid,d=i[u];if(void 0===d){d=t++,i[u]=d,e.push(h);for(var f=0,p=s;f!==p;++f)o[f].push(new kc(h,r[f],a[f]))}else if(d<n){l=e[d];var m=--n,v=e[m];i[v.uuid]=d,e[d]=v,i[u]=m,e[m]=h;for(f=0,p=s;f!==p;++f){var g=o[f],y=g[m],w=g[d];g[d]=y,void 0===w&&(w=new kc(h,r[f],a[f])),g[m]=w}}else e[d]!==l&&console.error("AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var e=this._objects,t=this.nCachedObjects_,n=this._indicesByUUID,i=this._bindings,r=i.length,a=0,o=arguments.length;a!==o;++a){var s=arguments[a],l=s.uuid,A=n[l];if(void 0!==A&&A>=t){var c=t++,h=e[c];n[h.uuid]=A,e[A]=h,n[l]=c,e[c]=s;for(var u=0,d=r;u!==d;++u){var f=i[u],p=f[c],m=f[A];f[A]=p,f[c]=m}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._bindings,a=r.length,o=0,s=arguments.length;o!==s;++o){var l=arguments[o],A=l.uuid,c=i[A];if(void 0!==c)if(delete i[A],c<n){var h=--n,u=e[h],d=e[g=--t];i[u.uuid]=c,e[c]=u,i[d.uuid]=h,e[h]=d,e.pop();for(var f=0,p=a;f!==p;++f){var m=(y=r[f])[h],v=y[g];y[c]=m,y[h]=v,y.pop()}}else{var g;i[(d=e[g=--t]).uuid]=c,e[c]=d,e.pop();for(f=0,p=a;f!==p;++f){var y;(y=r[f])[c]=y[g],y.pop()}}}this.nCachedObjects_=n},subscribe_:function(e,t){var n=this._bindingsIndicesByPath,i=n[e],r=this._bindings;if(void 0!==i)return r[i];var a=this._paths,o=this._parsedPaths,s=this._objects,l=s.length,A=this.nCachedObjects_,c=new Array(l);i=r.length,n[e]=i,a.push(e),o.push(t),r.push(c);for(var h=A,u=s.length;h!==u;++h){var d=s[h];c[h]=new kc(d,e,t)}return c},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){var i=this._paths,r=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];t[e[o]]=n,a[n]=s,a.pop(),r[n]=r[o],r.pop(),i[n]=i[o],i.pop()}}}),Object.assign(Uc.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){var i=this._clip.duration,r=e._clip.duration,a=r/i,o=i/r;e.warp(1,a,t),this.warp(o,1,t)}return this},crossFadeTo:function(e,t,n){return e.crossFadeFrom(this,t,n)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._effectiveTimeScale,0,e)},warp:function(e,t,n){var i=this._mixer,r=i.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,l=a.sampleValues;return s[0]=r,s[1]=r+n,l[0]=e/o,l[1]=t/o,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,n,i){if(this.enabled){var r=this._startTime;if(null!==r){var a=(e-r)*n;if(a<0||0===n)return;this._startTime=null,t=n*a}t*=this._updateTimeScale(e);var o=this._updateTime(t),s=this._updateWeight(e);if(s>0)for(var l=this._interpolants,A=this._propertyBindings,c=0,h=l.length;c!==h;++c)l[c].evaluate(o),A[c].accumulate(i,s)}else this._updateWeight(e)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var n=this._weightInterpolant;if(null!==n){var i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n)t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e,n=this._clip.duration,i=this.loop,r=this._loopCount,a=2202===i;if(0===e)return-1===r?t:a&&1==(1&r)?n-t:t;if(i===Ie){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(t>=n)t=n;else{if(!(t<0)){this.time=t;break e}t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===r&&(e>=0?(r=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),t>=n||t<0){var o=Math.floor(t/n);t-=n*o,r+=Math.abs(o);var s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=e>0?n:0,this.time=t,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var l=e<0;this._setEndings(l,!l,a)}else this._setEndings(!1,!1,a);this._loopCount=r,this.time=t,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=t;if(a&&1==(1&r))return n-t}return t},_setEndings:function(e,t,n){var i=this._interpolantSettings;n?(i.endingStart=De,i.endingEnd=De):(i.endingStart=e?this.zeroSlopeAtStart?De:Ue:Re,i.endingEnd=t?this.zeroSlopeAtEnd?De:Ue:Re)},_scheduleFading:function(e,t,n){var i=this._mixer,r=i.time,a=this._weightInterpolant;null===a&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=r,s[0]=t,o[1]=r+e,s[1]=n,this}}),Dc.prototype=Object.assign(Object.create(Je.prototype),{constructor:Dc,_bindAction:function(e,t){var n=e._localRoot||this._root,i=e._clip.tracks,r=i.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,l=this._bindingsByRootAndName,A=l[s];void 0===A&&(A={},l[s]=A);for(var c=0;c!==r;++c){var h=i[c],u=h.name,d=A[u];if(void 0!==d)a[c]=d;else{if(void 0!==(d=a[c])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,u));continue}var f=t&&t._propertyBindings[c].binding.parsedPath;++(d=new xc(kc.create(n,u,f),h.ValueTypeName,h.getValueSize())).referenceCount,this._addInactiveBinding(d,s,u),a[c]=d}o[c].resultBuffer=d.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,n=e._clip.uuid,i=this._actionsByClip[n];this._bindAction(e,i&&i.knownActions[0]),this._addInactiveAction(e,n,t)}for(var r=e._propertyBindings,a=0,o=r.length;a!==o;++a){var s=r[a];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,n=0,i=t.length;n!==i;++n){var r=t[n];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,n){var i=this._actions,r=this._actionsByClip,a=r[t];if(void 0===a)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,r[t]=a;else{var o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=i.length,i.push(e),a.actionByRoot[n]=e},_removeInactiveAction:function(e){var t=this._actions,n=t[t.length-1],i=e._cacheIndex;n._cacheIndex=i,t[i]=n,t.pop(),e._cacheIndex=null;var r=e._clip.uuid,a=this._actionsByClip,o=a[r],s=o.knownActions,l=s[s.length-1],A=e._byClipCacheIndex;l._byClipCacheIndex=A,s[A]=l,s.pop(),e._byClipCacheIndex=null,delete o.actionByRoot[(e._localRoot||this._root).uuid],0===s.length&&delete a[r],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,n=0,i=t.length;n!==i;++n){var r=t[n];0==--r.referenceCount&&this._removeInactiveBinding(r)}},_lendAction:function(e){var t=this._actions,n=e._cacheIndex,i=this._nActiveActions++,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_takeBackAction:function(e){var t=this._actions,n=e._cacheIndex,i=--this._nActiveActions,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_addInactiveBinding:function(e,t,n){var i=this._bindingsByRootAndName,r=i[t],a=this._bindings;void 0===r&&(r={},i[t]=r),r[n]=e,e._cacheIndex=a.length,a.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,n=e.binding,i=n.rootNode.uuid,r=n.path,a=this._bindingsByRootAndName,o=a[i],s=t[t.length-1],l=e._cacheIndex;s._cacheIndex=l,t[l]=s,t.pop(),delete o[r],0===Object.keys(o).length&&delete a[i]},_lendBinding:function(e){var t=this._bindings,n=e._cacheIndex,i=this._nActiveBindings++,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_takeBackBinding:function(e){var t=this._bindings,n=e._cacheIndex,i=--this._nActiveBindings,r=t[i];e._cacheIndex=i,t[i]=e,r._cacheIndex=n,t[n]=r},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,n=e[t];return void 0===n&&((n=new Fl(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=t,e[t]=n),n},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,n=e.__cacheIndex,i=--this._nActiveControlInterpolants,r=t[i];e.__cacheIndex=i,t[i]=e,r.__cacheIndex=n,t[n]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(e,t){var n=t||this._root,i=n.uuid,r="string"==typeof e?Gl.findByName(n,e):e,a=null!==r?r.uuid:e,o=this._actionsByClip[a],s=null;if(void 0!==o){var l=o.actionByRoot[i];if(void 0!==l)return l;s=o.knownActions[0],null===r&&(r=s._clip)}if(null===r)return null;var A=new Uc(this,r,t);return this._bindAction(A,s),this._addInactiveAction(A,a,i),A},existingAction:function(e,t){var n=t||this._root,i=n.uuid,r="string"==typeof e?Gl.findByName(n,e):e,a=r?r.uuid:e,o=this._actionsByClip[a];return void 0!==o&&o.actionByRoot[i]||null},stopAllAction:function(){var e=this._actions,t=this._nActiveActions,n=this._bindings,i=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var r=0;r!==t;++r)e[r].reset();for(r=0;r!==i;++r)n[r].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,n=this._nActiveActions,i=this.time+=e,r=Math.sign(e),a=this._accuIndex^=1,o=0;o!==n;++o){t[o]._update(i,e,r,a)}var s=this._bindings,l=this._nActiveBindings;for(o=0;o!==l;++o)s[o].apply(a);return this},setTime:function(e){this.time=0;for(var t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,n=e.uuid,i=this._actionsByClip,r=i[n];if(void 0!==r){for(var a=r.knownActions,o=0,s=a.length;o!==s;++o){var l=a[o];this._deactivateAction(l);var A=l._cacheIndex,c=t[t.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,c._cacheIndex=A,t[A]=c,t.pop(),this._removeInactiveBindingsForAction(l)}delete i[n]}},uncacheRoot:function(e){var t=e.uuid,n=this._actionsByClip;for(var i in n){var r=n[i].actionByRoot[t];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}var a=this._bindingsByRootAndName[t];if(void 0!==a)for(var o in a){var s=a[o];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(e,t){var n=this.existingAction(e,t);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),Rc.prototype.clone=function(){return new Rc(void 0===this.value.clone?this.value:this.value.clone())},Oc.prototype=Object.assign(Object.create(no.prototype),{constructor:Oc,isInstancedInterleavedBuffer:!0,copy:function(e){return no.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this}}),Object.assign(Nc.prototype,{linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("Raycaster: Unsupported camera type.")},intersectObject:function(e,t,n){var i=n||[];return Qc(e,this,i,t),i.sort(zc),i},intersectObjects:function(e,t,n){var i=n||[];if(!1===Array.isArray(e))return console.warn("Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,a=e.length;r<a;r++)Qc(e[r],this,i,t);return i.sort(zc),i}}),Object.assign(Gc.prototype,{set:function(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){var e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(et.clamp(t/this.radius,-1,1))),this}}),Object.assign(Hc.prototype,{set:function(e,t,n){return this.radius=e,this.theta=t,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.setFromCartesianCoords(e.x,e.y,e.z)},setFromCartesianCoords:function(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}});var Vc=new tt;function jc(e,t){this.min=void 0!==e?e:new tt(1/0,1/0),this.max=void 0!==t?t:new tt(-1/0,-1/0)}Object.assign(jc.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(e,t){var n=Vc.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(e){return void 0===e&&(e=new tt),this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){return void 0===e&&(e=new tt),this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return void 0===t&&(t=new tt),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)},clampPoint:function(e,t){return void 0===t&&(t=new tt),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(e){return Vc.copy(e).clamp(this.min,this.max).sub(e).length()},intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}});var Wc=new at,Xc=new at;function Yc(e,t){this.start=void 0!==e?e:new at,this.end=void 0!==t?t:new at}function Kc(e){zt.call(this),this.material=e,this.render=function(){}}Object.assign(Yc.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return void 0===e&&(console.warn("Line3: .getCenter() target is now required"),e=new at),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return void 0===e&&(console.warn("Line3: .delta() target is now required"),e=new at),e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){return void 0===t&&(console.warn("Line3: .at() target is now required"),t=new at),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(e,t){Wc.subVectors(e,this.start),Xc.subVectors(this.end,this.start);var n=Xc.dot(Xc),i=Xc.dot(Wc)/n;return t&&(i=et.clamp(i,0,1)),i},closestPointToPoint:function(e,t,n){var i=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("Line3: .closestPointToPoint() target is now required"),n=new at),this.delta(n).multiplyScalar(i).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),Kc.prototype=Object.create(zt.prototype),Kc.prototype.constructor=Kc,Kc.prototype.isImmediateRenderObject=!0;var Zc=new at,Jc=new at,qc=new lt,$c=["a","b","c"];function eh(e,t,n,i){this.object=e,this.size=void 0!==t?t:1;var r=void 0!==n?n:16711680,a=void 0!==i?i:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=3*s.faces.length:s&&s.isBufferGeometry&&(o=s.attributes.normal.count);var l=new si,A=new Yn(2*o*3,3);l.setAttribute("position",A),jo.call(this,l,new Do({color:r,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}eh.prototype=Object.create(jo.prototype),eh.prototype.constructor=eh,eh.prototype.update=function(){this.object.updateMatrixWorld(!0),qc.getNormalMatrix(this.object.matrixWorld);var e=this.object.matrixWorld,t=this.geometry.attributes.position,n=this.object.geometry;if(n&&n.isGeometry)for(var i=n.vertices,r=n.faces,a=0,o=0,s=r.length;o<s;o++)for(var l=r[o],A=0,c=l.vertexNormals.length;A<c;A++){var h=i[l[$c[A]]],u=l.vertexNormals[A];Zc.copy(h).applyMatrix4(e),Jc.copy(u).applyMatrix3(qc).normalize().multiplyScalar(this.size).add(Zc),t.setXYZ(a,Zc.x,Zc.y,Zc.z),a+=1,t.setXYZ(a,Jc.x,Jc.y,Jc.z),a+=1}else if(n&&n.isBufferGeometry){var d=n.attributes.position,f=n.attributes.normal;for(a=0,A=0,c=d.count;A<c;A++)Zc.set(d.getX(A),d.getY(A),d.getZ(A)).applyMatrix4(e),Jc.set(f.getX(A),f.getY(A),f.getZ(A)),Jc.applyMatrix3(qc).normalize().multiplyScalar(this.size).add(Zc),t.setXYZ(a,Zc.x,Zc.y,Zc.z),a+=1,t.setXYZ(a,Jc.x,Jc.y,Jc.z),a+=1}t.needsUpdate=!0};var th=new at;function nh(e,t){zt.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t;for(var n=new si,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],r=0,a=1;r<32;r++,a++){var o=r/32*Math.PI*2,s=a/32*Math.PI*2;i.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}n.setAttribute("position",new Yn(i,3));var l=new Do({fog:!1});this.cone=new jo(n,l),this.add(this.cone),this.update()}nh.prototype=Object.create(zt.prototype),nh.prototype.constructor=nh,nh.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},nh.prototype.update=function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),th.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(th),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};var ih=new at,rh=new bt,ah=new bt;function oh(e){var t=[];e&&e.isBone&&t.push(e);for(var n=0;n<e.children.length;n++)t.push.apply(t,oh(e.children[n]));return t}function sh(e){for(var t=oh(e),n=new si,i=[],r=[],a=new Fn(0,0,1),o=new Fn(0,1,0),s=0;s<t.length;s++){var l=t[s];l.parent&&l.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(a.r,a.g,a.b),r.push(o.r,o.g,o.b))}n.setAttribute("position",new Yn(i,3)),n.setAttribute("color",new Yn(r,3));var A=new Do({vertexColors:2,depthTest:!1,depthWrite:!1,transparent:!0});jo.call(this,n,A),this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}function lh(e,t,n){this.light=e,this.light.updateMatrixWorld(),this.color=n;var i=new el(t,4,2),r=new Nn({wireframe:!0,fog:!1});Ei.call(this,i,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function Ah(e,t){this.type="RectAreaLightHelper",this.light=e,this.color=t;var n=new si;n.setAttribute("position",new Yn([1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),n.computeBoundingSphere();var i=new Do({fog:!1});Go.call(this,n,i);var r=new si;r.setAttribute("position",new Yn([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),r.computeBoundingSphere(),this.add(new Ei(r,new Nn({side:1,fog:!1}))),this.update()}sh.prototype=Object.create(jo.prototype),sh.prototype.constructor=sh,sh.prototype.updateMatrixWorld=function(e){var t=this.bones,n=this.geometry,i=n.getAttribute("position");ah.getInverse(this.root.matrixWorld);for(var r=0,a=0;r<t.length;r++){var o=t[r];o.parent&&o.parent.isBone&&(rh.multiplyMatrices(ah,o.matrixWorld),ih.setFromMatrixPosition(rh),i.setXYZ(a,ih.x,ih.y,ih.z),rh.multiplyMatrices(ah,o.parent.matrixWorld),ih.setFromMatrixPosition(rh),i.setXYZ(a+1,ih.x,ih.y,ih.z),a+=2)}n.getAttribute("position").needsUpdate=!0,zt.prototype.updateMatrixWorld.call(this,e)},lh.prototype=Object.create(Ei.prototype),lh.prototype.constructor=lh,lh.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},lh.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},Ah.prototype=Object.create(Go.prototype),Ah.prototype.constructor=Ah,Ah.prototype.update=function(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);var e=this.material.color,t=Math.max(e.r,e.g,e.b);t>1&&e.multiplyScalar(1/t),this.children[0].material.color.copy(this.material.color)}},Ah.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()};var ch=new at,hh=new Fn,uh=new Fn;function dh(e,t,n){zt.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;var i=new hs(t);i.rotateY(.5*Math.PI),this.material=new Nn({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=2);var r=i.getAttribute("position"),a=new Float32Array(3*r.count);i.setAttribute("color",new zn(a,3)),this.add(new Ei(i,this.material)),this.update()}function fh(e,t){this.lightProbe=e,this.size=t;var n={GAMMA_OUTPUT:""},i=new Ri({defines:n,uniforms:{sh:{value:this.lightProbe.sh.coefficients},intensity:{value:this.lightProbe.intensity}},vertexShader:["varying vec3 vNormal;","void main() {","\tvNormal = normalize( normalMatrix * normal );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define RECIPROCAL_PI 0.318309886","vec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {","\t// matrix is assumed to be orthogonal","\treturn normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );","}","vec3 linearToOutput( in vec3 a ) {","\t#ifdef GAMMA_OUTPUT","\t\treturn pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );","\t#else","\t\treturn a;","\t#endif","}","// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf","vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {","\t// normal is assumed to have unit length","\tfloat x = normal.x, y = normal.y, z = normal.z;","\t// band 0","\tvec3 result = shCoefficients[ 0 ] * 0.886227;","\t// band 1","\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;","\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;","\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;","\t// band 2","\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;","\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;","\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );","\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;","\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );","\treturn result;","}","uniform vec3 sh[ 9 ]; // sh coefficients","uniform float intensity; // light probe intensity","varying vec3 vNormal;","void main() {","\tvec3 normal = normalize( vNormal );","\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );","\tvec3 irradiance = shGetIrradianceAt( worldNormal, sh );","\tvec3 outgoingLight = RECIPROCAL_PI * irradiance * intensity;","\toutgoingLight = linearToOutput( outgoingLight );","\tgl_FragColor = vec4( outgoingLight, 1.0 );","}"].join("\n")}),r=new el(1,32,16);Ei.call(this,r,i),this.onBeforeRender()}function ph(e,t,n,i){e=e||10,t=t||10,n=new Fn(void 0!==n?n:4473924),i=new Fn(void 0!==i?i:8947848);for(var r=t/2,a=e/t,o=e/2,s=[],l=[],A=0,c=0,h=-o;A<=t;A++,h+=a){s.push(-o,0,h,o,0,h),s.push(h,0,-o,h,0,o);var u=A===r?n:i;u.toArray(l,c),c+=3,u.toArray(l,c),c+=3,u.toArray(l,c),c+=3,u.toArray(l,c),c+=3}var d=new si;d.setAttribute("position",new Yn(s,3)),d.setAttribute("color",new Yn(l,3));var f=new Do({vertexColors:2});jo.call(this,d,f)}function mh(e,t,n,i,r,a){e=e||10,t=t||16,n=n||8,i=i||64,r=new Fn(void 0!==r?r:4473924),a=new Fn(void 0!==a?a:8947848);var o,s,l,A,c,h,u,d=[],f=[];for(A=0;A<=t;A++)l=A/t*(2*Math.PI),o=Math.sin(l)*e,s=Math.cos(l)*e,d.push(0,0,0),d.push(o,0,s),u=1&A?r:a,f.push(u.r,u.g,u.b),f.push(u.r,u.g,u.b);for(A=0;A<=n;A++)for(u=1&A?r:a,h=e-e/n*A,c=0;c<i;c++)l=c/i*(2*Math.PI),o=Math.sin(l)*h,s=Math.cos(l)*h,d.push(o,0,s),f.push(u.r,u.g,u.b),l=(c+1)/i*(2*Math.PI),o=Math.sin(l)*h,s=Math.cos(l)*h,d.push(o,0,s),f.push(u.r,u.g,u.b);var p=new si;p.setAttribute("position",new Yn(d,3)),p.setAttribute("color",new Yn(f,3));var m=new Do({vertexColors:2});jo.call(this,p,m)}function vh(e,t,n,i){this.audio=e,this.range=t||1,this.divisionsInnerAngle=n||16,this.divisionsOuterAngle=i||2;var r=new si,a=this.divisionsInnerAngle+2*this.divisionsOuterAngle,o=new Float32Array(3*(3*a+3));r.setAttribute("position",new zn(o,3));var s=new Do({color:65280}),l=new Do({color:16776960});Go.call(this,r,[l,s]),this.update()}dh.prototype=Object.create(zt.prototype),dh.prototype.constructor=dh,dh.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},dh.prototype.update=function(){var e=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var t=e.geometry.getAttribute("color");hh.copy(this.light.color),uh.copy(this.light.groundColor);for(var n=0,i=t.count;n<i;n++){var r=n<i/2?hh:uh;t.setXYZ(n,r.r,r.g,r.b)}t.needsUpdate=!0}e.lookAt(ch.setFromMatrixPosition(this.light.matrixWorld).negate())},fh.prototype=Object.create(Ei.prototype),fh.prototype.constructor=fh,fh.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},fh.prototype.onBeforeRender=function(){this.position.copy(this.lightProbe.position),this.scale.set(1,1,1).multiplyScalar(this.size),this.material.uniforms.intensity.value=this.lightProbe.intensity},ph.prototype=Object.assign(Object.create(jo.prototype),{constructor:ph,copy:function(e){return jo.prototype.copy.call(this,e),this.geometry.copy(e.geometry),this.material.copy(e.material),this},clone:function(){return(new this.constructor).copy(this)}}),mh.prototype=Object.create(jo.prototype),mh.prototype.constructor=mh,vh.prototype=Object.create(Go.prototype),vh.prototype.constructor=vh,vh.prototype.update=function(){var e,t,n=this.audio,i=this.range,r=this.divisionsInnerAngle,a=this.divisionsOuterAngle,o=et.degToRad(n.panner.coneInnerAngle),s=et.degToRad(n.panner.coneOuterAngle),l=o/2,A=s/2,c=0,h=0,u=this.geometry,d=u.attributes.position;function f(n,r,a,o){var s=(r-n)/a;for(d.setXYZ(c,0,0,0),h++,e=n;e<r;e+=s)t=c+h,d.setXYZ(t,Math.sin(e)*i,0,Math.cos(e)*i),d.setXYZ(t+1,Math.sin(Math.min(e+s,r))*i,0,Math.cos(Math.min(e+s,r))*i),d.setXYZ(t+2,0,0,0),h+=3;u.addGroup(c,h,o),c+=h,h=0}u.clearGroups(),f(-A,-l,a,0),f(-l,l,r,1),f(l,A,a,0),d.needsUpdate=!0,o===s&&(this.material[0].visible=!1)},vh.prototype.dispose=function(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()};var gh=new at,yh=new at,wh=new lt;function xh(e,t,n,i){this.object=e,this.size=void 0!==t?t:1;var r=void 0!==n?n:16776960,a=void 0!==i?i:1,o=0,s=this.object.geometry;s&&s.isGeometry?o=s.faces.length:console.warn("FaceNormalsHelper: only Geometry is supported. Use VertexNormalsHelper, instead.");var l=new si,A=new Yn(2*o*3,3);l.setAttribute("position",A),jo.call(this,l,new Do({color:r,linewidth:a})),this.matrixAutoUpdate=!1,this.update()}xh.prototype=Object.create(jo.prototype),xh.prototype.constructor=xh,xh.prototype.update=function(){this.object.updateMatrixWorld(!0),wh.getNormalMatrix(this.object.matrixWorld);for(var e=this.object.matrixWorld,t=this.geometry.attributes.position,n=this.object.geometry,i=n.vertices,r=n.faces,a=0,o=0,s=r.length;o<s;o++){var l=r[o],A=l.normal;gh.copy(i[l.a]).add(i[l.b]).add(i[l.c]).divideScalar(3).applyMatrix4(e),yh.copy(A).applyMatrix3(wh).normalize().multiplyScalar(this.size).add(gh),t.setXYZ(a,gh.x,gh.y,gh.z),a+=1,t.setXYZ(a,yh.x,yh.y,yh.z),a+=1}t.needsUpdate=!0};var bh=new at,Mh=new at,Ch=new at;function Bh(e,t,n){zt.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===t&&(t=1);var i=new si;i.setAttribute("position",new Yn([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var r=new Do({fog:!1});this.lightPlane=new Go(i,r),this.add(this.lightPlane),(i=new si).setAttribute("position",new Yn([0,0,0,0,0,1],3)),this.targetLine=new Go(i,r),this.add(this.targetLine),this.update()}Bh.prototype=Object.create(zt.prototype),Bh.prototype.constructor=Bh,Bh.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},Bh.prototype.update=function(){bh.setFromMatrixPosition(this.light.matrixWorld),Mh.setFromMatrixPosition(this.light.target.matrixWorld),Ch.subVectors(Mh,bh),this.lightPlane.lookAt(Mh),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Mh),this.targetLine.scale.z=Ch.length()};var Eh=new at,Sh=new Oi;function Th(e){var t=new si,n=new Do({color:16777215,vertexColors:1}),i=[],r=[],a={},o=new Fn(16755200),s=new Fn(16711680),l=new Fn(43775),A=new Fn(16777215),c=new Fn(3355443);function h(e,t,n){u(e,n),u(t,n)}function u(e,t){i.push(0,0,0),r.push(t.r,t.g,t.b),void 0===a[e]&&(a[e]=[]),a[e].push(i.length/3-1)}h("n1","n2",o),h("n2","n4",o),h("n4","n3",o),h("n3","n1",o),h("f1","f2",o),h("f2","f4",o),h("f4","f3",o),h("f3","f1",o),h("n1","f1",o),h("n2","f2",o),h("n3","f3",o),h("n4","f4",o),h("p","n1",s),h("p","n2",s),h("p","n3",s),h("p","n4",s),h("u1","u2",l),h("u2","u3",l),h("u3","u1",l),h("c","t",A),h("p","c",c),h("cn1","cn2",c),h("cn3","cn4",c),h("cf1","cf2",c),h("cf3","cf4",c),t.setAttribute("position",new Yn(i,3)),t.setAttribute("color",new Yn(r,3)),jo.call(this,t,n),this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()}function _h(e,t,n,i,r,a,o){Eh.set(r,a,o).unproject(i);var s=t[e];if(void 0!==s)for(var l=n.getAttribute("position"),A=0,c=s.length;A<c;A++)l.setXYZ(s[A],Eh.x,Eh.y,Eh.z)}Th.prototype=Object.create(jo.prototype),Th.prototype.constructor=Th,Th.prototype.update=function(){var e=this.geometry,t=this.pointMap;Sh.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),_h("c",t,e,Sh,0,0,-1),_h("t",t,e,Sh,0,0,1),_h("n1",t,e,Sh,-1,-1,-1),_h("n2",t,e,Sh,1,-1,-1),_h("n3",t,e,Sh,-1,1,-1),_h("n4",t,e,Sh,1,1,-1),_h("f1",t,e,Sh,-1,-1,1),_h("f2",t,e,Sh,1,-1,1),_h("f3",t,e,Sh,-1,1,1),_h("f4",t,e,Sh,1,1,1),_h("u1",t,e,Sh,.7,1.1,-1),_h("u2",t,e,Sh,-.7,1.1,-1),_h("u3",t,e,Sh,0,2,-1),_h("cf1",t,e,Sh,-1,0,1),_h("cf2",t,e,Sh,1,0,1),_h("cf3",t,e,Sh,0,-1,1),_h("cf4",t,e,Sh,0,1,1),_h("cn1",t,e,Sh,-1,0,-1),_h("cn2",t,e,Sh,1,0,-1),_h("cn3",t,e,Sh,0,-1,-1),_h("cn4",t,e,Sh,0,1,-1),e.getAttribute("position").needsUpdate=!0};var Ih=new tn;function Lh(e,t){this.object=e,void 0===t&&(t=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),r=new si;r.setIndex(new zn(n,1)),r.setAttribute("position",new zn(i,3)),jo.call(this,r,new Do({color:t})),this.matrixAutoUpdate=!1,this.update()}function Fh(e,t){this.type="Box3Helper",this.box=e,t=t||16776960;var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new si;i.setIndex(new zn(n,1)),i.setAttribute("position",new Yn([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),jo.call(this,i,new Do({color:t})),this.geometry.computeBoundingSphere()}function kh(e,t,n){this.type="PlaneHelper",this.plane=e,this.size=void 0===t?1:t;var i=void 0!==n?n:16776960,r=new si;r.setAttribute("position",new Yn([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),r.computeBoundingSphere(),Go.call(this,r,new Do({color:i}));var a=new si;a.setAttribute("position",new Yn([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),a.computeBoundingSphere(),this.add(new Ei(a,new Nn({color:i,opacity:.2,transparent:!0,depthWrite:!1})))}Lh.prototype=Object.create(jo.prototype),Lh.prototype.constructor=Lh,Lh.prototype.update=function(e){if(void 0===e&&(void 0!==this.object&&Ih.setFromObject(this.object),!Ih.isEmpty())){var t=Ih.min,n=Ih.max,i=this.geometry.attributes.position,r=i.array;r[0]=n.x,r[1]=n.y,r[2]=n.z,r[3]=t.x,r[4]=n.y,r[5]=n.z,r[6]=t.x,r[7]=t.y,r[8]=n.z,r[9]=n.x,r[10]=t.y,r[11]=n.z,r[12]=n.x,r[13]=n.y,r[14]=t.z,r[15]=t.x,r[16]=n.y,r[17]=t.z,r[18]=t.x,r[19]=t.y,r[20]=t.z,r[21]=n.x,r[22]=t.y,r[23]=t.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}},Lh.prototype.setFromObject=function(e){return this.object=e,this.update(),this},Lh.prototype.copy=function(e){return jo.prototype.copy.call(this,e),this.object=e.object,this},Lh.prototype.clone=function(){return(new this.constructor).copy(this)},Fh.prototype=Object.create(jo.prototype),Fh.prototype.constructor=Fh,Fh.prototype.updateMatrixWorld=function(e){var t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),zt.prototype.updateMatrixWorld.call(this,e))},kh.prototype=Object.create(Go.prototype),kh.prototype.constructor=kh,kh.prototype.updateMatrixWorld=function(e){var t=-this.plane.constant;Math.abs(t)<1e-8&&(t=1e-8),this.scale.set(.5*this.size,.5*this.size,t),this.children[0].material.side=t<0?1:0,this.lookAt(this.plane.normal),zt.prototype.updateMatrixWorld.call(this,e)};var Ph,Uh,Dh=new at;function Rh(e,t,n,i,r,a){zt.call(this),void 0===e&&(e=new at(0,0,1)),void 0===t&&(t=new at(0,0,0)),void 0===n&&(n=1),void 0===i&&(i=16776960),void 0===r&&(r=.2*n),void 0===a&&(a=.2*r),void 0===Ph&&((Ph=new si).setAttribute("position",new Yn([0,0,0,0,1,0],3)),(Uh=new cl(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(t),this.line=new Go(Ph,new Do({color:i})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Ei(Uh,new Nn({color:i})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,r,a)}function Oh(e){var t=[0,0,0,e=e||1,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=new si;n.setAttribute("position",new Yn(t,3)),n.setAttribute("color",new Yn([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var i=new Do({vertexColors:2});jo.call(this,n,i)}Rh.prototype=Object.create(zt.prototype),Rh.prototype.constructor=Rh,Rh.prototype.setDirection=function(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{Dh.set(e.z,0,-e.x).normalize();var t=Math.acos(e.y);this.quaternion.setFromAxisAngle(Dh,t)}},Rh.prototype.setLength=function(e,t,n){void 0===t&&(t=.2*e),void 0===n&&(n=.2*t),this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},Rh.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},Rh.prototype.copy=function(e){return zt.prototype.copy.call(this,e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this},Rh.prototype.clone=function(){return(new this.constructor).copy(this)},Oh.prototype=Object.create(jo.prototype),Oh.prototype.constructor=Oh;var Nh=function(e){ql.call(this,e),this.type=$};Nh.prototype=Object.assign(Object.create(ql.prototype),{constructor:Nh,parse:function(e){var t=function(e,t){switch(e){case 1:console.error("RGBELoader Read Error: "+(t||""));break;case 2:console.error("RGBELoader Write Error: "+(t||""));break;case 3:console.error("RGBELoader Bad File Format: "+(t||""));break;default:console.error("RGBELoader: Error: "+(t||""))}return-1},n=function(e,t,n){t=t||1024;for(var i=e.pos,r=-1,a=0,o="",s=String.fromCharCode.apply(null,new Uint16Array(e.subarray(i,i+128)));0>(r=s.indexOf("\n"))&&a<t&&i<e.byteLength;)o+=s,a+=s.length,i+=128,s+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(i,i+128)));return-1<r&&(!1!==n&&(e.pos+=a+r+1),o+s.slice(0,r))},i=function(e,t,n,i){var r=e[t+3],a=Math.pow(2,r-128)/255;n[i+0]=e[t+0]*a,n[i+1]=e[t+1]*a,n[i+2]=e[t+2]*a},r=function(){var e=new Float32Array(1),t=new Int32Array(e.buffer);function n(n){e[0]=n;var i=t[0],r=i>>16&32768,a=i>>12&2047,o=i>>23&255;return o<103?r:o>142?(r|=31744,r|=(255==o?0:1)&&8388607&i):o<113?r|=((a|=2048)>>114-o)+(a>>113-o&1):(r|=o-112<<10|a>>1,r+=1&a)}return function(e,t,i,r){var a=e[t+3],o=Math.pow(2,a-128)/255;i[r+0]=n(e[t+0]*o),i[r+1]=n(e[t+1]*o),i[r+2]=n(e[t+2]*o)}}(),a=new Uint8Array(e);a.pos=0;var o=function(e){var i,r,a=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,o=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,s=/^\s*FORMAT=(\S+)\s*$/,l=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,A={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};if(e.pos>=e.byteLength||!(i=n(e)))return t(1,"no header found");if(!(r=i.match(/^#\?(\S+)$/)))return t(3,"bad initial token");for(A.valid|=1,A.programtype=r[1],A.string+=i+"\n";!1!==(i=n(e));)if(A.string+=i+"\n","#"!==i.charAt(0)){if((r=i.match(a))&&(A.gamma=parseFloat(r[1],10)),(r=i.match(o))&&(A.exposure=parseFloat(r[1],10)),(r=i.match(s))&&(A.valid|=2,A.format=r[1]),(r=i.match(l))&&(A.valid|=4,A.height=parseInt(r[1],10),A.width=parseInt(r[2],10)),2&A.valid&&4&A.valid)break}else A.comments+=i+"\n";return 2&A.valid?4&A.valid?A:t(3,"missing image size specifier"):t(3,"missing format specifier")}(a);if(-1!==o){var s=o.width,l=o.height,A=function(e,n,i){var r,a,o,s,l,A,c,h,u,d,f,p,m,v=n,g=i;if(v<8||v>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(v!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");if(!(r=new Uint8Array(4*n*i))||!r.length)return t(4,"unable to allocate buffer space");for(a=0,o=0,h=4*v,m=new Uint8Array(4),A=new Uint8Array(h);g>0&&o<e.byteLength;){if(o+4>e.byteLength)return t(1);if(m[0]=e[o++],m[1]=e[o++],m[2]=e[o++],m[3]=e[o++],2!=m[0]||2!=m[1]||(m[2]<<8|m[3])!=v)return t(3,"bad rgbe scanline format");for(c=0;c<h&&o<e.byteLength;){if((p=(s=e[o++])>128)&&(s-=128),0===s||c+s>h)return t(3,"bad scanline data");if(p)for(l=e[o++],u=0;u<s;u++)A[c++]=l;else A.set(e.subarray(o,o+s),c),c+=s,o+=s}for(d=v,u=0;u<d;u++)f=0,r[a]=A[u+f],f+=v,r[a+1]=A[u+f],f+=v,r[a+2]=A[u+f],f+=v,r[a+3]=A[u+f],a+=4;g--}return r}(a.subarray(a.pos),s,l);if(-1!==A){switch(this.type){case $:var c=A,h=de,u=$;break;case ne:for(var d=A.length/4*3,f=new Float32Array(d),p=0;p<d;p++)i(A,4*p,f,3*p);c=f,h=Ae,u=ne;break;case ie:d=A.length/4*3;var m=new Uint16Array(d);for(p=0;p<d;p++)r(A,4*p,m,3*p);c=m,h=Ae,u=ie;break;default:console.error("RGBELoader: unsupported type: ",this.type)}return{width:s,height:l,data:c,header:o.string,gamma:o.gamma,exposure:o.exposure,format:h,type:u}}}return null},setDataType:function(e){return this.type=e,this},load:function(e,t,n,i){return ql.prototype.load.call(this,e,(function(e,n){switch(e.type){case $:e.encoding=Qe,e.minFilter=X,e.magFilter=X,e.generateMipmaps=!1,e.flipY=!0;break;case ne:case ie:e.encoding=Oe,e.minFilter=Z,e.magFilter=Z,e.generateMipmaps=!1,e.flipY=!0}t&&t(e,n)}),n,i)}});for(var zh=[],Qh=0;Qh<256;Qh++)zh[Qh]=(Qh<16?"0":"")+Qh.toString(16);var Gh=1234567,Hh={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(zh[255&e]+zh[e>>8&255]+zh[e>>16&255]+zh[e>>24&255]+"-"+zh[255&t]+zh[t>>8&255]+"-"+zh[t>>16&15|64]+zh[t>>24&255]+"-"+zh[63&n|128]+zh[n>>8&255]+"-"+zh[n>>16&255]+zh[n>>24&255]+zh[255&i]+zh[i>>8&255]+zh[i>>16&255]+zh[i>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,i,r){return i+(e-t)*(r-i)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return void 0!==e&&(Gh=e%2147483647),((Gh=16807*Gh%2147483647)-1)/2147483646},degToRad:function(e){return e*Hh.DEG2RAD},radToDeg:function(e){return e*Hh.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,i,r){var a=Math.cos,o=Math.sin,s=a(n/2),l=o(n/2),A=a((t+i)/2),c=o((t+i)/2),h=a((t-i)/2),u=o((t-i)/2),d=a((i-t)/2),f=o((i-t)/2);switch(r){case"XYX":e.set(s*c,l*h,l*u,s*A);break;case"YZY":e.set(l*u,s*c,l*h,s*A);break;case"ZXZ":e.set(l*h,l*u,s*c,s*A);break;case"XZX":e.set(s*c,l*f,l*d,s*A);break;case"YXY":e.set(l*d,s*c,l*f,s*A);break;case"ZYZ":e.set(l*f,l*d,s*c,s*A);break;default:console.warn("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}};function Vh(e){return void 0===e&&(e=[]),console.warn("MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e}function jh(e){console.warn("ClosedSplineCurve3 has been deprecated. Use CatmullRomCurve3 instead."),cA.call(this,e),this.type="catmullrom",this.closed=!0}function Wh(e){console.warn("SplineCurve3 has been deprecated. Use CatmullRomCurve3 instead."),cA.call(this,e),this.type="catmullrom"}function Xh(e){console.warn("Spline has been removed. Use CatmullRomCurve3 instead."),cA.call(this,e),this.type="catmullrom"}nA.create=function(e,t){return console.log("Curve.create() has been deprecated"),e.prototype=Object.create(nA.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(bA.prototype,{createPointsGeometry:function(e){console.warn("CurvePath: .createPointsGeometry() has been removed. Use new Geometry().setFromPoints( points ) instead.");var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("CurvePath: .createSpacedPointsGeometry() has been removed. Use new Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("CurvePath: .createGeometry() has been removed. Use new Geometry().setFromPoints( points ) instead.");for(var t=new Li,n=0,i=e.length;n<i;n++){var r=e[n];t.vertices.push(new at(r.x,r.y,r.z||0))}return t}}),Object.assign(MA.prototype,{fromPoints:function(e){return console.warn("Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),jh.prototype=Object.create(cA.prototype),Wh.prototype=Object.create(cA.prototype),Xh.prototype=Object.create(cA.prototype),Object.assign(Xh.prototype,{initFromArray:function(){console.error("Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("Spline: .reparametrizeByArcLength() has been removed.")}}),ph.prototype.setColors=function(){console.error("GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Object.assign(Wl.prototype,{extractUrlBase:function(e){return console.warn("Loader: .extractUrlBase() has been deprecated. Use LoaderUtils.extractUrlBase() instead."),OA.extractUrlBase(e)}}),Wl.Handlers={add:function(){console.error("Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(HA.prototype,{setTexturePath:function(e){return console.warn("ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(e)}}),Object.assign(jc.prototype,{center:function(e){return console.warn("Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(tn.prototype,{center:function(e){return console.warn("Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Yc.prototype.center=function(e){return console.warn("Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(et,{random16:function(){return console.warn("Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),et.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),et.ceilPowerOfTwo(e)}}),Object.assign(lt.prototype,{flattenToArrayOffset:function(e,t){return console.warn("Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(e){return console.warn("Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)},applyToVector3Array:function(){console.error("Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(bt.prototype,{extractPosition:function(e){return console.warn("Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new at).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("Matrix4: .translate() has been removed.")},rotateX:function(){console.error("Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(e){return console.warn("Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)},applyToVector3Array:function(){console.error("Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,i,r,a){return console.warn("Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,i,n,r,a)}}),vn.prototype.isIntersectionLine=function(e){return console.warn("Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},nt.prototype.multiplyVector3=function(e){return console.warn("Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},Object.assign(dn.prototype,{isIntersectionBox:function(e){return console.warn("Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(Tn.prototype,{area:function(){return console.warn("Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(Tn,{barycoordFromPoint:function(e,t,n,i,r){return console.warn("Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Tn.getBarycoord(e,t,n,i,r)},normal:function(e,t,n,i){return console.warn("Triangle: .normal() has been renamed to .getNormal()."),Tn.getNormal(e,t,n,i)}}),Object.assign(CA.prototype,{extractAllPoints:function(e){return console.warn("Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Xs(this,e)},makeGeometry:function(e){return console.warn("Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new al(this,e)}}),Object.assign(tt.prototype,{fromAttribute:function(e,t,n){return console.warn("Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(at.prototype,{setEulerFromRotationMatrix:function(){console.error("Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(ut.prototype,{fromAttribute:function(e,t,n){return console.warn("Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Li.prototype,{computeTangents:function(){console.error("Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("Geometry: .computeLineDistances() has been removed. Use Line.computeLineDistances() instead.")}}),Object.assign(zt.prototype,{getChildByName:function(e){return console.warn("Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("Object3D: .getWorldRotation() has been removed. Use Object3D.getWorldQuaternion( target ) instead.")}}),Object.defineProperties(zt.prototype,{eulerOrder:{get:function(){return console.warn("Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(bo.prototype,{objects:{get:function(){return console.warn("LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(To.prototype,"useVertexTexture",{get:function(){console.warn("Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("Skeleton: useVertexTexture has been removed.")}}),Bo.prototype.initBones=function(){console.error("SkinnedMesh: initBones() has been removed.")},Object.defineProperty(nA.prototype,"__arcLengthDivisions",{get:function(){return console.warn("Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),Ni.prototype.setLens=function(e,t){console.warn("PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(BA.prototype,{onlyShadow:{set:function(){console.warn("Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("Light: .shadowCameraVisible has been removed. Use new CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(zn.prototype,{length:{get:function(){return console.warn("BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===Ye},set:function(){console.warn("BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Ye)}}}),Object.assign(zn.prototype,{setDynamic:function(e){return console.warn("BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?Ye:Xe),this},copyIndicesArray:function(){console.error("BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(si.prototype,{addIndex:function(e){console.warn("BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t){return console.warn("BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new zn(arguments[1],arguments[2])))},addDrawCall:function(e,t,n){void 0!==n&&console.warn("BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(e){return console.warn("BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)}}),Object.defineProperties(si.prototype,{drawcalls:{get:function(){return console.error("BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(no.prototype,{dynamic:{get:function(){return console.warn("InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===Ye},set:function(e){console.warn("InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(no.prototype,{setDynamic:function(e){return console.warn("InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?Ye:Xe),this},setArray:function(){console.error("InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Ys.prototype,{getArrays:function(){console.error("ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(Rc.prototype,{dynamic:{set:function(){console.warn("Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(On.prototype,{wrapAround:{get:function(){console.warn("Material: .wrapAround has been removed.")},set:function(){console.warn("Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("Material: .overdraw has been removed.")},set:function(){console.warn("Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("Material: .wrapRGB has been removed."),new Fn}},shading:{get:function(){console.error(this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn(this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}},stencilMask:{get:function(){return console.warn(this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn(this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(wl.prototype,{metal:{get:function(){return console.warn("MeshPhongMaterial: .metal has been removed. Use MeshStandardMaterial instead."),!1},set:function(){console.warn("MeshPhongMaterial: .metal has been removed. Use MeshStandardMaterial instead")}}}),Object.defineProperties(Ri.prototype,{derivatives:{get:function(){return console.warn("ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn(" ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign($a.prototype,{clearTarget:function(e,t,n,i){console.warn("WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,i)},animate:function(e){console.warn("WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties($a.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}}}),Object.defineProperties(Na.prototype,{cullFace:{get:function(){console.warn("WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(Gi.prototype,{activeCubeFace:{set:function(){console.warn("WebGLRenderTargetCube: .activeCubeFace has been removed. It is now the second parameter of WebGLRenderer.setRenderTarget().")}},activeMipMapLevel:{set:function(){console.warn("WebGLRenderTargetCube: .activeMipMapLevel has been removed. It is now the third parameter of WebGLRenderer.setRenderTarget().")}}}),Object.defineProperties(dt.prototype,{wrapS:{get:function(){return console.warn("WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(Ja.prototype,{standing:{set:function(){console.warn("WebVRManager: .standing has been removed.")}},userHeight:{set:function(){console.warn("WebVRManager: .userHeight has been removed.")}}}),Object.defineProperties(fc.prototype,{load:{value:function(e){console.warn("Audio: .load has been deprecated. Use AudioLoader instead.");var t=this;return(new ec).load(e,(function(e){t.setBuffer(e)})),this}},startTime:{set:function(){console.warn("Audio: .startTime is now .play( delay ).")}}}),wc.prototype.getData=function(){return console.warn("AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},Qi.prototype.updateCubeMap=function(e,t){return console.warn("CubeCamera: .updateCubeMap() is now .update()."),this.update(e,t)};var Yh={merge:function(e,t,n){var i;console.warn("GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),t.isMesh&&(t.matrixAutoUpdate&&t.updateMatrix(),i=t.matrix,t=t.geometry),e.merge(t,i,n)},center:function(e){return console.warn("GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}};At.crossOrigin=void 0,At.loadTexture=function(e,t,n,i){console.warn("ImageUtils.loadTexture has been deprecated. Use TextureLoader() instead.");var r=new tA;r.setCrossOrigin(this.crossOrigin);var a=r.load(e,n,void 0,i);return t&&(a.mapping=t),a},At.loadTextureCube=function(e,t,n,i){console.warn("ImageUtils.loadTextureCube has been deprecated. Use CubeTextureLoader() instead.");var r=new eA;r.setCrossOrigin(this.crossOrigin);var a=r.load(e,n,void 0,i);return t&&(a.mapping=t),a},At.loadCompressedTexture=function(){console.error("ImageUtils.loadCompressedTexture has been removed. Use DDSLoader instead.")},At.loadCompressedTextureCube=function(){console.error("ImageUtils.loadCompressedTextureCube has been removed. Use DDSLoader instead.")};var Kh={createMultiMaterialObject:function(){console.error("SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},detach:function(){console.error("SceneUtils has been moved to /examples/js/utils/SceneUtils.js")},attach:function(){console.error("SceneUtils has been moved to /examples/js/utils/SceneUtils.js")}};function Zh(e,t){Li.call(this),this.type="ExtrudeGeometry2",this.parameters={shapes:e,options:t},this.fromBufferGeometry(new Jh(e,t)),this.mergeVertices()}function Jh(e,t){si.call(this),this.type="ExtrudeBufferGeometry2",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];for(var n=this,i=[],r=[],a=0,o=e.length;a<o;a++){s(e[a])}function s(e){var a=[],o=void 0!==t.curveSegments?t.curveSegments:12,s=void 0!==t.steps?t.steps:1,l=void 0!==t.depth?t.depth:100,A=void 0===t.bevelEnabled||t.bevelEnabled,c=void 0!==t.bevelThickness?t.bevelThickness:6,h=void 0!==t.bevelSize?t.bevelSize:c-2,u=void 0!==t.bevelOffset?t.bevelOffset:0,d=void 0!==t.bevelSegments?t.bevelSegments:3,f=t.extrudePath,p=void 0!==t.UVGenerator?t.UVGenerator:qh;void 0!==t.amount&&(console.warn("ExtrudeBufferGeometry2: amount has been renamed to depth."),l=t.amount);var m,v,g,y,w,x,b,M,C=!1;f&&(m=f.getSpacedPoints(s),C=!0,A=!1,v=f.computeFrenetFrames(s,!1),g=new at,y=new at,w=new at),A||(d=0,c=0,h=0,u=0);var B=e.extractPoints(o),E=B.shape,S=B.holes;if(!Vs.isClockWise(E))for(E=E.reverse(),b=0,M=S.length;b<M;b++)x=S[b],Vs.isClockWise(x)&&(S[b]=x.reverse());var T=Vs.triangulateShape(E,S),_=E;for(b=0,M=S.length;b<M;b++)x=S[b],E=E.concat(x);function I(e,t,n){return t||console.error("ExtrudeGeometry2: vec does not exist"),t.clone().multiplyScalar(n).add(e)}var L,F,k,P,U,D=E.length,R=T.length;function O(e,t,n){var i,r,a,o=e.x-t.x,s=e.y-t.y,l=n.x-e.x,A=n.y-e.y,c=o*o+s*s,h=o*A-s*l;if(Math.abs(h)>Number.EPSILON){var u=Math.sqrt(c),d=Math.sqrt(l*l+A*A),f=t.x-s/u,p=t.y+o/u,m=((n.x-A/d-f)*A-(n.y+l/d-p)*l)/(o*A-s*l),v=(i=f+o*m-e.x)*i+(r=p+s*m-e.y)*r;if(v<=2)return new tt(i,r);a=Math.sqrt(v/2)}else{var g=!1;o>Number.EPSILON?l>Number.EPSILON&&(g=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(g=!0):Math.sign(s)===Math.sign(A)&&(g=!0),g?(i=-s,r=o,a=Math.sqrt(c)):(i=o,r=s,a=Math.sqrt(c/2))}return new tt(i/a,r/a)}for(var N=[],z=0,Q=_.length,G=Q-1,H=z+1;z<Q;z++,G++,H++)G===Q&&(G=0),H===Q&&(H=0),N[z]=O(_[z],_[G],_[H]);var V,j,W=[],X=N.concat();for(b=0,M=S.length;b<M;b++){for(x=S[b],V=[],z=0,G=(Q=x.length)-1,H=z+1;z<Q;z++,G++,H++)G===Q&&(G=0),H===Q&&(H=0),V[z]=O(x[z],x[G],x[H]);W.push(V),X=X.concat(V)}for(L=0;L<d;L++){for(k=L/d,P=c*Math.cos(k*Math.PI/2),F=h*Math.sin(k*Math.PI/2)+u,z=0,Q=_.length;z<Q;z++)K((U=I(_[z],N[z],F)).x,U.y,-P);for(b=0,M=S.length;b<M;b++)for(x=S[b],V=W[b],z=0,Q=x.length;z<Q;z++)K((U=I(x[z],V[z],F)).x,U.y,-P)}for(F=h+u,z=0;z<D;z++)U=A?I(E[z],X[z],F):E[z],C?(y.copy(v.normals[0]).multiplyScalar(U.x),g.copy(v.binormals[0]).multiplyScalar(U.y),w.copy(m[0]).add(y).add(g),K(w.x,w.y,w.z)):K(U.x,U.y,0);for(j=1;j<=s;j++)for(z=0;z<D;z++)U=A?I(E[z],X[z],F):E[z],C?(y.copy(v.normals[j]).multiplyScalar(U.x),g.copy(v.binormals[j]).multiplyScalar(U.y),w.copy(m[j]).add(y).add(g),K(w.x,w.y,w.z)):K(U.x,U.y,l/s*j);for(L=d-1;L>=0;L--){for(k=L/d,P=c*Math.cos(k*Math.PI/2),F=h*Math.sin(k*Math.PI/2)+u,z=0,Q=_.length;z<Q;z++)K((U=I(_[z],N[z],F)).x,U.y,l+P);for(b=0,M=S.length;b<M;b++)for(x=S[b],V=W[b],z=0,Q=x.length;z<Q;z++)U=I(x[z],V[z],F),C?K(U.x,U.y+m[s-1].y,m[s-1].x+P):K(U.x,U.y,l+P)}function Y(e,t){var n,i;for(z=e.length;--z>=0;){n=z,(i=z-1)<0&&(i=e.length-1);var r=0,a=s+2*d;for(r=0;r<a;r++){var o=D*r,l=D*(r+1);q(t+n+o,t+i+o,t+i+l,t+n+l)}}}function K(e,t,n){a.push(e),a.push(t),a.push(n)}function Z(e,t,n,r){for(var a=t/2,o=0,s=0;o<t&&s<a;o++,s++){for(var l,A,c,h,u=[],d=0;d<2;d++){var f=o+2*d;f>=t&&(f=t-1);var p=e[f];u.push(p[r?2:0]+n),u.push(p[1]+n),u.push(p[r?0:2]+n)}o%2==1&&(o+=2);for(var m=0;m<u.length;m++)$(u[m]);for(var v,g,y,w,x,b,M,C,B,E,S=0,T=i.length/3,_=0;_<3;_++){g=2==_?T-6:T-6+_+1,x=new tt(i[3*(v=T-6+_)],i[3*v+1]),b=new tt(i[3*g],i[3*g+1]);var I=(B=new tt(b.x-x.x,b.y-x.y)).length();B.normalize();for(var L=3;L<6;L++){w=5==L?T-3:T-6+L+1,M=new tt(i[3*(y=T-6+L)],i[3*y+1]),C=new tt(i[3*w],i[3*w+1]),(E=new tt(C.x-M.x,C.y-M.y)).normalize();var F=B.dot(E);if(1-Math.abs(F)<1e-10){if(x.equals(M)&&b.equals(C)||x.equals(C)&&b.equals(M))break;I>S&&(S=I,l=x,A=b,c=M,h=C);break}}}if(S>0)J(T-6,T-5,T-4,l,A,!0),J(T-3,T-2,T-1,c,h,!1);else{console.log("Error: 没有找到平行边!!!");var k=[];for(_=0;_<3;_++){g=2==_?T-6:T-6+_+1,x=new tt(i[3*(v=T-6+_)],i[3*v+1]),b=new tt(i[3*g],i[3*g+1]);I=(B=new tt(b.x-x.x,b.y-x.y)).length();k.push([I,x,b])}var P=function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0};k.sort(P),J(T-6,T-5,T-4,k[1][1],k[1][2],!0),k=[];for(L=3;L<6;L++){w=5==L?T-3:T-6+L+1,M=new tt(i[3*(y=T-6+L)],i[3*y+1]),C=new tt(i[3*w],i[3*w+1]),E=new tt(C.x-M.x,C.y-M.y);I=B.length();k.push([I,M,C])}k.sort(P),J(T-3,T-2,T-1,k[1][1],k[1][2],!1)}}}function J(e,t,r,a,o,s){var l=p.generateTopUV(n,i,e,t,r,a,o,s);ee(l[0]),ee(l[1]),ee(l[2])}function q(e,t,r,a){$(e),$(t),$(a),$(t),$(r),$(a);var o=i.length/3,s=p.generateSideWallUV(n,i,o-6,o-3,o-2,o-1);ee(s[0]),ee(s[1]),ee(s[3]),ee(s[1]),ee(s[2]),ee(s[3])}function $(e){i.push(a[3*e+0]),i.push(a[3*e+1]),i.push(a[3*e+2])}function ee(e){r.push(e.x),r.push(e.y)}!function(){var e=i.length/3;if(A){var t=0;Z(T,R,D*t,!0),Z(T,R,D*(t=s+2*d),!1)}else{Z(T,R,0,!0),Z(T,R,D*s,!1)}n.addGroup(e,i.length/3-e,0)}(),function(){var e=i.length/3,t=0;for(Y(_,t),t+=_.length,b=0,M=S.length;b<M;b++)Y(x=S[b],t),t+=x.length;n.addGroup(e,i.length/3-e,1)}()}this.setAttribute("position",new Yn(i,3)),this.setAttribute("uv",new Yn(r,2)),this.computeVertexNormals()}Zh.prototype=Object.create(Li.prototype),Zh.prototype.constructor=Zh,Zh.prototype.toJSON=function(){var e=Li.prototype.toJSON.call(this);return $h(this.parameters.shapes,this.parameters.options,e)},Jh.prototype=Object.create(si.prototype),Jh.prototype.constructor=Jh,Jh.prototype.toJSON=function(){var e=si.prototype.toJSON.call(this);return $h(this.parameters.shapes,this.parameters.options,e)};var qh={generateTopUV:function(e,t,n,i,r,a,o,s){var l=new tt(t[3*n],t[3*n+1]),A=new tt(t[3*i],t[3*i+1]),c=new tt(t[3*r],t[3*r+1]);if(null===a||null===o)return[new tt(l.x,l.y),new tt(A.x,A.y),new tt(c.x,c.y)];for(var h,u=[l,A,c],d=[0,0,0],f=0;f<u.length;f++)u[f].equals(a)||u[f].equals(o)?u[f].equals(a)?d[f]=0:d[f]=1:(h=u[f],d[f]=2);var p=new tt(a.x+o.x,a.y+o.y);p=p.divideScalar(2);var m=new tt(o.x-a.x,o.y-a.y),v=m.length()/2;m.normalize();var g=new tt(h.x-p.x,h.y-p.y),y=new tt(1,0),w=m.dot(y),x=Math.acos(w),b=!1,M=m.x*m.y>0;(M&&x>Math.PI/2||!M&&x<Math.PI/2)&&(b=!0,x=Math.PI-x),w=Math.cos(x);for(var C=Math.sin(x),B=g.x*w+g.y*C,E=-g.x*C+g.y*w,S=[],T=0;T<3;T++){var _;switch(d[T]){case 0:_=new tt(b?v:-v,0);break;case 1:_=new tt(b?-v:v,0);break;case 2:_=new tt(B,E)}S.push(_)}return S},generateSideWallUV:function(e,t,n,i,r,a){var o=[3*n,3*i,3*r,3*a],s=[t[o[0]+2],t[o[1]+2],t[o[2]+2],t[o[3]+2]];s.sort((function(e,t){return e<t?-1:e>t?1:0}));for(var l=[],A=0;A<2;A++)for(var c=0;c<o.length;c++)t[o[c]+2]==s[A]&&(0==A||1==A&&o[c]!=l[0])&&(l[A]=o[c]);var h=!1,u=t[l[0]]-t[l[1]],d=t[l[0]+1]-t[l[1]+1];u*d>=0&&(h=!0);var f=(u=Math.abs(u))+(d=Math.abs(d)),p=d/f,m=u/f;if(h)return[new tt(t[o[0]]*m+t[o[0]+1]*p,1-t[o[0]+2]),new tt(t[o[1]]*m+t[o[1]+1]*p,1-t[o[1]+2]),new tt(t[o[2]]*m+t[o[2]+1]*p,1-t[o[2]+2]),new tt(t[o[3]]*m+t[o[3]+1]*p,1-t[o[3]+2])];for(c=0;c<o.length;c++)o[c]!=l[0]&&o[c]!=l[1]&&l.push(o[c]);for(var v=[],g=0;g<4;g++){var y=new tt;y.x=t[o[g]]*m;for(var w=0,x=0;x<2;x++)o[g]==l[2*x]?w=l[2*x+1]:o[g]==l[2*x+1]&&(w=l[2*x]);y.x+=t[w+1]*p,y.y=1-t[o[g]+2],v.push(y)}return v}};function $h(e,t,n){if(n.shapes=[],Array.isArray(e))for(var i=0,r=e.length;i<r;i++){var a=e[i];n.shapes.push(a.uuid)}else n.shapes.push(e.uuid);return void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}function eu(e){return function(e){for(var t="0123456789abcdef",n="",i=0;i<4*e.length;i++)n+=t.charAt(e[i>>2]>>8*(3-i%4)+4&15)+t.charAt(e[i>>2]>>8*(3-i%4)&15);return n}(function(e){for(var t=e,n=Array(80),i=1732584193,r=-271733879,a=-1732584194,o=271733878,s=-1009589776,l=0;l<t.length;l+=16){for(var A=i,c=r,h=a,u=o,d=s,f=0;f<80;f++){n[f]=f<16?t[l+f]:ru(n[f-3]^n[f-8]^n[f-14]^n[f-16],1);var p=iu(iu(ru(i,5),tu(f,r,a,o)),iu(iu(s,n[f]),nu(f)));s=o,o=a,a=ru(r,30),r=i,i=p}i=iu(i,A),r=iu(r,c),a=iu(a,h),o=iu(o,u),s=iu(s,d)}return new Array(i,r,a,o,s)}(function(e){for(var t=1+(e.length+8>>6),n=new Array(16*t),i=0;i<16*t;i++)n[i]=0;for(i=0;i<e.length;i++)n[i>>2]|=e.charCodeAt(i)<<24-8*(3&i);return n[i>>2]|=128<<24-8*(3&i),n[16*t-1]=8*e.length,n}(e)))}function tu(e,t,n,i){return e<20?t&n|~t&i:e<40?t^n^i:e<60?t&n|t&i|n&i:t^n^i}function nu(e){return e<20?1518500249:e<40?1859775393:e<60?-1894007588:-899497514}function iu(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function ru(e,t){return e<<t|e>>>32-t}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:T}}));var au={};function ou(){}ou.prototype=Object.assign(ou.prototype,{constructor:ou,load:function(e,t,n,i){if(void 0===au[e]){au[e]=[],au[e].push({onLoad:t,onProgress:n,onError:i});var r=new XMLHttpRequest;return r.open("GET",e,!0),r.addEventListener("load",(function(t){var n=this.response,i=au[e];if(delete au[e],200===this.status||0===this.status)for(var a=0,o=i.length;a<o;a++){(s=i[a]).onLoad&&s.onLoad(n)}else for(a=0,o=i.length;a<o;a++){var s;(s=i[a]).onError&&s.onError(t)}r.end=!0}),!1),r.addEventListener("progress",(function(t){for(var n=au[e],i=0,r=n.length;i<r;i++){var a=n[i];a.onProgress&&a.onProgress(t)}}),!1),r.addEventListener("error",(function(t){var n=au[e];delete au[e];for(var i=0,a=n.length;i<a;i++){var o=n[i];o.onError&&o.onError(t)}r.end=!0}),!1),r.addEventListener("abort",(function(t){var n=au[e];delete au[e];for(var i=0,a=n.length;i<a;i++){var o=n[i];o.onError&&o.onError(t)}r.end=!0}),!1),void 0!==this.responseType&&(r.responseType=this.responseType),r.send(null),r}au[e].push({onLoad:t,onProgress:n,onError:i})},setResponseType:function(e){return this.responseType=e,this}});var su="http://10.10.10.139:4080/common/downloadFile/",lu=function(){function e(){s(this,e)}return A(e,null,[{key:"getModelById",value:function(t){try{var n=this.post({url:"https://open.laozicloud.com/v4/auth/getModelFile",body:"modelId="+t+"&token="+cu.token,async:!1});if(6e4===n.resp_code)return n.datas;if(60301!==n.resp_code)throw new Error("模型获取失败!");if("无权访问该模型"==n.resp_msg)throw console.warn(n.resp_msg),new Error(n.resp_msg);if("token不存在或已失效"===n.resp_msg&&(cu.token=cu.checkDevloper(),cu.token))return e.getModelById(t)}catch(e){throw new Error("模型获取失败!")}}},{key:"getLocalModelById",value:function(e){try{var t=this.post({url:"http://10.10.10.139:4080/model/preview",body:"id="+e,async:!1});if(t&&6e4===t.resp_code)return JSON.parse(t.datas.paths);throw new Error("模型获取失败!")}catch(e){throw new Error("模型获取失败!")}}},{key:"authorization",value:function(e){var t=this.post({url:"https://open.laozicloud.com/v4/auth/authentication",body:e,async:!1});try{if(t&&6e4===t.resp_code)return t.datas;throw new Error("授权失败,请检查您的开发者凭证是否正确。")}catch(e){throw new Error("授权失败,请检查您的开发者凭证是否正确。")}}},{key:"post",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0===e.async&&(e.async=!0);var t=new XMLHttpRequest;if(e.async&&(t.responseType="json"),t.open("POST",e.url,e.async),t.setRequestHeader("Content-type","application/x-www-form-urlencoded"),t.onreadystatechange=function(){4==t.readyState&&200==t.status&&e.onSuccess&&e.onSuccess(t.response)},t.onerror=function(t){e.onFaild&&e.onFaild(t)},t.send(e.body),!e.async)return JSON.parse(t.response)}},{key:"get",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0===e.async&&(e.async=!0);var t=new XMLHttpRequest;if(e.async&&(t.responseType="json"),t.open("GET",e.url,e.async),t.setRequestHeader("Content-type","application/x-www-form-urlencoded"),t.onreadystatechange=function(){4===t.readyState&&200===t.status&&e.onSuccess&&e.onSuccess(t.response)},t.onerror=function(t){e.onFaild&&e.onFaild(t)},t.send(),!e.async)try{return JSON.parse(t.response)}catch(e){return 4===t.readyState&&200===t.status}}},{key:"setLocalPath",value:function(e,t){return e.m.forEach((function(n,i){e.m[i]=t+"m/"+n})),e.mat.forEach((function(n,i){e.mat[i]=t+"mat/"+n})),void 0!==e.scene&&""!=e.scene&&(e.scene=t+e.scene),void 0!==e.nodes&&""!=e.nodes&&(e.nodes=t+"nodes/"+e.nodes),void 0!==e.i&&""!=e.i&&(e.i=t+"instance/"+e.i),void 0!==e.ii&&e.ii.forEach((function(n,i){e.ii[i]=t+"instance/"+n})),e.localPath=t+"Texture/",e.bim&&(e.bim=t+e.bim),e}},{key:"setOnlinePath",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:su;return e.m.forEach((function(n,i){e.m[i]=t+n})),e.mat.forEach((function(n,i){e.mat[i]=t+n})),void 0!==e.scene&&""!=e.scene&&(e.scene=t+e.scene),void 0!==e.nodes&&""!=e.nodes&&(e.nodes=t+e.nodes),void 0!==e.i&&""!=e.i&&(e.i=t+e.i),void 0!==e.ii&&e.ii.forEach((function(n,i){e.ii[i]=t+n})),e.localPath=t,e}},{key:"getFileList",value:function(e){try{var t=this.get({url:e+"fileList.json",method:"GET",async:!1});return Array.isArray(t.addition)&&(t.addition=t.addition.map((function(t){return e+t}))),Array.isArray(t.a)&&(t.a=t.a.map((function(t){return e+t}))),Array.isArray(t.m)&&(t.m=t.m.map((function(t){return e+t}))),Array.isArray(t.mat)&&(t.mat=t.mat.map((function(t){return e+t}))),Array.isArray(t.instance)&&(t.instance=t.instance.map((function(t){return e+t}))),Array.isArray(t.skin)&&(t.skin=t.skin.map((function(t){return e+t}))),Array.isArray(t.bone)&&(t.bone=t.bone.map((function(t){return e+t}))),t.scene&&(t.scene=e+t.scene),t.sky&&(t.sky.a=e+t.sky.a,t.sky.b=e+t.sky.b),t.bim&&(t.bim=e+t.bim),t.sceneData&&(t.sceneData=e+t.sceneData),t}catch(e){console.error("获取本地fileList.json失败")}}},{key:"hasMRCBFile",value:function(e){try{return this.get({url:e+"conf.mrcb",method:"GET",async:!1})}catch(e){}}},{key:"getCoordsByAddressOrCityCode",value:function(t,n,i){var r='https://api.tianditu.gov.cn/administrative?postStr={"searchWord":"'.concat(void 0!==t?t:n,'","searchType":"').concat(void 0!==t?1:0,'","needSubInfo":"false","needAll":"false","needPolygon":"true","needPre":"true"}&tk=')+Ck.token;e.get({url:r,async:!0,onSuccess:function(e){"ok"===e.msg&&(e.data[0].coord=[e.data[0].lnt,e.data[0].lat],i(e.data[0]))}})}},{key:"getCoordsByCityCode",value:function(t,n){e.getCoordsByAddressOrCityCode(void 0,t,n)}},{key:"getCoordsByAddress",value:function(t,n){e.getCoordsByAddressOrCityCode(t,void 0,n)}}]),e}(),Au=function(){function e(){s(this,e),this.token=null}return A(e,[{key:"init",value:function(e){this.options=e}},{key:"checkDevloper",value:function(){if(!this.options.appkey||""===this.options.appkey)throw new Error("开发者参数[appkey]缺失!");if(!this.options.appsecret||""===this.options.appsecret)throw new Error("开发者参数[appsecret]缺失!");var e=(new Date).getTime(),t=parseInt(1e6*Math.random()),n=eu(this.options.appsecret+e+t),i="appkey="+this.options.appkey+"&random="+t+"&sign="+n+"&source=3&timeStamp="+e;return lu.authorization(i)}},{key:"offlineValidation",value:function(e){var t=this;try{callRuntimeCallbacks&&callRuntimeCallbacks([function(n){n.onRuntimeInitialized=function(){var i=0;n&&n.ccall&&(i=n.ccall("WEB_API_CheckLicenseData","number",["string","string","string","string"],[t.options.developerID,t.options.appID,t.options.secretKey,t.options.offlinekey])),e(i)}}])}catch(t){e(0)}}}]),e}(),cu=new Au;function hu(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}Object.assign(hu.prototype,{setSize:function(){},render:function(){console.error("Pass: .render() must be implemented in derived pass.")}}),hu.FullScreenQuad=function(){var e=new FA(-1,1,1,-1,0,1),t=new $i(2,2),n=function(e){this._mesh=new Ei(t,e)};return Object.defineProperty(n.prototype,"material",{get:function(){return this._mesh.material},set:function(e){this._mesh.material=e}}),Object.assign(n.prototype,{render:function(t){t.render(this._mesh,e)}}),n}();var uu=function(e,t,n,i,r){hu.call(this),this.scene=e,this.camera=t,this.overrideMaterial=n,this.clearColor=i,this.clearAlpha=void 0!==r?r:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1};uu.prototype=Object.assign(Object.create(hu.prototype),{constructor:uu,render:function(e,t,n){var i,r,a=e.autoClear;e.autoClear=!1,this.scene.overrideMaterial=this.overrideMaterial,this.clearColor&&(i=e.getClearColor().getHex(),r=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:n),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor&&e.setClearColor(i,r),this.scene.overrideMaterial=null,e.autoClear=a}}),"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:T}}));var du={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tgl_FragColor = opacity * texel;","}"].join("\n")},fu=function(e,t){hu.call(this),this.textureID=void 0!==t?t:"tDiffuse",e instanceof Ri?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=Di.clone(e.uniforms),this.material=new Ri({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new hu.FullScreenQuad(this.material)};fu.prototype=Object.assign(Object.create(hu.prototype),{constructor:fu,render:function(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}});var pu=function(e,t){hu.call(this),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1};pu.prototype=Object.assign(Object.create(hu.prototype),{constructor:pu,render:function(e,t,n){var i,r,a=e.getContext(),o=e.state;o.buffers.color.setMask(!1),o.buffers.depth.setMask(!1),o.buffers.color.setLocked(!0),o.buffers.depth.setLocked(!0),this.inverse?(i=0,r=1):(i=1,r=0),o.buffers.stencil.setTest(!0),o.buffers.stencil.setOp(a.REPLACE,a.REPLACE,a.REPLACE),o.buffers.stencil.setFunc(a.ALWAYS,i,4294967295),o.buffers.stencil.setClear(r),o.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),o.buffers.color.setLocked(!1),o.buffers.depth.setLocked(!1),o.buffers.stencil.setLocked(!1),o.buffers.stencil.setFunc(a.EQUAL,1,4294967295),o.buffers.stencil.setOp(a.KEEP,a.KEEP,a.KEEP),o.buffers.stencil.setLocked(!0)}});var mu=function(){hu.call(this),this.needsSwap=!1};mu.prototype=Object.create(hu.prototype),Object.assign(mu.prototype,{render:function(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}});var vu=function(e,t){if(this.renderer=e,void 0===t){var n={minFilter:Z,magFilter:Z,format:ce,stencilBuffer:!0},i=e.getSize(new tt);this._pixelRatio=e.getPixelRatio(),this._width=i.width,this._height=i.height,(t=new dt(this._width*this._pixelRatio,this._height*this._pixelRatio,n)).texture.name="EffectComposer.rt1"}else this._pixelRatio=1,this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],void 0===du&&console.error("EffectComposer relies on CopyShader"),void 0===fu&&console.error("EffectComposer relies on ShaderPass"),this.copyPass=new fu(du),this.clock=new lc};Object.assign(vu.prototype,{swapBuffers:function(){var e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e},addPass:function(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)},insertPass:function(e,t){this.passes.splice(t,0,e)},isLastEnabledPass:function(e){for(var t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0},render:function(e){void 0===e&&(e=this.clock.getDelta());var t,n,i=this.renderer.getRenderTarget(),r=!1,a=this.passes.length;for(n=0;n<a;n++)if(!1!==(t=this.passes[n]).enabled){if(t.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(n),t.render(this.renderer,this.writeBuffer,this.readBuffer,e,r),t.needsSwap){if(r){var o=this.renderer.getContext(),s=this.renderer.state.buffers.stencil;s.setFunc(o.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),s.setFunc(o.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==pu&&(t instanceof pu?r=!0:t instanceof mu&&(r=!1))}this.renderer.setRenderTarget(i)},reset:function(e){if(void 0===e){var t=this.renderer.getSize(new tt);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,(e=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2},setSize:function(e,t){this._width=e,this._height=t;var n=this._width*this._pixelRatio,i=this._height*this._pixelRatio;this.renderTarget1.setSize(n,i),this.renderTarget2.setSize(n,i);for(var r=0;r<this.passes.length;r++)this.passes[r].setSize(n,i)},setPixelRatio:function(e){this._pixelRatio=e,this.setSize(this._width,this._height)}});var gu=function(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1};Object.assign(gu.prototype,{setSize:function(){},render:function(){console.error("Pass: .render() must be implemented in derived pass.")}}),gu.FullScreenQuad=function(){var e=new FA(-1,1,1,-1,0,1),t=new $i(2,2),n=function(e){this._mesh=new Ei(t,e)};return Object.defineProperty(n.prototype,"material",{get:function(){return this._mesh.material},set:function(e){this._mesh.material=e}}),Object.assign(n.prototype,{render:function(t){t.render(this._mesh,e)}}),n}();var yu={uniforms:{tDiffuse:{value:null},resolution:{value:new tt(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["precision highp float;","","uniform sampler2D tDiffuse;","","uniform vec2 resolution;","","varying vec2 vUv;","","// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)","","//----------------------------------------------------------------------------------","// File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag","// SDK Version: v3.00","// Email: gameworks@nvidia.com","// Site: http://developer.nvidia.com/","//","// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.","//","// Redistribution and use in source and binary forms, with or without","// modification, are permitted provided that the following conditions","// are met:","// * Redistributions of source code must retain the above copyright","// notice, this list of conditions and the following disclaimer.","// * Redistributions in binary form must reproduce the above copyright","// notice, this list of conditions and the following disclaimer in the","// documentation and/or other materials provided with the distribution.","// * Neither the name of NVIDIA CORPORATION nor the names of its","// contributors may be used to endorse or promote products derived","// from this software without specific prior written permission.","//","// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY","// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE","// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR","// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR","// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,","// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,","// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR","// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY","// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT","// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE","// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","//","//----------------------------------------------------------------------------------","","#define FXAA_PC 1","#define FXAA_GLSL_100 1","#define FXAA_QUALITY_PRESET 12","","#define FXAA_GREEN_AS_LUMA 1","","/*--------------------------------------------------------------------------*/","#ifndef FXAA_PC_CONSOLE"," //"," // The console algorithm for PC is included"," // for developers targeting really low spec machines."," // Likely better to just run FXAA_PC, and use a really low preset."," //"," #define FXAA_PC_CONSOLE 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_120"," #define FXAA_GLSL_120 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_130"," #define FXAA_GLSL_130 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_3"," #define FXAA_HLSL_3 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_4"," #define FXAA_HLSL_4 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_5"," #define FXAA_HLSL_5 0","#endif","/*==========================================================================*/","#ifndef FXAA_GREEN_AS_LUMA"," //"," // For those using non-linear color,"," // and either not able to get luma in alpha, or not wanting to,"," // this enables FXAA to run using green as a proxy for luma."," // So with this enabled, no need to pack luma in alpha."," //"," // This will turn off AA on anything which lacks some amount of green."," // Pure red and blue or combination of only R and B, will get no AA."," //"," // Might want to lower the settings for both,"," // fxaaConsoleEdgeThresholdMin"," // fxaaQualityEdgeThresholdMin"," // In order to insure AA does not get turned off on colors"," // which contain a minor amount of green."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_GREEN_AS_LUMA 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_EARLY_EXIT"," //"," // Controls algorithm's early exit path."," // On PS3 turning this ON adds 2 cycles to the shader."," // On 360 turning this OFF adds 10ths of a millisecond to the shader."," // Turning this off on console will result in a more blurry image."," // So this defaults to on."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_EARLY_EXIT 1","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_DISCARD"," //"," // Only valid for PC OpenGL currently."," // Probably will not work when FXAA_GREEN_AS_LUMA = 1."," //"," // 1 = Use discard on pixels which don't need AA."," // For APIs which enable concurrent TEX+ROP from same surface."," // 0 = Return unchanged color on pixels which don't need AA."," //"," #define FXAA_DISCARD 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_FAST_PIXEL_OFFSET"," //"," // Used for GLSL 120 only."," //"," // 1 = GL API supports fast pixel offsets"," // 0 = do not use fast pixel offsets"," //"," #ifdef GL_EXT_gpu_shader4"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifndef FXAA_FAST_PIXEL_OFFSET"," #define FXAA_FAST_PIXEL_OFFSET 0"," #endif","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GATHER4_ALPHA"," //"," // 1 = API supports gather4 on alpha channel."," // 0 = API does not support gather4 on alpha channel."," //"," #if (FXAA_HLSL_5 == 1)"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifndef FXAA_GATHER4_ALPHA"," #define FXAA_GATHER4_ALPHA 0"," #endif","#endif","","","/*============================================================================"," FXAA QUALITY - TUNING KNOBS","------------------------------------------------------------------------------","NOTE the other tuning knobs are now in the shader function inputs!","============================================================================*/","#ifndef FXAA_QUALITY_PRESET"," //"," // Choose the quality preset."," // This needs to be compiled into the shader as it effects code."," // Best option to include multiple presets is to"," // in each shader define the preset, then include this file."," //"," // OPTIONS"," // -----------------------------------------------------------------------"," // 10 to 15 - default medium dither (10=fastest, 15=highest quality)"," // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)"," // 39 - no dither, very expensive"," //"," // NOTES"," // -----------------------------------------------------------------------"," // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)"," // 13 = about same speed as FXAA 3.9 and better than 12"," // 23 = closest to FXAA 3.9 visually and performance wise"," // _ = the lowest digit is directly related to performance"," // _ = the highest digit is directly related to style"," //"," #define FXAA_QUALITY_PRESET 12","#endif","","","/*============================================================================",""," FXAA QUALITY - PRESETS","","============================================================================*/","","/*============================================================================"," FXAA QUALITY - MEDIUM DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 10)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 3.0"," #define FXAA_QUALITY_P2 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 11)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 3.0"," #define FXAA_QUALITY_P3 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 12)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 4.0"," #define FXAA_QUALITY_P4 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 13)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 4.0"," #define FXAA_QUALITY_P5 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 14)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 4.0"," #define FXAA_QUALITY_P6 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 15)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 12.0","#endif","","/*============================================================================"," FXAA QUALITY - LOW DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 20)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 2.0"," #define FXAA_QUALITY_P2 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 21)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 22)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 23)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 24)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 3.0"," #define FXAA_QUALITY_P6 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 25)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 26)"," #define FXAA_QUALITY_PS 9"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 4.0"," #define FXAA_QUALITY_P8 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 27)"," #define FXAA_QUALITY_PS 10"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 4.0"," #define FXAA_QUALITY_P9 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 28)"," #define FXAA_QUALITY_PS 11"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 4.0"," #define FXAA_QUALITY_P10 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 29)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","/*============================================================================"," FXAA QUALITY - EXTREME QUALITY","============================================================================*/","#if (FXAA_QUALITY_PRESET == 39)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.0"," #define FXAA_QUALITY_P2 1.0"," #define FXAA_QUALITY_P3 1.0"," #define FXAA_QUALITY_P4 1.0"," #define FXAA_QUALITY_P5 1.5"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","","","/*============================================================================",""," API PORTING","","============================================================================*/","#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)"," #define FxaaBool bool"," #define FxaaDiscard discard"," #define FxaaFloat float"," #define FxaaFloat2 vec2"," #define FxaaFloat3 vec3"," #define FxaaFloat4 vec4"," #define FxaaHalf float"," #define FxaaHalf2 vec2"," #define FxaaHalf3 vec3"," #define FxaaHalf4 vec4"," #define FxaaInt2 ivec2"," #define FxaaSat(x) clamp(x, 0.0, 1.0)"," #define FxaaTex sampler2D","#else"," #define FxaaBool bool"," #define FxaaDiscard clip(-1)"," #define FxaaFloat float"," #define FxaaFloat2 float2"," #define FxaaFloat3 float3"," #define FxaaFloat4 float4"," #define FxaaHalf half"," #define FxaaHalf2 half2"," #define FxaaHalf3 half3"," #define FxaaHalf4 half4"," #define FxaaSat(x) saturate(x)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_100 == 1)"," #define FxaaTexTop(t, p) texture2D(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_120 == 1)"," // Requires,"," // #version 120"," // And at least,"," // #extension GL_EXT_gpu_shader4 : enable"," // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)"," #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)"," #if (FXAA_FAST_PIXEL_OFFSET == 1)"," #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)"," #else"," #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)"," #endif"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_130 == 1)",' // Requires "#version 130" or better'," #define FxaaTexTop(t, p) textureLod(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_3 == 1)"," #define FxaaInt2 float2"," #define FxaaTex sampler2D"," #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))"," #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_4 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_5 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)"," #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)"," #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)"," #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)"," #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)","#endif","","","/*============================================================================"," GREEN AS LUMA OPTION SUPPORT FUNCTION","============================================================================*/","#if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }","#else"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }","#endif","","","","","/*============================================================================",""," FXAA3 QUALITY - PC","","============================================================================*/","#if (FXAA_PC == 1)","/*--------------------------------------------------------------------------*/","FxaaFloat4 FxaaPixelShader("," //"," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy} = center of pixel"," FxaaFloat2 pos,"," //"," // Used only for FXAA Console, and not used on the 360 version."," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy_} = upper left of pixel"," // {_zw} = lower right of pixel"," FxaaFloat4 fxaaConsolePosPos,"," //"," // Input color texture."," // {rgb_} = color in linear or perceptual color space"," // if (FXAA_GREEN_AS_LUMA == 0)"," // {__a} = luma in perceptual color space (not linear)"," FxaaTex tex,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 2nd sampler."," // This sampler needs to have an exponent bias of -1."," FxaaTex fxaaConsole360TexExpBiasNegOne,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 3nd sampler."," // This sampler needs to have an exponent bias of -2."," FxaaTex fxaaConsole360TexExpBiasNegTwo,"," //"," // Only used on FXAA Quality."," // This must be from a constant/uniform."," // {x_} = 1.0/screenWidthInPixels"," // {_y} = 1.0/screenHeightInPixels"," FxaaFloat2 fxaaQualityRcpFrame,"," //"," // Only used on FXAA Console."," // This must be from a constant/uniform."," // This effects sub-pixel AA quality and inversely sharpness."," // Where N ranges between,"," // N = 0.50 (default)"," // N = 0.33 (sharper)"," // {x__} = -N/screenWidthInPixels"," // {_y_} = -N/screenHeightInPixels"," // {_z_} = N/screenWidthInPixels"," // {__w} = N/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt,"," //"," // Only used on FXAA Console."," // Not used on 360, but used on PS3 and PC."," // This must be from a constant/uniform."," // {x__} = -2.0/screenWidthInPixels"," // {_y_} = -2.0/screenHeightInPixels"," // {_z_} = 2.0/screenWidthInPixels"," // {__w} = 2.0/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt2,"," //"," // Only used on FXAA Console."," // Only used on 360 in place of fxaaConsoleRcpFrameOpt2."," // This must be from a constant/uniform."," // {x__} = 8.0/screenWidthInPixels"," // {_y_} = 8.0/screenHeightInPixels"," // {_z_} = -4.0/screenWidthInPixels"," // {__w} = -4.0/screenHeightInPixels"," FxaaFloat4 fxaaConsole360RcpFrameOpt2,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_SUBPIX define."," // It is here now to allow easier tuning."," // Choose the amount of sub-pixel aliasing removal."," // This can effect sharpness."," // 1.00 - upper limit (softer)"," // 0.75 - default amount of filtering"," // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)"," // 0.25 - almost off"," // 0.00 - completely off"," FxaaFloat fxaaQualitySubpix,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // The minimum amount of local contrast required to apply algorithm."," // 0.333 - too little (faster)"," // 0.250 - low quality"," // 0.166 - default"," // 0.125 - high quality"," // 0.063 - overkill (slower)"," FxaaFloat fxaaQualityEdgeThreshold,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // 0.0833 - upper limit (default, the start of visible unfiltered edges)"," // 0.0625 - high quality (faster)"," // 0.0312 - visible limit (slower)"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaQualityEdgeThresholdMin,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3."," // Due to the PS3 being ALU bound,"," // there are only three safe values here: 2 and 4 and 8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // For all other platforms can be a non-power of two."," // 8.0 is sharper (default!!!)"," // 4.0 is softer"," // 2.0 is really soft (good only for vector graphics inputs)"," FxaaFloat fxaaConsoleEdgeSharpness,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3."," // Due to the PS3 being ALU bound,"," // there are only two safe values here: 1/4 and 1/8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // The console setting has a different mapping than the quality setting."," // Other platforms can use other values."," // 0.125 leaves less aliasing, but is softer (default!!!)"," // 0.25 leaves more aliasing, and is sharper"," FxaaFloat fxaaConsoleEdgeThreshold,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // The console setting has a different mapping than the quality setting."," // This only applies when FXAA_EARLY_EXIT is 1."," // This does not apply to PS3,"," // PS3 was simplified to avoid more shader instructions."," // 0.06 - faster but more aliasing in darks"," // 0.05 - default"," // 0.04 - slower and less aliasing in darks"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaConsoleEdgeThresholdMin,"," //"," // Extra constants for 360 FXAA Console only."," // Use zeros or anything else for other platforms."," // These must be in physical constant registers and NOT immediates."," // Immediates will result in compiler un-optimizing."," // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)"," FxaaFloat4 fxaaConsole360ConstDir",") {","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posM;"," posM.x = pos.x;"," posM.y = pos.y;"," #if (FXAA_GATHER4_ALPHA == 1)"," #if (FXAA_DISCARD == 0)"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #endif"," #if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));"," #else"," FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));"," #endif"," #if (FXAA_DISCARD == 1)"," #define lumaM luma4A.w"," #endif"," #define lumaE luma4A.z"," #define lumaS luma4A.x"," #define lumaSE luma4A.y"," #define lumaNW luma4B.w"," #define lumaN luma4B.z"," #define lumaW luma4B.x"," #else"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));"," #endif"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat maxSM = max(lumaS, lumaM);"," FxaaFloat minSM = min(lumaS, lumaM);"," FxaaFloat maxESM = max(lumaE, maxSM);"," FxaaFloat minESM = min(lumaE, minSM);"," FxaaFloat maxWN = max(lumaN, lumaW);"," FxaaFloat minWN = min(lumaN, lumaW);"," FxaaFloat rangeMax = max(maxWN, maxESM);"," FxaaFloat rangeMin = min(minWN, minESM);"," FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;"," FxaaFloat range = rangeMax - rangeMin;"," FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);"," FxaaBool earlyExit = range < rangeMaxClamped;","/*--------------------------------------------------------------------------*/"," if(earlyExit)"," #if (FXAA_DISCARD == 1)"," FxaaDiscard;"," #else"," return rgbyM;"," #endif","/*--------------------------------------------------------------------------*/"," #if (FXAA_GATHER4_ALPHA == 0)"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif"," #else"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNS = lumaN + lumaS;"," FxaaFloat lumaWE = lumaW + lumaE;"," FxaaFloat subpixRcpRange = 1.0/range;"," FxaaFloat subpixNSWE = lumaNS + lumaWE;"," FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;"," FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNESE = lumaNE + lumaSE;"," FxaaFloat lumaNWNE = lumaNW + lumaNE;"," FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;"," FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNWSW = lumaNW + lumaSW;"," FxaaFloat lumaSWSE = lumaSW + lumaSE;"," FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);"," FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);"," FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;"," FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;"," FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;"," FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;","/*--------------------------------------------------------------------------*/"," FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;"," FxaaFloat lengthSign = fxaaQualityRcpFrame.x;"," FxaaBool horzSpan = edgeHorz >= edgeVert;"," FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;","/*--------------------------------------------------------------------------*/"," if(!horzSpan) lumaN = lumaW;"," if(!horzSpan) lumaS = lumaE;"," if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;"," FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;","/*--------------------------------------------------------------------------*/"," FxaaFloat gradientN = lumaN - lumaM;"," FxaaFloat gradientS = lumaS - lumaM;"," FxaaFloat lumaNN = lumaN + lumaM;"," FxaaFloat lumaSS = lumaS + lumaM;"," FxaaBool pairN = abs(gradientN) >= abs(gradientS);"," FxaaFloat gradient = max(abs(gradientN), abs(gradientS));"," if(pairN) lengthSign = -lengthSign;"," FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posB;"," posB.x = posM.x;"," posB.y = posM.y;"," FxaaFloat2 offNP;"," offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;"," offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;"," if(!horzSpan) posB.x += lengthSign * 0.5;"," if( horzSpan) posB.y += lengthSign * 0.5;","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posN;"," posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;"," posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;"," FxaaFloat2 posP;"," posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;"," posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;"," FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;"," FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));"," FxaaFloat subpixE = subpixC * subpixC;"," FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));","/*--------------------------------------------------------------------------*/"," if(!pairN) lumaNN = lumaSS;"," FxaaFloat gradientScaled = gradient * 1.0/4.0;"," FxaaFloat lumaMM = lumaM - lumaNN * 0.5;"," FxaaFloat subpixF = subpixD * subpixE;"," FxaaBool lumaMLTZero = lumaMM < 0.0;","/*--------------------------------------------------------------------------*/"," lumaEndN -= lumaNN * 0.5;"," lumaEndP -= lumaNN * 0.5;"," FxaaBool doneN = abs(lumaEndN) >= gradientScaled;"," FxaaBool doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;"," FxaaBool doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;","/*--------------------------------------------------------------------------*/"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 3)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 4)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 5)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 6)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 7)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 8)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 9)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 10)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 11)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 12)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }","/*--------------------------------------------------------------------------*/"," FxaaFloat dstN = posM.x - posN.x;"," FxaaFloat dstP = posP.x - posM.x;"," if(!horzSpan) dstN = posM.y - posN.y;"," if(!horzSpan) dstP = posP.y - posM.y;","/*--------------------------------------------------------------------------*/"," FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;"," FxaaFloat spanLength = (dstP + dstN);"," FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;"," FxaaFloat spanLengthRcp = 1.0/spanLength;","/*--------------------------------------------------------------------------*/"," FxaaBool directionN = dstN < dstP;"," FxaaFloat dst = min(dstN, dstP);"," FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;"," FxaaFloat subpixG = subpixF * subpixF;"," FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;"," FxaaFloat subpixH = subpixG * fxaaQualitySubpix;","/*--------------------------------------------------------------------------*/"," FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;"," FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);"," if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;"," if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;"," #if (FXAA_DISCARD == 1)"," return FxaaTexTop(tex, posM);"," #else"," return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);"," #endif","}","/*==========================================================================*/","#endif","","void main() {"," gl_FragColor = FxaaPixelShader("," vUv,"," vec4(0.0),"," tDiffuse,"," tDiffuse,"," tDiffuse,"," resolution,"," vec4(0.0),"," vec4(0.0),"," vec4(0.0),"," 0.75,"," 0.166,"," 0.0833,"," 0.0,"," 0.0,"," 0.0,"," vec4(0.0)"," );",""," // TODO avoid querying texture twice for same texel"," gl_FragColor.a = texture2D(tDiffuse, vUv).a;","}"].join("\n")},wu={defines:{SMAA_THRESHOLD:"0.1"},uniforms:{tDiffuse:{value:null},resolution:{value:new tt(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","void SMAAEdgeDetectionVS( vec2 texcoord ) {","\tvOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","\tvOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","\tvOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0, 2.0 );","}","void main() {","\tvUv = uv;","\tSMAAEdgeDetectionVS( vUv );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {","\tvec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );","\tvec4 delta;","\tvec3 C = texture2D( colorTex, texcoord ).rgb;","\tvec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;","\tvec3 t = abs( C - Cleft );","\tdelta.x = max( max( t.r, t.g ), t.b );","\tvec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;","\tt = abs( C - Ctop );","\tdelta.y = max( max( t.r, t.g ), t.b );","\tvec2 edges = step( threshold, delta.xy );","\tif ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )","\t\tdiscard;","\tvec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;","\tt = abs( C - Cright );","\tdelta.z = max( max( t.r, t.g ), t.b );","\tvec3 Cbottom = texture2D( colorTex, offset[1].zw ).rgb;","\tt = abs( C - Cbottom );","\tdelta.w = max( max( t.r, t.g ), t.b );","\tfloat maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );","\tvec3 Cleftleft = texture2D( colorTex, offset[2].xy ).rgb;","\tt = abs( C - Cleftleft );","\tdelta.z = max( max( t.r, t.g ), t.b );","\tvec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;","\tt = abs( C - Ctoptop );","\tdelta.w = max( max( t.r, t.g ), t.b );","\tmaxDelta = max( max( maxDelta, delta.z ), delta.w );","\tedges.xy *= step( 0.5 * maxDelta, delta.xy );","\treturn vec4( edges, 0.0, 0.0 );","}","void main() {","\tgl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );","}"].join("\n")},xu={defines:{SMAA_MAX_SEARCH_STEPS:"8",SMAA_AREATEX_MAX_DISTANCE:"16",SMAA_AREATEX_PIXEL_SIZE:"( 1.0 / vec2( 160.0, 560.0 ) )",SMAA_AREATEX_SUBTEX_SIZE:"( 1.0 / 7.0 )"},uniforms:{tDiffuse:{value:null},tArea:{value:null},tSearch:{value:null},resolution:{value:new tt(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","varying vec2 vPixcoord;","void SMAABlendingWeightCalculationVS( vec2 texcoord ) {","\tvPixcoord = texcoord / resolution;","\tvOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );","\tvOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );","\tvOffset[ 2 ] = vec4( vOffset[ 0 ].xz, vOffset[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );","}","void main() {","\tvUv = uv;","\tSMAABlendingWeightCalculationVS( vUv );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define SMAASampleLevelZeroOffset( tex, coord, offset ) texture2D( tex, coord + float( offset ) * resolution, 0.0 )","uniform sampler2D tDiffuse;","uniform sampler2D tArea;","uniform sampler2D tSearch;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[3];","varying vec2 vPixcoord;","#if __VERSION__ == 100","vec2 round( vec2 x ) {","\treturn sign( x ) * floor( abs( x ) + 0.5 );","}","#endif","float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {","\te.r = bias + e.r * scale;","\treturn 255.0 * texture2D( searchTex, e, 0.0 ).r;","}","float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","\tvec2 e = vec2( 0.0, 1.0 );","\tfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","\t\te = texture2D( edgesTex, texcoord, 0.0 ).rg;","\t\ttexcoord -= vec2( 2.0, 0.0 ) * resolution;","\t\tif ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;","\t}","\ttexcoord.x += 0.25 * resolution.x;","\ttexcoord.x += resolution.x;","\ttexcoord.x += 2.0 * resolution.x;","\ttexcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);","\treturn texcoord.x;","}","float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","\tvec2 e = vec2( 0.0, 1.0 );","\tfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","\t\te = texture2D( edgesTex, texcoord, 0.0 ).rg;","\t\ttexcoord += vec2( 2.0, 0.0 ) * resolution;","\t\tif ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;","\t}","\ttexcoord.x -= 0.25 * resolution.x;","\ttexcoord.x -= resolution.x;","\ttexcoord.x -= 2.0 * resolution.x;","\ttexcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );","\treturn texcoord.x;","}","float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","\tvec2 e = vec2( 1.0, 0.0 );","\tfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","\t\te = texture2D( edgesTex, texcoord, 0.0 ).rg;","\t\ttexcoord += vec2( 0.0, 2.0 ) * resolution;","\t\tif ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;","\t}","\ttexcoord.y -= 0.25 * resolution.y;","\ttexcoord.y -= resolution.y;","\ttexcoord.y -= 2.0 * resolution.y;","\ttexcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );","\treturn texcoord.y;","}","float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","\tvec2 e = vec2( 1.0, 0.0 );","\tfor ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","\t\te = texture2D( edgesTex, texcoord, 0.0 ).rg;","\t\ttexcoord -= vec2( 0.0, 2.0 ) * resolution;","\t\tif ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;","\t}","\ttexcoord.y += 0.25 * resolution.y;","\ttexcoord.y += resolution.y;","\ttexcoord.y += 2.0 * resolution.y;","\ttexcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );","\treturn texcoord.y;","}","vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {","\tvec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;","\ttexcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );","\ttexcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;","\treturn texture2D( areaTex, texcoord, 0.0 ).rg;","}","vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {","\tvec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );","\tvec2 e = texture2D( edgesTex, texcoord ).rg;","\tif ( e.g > 0.0 ) {","\t\tvec2 d;","\t\tvec2 coords;","\t\tcoords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );","\t\tcoords.y = offset[ 1 ].y;","\t\td.x = coords.x;","\t\tfloat e1 = texture2D( edgesTex, coords, 0.0 ).r;","\t\tcoords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );","\t\td.y = coords.x;","\t\td = d / resolution.x - pixcoord.x;","\t\tvec2 sqrt_d = sqrt( abs( d ) );","\t\tcoords.y -= 1.0 * resolution.y;","\t\tfloat e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;","\t\tweights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );","\t}","\tif ( e.r > 0.0 ) {","\t\tvec2 d;","\t\tvec2 coords;","\t\tcoords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );","\t\tcoords.x = offset[ 0 ].x;","\t\td.x = coords.y;","\t\tfloat e1 = texture2D( edgesTex, coords, 0.0 ).g;","\t\tcoords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );","\t\td.y = coords.y;","\t\td = d / resolution.y - pixcoord.y;","\t\tvec2 sqrt_d = sqrt( abs( d ) );","\t\tcoords.y -= 1.0 * resolution.y;","\t\tfloat e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;","\t\tweights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );","\t}","\treturn weights;","}","void main() {","\tgl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );","}"].join("\n")},bu={uniforms:{tDiffuse:{value:null},tColor:{value:null},resolution:{value:new tt(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","void SMAANeighborhoodBlendingVS( vec2 texcoord ) {","\tvOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","\tvOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","}","void main() {","\tvUv = uv;","\tSMAANeighborhoodBlendingVS( vUv );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform sampler2D tColor;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {","\tvec4 a;","\ta.xz = texture2D( blendTex, texcoord ).xz;","\ta.y = texture2D( blendTex, offset[ 1 ].zw ).g;","\ta.w = texture2D( blendTex, offset[ 1 ].xy ).a;","\tif ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {","\t\treturn texture2D( colorTex, texcoord, 0.0 );","\t} else {","\t\tvec2 offset;","\t\toffset.x = a.a > a.b ? a.a : -a.b;","\t\toffset.y = a.g > a.r ? -a.g : a.r;","\t\tif ( abs( offset.x ) > abs( offset.y )) {","\t\t\toffset.y = 0.0;","\t\t} else {","\t\t\toffset.x = 0.0;","\t\t}","\t\tvec4 C = texture2D( colorTex, texcoord, 0.0 );","\t\ttexcoord += sign( offset ) * resolution;","\t\tvec4 Cop = texture2D( colorTex, texcoord, 0.0 );","\t\tfloat s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );","\t\tC.xyz = pow(C.xyz, vec3(2.2));","\t\tCop.xyz = pow(Cop.xyz, vec3(2.2));","\t\tvec4 mixed = mix(C, Cop, s);","\t\tmixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));","\t\treturn mixed;","\t}","}","void main() {","\tgl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );","}"].join("\n")},Mu=function(e,t){hu.call(this),this.edgesRT=new dt(e,t,{depthBuffer:!1,generateMipmaps:!1,minFilter:Z,format:Ae}),this.edgesRT.texture.name="SMAAPass.edges",this.weightsRT=new dt(e,t,{depthBuffer:!1,generateMipmaps:!1,minFilter:Z,format:ce}),this.weightsRT.texture.name="SMAAPass.weights";var n,i,r=this;(n=new Image).src=this.getAreaTexture(),n.onload=function(){r.areaTexture.needsUpdate=!0},this.areaTexture=new ht,this.areaTexture.name="SMAAPass.area",this.areaTexture.image=n,this.areaTexture.format=Ae,this.areaTexture.minFilter=Z,this.areaTexture.generateMipmaps=!1,this.areaTexture.flipY=!1,(i=new Image).src=this.getSearchTexture(),i.onload=function(){r.searchTexture.needsUpdate=!0},this.searchTexture=new ht,this.searchTexture.name="SMAAPass.search",this.searchTexture.image=i,this.searchTexture.magFilter=X,this.searchTexture.minFilter=X,this.searchTexture.generateMipmaps=!1,this.searchTexture.flipY=!1,void 0===wu&&console.error("SMAAPass relies on SMAAShader"),this.uniformsEdges=Di.clone(wu.uniforms),this.uniformsEdges.resolution.value.set(1/e,1/t),this.materialEdges=new Ri({defines:Object.assign({},wu.defines),uniforms:this.uniformsEdges,vertexShader:wu.vertexShader,fragmentShader:wu.fragmentShader}),this.uniformsWeights=Di.clone(xu.uniforms),this.uniformsWeights.resolution.value.set(1/e,1/t),this.uniformsWeights.tDiffuse.value=this.edgesRT.texture,this.uniformsWeights.tArea.value=this.areaTexture,this.uniformsWeights.tSearch.value=this.searchTexture,this.materialWeights=new Ri({defines:Object.assign({},xu.defines),uniforms:this.uniformsWeights,vertexShader:xu.vertexShader,fragmentShader:xu.fragmentShader}),this.uniformsBlend=Di.clone(bu.uniforms),this.uniformsBlend.resolution.value.set(1/e,1/t),this.uniformsBlend.tDiffuse.value=this.weightsRT.texture,this.materialBlend=new Ri({uniforms:this.uniformsBlend,vertexShader:bu.vertexShader,fragmentShader:bu.fragmentShader}),this.needsSwap=!1,this.fsQuad=new hu.FullScreenQuad(null)};Mu.prototype=Object.assign(Object.create(hu.prototype),{constructor:Mu,render:function(e,t,n){this.uniformsEdges.tDiffuse.value=n.texture,this.fsQuad.material=this.materialEdges,e.setRenderTarget(this.edgesRT),this.clear&&e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.materialWeights,e.setRenderTarget(this.weightsRT),this.clear&&e.clear(),this.fsQuad.render(e),this.uniformsBlend.tColor.value=n.texture,this.fsQuad.material=this.materialBlend,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))},setSize:function(e,t){this.edgesRT.setSize(e,t),this.weightsRT.setSize(e,t),this.materialEdges.uniforms.resolution.value.set(1/e,1/t),this.materialWeights.uniforms.resolution.value.set(1/e,1/t),this.materialBlend.uniforms.resolution.value.set(1/e,1/t)},getAreaTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAIAAACOVPcQAACBeklEQVR42u39W4xlWXrnh/3WWvuciIzMrKxrV8/0rWbY0+SQFKcb4owIkSIFCjY9AC1BT/LYBozRi+EX+cV+8IMsYAaCwRcBwjzMiw2jAWtgwC8WR5Q8mDFHZ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z0Bw2H/C2Smc7+WGB0HWDELBmOByA3r5QONo4V+DpzR/hFS4U8wMW1PXNB4TOqYz9urxRV++ntWCw/U59Ty9ebdWbrgfRS9AYKKN63ZokZVygr8GZ/gfIhZXIXPsAlNjPOLBby5c1eOLvmQ9lwkOy5x6QV1j5TYqpS05JtUgUHUp5toHGsVfn4NX4RnMCe+AxTpwmApTYxqMxwfCeJGjpXzRF61nbcHhUBPqWze9svwcHJ+S6NPscKrEjug78Dx8Lj3T8D4YxGIdxmJcwhi34fzZUr7olevZCw5vkOhoClq5zBPZAnygD/Tl9EzDh6kl3VhsHYcDEb+hCtJSvuiV69kLDm+WycrOTArHmB5/VYyP6jOVjwgGawk2zQOaTcc1L+aLXrKeveDwZqlKrw8U9Y1p66uK8dEzdYwBeUQAY7DbyYNezBfdWQ97weEtAKYQg2xJIkuveAT3dYeLGH+ShrWNwZgN0b2YL7qznr3g8JYAo5bQBziPjx7BPZ0d9RCQp4UZbnFdzBddor4XHN4KYMrB2qHFRIzzcLAHQZ5the5ovui94PCWAPefaYnxIdzRwdHCbuR4B+tbiy96Lzi8E4D7z7S0mEPd+eqO3cT53Z0Y8SV80XvB4Z0ADJi/f7X113f+7p7/+UYBvur6657/+YYBvur6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+VMA8FXWX/f8z58OgK+y/rrnf75RgLna+uue//lTA/CV1V/3/M837aKvvv6653++UQvmauuve/7nTwfAV1N/3fM/fzr24Cuuv+75nz8FFnxl9dc9//MOr/8/glixwRuUfM4AAAAASUVORK5CYII="},getSearchTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII="}});var Cu=A((function e(){s(this,e)}));Cu.FXAA="FXAA",Cu.SMAA="SMAA",Cu.MSAA="MSAA",Cu.SSAA="SSAA";var Bu=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,e),this.options=t,this.pass={enabled:!0},this.antiAliasing=t.antialias||Cu.FXAA,this.isPostProcessing=!0}return A(e,[{key:"init",value:function(){}},{key:"render",value:function(){}},{key:"enabled",get:function(){this.pass.enabled},set:function(e){this.pass.enabled=e}},{key:"setSize",value:function(e,t){}}]),e}(),Eu=function(e,t,n,i){this.renderScene=t,this.renderCamera=n,this.selectedObjects=void 0!==i?i:[],this.visibleEdgeColor=new Fn(1,1,1),this.hiddenEdgeColor=new Fn(.1,.04,.02),this.edgeGlow=0,this.usePatternTexture=!1,this.edgeThickness=1,this.edgeStrength=3,this.downSampleRatio=2,this.pulsePeriod=0,hu.call(this),this.resolution=void 0!==e?new tt(e.x,e.y):new tt(256,256);var r={minFilter:Z,magFilter:Z,format:ce},a=Math.round(this.resolution.x/this.downSampleRatio),o=Math.round(this.resolution.y/this.downSampleRatio);this.maskBufferMaterial=new Nn({color:16777215}),this.maskBufferMaterial.side=2,this.renderTargetMaskBuffer=new dt(this.resolution.x,this.resolution.y,r),this.renderTargetMaskBuffer.texture.name="OutlinePass.mask",this.renderTargetMaskBuffer.texture.generateMipmaps=!1,this.depthMaterial=new Ra,this.depthMaterial.side=2,this.depthMaterial.depthPacking=je,this.depthMaterial.blending=0,this.prepareMaskMaterial=this.getPrepareMaskMaterial(),this.prepareMaskMaterial.side=2,this.prepareMaskMaterial.fragmentShader=function(e,t){var n=t.isPerspectiveCamera?"perspective":"orthographic";return e.replace(/DEPTH_TO_VIEW_Z/g,n+"DepthToViewZ")}(this.prepareMaskMaterial.fragmentShader,this.renderCamera),this.renderTargetDepthBuffer=new dt(this.resolution.x,this.resolution.y,r),this.renderTargetDepthBuffer.texture.name="OutlinePass.depth",this.renderTargetDepthBuffer.texture.generateMipmaps=!1,this.renderTargetMaskDownSampleBuffer=new dt(a,o,r),this.renderTargetMaskDownSampleBuffer.texture.name="OutlinePass.depthDownSample",this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps=!1,this.renderTargetBlurBuffer1=new dt(a,o,r),this.renderTargetBlurBuffer1.texture.name="OutlinePass.blur1",this.renderTargetBlurBuffer1.texture.generateMipmaps=!1,this.renderTargetBlurBuffer2=new dt(Math.round(a/2),Math.round(o/2),r),this.renderTargetBlurBuffer2.texture.name="OutlinePass.blur2",this.renderTargetBlurBuffer2.texture.generateMipmaps=!1,this.edgeDetectionMaterial=this.getEdgeDetectionMaterial(),this.renderTargetEdgeBuffer1=new dt(a,o,r),this.renderTargetEdgeBuffer1.texture.name="OutlinePass.edge1",this.renderTargetEdgeBuffer1.texture.generateMipmaps=!1,this.renderTargetEdgeBuffer2=new dt(Math.round(a/2),Math.round(o/2),r),this.renderTargetEdgeBuffer2.texture.name="OutlinePass.edge2",this.renderTargetEdgeBuffer2.texture.generateMipmaps=!1;this.separableBlurMaterial1=this.getSeperableBlurMaterial(4),this.separableBlurMaterial1.uniforms.texSize.value=new tt(a,o),this.separableBlurMaterial1.uniforms.kernelRadius.value=1,this.separableBlurMaterial2=this.getSeperableBlurMaterial(4),this.separableBlurMaterial2.uniforms.texSize.value=new tt(Math.round(a/2),Math.round(o/2)),this.separableBlurMaterial2.uniforms.kernelRadius.value=4,this.overlayMaterial=this.getOverlayMaterial(),void 0===du&&console.error("OutlinePass relies on CopyShader");var s=du;this.copyUniforms=Di.clone(s.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new Ri({uniforms:this.copyUniforms,vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,blending:0,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this.oldClearColor=new Fn,this.oldClearAlpha=1,this.fsQuad=new hu.FullScreenQuad(null),this.tempPulseColor1=new Fn,this.tempPulseColor2=new Fn,this.textureMatrix=new bt};Eu.prototype=Object.assign(Object.create(hu.prototype),{constructor:Eu,dispose:function(){this.renderTargetMaskBuffer.dispose(),this.renderTargetDepthBuffer.dispose(),this.renderTargetMaskDownSampleBuffer.dispose(),this.renderTargetBlurBuffer1.dispose(),this.renderTargetBlurBuffer2.dispose(),this.renderTargetEdgeBuffer1.dispose(),this.renderTargetEdgeBuffer2.dispose()},setSize:function(e,t){this.renderTargetMaskBuffer.setSize(e,t);var n=Math.round(e/this.downSampleRatio),i=Math.round(t/this.downSampleRatio);this.renderTargetMaskDownSampleBuffer.setSize(n,i),this.renderTargetBlurBuffer1.setSize(n,i),this.renderTargetEdgeBuffer1.setSize(n,i),this.separableBlurMaterial1.uniforms.texSize.value=new tt(n,i),n=Math.round(n/2),i=Math.round(i/2),this.renderTargetBlurBuffer2.setSize(n,i),this.renderTargetEdgeBuffer2.setSize(n,i),this.separableBlurMaterial2.uniforms.texSize.value=new tt(n,i)},changeVisibilityOfSelectedObjects:function(e){function t(t){t.isMesh&&(e?(t.visible=t.userData.oldVisible,delete t.userData.oldVisible):(t.userData.oldVisible=t.visible,t.visible=e))}for(var n=0;n<this.selectedObjects.length;n++){this.selectedObjects[n].traverse(t)}},changeVisibilityOfNonSelectedObjects:function(e){var t=[];function n(e){e.isMesh&&t.push(e)}for(var i=0;i<this.selectedObjects.length;i++){this.selectedObjects[i].traverse(n)}this.renderScene.traverse((function(n){if(n.isMesh||n.isLine||n.isSprite){for(var i=!1,r=0;r<t.length;r++){if(t[r].id===n.id){i=!0;break}}if(!i){var a=n.visible;e&&!n.bVisible||(n.visible=e),n.bVisible=a}}}))},updateTextureMatrix:function(){this.textureMatrix.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),this.textureMatrix.multiply(this.renderCamera.projectionMatrix),this.textureMatrix.multiply(this.renderCamera.matrixWorldInverse)},toggleVisibleOfSelectedObjects:function(e){e?this.selectedObjects.map((function(e){(e.isMesh||e.isLine||e.isSprite)&&(e.__visible=e.visible,e.visible=!0)})):this.selectedObjects.map((function(e){(e.isMesh||e.isLine||e.isSprite)&&(e.visible=e.__visible,delete e.__visible)}))},render:function(e,t,n,i,r){if(this.selectedObjects.length>0){this.showTransform=!1,this.renderScene.getObjectByName("ObjectControls")&&this.renderScene.getObjectByName("ObjectControls").visible&&(this.showTransform=!0,this.renderScene.getObjectByName("ObjectControls").visible=!1),this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var a=e.autoClear;e.autoClear=!1,r&&e.state.buffers.stencil.setTest(!1),e.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);var o=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,e.setRenderTarget(this.renderTargetDepthBuffer),e.clear(),e.render(this.renderScene,this.renderCamera),this.changeVisibilityOfSelectedObjects(!0),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value=new tt(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.setRenderTarget(this.renderTargetMaskBuffer),e.clear(),this.toggleVisibleOfSelectedObjects(!0),e.render(this.renderScene,this.renderCamera),this.toggleVisibleOfSelectedObjects(!1),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this.renderScene.background=o,this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.setRenderTarget(this.renderTargetMaskDownSampleBuffer),e.clear(),this.fsQuad.render(e),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){var s=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(s),this.tempPulseColor2.multiplyScalar(s)}this.fsQuad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value=new tt(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=Eu.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.setRenderTarget(this.renderTargetBlurBuffer1),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=Eu.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=Eu.BlurDirectionX,e.setRenderTarget(this.renderTargetBlurBuffer2),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=Eu.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer2),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,r&&e.state.buffers.stencil.setTest(!0),e.setRenderTarget(n),this.fsQuad.render(e),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=a}this.renderToScreen&&(this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=n.texture,e.setRenderTarget(null),this.fsQuad.render(e)),this.showTransform&&(this.renderScene.getObjectByName("ObjectControls").visible=!0)},getPrepareMaskMaterial:function(){return new Ri({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new tt(.5,.5)},textureMatrix:{value:new bt}},vertexShader:["varying vec4 projTexCoord;","varying vec4 vPosition;","uniform mat4 textureMatrix;","void main() {","\tvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tprojTexCoord = textureMatrix * worldPosition;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <packing>","varying vec4 vPosition;","varying vec4 projTexCoord;","uniform sampler2D depthTexture;","uniform vec2 cameraNearFar;","void main() {","\tfloat depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));","\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );","\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;","\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);","}"].join("\n")})},getEdgeDetectionMaterial:function(){return new Ri({uniforms:{maskTexture:{value:null},texSize:{value:new tt(.5,.5)},visibleEdgeColor:{value:new at(1,1,1)},hiddenEdgeColor:{value:new at(1,1,1)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec3 visibleEdgeColor;\t\t\t\tuniform vec3 hiddenEdgeColor;\t\t\t\t\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\t\t\t\t}"})},getSeperableBlurMaterial:function(e){return new Ri({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new tt(.5,.5)},direction:{value:new tt(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include <common>\t\t\t\tvarying vec2 vUv;\t\t\t\tuniform sampler2D colorTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\tuniform float kernelRadius;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, kernelRadius);\t\t\t\t\tvec4 diffuseSum = texture2D( colorTexture, vUv) * weightSum;\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\t\t\t\t\tvec2 uvOffset = delta;\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\t\t\t\t\t\tfloat w = gaussianPdf(uvOffset.x, kernelRadius);\t\t\t\t\t\tvec4 sample1 = texture2D( colorTexture, vUv + uvOffset);\t\t\t\t\t\tvec4 sample2 = texture2D( colorTexture, vUv - uvOffset);\t\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\t\t\t\t\t\tweightSum += (2.0 * w);\t\t\t\t\t\tuvOffset += delta;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = diffuseSum/weightSum;\t\t\t\t}"})},getOverlayMaterial:function(){return new Ri({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform sampler2D edgeTexture1;\t\t\t\tuniform sampler2D edgeTexture2;\t\t\t\tuniform sampler2D patternTexture;\t\t\t\tuniform float edgeStrength;\t\t\t\tuniform float edgeGlow;\t\t\t\tuniform bool usePatternTexture;\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\t\t\t\t\tif(usePatternTexture)\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\t\t\t\t\tgl_FragColor = finalColor;\t\t\t\t}",blending:2,depthTest:!1,depthWrite:!1,transparent:!0})}}),Eu.BlurDirectionX=new tt(1,0),Eu.BlurDirectionY=new tt(0,1);var Su=function(e,t,n,i){this.renderScene=t,this.renderCamera=n,this.selectedObjects=void 0!==i?i:[],this.visibleEdgeColor=new Fn(1,1,1),this.hiddenEdgeColor=new Fn(.1,.04,.02),this.edgeGlow=0,this.usePatternTexture=!1,this.edgeThickness=1,this.edgeStrength=3,this.downSampleRatio=2,this.pulsePeriod=0,hu.call(this),this.resolution=void 0!==e?new tt(e.x,e.y):new tt(256,256);var r={minFilter:Z,magFilter:Z,format:ce},a=Math.round(this.resolution.x/this.downSampleRatio),o=Math.round(this.resolution.y/this.downSampleRatio);this.renderTargetMaskBuffer=new dt(this.resolution.x,this.resolution.y,r),this.renderTargetMaskBuffer.texture.name="OutlinePass.mask",this.renderTargetMaskBuffer.texture.generateMipmaps=!1,this.prepareMaskMaterial=this.getPrepareMaskMaterial(),this.prepareMaskMaterial.side=2,this.prepareMaskMaterial.fragmentShader=function(e,t){var n=t.isPerspectiveCamera?"perspective":"orthographic";return e.replace(/DEPTH_TO_VIEW_Z/g,n+"DepthToViewZ")}(this.prepareMaskMaterial.fragmentShader,this.renderCamera),this.renderTargetMaskDownSampleBuffer=new dt(a,o,r),this.renderTargetMaskDownSampleBuffer.texture.name="OutlinePass.depthDownSample",this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps=!1,this.renderTargetBlurBuffer1=new dt(a,o,r),this.renderTargetBlurBuffer1.texture.name="OutlinePass.blur1",this.renderTargetBlurBuffer1.texture.generateMipmaps=!1,this.renderTargetBlurBuffer2=new dt(Math.round(a/2),Math.round(o/2),r),this.renderTargetBlurBuffer2.texture.name="OutlinePass.blur2",this.renderTargetBlurBuffer2.texture.generateMipmaps=!1,this.edgeDetectionMaterial=this.getEdgeDetectionMaterial(),this.renderTargetEdgeBuffer1=new dt(a,o,r),this.renderTargetEdgeBuffer1.texture.name="OutlinePass.edge1",this.renderTargetEdgeBuffer1.texture.generateMipmaps=!1,this.renderTargetEdgeBuffer2=new dt(Math.round(a/2),Math.round(o/2),r),this.renderTargetEdgeBuffer2.texture.name="OutlinePass.edge2",this.renderTargetEdgeBuffer2.texture.generateMipmaps=!1;this.separableBlurMaterial1=this.getSeperableBlurMaterial(4),this.separableBlurMaterial1.uniforms.texSize.value=new tt(a,o),this.separableBlurMaterial1.uniforms.kernelRadius.value=1,this.separableBlurMaterial2=this.getSeperableBlurMaterial(4),this.separableBlurMaterial2.uniforms.texSize.value=new tt(Math.round(a/2),Math.round(o/2)),this.separableBlurMaterial2.uniforms.kernelRadius.value=4,this.overlayMaterial=this.getOverlayMaterial(),void 0===du&&console.error("OutlinePass relies on CopyShader");var s=du;this.copyUniforms=Di.clone(s.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new Ri({uniforms:this.copyUniforms,vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,blending:0,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this.oldClearColor=new Fn,this.oldClearAlpha=1,this.fsQuad=new hu.FullScreenQuad(null),this.tempPulseColor1=new Fn,this.tempPulseColor2=new Fn,this.textureMatrix=new bt};Su.prototype=Object.assign(Object.create(hu.prototype),{constructor:Su,dispose:function(){this.renderTargetMaskBuffer.dispose(),this.renderTargetMaskDownSampleBuffer.dispose(),this.renderTargetBlurBuffer1.dispose(),this.renderTargetBlurBuffer2.dispose(),this.renderTargetEdgeBuffer1.dispose(),this.renderTargetEdgeBuffer2.dispose()},setSize:function(e,t){this.renderTargetMaskBuffer.setSize(e,t);var n=Math.round(e/this.downSampleRatio),i=Math.round(t/this.downSampleRatio);this.renderTargetMaskDownSampleBuffer.setSize(n,i),this.renderTargetBlurBuffer1.setSize(n,i),this.renderTargetEdgeBuffer1.setSize(n,i),this.separableBlurMaterial1.uniforms.texSize.value=new tt(n,i),n=Math.round(n/2),i=Math.round(i/2),this.renderTargetBlurBuffer2.setSize(n,i),this.renderTargetEdgeBuffer2.setSize(n,i),this.separableBlurMaterial2.uniforms.texSize.value=new tt(n,i)},changeVisibilityOfSelectedObjects:function(e){function t(t){t.isMesh&&(e?(t.visible=t.userData.oldVisible,delete t.userData.oldVisible):(t.userData.oldVisible=t.visible,t.visible=e))}for(var n=0;n<this.selectedObjects.length;n++){this.selectedObjects[n].traverse(t)}},changeVisibilityOfNonSelectedObjects:function(e){var t=[];function n(e){e.isMesh&&t.push(e)}for(var i=0;i<this.selectedObjects.length;i++){this.selectedObjects[i].traverse(n)}this.renderScene.traverse((function(n){if(n.isMesh||n.isLine||n.isSprite){for(var i=!1,r=0;r<t.length;r++){if(t[r].id===n.id){i=!0;break}}if(!i){var a=n.visible;e&&!n.bVisible||(n.visible=e),n.bVisible=a}}}))},updateTextureMatrix:function(){this.textureMatrix.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),this.textureMatrix.multiply(this.renderCamera.projectionMatrix),this.textureMatrix.multiply(this.renderCamera.matrixWorldInverse)},render:function(e,t,n,i,r){if(this.selectedObjects.length>0){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var a=e.autoClear;e.autoClear=!1,r&&e.state.buffers.stencil.setTest(!1),e.setClearColor(16777215,1);var o=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.prepareMaskMaterial,e.setRenderTarget(this.renderTargetMaskBuffer),e.clear(),e.renderArray(this.selectedObjects,this.renderScene,this.renderCamera),this.renderScene.overrideMaterial=null,this.renderScene.background=o,this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.setRenderTarget(this.renderTargetMaskDownSampleBuffer),e.clear(),this.fsQuad.render(e),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){var s=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(s),this.tempPulseColor2.multiplyScalar(s)}this.fsQuad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value=new tt(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=Su.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.setRenderTarget(this.renderTargetBlurBuffer1),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=Su.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=Su.BlurDirectionX,e.setRenderTarget(this.renderTargetBlurBuffer2),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=Su.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer2),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,r&&e.state.buffers.stencil.setTest(!0),e.setRenderTarget(n),this.fsQuad.render(e),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=a}this.renderToScreen&&(this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=n.texture,e.setRenderTarget(null),this.fsQuad.render(e)),this.showTransform&&(this.renderScene.getObjectByName("ObjectControls").visible=!0)},getPrepareMaskMaterial:function(){return new Ri({uniforms:{},vertexShader:["#include <amrt_skinning_pars_vertex>","void main() {","\t#include <begin_vertex>","\t#include <amrt_skinbase_vertex>","\t#include <amrt_skinning_vertex>","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( transformed, 1.0 );","}"].join("\n"),fragmentShader:["void main() {","\tgl_FragColor = vec4(0.0, 0.0, 1.0, 1.0);","}"].join("\n")})},getEdgeDetectionMaterial:function(){return new Ri({uniforms:{maskTexture:{value:null},texSize:{value:new tt(.5,.5)},visibleEdgeColor:{value:new at(1,1,1)},hiddenEdgeColor:{value:new at(1,1,1)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec3 visibleEdgeColor;\t\t\t\tuniform vec3 hiddenEdgeColor;\t\t\t\t\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\t\t\t\t}"})},getSeperableBlurMaterial:function(e){return new Ri({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new tt(.5,.5)},direction:{value:new tt(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include <common>\t\t\t\tvarying vec2 vUv;\t\t\t\tuniform sampler2D colorTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\tuniform float kernelRadius;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, kernelRadius);\t\t\t\t\tvec4 diffuseSum = texture2D( colorTexture, vUv) * weightSum;\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\t\t\t\t\tvec2 uvOffset = delta;\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\t\t\t\t\t\tfloat w = gaussianPdf(uvOffset.x, kernelRadius);\t\t\t\t\t\tvec4 sample1 = texture2D( colorTexture, vUv + uvOffset);\t\t\t\t\t\tvec4 sample2 = texture2D( colorTexture, vUv - uvOffset);\t\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\t\t\t\t\t\tweightSum += (2.0 * w);\t\t\t\t\t\tuvOffset += delta;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = diffuseSum/weightSum;\t\t\t\t}"})},getOverlayMaterial:function(){return new Ri({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform sampler2D edgeTexture1;\t\t\t\tuniform sampler2D edgeTexture2;\t\t\t\tuniform sampler2D patternTexture;\t\t\t\tuniform float edgeStrength;\t\t\t\tuniform float edgeGlow;\t\t\t\tuniform bool usePatternTexture;\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\t\t\t\t\tif(usePatternTexture)\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\t\t\t\t\tgl_FragColor = finalColor;\t\t\t\t}",blending:2,depthTest:!1,depthWrite:!1,transparent:!0})}}),Su.BlurDirectionX=new tt(1,0),Su.BlurDirectionY=new tt(0,1);var Tu=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),(i=t.call(this,e)).antiAliasing=Cu.SMAA,i.selectedColor=e.color||"#fff709",i.objects=[],null==e.strength&&(e.strength=6.5),null==e.glow&&(e.glow=1),null==e.thickness&&(e.thickness=2),i}return A(n,[{key:"init",value:function(e){this.pass=new Su(new tt(e.width,e.height),e.scene,e.camera),this.pass.edgeStrength=this.options.strength,this.pass.edgeGlow=this.options.glow,this.pass.edgeThickness=this.options.thickness,this.pass.visibleEdgeColor.set(this.selectedColor),this.pass.hiddenEdgeColor.set(this.selectedColor),this.pass.downSampleRatio=window.devicePixelRatio,this.pass.selectedObjects=this.objects,b(u(n.prototype),"init",this).call(this)}},{key:"add",value:function(e){var t=this;this.objects.includes(e)||(this.objects.push(e),e.traverse((function(e){e.isMesh&&!t.pass.selectedObjects.includes(e)&&t.pass.selectedObjects.push(e)})))}},{key:"remove",value:function(e){if(this.objects.includes(e)){this.objects.splice(this.objects.indexOf(e),1);var t=[];e.traverse((function(e){e.isMesh&&t.push(e)}));for(var n=this.pass.selectedObjects.length-1;n>=0;n--)t.includes(this.pass.selectedObjects[n])&&this.pass.selectedObjects.splice(n,1)}}},{key:"clear",value:function(){this.objects=[],this.pass.selectedObjects&&(this.pass.selectedObjects=[])}}]),n}(Bu),_u={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new Fn(0)},defaultOpacity:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 defaultColor;","uniform float defaultOpacity;","uniform float luminosityThreshold;","uniform float smoothWidth;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tvec3 luma = vec3( 0.299, 0.587, 0.114 );","\tfloat v = dot( texel.xyz, luma );","\tvec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );","\tfloat alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );","\tgl_FragColor = mix( outputColor, texel, alpha );","}"].join("\n")},Iu=function(e,t,n,i){hu.call(this),this.strength=void 0!==t?t:1,this.radius=n,this.threshold=i,this.resolution=void 0!==e?new tt(e.x,e.y):new tt(256,256),this.clearColor=new Fn(0,0,0);var r={minFilter:Z,magFilter:Z,format:ce};this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;var a=Math.round(this.resolution.x/2),o=Math.round(this.resolution.y/2);this.renderTargetBright=new dt(a,o,r),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(var s=0;s<this.nMips;s++){var l=new dt(a,o,r);l.texture.name="UnrealBloomPass.h"+s,l.texture.generateMipmaps=!1,this.renderTargetsHorizontal.push(l);var A=new dt(a,o,r);A.texture.name="UnrealBloomPass.v"+s,A.texture.generateMipmaps=!1,this.renderTargetsVertical.push(A),a=Math.round(a/2),o=Math.round(o/2)}void 0===_u&&console.error("UnrealBloomPass relies on LuminosityHighPassShader");var c=_u;this.highPassUniforms=Di.clone(c.uniforms),this.highPassUniforms.luminosityThreshold.value=i,this.highPassUniforms.smoothWidth.value=.01,this.materialHighPassFilter=new Ri({uniforms:this.highPassUniforms,vertexShader:c.vertexShader,fragmentShader:c.fragmentShader,defines:{}}),this.separableBlurMaterials=[];var h=[3,5,7,9,11];for(a=Math.round(this.resolution.x/2),o=Math.round(this.resolution.y/2),s=0;s<this.nMips;s++)this.separableBlurMaterials.push(this.getSeperableBlurMaterial(h[s])),this.separableBlurMaterials[s].uniforms.texSize.value=new tt(a,o),a=Math.round(a/2),o=Math.round(o/2);this.compositeMaterial=this.getCompositeMaterial(this.nMips),this.compositeMaterial.uniforms.blurTexture1.value=this.renderTargetsVertical[0].texture,this.compositeMaterial.uniforms.blurTexture2.value=this.renderTargetsVertical[1].texture,this.compositeMaterial.uniforms.blurTexture3.value=this.renderTargetsVertical[2].texture,this.compositeMaterial.uniforms.blurTexture4.value=this.renderTargetsVertical[3].texture,this.compositeMaterial.uniforms.blurTexture5.value=this.renderTargetsVertical[4].texture,this.compositeMaterial.uniforms.bloomStrength.value=t,this.compositeMaterial.uniforms.bloomRadius.value=.1,this.compositeMaterial.needsUpdate=!0;this.compositeMaterial.uniforms.bloomFactors.value=[1,.8,.6,.4,.2],this.bloomTintColors=[new at(1,1,1),new at(1,1,1),new at(1,1,1),new at(1,1,1),new at(1,1,1)],this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,void 0===du&&console.error("UnrealBloomPass relies on CopyShader");var u=du;this.copyUniforms=Di.clone(u.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new Ri({uniforms:this.copyUniforms,vertexShader:u.vertexShader,fragmentShader:u.fragmentShader}),this.enabled=!0,this.needsSwap=!1,this.oldClearColor=new Fn,this.oldClearAlpha=1,this.basic=new Nn,this.fsQuad=new hu.FullScreenQuad(null)};Iu.prototype=Object.assign(Object.create(hu.prototype),{constructor:Iu,dispose:function(){for(var e=0;e<this.renderTargetsHorizontal.length;e++)this.renderTargetsHorizontal[e].dispose();for(e=0;e<this.renderTargetsVertical.length;e++)this.renderTargetsVertical[e].dispose();this.renderTargetBright.dispose()},setSize:function(e,t){var n=Math.round(e/2),i=Math.round(t/2);this.renderTargetBright.setSize(n,i);for(var r=0;r<this.nMips;r++)this.renderTargetsHorizontal[r].setSize(n,i),this.renderTargetsVertical[r].setSize(n,i),this.separableBlurMaterials[r].uniforms.texSize.value=new tt(n,i),n=Math.round(n/2),i=Math.round(i/2)},render:function(e,t,n,i,r){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var a=e.autoClear;e.autoClear=!1,e.setClearColor(this.clearColor,0),r&&e.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=n.texture,e.setRenderTarget(null),e.clear(),this.fsQuad.render(e)),this.highPassUniforms.tDiffuse.value=n.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,e.setRenderTarget(this.renderTargetBright),e.clear(),this.fsQuad.render(e);for(var o=this.renderTargetBright,s=0;s<this.nMips;s++)this.fsQuad.material=this.separableBlurMaterials[s],this.separableBlurMaterials[s].uniforms.colorTexture.value=o.texture,this.separableBlurMaterials[s].uniforms.direction.value=Iu.BlurDirectionX,e.setRenderTarget(this.renderTargetsHorizontal[s]),e.clear(),this.fsQuad.render(e),this.separableBlurMaterials[s].uniforms.colorTexture.value=this.renderTargetsHorizontal[s].texture,this.separableBlurMaterials[s].uniforms.direction.value=Iu.BlurDirectionY,e.setRenderTarget(this.renderTargetsVertical[s]),e.clear(),this.fsQuad.render(e),o=this.renderTargetsVertical[s];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,e.setRenderTarget(this.renderTargetsHorizontal[0]),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,r&&e.state.buffers.stencil.setTest(!0),this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(n),this.fsQuad.render(e)),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=a},getSeperableBlurMaterial:function(e){return new Ri({defines:{KERNEL_RADIUS:e,SIGMA:e},uniforms:{colorTexture:{value:null},texSize:{value:new tt(.5,.5)},direction:{value:new tt(.5,.5)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include <common>\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat fSigma = float(SIGMA);\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\t\t\t\t\t\tfloat x = float(i);\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\t\t\t\t\t\tweightSum += 2.0 * w;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})},getCompositeMaterial:function(e){return new Ri({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D blurTexture1;\t\t\t\tuniform sampler2D blurTexture2;\t\t\t\tuniform sampler2D blurTexture3;\t\t\t\tuniform sampler2D blurTexture4;\t\t\t\tuniform sampler2D blurTexture5;\t\t\t\tuniform sampler2D dirtTexture;\t\t\t\tuniform float bloomStrength;\t\t\t\tuniform float bloomRadius;\t\t\t\tuniform float bloomFactors[NUM_MIPS];\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\t\t\t\t\t\t\t\tfloat lerpBloomFactor(const in float factor) { \t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\t\t\t\t}\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\t\t\t\t}"})}}),Iu.BlurDirectionX=new tt(1,0),Iu.BlurDirectionY=new tt(0,1);var Lu=function(e,t,n,i){hu.call(this),this.scene=e,this.camera=t,this.sampleLevel=4,this.unbiased=!0,this.clearColor=void 0!==n?n:0,this.clearAlpha=void 0!==i?i:0,void 0===du&&console.error("SSAARenderPass relies on CopyShader");var r=du;this.copyUniforms=Di.clone(r.uniforms),this.copyMaterial=new Ri({uniforms:this.copyUniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,premultipliedAlpha:!0,transparent:!0,blending:2,depthTest:!1,depthWrite:!1}),this.fsQuad=new hu.FullScreenQuad(this.copyMaterial)};Lu.prototype=Object.assign(Object.create(hu.prototype),{constructor:Lu,dispose:function(){this.sampleRenderTarget&&(this.sampleRenderTarget.dispose(),this.sampleRenderTarget=null)},setSize:function(e,t){this.sampleRenderTarget&&this.sampleRenderTarget.setSize(e,t)},render:function(e,t,n){this.sampleRenderTarget||(this.sampleRenderTarget=new dt(n.width,n.height,{minFilter:Z,magFilter:Z,format:ce}),this.sampleRenderTarget.texture.name="SSAARenderPass.sample");var i=Lu.JitterVectors[Math.max(0,Math.min(this.sampleLevel,5))],r=e.autoClear;e.autoClear=!1;var a=e.getClearColor().getHex(),o=e.getClearAlpha(),s=1/i.length;this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture,n.width,n.height;for(var l=0;l<i.length;l++){i[l];var A=s;if(this.unbiased)A+=.03125*((l+.5)/i.length-.5);this.copyUniforms.opacity.value=A,e.setClearColor(this.clearColor,this.clearAlpha),e.setRenderTarget(this.sampleRenderTarget),e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(this.renderToScreen?null:t),0===l&&(e.setClearColor(0,0),e.clear()),this.fsQuad.render(e)}this.camera.clearViewOffset&&this.camera.clearViewOffset(),e.autoClear=r,e.setClearColor(a,o)}}),Lu.JitterVectors=[[[0,0]],[[4,4],[-4,-4]],[[-2,-6],[6,-2],[-6,2],[2,6]],[[1,-3],[-1,3],[5,1],[-3,-5],[-5,5],[-7,-1],[3,7],[7,-7]],[[1,1],[-1,-3],[-3,2],[4,-1],[-5,-2],[2,5],[5,3],[3,-5],[-2,6],[0,-7],[-4,-6],[-6,4],[-8,0],[7,-4],[6,7],[-7,-8]],[[-4,-7],[-7,-5],[-3,-5],[-5,-4],[-1,-4],[-2,-2],[-6,-1],[-4,0],[-7,1],[-1,2],[-6,3],[-3,3],[-7,6],[-3,6],[-5,7],[-1,7],[5,-7],[1,-6],[6,-5],[4,-4],[2,-3],[7,-2],[1,-1],[4,-1],[2,1],[6,2],[0,4],[4,4],[2,5],[7,5],[5,6],[3,7]]];var Fu=function(e,t,n){void 0===t&&(console.warn('TransformControls: The second parameter "domElement" is now mandatory.'),t=document),zt.call(this),this.name="TransformControls",this.visible=!1;var i=new ku(n);this.add(i);var r=new Pu;this.add(r);var a=this;z("camera",e),z("object",void 0),z("enabled",!0),z("axis",null),z("mode","translate"),z("translationSnap",null),z("rotationSnap",null),z("space","world"),z("size",1),z("dragging",!1),z("showX",!0),z("showY",!0),z("showZ",!0);var o={type:"change"},s={type:"mouseDown"},l={type:"mouseUp",mode:a.mode},A={type:"objectChange"},c=new Nc,h=new at,u=new at,d=new nt,f={X:new at(1,0,0),Y:new at(0,1,0),Z:new at(0,0,1)},p=new at,m=new at,v=new at,g=new at,y=new at,w=new at,x=0,b=new at,M=new nt,C=new at,B=new at,E=new nt,S=new nt,T=new at,_=new at,I=new nt,L=new at,F=new at,k=new nt,P=new nt,U=new at,D=new at,R=new at,O=new nt,N=new at;function z(e,t){var n=t;Object.defineProperty(a,e,{get:function(){return void 0!==n?n:t},set:function(t){n!==t&&(n=t,r[e]=t,i[e]=t,a.dispatchEvent({type:e+"-changed",value:t}),a.dispatchEvent(o))}}),a[e]=t,r[e]=t,i[e]=t}function Q(e){if(document.pointerLockElement)return{x:0,y:0,button:e.button};var n=e.changedTouches?e.changedTouches[0]:e,i=t.getBoundingClientRect();return{x:(n.clientX-i.left)/i.width*2-1,y:-(n.clientY-i.top)/i.height*2+1,button:e.button}}function G(e){a.enabled&&a.pointerHover(Q(e))}function H(e){a.enabled&&(document.addEventListener("mousemove",V,!1),a.pointerHover(Q(e)),a.pointerDown(Q(e)))}function V(e){a.enabled&&a.pointerMove(Q(e))}function j(e){a.enabled&&(document.removeEventListener("mousemove",V,!1),a.pointerUp(Q(e)))}z("worldPosition",F),z("worldPositionStart",_),z("worldQuaternion",k),z("worldQuaternionStart",I),z("cameraPosition",b),z("cameraQuaternion",M),z("pointStart",p),z("pointEnd",m),z("rotationAxis",g),z("rotationAngle",x),z("eye",D),t.addEventListener("mousedown",H,!1),t.addEventListener("touchstart",H,!1),t.addEventListener("mousemove",G,!1),t.addEventListener("touchmove",G,!1),t.addEventListener("touchmove",V,!1),document.addEventListener("mouseup",j,!1),t.addEventListener("touchend",j,!1),t.addEventListener("touchcancel",j,!1),t.addEventListener("touchleave",j,!1),this.dispose=function(){t.removeEventListener("mousedown",H),t.removeEventListener("touchstart",H),t.removeEventListener("mousemove",G),document.removeEventListener("mousemove",V),t.removeEventListener("touchmove",G),t.removeEventListener("touchmove",V),document.removeEventListener("mouseup",j),t.removeEventListener("touchend",j),t.removeEventListener("touchcancel",j),t.removeEventListener("touchleave",j),this.traverse((function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()}))},this.attach=function(e){return this.object=e,this.visible=!0,this},this.detach=function(){return this.object=void 0,this.visible=!1,this.axis=null,this},this.updateMatrixWorld=function(){void 0!==this.object&&(this.object.updateMatrixWorld(),this.object.parent.matrixWorld.decompose(B,E,T),this.object.matrixWorld.decompose(F,k,U),S.copy(E).inverse(),P.copy(k).inverse()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(b,M,C),D.copy(b).sub(F).normalize(),zt.prototype.updateMatrixWorld.call(this)},this.pointerHover=function(e){if(void 0!==this.object&&!0!==this.dragging&&(void 0===e.button||0===e.button)){c.setFromCamera(e,this.camera);var t=c.intersectObjects(i.picker[this.mode].children,!0)[0]||!1;this.axis=t?t.object.name:null}},this.pointerDown=function(e){if(!(void 0===this.object||!0===this.dragging||void 0!==e.button&&0!==e.button||0!==e.button&&void 0!==e.button||null===this.axis)){c.setFromCamera(e,this.camera);var t=c.intersectObjects([r],!0)[0]||!1;if(t){var n=this.space;if("scale"===this.mode?n="local":"E"!==this.axis&&"XYZE"!==this.axis&&"XYZ"!==this.axis||(n="world"),"local"===n&&"rotate"===this.mode){var i=this.rotationSnap;"X"===this.axis&&i&&(this.object.rotation.x=Math.round(this.object.rotation.x/i)*i),"Y"===this.axis&&i&&(this.object.rotation.y=Math.round(this.object.rotation.y/i)*i),"Z"===this.axis&&i&&(this.object.rotation.z=Math.round(this.object.rotation.z/i)*i)}this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),R.copy(this.object.position),O.copy(this.object.quaternion),N.copy(this.object.scale),this.object.matrixWorld.decompose(_,I,L),p.copy(t.point).sub(_)}this.dragging=!0,s.mode=this.mode,this.dispatchEvent(s)}},this.pointerMove=function(e){var t=this.axis,n=this.mode,i=this.object,a=this.space;if("scale"===n?a="local":"E"!==t&&"XYZE"!==t&&"XYZ"!==t||(a="world"),void 0!==i&&null!==t&&!1!==this.dragging&&(void 0===e.button||0===e.button)){c.setFromCamera(e,this.camera);var s=c.intersectObjects([r],!0)[0]||!1;if(!1!==s){if(m.copy(s.point).sub(_),"translate"===n)v.copy(m).sub(p),"local"===a&&"XYZ"!==t&&v.applyQuaternion(P),-1===t.indexOf("X")&&(v.x=0),-1===t.indexOf("Y")&&(v.y=0),-1===t.indexOf("Z")&&(v.z=0),"local"===a&&"XYZ"!==t?v.applyQuaternion(O).divide(T):v.applyQuaternion(S).divide(T),i.position.copy(v).add(R),this.translationSnap&&("local"===a&&(i.position.applyQuaternion(d.copy(O).inverse()),-1!==t.search("X")&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),-1!==t.search("Y")&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),-1!==t.search("Z")&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.position.applyQuaternion(O)),"world"===a&&(i.parent&&i.position.add(h.setFromMatrixPosition(i.parent.matrixWorld)),-1!==t.search("X")&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),-1!==t.search("Y")&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),-1!==t.search("Z")&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.parent&&i.position.sub(h.setFromMatrixPosition(i.parent.matrixWorld))));else if("scale"===n){if(-1!==t.search("XYZ")){var l=m.length()/p.length();m.dot(p)<0&&(l*=-1),u.set(l,l,l)}else h.copy(p),u.copy(m),h.applyQuaternion(P),u.applyQuaternion(P),u.divide(h),-1===t.search("X")&&(u.x=1),-1===t.search("Y")&&(u.y=1),-1===t.search("Z")&&(u.z=1);i.scale.copy(N).multiply(u)}else if("rotate"===n){v.copy(m).sub(p);var b=20/F.distanceTo(h.setFromMatrixPosition(this.camera.matrixWorld));"E"===t?(g.copy(D),x=m.angleTo(p),y.copy(p).normalize(),w.copy(m).normalize(),x*=w.cross(y).dot(D)<0?1:-1):"XYZE"===t?(g.copy(v).cross(D).normalize(),x=v.dot(h.copy(g).cross(this.eye))*b):"X"!==t&&"Y"!==t&&"Z"!==t||(g.copy(f[t]),h.copy(f[t]),"local"===a&&h.applyQuaternion(k),x=v.dot(h.cross(D).normalize())*b),this.rotationSnap&&(x=Math.round(x/this.rotationSnap)*this.rotationSnap),this.rotationAngle=x,"local"===a&&"E"!==t&&"XYZE"!==t?(i.quaternion.copy(O),i.quaternion.multiply(d.setFromAxisAngle(g,x)).normalize()):(g.applyQuaternion(S),i.quaternion.copy(d.setFromAxisAngle(g,x)),i.quaternion.multiply(O).normalize())}A.pointer=e,this.dispatchEvent(o),this.dispatchEvent(A)}}},this.pointerUp=function(e){void 0!==e.button&&0!==e.button||(this.dragging&&null!==this.axis&&(l.mode=this.mode,this.dispatchEvent(l)),this.dragging=!1,void 0===e.button&&(this.axis=null))},this.getMode=function(){return a.mode},this.setMode=function(e){a.mode=e},this.setTranslationSnap=function(e){a.translationSnap=e},this.setRotationSnap=function(e){a.rotationSnap=e},this.setSize=function(e){a.size=e},this.setSpace=function(e){a.space=e},this.update=function(){}};Fu.prototype=Object.assign(Object.create(zt.prototype),{constructor:Fu,isTransformControls:!0});var ku=function(e){zt.call(this),this.type="TransformControlsGizmo";var t=new Nn({depthTest:!1,depthWrite:!1,transparent:!0,side:2,fog:!1}),n=new Do({depthTest:!1,depthWrite:!1,transparent:!0,linewidth:1,fog:!1}),i=t.clone();i.opacity=.15;var r=t.clone();r.opacity=.33;var a=t.clone();a.color.set(16711680);var o=t.clone();o.color.set(65280);var s=t.clone();s.color.set(255);var l=t.clone();l.opacity=.25;var A=l.clone();A.color.set(16776960);var c=l.clone();c.color.set(65535);var h=l.clone();h.color.set(16711935),t.clone().color.set(16776960);var u=n.clone();u.color.set(16711680);var d=n.clone();d.color.set(65280);var f=n.clone();f.color.set(255);var p=n.clone();p.color.set(65535);var m=n.clone();m.color.set(16711935);var v=n.clone();v.color.set(16776960);var g=n.clone();g.color.set(7895160);var y=v.clone();y.opacity=.25;var w=new cl(0,.05,.2,12,1,!1),x=new ki(.125,.125,.125),b=new si;b.setAttribute("position",new Yn([0,0,0,1,0,0],3));var M=function(e,t){for(var n=new si,i=[],r=0;r<=64*t;++r)i.push(0,Math.cos(r/32*Math.PI)*e,Math.sin(r/32*Math.PI)*e);return n.setAttribute("position",new Yn(i,3)),n},C={X:[[new Ei(w,a),[1,0,0],[0,0,-Math.PI/2],null,"fwd"],[new Ei(w,a),[1,0,0],[0,0,Math.PI/2],null,"bwd"],[new Go(b,u)]],Y:[[new Ei(w,o),[0,1,0],null,null,"fwd"],[new Ei(w,o),[0,1,0],[Math.PI,0,0],null,"bwd"],[new Go(b,d),null,[0,0,Math.PI/2]]],Z:[[new Ei(w,s),[0,0,1],[Math.PI/2,0,0],null,"fwd"],[new Ei(w,s),[0,0,1],[-Math.PI/2,0,0],null,"bwd"],[new Go(b,f),null,[0,-Math.PI/2,0]]],XYZ:[[new Ei(new hs(.1,0),l.clone()),[0,0,0],[0,0,0]]],XY:[[new Ei(new $i(.295,.295),A.clone()),[.15,.15,0]],[new Go(b,v),[.18,.3,0],null,[.125,1,1]],[new Go(b,v),[.3,.18,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new Ei(new $i(.295,.295),c.clone()),[0,.15,.15],[0,Math.PI/2,0]],[new Go(b,p),[0,.18,.3],[0,0,Math.PI/2],[.125,1,1]],[new Go(b,p),[0,.3,.18],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new Ei(new $i(.295,.295),h.clone()),[.15,0,.15],[-Math.PI/2,0,0]],[new Go(b,m),[.18,0,.3],null,[.125,1,1]],[new Go(b,m),[.3,0,.18],[0,-Math.PI/2,0],[.125,1,1]]]};e&&(delete C.XYZ,delete C.XY,delete C.YZ,delete C.XZ);var B={X:[[new Ei(new cl(.2,0,1,4,1,!1),i),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new Ei(new cl(.2,0,1,4,1,!1),i),[0,.6,0]]],Z:[[new Ei(new cl(.2,0,1,4,1,!1),i),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new Ei(new hs(.2,0),i)]],XY:[[new Ei(new $i(.4,.4),i),[.2,.2,0]]],YZ:[[new Ei(new $i(.4,.4),i),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new Ei(new $i(.4,.4),i),[.2,0,.2],[-Math.PI/2,0,0]]]};e&&(delete B.XYZ,delete B.XY,delete B.YZ,delete B.XZ);var E,S={START:[[new Ei(new hs(.01,2),r),null,null,null,"helper"]],END:[[new Ei(new hs(.01,2),r),null,null,null,"helper"]],DELTA:[[new Go((E=new si,E.setAttribute("position",new Yn([0,0,0,1,1,1],3)),E),r),null,null,null,"helper"]],X:[[new Go(b,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new Go(b,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new Go(b,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},T={X:[[new Go(M(1,.5),u)],[new Ei(new hs(.04,0),a),[0,0,.99],null,[1,3,1]]],Y:[[new Go(M(1,.5),d),null,[0,0,-Math.PI/2]],[new Ei(new hs(.04,0),o),[0,0,.99],null,[3,1,1]]],Z:[[new Go(M(1,.5),f),null,[0,Math.PI/2,0]],[new Ei(new hs(.04,0),s),[.99,0,0],null,[1,3,1]]],E:[[new Go(M(1.25,1),y),null,[0,Math.PI/2,0]],[new Ei(new cl(.03,0,.15,4,1,!1),y),[1.17,0,0],[0,0,-Math.PI/2],[1,1,.001]],[new Ei(new cl(.03,0,.15,4,1,!1),y),[-1.17,0,0],[0,0,Math.PI/2],[1,1,.001]],[new Ei(new cl(.03,0,.15,4,1,!1),y),[0,-1.17,0],[Math.PI,0,0],[1,1,.001]],[new Ei(new cl(.03,0,.15,4,1,!1),y),[0,1.17,0],[0,0,0],[1,1,.001]]],XYZE:[[new Go(M(1,1),g),null,[0,Math.PI/2,0]]]},_={AXIS:[[new Go(b,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},I={X:[[new Ei(new xs(1,.1,4,24),i),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new Ei(new xs(1,.1,4,24),i),[0,0,0],[Math.PI/2,0,0]]],Z:[[new Ei(new xs(1,.1,4,24),i),[0,0,0],[0,0,-Math.PI/2]]],E:[[new Ei(new xs(1.25,.1,2,24),i)]],XYZE:[[new Ei(new el(.7,10,8),i)]]},L={X:[[new Ei(x,a),[.8,0,0],[0,0,-Math.PI/2]],[new Go(b,u),null,null,[.8,1,1]]],Y:[[new Ei(x,o),[0,.8,0]],[new Go(b,d),null,[0,0,Math.PI/2],[.8,1,1]]],Z:[[new Ei(x,s),[0,0,.8],[Math.PI/2,0,0]],[new Go(b,f),null,[0,-Math.PI/2,0],[.8,1,1]]],XY:[[new Ei(x,A),[.85,.85,0],null,[2,2,.2]],[new Go(b,v),[.855,.98,0],null,[.125,1,1]],[new Go(b,v),[.98,.855,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new Ei(x,c),[0,.85,.85],null,[.2,2,2]],[new Go(b,p),[0,.855,.98],[0,0,Math.PI/2],[.125,1,1]],[new Go(b,p),[0,.98,.855],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new Ei(x,h),[.85,0,.85],null,[2,.2,2]],[new Go(b,m),[.855,0,.98],null,[.125,1,1]],[new Go(b,m),[.98,0,.855],[0,-Math.PI/2,0],[.125,1,1]]],XYZX:[[new Ei(new ki(.125,.125,.125),l.clone()),[1.1,0,0]]],XYZY:[[new Ei(new ki(.125,.125,.125),l.clone()),[0,1.1,0]]],XYZZ:[[new Ei(new ki(.125,.125,.125),l.clone()),[0,0,1.1]]]},F={X:[[new Ei(new cl(.2,0,.8,4,1,!1),i),[.5,0,0],[0,0,-Math.PI/2]]],Y:[[new Ei(new cl(.2,0,.8,4,1,!1),i),[0,.5,0]]],Z:[[new Ei(new cl(.2,0,.8,4,1,!1),i),[0,0,.5],[Math.PI/2,0,0]]],XY:[[new Ei(x,i),[.85,.85,0],null,[3,3,.2]]],YZ:[[new Ei(x,i),[0,.85,.85],null,[.2,3,3]]],XZ:[[new Ei(x,i),[.85,0,.85],null,[3,.2,3]]],XYZX:[[new Ei(new ki(.2,.2,.2),i),[1.1,0,0]]],XYZY:[[new Ei(new ki(.2,.2,.2),i),[0,1.1,0]]],XYZZ:[[new Ei(new ki(.2,.2,.2),i),[0,0,1.1]]]},k={X:[[new Go(b,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new Go(b,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new Go(b,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},P=function(e){var t=new zt;for(var n in e)for(var i=e[n].length;i--;){var r=e[n][i][0].clone(),a=e[n][i][1],o=e[n][i][2],s=e[n][i][3],l=e[n][i][4];r.name=n,r.tag=l,a&&r.position.set(a[0],a[1],a[2]),o&&r.rotation.set(o[0],o[1],o[2]),s&&r.scale.set(s[0],s[1],s[2]),r.updateMatrix();var A=r.geometry.clone();A.applyMatrix(r.matrix),r.geometry=A,r.renderOrder=1/0,r.position.set(0,0,0),r.rotation.set(0,0,0),r.scale.set(1,1,1),t.add(r)}return t},U=new at(0,0,0),D=new Bt,R=new at(0,1,0),O=new at(0,0,0),N=new bt,z=new nt,Q=new nt,G=new nt,H=new at(1,0,0),V=new at(0,1,0),j=new at(0,0,1);this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=P(C)),this.add(this.gizmo.rotate=P(T)),this.add(this.gizmo.scale=P(L)),this.add(this.picker.translate=P(B)),this.add(this.picker.rotate=P(I)),this.add(this.picker.scale=P(F)),this.add(this.helper.translate=P(S)),this.add(this.helper.rotate=P(_)),this.add(this.helper.scale=P(k)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1,this.updateMatrixWorld=function(){var e=this.space;"scale"===this.mode&&(e="local");var t="local"===e?this.worldQuaternion:G;this.gizmo.translate.visible="translate"===this.mode,this.gizmo.rotate.visible="rotate"===this.mode,this.gizmo.scale.visible="scale"===this.mode,this.helper.translate.visible="translate"===this.mode,this.helper.rotate.visible="rotate"===this.mode,this.helper.scale.visible="scale"===this.mode;var n=[];n=(n=(n=n.concat(this.picker[this.mode].children)).concat(this.gizmo[this.mode].children)).concat(this.helper[this.mode].children);for(var i=0;i<n.length;i++){var r=n[i];r.visible=!0,r.rotation.set(0,0,0),r.position.copy(this.worldPosition);var a=this.worldPosition.distanceTo(this.cameraPosition);if(r.scale.set(1,1,1).multiplyScalar(a*this.size/7),"helper"!==r.tag){if(r.quaternion.copy(t),"translate"===this.mode||"scale"===this.mode){var o=.99;"X"!==r.name&&"XYZX"!==r.name||Math.abs(R.copy(H).applyQuaternion(t).dot(this.eye))>o&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),"Y"!==r.name&&"XYZY"!==r.name||Math.abs(R.copy(V).applyQuaternion(t).dot(this.eye))>o&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),"Z"!==r.name&&"XYZZ"!==r.name||Math.abs(R.copy(j).applyQuaternion(t).dot(this.eye))>o&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),"XY"===r.name&&Math.abs(R.copy(j).applyQuaternion(t).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),"YZ"===r.name&&Math.abs(R.copy(H).applyQuaternion(t).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),"XZ"===r.name&&Math.abs(R.copy(V).applyQuaternion(t).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),-1!==r.name.search("X")&&(R.copy(H).applyQuaternion(t).dot(this.eye)<0?"fwd"===r.tag?r.visible=!1:r.scale.x*=-1:"bwd"===r.tag&&(r.visible=!1)),-1!==r.name.search("Y")&&(R.copy(V).applyQuaternion(t).dot(this.eye)<0?"fwd"===r.tag?r.visible=!1:r.scale.y*=-1:"bwd"===r.tag&&(r.visible=!1)),-1!==r.name.search("Z")&&(R.copy(j).applyQuaternion(t).dot(this.eye)<0?"fwd"===r.tag?r.visible=!1:r.scale.z*=-1:"bwd"===r.tag&&(r.visible=!1))}else"rotate"===this.mode&&(Q.copy(t),R.copy(this.eye).applyQuaternion(z.copy(t).inverse()),-1!==r.name.search("E")&&r.quaternion.setFromRotationMatrix(N.lookAt(this.eye,O,V)),"X"===r.name&&(z.setFromAxisAngle(H,Math.atan2(-R.y,R.z)),z.multiplyQuaternions(Q,z),r.quaternion.copy(z)),"Y"===r.name&&(z.setFromAxisAngle(V,Math.atan2(R.x,R.z)),z.multiplyQuaternions(Q,z),r.quaternion.copy(z)),"Z"===r.name&&(z.setFromAxisAngle(j,Math.atan2(R.y,R.x)),z.multiplyQuaternions(Q,z),r.quaternion.copy(z)));r.visible=r.visible&&(-1===r.name.indexOf("X")||this.showX),r.visible=r.visible&&(-1===r.name.indexOf("Y")||this.showY),r.visible=r.visible&&(-1===r.name.indexOf("Z")||this.showZ),r.visible=r.visible&&(-1===r.name.indexOf("E")||this.showX&&this.showY&&this.showZ),r.material._opacity=r.material._opacity||r.material.opacity,r.material._color=r.material._color||r.material.color.clone(),r.material.color.copy(r.material._color),r.material.opacity=r.material._opacity,this.enabled?this.axis&&(r.name===this.axis||this.axis.split("").some((function(e){return r.name===e}))?(r.material.opacity=1,r.material.color.lerp(new Fn(1,1,1),.5)):(r.material.opacity*=.25,r.material.color.lerp(new Fn(1,1,1),.5))):(r.material.opacity*=.5,r.material.color.lerp(new Fn(1,1,1),.5))}else r.visible=!1,"AXIS"===r.name?(r.position.copy(this.worldPositionStart),r.visible=!!this.axis,"X"===this.axis&&(z.setFromEuler(D.set(0,0,0)),r.quaternion.copy(t).multiply(z),Math.abs(R.copy(H).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),"Y"===this.axis&&(z.setFromEuler(D.set(0,0,Math.PI/2)),r.quaternion.copy(t).multiply(z),Math.abs(R.copy(V).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),"Z"===this.axis&&(z.setFromEuler(D.set(0,Math.PI/2,0)),r.quaternion.copy(t).multiply(z),Math.abs(R.copy(j).applyQuaternion(t).dot(this.eye))>.9&&(r.visible=!1)),"XYZE"===this.axis&&(z.setFromEuler(D.set(0,Math.PI/2,0)),R.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(N.lookAt(O,R,V)),r.quaternion.multiply(z),r.visible=this.dragging),"E"===this.axis&&(r.visible=!1)):"START"===r.name?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):"END"===r.name?(r.position.copy(this.worldPosition),r.visible=this.dragging):"DELTA"===r.name?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),U.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),U.applyQuaternion(this.worldQuaternionStart.clone().inverse()),r.scale.copy(U),r.visible=this.dragging):(r.quaternion.copy(t),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=-1!==this.axis.search(r.name)))}zt.prototype.updateMatrixWorld.call(this)}};ku.prototype=Object.assign(Object.create(zt.prototype),{constructor:ku,isTransformControlsGizmo:!0});var Pu=function(){Ei.call(this,new $i(1e5,1e5,2,2),new Nn({visible:!1,wireframe:!0,side:2,transparent:!0,opacity:.1})),this.type="TransformControlsPlane";var e=new at(1,0,0),t=new at(0,1,0),n=new at(0,0,1),i=new at,r=new at,a=new at,o=new bt,s=new nt;this.updateMatrixWorld=function(){var l=this.space;switch(this.position.copy(this.worldPosition),"scale"===this.mode&&(l="local"),e.set(1,0,0).applyQuaternion("local"===l?this.worldQuaternion:s),t.set(0,1,0).applyQuaternion("local"===l?this.worldQuaternion:s),n.set(0,0,1).applyQuaternion("local"===l?this.worldQuaternion:s),a.copy(t),this.mode){case"translate":case"scale":switch(this.axis){case"X":a.copy(this.eye).cross(e),r.copy(e).cross(a);break;case"Y":a.copy(this.eye).cross(t),r.copy(t).cross(a);break;case"Z":a.copy(this.eye).cross(n),r.copy(n).cross(a);break;case"XY":r.copy(n);break;case"YZ":r.copy(e);break;case"XZ":a.copy(n),r.copy(t);break;case"XYZ":case"E":r.set(0,0,0)}break;default:r.set(0,0,0)}0===r.length()?this.quaternion.copy(this.cameraQuaternion):(o.lookAt(i.set(0,0,0),r,a),this.quaternion.setFromRotationMatrix(o)),zt.prototype.updateMatrixWorld.call(this)}};Pu.prototype=Object.assign(Object.create(Ei.prototype),{constructor:Pu,isTransformControlsPlane:!0});var Uu,Du=function(e){h(n,e);var t=y(n);function n(e,i){var r;return s(this,n),(r=t.call(this,e))._hideObjects=[],r.antiAliasing=Cu.SMAA,r.options.strength=void 0!==r.options.strength?r.options.strength:1,r.options.radius=void 0!==r.options.radius?r.options.radius:0,r.options.threshold=void 0!==r.options.threshold?r.options.threshold:0,r._bloomPass={},r._materials={},r._darkMaterial=new Nn({color:"black"}),r._lastSelected=null,r._objects=[],r.isUnrealBloom=!0,r.viewer=i,r}return A(n,[{key:"init",value:function(e){var t=new tt(e.width,e.height);this._bloomPass=new Iu(t,this.options.strength,this.options.radius,this.options.threshold),this._bloomLayer=new Et,this._bloomLayer.set(1),this._composer=new vu(e.renderer),this._composer.renderToScreen=!1;var i=new Lu(e.scene,e.camera);i.sampleLevel=4,this._composer.addPass(i),this._composer.addPass(new fu(du)),this._composer.addPass(this._bloomPass),this.pass=new fu(new Ri({uniforms:{baseTexture:{value:null},bloomTexture:{value:this._composer.renderTarget2.texture}},vertexShader:"varying vec2 vUv;\n\t\t\t void main() {\n\t\t\t\tvUv = uv;\n\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t }",fragmentShader:"uniform sampler2D baseTexture;\n uniform sampler2D bloomTexture;\n varying vec2 vUv;\n vec4 getTexture( sampler2D texelToLinearTexture ) {\n return mapTexelToLinear( texture2D( texelToLinearTexture , vUv ) );\n }\n void main() {\n gl_FragColor = ( getTexture( baseTexture ) + vec4( 1.0 ) * getTexture( bloomTexture ) );\n }",defines:{}}),"baseTexture"),this.pass.needsSwap=!0,b(u(n.prototype),"init",this).call(this)}},{key:"setSize",value:function(e,t){this._composer.setSize(e,t)}},{key:"setStrength",value:function(e){this._bloomPass.strength=e,this.viewer.renderManager.render()}},{key:"getStrength",value:function(){return this._bloomPass.strength}},{key:"setRadius",value:function(e){this._bloomPass.radius=e,this.viewer.renderManager.render()}},{key:"getRadius",value:function(){return this._bloomPass.radius}},{key:"setThreshold",value:function(e){this._bloomPass.threshold=e,this.viewer.renderManager.render()}},{key:"getThreshold",value:function(){return this._bloomPass.threshold}},{key:"setExposure",value:function(e){this._bloomPass.exposure=e}},{key:"getExposure",value:function(){return this._bloomPass.exposure||1}},{key:"add",value:function(e){console.log(e);var t=this._objects;function n(e){t.includes(e)||(e.layers.mask=3,e.bloom=!0,t.push(e))}this._lastSelected=e,"Mesh"!==e.type&&"SkinnedMesh"!==e.type||n(e),"Object3D"!==e.type&&"Group"!==e.type||e.traverse((function(e){("Mesh"===e.type||"SkinnedMesh"===e.type)&&n(e)}))}},{key:"remove",value:function(e){var t=this._objects;function n(e){t.includes(e)&&(e.layers.mask=1,delete e.bloom,t.splice(t.indexOf(e),1))}"Mesh"!==e.type&&"SkinnedMesh"!==e.type||n(e),"Object3D"!==e.type&&"Group"!==e.type||e.traverse((function(e){("Mesh"===e.type||"SkinnedMesh"===e.type)&&n(e)}))}},{key:"clear",value:function(){this._objects.map((function(e){e.layers.mask=1,delete e.bloom})),this._objects=[]}},{key:"render",value:function(){var e,t,n=this;this.viewer.scene.traverse((function(i){n._darkenNonBloomed(i),"_shadow.mesh"==i.name&&(e=i),i.constructor===Fu&&i.visible&&(t=i)}));var i=this.viewer.scene.background;this.viewer.scene.background=null,e&&(e.visible=!1),t&&this.viewer.root.remove(t),this._composer.render(),this.viewer.scene.background=i,e&&(e.visible=!0),t&&this.viewer.root.add(t),this.viewer.scene.traverse((function(e){n._restoreMaterial(e)})),this._hideObjects.map((function(e){return e.visible=!0})),this._hideObjects.length=0}},{key:"_darkenNonBloomed",value:function(e){if(e.isAmrtAlphaHotSpotEntity&&e.isAmrtAlphaHotSpotEntity.visible)return e.visible=!1,void this._hideObjects.push(e);if((e.isMesh||e.isSprite)&&!1===this._bloomLayer.test(e.layers)){if(Array.isArray(e.material)){if(e.material.find((function(e){return e.transparent}))&&e.visible)return e.visible=!1,void this._hideObjects.push(e)}else if(e.material.opacity<1&&e.visible)return e.visible=!1,void this._hideObjects.push(e);this._materials[e.uuid]=e.material,e.material=this._darkMaterial}}},{key:"_restoreMaterial",value:function(e){this._materials[e.uuid]&&(e.material=this._materials[e.uuid],delete this._materials[e.uuid])}}]),n}(Bu),Ru={defines:{DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tColor:{value:null},tDepth:{value:null},focus:{value:1},aspect:{value:1},aperture:{value:.025},maxblur:{value:.01},nearClip:{value:1},farClip:{value:1e3}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <common>","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float maxblur;","uniform float aperture;","uniform float nearClip;","uniform float farClip;","uniform float focus;","uniform float aspect;","#include <packing>","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, nearClip, farClip );","\t#else","\treturn orthographicDepthToViewZ( depth, nearClip, farClip );","\t#endif","}","void main() {","\tvec2 aspectcorrect = vec2( 1.0, aspect );","\tfloat viewZ = getViewZ( getDepth( vUv ) );","\tfloat factor = ( focus + viewZ );","\tvec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );","\tvec2 dofblur9 = dofblur * 0.9;","\tvec2 dofblur7 = dofblur * 0.7;","\tvec2 dofblur4 = dofblur * 0.4;","\tvec4 col = vec4( 0.0 );","\tcol += texture2D( tColor, vUv.xy );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","\tcol += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );","\tgl_FragColor = col / 41.0;","\tgl_FragColor.a = 1.0;","}"].join("\n")},Ou=function(e,t,n){hu.call(this),this.scene=e,this.camera=t,this.apertureScale=1,this.focus=void 0!==n.focus?n.focus:1,this.aspect=void 0!==n.aspect?n.aspect:t.aspect,this.aperture=void 0!==n.aperture?n.aperture:.025,this.maxblur=void 0!==n.maxblur?n.maxblur:1;var i=n.width||window.innerWidth||1,r=n.height||window.innerHeight||1;this.renderTargetDepth=new dt(i,r,{minFilter:X,magFilter:X}),this.renderTargetDepth.texture.name="BokehPass.depth",this.materialDepth=new Ra,this.materialDepth.depthPacking=je,this.materialDepth.blending=0,void 0===Ru&&console.error("BokehPass relies on BokehShader");var a=Ru,o=Di.clone(a.uniforms);o.tDepth.value=this.renderTargetDepth.texture,o.focus.value=this.focus,o.aspect.value=this.aspect,o.aperture.value=this.aperture,o.maxblur.value=this.maxblur,o.nearClip.value=t.near,o.farClip.value=t.far,this.materialBokeh=new Ri({defines:Object.assign({},a.defines),uniforms:o,vertexShader:a.vertexShader,fragmentShader:a.fragmentShader}),this.uniforms=o,this.needsSwap=!1,this.fsQuad=new hu.FullScreenQuad(this.materialBokeh),this.oldClearColor=new Fn};Ou.prototype=Object.assign(Object.create(hu.prototype),{constructor:Ou,render:function(e,t,n){this.scene.overrideMaterial=this.materialDepth,this.oldClearColor.copy(e.getClearColor());var i=e.getClearAlpha(),r=e.autoClear;e.autoClear=!1,e.setClearColor(16777215),e.setClearAlpha(1),e.setRenderTarget(this.renderTargetDepth),e.clear(),e.render(this.scene,this.camera),this.uniforms.focus.value=this.focus,this.focus>.1?this.apertureScale=.1/this.focus:this.apertureScale=1,this.uniforms.aspect.value=this.aspect,this.uniforms.aperture.value=this.aperture*this.apertureScale,this.uniforms.maxblur.value=this.maxblur,this.uniforms.tColor.value=n.texture,this.uniforms.nearClip.value=this.camera.near,this.uniforms.farClip.value=this.camera.far,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),e.clear(),this.fsQuad.render(e)),this.scene.overrideMaterial=null,e.setClearColor(this.oldClearColor),e.setClearAlpha(i),e.autoClear=r}});var Nu=function(e){h(n,e);var t=y(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(this,n),(e=t.call(this)).antiAliasing=null,e.focus=i.focus||500,e.aperture=i.aperture||1,e.maxblur=i.maxblur||.01,e.apertureScale=1,e}return A(n,[{key:"init",value:function(e){Uu||(Uu=new Ou(e.scene,e.camera,{focus:this.focus,aperture:this.aperture,maxblur:this.maxblur}),this.pass=Uu),b(u(n.prototype),"init",this).call(this)}},{key:"setFocus",value:function(e){this.focus=e,this.pass.focus=e}},{key:"setAperture",value:function(e){this.aperture=e,this.pass.aperture=e}},{key:"setMaxblur",value:function(e){this.maxblur=e,this.pass.maxblur=.001*e}},{key:"setAspect",value:function(e){this.pass.uniforms.aspect.value=e}}]),n}(Bu),zu=function(e,t,n){hu.call(this),this.h=e,this.s=t,this.v=n,this.uniform={h:{value:0},s:{value:0},v:{value:0},t2D:{value:null}},this.material=new Ri({uniforms:this.uniform,vertexShader:"\nvarying vec2 vUv;\n//uniform mat3 uvTransform;\n\nvoid main() {\n\n\tvUv = uv;\n\t//vUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n\n}\n\n",fragmentShader:"\n\n float lerpFloat(float a,float b,float f){\n return a * (1.0 - f) + b * f;\n }\n\n vec3 lerp(vec3 a,vec3 b,float f){\n vec3 final = vec3(0.0,0.0,0.0);\n final.x = lerpFloat(a.x,b.x,f);\n final.y = lerpFloat(a.y,b.y,f);\n final.z = lerpFloat(a.z,b.z,f);\n return final;\n }\n\n vec4 lerp4(vec4 a,vec4 b,float f){\n vec4 final = vec4(0.0,0.0,0.0,0.0);\n final.x = lerpFloat(a.x,b.x,f);\n final.y = lerpFloat(a.y,b.y,f);\n final.z = lerpFloat(a.z,b.z,f);\n final.w = lerpFloat(a.w,b.w,f);\n return final;\n }\n\n vec3 HSV2RGB(vec3 c)\n {\n vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\n vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);\n return c.z * lerp(K.xxx, saturate(p - K.xxx), c.y);\n }\n\n vec3 RgbToHsv(vec3 c)\n {\n vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\n vec4 p = lerp4(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));\n vec4 q = lerp4(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));\n float d = q.x - min(q.w, q.y);\n float e = 1.0e-10;\n return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);\n }\n\n float RotateHue(float value, float low, float hi)\n {\n return (value < low)? value + hi : (value > hi)? value - hi : value;\n }\n\n float Luminance(vec3 linearRgb)\n {\n return dot(linearRgb, vec3(0.2126729, 0.7151522, 0.0721750));\n } \n\n vec3 Saturation(vec3 c, float sat)\n {\n vec3 satV = vec3(sat,sat,sat);\n float luma = Luminance(c);\n vec3 lumaV = vec3(luma,luma,luma);\n return lumaV.xxx + satV.xxx * (c - lumaV.xxx);\n }\n\n uniform sampler2D t2D;\n\n uniform float h;\n uniform float s;\n uniform float v;\n\n varying vec2 vUv;\n\n\n void main() {\n\n vec4 texColor = texture2D( t2D, vUv );\n\n vec3 hsv = RgbToHsv(texColor.rgb);\n float hue = hsv.x + h;\n hsv.x = RotateHue(hue, 0.0, 1.0);\n //hsv.y+=s;\n hsv.z+=v;\n texColor.rgb = HSV2RGB(hsv);\n texColor.rgb = Saturation(texColor.rgb, 1.0 + s);\n\n gl_FragColor = mapTexelToLinear( texColor );\n\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n\n }\n\n"}),this.fsQuad=new hu.FullScreenQuad(this.material)};zu.prototype=Object.assign(Object.create(hu.prototype),{constructor:zu,render:function(e,t,n,i){this.uniform.h.value=this.h,this.uniform.s.value=this.s,this.uniform.v.value=this.v,this.uniform.t2D.value=n.texture,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(),this.fsQuad.render(e))}});var Qu=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),(i=t.call(this,e)).h=0,i.s=0,i.v=0,i.pass=new zu(i.h,i.s,i.v),i}return A(n,[{key:"getHue",value:function(){return this.pass.h}},{key:"setHue",value:function(e){this.pass.h=e}},{key:"getContrast",value:function(){return this.pass.s}},{key:"setContrast",value:function(e){this.pass.s=e}},{key:"getVibrance",value:function(){return this.pass.v}},{key:"setVibrance",value:function(e){this.pass.v=e}}]),n}(Bu),Gu=function(e){null==e&&(e=Math),this.grad3=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]],this.grad4=[[0,1,1,1],[0,1,1,-1],[0,1,-1,1],[0,1,-1,-1],[0,-1,1,1],[0,-1,1,-1],[0,-1,-1,1],[0,-1,-1,-1],[1,0,1,1],[1,0,1,-1],[1,0,-1,1],[1,0,-1,-1],[-1,0,1,1],[-1,0,1,-1],[-1,0,-1,1],[-1,0,-1,-1],[1,1,0,1],[1,1,0,-1],[1,-1,0,1],[1,-1,0,-1],[-1,1,0,1],[-1,1,0,-1],[-1,-1,0,1],[-1,-1,0,-1],[1,1,1,0],[1,1,-1,0],[1,-1,1,0],[1,-1,-1,0],[-1,1,1,0],[-1,1,-1,0],[-1,-1,1,0],[-1,-1,-1,0]],this.p=[];for(var t=0;t<256;t++)this.p[t]=Math.floor(256*e.random());this.perm=[];for(t=0;t<512;t++)this.perm[t]=this.p[255&t];this.simplex=[[0,1,2,3],[0,1,3,2],[0,0,0,0],[0,2,3,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,3,0],[0,2,1,3],[0,0,0,0],[0,3,1,2],[0,3,2,1],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,3,2,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[1,2,0,3],[0,0,0,0],[1,3,0,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,3,0,1],[2,3,1,0],[1,0,2,3],[1,0,3,2],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,3,1],[0,0,0,0],[2,1,3,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0],[2,0,1,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,0,1,2],[3,0,2,1],[0,0,0,0],[3,1,2,0],[2,1,0,3],[0,0,0,0],[0,0,0,0],[0,0,0,0],[3,1,0,2],[0,0,0,0],[3,2,0,1],[3,2,1,0]]};Gu.prototype.dot=function(e,t,n){return e[0]*t+e[1]*n},Gu.prototype.dot3=function(e,t,n,i){return e[0]*t+e[1]*n+e[2]*i},Gu.prototype.dot4=function(e,t,n,i,r){return e[0]*t+e[1]*n+e[2]*i+e[3]*r},Gu.prototype.noise=function(e,t){var n,i,r=(e+t)*(.5*(Math.sqrt(3)-1)),a=Math.floor(e+r),o=Math.floor(t+r),s=(3-Math.sqrt(3))/6,l=(a+o)*s,A=e-(a-l),c=t-(o-l);A>c?(n=1,i=0):(n=0,i=1);var h=A-n+s,u=c-i+s,d=A-1+2*s,f=c-1+2*s,p=255&a,m=255&o,v=this.perm[p+this.perm[m]]%12,g=this.perm[p+n+this.perm[m+i]]%12,y=this.perm[p+1+this.perm[m+1]]%12,w=.5-A*A-c*c,x=.5-h*h-u*u,b=.5-d*d-f*f;return 70*((w<0?0:(w*=w)*w*this.dot(this.grad3[v],A,c))+(x<0?0:(x*=x)*x*this.dot(this.grad3[g],h,u))+(b<0?0:(b*=b)*b*this.dot(this.grad3[y],d,f)))},Gu.prototype.noise3d=function(e,t,n){var i,r,a,o,s,l,A=(e+t+n)*(1/3),c=Math.floor(e+A),h=Math.floor(t+A),u=Math.floor(n+A),d=1/6,f=(c+h+u)*d,p=e-(c-f),m=t-(h-f),v=n-(u-f);p>=m?m>=v?(i=1,r=0,a=0,o=1,s=1,l=0):p>=v?(i=1,r=0,a=0,o=1,s=0,l=1):(i=0,r=0,a=1,o=1,s=0,l=1):m<v?(i=0,r=0,a=1,o=0,s=1,l=1):p<v?(i=0,r=1,a=0,o=0,s=1,l=1):(i=0,r=1,a=0,o=1,s=1,l=0);var g=p-i+d,y=m-r+d,w=v-a+d,x=p-o+2*d,b=m-s+2*d,M=v-l+2*d,C=p-1+.5,B=m-1+.5,E=v-1+.5,S=255&c,T=255&h,_=255&u,I=this.perm[S+this.perm[T+this.perm[_]]]%12,L=this.perm[S+i+this.perm[T+r+this.perm[_+a]]]%12,F=this.perm[S+o+this.perm[T+s+this.perm[_+l]]]%12,k=this.perm[S+1+this.perm[T+1+this.perm[_+1]]]%12,P=.6-p*p-m*m-v*v,U=.6-g*g-y*y-w*w,D=.6-x*x-b*b-M*M,R=.6-C*C-B*B-E*E;return 32*((P<0?0:(P*=P)*P*this.dot3(this.grad3[I],p,m,v))+(U<0?0:(U*=U)*U*this.dot3(this.grad3[L],g,y,w))+(D<0?0:(D*=D)*D*this.dot3(this.grad3[F],x,b,M))+(R<0?0:(R*=R)*R*this.dot3(this.grad3[k],C,B,E)))},Gu.prototype.noise4d=function(e,t,n,i){var r,a,o,s,l,A,c,h,u,d,f,p,m=this.grad4,v=this.simplex,g=this.perm,y=(Math.sqrt(5)-1)/4,w=(5-Math.sqrt(5))/20,x=(e+t+n+i)*y,b=Math.floor(e+x),M=Math.floor(t+x),C=Math.floor(n+x),B=Math.floor(i+x),E=(b+M+C+B)*w,S=e-(b-E),T=t-(M-E),_=n-(C-E),I=i-(B-E),L=(S>T?32:0)+(S>_?16:0)+(T>_?8:0)+(S>I?4:0)+(T>I?2:0)+(_>I?1:0),F=S-(r=v[L][0]>=3?1:0)+w,k=T-(a=v[L][1]>=3?1:0)+w,P=_-(o=v[L][2]>=3?1:0)+w,U=I-(s=v[L][3]>=3?1:0)+w,D=S-(l=v[L][0]>=2?1:0)+2*w,R=T-(A=v[L][1]>=2?1:0)+2*w,O=_-(c=v[L][2]>=2?1:0)+2*w,N=I-(h=v[L][3]>=2?1:0)+2*w,z=S-(u=v[L][0]>=1?1:0)+3*w,Q=T-(d=v[L][1]>=1?1:0)+3*w,G=_-(f=v[L][2]>=1?1:0)+3*w,H=I-(p=v[L][3]>=1?1:0)+3*w,V=S-1+4*w,j=T-1+4*w,W=_-1+4*w,X=I-1+4*w,Y=255&b,K=255&M,Z=255&C,J=255&B,q=g[Y+g[K+g[Z+g[J]]]]%32,$=g[Y+r+g[K+a+g[Z+o+g[J+s]]]]%32,ee=g[Y+l+g[K+A+g[Z+c+g[J+h]]]]%32,te=g[Y+u+g[K+d+g[Z+f+g[J+p]]]]%32,ne=g[Y+1+g[K+1+g[Z+1+g[J+1]]]]%32,ie=.6-S*S-T*T-_*_-I*I,re=.6-F*F-k*k-P*P-U*U,ae=.6-D*D-R*R-O*O-N*N,oe=.6-z*z-Q*Q-G*G-H*H,se=.6-V*V-j*j-W*W-X*X;return 27*((ie<0?0:(ie*=ie)*ie*this.dot4(m[q],S,T,_,I))+(re<0?0:(re*=re)*re*this.dot4(m[$],F,k,P,U))+(ae<0?0:(ae*=ae)*ae*this.dot4(m[ee],D,R,O,N))+(oe<0?0:(oe*=oe)*oe*this.dot4(m[te],z,Q,G,H))+(se<0?0:(se*=se)*se*this.dot4(m[ne],V,j,W,X)))};var Hu={defines:{PERSPECTIVE_CAMERA:1,KERNEL_SIZE:32},uniforms:{tDiffuse:{value:null},tNormal:{value:null},tDepth:{value:null},tNoise:{value:null},kernel:{value:null},cameraNear:{value:null},cameraFar:{value:null},resolution:{value:new tt},cameraProjectionMatrix:{value:new bt},cameraInverseProjectionMatrix:{value:new bt},kernelRadius:{value:8},minDistance:{value:.005},maxDistance:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform sampler2D tNormal;","uniform sampler2D tDepth;","uniform sampler2D tNoise;","uniform vec3 kernel[ KERNEL_SIZE ];","uniform vec2 resolution;","uniform float cameraNear;","uniform float cameraFar;","uniform mat4 cameraProjectionMatrix;","uniform mat4 cameraInverseProjectionMatrix;","uniform float kernelRadius;","uniform float minDistance;","uniform float maxDistance;","varying vec2 vUv;","#include <packing>","float getDepth( const in vec2 screenPosition ) {","\treturn texture2D( tDepth, screenPosition ).x;","}","float getLinearDepth( const in vec2 screenPosition ) {","\t#if PERSPECTIVE_CAMERA == 1","\t\tfloat fragCoordZ = texture2D( tDepth, screenPosition ).x;","\t\tfloat viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );","\t\treturn viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );","\t#else","\t\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\t\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\t\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {","\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];","\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );","\tclipPosition *= clipW; // unprojection.","\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;","}","vec3 getViewNormal( const in vec2 screenPosition ) {","\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );","}","void main() {","\tfloat depth = getDepth( vUv );","\tfloat viewZ = getViewZ( depth );","\tvec3 viewPosition = getViewPosition( vUv, depth, viewZ );","\tvec3 viewNormal = getViewNormal( vUv );"," vec2 noiseScale = vec2( resolution.x / 4.0, resolution.y / 4.0 );","\tvec3 random = texture2D( tNoise, vUv * noiseScale ).xyz;","\tvec3 tangent = normalize( random - viewNormal * dot( random, viewNormal ) );","\tvec3 bitangent = cross( viewNormal, tangent );","\tmat3 kernelMatrix = mat3( tangent, bitangent, viewNormal );"," float occlusion = 0.0;"," for ( int i = 0; i < KERNEL_SIZE; i ++ ) {","\t\tvec3 sampleVector = kernelMatrix * kernel[ i ];","\t\tvec3 samplePoint = viewPosition + ( sampleVector * kernelRadius );","\t\tvec4 samplePointNDC = cameraProjectionMatrix * vec4( samplePoint, 1.0 );","\t\tsamplePointNDC /= samplePointNDC.w;","\t\tvec2 samplePointUv = samplePointNDC.xy * 0.5 + 0.5;","\t\tfloat realDepth = getLinearDepth( samplePointUv );","\t\tfloat sampleDepth = viewZToOrthographicDepth( samplePoint.z, cameraNear, cameraFar );","\t\tfloat delta = sampleDepth - realDepth;","\t\tif ( delta > minDistance && delta < maxDistance ) {","\t\t\tocclusion += 1.0;","\t\t}","\t}","\tocclusion = clamp( occlusion / float( KERNEL_SIZE ), 0.0, 1.0 );","\tgl_FragColor = vec4( vec3( 1.0 - occlusion ), 1.0 );","}"].join("\n")},Vu={defines:{PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{value:null},cameraNear:{value:null},cameraFar:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDepth;","uniform float cameraNear;","uniform float cameraFar;","varying vec2 vUv;","#include <packing>","float getLinearDepth( const in vec2 screenPosition ) {","\t#if PERSPECTIVE_CAMERA == 1","\t\tfloat fragCoordZ = texture2D( tDepth, screenPosition ).x;","\t\tfloat viewZ = perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar );","\t\treturn viewZToOrthographicDepth( viewZ, cameraNear, cameraFar );","\t#else","\t\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","void main() {","\tfloat depth = getLinearDepth( vUv );","\tgl_FragColor = vec4( vec3( 1.0 - depth ), 1.0 );","}"].join("\n")},ju={uniforms:{tDiffuse:{value:null},resolution:{value:new tt}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","void main() {","\tvec2 texelSize = ( 1.0 / resolution );","\tfloat result = 0.0;","\tfor ( int i = - 2; i <= 2; i ++ ) {","\t\tfor ( int j = - 2; j <= 2; j ++ ) {","\t\t\tvec2 offset = ( vec2( float( i ), float( j ) ) ) * texelSize;","\t\t\tresult += texture2D( tDiffuse, vUv + offset ).r;","\t\t}","\t}","\tgl_FragColor = vec4( vec3( result / ( 5.0 * 5.0 ) ), 1.0 );","}"].join("\n")},Wu=function(e,t,n,i){hu.call(this),this.width=void 0!==n?n:512,this.height=void 0!==i?i:512,this.clear=!0,this.camera=t,this.scene=e,this.kernelRadius=8,this.kernelSize=32,this.kernel=[],this.noiseTexture=null,this.output=0,this.minDistance=.005,this.maxDistance=.1,this.generateSampleKernel(),this.generateRandomKernelRotations();var r=new ns;r.type=ee,r.minFilter=X,r.maxFilter=X,this.beautyRenderTarget=new dt(this.width,this.height,{minFilter:Z,magFilter:Z,format:ce,depthTexture:r,depthBuffer:!0,stencilBuffer:!0}),this.normalRenderTarget=new dt(this.width,this.height,{minFilter:X,magFilter:X,format:ce,stencilBuffer:!0}),this.ssaoRenderTarget=new dt(this.width,this.height,{minFilter:Z,magFilter:Z,format:ce,stencilBuffer:!0}),this.blurRenderTarget=this.ssaoRenderTarget.clone(),this.ssaoMaterial=new Ri({defines:Object.assign({},Hu.defines),uniforms:Di.clone(Hu.uniforms),vertexShader:Hu.vertexShader,fragmentShader:Hu.fragmentShader,blending:0,stencilWrite:!0}),this.ssaoMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.ssaoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.ssaoMaterial.uniforms.tDepth.value=this.beautyRenderTarget.depthTexture,this.ssaoMaterial.uniforms.tNoise.value=this.noiseTexture,this.ssaoMaterial.uniforms.kernel.value=this.kernel,this.ssaoMaterial.uniforms.cameraNear.value=this.camera.near,this.ssaoMaterial.uniforms.cameraFar.value=this.camera.far,this.ssaoMaterial.uniforms.resolution.value.set(this.width,this.height),this.ssaoMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix),this.ssaoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.normalMaterial=new bl,this.normalMaterial.blending=0,this.normalMaterial.stencilWrite=!0,this.blurMaterial=new Ri({defines:Object.assign({},ju.defines),uniforms:Di.clone(ju.uniforms),vertexShader:ju.vertexShader,fragmentShader:ju.fragmentShader,stencilWrite:!0}),this.blurMaterial.uniforms.tDiffuse.value=this.ssaoRenderTarget.texture,this.blurMaterial.uniforms.resolution.value.set(this.width,this.height),this.depthRenderMaterial=new Ri({defines:Object.assign({},Vu.defines),uniforms:Di.clone(Vu.uniforms),vertexShader:Vu.vertexShader,fragmentShader:Vu.fragmentShader,blending:0,stencilWrite:!0}),this.depthRenderMaterial.uniforms.tDepth.value=this.beautyRenderTarget.depthTexture,this.depthRenderMaterial.uniforms.cameraNear.value=this.camera.near,this.depthRenderMaterial.uniforms.cameraFar.value=this.camera.far,this.copyMaterial=new Ri({uniforms:Di.clone(du.uniforms),vertexShader:du.vertexShader,fragmentShader:du.fragmentShader,transparent:!0,depthTest:!1,depthWrite:!1,blendSrc:R,blendDst:L,blendEquation:I,blendSrcAlpha:D,blendDstAlpha:L,blendEquationAlpha:I,stencilWrite:!0}),this.fsQuad=new hu.FullScreenQuad(null),this.originalClearColor=new Fn};Wu.prototype=Object.assign(Object.create(hu.prototype),{constructor:Wu,dispose:function(){this.beautyRenderTarget.dispose(),this.normalRenderTarget.dispose(),this.ssaoRenderTarget.dispose(),this.blurRenderTarget.dispose(),this.quad.geometry.dispose(),this.normalMaterial.dispose(),this.blurMaterial.dispose(),this.copyMaterial.dispose(),this.depthRenderMaterial.dispose()},toggleBackgroundVisible:function(e){e?(this.scene.background=this.scene._background,this.scene._shadow&&(this.scene._shadow.visible=!0),delete this.scene._background,delete this.scene._shadow):(this.scene._background=this.scene.background,this.scene.background=null,this.scene._shadow&&(this.scene._shadow.visible=!1))},render:function(e,t,n,i,r){switch(this.beautyRenderTarget=n,this.toggleBackgroundVisible(!1),this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.toggleBackgroundVisible(!0),this.ssaoMaterial.uniforms.kernelRadius.value=this.kernelRadius,this.ssaoMaterial.uniforms.minDistance.value=this.minDistance,this.ssaoMaterial.uniforms.maxDistance.value=this.maxDistance,this.renderPass(e,this.ssaoMaterial,this.ssaoRenderTarget),this.renderPass(e,this.blurMaterial,this.blurRenderTarget),this.output){case Wu.OUTPUT.SSAO:this.copyMaterial.uniforms.tDiffuse.value=this.ssaoRenderTarget.texture,this.copyMaterial.blending=0,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case Wu.OUTPUT.Blur:this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget.texture,this.copyMaterial.blending=0,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case Wu.OUTPUT.Beauty:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=0,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case Wu.OUTPUT.Depth:this.renderPass(e,this.depthRenderMaterial,this.renderToScreen?null:t);break;case Wu.OUTPUT.Normal:this.copyMaterial.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.copyMaterial.blending=0,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;case Wu.OUTPUT.Default:this.copyMaterial.uniforms.tDiffuse.value=this.beautyRenderTarget.texture,this.copyMaterial.blending=0,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t),this.copyMaterial.uniforms.tDiffuse.value=this.blurRenderTarget.texture,this.copyMaterial.blending=5,this.renderPass(e,this.copyMaterial,this.renderToScreen?null:t);break;default:console.warn("SSAOPass: Unknown output type.")}},renderPass:function(e,t,n,i,r){this.originalClearColor.copy(e.getClearColor());var a=e.getClearAlpha(),o=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,null!=i&&(e.setClearColor(i),e.setClearAlpha(r||0),e.clear()),this.fsQuad.material=t,this.fsQuad.render(e),e.autoClear=o,e.setClearColor(this.originalClearColor),e.setClearAlpha(a)},renderOverride:function(e,t,n,i,r){this.originalClearColor.copy(e.getClearColor());var a=e.getClearAlpha(),o=e.autoClear;e.setRenderTarget(n),e.autoClear=!1,i=t.clearColor||i,r=t.clearAlpha||r,null!=i&&(e.setClearColor(i),e.setClearAlpha(r||0),e.clear()),this.scene.overrideMaterial=t,e.render(this.scene,this.camera),this.scene.overrideMaterial=null,e.autoClear=o,e.setClearColor(this.originalClearColor),e.setClearAlpha(a)},setSize:function(e,t){this.width=e,this.height=t,this.beautyRenderTarget.setSize(e,t),this.ssaoRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.blurRenderTarget.setSize(e,t),this.ssaoMaterial.uniforms.resolution.value.set(e,t),this.ssaoMaterial.uniforms.cameraProjectionMatrix.value.copy(this.camera.projectionMatrix),this.ssaoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.blurMaterial.uniforms.resolution.value.set(e,t)},generateSampleKernel:function(){for(var e=this.kernelSize,t=this.kernel,n=0;n<e;n++){var i=new at;i.x=2*Math.random()-1,i.y=2*Math.random()-1,i.z=Math.random(),i.normalize();var r=n/e;r=et.lerp(.1,1,r*r),i.multiplyScalar(r),t.push(i)}},generateRandomKernelRotations:function(){for(var e=new Gu,t=new Float32Array(64),n=0;n<16;n++){var i=4*n,r=2*Math.random()-1,a=2*Math.random()-1,o=e.noise3d(r,a,0);t[i]=o,t[i+1]=o,t[i+2]=o,t[i+3]=1}this.noiseTexture=new Hi(t,4,4,ce,ne),this.noiseTexture.wrapS=V,this.noiseTexture.wrapT=V}}),Wu.OUTPUT={Default:0,SSAO:1,Blur:2,Beauty:3,Depth:4,Normal:5};var Xu=function(e){h(n,e);var t=y(n);function n(){var e;return s(this,n),(e=t.call(this)).antiAliasing=Cu.SMAA,e.radius=8,e.size=32,e.minDistance=1e-4,e.maxDistance=.001,e}return A(n,[{key:"init",value:function(e){this.scene=e.scene,this.pass=new Wu(e.scene,e.camera,e.width,e.height),this.pass.kernelRadius=this.radius,this.pass.kernelSize=this.size,this.pass.minDistance=this.minDistance,this.pass.maxDistance=this.maxDistance,b(u(n.prototype),"init",this).call(this)}},{key:"setMaxDistance",value:function(e){this.pass.maxDistance=e}},{key:"setMinDistance",value:function(e){this.pass.minDistance=e}},{key:"setRadius",value:function(e){this.pass.kernelRadius=e}},{key:"getRadius",value:function(){return this.pass.kernelRadius}},{key:"setStrength",value:function(e){this.pass.maxDistance=1e-4*e+1e-4}},{key:"getStrength",value:function(){return(this.pass.maxDistance-1e-4)/1e-4}}]),n}(Bu),Yu=function(e,t){hu.call(this),this.oldClearColor=new Fn,this.oldClearAlpha=1,this.textureID=void 0!==t?t:"tDiffuse",e instanceof Ri?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=Di.clone(e.uniforms),this.material=new Ri({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new hu.FullScreenQuad(this.material)};Yu.prototype=Object.assign(Object.create(hu.prototype),{constructor:Yu,render:function(e,t,n,i,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var a=e.autoClear;e.autoClear=!1,r&&e.state.buffers.stencil.setTest(!1),this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e),e.setRenderTarget(null)),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=a,r&&e.state.buffers.stencil.setTest(!0)}});var Ku={uniforms:{tDiffuse:{value:null},offset:{value:1},darkness:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float offset;","uniform float darkness;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 color = texture2D( tDiffuse, vUv );","\tfloat dist = distance( vUv, vec2( 0.5 ) );","\tfloat darkness2 = darkness*1.5;","\tfloat offset2 = pow(offset,2.0);","\tcolor.rgb *= smoothstep( 0.8, offset2 * 0.799, dist *( darkness2 + offset2 ) );","\tgl_FragColor = color;","}"].join("\n")},Zu=function(e){h(n,e);var t=y(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(this,n),e=t.call(this,i),null==i.darkness&&(i.darkness=.5),null==i.offset&&(i.offset=.5),e}return A(n,[{key:"init",value:function(e){this.pass=new Yu(Ku),this.pass.enabled=!0,this.pass.uniforms.darkness.value=this.options.darkness,this.pass.uniforms.offset.value=this.options.offset,b(u(n.prototype),"init",this).call(this)}},{key:"getDarkness",value:function(){return this.pass.uniforms.darkness.value}},{key:"setDarkness",value:function(e){this.pass.uniforms.darkness.value=e}},{key:"getOffset",value:function(){return this.pass.uniforms.offset.value}},{key:"setOffset",value:function(e){this.pass.uniforms.offset.value=e}}]),n}(Bu),Ju=function(e,t,n,i){hu.call(this),this.renderScene=e,this.renderCamera=t,this.oldClearColor=new Fn,this.oldClearAlpha=1,i=i||{},this.center=i.center?(new at).copy(i.center):new at(0,0,0),this.maxRange=i.maxRange?i.maxRange:50;var r=i.speed?i.speed:30;this.frameSpeed=r/60,this.radius=i.radius?i.radius:5,this.innerRadius=-this.radius,this.outerRadius=0,this.fillType=0==i.fillType?0:1,this.fillColor=i.fillColor?i.fillColor:new Fn("#ffff00");var a={minFilter:Z,magFilter:Z,format:ce,stencilBuffer:!0};n.antialias=!0,n.alpha=!0;var o=n.getSize(new tt),s=n.getPixelRatio(),l=o.width,A=o.height;this.depthTarget=new dt(l*s,A*s,a),this.depthTarget.depthBuffer=!0,this.depthTarget.depthTexture=new ns;var c=this.getShaderOptions();this.depthMaterial=new Ri(c),this.fsQuad=new hu.FullScreenQuad(this.depthMaterial)};Ju.prototype=Object.assign(Object.create(hu.prototype),{constructor:Ju,render:function(e,t,n,i,r){this.updateUniforms(n),this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var a=e.autoClear;e.autoClear=!1,e.setRenderTarget(t),this.fsQuad.render(e),e.setRenderTarget(this.depthTarget),e.render(this.renderScene,this.renderCamera),e.setRenderTarget(null),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=a},calCameraVectors:function(){var e=this.renderCamera,t=e.near,n=e.fov,i=e.aspect,r=Math.tan(this.ang2rad(n/2))*t,a=r*i,o=new at(0,0,1).applyMatrix4(e.matrixWorld.clone());o.sub(e.position.clone()),o.normalize();var s=new at(-1,0,0).applyMatrix4(e.matrixWorld.clone());s.sub(e.position.clone()),s.normalize();var l=new at(0,-1,0).applyMatrix4(e.matrixWorld.clone());l.sub(e.position.clone()),l.normalize();var A=s.multiplyScalar(a),c=l.multiplyScalar(r),h=o.clone().multiplyScalar(t).add(c.clone()).sub(A.clone()),u=h.length()/t;h.normalize(),h.multiplyScalar(-u);var d=o.clone().multiplyScalar(t).add(A.clone()).add(c.clone());d.normalize(),d.multiplyScalar(-u);var f=o.clone().multiplyScalar(t).sub(c.clone()).sub(A.clone());f.normalize(),f.multiplyScalar(-u);var p=o.clone().multiplyScalar(t).add(A.clone()).sub(c.clone());p.normalize(),p.multiplyScalar(-u),this.topLeftVec=h,this.topRightVec=d,this.bottomLeftVec=f,this.bottomRightVec=p},updateUniforms:function(e){this.calCameraVectors(),this.depthMaterial.uniforms.colorTexture.value=e.texture,this.depthMaterial.uniforms.cameraPos.value=this.renderCamera.position,this.depthMaterial.uniforms.topLeftVec.value=this.topLeftVec,this.depthMaterial.uniforms.topRightVec.value=this.topRightVec,this.depthMaterial.uniforms.bottomLeftVec.value=this.bottomLeftVec,this.depthMaterial.uniforms.bottomRightVec.value=this.bottomRightVec,this.depthMaterial.uniforms.center.value=this.center,this.depthMaterial.uniforms.fillType.value=this.fillType,this.depthMaterial.uniforms.fillColor.value=this.fillColor,this.depthMaterial.uniforms.innerRadius.value>this.maxRange&&(this.depthMaterial.uniforms.innerRadius.value=-this.radius,this.depthMaterial.uniforms.outerRadius.value=0),this.depthMaterial.uniforms.innerRadius.value+=this.frameSpeed,this.depthMaterial.uniforms.outerRadius.value=this.depthMaterial.uniforms.innerRadius.value+this.radius},ang2rad:function(e){return e*Math.PI/180},getShaderOptions:function(){var e={transparent:!0};return e.uniforms={colorTexture:{value:null},depthTexture:{value:this.depthTarget.depthTexture},cameraFar:{value:this.renderCamera.far},cameraNear:{value:this.renderCamera.near},cameraPos:{value:this.renderCamera.position.clone()},topLeftVec:{value:this.topLeftVec},topRightVec:{value:this.topRightVec},bottomLeftVec:{value:this.bottomLeftVec},bottomRightVec:{value:this.bottomRightVec},center:{value:this.center.clone()},innerRadius:{value:this.innerRadius},outerRadius:{value:this.outerRadius},fillType:{value:this.fillType},fillColor:{value:this.fillColor}},e.vertexShader="\n precision highp float;\n uniform vec3 topLeftVec;\n uniform vec3 topRightVec;\n uniform vec3 bottomLeftVec;\n uniform vec3 bottomRightVec;\n \n varying vec2 vUv;\n varying vec3 cameraVec;\n \n void main() {\n vUv = uv;\n if(uv.x < 0.5 && uv.y < 0.5) { // bottom left \n cameraVec = bottomLeftVec;\n }else if(uv.x < 0.5 && uv.y > 0.5) { // top left\n cameraVec = topLeftVec;\n }else if(uv.x > 0.5 && uv.y > 0.5) { // top right\n cameraVec = topRightVec;\n }else { // bottom right \n cameraVec = bottomRightVec;\n }\n \n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",e.fragmentShader="\n #include <packing>\n varying vec2 vUv;\n varying vec3 cameraVec;\n \n uniform float cameraFar;\n uniform float cameraNear;\n uniform vec3 cameraPos;\n uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n \n uniform vec3 center;\n uniform float innerRadius;\n uniform float outerRadius;\n uniform int fillType;\n uniform vec3 fillColor;\n \n float readClipZ( sampler2D depthSampler, vec2 coord ) {\n float fragCoordZ = texture2D( depthSampler, coord ).x;\n return perspectiveDepthToViewZ( fragCoordZ, cameraNear, cameraFar ); // 返回相机空间的 viewZ(相对于相机空间的实际z)\n }\n \n void main() {\n // gl_FragColor = vec4(1.0,0.0,0.0,1.0);\n // return;\n float clipZ = readClipZ( depthTexture, vUv );\n \n vec4 diff = texture2D( colorTexture, vUv);\n vec3 wP = cameraPos + (cameraVec)*abs(clipZ);\n \n float dis = distance(wP, center);\n float circleWidth = outerRadius - innerRadius;\n if(dis < outerRadius && dis > innerRadius) {\n if(fillType == 1) { // pure: 0 - linear: 1\n gl_FragColor = vec4(mix(diff.xyz, fillColor, (dis - innerRadius)/circleWidth), 1.0);\n }else {\n gl_FragColor = vec4(mix(diff.xyz, fillColor, 0.5), 1.0);\n }\n }else {\n gl_FragColor = diff;\n }\n }",e}});var qu=function(e){h(n,e);var t=y(n);function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(this,n),t.call(this,e)}return A(n,[{key:"init",value:function(e){this.pass=new Ju(e.scene,e.camera,e.renderer,this.options),this.pass.enabled=!0,b(u(n.prototype),"init",this).call(this)}},{key:"getSpeed",value:function(){return this.pass.frameSpeed}},{key:"setSpeed",value:function(e){if(e){var t=e/60;this.pass.frameSpeed=t}}},{key:"getRadius",value:function(){return this.pass.radius}},{key:"setRadius",value:function(e){e&&(this.pass.radius=e)}},{key:"getMaxRange",value:function(){return this.pass.maxRange}},{key:"setMaxRange",value:function(e){e&&(this.pass.maxRange=e)}},{key:"getCenter",value:function(){return this.pass.radius}},{key:"setCenter",value:function(e){e&&(this.pass.center=(new at).copy(e))}},{key:"getFillType",value:function(){return this.pass.fillType}},{key:"setFillType",value:function(e){this.pass.fillType=0==e?0:1}},{key:"getFillColor",value:function(){return this.pass.fillColor}},{key:"setFillColor",value:function(e){e&&(this.pass.fillColor=new Fn(e))}}]),n}(Bu),$u=function(e){h(n,e);var t=y(n);function n(e){var i,r=e.renderer,a=e.scene,o=e.camera,l=e.groundReflector;return s(this,n),(i=t.call(this)).renderer=r,i.scene=a,i.camera=o,i.groundReflector=l,i.needsSwap=!1,i}return A(n,[{key:"dispose",value:function(){}},{key:"render",value:function(e,t,n,i,r){this.groundReflector.doRender(this.renderer,this.scene,this.camera),this.renderToScreen?e.setRenderTarget(null):e.setRenderTarget(n),e.render(this.scene,this.camera)}},{key:"setSize",value:function(e,t){this.width=e,this.height=t,this.groundReflector.resize(e,t)}}]),n}(hu),ed=5+[.125,.215,.35,.446,.526,.582].length,td=new FA,nd=[.0205,.0855,.232,.324,.232,.0855,.0205],id=function(){function e(t){s(this,e),this._renderer=t,this._oldTarget=null,this.srcWidth=512,this.srcHeight=512,this.renderTexture=null,this._pingPongRenderTexture=null,this._lodPlanes=[],this._sizeLods=[],this.isInit=!1}return A(e,[{key:"init",value:function(){this.isInit||(this.isInit=!0,this._createPlanes(),this._blurMaterial=this._getTextureBlurShader(7),this._compileMaterial(this._blurMaterial),this._material=this._getTextureShader(),this._compileMaterial(this._material))}},{key:"dispose",value:function(){this.renderTexture&&this.renderTexture.dispose(),this._pingPongRenderTexture&&this._pingPongRenderTexture.dispose(),this._lodPlanes=[],this._sizeLods=[],this.isInit=!1,this._blurMaterial&&this._blurMaterial.dispose(),this._material&&this._material.dispose()}},{key:"fromTexture",value:function(e){return this._oldTarget=this._renderer.getRenderTarget(),this.srcWidth=e.image.width,this.srcHeight=this.srcWidth,this.init(),this.createTargets(e),this.textureUV(e),this._applyMipmap(),this.renderTexture}},{key:"textureUV",value:function(e){var t=new Qt;t.add(new Ei(this._lodPlanes[0],this._material)),this._material.uniforms.envMap.value=e,this._setViewport(this.renderTexture,0,0,this.srcWidth,this.srcHeight),this._renderer.setRenderTarget(this.renderTexture),this._renderer.render(t,td)}},{key:"_applyMipmap",value:function(){var e=this._renderer.autoClear;this._renderer.autoClear=!1;for(var t=1;t<ed;t++)this._blur(t-1,t);this._renderer.autoClear=e}},{key:"_blur",value:function(e,t){this._halfBlur(this.renderTexture,this._pingPongRenderTexture,e,t,1),this._halfBlur(this._pingPongRenderTexture,this.renderTexture,t,t,0)}},{key:"getRoughness",value:function(e){e<0&&(e=0);var t=10-e;return t>=9?t/10:t>=6?.4+(t-6)/3*.5:t>=5?.305+.095*(t-5):t>=4?.21+.095*(t-4):t/4*.21}},{key:"_halfBlur",value:function(e,t,n,i,r){var a=new Qt;a.add(new Ei(this._lodPlanes[i],this._blurMaterial));var o=this._blurMaterial.uniforms;o.envMap.value=e.texture,o.weights.value=nd,o.mipInt.value=n,o.isVertical.value=r,o.roughness.value=this.getRoughness(n)/this.getRoughness(n-1);var s=this._sizeLods[i];o.texSize.value=this._sizeLods[n],o.maxSize.value=this.srcWidth;var l=Math.max(0,this.srcWidth-2*s),A=(0===i?0:this.srcWidth)+s*(i>4?i-8+4:0);this._setViewport(t,l,A,s,s),this._renderer.setRenderTarget(t),this._renderer.render(a,td)}},{key:"_createPlanes",value:function(){for(var e=this.srcWidth,t=0;t<ed;t++){var n=e;this._sizeLods.push(n);var i=new si;i.setAttribute("position",new Yn([-1,-1,0,1,-1,0,-1,1,0,1,-1,0,1,1,0,-1,1,0],3)),i.setAttribute("uv",new Yn([0,0,1,0,0,1,1,0,1,1,0,1],2)),this._lodPlanes.push(i),e>this.srcWidth/16&&(e/=2)}}},{key:"createTargets",value:function(e){var t={magFilter:X,minFilter:X,generateMipmaps:!1,type:e?e.type:$,format:e?e.format:de,encoding:e?e.encoding:Qe,depthBuffer:!1,stencilBuffer:!1};this.renderTexture||(this.renderTexture=this.createRenderTexture(t),this.renderTexture.depthBuffer=!e),this._pingPongRenderTexture||(this._pingPongRenderTexture=this.createRenderTexture(t))}},{key:"createRenderTexture",value:function(e){var t=new dt(this.srcWidth,this.srcWidth+this.srcWidth/2,e);return t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}},{key:"_setViewport",value:function(e,t,n,i,r){e.viewport.set(t,n,i,r),e.scissor.set(t,n,i,r)}},{key:"_compileMaterial",value:function(e){var t=new Qt;t.add(new Ei(this._lodPlanes[0],e)),this._renderer.compile(t,td)}},{key:"_getTextureBlurShader",value:function(e){var t=new vl({uniforms:{envMap:{value:null},weights:{value:new Float32Array(e)},mipInt:{value:0},texSize:{value:0},maxSize:{value:0},isVertical:{value:0},roughness:{value:1}},vertexShader:this._getTextureCommonVertex(),fragmentShader:"\n precision mediump float;\n precision mediump int;\n varying vec2 vUv;\n uniform sampler2D envMap;\n uniform float weights[7];\n uniform float mipInt;\n uniform float texSize;\n uniform float maxSize;\n uniform int isVertical;\n uniform float roughness;\n\n vec3 sampleTexture(sampler2D envMap,vec2 uv,vec2 xRange,vec2 yRange){\n\n float xpercent = 1.0 / maxSize;\n float maxY = (maxSize + maxSize / 2.0);\n float ypercent = 1.0 / maxY;\n if(uv.x > xRange.y){\n uv.x = xRange.y - xpercent;\n }\n if(uv.x < xRange.x){\n uv.x = xRange.x + xpercent;\n }\n if(uv.y > yRange.y){\n uv.y = yRange.y - ypercent;;// - ypercent;\n }\n if(uv.y < yRange.x){\n uv.y = yRange.x + ypercent;\n }\n\n return texture2D(envMap,uv).rgb;\n }\n \n vec3 bilinearCubeUV(sampler2D envMap, float mipInt) {\n\n float maxY = (maxSize + maxSize / 2.0);\n vec2 uv = vUv;\n vec2 xRange = vec2(0.0,1.0);\n vec2 yRange = vec2(0.0,1.0);\n if(mipInt == 0.0 ){\n float uvx = vUv.x;\n float uvy = vUv.y * (texSize / maxY);\n uv = vec2(uvx,uvy);\n yRange.y = texSize / maxY;\n }\n else\n {\n xRange.x = (maxSize - 2.0 * texSize) / maxSize;\n xRange.y = xRange.x + texSize / maxSize;\n\n float uvx = xRange.x + (texSize / maxSize) * vUv.x;\n float uvy = vUv.y;\n if(mipInt < 5.0){\n yRange.x = maxSize / maxY;\n yRange.y = maxSize / maxY + texSize / maxY;\n uvy = yRange.x + texSize / maxY * vUv.y;\n }\n if(mipInt > 4.0){\n yRange.x = (maxSize + (mipInt - 4.0) * texSize) / maxY;\n yRange.y = (maxSize + (mipInt - 4.0) * texSize) / maxY + texSize / maxY;\n uvy = yRange.x + texSize / maxY * vUv.y;\n }\n uv = vec2(uvx,uvy);\n }\n\n float xpercent = 1.0 / maxSize;\n float ypercent = 1.0 / maxY;\n vec3 finalCol = vec3(0.0,0.0,0.0);\n float offset = 1.0;\n if(isVertical == 1){\n finalCol += sampleTexture(envMap, uv - vec2(0.0,ypercent * offset * 3.0),xRange,yRange).rgb * weights[0];\n finalCol += sampleTexture(envMap, uv - vec2(0.0,ypercent * offset * 2.0),xRange,yRange).rgb * weights[1];\n finalCol += sampleTexture(envMap, uv - vec2(0.0,ypercent * offset * 1.0),xRange,yRange).rgb * weights[2];\n finalCol += sampleTexture(envMap, uv,xRange,yRange).rgb * weights[3];\n finalCol += sampleTexture(envMap, uv + vec2(0.0,ypercent * offset * 3.0),xRange,yRange).rgb * weights[4];\n finalCol += sampleTexture(envMap, uv + vec2(0.0,ypercent * offset * 2.0),xRange,yRange).rgb * weights[5];\n finalCol += sampleTexture(envMap, uv + vec2(0.0,ypercent * offset * 1.0),xRange,yRange).rgb * weights[6];\n }else{\n finalCol += sampleTexture(envMap, uv - vec2(xpercent * offset * 3.0,0.0),xRange,yRange).rgb * weights[0];\n finalCol += sampleTexture(envMap, uv - vec2(xpercent * offset * 2.0,0.0),xRange,yRange).rgb * weights[1];\n finalCol += sampleTexture(envMap, uv - vec2(xpercent * offset * 1.0,0.0),xRange,yRange).rgb * weights[2];\n finalCol += sampleTexture(envMap, uv,xRange,yRange).rgb * weights[3];\n finalCol += sampleTexture(envMap, uv + vec2(xpercent * offset * 3.0,0.0),xRange,yRange).rgb * weights[4];\n finalCol += sampleTexture(envMap, uv + vec2(xpercent * offset * 2.0,0.0),xRange,yRange).rgb * weights[5];\n finalCol += sampleTexture(envMap, uv + vec2(xpercent * offset * 1.0,0.0),xRange,yRange).rgb * weights[6];\n }\n // finalCol = texture2D(envMap,uv).rgb;\n return finalCol * roughness;\n }\n \n void main() {\n gl_FragColor = vec4(1.0,1.0,1.0,1.0);\n gl_FragColor.rgb = bilinearCubeUV(envMap, mipInt);\n return;\n \n }\n ",blending:0,side:2,depthTest:!1,depthWrite:!1});return t.type="SphericalGaussianBlur",t}},{key:"_getTextureShader",value:function(){var e=new vl({uniforms:{envMap:{value:null},texelSize:{value:new tt(1,1)}},vertexShader:this._getTextureCommonVertex(),fragmentShader:"\n precision mediump float;\n precision mediump int;\n varying vec2 vUv;\n uniform sampler2D envMap;\n void main() {\n gl_FragColor = texture2D(envMap, vUv);\n }\n ",blending:0,depthTest:!1,depthWrite:!1});return e.type="EquirectangularToCubeUV",e}},{key:"_getTextureCommonVertex",value:function(){return"\n precision mediump float;\n precision mediump int;\n attribute vec3 position;\n attribute vec2 uv;\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = vec4( position, 1.0 );\n }\n "}}]),e}(),rd=A((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,e),this.type="ReflectorForSSRPass",this.renderer=t.renderer,this.scene=t.scene;var n=this,i=t.textureWidth||512,r=t.textureHeight||512,a=!0===t.useDepthTexture,o=new at(0,1,0),l=new at,A=new at;this.pmremGenerator=new id(this.renderer),this.maxDistance=180,this.opacity=1,n.resolution=t.resolution||new tt(window.innerWidth,window.innerHeight);var c,h=new at,u=new at,d=new at,f=new bt,p=new at(0,0,-1),m=new at,v=new at,g=new bt,y=new Ni;a&&((c=new ns).type=ee,c.minFilter=X,c.magFilter=X);var w={depthTexture:a?c:null,magFilter:X,minFilter:X,generateMipmaps:!1},x=new dt(i,r,w);this.reflectTexture=null,this.objects=[],this.planes=[],this.mainPlane=null;var b=new at;this.doRender=function(e,t,n){if(this.mainPlane&&(l.copy(n.position).normalize(),A.copy(l).reflect(o),u.setFromMatrixPosition(this.mainPlane.matrixWorld),d.setFromMatrixPosition(n.matrixWorld),f.extractRotation(this.mainPlane.matrixWorld),h.set(0,0,1),h.applyMatrix4(f),m.subVectors(u,d),!(m.dot(h)>0))){m.reflect(h).negate(),m.add(u),f.extractRotation(n.matrixWorld),p.set(0,0,-1),p.applyMatrix4(f),p.add(d),v.subVectors(u,p),v.reflect(h).negate(),v.add(u),y.position.copy(m),y.up.set(0,1,0),y.up.applyMatrix4(f),y.up.reflect(h),y.lookAt(v),y.far=n.far,y.updateMatrixWorld(),y.projectionMatrix.copy(n.projectionMatrix),g.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),g.multiply(y.projectionMatrix),g.multiply(y.matrixWorldInverse),g.multiply(this.mainPlane.matrixWorld);var i=e.getRenderTarget();this.setPlaneVisible(!1),e.setRenderTarget(x),e.state.buffers.depth.setMask(!0),!1===e.autoClear&&e.clear(),this.visibleObject(t,!1),e.render(t,y),this.visibleObject(t,!0),this.reflectTexture=this.pmremGenerator.fromTexture(x.texture).texture,this.setPlaneVisible(!0),this.refreshPlaneMaterial(n,y),e.setRenderTarget(i);var r=n.viewport;void 0!==r&&e.state.viewport(r)}},this.visibleObject=function(e,t){var n=this;0!==this.objects.length&&e.traverse((function(e){e.isMesh&&!n.objects.includes(e)&&(t?e.visible=e.cacheVisible:(e.cacheVisible=e.visible,e.visible=!1))}))},this.getRenderTarget=function(){return x},this.setPlaneVisible=function(e){for(var t=0;t<this.planes.length;t++)this.planes[t].visible=e},this.refreshPlaneMaterial=function(e,t){for(var i=0;i<this.planes.length;i++){var r=null;(r=Array.isArray(this.planes[i].material)?this.planes[i].material[0]:this.planes[i].material).ssrTexture=this.reflectTexture,r.ssrTextureMatrix=g,r.depthTexture=x.depthTexture,r.maxDistance=this.maxDistance,r.ssrOpacity=this.opacity,r.virtualCameraNear=e.near,r.virtualCameraFar=e.far,r.virtualCameraMatrixWorld=t.matrixWorld,r.virtualCameraProjectionMatrix=e.projectionMatrix,r.virtualCameraProjectionMatrixInverse=e.projectionMatrixInverse,this.planes[i].getWorldPosition(b),r.planeOffset=b.y,r.resolution=n.resolution,r.cacheEnvMap||(r.cacheEnvMap=r.envMap),r.envMap=null,r.needsUpdate=!0}},this.addPlane=function(e){0===this.planes.length&&(this.mainPlane=e),Array.isArray(e.material)?(e.material[0].ssrTextureMatrix=g,e.material[0].ssrTexture=this.reflectTexture,e.material[0].depthTexture=x.depthTexture):(e.material.ssrTextureMatrix=g,e.material.ssrTexture=this.reflectTexture,e.material.depthTexture=x.depthTexture),this.planes.push(e)},this.addObject=function(e){this.objects.push(e)},this.removePlane=function(e){this.planes.includes(e)&&(this.planes.remove(e),Array.isArray(e.material)?(e.material[0].ssrTextureMatrix=g,e.material[0].ssrTexture=null,e.material[0].depthTexture=null,e.material[0].needsUpdate=!0):(e.material.ssrTextureMatrix=g,e.material.ssrTexture=null,e.material.depthTexture=null,e.material.needsUpdate=!0)),0===this.planes.length&&(this.mainPlane=null)},this.removeObject=function(e){this.objects.includes(e)&&this.objects.remove(e)},this.dispose=function(){for(var e=0;e<this.planes.length;e++)Array.isArray(this.planes[e].material)?(this.planes[e].material[0].ssrTexture=null,this.planes[e].material[0].depthTexture=null,this.planes[e].material[0].envMap=this.planes[e].material[0].cacheEnvMap,this.planes[e].material[0].needsUpdate=!0):(this.planes[e].material.ssrTexture=null,this.planes[e].material.depthTexture=null,this.planes[e].material.envMap=this.planes[e].material.cacheEnvMap,this.planes[e].material.needsUpdate=!0);this.objects=[],this.planes=[]},this.resize=function(e,t){n.resolution.set(e,t)}})),ad=function(e){h(n,e);var t=y(n);function n(){var e;return s(this,n),(e=t.call(this)).objects=[],e.plane=null,e.planeObjects=[],e}return A(n,[{key:"init",value:function(e){this.scene=e.scene,this.camera=e.camera,this.width=e.width,this.height=e.height,this.renderer=e.renderer,this.groundPlane=new rd({textureWidth:2048,textureHeight:2048,color:16777215,useDepthTexture:!0,renderer:e.renderer,scene:this.scene}),this.pass=new $u({renderer:e.renderer,scene:this.scene,camera:this.camera,width:e.width,height:e.height,groundReflector:this.groundPlane,selects:this.objects}),this.pass.output=0}},{key:"addObject",value:function(e){this.groundPlane.addObject(e),this.objects.includes(e)||this.objects.push(e)}},{key:"addPlane",value:function(e){this.groundPlane.addPlane(e),this.planeObjects.includes(e)||this.planeObjects.push(e)}},{key:"removeObject",value:function(e){this.groundPlane.removeObject(e),this.objects.includes(e)&&this.objects.remove(e)}},{key:"removePlane",value:function(e){this.groundPlane.removePlane(e),this.planeObjects.includes(e)&&this.planeObjects.remove(e)}},{key:"clearPlane",value:function(){var e=this;this.planeObjects.map((function(t){return e.groundPlane.removePlane(t)})),this.planeObjects.length=0}},{key:"clearObject",value:function(){var e=this;this.objects.map((function(t){return e.groundPlane.removeObject(t)})),this.objects.length=0}},{key:"maxDistance",get:function(){return this.groundPlane.maxDistance},set:function(e){this.groundPlane.maxDistance=e}},{key:"opacity",get:function(){return this.groundPlane.opacity},set:function(e){this.groundPlane.opacity=e}},{key:"dispose",value:function(){this.groundPlane&&this.groundPlane.dispose()}}]),n}(Bu),od=function(){function e(t){s(this,e),this._enableUnrealBloom=!1,this._enableDof=!1,this._enableOutline=!1,this._enableColorAdjustment=!1,this._enableSSAO=!1,this.renderPass=null,this.isPostProcessingManager=!0,this.composer=null,this.processArray=[],this.outline=null,this.unrealBloom=null,this.dof=null,this.colorAdjustment=null,this.ssao=null,this.vignette=null,this._enableVignette=!1,this.circleSweep=null,this._enableCircleSweep=!1,this._enableSSR=!1,this.viewer=t,this.scene=t.scene,this.camera=t.camera,this.renderer=t.renderer,this.width=this.renderer.domElement.width,this.height=this.renderer.domElement.height,this.outline=new Tu({color:"#fff709"}),this.unrealBloom=new Du({},t),this.dof=new Nu,this.colorAdjustment=new Qu,this.ssao=new Xu,this.vignette=new Zu,this.circleSweep=new qu,this.ssr=new ad}return A(e,[{key:"enabled",get:function(){return this.processArray.length>0}},{key:"domElement",get:function(){return this.composer.renderer.domElement}},{key:"enableOutline",get:function(){return this._enableOutline},set:function(e){this.enableDof||this._enableOutline!=Boolean(e)&&(e?(this.add(this.outline),this.outline.clear()):this.remove(this.outline),this._enableOutline=e)}},{key:"enableUnrealBloom",get:function(){return this._enableUnrealBloom},set:function(e){this._enableUnrealBloom!=Boolean(e)&&(e?(this.add(this.unrealBloom),this.unrealBloom.clear()):this.remove(this.unrealBloom),this._enableUnrealBloom=e)}},{key:"enableDof",get:function(){return this._enableDof},set:function(e){this._enableDof!=Boolean(e)&&(e?this.add(this.dof):this.remove(this.dof),this._enableDof=e)}},{key:"enableColorAdjustment",get:function(){return this._enableColorAdjustment},set:function(e){this._enableColorAdjustment!==Boolean(e)&&(e?this.add(this.colorAdjustment):this.remove(this.colorAdjustment),this._enableColorAdjustment=Boolean(e))}},{key:"enableSSAO",get:function(){return this._enableSSAO},set:function(e){this._enableSSAO!==Boolean(e)&&(this.ssao.setMaxDistance(.001),this.ssao.setMinDistance(1e-4),this.ssao.setRadius(16),e?this.add(this.ssao):this.remove(this.ssao),this._enableSSAO=Boolean(e))}},{key:"enableVignette",get:function(){return this._enableVignette},set:function(e){this._enableVignette!=Boolean(e)&&(e?this.add(this.vignette):this.remove(this.vignette),this._enableVignette=e)}},{key:"enableCircleSweep",get:function(){return this._enableCircleSweep},set:function(e){this._enableCircleSweep!=Boolean(e)&&(e?this.add(this.circleSweep):this.remove(this.circleSweep),this._enableCircleSweep=e)}},{key:"enableSSR",get:function(){return this._enableSSR},set:function(e){this._enableSSR!=Boolean(e)&&(e?this.add(this.ssr):this.remove(this.ssr),this._enableSSR=e)}},{key:"_initComposer",value:function(){this.renderPass=new uu(this.scene,this.camera),this.composer=new vu(this.renderer),this.FXAA=new fu(yu),this.FXAA.uniforms.resolution.value.set(1/this.width,1/this.height);var e=this.renderer.getPixelRatio();this.SMAA=new Mu(this.width*e,this.height*e)}},{key:"add",value:function(e){var t;e&&this.processArray.indexOf(e)<0&&(this.composer||this._initComposer(),e.inited||(e.init({camera:this.camera,renderer:this.renderer,scene:this.scene,width:this.width,height:this.height,viewer:this.viewer}),e.inited=!0),this.composer.passes.length=0,this.composer.addPass(this.renderPass),(this.processArray.includes(this.ssao)||e===this.ssao)&&this.composer.addPass(this.ssao.pass),(this.processArray.includes(this.ssr)||e===this.ssr)&&this.composer.addPass(this.ssr.pass),(this.processArray.includes(this.colorAdjustment)||e===this.colorAdjustment)&&this.composer.addPass(this.colorAdjustment.pass),(this.processArray.includes(this.colorGradient)||e===this.colorGradient)&&this.composer.addPass(this.colorGradient.pass),(this.processArray.includes(this.outline)||e===this.outline)&&this.composer.addPass(this.outline.pass),(this.processArray.includes(this.unrealBloom)||e===this.unrealBloom)&&this.composer.addPass(this.unrealBloom.pass),(this.processArray.includes(this.vignette)||e===this.vignette)&&this.composer.addPass(this.vignette.pass),(this.processArray.includes(this.circleSweep)||e===this.circleSweep)&&this.composer.addPass(this.circleSweep.pass),(this.processArray.includes(this.dof)||e===this.dof)&&(this.composer.addPass(this.dof.pass),t=!0),t||this.composer.addPass(this.FXAA),this.processArray.push(e));this.enabled&&this.viewer.renderManager.setRenderer(this),setTimeout(this.viewer.renderManager.render,20)}},{key:"remove",value:function(e){e&&this.processArray.includes(e)&&(this.composer.passes.remove(e.pass),this.processArray.remove(e),e.dispose&&e.dispose()),this.enabled||this.viewer.renderManager.setRenderer(),this.viewer.renderManager.render()}},{key:"render",value:function(){this.onBeforeRender(),this.processArray.forEach((function(e){e.render()})),this.composer.render(),this.onAfterRender()}},{key:"onBeforeRender",value:function(){this.processArray.includes(this.ssao)&&(this.shadow=!1)}},{key:"onAfterRender",value:function(){this.processArray.includes(this.ssao)}},{key:"resize",value:function(e,t){this.width=e,this.height=t,this.composer.setSize(e,t),this.processArray.forEach((function(n){n.setSize(e,t)})),this.FXAA&&this.FXAA.uniforms.resolution.value.set(1/e,1/t),this.SMAA&&this.SMAA.setSize(e,t)}},{key:"dispose",value:function(){this.processArray.length=0,this.composer=null}}]),e}();function sd(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)}var ld={UPDATE:"update",CHANGE:"change",ENDED:"ended",LOOP:"loop",MAP_INIT:"map_init",MAP_LOADED:"map_loaded",MESH_LOADED:"mesh_loaded",MESH_LOAD_ERROR:"mesh_load_error"};ld.MESH_LOAD_ERROR="mesh_load_error",ld.MATERIAL_LOADED="material_loaded",ld.MATERIAL_LOAD_ERROR="material_load_error",ld.ANIMATION_LOADED="animation_loaded",ld.ANIMATION_LOAD_ERROR="animation_load_error",ld.MODEL_UPDATE="model_update",ld.START=sd()?"touchstart":"mousedown",ld.MOVE=sd()?"touchmove":"mousemove",ld.END=sd()?"touchend":"mouseup",ld.MESSAGE="message",ld.TEXTURE_LOADED="texture_loaded",ld.CLICK="click",ld.CAMERA_MOVED="camera-moved";var Ad={click:"click",rightClick:"rightClick",centerClick:"centerClick",doubleClick:"doubleClick",mousemove:"mousemove",mouseDown:"mousedown",mouseUp:"mouseup"},cd=function(){this._tweens={},this._tweensAddedDuringUpdate={},this._tweens={},this._tweensAddedDuringUpdate={}};cd.prototype={getAll:function(){return Object.keys(this._tweens).map(function(e){return this._tweens[e]}.bind(this))},removeAll:function(){this._tweens={}},add:function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},remove:function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},update:function(e,t){var n=Object.keys(this._tweens);if(0===n.length)return!1;for(e=void 0!==e?e:ud.now();n.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<n.length;i++){var r=this._tweens[n[i]];r&&!1===r.update(e)&&(r._isPlaying=!1,t||delete this._tweens[n[i]])}n=Object.keys(this._tweensAddedDuringUpdate)}return!0}};var hd,ud=new cd;ud.Group=cd,ud._nextId=0,ud.nextId=function(){return ud._nextId++},"undefined"==typeof self&&"undefined"!=typeof process&&process.hrtime?ud.now=function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?ud.now=self.performance.now.bind(self.performance):void 0!==Date.now?ud.now=Date.now:ud.now=function(){return(new Date).getTime()},ud.Tween=function(e,t){this._object=e,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._repeat=0,this._repeatDelayTime=void 0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=null,this._easingFunction=ud.Easing.Linear.None,this._interpolationFunction=ud.Interpolation.Linear,this._chainedTweens=[],this._onStartCallback=null,this._onStartCallbackFired=!1,this._onUpdateCallback=null,this._onRepeatCallback=null,this._onCompleteCallback=null,this._onStopCallback=null,this._group=t||ud,this._id=ud.nextId()},ud.Tween.prototype={getId:function(){return this._id},isPlaying:function(){return this._isPlaying},to:function(e,t){return this._valuesEnd=Object.create(e),void 0!==t&&(this._duration=t),this},duration:function(e){return this._duration=e,this},start:function(e){for(var t in this._group.add(this),this._isPlaying=!0,this._onStartCallbackFired=!1,this._startTime=void 0!==e?"string"==typeof e?ud.now()+parseFloat(e):e:ud.now(),this._startTime+=this._delayTime,this._valuesEnd){if(this._valuesEnd[t]instanceof Array){if(0===this._valuesEnd[t].length)continue;this._valuesEnd[t]=[this._object[t]].concat(this._valuesEnd[t])}void 0!==this._object[t]&&(this._valuesStart[t]=this._object[t],this._valuesStart[t]instanceof Array==!1&&(this._valuesStart[t]*=1),this._valuesStartRepeat[t]=this._valuesStart[t]||0)}return this},stop:function(){return this._isPlaying?(this._group.remove(this),this._isPlaying=!1,null!==this._onStopCallback&&this._onStopCallback(this._object),this.stopChainedTweens(),this):this},end:function(){return this.update(1/0),this},stopChainedTweens:function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop()},group:function(e){return this._group=e,this},delay:function(e){return this._delayTime=e,this},repeat:function(e){return this._repeat=e,this},repeatDelay:function(e){return this._repeatDelayTime=e,this},yoyo:function(e){return this._yoyo=e,this},easing:function(e){return this._easingFunction=e,this},interpolation:function(e){return this._interpolationFunction=e,this},chain:function(){return this._chainedTweens=arguments,this},onStart:function(e){return this._onStartCallback=e,this},onUpdate:function(e){return this._onUpdateCallback=e,this},onRepeat:function(e){return this._onRepeatCallback=e,this},onComplete:function(e){return this._onCompleteCallback=e,this},onStop:function(e){return this._onStopCallback=e,this},update:function(e){var t,n,i;if(e<this._startTime)return!0;for(t in!1===this._onStartCallbackFired&&(null!==this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),n=(e-this._startTime)/this._duration,n=0===this._duration||n>1?1:n,i=this._easingFunction(n),this._valuesEnd)if(void 0!==this._valuesStart[t]){var r=this._valuesStart[t]||0,a=this._valuesEnd[t];a instanceof Array?this._object[t]=this._interpolationFunction(a,i):("string"==typeof a&&(a="+"===a.charAt(0)||"-"===a.charAt(0)?r+parseFloat(a):parseFloat(a)),"number"==typeof a&&(this._object[t]=r+(a-r)*i))}if(null!==this._onUpdateCallback&&this._onUpdateCallback(this._object,n),1===n){if(this._repeat>0){for(t in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat){if("string"==typeof this._valuesEnd[t]&&(this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(this._valuesEnd[t])),this._yoyo){var o=this._valuesStartRepeat[t];this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=o}this._valuesStart[t]=this._valuesStartRepeat[t]}return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=e+this._repeatDelayTime:this._startTime=e+this._delayTime,null!==this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var s=0,l=this._chainedTweens.length;s<l;s++)this._chainedTweens[s].start(this._startTime+this._duration);return!1}return!0}},ud.Easing={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){return 0===e?0:1===e?1:-Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)},Out:function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin(5*(e-.1)*Math.PI)+1},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?-.5*Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)+1}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-ud.Easing.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*ud.Easing.Bounce.In(2*e):.5*ud.Easing.Bounce.Out(2*e-1)+.5}}},ud.Interpolation={Linear:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),a=ud.Interpolation.Utils.Linear;return t<0?a(e[0],e[1],i):t>1?a(e[n],e[n-1],n-i):a(e[r],e[r+1>n?n:r+1],i-r)},Bezier:function(e,t){for(var n=0,i=e.length-1,r=Math.pow,a=ud.Interpolation.Utils.Bernstein,o=0;o<=i;o++)n+=r(1-t,i-o)*r(t,o)*e[o]*a(i,o);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),a=ud.Interpolation.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(r=Math.floor(i=n*(1+t))),a(e[(r-1+n)%n],e[r],e[(r+1)%n],e[(r+2)%n],i-r)):t<0?e[0]-(a(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(a(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):a(e[r?r-1:0],e[r],e[n<r+1?n:r+1],e[n<r+2?n:r+2],i-r)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=ud.Interpolation.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:(hd=[1],function(e){var t=1;if(hd[e])return hd[e];for(var n=e;n>1;n--)t*=n;return hd[e]=t,t}),CatmullRom:function(e,t,n,i,r){var a=.5*(n-e),o=.5*(i-t),s=r*r;return(2*t-2*n+a+o)*(r*s)+(-3*t+3*n-2*a-o)*s+a*r+t}}};var dd=function(e){h(n,e);var t=y(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,n),(i=t.call(this)).clock=new lc,i._renderer=null,i._defaultRenderer=null,i.container=null,i.containerRect=null,i.renderEnabled=!1,i.scene=null,i.camera=null,i.defaultCamera=null,i.animationFrameHandler=null,i.beforeRenderQueue=[],i.afterRenderQueue=[],i.needsUpdate=!0,i.loop=!0,i.viewer=e,i.needsUpdate=!0,i.loop=!0,i.container=e.container,i.containerRect=i.container.getBoundingClientRect();var a={antialias:!0,alpha:!0,logarithmicDepthBuffer:Boolean(r.logarithmicDepthBuffer)};return(i.container.nodeName&&"CANVAS"===i.container.nodeName.toUpperCase()||i.container.tagName&&"CANVAS"===i.container.tagName.toUpperCase())&&(a.canvas=i.container),i._renderer=new $a(a),i._renderer.setClearAlpha(0),i._renderer.setPixelRatio(window.devicePixelRatio),i._renderer.setSize(i.containerRect.width,i.containerRect.height),i._defaultRenderer=i._renderer,i.domElement.style.backgroundColor="#000",void 0===a.canvas&&i.container.appendChild(i.domElement),i}return A(n,[{key:"domElement",get:function(){return this.getRenderer().domElement}},{key:"defaultRenderer",get:function(){return this._defaultRenderer}},{key:"renderer",get:function(){return this._renderer}},{key:"setRenderer",value:function(e){this._renderer=void 0!==e?e:this._defaultRenderer}},{key:"getRenderer",value:function(){return this._renderer||(this._renderer=this.defaultRenderer),this._renderer.isPostProcessingManager?this._renderer.composer.renderer:this._renderer}},{key:"setCamera",value:function(e){this.camera=void 0!==e?e:this.defaultCamera}},{key:"setLoop",value:function(e){this.loop=e,this.animate()}},{key:"render",value:function(e){this.renderEnabled=!0,e&&this.animate()}},{key:"render2",value:function(e,t){var n=this;e||(e=this.scene),t||(t=this.camera);var i=this.clock.getDelta();this.moduleManager.update(i),this._onBeforeRender(i),this.beforeRenderQueue.map((function(r){"function"==typeof r&&r(n._renderer,e,t,i)})),this._renderer.render(e,t),this.afterRenderQueue.map((function(r){"function"==typeof r&&r(n._renderer,e,t,i)})),ud.update(),this._onAfterRender(i),this.animationFrameHandler&&cancelAnimationFrame(this.animationFrameHandler),this.loop&&(this.animationFrameHandler=requestAnimationFrame((function(){n.animate()}))),this.dispatchEvent({type:ld.UPDATE})}},{key:"animate",value:function(){var e=this;if(this.renderEnabled&&this.needsUpdate){var t=this.clock.getDelta();this.moduleManager.update(t),this._onBeforeRender(t),this.beforeRenderQueue.map((function(n){"function"==typeof n&&n(e._renderer,e.scene,e.camera,t)})),this._renderer.render(this.scene,this.camera),this.afterRenderQueue.map((function(n){"function"==typeof n&&n(e._renderer,e.scene,e.camera,t)})),ud.update(),this._onAfterRender(t),this.animationFrameHandler&&cancelAnimationFrame(this.animationFrameHandler),this.loop&&(this.animationFrameHandler=requestAnimationFrame((function(){e.animate()}))),this.dispatchEvent({type:ld.UPDATE})}}},{key:"addBeforeRenderTask",value:function(e){this.beforeRenderQueue.includes(e)||this.beforeRenderQueue.push(e)}},{key:"removeBeforeRenderTask",value:function(e){this.beforeRenderQueue.includes(e)&&this.beforeRenderQueue.remove(e)}},{key:"addAfterRenderTask",value:function(e){this.afterRenderQueue.includes(e)||this.afterRenderQueue.push(e)}},{key:"removeAfterRenderTask",value:function(e){this.afterRenderQueue.includes(e)&&this.afterRenderQueue.remove(e)}},{key:"_onBeforeRender",value:function(e){var t=this,n=this.getRenderer();this.scene.getObjectByName("root").traverse((function(i){i.onBeforeRender&&i.onBeforeRender(n,t.scene,t.camera,e)}))}},{key:"_onAfterRender",value:function(e){var t=this,n=this.getRenderer();this.scene.getObjectByName("root").traverse((function(i){i.update&&i.update(e),i.onAfterRender&&i.onAfterRender(n,t.scene,t.camera,e)}))}},{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=this.container.getBoundingClientRect(),this.containerRect=e,this.getRenderer().setSize(e.width,e.height),this._renderer.composer&&this._renderer.resize(e.width,e.height),this.render()}},{key:"disabled",value:function(){this.needsUpdate=!1}},{key:"dispose",value:function(){cancelAnimationFrame(this.animationFrameHandler),this.setRenderer(),this._renderer.dispose(),this._renderer.forceContextLoss(),this._renderer=null,this.disabled()}}]),n}(Je),fd=function(){function e(){s(this,e)}return A(e,null,[{key:"create",value:function(t,n){var i=new dd(t,n);return e.RenderManagerArray.push(i),i}},{key:"render",value:function(t){for(var n=0;n<e.RenderManagerArray.length;n++)e.RenderManagerArray[n].render(t)}},{key:"getDefaultRenderer",value:function(){return e.RenderManagerArray[0].defaultRenderer}}]),e}();fd.RenderManagerArray=[];var pd=function(e){var t=e.index,n=e.attributes;if(null!==t&&void 0!==n.position&&void 0!==n.normal&&void 0!==n.uv){var i=t.array,r=n.position.array,a=n.normal.array,o=n.uv.array,s=r.length/3;void 0===n.tangent&&e.setAttribute("tangent",new zn(new Float32Array(4*s),4));for(var l=n.tangent.array,A=[],c=[],h=0;h<s;h++)A[h]=new at,c[h]=new at;var u=new at,d=new at,f=new at,p=new tt,m=new tt,v=new tt,g=new at,y=new at,w=e.groups;0===w.length&&(w=[{start:0,count:i.length}]);h=0;for(var x=w.length;h<x;++h)for(var b=F=(L=w[h]).start,M=F+L.count;b<M;b+=3)k(i[b+0],i[b+1],i[b+2]);var C,B,E,S=new at,T=new at,_=new at,I=new at;for(h=0,x=w.length;h<x;++h){var L,F;for(b=F=(L=w[h]).start,M=F+L.count;b<M;b+=3)P(i[b+0]),P(i[b+1]),P(i[b+2])}}else console.warn("BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");function k(e,t,n){u.fromArray(r,3*e),d.fromArray(r,3*t),f.fromArray(r,3*n),p.fromArray(o,2*e),m.fromArray(o,2*t),v.fromArray(o,2*n);var i=d.x-u.x,a=f.x-u.x,s=d.y-u.y,l=f.y-u.y,h=d.z-u.z,w=f.z-u.z,x=m.x-p.x,b=v.x-p.x,M=m.y-p.y,C=v.y-p.y,B=x*C-b*M,E=1;0!=B&&(E=1/B),0==M&&0==C?g.set(i-a,s-l,h-w):g.set((C*i-M*a)*E,(C*s-M*l)*E,(C*h-M*w)*E),0==x&&0==b?y.set((a-i)*E,(l-s)*E,(w-h)*E):y.set((x*a-b*i)*E,(x*l-b*s)*E,(x*w-b*h)*E),A[e].add(g),A[t].add(g),A[n].add(g),c[e].add(y),c[t].add(y),c[n].add(y)}function P(e){_.fromArray(a,3*e),I.copy(_),B=A[e],S.copy(B),S.sub(_.multiplyScalar(_.dot(B))).normalize(),T.crossVectors(I,B),E=T.dot(c[e]),C=E<0?-1:1,l[4*e]=S.x,l[4*e+1]=S.y,l[4*e+2]=S.z,l[4*e+3]=C}},md=null;try{var vd="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||"function"==typeof require&&require("worker_threads");md=vd.Worker}catch(QL){}function gd(e,t,n){var i=void 0===t?null:t,r=function(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}(e,void 0!==n&&n),a=r.indexOf("\n",10)+1,o=r.substring(a)+(i?"//# sourceMappingURL="+i:"");return function(e){return new md(o,Object.assign({},e,{eval:!0}))}}function yd(e,t,n){var i=void 0===t?null:t,r=function(e,t){var n=atob(e);if(t){for(var i=new Uint8Array(n.length),r=0,a=n.length;r<a;++r)i[r]=n.charCodeAt(r);return String.fromCharCode.apply(null,new Uint16Array(i.buffer))}return n}(e,void 0!==n&&n),a=r.indexOf("\n",10)+1,o=r.substring(a)+(i?"//# sourceMappingURL="+i:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}var wd="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);function xd(e,t,n){return wd?gd(e,t,n):function(e,t,n){var i;return function(r){return i=i||yd(e,t,n),new Worker(i,r)}}(e,t,n)}var bd=xd("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qKioNCiAgICAgKiDlpITnkIbmlofku7bliqDovb3lj4rop6PmnpANCiAgICAgKi8KCiAgICAvKirnirbmgIEqLwogICAgdmFyIFNUQVRVUyA9IHsKICAgICAgQ29tcGxldGU6ICdjb21wbGV0ZScsCiAgICAgIFByb2dyZXNzOiAncHJvZ3Jlc3MnLAogICAgICBFcnJvcjogJ2Vycm9yJwogICAgfTsKICAgIC8qKuaOpeaUtua2iOaBryovCgogICAgc2VsZi5vbm1lc3NhZ2UgPSBmdW5jdGlvbiAoZSkgewogICAgICBzd2l0Y2ggKGUuZGF0YS5jbWQpIHsKICAgICAgICBjYXNlICdtZXNoJzoKICAgICAgICAgIGxvYWRNZXNoKGUuZGF0YS5kYXRhKTsKICAgICAgICAgIGJyZWFrOwoKICAgICAgICBjYXNlICdpbWcnOgogICAgICAgICAgcHJlbG9hZEltYWdlKGUuZGF0YS5kYXRhKTsKICAgICAgICAgIGJyZWFrOwogICAgICB9CiAgICB9OwogICAgLyoqDQogICAgICog5Y+R6YCB5raI5oGvDQogICAgICogQHBhcmFtIHN0YXR1cyDnirbmgIENCiAgICAgKiBAcGFyYW0gZGF0YSDopoHlj5HpgIHnmoTmlbDmja4NCiAgICAgKi8KCgogICAgZnVuY3Rpb24gcG9zdE1zZyhzdGF0dXMsIHRhc2ssIGRhdGEpIHsKICAgICAgcG9zdE1lc3NhZ2UoewogICAgICAgIHN0YXR1czogc3RhdHVzLAogICAgICAgIHRhc2s6IHRhc2ssCiAgICAgICAgZGF0YTogZGF0YSwKICAgICAgICB0aW1lOiBuZXcgRGF0ZSgpCiAgICAgIH0pOwogICAgfQogICAgLyoq5Yqg6L29572R5qC85paH5Lu2Ki8KCiAgICBmdW5jdGlvbiBsb2FkTWVzaCh1cmwpIHsKICAgICAgLy8gY29uc29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EYXRhLmsubGVuZ3RoID4gMCkgewogICAgICAgICAgICBnZW9EYXRhLmsgPSBuZXcgRmxvYXQzMkFycmF5KGdlb0RhdGEuayk7CiAgICAgICAgICB9IC8vdXYyCgoKICAgICAgICAgIGlmIChnZW9EYXRhLmwgJiYgZ2VvRGF0YS5sLmxlbmd0aCA+IDApIHsKICAgICAgICAgICAgZ2VvRGF0YS5sID0gbmV3IEZsb2F0MzJBcnJheShnZW9EYXRhLmwpOwogICAgICAgICAgfQogICAgICAgIH0KICAgICAgfQoKICAgICAgcG9zdE1zZyhTVEFUVVMuQ29tcGxldGUsICdtZXNoJywgZGF0YSk7CiAgICB9Cgp9KSgpOwoK",null,!1),Md=function(){function e(){s(this,e),this._worker=void 0}return A(e,[{key:"loadMesh",value:function(e,t,n,i){var r=this;this._load("mesh",e,(function(e){t(e),r.closeWorker()}),n,i)}},{key:"preloadMap",value:function(e,t,n){this._load("img",e,t,void 0,n)}},{key:"closeWorker",value:function(){this._worker.terminate()}},{key:"_load",value:function(e,t,n,i,r){"undefined"!=typeof Worker?(this._worker||(this._worker=new bd),this._worker.onmessage=function(t){if(t.data.task==e)switch(t.data.status){case"complete":n&&n(t.data.data);break;case"progress":i&&i(t.data.data);break;case"error":r&&r(t.data.data)}},this._worker.postMessage({cmd:e,data:t})):console.log("浏览器不支持worker")}}]),e}(),Cd=function(e){h(n,e);var t=y(n);function n(){return s(this,n),t.call(this)}return A(n,[{key:"dispatchEvent",value:function(e,t){b(u(n.prototype),"dispatchEvent",this).call(this,{type:e,data:t})}}]),n}(Je),Bd="playing",Ed="pause",Sd="stop",Td=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),(i=t.call(this))._rootModel=e,i._speed=1,i._clock=new lc,i._mixer=null,i._animNameList=[],i._currentAnimName="",i._animStatus=Sd,i._isKeepByFinish=!0,i._isUpdate=!1,i._clipMap=new Map,i._currentAction=null,i._completeAction=null,i._lastAction=null,i._loop=!0,i.idMaps=new Map,i}return A(n,[{key:"speed",get:function(){return this._speed},set:function(e){this._speed=e,this._currentAction&&this._currentAction.setEffectiveTimeScale(this._speed)}},{key:"loop",get:function(){return this._loop},set:function(e){this._loop=e,this._currentAction&&this._currentAction.setLoop(this._loop?Le:Ie)}},{key:"isKeepByFinish",get:function(){return this._isKeepByFinish},set:function(e){this._isKeepByFinish=e,this._currentAction&&(this._currentAction.clampWhenFinished=this._isKeepByFinish)}},{key:"setLoop",value:function(e){this.loop=e}},{key:"setAnimationList",value:function(e){this._animNameList=e}},{key:"getMixer",value:function(){var e=this;return this._mixer||(this._mixer=new Dc(this._rootModel),this._mixer.addEventListener("finished",(function(){e.onEnded&&e.onEnded(),e.dispatchEvent(ld.ENDED),e._loop||(e._animStatus=Sd,e.isKeepByFinish||(e._currentAction=null),e._lastAction=null,e._completeAction&&e._completeAction())}))),this._mixer}},{key:"addClip",value:function(e){var t=this.getMixer().clipAction(e);this._clipMap.set(e.name,t)}},{key:"setUpdateStatus",value:function(e){if(e){if(this._isUpdate)return;this._isUpdate=e,this._clock.start(),this._update=this.update.bind(this),this._rootModel.viewer.renderManager.addAfterRenderTask(this._update)}else{if(!this._isUpdate)return;this._isUpdate=e,this._rootModel.viewer.renderManager.removeAfterRenderTask(this._update),this._update=null}}},{key:"getList",value:function(){return this._animNameList}},{key:"getStatus",value:function(){return this._animStatus}},{key:"getLengthByName",value:function(e){var t=this._clipMap.get(e);return t?t._clip.duration:(console.warn("getLengthByName: 动画不存在",e),0)}},{key:"getCurrentClipName",value:function(){return this._currentAction?this._currentAction._clip.name:""}},{key:"setCompleteAction",value:function(e){this._completeAction=e}},{key:"getClip",value:function(e){if(0!==this._animNameList.length){e||(e=this._animNameList[0]);var t=this._clipMap.get(e);if(t)return t;console.warn("play: 播放动画 "+e+" 不存在")}}},{key:"locateToSpecificFrame",value:function(e,t){this._currentAction&&this._currentAction.name==e||this.getClip(e)&&(this.play(e),this.pause());var n=t*this._currentAction._clip.duration;this.setCurrentTime(n)}},{key:"_play",value:function(e,t,n){var i=this.getClip(e);i&&(this._currentAction?(this.pause(),this._currentAction=i):this._currentAction=i,this._animStatus=Bd,this._currentAction.setEffectiveTimeScale(n),this._currentAction.clampWhenFinished=this._isKeepByFinish,this._currentAction.setLoop(t?Le:Ie),this.reset(),this._currentAction.play(),this.setUpdateStatus(!0),this.update())}},{key:"_playByCrossFade",value:function(e,t,n,i){if(t<=0||!this._currentAction)this._play(e,n,i);else{var r=this.getClip(e,n,i);if(r){if(this._currentAction==r)return this._lastAction=null,void this._play(e,n,i);this._lastAction=this._currentAction,this._currentAction=r,this._animStatus=Bd,this._currentAction.setEffectiveTimeScale(i),this._currentAction.clampWhenFinished=this._isKeepByFinish,this._currentAction.setLoop(n?Le:Ie),this._lastAction.crossFadeTo(this._currentAction,t,!0),this.setUpdateStatus(!0)}}}},{key:"play",value:function(e,t,n){null==t&&null==t||(this._loop=t),null!=n&&null!=n&&(this._speed=n),this._isSection=!1,this._play(e,this._loop,this._speed)}},{key:"playByCrossFade",value:function(e,t,n,i){null==n&&null==n||(this._loop=n),null!=i&&null!=i&&(this._speed=i),this._isSection=!1,this._playByCrossFade(e,t,this._loop,this._speed)}},{key:"pause",value:function(){this._currentAction&&this._currentAction.isRunning()&&(this._currentAction.paused=!0,this._animStatus=Ed),this._lastAction&&(this._lastAction.pause=!0)}},{key:"resume",value:function(){this._currentAction&&(this._currentAction.paused=!1,this._currentAction.isRunning()&&(this._animStatus=Bd)),this._lastAction&&(this._lastAction.pause=!1)}},{key:"stop",value:function(){this._currentAction&&this._currentAction.stop(),this._lastAction&&(this._lastAction=null),this._animStatus=Sd,this._currentAction=null,this.setUpdateStatus(!1)}},{key:"reset",value:function(){var e=this.getMixer();e&&(e.setTime(0),e.stopAllAction())}},{key:"setCurrentTime",value:function(e){null!=e&&null!=e?this._currentAction&&(this._currentAction.time=e):console.warn("setCurrentTime: 请设置时间",e)}},{key:"getCurrentDuration",value:function(){return this._currentAction&&this._currentAction._clip?this._currentAction._clip.duration:0}},{key:"getCurrentTime",value:function(){return this._currentAction?this._currentAction.time:0}},{key:"update",value:function(){if(this._mixer){var e=this._clock.getDelta();this._isSection&&this._animStatus===Bd&&(this._playTime+=e,this._playTime>=this._endTime&&(this.setCurrentTime(this._endTime),this.pause(),this._playTime=this._startTime)),this._mixer.update(e)}}},{key:"hasAnimation",value:function(){return this._animNameList.length>0}},{key:"list",value:function(){return this._animNameList}},{key:"playByTime",value:function(e,t,n){this._startTime=t,this._endTime=n,this._playTime=this._startTime,this._isSection=!0,this._play(e,this._loop,this._speed),this.setCurrentTime(this._startTime)}},{key:"clone",value:function(e){var t=this,i=new n(e);return i._speed=this._speed,i._paused=this._paused,i._clock=new lc,i._stopped=this._stopped,i.loop=this.loop,i.setAnimationList(this.getList()),this._clipMap.forEach((function(n){var r=n._clip;i.addClip(t.cloneAnimationClip(r,e))})),i}},{key:"cloneAnimationClip",value:function(e,t){if(e&&e.tracks){var n="BinLoader";n=t.modelPath.indexOf(".mbin")>-1||t.modelPath.indexOf(".mrmb")>-1?"BinLoader":"NewLoader";for(var i=[],r=0;r<e.tracks.length;r++){var a=e.tracks[r],o=a.name.lastIndexOf(".")+1,s=a.name.substr(o)[0],l=a.name.substr(0,o-1),A=this.idMaps.get(l);if(A)this.idMaps.set(l,A);else{var c=void 0;if(!(c="BinLoader"==n?t.getObjectByProperty("lastUUID",l):t.getObjectByProperty("name",l)))continue;A=c.uuid}"p"==s?i.push(new Ql(A+".position",a.times,a.values)):"s"==s?i.push(new Ql(A+".scale",a.times,a.values)):"q"==s&&i.push(new Nl(A+".quaternion",a.times,a.values))}return new Gl(e.name,e.duration,i)}}},{key:"dispose",value:function(){this._clipMap.clear(),this._clipMap=null,this._mixer=null}}]),n}(Cd),_d=function(){function e(t){var n=this;s(this,e),this.renderManager=t.viewer.renderManager,this.objects=[],t.traverse((function(e){e.isMesh&&(n.objects.push(e),e.defaultMat=e.material)})),this.normalMaterial=new bl}return A(e,[{key:"applyUV",value:function(e){var t=(new tA).load(e);this.objects.forEach((function(e){if(Array.isArray(e.material))for(var n=0;n<e.material.length;n++)e.material[n]=new El({albedo:t});else e.material=new El({albedo:t})})),this.renderManager.render()}},{key:"applyNormal",value:function(){var e=this;this.objects.forEach((function(t){t.material=e.normalMaterial})),this.renderManager.render()}},{key:"applyWireFrame",value:function(){this.resetMaterial(),this.objects.forEach((function(e){Array.isArray(e.material)?e.material.forEach((function(e){e.wireframe=!0})):e.material.wireframe=!0})),this.renderManager.render()}},{key:"resetMaterial",value:function(){this.objects.forEach((function(e){e.material=e.defaultMat,Array.isArray(e.material)?e.material.forEach((function(e){e.wireframe=!1})):e.material.wireframe=!1})),this.renderManager.render()}}]),e}(),Id=function(e){h(n,e);var t=y(n);function n(e,i,r,a){var o,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"#FFFFFF";return s(this,n),(o=t.call(this)).length=i,o.width=r,o.height=a,o.color=l,e&&(o.object=e,o._draw(i,r,a)),o}return A(n,[{key:"_draw",value:function(e,t,n){var i;i=this.object.isBox3?this.object:(new tn).setFromObject(this.object);var r=new at;i.getSize(r),this.maxLength=Math.max(r.x,r.y,r.z),this.textScale=2,this.textMeshScale=.002*this.maxLength,this.fontSize=20*this.textScale;var a=new at;i.getCenter(a);var o=.03*this.maxLength,s=.2*this.maxLength,l=.5*this.fontSize*this.textMeshScale/this.textScale,A=new at(i.min.x,i.max.y+s,a.z),c=new at(i.max.x,i.max.y+s,a.z);void 0!==e&&""!==e||(e=A.distanceTo(c).toFixed(4));var h=this._drawLine(A,c);h.rotation.z=Math.PI/2;var u=new at(A.x,A.y+l,A.z),d=new at(A.x,A.y-l,A.z);h=this._drawLine(u,d),u.set(c.x,c.y+l,c.z),d.set(c.x,c.y-l,c.z),h=this._drawLine(u,d);var f=this._drawText(e,new at(a.x,i.max.y+o+s,a.z)),p=f.clone();this.add(p),p.rotation.y=Math.PI,this.lengthMesh=f,this.lengthMesh.back=p,A.set(i.min.x-s,i.min.y,(i.max.z+i.min.z)/2),c.set(i.min.x-s,i.max.y,(i.max.z+i.min.z)/2),h=this._drawLine(A,c),void 0!==n&&""!==n||(n=A.distanceTo(c).toFixed(4)),u.set(A.x+l,A.y,A.z),d.set(A.x-l,A.y,A.z),(h=this._drawLine(u,d)).rotation.z=Math.PI/2,u.set(c.x+l,c.y,c.z),d.set(c.x-l,c.y,c.z),(h=this._drawLine(u,d)).rotation.z=Math.PI/2;var m=this._drawText(n,new at(i.min.x-o-s,a.y,a.z)),v=m.clone();this.add(v),v.position.x-=o/2,m.rotation.z=v.rotation.z=Math.PI/2,v.rotation.y=Math.PI,this.heightMesh=m,this.heightMesh.back=v,A.set(i.max.x+s,a.y,i.min.z),c.set(i.max.x+s,a.y,i.max.z),(h=this._drawLine(A,c)).rotation.x=Math.PI/2,void 0!==t&&""!==t||(t=A.distanceTo(c).toFixed(4)),u.set(A.x,A.y+l,A.z),d.set(A.x,A.y-l,A.z),h=this._drawLine(u,d),u.set(c.x,c.y+l,c.z),d.set(c.x,c.y-l,c.z),h=this._drawLine(u,d);var g=this._drawText(t,new at(i.max.x+s,a.y+o,a.z)),y=g.clone();this.add(y),g.rotation.y=y.rotation.y=Math.PI/2,y.rotation.y=-Math.PI/2,this.widthMesh=g,this.widthMesh.back=y}},{key:"updateSize",value:function(e,t,n){this.lengthMesh&&void 0!==e&&""!==e&&this._updateTextMesh(this.lengthMesh,e),this.widthMesh&&void 0!==t&&""!==t&&this._updateTextMesh(this.widthMesh,t),this.heightMesh&&void 0!==n&&""!==n&&this._updateTextMesh(this.heightMesh,n)}},{key:"_updateTextMesh",value:function(e,t){var n=e.material,i=n.map.image;this._fillText(n.map.image,t),n.map.needsUpdate=!0,n.needsUpdate=!0,e.back.material.map.needsUpdate=!0,e.back.material.needsUpdate=!0,e.back.geometry.dispose(),e.geometry.dispose(),e.back.geometry=e.geometry=new $i(i.width*this.textMeshScale/this.textScale,i.height*this.textMeshScale/this.textScale)}},{key:"_drawLine",value:function(e,t){var n=.005*this.maxLength*.5,i=new Ei(new ki(n,e.distanceTo(t),n),new Nn({color:this.color,side:2}));return i.position.copy(e.clone().add(t).multiplyScalar(.5)),i.renderOrder=5e3,this.add(i),i}},{key:"_drawText",value:function(e,t){var n=document.createElement("canvas");n.height=this.fontSize,this._fillText(n,e);var i=new $i(n.width*this.textMeshScale/this.textScale,n.height*this.textMeshScale/this.textScale),r=new ts(n);r.anisotropy=16;var a=new Nn({map:r,transparent:!0});a.depthTest=!1;var o=new Ei(i,a);return o.position.copy(t),this.add(o),o}},{key:"_fillText",value:function(e,t){var n=this.fontSize+"px 宋体";e.width=this._measureTextWidth(n,t);var i=e.getContext("2d");i.clearRect(0,0,e.width,e.height),i.font=n,i.fillStyle=this.color,i.textAlign="left",i.textBaseline="top",i.fillText(t,0,0)}},{key:"_measureTextWidth",value:function(e,t){this._measureCanvas||(this._measureCanvas=document.createElement("canvas"),this._measureCanvas.height=100,this._measureCanvas.width=100);var n=this._measureCanvas.getContext("2d");return n.font=e,n.measureText(t).width}},{key:"show",value:function(e,t,n,i){e&&this.object!==e&&(this.object=e),this.object&&this._draw(t,n,i),this.object.viewer.renderManager.render(!0)}},{key:"dispose",value:function(){}}]),n}(zt),Ld=function(e){h(n,e);var t=y(n);function n(e,i){var r;s(this,n),(r=t.call(this)).object=e,r.options=i||{},void 0===r.options.exposeFactor&&(r.options.exposeFactor=2),void 0===r.options.exposeByPart&&(r.options.exposeByPart=!1),void 0===r.options.exposeType&&(r.options.exposeType="NORMAL"),r.segments=3,r.prePercent=0,r.allModels=[];var a=r.object.getObjectByName("shadow");return r.options.exposeByPart?a.parent.children.forEach((function(e){e===a||e.isHotSpotEntity||e.children.forEach((function(e){r.allModels.push(e)}))})):r.object.traverse((function(e){e.geometry&&"shadow"!==e.name&&!e.isHotSpotEntity&&r.allModels.push(e)})),r.setMode(r.options.exposeType),r.object.viewer.renderManager.render(),r.exposeType=r.options.exposeType,r}return A(n,[{key:"setMode",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"NORMAL",n=new at,i=new at,r=(new tn).setFromObject(this.object);switch(r.getCenter(n),r.getSize(i),t){case"SPHERE":var a=this.allModels.length,o=Math.ceil(Math.sqrt(a)),s=this._genSphereGeo(o,a),l=s.length,A=[],c=Math.max(i.x,i.y,i.z);this.allModels.forEach((function(t){var n=e._getRandom(l,A);A.push(n);var i=s[n].clone().normalize();t.direct=i.clone().multiplyScalar(c*e.options.exposeFactor)}));break;case"SEGMENT":var h=i.y/this.segments;this.allModels.forEach((function(t){var n=(new tn).setFromObject(t);t.direct||(t.direct=new at),n.getCenter(t.direct),n&&n.getCenter&&t.direct.set(0,h*Math.floor(t.direct.y/h),0).multiplyScalar(e.options.exposeFactor)}));break;default:this.allModels.forEach((function(i){var r=(new tn).setFromObject(i);i.direct||(i.direct=new at),r.getCenter(i.direct),r&&r.getCenter&&(i.direct.sub(n).multiplyScalar(e.options.exposeFactor),"VERTICAL"===t&&(i.direct.x=i.direct.z=0),"HORIZONTAL"===t&&(i.direct.y=i.direct.z=0))}))}this.exposeType=t}},{key:"applyScalar",value:function(e){var t=e-this.prePercent;this.prePercent=e,this.allModels.forEach((function(e){if(e.parent&&e.direct&&!e.isAmrtAlphaHotSpotEntity){var n=e.getWorldPosition(new at);n.add(e.direct.clone().multiplyScalar(t));var i=e.parent.worldToLocal(n);e.position.copy(i)}})),this.object.viewer.renderManager.render(),this.dispatchEvent(ld.CHANGE,e)}},{key:"setSegment",value:function(e){this.stop(),this.segments=e,"SEGMENT"==this.exposeType&&this.setMode(this.exposeType)}},{key:"play",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.stop();var n={t:0};this.tween=new ud.Tween(n).to({t:1},t.time||3e3).onUpdate((function(){e.applyScalar(n.t)})).onComplete((function(){t.onComplete&&t.onComplete()})).repeat(void 0!==t.loop&&null!==t.loop?t.loop-1:0).start()}},{key:"stop",value:function(){this.tween&&this.tween.stop(),this.applyScalar(0)}},{key:"_getRandom",value:function(e,t){var n=Math.floor(Math.random()*e);return t.indexOf(n)>-1?this._getRandom(e,t):n}},{key:"_genSphereGeo",value:function(e,t){var n=new $s(1,e,e),i=this._removeRepeat(n.vertices);return i.length<t?this._genSphereGeo(e+1,t):i}},{key:"_removeRepeat",value:function(e){var t=[],n=this;return e.forEach((function(e){t.find((function(t){return n._equalV(e,t)}))||t.push(e)})),t}},{key:"_equalF",value:function(e,t){return parseFloat(Number(e).toFixed(10))===parseFloat(Number(t).toFixed(10))}},{key:"_equalV",value:function(e,t){return this._equalF(e.x,t.x)&&this._equalF(e.y,t.y)&&this._equalF(e.z,t.z)}}]),n}(Cd),Fd=function(){function e(t){s(this,e),this.model=t,this._visible=!1,this.time=0,this._isInit=!1,this.objects=t.objects}return A(e,[{key:"visible",get:function(){return this._visible},set:function(e){this._visible!==e&&(this._visible=e,this._visible&&!this._isInit&&(this.init(),this._isInit=!0),this._isInit&&(this._visible?this.start():this.disable()),this.setVisible(this._visible))}},{key:"IsInit",get:function(){return this._isInit}},{key:"setVisible",value:function(e){}},{key:"init",value:function(){}},{key:"start",value:function(){}},{key:"disable",value:function(){}},{key:"destory",value:function(){this.time=0,this._isInit=!1}},{key:"setObjects",value:function(e){this.objects=e}}]),e}(),kd=function(){function e(t,n){if(s(this,e),this.mesh=n,this.root=t,this.triangleMap=new Map,this.root){var i=new bt;i.getInverse(this.root.matrixWorld.clone()),this.rootLocalMatrix=this.mesh.matrixWorld.clone().premultiply(i)}}return A(e,[{key:"calculation",value:function(){if(this.mesh.geometry.index)for(var e=this.mesh.geometry.index.array,t=this.mesh.geometry.getAttribute("position").array,n=0;n<e.length;n+=3){var i=new at(t[3*e[n]],t[3*e[n]+1],t[3*e[n]+2]);this.root&&i.applyMatrix4(this.rootLocalMatrix);var r=new at(t[3*e[n+1]],t[3*e[n+1]+1],t[3*e[n+1]+2]);this.root&&r.applyMatrix4(this.rootLocalMatrix);var a=new at(t[3*e[n+2]],t[3*e[n+2]+1],t[3*e[n+2]+2]);this.root&&a.applyMatrix4(this.rootLocalMatrix),this.calculationFace(i,r,a)}else for(var o=this.mesh.geometry.faces,s=this.mesh.geometry.vertices,l=0;l<o.length;l++){var A=o[l],c=new at(s[A.a].x,s[A.a].y,s[A.a].z);this.root&&c.applyMatrix4(this.rootLocalMatrix);var h=new at(s[A.b].x,s[A.b].y,s[A.b].z);this.root&&h.applyMatrix4(this.rootLocalMatrix);var u=new at(s[A.c].x,s[A.c].y,s[A.c].z);this.root&&u.applyMatrix4(this.rootLocalMatrix),this.calculationFace(c,h,u)}for(var d=[],f=this.getPenEdge(),p=0;p<f.length;p++)d.push.apply(d,C(f[p].p));return d}},{key:"calculationFace",value:function(e,t,n){var i=e.clone().sub(t),r=n.clone().sub(t),a=i.cross(r);this.calculationEdge(e,t,a),this.calculationEdge(t,n,a),this.calculationEdge(n,e,a)}},{key:"calculationEdge",value:function(e,t,n){var i=this.getEdgeKey(e,t),r=this.triangleMap.get(i);if(r){if(r.isRecommend++,!r.isPen)if(0!==r.normal.lengthSq()&&0!==n.lengthSq())r.normal.angleTo(n)>=45*et.DEG2RAD&&(r.isPen=!0)}else{var a=this.getEdgeKey(t,e),o={normal:n,startPoint:e,endPoint:t,isRecommend:1};this.triangleMap.set(i,o),this.triangleMap.set(a,o)}}},{key:"getEdgeKey",value:function(e,t){return e.x+"_"+e.y+"_"+e.z+"_"+t.x+"_"+t.y+"_"+t.z}},{key:"getPenEdge",value:function(){var e=[];return this.triangleMap.forEach((function(t){if(!t.isResolve&&(t.isPen||1===t.isRecommend)){t.isResolve=!0;e.push({s:t.startPoint,p:[t.startPoint.x,t.startPoint.y,t.startPoint.z,t.endPoint.x,t.endPoint.y,t.endPoint.z],e:t.endPoint})}})),e}}]),e}(),Pd=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),(i=t.call(this,e))._isCombine=!0,i.lineRoots=[],i._color=null,i._isHideModel=!1,i}return A(n,[{key:"init",value:function(){b(u(n.prototype),"init",this).call(this),this.lineMat=new Do({color:this._color||255}),this.setFromObject()}},{key:"isCombine",set:function(e){this._isCombine=e,this._isInit&&this.setFromObject()}},{key:"isHideModel",set:function(e){this._isHideModel=e,this._isInit&&this.visible&&this.setModelActive(this._isHideModel)}},{key:"color",set:function(e){this._color=e,this._isInit&&(this.lineMat.color.set(this._color),this.lineMat.needsUpdate=!0)}},{key:"setFromObject",value:function(){this.destory();for(var e=[],t=0;t<this.objects.length;t++){var n=this.objects[t];if(n.visible)if(this._isCombine)for(var i=new kd(this.model,n).calculation(),r=0;r<i.length;r++)e.push(i[r]);else{var a=new kd(n,n).calculation(),o=this.createLine(a);o.tag="effect",n.add(o),this.lineRoots.push(o)}}if(this._isCombine){var s=this.createLine(e);s.tag="effect",this.model.add(s),this.lineRoots.push(s)}}},{key:"createLine",value:function(e){var t=new si;t.setAttribute("position",new Yn(e,3));var n=new jo(t,this.lineMat);return n.name="penLine",n}},{key:"setVisible",value:function(e){for(var t=0;t<this.lineRoots.length;t++)this.lineRoots[t].visible=this._visible}},{key:"setModelActive",value:function(e){for(var t=0;t<this.model.children.length;t++)"effect"!==this.model.children[t].tag&&(e?(this.model.children[t].visible1=this.model.children[t].visible,this.model.children[t].visible=!1):this.model.children[t].visible=this.model.children[t].visible1)}},{key:"start",value:function(){this._isHideModel&&this.setModelActive(!0)}},{key:"disable",value:function(){this._isHideModel&&this.setModelActive(!1)}},{key:"destory",value:function(){if(b(u(n.prototype),"destory",this).call(this),this._isInit){for(var e=0;e<this.lineRoots.length;e++)this.lineRoots[e].parent.remove(this.lineRoots[e]),this.lineRoots[e].geometry.dispose();this.lineRoots.splice(0,this.lineRoots.length)}}}]),n}(Fd),Ud=function(e){h(n,e);var t=y(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(s(this,n),(i=t.call(this,e)).lineRoots=[],i._color=null,i._isHideModel=!1,r.width||(r.width=100),r.height||(r.height=100),r.radius||(r.radius=10),r.colorStops||(r.colorStops={1:"#f00",.8:"#e2fa00",.6:"#33f900",.3:"#0349df",0:"#fff"}),!r.data){r.data=[];for(var a=0;a<100;a++)r.data.push({coord:[100*Math.random()-50,0,100*Math.random()-50],value:20*Math.random()})}return i.options=r,i}return A(n,[{key:"init",value:function(){b(u(n.prototype),"init",this).call(this),this.streamerMaterial=this.getMaterial(),this.destory()}},{key:"setVisible",value:function(e){var t=this;b(u(n.prototype),"setVisible",this).call(this,e),this.objects.forEach((function(n){e?t._setMat(n):t._resetMat(n)}))}},{key:"_setMat",value:function(e){var t=this;if(e.material1=e.material,Array.isArray(e.material)){var n=[];e.material.forEach((function(e){n.push(t.streamerMaterial.clone())})),e.material=n}else e.material=this.streamerMaterial.clone()}},{key:"_resetMat",value:function(e){e.material=e.material1,e.material1=null}},{key:"getMaterial",value:function(e){if(!this._streamerMaterial||e){var t=this.getMap();t.wrapS=t.wrapT=V,t.repeat.set(1,1),t.needsUpdate=!0,this._streamerMaterial=new Nn({map:t,transparent:!0}),this._color&&(this._streamerMaterial.color=new Fn(this._color))}return this._streamerMaterial}},{key:"getMap",value:function(){return new ts(this.draw())}},{key:"draw",value:function(){var e=this,t=this.options.radius,n=this.options.data;this._convertPoints(n);var i=this.options.width,r=this.options.height,a=document.createElement("canvas");a.width=i,a.height=r;var o=a.getContext("2d");o.fillStyle="#00ff00",o.fillRect(0,0,i,r),o.clearRect(0,0,i,r);var s=n.reduce((function(e,t){return Math.max(e,t.value)}),0);n.forEach((function(n){e._drawRadiation(o,{x:n.x,y:n.y,radius:t,weight:Math.max(Math.min((n.value-0)/(s-0),1),0),value:n.value})}));for(var l=this._createPalette(),A=o.getImageData(0,0,i,r),c=A.data,h=3;h<c.length;h+=4){var u=c[h],d=l.pickColor(u);c[h-3]=d[0],c[h-2]=d[1],c[h-1]=d[2]}return o.putImageData(A,0,0),a}},{key:"_createPalette",value:function(){var e=256,t=document.createElement("canvas");t.width=e,t.height=20;var n=t.getContext("2d");n.fillStyle="#0000ff";var i=n.createLinearGradient(0,0,e,0),r=this.options.colorStops;for(var a in r)i.addColorStop(a,r[a]);n.fillStyle=i,n.fillRect(0,0,e,20);var o=n.getImageData(0,0,e,1).data;return{canvas:t,pickColor:function(e){return o.slice(4*e,4*e+3)}}}},{key:"_convertPoints",value:function(e){e.forEach((function(e){e.x=e.coord[0],e.y=e.coord[2]}));e.forEach((function(t,n){t.x>0?t.x+=50:0==t.x?t.x=50:t.x<0&&(t.x=50+t.x),t.y>0?t.y+=50:0==t.y?t.y=50:t.y<0&&(t.y=50+t.y),e[n]=t}))}},{key:"_drawRadiation",value:function(e,t){var n=t.x,i=t.y,r=t.radius,a=t.weight;r=Math.round(r*a);var o=e.createRadialGradient(n,i,0,n,i,r);o.addColorStop(0,"rgba(25, 0, 0, 1)"),o.addColorStop(1,"rgba(0, 255, 0, 0)"),e.fillStyle=o,e.beginPath(),e.arc(n,i,r,0,2*Math.PI),e.closePath(),e.fill()}},{key:"start",value:function(){b(u(n.prototype),"start",this).call(this)}},{key:"disable",value:function(){b(u(n.prototype),"disable",this).call(this)}},{key:"setObjects",value:function(e){b(u(n.prototype),"setObjects",this).call(this,e)}},{key:"destory",value:function(){b(u(n.prototype),"destory",this).call(this),this._isInit&&this.setVisible(!1)}}]),n}(Fd),Dd=0,Rd=1,Od=2,Nd=3,zd=4,Qd=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),(i=t.call(this,e)).lineRoots=[],i._color=null,i._isHideModel=!1,i}return A(n,[{key:"init",value:function(){b(u(n.prototype),"init",this).call(this),this.uvSpeed=.01,this.speed=1,this.texture="img/streamer.png",this.destory()}},{key:"color",set:function(e){this._color=e,this._isInit&&(this.streamerMaterial.color.set(this._color),this.streamerMaterial.needsUpdate=!0)}},{key:"speed",get:function(){return this._speed},set:function(e){this._speed=e?e*this.uvSpeed:this.uvSpeed}},{key:"texture",get:function(){return this._texture},set:function(e){e&&(this._texture=e,this.streamerMaterial=this.getMaterial(!0))}},{key:"setVisible",value:function(e){var t=this;b(u(n.prototype),"setVisible",this).call(this,e),this.objects.forEach((function(n){e?t._moveUv(n):t._resetUv(n)}))}},{key:"_moveUv",value:function(e){var t=this;if(e.material1=e.material,Array.isArray(e.material)){var n=[];e.material.forEach((function(e){n.push(t.streamerMaterial.clone())})),e.material=n}else e.material=this.streamerMaterial.clone();e.onBeforeRender1=e.onBeforeRender,e.onBeforeRender=function(e,n,i,r,a){a&&a.map&&(a.map.offset.x-=t.speed)}}},{key:"onBeforeRenderFunc",value:function(e,t,n,i,r){r&&r.map&&(r.map.offset.x-=this.speed)}},{key:"_resetUv",value:function(e){e.material=e.material1,e.material1=null,e.onBeforeRender1?(e.onBeforeRender=e.onBeforeRender1,e.onBeforeRender1=null):e.onBeforeRender=function(){}}},{key:"getMaterial",value:function(e){if(!this._streamerMaterial||e){var t=(new tA).load(this.texture);t.wrapS=t.wrapT=V,t.repeat.set(1,1),t.needsUpdate=!0,this._streamerMaterial=new Nn({map:t,transparent:!0}),this._color&&(this._streamerMaterial.color=new Fn(this._color))}return this._streamerMaterial}},{key:"start",value:function(){b(u(n.prototype),"start",this).call(this)}},{key:"disable",value:function(){b(u(n.prototype),"disable",this).call(this)}},{key:"setObjects",value:function(e){b(u(n.prototype),"setObjects",this).call(this,e)}},{key:"destory",value:function(){b(u(n.prototype),"destory",this).call(this),this._isInit&&this.setVisible(!1)}}]),n}(Fd),Gd=null;var Hd,Vd,jd,Wd,Xd,Yd=function(){function e(){s(this,e),this.material=new Ri,this.material.data=this,this.initParams(),this.initMaterial()}return A(e,[{key:"transparent",set:function(e){this.material.transparent=e,this.material.depthWrite=!e}},{key:"initParams",value:function(){}},{key:"initMaterial",value:function(){}},{key:"updateMaterial",value:function(){}}]),e}(),Kd=function(e){h(n,e);var t=y(n);function n(){return s(this,n),t.call(this)}return A(n,[{key:"initParams",value:function(){this.t2D=null,this.color=new Fn(1,1,1),this.alpha=1}},{key:"initMaterial",value:function(){var e={};e.t2D={value:this.t2D},e.color={value:this.color},e.alpha={value:this.alpha},this.material.uniforms=e,this.material.vertexShader="\n\n varying vec2 vUv;\n\n void main() {\n\n vUv = uv;\n\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * mvPosition;\n\n }\n\n",this.material.fragmentShader="\n uniform sampler2D t2D;\n uniform vec3 color;\n uniform float alpha;\n varying vec2 vUv;\n\n void main() {\n\n vec4 texColor = texture2D( t2D, vUv );\n gl_FragColor = vec4(texColor.rgb * color,alpha * texColor.a);\n\n }\n\n"}},{key:"updateMaterial",value:function(){b(u(n.prototype),"updateMaterial",this).call(this),this.t2D?this.material.uniforms.t2D.value=this.t2D:this.material.uniforms.t2D.value=Gd||(Gd=(new tA).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAE6WlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzkuMTYwOTI0LCAyMDE3LzA3LzEzLTAxOjA2OjM5ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDov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MwsAAAAAElFTkSuQmCC")),this.material.uniforms.color.value=this.color,this.material.uniforms.alpha.value=this.alpha,this.material.needsUpdate=!0}}]),n}(Yd),Zd=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),(i=t.call(this,e)).edgeEffect=new Pd(i.model),i._lineColor=5371391,i._color=5422335,i._alpha=.3,i._texture=null,i}return A(n,[{key:"setObjects",value:function(e){b(u(n.prototype),"setObjects",this).call(this,e),this.edgeEffect.setObjects(this.objects)}},{key:"init",value:function(){b(u(n.prototype),"init",this).call(this),this.material=new Kd,this.material.transparent=!0,this.edgeEffect.color=this._lineColor,this.material.color.set(this._color),this.material.alpha=this._alpha,this.material.t2D=this._texture,this.material.updateMaterial()}},{key:"start",value:function(){b(u(n.prototype),"start",this).call(this),this.replaceMaterial(!1)}},{key:"disable",value:function(){b(u(n.prototype),"disable",this).call(this),this.replaceMaterial(!0)}},{key:"destory",value:function(){b(u(n.prototype),"destory",this).call(this),this.edgeEffect.destory(),this.replaceMaterial(!0),this.material=null}},{key:"setVisible",value:function(e){this.edgeEffect.visible=this._visible}},{key:"replaceMaterial",value:function(e){for(var t=0;t<this.objects.length;t++){var n=this.objects[t];if(e){if(n.srcMaterials&&n.srcMaterials.length>0){n.material=[];for(var i=0;i<n.srcMaterials.length;i++)n.material.push(n.srcMaterials[i]);n.srcMaterials=[]}}else{n.srcMaterials=[];for(var r=0;r<n.material.length;r++)n.srcMaterials.push(n.material[r]),n.material[r]=this.material.material}}}},{key:"lineColor",set:function(e){this._lineColor=e,this._isInit&&(this.edgeEffect.color=this._lineColor)}},{key:"color",set:function(e){this._color=e,this._isInit&&(this.material.color.set(this._color),this.material.updateMaterial())}},{key:"alpha",set:function(e){this._alpha=e,this._isInit&&(this.material.alpha=this._alpha,this.material.updateMaterial())}},{key:"texture",set:function(e){this._texture=e,this._isInit&&(this.material.t2D=this._texture,this.material.updateMaterial())}}]),n}(Fd),Jd=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),(i=t.call(this,e))._brightness=1,i._url="",i._coverTexture=null,i._coverTexUrl="",i.isLoop=!0,i._srcTexture=null,i._srcColor=null,i}return A(n,[{key:"Brightness",get:function(){return this._brightness},set:function(e){this._brightness=e,this.material&&(this.material.color.setRGB(this._brightness,this._brightness,this._brightness),this.material.needsUpdate=!0)}},{key:"Loop",get:function(){return this.isLoop},set:function(e){this.isLoop!==e&&(this.isLoop=e,this.video&&(this.video.loop=this.isLoop))}},{key:"init",value:function(){this.objects.length>0&&(this.mesh=this.objects[0],this.video=document.createElement("video"),this.video.src=this._url,this.video.loop=this.isLoop,this._coverTexUrl&&(console.log(this._coverTexUrl),this.video.poster=this._coverTexUrl),this.videoTexture=new li(this.video),this.videoTexture.minFilter=Z,this.videoTexture.magFilter=Z,this.videoTexture.format=Ae,this.videoTexture.image.setAttribute("crossorigin","anonymous"),Array.isArray(this.mesh.material)?this.material=this.mesh.material[0]:this.material=this.mesh.material,this._srcTexture=this.material.albedo,this._srcColor=this.material.color.getHex(),this.material.color.setRGB(this._brightness,this._brightness,this._brightness),this._coverTexture&&(this.material.albedo=this._coverTexture),this.material.needsUpdate=!0)}},{key:"disable",value:function(){this.reset()}},{key:"destory",value:function(){this.videoTexture&&this.videoTexture.dispose(),this._coverTexture&&this._coverTexture.dispose(),this.videoTexture=null,this.video=null}},{key:"setUrl",value:function(e,t){if(this._coverTexUrl!==t&&(this._coverTexUrl=t,this._coverTexture&&this._coverTexture.dispose(),this._coverTexUrl)){var n=new tA;this._coverTexture=n.load(this._coverTexUrl)}this._url!==e&&(this._url=e,this.video&&(this.video.src=this._url))}},{key:"play",value:function(){this.visible=!0,this.video&&(this.material&&(this.material.color.setRGB(this._brightness,this._brightness,this._brightness),this.material.albedo=this.videoTexture,this.material.needsUpdate=!0),this.video.currentTime=0,this.video.play())}},{key:"pause",value:function(){this.video&&this.video.pause()}},{key:"resume",value:function(){this.video&&this.video.play()}},{key:"stop",value:function(){this._coverTexture&&(this.material.albedo=this._coverTexture),this.video&&(this.video.pause(),this.video.currentTime=0)}},{key:"reset",value:function(){this.material&&(this.material.color.set(this._srcColor),this.material.albedo=this._srcTexture,this.material.needsUpdate=!0),this.video&&(this.video.pause(),this.video.currentTime=0)}},{key:"clear",value:function(){this.visible=!1}}]),n}(Fd),qd=function(){function e(t){s(this,e),this.model=t,this.effectMap=new Map,this.effectNodeArray=[],this.effectLifeTime=10}return A(e,[{key:"tick",value:function(e){var t=this;this.effectMap.forEach((function(n,i){!n.visible&&n.IsInit&&(n.time+=e,n.time>=t.effectLifeTime&&n.destory())}));for(var n=0;n<this.effectNodeArray.length;n++){var i=this.effectNodeArray[n];!i.visible&&i.IsInit&&(i.time+=e,i.time>=this.effectLifeTime&&(i.destory(),this.effectNodeArray.splice(n,1),n--))}}},{key:"getEffect",value:function(e){var t=this.effectMap.get(e);return t||(t=this.createEffect(e),this.effectMap.set(e,t)),t}},{key:"createEffect",value:function(e){var t={};return e===Dd?t=new Pd(this.model):e===Rd?t=new Zd(this.model):e===Od?t=new Qd(this.model):e===Nd?t=new Jd(this.model):e===zd&&(t=new Ud(this.model,this.heatMapData)),t.type=t,t}},{key:"getMeshByNames",value:function(e){var t=[];if(Array.isArray(e))for(var n=0;n<e.length;n++){var i=this.model.getObjectByName(e[n]);i&&i.isMesh&&t.push(i)}else{var r=this.model.getObjectByName(e);r&&r.isMesh&&t.push(r)}return t}},{key:"createEffectByNames",value:function(e,t){var n=this.getMeshByNames(e),i=this.createEffect(t);return i.setObjects(n),this.effectNodeArray.push(i),i}},{key:"edgeDetection",get:function(){return this.getEffect(Dd)}},{key:"addDetection",value:function(e){return this.createEffectByNames(e,Dd)}},{key:"technology",get:function(){return this.getEffect(Rd)}},{key:"addTechnology",value:function(e){return this.createEffectByNames(e,Rd)}},{key:"streamer",get:function(){return this.getEffect(Od)}},{key:"addStreamer",value:function(e){return this.createEffectByNames(e,Od)}},{key:"heatMap",get:function(){return this.getEffect(zd)}},{key:"addHeatMap",value:function(e,t){this.heatMapData=t;var n=this.createEffectByNames(e,zd);return n.heatMapData=t,n}},{key:"addVideoTexture",value:function(e,t,n,i){var r=this.createEffectByNames([e],Nd);return null!=i&&null!=i&&(r.isLoop=i),r.setUrl(t,n),r.visible=!0,r}},{key:"clone",value:function(t){var n=new e(t);return this.effectMap.forEach((function(e,t){var i=n.getEffect(t);i.visible=!0,e.visible||(i=!1)})),this.effectNodeArray.forEach((function(e){var i=e.type,r={},a=n.getNamesByMeshes(t,e.objects);switch(i){case Dd:r=n.addDetection(a);break;case Rd:r=n.addTechnology(a);break;case Od:r=n.addStreamer(a);break;case zd:var o=e.heatMapData;r=n.addHeatMap(a,o);break;case Nd:var s=e._url,l=e._coverTexUrl,A=e.Loop;r=n.addVideoTexture(a,s,l,A)}r.visible=!0,e.visible||(r=!1)})),n}},{key:"getNamesByMeshes",value:function(e,t){for(var n=[],i=0;i<t.length;i++){var r=t[i].lastUUID,a=e.getObjectByProperty("uuid",r);n.push(a)}return n}},{key:"dispose",value:function(){this.effectMap.forEach((function(e,t){e.destory()})),this.effectNodeArray.forEach((function(e){e.destory()}))}}]),e}(),$d=Math.pow(2,8),ef=[.125,.215,.35,.446,.526,.582],tf=5+ef.length,nf=(c(Hd={},Oe,0),c(Hd,Ne,1),c(Hd,Qe,2),c(Hd,Ge,3),c(Hd,He,4),c(Hd,Ve,5),c(Hd,ze,6),Hd),rf=new FA,af=(Vd=8,jd=new Float32Array(Vd),Wd=new at(0,1,0),(Xd=new vl({defines:{n:Vd},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:jd},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:Wd},inputEncoding:{value:nf[3e3]},outputEncoding:{value:nf[3e3]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform int samples;\nuniform float weights[n];\nuniform bool latitudinal;\nuniform float dTheta;\nuniform float mipInt;\nuniform vec3 poleAxis;\n".concat("\nuniform int inputEncoding;\nuniform int outputEncoding;\n#include <encodings_pars_fragment>\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t","\n#define ENVMAP_TYPE_CUBE_UV\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\n\nfloat getFace(vec3 direction) {\n vec3 absDirection = abs(direction);\n float face = -1.0;\n if (absDirection.x > absDirection.z) {\n if (absDirection.x > absDirection.y)\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if (absDirection.z > absDirection.y)\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n}\nvec2 getUV(vec3 direction, float face) {\n vec2 uv;\n if (face == 0.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x);\n } else if (face == 1.0) {\n uv = vec2(direction.x, -direction.z) / abs(direction.y);\n } else if (face == 2.0) {\n uv = direction.xy / abs(direction.z);\n } else if (face == 3.0) {\n uv = vec2(direction.z, direction.y) / abs(direction.x);\n } else if (face == 4.0) {\n uv = direction.xz / abs(direction.y);\n } else {\n uv = vec2(-direction.x, direction.y) / abs(direction.z);\n }\n return 0.5 * (uv + 1.0);\n}\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n// These defines must match with PMREMGenerator\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\nfloat roughnessToMip(float roughness) {\n float mip = 0.0;\n if (roughness >= r1) {\n mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n } else if (roughness >= r4) {\n mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n } else if (roughness >= r5) {\n mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n } else if (roughness >= r6) {\n mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n } else {\n mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25\n }\n return mip;\n}\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tfor (int i = 0; i < n; i++) {\n\t\tif (i >= samples)\n\t\t\tbreak;\n\t\tfor (int dir = -1; dir < 2; dir += 2) {\n\t\t\tif (i == 0 && dir == 1)\n\t\t\t\tcontinue;\n\t\t\tvec3 axis = latitudinal ? poleAxis : cross(poleAxis, vOutputDirection);\n\t\t\tif (all(equal(axis, vec3(0.0))))\n\t\t\t\taxis = cross(vec3(0.0, 1.0, 0.0), vOutputDirection);\n\t\t\taxis = normalize(axis);\n\t\t\tfloat theta = dTheta * float(dir * i);\n\t\t\tfloat cosTheta = cos(theta);\n\t\t\t// Rodrigues' axis-angle rotation\n\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t\t\t\t+ axis * dot(axis, vOutputDirection) * (1.0 - cosTheta);\n\t\t\tgl_FragColor.rgb +=\n\t\t\t\t\tweights[i] * bilinearCubeUV(envMap, sampleDirection, mipInt);\n\t\t}\n\t}\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t"),blending:0,depthTest:!1,depthWrite:!1})).type="SphericalGaussianBlur",Xd),of=null,sf=null,lf=function(){for(var e=[],t=[],n=[],i=8,r=0;r<tf;r++){var a=Math.pow(2,i);t.push(a);var o=1/a;r>4?o=ef[r-8+4-1]:0==r&&(o=0),n.push(o);for(var s=1/(a-1),l=-s/2,A=1+s/2,c=[l,l,A,l,A,A,l,l,A,A,l,A],h=new Float32Array(108),u=new Float32Array(72),d=new Float32Array(36),f=0;f<6;f++){var p=f%3*2/3-1,m=f>2?0:-1,v=[p,m,0,p+2/3,m,0,p+2/3,m+1,0,p,m,0,p+2/3,m+1,0,p,m+1,0];h.set(v,18*f),u.set(c,12*f);var g=[f,f,f,f,f,f];d.set(g,6*f)}var y=new si;y.setAttribute("position",new zn(h,3)),y.setAttribute("uv",new zn(u,2)),y.setAttribute("faceIndex",new zn(d,1)),e.push(y),i>4&&i--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}(),Af=lf._lodPlanes,cf=lf._sizeLods,hf=lf._sigmas,uf=null,df=null,ff=null,pf=(1+Math.sqrt(5))/2,mf=1/pf,vf=[new at(1,1,1),new at(-1,1,1),new at(1,1,-1),new at(-1,1,-1),new at(0,pf,mf),new at(0,pf,-mf),new at(mf,0,pf),new at(-mf,0,pf),new at(pf,mf,0),new at(-pf,mf,0)];function gf(e){df=e,bf(af)}function yf(e){var t={magFilter:X,minFilter:X,generateMipmaps:!1,type:e?e.type:$,format:e?e.format:de,encoding:e?e.encoding:Qe,depthBuffer:!1,stencilBuffer:!1},n=Mf(t);return n.depthBuffer=!e,uf=Mf(t),n}function wf(e){uf.dispose(),df.setRenderTarget(ff),e.scissorTest=!1,e.setSize(e.width,e.height)}function xf(e,t,n,i){var r=new Ni(90,1,t,n),a=[1,1,1,1,-1,1],o=[1,1,-1,-1,-1,1],s=df.outputEncoding,l=df.toneMapping,A=df.toneMappingExposure,c=df.getClearColor(),h=df.getClearAlpha();df.toneMapping=1,df.toneMappingExposure=1,df.outputEncoding=Oe,e.scale.z*=-1;var u=e.background;if(u&&u.isColor){u.convertSRGBToLinear();var d=Math.max(u.r,u.g,u.b),f=Math.min(Math.max(Math.ceil(Math.log2(d)),-128),127);u=u.multiplyScalar(Math.pow(2,-f));var p=(f+128)/255;df.setClearColor(u,p),e.background=null}for(var m=0;m<6;m++){var v=m%3;0==v?(r.up.set(0,a[m],0),r.lookAt(o[m],0,0)):1==v?(r.up.set(0,0,a[m]),r.lookAt(0,o[m],0)):(r.up.set(0,a[m],0),r.lookAt(0,0,o[m])),Cf(i,v*$d,m>2?$d:0,$d,$d),df.setRenderTarget(i),df.render(e,r)}df.toneMapping=l,df.toneMappingExposure=A,df.outputEncoding=s,df.setClearColor(c,h),e.scale.z*=-1}function bf(e){var t=new Qt;t.add(new Ei(Af[0],e)),df.compile(t,rf)}function Mf(e){var t=new dt(3*$d,3*$d,e);return t.texture.mapping=G,t.texture.name="PMREM.cubeUv",t.scissorTest=!0,t}function Cf(e,t,n,i,r){e.viewport.set(t,n,i,r),e.scissor.set(t,n,i,r)}function Bf(e){var t=df.autoClear;df.autoClear=!1;for(var n=1;n<tf;n++){Ef(e,n-1,n,Math.sqrt(hf[n]*hf[n]-hf[n-1]*hf[n-1]),vf[(n-1)%vf.length])}df.autoClear=t}function Ef(e,t,n,i,r){Sf(e,uf,t,n,i,"latitudinal",r),Sf(uf,e,n,n,i,"longitudinal",r)}function Sf(e,t,n,i,r,a,o){"latitudinal"!==a&&"longitudinal"!==a&&console.error("blur direction must be either latitudinal or longitudinal!");var s=new Qt;s.add(new Ei(Af[i],af));var l=af.uniforms,A=cf[n]-1,c=isFinite(r)?Math.PI/(2*A):2*Math.PI/15,h=r/c,u=isFinite(r)?1+Math.floor(3*h):8;u>8&&console.warn("sigmaRadians, ".concat(r,", is too large and will clip, as it requested ").concat(u," samples when the maximum is set to ").concat(8));for(var d=[],f=0,p=0;p<8;++p){var m=p/h,v=Math.exp(-m*m/2);d.push(v),0==p?f+=v:p<u&&(f+=2*v)}for(p=0;p<d.length;p++)d[p]=d[p]/f;l.envMap.value=e.texture,l.samples.value=u,l.weights.value=d,l.latitudinal.value="latitudinal"===a,o&&(l.poleAxis.value=o),l.dTheta.value=c,l.mipInt.value=8-n,l.inputEncoding.value=nf[e.texture.encoding],l.outputEncoding.value=nf[e.texture.encoding];var g=cf[i];Cf(t,m=3*Math.max(0,$d-2*g),(0===i?0:2*$d)+2*g*(i>4?i-8+4:0),3*g,2*g),df.setRenderTarget(t),df.render(s,rf)}function Tf(){var e=new vl({uniforms:{envMap:{value:null},texelSize:{value:new tt(1,1)},inputEncoding:{value:nf[3e3]},outputEncoding:{value:nf[3e3]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform vec2 texelSize;\n".concat("\nuniform int inputEncoding;\nuniform int outputEncoding;\n#include <encodings_pars_fragment>\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t","\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tvec3 outputDirection = normalize(vOutputDirection);\n\tvec2 uv;\n\tuv.y = asin(clamp(outputDirection.y, -1.0, 1.0)) * RECIPROCAL_PI + 0.5;\n\tuv.x = atan(outputDirection.z, outputDirection.x) * RECIPROCAL_PI2 + 0.5;\n\tvec2 f = fract(uv / texelSize - 0.5);\n\tuv -= f * texelSize;\n\tvec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x += texelSize.x;\n\tvec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.y += texelSize.y;\n\tvec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tuv.x -= texelSize.x;\n\tvec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\tvec3 tm = mix(tl, tr, f.x);\n\tvec3 bm = mix(bl, br, f.x);\n\tgl_FragColor.rgb = mix(tm, bm, f.y);\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t"),blending:0,depthTest:!1,depthWrite:!1});return e.type="EquirectangularToCubeUV",e}function _f(){var e=new vl({uniforms:{envMap:{value:null},inputEncoding:{value:nf[3e3]},outputEncoding:{value:nf[3e3]}},vertexShader:"\nprecision mediump float;\nprecision mediump int;\nattribute vec3 position;\nattribute vec2 uv;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nvec3 getDirection(vec2 uv, float face) {\n\tuv = 2.0 * uv - 1.0;\n\tvec3 direction = vec3(uv, 1.0);\n\tif (face == 0.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 1.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.z *= -1.0;\n\t} else if (face == 3.0) {\n\t\tdirection = direction.zyx;\n\t\tdirection.x *= -1.0;\n\t} else if (face == 4.0) {\n\t\tdirection = direction.xzy;\n\t\tdirection.y *= -1.0;\n\t} else if (face == 5.0) {\n\t\tdirection.xz *= -1.0;\n\t}\n\treturn direction;\n}\nvoid main() {\n\tvOutputDirection = getDirection(uv, faceIndex);\n\tgl_Position = vec4( position, 1.0 );\n}\n\t",fragmentShader:"\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform samplerCube envMap;\n".concat("\nuniform int inputEncoding;\nuniform int outputEncoding;\n#include <encodings_pars_fragment>\nvec4 inputTexelToLinear(vec4 value){\n\tif(inputEncoding == 0){\n\t\treturn value;\n\t}else if(inputEncoding == 1){\n\t\treturn sRGBToLinear(value);\n\t}else if(inputEncoding == 2){\n\t\treturn RGBEToLinear(value);\n\t}else if(inputEncoding == 3){\n\t\treturn RGBMToLinear(value, 7.0);\n\t}else if(inputEncoding == 4){\n\t\treturn RGBMToLinear(value, 16.0);\n\t}else if(inputEncoding == 5){\n\t\treturn RGBDToLinear(value, 256.0);\n\t}else{\n\t\treturn GammaToLinear(value, 2.2);\n\t}\n}\nvec4 linearToOutputTexel(vec4 value){\n\tif(outputEncoding == 0){\n\t\treturn value;\n\t}else if(outputEncoding == 1){\n\t\treturn LinearTosRGB(value);\n\t}else if(outputEncoding == 2){\n\t\treturn LinearToRGBE(value);\n\t}else if(outputEncoding == 3){\n\t\treturn LinearToRGBM(value, 7.0);\n\t}else if(outputEncoding == 4){\n\t\treturn LinearToRGBM(value, 16.0);\n\t}else if(outputEncoding == 5){\n\t\treturn LinearToRGBD(value, 256.0);\n\t}else{\n\t\treturn LinearToGamma(value, 2.2);\n\t}\n}\nvec4 envMapTexelToLinear(vec4 color) {\n\treturn inputTexelToLinear(color);\n}\n\t","\nvoid main() {\n\tgl_FragColor = vec4(0.0);\n\tgl_FragColor.rgb = envMapTexelToLinear(textureCube(envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ))).rgb;\n\tgl_FragColor = linearToOutputTexel(gl_FragColor);\n}\n\t\t"),blending:0,depthTest:!1,depthWrite:!1});return e.type="CubemapToCubeUV",e}gf.prototype={constructor:gf,fromScene:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;ff=df.getRenderTarget();var r=yf();return xf(e,n,i,r),t>0&&Ef(r,0,0,t),Bf(r),wf(r),r},fromEquirectangular:function(e){return e.magFilter=X,e.minFilter=X,e.generateMipmaps=!1,this.fromCubemap(e)},fromCubemap:function(e){ff=df.getRenderTarget();var t=yf(e);return function(e,t){var n=new Qt;e.isCubeTexture?null==sf&&(sf=_f()):null==of&&(of=Tf());var i=e.isCubeTexture?sf:of;n.add(new Ei(Af[0],i));var r=i.uniforms;r.envMap.value=e,e.isCubeTexture||r.texelSize.value.set(1/e.image.width,1/e.image.height);r.inputEncoding.value=nf[e.encoding],r.outputEncoding.value=nf[e.encoding],Cf(t,0,0,3*$d,2*$d),df.setRenderTarget(t),df.render(n,rf)}(e,t),Bf(t),wf(t),t},compileCubemapShader:function(){null==sf&&bf(sf=_f())},compileEquirectangularShader:function(){null==of&&bf(of=Tf())},dispose:function(){af.dispose(),null!=sf&&sf.dispose(),null!=of&&of.dispose();for(var e=0;e<Af.length;e++)Af[e].dispose()}};var If=function(){function e(){s(this,e)}return A(e,null,[{key:"getTouchByEvent",value:function(e){return e.touches&&e.touches.length>0?e.touches[0]:e.changedTouches&&e.changedTouches.length>0?e.changedTouches[0]:e}},{key:"isIOS",get:function(){return navigator.userAgent.indexOf("Android")>-1||navigator.userAgent.indexOf("Adr")>-1}},{key:"isAndroid",get:function(){return!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)}},{key:"isMobile",get:function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)}},{key:"stringToArrayBuffer",value:function(e){for(var t=new ArrayBuffer(2*e.length),n=new Uint16Array(t),i=0,r=e.length;i<r;i++)n[i]=e.charCodeAt(i);return t}},{key:"arrayBufferToString",value:function(e){return String.fromCharCode.apply(null,new Uint16Array(e))}},{key:"setRaycasterByCamera",value:function(e,t,n){var i=(new bt).getInverse(n.projectionMatrix),r=(new at).applyMatrix4(i),a=new at(e.x,e.y,1).applyMatrix4(i).clone().sub(r).normalize();return t.set(r,a),a}},{key:"getDomMouse",value:function(t,n){var i={},r=n.offsetWidth,a=n.offsetHeight;n instanceof HTMLElement&&(n=n.getBoundingClientRect()),t=e.getTouchByEvent(t);var o=r/n.width,s=a/n.height;return i.x=void 0===t.offsetX?(t.pageX-n.left)/n.width*2-1:t.offsetX/o/n.width*2-1,i.y=void 0===t.offsetY?-(t.pageY-n.top)/n.height*2+1:-t.offsetY/s/n.height*2+1,i}},{key:"getDomMouseForThreeBox",value:function(t,n){t=e.getTouchByEvent(t);var i={},r=n.getBoundingClientRect();return i.x=t.offsetX/r.width*2-1,i.y=1-t.offsetY/r.height*2,i}},{key:"bindAll",value:function(e,t){e.forEach((function(e){t[e]&&(t[e]=t[e].bind(t))}))}},{key:"getSize",value:function(e){var t=new tn;return t.setFromObject(e),t.getSize(new at)}},{key:"getModelRootNode",value:function(t){return"modelGroup"==t.parent.name?t:e.getModelRootNode(t.parent)}},{key:"assemblyPath",value:function(e,t){if(e.startsWith("#"))return e;var n=e.split(",");return n.map((function(e){e=e.split("?")[0],e=t+e.slice(e.lastIndexOf("/")+1)})),n.join(",")}},{key:"createCircleMap",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:256,n="rgba("+255*(e=new Fn(e)).r+","+255*e.g+","+255*e.b+",",i=document.createElement("canvas");i.width=i.height=t;var r=i.getContext("2d"),a=t/2;r.beginPath(),r.arc(a,a,a,0,2*Math.PI,!0),r.closePath();var o=r.createRadialGradient(a,a,1,a,a,a);o.addColorStop(0,n+"1)"),o.addColorStop(.2,n+"0)"),o.addColorStop(.4,n+"1)"),o.addColorStop(.6,n+"0)"),o.addColorStop(.8,n+"1)"),o.addColorStop(1,n+"0)"),r.fillStyle=o,r.fill();var s=new ts(i);return s.minFilter=Z,s.needsUpdate=!0,s}},{key:"segmentIntersection",value:function(e,t,n,i){e=new tt(e.x,e.z),t=new tt(t.x,t.z),n=new tt(n.x,n.z),i=new tt(i.x,i.z);var r=(t.y-e.y)/(t.x-e.x),a=t.y-r*t.x,o=(i.y-n.y)/(i.x-n.x),s=i.y-o*i.x;return{x:(s-a)/(r-o),y:r*((s-a)/(r-o))+a}}},{key:"convertTexture",value:function(e,t){if(!t)return e;var n=new gf(t),i=e.image.src;return e.constructor===hr?(n.compileCubemapShader(),e=n.fromCubemap(e).texture):(n.compileEquirectangularShader(),e=n.fromEquirectangular(e).texture),n.dispose(),e.image.src=i,e}},{key:"getDecoderPath",value:function(){var e="js/";if(document.getElementById("AMRT")){var t=document.getElementById("AMRT").src;e=t.slice(0,t.lastIndexOf("/"))+"/"}else for(var n=0;n<document.scripts.length;n++){var i=document.scripts[n];i.src&&"app.js"===i.src.slice(i.src.lastIndexOf("/")+1)&&(e=i.src.slice(0,i.src.lastIndexOf("/"))+"/")}return e}},{key:"computeDistance",value:function(e,t){var n=M(e,2),i=n[0],r=n[1],a=M(t,2),o=a[0],s=a[1],l=et.degToRad(r),A=et.degToRad(s),c=l-A,h=et.degToRad(i)-et.degToRad(o),u=2*Math.asin(Math.sqrt(Math.pow(Math.sin(c/2),2)+Math.cos(l)*Math.cos(A)*Math.pow(Math.sin(h/2),2)));return u*=6378137,u=Math.round(1e4*u)/1e4}},{key:"tb",value:function(e){return(new Date).getTime()>e}}]),e}();function Lf(e,t,n){this.objects=[],this.tmpGeometry=e.clone(),Uo.call(this,e,t,n),this.frustumCulled=!1}Lf.prototype=Object.assign(Object.create(Uo.prototype),{constructor:Lf,isInstancedMesh:!0,deleteItem:function(e){if(e&&0!=e.length){var t=new Float32Array(16*(this.count-e.length));e.push(this.count);for(var n=0,i=0,r=0;r<e.length;r++){this.objects.splice(e[r]-r,1);var a=16*e[r];if(n<a){var o=this.bufferArray.slice(n,a);t.set(o,i),i+=o.length}n=a+16}for(var s=0;s<this.objects.length;s++)this.objects[s].instanceIndex=s;this.bufferArray=t,this.instanceMatrix=new zn(this.bufferArray,16),this.count=this.count-e.length+1}},addItem:function(e){this.count+=e.length;var t=new Float32Array(16*this.count);t.set(this.bufferArray,0),this.bufferArray=t;for(var n=0;n<e.length;n++)e[n].refreshInstanceMesh(),this.objects.push(e[n])}});var Ff={Perlin:(new tA).load("https://laozicloud-sdk.obs.cn-east-2.myhuaweicloud.com:443/assets/noise/perlin.jpg"),Radial:(new tA).load("https://laozicloud-sdk.obs.cn-east-2.myhuaweicloud.com:443/assets/noise/radial.jpg"),Linner:(new tA).load("https://laozicloud-sdk.obs.cn-east-2.myhuaweicloud.com:443/assets/noise/linear.jpg")};zt.prototype.startMove=function(e){var t=this;if(e.path){this.tween&&this.tween.stop();var n=[];e.path.forEach((function(e){n.push((new at).copy(e))}));var i=new cA(n);i.curveType="catmullrom",i.tension=0;var r,a={t:0},o=new at;this.tween=new ud.Tween(a).to({t:1},e.time||3e3).onUpdate((function(){var e=new at;i.getPoint(a.t,e),o.copy(e),r&&i.getPoint(a.t+.01,o),r=a.t,t.position.copy(e.clone())})).onComplete((function(){e.onComplete&&e.onComplete()})).repeat(void 0!==e.loop&&null!==e.loop?e.loop-1:0).start()}else console.error("startMove缺少参数path")},zt.prototype.stopMove=function(){this.tween&&this.tween.stop()},new at;var kf=function(e){h(i,e);var t=y(i);function i(e){var n;return s(this,i),(n=t.call(this))._cacheMaterials={},n._cache=new WeakMap,n.viewer=e,n.isModel=!0,n.name="",n.objects=[],n.materials=[],n.animation=new Td(v(n)),n.envMap=null,n.boundingBox=new tn,n.boundingSphere=new an,n.clickCallback=[],n.dblclickCallback=[],n.mousedownCallback=[],n.mousemoveCallback=[],n.effect=new qd(v(n)),n.clock=new lc(!0),n.mouseoverListeners=[],n.mouseoutListeners=[],n.currentIntersectTarget=null,n.viewer.container.addEventListener("mousemove",n._mousemoveHandler.bind(v(n))),n}return A(i,[{key:"mapLoader",get:function(){return this.viewer.sceneManager.mapLoader}},{key:"materialViewer",get:function(){return this._materialViewer||(this._materialViewer=new _d(this)),this._materialViewer}},{key:"shadowMaterial",get:function(){return this._shadowMaterial||null},set:function(e){e?this.traverse((function(t){if(t.isMesh&&Array.isArray(t.material)&&(void 0===t.materialNum||t.materialNum!=t.material.length)){for(var i=t.material.length,r=0;r<i;r++){var a=n({},t.geometry.groups[r]);a.materialIndex=r+i,t.geometry.groups.push(a),t.material.push(e),e.skinning=t.material[r].skinning,e.morphTargets=t.material[r].morphTargets}t.materialNum=i}})):this.traverse((function(e){e.isMesh&&Array.isArray(e.material)&&e.materialNum&&e.materialNum!=e.material.length&&(e.geometry.groups.length=e.materialNum,e.material.length=e.materialNum,delete e.materialNum)})),this._shadowMaterial=e}},{key:"init",value:function(e){var t=this;e&&(this.materials=[],this.objects=[],e.traverse((function(e){if(e.isMesh){if(Array.isArray(e.material))for(var n=0;n<e.material.length;n++)t.materials.push(e.material[n]);else t.materials.push(e.material);t.objects.push(e)}})),this.recalculationBound())}},{key:"getObjectByID",value:function(e){var t=null;return this.traverse((function(n){n.ID===e&&(t=n)})),t}},{key:"getMaterials",value:function(){return this.materials.filter((function(e){return void 0===e.re}))}},{key:"applyWireFrame",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e?this.materialViewer.applyWireFrame.bind(this._materialViewer)():this.materialViewer.resetMaterial.bind(this._materialViewer)()}},{key:"update",value:function(){this.effect.tick(this.clock.getDelta())}},{key:"recalculationBound",value:function(){this.boundingBox.setFromObject(this),this.boundingBox.getBoundingSphere(this.boundingSphere)}},{key:"add",value:function(e){b(u(i.prototype),"add",this).call(this,e)}},{key:"remove",value:function(e){b(u(i.prototype),"remove",this).call(this,e)}},{key:"replace",value:function(e,t){e.position.copy(t.localToWorld(t.position.clone())),e.rotation.copy(t.rotation),t.parent.add(e),t.parent.remove(t)}},{key:"setPosition",value:function(e,t,n){this.position.set(e,t,n)}},{key:"setRotation",value:function(e,t,n){this.rotation.set(e,t,n)}},{key:"setScale",value:function(e,t,n){this.scale.set(e,t,n)}},{key:"setEnvMap",value:function(e,t,n){var i=this;return e?e.isTexture?(this.envMap=e,this.materials.forEach((function(t){t.envMap=e,t.needsUpdate=!0})),t&&t(),e):this.mapLoader.loadEnvMap(e,(function(e){i.envMap=e,i.materials.forEach((function(t){t.envMap=e,t.needsUpdate=!0})),t&&t()}),n):(this.envMap=null,this.materials.forEach((function(e){e.envMap=null,e.needsUpdate=!0})),null)}},{key:"getEnvMap",value:function(){if(this.envMap)return this.envMap.image.src}},{key:"setEnvMapRotation",value:function(e){this.envMapRotation=e,this.materials.forEach((function(t){t.envMap&&(t.envRotateY=Math.PI/180*e,t.needsUpdate=!0)}))}},{key:"getEnvMapRotation",value:function(){return this.envMapRotation||0}},{key:"setEnvMapIntensity",value:function(e){null==e||null==e?(e=.7,this.materials.forEach((function(t){t.envMapIntensity=e,t.needsUpdate=!0}))):(this.materials.forEach((function(t){t.envMapIntensity=e,t.needsUpdate=!0})),this.envMapIntensity=e)}},{key:"getEnvMapIntensity",value:function(){return null==this.envMapIntensity||null==this.envMapIntensity?.7:this.envMapIntensity}},{key:"clearEnvMap",value:function(){this.envMap=null,this.materials.forEach((function(e){e.envMap=null,e.needsUpdate=!0}))}},{key:"hasAnimation",value:function(){return this.animation.hasAnimation()}},{key:"adapt",value:function(){this.update(),this.updateWorldMatrix(!1,!0);var e=(new at).subVectors(this.boundingBox.getCenter(),this.position);this.children.forEach((function(t){t.position.x-=e.x,t.position.y-=e.y,t.position.z-=e.z})),this.update(),this.viewer.sceneManager.fitCamera(this,this.boundingBox)}},{key:"getSize",value:function(){return this.boundingBox.getSize()}},{key:"showDimension",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#FFFFFF";this.dimension&&this.viewer.sceneManager.root.remove(this.dimension),this.dimension=new Id(this,e,t,n,i),this.viewer.sceneManager.root.add(this.dimension)}},{key:"hideDimension",value:function(){this.dimension&&(this.viewer.sceneManager.root.remove(this.dimension),this.dimension=null)}},{key:"exploding",get:function(){return this._exploding||(this._exploding=new Ld(this)),this._exploding}},{key:"setExploding",value:function(e){this.exploding.applyScalar(parseFloat(e))}},{key:"setExplodingMode",value:function(e){this.exploding.applyScalar(0),this.exploding.setMode(e)}},{key:"onBeforeRender",value:function(e,t,n){}},{key:"onAfterRender",value:function(e,t,n){}},{key:"on",value:function(e,t){"click"==e&&(this.clickCallback.push(t),this.viewer.modelManager.intersectObjects.click.includes(this)||this.viewer.modelManager.intersectObjects.click.push(this)),"dblclick"==e&&(this.dblclickCallback.push(t),this.viewer.modelManager.intersectObjects.dblclick.includes(this)||this.viewer.modelManager.intersectObjects.dblclick.push(this)),"mousedown"==e&&(this.mousedownCallback.push(t),this.viewer.modelManager.intersectObjects.mousedown.includes(this)||this.viewer.modelManager.intersectObjects.mousedown.push(this)),"mousemove"==e&&(this.mousemoveCallback.push(t),this.viewer.modelManager.intersectObjects.mousemove.includes(this)||this.viewer.modelManager.intersectObjects.mousemove.push(this))}},{key:"off",value:function(e,t){"click"==e&&(this.clickCallback.includes(t)&&this.clickCallback.remove(t),0==this.clickCallback.length&&this.viewer.modelManager.intersectObjects.click.includes(this)&&this.viewer.modelManager.intersectObjects.click.remove(this)),"dblclick"==e&&(this.dblclickCallback.includes(t)&&this.dblclickCallback.remove(t),0==this.dblclickCallback.length&&this.viewer.modelManager.intersectObjects.dblclick.includes(this)&&this.viewer.modelManager.intersectObjects.dblclick.remove(this)),"mousedown"==e&&(this.mousedownCallback.includes(t)&&this.mousedownCallback.remove(t),0==this.mousedownCallback.length&&this.viewer.modelManager.intersectObjects.mousedown.includes(this)&&this.viewer.modelManager.intersectObjects.mousedown.remove(this)),"mousemove"==e&&(this.mousemoveCallback.includes(t)&&this.mousemoveCallback.remove(t),0==this.mousemoveCallback.length&&this.viewer.modelManager.intersectObjects.mousemove.includes(this)&&this.viewer.modelManager.intersectObjects.mousemove.remove(this))}},{key:"clear",value:function(){var e=this;this.clickCallback.map((function(t){e.viewer.modelManager.intersectObjects.click.remove(t)})),this.dblclickCallback.map((function(t){e.viewer.modelManager.intersectObjects.dblclick.remove(t)})),this.mousemoveCallback.map((function(t){e.viewer.modelManager.intersectObjects.mousemove.remove(t)})),this.mousedownCallback.map((function(t){e.viewer.modelManager.intersectObjects.mousedown.remove(t)})),this.clickCallback=[],this.dblclickCallback=[],this.mousemoveCallback=[],this.mousedownCallback=[]}},{key:"dispose",value:function(){this.traverse((function(e){if(e.isMesh){e.geometry&&e.geometry.dispose(),e.geometry=null;for(var t=Array.isArray(e.material)?e.material:[e.material],n=0;n<t.length;n++){var i=t[n];i&&(i.map&&i.map.dispose(),i.dispose())}if(e.material.length=0,e.material=null,e.material1){for(var r=Array.isArray(e.material1)?e.material1:[e.material1],a=0;a<r.length;a++){var o=r[a];o&&(o.map&&o.map.dispose(),o.dispose())}e.material1.length=0,e.material1=null}}else if(e.isModel){e.effect&&e.effect.dispose(),e.effect=null,e.animation&&e.animation.dispose(),e.animation=null,e.objects.length=0,e.objects=null;for(var s=Array.isArray(e.materials)?e.materials:[e.materials],l=0;l<s.length;l++){var A=s[l];A&&(A.map&&A.map.dispose(),A.dispose())}e.materials.length=0,e.materials=null,e.cacheKey&&e.viewer.modelManager.removeCache(e.cacheKey)}}))}},{key:"setColor",value:function(){var e=arguments,t=this;1==arguments.length?this.materials.forEach((function(n){t.selectedMaterial=n,t._applyParams("color",e[0],"color")})):(this.selectedMaterial=this._getMaterialByName(arguments[0]),this._applyParams("color",arguments[1],"color"))}},{key:"setMeshBrightness",value:function(e,t){var n=this.getObjectByName(e);if(!n)return!1;if(n.material1||(n.material1=n.material,Array.isArray(n.material)?(n.material=[],n.material1.forEach((function(e){n.material.push(e.clone())}))):n.material=n.material.clone()),Array.isArray(n.material))n.material.forEach((function(e){e.colorBrightness||(e.colorBrightness=1),e.color.r=e.color.r*t/e.colorBrightness,e.color.g=e.color.g*t/e.colorBrightness,e.color.b=e.color.b*t/e.colorBrightness,e.colorBrightness=t,e.needsUpdate=!0}));else{var i=n.material;i.colorBrightness||(i.colorBrightness=1),i.color.r=i.color.r*t/i.colorBrightness,i.color.g=i.color.g*t/i.colorBrightness,i.color.b=i.color.b*t/i.colorBrightness,i.colorBrightness=t,i.needsUpdate=!0}}},{key:"setMeshTexture",value:function(e,t){var n=this.getObjectByName(e);if(!n)return!1;n.material1||(n.material1=n.material,Array.isArray(n.material)?(n.material=[],n.material1.forEach((function(e){n.material.push(e.clone())}))):n.material=n.material.clone()),(new tA).load(t,(function(e){Array.isArray(n.material)?n.material.forEach((function(t){t.albedo=e,t.needsUpdate=!0})):(n.material.albedo=e,n.material.needsUpdate=!0)}))}},{key:"setOpacity",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.selectedMaterial=this._getMaterialByName(e),this._applyParams("opacity",t),this._updateTransparent()}},{key:"setAlbedoMap",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this.selectedMaterial=this._getMaterialByName(e),this._applyParams("albedo",t,"map"),this.selectedMaterial.albedo&&(this.selectedMaterial.albedo.repeat.set(i,i),this.selectedMaterial.albedo.offset.set(n,n),this.selectedMaterial.needsUpdate=!0)}},{key:"setNormalMap",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;this.selectedMaterial=this._getMaterialByName(e),this._applyParams("normalMap",t,"map"),this._applyParams("normalScale",n),this.selectedMaterial.normalMap&&(this.selectedMaterial.normalMap.repeat.set(r,r),this.selectedMaterial.normalMap.offset.set(i,i),this.selectedMaterial.needsUpdate=!0)}},{key:"_updateTransparent",value:function(){this.selectedMaterial&&(this.selectedMaterial.opacity<1||this.selectedMaterial.transparency>0?this.selectedMaterial.transparent=!0:1==this.selectedMaterial.opacity&&0==this.selectedMaterial.transparency&&(this.selectedMaterial.transparent=!1))}},{key:"_getMaterialByName",value:function(e){var t=this.materials.find((function(t){return t.sname==e}));if(!t)throw new Error("找不到该材质");return t}},{key:"_applyParams",value:function(e,t,n){var i=this;if(this._cacheMaterials[this.selectedMaterial.name]||(this._cacheMaterials[this.selectedMaterial.name]=this.selectedMaterial.clone()),"map"===n){var r=this.selectedMaterial[e];if(void 0===this.selectedMaterial[e+"0"]&&(this.selectedMaterial[e+"0"]=r||null),t){var a=t;t=this.mapLoader.load(t,(function(t){"reflectMap"!==e&&"envMap"!==e||((t=i.mapLoader.convertTexture(t)).image.src=a,i.selectedMaterial[e]=t,i.selectedMaterial.needsUpdate=!0)})),"envMap"===e?t.custom=!0:t.wrapS=t.wrapT=1e3}else t=null;this.selectedMaterial[e]=t}else"color"===n?this.selectedMaterial[e].set(t):this.selectedMaterial[e]=t;this.selectedMaterial.needsUpdate=!0}},{key:"applyMaterialFile",value:function(e){var t=this,n=e.url,i=e.onTextureLoad,r=e.env,a=e.fromOthers,o=e.localPath;this.loader&&(this.splitCache&&(this.splitCache.map((function(e){var n=t.objects.find((function(t){return t.id===e.a})),i=t.materials.find((function(t){return t.name===e.c}));i&&(n.material[e.b]=i)})),this.splitCache=[]),this.loader.loader.extraMaterial={},o&&this.loader.mapLoader.setBaseUrl(o),this.loader.loader.replaceMaterials({url:n,fromOthers:a,onTextureLoad:i,onLoad:function(){t.mapLoader.setBaseUrl(!1),r&&t.setEnvMap(t.envMap)}}))}},{key:"dissolve",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this,n=this.viewer,i=e.target,r=e.speed,a=e.type,o=e.color,s=e.onComplete,l=e.start,A=e.end;if(void 0===i&&(i=this.objects),!Array.isArray(i))return new Error("param.target 必须为一个节点/网格类型数组, 默认使用整个Model下所有子节点");void 0===a&&(a="Perlin");var c=["Perlin","Radial","Linner"].includes(a)?Ff[a]:a;if(!c.isTexture)return new Error("param.type 必须为一'Perlin', 'Radial', 'Linner'中一个, 或者使用自定义Texture对象");r=r||1,l=l||0,A=A||1,o=new Fn(o||16774921);var h=[],u=new WeakMap,d=[];Array.isArray(i)&&i.map((function(e){e.isMesh&&!h.includes(e)&&h.push(e),e.isObject3D&&e.traverse((function(e){e.isMesh&&!h.includes(e)&&h.push(e)}))})),h.map((function(e){return m(e)})),n.addEventListener(ld.UPDATE,p);var f=l;function p(){f>=A&&(n.removeEventListener(ld.UPDATE,p),s&&s(),p=null),f+=.005*r,d.map((function(e){u.get(e).dissolveRatio=f}))}function m(e){e.material=e.material.map((function(e){if(e.isAMRTShadowMaterial)return e;if(e.dissolveMap&&(e=t._cache.get(e)),u.has(e))return u.get(e);var n=(new El).copy(e);return n.dissolveMap=c,n.dissolveRatio=l,n.dissolveColor=o,t._cache.set(n,e),u.set(e,n),d.push(e),n}))}}},{key:"clearDissolve",value:function(){var e=this;this.objects.map((function(t){t.material=t.material.map((function(t){return e._cache.has(t)?e._cache.get(t):t}))})),this._cache=new WeakMap}},{key:"showSkeleton",value:function(){this.skeleton?this.skeleton.visible=!0:(this.skeleton=new sh(this),this.skeleton.visible=!0,this.add(this.skeleton))}},{key:"hideSkeleton",value:function(){this.skeleton&&(this.skeleton.visible=!1),this.skeleton=null}},{key:"getNodeTree",value:function(){var e={};return this._getNodeTree(this.children[0],e),e}},{key:"_getNodeTree",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.ID=e.ID,n.id=e.id,n.name=e.name,n.children=[],e.children&&e.children.length>0&&e.children.forEach((function(e){n.children.push(t._getNodeTree(e))})),n}},{key:"onMouseOver",value:function(e,t){e&&t&&(this._findListener(this.mouseoverListeners,e,t)||(e._targetRoot=!0,this.mouseoverListeners.push({target:e,handle:t})))}},{key:"offMouseOver",value:function(e,t){var n=this._findListener(this.mouseoverListeners,e,t);n&&(this.mouseoverListeners.remove(n),delete n.target._targetRoot)}},{key:"onMouseOut",value:function(e,t){e&&t&&(this._findListener(this.mouseoutListeners,e,t)||(e._targetRoot=!0,this.mouseoutListeners.push({target:e,handle:t})))}},{key:"offMouseOut",value:function(e,t){var n=this._findListener(this.mouseoutListeners,e,t);n&&(this.mouseoutListeners.remove(n),delete n.target._targetRoot)}},{key:"_mousemoveHandler",value:function(e){var t=this;if(this.mouseoverListeners.length+this.mouseoutListeners.length>0){var n=[];this.mouseoverListeners.forEach((function(e){n.includes(e.target)||n.push(e.target)}));var i=this.viewer.modelManager.picker.intersectObject(e,n,!0),r=null;if(i){var a=function(e){e._targetRoot&&(t.mouseoverListeners.forEach((function(n){n.target===e&&n.target!==t.currentIntersectTarget&&n.handle(n.target)})),r=e)};i.object._targetRoot?a(i.object):i.object.traverseAncestors(a)}for(var o=0;o<this.mouseoutListeners.length;o++){var s=this.mouseoutListeners[o];s.target===this.currentIntersectTarget&&r!==this.currentIntersectTarget&&s.handle(s.target)}this.currentIntersectTarget=r}}},{key:"_findListener",value:function(e,t,n){return e.find((function(e){return e.target===t&&e.handle===n}))}},{key:"copy",value:function(e){var t=this;if(b(u(i.prototype),"copy",this).call(this,e),this.traverse((function(e){"penLine"==e.name&&t.remove(e)})),this.isModel=e.isModel,this.name=e.name,this.modelPath=e.modelPath,this.init(this),this.effect=e.effect.clone(this),this.animation=e.animation.clone(this),this.envMap=e.envMap,e.clickCallback.forEach((function(e){t.on("click",e)})),e.dblclickCallback.forEach((function(e){t.on("dblclick",e)})),e.mousedownCallback.forEach((function(e){t.on("mousedown",e)})),e.mousemoveCallback.forEach((function(e){t.on("mousemove",e)})),this.cloneSkinnedMesh(this),e.dimension){var n=e.dimension;this.showDimension(n.length,n.width,n.height,n.color)}return e.viewer.modelManager.add(this),this}},{key:"clone",value:function(){var e=new this.constructor(this.viewer).copy(this);if(e.traverse((function(t){"penLine"==t.name&&e.remove(t)})),e.isModel=this.isModel,e.name=this.name,e.modelPath=this.modelPath,e.init(e),e.effect=this.effect.clone(e),e.animation=this.animation.clone(e),e.envMap=this.envMap,this.clickCallback.forEach((function(t){e.on("click",t)})),this.dblclickCallback.forEach((function(t){e.on("dblclick",t)})),this.mousedownCallback.forEach((function(t){e.on("mousedown",t)})),this.mousemoveCallback.forEach((function(t){e.on("mousemove",t)})),e.cloneSkinnedMesh(e),this.dimension){var t=this.dimension;e.showDimension(t.length,t.width,t.height,t.color)}return this.viewer.modelManager.add(e),e}},{key:"cloneSkinnedMesh",value:function(e){if(e){if(1==e.isSkinnedMesh){for(var t=e.skeleton.bones,n=[],i=0;i<t.length;i++){var r=t[i].uuid,a=this.getObjectByProperty("lastUUID",r);n.push(a)}var o=new To(n);e.bind(o)}for(var s=0;s<e.children.length;s++)this.cloneSkinnedMesh(e.children[s])}}}]),i}(zt),Pf={};function Uf(){}Uf.prototype=Object.assign(Uf.prototype,{constructor:Uf,load:function(e,t,n,i){if(void 0===Pf[e]){Pf[e]=[],Pf[e].push({onLoad:t,onProgress:n,onError:i});var r=new XMLHttpRequest;return r.open("GET",e,!0),r.addEventListener("load",(function(t){var n=this.response,i=Pf[e];if(delete Pf[e],200===this.status||0===this.status)for(var a=0,o=i.length;a<o;a++){(s=i[a]).onLoad&&s.onLoad(n)}else for(a=0,o=i.length;a<o;a++){var s;(s=i[a]).onError&&s.onError(t)}r.end=!0}),!1),r.addEventListener("progress",(function(t){for(var n=Pf[e],i=0,r=n.length;i<r;i++){var a=n[i];a.onProgress&&a.onProgress(t)}}),!1),r.addEventListener("error",(function(t){var n=Pf[e];delete Pf[e];for(var i=0,a=n.length;i<a;i++){var o=n[i];o.onError&&o.onError(t)}r.end=!0}),!1),r.addEventListener("abort",(function(t){var n=Pf[e];delete Pf[e];for(var i=0,a=n.length;i<a;i++){var o=n[i];o.onError&&o.onError(t)}r.end=!0}),!1),void 0!==this.responseType&&(r.responseType=this.responseType),r.send(null),r}Pf[e].push({onLoad:t,onProgress:n,onError:i})},setResponseType:function(e){return this.responseType=e,this}});var Df=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),(i=t.call(this,e)).isBIM=!0,i.bimConfig=null,i.structureTree=null,i.basePath="",i.extension="",i.nodeTree=null,i.nodeArray=[],i.faceMap=null,i.hideNodes={},i}return A(n,[{key:"getComponentInfo",value:function(e,t){if(void 0!==e.faceIndex){var n=this.getComponentInfoByFace(e);if(n){var i=this._findNodeParent(n);n.bim||i.bim?t(n.bim||i.bim):this.getComponentFileByCID(n.CID||i.CID,(function(){t(n.bim||i.bim)}))}}else e.userData.bim||e.parent.userData.bim?t(e.userData.bim||e.parent.userData.bim):this.getComponentFileByCID(e.CID||e.parent.CID,(function(){t(e.userData.bim||e.parent.userData.bim)}))}},{key:"getObjectByCID",value:function(e){return this.getObjectByProperty("CID",parseInt(e))}},{key:"getComponentInfoByCID",value:function(e){var t=this.getObjectByProperty("CID",parseInt(e));if(t)return this.getComponentInfo(t)}},{key:"getComponentFileByCID",value:function(e,t){for(var n=0;n<this.bimConfig.length;n++){var i=this.bimConfig[n];!i.loaded&&i.b.indexOf(e)>-1&&this.loadComponentFile(i,t)}}},{key:"loadComponentFile",value:function(e,t){var n=this,i="gz"===this.extension?e.a+"."+this.extension:e.a;(new Uf).load(this.basePath+i,(function(e){n.parseComponentFile(JSON.parse(e)),t()})),e.loaded=!0}},{key:"parseComponentFile",value:function(e,t){var n=this;e.forEach((function(e){var t={id:e.a,pid:e.b,name:e.c,data:e.d};if(n.nodeTree){var i=n.nodeArray.find((function(t){return t.CID==e.a}));i&&(i.bim=t)}else{var r=n.getObjectByProperty("CID",e.a);r&&(r.userData.bim=t)}}))}},{key:"onComplete",value:function(){var e=this;this.objects=[],this.traverse((function(t){if(t.isMesh&&e.objects.push(t),t.name.indexOf("##")>-1){var n=t.name.split("##");t.name=n[0],t.CID=parseInt(n[1])}}))}},{key:"getNodeByFace",value:function(e){return this.nodeArray.find((function(t){return e>=t.face[0]&&e<=t.face[1]}))}},{key:"getComponentInfoByFace",value:function(e,t){var n=this.faceMap.find((function(t){return t.a==e.object.ID}));if(n){for(var i=null,r=0,a=n.b.length;r<a;r+=3)if(e.faceIndex>=n.b[r]&&e.faceIndex<=n.b[r+1]){i=n.b[r+2];break}if(null!==i)return this.nodeArray.find((function(e){return e.a==i}))}}},{key:"getFaceRange",value:function(e){var t=this.faceMap.find((function(t){return t.a==e.object.ID}));if(t){for(var n=0,i=t.b.length;n<i;n+=3)if(e.faceIndex>=t.b[n]&&e.faceIndex<=t.b[n+1])return{face:[t.b[n],t.b[n+1]],id:t.b[n+2],node:this.nodeTree[t.b[n+2]]};return null}}},{key:"setMaterialByFace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#00f9ff",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=this.getFaceRange(e),r=e.object,a=r.material[0].clone();a.color.setStyle(t),a.opacity=n,r.changeNodes[i.id]={node:i,mat:a},this._resetMaterial(r)}},{key:"_resetMaterial",value:function(e){var t=e.geometry.index.count,n=[],i=[];e.geometry.index.array=[],e.material=[e.material[0]];var r=Object.values(e.changeNodes),a=r.length;r.forEach((function(e){n.push([]),n[n.length-1].mat=e.mat}));for(var o=0;o<t;o++){for(var s=!0,l=0;l<a;l++){var A=r[l],c=3*A.node.face[0],h=3*A.node.face[1];o>=c&&o<h&&(n[l].push(e.originIndex[o]),s=!1)}s&&i.push(e.originIndex[o])}var u=[];n.forEach((function(e){u=u.concat(e)})),e.geometry.setIndex(i.concat(u)),e.geometry.clearGroups(),e.geometry.addGroup(0,i.length,0);var d=i.length;n.forEach((function(t,n){e.geometry.addGroup(d,t.length,n+1),e.material.push(t.mat),d+=t.length})),AMRT.render()}},{key:"clearMaterialByFace",value:function(e){var t=this.getFaceRange(e),n=e.object;n.changeNodes[t.id]&&(delete n.changeNodes[t.id],this._resetMaterial(n))}},{key:"setNodeVisible",value:function(e,t,n){t.forEach((function(t){n?e.hideNodes[t.id]&&delete e.hideNodes[t.id]:e.hideNodes[t.id]=t.face}));var i=e.originIndex.length;e.geometry.index.array=[];for(var r=[],a=Object.values(e.hideNodes),o=a.length,s=0;s<i;s++){for(var l=!0,A=0;A<o;A++){var c=a[A],h=3*c[0],u=3*c[1];if(s>=h&&s<u){l=!1;break}}l&&r.push(e.originIndex[s])}e.geometry.setIndex(r),e.geometry.clearGroups(),e.geometry.addGroup(0,r.length,0),AMRT.render()}},{key:"showComponentByCID",value:function(e){if(this.nodeTree)this._setComponentVisible(e,!0);else{var t=this.getObjectByProperty("CID",e);t&&(t.visible=!1)}}},{key:"hideComponentByCID",value:function(e){if(this.nodeTree)this._setComponentVisible(e,!1);else{var t=this.getObjectByProperty("CID",e);t&&(t.visible=!0)}}},{key:"_setComponentVisible",value:function(e,t){var n=this;if(this.hideNodes[e])console.time("setFace"),this.hideNodes[e].forEach((function(e){n.setNodeVisible(e.mesh,e.nodes,t)})),console.timeEnd("setFace");else{console.time("总耗时"),console.time("findChildren");var i=this._findNodeByCID(e),r=this._getNodeChild(i);console.timeEnd("findChildren"),console.time("findMesh");for(var a={},o=0,s=r.length;o<s;o++){var l=this._findMeshByNode(r[o]);l&&(a[l.mesh.ID]?a[l.mesh.ID].nodes.push(l):a[l.mesh.ID]={mesh:l.mesh,nodes:[l]})}console.log(a),console.timeEnd("findMesh"),console.time("setFace"),t||this.hideNodes[e]||(this.hideNodes[e]=[]),Object.values(a).forEach((function(i){if(i.nodes.length>1){var r=n._findNodeParent(i.nodes[0].node);i.nodes=[{mesh:i.mesh,id:r.a,node:r,face:[i.nodes[0].face[0],i.nodes[i.nodes.length-1].face[1]]}]}n.setNodeVisible(i.mesh,i.nodes,t),t||n.hideNodes[e].push(i)})),console.timeEnd("setFace"),console.timeEnd("总耗时")}}},{key:"_findNodeByCID",value:function(e){return this.nodeArray.find((function(t){return t.CID==e}))}},{key:"_findMeshByCID",value:function(e){var t=this._findNodeByCID(e);return t?this._findMeshByNode(t):null}},{key:"_findMeshByNode",value:function(e){var t=e.target||this._findMeshByNodeID(e.a);if(t)return e.target=t,t.node=e,t;e.children||this._findNodeChildren(e);for(var n=0,i=e.children.length;n<i;n++){var r=e.children[n].target||this._findMeshByNodeID(e.children[n].a);if(r)return e.children[n].target=r,r.node=e,r}return null}},{key:"_findMeshByNodeID",value:function(e){for(var t=0,n=this.faceMap.length;t<n;t++)for(var i=this.faceMap[t],r=0,a=i.b.length;r<a;r+=3)if(e==i.b[r+2]){var o=this.getObjectByProperty("ID",i.a);if(o)return{mesh:o,face:[i.b[r],i.b[r+1]],id:e}}return null}},{key:"_getNodeChild",value:function(e){var t=[];return function e(n){if(t.push(n),n.children&&n.children.length>0)for(var i=0,r=n.children.length;i<r;i++)e(n.children[i])}(e),t}},{key:"_findNodeChildren",value:function(e){e.children=[],this.nodeArray.forEach((function(t){t.c==e.a&&e.children.push(t)}))}},{key:"_findNodeParent",value:function(e){if(e.parent)return e.parent;for(var t=0;t<this.nodeArray.length;t++)if(e.c==this.nodeArray[t].a)return e.parent=this.nodeArray[t],e.parent}}]),n}(kf);function Rf(e){var t=new El;return t.name=e,t.ID=e,t.color=new Fn("#cccccc"),t}var Of={},Nf=function(){function e(){s(this,e)}return A(e,null,[{key:"parseAmrtMaterial",value:function(e,t,n,i,r,a){var o=arguments.length>6&&void 0!==arguments[6]&&arguments[6];n||(n=Rf(matName)),void 0!==e.a&&(n.name=e.a,n.ID=e.a,n.sname=e.ee);var s=0,l=0;function A(){++s===l&&(n.needsUpdate=!0,r&&r instanceof Function&&r())}if(!o)if(void 0!==e.b?n.color=(new Fn).fromArray(e.b):n.color.set(16777215),void 0!==e.c&&t[e.c]){l++;var c=t[e.c];a.load(c,(function(t){null!=e.t&&t.repeat.set(e.t[0],e.t[1]),null!=e.x&&t.offset.set(e.x[0],e.x[1]),null!=e.ff&&(t.rotation=e.ff),null!=e.ad&&(n.albedoUV=e.ad),n.albedo=t,void 0!==e.c?n.useDefault=e.useDefault:n.useDefault=!0,A()}),null,(function(e){console.error("贴图加载出错"),A()}))}else n.albedo=null,n.albedoUV=null,n.needsUpdate=!0;if(e.d){var h=(new Fn).fromArray(e.d);n.emissive=h}if(void 0!==e.e&&(n.aoScale=parseFloat(e.e)),void 0!==e.f&&n.color.multiplyScalar(parseFloat(e.f)),void 0!==e.g&&(n.smoothness=parseFloat(e.g)),void 0!==e.h&&(n.metallic=parseFloat(e.h)),void 0!==e.i&&(n.normalScale=parseFloat(e.i)),void 0!==e.j&&(n.opacity=parseFloat(e.j)),void 0!==e.gg&&(n.transparency=parseFloat(e.gg)),(n.opacity<1||n.transparency>0)&&(n.transparent=!0),void 0!==e.hh&&(n.alphaTest=parseFloat(e.hh)),void 0!==e.ii&&(n.reflectIntensity=parseFloat(e.ii)),void 0!==e.si&&(n.side=e.si),void 0!==e.q&&t[e.q]?(l++,a.load(t[e.q],(function(t){void 0!==e.u?t.repeat.set(e.u[0],e.u[1]):t.repeat.set(1,1),void 0!==e.mm&&t.offset.set(e.mm[0],e.mm[1]),void 0!==e.nn&&(t.rotation=e.nn),n.normalMap=t,A()}),null,(function(e){console.error("贴图加载出错"),A()}))):(n.normalMap=null,n.needsUpdate=!0),void 0!==e.cf&&t[e.cf]?(l++,a.load(t[e.cf],(function(t){void 0!==e.cb?t.repeat.set(e.cb[0],e.cb[1]):t.repeat.set(1,1),void 0!==e.cg&&t.offset.set(e.cg[0],e.cg[1]),void 0!==e.cn&&(t.rotation=e.cn),void 0!==e.ca&&(n.normalScale2=parseFloat(e.ca)),n.normalMap2=t,A()}),null,(function(e){console.error("贴图加载出错"),A()}))):(n.normalMap2=null,n.needsUpdate=!0),void 0!==e.r&&t[e.r]&&void 0!==e.fd){l++;var u=t[e.r];Of[u]?(n.aoMap=Of[u],n.aoUV=e.fd,Of[u+"_mats"].push(n),A()):(n.aoMap=Of[u]=a.load(t[e.r],(function(t){void 0!==e.v?t.repeat.set(e.v[0],e.v[1]):t.repeat.set(1,1),void 0!==e.oo&&t.offset.set(e.oo[0],e.oo[1]),void 0!==e.ss&&(t.rotation=e.ss),n.aoUV=e.fd,Of[u+"_mats"]&&Of[u+"_mats"].map((function(e){return e.needsUpdate=!0})),A()}),null,(function(e){console.error("贴图加载出错"),A()})),Of[u+"_mats"]=[n])}else n.aoMap=null,n.needsUpdate=!0;if(void 0!==e.y&&t[e.y]?(l++,a.load(t[e.y],(function(t){void 0!==e.bb?t.repeat.set(e.bb[0],e.bb[1]):t.repeat.set(1,1),void 0!==e.pp&&t.offset.set(e.pp[0],e.pp[1]),void 0!==e.tt&&(t.rotation=e.tt),n.metallicMap=t,A()}),null,(function(e){console.error("贴图加载出错"),A()}))):(n.metallicMap=null,n.needsUpdate=!0),void 0!==e.z&&t[e.z]?(l++,a.load(t[e.z],(function(t){void 0!==e.cc?t.repeat.set(e.cc[0],e.cc[1]):t.repeat.set(1,1),void 0!==e.qq&&t.offset.set(e.qq[0],e.qq[1]),void 0!==e.uu&&(t.rotation=e.uu),n.roughnessMap=t,A()}),null,(function(e){console.error("贴图加载出错"),A()}))):(n.roughnessMap=null,n.needsUpdate=!0),void 0!==e.aa&&t[e.aa]?(l++,a.load(t[e.aa],(function(t){void 0!==e.dd?t.repeat.set(e.dd[0],e.dd[1]):t.repeat.set(1,1),void 0!==e.rr&&t.offset.set(e.rr[0],e.rr[1]),void 0!==e.vv&&(t.rotation=e.vv),void 0!==e.gd&&(n.emissiveUV=e.gd),n.emissiveMap=t,A()}),null,(function(e){console.error("贴图加载出错"),A()}))):(n.emissiveMap=null,n.needsUpdate=!0),void 0!==e.ll&&t[e.ll]){l++;var d=t[e.ll];void 0!==e.yy&&(n.reflectRotateY=e.yy),a.load(d,(function(e){var t=e.image;e.wrapS=e.wrapT=1e3,0===e.image.width||0===e.image.height?setTimeout((function(){e=a.convertTexture(e),n.reflectMap=e,e.image=t,A()}),500):(e=a.convertTexture(e),n.reflectMap=e,e.image=t,A())}),null,(function(e){console.error("贴图加载出错"),A()}))}else n.reflectMap=null,n.needsUpdate=!0;if(void 0!==e.zz&&t[e.zz]){l++;var f=t[e.zz];a.load(f,(function(t){void 0!==e.bb?t.repeat.set(e.zx[0],e.zx[1]):t.repeat.set(1,1),void 0!==e.pp&&t.offset.set(e.zc[0],e.zc[1]),void 0!==e.zv&&(t.rotation=e.zv),n.alphaMap=t,A()}),null,(function(e){console.error("贴图加载出错"),A()}))}else n.reflectMap=null,n.needsUpdate=!0;return n.retainMap=!0,void 0!==e.jj&&(n.retainMap=Boolean(e.ii)),void 0!==e.kk&&!0!==e.kk?n.renderOrder=Number(e.kk):n.renderOrder=n.opacity<1?Ke:Ze,null!=e.jr&&(n.reflectivity=e.jr),null!=e.l&&(n.wireframe=e.l),null!=e.o&&(n.skinning=e.o),null!=e.p&&(n.vertexTangents=e.p),null!=e.qn&&(n.normalMapType=e.qn),null!=e.rm&&(n.morphTargets=e.rm),null!=e.transparent&&(n.transparent=e.transparent),void 0!==e.re&&(n.re=e.re),void 0!==e.dt&&(n.depthTest=e.dt),void 0!==e.dw&&(n.depthWrite=e.dw),n.needsUpdate=!0,i&&i instanceof Function&&i(n),0===l&&r&&r instanceof Function&&r(n),n}},{key:"export",value:function(e,t){if(void 0!==e.re)return{a:e.ID||e.name,re:e.re};var n=Object.keys(t).length,i={a:e.ID||e.name,b:e.color.toArray(),d:e.emissive.toArray(),e:e.aoScale,g:e.smoothness,h:e.metallic,i:e.normalScale,j:e.opacity,gg:e.transparency,hh:e.alphaTest,ii:e.reflectIntensity,jj:e.retainMap,kk:e.renderOrder,ee:e.sname,useDefault:e.useDefault,transparent:e.transparent,si:e.side,jr:e.reflectivity,lw:e.wireframe,os:e.skinning,pv:e.vertexTangents,qn:e.normalMapType,rm:e.morphTargets,dw:e.depthWrite,dt:e.depthTest};return e.albedo&&(i.t=e.albedo.repeat.toArray(),i.x=e.albedo.offset.toArray(),i.ff=e.albedo.rotation,i.ad=e.albedoUV,e.albedo.image&&(i.c=n,t[n]=e.albedo.image.src,n++)),e.normalMap&&(i.u=e.normalMap.repeat.toArray(),i.mm=e.normalMap.offset.toArray(),i.nn=e.normalMap.rotation,e.normalMap.image&&(i.q=n,t[n]=e.normalMap.image.src,n++)),e.normalMap2&&(i.cb=e.normalMap2.repeat.toArray(),i.cg=e.normalMap2.offset.toArray(),i.cn=e.normalMap2.rotation,i.ca=e.normalMap2.normalScale2,e.normalMap2.image&&(i.cf=n,t[n]=e.normalMap2.image.src,n++)),e.aoMap&&(i.v=e.aoMap.repeat.toArray(),i.oo=e.aoMap.offset.toArray(),i.ss=e.aoMap.rotation,i.fd=e.aoUV,e.aoMap.image&&(i.r=n,t[n]=e.aoMap.image.src,n++)),e.metallicMap&&(i.bb=e.metallicMap.repeat.toArray(),i.pp=e.metallicMap.offset.toArray(),i.tt=e.metallicMap.rotation,e.metallicMap.image&&(i.y=n,t[n]=e.metallicMap.image.src,n++)),e.roughnessMap&&(i.cc=e.roughnessMap.repeat.toArray(),i.qq=e.roughnessMap.offset.toArray(),i.uu=e.roughnessMap.rotation,e.roughnessMap.image&&(i.z=n,t[n]=e.roughnessMap.image.src,n++)),e.emissiveMap&&(i.dd=e.emissiveMap.repeat.toArray(),i.rr=e.emissiveMap.offset.toArray(),i.vv=e.emissiveMap.rotation,i.gd=e.emissiveUV,e.emissiveMap.image&&(i.aa=n,t[n]=e.emissiveMap.image.src,n++)),e.reflectMap&&e.reflectMap.image&&(i.yy=e.reflectRotateY,i.ll=n,t[n]=e.reflectMap.image.src,n++),e.alphaMap&&(i.zx=e.alphaMap.repeat.toArray(),i.zc=e.alphaMap.offset.toArray(),i.zv=e.alphaMap.rotation,e.alphaMap.image&&(i.zz=n,t[n]=e.alphaMap.image.src,n++)),i}},{key:"merge",value:function(e,t){var n=0;if(e.b&&(n=Object.keys(e.b).length,t.b))for(var i in t.b)i=parseInt(i),e.b[i+n]=t.b[i];Array.isArray(t.a)&&(t.a=t.a.filter((function(e){return void 0===e.re})),e.a.map((function(i,r){if(i.ee){var a=t.a.find((function(e){return e.ee===i.ee}));for(var o in a)["c","q","cf","r","y","z","aa","ll","zz"].includes(o)&&(a[o]=a[o]+n);a&&(a.a=i.a,e.a[r]=Object.assign({},a))}})))}}]),e}(),zf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;s(this,e),this.viewer=n,this.cacheMats=[],this.queryMats={},this.cacheMeshes=[],this.cacheMesheIds=[],this.cacheAnimations=[],this.cacheActions=[],this.cacheSkyboxs={},this.cacheSkinnedMeshs=[],this.cacheSkinnedMeshIds=[],this.cacheEnvMap={},this.cacheAoMap={},this.instances=null,this.extraMaterial={},this.cacheExtraMat=[],this.scene=null,this.hasSkinnedAnimation=!1,this.model=t.isBIM?new Df(this.viewer):new kf(this.viewer),this.model.objects=this.cacheMeshes,this.model.materials=this.cacheMats,this.animNameMap=new Map}return A(e,[{key:"load",value:function(e,t,n,i){var r=this;"undefined"!=typeof Worker?(this.workerLoader=new Md,this.workerLoader.loadMesh(e,(function(e){t(r.parse(e))}),n,(function(e){console.error("网格文件解析出错!"),i&&i(e)}))):(new Kl).load(e,(function(e){try{r.parse(JSON.parse(e))}catch(e){console.error("网格文件解析出错!",e),i&&i(e)}t(r.model)}),n,i)}},{key:"loadNodes",value:function(e,t,n){var i=this;(new Kl).load(e,(function(e){i.generateNodes(JSON.parse(e)),t()}),void 0,(function(t){console.error("节点文件加载失败:"+e,t)}))}},{key:"generateNodes",value:function(e){var t=this;e.forEach((function(e){var n=new ja;if(n.ID=e.a,n.name=e.b,-1==e.c)t.model.add(n);else{var i=t.model.getObjectByProperty("ID",e.c);i&&i.add(n)}n.applyMatrix((new bt).fromArray(e.d)),t.addToCache(n)}))}},{key:"bindSkeleton",value:function(){}},{key:"initSkeletonTransform",value:function(){}},{key:"loadMeshComplete",value:function(){}},{key:"parse",value:function(e){var t=this.model;Array.isArray(e)||(e=[e]);for(var n=[],i=function(t){e.find((function(n,i){return n.a===e[t].a&&t!=i}))&&(e[t].a+=e[t].b)},r=0;r<e.length;r++)i(r);for(var a=0;a<e.length;a++){var o=void 0,s=e[a];if(6==s.at&&this.instances){var l=this._getInstanceMatrix(s.a);l&&(s.iid=s.a,s.a=l.b,s.b=l.a,s.d=l.d)}if(null==s.at||0==s.at||2==s.at||6==s.at||s.h&&s.ff&&0==s.ff.length)if(o=this.generateMesh(s),void 0!==s.iid&&(o.iid=s.iid),this.addToCache(o),-1===o.parentID)t.add(o);else{var A=this.cacheMesheIds.indexOf(o.parentID);-1!==A?this.cacheMeshes[A].add(o):t.add(o)}else if(1==s.at||3==s.at)if(o=this.generateSkinnedMesh(s),this.hasSkinnedAnimation=!0,this.cacheMesheIds.push(o.ID),-1===o.parentID)t.add(o);else{var c=this.cacheSkinnedMeshIds.indexOf(o.parentID);-1!==c?this.cacheSkinnedMeshs[c].add(o):t.add(o)}n.push(o)}if(this.hasSkinnedAnimation)for(var h=0;h<this.cacheSkinnedMeshs.length;h++){var u=this.cacheSkinnedMeshs[h];if(null!=u&&null!=u.xIDs){for(var d=[],f=0;f<u.xIDs.length;f++)d[f]=this.cacheSkinnedMeshs[u.xIDs[f]];var p=new To(d);u.bind(p)}}return this._initMaterial(),n}},{key:"generateMesh",value:function(e){var t;if(e.h&&e.h.length>0){var n=this.generateGeometry(e);t=new Ei(n,this.generateMaterial(n))}else t=new zt;return t.name=e.a,t.ID=e.b,t.parentID=e.c,t.applyMatrix((new bt).fromArray(e.d)),t}},{key:"generateSkinnedMesh",value:function(e){var t;if(e.h){var n=this.generateGeometry(e),i=this.generateMaterial(n,!0);e.ff&&e.ff.length>0?(i.skinning=!0,n.setAttribute("skinIndex",new jn(e.ff,4)),n.setAttribute("skinWeight",new Yn(e.gg,4)),(t=new Bo(n,i)).xIDs=e.hh):t=new Ei(n,i)}else t=new _o;return t.name=e.a,t.ID=e.b,t.applyMatrix((new bt).fromArray(e.d)),this.cacheSkinnedMeshs[e.b]=t,this.model.add(t),this.model.updateMatrixWorld(!0),t}},{key:"generateGeometry",value:function(e){var t=new si;t.name=e.a;var n=new bt;if(e.e&&n.fromArray(e.e),!(e.h&&e.h.length>0))return null;var i=new Yn(e.h,3);if(n.applyToBufferAttribute(i),t.setAttribute("position",i),e.j&&e.j.length>0){var r=new Yn(e.j,3);(new lt).getNormalMatrix(n).applyToBufferAttribute(r),t.setAttribute("normal",r)}else console.warn("无法线");e.k&&e.k.length>0?t.setAttribute("uv",new Yn(e.k,2)):console.warn("无UV"),e.l&&e.l.length>0&&t.setAttribute("uv2",new Yn(e.l,2)),t.setIndex(e.i),e.j&&0!=e.j.length||t.computeVertexNormals(),t.clearGroups(),e.k&&e.k.length>0&&pd(t);for(var a=[],o=0;o<e.m.length/3;o++)-1===a.indexOf(e.m[3*o+2])&&a.push(e.m[3*o+2]);for(var s=0;s<e.m.length/3;s++)t.addGroup(3*e.m[3*s],3*(e.m[3*s+1]-e.m[3*s]),a.indexOf(e.m[3*s+2]));return t.m=a,t}},{key:"preloadMap",value:function(e,t,n){this.workerLoader||(this.workerLoader=new Md),this.workerLoader.preloadMap(e,t,void 0,n)}},{key:"loadMaterials",value:function(e){var t=this,n=e.url,i=e.onLoad,r=e.onTextureLoad,a=e.onError;(new Kl).load(n,(function(e){e=JSON.parse(e),t.SnameTable&&Array.isArray(e.a)&&e.a.map((function(e){e.ee&&t.SnameTable[e.ee]&&(e.a=t.SnameTable[e.ee])})),t.parseMaterials(e,i,r,a)}))}},{key:"loadAOMap",value:function(e,t){var n=this;this.mapLoader.BASE_URL="",this.mapLoader.load(e,(function(e){e.wrapS=e.wrapT=1e3,n.cacheMats.forEach((function(t){t.aoMap=e,t.needsUpdate=!0})),t&&t instanceof Function&&t()}),null,t)}},{key:"generateMaterial",value:function(e,t){for(var n=[],i=0;i<e.m.length;i++){var r=e.m[i];if(void 0!==this.queryMats[r])n.push(this.cacheMats[this.queryMats[r]]);else{var a=this._createBaseMaterial(r);n.push(a),t&&(a.skinning=!0),this.cacheMats.push(a),this.queryMats[r]=this.cacheMats.length-1}}return delete e.m,n}},{key:"_createBaseMaterial",value:function(e){var t=new El;return t.ID=e,t.name=e,t.color=new Fn("#cccccc"),t}},{key:"parseMaterials",value:function(e,t,n,i){var r=this;if(Array.isArray(e)&&(e={a:e,b:[]}),this.extraMaterial=e.c||{},e.a.length>0){var a=0,o=0,s=e.a.length;e.a.forEach((function(l){r.parseMaterial({config:l,maps:e.b,onLoad:function(){++a===s&&(r._initMaterial(),t&&t instanceof Function&&t())},onTextureLoad:function(){++o===s&&n&&n instanceof Function&&n()},onError:i,edited:!1})}))}else t&&t instanceof Function&&t()}},{key:"parseMaterial",value:function(e){var t=e.config,n=e.maps,i=e.onLoad,r=e.onTextureLoad;e.onError;var a=e.edited,o=t.a,s=this.queryMats[o];if(void 0===s&&o&&o.toString().indexOf("_")>-1){var l=o.split("_")[0],A=this.queryMats[l],c=this.cacheMats[A],h=this.cacheMeshes.find((function(e){return e.name===t.mn})),u=c.clone();u.name=t.ee||o,u.sname=c.sname,u.ID=o,this.cacheMats.push(u),s=this.cacheMats.length-1,this.queryMats[o]=s,h.material[h.material.indexOf(c)]=u}var d=this.cacheMats[s];d||(d=this._createBaseMaterial(o),this.cacheMats.push(d),this.queryMats[o]=this.cacheMats.length-1),Nf.parseAmrtMaterial(t,n,d,i,r,this.mapLoader,a)}},{key:"loadAnimationComplete",value:function(e){this.model.animation.setAnimationList(["take 01"])}},{key:"loadAnimation",value:function(e,t){var n=this;(new Kl).load(e,(function(e){try{n.hasSkinnedAnimation?n.parseSkinnedAnimation(JSON.parse(e)):n.parseAnimation(JSON.parse(e))}catch(e){console.error("动画文件解析出错!",e)}t&&t()}))}},{key:"parseAnimation",value:function(e){for(var t=0,n=[],i=0;i<e.length;i++){var r=e[i],a=this.cacheMeshes[this.cacheMesheIds.indexOf(r.a)];switch(r.b){case"a":n.push(new Ql(a.name+".position",r.c,r.d));break;case"b":n.push(new Nl(a.name+".quaternion",r.c,r.d));break;case"c":n.push(new Ql(a.name+".scale",r.c,r.d))}var o=r.c[r.c.length-1];o>t&&(t=o)}var s=new Gl("take 01",t,n);this.model.animation.addClip(s)}},{key:"parseSkinnedAnimation",value:function(e){for(var t=[],n=0,i=0;i<e.length;i++){var r=e[i],a=this.cacheSkinnedMeshs[r.a].name,o=[],s=[],l=[],A=[];r.d>n&&(n=r.d);for(var c=0;c<r.b.length;c++){o.push(r.b[c].a);var h=(new bt).fromArray(r.b[c].b),u=new at,d=new nt,f=new at;h.decompose(u,d,f),s.push(u.x),s.push(u.y),s.push(u.z),l.push(d.x),l.push(d.y),l.push(d.z),l.push(d.w),A.push(f.x),A.push(f.y),A.push(f.z)}t.push(new Ql(a+".position",o,s)),t.push(new Nl(a+".quaternion",o,l)),t.push(new Ql(a+".scale",o,A))}var p=new Gl("take 01",n,t);this.model.animation.addClip(p)}},{key:"_getInstanceMatrix",value:function(e){for(var t=0,n=this.instances.length;t<n;t++)if(this.instances[t].c==e)return this.instances[t]}},{key:"addToCache",value:function(e){this.cacheMeshes.push(e),this.cacheMesheIds.push(e.ID)}},{key:"_initMaterial",value:function(){var e=this;this.cacheMeshes.forEach((function(t){if(t.isMesh&&!t.isHotSpotEntity){t.renderOrder=(Array.isArray(t.material)?t.material[0]:t.material).renderOrder;var n=Array.isArray(t.material)?t.material:[t.material];t.geometry.attributes&&!t.geometry.attributes.uv&&n.forEach((function(e){e.vertexTangents=!1})),t.geometry.attributes&&t.geometry.attributes.uv2&&n.forEach((function(e){void 0===e.aoUV&&(e.aoUV=1)}));var i=function(n){var i=e.extraMaterial[n],r=e.cacheMats.find((function(e){return e.name==n}));if(!r)return"continue";i.map((function(n){n.a==t.ID&&(e.cacheExtraMat.push({a:t.ID,b:n.b,c:t.material[n.b].name}),r.skinning=t.material[n.b].skinning,t.material[n.b]=r,t.overMaterial=[n.b].concat(C(t.overMaterial||[])))}))};for(var r in e.extraMaterial)i(r)}}))}},{key:"replaceMaterials",value:function(e){var t=this,n=e.url,i=e.onload,r=e.fromOthers,a=e.onTextureLoad;this.cacheExtraMat.map((function(e){var n=t.cacheMeshes.find((function(t){return t.ID==e.a})),i=t.cacheMats[t.queryMats[e.c]];n.material[e.b]=i})),this.extraMaterial={},r&&(this.SnameTable={},this.cacheMats.map((function(e){e.sname&&(t.SnameTable[e.sname]=e.ID)}))),this.loadMaterials({url:n,onload:i,onTextureLoad:a})}}]),e}(),Qf=function(){function e(e){Wl.call(this,e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this._geometryList=[],this.loadedFileNum=0,this.taskId2Worker={},this.workerStateById={},this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}function t(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===t||t}return e.prototype=Object.assign(Object.create(Wl.prototype),{constructor:e,setDecoderPath:function(e){return this.decoderPath=e,this},setDecoderConfig:function(e){return this.decoderConfig=e,this},setWorkerLimit:function(e){return this.workerLimit=e,this},setVerbosity:function(){console.warn("DRACOLoader: The .setVerbosity() method has been removed.")},setDrawMode:function(){console.warn("DRACOLoader: The .setDrawMode() method has been removed.")},setSkipDequantization:function(){console.warn("DRACOLoader: The .setSkipDequantization() method has been removed.")},load:function(e,t,n,i,r,a){var o=this,s=new Kl(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),"use-credentials"===this.crossOrigin&&s.setWithCredentials(!0),this.onLoad=t,this.onComplete=n;var l=this;s.load(e,(function(e){var t={attributeIDs:l.defaultAttributeIDs,attributeTypes:l.defaultAttributeTypes,useUniqueIDs:!1};o.decodeGeometry(e,t,a).catch(r)}),i,r)},decodeDracoFile:function(e,t,n,i,r){},decodeWholeFile:function(e,t){if("MBIN"===convertArrayBufferToString(e,0,4))return this.parseModelFile(e,t)},readPaddingBytes:function(e){var t=e.getUint8();e.getString(t)},decodeGeometry:function(e,t,n){var i,r=this;for(var a in t.attributeTypes){var o=t.attributeTypes[a];void 0!==o.BYTES_PER_ELEMENT&&(t.attributeTypes[a]=o.name)}if(0===e.byteLength)throw new Error("DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.");var s=this.workerNextTaskID++,l=e.byteLength;return this._getWorker(s,l).then((function(n){return i=n,r.workerStateById[s]=0,new Promise((function(n,a){i._callbacks[s]={resolve:n,reject:a},r.taskId2Worker[s]=i;try{i.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}catch(e){console.log(i)}}))}))},onReceiveMessageFromWebworker:function(e,t){var n=this.taskId2Worker[e];this._createGeometry(n,e,t),n&&e&&1==this.workerStateById[e]&&(this._releaseTask(n,e),this.workerStateById[e]=2,this.taskId2Worker[e]=null,this.onComplete())},arrayMax:function(e){if(0===e.length)return-1/0;for(var t=e[0],n=1,i=e.length;n<i;++n)e[n]>t&&(t=e[n]);return t},_createGeometry:function(e,t,n){if("mbin"===n.fileType){if(n.bComplete&&(this.workerStateById[t]=1),null===(c=n.geometry)||null==c)return;if(c.chunkType,2===c.chunkType){var i=new si;if(i.custom_data={},i.custom_data.id=c.id,i.custom_data.parentId=c.parentId,i.custom_data.matrix=c.matrix,i.custom_data.bIsNodel=c.bIsNodel,i.custom_data.nodeType=c.nodeType,i.custom_data.version=c.version,void 0!==c.materialIndex){i.clearGroups(),i.custom_data.materialIndex=[];for(var r=c.materialIndex.length/3,a=0;a<r;a++)i.custom_data.materialIndex.push(c.materialIndex[3*a+2]),i.addGroup(3*c.materialIndex[3*a],3*c.materialIndex[3*a+1],a)}i.name=OA.decodeText(new Uint8Array(c.name)),c.index&&(i.index=new(this.arrayMax(c.index.array)>65535?Xn:jn)(c.index.array,1),delete c.index.array,c.index=null);for(a=0;a<c.attributes.length;a++){var o=c.attributes[a],s=o.name,l=o.itemSize,A=new zn(c.attributes[a].array,l);i.setAttribute(s,A),delete c.attributes[a].array,c.attributes[a]=null}c=null,this.onLoad(i)}}else if("bbin"===n.fileType||"bmbin"===n.fileType){if(n.bComplete&&(this.workerStateById[t]=1),null===n.geometry)return;this.onLoad(n.geometry)}else if("kmbin"===n.fileType){if(n.bComplete&&(this.workerStateById[t]=1),null===n.geometry)return;n.geometry.insts.forEach((function(e){e.name=OA.decodeText(new Uint8Array(e.name))})),this.onLoad(n.geometry)}else if("abin"===n.fileType){if(n.bComplete&&(this.workerStateById[t]=1),null===n.geometry)return void this.onLoad(!1);n.geometry.name=OA.decodeText(new Uint8Array(n.geometry.name)),this.onLoad(n.geometry)}else if("addbin"===n.fileType){var c;if(n.bComplete&&(this.workerStateById[t]=1),null===(c=n.geometry))return;c.type="meshGroup",this.onLoad(c)}},_loadLibrary:function(e,t){var n=new Kl(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),new Promise((function(t,i){n.load(e,t,void 0,i)}))},preload:function(){return this._initDecoder(),this},_initDecoder:function(){var t=this;if(this.decoderPending)return this.decoderPending;var n="object"!==("undefined"==typeof WebAssembly?"undefined":r(WebAssembly))||"js"===this.decoderConfig.type,i=[];return n?i.push(this._loadLibrary("../amrt_decoder.js","text")):(i.push(this._loadLibrary("../../amrt_wasm_wrapper.js","text")),i.push(this._loadLibrary("../../amrt_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(i).then((function(i){var r=i[0];n||(t.decoderConfig.wasmBinary=i[1]);var a=e.DRACOWorker.toString(),o=["/* draco decoder */",r,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join("\n");t.workerSourceURL=URL.createObjectURL(new Blob([o]))})),this.decoderPending},_getWorker:function(e,t){var n=this;return this._initDecoder().then((function(){if(n.workerPool.length<n.workerLimit){var i;(i=new Worker(n.workerSourceURL))._callbacks={},i._taskCosts={},i._taskLoad=0,i.postMessage({type:"init",decoderConfig:n.decoderConfig});var r=n;i.onmessage=function(e){var t=e.data;switch(t.type){case"decode":r.onReceiveMessageFromWebworker(t.id,t);break;case"error":i._callbacks[t.id].reject(t);break;default:console.error('DRACOLoader: Unexpected message, "'+t.type+'"')}},n.workerPool.push(i)}else n.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));return(i=n.workerPool[n.workerPool.length-1])._taskCosts[e]=t,i._taskLoad+=t,i})).catch((function(e){console.log(e)}))},_releaseTask:function(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]},debug:function(){console.log("Task load: ",this.workerPool.map((function(e){return e._taskLoad})))},dispose:function(){for(var e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}),e.DRACOWorker=function(){var e,t,n=0;function i(e,t,n,i,s){var l={},A=0,c=e.getUint32(),h=e.getOffset(),u=e.getUint8();l.name=e.getString(u),l.ticksPerSecond=e.getFloat32(),l.Duration=e.getFloat32();var d=32&e.getUint32();l.isBoneAnim=!1,l.animType2Anim={},l.animType2Anim.transAnim=[],l.animType2Anim.rotAnim=[],l.animType2Anim.scaleAnim=[];for(var p=0;p<4;p++){var m=e.getUint32();if(4==m){l.isBoneAnim=!0,l.boneId2Anim=[];var v=e.getUint32(),g=e.getUint32(),y=e.getOffset();if(d){var w=e.getUint32();if(w>0){var x;this.dracoLoadCount++;var b=e.getArrayBuffer(w);s.Init(new Int8Array(b),b.byteLength),t.decodeType=4;for(var M,C=f(n,i,s,t),B=C.attributes.length,E=0;E<B;E++)if("time"!==(x=C.attributes[E]).name){var S={};S.boneId=parseInt(x.name),S.frameNum=M.length,S.frameTimes=M,S.frameVals=[];for(var T=0;T<S.frameNum;T++){for(var _=[],I=0;I<16;I++)_[I]=x.array[16*T+I];S.frameVals[T]=_}l.boneId2Anim.push(S)}else M=x.array;M.length>A&&(A=M.length)}}else for(var L=0;L<v;L++){var F=r(e);F.frameNum>A&&(A=F.frameNum),null!==F&&l.boneId2Anim.push(F)}e.setOffset(y+g)}else{for(var k=e.getUint32(),P=(g=e.getUint32(),y=e.getOffset(),0);P<k;P++){l.meshNum=e.getUint32();var U=e.getUint32Array(l.meshNum);if(5==m||7==m)(D=a(e,d,t,n,i,s)).frameNum>A&&(A=D.frameNum),D.meshId=U,null!==D&&(5==m?l.animType2Anim.transAnim.push(D):7==m&&l.animType2Anim.scaleAnim.push(D));else if(6==m){var D;(D=o(e,d,t,n,i,s)).frameNum>A&&(A=D.frameNum),D.meshId=U,null!==D&&l.animType2Anim.rotAnim.push(D)}else console.log("Error: chunkType errror!!!!")}e.setOffset(y+g)}}return e.setOffset(h+c),A<2?null:l}function r(e){var t={};t.boneId=e.getUint32(),t.frameNum=e.getUint32(),t.frameTimes=e.getFloat32Array(t.frameNum),t.frameVals=new Array(t.frameNum);for(var n=0;n<t.frameNum;n++)t.frameVals[n]=e.getMatrix4();return t}function a(e,t,n,i,r,a){var o={};if(o.frameNum=e.getUint32(),t&&o.frameNum>=5){var s=e.getUint32();if(s>0){var l=e.getArrayBuffer(s);a.Init(new Int8Array(l),l.byteLength),n.decodeType=5;var A=f(i,r,a,n);o.frameTimes=A.attributes[0].array,o.frameVals=A.attributes[1].array}}else o.frameTimes=e.getFloat32Array(o.frameNum),o.frameVals=e.getFloat32Array(3*o.frameNum);return o}function o(e,t,n,i,r,a){var o={};if(o.frameNum=e.getUint32(),t&&o.frameNum>=5){var s=e.getUint32(),l=e.getArrayBuffer(s);a.Init(new Int8Array(l),l.byteLength),n.decodeType=5;var A=f(i,r,a,n);o.frameTimes=A.attributes[0].array,o.frameVals=A.attributes[1].array}else o.frameTimes=e.getFloat32Array(o.frameNum),o.frameVals=e.getFloat32Array(4*o.frameNum);return o}function s(e,t,n,i,r,a){var o={meshId:0,boneIds:[],boneIndices:[],boneWeights:[]},s=e.getUint32(),l=e.getOffset();o.meshId=e.getUint32();for(var A=e.getUint32(),c=[],h=0;h<A;h++){var u=e.getUint32();c.push(u)}o.boneIds=c;var d=e.getUint32(),p=e.getUint8Array(d),m=0,v=0,g=0,y=0,w=[],x=[],b=e.getUint8(),M=4*(Math.round(b%4)>0?parseInt(b/4)+1:parseInt(b/4));if(t){var C=e.getUint32();if(C>0){var B=e.getArrayBuffer(C);a.Init(new Int8Array(B),B.byteLength),n.decodeType=3;var E=f(i,r,a,n),S=E.attributes[0].array,T=E.attributes[1].array;S.length;for(var _=0;_<d;_++){m=p[_];for(var I=0,L=0;L<m;L++){var F=S[v+L],k=T[v+L];w[I=parseInt(L/4)]||(w[I]=[]),x[I]||(x[I]=[]),w[I].push(F),x[I].push(k)}for(var P=m;P<M;P++)w[I=parseInt(P/4)]||(w[I]=[]),x[I]||(x[I]=[]),w[I].push(0),x[I].push(0);v+=m}o.boneIndices=w,o.boneWeights=x}}else{e.getUint32();for(var U=0;U<d;U++){m=p[U];for(var D=0,R=0;R<m;R++)g=e.getUint16(),y=e.getFloat32(),w[D=parseInt(R/4)]||(w[D]=[]),x[D]||(x[D]=[]),w[D].push(g),x[D].push(y);for(var O=m;O<M;O++)w[D=parseInt(O/4)]||(w[D]=[]),x[D]||(x[D]=[]),w[D].push(0),x[D].push(0);v+=m}}return e.setOffset(l+s),o}function l(e){var t={};return t.id=e.getUint32(),t.ref_id=e.getUint32(),t.parent_Id=e.getUint32(),t.offsetMatrix=e.getMatrix4(),t}function A(e){var t={};t.id=e.getUint32(),t.nodeId=e.getUint32(),t.offsetMatrix=e.getMatrix4();var n=e.getUint8();return t.name=e.getString(n),t}function c(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=e.byteLength),u.decodeText(new Uint8Array(e,t,n))}function h(e,t,n,i,r){var a=this,o={index:null,attributes:[]};o.id=e.getUint32(),o.parentId=e.getInt32(),o.matrix=e.getMatrix4(),o.loadedState={};var s=e.getUint32();if(o.bIsNodel=1&s,o.bIsNodel){var l=64==(64&s);o.nodeType=l?4:3}else{o.bUseCompose=2&s,o.bHaveNormal=4&s,o.bHaveUVData=8&s,o.bHaveUV2Data=16&s,o.bUseDraco=32&s;var A,c,h=64==(64&s);if(o.nodeType=h?2:1,o.bUseDraco){if((m=e.getUint32())>0){o.loadedState[0]=0;var u=e.getArrayBuffer(m);r.Init(new Int8Array(u),u.byteLength),t.decodeType=1,(d=f(n,i,r,t)).attributes[0].name="position",o.attributes.push(d.attributes[0])}else o.vertexNum=0,o.loadedState[0]=1;if((m=e.getUint32())>0){o.loadedState[1]=0;u=e.getArrayBuffer(m);r.Init(new Int8Array(u),u.byteLength),t.decodeType=2;var d=f(n,i,r,t);o.index={array:d.attributes[0].array},o.faceNum=d.attributes[0].array.length/3}else o.faceNum=0,o.loadedState[1]=1}else o.vertexNum=e.getUint32(),o.vertexs=e.getFloat32Array(3*o.vertexNum),o.attributes.push({name:"position",array:o.vertexs,itemSize:3}),o.faceNum=e.getUint32(),o.faceVerIndexs=e.getUint32Array(3*o.faceNum),o.index={array:o.faceVerIndexs};if(o.bHaveUVData)if(o.bUseDraco){if((m=e.getUint32())>0){o.loadedState[2]=0;u=e.getArrayBuffer(m);r.Init(new Int8Array(u),u.byteLength),t.decodeType=1,(d=f(n,i,r,t)).attributes[0].name="uv",o.attributes.push(d.attributes[0])}else o.UVNum=0,o.loadedState[2]=1;if(o.bUseCompose)if((m=e.getUint32())>0){o.loadedState[3]=0;u=e.getArrayBuffer(m);this.dracoLoadCount++,dracoLoader.decodeDracoFile(u,(function(e){o.faceComposedUVIndexs=e.attributes[0].array,o.loadedState[3]=1,a.dracoOnLoad()}),null,null,2)}else o.loadedState[3]=1;else o.loadedState[3]=1}else o.UVNum=e.getUint32(),o.uvData=e.getFloat32Array(2*o.UVNum),o.attributes.push({name:"uv",array:o.uvData,itemSize:2}),o.bUseCompose&&(o.faceComposedUVIndexs=e.getUint32Array(3*o.faceNum)),o.loadedState[3]=1;else o.loadedState[2]=1,o.loadedState[3]=1;if(o.bHaveUV2Data)if(o.bUseDraco){if((m=e.getUint32())>0){o.loadedState[4]=0;u=e.getArrayBuffer(m);r.Init(new Int8Array(u),u.byteLength),t.decodeType=1,(d=f(n,i,r,t)).attributes[0].name="uv2",o.attributes.push(d.attributes[0])}else o.UV2Num=0,o.loadedState[4]=1;if(o.bUseCompose)if((m=e.getUint32())>0){o.loadedState[5]=0;u=e.getArrayBuffer(m);this.dracoLoadCount++,dracoLoader.decodeDracoFile(u,(function(e){o.faceComposedUV2Indexs=e.attributes[0].array,o.loadedState[5]=1,a.dracoOnLoad()}),null,null,2)}else o.loadedState[5]=1;else o.loadedState[5]=1}else o.UV2Num=e.getUint32(),o.uv2Data=e.getFloat32Array(2*o.UV2Num),o.loadedState[4]=1,o.attributes.push({name:"uv2",array:o.uv2Data,itemSize:2}),o.bUseCompose&&(o.faceComposedUV2Indexs=e.getUint32Array(3*o.faceNum)),o.loadedState[5]=1;else o.loadedState[4]=1,o.loadedState[5]=1;o.materialNum=e.getUint32(),o.materialIndex=new Array(o.materialNum);for(var p=0;p<o.materialNum;p++)A=e.getUint32(),o.materialIndex[3*p]=A,c=e.getUint32(),o.materialIndex[3*p+1]=c,o.materialIndex[3*p+2]=e.getUint32();if(1===o.materialNum&&(o.materialIndex[0]=0,o.materialIndex[1]=o.faceNum),o.bHaveNormal)if(o.bUseDraco){var m;if((m=e.getUint32())>0){o.loadedState[6]=0;u=e.getArrayBuffer(m);r.Init(new Int8Array(u),u.byteLength),t.decodeType=1,(d=f(n,i,r,t)).attributes[0].name="normal",o.attributes.push(d.attributes[0])}else o.normalNum=0,o.loadedState[6]=1;if(o.bUseCompose)if((m=e.getUint32())>0){o.loadedState[7]=0;u=e.getArrayBuffer(m);this.dracoLoadCount++,dracoLoader.decodeDracoFile(u,(function(e){o.faceComposedNormalIndexs=e.attributes[0].array,o.loadedState[7]=1,a.dracoOnLoad()}),null,null,2)}else o.loadedState[7]=1;else o.loadedState[7]=1}else o.normalNum=e.getUint32(),o.normals=e.getFloat32Array(3*o.normalNum),o.loadedState[6]=1,o.attributes.push({name:"normal",array:o.normals,itemSize:3}),o.bUseCompose&&(o.faceComposedNormalIndexs=e.getUint32Array(3*o.faceNum)),o.loadedState[7]=1;else o.loadedState[6]=1,o.loadedState[7]=1}var v=e.getUint8();return o.name=e.getString(v),function(e){var t=e.getUint8();e.getString(t)}(e),o}onmessage=function(r){var a=r.data;switch(a.type){case"init":e=a.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"clear_data":console.log("clear_data");break;case"decode":var o=a.buffer,u=a.taskConfig;t.then((function(e){var t=e.draco,r=new t.Decoder,p=new t.DecoderBuffer;try{var m=c(o,0,4);if("MBIN"===m)(function(e,t,i,r,a,o){if(function(e){var t="MBIN",n=4,i=c(e,0,n);return e.byteLength>=n&&t===i}(t)){var u=new d(t);for(u.skip(4),n=u.getUint32();u.offset<u.size();){var p=u.getUint32();if(2===p){var m=u.getUint32(),v=u.getUint32(),g=u.getOffset();if(0==m)return void self.postMessage({type:"decode",id:e.id,fileType:"mbin",bComplete:!0,geometry:null});this.totalMeshNum=m,this.completedMeshNum=0;for(var y=0;y<m;y++){var w=u.getUint32(),x=u.getOffset();if(null!==(B=h(u,i,r,a,o))){B.chunkType=2;for(var b=[],M=0;M<B.attributes.length;M++)B.attributes[M].array.buffer&&b.push(B.attributes[M].array.buffer);B.index&&b.push(B.index.array.buffer)}var C=y==m-1;B.version=n,self.postMessage({type:"decode",id:e.id,fileType:"mbin",bComplete:C,geometry:B},b),u.setOffset(x+w)}u.setOffset(g+v)}else if(1===p){var B={},E=u.getUint32(),S=(v=u.getUint32(),g=u.getOffset(),[]);for(y=0;y<E;y++){var T=A(u);null!==T&&(T.chunkType=1,S.push(T))}B.bones=S,u.setOffset(g+v);var _=[];for(m=u.getUint32(),y=0;y<m;y++){var I=u.getUint32(),L=u.getUint8(),F=(E=u.getUint32(),{});F.meshId=I,F.maxBoneCount=L,F.boneList=u.getUint32Array(E),_.push(F)}if(B.boneMeshList=_,B.version=n,n>=5){var k=u.getUint32();B.newBoneData=[];for(var P=0;P<k;P++){var U=u.getUint32(),D=u.getUint32(),R={};R.boneId=U,R.meshdata=[];for(var O=0;O<D;O++){var N=u.getMatrix4(),z=u.getUint32(),Q=u.getUint32Array(z),G={};G.matrix=N,G.meshList=Q,R.meshdata.push(G)}B.newBoneData.push(R)}}self.postMessage({type:"decode",id:e.id,fileType:"bbin",bComplete:!0,geometry:B})}else if(9===p){B={};var H=u.getUint32(),V=u.getUint32(),j=(v=u.getUint32(),g=u.getOffset(),[]);if(V&&H>=5){var W=u.getUint32();if(W>0){var X=u.getArrayBuffer(W);o.Init(new Int8Array(X),X.byteLength),i.decodeType=6;var Y=(B=f(r,a,o,i)).attributes[0].array;for(y=0;y<H;y++){(ee={}).id=Y[3*y],ee.ref_id=Y[3*y+1],ee.parent_Id=Y[3*y+2],ee.offsetMatrix=[],ee.chunkType=9,j.push(ee)}var K=B.attributes[1].array,Z=B.attributes[2].array,J=0,q=0;for(y=0;y<H;y++){for(var $=0;$<3;$++)j[y].offsetMatrix.push(K[J++]),j[y].offsetMatrix.push(K[J++]),j[y].offsetMatrix.push(K[J++]),j[y].offsetMatrix.push(0);j[y].offsetMatrix.push(Z[q++]),j[y].offsetMatrix.push(Z[q++]),j[y].offsetMatrix.push(Z[q++]),j[y].offsetMatrix.push(1)}}}else for(y=0;y<H;y++){var ee;null!==(ee=l(u))&&(ee.chunkType=9,j.push(ee))}for(y=0;y<H;y++){var te=u.getUint8();j[y].name=u.getString(te)}B.insts=j,self.postMessage({type:"decode",id:e.id,fileType:"kmbin",bComplete:!0,geometry:B}),u.setOffset(g+v)}else if(3===p){var ne=u.getUint32();if(0==ne)return void self.postMessage({type:"decode",id:e.id,fileType:"bmbin",bComplete:!0,geometry:null});for(V=u.getUint32(),v=u.getUint32(),g=u.getOffset(),y=0;y<ne;y++){console.log("bone data:_bonedMeshNum:"+ne),null!==(B=s(u,V,i,r,a,o))&&(B.chunkType=3),B.version=n;C=y==ne-1;self.postMessage({type:"decode",id:e.id,fileType:"bmbin",bComplete:C,geometry:B})}u.setOffset(g+v)}else{v=u.getUint32(),g=u.getOffset();if(10===p){for(var ie=u.getUint32(),re=(B={packdata:[]},u.getInt32Array(ie)),ae=u.getUint32Array(ie),oe=0;oe<ie;oe++){var se={};if(se.meshId=re[oe],se.groupIds=ae[oe],n>=4)0!==u.getUint8()&&(se.matrix=u.getMatrix4());B.packdata.push(se)}self.postMessage({type:"decode",id:e.id,fileType:"addbin",bComplete:!0,geometry:B})}else u.skip(v);u.setOffset(g+v)}}u=null}else console.log("mbin file format error!!!!!!!!")})(a,o,u,t,r,p);else if("ABIN"===m)(function(e,t,n,r,a,o){if(function(e){var t="ABIN",n=4,i=c(e,0,n);return e.byteLength>=n&&t===i}(t)){var s=new d(t);if(s.skip(4),s.getUint32(),8===s.getUint32()){var l=s.getUint32(),A=s.getUint32(),h=s.getOffset();if(0==l)return void self.postMessage({type:"decode",id:e.id,fileType:"abin",bComplete:!0,geometry:null});for(var u=0;u<l;u++){var f=i(s,n,r,a,o);if(null!==f)var p=[];var m=u==l-1;self.postMessage({type:"decode",id:e.id,bComplete:m,fileType:"abin",geometry:f},p)}s.setOffset(h+A)}}else console.log("abin file format error!!!!!!!!")})(a,o,u,t,r,p)}catch(e){console.error(e),self.postMessage({type:"error",id:a.id,error:e.message})}finally{t.destroy(p),t.destroy(r)}a.buffer=null}))}};var u={decodeText:function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}},extractUrlBase:function(e){var t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)}};function d(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===t||t}function f(e,t,n,i){i.attributeIDs;i.attributeTypes;var r,a,o=i.decodeType,s=t.GetEncodedGeometryType(n);if(s===e.TRIANGULAR_MESH)r=new e.Mesh,a=t.DecodeBufferToMesh(n,r);else{if(s!==e.POINT_CLOUD)throw new Error("DRACOLoader: Unexpected geometry type.");r=new e.PointCloud,a=t.DecodeBufferToPointCloud(n,r)}if(!a.ok()||0===r.ptr)throw new Error("DRACOLoader: Decoding failed: "+a.error_msg());var l,A={index:null,attributes:[]};if(1===o)l=t.GetAttribute(r,0),A.attributes.push(p(e,t,r,"position",Float32Array,l));else if(2===o)l=t.GetAttribute(r,0),A.attributes.push(p(e,t,r,"index",Uint32Array,l));else if(3===o)l=t.GetAttribute(r,0),A.attributes.push(p(e,t,r,"boneIndex",Uint16Array,l)),l=t.GetAttribute(r,1),A.attributes.push(p(e,t,r,"boneWeight",Float32Array,l));else if(6===o)l=t.GetAttribute(r,0),A.attributes.push(p(e,t,r,"ididids",Int32Array,l)),l=t.GetAttribute(r,1),A.attributes.push(p(e,t,r,"offsetMat",Float32Array,l)),l=t.GetAttribute(r,2),A.attributes.push(p(e,t,r,"trans",Float32Array,l));else if(5===o)l=t.GetAttribute(r,0),A.attributes.push(p(e,t,r,"time",Float32Array,l)),l=t.GetAttribute(r,1),A.attributes.push(p(e,t,r,"frameVal",Float32Array,l));else{if(4!==o)throw new Error("DRACOLoader: Unexpected Draco_Data_Type.");l=t.GetAttribute(r,0),A.attributes.push(p(e,t,r,"time",Float32Array,l));for(var c,h,u,d=t.GetAttributeMetadata(r,0),f=new e.MetadataQuerier,m=f.NumEntries(d),v=0;v<m;v++)"name"===(c=f.GetEntryName(d,v))?console.log(f.GetStringEntry(d,c)):(h=f.GetIntEntry(d,c),u=parseInt(c),l=t.GetAttribute(r,u),A.attributes.push(p(e,t,r,h+"",Float32Array,l)))}return e.destroy(r),A}function p(e,t,n,i,r,a){var o,s,l=a.num_components(),A=n.num_points()*l;switch(r){case Float32Array:var c=4*A;o=e._malloc(c),t.GetAttributeDataArrayForAllPoints(n,a,e.DT_FLOAT32,c,o),s=new Float32Array(e.HEAPF32.buffer,o,A).slice(),e._free(o);break;case Int8Array:o=e._malloc(A),t.GetAttributeDataArrayForAllPoints(n,a,e.DT_INT8,A,o),s=new Int8Array(e.HEAP8.buffer,o,A).slice(),e._free(o);break;case Int16Array:c=2*A;o=e._malloc(c),t.GetAttributeDataArrayForAllPoints(n,a,e.DT_INT16,c,o),s=new Int16Array(e.HEAP16.buffer,o,A).slice(),e._free(o);break;case Int32Array:c=4*A;o=e._malloc(c),t.GetAttributeDataArrayForAllPoints(n,a,e.DT_INT32,c,o),s=new Int32Array(e.HEAP32.buffer,o,A).slice(),e._free(o);break;case Uint8Array:o=e._malloc(A),t.GetAttributeDataArrayForAllPoints(n,a,e.DT_UINT8,A,o),s=new Uint8Array(e.HEAPU8.buffer,o,A).slice(),e._free(o);break;case Uint16Array:c=2*A;o=e._malloc(c),t.GetAttributeDataArrayForAllPoints(n,a,e.DT_UINT16,c,o),s=new Uint16Array(e.HEAPU16.buffer,o,A).slice(),e._free(o);break;case Uint32Array:c=4*A;o=e._malloc(c),t.GetAttributeDataArrayForAllPoints(n,a,e.DT_UINT32,c,o),s=new Uint32Array(e.HEAPU32.buffer,o,A).slice(),e._free(o);break;default:throw new Error("DRACOLoader: Unexpected attribute type.")}return{name:i,array:s,itemSize:l}}d.prototype={constructor:d,getOffset:function(){return this.offset},setOffset:function(e){this.offset=e},size:function(){return this.dv.buffer.byteLength},skip:function(e){this.offset+=e},getBoolean:function(){return 1==(1&this.getUint8())},getBooleanArray:function(e){for(var t=[],n=0;n<e;n++)t.push(this.getBoolean());return t},getUint8:function(){var e=this.dv.getUint8(this.offset);return this.offset+=1,e},getUint8Array:function(e){for(var t=new Uint8Array(e),n=0;n<e;n++)t[n]=this.getUint8();return t},getInt16:function(){var e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e},getUint16:function(e){if(null!=e)return t=this.dv.getUint16(e,this.littleEndian);var t=this.dv.getUint16(this.offset,this.littleEndian);return this.offset+=2,t},getInt32:function(){var e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e},getInt32Array:function(e){for(var t=new Int32Array(e),n=0;n<e;n++)t[n]=this.getInt32();return t},getUint32:function(){var e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e},getUint32Array:function(e){for(var t=new Uint32Array(e),n=0;n<e;n++)t[n]=this.getUint32();return t},getMatrix4:function(){for(var e=[],t=0;t<16;t++)e.push(this.getFloat32());return e},getInt64:function(){var e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),2147483648&t?(t=4294967295&~t,4294967295===(e=4294967295&~e)&&(t=t+1&4294967295),-(4294967296*t+(e=e+1&4294967295))):4294967296*t+e},getInt64Array:function(e){for(var t=new Int64Array(e),n=0;n<e;n++)t[n]=this.getUint8();return t},getUint64:function(){var e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),4294967296*t+e},getFloat32:function(e){if(null!=e)return t=this.dv.getFloat32(e,this.littleEndian);var t=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t},getFloat32Array:function(e){for(var t=new Float32Array(e),n=0;n<e;n++)t[n]=this.getFloat32();return t},getFloat64:function(){var e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e},getFloat64Array:function(e){for(var t=new Float64Array(e),n=0;n<e;n++)t[n]=this.getFloat64();return t},getArrayBuffer:function(e){var t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},getString:function(e){for(var t=[],n=0;n<e;n++)t[n]=this.getUint8();var i=t.indexOf(0);return i>=0&&(t=t.slice(0,i)),t}}},e.taskCache=new WeakMap,e.setDecoderPath=function(){console.warn("DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.")},e.setDecoderConfig=function(){console.warn("DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.")},e.releaseDecoderModule=function(){console.warn("DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.")},e.getDecoderModule=function(){console.warn("DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.")},t.prototype={constructor:t,getOffset:function(){return this.offset},size:function(){return this.dv.buffer.byteLength},skip:function(e){this.offset+=e},getBoolean:function(){return 1==(1&this.getUint8())},getBooleanArray:function(e){for(var t=[],n=0;n<e;n++)t.push(this.getBoolean());return t},getUint8:function(){var e=this.dv.getUint8(this.offset);return this.offset+=1,e},getUint8Array:function(e){for(var t=new Uint8Array(e),n=0;n<e;n++)t[n]=this.getUint8()},getInt16:function(){var e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e},getUint16:function(e){if(null!=e)return t=this.dv.getUint16(e,this.littleEndian);var t=this.dv.getUint16(this.offset,this.littleEndian);return this.offset+=2,t},getInt32:function(){var e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e},getInt32Array:function(e){for(var t=new Int32Array(e),n=0;n<e;n++)t[n]=this.getInt32()},getUint32:function(){var e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e},getUint32Array:function(e){for(var t=[],n=0;n<e;n++)t.push(this.getUint32());return t},getMatrix4:function(){for(var e=new bt,t=0;t<16;t++)e.elements[t]=this.getFloat32();return e},getVector3:function(){for(var e=new at,t=0;t<3;t++)e.setComponent(t,this.getFloat32());return e},getInt64:function(){var e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),2147483648&t?(t=4294967295&~t,4294967295===(e=4294967295&~e)&&(t=t+1&4294967295),-(4294967296*t+(e=e+1&4294967295))):4294967296*t+e},getInt64Array:function(e){for(var t=[],n=0;n<e;n++)t.push(this.getInt64());return t},getUint64:function(){var e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),4294967296*t+e},getFloat32:function(e){if(null!=e)return t=this.dv.getFloat32(e,this.littleEndian);var t=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t},getFloat32Array:function(e){for(var t=new Float32Array(e),n=0;n<e;n++)t[n]=this.getFloat32();return t},getFloat64:function(){var e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e},getFloat64Array:function(e){for(var t=new Float64Array(e),n=0;n<e;n++)t[n]=this.getFloat64();return t},getArrayBuffer:function(e){var t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},getString:function(e){for(var t=[],n=0;n<e;n++)t[n]=this.getUint8();var i=t.indexOf(0);return i>=0&&(t=t.slice(0,i)),OA.decodeText(new Uint8Array(t))}},e}();function Gf(e){On.call(this),this.defines={STANDARD:""},this.type="AMRTBasicMaterial",this.color=new Fn(16777215),this.albedo=null,this.albedoUV=0,this.normalMap=null,this.normalScale=1,this.normalMap2=null,this.normalScale2=1,this.metallicMap=null,this.metallic=0,this.roughnessMap=null,this.smoothness=0,this.aoMap=null,this.aoScale=1,this.aoUV=0,this.emissive=new Fn(0),this.emissiveMap=null,this.emissiveUV=0,this.reflectMap=null,this.reflectIntensity=0,this.cutout=.5,this.reflectivity=1,this.transparency=0,this.opacity=1,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.vertexTangents=!0,this.normalMapType=0,this.envRotateY=0,this.envYMatrix=new lt,this.reflectRotateY=0,this.reflecYMatrix=new lt,this.dissolveMap=null,this.dissolveRatio=0,this.dissolveColor=new Fn(16774921),this.ssrTextureMatrix=new bt,this.ssrTexture=null,this.maxDistance=10,this.ssrOpacity=1,this.fresnelCoe=0,this.depthTexture=null,this.planeOffset=0,this.virtualCameraNear=.1,this.virtualCameraFar=1e3,this.virtualCameraMatrixWorld=new bt,this.virtualCameraProjectionMatrix=new bt,this.virtualCameraProjectionMatrixInverse=new bt,this.resolution=new tt,this.setValues(e),this.__defineSetter__("envRotateY",(function(e){this.envYMatrix=(new lt).rotateY(e)})),this.__defineSetter__("reflectRotateY",(function(e){this.reflecYMatrix=(new lt).rotateY(e)}))}Gf.prototype=Object.create(On.prototype),Gf.prototype.constructor=Gf,Gf.prototype.isAMRTBasicMaterial=!0,Gf.prototype.clone=function(){return(new this.constructor).copy(this)},Gf.prototype.copy=function(e){return On.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.albedo=e.albedo,this.albedoUV=e.albedoUV,this.normalMap=e.normalMap,this.normalScale=e.normalScale,this.normalMap2=e.normalMap2,this.normalScale2=e.normalScale2,this.metallicMap=e.metallicMap,this.metallic=e.metallic,this.roughnessMap=e.roughnessMap,this.smoothness=e.smoothness,this.aoMap=e.aoMap,this.aoScale=e.aoScale,this.aoUV=e.aoUV,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveUV=e.emissiveUV,this.reflectMap=e.reflectMap,this.reflectIntensity=e.reflectIntensity,this.cutout=e.cutout,this.reflectivity=e.reflectivity,this.transparency=e.transparency,this.opacity=e.opacity,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.vertexTangents=e.vertexTangents,this.normalMapType=e.normalMapType,this.envRotateY=e.envRotateY,this.envYMatrix=e.envYMatrix,this.reflectRotateY=e.reflectRotateY,this.reflecYMatrix=e.reflecYMatrix,this},Gf.prototype.dispose=function(){On.prototype.dispose.call(this),this.albedo&&this.albedo.dispose(),this.metallicMap&&this.metallicMap.dispose(),this.roughnessMap&&this.roughnessMap.dispose(),this.aoMap&&this.aoMap.dispose(),this.emissiveMap&&this.emissiveMap.dispose(),this.reflectMap&&this.reflectMap.dispose(),this.envMap&&this.envMap.dispose()},Object.defineProperty(Gf.prototype,"alphaMap",{get:function(){return this._alphaMap||null},set:function(e){this._alphaMap=e,e&&(this.transparent=!0)}});var Hf=[];function Vf(){this.geometry=null,this._material=null,this.instanceIndex=0,this._instanceMesh=null,this.rootInverse=new bt,this.material0=null,this._mesh=null,zt.call(this),Object.defineProperty(this,"instanceMesh",{get:function(){return this._instanceMesh},set:function(e){this._instanceMesh!=e&&(this._instanceMesh=e,this.geometry=this._instanceMesh.tmpGeometry,this._material=this._instanceMesh.material[0],this.material0=this._material,this._mesh=new Ei(this.geometry,this._material),this._mesh.name=this.name)}}),Object.defineProperty(this,"material",{get:function(){return null==this._instanceMesh?null:(this._material===this._instanceMesh.material[0]&&this.createMesh(),this._material)},set:function(e){console.log("set"),this._material=e,this._mesh.material=this._material,this._mesh.material0=this._material,null==this._mesh.parent&&this.add(this._mesh)}})}Vf.prototype=Object.assign(Object.create(zt.prototype),{constructor:Vf,intanceObject:!0,setDirty:function(){this.refreshInstanceMesh()},refreshInstanceMesh:function(){null!=this._instanceMesh&&(this._instanceMesh.updateMatrixWorld(!0),this.rootInverse.getInverse(this._instanceMesh.matrixWorld),this._instanceMesh.setMatrixAt(this.instanceIndex,this.rootInverse.multiply(this.matrixWorld)),this._instanceMesh.instanceMatrix.needsUpdate=!0)},createMesh:function(){if(null==this._mesh.parent){var e=new Gf;e.copy(this._material),this._material=e,this.material0=this._material,this._mesh.material=this._material,this._mesh.material0=this._material,this._instanceMesh.deleteItem([this.instanceIndex]),this.add(this._mesh)}},raycast:function(e,t){null!=this._mesh&&(this._mesh.matrixWorld=this.matrixWorld,this._mesh.raycast(e,Hf),Hf.length>0&&(this.createMesh(),Hf[0].object=this,t.push(Hf[0])),Hf.length=0)}});var jf=function(e){Wl.call(this,e)};jf.prototype=Object.assign(Object.create(Wl.prototype),{constructor:jf,load:function(e,t,n,i){var r=this,a=new ht,o=new Kl(this.manager);return o.setResponseType("arraybuffer"),o.setPath(this.path),o.load(e,(function(e){a.image=r.parse(e),a.needsUpdate=!0,void 0!==t&&t(a)}),n,i),a},parse:function(e){var t=0,n=1,i=2,r=3,a=9,o=10,s=11,l=48,A=4,c=0,h=1,u=2,d=3;e.length<19&&console.error("TGALoader: Not enough data to contain header.");var f=new Uint8Array(e),p=0,m={id_length:f[p++],colormap_type:f[p++],image_type:f[p++],colormap_index:f[p++]|f[p++]<<8,colormap_length:f[p++]|f[p++]<<8,colormap_size:f[p++],origin:[f[p++]|f[p++]<<8,f[p++]|f[p++]<<8],width:f[p++]|f[p++]<<8,height:f[p++]|f[p++]<<8,pixel_size:f[p++],flags:f[p++]};!function(e){switch(e.image_type){case n:case a:(e.colormap_length>256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("TGALoader: Invalid type colormap data for indexed type.");break;case i:case r:case o:case s:e.colormap_type&&console.error("TGALoader: Invalid type colormap data for colormap type.");break;case t:console.error("TGALoader: No data.");default:console.error('TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('TGALoader: Invalid pixel size "%s".',e.pixel_size)}(m),m.id_length+p>e.length&&console.error("TGALoader: No data."),p+=m.id_length;var v=!1,g=!1,y=!1;switch(m.image_type){case a:v=!0,g=!0;break;case n:g=!0;break;case o:v=!0;break;case i:break;case s:v=!0,y=!0;break;case r:y=!0}var w=document.createElement("canvas");w.width=m.width,w.height=m.height;var x=w.getContext("2d"),b=x.createImageData(m.width,m.height),M=function(e,t,n,i,r){var a,o,s,l;if(o=n.pixel_size>>3,s=n.width*n.height*o,t&&(l=r.subarray(i,i+=n.colormap_length*(n.colormap_size>>3))),e){var A,c,h;a=new Uint8Array(s);for(var u=0,d=new Uint8Array(o);u<s;)if(c=1+(127&(A=r[i++])),128&A){for(h=0;h<o;++h)d[h]=r[i++];for(h=0;h<c;++h)a.set(d,u+h*o);u+=o*c}else{for(c*=o,h=0;h<c;++h)a[u+h]=r[i++];u+=c}}else a=r.subarray(i,i+=t?n.width*n.height:s);return{pixel_data:a,palettes:l}}(v,g,m,p,f);return function(e,t,n,i,r){var a,o,s,f,p,v;switch((m.flags&l)>>A){default:case u:a=0,s=1,p=t,o=0,f=1,v=n;break;case c:a=0,s=1,p=t,o=n-1,f=-1,v=-1;break;case d:a=t-1,s=-1,p=-1,o=0,f=1,v=n;break;case h:a=t-1,s=-1,p=-1,o=n-1,f=-1,v=-1}if(y)switch(m.pixel_size){case 8:!function(e,t,n,i,r,a,o,s){var l,A,c,h=0,u=m.width;for(c=t;c!==i;c+=n)for(A=r;A!==o;A+=a,h++)l=s[h],e[4*(A+u*c)+0]=l,e[4*(A+u*c)+1]=l,e[4*(A+u*c)+2]=l,e[4*(A+u*c)+3]=255}(e,o,f,v,a,s,p,i);break;case 16:!function(e,t,n,i,r,a,o,s){var l,A,c=0,h=m.width;for(A=t;A!==i;A+=n)for(l=r;l!==o;l+=a,c+=2)e[4*(l+h*A)+0]=s[c+0],e[4*(l+h*A)+1]=s[c+0],e[4*(l+h*A)+2]=s[c+0],e[4*(l+h*A)+3]=s[c+1]}(e,o,f,v,a,s,p,i);break;default:console.error("TGALoader: Format not supported.")}else switch(m.pixel_size){case 8:!function(e,t,n,i,r,a,o,s,l){var A,c,h,u=l,d=0,f=m.width;for(h=t;h!==i;h+=n)for(c=r;c!==o;c+=a,d++)A=s[d],e[4*(c+f*h)+3]=255,e[4*(c+f*h)+2]=u[3*A+0],e[4*(c+f*h)+1]=u[3*A+1],e[4*(c+f*h)+0]=u[3*A+2]}(e,o,f,v,a,s,p,i,r);break;case 16:!function(e,t,n,i,r,a,o,s){var l,A,c,h=0,u=m.width;for(c=t;c!==i;c+=n)for(A=r;A!==o;A+=a,h+=2)l=s[h+0]+(s[h+1]<<8),e[4*(A+u*c)+0]=(31744&l)>>7,e[4*(A+u*c)+1]=(992&l)>>2,e[4*(A+u*c)+2]=(31&l)>>3,e[4*(A+u*c)+3]=32768&l?0:255}(e,o,f,v,a,s,p,i);break;case 24:!function(e,t,n,i,r,a,o,s){var l,A,c=0,h=m.width;for(A=t;A!==i;A+=n)for(l=r;l!==o;l+=a,c+=3)e[4*(l+h*A)+3]=255,e[4*(l+h*A)+2]=s[c+0],e[4*(l+h*A)+1]=s[c+1],e[4*(l+h*A)+0]=s[c+2]}(e,o,f,v,a,s,p,i);break;case 32:!function(e,t,n,i,r,a,o,s){var l,A,c=0,h=m.width;for(A=t;A!==i;A+=n)for(l=r;l!==o;l+=a,c+=4)e[4*(l+h*A)+2]=s[c+0],e[4*(l+h*A)+1]=s[c+1],e[4*(l+h*A)+0]=s[c+2],e[4*(l+h*A)+3]=s[c+3]}(e,o,f,v,a,s,p,i);break;default:console.error("TGALoader: Format not supported.")}}(b.data,m.width,m.height,M.pixel_data,M.palettes),x.putImageData(b,0,0),w}});var Wf=new WeakMap,Xf=function(e){h(i,e);var t=y(i);function i(e){var n;return s(this,i),(n=t.call(this,e)).transcoderPath="",n.transcoderBinary=null,n.transcoderPending=null,n.workerLimit=4,n.workerPool=[],n.workerNextTaskID=1,n.workerSourceURL="",n.workerConfig=null,n}return A(i,[{key:"setTranscoderPath",value:function(e){return this.transcoderPath=e,this}},{key:"setWorkerLimit",value:function(e){return this.workerLimit=e,this}},{key:"detectSupport",value:function(e){return this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this}},{key:"load",value:function(e,t,n,i){var r=this,a=new Kl(this.manager);a.setResponseType("arraybuffer"),a.setWithCredentials(this.withCredentials);var o=new es;return a.load(e,(function(e){r.loadFromBuffer(e,t,i,o)}),n,i),o}},{key:"loadFromBuffer",value:function(e,t,n,i){return void 0===i&&(i=new es),Wf.has(e)?Wf.get(e).promise.then(t).catch(n):(this._createTexture([e]).then((function(e){i.copy(e),i.needsUpdate=!0,t&&t(i)})).catch(n),i)}},{key:"parseInternalAsync",value:function(e){for(var t=e.levels,i=new Set,r=0;r<t.length;r++)i.add(t[r].data.buffer);return this._createTexture(Array.from(i),n(n({},e),{},{lowLevel:!0}))}},{key:"_createTexture",value:function(e){for(var t,n,i=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r,o=0,s=0;s<e.length;s++)o+=e[s].byteLength;var l=this._allocateWorker(o).then((function(r){return t=r,n=i.workerNextTaskID++,new Promise((function(i,r){t._callbacks[n]={resolve:i,reject:r},t.postMessage({type:"transcode",id:n,buffers:e,taskConfig:a},e)}))})).then((function(e){var t=e.mipmaps,n=new es(t,e.width,e.height,e.format,$);return n.minFilter=1===t.length?Z:q,n.magFilter=Z,n.generateMipmaps=!0,n.needsUpdate=!0,n}));return l.catch((function(){return!0})).then((function(){t&&n&&(t._taskLoad-=o,delete t._callbacks[n])})),Wf.set(e[0],{promise:l}),l}},{key:"_initTranscoder",value:function(){var e=this;if(!this.transcoderPending){var t=new Kl(this.manager);t.setPath(this.transcoderPath),t.setWithCredentials(this.withCredentials);var n=new Promise((function(e,n){t.load("../../../amrt_transcoder.js",e,void 0,n)})),r=new Kl(this.manager);r.setPath(this.transcoderPath),r.setResponseType("arraybuffer"),r.setWithCredentials(this.withCredentials);var a=new Promise((function(e,t){r.load("../../../amrt_transcoder.wasm",e,void 0,t)})),o=[];o.push(n),o.push(a),this.transcoderPending=Promise.all(o).then((function(t){var n=M(t,2),r=n[0],a=n[1],o=i.BasisWorker.toString(),s=["/* constants */","let _EngineFormat = "+JSON.stringify(i.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(i.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(i.BasisFormat),"/* amrt_transcoder.js */",r,"/* worker */",o.substring(o.indexOf("{")+1,o.lastIndexOf("}"))].join("\n");e.workerSourceURL=URL.createObjectURL(new Blob([s])),e.transcoderBinary=a}))}return this.transcoderPending}},{key:"_allocateWorker",value:function(e){var t=this;return this._initTranscoder().then((function(){var n;t.workerPool.length<t.workerLimit?((n=new Worker(t.workerSourceURL))._callbacks={},n._taskLoad=0,n.postMessage({type:"init",config:t.workerConfig,transcoderBinary:t.transcoderBinary}),n.onmessage=function(e){var t=e.data;switch(t.type){case"transcode":n._callbacks[t.id].resolve(t);break;case"error":n._callbacks[t.id].reject(t);break;default:console.error('BasisTextureLoader: Unexpected message, "'+t.type+'"')}},t.workerPool.push(n)):t.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));return(n=t.workerPool[t.workerPool.length-1])._taskLoad+=e,n}))}},{key:"dispose",value:function(){for(var e=0;e<this.workerPool.length;e++)this.workerPool[e].terminate();return this.workerPool.length=0,this}}]),i}(Wl);Xf.BasisFormat={ETC1S:0,UASTC_4x4:1},Xf.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16},Xf.EngineFormat={RGBAFormat:ce,RGBA_ASTC_4x4_Format:Ee,RGBA_BPTC_Format:Se,RGBA_ETC2_EAC_Format:_e,RGBA_PVRTC_4BPPV1_Format:Me,RGBA_S3TC_DXT5_Format:we,RGB_ETC1_Format:Be,RGB_ETC2_Format:Te,RGB_PVRTC_4BPPV1_Format:xe,RGB_S3TC_DXT1_Format:ve},Xf.BasisWorker=function(){var e,t,n,i=_EngineFormat,r=_TranscoderFormat,a=_BasisFormat;onmessage=function(i){var r,o=i.data;switch(o.type){case"init":e=o.config,r=o.transcoderBinary,t=new Promise((function(e){n={wasmBinary:r,onRuntimeInitialized:e},BASIS(n)})).then((function(){n.initializeBasis()}));break;case"transcode":t.then((function(){try{for(var e=o.taskConfig.lowLevel?function(e){var t=e.basisFormat,i=e.width,r=e.height,o=e.hasAlpha,s=A(t,i,r,o),l=s.transcoderFormat,f=s.engineFormat,p=n.getBytesPerBlockOrPixel(l);c(n.isFormatSupported(l),"BasisTextureLoader: Unsupported format.");var m=[];if(t===a.ETC1S){var v=new n.LowLevelETC1SImageTranscoder,g=e.globalData,y=g.endpointCount,w=g.endpointsData,x=g.selectorCount,b=g.selectorsData,M=g.tablesData;try{c(v.decodePalettes(y,w,x,b),"BasisTextureLoader: decodePalettes() failed."),c(v.decodeTables(M),"BasisTextureLoader: decodeTables() failed.");for(var C=0;C<e.levels.length;C++){var B=e.levels[C],E=e.globalData.imageDescs[C],S=d(l,B.width,B.height),T=new Uint8Array(S);c(v.transcodeImage(l,T,S/p,B.data,h(l,B.width),u(l,B.height),B.width,B.height,B.index,E.rgbSliceByteOffset,E.rgbSliceByteLength,E.alphaSliceByteOffset,E.alphaSliceByteLength,E.imageFlags,o,!1,0,0),"BasisTextureLoader: transcodeImage() failed for level "+B.index+"."),m.push({data:T,width:B.width,height:B.height})}}finally{v.delete()}}else for(var _=0;_<e.levels.length;_++){var I=e.levels[_],L=d(l,I.width,I.height),F=new Uint8Array(L);c(n.transcodeUASTCImage(l,F,L/p,I.data,h(l,I.width),u(l,I.height),I.width,I.height,I.index,0,I.data.byteLength,0,o,!1,0,0,-1,-1),"BasisTextureLoader: transcodeUASTCImage() failed for level "+I.index+"."),m.push({data:F,width:I.width,height:I.height})}return{width:i,height:r,hasAlpha:o,mipmaps:m,format:f}}(o.taskConfig):function(e){var t=new n.BasisFile(new Uint8Array(e)),i=t.isUASTC()?a.UASTC_4x4:a.ETC1S,r=t.getImageWidth(0,0),o=t.getImageHeight(0,0),s=t.getNumLevels(0),l=t.getHasAlpha();function c(){t.close(),t.delete()}var h=A(i,r,o,l),u=h.transcoderFormat,d=h.engineFormat;if(!r||!o||!s)throw c(),new Error("BasisTextureLoader:\tInvalid texture");if(!t.startTranscoding())throw c(),new Error("BasisTextureLoader: .startTranscoding failed");for(var f=[],p=0;p<s;p++){var m=t.getImageWidth(0,p),v=t.getImageHeight(0,p),g=new Uint8Array(t.getImageTranscodedSizeInBytes(0,p,u));if(!t.transcodeImage(g,0,p,u,0,l))throw c(),new Error("BasisTextureLoader: .transcodeImage failed.");f.push({data:g,width:m,height:v})}return c(),{width:r,height:o,hasAlpha:l,mipmaps:f,format:d}}(o.buffers[0]),t=e.width,i=e.height,r=e.hasAlpha,s=e.mipmaps,l=e.format,f=[],p=0;p<s.length;++p)f.push(s[p].data.buffer);self.postMessage({type:"transcode",id:o.id,width:t,height:i,hasAlpha:r,mipmaps:s,format:l},f)}catch(e){console.error(e),self.postMessage({type:"error",id:o.id,error:e.message})}}))}};var o=[{if:"astcSupported",basisFormat:[a.UASTC_4x4],transcoderFormat:[r.ASTC_4x4,r.ASTC_4x4],engineFormat:[i.RGBA_ASTC_4x4_Format,i.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[r.BC7_M5,r.BC7_M5],engineFormat:[i.RGBA_BPTC_Format,i.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[r.BC1,r.BC3],engineFormat:[i.RGB_S3TC_DXT1_Format,i.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[r.ETC1,r.ETC2],engineFormat:[i.RGB_ETC2_Format,i.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[r.ETC1,r.ETC1],engineFormat:[i.RGB_ETC1_Format,i.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[a.ETC1S,a.UASTC_4x4],transcoderFormat:[r.PVRTC1_4_RGB,r.PVRTC1_4_RGBA],engineFormat:[i.RGB_PVRTC_4BPPV1_Format,i.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],s=o.sort((function(e,t){return e.priorityETC1S-t.priorityETC1S})),l=o.sort((function(e,t){return e.priorityUASTC-t.priorityUASTC}));function A(t,n,o,A){for(var c=t===a.ETC1S?s:l,h=0;h<c.length;h++){var u=c[h];if(e[u.if]&&(u.basisFormat.includes(t)&&(!u.needsPowerOfTwo||f(n)&&f(o))))return{transcoderFormat:u.transcoderFormat[A?1:0],engineFormat:u.engineFormat[A?1:0]}}return console.warn("BasisTextureLoader: No suitable compressed texture format found. Decoding to RGBA32."),{transcoderFormat:r.RGBA32,engineFormat:i.RGBAFormat}}function c(e,t){if(!e)throw new Error(t)}function h(e,t){return Math.ceil(t/n.getFormatBlockWidth(e))}function u(e,t){return Math.ceil(t/n.getFormatBlockHeight(e))}function d(e,t,i){var a=n.getBytesPerBlockOrPixel(e);if(n.formatIsUncompressed(e))return t*i*a;if(e===r.PVRTC1_4_RGB||e===r.PVRTC1_4_RGBA){var o=t+3&-4,s=i+3&-4;return(Math.max(8,o)*Math.max(8,s)*4+7)/8}return h(e,t)*u(e,i)*a}function f(e){return e<=2||0==(e&e-1)&&0!==e}};var Yf=[],Kf=function(){function e(t){s(this,e),this.count=0,this.loaded=0,this.THUMB_SIZE=512,this.BASE_URL="",this.RESIZE=!0,this.RENAME=!1,this.renderer=null,this.basisLoader=null,t&&(this.renderer=t.renderManager.defaultRenderer)}return A(e,[{key:"setBaseUrl",value:function(e){this.BASE_URL=e||""}},{key:"load",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,s=function(t){console.error("贴图加载失败:"+e,t),r&&r(t)};if(e.constructor===String){if(6===e.split(",").length){e=e.split(",");for(var l=0;l<e.length;l++)this.RESIZE?e[l]=this._resize(e[l]):e[l]=_rebuildUrl(e[l]);return(new eA).load(e,(function(e){n(e)}),i,s)}var A=e.substr(e.lastIndexOf(".")+1).split("?")[0].toUpperCase();switch(A){case"HDR":var c=ie;return(If.isMobile||AMRT.isWebGL2)&&(c=$),(navigator.userAgent.indexOf("Trident")>-1||navigator.userAgent.indexOf("Firefox")>-1||navigator.userAgent.indexOf("Safari")>-1&&-1==navigator.userAgent.indexOf("Chrome"))&&(c=$),e=this._rebuildUrl(e),(new Nh).setDataType(o||c).load(e,(function(t){t.image.src=e,n(t)}),i,s);case"TGA":return e=this._rebuildUrl(e),(new jf).load(e,(function(t){t.image.src=e,n(t)}),i,s);case"BASIS":case"MRTB":return e=this._rebuildUrl(e),this.basisLoader||(this.basisLoader=new Xf,this.basisLoader.setWorkerLimit(8),this.basisLoader.setTranscoderPath(If.getDecoderPath()),this.basisLoader.detectSupport(this.renderer),Yf.push(this.basisLoader)),this.count++,this.basisLoader.load(e,(function(i){i.wrapS=V,i.wrapT=V,n(i),i.image.src=e,i.flipY=!0,t.loaded++,t.loaded>=t.count&&t.basisLoader.dispose()}),(function(e){}),(function(e){console.error(e)}));default:var h=e;return h=this.RESIZE?this._resize(h,a):this._rebuildUrl(h),(new tA).load(h,(function(e){et.isPowerOfTwo(e.image.width)&&et.isPowerOfTwo(e.image.height),e.wrapS=V,e.wrapT=V,n(e)}),i,s)}}else if(Array.isArray(e)&&6===e.length){for(var u=0;u<e.length;u++)this.RESIZE?e[u]=this._resize(e[u]):e[u]=this.BASE_URL+e[u];return(new eA).load(e,(function(e){n(e)}),i,s)}}},{key:"loadEnvMap",value:function(e,t,n){var i=this;this.load(e,(function(e){var n=i.convertTexture(e);t&&t(n)}),(function(){}),n)}},{key:"convertTexture",value:function(e){var t,n=new gf(this.renderer),i=e.image.src;return e.constructor===hr?(i=e.image.map((function(e){return e.src})).join(","),n.compileCubemapShader(),t=n.fromCubemap(e).texture):(n.compileEquirectangularShader(),t=n.fromEquirectangular(e).texture),n.dispose(),t.image.src=i,t._texture=e,t}},{key:"_resize",value:function(e,t){if(e.startsWith("data:image"))return e;if(e=e.replaceAll(/&?\??x-image-process=image\/resize,w_[0-9]+,h_[0-9]+\/quality,q_100\/marker,u_plus/g,""),void 0!==t){var n="x-image-process=image/resize,w_"+t+",h_"+t;return e.indexOf("?")>-1?e+="&"+n:e+="?"+n,e}if(If.isMobile){var i="x-image-process=image/resize,w_"+(t=2048)+",h_"+t+"/quality,q_100/marker,u_plus";e.indexOf("?")>-1?e+="&"+i:e+="?"+i}return e}},{key:"_rename",value:function(e){return e=e.split("?")[0],encodeURIComponent(e.slice(e.lastIndexOf("/")+1))}},{key:"_rebuildUrl",value:function(e){return this.RENAME&&(e=this._rename(e)),e.startsWith("http")||e.startsWith("data:")?e:this.BASE_URL+e}}]),e}(),Zf=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;s(this,e),this.viewer=n,this.cacheMats=[],this.queryMats={},this.cacheMeshes=[],this.cacheMesheIds=[],this.cacheAnimations=[],this.cacheActions=[],this.cacheSkinnedMeshs=[],this.cacheSkinnedMeshIds=[],this.cacheEnvMap={},this.cacheAoMap={},this.hasSkinnedAnimation=!1,this.model=t.isBIM?new Df(this.viewer):new kf(this.viewer),this.model.objects=this.cacheMeshes,this.model.materials=this.cacheMats,this.instances=null,this.ref=[],this.sref=[],this.boneListByMeshMap=new Map,this.boneListMap=new Map,this.meshLoader=new Qf,this.extraMaterial={},this.cacheExtraMat=[],this.instanceMap=new Map,this.loadCount=0,this.currentLoadCount=0,this.meshLoader.setDecoderPath(If.getDecoderPath()),this.meshLoader.setWorkerLimit(8),this.isOpenInstance=t.instance||!1,this.isOpenInstance&&console.log("开启实例化"),this.meshGroupDic=new Map,this.materialConfig=null,this.animNameMap=new Map,this.mapLoader=new Kf(this.viewer),this.additionPackData={}}return A(e,[{key:"setLoadCount",value:function(e){this.loadCount=e}},{key:"load",value:function(e,t,n,i){var r=this;this.meshLoader.load(e,(function(e){if(e){var t;e.attributes.normal||e.computeVertexNormals(),e.attributes.uv&&pd(e);var n=r.instanceMap.get(e.custom_data.id);if(n){if(!0!==r.isOpenInstance){for(var i=0;i<n.length;i++){(new si).copy(e),(t=new Ei(e,r.generateMaterial(e))).ID=n[i].ID,r.addToCache(t),t.applyMatrix(n[i].matrix.clone()),t.sid=n[i].sid,t.parentId=n[i].parentId,t.materialIndex=e.custom_data.materialIndex.concat(),t.nodeType=1,t.name=n[i].name,r._assembly(t)}return r.instanceMap.set(e.custom_data.id,void 0),void delete e.custom_data}t=new Lf(e,r.generateMaterial(e),n.length)}else if(1===e.custom_data.nodeType){if(e.attributes.position)t=new Ei(e,r.generateMaterial(e)),r.addToCache(t);else t=new zt}else if(2===e.custom_data.nodeType)if(e.attributes.position){var a=r.boneListByMeshMap.get(e.custom_data.id);if(a)(t=new Bo(e,r.generateMaterial(e,!0))).boneNum=a.maxBoneCount,t.visible=!1,r.addToCache(t)}else t=new zt;else if(4===e.custom_data.nodeType){var o=r.boneListMap.get(e.custom_data.id);t=o||new _o}else t=new zt;if(t.ID=e.custom_data.id,4!==e.custom_data.nodeType)t.applyMatrix((new bt).fromArray(e.custom_data.matrix));else{var s=(new bt).fromArray(e.custom_data.matrix);t.version>=5?(t.initMatrix=s,t.visible=!1):t.offsetMatrix&&t.version>=3?(t.hasPose=!0,t.initMatrix=s,t.visible=!1):t.applyMatrix(s)}t.sid=e.custom_data.id,t.parentId=n?-1:e.custom_data.parentId,t.materialIndex=e.custom_data.materialIndex,t.nodeType=e.custom_data.nodeType,t.name=e.name,delete e.custom_data,r._assembly(t)}}),(function(){if(r.currentLoadCount++,r.loadCount===r.currentLoadCount&&!0===r.isOpenInstance){var e=new bt;e.getInverse(r.model.matrixWorld);var n,i=S(r.instanceMap);try{for(i.s();!(n=i.n()).done;){var a=n.value;if(r.ref[a[0]]){var o=r.ref[a[0]],s=a[1];if(s){for(var l=0;l<s.length;l++){s[l].instanceMesh=o,s[l].instanceIndex=l,s[l].updateMatrixWorld(!0);var A=new bt;o.setMatrixAt(l,A.multiplyMatrices(e,s[l].matrixWorld)),o.instanceMatrix.needsUpdate=!0,o.objects.push(s[l])}r.instanceMap.set(a[0],void 0)}}}}catch(e){i.e(e)}finally{i.f()}r.currentLoadCount=0,console.log("complete")}t(r.model)}),n,i)}},{key:"bindSkeleton",value:function(){var e,t=S(this.boneListMap);try{for(t.s();!(e=t.n()).done;){var n=e.value[1];n.hasPose&&n.offsetMatrix&&n.applyWorldMatrix4(n.offsetMatrix),n.visible=!0}}catch(e){t.e(e)}finally{t.f()}var i,r=S(this.boneListByMeshMap);try{for(r.s();!(i=r.n()).done;){var a=i.value,o=a[1].bones,s=this.ref[a[0]];if(s){for(var l=void 0,A=0;A<this.additionPackData.length;A++)if(s.ID===this.additionPackData[A].meshId){l=this.additionPackData[A].matrix;break}var c=new To(o,s.ID);void 0===l?s.bind(c):s.bind(c,(new bt).fromArray(l))}}}catch(e){r.e(e)}finally{r.f()}}},{key:"initSkeletonTransform",value:function(){var e,t=S(this.boneListMap);try{for(t.s();!(e=t.n()).done;){var n=e.value[1];if(n.initMatrix){var i=new at,r=new nt,a=new at;n.initMatrix.decompose(i,r,a),n.position.set(i.x,i.y,i.z),n.quaternion.set(r.x,r.y,r.z,r.w),n.scale.set(a.x,a.y,a.z),n.updateMatrix()}}}catch(e){t.e(e)}finally{t.f()}var o,s=S(this.boneListByMeshMap);try{for(s.s();!(o=s.n()).done;){var l=o.value,A=this.ref[l[0]];A&&(A.visible=!0)}}catch(e){s.e(e)}finally{s.f()}}},{key:"combinMesh",value:function(e,t){var n=e.geometry,i=t.geometry,r=n.attributes.position.count;if(i.attributes.position){var a=this.mergeBufferGeometry(n,i,"position");n.setAttribute("position",new zn(a,3)),n.attributes.position.needsUpdate=!0}if(i.attributes.uv){var o=this.mergeBufferGeometry(n,i,"uv");n.setAttribute("uv",new zn(o,2)),n.attributes.uv.needsUpdate=!0}if(i.attributes.uv2){var s=this.mergeBufferGeometry(n,i,"uv2");n.setAttribute("uv2",new zn(s,2)),n.attributes.uv2.needsUpdate=!0}if(i.attributes.normal){var l=this.mergeBufferGeometry(n,i,"normal");n.setAttribute("normal",new zn(l,3)),n.attributes.normal.needsUpdate=!0}if(i.attributes.tangent){var A=this.mergeBufferGeometry(n,i,"tangent");n.setAttribute("tangent",new zn(A,4)),n.attributes.tangent.needsUpdate=!0}for(var c=n.index.array,h=i.index.array,u=c.length,d=h.length,f=[],p=0;p<u;p++)f.push(c[p]);for(var m=0;m<d;m++)f.push(h[m]+r);if(delete n.index,n.setIndex(f),n.index.needsUpdate=!0,n.groups.length>0&&i.groups.length>0){var v=n.groups[n.groups.length-1];if(e.materialIndex[v.materialIndex]==t.materialIndex[0])v.count+=i.groups[0].count;else{e.material.push(t.material[0]),e.materialIndex.push(t.materialIndex[0]);var g=v.start+v.count;n.addGroup(g,i.groups[0].count,e.materialIndex.length-1)}}}},{key:"mergeBufferGeometry",value:function(e,t,n){for(var i=e.getAttribute(n).array,r=t.getAttribute(n).array,a=i.length,o=r.length,s=new Float32Array(a+o),l=0;l<a;l++)s[l]=i[l];for(var A=0;A<o;A++)s[a+A]=r[A];return s}},{key:"loadMeshComplete",value:function(){for(var e=0;e<this.additionPackData.length;e++){var t=this.additionPackData[e].meshIds,n=this.additionPackData[e].groupIds,i=this.ref[t];if(i&&!i.isSkinnedMesh){var r=n,a=this.meshGroupDic.get(r);if(a){if(this.combinMesh(a,i),i.parent&&i.parent.remove(i),delete this.ref[t],this.sref[t]&&delete this.sref[t],this.sref[i.parentId])for(var o=this.sref[i.parentId],s=0;s<o.length;s++)if(o[s]===t){o.splice(s,1);break}a.geometry.boundingSphere=null,a.geometry.boundingBox=null}else this.meshGroupDic.set(r,i)}}}},{key:"loadAdditionPack",value:function(e,t){var n=this,i=this._createDracoLoader();i.load(e,(function(e){"meshGroup"==e.type&&e.packdata&&(n.additionPackData=e.packdata)}),(function(){i.dispose(),t()}))}},{key:"_assembly",value:function(e){var t=this;this.ref[e.sid]=e,-1===e.parentId?this.model.add(e):this.ref[e.parentId]?(this.ref[e.parentId].add(e),e.updateMatrixWorld(!0)):(void 0===this.sref[e.parentId]&&(this.sref[e.parentId]=[]),this.sref[e.parentId].push(e.sid)),this.sref[e.sid]&&(this.sref[e.sid].forEach((function(n){e.add(t.ref[n]),e.updateMatrixWorld(!0)})),this.sref[e.sid]=null)}},{key:"clearTempData",value:function(){this.ref=null,this.sref=null}},{key:"loadBoneList",value:function(e,t){var n=this,i=this._createDracoLoader();i.load(e,(function(e){if(e){if(e.boneMeshList)for(var t=0;t<e.boneMeshList.length;t++){for(var i=e.boneMeshList[t],r={},a=[],o=0;o<i.boneList.length;o++){var s=n.boneListMap.get(i.boneList[o]);s||((s=new _o).version=e.version,n.boneListMap.set(i.boneList[o],s)),a.push(s)}r.bones=a,r.maxBoneCount=i.maxBoneCount,n.boneListByMeshMap.set(i.meshId,r)}if(e.newBoneData)for(var l=0;l<e.newBoneData.length;l++){var A=e.newBoneData[l].boneId,c=n.boneListMap.get(A);c&&(c.meshdata=e.newBoneData[l].meshdata)}if(e.bones)for(var h=0;h<e.bones.length;h++){var u=e.bones[h],d=n.boneListMap.get(u.id);if(d){var f=(new bt).fromArray(u.offsetMatrix);d.offsetMatrix=f}}}}),(function(){t&&t(),i.dispose()}))}},{key:"loadSkin",value:function(e,t){var n=this,i=this._createDracoLoader();i.load(e,(function(e){if(e)for(var t=0;t<e.boneIndices.length;t++)n.ref[e.meshId].geometry.setAttribute("skinIndex_"+4*(t+1),new jn(e.boneIndices[t],4)),n.ref[e.meshId].geometry.setAttribute("skinWeight_"+4*(t+1),new Yn(e.boneWeights[t],4))}),(function(){t&&t(),i.dispose()}))}},{key:"loadInstance",value:function(e,t){var n=this,i=this._createDracoLoader();i.load(e,(function(e){e&&e.insts&&(e.insts.forEach((function(e){var t=new Vf;t.applyMatrix4((new bt).fromArray(e.offsetMatrix)),t.name=e.name,t.ID=e.id,t.sid=e.id,t.parentId=e.parent_Id,n.isOpenInstance&&n.addToCache(t);var i=n.instanceMap.get(e.ref_id);i?i.push(t):n.instanceMap.set(e.ref_id,[t]),n.isOpenInstance&&n._assembly(t)})),e.insts.length=0,e.insts=[],delete e.insts)}),(function(){t&&t(),i.dispose()}))}},{key:"loadMaterials",value:function(e){var t=this,n=e.url,i=e.onLoad,r=e.onTextureLoad,a=e.onError;(new Kl).load(n,(function(e){if(e=JSON.parse(e),t.model.originMaps={},e.z)for(var n in e.b)t.model.originMaps[e.b[n]]=e.z[n];fd.getDefaultRenderer().extensions.has("OES_texture_half_float")||(console.log("不支持拓展 OES_texture_half_float ,改用加载原贴图。"),e.b=e.z||[]),t.materialConfig?(Nf.merge(t.materialConfig,e),console.log(t.materialConfig)):t.materialConfig=e,t.parseMaterials(t.materialConfig,i,r,a)}))}},{key:"loadAOMap",value:function(e,t){var n=this;this.mapLoader.load(e,(function(e){e.wrapS=e.wrapT=1e3,n.cacheMats.forEach((function(t){t.aoMap=e,t.needsUpdate=!0})),t&&t instanceof Function&&t()}),null,t)}},{key:"generateMaterial",value:function(e,t){for(var n=[],i=0;i<e.custom_data.materialIndex.length;i++){var r=e.custom_data.materialIndex[i];if(void 0!==this.queryMats[r]){var a=this.cacheMats[this.queryMats[r]];n.push(a)}else{var o=this._createBaseMaterial(r);n.push(o),t&&(o.skinning=!0),this.cacheMats.push(o),this.queryMats[r]=this.cacheMats.length-1}}return n}},{key:"_createBaseMaterial",value:function(e){var t=new El;return t.name=e,t.ID=e,t.color=new Fn("#cccccc"),t}},{key:"parseMaterials",value:function(e,t,n,i){var r=this;if(Array.isArray(e)&&(e={a:e,b:[]}),this.extraMaterial=e.c||{},e.a.length>0){var a=0,o=0,s=e.a.length,l=new Map;e.a.forEach((function(A){var c=A;if(void 0!==c.re){var h=c.a,u=c.re;(c=l.get(u))?(c=JSON.parse(JSON.stringify(c))).re=u:c={},c.a=h}else l.set(c.a,c);r.parseMaterial({config:c,maps:e.b,onLoad:function(){++a===s&&(r._initMaterial(),t&&t instanceof Function&&t())},onTextureLoad:function(){++o===s&&n&&n instanceof Function&&n()},onError:i,edited:!1})})),l.clear()}else t&&t instanceof Function&&t()}},{key:"parseMaterial",value:function(e){var t=e.config,n=e.maps,i=e.onLoad,r=e.onTextureLoad;e.onError,e.edited;var a=t.a,o=this.queryMats[a];if(void 0===o&&a&&a.toString().indexOf("_")>-1){var s=a.split("_")[0],l=this.queryMats[s],A=this.cacheMats[l],c=this.cacheMeshes.find((function(e){return e.name===t.mn})),h=A.clone();h.name=t.ee||a,h.sname=A.sname,h.ID=a,this.cacheMats.push(h),o=this.cacheMats.length-1,this.queryMats[a]=o,c.material[c.material.indexOf(A)]=h}var u=this.cacheMats[o];u||(u=this._createBaseMaterial(a),this.cacheMats.push(u),this.queryMats[a]=this.cacheMats.length-1),Nf.parseAmrtMaterial(t,n,u,i,r,this.mapLoader)}},{key:"addToCache",value:function(e){this.cacheMeshes.push(e),this.cacheMesheIds.push(e.ID)}},{key:"loadAnimationComplete",value:function(e){for(var t=[],n=0;n<e.length;n++){var i=this.animNameMap.get(e[n]);i&&t.push(i)}this.model.animation.setAnimationList(t)}},{key:"loadAnimation",value:function(e,t){var n=this;this.hasSkinnedAnimation=!0;var i=this._createDracoLoader();i.load(e,(function(i){try{if(i){var r=[];if(i.animType2Anim){var a=n.parseAnimation(i);r=r.concat(a)}else i.boneId2Anim&&i.boneId2Anim.length>0&&(r=r.concat(n.parseSkinAnimation(i)));var o=new Gl(i.name,i.Duration,r);n.model.animation.addClip(o),n.animNameMap.set(e,i.name)}}catch(e){console.error("动画文件解析出错!",e)}t&&t()}),(function(){i.dispose()}))}},{key:"parseSkinAnimation",value:function(e){if(e.boneId2Anim){var t=new bt,n=new at,i=new nt,r=new at;e.Duration;for(var a=[],o=0;o<e.boneId2Anim.length;o++){for(var s=e.boneId2Anim[o],l=this.ref[s.boneId].name,A=s.frameTimes,c=[],h=[],u=[],d=0;d<s.frameVals.length;d++){var f=s.frameVals[d];t.fromArray(f),t.decompose(n,i,r),c.push(n.x,n.y,n.z),h.push(i.x,i.y,i.z,i.w),u.push(r.x,r.y,r.z)}var p=new Ql(l+".position",A,c),m=new Nl(l+".quaternion",A,h),v=new Ql(l+".scale",A,u);a.push(p,m,v)}return a}}},{key:"parseAnimation",value:function(e){var t=e.animType2Anim,n=e.ticksPerSecond,i=[];if(t.transAnim)for(var r=0;r<t.transAnim.length;r++){for(var a=t.transAnim[r],o=[],s=0;s<a.frameTimes.length;s++)o.push(a.frameTimes[s]-n);for(var l=0;l<a.meshId.length;l++)if(this.ref[a.meshId[l]]){var A=this.ref[a.meshId[l]].uuid;i.push(new Ql(A+".position",o,a.frameVals))}}if(t.scaleAnim)for(var c=0;c<t.scaleAnim.length;c++){for(var h=t.scaleAnim[c],u=[],d=0;d<h.frameTimes.length;d++)u.push(h.frameTimes[d]-n);for(var f=0;f<h.meshId.length;f++)if(this.ref[h.meshId[f]]){var p=this.ref[h.meshId[f]].uuid;i.push(new Ql(p+".scale",u,h.frameVals))}}if(t.rotAnim)for(var m=0;m<t.rotAnim.length;m++){for(var v=t.rotAnim[m],g=[],y=0;y<v.frameTimes.length;y++)g.push(v.frameTimes[y]-n);for(var w=0;w<v.meshId.length;w++)if(this.ref[v.meshId[w]]){var x=this.ref[v.meshId[w]].uuid;i.push(new Nl(x+".quaternion",g,v.frameVals))}}return i}},{key:"parseSkinnedAnimation",value:function(e){for(var t,n=[],i=0,r=0;r<e.length;r++){var a=e[r],o=this.cacheSkinnedMeshs[a.a].name,s=[],l=[],A=[],c=[];a.d>i&&(i=a.d);for(var h=0;h<a.b.length;h++){s.push(a.b[h].a);var u=(new bt).fromArray(a.b[h].b),d=new at,f=new nt,p=new at;u.decompose(d,f,p),l.push(d.x),l.push(d.y),l.push(d.z),A.push(f.x),A.push(f.y),A.push(f.z),A.push(f.w),c.push(p.x),c.push(p.y),c.push(p.z)}n.push(new Ql(o+".position",s,l)),n.push(new Nl(o+".quaternion",s,A)),n.push(new Ql(o+".scale",s,c))}var m=new Gl("test",i,n),v=(t=new Dc(this.model)).clipAction(m);v.play(),this.cacheAnimations.push(t),this.cacheActions.push(v)}},{key:"_initMaterial",value:function(){var e=this,t=[];this.cacheMeshes.forEach((function(n){if(n.isMesh&&!n.isHotSpotEntity){var i=Array.isArray(n.material)?n.material[0]:n.material;i&&(n.renderOrder=i.renderOrder);var r=Array.isArray(n.material)?n.material:[n.material];r&&(n.geometry.attributes&&!n.geometry.attributes.uv&&r.forEach((function(e){e.vertexTangents=!1})),n.geometry.attributes&&n.geometry.attributes.uv2&&r.forEach((function(e){void 0===e.aoUV&&(e.aoUV=1)})));var a=function(i){var r=e.extraMaterial[i],a=e.cacheMats.find((function(e){return e.name==i}));if(!a)return"continue";r.map((function(i){if(i.a==n.ID){if(!n.material[i.b])return;e.cacheExtraMat.push({a:n.ID,b:i.b,c:n.material[i.b].name}),n.isSkinnedMesh?a.skinning=!0:a.skinning=!1,t.push(n.material[i.b]),n.material[i.b]=a}}))};for(var o in e.extraMaterial)a(o)}}));for(var n=0;n<t.length;n++){for(var i=!1,r=0;r<this.cacheMeshes.length;r++){for(var a=0;a<this.cacheMeshes[r].material.length;a++)if(t[n]==this.cacheMeshes[r].material[a]){i=!0;break}if(i)break}if(!i){var o=this.cacheMats.indexOf(t[n]);o>=0&&this.cacheMats.splice(o,1)}}}},{key:"replaceMaterials",value:function(e){var t=e.url,n=e.onload,i=e.onTextureLoad;this.extraMaterial={},this.loadMaterials({url:t,onload:n,onTextureLoad:i})}},{key:"_createDracoLoader",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4,t=new Qf;return t.setDecoderPath(If.getDecoderPath()),t.setWorkerLimit(e),t}}]),e}(),Jf=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),(i=t.call(this)).logId="",i.viewer=e,i.mapLoader=new Kf(e),i}return A(n,[{key:"load",value:function(e,t,n,i){var r=this,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return this.paths=e,void 0!==e.localPath&&this.mapLoader.setBaseUrl(e.localPath),this._onLoad=t,this._onProgress=n,this._onError=i,this.logId=!!a.log&&a.log.toString(),e.m[0].indexOf(".mbin")>-1||e.m[0].indexOf(".mrmb")>-1?this.loader=new Zf(a,this.viewer):this.loader=new zf(a,this.viewer),this.loader.mapLoader=this.mapLoader,this.paths.nodes?this.loader.loadNodes(this.paths.nodes,(function(){r._loadMultiMesh()})):this._loadAdditionPack((function(){if(r.paths.instance&&r.paths.instance.length>0)for(var e=0;e<r.paths.instance.length;e++)r.loader.loadInstance(r.paths.instance[e],(function(){r._loadSkinAndMesh()}));else r._loadSkinAndMesh()})),this.loader.model.name=a.name||this.loader.model.name,this.loader.model.ID=a.id||"",a.position&&(Array.isArray(a.position)?this.loader.model.position.fromArray(a.position):a.position.isVector3&&this.loader.model.position.copy(a.position)),a.rotation&&Array.isArray(a.rotation)&&this.loader.model.rotation.set(et.degToRad(a.rotation[0]),et.degToRad(a.rotation[1]),et.degToRad(a.rotation[2])),a.scale&&(Array.isArray(a.scale)&&3===a.scale.length?this.loader.model.scale.fromArray(a.scale):isNaN(a.scale)?a.scale.isVector3&&this.loader.model.scale.copy(a.scale):this.loader.model.scale.multiplyScalar(a.scale)),this.loader.model}},{key:"_loadSkinAndMesh",value:function(){var e=this;if(this.paths.bone&&this.paths.bone.length>0)for(var t=0;t<this.paths.bone.length;t++)this.loader.loadBoneList(this.paths.bone[t],(function(){e._loadMultiMesh()}));else this._loadMultiMesh()}},{key:"_loadMaterials",value:function(e){var t=this;this.logId&&console.time("材质加载用时(".concat(this.logId,")")),this.logId&&console.time("贴图加载用时(".concat(this.logId,")")),void 0!==this.paths.rs&&(this.mapLoader.RESIZE=Boolean(this.paths.rs)),void 0!==this.paths.localPath&&(this.mapLoader.RESIZE=!1);var n=0,i=e.length;e.forEach((function(e){t.loader.loadMaterials({url:e,onLoad:function(){++n===i&&(t.dispatchEvent(ld.MATERIAL_LOADED,t.loader.model),t.logId&&console.timeEnd("材质加载用时(".concat(t.logId,")")))},onTextureLoad:function(){t.paths.ao&&t.paths.ao,t.dispatchEvent(ld.TEXTURE_LOADED),t.logId&&console.timeEnd("贴图加载用时(".concat(t.logId,")"))},onError:function(e){t.dispatchEvent(ld.MATERIAL_LOAD_ERROR),console.error("材质加载出错",e)}})}))}},{key:"_loadAnimations",value:function(){var e=this;if(this.paths.a){this.logId&&console.time("动画加载用时(".concat(this.logId,")"));var t=0,n=this.paths.a.length;this.paths.a.forEach((function(i){e.loader.loadAnimation(i,(function(){++t===n&&(e.loader.loadAnimationComplete(e.paths.a),e.dispatchEvent(ld.ANIMATION_LOADED),e.logId&&console.timeEnd("动画加载用时(".concat(e.logId,")")))}))}))}}},{key:"_loadAdditionPack",value:function(e){var t=this;Array.isArray(this.paths.addition)&&this.paths.addition.length>0?this.paths.addition.forEach((function(n){n&&t.loader.loadAdditionPack(n,e)})):e()}},{key:"_loadComplete",value:function(e){var t=this;e.objects=[],e.traverse((function(t){t.isMesh&&e.objects.push(t)})),e.recalculationBound(),e.update(),this.loader.bindSkeleton(),this.loader.loadMeshComplete();var n=!1;this.paths.skin&&this.paths.skin.length>0?(n=!0,this._loadSkin(this.paths.skin,(function(){t.loader.initSkeletonTransform(),t._loadAnimations(),t._loadMaterials(t.paths.mat),t._onProgress&&t._onProgress(100),t.dispatchEvent(ld.MESH_LOADED,e),t._onLoad&&t._onLoad(e)}))):this._loadAnimations(),this.paths.a&&this.paths.a.length,n||(this._loadMaterials(this.paths.mat),this._onProgress&&this._onProgress(100),this.dispatchEvent(ld.MESH_LOADED,e),this._onLoad&&this._onLoad(e)),this.loader.meshLoader&&this.loader.meshLoader.dispose()}},{key:"_loadSkin",value:function(e,t){for(var n=0;n<e.length;n++)this.loader.loadSkin(e[n],t)}},{key:"_loadMultiMesh",value:function(){var e=this;this.logId&&console.time("网格加载用时(".concat(this.logId,")"));var t=this.paths.m.length,n=0,i=new Array(t).fill(0),r=new Array(t).fill(0),a=new Array(t).fill(0),o=0,s=function(){n++,A(1),n>=t&&(e.logId&&console.timeEnd("网格加载用时(".concat(e.logId,")")),e.paths.i&&e.paths.ii?e.loadInstanceMesh((function(){e._loadComplete(e.loader.model)})):e._loadComplete(e.loader.model))},l=function(t){e._onError&&e._onError(t),e.dispatchEvent(ld.MESH_LOAD_ERROR)},A=function(n){e.loader.setLoadCount&&e.loader.setLoadCount(t);for(var A=function(t){var n=e.paths.m[o];e.loader.load(n,s,(function(n){!function(t,n){var o=e.paths.ms&&e.paths.ms[n];if(e._onProgress){if(r[n]=o||t.total,!r[n])return;i[n]=t.loaded,a[n]=i[n]/r[n];var s=a.reduce((function(e,t){return e+t}),0)/a.length;e._onProgress(parseInt(100*s))}}(n,t)}),l),o++},c=0;c<n&&o<t;c++)A(c)};t>0?A(Math.min(t,20)):s()}},{key:"_preloadMaterial",value:function(){var e=this;void 0!==this.paths.localPath&&(this.mapLoader.RESIZE=!1),this.paths.mat.forEach((function(t){(new Kl).load(t,(function(t){for(var n in(t=JSON.parse(t)).b)e.mapLoader.load(t.b[n])}))}))}},{key:"loadInstanceMesh",value:function(e){var t=this;(new Kl).load(this.paths.i,(function(n){var i=JSON.parse(n);t.loader.instances=i;var r=t.paths.ii.length,a=0;t.paths.ii.forEach((function(n){t.loader.load(n,(function(n){(n=n[0]).parent&&n.parent.remove(n);var o=[];i.forEach((function(e,t){e.c==n.iid&&o.push(e)}));var s=new El;s.name=name,s.color=new Fn("#cccccc");var l=[s],A=new Lf(n.geometry,l,o.length);t.loader.model.add(A);var c=new bt;c.getInverse(t.loader.model.matrixWorld),o.forEach((function(e,n){var i=new Vf;i.name=e.b,i.instanceMesh=A,i.instanceIndex=n,i.applyMatrix((new bt).fromArray(e.d));var r=t.loader.model.getObjectByProperty("ID",e.e)||t.loader.model;r&&(r.add(i),t.loader.addToCache(i)),i.updateMatrixWorld(!0);var a=new bt;A.setMatrixAt(n,a.multiplyMatrices(c,i.matrixWorld)),A.objects.push(i)})),A.instanceMatrix.needsUpdate=!0,++a>=r&&e()}))}))}),void 0,(function(){console.error("实例化数据文件加载失败"),e()}))}},{key:"preloadMap",value:function(e,t,n){this.loader.preloadMap(e,t,void 0,n)}},{key:"dispatchEvent",value:function(e,t){b(u(n.prototype),"dispatchEvent",this).call(this,{type:e,data:t})}},{key:"addEventListener",value:function(e,t){return b(u(n.prototype),"addEventListener",this).call(this,e,t),this}}]),n}(Je),qf=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),(i=t.call(this,e)).isBIMLoader=!0,i}return A(n,[{key:"load",value:function(e,t,i,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return a.isBIM=!0,b(u(n.prototype),"load",this).call(this,e,t,i,r,a),this.loadConfig(this.paths.bim),this.paths.bimNode&&this.loadNodeTree(this.paths.bimNode),this.loader.model}},{key:"loadNodeTree",value:function(e){var t=this;(new Kl).setResponseType("json").load(e,(function(e){console.time("nodeTree");var n={};e.forEach((function(e){if(e.b.indexOf("##")>-1){var t=e.b.split("##");e.b=t[0],e.CID=parseInt(t[1])}n[e.a]=e}));for(var i={},r={children:{}},a=0;a<e.length;a++)if(e[a].children={},i[e[a].a]=e[a].c,-1==e[a].c)r.children[e[a].a]=e[a];else{var o=e[a].c,s=[];for(s.push(o);-1!==i[o];)o=i[o],s.push(o);s.reverse();for(var l=r,A=0;A<s.length;A++)l=l.children[s[A]];l.children[e[a].a]=e[a]}for(var c=0;c<e.length;c++)e[c].children=Object.values(e[c].children);console.timeEnd("节点计算"),i=null,r=Object.values(r.children)[0],console.log(r),t.loader.model.nodeArray=e,t.loader.model.nodeTree=r,console.timeEnd("nodeTree"),t.paths.bimFace&&(new Kl).setResponseType("json").load(t.paths.bimFace,(function(e){t.loader.model.faceMap=e}))}))}},{key:"loadConfig",value:function(e,t){var n=this;this.loader.model.isBIM=!0,this.loader.model.basePath=e.substring(0,e.lastIndexOf("/"))+"/",this.loader.model.extension=e.substring(e.lastIndexOf(".")+1,e.length),this.loader.model.extension=this.loader.model.extension.split("?")[0],(new Kl).load(e,(function(e){e=JSON.parse(e),n.loader.model.bimConfig=e.c,n.loader.model.structureTree=e.d,n.viewer.dispatchEvent("BIMOnLoad"),t&&t()}))}}]),n}(Jf),$f=function(){function e(){s(this,e)}return A(e,null,[{key:"create",value:function(t){var n=new ep(t);return e.ModelManagerArray.push(n),n}}]),e}();$f.ModelManagerArray=[];var ep=function(e){h(n,e);var t=y(n);function n(e){var i;if(s(this,n),(i=t.call(this)).viewer=null,i.root=null,i.modelGroup=null,i.scene=null,i.intersectObjects={click:[],dblclick:[],mousedown:[],mousemove:[]},i.viewer=e,!i.viewer.sceneManager.scene)throw new Error("scene is not instance of Scene.");return i.scene=i.viewer.sceneManager.scene,i.root=i.viewer.sceneManager.root,i.modelGroup=i.viewer.sceneManager.modelGroup,i.picker=e.picker,i.viewer.container.addEventListener("click",i._eventHandler.bind(v(i),"click")),i.viewer.container.addEventListener("dblclick",i._eventHandler.bind(v(i),"dblclick")),i.viewer.container.addEventListener("mousedown",i._eventHandler.bind(v(i),"mousedown")),i.viewer.container.addEventListener("mousemove",i._eventHandler.bind(v(i),"mousemove")),i.cacheModels=new Map,i}return A(n,[{key:"mapLoader",get:function(){return this.viewer.sceneManager.mapLoader}},{key:"_eventHandler",value:function(e,t){if(0!=this.intersectObjects[e].length){var n=this.picker.intersectObject(t,this.intersectObjects[e],!0);if(n){var i=[];n.object.traverseAncestors((function(t){switch(e){case"click":i=t.clickCallback;break;case"dblclick":i=t.dblclickCallback;break;case"mousedown":i=t.mousedownCallback;break;case"mousemove":i=t.mousemoveCallback}t.isModel&&i.map((function(e){e.bind(t)()}))}))}}}},{key:"add",value:function(e){e.isModel?this.addModel(e):e.isPostProcessing?this.viewer.composer.add(e):e.isObject3D&&this.root.add(e),this.viewer.renderManager.render()}},{key:"remove",value:function(e){e.isModel?this.removeModel(e):e.isPostProcessing?this.viewer.composer.remove(e):e.isObject3D&&this.root.remove(e),this.viewer.renderManager.render()}},{key:"addModel",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.modelGroup.add(e),this.dispatchEvent({type:ld.MODEL_UPDATE}),(1===this.modelGroup.children.length||t.fitCamera||void 0===t.fitCamera)&&(e.boundingBox?this.viewer.sceneManager.fitCamera(e):(t.box&&!t.box.isBox3&&(t.box=(new tn).setFromArray(t.box.min.concat(t.box.max))),this.viewer.sceneManager.fitCamera(e,t.box))),this.viewer.renderManager.render()}},{key:"fitCamera",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.dispatchEvent({type:ld.MODEL_UPDATE}),(1===this.modelGroup.children.length||t.fitCamera||void 0===t.fitCamera)&&(e.boundingBox||t.box&&!t.box.isBox3&&(t.box=(new tn).setFromArray(t.box.min.concat(t.box.max)))),this.viewer.renderManager.render()}},{key:"removeModel",value:function(e){e.parent&&e.parent.remove(e),this.dispatchEvent({type:ld.MODEL_UPDATE}),this.viewer.renderManager.render()}},{key:"removeCache",value:function(e){this.cacheModels.delete(e)}},{key:"modelClone",value:function(e,t){var n=t.model,i=t.options;n.copy(e),n.visible=0!=e.initVisible,i.onLoad&&i.onLoad(n),i.onProgress&&i.onProgress(),i.onError&&i.onError(),i.onMatLoad&&i.onMatLoad(),i.onAnimeLoad&&i.onAnimeLoad(n),i.onSceneLoad&&i.onSceneLoad(),i.onTextureLoad&&i.onTextureLoad(n),i.onPostProcessingLoad&&i.onPostProcessingLoad(),i.onComplete&&i.onComplete(n)}},{key:"actionClone",value:function(e){var t=e.get("model"),n=e.get("optionsList");e.set("optionsList",[]);for(var i=0;i<n.length;i++){var r=n[i];this.modelClone(t,r)}}},{key:"actionComplete",value:function(e,t,n){for(var i in n)if(!n[i])return null;e.visible=0!=e.initVisible,t&&t(e)}},{key:"loadModel",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i={},r=new Map;if(this.cacheModels.get(e)){r=this.cacheModels.get(e);var a=new kf(this.viewer);if(r.get("model")){var o=r.get("model"),s={options:n,model:a};this.modelClone(o,s)}else{var l=r.get("optionsList"),A={options:n,model:a};l.push(A)}return a}r.set("path",e),r.set("optionsList",[]),this.cacheModels.set(e,r);var c=e;if(n.background=n.background||void 0===n.background,n.env=n.env||void 0===n.env,n.focus=n.focus||void 0===n.focus,n.addModel=n.addModel||void 0===n.addModel,n.postprocessing=n.postprocessing||void 0===n.postprocessing,e&&n.offline){if(!(c=lu.getFileList(e)))return(c=lu.hasMRCBFile(e))?(i.onload=0,this.viewer.largeSceneLoader2.load(e,(function(e){e.coordinate=c.coordinate,n.onLoad&&n.onLoad(e),i.onload=1,t.actionComplete(e,n.onComplete,i)}),n)):(this.actionComplete(null,n.onComplete,i),null);c.localPath=e+"Texture/"}else{if(/^\d{19}/.test(e)){n.id=n.id||e;try{c=n.local?lu.getLocalModelById(e):lu.getModelById(e),n.local&&lu.setOnlinePath(c)}catch(e){return n.onError&&n.onError(e),void this.actionComplete(e,n.onComplete,i)}}n.baseURL&&(c=lu.setLocalPath(c,n.baseURL))}if(cu.options&&cu.options.offline){var h=!1,u=function(e){var t=c[e];if(Array.isArray(t)){if(t.find((function(e){return t&&t.includes&&e.includes("https://laozi-auto-east.obs.cn-east-2.myhuaweicloud.com")})))throw h=!0,new Error("离线模式下不允许加载线上资源")}else if(t&&t.includes&&t.includes("https://laozi-auto-east.obs.cn-east-2.myhuaweicloud.com"))throw h=!0,new Error("离线模式下不允许加载线上资源")};for(var d in c)u(d);if(h)return}if(c.levelUrl)return this.cacheModels.delete(e),c.levelUrl.endsWith("AMRT-L")?(i.onload=0,this.viewer.largeSceneLoader2.load(c.levelUrl,(function(e){e.coordinate=c.coordinate,n.onLoad&&n.onLoad(e),i.onload=1,t.actionComplete(e,n.onComplete,i)}),{focus:n.focus,doubeside:n.doubeside,transparent:n.transparent,alhpaTest:n.alhpaTest,isOnline:!0})):(i.onload=0,this.viewer.largeSceneLoader.load(c.levelUrl,(function(e){e.coordinate=c.coordinate,n.onLoad&&n.onLoad(e),i.onload=1,t.actionComplete(e,n.onComplete,i)})));i.onload=0,i.onPostProcessingLoad=0;var f=c.bim?new qf(this.viewer):new Jf(this.viewer),p=f.load(c,(function(e){if(c.fitCamera=n.focus,n.addModel&&(t.modelGroup.add(e),e.initVisible=e.visible,e.visible=!1),n.offline||c.sceneData&&c.sceneData.endsWith(".json"))c.sceneData?t.loadSceneData(p,c.sceneData,c):t.setCameraView(e,null,c);else if(c.sceneData){var r=JSON.parse(c.sceneData);if(r.rotation&&(e.rotation.fromArray(r.rotation),e.updateMatrix(),e.boundingBox.setFromObject(e)),!r.shadow)return;t.viewer.sceneManager.enableShadow=r.shadow.visible,t.viewer.sceneManager.shadowDecay=r.shadow.decay||1,t.viewer.sceneManager.shadowStrength=r.shadow.strength/10,t.viewer.sceneManager.shadowOffset=(r.shadow.offset||0)*e.boundingBox.getSize(new at).y*2,t.setCameraView(e,r,c)}else t.setCameraView(e,null,c);n.onLoad&&n.onLoad(e),e.onComplete&&e.onComplete(),i.onload=1,t.actionComplete(e,n.onComplete,i)}),(function(e){n.onProgress&&n.onProgress(e)}),(function(e){n.onError&&n.onError(e),t.actionComplete(e,n.onComplete,i)}),n);p.viewer=this.viewer,p.modelPath=c.m[0],i.onSceneLoad=0;var v=n.localPath||c.localPath||"";return f.addEventListener(ld.MATERIAL_LOADED,(function(){c.scene?t.viewer.sceneManager.loadSceneFile(c.scene,{localPath:v,onLoad:function(e){n.env&&e.e?(t.mapLoader.loadEnvMap(v+e.e,(function(r){p.materials.map((function(t){t.envMap=r,t.envMapIntensity=null==e.ei||null==e.ei?.7:e.ei,t.envRotateY=Math.PI/180*(e.ea||0),t.needsUpdate=!0})),n.onSceneLoad&&n.onSceneLoad(e),i.onSceneLoad=1,t.actionComplete(p,n.onComplete,i),setTimeout((function(){n.postprocessing&&t.viewer.sceneManager.loadPostProcessing(p),n.onPostProcessingLoad&&n.onPostProcessingLoad(),i.onPostProcessingLoad=1,t.actionComplete(p,n.onComplete,i)}),1e3)})),t.viewer.sceneManager.setEnvMapIntensity(e.ei),t.viewer.sceneManager.setEnvMapRotation(e.ea||0),t.viewer.sceneManager.envMapUrl=e.e):(n.onSceneLoad&&n.onSceneLoad(e),i.onSceneLoad=1,t.actionComplete(p,n.onComplete,i),setTimeout((function(){n.postprocessing&&t.viewer.sceneManager.loadPostProcessing(p),n.onPostProcessingLoad&&n.onPostProcessingLoad(),i.onPostProcessingLoad=1,t.actionComplete(p,n.onComplete,i)}),1e3))},background:n.background},p):c.sky?(c.sky.b&&n.background&&t.viewer.sceneManager.setSkyBox(c.sky.b),c.sky.a&&n.env?(t.mapLoader.loadEnvMap(c.sky.a,(function(e){p.setEnvMap(e),n.onSceneLoad&&n.onSceneLoad({a:{aa:"#FFFFFF",ab:.7},b:{ba:"#FFFFFF",bb:.7,bc:[0,.7,.7]},c:1,ca:c.sky.b,cb:.5,e:c.sky.a,ea:0,ei:.7}),i.onSceneLoad=1,t.actionComplete(p,n.onComplete,i)})),t.viewer.sceneManager.envMapUrl=c.sky.a):(i.onSceneLoad=1,t.actionComplete(p,n.onComplete,i)),n.onPostProcessingLoad&&n.onPostProcessingLoad(null),i.onPostProcessingLoad=1,t.actionComplete(p,n.onComplete,i)):(n.onSceneLoad&&n.onSceneLoad({a:{aa:"#FFFFFF",ab:.7},b:{ba:"#FFFFFF",bb:.7,bc:[0,.7,.7]},c:2,ca:"#000000"}),n.onPostProcessingLoad&&n.onPostProcessingLoad(null),i.onSceneLoad=1,t.actionComplete(p,n.onComplete,i),i.onPostProcessingLoad=1,t.actionComplete(p,n.onComplete,i)),!n.env&&t.viewer.sceneManager.envMapUrl&&n.onLoad&&n.onLoad(m).setEnvMap(t.viewer.sceneManager.envMapUrl),n.onMatLoad&&n.onMatLoad()})),c.a&&c.a.length>0&&(i.onAnimeLoad=0),f.addEventListener(ld.ANIMATION_LOADED,(function(){n.onAnimeLoad&&n.onAnimeLoad(p),i.onAnimeLoad=1,t.actionComplete(p,n.onComplete,i)})),i.onTextureLoad=0,f.addEventListener(ld.TEXTURE_LOADED,(function(){r.set("model",p),p.cacheKey=r.get("path"),t.actionClone(r),n.onTextureLoad&&n.onTextureLoad(p),i.onTextureLoad=1,t.actionComplete(p,n.onComplete,i)})),p.options=n,p.loader=f,p}},{key:"loadModel_miniprogram",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i={},r=e,a=this;if(n.background=n.background||void 0===n.background,n.env=n.env||void 0===n.env,n.focus=n.focus||void 0===n.focus,n.addModel=n.addModel||void 0===n.addModel,n.postprocessing=n.postprocessing||void 0===n.postprocessing,e.constructor!==String&&isNaN(e))n.baseURL&&(r=lu.setLocalPath(e,n.baseURL)),s();else{n.id=n.id||e;var o=n.local?lu.getLocalModelById:lu.getModelById;o(e).then((function(t){if(r=t,"无权访问该模型"!=t){if("token不存在或已失效"===t)return cu.token=cu.checkDevloper(),void(cu.token&&lu.getModelById(e).then((function(e){r=e,n.local&&lu.setOnlinePath(r),s()})));n.local&&lu.setOnlinePath(r),s()}})).catch((function(e){n.onError&&n.onError(e),t.actionComplete(e,n.onComplete,i)}))}function s(){var e=r.bim?new qf(a.viewer):new Jf(a.viewer);i.onLoad=0,i.onPostProcessingLoad=0;var t=e.load(r,(function(e){r.fitCamera=void 0===n.focus||n.focus,!1!==n.addModel&&(a.modelGroup.add(e),e.visible=!1),n.onLoad&&n.onLoad(e),i.onLoad=1,a.actionComplete(e,n.onComplete,i)}),(function(e){n.onProgress&&n.onProgress(e)}),(function(e){n.onError&&n.onError(e),a.actionComplete(e,n.onComplete,i)}),n);return t.viewer=a.viewer,i.onMatLoad=0,e.addEventListener(ld.MATERIAL_LOADED,(function(){n.onMatLoad&&n.onMatLoad(),i.onMatLoad=1,a.actionComplete(t,n.onComplete,i),r.scene?(i.onSceneLoad=0,a.viewer.sceneManager.loadSceneFile(r.scene,{onLoad:function(e){n.env&&e.e?(a.mapLoader.loadEnvMap(e.e,(function(n){t.materials.map((function(t){t.envMap=n,null==e.ei||null==e.ei?t.envMapIntensity=.7:t.envMapIntensity=Number(e.ei),e.ea&&0!==e.ea?t.envRotateY=Math.PI/180*Number(e.ea):t.envRotateY=0,t.needsUpdate=!0}))})),n.onSceneLoad&&n.onSceneLoad(e),i.onSceneLoad=1,a.actionComplete(t,n.onComplete,i),setTimeout((function(){n.postprocessing&&a.viewer.sceneManager.loadPostProcessing(t),n.onPostProcessingLoad&&n.onPostProcessingLoad(),i.onPostProcessingLoad=1,a.actionComplete(t,n.onComplete,i)}),1e3)):setTimeout((function(){n.postprocessing&&a.viewer.sceneManager.loadPostProcessing(t),n.onPostProcessingLoad&&n.onPostProcessingLoad(),i.onPostProcessingLoad=1,a.actionComplete(t,n.onComplete,i)}),1e3)},background:n.background})):r.sky?(r.sky.b&&n.background&&a.viewer.sceneManager.setSkyBox(r.sky.b),r.sky.a&&n.env?(a.mapLoader.loadEnvMap(r.sky.a,(function(e){t.setEnvMap(e)})),n.onSceneLoad&&n.onSceneLoad(config),setTimeout((function(){n.postprocessing&&a.viewer.sceneManager.loadPostProcessing(t),n.onPostProcessingLoad&&n.onPostProcessingLoad(),i.onPostProcessingLoad=1,a.actionComplete(t,n.onComplete,i)}),1e3)):setTimeout((function(){n.postprocessing&&a.viewer.sceneManager.loadPostProcessing(t),n.onPostProcessingLoad&&n.onPostProcessingLoad(),i.onPostProcessingLoad=1,a.actionComplete(t,n.onComplete,i)}),1e3)):setTimeout((function(){n.postprocessing&&a.viewer.sceneManager.loadPostProcessing(t),n.onPostProcessingLoad&&n.onPostProcessingLoad(),i.onPostProcessingLoad=1,a.actionComplete(t,n.onComplete,i)}),1e3),!n.env&&a.viewer.sceneManager.envMapUrl&&m.setEnvMap(a.viewer.sceneManager.envMapUrl)})),r.a&&r.a.length>0&&(i.onAnimeLoad=0),e.addEventListener(ld.ANIMATION_LOADED,(function(){n.onAnimeLoad&&n.onAnimeLoad(t),i.onAnimeLoad=1,a.actionComplete(error,n.onComplete,i)})),t.loader=e,t}}},{key:"loadSingleMaterial",value:function(e,t){var n=new Zf(this,this.viewer);if(t.mapRoot){var i=e.b;for(var r in i)i[r].startsWith("http")&&(i[r]=i[r].slice(i[r].lastIndexOf("/")+1)),i[r]=t.mapRoot+i[r]}n.parseMaterials(e,(function(){t.onLoad&&t.onLoad(n.cacheMats)}))}},{key:"loadSceneData",value:function(e,t,n){var i=this;(new ou).load(t,(function(t){try{var r=JSON.parse(t);if(r.rotation&&(e.rotation.fromArray(r.rotation),e.updateMatrix(),e.boundingBox.setFromObject(e)),!r.shadow)return;i.viewer.sceneManager.enableShadow=r.shadow.visible,i.viewer.sceneManager.shadowDecay=r.shadow.decay||1,i.viewer.sceneManager.shadowStrength=r.shadow.strength/10,i.viewer.sceneManager.shadowOffset=(r.shadow.offset||0)*Math.ceil(e.boundingBox.getSize(new at).y)*2,i.setCameraView(e,r,n)}catch(e){console.warn("加载配置数据出错")}}))}},{key:"setCameraView",value:function(e,t,n){if(this.dispatchEvent({type:ld.MODEL_UPDATE}),n.fitCamera||void 0===n.fitCamera)if(t&&t.view){var i=t.view.target,r=t.view.position,a=e.boundingBox.getSize(new at),o=1.5*a.length(),s=e.boundingBox.getCenter(new at),l=s.x-i[0],A=s.y-i[1],c=s.z-i[2],h=[r[0]+l,r[1]+A,r[2]+c],u=[s.x,s.y,s.z],d=new at(h[0]-u[0],h[1]-u[1],h[2]-u[2]).normalize(),f=s.clone().addScaledVector(d,o),p=[f.x,f.y,f.z];this.viewer.controls.setView({position:p,target:u});var m=Math.max(a.x,a.y,a.z),v=Math.min(a.x,a.y,a.z);this.viewer.camera.near=.05*v,20*m>this.viewer.camera.far&&(this.viewer.camera.far=20*m),this.viewer.camera.far<5e3&&(this.viewer.camera.far=5e3),this.viewer.camera.updateProjectionMatrix()}else e.boundingBox?this.viewer.sceneManager.fitCamera(e):(n.box&&!n.box.isBox3&&(n.box=(new tn).setFromArray(n.box.min.concat(n.box.max))),this.viewer.sceneManager.fitCamera(e,n.box));this.viewer.renderManager.render(!0)}}]),n}(Je);function tp(e){var t=new Qt;t.viewer=e;var n=new ki;n.deleteAttribute("uv");var i=new gl({side:1}),r=new gl,a=new LA(16777215,5,28,2);a.position.set(.418,16.199,.3),t.add(a);var o=new Ei(n,i);o.position.set(-.757,13.219,.717),o.scale.set(31.713,28.305,28.591),t.add(o);var s=new Ei(n,r);s.position.set(-10.906,2.009,1.846),s.rotation.set(0,-.195,0),s.scale.set(2.328,7.905,4.651),t.add(s);var l=new Ei(n,r);l.position.set(-5.607,-.754,-.758),l.rotation.set(0,.994,0),l.scale.set(1.97,1.534,3.955),t.add(l);var A=new Ei(n,r);A.position.set(6.167,.857,7.803),A.rotation.set(0,.561,0),A.scale.set(3.927,6.285,3.687),t.add(A);var c=new Ei(n,r);c.position.set(-2.017,.018,6.124),c.rotation.set(0,.333,0),c.scale.set(2.002,4.566,2.064),t.add(c);var h=new Ei(n,r);h.position.set(2.291,-.756,-2.621),h.rotation.set(0,-.286,0),h.scale.set(1.546,1.552,1.496),t.add(h);var u=new Ei(n,r);u.position.set(-2.193,-.369,-5.547),u.rotation.set(0,.516,0),u.scale.set(3.875,3.487,2.986),t.add(u);var d=new Ei(n,y(50));d.position.set(-16.116,14.37,8.208),d.scale.set(.1,2.428,2.739),t.add(d);var f=new Ei(n,y(50));f.position.set(-16.109,18.021,-8.207),f.scale.set(.1,2.425,2.751),t.add(f);var p=new Ei(n,y(17));p.position.set(14.904,12.198,-1.832),p.scale.set(.15,4.265,6.331),t.add(p);var m=new Ei(n,y(43));m.position.set(-.462,8.89,14.52),m.scale.set(4.38,5.441,.088),t.add(m);var v=new Ei(n,y(20));v.position.set(3.235,11.486,-12.541),v.scale.set(2.5,2,.1),t.add(v);var g=new Ei(n,y(100));function y(e){var t=new Nn;return t.color.setScalar(e),t}return g.position.set(0,20,0),g.scale.set(1,.1,1),t.add(g),t}function np(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16776960;zt.call(this),this.name="BoxClippingHelper",this.box=e,this.boxSize=new at,this.line=new Fh(e,t),this.add(this.line);var n=new ki(1,1,1);this.mesh=new Ei(n,new Nn({transparent:!0,opacity:.25,color:t})),this.box.getSize(this.boxSize),this.mesh.scale.set(this.boxSize.x,this.boxSize.y,this.boxSize.z),this.box.getCenter(this.mesh.position),this.add(this.mesh)}np.prototype=Object.create(zt.prototype),np.prototype.update=function(){this.box.getSize(this.boxSize),this.mesh.scale.set(this.boxSize.x,this.boxSize.y,this.boxSize.z),this.box.getCenter(this.mesh.position)};var ip=function(e){h(n,e);var t=y(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return s(this,n),(i=t.call(this))._mode=-1,i._enabled=!1,i._empty=Object.freeze([]),i._clipPlane=new vn(new at(-1,0,0),0),i._boxClipPlane=[],i._root=new zt,i._showHelper=!0,i.target=r||e.modelGroup,i.viewer=e,i.viewer.renderer.localClippingEnabled=!0,i.viewer.add(i._root),i._init(),i.mode=n.Mode.Plane,i}return A(n,[{key:"enabled",get:function(){return this._enabled},set:function(e){this._enabled=e=Boolean(e),this.mode==n.Mode.Plane&&(this._control.visible=e),this._root.visible=e,this._updateClippingPlanes()}},{key:"mode",get:function(){return this._mode},set:function(e){var t,i;if(e!==this._mode){switch(e){case n.Mode.Plane:this._control.enabled=!0,(t=this._root).remove.apply(t,C(this._root.children)),this._root.add(this._planeHelper),this.viewer.add(this._control),this._clipPlanes=[this._clipPlane],this._updateClippingPlanes();break;case n.Mode.Box:this._control.enabled=!1,this.viewer.remove(this._control),(i=this._root).remove.apply(i,C(this._root.children)),this._root.add(this._boxHelper),this._clipPlanes=this._boxClipPlane,this._updateClippingPlanes()}this._mode=e}}},{key:"showHelper",get:function(){return this._showHelper},set:function(e){(e=Boolean(e))!==this._showHelper&&(this._boxHelper.visible=e,this._planeHelper.visible=e,this._showHelper=e)}},{key:"_init",value:function(){var e=this;this.target.traverse((function(t){t.isMesh&&(Array.isArray(t.material)?t.material:[t.material]).forEach((function(t){t.clippingPlanes=e._empty}))})),this._initPlaneHelper(),this._initBoxHelper()}},{key:"_initBoxHelper",value:function(){var e=this,t=(new tn).setFromObject(this.target),i=new at;t.getSize(i),t.expandByVector(new at(i.x/100,i.y/100,i.z/100));var r=(new tn).copy(t);this._boxClipPlane.push(new vn(new at(1,0,0),-t.min.x)),this._boxClipPlane.push(new vn(new at(-1,0,0),t.max.x)),this._boxClipPlane.push(new vn(new at(0,1,0),-t.min.y)),this._boxClipPlane.push(new vn(new at(0,-1,0),t.max.y)),this._boxClipPlane.push(new vn(new at(0,0,1),-t.min.z)),this._boxClipPlane.push(new vn(new at(0,0,-1),t.max.z)),this._boxHelper=new np(t,this.color);var a,o=new Nc,s=new at,l={},A=new tt,c=new tt,h=new ut,u=!1;this.viewer.domElement.addEventListener("mousedown",(function(i){if(e.mode===n.Mode.Box&&(o.setFromCamera(If.getDomMouse(i,e.viewer.domElement),e.viewer.camera),o.ray.intersectBox(t,s))){switch(a=e._getIntersectFaceInBox(t,s),l.pageX=i.pageX,l.pageY=i.pageY,u=!0,e.viewer.controls.enabled=!1,a){case 0:h.set(1,0,0,0);break;case 1:h.set(-1,0,0,0);break;case 2:h.set(0,1,0,0);break;case 3:h.set(0,-1,0,0);break;case 4:h.set(0,0,1,0);break;case 5:h.set(0,0,-1,0)}h.applyMatrix4(e.viewer.camera.matrixWorldInverse).applyMatrix4(e.viewer.camera.projectionMatrix),A.set(-h.x,h.y)}})),this.viewer.domElement.addEventListener("mousemove",(function(h){if(e.mode===n.Mode.Box){if(c.set(h.pageX-l.pageX,h.pageY-l.pageY).normalize(),u){var d=0;switch(a){case 0:if(d=c.dot(A)*i.x/100,t.min.x-d>=r.max.x||t.min.x-d<r.min.x)break;t.min.x-=d,e._boxClipPlane[0].constant+=d;break;case 1:if(d=c.dot(A)*i.x/100,t.max.x+d>=r.max.x||t.max.x+d<r.min.x)break;t.max.x+=d,e._boxClipPlane[1].constant+=d;break;case 2:if(d=c.dot(A)*i.y/100,t.min.y-d>=r.max.y||t.min.y-d<r.min.y)break;t.min.y-=d,e._boxClipPlane[2].constant+=d;break;case 3:if(d=c.dot(A)*i.y/100,t.max.y+d>=r.max.y||t.max.y+d<r.min.y)break;t.max.y+=d,e._boxClipPlane[3].constant+=d;break;case 4:if(d=c.dot(A)*i.z/100,t.min.z-d>=r.max.z||t.min.z-d<r.min.z)break;t.min.z-=d,e._boxClipPlane[4].constant+=d;break;case 5:if(d=c.dot(A)*i.z/100,t.max.z+d>=r.max.z||t.max.z+d<r.min.z)break;t.max.z+=d,e._boxClipPlane[5].constant+=d}}else o.setFromCamera(If.getDomMouse(h,e.viewer.domElement),e.viewer.camera),e.viewer.domElement.style.cursor=o.ray.intersectBox(t,s)?"move":"default";l.pageX=h.pageX,l.pageY=h.pageY}})),this.viewer.domElement.addEventListener("mouseup",(function(){e.mode===n.Mode.Box&&(e.viewer.controls.enabled=!0,u=!1,e.viewer.domElement.style.cursor="default")}))}},{key:"_initPlaneHelper",value:function(){var e=this,t=.5*Math.PI,i=(new tn).setFromObject(this.target),r=i.getSize(new at),a=Math.max(r.x,r.y,r.z),o=new Ei(new $i(a,a),new Nn({color:16777215,side:2,opacity:.3,transparent:!0}));this._planeHelper=o,i.getCenter(this._planeHelper.position),o.renderOrder=11e3,o.rotation.y=t;var s=new Fu(this.viewer.camera,this.viewer.domElement,!0);this._control=s,s.attach(o),s.addEventListener("dragging-changed",(function(t){e.mode===n.Mode.Plane&&(e.viewer.controls.enabled=!t.value)})),s.addEventListener("objectChange",(function(r){if(e.mode===n.Mode.Plane){var a=r.target.axis;if(a){var l=o.getWorldPosition(new at),A="X"===e._axis?l.x:"Y"===e._axis?l.y:l.z;if(a!==e._axis){switch(e._axis=a,o.rotation.set(0,0,0),a){case"X":e._clipPlane.normal.set(-1,0,0),i.getCenter(o.position),o.rotation.y=t;break;case"Y":e._clipPlane.normal.set(0,-1,0),i.getCenter(o.position),o.rotation.x=t;break;case"Z":e._clipPlane.normal.set(0,0,-1),i.getCenter(o.position)}s.dragging=!1,s.pointerDown(r.pointer)}switch(a){case"X":case"Y":case"Z":e._clipPlane.constant=A}}}})),this._clipPlane.normal=new at(-1,0,0),this._clipPlane.constant=o.position.x}},{key:"_updateClippingPlanes",value:function(){var e=this;this.target.getWorldPosition(this._root.position),this.target.traverse((function(t){t.isMesh&&((Array.isArray(t.material)?t.material:[t.material]).forEach((function(t){t.clippingPlanes=e.enabled?e._clipPlanes:e._empty})),e.mode===n.Mode.Box&&e._boxHelper.update())}))}},{key:"_getIntersectFaceInBox",value:function(e,t){var n=-1,i=1/0;return Math.abs(t.x-e.max.x)<i&&(i=Math.abs(t.x-e.max.x),n=1),Math.abs(t.x-e.min.x)<i&&(i=Math.abs(t.x-e.min.x),n=0),Math.abs(t.y-e.max.y)<i&&(i=Math.abs(t.y-e.max.y),n=3),Math.abs(t.y-e.min.y)<i&&(i=Math.abs(t.y-e.min.y),n=2),Math.abs(t.z-e.max.z)<i&&(i=Math.abs(t.z-e.max.z),n=5),Math.abs(t.z-e.min.z)<i&&(i=Math.abs(t.z-e.min.z),n=4),n}}]),n}(Je);ip.Mode={Plane:0,Box:1};var rp=function(e){h(n,e);var t=y(n);function n(){var e;return s(this,n),(e=t.call(this)).boundingBox=new tn,e.boundingSphere=new an,e.name="modelGroup",e}return A(n,[{key:"add",value:function(){b(u(n.prototype),"add",this).apply(this,arguments),this.update()}},{key:"remove",value:function(){b(u(n.prototype),"remove",this).apply(this,arguments),this.update()}},{key:"update",value:function(){this.boundingBox.setFromObject(this),this.boundingBox.getBoundingSphere(this.boundingSphere)}},{key:"onAfterRender",value:function(){}}]),n}(zt),ap=new Nc,op=new tn,sp=new at,lp=function(){function e(){s(this,e)}return A(e,null,[{key:"create",value:function(t){var n=new hp(t);return e.SceneManagerArray.push(n),n}}]),e}();lp.SceneManagerArray=[];var Ap,cp,hp=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),(i=t.call(this))._backgroundVisible=!0,i._backgroundBrightness=.5,i._enableDof=!1,i._sceneData=null,i._enableShadow=!1,i._prevBackground=null,i._shadowStrength=1,i._shadowDecay=1,i._shadowOffset=0,i.icon=null,i.root=null,i.modelGroup=null,i.scene=null,i.ambientLight=null,i.directLight=null,i.lightFollow=!1,i.camera=null,i.envMapUrl=null,i.viewer=e,i.scene=new Qt,i.scene.viewer=e,i.scene.background=new Fn(15658734),i.scene.environment=new gf(i.viewer.renderManager.defaultRenderer).fromScene(new tp(e)).texture,i.root=new zt,i.root.name="root",i.scene.add(i.root),i.ambientLight=new UA(16777215,.7),i.root.add(i.ambientLight),i.directLight=new PA(16777215,.3),i.directLight.position.set(0,1,1).normalize(),i.root.add(i.directLight),i.modelGroup=new rp,i.root.add(i.modelGroup),i.mapLoader=new Kf(i.viewer),i}return A(n,[{key:"visible",get:function(){return this.root.visible},set:function(e){this.root.visible=e}},{key:"backgroundVisible",get:function(){return this._backgroundVisible},set:function(e){e?!this._backgroundVisible&&this._prevBackground&&(this.scene.background=this._prevBackground,this.viewer.renderManager.domElement.style.background="#000"):this._backgroundVisible&&(this._prevBackground=this.scene.background,this.viewer.renderManager.domElement.style.background="transparent",this.clearBackground()),this._backgroundVisible=Boolean(e)}},{key:"backgroundBrightness",get:function(){return this._backgroundBrightness},set:function(e){this._backgroundBrightness=e,this.scene.background&&(this.scene.background.brightness=2*e)}},{key:"enableClickDof",get:function(){return this._enableDof},set:function(e){if(e){if(!this.icon){var t=this.viewer.renderManager.containerRect,n=t.width,i=t.height;this.icon=new Image,this.icon.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD8AAAAwCAYAAACmCaIKAAAAAXNSR0IArs4c6QAAAT5JREFUaEPtWsENwjAMvFuHXeAHI/BjBmAFeMEK/GAoxjCKKKgfmrqiVpRcX0i9ND2f7ZrYBAAzOwHYpd8jrw3J20js7DAz2wK4ODZ6kFzRzO4AlgAOYxeTPI7FRuHMbO/YK3E9J/KWiJdIyEHGBe0MdRB5KV9gHLt82QGW26c8p4SnbF/et9sRxi6oYr4X80WVqy4ZJ4A/5TAnrK1michXI6WTiJR3GqwauJSvRkonkVDlzWwNYDHwjk+SVyeHyfBo8unUaPAiGfZOYRslxkP/IL/1tsjn/OM/96X8f+yYf4rc/sfBiWL+bZiwUAzbqJftm/3UtVvk5FNiLCLU7WOp5XcT+byN6kRI+Tp1zbNqW/mu3m6zaaEurbq06tLmU2QFCLWoNZaiIURNYBY3TztXbu0nvHYHj7uztSZHzl/kIiMOWht+IQAAAABJRU5ErkJggg==",this.icon.style.position="absolute",this.icon.style.width="30px",this.icon.style.height="30px",this.icon.style.top=i/2-15+"px",this.icon.style.left=n/2-15+"px",this.icon.style.opacity=0,this.icon.style.transition="opacity 1s",this.viewer.renderManager.container.appendChild(this.icon),this.viewer.renderManager.container.style.position="relative"}if(this._enableDof)return;this.viewer.composer.enableDof=!0,this._dofClickHandler=up.bind(this),this.viewer.renderManager.container.addEventListener("mousedown",dp),this.viewer.renderManager.container.addEventListener("mouseup",this._dofClickHandler)}else{if(!this._dofClickHandler||!this._enableDof)return;this.viewer.renderManager.container.removeEventListener("mousedown",dp),this.viewer.renderManager.container.addEventListener("mouseup",this._dofClickHandler),this._dofClickHandler=null,this.viewer.composer.enableDof=!1}this._enableDof=e}},{key:"enableShadow",get:function(){return this._enableShadow},set:function(e){this._enableShadow=Boolean(e),this.updateShadowMaterial()}},{key:"shadowStrength",get:function(){return this._shadowStrength},set:function(e){e=Math.max(0,Math.min(1,e)),this._shadowStrength=e,this.updateShadowMaterial()}},{key:"shadowDecay",get:function(){return this._shadowDecay},set:function(e){this._shadowDecay=e,this.updateShadowMaterial()}},{key:"shadowOffset",get:function(){return this._shadowOffset},set:function(e){this._shadowOffset=e,this.updateShadowMaterial()}},{key:"getEnvMap",value:function(){return this.envMapUrl?this.modelGroup.children[0].envMap:""}},{key:"setEnvMap",value:function(e,t,n){var i=!0;this.modelGroup.children.map((function(r){r.isModel&&r.setEnvMap(e,(function(){t&&i&&(i=!1,t())}),n)})),this.envMapUrl=e?e.isTexture?e.image.src:e:null}},{key:"getEnvMapRotation",value:function(){return this.envMapRotation||0}},{key:"setEnvMapRotation",value:function(e){this.modelGroup.children.map((function(t){t.isModel&&t.setEnvMapRotation(e)})),this.envMapRotation=e}},{key:"getEnvMapIntensity",value:function(){return null==this.envMapIntensity||null==this.envMapIntensity?.7:this.envMapIntensity}},{key:"setEnvMapIntensity",value:function(e){null==e||null==e?(e=.7,this.modelGroup.children.map((function(t){t.isModel&&t.setEnvMapIntensity(e)}))):(this.modelGroup.children.map((function(t){t.isModel&&t.setEnvMapIntensity(e)})),this.envMapIntensity=e)}},{key:"setSkyBox",value:function(e,t){var n=this;if(void 0!==e&&""!==e&&null!==e)if(e.isWebGLRenderTarget)this.scene.background=e;else var i=this.mapLoader.load(e,(function(r){if(r.constructor===hr)n.scene.background=r;else{i.constructor===Nh?(r.wrapS=r.wrapT=1001,r.mapping=EquirectangularReflectionMapping):r.mapping=O;var a={generateMipmaps:!0,minFilter:q,magFilter:Z};n.scene.background=new Gi(1024,1024,a).fromEquirectangularTexture(n.viewer.renderManager.defaultRenderer,r)}n.scene.background.sky=e,n.scene.background._texture=r,t&&t()}));else this.scene.background=null}},{key:"setBackground",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e&&(0===e.indexOf("#")?(this.scene.background=(new Fn).setStyle(e),t&&t()):(new tA).setPath(i).load(e,(function(e){e.minFilter=Z,n.scene.background=e,t&&t()})))}},{key:"clearBackground",value:function(){this.scene.background=null,this.viewer.renderManager.render()}},{key:"setLightness",value:function(e){this.ambientLight.intensity=e,this.viewer.renderManager.render()}},{key:"getLightness",value:function(){return this.ambientLight.intensity}},{key:"getLightColor",value:function(){return"#"+this.ambientLight.color.getHexString()}},{key:"setLightColor",value:function(e){this.ambientLight.color.setStyle(e),this.viewer.renderManager.render()}},{key:"setDirectLightLightness",value:function(e){this.directLight.intensity=e,this.viewer.renderManager.render()}},{key:"getDirectLightLightness",value:function(){return this.directLight.intensity}},{key:"getDirectLightColor",value:function(){return"#"+this.directLight.color.getHexString()}},{key:"setDirectLightPosition",value:function(e,t,n){e.isVector3?this.directLight.position.copy(e):(void 0!==e&&(this.directLight.position.x=e),void 0!==t&&(this.directLight.position.y=t),void 0!==n&&(this.directLight.position.z=n)),this.viewer.renderManager.render(),this.enableShadow&&this.updateShadowMaterial()}},{key:"getDirectLightPosition",value:function(){return this.directLight.position}},{key:"setDirectLightColor",value:function(e){this.directLight.color.setStyle(e),this.viewer.renderManager.render()}},{key:"addSpotLight",value:function(e){if(e.position){var t=new _A(e.color||16777215,e.intensity||1,e.distance||100,e.angle||Math.PI/8,e.penumbra||.5,e.decay||.5);return Array.isArray(e.position)?t.position.fromArray(e.position):t.position.copy(e.position),e.target&&(t.target=e.target),this.root.add(t),t}console.warn("addSpotLight需要指定position")}},{key:"saveSceneData",value:function(){var e={};e.a={aa:this.getLightColor(),ab:this.getLightness()},e.b={ba:this.getDirectLightColor(),bb:this.getDirectLightLightness()},this.lightFollow||(e.b.bc=this.directLight.position.toArray()),e.b.bv=this.directLight.visible;var t=this.scene.background||this._prevBackground;return t&&(t.sky?(e.c=1,e.ca=t.sky,e.cb=this.backgroundBrightness):t.isTexture?(e.c=2,e.ca=[t.image.src,t.image.src].join(",")):t.isColor&&(e.c=2,e.ca="#"+t.getHexString())),this.envMapUrl&&(e.e=this.envMapUrl,e.ea=this.envMapRotation||0,e.ei=this.envMapIntensity),e.v=Boolean(this.backgroundVisible),e.u={v:!1,s:0,r:0},this.viewer.composer.enableUnrealBloom&&(e.u.v=!0,e.u.s=this.viewer.composer.unrealBloom.getStrength(),e.u.r=this.viewer.composer.unrealBloom.getRadius(),e.u.t=this.viewer.composer.unrealBloom.getThreshold(),this.viewer.composer.unrealBloom._lastSelected&&this.viewer.composer.unrealBloom._lastSelected.isMesh&&(e.u.o=this.viewer.composer.unrealBloom._objects.map((function(e){return e.ID})))),e.k={v:!1,h:0,s:0,b:0},this.viewer.composer.enableColorAdjustment&&(e.k.v=!0,e.k.h=this.viewer.composer.colorAdjustment.getHue(),e.k.s=this.viewer.composer.colorAdjustment.getContrast(),e.k.b=this.viewer.composer.colorAdjustment.getVibrance()),e.f={v:!1,a:0,b:0},this.viewer.composer.enableDof&&(e.f.v=!0,e.f.a=this.viewer.composer.dof.aperture,e.f.b=this.viewer.composer.dof.maxblur),e.s={v:!1,r:0,s:0},this.viewer.composer.enableSSAO&&(e.s.v=!0,e.s.r=this.viewer.composer.ssao.getRadius(),e.s.s=this.viewer.composer.ssao.getStrength()),e.g={v:!1,d:0,o:0},this.viewer.composer.enableVignette&&(e.g.v=!0,e.g.d=this.viewer.composer.vignette.getDarkness(),e.g.o=this.viewer.composer.vignette.getOffset()),e.q={v:!1,c:[],r:[],d:0,o:1},this.viewer.composer.enableSSR&&(e.q.v=!0,e.q.c=this.viewer.composer.ssr.objects.map((function(e){return e.ID})),e.q.r=this.viewer.composer.ssr.planeObjects.map((function(e){return e.ID})),e.q.d=this.viewer.composer.ssr.maxDistance,e.q.o=this.viewer.composer.ssr.opacity),e}},{key:"loadSceneData",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,r=void 0===n.background||n.background,a=n.localPath||"";e=JSON.parse(e);var o=Boolean(e.v)||void 0===e.v;return this._data=e,r?(this.setLightColor(e.a.aa),this.setLightness(e.a.ab),this.setDirectLightColor(e.b.ba),this.setDirectLightLightness(e.b.bb),Array.isArray(e.b.bc)?this.directLight.position.fromArray(e.b.bc):this.lightFollow=!0,!1===e.b.bv&&(this.directLight.visible=!1),1==e.c&&this.setSkyBox(a+e.ca,(function(){t.backgroundVisible=o,t.backgroundBrightness=e.cb||.5,i&&i(e)})),2==e.c&&(Array.isArray(e.ca)||(e.ca=e.ca.split(",")),1==e.ca.length?(this.setBackground(e.ca[0]),e.ca=e.ca[0],this.backgroundVisible=o,i&&i(e)):2==e.ca.length&&(If.isMobile?this.setBackground(e.ca[1]+"?time="+Date.now(),(function(){t.backgroundVisible=o,i&&i(e)}),a):this.setBackground(e.ca[0]+"?time="+Date.now(),(function(){t.backgroundVisible=o,i&&i(e)}),a)))):i&&i(e),e}},{key:"loadSceneFile",value:function(e,t){var n=this;(new Kl).load(e,(function(e){n.loadSceneData(e,t,(function(e){n._sceneData=e,t.onLoad&&t.onLoad(e)}))}))}},{key:"loadPostProcessing",value:function(e){var t=this,n=this._sceneData;if(n)return n.k&&n.k.v&&(this.viewer.composer.enableColorAdjustment=!0,this.viewer.composer.colorAdjustment.setHue(n.k.h),this.viewer.composer.colorAdjustment.setContrast(n.k.s),this.viewer.composer.colorAdjustment.setVibrance(n.k.b)),n.f&&n.f.v&&(this.viewer.composer.enableDof=!0,this.viewer.composer.dof.setAperture(n.f.a),this.viewer.composer.dof.setMaxblur(n.f.b),this.enableClickDof=!0),n.s&&n.s.v&&(this.viewer.composer.enableSSAO=!0,this.viewer.composer.ssao.setStrength(n.s.s),this.viewer.composer.ssao.setRadius(n.s.r)),n.u&&n.u.v&&(this.viewer.composer.enableUnrealBloom=!0,this.viewer.composer.unrealBloom.setStrength(n.u.s),this.viewer.composer.unrealBloom.setRadius(n.u.r),this.viewer.composer.unrealBloom.setThreshold(n.u.t),n.u.o?n.u.o.map((function(n){return t.viewer.composer.unrealBloom.add(e.getObjectByID(n))})):this.viewer.composer.unrealBloom.add(e)),n.g&&n.g.v&&(this.viewer.composer.enableVignette=!0,this.viewer.composer.vignette.setDarkness(n.g.d),this.viewer.composer.vignette.setOffset(n.g.o)),n.q&&n.q.v&&(this.viewer.composer.enableSSR=!0,n.q.c&&n.q.c.length>0&&n.q.c.map((function(n){return t.viewer.composer.ssr.addObject(e.getObjectByID(n))})),n.q.r&&n.q.r.length>0&&n.q.r.map((function(n){return t.viewer.composer.ssr.addPlane(e.getObjectByID(n))})),this.viewer.composer.ssr.maxDistance=n.q.d,this.viewer.composer.ssr.opacity=n.q.o),{colorAdjustment:this.viewer.composer.enableColorAdjustment,dof:this.viewer.composer.enableDof,ssao:this.viewer.composer.enableSSAO,unrealBloom:this.viewer.composer.enableUnrealBloom}}},{key:"hidePostprocessing",value:function(){this.viewer.composer.enableUnrealBloom=!1,this.viewer.composer.enableColorAdjustment=!1,this.viewer.composer.enableDof=!1,this.viewer.composer.enableSSAO=!1,this.viewer.composer.enableVignette=!1,this.enableClickDof=!1}},{key:"showFog",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#ffffff",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3;this.scene.fog=new to(e,t,n)}},{key:"showFogExp",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#ffffff",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;t*=5e-5,this.scene.fog=new eo(e,t)}},{key:"setFogDensity",value:function(e){this.scene.fog&&(this.scene.fog.density=5e-5*e)}},{key:"clearFog",value:function(){this.scene.fog=null}},{key:"showGridHelp",value:function(e,t,n){this.gridHelp?this.gridHelp.visible=!0:(this.gridHelp=new ph(e,t,n,n),this.root.add(this.gridHelp))}},{key:"hideGridHelp",value:function(){this.gridHelp&&(this.gridHelp.visible=!1)}},{key:"showAxesHelper",value:function(e){if(this.axesHelper&&this.root.remove(this.axesHelper),!e){var t=(new tn).setFromObject(this.modelGroup);e=Math.max(t.getSize().x,t.getSize().y,t.getSize().z)}this.axesHelper=new Oh(e),this.root.add(this.axesHelper)}},{key:"hideAxesHelper",value:function(){this.axesHelper&&this.root.remove(this.axesHelper)}},{key:"fitCamera",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.modelGroup,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;n&&n.isBox3?e=n:(e=new tn).expandByObject(t);var i=e.getCenter(new at);t===this.modelGroup&&(t.translateX(-i.x),t.translateY(-i.y),t.translateZ(-i.z),i.x=i.y=i.z=0),this.modelGroup.traverse((function(e){e._shadow&&(t.updateMatrixWorld(),t.matrixWorld.decompose(e._shadow.parent.position,e._shadow.parent.quaternion,e._shadow.parent.scale))}));var r=1.5,a=.8,o=.05,s=this.viewer.renderManager.container.getBoundingClientRect();s.width<s.height&&(r=2);var l=e.getSize(new at),A=Math.max(l.x,l.y,l.z),c=this.camera.fov*(Math.PI/180),h=Math.abs(A/(2*Math.tan(c/2))),u=Math.min(l.x,l.y,l.z);this.camera.near=u*o,20*A>this.camera.far&&(this.camera.far=20*A),this.camera.far<5e3&&(this.camera.far=5e3),this.camera.near<.01&&(this.camera.near=.01),this.camera.defaultPos.copy(this.camera.position);var d=new at(i.x,i.y+h*a,i.z+h*r);this.camera.controller?(this.camera.controller.setPosition(d.x,d.y,d.z),this.camera.controller.setTarget(i.x,i.y,i.z)):(this.camera.position.z=d.z,this.camera.position.y=d.y,this.camera.lookAt(i.x,i.y,i.z)),this.camera.updateProjectionMatrix()}},{key:"dispose",value:function(){this.scene.traverse((function(e){e.isMesh&&(e.geometry&&e.geometry.dispose(),(Array.isArray(e.material)?e.material:[e.material]).forEach((function(e){e.map&&e.map.dispose(),e.dispose()})))})),this.scene.background&&this.scene.background.dispose&&this.scene.background.dispose(),this.scene.dispose(),this.scene.background=null}},{key:"updateShadowMaterial",value:function(){var e=this;op.setFromObject(this.modelGroup);var t=new ut(0,-1,0,-op.min.y+this.shadowOffset),n=this.shadowDecay,i=this.shadowStrength;this.modelGroup.traverse((function(r){r.isModel&&(e._enableShadow?(op.setFromObject(r),r.shadowMaterial?(r.shadowMaterial.lightDirection.copy((new at).sub(e.directLight.position)),r.shadowMaterial.shadowPlane=t,r.shadowMaterial.shadowLength=op.getSize(sp).length()*n,r.shadowMaterial.shadowStrength=i,op.getCenter(r.shadowMaterial.center)):r.shadowMaterial=new Sl({lightDirection:(new at).sub(e.directLight.position),shadowPlane:t,shadowLength:op.getSize(sp).length()*n,color:new Fn(0),shadowStrength:i,center:op.getCenter(sp)})):r.shadowMaterial=null)}))}}]),n}(Je);function up(e){var t=this;if(cp&&!(Date.now()-cp>200)){var n=e.offsetX,i=e.offsetY;this.icon.style.left=n-15+"px",this.icon.style.top=i-15+"px",this.icon.style.opacity=1,this.icon.style["-webkit-user-drag"]="none",Ap&&clearTimeout(Ap),Ap=setTimeout((function(){return t.icon.style.opacity=0}),1e3);var r=If.getDomMouse(e,this.viewer.domElement);ap.setFromCamera(r,this.viewer.renderManager.camera);var a=ap.intersectObject(this.modelGroup,!0);if(a[0]){var o=a[0].distance;this.viewer.composer.dof.setFocus(o)}}}function dp(e){cp=Date.now()}function fp(e){this.viewer=e;var t=this.object=e.camera;this.domElement=void 0!==e.renderer.domElement?e.renderer.domElement:document,this.enabled=!0,this.target=new at,this._minDistance=0,this.minDistance=0,this._maxDistance=1/0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this._minPolarAngle=0,this._maxPolarAngle=Math.PI,this._minAzimuthAngle=-1/0,this._maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this._enableZoom=!0,this.zoomSpeed=1,this._enableRotate=!0,this.rotateSpeed=1,this._enablePan=!0,this.leftPan=!1,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!1,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:_.LEFT,MIDDLE:_.MIDDLE,RIGHT:_.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._rotateLeft=function(e){C(e)},this._rotateUp=function(e){B(e)},this.panLeft=function(e){S(e,n.object.matrix)},this.panRight=function(e){S(-e,n.object.matrix)},this.panUp=function(e){T(e,n.object.matrix)},this.panDown=function(e){T(-e,n.object.matrix)},this.dollyIn=function(t){L(t,!0),e.renderManager.render()},this.dollyOut=function(t){F(t,!0),e.renderManager.render()},this.zoom=function(e){e<0?F(M()):e>0&&L(M()),n._update()},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){u.set(0,0,0),n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(i),n._update(),s=o.NONE},this._update=function(){var e=new at,r=(new nt).setFromUnitVectors(t.up,new at(0,1,0)),a=r.clone().inverse(),f=new at,p=new nt;return function(){n.cachePosition&&(n.setPosition(n.cachePosition.x,n.cachePosition.y,n.cachePosition.z),n.cachePosition=null),n.cacheTarget&&(n.setTarget(n.cacheTarget.x,n.cacheTarget.y,n.cacheTarget.z),n.cacheTarget=null);var t=n.object.position;e.copy(t).sub(n.target),e.applyQuaternion(r),A.setFromVector3(e),n.autoRotate&&s===o.NONE&&C(2*Math.PI/60/60*n.autoRotateSpeed),A.theta+=c.theta,A.phi+=c.phi,A.theta=Math.max(n._minAzimuthAngle,Math.min(n._maxAzimuthAngle,A.theta)),A.phi=Math.max(n._minPolarAngle,Math.min(n._maxPolarAngle,A.phi)),A.makeSafe(),A.radius*=h,A.radius=Math.max(n.minDistance,Math.min(n.maxDistance,A.radius)),n.target.add(u),e.setFromSpherical(A),e.applyQuaternion(a),t.equals(n.target.clone().add(e))||t.copy(n.target).add(e),n.object.lookAt(n.target);var m=!1;return u.equals(new at)||(m=!0),!0===n.enableDamping?(c.theta*=1-n.dampingFactor,c.phi*=1-n.dampingFactor,u.multiplyScalar(1-n.dampingFactor)):(c.set(0,0,0),u.set(0,0,0)),h=1,!!(d||f.distanceToSquared(n.object.position)>l||8*(1-p.dot(n.object.quaternion))>l)&&(m?i.data="pan":delete i.data,n.dispatchEvent(i),f.copy(n.object.position),p.copy(n.object.quaternion),d=!1,!0)}}(),this.computePosition=function(e,t,i,r){var a=(new nt).setFromUnitVectors(n.object.up,new at(0,1,0)),o=a.clone().inverse(),s=new at;return s.copy(e).sub(t),s.applyQuaternion(a),A.setFromVector3(s),void 0!==i?A.theta=i:A.theta+=c.theta,void 0!==r?A.phi=r:A.phi+=c.phi,A.theta=Math.max(n._minAzimuthAngle,Math.min(n._maxAzimuthAngle,A.theta)),A.phi=Math.max(n._minPolarAngle,Math.min(n._maxPolarAngle,A.phi)),A.makeSafe(),A.radius*=h,A.radius=Math.max(n.minDistance,Math.min(n.maxDistance,A.radius)),s.setFromSpherical(A),s.applyQuaternion(o),e.copy(t).add(s),e},this.dispose=function(){n.domElement.removeEventListener("contextmenu",G,!1),n.domElement.removeEventListener("mousedown",P,!1),n.domElement.removeEventListener("wheel",R,!1),n.domElement.removeEventListener("touchstart",N,!1),n.domElement.removeEventListener("touchend",Q,!1),n.domElement.removeEventListener("touchmove",z,!1),document.removeEventListener("mousemove",U,!1),document.removeEventListener("mouseup",D,!1),window.removeEventListener("keydown",O,!1)};var n=this,i={type:"change"},r={type:"start"},a={type:"end"},o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY_PAN:4},s=o.NONE,l=1e-6,A=new Gc,c=new Gc;this.sphericalDelta=c;var h=1,u=new at,d=!1,f=new tt,p=new tt,m=new tt,v=new tt,g=new tt,y=new tt,w=new tt,x=new tt,b=new tt;function M(){return Math.pow(.95,n.zoomSpeed)}function C(t){c.theta-=t,e.renderManager.render()}function B(t){c.phi-=t,e.renderManager.render()}this.spherical=A;var E,S=function(){var t=new at;return function(n,i){t.setFromMatrixColumn(i,0),t.multiplyScalar(-n),u.add(t),e.renderManager.render()}}(),T=function(){var t=new at;return function(i,r){!0===n.screenSpacePanning?t.setFromMatrixColumn(r,1):(t.setFromMatrixColumn(r,0),t.crossVectors(n.object.up,t)),t.multiplyScalar(i),u.add(t),e.renderManager.render()}}(),I=(E=new at,function(e,t){var i=n.domElement===document?n.domElement.body:n.domElement;if(n.object.isPerspectiveCamera){var r=n.object.position;E.copy(r).sub(n.target);var a=E.length();a*=Math.tan(n.object.fov/2*Math.PI/180),S(2*e*a/i.clientHeight,n.object.matrix),T(2*t*a/i.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(S(e*(n.object.right-n.object.left)/n.object.zoom/i.clientWidth,n.object.matrix),T(t*(n.object.top-n.object.bottom)/n.object.zoom/i.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n._enablePan=!1)});function L(e,t){n.object.isPerspectiveCamera?t?h=e:h/=e:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom*e)),n.object.updateProjectionMatrix(),d=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n._enableZoom=!1)}function F(e,t){n.object.isPerspectiveCamera?t?h=e:h*=e:n.object.isOrthographicCamera?(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/e)),n.object.updateProjectionMatrix(),d=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n._enableZoom=!1)}function k(e){v.set(e.clientX,e.clientY)}function P(e){if(!1!==n.enabled){switch(e.preventDefault(),n.domElement.focus?n.domElement.focus():window.focus(),e.button){case n.mouseButtons.LEFT:if(e.ctrlKey||e.metaKey||e.shiftKey||n.leftPan){if(!1===n._enablePan)return;k(e),s=o.PAN}else{if(!1===n._enableRotate)return;!function(e){f.set(e.clientX,e.clientY)}(e),s=o.ROTATE}break;case n.mouseButtons.MIDDLE:if(!1===n._enableZoom)return;!function(e){w.set(e.clientX,e.clientY)}(e),s=o.DOLLY;break;case n.mouseButtons.RIGHT:if(!1===n._enablePan)return;k(e),s=o.PAN}s!==o.NONE&&(document.addEventListener("mousemove",U,!1),document.addEventListener("mouseup",D,!1),n.dispatchEvent(r))}}function U(e){if(!1!==n.enabled)switch(e.preventDefault(),s){case o.ROTATE:if(!1===n._enableRotate)return;!function(e){p.set(e.clientX,e.clientY),m.subVectors(p,f).multiplyScalar(n.rotateSpeed);var t=n.domElement===document?n.domElement.body:n.domElement;C(2*Math.PI*m.x/t.clientHeight),B(2*Math.PI*m.y/t.clientHeight),f.copy(p),n._update()}(e);break;case o.DOLLY:if(!1===n._enableZoom)return;!function(e){x.set(e.clientX,e.clientY),b.subVectors(x,w),b.y>0?L(M()):b.y<0&&F(M()),w.copy(x),n._update()}(e);break;case o.PAN:if(!1===n._enablePan)return;!function(e){g.set(e.clientX,e.clientY),y.subVectors(g,v).multiplyScalar(n.panSpeed),I(y.x,y.y),v.copy(g),n._update()}(e)}}function D(e){!1!==n.enabled&&(document.removeEventListener("mousemove",U,!1),document.removeEventListener("mouseup",D,!1),n.dispatchEvent(a),s=o.NONE)}function R(e){!1===n.enabled||!1===n._enableZoom||s!==o.NONE&&s!==o.ROTATE||(e.preventDefault(),n.dispatchEvent(r),function(e){e.deltaY<0?F(M()):e.deltaY>0&&L(M()),n._update()}(e),n.dispatchEvent(a))}function O(e){!1!==n.enabled&&!1!==n.enableKeys&&!1!==n._enablePan&&function(e){var t=!1;switch(e.keyCode){case n.keys.UP:I(0,n.keyPanSpeed),t=!0;break;case n.keys.BOTTOM:I(0,-n.keyPanSpeed),t=!0;break;case n.keys.LEFT:I(n.keyPanSpeed,0),t=!0;break;case n.keys.RIGHT:I(-n.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),n._update())}(e)}function N(e){if(!1!==n.enabled){switch(e.preventDefault(),e.touches.length){case 1:if(!1===n._enableRotate)return;!function(e){f.set(e.touches[0].pageX,e.touches[0].pageY)}(e),s=o.TOUCH_ROTATE;break;case 2:if(!1===n._enableZoom&&!1===n._enablePan)return;!function(e){if(n._enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,i=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+i*i);w.set(0,r)}if(n._enablePan){var a=.5*(e.touches[0].pageX+e.touches[1].pageX),o=.5*(e.touches[0].pageY+e.touches[1].pageY);v.set(a,o)}}(e),s=o.TOUCH_DOLLY_PAN;break;default:s=o.NONE}s!==o.NONE&&n.dispatchEvent(r)}}function z(e){if(!1!==n.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===n._enableRotate)return;if(s!==o.TOUCH_ROTATE)return;!function(e){p.set(e.touches[0].pageX,e.touches[0].pageY),m.subVectors(p,f).multiplyScalar(n.rotateSpeed);var t=n.domElement===document?n.domElement.body:n.domElement;C(2*Math.PI*m.x/t.clientHeight),B(2*Math.PI*m.y/t.clientHeight),f.copy(p),n._update()}(e);break;case 2:if(!1===n._enableZoom&&!1===n._enablePan)return;if(s!==o.TOUCH_DOLLY_PAN)return;!function(e){if(n._enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,i=e.touches[0].pageY-e.touches[1].pageY,r=Math.sqrt(t*t+i*i);x.set(0,r),b.set(0,Math.pow(x.y/w.y,n.zoomSpeed)),L(b.y),w.copy(x)}if(n._enablePan){var a=.5*(e.touches[0].pageX+e.touches[1].pageX),o=.5*(e.touches[0].pageY+e.touches[1].pageY);g.set(a,o),y.subVectors(g,v).multiplyScalar(n.panSpeed),I(y.x,y.y),v.copy(g)}n._update()}(e);break;default:s=o.NONE}}function Q(e){s=o.NONE,!1!==n.enabled&&(n.dispatchEvent(a),s=o.NONE)}function G(e){!1!==n.enabled&&e.preventDefault()}n.domElement.addEventListener("contextmenu",G,!1),n.domElement.addEventListener("mousedown",P,!1),n.domElement.addEventListener("wheel",R,!1),n.domElement.addEventListener("touchstart",N,!1),n.domElement.addEventListener("touchend",Q,!1),n.domElement.addEventListener("touchmove",z,!1),window.addEventListener("keydown",O,!1),this._update()}fp.prototype=Object.create(Je.prototype),fp.prototype.constructor=fp,Object.defineProperties(fp.prototype,{center:{get:function(){return console.warn("OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this._enableZoom},set:function(e){console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this._enableZoom=!e}},noRotate:{get:function(){return console.warn("OrbitControls: .noRotate has been deprecated. Use ._enableRotate instead."),!this._enableRotate},set:function(e){console.warn("OrbitControls: .noRotate has been deprecated. Use ._enableRotate instead."),this._enableRotate=!e}},noPan:{get:function(){return console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}},minDistance:{set:function(e){isNaN(e)&&(e=0),this._minDistance=e},get:function(){return isNaN(this._minDistance)&&(this._minDistance=0),this._minDistance}},maxDistance:{set:function(e){isNaN(e)&&(e=1/0),this._maxDistance=e},get:function(){return isNaN(this._maxDistance)&&(this._maxDistance=1/0),this._maxDistance}}});var pp={TOP:"top",NORMAL:"normal",MAP:"map",ROAM_FREE:"roam_free",ROAM_AUTO:"roam_auto",ORBIT:"orbit",GLOBE:"globe",PLANAR:"planar",FLY:"fly",DRIVE:"drive"},mp=function(e){h(n,e);var t=y(n);function n(e,i,r,a){var o;return s(this,n),(o=t.call(this)).object=e,o.camera=i,o.tween=r,o.controls=a,o}return A(n,[{key:"setCameraFloor",value:function(e){this.cameraPos=this.camera.position.clone(),this.controls.enabled=!1,e&&(e.z*=-1,this.camera.position.copy(e)),this.camera.lookAt(new at),this.object.add(this.camera)}},{key:"stopCameraFloor",value:function(){this.controls.enabled=!0,this.camera.parent==this.object&&this.object.remove(this.camera),this.cameraPos&&this.camera.position.copy(this.cameraPos)}},{key:"stopMoving",value:function(){this.tween.stop(),this.stopCameraFloor()}}]),n}(Je),vp={type:ld.CHANGE},gp={type:"move"},yp=function(e){h(n,e);var t=y(n);function n(e){var i,r,a;return s(this,n),(a=t.call(this,e))._viewMode=pp.NORMAL,a._rotateTween=null,a.viewer=e,a.object=e.camera,a.camera=e.camera,e.camera.controller=v(a),b((i=v(a),u(n.prototype)),"addEventListener",i).call(i,"change",(function(){return a.dispatchEvent(gp)})),b((r=v(a),u(n.prototype)),"addEventListener",r).call(r,"end",(function(){return a.dispatchEvent(vp)})),a}return A(n,[{key:"viewMode",get:function(){return this._viewMode},set:function(e){this._viewMode=e,this.dispatchEvent({type:"view_change",data:e})}},{key:"getView",value:function(){return{position:this.object.position.toArray(),target:this.target.toArray()}}},{key:"setView",value:function(e){void 0!==e&&(void 0!==e.position&&(Array.isArray(e.position)?this.object.position.fromArray(e.position):this.object.position.copy(e.position)),void 0!==e.target&&this.target&&(Array.isArray(e.position)?this.target.fromArray(e.target):this.target.copy(e.target))),this.viewer.renderManager.render(!0)}},{key:"enablePan",get:function(){return this._enablePan},set:function(e){this._enablePan=e}},{key:"enableRotate",get:function(){return this._enableRotate},set:function(e){this._enableRotate=e}},{key:"enableZoom",get:function(){return this._enableZoom},set:function(e){this._enableZoom=e}},{key:"maxPolarAngle",get:function(){return this._maxPolarAngle/(Math.PI/180)},set:function(e){this._maxPolarAngle=Math.PI/180*e}},{key:"minPolarAngle",get:function(){return this._minPolarAngle/(Math.PI/180)},set:function(e){this._minPolarAngle=Math.PI/180*e}},{key:"maxAzimuthAngle",get:function(){return this._maxAzimuthAngle/(Math.PI/180)},set:function(e){this._maxAzimuthAngle=Math.PI/180*e}},{key:"minAzimuthAngle",get:function(){return this._minAzimuthAngle/(Math.PI/180)},set:function(e){this._minAzimuthAngle=Math.PI/180*e}},{key:"flyTo",value:function(e){var t,n,i=this,r=[ud.Easing.Linear.None,ud.Easing.Quadratic.InOut,ud.Easing.Quadratic.Out,ud.Easing.Cubic.InOut,ud.Easing.Cubic.Out,ud.Easing.Sinusoidal.InOut,ud.Easing.Sinusoidal.Out,ud.Easing.Exponential.InOut,ud.Easing.Exponential.Out,ud.Easing.Circular.InOut,ud.Easing.Circular.Out,ud.Easing.Elastic.InOut,ud.Easing.Elastic.Out,ud.Easing.Back.InOut,ud.Easing.Back.Out,ud.Easing.Bounce.InOut,ud.Easing.Bounce.Out],a=e&&e.type?r[e.type]:r[10];if(void 0!==(e=e||{}).position&&(t=Array.isArray(e.position)?(new at).fromArray(e.position):(new at).copy(e.position)),void 0!==e.target&&(n=Array.isArray(e.target)?(new at).fromArray(e.target):(new at).copy(e.target)),e.object&&(e.object.isObject3D||e.object.isMesh)&&(n=e.object.parent.localToWorld(e.object.position.clone()),t=this._fitCamera(e.object).add(n),e.yAngle&&(t.x=0,t.applyAxisAngle(new at(0,1,0),Math.PI/180*e.yAngle).add(n)),e.xAngle)){var o=this._fitCamera(e.object).add(n);o.applyAxisAngle(new at(1,0,0),Math.PI/180*e.xAngle*-1),t.copy(o),e.yAngle&&(t.x=0,t.applyAxisAngle(new at(0,1,0),Math.PI/180*e.yAngle).add(n))}if(t){if(this.viewer.firstPersonControls.enabled&&this.object.isCamera){var s=this.object.getWorldPosition(),l=this.object.getWorldDirection();this.target=s.clone().addScaledVector(l,10)}n&&n.distanceTo(this.target)>0&&new ud.Tween(this.target).easing(a).to(n,e.time+100||600).onUpdate((function(){i.object.lookAt(i.target)})).start(),new ud.Tween(this.object.position).easing(a).to(t,e.time||500).onUpdate((function(){i._dispatchEvent(vp)})).onComplete((function(){e.complete&&e.complete()})).start()}}},{key:"fit",value:function(e){if(e.isMesh||e.isObject3D){this.viewer.renderManager.render(!0);var t=e.parent.localToWorld(e.position.clone()),n=this._fitCamera(e).add(t);this.object.position.copy(n),this.target.copy(t),this._dispatchEvent(vp)}}},{key:"setPosition",value:function(e,t,n){this.object.position.set(e,t,n),this._dispatchEvent(vp)}},{key:"setTarget",value:function(e,t,n){this.target.set(e,t,n),this._dispatchEvent(vp)}},{key:"moveForward",value:function(e){var t=new at;this.object.getWorldDirection(t),this.object.position.add(t.multiplyScalar(e)),this._dispatchEvent(vp)}},{key:"moveBackward",value:function(e){var t=new at;this.object.getWorldDirection(t),this.object.position.add(t.multiplyScalar(-e)),this._dispatchEvent(vp)}},{key:"moveLeft",value:function(e){this.panLeft(e)}},{key:"moveRight",value:function(e){this.panRight(e)}},{key:"moveUp",value:function(e){this.panUp(e)}},{key:"moveDown",value:function(e){this.panDown(e)}},{key:"rotateLeft",value:function(e){e=Math.PI/180*e,this._rotateLeft(e)}},{key:"rotateUp",value:function(e){e=Math.PI/180*e,this._rotateUp(e)}},{key:"zoomIn",value:function(){this.zoom(-1)}},{key:"zoomOut",value:function(){this.zoom(1)}},{key:"rotateAround",value:function(e){var t,n=this,i=e.target,r=e.object;r&&(r.isMesh||r.isObject3D)?t=r.parent.localToWorld(r.position.clone()):i&&void 0!==i.x&&void 0!==i.y&&void 0!==i.z&&(t=(new at).copy(i)),this.stopRotateAround();var a=function(){if(e.yAngle){var t=0,i={angle:0};n._rotateTween=new ud.Tween(i).to({angle:e.yAngle},e.time).onUpdate((function(){n.rotateLeft(i.angle-t),t=i.angle})).start().repeat(e.loop||1)}if(e.xAngle){var r=0,a={angle:0};n._rotateTween=new ud.Tween(a).to({angle:e.xAngle},e.time).onUpdate((function(){n.rotateUp(a.angle-r),r=a.angle})).start().repeat(e.loop||1)}};t.distanceTo(this.target)>0?new ud.Tween(this.target).to(t,500).onUpdate((function(){n.object.lookAt(n.target),n._dispatchEvent(vp)})).onComplete((function(){a()})).start():a()}},{key:"stopRotateAround",value:function(){this._rotateTween&&this._rotateTween.stop()}},{key:"movePath",value:function(e){var t,n=[];e.path.forEach((function(e){n.push((new at).copy(e))}));var i=new cA(n);i.curveType="catmullrom",i.tension=0,i.getPoints(50);var r,a={t:0},o=new at,s=new ud.Tween(a).to({t:1},e.time).onUpdate((function(){var t=new at;i.getPoint(a.t,t),o.copy(t),r&&i.getPoint(a.t+.01,o),r=a.t,e.object.lookAt(o.clone()),e.object.position.copy(t.clone())})).onComplete((function(){t.stopCameraFloor()})).repeat(e.loop||1).start();return t=new mp(e.object,this.object,s,this)}},{key:"_fitCamera",value:function(e){var t=new tn;t.makeEmpty(),t.expandByObject(e);var n=1.5;this.viewer.containerRect.width<this.viewer.containerRect.height&&(n=2);var i=new at,r=t.getSize(new at),a=Math.max(r.x,r.y,r.z),o=this.object.fov*(Math.PI/180),s=Math.abs(a/(2*Math.tan(o/2)));return i.z=s*n,i.y=.5*s,i}},{key:"update",value:function(){this.enabled&&this._update()}},{key:"_dispatchEvent",value:function(e){this.dispatchEvent(e)}},{key:"switchToOrthoCamera",value:function(){var e=(new tn).setFromObject(this.viewer.modelGroup).getCenter(new at),t=this.viewer.camera,n=2*t.position.distanceTo(e)*Math.atan(t.fov*(Math.PI/180)/2),i=n*t.aspect,r=new FA(i/-2,i/2,n/2,n/-2,t.near,t.far);r.position.copy(t.position),r.quaternion.copy(t.quaternion),r.up.copy(t.up),r.updateProjectionMatrix(),this.object=r,this._viewMode=pp.TOP,this.enabled=!0,this.enableRotate=!0,this.update(),this.viewer.renderManager.setCamera(r),this.viewer.renderManager.render()}},{key:"switchToPerspectiveCamera",value:function(){var e=(new tn).setFromObject(this.viewer.modelGroup).getCenter(new at),t=this.object,n=this.viewer.camera,i=t.getWorldDirection(new at),r=t.position.distanceTo(e),a=t.zoom,o=e.clone().addScaledVector(i,-r/a);n.position.copy(o),n.up.copy(t.up),this.object=n,this._viewMode=pp.NORMAL,this.enabled=!0,this.enableRotate=!0,this.update(),this.viewer.renderManager.setCamera(),this.viewer.renderManager.render()}},{key:"setViewMode",value:function(e){var t=this;if(e===pp.NORMAL){if(this.object.isPerspectiveCamera)return;this.viewer.renderManager.setCamera(),this.switchToPerspectiveCamera(),this._prevView&&(new ud.Tween(this.target).to(this._prevView.target,500).start(),new ud.Tween(this.object.position).to(this._prevView.position,500).onUpdate((function(){t.object.lookAt(t.target)})).onComplete((function(){})).start(),this._prevView=null)}else if(e===pp.TOP){if(this.object.isOrthographicCamera)return;this._prevView=this.getView(),this._prevView.position=(new at).fromArray(this._prevView.position),this._prevView.target=(new at).fromArray(this._prevView.target);var n=new at;this.enabled=!1,this.target.copy(n);var i=this.computePosition(this.object.defaultPos,n,0,0),r=this._prevView.target.clone();new ud.Tween(r).to(n,500).onUpdate((function(){t.object.lookAt(r)})).start(),new ud.Tween(this.object.position).to(i,500).onComplete((function(){t.switchToOrthoCamera()})).start()}}},{key:"startAutoRotate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;this.autoRotateSpeed=e,this.autoRotate=!0}},{key:"stopAutoRotate",value:function(){this.autoRotate=!1}},{key:"follow",value:function(e,t){var n=this;e||console.error("缺少参数object"),this.followTask=function(){var i=n._fitCamera(e),r=new at(0,0,0);t&&(i.add(t),r.add(t)),n.setPosition(e.position.x+i.x,e.position.y+i.y,e.position.z+i.z),n.setTarget(e.position.x+r.x,e.position.y+r.y,e.position.z+r.z)}.bind(this),this.viewer.addEventListener("update",this.followTask)}},{key:"stopFollow",value:function(){this.viewer.removeEventListener("update",this.followTask)}}]),n}(fp);yp.VIEW_CHANGE="view_change";var wp="#DDDDDD",xp="#F2F5CE",bp="#FFFFFF",Mp=256,Cp=[],Bp=[],Ep=[],Sp=[],Tp=[],_p=function(e){h(n,e);var t=y(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,o=arguments.length>3?arguments[3]:void 0;s(this,n),A(),(i=t.call(this)).cubeSize=r,i.edgeSize=a,i._cube=new Ip({size:i.cubeSize,edge:i.edgeSize,outline:!0,bgColor:wp,hoverColor:xp,outlineColor:bp}),i._animation=null,i._handleMouseMove=i._handleMouseMove.bind(v(i)),i._handleMouseClick=i._handleMouseClick.bind(v(i)),i._controls=o,i._renderer=new $a({antialias:!0,alpha:!0}),i._renderer.setPixelRatio(window.devicePixelRatio),i._renderer.setSize(150,150),i._renderer.setClearAlpha(0),i._renderer.domElement.style.position="absolute",i._renderer.domElement.style.right="0px",i._renderer.domElement.style.top="0px",e.appendChild(i._renderer.domElement),i.domElement=i._renderer.domElement,i._listen(),i._scene=new Qt,i._scene.add(i._cube),i._camera=new Ni(50,1,.1,1e3);var l=new UA(16777215,1);function A(){Bp=[{name:Up.FRONT,map:Pp("前",{fontSize:Mp,font:"Arial Narrow, sans-serif"})},{name:Up.RIGHT,map:Pp("右",{fontSize:Mp,font:"Arial Narrow, sans-serif"})},{name:Up.BACK,map:Pp("后",{fontSize:Mp,font:"Arial Narrow, sans-serif"})},{name:Up.LEFT,map:Pp("左",{fontSize:Mp,font:"Arial Narrow, sans-serif"})},{name:Up.TOP,map:Pp("上",{fontSize:Mp,font:"Arial Narrow, sans-serif"})},{name:Up.BOTTOM,map:Pp("下",{fontSize:Mp,font:"Arial Narrow, sans-serif"})}],Ep=[{name:Up.TOP_FRONT_RIGHT_CORNER},{name:Up.TOP_BACK_RIGHT_CORNER},{name:Up.TOP_BACK_LEFT_CORNER},{name:Up.TOP_FRONT_LEFT_CORNER},{name:Up.BOTTOM_BACK_RIGHT_CORNER},{name:Up.BOTTOM_FRONT_RIGHT_CORNER},{name:Up.BOTTOM_FRONT_LEFT_CORNER},{name:Up.BOTTOM_BACK_LEFT_CORNER}],Sp=[{name:Up.TOP_FRONT_EDGE},{name:Up.TOP_RIGHT_EDGE},{name:Up.TOP_BACK_EDGE},{name:Up.TOP_LEFT_EDGE},{name:Up.BOTTOM_BACK_EDGE},{name:Up.BOTTOM_RIGHT_EDGE},{name:Up.BOTTOM_FRONT_EDGE},{name:Up.BOTTOM_LEFT_EDGE}],Tp=[{name:Up.FRONT_RIGHT_EDGE},{name:Up.BACK_RIGHT_EDGE},{name:Up.BACK_LEFT_EDGE},{name:Up.FRONT_LEFT_EDGE}],Cp=[].concat(C(Bp),C(Ep),C(Sp),C(Tp))}return i._scene.add(l),i._camera.position.set(0,0,70),i._camera.lookAt(0,0,0),i}return A(n,[{key:"_listen",value:function(){var e=this;this.domElement.addEventListener("mousemove",this._handleMouseMove),this.domElement.addEventListener("click",this._handleMouseClick),this._controls.addEventListener(ld.CHANGE,(function(){var t=-1*(e._controls.spherical.phi-Math.PI/2),n=-e._controls.spherical.theta;e._cube.rotation.set(t,n,0)}))}},{key:"_handleMouseClick",value:function(e){var t=e.offsetX/e.target.clientWidth*2-1,n=-e.offsetY/e.target.clientHeight*2+1;this._checkSideTouch(t,n)}},{key:"_checkSideTouch",value:function(e,t){var n=this,i=new Nc;i.setFromCamera({x:e,y:t},this._camera);var r=[];this._cube.children.forEach((function(e){e!=n._cube.model&&r.push(e)}));var a=i.intersectObjects(r,!0);if(a.length){var o,s=S(a);try{for(s.s();!(o=s.n()).done;){var l=o.value.object;if(l.name){this._rotateTheCube(l.name),this._rotateTheCamera(l.name);break}}}catch(e){s.e(e)}finally{s.f()}}}},{key:"_rotateTheCamera",value:function(e){var t=new at;switch(e){case Up.FRONT:t.set(0,0,1);break;case Up.BACK:t.set(0,0,-1);break;case Up.LEFT:t.set(-1,0,0);break;case Up.RIGHT:t.set(1,0,0);break;case Up.TOP:t.set(0,1,0);break;case Up.BOTTOM:t.set(0,-1,0);break;case Up.TOP_FRONT_EDGE:t.set(0,1,1);break;case Up.TOP_BACK_EDGE:t.set(0,1,-1);break;case Up.TOP_RIGHT_EDGE:t.set(1,1,0);break;case Up.TOP_LEFT_EDGE:t.set(-1,1,0);break;case Up.BOTTOM_FRONT_EDGE:t.set(0,-1,1);break;case Up.BOTTOM_BACK_EDGE:t.set(0,-1,-1);break;case Up.BOTTOM_RIGHT_EDGE:t.set(1,-1,0);break;case Up.BOTTOM_LEFT_EDGE:t.set(-1,-1,0);break;case Up.FRONT_RIGHT_EDGE:t.set(1,0,1);break;case Up.FRONT_LEFT_EDGE:t.set(-1,0,1);break;case Up.BACK_RIGHT_EDGE:t.set(1,0,-1);break;case Up.BACK_LEFT_EDGE:t.set(-1,0,-1);break;case Up.TOP_FRONT_RIGHT_CORNER:t.set(1,1,1);break;case Up.TOP_FRONT_LEFT_CORNER:t.set(-1,1,1);break;case Up.TOP_BACK_RIGHT_CORNER:t.set(1,1,-1);break;case Up.TOP_BACK_LEFT_CORNER:t.set(-1,1,-1);break;case Up.BOTTOM_FRONT_RIGHT_CORNER:t.set(1,-1,1);break;case Up.BOTTOM_FRONT_LEFT_CORNER:t.set(-1,-1,1);break;case Up.BOTTOM_BACK_RIGHT_CORNER:t.set(1,-1,-1);break;case Up.BOTTOM_BACK_LEFT_CORNER:t.set(-1,-1,-1)}t.clone();var n=this._controls.target.distanceTo(this._controls.object.position),i=t.normalize().multiplyScalar(n).add(this._controls.target);this._controls.camera.rotation.set(0,0,0),this._controls.flyTo({position:i,rotation:new at})}},{key:"_rotateTheCube",value:function(e){switch(e){case Up.FRONT:this._setCubeAngles(0,0,0);break;case Up.RIGHT:this._setCubeAngles(0,-90,0);break;case Up.BACK:this._setCubeAngles(0,-180,0);break;case Up.LEFT:this._setCubeAngles(0,-270,0);break;case Up.TOP:this._setCubeAngles(90,0,0);break;case Up.BOTTOM:this._setCubeAngles(-90,0,0);break;case Up.TOP_FRONT_EDGE:this._setCubeAngles(45,0,0);break;case Up.TOP_RIGHT_EDGE:this._setCubeAngles(45,-90,0);break;case Up.TOP_BACK_EDGE:this._setCubeAngles(45,-180,0);break;case Up.TOP_LEFT_EDGE:this._setCubeAngles(45,-270,0);break;case Up.BOTTOM_FRONT_EDGE:this._setCubeAngles(-45,0,0);break;case Up.BOTTOM_RIGHT_EDGE:this._setCubeAngles(-45,-90,0);break;case Up.BOTTOM_BACK_EDGE:this._setCubeAngles(-45,-180,0);break;case Up.BOTTOM_LEFT_EDGE:this._setCubeAngles(-45,-270,0);break;case Up.FRONT_RIGHT_EDGE:this._setCubeAngles(0,-45,0);break;case Up.BACK_RIGHT_EDGE:this._setCubeAngles(0,-135,0);break;case Up.BACK_LEFT_EDGE:this._setCubeAngles(0,-225,0);break;case Up.FRONT_LEFT_EDGE:this._setCubeAngles(0,-315,0);break;case Up.TOP_FRONT_RIGHT_CORNER:this._setCubeAngles(45,-45,0);break;case Up.TOP_BACK_RIGHT_CORNER:this._setCubeAngles(45,-135,0);break;case Up.TOP_BACK_LEFT_CORNER:this._setCubeAngles(45,-225,0);break;case Up.TOP_FRONT_LEFT_CORNER:this._setCubeAngles(45,-315,0);break;case Up.BOTTOM_FRONT_RIGHT_CORNER:this._setCubeAngles(-45,-45,0);break;case Up.BOTTOM_BACK_RIGHT_CORNER:this._setCubeAngles(-45,-135,0);break;case Up.BOTTOM_BACK_LEFT_CORNER:this._setCubeAngles(-45,-225,0);break;case Up.BOTTOM_FRONT_LEFT_CORNER:this._setCubeAngles(-45,-315,0)}}},{key:"_setCubeAngles",value:function(e,t,n){var i=this._cube.rotation;this._animation={base:{x:i.x,y:i.y,z:i.z},delta:{x:kp(i.x,e*Lp),y:kp(i.y,t*Lp),z:kp(i.z,n*Lp)},duration:500,time:Date.now()}}},{key:"_handleMouseMove",value:function(e){var t=e.offsetX/e.target.clientWidth*2-1,n=-e.offsetY/e.target.clientHeight*2+1;this._checkSideOver(t,n)}},{key:"_checkSideOver",value:function(e,t){var n=this,i=new Nc;i.setFromCamera({x:e,y:t},this._camera);var r=[],a=this._cube.model;this._cube.children.forEach((function(e){e!=n._cube.model&&r.push(e)}));var o=i.intersectObjects(r,!0);if(this._cube.children.forEach((function(e){e!=a&&e.traverse((function(e){e.name&&e.material.color.setStyle(e.material.color0)}))})),o.length){var s,l=S(o);try{var A=function(){var e=s.value.object;if(e.name){Cp.find((function(t){return t.name===e.name}));return e.parent.children.forEach((function(t){t!=a&&t.name===e.name&&(t.material.color0||(t.material.color0="#"+t.material.color.getHexString()),t.material.color.setStyle(xp))})),"break"}};for(l.s();!(s=l.n()).done;){if("break"===A())break}}catch(e){l.e(e)}finally{l.f()}}}},{key:"update",value:function(){this._animate(),this._renderer.render(this._scene,this._camera)}},{key:"_animate",value:function(){if(this._animation){var e=Date.now(),t=this._animation,n=t.duration,i=t.time,r=Math.min((e-i)/n,1);this._animateCubeRotation(this._animation,r),1==r&&(this._animation=null),this.dispatchEvent({type:"angle-change",quaternion:this._cube.quaternion.clone()})}}},{key:"_animateCubeRotation",value:function(e,t){var n=e.base,i=e.delta,r=.5*(Math.sin((2*t-1)*Math.PI*.5)+1),a=-Fp+n.x+i.x*r,o=-Fp+n.y+i.y*r,s=-Fp+n.z+i.z*r;this._cube.rotation.set(a%Fp,o%Fp,s%Fp)}},{key:"setQuaternion",value:function(e){this._cube.setRotationFromQuaternion(e)}},{key:"getObject",value:function(){return this._cube}}]),n}(Je),Ip=function(e){h(n,e);var t=y(n);function n(e){var i,r=e.size,a=void 0===r?60:r,o=e.edge,l=void 0===o?5:o,A=e.outline,c=void 0===A||A,h=e.bgColor,u=void 0===h?"#CCCCCC":h,d=e.hoverColor,f=void 0===d?"#FFFFFF":d,p=e.outlineColor,m=void 0===p?"#999999":p,v=e.cornerColor,g=void 0===v?"#ffffff":v;return s(this,n),(i=t.call(this))._cubeSize=a,i._edgeSize=l,i._outline=c,i._bgColor=u,i._hoverColor=f,i._outlineColor=m,i._cornerColor=g,i._build(),i}return A(n,[{key:"_build",value:function(){var e,t=this._cubeSize-2*this._edgeSize,n=this._cubeSize/2,i=this._edgeSize,r=this._createCubeFaces(t,n),a=S(Bp.entries());try{for(a.s();!(e=a.n()).done;){var o=M(e.value,2),s=o[0],l=o[1];r.children[s].name=l.name,r.children[s].material.color.setStyle(this._bgColor),r.children[s].material.map=l.map}}catch(e){a.e(e)}finally{a.f()}this.add(r);var A,c=[],h=S(Ep.entries());try{for(h.s();!(A=h.n()).done;){var u=M(A.value,2),d=u[0],f=u[1],p=this._createCornerFaces(i,n,f.name,{color:this._bgColor});p.rotateOnAxis(new at(0,1,0),d%4*90*Lp),c.push(p)}}catch(e){h.e(e)}finally{h.f()}var m=new ja,v=new ja;this.add(m.add.apply(m,C(c.slice(0,4)))),this.add(v.add.apply(v,C(c.slice(4))).rotateOnAxis(new at(1,0,0),180*Lp));var g,y=[],w=S(Sp.entries());try{for(w.s();!(g=w.n()).done;){var x=M(g.value,2),b=x[0],B=x[1],E=this._createHorzEdgeFaces(t,i,n,B.name,{color:this._bgColor});E.rotateOnAxis(new at(0,1,0),b%4*90*Lp),y.push(E)}}catch(e){w.e(e)}finally{w.f()}var T=new ja,_=new ja;this.add(T.add.apply(T,C(y.slice(0,4)))),this.add(_.add.apply(_,C(y.slice(4))).rotateOnAxis(new at(1,0,0),180*Lp));var I,L=new ja,F=S(Tp.entries());try{for(F.s();!(I=F.n()).done;){var k=M(I.value,2),P=k[0],U=k[1],D=this._createVertEdgeFaces(i,t,n,U.name,{color:this._bgColor});D.rotateOnAxis(new at(0,1,0),90*P*Lp),L.add(D)}}catch(e){F.e(e)}finally{F.f()}this.add(L),this._outline&&this.add(this._createCubeOutline(this._cubeSize))}},{key:"addModel",value:function(e){if(this.removeModel(),this.traverse((function(e){"Mesh"==e.type?(e.material.transparent=!0,e.material.opacity=.01):"LineSegments"==e.type&&(e.material.transparent=!0,e.material.opacity=.1)})),e){e.scale1=e.scale.clone(),e.position1=e.position.clone();var t=this._cubeSize/(2*e.boundingSphere.radius);e.scale.set(t,t,t);var n=e.boundingSphere.center.clone().negate().multiplyScalar(t);e.position.copy(n),this.add(e),this.model=e}}},{key:"removeModel",value:function(){this.model&&(model.scale.copy(model.scale1),model.position.copy(model.position1),model.scale1=null,model.position1=null,this.remove(this.model),this.model=null),this.traverse((function(e){("Mesh"==e.type||"LineSegments"==e.type)&&(e.material.transparent=!1,e.material.opacity=1)}))}},{key:"_createFace",value:function(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=i.axis,a=void 0===r?[0,1,0]:r,o=i.angle,s=void 0===o?0:o,l=i.name,A=void 0===l?"":l,c=i.matProps,h=void 0===c?{}:c;Array.isArray(e)||(e=[e,e]);var u=new Nn(h),d=new qi(e[0],e[1]),f=new Ei(d,u);return f.name=A,f.rotateOnAxis(p(at,C(a)),s*Lp),(n=f.position).set.apply(n,C(t)),f}},{key:"_createCubeFaces",value:function(e,t){var n=new zt;return n.add(this._createFace(e,[0,0,t],{axis:[0,1,0],angle:0})),n.add(this._createFace(e,[t,0,0],{axis:[0,1,0],angle:90})),n.add(this._createFace(e,[0,0,-t],{axis:[0,1,0],angle:180})),n.add(this._createFace(e,[-t,0,0],{axis:[0,1,0],angle:270})),n.add(this._createFace(e,[0,t,0],{axis:[1,0,0],angle:-90})),n.add(this._createFace(e,[0,-t,0],{axis:[1,0,0],angle:90})),n}},{key:"_createCornerFaces",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=new zt,a=t-e/2;return r.add(this._createFace(e,[a,a,t],{axis:[0,1,0],angle:0,matProps:i,name:n})),r.add(this._createFace(e,[t,a,a],{axis:[0,1,0],angle:90,matProps:i,name:n})),r.add(this._createFace(e,[a,t,a],{axis:[1,0,0],angle:-90,matProps:i,name:n})),r}},{key:"_createHorzEdgeFaces",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=new zt,o=n-t/2;return a.add(this._createFace([e,t],[0,o,n],{axis:[0,1,0],angle:0,name:i,matProps:r})),a.add(this._createFace([e,t],[0,n,o],{axis:[1,0,0],angle:-90,name:i,matProps:r})),a}},{key:"_createVertEdgeFaces",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=new zt,o=n-e/2;return a.add(this._createFace([e,t],[o,0,n],{axis:[0,1,0],angle:0,name:i,matProps:r})),a.add(this._createFace([e,t],[n,0,o],{axis:[0,1,0],angle:90,name:i,matProps:r})),a}},{key:"_createCubeOutline",value:function(e){return new jo(new ll(new Fi(e,e,e)),new Do({color:this._outlineColor,linewidth:1}))}},{key:"_createCubeOutline2",value:function(e){return new jo(new ll(new Fi(e.x,e.y,e.z)),new Do({color:this._outlineColor,linewidth:1}))}}]),n}(zt),Lp=Math.PI/180,Fp=2*Math.PI;function kp(e,t){var n=t-e,i=n-Fp,r=n+Fp;return Math.abs(n)>Math.abs(i)?i:Math.abs(n)>Math.abs(r)?r:n}function Pp(e,t){var n=t.font||"Helvetica",i=t.fontSize||30,r=t.width||512,a=t.height||512,o=t.color?t.bgColor.join(", "):"255, 255, 255, 1.0",s=t.color?t.color.join(", "):"0, 0, 0, 1.0",l=document.createElement("canvas");l.width=r,l.height=a;var A=l.getContext("2d");A.font="bold ".concat(i,"px ").concat(n),A.fillStyle="rgba(".concat(o,")"),A.fillRect(0,0,r,a);var c=A.measureText(e).width;A.fillStyle="rgba(".concat(s,")"),A.fillText(e,r/2-c/2,a/2+i/2-2);var h=new ts(l);return h.minFilter=1008,h.needsUpdate=!0,h.anisotropy=2,h}var Up={TOP:1,FRONT:2,RIGHT:3,BACK:4,LEFT:5,BOTTOM:6,TOP_FRONT_EDGE:7,TOP_RIGHT_EDGE:8,TOP_BACK_EDGE:9,TOP_LEFT_EDGE:10,FRONT_RIGHT_EDGE:11,BACK_RIGHT_EDGE:12,BACK_LEFT_EDGE:13,FRONT_LEFT_EDGE:14,BOTTOM_FRONT_EDGE:15,BOTTOM_RIGHT_EDGE:16,BOTTOM_BACK_EDGE:17,BOTTOM_LEFT_EDGE:18,TOP_FRONT_RIGHT_CORNER:19,TOP_BACK_RIGHT_CORNER:20,TOP_BACK_LEFT_CORNER:21,TOP_FRONT_LEFT_CORNER:22,BOTTOM_FRONT_RIGHT_CORNER:23,BOTTOM_BACK_RIGHT_CORNER:24,BOTTOM_BACK_LEFT_CORNER:25,BOTTOM_FRONT_LEFT_CORNER:26},Dp=function(){function e(t){s(this,e),this.viewer=t}return A(e,[{key:"init",value:function(){}},{key:"update",value:function(e){}},{key:"destory",value:function(){}}]),e}(),Rp=function(){function e(t,n){s(this,e),this.isHotSpotEntity=!0,this.options=n,this.name=t,this.init(),this.load()}return A(e,[{key:"init",value:function(){this.object=null,this.material=null,this.name=this.name,this.position=new at(0,0,0),this.options.pos&&3===this.options.pos.length?this.localPosition=new at(this.options.pos[0],this.options.pos[1],this.options.pos[2]):this.localPosition=new at(0,0,0),this.scale=new at(1,1,1),this.color=new ut(1,1,1),this.width=0,this.height=0,this.hoverColor=null}},{key:"load",value:function(){this.object=new zt}},{key:"setColor",value:function(e,t,n){this.color.x=e,this.color.y=t,this.color.z=n,this.material&&(this.material.needsUpdate=!0)}},{key:"setAlpha",value:function(e){this.color.w=e,this.material&&(this.material.needsUpdate=!0)}},{key:"onEnterHover",value:function(){this.hoverColor&&this.material&&(this.material.uniforms.color.value=this.hoverColor,this.material.needsUpdate=!0)}},{key:"onExitHover",value:function(){this.hoverColor&&this.material&&(this.material.uniforms.color.value=this.color,this.material.needsUpdate=!0)}},{key:"dispose",value:function(){this.material&&this.material.dispose(),this.material=null,this.object&&this.object.parent&&this.object.parent.remove(this.object),this.object=null}}]),e}(),Op=function(e){h(n,e);var t=y(n);function n(e,i){return s(this,n),t.call(this,e,i)}return A(n,[{key:"init",value:function(){b(u(n.prototype),"init",this).call(this),this.width=this.options.scale[0],this.height=this.options.scale[1],this.url=this.options.url,this.options.color&&4===this.options.color.length&&(this.color=new ut(this.options.color[0],this.options.color[1],this.options.color[2],this.options.color[3])),this.options.hoverColor&&4===this.options.hoverColor.length&&(this.hoverColor=new ut(this.options.hoverColor[0],this.options.hoverColor[1],this.options.hoverColor[2],this.options.hoverColor[3]))}},{key:"load",value:function(){this.createMesh(this.width,this.height,this.url)}},{key:"createMesh",value:function(e,t,n){var i=(new tA).load(n),r=e/2,a=t/2,o=[-r,-a,0,-r,a,0,r,a,0,r,-a,0],s=new si;s.setAttribute("position",new Yn(o,3)),s.setAttribute("uv",new Yn([0,0,0,1,1,1,1,0],2)),s.setIndex([0,1,2,2,3,0]);var l={};l.mainTex={value:i},l.color={value:this.color},this.material=new Ri({uniforms:l,vertexShader:this.getVertShader(),fragmentShader:this.getFragmentShader(),transparent:!0,depthWrite:!1,side:2}),s.addGroup(0,6,0),this.object=new Ei(s,[this.material]),this.object.isHotSpotEntity=!0,this.object.position.set(this.localPosition.x,this.localPosition.y,this.localPosition.z)}},{key:"getVertShader",value:function(){return"\n varying vec2 vUv;\n void main()\n {\n vUv = uv;\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * mvPosition;\n }\n "}},{key:"getFragmentShader",value:function(){return"\n uniform sampler2D mainTex;\n uniform vec4 color;\n varying vec2 vUv;\n void main()\n {\n vec4 texColor = texture2D(mainTex,vUv.xy);\n vec4 col = texColor * color;\n gl_FragColor = col;\n }\n "}},{key:"dispose",value:function(){this.material&&(this.material.uniforms.mainTex&&this.material.uniforms.mainTex.value.dispose(),this.material.dispose()),this.material=null,this.object&&this.object.parent&&this.object.parent.remove(this.object),this.object=null}}]),n}(Rp),Np=function(e){h(n,e);var t=y(n);function n(e,i){return s(this,n),t.call(this,e,i)}return A(n,[{key:"init",value:function(){b(u(n.prototype),"init",this).call(this),this.backMaterial=null,this.options.backColor&&4===this.options.backColor.length?this.backColor=new ut(this.options.backColor[0],this.options.backColor[1],this.options.backColor[2],this.options.backColor[3]):this.backColor=new ut(1,1,1,1),this.options.backHoverColor&&4===this.options.backHoverColor.length&&(this.backHoverColor=new ut(this.options.backHoverColor[0],this.options.backHoverColor[1],this.options.backHoverColor[2],this.options.backHoverColor[3]))}},{key:"load",value:function(){b(u(n.prototype),"load",this).call(this);var e={};e.mainTex={value:this.material.uniforms.mainTex.value},e.color={value:this.backColor},this.backMaterial=new Ri({uniforms:e,vertexShader:this.getVertShader(),fragmentShader:this.getFragmentShader(),transparent:!0,depthWrite:!1,side:2,depthFunc:6}),this.object.geometry.addGroup(0,6,1),this.object.material.push(this.backMaterial)}},{key:"onEnterHover",value:function(){b(u(n.prototype),"onEnterHover",this).call(this),this.backHoverColor&&this.backMaterial&&(this.backMaterial.uniforms.color.value=this.backHoverColor,this.backMaterial.needsUpdate=!0)}},{key:"onExitHover",value:function(){b(u(n.prototype),"onExitHover",this).call(this),this.backHoverColor&&this.backMaterial&&(this.backMaterial.uniforms.color.value=this.backColor,this.backMaterial.needsUpdate=!0)}},{key:"dispose",value:function(){this.material&&(this.material.uniforms.mainTex&&this.material.uniforms.mainTex.value.dispose(),this.material.dispose()),this.material=null,this.backMaterial&&this.backMaterial.dispose(),this.backMaterial=null,this.object&&this.object.parent&&this.object.parent.remove(this.object),this.object=null}}]),n}(Op),zp=new(function(){function e(){s(this,e),this.fontDic=new Map}return A(e,[{key:"getFont",value:function(e,t){var n=this,i=this.fontDic.get(e);i?t(i):(new qA).load(e,(function(i){return n.fontDic.set(e,i),t(i),i}))}}]),e}()),Qp=function(e){h(n,e);var t=y(n);function n(e,i){var r;return s(this,n),(r=t.call(this,e,i)).texObj=null,r}return A(n,[{key:"init",value:function(){b(u(n.prototype),"init",this).call(this),this.text="",this.font=null,this.length=0,this.options.size?this.fontSize=this.options.size:this.fontSize=1,this.options.color&&4===this.options.color.length&&(this.color=new ut(this.options.color[0],this.options.color[1],this.options.color[2],this.options.color[3])),this.options.hoverColor&&4===this.options.hoverColor.length&&(this.hoverColor=new ut(this.options.hoverColor[0],this.options.hoverColor[1],this.options.hoverColor[2],this.options.hoverColor[3]))}},{key:"load",value:function(){this.object=new zt,this.object.name=this.name,this.refresh()}},{key:"setText",value:function(e){this.text=e+"",this.refresh()}},{key:"setFont",value:function(e){var t=this;this.fontPath=e,zp.getFont(this.fontPath,(function(e){t.font=e,t.refresh()}))}},{key:"setFontSize",value:function(e){this.fontSize=e,this.refresh()}},{key:"refresh",value:function(){if(this.font){var e=new ol(this.font.generateShapes(this.text,this.fontSize),void 0,!0);e.computeBoundingBox(),this.refreshGeometry(e),this.length=e.boundingBox.max.x-e.boundingBox.min.x,this.texObj?this.texObj.geometry=e:this.createTextMesh(e);var t=-this.length/2-e.boundingBox.min.x,n=-this.fontSize/2;this.texObj.position.set(t,n,this.fontSize/100),this.width=e.boundingBox.max.x-e.boundingBox.min.x,this.height=e.boundingBox.max.y-e.boundingBox.min.y}else this.setFont("https://sdk-localresource.laozicloud.com/helvetiker_regular.typeface.json")}},{key:"createTextMesh",value:function(e){var t={};t.color={value:this.color},this.material=new Ri({uniforms:t,vertexShader:this.getVertShader(),fragmentShader:this.getFragmentShader(),side:2,transparent:!0}),this.texObj=new Ei(e,[this.material]),this.texObj.isHotSpotEntity=!0,this.object.add(this.texObj),this.object.position.set(this.localPosition.x,this.localPosition.y,this.localPosition.z)}},{key:"refreshGeometry",value:function(e){e.addGroup(0,e.index.count,0)}},{key:"getVertShader",value:function(){return"\n varying vec2 vUv;\n void main()\n {\n vUv = uv;\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * mvPosition;\n }\n "}},{key:"getFragmentShader",value:function(){return"\n uniform vec4 color;\n void main()\n {\n gl_FragColor = color;\n //gl_FragColor = vec4(1.0,0.0,0.0,1.0);\n }\n "}}]),n}(Rp),Gp=function(e){h(n,e);var t=y(n);function n(e,i){return s(this,n),t.call(this,e,i)}return A(n,[{key:"init",value:function(){b(u(n.prototype),"init",this).call(this),this.backMaterial=null,this.options.backColor&&4===this.options.backColor.length?this.backColor=new ut(this.options.backColor[0],this.options.backColor[1],this.options.backColor[2],this.options.backColor[3]):this.backColor=new ut(1,1,1,1),this.options.backHoverColor&&4===this.options.backHoverColor.length&&(this.backHoverColor=new ut(this.options.backHoverColor[0],this.options.backHoverColor[1],this.options.backHoverColor[2],this.options.backHoverColor[3]))}},{key:"createTextMesh",value:function(e){b(u(n.prototype),"createTextMesh",this).call(this,e);var t={};t.color={value:this.backColor},this.backMaterial=new Ri({uniforms:t,vertexShader:this.getVertShader(),fragmentShader:this.getFragmentShader(),transparent:!0,depthWrite:!1,side:2,depthFunc:6}),this.texObj.material.push(this.backMaterial)}},{key:"refreshGeometry",value:function(e){b(u(n.prototype),"refreshGeometry",this).call(this,e),e.addGroup(0,e.index.count,1)}},{key:"onEnterHover",value:function(){b(u(n.prototype),"onEnterHover",this).call(this),this.backHoverColor&&this.backMaterial&&(this.backMaterial.uniforms.color.value=this.backHoverColor,this.backMaterial.needsUpdate=!0)}},{key:"onExitHover",value:function(){b(u(n.prototype),"onExitHover",this).call(this),this.backHoverColor&&this.backMaterial&&(this.backMaterial.uniforms.color.value=this.backColor,this.backMaterial.needsUpdate=!0)}},{key:"dispose",value:function(){b(u(n.prototype),"dispose",this).call(this),this.backMaterial&&this.backMaterial.dispose(),this.backMaterial=null}}]),n}(Qp),Hp=new at,Vp=new bt,jp=new at,Wp=new at,Xp=function(e){h(n,e);var t=y(n);function n(){var e;return s(this,n),(e=t.call(this)).objects=[],e.click=null,e.viewMatrx=new bt,e.isAutoScale=!1,e.autoZ=0,e.ishover=!1,e.box=new tn(new at(0,0,0),new at(1,1,1)),e.hotRaycast=new Nc,e.depth=0,e.isBulletionBoard=!0,e.bindMesh=null,e.bindMeshIndex=0,e.bindOffsetPoint=null,e._tmpBindPosition=new at,e}return A(n,[{key:"getObjectByName",value:function(e){for(var t=0;t<this.objects.length;t++)if(this.objects[t].name===e)return this.objects[t];return null}},{key:"setColor",value:function(e,t,n){for(var i=0;i<this.objects.length;i++)this.objects[i].setColor(e,t,n)}},{key:"setAlpha",value:function(e){for(var t=0;t<this.objects.length;t++)this.objects[t].setAlpha(e)}},{key:"setBindMesh",value:function(e,t,n,i){if(e){var r,a=n.clone(),o=e.geometry.attributes.position;if(!(o.count<=t))this.bindMesh=e,this.bindMeshIndex=t,i&&(this.offsetDirection=i.normalize()),r=e.isSkinnedMesh?this.bindMesh.getVertex(t):new at(o.array[3*t],o.array[3*t+1],o.array[3*t+2]),this.bindPosition=(new at).copy(a),this.bindLocalPoint=a,r&&(this.bindOffsetPoint=this.bindLocalPoint.sub(r))}}},{key:"load",value:function(e){(new Kl).load(e,this.loadComplete.bind(this))}},{key:"loadComplete",value:function(e){this.setData(e)}},{key:"setData",value:function(e){var t=JSON.parse(e);t.data&&t.data.z&&(this.autoZ=t.data.z,this.isAutoScale=!0);var n=t.node;if(Array.isArray(n))for(var i=0;i<n.length;i++)this.parseJson(n[i],this);else this.parseJson(n,this);this.recalutionBound()}},{key:"parseJson",value:function(e,t){var n=this.createObject(e);if(t.add(n.object),n.object.updateMatrixWorld(!0),this.objects.push(n),e.child)for(var i=0;i<e.child.length;i++)this.parseJson(e.child[i],n)}},{key:"setEntityConfig",value:function(e){for(var t=0;t<this.objects.length;t++)this.objects[t].dispose();this.objects=[],this.load(e)}},{key:"createObject",value:function(e){if("image"===e.type)return new Op(e.name,e);if("text"===e.type){var t=new Qp(e.name,e);return t.setText(e.text),t}if("doubleImage"===e.type)return new Np(e.name,e);if("doubleText"===e.type){var n=new Gp(e.name,e);return n.setText(e.text),n}}},{key:"recalutionBound",value:function(){for(var e=0;e<this.objects.length;e++){var t=this.objects[e],n=t.object.parent.localToWorld(t.object.position.clone()),i=this.worldToLocal(n),r=i.x-t.width/2,a=i.x+t.width/2,o=i.y-t.height/2,s=i.y+t.height/2;0===e?(this.box.min.set(r,o,0),this.box.max.set(a,s,0)):(this.box.min.x=Math.min(r,this.box.min.x),this.box.min.y=Math.min(o,this.box.min.y),this.box.max.x=Math.max(a,this.box.max.x),this.box.max.y=Math.max(s,this.box.max.y))}}},{key:"raycaster",value:function(e){if(this.viewer){if(!this.click)return!1;var t=If.getDomMouse(e,this.viewer.domElement);return Vp.multiplyMatrices(this.viewer.camera.matrixWorldInverse,this.matrixWorld),Vp.premultiply(this.viewer.camera.projectionMatrix),jp=this.box.min.clone().applyMatrix4(Vp),Wp=this.box.max.clone().applyMatrix4(Vp),t.x>=jp.x&&t.x<=Wp.x&&t.y>=jp.y&&t.y<=Wp.y}}},{key:"onclick",value:function(){this.click&&this.click()}},{key:"onEnterHover",value:function(){this.ishover=!0;for(var e=0;e<this.objects.length;e++)this.objects[e].onEnterHover()}},{key:"onExitHover",value:function(){this.ishover=!1;for(var e=0;e<this.objects.length;e++)this.objects[e].onExitHover()}},{key:"update",value:function(e){if(this.viewer){if(this.isAutoScale){this.viewMatrx.multiplyMatrices(this.viewer.camera.matrixWorldInverse,this.parent.matrixWorld);var t=this.position.clone().applyMatrix4(this.viewMatrx);this.depth=t.z;var n=-t.z/this.autoZ;this.scale.set(n,n,n)}if(this.bindMesh){if(this.bindMesh.isSkinnedMesh){if(this._tmpBindPosition=this.bindMesh.getVertex(this.bindMeshIndex),!this._tmpBindPosition)return;this.bindOffsetPoint||(this.bindOffsetPoint=this.bindLocalPoint.sub(this._tmpBindPosition))}else{var i=this.bindMesh.geometry.attributes.position.array;this._tmpBindPosition=new at(i[3*index],i[3*index+1],i[3*index+2])}if(this._tmpBindPosition.add(this.bindOffsetPoint),this.offsetDirection){this.bindMesh.getWorldScale(Hp);var r=Math.max(this.box.max.x-this.box.min.x,this.box.max.y-this.box.min.y)*Math.abs(this.scale.x/Hp.x)/2;this._tmpBindPosition.addScaledVector(this.offsetDirection,r)}this.bindMesh.localToWorld(this._tmpBindPosition),this.parent&&this.parent.worldToLocal(this._tmpBindPosition),this.position.copy(this._tmpBindPosition)}}}},{key:"updateMatrixWorld",value:function(e){if(this.isBulletionBoard){if(this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldNeedsUpdate||e){var t=this.matrixWorld.clone();if(null===this.parent)this.matrixWorld.copy(this.matrix);else{var i=this.position.clone().applyMatrix4(this.parent.matrixWorld);this.matrixWorld=this.matrix.clone().setPosition(i)}this.matrixWorldNeedsUpdate=!1,e=!0,this.matrixWorld.equals(t)||(this.viewer&&this.viewer.renderManager.render(),this.setDirty())}for(var r=this.children,a=0,o=r.length;a<o;a++)r[a].updateMatrixWorld(e)}else b(u(n.prototype),"updateMatrixWorld",this).call(this,e)}},{key:"updateWorldMatrix",value:function(e,t){if(this.isBulletionBoard){this.viewer&&this.viewer.renderManager.render();var i=this.parent;if(!0===e&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent)this.matrixWorld.copy(this.matrix);else{var r=this.position.clone().applyMatrix4(this.parent.matrixWorld);this.matrixWorld=this.matrix.clone().setPosition(r)}if(!0===t)for(var a=this.children,o=0,s=a.length;o<s;o++)a[o].updateWorldMatrix(!1,!0)}else b(u(n.prototype),"updateWorldMatrix",this).call(this,e,t)}},{key:"dispose",value:function(){for(var e=0;e<this.objects.length;e++)this.objects[e].dispose();this.objects=[]}}]),n}(zt),Yp=new at,Kp=function(e){h(n,e);var t=y(n);function n(){var e;return s(this,n),(e=t.call(this)).isAmrtAlphaHotSpotEntity=!0,e.text="",e.texObj=null,e}return A(n,[{key:"loadComplete",value:function(e){b(u(n.prototype),"loadComplete",this).call(this,e),this.texObj=this.getObjectByName("text"),this.refreshText()}},{key:"setText",value:function(e){this.text=e,this.refreshText()}},{key:"refreshText",value:function(){this.texObj&&""!=this.text&&this.texObj.setText(this.text)}},{key:"setPosAndDir",value:function(e,t){e&&(this.position.copy(e),this.insertPosition=(new at).copy(e),this.tempPostion=new at,this.boxSize=new at),t&&(this.insertDirection=(new at).copy(t))}},{key:"update",value:function(e){if(b(u(n.prototype),"update",this).call(this,e),this.insertPosition&&this.insertDirection)if(NaN==this.box.min.x||NaN==this.box.min.y||NaN==this.box.min.z||Math.abs(this.box.min.x)==1/0||Math.abs(this.box.min.y)==1/0||Math.abs(this.box.min.z)==1/0)this.recalutionBound();else{this.tempPostion.copy(this.insertPosition),this.parent.getWorldScale(Yp);var t=this.box.getSize(this.boxSize).x/2*Math.abs(this.scale.x/Yp.x),i=this.tempPostion.addScaledVector(this.insertDirection,t);this.position.copy(i)}}}]),n}(Xp),Zp=function(e){h(n,e);var t=y(n);function n(e){return s(this,n),t.call(this,e)}return A(n,[{key:"init",value:function(){var e=this;this.event=new Je,this.startPoint=new tt,this.addEventListenerByName("dblclick",(function(t){t=If.getTouchByEvent(t),e.event.dispatchEvent({type:Ad.doubleClick,point:t})})),this.addEventListenerByName(ld.START,(function(t){t=If.getTouchByEvent(t),e.event.dispatchEvent({type:Ad.mouseDown,point:t}),e.startPoint.set(t.clientX,t.clientY)})),this.addEventListenerByName(ld.END,(function(t){t=If.getTouchByEvent(t),e.event.dispatchEvent({type:Ad.mouseUp,point:t}),e.startPoint.distanceTo(new tt(t.clientX,t.clientY))<5&&(0===t.button?e.event.dispatchEvent({type:Ad.click,point:t}):1===t.button?e.event.dispatchEvent({type:Ad.centerClick,point:t}):2===t.button&&e.event.dispatchEvent({type:Ad.rightClick,point:t}))})),If.isMobile||this.addEventListenerByName("mousemove",(function(t){t=If.getTouchByEvent(t),e.event.dispatchEvent({type:Ad.mousemove,point:t})}))}},{key:"addEventListenerByName",value:function(e,t){this.viewer.domElement.addEventListener?this.viewer.domElement.addEventListener(e,t):this.viewer.domElement.attachEvent&&this.viewer.domElement.attachEvent("on"+e,t)}},{key:"addEventListener",value:function(e,t){this.event.addEventListener(e,t)}},{key:"removeEventListener",value:function(e,t){this.event.removeEventListener(e,t)}}]),n}(Dp);new Bt,new bt,new bt;var Jp=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),(i=t.call(this,e)).viewer=e,i.stop=!1,i}return A(n,[{key:"init",value:function(){var e=this;this.hotspot=[],this.viewer.moduleManager.event.addEventListener(Ad.mousemove,(function(t){for(var n=!1,i=0;i<e.hotspot.length;i++){var r=e.hotspot[i].raycaster(t.point);r&&!n?(e.hotspot[i].ishover||e.hotspot[i].onEnterHover(),n=!0):r&&!n||!e.hotspot[i].ishover||e.hotspot[i].onExitHover()}}));var t=new tt;this.viewer.domElement.addEventListener(ld.START,(function(e){if(e.constructor!==MouseEvent||0===e.button){var n=If.getTouchByEvent(e);t.set(n.clientX,n.clientY)}}));var n=this.hotspot;this.viewer.domElement,this.viewer.domElement.addEventListener(ld.END,(function(e){if(e.constructor!==MouseEvent||0===e.button){var i=If.getTouchByEvent(e);if(t.distanceTo(new tt(i.clientX,i.clientY))<5)for(var r=0;r<n.length;r++){if(n[r].raycaster(e))return void n[r].onclick()}}}))}},{key:"addDefaultHotSpot",value:function(e,t){var n=new Kp;return n.load(t||"https://sdk-localresource.laozicloud.com/alphaHotspot.bin"),e?e.add(n):this.viewer.scene.add(n),n.viewer=this.viewer,this.hotspot.push(n),n}},{key:"addHotSpot",value:function(e,t){var n=new Xp;return-1!=e.indexOf("http")?n.load(e):n.setData(e),t?t.add(n):this.viewer.scene.add(n),n.viewer=this.viewer,this.hotspot.push(n),n}},{key:"removeHotSpot",value:function(e){e.parent.remove(e);for(var t=0;t<this.hotspot.length;t++)if(this.hotspot[t]==e)return void this.hotspot.splice(t,1);e.dispose()}},{key:"update",value:function(e){if(!this.stop){for(var t=this.viewer.camera,n=0;n<this.hotspot.length;n++)this.hotspot[n].parent&&this.hotspot[n].quaternion.set(t.quaternion.x,t.quaternion.y,t.quaternion.z,t.quaternion.w),this.hotspot[n].update(e);this.hotspot.sort((function(e,t){return t.depth-e.depth}))}}}]),n}(Dp),qp=function(){function e(t){s(this,e),this.viewer=t,this.modules=[],this.event=new Zp(t),this.modules.push(this.event),this.hotspot=new Jp(t),this.modules.push(this.hotspot)}return A(e,[{key:"init",value:function(){for(var e=0;e<this.modules.length;e++)this.modules[e].init()}},{key:"update",value:function(e){for(var t=0;t<this.modules.length;t++)this.modules[t].update(e)}},{key:"destory",value:function(){for(var e=0;e<this.modules.length;e++)this.modules[e].destory()}}]),e}();function $p(e){var t=e.camera,n=e.renderer.domElement;this.domElement=n,this.rotateSpeed=.002,this.moveSpeed=50,this.minHeight=t.position.y,this.detectEnabled=!0,this.detectDistance=2,this.lockHeight=!0,this.collider=[],this.movingRegion=new tn(new at(-1/0,-1/0,-1/0),new at(1/0,1/0,1/0)),this.floor=new vn(new at(0,1,0),0),this.useGravity=!1,this.character=new tn,this.rotationAngle=0;var i,r=!1,a=2,o=!1,s=new at,l=new at;Object.defineProperties(this,{enabled:{get:function(){return r},set:function(t){t=r=Boolean(t),e.controls.enabled=!t,t?(this.connect(),i=e.camera.near,e.camera.near=.1,e.camera.updateProjectionMatrix(),e.addEventListener("update",R)):(this.disconnect(),e.camera.near=i,e.camera.updateProjectionMatrix(),e.removeEventListener("update",R))}},height:{get:function(){return a},set:function(e){a=e,C()}},showController:{get:function(){return o},set:function(t){(t=o=Boolean(t))?function(){if(D)return void(D.style.display="block");var t=e.container;t.style.position="relative";var n=D=document.createElement("div");n.className="first_person_controller",Object.assign(n.style,{position:"absolute",bottom:"20px",right:"20px",width:"200px",height:"200px",backgroundColor:"rgba(0, 0, 0, 0.2)",borderRadius:"50%"});var i=document.createElement("div");Object.assign(i.style,{width:"100px",height:"100px",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.2)",cursor:"move",position:"absolute",top:"50px",left:"50px"}),n.appendChild(i),t.appendChild(n);var r={},a=!1,o=new tt;i.addEventListener(ld.START,(function(e){e.stopPropagation(),e=If.getTouchByEvent(e),s.set(e.pageX,e.pageY,0),0!=A.rotationAngle&&s.applyAxisAngle(new AMRT.Vector3(0,0,1),A.rotationAngle*Hh.DEG2RAD),i.style.backgroundColor="rgba(0, 0, 0, 0.6)",i.style.boxShadow="0 0 10px #000",r.x=s.x,r.y=s.y,a=!0})),t.addEventListener(ld.END,(function(e){i.style.backgroundColor="rgba(0, 0, 0, 0.2)",i.style.boxShadow="none",a=!1,i.style.left="50px",i.style.top="50px",p=f=m=v=!1})),t.addEventListener(ld.MOVE,(function(e){a&&(e=If.getTouchByEvent(e),s.set(e.pageX,e.pageY,0),0!=A.rotationAngle&&s.applyAxisAngle(new AMRT.Vector3(0,0,1),A.rotationAngle*Hh.DEG2RAD),o.set(Math.max(Math.min(s.x-r.x,100),-100),Math.max(Math.min(s.y-r.y,100),-100)),o.normalize(),o.x>0?(m=!1,v=!0):(m=!0,v=!1),o.y<0?(p=!1,f=!0):(p=!0,f=!1),o.multiplyScalar(50),i.style.left=o.x+50+"px",i.style.top=o.y+50+"px")}))}():D&&(D.style.display="none")}}});var A=this,c={type:"change"},h=new Bt(0,0,0,"YXZ"),u=Math.PI/2,d=new at,f=!1,p=!1,m=!1,v=!1,g=!1,y=!1,w=performance.now(),x=new at,b=new at,M=new Nc;function C(){A.character.min.set(-1,-a/2,-1),A.character.max.set(1,a/2,1),A.character.translate(t.position)}function B(e){switch(e.keyCode){case 38:case 87:f=!0;break;case 37:case 65:m=!0;break;case 40:case 83:p=!0;break;case 39:case 68:v=!0;break;case 82:g=!0;break;case 70:y=!0;break;case 32:A.jump()}}function E(e){switch(e.keyCode){case 38:case 87:f=!1;break;case 37:case 65:m=!1;break;case 40:case 83:p=!1;break;case 39:case 68:v=!1;break;case 82:g=!1;break;case 70:y=!1}}function S(e){0===e.button&&document.addEventListener(ld.MOVE,_,!1)}function T(){document.removeEventListener(ld.MOVE,_,!1)}function _(e){if(!1!==A.enabled){var n=e.movementX||e.mozMovementX||e.webkitMovementX||0,i=e.movementY||e.mozMovementY||e.webkitMovementY||0;l.set(n,i,0),0!=A.rotationAngle&&l.applyAxisAngle(new AMRT.Vector3(0,0,1),A.rotationAngle*Hh.DEG2RAD),h.setFromQuaternion(t.quaternion),h.y-=l.x*A.rotateSpeed,h.x-=l.y*A.rotateSpeed,h.x=Math.max(-u,Math.min(u,h.x)),t.quaternion.setFromEuler(h),A.dispatchEvent(c)}}C();var I=new tn,L=new at;function F(e,n){if(Math.abs(n)>0){var i=t.position.clone();i.addScaledVector(e,n),L.set(0,0,0),L.addScaledVector(e,n),I.copy(A.character),I.translate(L);var r=(new at).subVectors(i,t.position).normalize();return!(A.detectEnabled&&A.collider&&function(e,t){if(M.set(e.clone(),t),M.far=A.detectDistance,(Array.isArray(A.collider)?M.intersectObjects(A.collider,!0):M.intersectObject(A.collider,!0)).length>0)return!0}(i.clone(),r))&&(t.position.copy(i),A.useGravity&&I.intersectsPlane(A.floor)?(t.position.y=-A.floor.constant+A.height/2+.1,!1):(A.movingRegion&&(t.position.x=Math.max(Math.min(t.position.x,A.movingRegion.max.x),A.movingRegion.min.x),t.position.z=Math.max(Math.min(t.position.z,A.movingRegion.max.z),A.movingRegion.min.z)),C(),!0))}}function k(e){this.preX=e.targetTouches[0].clientX,this.preY=e.targetTouches[0].clientY,document.addEventListener("touchmove",U,!1)}function P(){document.removeEventListener("touchmove",U,!1)}function U(e){if(!1!==A.enabled){var n=e.targetTouches[0].clientX-this.preX||0,i=e.targetTouches[0].clientY-this.preY||0;l.set(n,i,0),0!=A.rotationAngle&&l.applyAxisAngle(new AMRT.Vector3(0,0,1),A.rotationAngle*Hh.DEG2RAD),h.setFromQuaternion(t.quaternion),h.y-=l.x*A.rotateSpeed,h.x-=l.y*A.rotateSpeed,h.x=Math.max(-u,Math.min(u,h.x)),t.quaternion.setFromEuler(h),A.dispatchEvent(c),this.preX=e.targetTouches[0].clientX,this.preY=e.targetTouches[0].clientY}}this.setCollider=function(e){var t=this;this.collider=e;var n=Array.isArray(this.collider)?this.collider:[this.collider];this.targets=[],n.forEach((function(e){e.traverse((function(e){e.isMesh&&t.targets.push(e)}))}))},this.setRegion=function(e){A.movingRegion.setFromArray(e)},this.setFloorHeight=function(e){A.floor.constant=-e},this.setView=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==e.position&&(Array.isArray(e.position)?t.position.fromArray(e.position):t.position.copy(e.position)),void 0!==e.rotation&&(Array.isArray(e.rotation)?t.rotation.fromArray(e.rotation):t.rotation.setFromVector3(e.rotation)),C()},this.getView=function(){return{position:t.position.toArray(),rotation:t.rotation.toArray()}},this.connect=function(){document.addEventListener(ld.START,S,!1),document.addEventListener(ld.END,T,!1),document.addEventListener("keydown",B,!1),document.addEventListener("keyup",E,!1),document.addEventListener("touchstart",k,!1),document.addEventListener("touchend",P,!1)},this.disconnect=function(){document.removeEventListener(ld.START,S,!1),document.removeEventListener(ld.END,T,!1),document.removeEventListener("keydown",B,!1),document.removeEventListener("keyup",E,!1),document.removeEventListener("touchstart",k,!1),document.removeEventListener("touchend",P,!1)},this.getDirection=function(){var e=new at(0,0,-1);return function(n){return n.copy(e).applyQuaternion(t.quaternion)}}(),this.moveForward=function(e){d.setFromMatrixColumn(t.matrix,0),d.crossVectors(t.up,d),F(d,e)},this.moveRight=function(e){d.setFromMatrixColumn(t.matrix,0),F(d,e)},this.moveUp=function(e){return d.copy(t.up),F(d,e)},this.jump=function(){x.y+=50};var D,R=function(){if(!0===A.enabled){var e=performance.now(),n=(e-w)/1e3;x.x-=10*x.x*n,x.z-=10*x.z*n,x.y-=10*x.y*n,b.z=Number(f)-Number(p),b.x=Number(v)-Number(m),b.y=Number(y)-Number(g),b.normalize(),(f||p)&&(x.z-=b.z*A.moveSpeed*n,this.moveForward(-x.z*n)),(m||v)&&(x.x-=b.x*A.moveSpeed*n,this.moveRight(-x.x*n)),this.useGravity?(x.y-=98*n,this.moveUp(x.y*n)||(x.y=0)):(g||y)&&(x.y-=b.y*A.moveSpeed*n,this.lockHeight||(t.position.y+=x.y*n,t.position.y<this.minHeight&&(x.y=0,t.position.y=this.minHeight))),w=e}}.bind(this)}function em(e){var t=e.camera,n=e.renderer.domElement;this.domElement=n,this.rotateSpeed=.002,this.moveSpeed=50,this.minHeight=t.position.y,this.detectEnabled=!0,this.detectDistance=2,this.lockHeight=!0,this.collider=[],this.movingRegion=new tn(new at(-1/0,-1/0,-1/0),new at(1/0,1/0,1/0)),this.floor=new vn(new at(0,1,0),0),this.useGravity=!1,this.character=new tn,this.model=function(){var t=new kf(e),n=new Fi(2,2,4),i=new Gf({}),r=new Ei(n,i);t.add(r);var a=new Fi(1,1,3),o=new Gf({color:16711680}),s=new Ei(a,o);return s.position.z=2,t.add(s),e.scene.add(t),t.visible=!1,t.name="threePersonControls",t}();var i,r,a,o,s=this.model,l=10,A=1,c=20;this.rotationAngle=0;var h,u=!1,d=2,f=!1,p=new at,m=new at;Object.defineProperties(this,{model:{set:function(e){d=(s=e).boundingBox.getSize(new at).y;var t=s.boundingSphere;l=5*t.radius,A=1*t.radius,c=20*t.radius,s.name="threePersonControls"}},runAnimationName:{set:function(e){i=e}},upAnimationName:{set:function(e){a=e}},downAnimationName:{set:function(e){o=e}},jumpAnimationName:{set:function(e){r=e}},distance:{set:function(e){l=e}},maxDistance:{set:function(e){c=e}},minDistance:{set:function(e){A=e}},enabled:{get:function(){return u},set:function(t){t=u=Boolean(t),e.controls.enabled=!t,t?(this.connect(),h=e.camera.near,e.camera.near=.1,e.camera.updateProjectionMatrix(),e.addEventListener("update",K)):(this.disconnect(),e.camera.near=h,e.camera.updateProjectionMatrix(),e.removeEventListener("update",K))}},height:{get:function(){return d},set:function(e){d=e,F()}},showController:{get:function(){return f},set:function(t){(t=f=Boolean(t))?function(){if(Y)return void(Y.style.display="block");var t=e.container;t.style.position="relative";var n=Y=document.createElement("div");n.className="first_person_controller",Object.assign(n.style,{position:"absolute",bottom:"20px",right:"20px",width:"200px",height:"200px",backgroundColor:"rgba(0, 0, 0, 0.2)",borderRadius:"50%"});var i=document.createElement("div");Object.assign(i.style,{width:"100px",height:"100px",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.2)",cursor:"move",position:"absolute",top:"50px",left:"50px"}),n.appendChild(i),t.appendChild(n);var r={},a=!1,o=new tt;i.addEventListener(ld.START,(function(e){e.stopPropagation(),e=If.getTouchByEvent(e),p.set(e.pageX,e.pageY,0),0!=v.rotationAngle&&p.applyAxisAngle(new AMRT.Vector3(0,0,1),v.rotationAngle*Hh.DEG2RAD),i.style.backgroundColor="rgba(0, 0, 0, 0.6)",i.style.boxShadow="0 0 10px #000",r.x=p.x,r.y=p.y,a=!0})),t.addEventListener(ld.END,(function(e){i.style.backgroundColor="rgba(0, 0, 0, 0.2)",i.style.boxShadow="none",a=!1,i.style.left="50px",i.style.top="50px",M=b=C=B=!1})),t.addEventListener(ld.MOVE,(function(e){a&&(e=If.getTouchByEvent(e),p.set(e.pageX,e.pageY,0),0!=v.rotationAngle&&p.applyAxisAngle(new AMRT.Vector3(0,0,1),v.rotationAngle*Hh.DEG2RAD),o.set(Math.max(Math.min(p.x-r.x,100),-100),Math.max(Math.min(p.y-r.y,100),-100)),o.normalize(),o.x>0?(C=!1,B=!0):(C=!0,B=!1),o.y<0?(M=!1,b=!0):(M=!0,b=!1),o.multiplyScalar(50),i.style.left=o.x+50+"px",i.style.top=o.y+50+"px")}))}():Y&&(Y.style.display="none")}}});var v=this,g={type:"change"},y=new Bt(0,0,0,"YXZ"),w=Math.PI/2,x=new at,b=!1,M=!1,C=!1,B=!1,E=!1,S=!1,T=performance.now(),_=new at,I=new at,L=new Nc;function F(){v.character.min.set(-1,-d/2,-1),v.character.max.set(1,d/2,1),v.character.translate(s.position)}function k(e){switch(e.keyCode){case 38:case 87:b=!0;break;case 37:case 65:C=!0;break;case 40:case 83:M=!0;break;case 39:case 68:B=!0;break;case 82:E=!0;break;case 70:S=!0;break;case 32:v.jump()}}function P(e){switch(e.keyCode){case 38:case 87:b=!1;break;case 37:case 65:C=!1;break;case 40:case 83:M=!1;break;case 39:case 68:B=!1;break;case 82:E=!1;break;case 70:S=!1}}function U(e){0===e.button&&document.addEventListener(ld.MOVE,R,!1)}function D(){document.removeEventListener(ld.MOVE,R,!1)}function R(e){if(!1!==v.enabled){var n=e.movementX||e.mozMovementX||e.webkitMovementX||0,i=e.movementY||e.mozMovementY||e.webkitMovementY||0;m.set(n,i,0),0!=v.rotationAngle&&m.applyAxisAngle(new AMRT.Vector3(0,0,1),v.rotationAngle*Hh.DEG2RAD),y.setFromQuaternion(t.quaternion),y.y+=m.x*v.rotateSpeed,y.x-=m.y*v.rotateSpeed,y.x=Math.max(-w,Math.min(w,y.x)),t.quaternion.setFromEuler(y);var r=t.getWorldDirection(new at),a=s.getWorldPosition(new at).clone().addScaledVector(r,-l);v.dispatchEvent(g),t.position.copy(a)}}function O(e){!1!==v.enabled&&(e.deltaY<0?(--l<A&&(l=A),N()):e.deltaY>0&&(++l>c&&(l=c),N()))}function N(e){e||(e=t.getWorldDirection(new at).negate());var n=s.getWorldPosition(new at),i=n.clone().addScaledVector(e,l);t.position.copy(i),t.lookAt(n)}F(),new tn;var z,Q=new at,G=new at;function H(e,n,i){if(Math.abs(n)>0){i=i||e,s.recalculationBound();var r=s.boundingBox,a=s.position.clone(),o=a.clone().addScaledVector(i,n*l*1e4);a.addScaledVector(e,n),Q.set(0,0,0),Q.addScaledVector(e,n),r.copy(v.character),r.translate(Q);var A=(new at).subVectors(a,s.position).normalize();if(v.detectEnabled&&v.collider&&function(e,t){if(L.set(e.clone(),t),L.far=v.detectDistance,(Array.isArray(v.collider)?L.intersectObjects(v.collider,!0):L.intersectObject(v.collider,!0)).length>0)return!0}(a.clone(),A))return!1;var c=a.clone().sub(s.position);return s.position.copy(a),t.position.add(c),t.lookAt(a),v.useGravity&&r.intersectsPlane(v.floor)?(s.position.y=-v.floor.constant+v.height/2+.1,!1):(v.movingRegion&&(s.position.x=Math.max(Math.min(s.position.x,v.movingRegion.max.x),v.movingRegion.min.x),s.position.z=Math.max(Math.min(s.position.z,v.movingRegion.max.z),v.movingRegion.min.z)),s.lookAt(o),F(),!0)}}function V(e){this.preX=e.targetTouches[0].clientX,this.preY=e.targetTouches[0].clientY,document.addEventListener("touchmove",W,!1)}function j(){document.removeEventListener("touchmove",W,!1)}function W(e){if(!1!==v.enabled){var n=e.targetTouches[0].clientX-this.preX||0,i=e.targetTouches[0].clientY-this.preY||0;m.set(n,i,0),0!=v.rotationAngle&&m.applyAxisAngle(new AMRT.Vector3(0,0,1),v.rotationAngle*Hh.DEG2RAD),y.setFromQuaternion(t.quaternion),y.y-=m.x*v.rotateSpeed,y.x-=m.y*v.rotateSpeed,y.x=Math.max(-w,Math.min(w,y.x)),t.quaternion.setFromEuler(y);var r=t.getWorldDirection(new at),a=s.getWorldPosition(new at).clone().addScaledVector(r,-l);v.dispatchEvent(g),t.position.copy(a),this.preX=e.targetTouches[0].clientX,this.preY=e.targetTouches[0].clientY}}function X(e){if(s)if(e){if(e!=z)switch(e){case"run":s.animation.play(i);break;case"up":s.animation.play(a);break;case"down":s.animation.play(o);break;case"jump":s.animation.play(r);break;default:s.animation.stop()}}else s.animation.stop();z=e}this.setCollider=function(e){var t=this;this.collider=e;var n=Array.isArray(this.collider)?this.collider:[this.collider];this.targets=[],n.forEach((function(e){e.traverse((function(e){e.isMesh&&t.targets.push(e)}))}))},this.setRegion=function(e){v.movingRegion.setFromArray(e)},this.setFloorHeight=function(e){v.floor.constant=-e},this.setView=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};void 0!==t.position&&(Array.isArray(t.position)?s.position.fromArray(t.position):s.position.copy(t.position)),void 0!==t.rotation&&(Array.isArray(t.rotation)?s.rotation.fromArray(t.rotation):s.rotation.setFromVector3(t.rotation)),void 0!==t.cameraDirection?(e=Array.isArray(t.cameraDirection)?(new at).fromArray(t.cameraDirection):(new at).copy(t.cameraDirection)).normalize().negate():((e=s.getWorldDirection(new at)).y-=.4,e.normalize().negate()),t.distance&&(l=t.distance),t.minDistance&&(A=t.minDistance),t.maxDistance&&(c=t.maxDistance),N(e),F()},this.getView=function(){return{position:s.position.toArray(),rotation:s.rotation.toArray(),cameraDirection:t.getWorldDirection(new at),distance:l,minDistance:A,maxDistance:c}},this.connect=function(){document.addEventListener(ld.START,U,!1),document.addEventListener(ld.END,D,!1),document.addEventListener("keydown",k,!1),document.addEventListener("keyup",P,!1),document.addEventListener("touchstart",V,!1),document.addEventListener("touchend",j,!1),document.addEventListener("wheel",O,!1)},this.disconnect=function(){document.removeEventListener(ld.START,U,!1),document.removeEventListener(ld.END,D,!1),document.removeEventListener("keydown",k,!1),document.removeEventListener("keyup",P,!1),document.removeEventListener("touchstart",V,!1),document.removeEventListener("touchend",j,!1),document.removeEventListener("wheel",O,!1)},this.getDirection=function(){var e=new at(0,0,-1);return function(n){return n.copy(e).applyQuaternion(t.quaternion)}}(),this.moveForward=function(e){x.setFromMatrixColumn(t.matrix,2),x.y=0,x.normalize().negate(),H(x,e)},this.moveRight=function(e){x.setFromMatrixColumn(t.matrix,0),x.y=0,x.normalize().negate(),H(x,-e)},this.moveUp=function(e){return x.set(0,1,0),G.setFromMatrixColumn(t.matrix,2),G.y=0,G.normalize().negate(),H(x,e,G)},this.jump=function(){_.y+=50};var Y,K=function(){if(!0===v.enabled){var e=performance.now(),t=(e-T)/1e3;_.x-=10*_.x*t,_.z-=10*_.z*t,_.y-=10*_.y*t,I.z=Number(b)-Number(M),I.x=Number(B)-Number(C),I.y=Number(S)-Number(E),I.normalize(),b||M||C||B?((b||M)&&(_.z-=I.z*v.moveSpeed*t,this.moveForward(-_.z*t)),(C||B)&&(_.x-=I.x*v.moveSpeed*t,this.moveRight(-_.x*t)),X("run")):this.useGravity||E||S?this.useGravity?(_.y-=98*t,this.moveUp(_.y*t)||(_.y=0),X("jump")):(E||S)&&(_.y-=I.y*v.moveSpeed*t,this.lockHeight||(this.moveUp(_.y*t),s.position.y<this.minHeight&&(_.y=0,s.position.y=this.minHeight),_.y*t>0?X("up"):X("down"))):X("stop"),T=e}}.bind(this)}$p.prototype=Object.create(Je.prototype),$p.prototype.constructor=$p,em.prototype=Object.create(Je.prototype),em.prototype.constructor=em;var tm=function(e){h(n,e);var t=y(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(s(this,n),(i=t.call(this)).containerRect=null,i.camera=null,i.renderManager=null,i.sceneManager=null,i.disposed=!1,i.composer=null,i.moduleManager=null,i.controls=null,i.onControlsChange=null,i._options=r,e.constructor===String&&(e=document.querySelector("#"+e)||document.querySelector("."+e)),i.container=e||document.body,!r.nv){if(cu.init(r),r.offline)return g(i);if(void 0!==r.offlinekey)cu.offlineValidation((function(e){if(!e)throw new Error("授权失败!请检查您的开发者凭证。")}));else{var a=cu.checkDevloper();a?cu.token=a:i.dispose()}}return Object.defineProperty(window,"__viewer",{writable:!0,value:v(i)}),i}return A(n,[{key:"renderer",get:function(){return this.renderManager.defaultRenderer}},{key:"render",get:function(){return this.renderManager.render.bind(this.renderManager)}},{key:"domElement",get:function(){return this.renderManager.domElement}},{key:"scene",get:function(){return this.sceneManager.scene}},{key:"root",get:function(){return this.sceneManager.root}},{key:"modelGroup",get:function(){return this.sceneManager.modelGroup}},{key:"setSkyBox",get:function(){return this.sceneManager.setSkyBox.bind(this.sceneManager)}},{key:"setBackground",get:function(){return this.sceneManager.setBackground.bind(this.sceneManager)}},{key:"clearBackground",get:function(){return this.sceneManager.clearBackground.bind(this.sceneManager)}},{key:"loadSceneData",get:function(){return this.sceneManager.loadSceneData.bind(this.sceneManager)}},{key:"saveSceneData",get:function(){return this.sceneManager.saveSceneData.bind(this.sceneManager)}},{key:"fitCamera",get:function(){return this.sceneManager.fitCamera.bind(this.sceneManager)}},{key:"add",get:function(){return this.modelManager.add.bind(this.modelManager)}},{key:"remove",get:function(){return this.modelManager.remove.bind(this.modelManager)}},{key:"loadModel",get:function(){return this.modelManager.loadModel.bind(this.modelManager)}},{key:"initialize",value:function(e){var t=this;this.containerRect=this.container.getBoundingClientRect(),this.camera=new Ni(50,this.containerRect.width/this.containerRect.height,1,5e3),this.camera.position.set(0,0,1),this.renderManager=fd.create(this,e),this.renderManager.setCamera(this.camera),this.moduleManager=new qp(this),this.moduleManager.init(),this.renderManager.moduleManager=this.moduleManager,this.sceneManager=lp.create(this),this.modelManager=$f.create(this),this.renderManager.scene=this.scene,this.renderManager.camera=this.camera,this.renderManager.defaultCamera=this.camera,this.sceneManager.camera=this.camera,this.composer=new od(this),e.isMap?(this.renderer.domElement.style.pointerEvents="none",this.renderer.domElement.style.position="absolute",this.renderer.domElement.style.top=0,this.renderer.domElement.style.left=0,this.renderManager.setLoop(!1)):(this.renderManager.render(!0),this._initControls(),window.addEventListener("resize",(function(){t.resize()}),!1),this.container.addEventListener("resize",(function(){t.resize()}),!1)),this._proxyEvent()}},{key:"_initControls",value:function(){var e=this;this.controls=new yp(this),this.controls.screenSpacePanning=!0,this.controls.addEventListener(ld.CHANGE,(function(){e.sceneManager.lightFollow&&(e.sceneManager.directLight.position.copy(e.camera.position),e.sceneManager.updateShadowMaterial()),e.onControlsChange&&e.onControlsChange()})),this.controls.addEventListener(yp.VIEW_CHANGE,(function(t){e.controls.setViewMode(t.data)})),this.camera.defaultPos=this.camera.position.clone(),this.renderManager.addAfterRenderTask(this.controls.update.bind(this.controls)),this.firstPersonControls=new $p(this),this.threePersonControls=new em(this),this.viewCubeControls=new _p(this.container,30,5,this.controls),this.viewCubeControlsUpdate=this.viewCubeControls.update.bind(this.viewCubeControls),this.hideViewCube()}},{key:"_proxyEvent",value:function(){var e=this;this.renderManager.addEventListener(ld.UPDATE,(function(){e.controls.update(),e.dispatchEvent(ld.UPDATE)})),this.modelManager.addEventListener(ld.MODEL_UPDATE,(function(){e.dispatchEvent(ld.MODEL_UPDATE)}));var t=new tt,n=new tt;this.domElement.addEventListener("mousedown",(function(e){t.set(e.clientX,e.clientY)})),this.domElement.addEventListener("mouseup",(function(i){n.set(i.clientX,i.clientY),t.distanceTo(n)<5&&e.dispatchEvent(ld.CLICK,i)}))}},{key:"resize",value:function(){this.containerRect=this.container.getBoundingClientRect(),this.camera.aspect=this.containerRect.width/this.containerRect.height,this.camera.updateProjectionMatrix(),this.domElement.style.width=this.containerRect.width+"px",this.domElement.style.height=this.containerRect.height+"px",this.renderManager.resize()}},{key:"dispatchEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;b(u(n.prototype),"dispatchEvent",this).call(this,{type:e,data:t})}},{key:"getComponentInfo",value:function(e,t){e.traverseAncestors((function(n){n.isBIM&&n.getComponentInfo(e,t)}))}},{key:"showViewCube",value:function(){this.viewCubeControls.domElement.style.display="block",this.renderManager.addAfterRenderTask(this.viewCubeControlsUpdate)}},{key:"hideViewCube",value:function(){this.viewCubeControls.domElement.style.display="none",this.renderManager.removeAfterRenderTask(this.viewCubeControlsUpdate)}},{key:"setViewCube",value:function(e){this.viewCubeControls._cube.addModel(e)}},{key:"resetViewCube",value:function(){this.viewCubeControls._cube.removeModel()}},{key:"dispose",value:function(){this.sceneManager.dispose(),this.renderManager.dispose(),this.controls.dispose(),this.composer.dispose(),this.disposed=!0,this.container.innerHTML=""}}]),n}(Je);function nm(e,t,n,i){if(e instanceof Oi){console.warn("DragControls: Constructor now expects ( objects, camera, domElement )");var r=e;e=t,t=r}var a=new vn,o=new Nc;new tt;var s=new at,l=new at,A=new at,c=new bt,h=null,u=this;function d(){n.addEventListener("mousemove",p,!1),n.addEventListener("mousedown",m,!1),n.addEventListener("mouseup",v,!1),n.addEventListener("mouseleave",v,!1),n.addEventListener("touchmove",p,!1),n.addEventListener("touchstart",m,!1),n.addEventListener("touchend",v,!1)}function f(){n.removeEventListener("mousemove",p,!1),n.removeEventListener("mousedown",m,!1),n.removeEventListener("mouseup",v,!1),n.removeEventListener("mouseleave",v,!1),n.removeEventListener("touchmove",p,!1),n.removeEventListener("touchstart",m,!1),n.removeEventListener("touchend",v,!1)}function p(e){if(e.preventDefault(),g(e),h&&u.enabled)return o.ray.intersectPlane(a,l)&&h.position.copy(l.sub(s).applyMatrix4(c)),void u.dispatchEvent({type:"drag",object:h})}function m(e){e.preventDefault(),g(e),function(e,i){e.length>0&&(h=e[0].object,r=h,d=A.setFromMatrixPosition(r.matrixWorld),a.setFromNormalAndCoplanarPoint(t.getWorldDirection(a.normal),d),o.ray.intersectPlane(a,l)&&(c.getInverse(h.parent.matrixWorld),s.copy(l).sub(A.setFromMatrixPosition(h.matrixWorld))),n.style.cursor="move",u.dispatchEvent({type:"dragstart",object:h}));var r,d}(i.intersectModels(e))}function v(e){e.preventDefault(),u.dispatchEvent({type:"dragend",object:h}),h=null,n.style.cursor="auto"}function g(e){e=If.getTouchByEvent(e);var i=If.getDomMouse(e,n);o.setFromCamera(i,t)}d(),this.enabled=!0,this.activate=d,this.deactivate=f,this.dispose=function(){f()}}nm.prototype=Object.create(Je.prototype),nm.prototype.constructor=nm;var im,rm,am,om=new at,sm=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),(i=t.call(this)).viewer=e,i._enabled=!1,i._enableDrag=!1,i._startPoint=new tt,i._selected=null,i.selectedColor="#b2ac00",i.objects=[],i.dragControls=new nm(i.viewer.modelGroup,i.viewer.camera,i.viewer.domElement,i.viewer),i.dragControls.deactivate(),i.dragControls.enabled=!1,i.onChange=function(){},i._initEvents(),i}return A(n,[{key:"single",set:function(e){this._single=!!e}},{key:"enabled",get:function(){return this._enabled},set:function(e){this._enabled=e,this._initData()}},{key:"enableDrag",get:function(){return this._enableDrag},set:function(e){this._enableDrag=e,this.dragControls.enabled=e,this._enableDrag?this.dragControls.activate():this.dragControls.deactivate()}},{key:"_initEvents",value:function(){var e=this;this.viewer.domElement.addEventListener(ld.START,(function(t){t.constructor===MouseEvent&&0!==t.button||(t=If.getTouchByEvent(t),e._startPoint.set(t.clientX,t.clientY))})),this.viewer.domElement.addEventListener(ld.END,(function(t){if(t.constructor!==MouseEvent||0===t.button){t=If.getTouchByEvent(t);var n=e._startPoint.distanceTo(new tt(t.clientX,t.clientY));e.enabled&&!e._enableDrag&&n<5&&e.viewer.intersectModels(t,e._rayCasterHandler,e,e.viewer.scene)}})),this.dragControls.addEventListener("dragstart",(function(t){e.enableDrag&&(e.selected=t.object,e.viewer.controls.enabled=!1,e.selected&&om.copy(e.selected.position))})),this.dragControls.addEventListener("dragend",(function(t){e.enableDrag&&(e.viewer.controls.enabled=!0,e.selected&&!om.equals(e.selected.position)&&(e.onChange(),om.copy(e.selected.position)))})),this.viewer.addEventListener(ld.MODEL_UPDATE,(function(){e._enabled&&e._initData()}))}},{key:"_rayCasterHandler",value:function(e){e.length>0&&this.selected!=e[0].object?e[0].object.isHotSpotEntity||(this.selected=e[0].object,this.dispatchEvent(ld.CHANGE,this.selected)):0===e.length&&this.selected&&(this.selected=null,this.dispatchEvent(ld.CHANGE,this.selected))}},{key:"selected",get:function(){return this._selected},set:function(e){var t=this;if(this.selected&&(this.selected.material=this.selected.material0,this.selected.transparent&&(this.selected.material=this._cloneMate(this.selected.material),this.transparent(this.selected))),this._selected=e,!this._selected)return this.viewer.composer.enableOutline=!1,this.viewer.composer.outline.pass.edgeThickness=2,void(this.viewer.composer.outline.pass.edgeStrength=6.5);(this.viewer.composer.enableOutline||(this.viewer.composer.enableOutline=!0,this.viewer.composer.outline.pass.edgeThickness=1,this.viewer.composer.outline.pass.edgeStrength=4.5),this._selected.isMesh||this._selected.intanceObject)&&(this._selected.material=this._cloneMate(this._selected.material),(Array.isArray(this._selected.material)?this._selected.material:[this._selected.material]).forEach((function(e){e.isAMRTBasicMaterial&&e.color.setStyle(t.selectedColor)})),this._selected.transparent&&this.transparent(this._selected),this.viewer.composer.outline.pass.selectedObjects=[this._selected])}},{key:"unSelected",value:function(e){e.isMesh&&(e.material=e.material0)}},{key:"toggleDisplay",value:function(){this.objects.forEach((function(e){e.visible=!e.visible})),this.viewer.renderManager.render(),this.onChange()}},{key:"hide",value:function(){this.selected&&(this.selected&&(this.selected.visible=!1),this.onChange())}},{key:"showAlone",value:function(){this.selected&&(this.objects.forEach((function(e){e.visible=!1})),this.selected.visible=!0,this.onChange())}},{key:"showAll",value:function(){this.objects.forEach((function(e){e.visible=!0})),this.onChange()}},{key:"transparent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selected;if(e){e.transparent=!0;var t=Array.isArray(e.material)?e.material:[e.material];t.forEach((function(e){e.isAMRTBasicMaterial&&(e.opacity0=void 0!==e.opacity0?e.opacity0:e.opacity,e.transparent0=void 0!==e.transparent0?e.transparent0:e.transparent,e.opacity=.15,e.transparent=!0)}))}this.onChange()}},{key:"unTransparent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.selected;e&&(Array.isArray(e.material)?e.material.forEach((function(e){e.isAMRTBasicMaterial&&(e.opacity=e.opacity0,e.transparent=e.transparent0)})):(e.material.opacity=void 0!==e.material.opacity0?e.material.opacity0:1,e.material.transparent=e.material.transparent0),e.transparent=!1),this.onChange()}},{key:"translucenceOthers",value:function(e){var t=this;this.objects.forEach((function(n){n!==e&&n.visible&&t.transparent(n)}))}},{key:"restore",value:function(){var e=this;this.objects.forEach((function(t){e.restoreObject(t)})),this.onChange(),this.selected=null}},{key:"restoreObject",value:function(e){e&&(e.visible||(e.visible=!0),this.restoreMaterial(e),this.restorePosition(e),e.transparent=e.transparent0,e==this.selected&&(this.selected=null))}},{key:"restoreMaterial",value:function(e){e&&(e.material=e.material0,(Array.isArray(e.material)?e.material:[e.material]).forEach((function(e){e.isAMRTBasicMaterial&&(e.opacity=e.opacity0,e.transparent=e.transparent0)})),this.viewer.renderManager.render())}},{key:"restorePosition",value:function(e){e&&e.position.copy(e.position0)}},{key:"dispose",value:function(){this.dragControls.enabled=!1,this.dragControls.deactivate()}},{key:"_initData",value:function(){var e=this;this.objects=[],this.viewer.modelGroup.traverse((function(t){t.isMesh&&(e.objects.push(t),t.material0||(t.position0=t.position.clone(),(Array.isArray(t.material)?t.material:[t.material]).forEach((function(e){e.isAMRTBasicMaterial&&(e.opacity0=e.opacity,e.transparent0=e.transparent)})),t.material0=t.material))}))}},{key:"_cloneMate",value:function(e){var t;return Array.isArray(e)?(t=[],e.forEach((function(e){if(e.isAMRTBasicMaterial){var n=e.clone();n.opacity0=e.opacity0,n.transparent0=e.transparent0,t.push(n)}else t.push(e)}))):((t=e.clone()).opacity0=e.opacity0,t.transparent0=e.transparent0),t}}]),n}(Cd),lm=function(){var e=new Wi,t=new at,n=new at,i=new at,r=new at,a=new at,o=new at,s=new at,l=new at,A=new at,c=new at,h=new at,u=new at,d=new at,f=new at;function p(e,t,n){this.camera=e,this.scene=t,this.startPoint=new at,this.endPoint=new at,this.collection=[],this.deep=n||Number.MAX_VALUE}return p.prototype.select=function(t,n){return this.startPoint=t||this.startPoint,this.endPoint=n||this.endPoint,this.collection=[],this.updateFrustum(this.startPoint,this.endPoint),this.searchChildInFrustum(e,this.scene),this.collection},p.prototype.updateFrustum=function(t,p){if(t=t||this.startPoint,p=p||this.endPoint,t.x===p.x&&(p.x+=Number.EPSILON),t.y===p.y&&(p.y+=Number.EPSILON),this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(),this.camera.isPerspectiveCamera)n.copy(t),n.x=Math.min(t.x,p.x),n.y=Math.max(t.y,p.y),p.x=Math.max(t.x,p.x),p.y=Math.min(t.y,p.y),i.setFromMatrixPosition(this.camera.matrixWorld),r.copy(n),a.set(p.x,n.y,0),o.copy(p),s.set(n.x,p.y,0),r.unproject(this.camera),a.unproject(this.camera),o.unproject(this.camera),s.unproject(this.camera),u.copy(r).sub(i),d.copy(a).sub(i),f.copy(o).sub(i),u.normalize(),d.normalize(),f.normalize(),u.multiplyScalar(this.deep),d.multiplyScalar(this.deep),f.multiplyScalar(this.deep),u.add(i),d.add(i),f.add(i),(m=e.planes)[0].setFromCoplanarPoints(i,r,a),m[1].setFromCoplanarPoints(i,a,o),m[2].setFromCoplanarPoints(o,s,i),m[3].setFromCoplanarPoints(s,r,i),m[4].setFromCoplanarPoints(a,o,s),m[5].setFromCoplanarPoints(f,d,u),m[5].normal.multiplyScalar(-1);else if(this.camera.isOrthographicCamera){var m,v=Math.min(t.x,p.x),g=Math.max(t.y,p.y),y=Math.max(t.x,p.x),w=Math.min(t.y,p.y);r.set(v,g,-1),a.set(y,g,-1),o.set(y,w,-1),s.set(v,w,-1),l.set(v,g,1),A.set(y,g,1),c.set(y,w,1),h.set(v,w,1),r.unproject(this.camera),a.unproject(this.camera),o.unproject(this.camera),s.unproject(this.camera),l.unproject(this.camera),A.unproject(this.camera),c.unproject(this.camera),h.unproject(this.camera),(m=e.planes)[0].setFromCoplanarPoints(r,l,A),m[1].setFromCoplanarPoints(a,A,c),m[2].setFromCoplanarPoints(c,h,s),m[3].setFromCoplanarPoints(h,l,r),m[4].setFromCoplanarPoints(a,o,s),m[5].setFromCoplanarPoints(c,A,l),m[5].normal.multiplyScalar(-1)}else console.error("SelectionBox: Unsupported camera type.")},p.prototype.searchChildInFrustum=function(e,n){if("_shadow.mesh"!=n.name&&((n.isMesh||n.isLine||n.isPoints)&&void 0!==n.material&&(null===n.geometry.boundingSphere&&n.geometry.computeBoundingSphere(),t.copy(n.geometry.boundingSphere.center),t.applyMatrix4(n.matrixWorld),e.containsPoint(t)&&this.collection.push(n)),n.children.length>0))for(var i=0;i<n.children.length;i++)this.searchChildInFrustum(e,n.children[i])},p}(),Am=function(){function e(e,t,n){this.enabled=!1,this.element=document.createElement("div"),this.element.classList.add(n),this.element.style.pointerEvents="none",this.renderer=t,this.startPoint=new tt,this.pointTopLeft=new tt,this.pointBottomRight=new tt,this.isDown=!1,this.renderer.domElement.addEventListener("pointerdown",function(e){this.enabled&&(this.isDown=!0,this.onSelectStart(e))}.bind(this)),this.renderer.domElement.addEventListener("pointermove",function(e){this.enabled&&this.isDown&&this.onSelectMove(e)}.bind(this)),this.renderer.domElement.addEventListener("pointerup",function(e){this.enabled&&(this.isDown=!1,this.onSelectOver(e))}.bind(this))}return e.prototype.onSelectStart=function(e){this.renderer.domElement.parentElement.appendChild(this.element),this.element.style.left=e.clientX+"px",this.element.style.top=e.clientY+"px",this.element.style.width="0px",this.element.style.height="0px",this.startPoint.x=e.clientX,this.startPoint.y=e.clientY},e.prototype.onSelectMove=function(e){this.pointBottomRight.x=Math.max(this.startPoint.x,e.clientX),this.pointBottomRight.y=Math.max(this.startPoint.y,e.clientY),this.pointTopLeft.x=Math.min(this.startPoint.x,e.clientX),this.pointTopLeft.y=Math.min(this.startPoint.y,e.clientY),this.element.style.left=this.pointTopLeft.x+"px",this.element.style.top=this.pointTopLeft.y+"px",this.element.style.width=this.pointBottomRight.x-this.pointTopLeft.x+"px",this.element.style.height=this.pointBottomRight.y-this.pointTopLeft.y+"px"},e.prototype.onSelectOver=function(){this.element.parentElement.removeChild(this.element)},e}(),cm="",hm=!1,um=[],dm=[],fm=[],pm=[],mm={},vm=!1,gm=!1,ym=new Ml({color:16711680,transparent:!0,opacity:.5}),wm=function(e){h(i,e);var t=y(i);function i(e,n){var r;s(this,i),(r=t.call(this)).selected=null,r.selectedMaterial=null,r.selectable=!0,r.boxSelected=[],r.onChange=function(){},r.onError=function(){},im=e,r.mapLoader=new Kf(im);var a=new tt,o=im.domElement,l=o.clientWidth,A=o.clientHeight;return im.domElement.addEventListener(ld.START,(function(e){hm&&(e.constructor===MouseEvent&&0!==e.button||(e=If.getTouchByEvent(e),vm?(r.selectedMaterial&&r._onChange(null),r.boxSelected=[],fm.map((function(e){return e.material=e.material_0})),rm.startPoint.set((e.clientX-im.containerRect.x)/l*2-1,-(e.clientY-im.containerRect.y)/A*2+1,.5)):a.set(e.clientX,e.clientY)))})),im.domElement.addEventListener(ld.MOVE,(function(e){if(hm&&vm&&am.isDown){for(var t=0;t<rm.collection.length;t++){var n=rm.collection[t];n.material=n.material_0}rm.endPoint.set((e.clientX-im.containerRect.x)/l*2-1,-(e.clientY-im.containerRect.y)/A*2+1,.5),r.boxSelected.length=0;for(var i=rm.select(),a=0;a<i.length;a++)i[a].material=i[a].material.map((function(e){return e.isAMRTShadowMaterial?e:ym})),r.boxSelected.push(i[a])}})),im.domElement.addEventListener(ld.END,(function(e){if(hm&&(e.constructor!==MouseEvent||0===e.button))if(e=If.getTouchByEvent(e),vm){rm.endPoint.set((e.clientX-im.containerRect.x)/l*2-1,-(e.clientY-im.containerRect.y)/A*2+1,.5);var t=rm.select();r.boxSelected.length=0;for(var n=0;n<t.length;n++)t[n].material=t[n].material.map((function(e){return e.isAMRTShadowMaterial?e:ym})),r.boxSelected.push(t[n])}else{if(!r.selectable)return;var i=a.distanceTo(new tt(e.clientX,e.clientY));!r._enableDrag&&i<5&&(r.enableMutilpeSelection||r.boxSelected.length>0&&(r.boxSelected.length=0,r.clearBoxSelected()),im.intersectModels(e,(function(e){if(r.enableMutilpeSelection){r._onChange(null);var t=e[0]?e[0].object:null;t&&(r.boxSelected.includes(t)?(t.material=t.material_0,r.boxSelected.remove(t)):(t.material=t.material.map((function(e){return e.isAMRTShadowMaterial?e:ym})),r.boxSelected.push(t)))}else r._onChange(e.length>0?e[0]:null)}),v(r)))}})),n&&n.isModel&&r.setTarget(n),r}return A(i,[{key:"newMaterials",get:function(){return um}},{key:"materials",get:function(){return dm}},{key:"mode",get:function(){return cm},set:function(e){cm=e,this.selectedMaterial=null,this.selected=null,im.composer.outline.pass.selectedObjects=pm=[]}},{key:"enabled",get:function(){return hm},set:function(e){hm!=e&&(e?(im.composer.enableOutline=!0,im.composer.outline.pass.edgeGlow=0,im.composer.outline.pass.edgeThickness=1,im.composer.outline.pass.edgeStrength=4.5):(im.composer.enableOutline=!1,im.composer.outline.pass.edgeGlow=1,im.composer.outline.pass.edgeThickness=2,im.composer.outline.pass.edgeStrength=6.5,this.selected=null,this.selectedMaterial=null,fm=[],dm=[],pm=[],mm={}),hm=e)}},{key:"enableBoxSelection",get:function(){return vm},set:function(e){e!==vm&&(e?(rm||(rm=new lm(im.camera,im.modelGroup)),am||(am=new Am(rm,im.renderer,"selectBox")),this.selectionBox=rm,am.enabled=!0,am.element.style.display="block",im.controls.enabled=!1):(am.enabled=!1,im.controls.enabled=!0,am.element.style.display="none"),vm=e)}},{key:"enableMutilpeSelection",get:function(){return gm},set:function(e){e!==gm&&(gm=e)}},{key:"clearBoxSelected",value:function(){fm.map((function(e){e.material[0]===ym&&e.material_0&&(e.material=e.material_0)}))}},{key:"_onChange",value:function(e){var t=e?e.object:null;if(t){var n,i=e.faceIndex;t.geometry.groups.forEach((function(e){i>=e.start&&i<e.start+e.count&&!t.material[e.materialIndex].isAMRTShadowMaterial&&(n=t.material[e.materialIndex])})),this.setOutlineObjects(t,n)}else this.clearSelected();this.dispatchEvent(ld.CHANGE,this.selectedMaterial),this.onChange&&this.onChange(this.selectedMaterial)}},{key:"clearSelected",value:function(){im.composer.outline.pass.selectedObjects=pm=[],this.selectedMaterial=null,this.selected=null,dm.map((function(e){e.skinning_0&&(e.skinning=!0,e.needsUpdate=!0)}))}},{key:"setTarget",value:function(e){this.enabled=!1,e&&e.isModel&&(this.model=e,e.traverse((function(e){e.isMesh&&((Array.isArray(e.material)?e.material:[e.material]).forEach((function(e){e.skinning_0=Boolean(e.skinning),dm.indexOf(e)<0&&e.isAMRTBasicMaterial&&dm.push(e)})),e.material_0=e.material,fm.push(e))})),this.enabled=!0,void 0===this.model.materialRecords&&(this.model.materialRecords=[])),this.getAllMaterials()}},{key:"getAllMaterials",value:function(){return dm=this.model.materials,um.map((function(e){dm.includes(e)||dm.push(e)})),dm.filter((function(e){return void 0===e.re}))}},{key:"setSelectedMaterial",value:function(e){var t=this;e.isAMRTBasicMaterial&&(im.composer.outline.pass.selectedObjects=pm=[],void 0!==e.re?this.selectedMaterial=dm.find((function(t){return t.ID===e.re})):this.selectedMaterial=e,this.selectedMaterial.skinning=e.skinning,fm.forEach((function(e){var n=Array.isArray(e.material)?e.material:[e.material],i=!1;n.forEach((function(e){t.selectedMaterial.id!==e.id&&t.selectedMaterial.ID!==e.re||(i=!0)})),i&&(e.isSkinnedMesh?t.selectedMaterial.skinning=!0:t.selectedMaterial.skinning=!1,pm.push(e))})),this.selected=pm[0],im.renderManager.render())}},{key:"setSelectedMesh",value:function(e){e.isMesh&&(im.composer.outline.pass.selectedObjects=pm=[e],this.selected=e,this.selectedMaterial=e.material[0],im.renderManager.render())}},{key:"setOutlineObjects",value:function(e,t){"MESH"==this.mode.toLocaleUpperCase()?(this.setSelectedMesh(e),this.selectedMaterial=t):(this.setSelectedMaterial(t),this.selected=e)}},{key:"cloneMaterial",value:function(e){if(e||(e=this.selectedMaterial),!e)return console.error("请选中需要克隆材质!");var t=e.clone();return t.sname=this._generateMaterialName(e.sname||e.name.toString()),t.ID=t.name=this._generateMaterialID(),um.push(t),this.getAllMaterials(),t}},{key:"createMaterial",value:function(e){if(this.getAllMaterials(),dm.find((function(t){return t.name===e})))return console.error("创建失败: 材质名称 ".concat(e," 已存在!"));var t=new El;return t.sname=e,t.ID=t.name=this._generateMaterialID(),um.push(t),this.getAllMaterials(),t}},{key:"_generateMaterialName",value:function(e){this.getAllMaterials();for(var t=e.split("(")[0],n=1;i(t+"("+n+")");)n++;return t+"("+n+")";function i(e){return dm.find((function(t){return t.sname===e}))}}},{key:"_generateMaterialID",value:function(){var e=dm.map((function(e){return e.ID}));return Math.max.apply(Math,C(e))+um.length+1}},{key:"applyMaterial",value:function(e,t){var n=this;if(("Mesh"===e.type||"SkinnedMesh"===e.type)&&"AMRTBasicMaterial"===t.type)return e.overMaterial=[],e.material.map((function(i,r){i.isAMRTBasicMaterial&&(n.model.materialRecords.find((function(t){return t.a===e.id}))||n.model.materialRecords.unshift({a:e.id,b:r,c:i.name}),e.isSkinnedMesh&&(t.skinning=!0),e.material[r]=t,e.overMaterial.push(r))})),e.material_0=e.material,t}},{key:"hide",value:function(e){e||(e=this.selectedMaterial),this.boxSelected.length>0&&this.boxSelected.map((function(e){return e.visible=!1})),e&&fm.map((function(t){t.material.forEach((function(n){e.id!==n.id&&e.ID!==n.re||(t.visible=!1)}))}))}},{key:"show",value:function(e){(this.selectedMaterial||e)&&(e=e?dm.find((function(t){return t.id===e.id})):this.selectedMaterial,fm.forEach((function(t){t.material.find((function(t){return t.id===e.id||t.re===e.ID}))&&(t.visible=!0,t.material.map((function(e){return e.visible=!0})))})))}},{key:"showAll",value:function(){fm.forEach((function(e){e.visible||(e.visible=!0)}))}},{key:"showIndependent",value:function(e){(this.selectedMaterial||e)&&(e=e?dm.find((function(t){return t.id===e.id})):this.selectedMaterial,fm.forEach((function(t){t.visible=Boolean(t.material.find((function(t){return t.id===e.id||t.re===e.ID})))})))}},{key:"toggleDisplay",value:function(){fm.forEach((function(e){e.visible=!e.visible}))}},{key:"setColor",value:function(e){this._applyParams("color",e,"color")}},{key:"getColor",value:function(){return this._getParams("color")}},{key:"setRepeat",value:function(e,t){this.selectedMaterial&&this.selectedMaterial.albedo&&this.selectedMaterial.albedo.repeat.set(e,t),im.renderManager.render()}},{key:"getRepeat",value:function(){if(this.selectedMaterial&&this.selectedMaterial.albedo)return this.selectedMaterial.albedo.repeat}},{key:"setRotation",value:function(e){this.selectedMaterial&&this.selectedMaterial.albedo&&(this.selectedMaterial.albedo.rotation=Math.PI/180*e),im.renderManager.render()}},{key:"getRotation",value:function(){if(this.selectedMaterial&&this.selectedMaterial.albedo)return 180*this.selectedMaterial.albedo.rotation/Math.PI}},{key:"setOffset",value:function(e,t){this.selectedMaterial&&this.selectedMaterial.albedo&&this.selectedMaterial.albedo.offset.set(e,t),im.renderManager.render()}},{key:"getOffset",value:function(e){if(this.selectedMaterial&&this.selectedMaterial.albedo)return this.selectedMaterial.albedo.offset}},{key:"setAlbedoMap",value:function(e){this._applyParams("albedo",e,"map"),im.renderManager.render()}},{key:"getAlbedoMap",value:function(){return this._getParams("albedo")}},{key:"clearAlbedoMap",value:function(){this.selectedMaterial&&(this.selectedMaterial.albedo=null,this.selectedMaterial.needsUpdate=!0,im.renderManager.render())}},{key:"setAlbedoUV",value:function(e){this._applyParams("albedoUV",parseInt(e)),im.renderManager.render()}},{key:"getAlbedoUV",value:function(){return Number(this._getParams("albedoUV"))}},{key:"setNormalMap",value:function(e){this._applyParams("normalMap",e,"map")}},{key:"getNormalMap",value:function(){return this._getParams("normalMap")}},{key:"setNormalScale",value:function(e){this._applyParams("normalScale",e)}},{key:"getNormalScale",value:function(){return this._getParams("normalScale")}},{key:"setNormalRepeat",value:function(e,t){this.selectedMaterial&&this.selectedMaterial.normalMap&&this.selectedMaterial.normalMap.repeat.set(e,t),im.renderManager.render()}},{key:"getNormalRepeat",value:function(){if(this.selectedMaterial&&this.selectedMaterial.normalMap)return this.selectedMaterial.normalMap.repeat}},{key:"setNormalRotation",value:function(e){this.selectedMaterial&&this.selectedMaterial.normalMap&&(this.selectedMaterial.normalMap.rotation=Math.PI/180*e),im.renderManager.render()}},{key:"getNormalRotation",value:function(){if(this.selectedMaterial&&this.selectedMaterial.normalMap)return 180*this.selectedMaterial.normalMap.rotation/Math.PI}},{key:"setNormalOffset",value:function(e,t){this.selectedMaterial&&this.selectedMaterial.normalMap&&this.selectedMaterial.normalMap.offset.set(e,t),im.renderManager.render()}},{key:"getNormalOffset",value:function(e){if(this.selectedMaterial&&this.selectedMaterial.normalMap)return this.selectedMaterial.normalMap.offset}},{key:"setNormal2Map",value:function(e){this._applyParams("normalMap2",e,"map")}},{key:"getNormal2Map",value:function(){return this._getParams("normalMap2")}},{key:"setNormal2Scale",value:function(e){this._applyParams("normalScale2",e)}},{key:"getNormal2Scale",value:function(){return this._getParams("normalScale2")}},{key:"setNormal2Repeat",value:function(e,t){this.selectedMaterial&&this.selectedMaterial.normalMap2&&this.selectedMaterial.normalMap2.repeat.set(e,t),im.renderManager.render()}},{key:"getNormal2Repeat",value:function(){if(this.selectedMaterial&&this.selectedMaterial.normalMap2)return this.selectedMaterial.normalMap2.repeat}},{key:"setNormal2Rotation",value:function(e){this.selectedMaterial&&this.selectedMaterial.normalMap2&&(this.selectedMaterial.normalMap2.rotation=Math.PI/180*e),im.renderManager.render()}},{key:"setSide",value:function(e){e<0||e>2||this._applyParams("side",e)}},{key:"getSide",value:function(){return this.selectedMaterial.side}},{key:"getNormal2Rotation",value:function(){if(this.selectedMaterial&&this.selectedMaterial.normalMap2)return 180*this.selectedMaterial.normalMap2.rotation/Math.PI}},{key:"setNormal2Offset",value:function(e,t){this.selectedMaterial&&this.selectedMaterial.normalMap2&&this.selectedMaterial.normalMap2.offset.set(e,t),im.renderManager.render()}},{key:"getNormal2Offset",value:function(e){if(this.selectedMaterial&&this.selectedMaterial.normalMap2)return this.selectedMaterial.normalMap2.offset}},{key:"setMetallicMap",value:function(e){this._applyParams("metallicMap",e,"map")}},{key:"setMetallicRepeat",value:function(e,t){this.selectedMaterial&&this.selectedMaterial.metallicMap&&this.selectedMaterial.metallicMap.repeat.set(e,t),im.renderManager.render()}},{key:"getMetallicRepeat",value:function(){if(this.selectedMaterial&&this.selectedMaterial.metallicMap)return this.selectedMaterial.metallicMap.repeat}},{key:"setMetallicRotation",value:function(e){this.selectedMaterial&&this.selectedMaterial.metallicMap&&(this.selectedMaterial.metallicMap.rotation=Math.PI/180*e),im.renderManager.render()}},{key:"getMetallicRotation",value:function(){if(this.selectedMaterial&&this.selectedMaterial.metallicMap)return 180*this.selectedMaterial.metallicMap.rotation/Math.PI}},{key:"setMetallicOffset",value:function(e,t){this.selectedMaterial&&this.selectedMaterial.metallicMap&&this.selectedMaterial.metallicMap.offset.set(e,t),im.renderManager.render()}},{key:"getMetallicOffset",value:function(e){this.selectedMaterial&&this.selectedMaterial.metallicMap&&this.selectedMaterial.metallicMap.offset}},{key:"setMetallic",value:function(e){this._applyParams("metallic",e)}},{key:"getMetallic",value:function(){return this._getParams("metallic")}},{key:"setRoughnessMap",value:function(e){this._applyParams("roughnessMap",e,"map")}},{key:"setRoughnessRepeat",value:function(e,t){this.selectedMaterial&&this.selectedMaterial.roughnessMap&&this.selectedMaterial.roughnessMap.repeat.set(e,t),im.renderManager.render()}},{key:"getRoughnessRepeat",value:function(){if(this.selectedMaterial&&this.selectedMaterial.roughnessMap)return this.selectedMaterial.roughnessMap.repeat}},{key:"setRoughnessRotation",value:function(e){this.selectedMaterial&&this.selectedMaterial.roughnessMap&&(this.selectedMaterial.roughnessMap.rotation=Math.PI/180*e),im.renderManager.render()}},{key:"getRoughnessRotation",value:function(){return this.selectedMaterial&&this.selectedMaterial.roughnessMap?180*this.selectedMaterial.roughnessMap.rotation/Math.PI:null}},{key:"setRoughnessOffset",value:function(e,t){this.selectedMaterial&&this.selectedMaterial.roughnessMap&&this.selectedMaterial.roughnessMap.offset.set(e,t),im.renderManager.render()}},{key:"getRoughnessOffset",value:function(){return this.selectedMaterial&&this.selectedMaterial.roughnessMap?this.selectedMaterial.roughnessMap.offset:null}},{key:"setSmoothness",value:function(e){this._applyParams("smoothness",e)}},{key:"getSmoothness",value:function(){return this._getParams("smoothness")}},{key:"setAOMap",value:function(e,t){this._applyParams("aoMap",e,"map")}},{key:"clearAOMap",value:function(){this.selectedMaterial?(this.selectedMaterial.aoMap=null,this.selectedMaterial.needsUpdate=!0,im.renderManager.render()):this.onError("未选择材质对象")}},{key:"getAOMap",value:function(){return this._getParams("aoMap")}},{key:"setAORepeat",value:function(e,t){this.selectedMaterial&&this.selectedMaterial.aoMap&&this.selectedMaterial.aoMap.repeat.set(e,t),im.renderManager.render()}},{key:"getAORepeat",value:function(){if(this.selectedMaterial&&this.selectedMaterial.aoMap)return this.selectedMaterial.aoMap.repeat}},{key:"setAORotation",value:function(e){this.selectedMaterial&&this.selectedMaterial.aoMap&&(this.selectedMaterial.aoMap.rotation=Math.PI/180*e),im.renderManager.render()}},{key:"getAORotation",value:function(){if(this.selectedMaterial&&this.selectedMaterial.aoMap)return 180*this.selectedMaterial.aoMap.rotation/Math.PI}},{key:"setAOOffset",value:function(e,t){this.selectedMaterial&&this.selectedMaterial.aoMap&&this.selectedMaterial.aoMap.offset.set(e,t),im.renderManager.render()}},{key:"getAOOffset",value:function(e){if(this.selectedMaterial&&this.selectedMaterial.aoMap)return this.selectedMaterial.aoMap.offset}},{key:"setAOScale",value:function(e){this._applyParams("aoScale",e)}},{key:"getAOScale",value:function(){return this._getParams("aoScale")}},{key:"setAOUV",value:function(e){this._applyParams("aoUV",parseInt(e))}},{key:"getAOUV",value:function(){return this._getParams("aoUV")}},{key:"setEmissiveMap",value:function(e){this._applyParams("emissiveMap",e,"map")}},{key:"setEmissiveRepeat",value:function(e,t){this.selectedMaterial&&this.selectedMaterial.emissiveMap&&this.selectedMaterial.emissiveMap.repeat.set(e,t),im.renderManager.render()}},{key:"getEmissiveRepeat",value:function(){if(this.selectedMaterial&&this.selectedMaterial.emissiveMap)return this.selectedMaterial.emissiveMap.repeat}},{key:"setEmissiveRotation",value:function(e){this.selectedMaterial&&this.selectedMaterial.emissiveMap&&(this.selectedMaterial.emissiveMap.rotation=Math.PI/180*e),im.renderManager.render()}},{key:"getEmissiveRotation",value:function(){if(this.selectedMaterial&&this.selectedMaterial.emissiveMap)return 180*this.selectedMaterial.emissiveMap.rotation/Math.PI}},{key:"setEmissiveOffset",value:function(e,t){this.selectedMaterial&&this.selectedMaterial.emissiveMap&&this.selectedMaterial.emissiveMap.offset.set(e,t),im.renderManager.render()}},{key:"getEmissiveOffset",value:function(e){if(this.selectedMaterial&&this.selectedMaterial.emissiveMap)return this.selectedMaterial.emissiveMap.offset}},{key:"setEmissiveColor",value:function(e){this._applyParams("emissive",e,"color")}},{key:"getEmissiveColor",value:function(){return this._getParams("emissive")}},{key:"setEmissiveUV",value:function(e){this._applyParams("emissiveUV",e)}},{key:"getEmissiveUV",value:function(){return this._getParams("emissiveUV")}},{key:"setReflectMap",value:function(e){this._applyParams("reflectMap",e,"map")}},{key:"setReflectRepeat",value:function(e,t){this.selectedMaterial&&this.selectedMaterial.reflectMap&&this.selectedMaterial.reflectMap.repeat.set(e,t),im.renderManager.render()}},{key:"getReflectRepeat",value:function(){if(this.selectedMaterial&&this.selectedMaterial.reflectMap)return this.selectedMaterial.reflectMap.repeat}},{key:"setReflectRotation",value:function(e){this.selectedMaterial&&this.selectedMaterial.reflectMap&&(this.selectedMaterial.reflectMap.rotation=Math.PI/180*e),im.renderManager.render()}},{key:"getReflectRotation",value:function(){if(this.selectedMaterial&&this.selectedMaterial.reflectMap)return 180*this.selectedMaterial.reflectMap.rotation/Math.PI}},{key:"setReflectOffset",value:function(e,t){this.selectedMaterial&&this.selectedMaterial.reflectMap&&this.selectedMaterial.reflectMap.offset.set(e,t),im.renderManager.render()}},{key:"getReflectOffset",value:function(e){if(this.selectedMaterial&&this.selectedMaterial.reflectMap)return this.selectedMaterial.reflectMap.offset}},{key:"setReflectIntensity",value:function(e){this._applyParams("reflectIntensity",e)}},{key:"getReflectIntensity",value:function(){return this._getParams("reflectIntensity")}},{key:"setReflectivity",value:function(e){this._applyParams("reflectivity",e)}},{key:"getReflectivity",value:function(){return this._getParams("reflectivity")}},{key:"setAlphaMap",value:function(e){this._applyParams("alphaMap",e,"map")}},{key:"setAlphaMapRepeat",value:function(e,t){this.selectedMaterial&&this.selectedMaterial.alphaMap&&this.selectedMaterial.alphaMap.repeat.set(e,t)}},{key:"getAlphaMapRepeat",value:function(){if(this.selectedMaterial&&this.selectedMaterial.alphaMap)return this.selectedMaterial.alphaMap.repeat}},{key:"setAlphaMapRotation",value:function(e){this.selectedMaterial&&this.selectedMaterial.alphaMap&&(this.selectedMaterial.alphaMap.rotation=Math.PI/180*e)}},{key:"getAlphaMapRotation",value:function(){if(this.selectedMaterial&&this.selectedMaterial.alphaMap)return 180*this.selectedMaterial.alphaMap.rotation/Math.PI}},{key:"setAlphaMapOffset",value:function(e,t){this.selectedMaterial&&this.selectedMaterial.alphaMap&&this.selectedMaterial.alphaMap.offset.set(e,t)}},{key:"getAlphaMapOffset",value:function(){if(this.selectedMaterial&&this.selectedMaterial.alphaMap)return this.selectedMaterial.alphaMap.offset}},{key:"setRefractionRatio",value:function(e){this._applyParams("refractionRatio",e)}},{key:"getRefractionRatio",value:function(){return this._getParams("refractionRatio")}},{key:"setTransparency",value:function(e){this._applyParams("transparency",e),this._updateTransparent()}},{key:"_updateTransparent",value:function(){this.selectedMaterial&&(this.selectedMaterial.opacity<1||this.selectedMaterial.transparency>0||this.selectedMaterial.alphaMap?this.selectedMaterial.transparent=!0:1!=this.selectedMaterial.opacity||0!=this.selectedMaterial.transparency||this.selectedMaterial.alphaMap||(this.selectedMaterial.transparent=!1))}},{key:"getTransparency",value:function(){return this._getParams("transparency")}},{key:"setOpacity",value:function(e){this._applyParams("opacity",e),this._updateTransparent()}},{key:"getOpacity",value:function(){return this._getParams("opacity")}},{key:"setTransparent",value:function(e){this._applyParams("transparent",Boolean(e))}},{key:"getTransparent",value:function(){return this._getParams("transparent")}},{key:"getAlphaTest",value:function(){return this._getParams("alphaTest")}},{key:"setAlphaTest",value:function(e){this._applyParams("alphaTest",e)}},{key:"getRetainMap",value:function(){if(this.selectedMaterial)return this.selectedMaterial.retainMap}},{key:"setRetainMap",value:function(e){if(this.selectedMaterial)return this.selectedMaterial.retainMap=e}},{key:"setRenderOrder",value:function(e){this.selectedMaterial&&(this._updateRenderOrderByMaterial(this.selectedMaterial,e),this.selectedMaterial.renderOrder=e,im.renderManager.render())}},{key:"getRenderOrder",value:function(){if(this.selected)return this.selected.renderOrder}},{key:"_getMeshByMaterial",value:function(e){var t=[];return fm.forEach((function(n){var i=n.material;(Array.isArray(i)?i:[i]).forEach((function(i){i==e&&t.push(n)}))})),t}},{key:"_updateRenderOrderByMaterial",value:function(e,t){e&&this._getMeshByMaterial(this.selectedMaterial).forEach((function(e){return e.renderOrder=t}))}},{key:"_applyParams",value:function(e,t,n){var i=this;if(this.selectedMaterial){if(mm[this.selectedMaterial.name]||(mm[this.selectedMaterial.name]=this.selectedMaterial.clone()),"map"===n){if(t){var r=t;this.mapLoader.setBaseUrl(""),t=this.mapLoader.load(t,(function(t){var n=r.substr(r.lastIndexOf(".")+1).split("?")[0].toUpperCase();"reflectMap"===e||"envMap"===e?((t=i.mapLoader.convertTexture(t)).image.src=r,i.selectedMaterial[e]=t,i.selectedMaterial.needsUpdate=!0):"BASIS"===n&&(i.selectedMaterial[e]=t,i.selectedMaterial.needsUpdate=!0)})),"envMap"===e?t.custom=!0:t.wrapS=t.wrapT=1e3}else t=null;this.selectedMaterial[e]=t,this.selectedMaterial.needsUpdate=!0}else"color"===n?this.selectedMaterial[e].setStyle(t):this.selectedMaterial[e]=t;this.selectedMaterial.needsUpdate=!0,dm.map((function(e){void 0!==e.re&&e.re===i.selectedMaterial.ID&&(e.copy(i.selectedMaterial),e.needsUpdate=!0)})),this.onEdit&&this.onEdit()}else this.onError("未选择材质对象")}},{key:"_getParams",value:function(e){if(this.selectedMaterial)return this.selectedMaterial[e]&&this.selectedMaterial[e].constructor===Fn?"#"+this.selectedMaterial[e].getHexString():this.selectedMaterial[e]&&this.selectedMaterial[e].constructor===ht?this.selectedMaterial[e].image.currentSrc||this.selectedMaterial[e].image.src:this.selectedMaterial[e];this.onError("未选择材质对象")}},{key:"replace",value:function(e,t){var i=this,r=this.selectedMaterial;if(r){mm[r.name]||(mm[r.name]=r.clone());for(var a=e.lod1,o={},s=0;s<Object.keys(a).length;s++){var l=Object.keys(a)[s];o[s]=a[l],a[l]=s}var A=n(n(n({a:r.name,ee:r.sname,re:r.re},a),e.params.allParams),{},{transparent:e.transparent});console.log(A,e.keepDiffuse),Nf.parseAmrtMaterial(A,o,r,null,(function(){i.materials.map((function(e){e.re==r.ID&&e.copy(r)})),t&&t()}),this.mapLoader,e.keepDiffuse||!1)}else this.onError("未选择材质对象")}},{key:"restore",value:function(){var e=this;if(this.selectedMaterial){im.renderManager.render();var t=mm[this.selectedMaterial.name];if(t)t.envMap=this.selectedMaterial.envMap,mm[this.selectedMaterial.name]=t.clone(),this._getMeshByMaterial(this.selectedMaterial).forEach((function(n){if(Array.isArray(n.material))for(var i=0;i<n.material.length;i++)n.material[i]==e.selectedMaterial&&(n.material[i]=t);else n.material==e.selectedMaterial&&(n.material=t)})),dm.splice(dm.indexOf(this.selectedMaterial),1,t),this.selectedMaterial=t}}},{key:"saveToJSON",value:function(){var e={},t=[],n=[];this.getAllMaterials();var i=dm.map((function(e){return e.re}));dm.map((function(e){var t=!1;fm.map((function(n){t=t||n.material.find((function(t){return t.ID===e.ID}))})),(t||void 0!==e.ID&&i.includes(e.ID))&&n.push(e)})),n=n.filter((function(e){return"AMRTBasicMaterial"==e.type})),n.map((function(n){return t.push(Nf.export(n,e))})),t=t.sort((function(e,t){return(void 0===t.re?-1:t.re)-(void 0===e.re?-1:e.re)})).reverse();var r={};fm.map((function(e){if(e.materialIndex)for(var t=0;t<e.materialIndex.length;t++)if(e.material.length>t&&e.material[t].ID!==e.materialIndex[t]){var n=e.material[t].ID;r[n]||(r[n]=[]),r[n].push({a:e.ID,b:t})}}));var a={};for(var o in e){var s=e[o];".basis"!=s.slice(s.lastIndexOf("."))&&".mrtb"!=s.slice(s.lastIndexOf("."))||(s=this.model.originMaps[s]||""),e[o]&&e[o].startsWith("data:image")?e[o]="":a[o]=s}var l={a:t,b:e,c:r,ed:!0,z:a};return JSON.stringify(l)}},{key:"exportSingleMaterial",value:function(e){var t={},i=n({},e);delete i.re;var r=Nf.export(i,t);for(var a in delete r.a,delete r.ee,t)t[a]&&t[a].startsWith("data:image")&&(t[a]="");return{a:r,b:t}}},{key:"importSingleMaterial",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(n||(n=this.selectedMaterial),!n)return this.onError("请选则材质");Nf.parseAmrtMaterial(e.a,e.b,n,null,i,this.mapLoader,r),this.materials.map((function(a){return a.re===n.ID&&Nf.parseAmrtMaterial(e.a,e.b,a,null,i,t.mapLoader,r)}))}},{key:"rename",value:function(e,t){return t||(t=this.selectedMaterial),t?(t.sname=e,!0):(this.onError("请选则材质"),!1)}}]),i}(Cd),xm=function(){function e(t){s(this,e),this._rayCaster=null,this.viewer=t}return A(e,[{key:"rayCaster",get:function(){return this._rayCaster||(this._rayCaster=new Nc),this._rayCaster}},{key:"rayIntersect",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t=t||this.viewer.sceneManager.root;var i=If.getDomMouse(e,this.viewer.domElement);return this.rayCaster.setFromCamera(i,this.viewer.renderManager.camera),Array.isArray(t)?this.rayCaster.intersectObjects(t,n):this.rayCaster.intersectObject(t,n)}},{key:"intersectObject",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e)return console.error("缺少事件对象: MouseEvent"),!1;t=t||this.viewer.sceneManager.modelGroup;var i=this.rayIntersect(e,t,n);return i.length>0?i[0]:null}},{key:"intersectObjects",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e)return console.error("缺少事件对象: MouseEvent"),!1;t=t||this.viewer.sceneManager.modelGroup;var i=this.rayIntersect(e,t,n);return i}},{key:"intersectModels",value:function(e,t,n,i){var r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(!e)return console.error("缺少事件对象: MouseEvent"),!1;if(i=i||this.viewer.sceneManager.modelGroup,this.rayCaster.constructor===Nc){var a=this.rayIntersect(e,i,r);return t&&(n?t.call(n,a):t(a)),a}this.rayCaster.executeTest((function(e){t&&(n?t.call(n,e.intersects):t(e.intersects))}),!0)}},{key:"intersectBox",value:function(e,t){if(!e)return console.error("缺少事件对象: MouseEvent"),!1;var n=If.getDomMouse(e,this.viewer.domElement);this.rayCaster.setFromCamera(n,this.viewer.renderManager.camera);var i=(new tn).setFromObject(t);return this.rayCaster.ray.intersectBox(i)}},{key:"screenToVector",value:function(e){var t=this.intersectObject(e,this.viewer.sceneManager.root);return t?t.point:null}},{key:"vectorToScreen",value:function(e){var t=this.viewer.renderManager.container.getBoundingClientRect(),n=t.width/2,i=t.height/2,r=e.clone();return r.project(this.viewer.renderManager.camera),new tt(r.x*n+n,-r.y*i+i)}}]),e}(),bm=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),e.transform?g(i,e.transform):((i=t.call(this)).viewer=e,i._controls=new Fu(e.camera,e.container,!1),i._controls.addEventListener("dragging-changed",(function(e){i.viewer.controls.enabled=!e.value,i.dispatchEvent({type:"dragging-changed",data:i.target})})),i._controls.addEventListener("mouseDown",(function(){i.dispatchEvent({type:"mouseDown",data:i.target})})),i._controls.addEventListener("mouseUp",(function(){i.dispatchEvent({type:"mouseUp",data:i.target})})),i._controls.addEventListener("objectChange",(function(e){i.dispatchEvent({type:ld.CHANGE,data:i.target})})),i.target=null,e.transform=v(i),i)}return A(n,[{key:"setTarget",value:function(e){this.target=e,e?this._controls.attach(this.target):this._controls.detach(),this.viewer.renderManager.render()}},{key:"remove",value:function(){this._controls.detach(),this.target=null,this.viewer.renderManager.render()}},{key:"getTarget",value:function(){return this.target}},{key:"getMode",value:function(e){return this._controls.mode}},{key:"setMode",value:function(e){this._controls.setMode(e),this.viewer.renderManager.render()}},{key:"size",get:function(){return this._controls.size},set:function(e){this._controls.setSize(e),this.viewer.renderManager.render()}},{key:"enabled",get:function(){return this._controls.enabled},set:function(e){e?this.viewer.root.add(this._controls):this.viewer.root.remove(this._controls),this._controls.enabled=e,this.viewer.renderManager.render()}},{key:"showX",get:function(){return this._controls.showX},set:function(e){this._controls.showX=e,this.viewer.renderManager.render()}},{key:"showY",get:function(){return this._controls.showY},set:function(e){this._controls.showY=e,this.viewer.renderManager.render()}},{key:"showZ",get:function(){return this._controls.showZ},set:function(e){this._controls.showZ=e,this.viewer.renderManager.render()}},{key:"dispose",value:function(){this._controls.dispose(),this.viewer.renderManager.render()}}]),n}(Je),Mm=A((function e(){s(this,e)}));Mm.TRANSLATE="translate",Mm.ROTATE="rotate",Mm.SCALE="scale";var Cm=function(e){h(n,e);var t=y(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s(this,n),(e=t.call(this)).options=i,e.isEffect=!0,e.init(),e}return A(n,[{key:"init",value:function(){}},{key:"update",value:function(){}}]),n}(zt),Bm=" \n uniform float size; \n uniform float time; \n uniform float u_len; \n attribute float u_index;\n varying float u_opacitys;\n void main() { \n if( u_index < time + u_len && u_index > time){\n float u_scale = 1.0 - (time + u_len - u_index) /u_len;\n u_opacitys = u_scale;\n vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * mvPosition;\n gl_PointSize = size * u_scale * 1.0;\n } \n }\n ",Em=" \n uniform sampler2D u_map;\n uniform float u_opacity;\n uniform vec3 color;\n uniform float isTexture;\n varying float u_opacitys;\n void main() {\n vec4 u_color = vec4(color,u_opacity * u_opacitys);\n gl_FragColor = u_color;\n }",Sm=function(e){h(n,e);var t=y(n);function n(e,i,r,a){var o;return s(this,n),(o=t.call(this)).flyId=0,o.flyArr=[],o.baicSpeed=1,e=Array.isArray(e)?(new at).fromArray(e):(new at).copy(e),i=Array.isArray(i)?(new at).fromArray(i):(new at).copy(i),o.start=e,o.end=i,o.height=r||.3*e.distanceTo(i),o.color=a||"#02E6FF",o._baseScale=.1,o._opacity=1,o._init(),o}return A(n,[{key:"_initCurve",value:function(){var e=new yA(this.start,new at((this.start.x+this.end.x)/2,2*this.height,(this.start.z+this.end.z)/2),this.end);return this.curveLength=e.getLength(),e.getPoints(40*this.start.distanceTo(this.end))}},{key:"_init",value:function(){var e=this,t=this._initCurve(),n=new Li;n.vertices=t,this.baseLine=new Go(n,new Do({color:this.color})),this.add(this.baseLine),this._createFlyLine(t,this.color,{}),this.timer=setInterval((function(){e._createFlyLine(e._initCurve(),e.color,{}),e.flyArr.length>=3&&clearInterval(e.timer)}),3e3),this.pointMaterial=new Nn({map:If.createCircleMap(this.color),side:2,transparent:!0}),this.startPoint=new Ei(new dl(1,32),this.pointMaterial),this.startPoint.rotation.x=Math.PI/2,this.startPoint.position.copy(this.start),this.endPoint=new Ei(new dl(1,32),this.pointMaterial),this.endPoint.position.copy(this.end),this.endPoint.rotation.x=Math.PI/2,this.add(this.startPoint),this.add(this.endPoint)}},{key:"pointVisible",set:function(e){e=!!e,this.startPoint.visible=e,this.endPoint.visible=e}},{key:"_createGeometry",value:function(e,t){t=t||new si;var n=[],i=[];return e.forEach((function(e,t){n.push(e.x,e.y,e.z),i.push(t)})),t.setAttribute("position",new Yn(n,3)),t.setAttribute("u_index",new Yn(i,1)),t}},{key:"_createFlyLine",value:function(e,t,n){var i=n.width,r=void 0===i?3:i;n.length,n.speed;var a=n.repeat,o=void 0===a?1/0:a,s=new Ri({uniforms:{color:{value:new Fn(t).lerp(new Fn(1,1,1),.3),type:"v3"},size:{value:r,type:"f"},u_len:{value:10*this.curveLength,type:"f"},u_opacity:{value:.7,type:"f"},time:{value:-10*this.curveLength,type:"f"}},transparent:!0,depthTest:!1,vertexShader:Bm,fragmentShader:Em,defaultAttributeValues:{}}),l=this._createGeometry(e);this.points=new qo(l,s),this.points._speed=this.curveLength/3,this.points._repeat=o,this.points._been=0,this.points._total=e.length,this.flyId++,this.flyArr.push(this.points),this.add(this.points)}},{key:"update",value:function(e){var t=this;e>.2||(this.flyArr.forEach((function(n){if(n.parent)if(n._been>n._repeat)n.visible=!1,"function"==typeof n._callback&&n._callback(n),t.remove(n);else{var i=n.material.uniforms;i.time.value<n._total?i.time.value+=e*(t.baicSpeed/e)*n._speed:(n._been+=1,i.time.value=-i.u_len.value)}})),this._baseScale+=15*e,this._baseScale=this._baseScale>1?.2:this._baseScale,this.startPoint.scale.set(this._baseScale,this._baseScale,this._baseScale),this.endPoint.scale.copy(this.startPoint.scale))}},{key:"_updateLine",value:function(){var e=this;this.startPoint.position.copy(this.start),this.endPoint.position.copy(this.end);var t=this._initCurve(),n=new Li;n.vertices=t,this.baseLine.geometry.dispose(),this.baseLine.geometry=n,this.flyArr.forEach((function(n){e._createGeometry(t,n.geometry),n.geometry.verticesNeedUpdate=!0}))}},{key:"onAfterRender",value:function(){AMRT.needsUpdate=!0}},{key:"setHeight",value:function(e){e!=this.height&&(this.height=e,this._updateLine())}},{key:"setStartPoint",value:function(e){this.start=e,this._updateLine()}},{key:"setEndPoint",value:function(e){this.end=e,this._updateLine()}},{key:"setColor",value:function(e){this.color=e,this.baseLine.material.color.setStyle(this.color);var t=new Fn(e).lerp(new Fn(1,1,1),.3);this.flyArr.forEach((function(e){e.material.uniforms.color.value.copy(t)})),this.pointMaterial.map=If.createCircleMap(this.color),this.pointMaterial.map.needsUpdate=!0}},{key:"toJSON",value:function(){return{start:this.start,end:this.end,height:this.height,color:this.color}}},{key:"dispose",value:function(){for(;0<this.children.length;){var e=this.children[0];this.remove(e),e.geometry.dispose(),e.material.dispose()}this.parent&&this.parent.remove(this)}}]),n}(Cm),Tm=function(e){h(n,e);var t=y(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#FFFF00";s(this,n),(e=t.call(this)).viewer=null,e.dotIndex=0,e.path=i,e.longlats=[],e.isClose=!1,e.lineColor=r;var a=new Li;return e.lineMaterial=new Do({color:r,depthTest:!1,depthWrite:!1}),e.line=new Go(a,e.lineMaterial),e.line.renderOrder=5e3,e.add(e.line),e.dotGroup=new zt,e.add(e.dotGroup),e.dotMaterial=e.createDotMaterial(),e}return A(n,[{key:"path",get:function(){return this._path},set:function(e){if(e){this._path=[];for(var t=0;t<e.length;t++)this.pathPush(e[t])}}},{key:"isClose",get:function(){return this._isClose},set:function(e){this._isClose=e}},{key:"viewer",get:function(){return this._viewer},set:function(e){this._viewer=e}},{key:"curDot",get:function(){this.dotGroup.children[this.dotIndex]||(this.dotIndex=0);var e=this.dotGroup.children[this.dotIndex];return this.dotIndex++,e}},{key:"addPoint",value:function(e){e&&(this.pathPush(e),this.updateDot())}},{key:"addLongLat",value:function(e){if(e&&Array.isArray(e)&&this.viewer&&this.viewer.isGISViewer){this.longlats.push(e);var t=this.viewer.coordinatesToVector3(e);this.addPoint(t)}}},{key:"addPoints",value:function(e){var t=this;e&&e.length>0&&(e.forEach((function(e){e&&t.pathPush(e)})),this.updateDot())}},{key:"addLongLats",value:function(e){var t=this;e&&e.length>0&&(e.forEach((function(n){n&&Array.isArray(n)&&t.viewer&&t.viewer.isGISViewer&&(t.longlats.push(e),t.pathPush(t.viewer.coordinatesToVector3(n)))})),this.updateDot())}},{key:"pathPush",value:function(e){var t=(new at).copy(e);this._path.push(t)}},{key:"removePoint",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.path.length>0&&(null!=e&&this.path[e]||(e=this.path.length-1),this.path.splice(e,1),this.longlats&&this.longlats[e]&&this.longlats.splice(e,1),this.updateDot())}},{key:"updatePath",value:function(){var e=this,t=[];if(this.dotGroup.children.forEach((function(e){t.push(e.position.clone())})),this.path=t,this.viewer&&this.viewer.isGISViewer){var n=[];this.path.forEach((function(t){n.push(e.viewer.coordinatesToVector3(t))})),this.longlats=n}this.updateLine()}},{key:"updateDot",value:function(){for(var e=this.path,t=this.dotGroup.children,n=Math.max(e.length,t.length),i=0;i<n;i++)if(e[i]&&t[i])t[i].position.copy(e[i]);else if(e[i]){var r=this.createDot(e[i]);this.dotGroup.add(r)}else if(t[i]){t.splice(i,t.length-i);break}this.updateLine()}},{key:"updateLine",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e&&(this.path=e);var t=new Li;if(this.longlats&&this.longlats.length>0)t.vertices=this.detVector3();else{var n=[];this.path.forEach((function(e){n.push(e)})),this.isClose&&n.push(n[0]),t.vertices=n}this.line.geometry.dispose(),this.line.geometry=t,this.line.geometry.verticesNeedUpdate=!0}},{key:"createDot",value:function(e,t){var n=new go(this.dotMaterial.clone());return n.isPathPoint=!0,n.renderOrder=5e3,n.scale.set(.04,.04,1),e&&n.position.copy(e),n}},{key:"createDotMaterial",value:function(){var e=document.createElement("canvas");e.width=e.height=32;var t=e.getContext("2d");return t.beginPath(),t.arc(16,16,4,0,2*Math.PI),t.fillStyle=this.lineColor,t.fill(),new ro({map:new ts(e),sizeAttenuation:!1,depthTest:!1,depthWrite:!1})}},{key:"show",value:function(){this.visible=!0}},{key:"hide",value:function(){this.visible=!1}},{key:"detVector3",value:function(){var e=[];if(1===this.longlats.length)e.push(this.viewer.coordinatesToVector3(this.longlats[0]));else{var t=[];this.longlats.forEach((function(e){t.push(e)})),this.isClose&&t.push(t[0]);for(var n=0;n<t.length-1;n++){for(var i=new tt(t[n][0],t[n][1]),r=new tt(t[n+1][0],t[n+1][1]),a=i.distanceTo(r),o=r.clone().sub(i).normalize(),s=Math.ceil(a/1),l=0;l<s;l++){var A=i.clone().addScaledVector(o,1*l),c=this.viewer.coordinatesToVector3([A.x,A.y]);e.push(c)}var h=this.viewer.coordinatesToVector3([r.x,r.y]);e.push(h)}}return e}}]),n}(zt),_m="#FF0000",Im={m:1,mm:1e3,km:.001},Lm=function(e){h(n,e);var t=y(n);function n(e,i){var r;return s(this,n),(r=t.call(this)).unselectColor=i||"#FFFF00",r.type=e||n.TYPE_DISTANCE,r.earthsCoreVec=new at(0,0,0),r.init(),r}return A(n,[{key:"init",value:function(){this.showUnit="m",this.decimalPlaces=2,this.hided=!1,this.onComplete=null,this.pathEditor=new Tm([],this.unselectColor),this.add(this.pathEditor),this.panelNode=new zt,this.add(this.panelNode)}},{key:"addPoint",value:function(e,t){if(this.type===n.TYPE_DISTANCE)this.pathEditor.isClose=!1,e&&this.pathEditor.addPoint(e),this.pathEditor.path.length>=2&&this.addDistancePanel();else if(this.type===n.TYPE_HEIGHT){this.pathEditor.isClose=!1;var i=this.computeHeightPoint(e,t);i&&this.pathEditor.addPoint(i),this.pathEditor.path.length>=2&&this.addHeightPanel()}else this.type===n.TYPE_ANGLE?(this.pathEditor.isClose=!1,e&&this.pathEditor.addPoint(e),this.pathEditor.path.length>=3&&this.addAnglePanel()):this.type===n.TYPE_AREA&&(this.pathEditor.isClose=!0,e&&this.pathEditor.addPoint(e),this.pathEditor.path.length>=3&&this.addAreaPanel())}},{key:"addPoints",value:function(e){var t=this;e.forEach((function(e){t.addPoint(e)}))}},{key:"addAreaPanel",value:function(){var e=this.pathEditor.path;this.clearPanel();var t=e[0],n=e[1],i=e[2],r=this.computePolyArea(e),a=new tn;a.setFromPoints(e);var o=a.getCenter(),s=a.max.distanceTo(a.min);this.maxLength=s,this.textScale=2,this.textMeshScale=.002*this.maxLength,this.fontSize=20*this.textScale;var l=n.distanceTo(t),A=n.distanceTo(i),c=.005*this.maxLength*.5*30,h=Math.min(l,A);c=c>3*h/4?3*h/4:c;var u=t.clone().sub(n).normalize(),d=i.clone().sub(n).normalize(),f=n.clone().addScaledVector(u,c),p=n.clone().addScaledVector(d,c),m=new at((f.x+p.x)/2,(f.y+p.y)/2,(f.z+p.z)/2).clone().sub(n),v=this._drawText2((r*this.magnification*this.magnification).toFixed(this.decimalPlaces)+this.showUnit+"2"),g=v.clone();g.geometry=v.geometry.clone(),g.selectMat=v.selectMat.clone(),g.unselectMat=v.unselectMat.clone(),this.panelNode.add(g);var y=m.clone().normalize(),w=u.clone().cross(d).normalize(),x=w.clone().cross(y);x.y<0&&(x.negate(),w.negate());var b=new bt;b.makeBasis(y,x,w),b.setPosition(o),v.geometry.applyMatrix(b);var M=new bt;M.makeBasis(y.clone().negate(),x.clone(),w.clone().negate()),M.setPosition(o.clone()),g.geometry.applyMatrix(M),this.lengthMesh=v,this.lengthMesh.back=g}},{key:"addAnglePanel",value:function(){var e=this.pathEditor.path;this.clearPanel();for(var t=0;t<e.length-2;t++){var n=e[t],i=e[t+1],r=e[t+2],a=n.distanceTo(i).toFixed(4);this.maxLength=a,this.textScale=2,this.textMeshScale=.002*this.maxLength,this.fontSize=20*this.textScale;var o=i.distanceTo(n),s=i.distanceTo(r),l=.005*this.maxLength*.5*30,A=Math.min(o,s);l=l>3*A/4?3*A/4:l;var c=n.clone().sub(i).normalize(),h=r.clone().sub(i).normalize(),u=180*c.angleTo(h)/Math.PI,d=i.clone().addScaledVector(c,l),f=i.clone().addScaledVector(h,l),p=new at((d.x+f.x)/2,(d.y+f.y)/2,(d.z+f.z)/2),m=p.clone().sub(i),v=p.addScaledVector(m,2),g=this._drawText2(u.toFixed(this.decimalPlaces)+"度"),y=g.clone();y.geometry=g.geometry.clone(),y.selectMat=g.selectMat.clone(),y.unselectMat=g.unselectMat.clone(),this.panelNode.add(y);var w=m.clone().normalize(),x=c.clone().cross(h).normalize(),b=x.clone().cross(w);b.y<0&&(b.negate(),x.negate());var M=new bt;M.makeBasis(w,b,x),M.setPosition(v),g.geometry.applyMatrix(M);var C=new bt;C.makeBasis(w.clone().negate(),b.clone(),x.clone().negate()),C.setPosition(v.clone()),y.geometry.applyMatrix(C),this.lengthMesh=g,this.lengthMesh.back=y}}},{key:"addHeightPanel",value:function(){var e=this.pathEditor.path;this.clearPanel();for(var t=0;t<e.length-1;t++){var n=e[t],i=e[t+1],r=n.distanceTo(i);this.maxLength=r,this.textScale=2,this.textMeshScale=.002*this.maxLength,this.fontSize=20*this.textScale;var a=n.distanceTo(i),o=i.clone().sub(n).normalize(),s=n.clone().addScaledVector(o,a/2),l=o.clone(),A=void 0,c=void 0;if(0==l.clone().dot(new at(1,0,0)))A=new at(1,0,0),c=l.clone().cross(A).normalize();else{var h=new at(0,1,0);A=(c=l.clone().cross(h).normalize()).clone().cross(l).normalize()}A.y<0&&(A.negate(),c.negate());var u=s.clone().addScaledVector(A,.03*this.maxLength),d=this._drawText2((r*this.magnification).toFixed(this.decimalPlaces)+this.showUnit),f=d.clone();f.geometry=d.geometry.clone(),f.selectMat=d.selectMat.clone(),f.unselectMat=d.unselectMat.clone(),this.panelNode.add(f);var p=new bt;p.makeBasis(l,A,c),p.setPosition(u),d.geometry.applyMatrix(p);var m=new bt;m.makeBasis(l.clone().negate(),A.clone(),c.clone().negate()),m.setPosition(u.clone()),f.geometry.applyMatrix(m),this.lengthMesh=d,this.lengthMesh.back=f}}},{key:"addDistancePanel",value:function(){var e=this.pathEditor.path;this.clearPanel();for(var t=0;t<e.length-1;t++){var n=e[t],i=e[t+1],r=n.distanceTo(i);this.maxLength=r,this.textScale=2,this.textMeshScale=.002*this.maxLength,this.fontSize=20*this.textScale;var a=n.distanceTo(i),o=i.clone().sub(n).normalize(),s=n.clone().addScaledVector(o,a/2),l=o.clone(),A=void 0,c=void 0;if(0==l.clone().dot(new at(1,0,0)))A=new at(1,0,0),c=l.clone().cross(A).normalize();else{var h=new at(0,1,0);A=(c=l.clone().cross(h).normalize()).clone().cross(l).normalize()}A.y<0&&(A.negate(),c.negate());var u=s.clone().addScaledVector(A,.03*this.maxLength),d=this._drawText2((r*this.magnification).toFixed(this.decimalPlaces)+this.showUnit),f=d.clone();f.geometry=d.geometry.clone(),f.selectMat=d.selectMat.clone(),f.unselectMat=d.unselectMat.clone(),this.panelNode.add(f);var p=new bt;p.makeBasis(l,A,c),p.setPosition(u),d.geometry.applyMatrix(p);var m=new bt;m.makeBasis(l.clone().negate(),A.clone(),c.clone().negate()),m.setPosition(u.clone()),f.geometry.applyMatrix(m),this.lengthMesh=d,this.lengthMesh.back=f}}},{key:"removePoint",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.pathEditor.removePoint(e)}},{key:"updatePath",value:function(){this.pathEditor.updatePath(),this.updatePanel()}},{key:"clearPanel",value:function(){for(;this.panelNode.children.length>0;)this.panelNode.remove(this.panelNode.children[0])}},{key:"updatePanel",value:function(){this.clearPanel();this.addPoint(null)}},{key:"_onComplete",value:function(){this.onComplete&&this.onComplete()}},{key:"close",value:function(e){e&&e()}},{key:"hide",value:function(){this.visible=!1}},{key:"show",value:function(){this.visible=!0}},{key:"_drawText2",value:function(e,t){var n=document.createElement("canvas"),i=this._getMaterial(n,e,this.unselectColor),r=document.createElement("canvas"),a=this._getMaterial(r,e,_m),o=new Ei(new $i(n.width*this.textMeshScale/this.textScale,n.height*this.textMeshScale/this.textScale),i);return o.renderOrder=Ke,o.name="Text",t&&o.position.copy(t),o.selectMat=a,o.unselectMat=i,this.panelNode.add(o),o}},{key:"_getMaterial",value:function(e,t,n){e.height=this.fontSize,this._fillText(e,t,n);var i=new ts(e);i.anisotropy=16;var r=new Nn({map:i,transparent:!0});return r.depthTest=!1,r}},{key:"_fillText",value:function(e,t,n){var i="normal bolder "+this.fontSize+"px 黑体";e.width=this._measureTextWidth(i,t);var r=e.getContext("2d");r.clearRect(0,0,e.width,e.height),r.font=i,r.fillStyle=n||this.unselectColor,r.textAlign="left",r.textBaseline="top",r.fillText(t,0,0)}},{key:"_measureTextWidth",value:function(e,t){this._measureCanvas||(this._measureCanvas=document.createElement("canvas"),this._measureCanvas.height=100,this._measureCanvas.width=100);var n=this._measureCanvas.getContext("2d");return n.font=e,n.measureText(t).width}},{key:"computePolyArea",value:function(e){for(var t=0,n=this.getFaces(e),i=0;i<n.length;i++){var r=n[i],a=e[r[0]],o=e[r[1]],s=e[r[2]];t+=this.computeTriArea(a,o,s)}var l=[];e.forEach((function(e){l.push(e.x,e.y,e.z)}));var A=[];n.forEach((function(e){A.push(e[0],e[1],e[2])}));var c=new si;c.attributes.position=new zn(new Float32Array(l),3),c.index=new zn(new Uint16Array(A),1);var h=new Nn({side:2,transparent:!0,opacity:.2});h.color=new Fn(this.unselectColor);var u=new Ei(c,h);return u.renderOrder=Ke,this.panelNode.add(u),t}},{key:"computeTriArea",value:function(e,t,n){var i=t.distanceTo(e),r=n.distanceTo(t),a=e.distanceTo(n),o=(i+r+a)/2;return Math.sqrt(o*(o-i)*(o-r)*(o-a))}},{key:"computeHeightPoint",value:function(e,t){var n=null;if(t){var i=this.pathEditor.path;if(0===i.length)e&&(n=(new at).copy(e));else{var r=t.origin.clone(),a=this.earthsCoreVec,o=i[0],s=i[i.length-1],l=t.direction.clone().normalize(),A=o.clone().sub(a).normalize(),c=A.clone().cross(l).normalize(),h=l.clone().cross(c).normalize(),u=new vn;u.setFromNormalAndCoplanarPoint(h,r);var d=Math.abs(u.distanceToPoint(a)),f=s.distanceTo(a),p=h.angleTo(A),m=Math.abs(1/Math.cos(p)*d);m>f&&(n=a.clone().addScaledVector(A,m))}}else e&&(n=(new at).copy(e));return n}},{key:"getFaces",value:function(e){if(e.length<3)return[];for(var t,n,i,r,a,o,s=1e-4,l=!1,A=0;A<e.length-1;A++)if(t=e[A],n=e[(A+1)%e.length],i=e[(A+2)%e.length],this.computeTriArea(t,n,i)){l=!0;break}if(!l)return[];r=n.clone().sub(t).normalize(),a=i.clone().sub(n).normalize(),o=r.clone().cross(a).normalize(),Math.abs(o.x);for(var c=Math.abs(o.y)<s,h=Math.abs(o.z)<s,u=[],d=0;d<e.length;d++){var f=e[d],p=void 0;p=c?new tt(h?f.z:f.x,f.y):new tt(f.x,f.z),u.push(p)}return Vs.triangulateShape(u,[])}},{key:"select",value:function(){this.children.forEach((function(e){"Edge"===e.name&&e.material.color.setStyle(_m)})),this.lengthMesh.material=this.lengthMesh.selectMat,this.lengthMesh.back.material=this.lengthMesh.back.selectMat,this.lengthMesh.material.map.needsUpdate=!0,this.lengthMesh.back.material.map.needsUpdate=!0}},{key:"unSelect",value:function(){var e=this;this.children.forEach((function(t){"Edge"===t.name&&t.material.color.setStyle(e.unselectColor)})),this.lengthMesh.material=this.lengthMesh.unselectMat,this.lengthMesh.back.material=this.lengthMesh.back.unselectMat,this.lengthMesh.material.map.needsUpdate=!0,this.lengthMesh.back.material.map.needsUpdate=!0}},{key:"curDot",get:function(){return this.pathEditor.curDot}},{key:"unselectColor",get:function(){return this._unselectColor},set:function(e){e&&(this._unselectColor=e)}},{key:"pointMaterial",get:function(){if(!this._pointMaterial){var e,t;(e=document.createElement("canvas")).width=e.height=16;var n=e.getContext("2d");n.beginPath(),n.arc(8,8,8,0,2*Math.PI),n.fillStyle=this.unselectColor,n.fill(),t=new ts(e),this._pointMaterial=new ro({map:t,sizeAttenuation:!1,depthTest:!1,depthWrite:!1})}return this._pointMaterial}},{key:"showUnit",get:function(){return this._showUnit},set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"m";Im[e]&&(this._showUnit=e,this.magnification=Im[e])}},{key:"magnification",get:function(){return this._magnification},set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;this._magnification=e}},{key:"decimalPlaces",get:function(){return this._decimalPlaces},set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;"string"==typeof e&&(e=parseInt(e)),"number"==typeof e&&e>=0&&(this._decimalPlaces=Math.round(e))}},{key:"earthsCoreVec",get:function(){return this._earthsCoreVec},set:function(e){e&&(this._earthsCoreVec=(new at).copy(e))}},{key:"toJSON",value:function(){return{type:this.type,points:this.pathEditor.path,color:this.unselectColor}}},{key:"loadJson",value:function(e){this.addPoints(e.points)}},{key:"reset",value:function(){for(var e=this.showUnit,t=this.decimalPlaces,n=this.toJSON();this.children.length>0;)this.remove(this.children[0]);this.init(),this.showUnit=e,this.decimalPlaces=t,this.loadJson(n)}},{key:"destroy",value:function(){}}]),n}(zt);Lm.TYPE_DISTANCE=0,Lm.TYPE_HEIGHT=1,Lm.TYPE_ANGLE=2,Lm.TYPE_AREA=3;var Fm=.001,km=function(e){h(n,e);var t=y(n);function n(e,i){var r;return s(this,n),(r=t.call(this)).unselectColor=i||"#FF4500",r.type=e||n.TYPE_RECT,r.decimalPlaces=3,r.init(),r}return A(n,[{key:"init",value:function(){this.hided=!1,this.pathEditor=new Tm([],this.unselectColor),this.pathEditor.isClose=!0,this.add(this.pathEditor),this.panelNode=new zt,this.add(this.panelNode)}},{key:"addPoint",value:function(e,t){if(this.type===n.TYPE_POLYGON)e&&(Array.isArray(e)?this.pathEditor.addLongLat(e):this.pathEditor.addPoint(e)),this.pathEditor.path.length>=3&&this.addAreaPanel(this.pathEditor.path);else if(this.type===n.TYPE_RECT){if(e)if(this.firstPoint){for(;this.pathEditor.path.length>0;)this.pathEditor.removePoint();if(Array.isArray(e)){var i=this.firstPoint,r=[e[0],e[1]],a=[i[0],e[1]],o=[e[0],i[1]];this.pathEditor.addLongLat(i),this.pathEditor.addLongLat(a),this.pathEditor.addLongLat(r),this.pathEditor.addLongLat(o)}else{var s=this.firstPoint.clone(),l=e,A=new at(s.x,s.y,l.z),c=new at(l.x,l.y,s.z);this.pathEditor.addPoint(s),this.pathEditor.addPoint(A),this.pathEditor.addPoint(l),this.pathEditor.addPoint(c)}this.addAreaPanel(this.pathEditor.path),t&&t()}else Array.isArray(e)?this.firstPoint=[e[0],e[1]]:this.firstPoint=(new at).copy(e)}else if(this.type===n.TYPE_CIRCULAR){if(e)if(this.firstPoint){for(;this.pathEditor.path.length>0;)this.pathEditor.removePoint();if(Array.isArray(e))for(var h=new tt(this.firstPoint[0],this.firstPoint[1]).distanceTo(new tt(e[0],e[1])),u=0;u<=360;u+=10){var d=u/180*Math.PI,f=this.firstPoint[0]+h*Math.cos(d),p=this.firstPoint[1]+h*Math.sin(d);this.pathEditor.addLongLat([f,p])}else{e.y=this.firstPoint.y;for(var m=this.firstPoint.distanceTo(e),v=0;v<=360;v+=10){var g=v/180*Math.PI,y=this.firstPoint.x+m*Math.cos(g),w=this.firstPoint.z+m*Math.sin(g);this.pathEditor.addPoint({x:y,y:this.firstPoint.y,z:w})}}this.addAreaPanel(this.pathEditor.path),t&&t()}else Array.isArray(e)?this.firstPoint=[e[0],e[1]]:this.firstPoint=(new at).copy(e);this.pathEditor.dotGroup.visible=!1}}},{key:"addPoints",value:function(e){var t=this;e.forEach((function(e){t.addPoint(e)}))}},{key:"addLongLats",value:function(e){var t=this;e.forEach((function(e){t.addLongLat(e)}))}},{key:"removePoint",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.pathEditor.removePoint(e)}},{key:"updatePath",value:function(){this.pathEditor.updatePath(),this.updatePanel()}},{key:"clearPanel",value:function(){for(;this.panelNode.children.length>0;)this.panelNode.remove(this.panelNode.children[0])}},{key:"updatePanel",value:function(){this.clearPanel();this.addPoint(null)}},{key:"close",value:function(e){e&&e()}},{key:"hide",value:function(){this.visible=!1}},{key:"show",value:function(){this.visible=!0}},{key:"filter",value:function(e,t){var n=this.getLoop(t);if(n.length>=3){var i=[];Array.isArray(e)?e.forEach((function(e){e.traverse((function(e){e.isMesh&&i.push(e)}))})):e.traverse((function(e){e.isMesh&&i.push(e)}));for(var r=0;r<i.length;r++){var a=i[r],o=a.getWorldPosition(new at).clone();o.applyMatrix4(t),o=this.pointRegular(o);var s=this.pointAtLoop(n,o);a.visible="out"!=s}}}},{key:"pointRegular",value:function(e){return new at(parseFloat(e.x.toFixed(this.decimalPlaces)),parseFloat(e.y.toFixed(this.decimalPlaces)),parseFloat(e.z.toFixed(this.decimalPlaces)))}},{key:"getLoop",value:function(e){var t=this,n=this.pathEditor.path,i=[];n.forEach((function(n){var r=n.clone().applyMatrix4(e);r=t.pointRegular(r),i.push(r)}));for(var r=[],a=null,o=0;o<i.length;o++){var s=o==i.length-1,l=i[o],A=s?i[0]:i[o+1],c=l.distanceTo(A);if(c<Fm)i.splice(o,1),o--;else{var h={startPoint:l,endPoint:A,lineLen:c,dir:A.clone().sub(l).normalize()};r.push(h),a&&(a.next=h,h.pre=a),a=h}}r[r.length-1].next=r[0],r[0].pre=r[r.length-1];for(var u=0;u<r.length;u++){var d=r[u];if(d.lineLen<Fm)r.remove(d),u--,d.next.startPoint=d.startPoint.clone(),d.next.pre=d.pre,d.pre.next=d.next;else{var f=d.dir.angleTo(d.next.dir);f<Fm?(r.remove(d.next),u--,d.endPoint=d.next.endPoint.clone(),d.next=d.next.next,d.next.pre=d):Math.PI-f<Fm&&(d.lineLen>d.next.lineLen?(r.remove(d.next),u--,d.endPoint=d.next.endPoint.clone(),d.next=d.next.next,d.next.pre=d):(r.remove(d),u--,d.next.startPoint=d.startPoint.clone(),d.next.pre=d.pre,d.pre.next=d.next))}}return r}},{key:"pointAtLoop",value:function(e,t){for(var n=t.x,i=t.y,r={},a="out",o=0;o<e.length;o++){var s=e[o],l=s.startPoint,A=l.x,c=l.y,h=s.endPoint,u=h.x,d=h.y;if(!(c>i&&d>i))if(n!=A||n!=u){if(!(n>A&&n>u||n<A&&n<u)){var f=u-A;if(!(Math.abs(f)<Fm)){var p=c+(n-A)*((d-c)/f);if(!(p>i)){if(p==i)return a=n==A||n==u?"atpoint":"atline";if(n==A){if(s.endPoint.x>n&&s.pre.startPoint.x>n||s.endPoint.x<n&&s.pre.startPoint.x<n)continue}else if(n==u&&(s.startPoint.x>n&&s.next.endPoint.x>n||s.startPoint.x<n&&s.next.endPoint.x<n))continue;var m=n.toFixed(3)+"_"+p.toFixed(3);r[m]||(r[m]=!0)}}}}else{var v=void 0,g=void 0;if(c>d?(v=c,g=d):(v=d,g=c),i>=g&&i<=v)return a="atline";if(s.pre.startPoint.x>n&&s.next.endPoint.x>n||s.pre.startPoint.x<n&&s.next.endPoint.x<n);else{var y=A.toFixed(3)+"_"+g.toFixed(3)+"_"+u.toFixed(3)+"_"+v.toFixed(3);r[y]||(r[y]=!0)}}}var w=0;for(var x in r)w++;return w%2==1&&(a="in"),a}},{key:"addAreaPanel",value:function(e){this.clearPanel();var t=this.getFaces(e),n=[];e.forEach((function(e){n.push(e.x,e.y,e.z)}));var i=[];t.forEach((function(e){i.push(e[0],e[1],e[2])}));var r=new si;r.attributes.position=new zn(new Float32Array(n),3),r.index=new zn(new Uint16Array(i),1);var a=new Nn({side:2,transparent:!0,opacity:.2,depthTest:!1,depthWrite:!1});a.color=new Fn(this.unselectColor);var o=new Ei(r,a);o.renderOrder=5e3,this.panelNode.add(o)}},{key:"computePolyArea",value:function(e){e||(e=this.pathEditor.path);for(var t=0,n=this.getFaces(e),i=0;i<n.length;i++){var r=n[i],a=e[r[0]],o=e[r[1]],s=e[r[2]];t+=this.computeTriArea(a,o,s)}return t}},{key:"getFaces",value:function(e){if(e.length<3)return[];for(var t,n,i,r,a,o,s=!1,l=0;l<e.length-1;l++)if(t=e[l],n=e[(l+1)%e.length],i=e[(l+2)%e.length],this.computeTriArea(t,n,i)){s=!0;break}if(!s)return[];r=n.clone().sub(t).normalize(),a=i.clone().sub(n).normalize(),o=r.clone().cross(a).normalize(),Math.abs(o.x);for(var A=Math.abs(o.y)<Fm,c=Math.abs(o.z)<Fm,h=[],u=0;u<e.length;u++){var d=e[u],f=void 0;f=A?new tt(c?d.z:d.x,d.y):new tt(d.x,d.z),h.push(f)}return Vs.triangulateShape(h,[])}},{key:"computeTriArea",value:function(e,t,n){var i=t.distanceTo(e),r=n.distanceTo(t),a=e.distanceTo(n),o=(i+r+a)/2;return Math.sqrt(o*(o-i)*(o-r)*(o-a))}},{key:"select",value:function(){this.children.forEach((function(e){"Edge"===e.name&&e.material.color.setStyle("#FF0000")})),this.lengthMesh.material=this.lengthMesh.selectMat,this.lengthMesh.back.material=this.lengthMesh.back.selectMat,this.lengthMesh.material.map.needsUpdate=!0,this.lengthMesh.back.material.map.needsUpdate=!0}},{key:"unSelect",value:function(){var e=this;this.children.forEach((function(t){"Edge"===t.name&&t.material.color.setStyle(e.unselectColor)})),this.lengthMesh.material=this.lengthMesh.unselectMat,this.lengthMesh.back.material=this.lengthMesh.back.unselectMat,this.lengthMesh.material.map.needsUpdate=!0,this.lengthMesh.back.material.map.needsUpdate=!0}},{key:"viewer",get:function(){return this._viewer},set:function(e){e&&(this._viewer=e,this.pathEditor&&(this.pathEditor.viewer=e))}},{key:"curDot",get:function(){return this.pathEditor.curDot}},{key:"unselectColor",get:function(){return this._unselectColor},set:function(e){e&&(this._unselectColor=e)}},{key:"pointMaterial",get:function(){if(!this._pointMaterial){var e=document.createElement("canvas");e.width=e.height=16;var t=e.getContext("2d");t.beginPath(),t.arc(8,8,8,0,2*Math.PI),t.fillStyle=this.unselectColor,t.fill(),this._pointMaterial=new ro({map:new ts(e),sizeAttenuation:!1,depthTest:!1,depthWrite:!1})}return this._pointMaterial}},{key:"toJSON",value:function(){var e={type:this.type,color:this.unselectColor},t=this.pathEditor.longlats;if(t&&t.length>0)this.type===n.TYPE_RECT&&t.length>3?e.longlats=[t[0],t[2]]:this.type===n.TYPE_CIRCULAR&&t.length>1?e.longlats=[this.firstPoint,t[0]]:this.type===n.TYPE_POLYGON&&t.length>3?e.longlats=t:e=null;else{var i=this.pathEditor.path;this.type===n.TYPE_RECT&&i.length>3?e.points=[i[0],i[2]]:this.type===n.TYPE_CIRCULAR&&i.length>1?e.points=[this.firstPoint,i[0]]:this.type===n.TYPE_POLYGON&&i.length>3?e.points=i:e=null}return e}},{key:"loadJson",value:function(e){e.longlats?this.addPoints(e.longlats):this.addPoints(e.points)}},{key:"reset",value:function(){for(var e=this.showUnit,t=this.decimalPlaces,n=this.toJSON();this.children.length>0;)this.remove(this.children[0]);this.init(),this.showUnit=e,this.decimalPlaces=t,this.loadJson(n)}},{key:"destroy",value:function(){}}]),n}(zt);km.TYPE_RECT=0,km.TYPE_CIRCULAR=1,km.TYPE_POLYGON=2;var Pm=function(){function e(t){s(this,e),this.viewer=t,this.modelNode=new zt,this.viewer.modelGroup.add(this.modelNode),this.basicModels=[],this.flyLines=[],this.pathEditors=[],this.measure3Ds=[],this.selections=[],this.allModels=[this.basicModels,this.flyLines,this.pathEditors,this.measure3Ds,this.selections]}return A(e,[{key:"addCube",value:function(e,t,n){var i={width:e,height:t,depth:n};return this.addCube2(i)}},{key:"addCube2",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new kf(this.viewer),n={};e.color&&(n.color=e.color);var i=new Fi(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments),r=new Gf(n),a=new Ei(i,r);return t.add(a),e.position&&t.position.copy(e.position),e.parent?e.parent.add(t):this.viewer.modelGroup.add(t),this.basicModels.push(t),t.init(t),t}},{key:"addSphere",value:function(e){var t={radius:e};return this.addSphere2(t)}},{key:"addSphere2",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new kf(this.viewer),n={};e.color&&(n.color=e.color);var i=new $s(e.radius,e.widthSegments,e.heightSegments),r=new Gf(n),a=new Ei(i,r);return t.add(a),e.position&&t.position.copy(e.position),e.parent?e.parent.add(t):this.viewer.modelGroup.add(t),this.basicModels.push(t),t.init(t),t}},{key:"addTorus",value:function(e,t){var n={radius:e,tube:t};return this.addTorus2(n)}},{key:"addTorus2",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new kf(this.viewer),n={};e.color&&(n.color=e.color);var i=new ws(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc),r=new Gf(n),a=new Ei(i,r);return t.add(a),e.position&&t.position.copy(e.position),e.parent?e.parent.add(t):this.viewer.modelGroup.add(t),this.basicModels.push(t),t.init(t),t}},{key:"addCylinder",value:function(e,t,n){var i={radiusTop:e,radiusBottom:t,height:n};return this.addCylinder2(i)}},{key:"addCylinder2",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new kf(this.viewer),n={};e.color&&(n.color=e.color);var i=new Al(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded),r=new Gf(n),a=new Ei(i,r);return t.add(a),e.position&&t.position.copy(e.position),e.parent?e.parent.add(t):this.viewer.modelGroup.add(t),this.basicModels.push(t),t.init(t),t}},{key:"addRectPlane",value:function(e,t){var n={width:e,height:t};return this.addRectPlane2(n)}},{key:"addRectPlane2",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new kf(this.viewer),n={};e.color&&(n.color=e.color),e.doubleSide&&(n.side=2);var i=new qi(e.width,e.height,e.widthSegments,e.heightSegments),r=new Gf(n),a=new Ei(i,r);return t.add(a),e.position&&t.position.copy(e.position),e.parent?e.parent.add(t):this.viewer.modelGroup.add(t),this.basicModels.push(t),t.init(t),t}},{key:"addCirclePlane",value:function(e){var t={radius:e};return this.addCirclePlane2(t)}},{key:"addCirclePlane2",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new kf(this.viewer),n={};e.color&&(n.color=e.color),e.doubleSide&&(n.side=2);var i=new dl(e.radius,e.segments,e.thetaStart,e.thetaLength),r=new Gf(n),a=new Ei(i,r);return t.add(a),e.position&&t.position.copy(e.position),e.parent?e.parent.add(t):this.viewer.modelGroup.add(t),this.basicModels.push(t),t.init(t),t}},{key:"addFlyLine",value:function(e,t,n,i){var r=new kf(this.viewer),a=new Sm(e,t,n,i);return r.add(a),this.viewer.modelGroup.add(r),this.flyLines.push(r),r}},{key:"addPathEditor",value:function(e,t){var n=new kf(this.viewer),i=new Tm([],t);return e&&e.length>0&&i.addPoints(e),n.add(i),this.viewer.modelGroup.add(n),this.pathEditors.push(n),n}},{key:"addMeasure3D",value:function(e,t,n){var i=new kf(this.viewer),r=new Lm(t,n);return e&&e.length>0&&r.addPoints(e),i.add(r),this.viewer.modelGroup.add(i),this.measure3Ds.push(i),i}},{key:"addSelection",value:function(e,t,n){var i=new kf(this.viewer),r=new km(t,n);return e&&e.length>0&&r.addPoints(e),i.add(r),this.viewer.modelGroup.add(i),this.selections.push(i),i}},{key:"show",value:function(){this.allModels.forEach((function(e){e.forEach((function(e){e.visible=!0}))})),this._consoleCallBack&&this._consoleCallBack("显示组")}},{key:"hide",value:function(){this.allModels.forEach((function(e){e.forEach((function(e){e.visible=!1}))})),this._consoleCallBack&&this._consoleCallBack("隐藏组")}},{key:"removeMesh",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(this.basicModels.length>0){-1===e&&(e=this.basicModels.length-1);var t=this.basicModels[e];t.parent.remove(t),this.basicModels.splice(e,1),this._consoleCallBack&&this._consoleCallBack("删除成功!")}}},{key:"clearAll",value:function(){var e=0;this.allModels.forEach((function(t){t.forEach((function(t){t.parent.remove(t),e++})),t.splice(0,t.length)})),this._consoleCallBack&&e>0&&this._consoleCallBack("清空组!")}},{key:"_onMouseUp",value:function(e){}},{key:"_onMouseMove",value:function(e){}},{key:"_onUpdate",value:function(){}},{key:"consoleCallBack",set:function(e){e&&(this._consoleCallBack=e)}}]),e}(),Um=function(){function e(t){s(this,e),this.viewer=t,this.type=e.TYPE_DRAW,this.pathsGroup=new zt,this.viewer.modelGroup.add(this.pathsGroup),this.curPathEditor=null,this.container=document.createElement("div"),this.viewer.container.appendChild(this.container),this._onClick=this._onClick.bind(this),this._onRightClick=this._onRightClick.bind(this),this._onMouseMove=this._onMouseMove.bind(this)}return A(e,[{key:"start",value:function(){this.curPathEditor||this.addPathEditor(),this.viewer.moduleManager.event.addEventListener(Ad.click,this._onClick),this.viewer.moduleManager.event.addEventListener(Ad.rightClick,this._onRightClick),this.viewer.moduleManager.event.addEventListener(Ad.mousemove,this._onMouseMove),this.viewer.domElement.style.cursor="crosshair",this.container.style.display="block",this._consoleCallBack&&this._consoleCallBack("左键点击开始绘制!")}},{key:"end",value:function(){this.viewer.moduleManager.event.removeEventListener(Ad.click,this._onClick),this.viewer.moduleManager.event.removeEventListener(Ad.rightClick,this._onRightClick),this.viewer.moduleManager.event.removeEventListener(Ad.mousemove,this._onMouseMove),this.viewer.domElement.style.cursor="auto",this.container.style.display="none",this.curPathEditor&&(this.curPathEditor.path.length<2&&this.pathsGroup.remove(this.curPathEditor),this.curPathEditor=null),this.viewer.enableTransform&&(this.viewer.enableTransform=!0),this.viewer.transform&&this.viewer.transform.setTarget(null),this.type=e.TYPE_DRAW,this._consoleCallBack&&this._consoleCallBack("结束绘制!")}},{key:"show",value:function(){!1===this.pathsGroup.visible&&(this.pathsGroup.visible=!0,this._consoleCallBack&&this._consoleCallBack("显示路径!"))}},{key:"hide",value:function(){!0===this.pathsGroup.visible&&(this.pathsGroup.visible=!1,this._consoleCallBack&&this._consoleCallBack("隐藏路径!"))}},{key:"addPathEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t||this.pathEditorColor;return this.curPathEditor=new Tm([],n),this.curPathEditor.addPoints(e),this.pathsGroup.add(this.curPathEditor),this.curPathEditor}},{key:"getPathEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=null;return this.pathsGroup.children.length>0&&(-1==e&&(e=this.pathsGroup.children.length-1),t=this.pathsGroup.children[e]),t}},{key:"updatePathEditor",value:function(){for(var e=0;e<this.pathsGroup.children.length;e++){this.pathsGroup.children[e].updatePath()}this.curPathEditor=null,this.end()}},{key:"removePathEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;this.pathsGroup.children.length>0&&(-1===e&&(e=this.pathsGroup.children.length-1),this.pathsGroup.children.splice(e,1),this.curPathEditor=null,this._consoleCallBack&&this._consoleCallBack("删除成功!"))}},{key:"clearPathEditor",value:function(){this.pathsGroup.children.splice(0,this.pathsGroup.children.length)}},{key:"enableEditor",value:function(){this.viewer.moduleManager.event.addEventListener(Ad.click,this._onClick),this.viewer.moduleManager.event.addEventListener(Ad.rightClick,this._onRightClick),this.viewer.moduleManager.event.addEventListener(Ad.mousemove,this._onMouseMove),this.container.style.display="block",this.type=e.TYPE_EDIT,this._consoleCallBack&&this._consoleCallBack("选择路径节点进行编辑!右键结束编辑")}},{key:"loadJson",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"PathEditorData",t=localStorage.getItem(e);if(t){t=JSON.parse(t);for(var n=0;n<t.length;n++){var i=t[n];if(i){var r=this.addPathEditor(i.points,i.color);this.pathsGroup.add(r)}}}this.curPathEditor=null,this._consoleCallBack&&this._consoleCallBack("加载路径!")}},{key:"loadJsonByFile",value:function(e){var t=this;(new Kl).load(e,(function(e){for(var n=JSON.parse(e),i=0;i<n.length;i++){var r=n[i];if(r){var a=t.addPathEditor(r.points,r.color);t.pathsGroup.add(a)}}})),this.curPathEditor=null}},{key:"saveJson",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"PathEditorData",t=[],n=0;n<this.pathsGroup.children.length;n++){var i=this.pathsGroup.children[n];if(i.path&&i.path.length>0){var r={points:i.path,color:i.lineColor};t.push(r)}}return localStorage.setItem(e,JSON.stringify(t)),this._consoleCallBack&&this._consoleCallBack("保存路径!"),t}},{key:"_onClick",value:function(t){var n=this;if(this.type===e.TYPE_EDIT){var i=[];this.pathsGroup.children.forEach((function(e){i=i.concat(e.dotGroup)}));var r=this.viewer.picker.intersectModels(t.point,null,null,i);r&&r.length>0?(this.viewer.enableTransform||(this.viewer.enableTransform=!0),this.viewer.transform.setTarget(r[0].object)):this.viewer.transform&&this.viewer.transform.setTarget(null)}else if(this.curPathEditor){var a=[];this.viewer.modelGroup.children.forEach((function(e){e!=n.pathsGroup&&a.push(e)}));var o=this.viewer.picker.intersectObject(t.point,a);o&&this.curPathEditor.addPoint(o.point)}}},{key:"_onRightClick",value:function(){this.end()}},{key:"_onMouseMove",value:function(e){}},{key:"_onUpdate",value:function(){}},{key:"pathEditorColor",get:function(){return this._pathEditorColor},set:function(e){e&&(this._pathEditorColor=e)}},{key:"consoleCallBack",set:function(e){e&&(this._consoleCallBack=e)}}]),e}();Um.TYPE_DRAW=0,Um.TYPE_EDIT=1;var Dm=function(){function e(t){s(this,e),this.viewer=t,this.measuresGroup=new zt,this.viewer.modelGroup.add(this.measuresGroup),this.curMeasure3D=null,this.container=document.createElement("div"),this.viewer.container.appendChild(this.container),this.earthsCoreVec=new at,this._onClick=this._onClick.bind(this),this._onRightClick=this._onRightClick.bind(this),this._onMouseMove=this._onMouseMove.bind(this)}return A(e,[{key:"distanceMeasure",value:function(){this.start(Lm.TYPE_DISTANCE),this._consoleCallBack&&this._consoleCallBack("开始距离测量,点击右键即可完成!")}},{key:"heightMeasure",value:function(){this.start(Lm.TYPE_HEIGHT),this._consoleCallBack&&this._consoleCallBack("开始高度测量,点击右键即可完成!")}},{key:"angleMeasure",value:function(){this.start(Lm.TYPE_ANGLE),this._consoleCallBack&&this._consoleCallBack("开始角度测量,点击右键即可完成!")}},{key:"areaMeasure",value:function(){this.start(Lm.TYPE_AREA),this._consoleCallBack&&this._consoleCallBack("开始面积测量,点击右键即可完成!")}},{key:"start",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Lm.TYPE_DISTANCE;this.curMeasure3D?this.curMeasure3D.type!=e&&(this.removeMeasure(),this.addMeasure(e)):this.addMeasure(e),this.viewer.moduleManager.event.addEventListener(Ad.click,this._onClick),this.viewer.moduleManager.event.addEventListener(Ad.rightClick,this._onRightClick),this.viewer.moduleManager.event.addEventListener(Ad.mousemove,this._onMouseMove),this.viewer.domElement.style.cursor="crosshair",this.container.style.display="block"}},{key:"end",value:function(){if(this.viewer.moduleManager.event.removeEventListener(Ad.click,this._onClick),this.viewer.moduleManager.event.removeEventListener(Ad.rightClick,this._onRightClick),this.viewer.moduleManager.event.removeEventListener(Ad.mousemove,this._onMouseMove),this.viewer.domElement.style.cursor="auto",this.container.style.display="none",this.curMeasure3D){var e=this.curMeasure3D.type,t=this.curMeasure3D.pathEditor.path.length;(e===Lm.TYPE_DISTANCE||e===Lm.TYPE_HEIGHT)&&t<2&&this.measuresGroup.remove(this.curMeasure3D),(e===Lm.TYPE_ANGLE||e===Lm.TYPE_AREA)&&t<3&&this.measuresGroup.remove(this.curMeasure3D),this.curMeasure3D=null}}},{key:"show",value:function(){!1===this.measuresGroup.visible&&(this.measuresGroup.visible=!0,this._consoleCallBack&&this._consoleCallBack("显示测量!"))}},{key:"hide",value:function(){!0===this.measuresGroup.visible&&(this.measuresGroup.visible=!1,this._consoleCallBack&&this._consoleCallBack("隐藏测量!"))}},{key:"addMeasure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Lm.TYPE_DISTANCE,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t||this.measureColor;return this.curMeasure3D=new Lm(e,n),this.curMeasure3D.earthsCoreVec=this.earthsCoreVec,this.curMeasure3D.showUnit=this.measureUnit,this.curMeasure3D.decimalPlaces=this.measureDecimalPlaces,this.measuresGroup.add(this.curMeasure3D),this.curMeasure3D}},{key:"updateMeasure",value:function(){for(var e=[],t=0;t<this.measuresGroup.children.length;t++){var n=this.measuresGroup.children[t].toJSON();e.push(n)}this.clearMeasure();for(var i=0;i<e.length;i++){var r=e[i],a=this.addMeasure(r.type,r.color);a.loadJson(r),this.measuresGroup.add(a)}this.curMeasure3D=null}},{key:"removeMeasure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;this.measuresGroup.children.length>0&&(-1===e&&(e=this.measuresGroup.children.length-1),this.measuresGroup.children.splice(e,1),this.curMeasure3D=null,this._consoleCallBack&&this._consoleCallBack("删除成功!"))}},{key:"clearMeasure",value:function(){this.measuresGroup.children.splice(0,this.measuresGroup.children.length)}},{key:"loadJson",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"MeasureData",t=localStorage.getItem(e);if(t){t=JSON.parse(t);for(var n=0;n<t.length;n++){var i=t[n];if(i){var r=this.addMeasure(i.type,i.color);r.loadJson(i),this.measuresGroup.add(r)}}}this.curMeasure3D=null,this._consoleCallBack&&this._consoleCallBack("加载测量!")}},{key:"saveJson",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"MeasureData",t=[],n=0;n<this.measuresGroup.children.length;n++){var i=this.measuresGroup.children[n],r=i.toJSON();r&&t.push(r)}return localStorage.setItem(e,JSON.stringify(t)),this._consoleCallBack&&this._consoleCallBack("保存测量!"),t}},{key:"_onClick",value:function(e){if(this.curMeasure3D){var t=this.viewer.picker.screenToVector(e.point);this.curMeasure3D.type===Lm.TYPE_HEIGHT?this.curMeasure3D.addPoint(t,this.viewer.picker.rayCaster.ray):t&&this.curMeasure3D.addPoint(t)}}},{key:"_onRightClick",value:function(){this.end()}},{key:"_onMouseMove",value:function(e){if(this.curMeasure3D){var t=this.viewer.picker.screenToVector(e);t&&(this.currMeasure.v2=t,this.currMeasure.showLine(),this.viewer.renderManager.render())}}},{key:"_onUpdate",value:function(){}},{key:"earthsCoreVec",get:function(){return this._earthsCoreVec},set:function(e){e&&(this._earthsCoreVec=(new at).copy(e))}},{key:"measureColor",get:function(){return this._measureColor},set:function(e){e&&(this._measureColor=e)}},{key:"measureUnit",get:function(){return this._measureUnit},set:function(e){this._measureUnit=e}},{key:"measureDecimalPlaces",get:function(){return this._measureDecimalPlaces},set:function(e){this._measureDecimalPlaces=e}},{key:"consoleCallBack",set:function(e){e&&(this._consoleCallBack=e)}}]),e}(),Rm=function(){function e(t){s(this,e),this.viewer=t,this.selectionsGroup=new zt,this.viewer.modelGroup.add(this.selectionsGroup),this.curSelection=null,this.container=document.createElement("div"),this.viewer.container.appendChild(this.container),this.earthsCoreVec=new at,this._onClick=this._onClick.bind(this),this._onRightClick=this._onRightClick.bind(this),this._onMouseMove=this._onMouseMove.bind(this)}return A(e,[{key:"polygonSelection",value:function(){this.start(km.TYPE_POLYGON),this._consoleCallBack&&this._consoleCallBack("开始多边形框选,点击右键即可完成!")}},{key:"rectSelection",value:function(){this.start(km.TYPE_RECT),this._consoleCallBack&&this._consoleCallBack("开始矩形框选,点击右键即可完成!")}},{key:"circularSelection",value:function(){this.start(km.TYPE_CIRCULAR),this._consoleCallBack&&this._consoleCallBack("开始圆形框选,点击右键即可完成!")}},{key:"start",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:km.TYPE_POLYGON;this.curSelection?this.curSelection.type!=e&&(this.removeSelection(),this.addSelection(e)):this.addSelection(e),this.viewer.moduleManager.event.addEventListener(Ad.click,this._onClick),this.viewer.moduleManager.event.addEventListener(Ad.rightClick,this._onRightClick),this.viewer.moduleManager.event.addEventListener(Ad.mousemove,this._onMouseMove),this.viewer.domElement.style.cursor="crosshair",this.container.style.display="block"}},{key:"end",value:function(){this._endCallBack&&this._endCallBack(this.curSelection),this.curSelection&&(this.curSelection.pathEditor.path.length<3&&this.selectionsGroup.remove(this.curSelection),this.curSelection=null),this.viewer.moduleManager.event.removeEventListener(Ad.click,this._onClick),this.viewer.moduleManager.event.removeEventListener(Ad.rightClick,this._onRightClick),this.viewer.moduleManager.event.removeEventListener(Ad.mousemove,this._onMouseMove),this.viewer.domElement.style.cursor="auto",this.container.style.display="none"}},{key:"filter",value:function(e){if(e=e||this.viewer.sceneManager.modelGroup,this.curSelection&&this.end(),this.selectionsGroup.children.length>0){var t=this.selectionsGroup.children[this.selectionsGroup.children.length-1],n=this.viewer.camera.matrix.clone();n.setPosition(0,0,0);var i=(new bt).getInverse(n);t.filter(e,i)}this._consoleCallBack&&this._consoleCallBack("框选过滤完成!")}},{key:"show",value:function(){!1===this.selectionsGroup.visible&&(this.selectionsGroup.visible=!0,this._consoleCallBack&&this._consoleCallBack("显示框选!"))}},{key:"hide",value:function(){!0===this.selectionsGroup.visible&&(this.selectionsGroup.visible=!1,this._consoleCallBack&&this._consoleCallBack("隐藏框选!"))}},{key:"addSelection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:km.TYPE_POLYGON,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t||this.selectionColor;return this.curSelection=new km(e,n),this.curSelection.viewer=this.viewer,this.selectionsGroup.add(this.curSelection),this.curSelection}},{key:"removeSelection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;this.selectionsGroup.children.length>0&&(-1===e&&(e=this.selectionsGroup.children.length-1),this.selectionsGroup.children.splice(e,1),this.curSelection=null,this._consoleCallBack&&this._consoleCallBack("删除成功!"))}},{key:"clearSelection",value:function(){this.selectionsGroup.children.splice(0,this.selectionsGroup.children.length)}},{key:"loadJson",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"SelectionData",t=localStorage.getItem(e);if(t){t=JSON.parse(t);for(var n=0;n<t.length;n++){var i=t[n];if(i){var r=this.addSelection(i.type,i.color);r.loadJson(i),this.selectionsGroup.add(r)}}}this.curSelection=null,this._consoleCallBack&&this._consoleCallBack("加载框选!")}},{key:"saveJson",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"SelectionData",t=[],n=0;n<this.selectionsGroup.children.length;n++){var i=this.selectionsGroup.children[n],r=i.toJSON();r&&t.push(r)}return localStorage.setItem(e,JSON.stringify(t)),this._consoleCallBack&&this._consoleCallBack("保存框选!"),t}},{key:"_onClick",value:function(e){if(this.curSelection)if(this.viewer.isGISViewer){var t=this.viewer.pickPosition(e.point);if(t){var n=this.viewer.vector3ToCoordinates(t),i=this;this.curSelection.addPoint(n,(function(){i.end()}))}}else{var r=this.viewer.picker.screenToVector(e.point);if(r){var a=this;this.curSelection.addPoint(r,(function(){a.end()}))}}}},{key:"_onRightClick",value:function(){this.end()}},{key:"_onMouseMove",value:function(e){if(this.curSelection&&this.curSelection.firstPoint)if(this.viewer.isGISViewer){var t=this.viewer.pickPosition(e.point);if(t){var n=this.viewer.vector3ToCoordinates(t);this.curSelection.addPoint(n)}}else{var i=this.viewer.picker.screenToVector(e.point);i&&this.curSelection.addPoint(i)}}},{key:"_onUpdate",value:function(){}},{key:"destory",value:function(){this.end(),this.viewer.modelGroup.remove(this.selectionsGroup)}},{key:"selectionColor",get:function(){return this._selectionColor},set:function(e){e&&(this._selectionColor=e)}},{key:"consoleCallBack",set:function(e){e&&(this._consoleCallBack=e)}},{key:"endCallBack",set:function(e){e&&(this._endCallBack=e)}}]),e}(),Om=function(){function e(t){s(this,e),this.viewer=t,this.flyLinesGroup=new zt,this.viewer.modelGroup.add(this.flyLinesGroup),this.circleGroup=new zt,this.viewer.modelGroup.add(this.circleGroup),this.pointVisible=!0,this.flyLineColor="#02E6FF",this.flyLinePoints=[],this.curFlyLine=null,this.container=document.createElement("div"),this.viewer.container.appendChild(this.container),this._onClick=this._onClick.bind(this),this._onRightClick=this._onRightClick.bind(this),this._onMouseMove=this._onMouseMove.bind(this)}return A(e,[{key:"start",value:function(){this.curFlyLine&&this.end(),this.viewer.moduleManager.event.addEventListener(Ad.click,this._onClick),this.viewer.moduleManager.event.addEventListener(Ad.rightClick,this._onRightClick),this.viewer.moduleManager.event.addEventListener(Ad.mousemove,this._onMouseMove),this.viewer.domElement.style.cursor="crosshair",this.container.style.display="block"}},{key:"end",value:function(){this.flyLinePoints=[],this._endCallBack&&this._endCallBack(this.curFlyLine),this.curFlyLine&&(this.curFlyLine=null),this.circle&&(this.circle.visible=!1),this.viewer.moduleManager.event.removeEventListener(Ad.click,this._onClick),this.viewer.moduleManager.event.removeEventListener(Ad.rightClick,this._onRightClick),this.viewer.moduleManager.event.removeEventListener(Ad.mousemove,this._onMouseMove),this.viewer.domElement.style.cursor="auto",this.container.style.display="none"}},{key:"pointVisible",get:function(){return this._pointVisible},set:function(e){var t=this;this._pointVisible=!!e,this.flyLinesGroup.children.forEach((function(e){e.pointVisible=t._pointVisible}))}},{key:"show",value:function(){!1===this.flyLinesGroup.visible&&(this.flyLinesGroup.visible=!0,this._consoleCallBack&&this._consoleCallBack("显示飞线!"))}},{key:"hide",value:function(){!0===this.flyLinesGroup.visible&&(this.flyLinesGroup.visible=!1,this._consoleCallBack&&this._consoleCallBack("隐藏飞线!"))}},{key:"addFlyLine",value:function(e,t,n,i){return this.curFlyLine=new Sm(e,t,n,i),this.curFlyLine.pointVisible=this.pointVisible,this.flyLinesGroup.add(this.curFlyLine),this.curFlyLine}},{key:"removeFlyLine",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;this.flyLinesGroup.children.length>0&&(-1===e&&(e=this.flyLinesGroup.children.length-1),this.flyLinesGroup.children.splice(e,1),this.curFlyLine=null,this._consoleCallBack&&this._consoleCallBack("删除成功!"))}},{key:"clearFlyLine",value:function(){this.flyLinesGroup.children.splice(0,this.flyLinesGroup.children.length)}},{key:"loadJson",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"FlyLineData",t=localStorage.getItem(e);if(t){t=JSON.parse(t);for(var n=0;n<t.length;n++){var i=t[n];if(i){var r=this.addFlyLine((new at).copy(i.start),(new at).copy(i.end),i.height,i.color);this.flyLinesGroup.add(r)}}}this.curFlyLine=null,this._consoleCallBack&&this._consoleCallBack("加载飞线!")}},{key:"saveJson",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"FlyLineData",t=[],n=0;n<this.flyLinesGroup.children.length;n++){var i=this.flyLinesGroup.children[n],r=i.toJSON();r&&t.push(r)}return localStorage.setItem(e,JSON.stringify(t)),this._consoleCallBack&&this._consoleCallBack("保存飞线!"),t}},{key:"addCircle",value:function(e,t){return this.circle?t!=this.oldColor&&(this.circleGroup.remove(this.circle),this.circle=this.createCircle(t),this.circleGroup.add(this.circle)):(this.circle=this.createCircle(t),this.circleGroup.add(this.circle)),e&&this.circle.position.copy(e),this.circle.visible=!0,this.circle}},{key:"createCircle",value:function(e){var t=new Nn({map:If.createCircleMap(e),side:2,transparent:!0}),n=new Ei(new dl(2,32),t);return n.rotation.x=Math.PI/2,n}},{key:"_onClick",value:function(e){var t=this.viewer.picker.screenToVector(e.point);t&&(t.y+=.1,this.flyLinePoints.push(t),2===this.flyLinePoints.length?(this.addFlyLine(this.flyLinePoints[0],this.flyLinePoints[1],this.flyLineHeight,this.flyLineColor),this.flyLinePoints=[],this.circle.visible=!1):this.addCircle(t,this.flyLineColor))}},{key:"_onRightClick",value:function(){this.end()}},{key:"_onMouseMove",value:function(e){}},{key:"_onUpdate",value:function(){}},{key:"destory",value:function(){this.end(),this.viewer.modelGroup.remove(this.flyLinesGroup)}},{key:"flyLineHeight",get:function(){return this._flyLineHeight},set:function(e){null!=e&&(this._flyLineHeight=e)}},{key:"flyLineColor",get:function(){return this._flyLineColor},set:function(e){e&&(this._flyLineColor=e)}},{key:"consoleCallBack",set:function(e){e&&(this._consoleCallBack=e)}},{key:"endCallBack",set:function(e){e&&(this._endCallBack=e)}}]),e}(),Nm=function(){function e(t){s(this,e),this.viewer=t,this._color="#FF4500",this._pathEditorTool=new Um(t),this._type=e.PATH}return A(e,[{key:"drawPath",value:function(){this.type=e.PATH,this.pathEditorTool.pathEditorColor=this.color,this.pathEditorTool.start()}},{key:"drawDistanceMeasure",value:function(){this.type=e.DISTANCEMEASURE,this.measure3DTool.measureColor=this.color,this.measure3DTool.distanceMeasure()}},{key:"drawHeightMeasure",value:function(){this.type=e.HEIGHTMEASURE,this.measure3DTool.measureColor=this.color,this.measure3DTool.heightMeasure()}},{key:"drawAngleMeasure",value:function(){this.type=e.ANGLEMEASURE,this.measure3DTool.measureColor=this.color,this.measure3DTool.angleMeasure()}},{key:"drawAreaMeasure",value:function(){this.type=e.AREAMEASURE,this.measure3DTool.measureColor=this.color,this.measure3DTool.areaMeasure()}},{key:"drawPolygonSelection",value:function(){this.type=e.POLYGONSELECTION,this.selectionTool.selectionColor=this.color,this.selectionTool.polygonSelection()}},{key:"drawRectSelection",value:function(){this.type=e.RECTSELECTION,this.selectionTool.selectionColor=this.color,this.selectionTool.rectSelection()}},{key:"drawCircularSelection",value:function(){this.type=e.CIRCULARSELECTION,this.selectionTool.selectionColor=this.color,this.selectionTool.circularSelection()}},{key:"drawFlyLine",value:function(){this.type=e.FLYLINE,this.flyLineTool.flyLineColor=this.color,this.flyLineTool.start()}},{key:"drawPolygonModel",value:function(){this.type=e.POLYGONSELECTION,this.selectionTool.selectionColor=this.color,this.selectionTool.polygonSelection(),this.selectionTool.endCallBack=this._drawPolygonModel.bind(this)}},{key:"_drawPolygonModel",value:function(e){var t=e.pathEditor.path;if(t.length>=3){var n=new kf(this.viewer),i=new CA;i.moveTo(t[0].x,t[0].z);for(var r=1;r<t.length;r++)i.lineTo(t[r].x,t[r].z);i.lineTo(t[0].x,t[0].z);var a=new Ei(new Xs(i,{steps:1,depth:-this.height,bevelEnabled:!0,bevelThickness:0,bevelSize:0,bevelOffset:0,bevelSegments:1}),new Gf({color:this.color,side:2}));a.rotateX(Math.PI/2),n.add(a),n.position.y=t[0].y,this.viewer.modelGroup.add(n)}else console.log("小于3个点无法构成多边形");this.selectionTool.selectionsGroup.remove(e),this.selectionTool.endCallBack=void 0}},{key:"loadJson",value:function(){this.pathEditorTool.loadJson(),this.measure3DTool.loadJson(),this.selectionTool.loadJson(),this.flyLineTool.loadJson()}},{key:"saveJson",value:function(){this.pathEditorTool.saveJson(),this.measure3DTool.saveJson(),this.selectionTool.saveJson(),this.flyLineTool.saveJson()}},{key:"drawEnd",value:function(){var t=this.type;t==e.PATH?this.pathEditorTool.end():t==e.DISTANCEMEASURE||t==e.HEIGHTMEASURE||t==e.ANGLEMEASURE||t==e.AREAMEASURE?this.measure3DTool.end():t==e.POLYGONSELECTION||t==e.RECTSELECTION||t==e.CIRCULARSELECTION?this.selectionTool.end():t==e.FLYLINE&&this.flyLineTool.end()}},{key:"height",get:function(){return this._height||1},set:function(e){this._height=e}},{key:"color",get:function(){return this._color},set:function(e){e&&(this._color=e)}},{key:"type",get:function(){return this._type},set:function(e){this._type!=e&&this.drawEnd(),this._type=e}},{key:"pathEditorTool",get:function(){return this._pathEditorTool||(this._pathEditorTool=new Um(this.viewer)),this._pathEditorTool}},{key:"measure3DTool",get:function(){return this._measure3DTool||(this._measure3DTool=new Dm(this.viewer)),this._measure3DTool}},{key:"selectionTool",get:function(){return this._selectionTool||(this._selectionTool=new Rm(this.viewer)),this._selectionTool}},{key:"flyLineTool",get:function(){return this._flyLineTool||(this._flyLineTool=new Om(this.viewer)),this._flyLineTool}}]),e}();Nm.PATH=0,Nm.DISTANCEMEASURE=1,Nm.HEIGHTMEASURE=2,Nm.ANGLEMEASURE=3,Nm.AREAMEASURE=4,Nm.POLYGONSELECTION=5,Nm.RECTSELECTION=6,Nm.CIRCULARSELECTION=7,Nm.FLYLINE=8;var zm,Qm,Gm=0,Hm=function(){function e(t){var n=this;s(this,e),this.viewer=t;var i=document.createElement("div");i.style.cssText="position:absolute;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000;flex-direction: column;display:none;background-color: #000022c7;display:none",t.container.appendChild(i),this._visible=!1,this.container=i,this.texture=null,zm=(performance||Date).now(),Qm=zm,this.facePanel=this.addPanel("面数:"),this.verticesPanel=this.addPanel("顶点数:"),this.meshPanel=this.addPanel("网格数:"),this.skinnedMeshPanel=this.addPanel("蒙皮网格数:"),this.materialPanel=this.addPanel("材质数:"),this.nodePanel=this.addPanel("节点数:"),this.fpsPanel=this.addPanel("帧数:","FPS"),this.msPanel=this.addPanel("耗时:","MS"),this.memPanel=null,window.performance&&window.performance.memory&&(this.memPanel=this.addPanel("内存:","MB")),this.targetPanel=this.addPanel("展示纹理");var r=0;this.targetPanel.dom.onclick=function(){if(n.texture){var e=n.viewer.domElement.width,i=n.viewer.domElement.height;if(n.texture.image&&void 0!==n.texture.image.width&&void 0!==n.texture.image.height){var a=n.viewer.domElement.getBoundingClientRect();e=n.texture.image.width,i=n.texture.image.height;var o=a.width/e,s=a.height/i;e>=i?(r=o)*i>a.height&&(r=s):(r=s)*e>a.width&&(r=o)}n.orthographicCamera=new FA(n.viewer.domElement.width/-2,n.viewer.domElement.width/2,n.viewer.domElement.height/2,n.viewer.domElement.height/-2,.1,1e7),n.orthographicCamera.zoom=r,n.orthographicCamera.updateProjectionMatrix(),n.targetMesh=new Ei(new $i(e,i),new Nn({map:n.texture,transparent:!0})),t.renderer.render(n.targetMesh,n.orthographicCamera);var l=t.renderer.domElement.toDataURL(),A=new Image;A.src=l;var c=window.open("","_blank");c.document.write(A.outerHTML),c.document.close()}}}return A(e,[{key:"addPanel",value:function(t,n){var i=new e.Panel(t,n,"#0ff");return this.container.appendChild(i.dom),i}},{key:"update",value:function(){Gm++;var e=0,t=0,n=0,i=0,r=0,a=0,o=[],s=[];this.visible&&(this.viewer.scene.traverse((function(l){(n++,l.isMesh)&&(e++,l.isSkinnedMesh&&t++,s.includes(l.geometry)||s.push(l.geometry),l.geometry.attributes&&l.geometry.attributes.position?i+=l.geometry.attributes.position.count:l.geometry.vertices&&(i+=l.geometry.vertices.length),l.geometry.index?r+=l.geometry.index.count:l.geometry.faces&&(r+=l.geometry.faces.length),l.material&&(Array.isArray(l.material)?l.material:[l.material]).forEach((function(e){o.includes(e.id)||(a++,o.push(e.id))})))})),this.facePanel.update(r),this.verticesPanel.update(i),this.meshPanel.update(e),this.skinnedMeshPanel.update(t),this.materialPanel.update(a),this.nodePanel.update(n));var l=(performance||Date).now();if(this.msPanel.update(l-zm,!0),l>=Qm+1e3&&(this.fpsPanel.update(1e3*Gm/(l-Qm),!0),Qm=l,Gm=0,this.memPanel)){var A=performance.memory;this.memPanel.update(A.usedJSHeapSize/1048576,!0)}this.targetPanel.update(this.texture?"展示纹理":void 0),zm=l}},{key:"visible",get:function(){return this._visible},set:function(e){this._visible=e,this.container.style.display=e?"flex":"none"}},{key:"formatBytes",value:function(e,t){if(0===e)return"0 bytes";var n=t<0?0:t,i=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,i)).toFixed(n))+" "+["bytes","KB","MB"][i]}}]),e}();Hm.Panel=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=1/0,r=0,a=Math.round,o=a(window.devicePixelRatio||1),s=140*o,l=20*o,A=3*o,c=4*o,h=document.createElement("canvas");h.width=s,h.height=l,h.style.cssText="width:140px;height:20px;";var u=h.getContext("2d");return u.font=12*o+"px Helvetica,Arial,sans-serif",u.textBaseline="top",u.clearRect(0,0,s,l),u.fillStyle=n,u.fillText(e,A,c),{dom:h,update:function(o,h){i=Math.min(i,o),r=Math.max(r,o),u.globalAlpha=1,u.clearRect(0,0,s,l),u.fillStyle=n,u.fillText((void 0!==o?e+(isNaN(o)?o:a(o)):"")+" "+t+(h?" ("+a(i)+"-"+a(r)+")":""),A,c)}}};var Vm,jm,Wm=function(){function e(t){var n=this;s(this,e),this.stream=t.captureStream(60),this.recorder=new MediaRecorder(this.stream,{mimeType:"video/webm;codecs=h264"}),this.allChunks=[],this.recorder.ondataavailable=function(e){n.allChunks.push(e.data)},this.element=document.createElement("div"),t.parentElement.appendChild(this.element),this.element.style.cssText="display: none;flex-direction: row;align-items: center;gap: 5px;background: #000000b5;position: absolute;top:0px;padding: 5px;left: 50%;transform: translateX(-50%);font-size: 12px;color: white;",this.element.innerHTML='<span style="background: red;width: 12px;height: 12px;border-radius: 50%;"></span><span id="label">正在录制 00:00</span>',this.tip=this.element.querySelector("#label"),this.interval=null,this._timer=this._timer.bind(this),this.duration=0,this.timeLabel=""}return A(e,[{key:"start",value:function(){this._stop(),this.interval=setInterval(this._timer,1e3),this.tip.innerHTML="正在录制 00:00",this.duration=0,this.tipVisible=!0,this.allChunks=[],this.recorder.start(10)}},{key:"stop",value:function(){this._stop(),this.tip.innerHTML="录制完成 "+this.timeLabel}},{key:"_stop",value:function(){this.interval&&clearInterval(this.interval),"recording"===this.recorder.state&&this.recorder.stop()}},{key:"download",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"录屏";if(this.allChunks.length>0){var t=document.createElement("a");t.style.display="none";var n=new Blob(this.allChunks),i=window.URL.createObjectURL(n);t.href=i,t.download=e+".webm",document.body.appendChild(t),t.click(),t.remove()}else console.warn("无数据")}},{key:"preview",value:function(){if(this.allChunks.length>0){var e=new Blob(this.allChunks),t=window.URL.createObjectURL(e),n=document.createElement("video");n.style.cssText="max-width: 80%;max-height: 80%",n.controls=!0,n.src=t;var i=window.open("","_blank");i.document.write(n.outerHTML),i.document.close()}else console.warn("无数据")}},{key:"exit",value:function(){this.stop(),this.allChunks=[],this.tipVisible=!1}},{key:"_timer",value:function(){this.duration++,this.timeLabel="";var e=parseInt(this.duration/60),t=this.duration%60;this.timeLabel+=(e>9?e:"0"+e)+":",this.timeLabel+=t>9?t:"0"+t,this.tip.innerHTML="正在录制 "+this.timeLabel}},{key:"tipVisible",set:function(e){this.element.style.display=e?"flex":"none"}}]),e}(),Xm=function(e){h(n,e);var t=y(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this,n),(i=t.call(this,e,r)).isViewer=!0,i._debug=!1,i._mapLoader=null,!r.isMap&&i.initialize(r),i}return A(n,[{key:"screenShot",get:function(){console.warn("viewer.screenShot has been removed, use AMRT.ScreenHelper.screenShot(viewer) instead.")}},{key:"encircleScreenShot",get:function(){console.warn("viewer.screenShot has been removed, use AMRT.ScreenHelper.encircleScreenShot(viewer) instead.")}},{key:"intersectObjects",get:function(){return this.picker.intersectObjects.bind(this.picker)}},{key:"intersectObject",get:function(){return this.picker.intersectObject.bind(this.picker)}},{key:"intersectModels",get:function(){return this.picker.intersectModels.bind(this.picker)}},{key:"screenToVector",get:function(){return this.picker.screenToVector.bind(this.picker)}},{key:"vectorToScreen",get:function(){return this.picker.vectorToScreen.bind(this.picker)}},{key:"enableOutline",get:function(){return this.composer.enableOutline},set:function(e){this.composer.enableOutline=e}},{key:"outline",get:function(){return this.composer.outline}},{key:"enableUnrealBloom",get:function(){return this.composer.enableUnrealBloom},set:function(e){this.composer.enableUnrealBloom=e}},{key:"unrealBloom",get:function(){return this.composer.unrealBloom}},{key:"enableDof",get:function(){return this.composer.enableDof},set:function(e){this.composer.enableDof=e}},{key:"dof",get:function(){return this.composer.dof}},{key:"enableSSAO",get:function(){return this.composer.enableSSAO},set:function(e){this.composer.enableSSAO=e}},{key:"ssao",get:function(){return this.composer.ssao}},{key:"enableColorAdjustment",get:function(){return this.composer.enableColorAdjustment},set:function(e){this.composer.enableColorAdjustment=e}},{key:"colorAdjustment",get:function(){return this.composer.colorAdjustment}},{key:"enableVignette",get:function(){return this.composer.enableVignette},set:function(e){this.composer.enableVignette=e}},{key:"vignette",get:function(){return this.composer.vignette}},{key:"enableCircleSweep",get:function(){return this.composer.enableCircleSweep},set:function(e){this.composer.enableCircleSweep=e}},{key:"circleSweep",get:function(){return this.composer.circleSweep}},{key:"enableSSR",get:function(){return this.composer.enableSSR},set:function(e){this.composer.enableSSR=e}},{key:"ssr",get:function(){return this.composer.ssr}},{key:"mapLoader",get:function(){return this._mapLoader||(this._mapLoader=new Kf(this)),this._mapLoader}},{key:"materialEditor",get:function(){return Vm||(Vm=new wm(this)),Vm}},{key:"operator",get:function(){return jm||(jm=new sm(this)),jm}},{key:"enableTransform",get:function(){return Boolean(this.transform&&this.transform.enabled)},set:function(e){e?(!this.transform&&(this.transform=new bm(this)),this.transform.enabled=!0,this.transform.setMode(Mm.TRANSLATE)):(this.transform.enabled=!1,this.transform.setTarget(null))}},{key:"hotspot",get:function(){return this.moduleManager.hotspot}},{key:"basicModel",get:function(){return this._basicModel||(this._basicModel=new Pm(this)),this._basicModel}},{key:"basicEditor",get:function(){return this._basicEditor||(this._basicEditor=new Nm(this)),this._basicEditor}},{key:"initialize",value:function(e){this.picker=new xm(this),b(u(n.prototype),"initialize",this).call(this,e)}},{key:"dispose",value:function(){this.enableOutline=!1,this.enableDof=!1,this.enableUnrealBloom=!1,b(u(n.prototype),"dispose",this).call(this)}},{key:"debug",get:function(){return this._debug},set:function(e){var t=this;this.debugPanel||(this.debugPanel=new Hm(this),this.addEventListener("update",(function(){t.debugPanel.update()}))),this.debugPanel.visible=this._debug=e}},{key:"recorder",get:function(){return this._recorder||(this._recorder=new Wm(this.domElement)),this._recorder}}]),n}(tm),Ym=A((function e(){s(this,e)}));Ym.CENTER="center",Ym.LEFT="left",Ym.RIGHT="right",Ym.TOP="top",Ym.BOTTOM="bottom",Ym.TOP_LEFT="top-left",Ym.TOP_RIGHT="top-right",Ym.BOTTOM_LEFT="bottom-left",Ym.BOTTOM_RIGHT="bottom-right";var Km=function(){function e(t){var n=this;s(this,e),this.position=t.position.clone(),this.objectId=t.objectId,this.worldPos=t.worldPos,this.cameraView=t.cameraView,this.cameraView&&this.cameraView.position&&this.cameraView.target&&(this.cameraView.position=Array.isArray(this.cameraView.position)?(new at).fromArray(this.cameraView.position):(new at).copy(this.cameraView.position),this.cameraView.target=Array.isArray(this.cameraView.target)?(new at).fromArray(this.cameraView.target):(new at).copy(this.cameraView.target)),this.element=t.element,this.onUpdate=t.onUpdate,this.userData=t.userData||{},this.screenCoord=void 0,this.onclick=t.onclick,this.anchor=t.anchor||Ym.BOTTOM,this.offset=t.offset||new tt,this.hided=!1,this.focus=function(){},this.complete=t.complete,this.flicker=t.flicker,this.flicker&&this.showFlicker(),this.element.onclick=function(e){n.focus(),n.onclick&&n.onclick(e)}}return A(e,[{key:"showFlicker",value:function(){var e=this;this.interval||(this.interval=setInterval((function(){e.element.parentElement&&!e.hided&&(e.element.style.display="none"==e.element.style.display?"block":"none")}),500))}},{key:"stopFlicker",value:function(){this.interval&&(clearInterval(this.interval),this.interval=null,this.element.style.display=this.hided?"none":"block")}},{key:"updateScreenCoords",value:function(e){if(e){this.screenCoord=e;var t=this._convertAnchor();this.element.style.left=e.x+t.x+this.offset.x+"px",this.element.style.top=e.y+t.y+this.offset.y+"px"}}},{key:"hide",value:function(){this.element.style.display="none",this.hided=!0}},{key:"show",value:function(){this.element.style.display="block",this.hided=!1}},{key:"remove",value:function(){this.element.parentElement&&this.element.parentElement.removeChild(this.element),this.stopFlicker()}},{key:"toJSON",value:function(){return{position:this.worldPos?this.worldPos.toArray():this.position.toArray(),objectId:this.objectId,cameraView:{position:this.cameraView&&this.cameraView.position?this.cameraView.position.toArray():null,target:this.cameraView&&this.cameraView.target?this.cameraView.target.toArray():null},element:(new XMLSerializer).serializeToString(this.element),userData:this.userData}}},{key:"_convertAnchor",value:function(){var e=this.element.getBoundingClientRect(),t=new tt;switch(this.anchor){case"center":t.set(-e.width/2,-e.height/2);break;case"top":t.set(-e.width/2,0);break;case"bottom":t.set(-e.width/2,-e.height);break;case"left":t.set(0,-e.height/2);break;case"right":t.set(-e.width,-e.height/2);break;case"top-left":t.set(0,0);break;case"top-right":t.set(-e.width,0);break;case"bottom-left":t.set(0,-e.height);break;case"bottom-right":t.set(-e.width,-e.height)}return t}}]),e}(),Zm=function(){function e(){s(this,e),this.spots=[],this._visible=!0,this.name=""}return A(e,[{key:"visible",get:function(){return this._visible},set:function(e){this._setVisible(e)}},{key:"hide",value:function(){this._setVisible(0)}},{key:"show",value:function(){this._setVisible(1)}},{key:"add",value:function(e){this.spots.push(e),e.parent=this}},{key:"remove",value:function(e){this.spots.remove(e),e.remove(),e.parent=null}},{key:"removeAll",value:function(){this.spots.forEach((function(e){e.remove()})),this.spots=[]}},{key:"_setVisible",value:function(e){this._visible=e,this.spots.forEach((function(t){e?t.show():t.hide()}))}},{key:"toJSON",value:function(){var e=[];return this.spots.forEach((function(t){e.push(t.toJSON())})),e}}]),e}();"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Jm(e){var t={exports:{}};return e(t,t.exports),t.exports
|
|
|
/*!
|
|
|
* html2canvas 1.4.1 <https://html2canvas.hertzen.com>
|
|
|
* Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
|
|
|
* Released under MIT License
|
|
|
*/}var qm=Jm((function(e,t){e.exports=function(){
|
|
|
/*! *****************************************************************************
|
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
purpose with or without fee is hereby granted.
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
|
***************************************************************************** */
|
|
|
var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var n=function(){return n=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},n.apply(this,arguments)};function i(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function o(e){try{l(i.next(e))}catch(e){a(e)}}function s(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){e.done?n(e.value):r(e.value).then(o,s)}l((i=i.apply(e,t||[])).next())}))}function r(e,t){var n,i,r,a,o={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return l([e,t])}}function l(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(r=2&a[0]?i.return:a[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,a[1])).done)return r;switch(i=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,i=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((r=(r=o.trys).length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){o.label=a[1];break}if(6===a[0]&&o.label<r[1]){o.label=r[1],r=a;break}if(r&&o.label<r[2]){o.label=r[2],o.ops.push(a);break}r[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],i=0}finally{n=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}function a(e,t,n){if(n||2===arguments.length)for(var i,r=0,a=t.length;r<a;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||t)}for(var o=function(){function e(e,t,n,i){this.left=e,this.top=t,this.width=n,this.height=i}return e.prototype.add=function(t,n,i,r){return new e(this.left+t,this.top+n,this.width+i,this.height+r)},e.fromClientRect=function(t,n){return new e(n.left+t.windowBounds.left,n.top+t.windowBounds.top,n.width,n.height)},e.fromDOMRectList=function(t,n){var i=Array.from(n).find((function(e){return 0!==e.width}));return i?new e(i.left+t.windowBounds.left,i.top+t.windowBounds.top,i.width,i.height):e.EMPTY},e.EMPTY=new e(0,0,0,0),e}(),s=function(e,t){return o.fromClientRect(e,t.getBoundingClientRect())},l=function(e){var t=e.body,n=e.documentElement;if(!t||!n)throw new Error("Unable to get document size");var i=Math.max(Math.max(t.scrollWidth,n.scrollWidth),Math.max(t.offsetWidth,n.offsetWidth),Math.max(t.clientWidth,n.clientWidth)),r=Math.max(Math.max(t.scrollHeight,n.scrollHeight),Math.max(t.offsetHeight,n.offsetHeight),Math.max(t.clientHeight,n.clientHeight));return new o(0,0,i,r)},A=function(e){for(var t=[],n=0,i=e.length;n<i;){var r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<i){var a=e.charCodeAt(n++);56320==(64512&a)?t.push(((1023&r)<<10)+(1023&a)+65536):(t.push(r),n--)}else t.push(r)}return t},c=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var n=e.length;if(!n)return"";for(var i=[],r=-1,a="";++r<n;){var o=e[r];o<=65535?i.push(o):(o-=65536,i.push(55296+(o>>10),o%1024+56320)),(r+1===n||i.length>16384)&&(a+=String.fromCharCode.apply(String,i),i.length=0)}return a},h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u="undefined"==typeof Uint8Array?[]:new Uint8Array(256),d=0;d<h.length;d++)u[h.charCodeAt(d)]=d;for(var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p="undefined"==typeof Uint8Array?[]:new Uint8Array(256),m=0;m<f.length;m++)p[f.charCodeAt(m)]=m;for(var v=function(e){var t,n,i,r,a,o=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var A="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(o):new Array(o),c=Array.isArray(A)?A:new Uint8Array(A);for(t=0;t<s;t+=4)n=p[e.charCodeAt(t)],i=p[e.charCodeAt(t+1)],r=p[e.charCodeAt(t+2)],a=p[e.charCodeAt(t+3)],c[l++]=n<<2|i>>4,c[l++]=(15&i)<<4|r>>2,c[l++]=(3&r)<<6|63&a;return A},g=function(e){for(var t=e.length,n=[],i=0;i<t;i+=2)n.push(e[i+1]<<8|e[i]);return n},y=function(e){for(var t=e.length,n=[],i=0;i<t;i+=4)n.push(e[i+3]<<24|e[i+2]<<16|e[i+1]<<8|e[i]);return n},w=5,x=11,b=2,M=65536>>w,C=(1<<w)-1,B=M+(1024>>w)+32,E=65536>>x,S=(1<<x-w)-1,T=function(e,t,n){return e.slice?e.slice(t,n):new Uint16Array(Array.prototype.slice.call(e,t,n))},_=function(e,t,n){return e.slice?e.slice(t,n):new Uint32Array(Array.prototype.slice.call(e,t,n))},I=function(e,t){var n=v(e),i=Array.isArray(n)?y(n):new Uint32Array(n),r=Array.isArray(n)?g(n):new Uint16Array(n),a=24,o=T(r,a/2,i[4]/2),s=2===i[5]?T(r,(a+i[4])/2):_(i,Math.ceil((a+i[4])/4));return new L(i[0],i[1],i[2],i[3],o,s)},L=function(){function e(e,t,n,i,r,a){this.initialValue=e,this.errorValue=t,this.highStart=n,this.highValueIndex=i,this.index=r,this.data=a}return e.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>w])<<b)+(e&C),this.data[t];if(e<=65535)return t=((t=this.index[M+(e-55296>>w)])<<b)+(e&C),this.data[t];if(e<this.highStart)return t=B-E+(e>>x),t=this.index[t],t+=e>>w&S,t=((t=this.index[t])<<b)+(e&C),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),F="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",k="undefined"==typeof Uint8Array?[]:new Uint8Array(256),P=0;P<F.length;P++)k[F.charCodeAt(P)]=P;var U=50,D=1,R=2,O=3,N=4,z=5,Q=7,G=8,H=9,V=10,j=11,W=12,X=13,Y=14,K=15,Z=16,J=17,q=18,$=19,ee=20,te=21,ne=22,ie=23,re=24,ae=25,oe=26,se=27,le=28,Ae=29,ce=30,he=31,ue=32,de=33,fe=34,pe=35,me=36,ve=37,ge=38,ye=39,we=40,xe=41,be=42,Me=43,Ce=[9001,65288],Be="!",Ee="×",Se="÷",Te=I("KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwM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ywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywH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MAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDM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BtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwB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ABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAe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B4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQB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VwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAr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gArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHg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AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA=="),_e=[ce,me],Ie=[D,R,O,z],Le=[V,G],Fe=[se,oe],ke=Ie.concat(Le),Pe=[ge,ye,we,fe,pe],Ue=[K,X],De=function(e,t){void 0===t&&(t="strict");var n=[],i=[],r=[];return e.forEach((function(e,a){var o=Te.get(e);if(o>U?(r.push(!0),o-=U):r.push(!1),-1!==["normal","auto","loose"].indexOf(t)&&-1!==[8208,8211,12316,12448].indexOf(e))return i.push(a),n.push(Z);if(o===N||o===j){if(0===a)return i.push(a),n.push(ce);var s=n[a-1];return-1===ke.indexOf(s)?(i.push(i[a-1]),n.push(s)):(i.push(a),n.push(ce))}return i.push(a),o===he?n.push("strict"===t?te:ve):o===be||o===Ae?n.push(ce):o===Me?e>=131072&&e<=196605||e>=196608&&e<=262141?n.push(ve):n.push(ce):void n.push(o)})),[i,n,r]},Re=function(e,t,n,i){var r=i[n];if(Array.isArray(e)?-1!==e.indexOf(r):e===r)for(var a=n;a<=i.length;){if((l=i[++a])===t)return!0;if(l!==V)break}if(r===V)for(a=n;a>0;){var o=i[--a];if(Array.isArray(e)?-1!==e.indexOf(o):e===o)for(var s=n;s<=i.length;){var l;if((l=i[++s])===t)return!0;if(l!==V)break}if(o!==V)break}return!1},Oe=function(e,t){for(var n=e;n>=0;){var i=t[n];if(i!==V)return i;n--}return 0},Ne=function(e,t,n,i,r){if(0===n[i])return Ee;var a=i-1;if(Array.isArray(r)&&!0===r[a])return Ee;var o=a-1,s=a+1,l=t[a],A=o>=0?t[o]:0,c=t[s];if(l===R&&c===O)return Ee;if(-1!==Ie.indexOf(l))return Be;if(-1!==Ie.indexOf(c))return Ee;if(-1!==Le.indexOf(c))return Ee;if(Oe(a,t)===G)return Se;if(Te.get(e[a])===j)return Ee;if((l===ue||l===de)&&Te.get(e[s])===j)return Ee;if(l===Q||c===Q)return Ee;if(l===H)return Ee;if(-1===[V,X,K].indexOf(l)&&c===H)return Ee;if(-1!==[J,q,$,re,le].indexOf(c))return Ee;if(Oe(a,t)===ne)return Ee;if(Re(ie,ne,a,t))return Ee;if(Re([J,q],te,a,t))return Ee;if(Re(W,W,a,t))return Ee;if(l===V)return Se;if(l===ie||c===ie)return Ee;if(c===Z||l===Z)return Se;if(-1!==[X,K,te].indexOf(c)||l===Y)return Ee;if(A===me&&-1!==Ue.indexOf(l))return Ee;if(l===le&&c===me)return Ee;if(c===ee)return Ee;if(-1!==_e.indexOf(c)&&l===ae||-1!==_e.indexOf(l)&&c===ae)return Ee;if(l===se&&-1!==[ve,ue,de].indexOf(c)||-1!==[ve,ue,de].indexOf(l)&&c===oe)return Ee;if(-1!==_e.indexOf(l)&&-1!==Fe.indexOf(c)||-1!==Fe.indexOf(l)&&-1!==_e.indexOf(c))return Ee;if(-1!==[se,oe].indexOf(l)&&(c===ae||-1!==[ne,K].indexOf(c)&&t[s+1]===ae)||-1!==[ne,K].indexOf(l)&&c===ae||l===ae&&-1!==[ae,le,re].indexOf(c))return Ee;if(-1!==[ae,le,re,J,q].indexOf(c))for(var h=a;h>=0;){if((u=t[h])===ae)return Ee;if(-1===[le,re].indexOf(u))break;h--}if(-1!==[se,oe].indexOf(c))for(h=-1!==[J,q].indexOf(l)?o:a;h>=0;){var u;if((u=t[h])===ae)return Ee;if(-1===[le,re].indexOf(u))break;h--}if(ge===l&&-1!==[ge,ye,fe,pe].indexOf(c)||-1!==[ye,fe].indexOf(l)&&-1!==[ye,we].indexOf(c)||-1!==[we,pe].indexOf(l)&&c===we)return Ee;if(-1!==Pe.indexOf(l)&&-1!==[ee,oe].indexOf(c)||-1!==Pe.indexOf(c)&&l===se)return Ee;if(-1!==_e.indexOf(l)&&-1!==_e.indexOf(c))return Ee;if(l===re&&-1!==_e.indexOf(c))return Ee;if(-1!==_e.concat(ae).indexOf(l)&&c===ne&&-1===Ce.indexOf(e[s])||-1!==_e.concat(ae).indexOf(c)&&l===q)return Ee;if(l===xe&&c===xe){for(var d=n[a],f=1;d>0&&t[--d]===xe;)f++;if(f%2!=0)return Ee}return l===ue&&c===de?Ee:Se},ze=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var n=De(e,t.lineBreak),i=n[0],r=n[1],a=n[2];"break-all"!==t.wordBreak&&"break-word"!==t.wordBreak||(r=r.map((function(e){return-1!==[ae,ce,be].indexOf(e)?ve:e})));var o="keep-all"===t.wordBreak?a.map((function(t,n){return t&&e[n]>=19968&&e[n]<=40959})):void 0;return[i,r,o]},Qe=function(){function e(e,t,n,i){this.codePoints=e,this.required=t===Be,this.start=n,this.end=i}return e.prototype.slice=function(){return c.apply(void 0,this.codePoints.slice(this.start,this.end))},e}(),Ge=function(e,t){var n=A(e),i=ze(n,t),r=i[0],a=i[1],o=i[2],s=n.length,l=0,c=0;return{next:function(){if(c>=s)return{done:!0,value:null};for(var e=Ee;c<s&&(e=Ne(n,a,r,++c,o))===Ee;);if(e!==Ee||c===s){var t=new Qe(n,e,l,c);return l=c,{value:t,done:!1}}return{done:!0,value:null}}}},He=1,Ve=2,je=4,We=8,Xe=10,Ye=47,Ke=92,Ze=9,Je=32,qe=34,$e=61,et=35,tt=36,nt=37,it=39,rt=40,at=41,ot=95,st=45,lt=33,At=60,ct=62,ht=64,ut=91,dt=93,ft=61,pt=123,mt=63,vt=125,gt=124,yt=126,wt=128,xt=65533,bt=42,Mt=43,Ct=44,Bt=58,Et=59,St=46,Tt=0,_t=8,It=11,Lt=14,Ft=31,kt=127,Pt=-1,Ut=48,Dt=97,Rt=101,Ot=102,Nt=117,zt=122,Qt=65,Gt=69,Ht=70,Vt=85,jt=90,Wt=function(e){return e>=Ut&&e<=57},Xt=function(e){return e>=55296&&e<=57343},Yt=function(e){return Wt(e)||e>=Qt&&e<=Ht||e>=Dt&&e<=Ot},Kt=function(e){return e>=Dt&&e<=zt},Zt=function(e){return e>=Qt&&e<=jt},Jt=function(e){return Kt(e)||Zt(e)},qt=function(e){return e>=wt},$t=function(e){return e===Xe||e===Ze||e===Je},en=function(e){return Jt(e)||qt(e)||e===ot},tn=function(e){return en(e)||Wt(e)||e===st},nn=function(e){return e>=Tt&&e<=_t||e===It||e>=Lt&&e<=Ft||e===kt},rn=function(e,t){return e===Ke&&t!==Xe},an=function(e,t,n){return e===st?en(t)||rn(t,n):!!en(e)||!(e!==Ke||!rn(e,t))},on=function(e,t,n){return e===Mt||e===st?!!Wt(t)||t===St&&Wt(n):Wt(e===St?t:e)},sn=function(e){var t=0,n=1;e[t]!==Mt&&e[t]!==st||(e[t]===st&&(n=-1),t++);for(var i=[];Wt(e[t]);)i.push(e[t++]);var r=i.length?parseInt(c.apply(void 0,i),10):0;e[t]===St&&t++;for(var a=[];Wt(e[t]);)a.push(e[t++]);var o=a.length,s=o?parseInt(c.apply(void 0,a),10):0;e[t]!==Gt&&e[t]!==Rt||t++;var l=1;e[t]!==Mt&&e[t]!==st||(e[t]===st&&(l=-1),t++);for(var A=[];Wt(e[t]);)A.push(e[t++]);var h=A.length?parseInt(c.apply(void 0,A),10):0;return n*(r+s*Math.pow(10,-o))*Math.pow(10,l*h)},ln={type:2},An={type:3},cn={type:4},hn={type:13},un={type:8},dn={type:21},fn={type:9},pn={type:10},mn={type:11},vn={type:12},gn={type:14},yn={type:23},wn={type:1},xn={type:25},bn={type:24},Mn={type:26},Cn={type:27},Bn={type:28},En={type:29},Sn={type:31},Tn={type:32},_n=function(){function e(){this._value=[]}return e.prototype.write=function(e){this._value=this._value.concat(A(e))},e.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==Tn;)e.push(t),t=this.consumeToken();return e},e.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case qe:return this.consumeStringToken(qe);case et:var t=this.peekCodePoint(0),n=this.peekCodePoint(1),i=this.peekCodePoint(2);if(tn(t)||rn(n,i)){var r=an(t,n,i)?Ve:He;return{type:5,value:this.consumeName(),flags:r}}break;case tt:if(this.peekCodePoint(0)===$e)return this.consumeCodePoint(),hn;break;case it:return this.consumeStringToken(it);case rt:return ln;case at:return An;case bt:if(this.peekCodePoint(0)===$e)return this.consumeCodePoint(),gn;break;case Mt:if(on(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case Ct:return cn;case st:var a=e,o=this.peekCodePoint(0),s=this.peekCodePoint(1);if(on(a,o,s))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(an(a,o,s))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(o===st&&s===ct)return this.consumeCodePoint(),this.consumeCodePoint(),bn;break;case St:if(on(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case Ye:if(this.peekCodePoint(0)===bt)for(this.consumeCodePoint();;){var l=this.consumeCodePoint();if(l===bt&&(l=this.consumeCodePoint())===Ye)return this.consumeToken();if(l===Pt)return this.consumeToken()}break;case Bt:return Mn;case Et:return Cn;case At:if(this.peekCodePoint(0)===lt&&this.peekCodePoint(1)===st&&this.peekCodePoint(2)===st)return this.consumeCodePoint(),this.consumeCodePoint(),xn;break;case ht:var A=this.peekCodePoint(0),h=this.peekCodePoint(1),u=this.peekCodePoint(2);if(an(A,h,u))return{type:7,value:this.consumeName()};break;case ut:return Bn;case Ke:if(rn(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case dt:return En;case ft:if(this.peekCodePoint(0)===$e)return this.consumeCodePoint(),un;break;case pt:return mn;case vt:return vn;case Nt:case Vt:var d=this.peekCodePoint(0),f=this.peekCodePoint(1);return d!==Mt||!Yt(f)&&f!==mt||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case gt:if(this.peekCodePoint(0)===$e)return this.consumeCodePoint(),fn;if(this.peekCodePoint(0)===gt)return this.consumeCodePoint(),dn;break;case yt:if(this.peekCodePoint(0)===$e)return this.consumeCodePoint(),pn;break;case Pt:return Tn}return $t(e)?(this.consumeWhiteSpace(),Sn):Wt(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):en(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:c(e)}},e.prototype.consumeCodePoint=function(){var e=this._value.shift();return void 0===e?-1:e},e.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},e.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},e.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();Yt(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var n=!1;t===mt&&e.length<6;)e.push(t),t=this.consumeCodePoint(),n=!0;if(n)return{type:30,start:parseInt(c.apply(void 0,e.map((function(e){return e===mt?Ut:e}))),16),end:parseInt(c.apply(void 0,e.map((function(e){return e===mt?Ht:e}))),16)};var i=parseInt(c.apply(void 0,e),16);if(this.peekCodePoint(0)===st&&Yt(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var r=[];Yt(t)&&r.length<6;)r.push(t),t=this.consumeCodePoint();return{type:30,start:i,end:parseInt(c.apply(void 0,r),16)}}return{type:30,start:i,end:i}},e.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return"url"===e.toLowerCase()&&this.peekCodePoint(0)===rt?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===rt?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},e.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===Pt)return{type:22,value:""};var t=this.peekCodePoint(0);if(t===it||t===qe){var n=this.consumeStringToken(this.consumeCodePoint());return 0===n.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===Pt||this.peekCodePoint(0)===at)?(this.consumeCodePoint(),{type:22,value:n.value}):(this.consumeBadUrlRemnants(),yn)}for(;;){var i=this.consumeCodePoint();if(i===Pt||i===at)return{type:22,value:c.apply(void 0,e)};if($t(i))return this.consumeWhiteSpace(),this.peekCodePoint(0)===Pt||this.peekCodePoint(0)===at?(this.consumeCodePoint(),{type:22,value:c.apply(void 0,e)}):(this.consumeBadUrlRemnants(),yn);if(i===qe||i===it||i===rt||nn(i))return this.consumeBadUrlRemnants(),yn;if(i===Ke){if(!rn(i,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),yn;e.push(this.consumeEscapedCodePoint())}else e.push(i)}},e.prototype.consumeWhiteSpace=function(){for(;$t(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(e===at||e===Pt)return;rn(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(e){for(var t=5e4,n="";e>0;){var i=Math.min(t,e);n+=c.apply(void 0,this._value.splice(0,i)),e-=i}return this._value.shift(),n},e.prototype.consumeStringToken=function(e){for(var t="",n=0;;){var i=this._value[n];if(i===Pt||void 0===i||i===e)return{type:0,value:t+=this.consumeStringSlice(n)};if(i===Xe)return this._value.splice(0,n),wn;if(i===Ke){var r=this._value[n+1];r!==Pt&&void 0!==r&&(r===Xe?(t+=this.consumeStringSlice(n),n=-1,this._value.shift()):rn(i,r)&&(t+=this.consumeStringSlice(n),t+=c(this.consumeEscapedCodePoint()),n=-1))}n++}},e.prototype.consumeNumber=function(){var e=[],t=je,n=this.peekCodePoint(0);for(n!==Mt&&n!==st||e.push(this.consumeCodePoint());Wt(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0);var i=this.peekCodePoint(1);if(n===St&&Wt(i))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=We;Wt(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0),i=this.peekCodePoint(1);var r=this.peekCodePoint(2);if((n===Gt||n===Rt)&&((i===Mt||i===st)&&Wt(r)||Wt(i)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=We;Wt(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[sn(e),t]},e.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],n=e[1],i=this.peekCodePoint(0),r=this.peekCodePoint(1),a=this.peekCodePoint(2);return an(i,r,a)?{type:15,number:t,flags:n,unit:this.consumeName()}:i===nt?(this.consumeCodePoint(),{type:16,number:t,flags:n}):{type:17,number:t,flags:n}},e.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(Yt(e)){for(var t=c(e);Yt(this.peekCodePoint(0))&&t.length<6;)t+=c(this.consumeCodePoint());$t(this.peekCodePoint(0))&&this.consumeCodePoint();var n=parseInt(t,16);return 0===n||Xt(n)||n>1114111?xt:n}return e===Pt?xt:e},e.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(tn(t))e+=c(t);else{if(!rn(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),e;e+=c(this.consumeEscapedCodePoint())}}},e}(),In=function(){function e(e){this._tokens=e}return e.create=function(t){var n=new _n;return n.write(t),new e(n.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var e=this.consumeToken();31===e.type;)e=this.consumeToken();if(32===e.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var t=this.consumeComponentValue();do{e=this.consumeToken()}while(31===e.type);if(32===e.type)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(32===t.type)return e;e.push(t),e.push()}},e.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},e.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},n=this.consumeToken();;){if(32===n.type||Nn(n,e))return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue()),n=this.consumeToken()}},e.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:18};;){var n=this.consumeToken();if(32===n.type||3===n.type)return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var e=this._tokens.shift();return void 0===e?Tn:e},e.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},e}(),Ln=function(e){return 15===e.type},Fn=function(e){return 17===e.type},kn=function(e){return 20===e.type},Pn=function(e){return 0===e.type},Un=function(e,t){return kn(e)&&e.value===t},Dn=function(e){return 31!==e.type},Rn=function(e){return 31!==e.type&&4!==e.type},On=function(e){var t=[],n=[];return e.forEach((function(e){if(4===e.type){if(0===n.length)throw new Error("Error parsing function args, zero tokens for arg");return t.push(n),void(n=[])}31!==e.type&&n.push(e)})),n.length&&t.push(n),t},Nn=function(e,t){return 11===t&&12===e.type||28===t&&29===e.type||2===t&&3===e.type},zn=function(e){return 17===e.type||15===e.type},Qn=function(e){return 16===e.type||zn(e)},Gn=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},Hn={type:17,number:0,flags:je},Vn={type:16,number:50,flags:je},jn={type:16,number:100,flags:je},Wn=function(e,t,n){var i=e[0],r=e[1];return[Xn(i,t),Xn(void 0!==r?r:i,n)]},Xn=function(e,t){if(16===e.type)return e.number/100*t;if(Ln(e))switch(e.unit){case"rem":case"em":return 16*e.number;default:return e.number}return e.number},Yn="deg",Kn="grad",Zn="rad",Jn="turn",qn={name:"angle",parse:function(e,t){if(15===t.type)switch(t.unit){case Yn:return Math.PI*t.number/180;case Kn:return Math.PI/200*t.number;case Zn:return t.number;case Jn:return 2*Math.PI*t.number}throw new Error("Unsupported angle type")}},$n=function(e){return 15===e.type&&(e.unit===Yn||e.unit===Kn||e.unit===Zn||e.unit===Jn)},ei=function(e){switch(e.filter(kn).map((function(e){return e.value})).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[Hn,Hn];case"to top":case"bottom":return ti(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[Hn,jn];case"to right":case"left":return ti(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[jn,jn];case"to bottom":case"top":return ti(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[jn,Hn];case"to left":case"right":return ti(270)}return 0},ti=function(e){return Math.PI*e/180},ni={name:"color",parse:function(e,t){if(18===t.type){var n=ci[t.name];if(void 0===n)throw new Error('Attempting to parse an unsupported color function "'+t.name+'"');return n(e,t.values)}if(5===t.type){if(3===t.value.length){var i=t.value.substring(0,1),r=t.value.substring(1,2),a=t.value.substring(2,3);return ai(parseInt(i+i,16),parseInt(r+r,16),parseInt(a+a,16),1)}if(4===t.value.length){i=t.value.substring(0,1),r=t.value.substring(1,2),a=t.value.substring(2,3);var o=t.value.substring(3,4);return ai(parseInt(i+i,16),parseInt(r+r,16),parseInt(a+a,16),parseInt(o+o,16)/255)}if(6===t.value.length)return i=t.value.substring(0,2),r=t.value.substring(2,4),a=t.value.substring(4,6),ai(parseInt(i,16),parseInt(r,16),parseInt(a,16),1);if(8===t.value.length)return i=t.value.substring(0,2),r=t.value.substring(2,4),a=t.value.substring(4,6),o=t.value.substring(6,8),ai(parseInt(i,16),parseInt(r,16),parseInt(a,16),parseInt(o,16)/255)}if(20===t.type){var s=ui[t.value.toUpperCase()];if(void 0!==s)return s}return ui.TRANSPARENT}},ii=function(e){return 0==(255&e)},ri=function(e){var t=255&e,n=255&e>>8,i=255&e>>16,r=255&e>>24;return t<255?"rgba("+r+","+i+","+n+","+t/255+")":"rgb("+r+","+i+","+n+")"},ai=function(e,t,n,i){return(e<<24|t<<16|n<<8|Math.round(255*i)<<0)>>>0},oi=function(e,t){if(17===e.type)return e.number;if(16===e.type){var n=3===t?1:255;return 3===t?e.number/100*n:Math.round(e.number/100*n)}return 0},si=function(e,t){var n=t.filter(Rn);if(3===n.length){var i=n.map(oi),r=i[0],a=i[1],o=i[2];return ai(r,a,o,1)}if(4===n.length){var s=n.map(oi),l=(r=s[0],a=s[1],o=s[2],s[3]);return ai(r,a,o,l)}return 0};function li(e,t,n){return n<0&&(n+=1),n>=1&&(n-=1),n<1/6?(t-e)*n*6+e:n<.5?t:n<2/3?6*(t-e)*(2/3-n)+e:e}var Ai=function(e,t){var n=t.filter(Rn),i=n[0],r=n[1],a=n[2],o=n[3],s=(17===i.type?ti(i.number):qn.parse(e,i))/(2*Math.PI),l=Qn(r)?r.number/100:0,A=Qn(a)?a.number/100:0,c=void 0!==o&&Qn(o)?Xn(o,1):1;if(0===l)return ai(255*A,255*A,255*A,1);var h=A<=.5?A*(l+1):A+l-A*l,u=2*A-h,d=li(u,h,s+1/3),f=li(u,h,s),p=li(u,h,s-1/3);return ai(255*d,255*f,255*p,c)},ci={hsl:Ai,hsla:Ai,rgb:si,rgba:si},hi=function(e,t){return ni.parse(e,In.create(t).parseComponentValue())},ui={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},di={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map((function(e){if(kn(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},fi={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},pi=function(e,t){var n=ni.parse(e,t[0]),i=t[1];return i&&Qn(i)?{color:n,stop:i}:{color:n,stop:null}},mi=function(e,t){var n=e[0],i=e[e.length-1];null===n.stop&&(n.stop=Hn),null===i.stop&&(i.stop=jn);for(var r=[],a=0,o=0;o<e.length;o++){var s=e[o].stop;if(null!==s){var l=Xn(s,t);l>a?r.push(l):r.push(a),a=l}else r.push(null)}var A=null;for(o=0;o<r.length;o++){var c=r[o];if(null===c)null===A&&(A=o);else if(null!==A){for(var h=o-A,u=(c-r[A-1])/(h+1),d=1;d<=h;d++)r[A+d-1]=u*d;A=null}}return e.map((function(e,n){return{color:e.color,stop:Math.max(Math.min(1,r[n]/t),0)}}))},vi=function(e,t,n){var i=t/2,r=n/2,a=Xn(e[0],t)-i,o=r-Xn(e[1],n);return(Math.atan2(o,a)+2*Math.PI)%(2*Math.PI)},gi=function(e,t,n){var i="number"==typeof e?e:vi(e,t,n),r=Math.abs(t*Math.sin(i))+Math.abs(n*Math.cos(i)),a=t/2,o=n/2,s=r/2,l=Math.sin(i-Math.PI/2)*s,A=Math.cos(i-Math.PI/2)*s;return[r,a-A,a+A,o-l,o+l]},yi=function(e,t){return Math.sqrt(e*e+t*t)},wi=function(e,t,n,i,r){return[[0,0],[0,t],[e,0],[e,t]].reduce((function(e,t){var a=t[0],o=t[1],s=yi(n-a,i-o);return(r?s<e.optimumDistance:s>e.optimumDistance)?{optimumCorner:t,optimumDistance:s}:e}),{optimumDistance:r?1/0:-1/0,optimumCorner:null}).optimumCorner},xi=function(e,t,n,i,r){var a=0,o=0;switch(e.size){case 0:0===e.shape?a=o=Math.min(Math.abs(t),Math.abs(t-i),Math.abs(n),Math.abs(n-r)):1===e.shape&&(a=Math.min(Math.abs(t),Math.abs(t-i)),o=Math.min(Math.abs(n),Math.abs(n-r)));break;case 2:if(0===e.shape)a=o=Math.min(yi(t,n),yi(t,n-r),yi(t-i,n),yi(t-i,n-r));else if(1===e.shape){var s=Math.min(Math.abs(n),Math.abs(n-r))/Math.min(Math.abs(t),Math.abs(t-i)),l=wi(i,r,t,n,!0),A=l[0],c=l[1];o=s*(a=yi(A-t,(c-n)/s))}break;case 1:0===e.shape?a=o=Math.max(Math.abs(t),Math.abs(t-i),Math.abs(n),Math.abs(n-r)):1===e.shape&&(a=Math.max(Math.abs(t),Math.abs(t-i)),o=Math.max(Math.abs(n),Math.abs(n-r)));break;case 3:if(0===e.shape)a=o=Math.max(yi(t,n),yi(t,n-r),yi(t-i,n),yi(t-i,n-r));else if(1===e.shape){s=Math.max(Math.abs(n),Math.abs(n-r))/Math.max(Math.abs(t),Math.abs(t-i));var h=wi(i,r,t,n,!1);A=h[0],c=h[1],o=s*(a=yi(A-t,(c-n)/s))}}return Array.isArray(e.size)&&(a=Xn(e.size[0],i),o=2===e.size.length?Xn(e.size[1],r):a),[a,o]},bi=function(e,t){var n=ti(180),i=[];return On(t).forEach((function(t,r){if(0===r){var a=t[0];if(20===a.type&&"to"===a.value)return void(n=ei(t));if($n(a))return void(n=qn.parse(e,a))}var o=pi(e,t);i.push(o)})),{angle:n,stops:i,type:1}},Mi=function(e,t){var n=ti(180),i=[];return On(t).forEach((function(t,r){if(0===r){var a=t[0];if(20===a.type&&-1!==["top","left","right","bottom"].indexOf(a.value))return void(n=ei(t));if($n(a))return void(n=(qn.parse(e,a)+ti(270))%ti(360))}var o=pi(e,t);i.push(o)})),{angle:n,stops:i,type:1}},Ci=function(e,t){var n=ti(180),i=[],r=1,a=0,o=3,s=[];return On(t).forEach((function(t,n){var a=t[0];if(0===n){if(kn(a)&&"linear"===a.value)return void(r=1);if(kn(a)&&"radial"===a.value)return void(r=2)}if(18===a.type)if("from"===a.name){var o=ni.parse(e,a.values[0]);i.push({stop:Hn,color:o})}else if("to"===a.name)o=ni.parse(e,a.values[0]),i.push({stop:jn,color:o});else if("color-stop"===a.name){var s=a.values.filter(Rn);if(2===s.length){o=ni.parse(e,s[1]);var l=s[0];Fn(l)&&i.push({stop:{type:16,number:100*l.number,flags:l.flags},color:o})}}})),1===r?{angle:(n+ti(180))%ti(360),stops:i,type:r}:{size:o,shape:a,stops:i,position:s,type:r}},Bi="closest-side",Ei="farthest-side",Si="closest-corner",Ti="farthest-corner",_i="circle",Ii="ellipse",Li="cover",Fi="contain",ki=function(e,t){var n=0,i=3,r=[],a=[];return On(t).forEach((function(t,o){var s=!0;if(0===o){var l=!1;s=t.reduce((function(e,t){if(l)if(kn(t))switch(t.value){case"center":return a.push(Vn),e;case"top":case"left":return a.push(Hn),e;case"right":case"bottom":return a.push(jn),e}else(Qn(t)||zn(t))&&a.push(t);else if(kn(t))switch(t.value){case _i:return n=0,!1;case Ii:return n=1,!1;case"at":return l=!0,!1;case Bi:return i=0,!1;case Li:case Ei:return i=1,!1;case Fi:case Si:return i=2,!1;case Ti:return i=3,!1}else if(zn(t)||Qn(t))return Array.isArray(i)||(i=[]),i.push(t),!1;return e}),s)}if(s){var A=pi(e,t);r.push(A)}})),{size:i,shape:n,stops:r,position:a,type:2}},Pi=function(e,t){var n=0,i=3,r=[],a=[];return On(t).forEach((function(t,o){var s=!0;if(0===o?s=t.reduce((function(e,t){if(kn(t))switch(t.value){case"center":return a.push(Vn),!1;case"top":case"left":return a.push(Hn),!1;case"right":case"bottom":return a.push(jn),!1}else if(Qn(t)||zn(t))return a.push(t),!1;return e}),s):1===o&&(s=t.reduce((function(e,t){if(kn(t))switch(t.value){case _i:return n=0,!1;case Ii:return n=1,!1;case Fi:case Bi:return i=0,!1;case Ei:return i=1,!1;case Si:return i=2,!1;case Li:case Ti:return i=3,!1}else if(zn(t)||Qn(t))return Array.isArray(i)||(i=[]),i.push(t),!1;return e}),s)),s){var l=pi(e,t);r.push(l)}})),{size:i,shape:n,stops:r,position:a,type:2}},Ui=function(e){return 1===e.type},Di=function(e){return 2===e.type},Ri={name:"image",parse:function(e,t){if(22===t.type){var n={url:t.value,type:0};return e.cache.addImage(t.value),n}if(18===t.type){var i=zi[t.name];if(void 0===i)throw new Error('Attempting to parse an unsupported image function "'+t.name+'"');return i(e,t.values)}throw new Error("Unsupported image type "+t.type)}};function Oi(e){return!(20===e.type&&"none"===e.value||18===e.type&&!zi[e.name])}var Ni,zi={"linear-gradient":bi,"-moz-linear-gradient":Mi,"-ms-linear-gradient":Mi,"-o-linear-gradient":Mi,"-webkit-linear-gradient":Mi,"radial-gradient":ki,"-moz-radial-gradient":Pi,"-ms-radial-gradient":Pi,"-o-radial-gradient":Pi,"-webkit-radial-gradient":Pi,"-webkit-gradient":Ci},Qi={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var n=t[0];return 20===n.type&&"none"===n.value?[]:t.filter((function(e){return Rn(e)&&Oi(e)})).map((function(t){return Ri.parse(e,t)}))}},Gi={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map((function(e){if(kn(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},Hi={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,t){return On(t).map((function(e){return e.filter(Qn)})).map(Gn)}},Vi={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,t){return On(t).map((function(e){return e.filter(kn).map((function(e){return e.value})).join(" ")})).map(ji)}},ji=function(e){switch(e){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};!function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"}(Ni||(Ni={}));var Wi,Xi={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,t){return On(t).map((function(e){return e.filter(Yi)}))}},Yi=function(e){return kn(e)||Qn(e)},Ki=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},Zi=Ki("top"),Ji=Ki("right"),qi=Ki("bottom"),$i=Ki("left"),er=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(e,t){return Gn(t.filter(Qn))}}},tr=er("top-left"),nr=er("top-right"),ir=er("bottom-right"),rr=er("bottom-left"),ar=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(e,t){switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},or=ar("top"),sr=ar("right"),lr=ar("bottom"),Ar=ar("left"),cr=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return Ln(t)?t.number:0}}},hr=cr("top"),ur=cr("right"),dr=cr("bottom"),fr=cr("left"),pr={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},mr={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,t){return"rtl"===t?1:0}},vr={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,t){return t.filter(kn).reduce((function(e,t){return e|gr(t.value)}),0)}},gr=function(e){switch(e){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},yr={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},wr={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,t){return 20===t.type&&"normal"===t.value?0:17===t.type||15===t.type?t.number:0}};!function(e){e.NORMAL="normal",e.STRICT="strict"}(Wi||(Wi={}));var xr,br={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){return"strict"===t?Wi.STRICT:Wi.NORMAL}},Mr={name:"line-height",initialValue:"normal",prefix:!1,type:4},Cr=function(e,t){return kn(e)&&"normal"===e.value?1.2*t:17===e.type?t*e.number:Qn(e)?Xn(e,t):t},Br={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,t){return 20===t.type&&"none"===t.value?null:Ri.parse(e,t)}},Er={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,t){return"inside"===t?0:1}},Sr={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},Tr=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},_r=Tr("top"),Ir=Tr("right"),Lr=Tr("bottom"),Fr=Tr("left"),kr={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,t){return t.filter(kn).map((function(e){switch(e.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}}))}},Pr={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){return"break-word"===t?"break-word":"normal"}},Ur=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Dr=Ur("top"),Rr=Ur("right"),Or=Ur("bottom"),Nr=Ur("left"),zr={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,t){switch(t){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},Qr={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,t){switch(t){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Gr={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&Un(t[0],"none")?[]:On(t).map((function(t){for(var n={color:ui.TRANSPARENT,offsetX:Hn,offsetY:Hn,blur:Hn},i=0,r=0;r<t.length;r++){var a=t[r];zn(a)?(0===i?n.offsetX=a:1===i?n.offsetY=a:n.blur=a,i++):n.color=ni.parse(e,a)}return n}))}},Hr={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},Vr={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(e,t){if(20===t.type&&"none"===t.value)return null;if(18===t.type){var n=jr[t.name];if(void 0===n)throw new Error('Attempting to parse an unsupported transform function "'+t.name+'"');return n(t.values)}return null}},jr={matrix:function(e){var t=e.filter((function(e){return 17===e.type})).map((function(e){return e.number}));return 6===t.length?t:null},matrix3d:function(e){var t=e.filter((function(e){return 17===e.type})).map((function(e){return e.number})),n=t[0],i=t[1];t[2],t[3];var r=t[4],a=t[5];t[6],t[7],t[8],t[9],t[10],t[11];var o=t[12],s=t[13];return t[14],t[15],16===t.length?[n,i,r,a,o,s]:null}},Wr={type:16,number:50,flags:je},Xr=[Wr,Wr],Yr={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,t){var n=t.filter(Qn);return 2!==n.length?Xr:[n[0],n[1]]}},Kr={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"hidden":return 1;case"collapse":return 2;default:return 0}}};!function(e){e.NORMAL="normal",e.BREAK_ALL="break-all",e.KEEP_ALL="keep-all"}(xr||(xr={}));for(var Zr={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-all":return xr.BREAK_ALL;case"keep-all":return xr.KEEP_ALL;default:return xr.NORMAL}}},Jr={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,t){if(20===t.type)return{auto:!0,order:0};if(Fn(t))return{auto:!1,order:t.number};throw new Error("Invalid z-index number parsed")}},qr={name:"time",parse:function(e,t){if(15===t.type)switch(t.unit.toLowerCase()){case"s":return 1e3*t.number;case"ms":return t.number}throw new Error("Unsupported time type")}},$r={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,t){return Fn(t)?t.number:1}},ea={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},ta={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(e,t){return t.filter(kn).map((function(e){switch(e.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0})).filter((function(e){return 0!==e}))}},na={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(e,t){var n=[],i=[];return t.forEach((function(e){switch(e.type){case 20:case 0:n.push(e.value);break;case 17:n.push(e.number.toString());break;case 4:i.push(n.join(" ")),n.length=0}})),n.length&&i.push(n.join(" ")),i.map((function(e){return-1===e.indexOf(" ")?e:"'"+e+"'"}))}},ia={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},ra={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(e,t){return Fn(t)?t.number:kn(t)&&"bold"===t.value?700:400}},aa={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.filter(kn).map((function(e){return e.value}))}},oa={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},sa=function(e,t){return 0!=(e&t)},la={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var n=t[0];return 20===n.type&&"none"===n.value?[]:t}},Aa={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return null;var n=t[0];if(20===n.type&&"none"===n.value)return null;for(var i=[],r=t.filter(Dn),a=0;a<r.length;a++){var o=r[a],s=r[a+1];if(20===o.type){var l=s&&Fn(s)?s.number:1;i.push({counter:o.value,increment:l})}}return i}},ca={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return[];for(var n=[],i=t.filter(Dn),r=0;r<i.length;r++){var a=i[r],o=i[r+1];if(kn(a)&&"none"!==a.value){var s=o&&Fn(o)?o.number:0;n.push({counter:a.value,reset:s})}}return n}},ha={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,t){return t.filter(Ln).map((function(t){return qr.parse(e,t)}))}},ua={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return null;var n=t[0];if(20===n.type&&"none"===n.value)return null;var i=[],r=t.filter(Pn);if(r.length%2!=0)return null;for(var a=0;a<r.length;a+=2){var o=r[a].value,s=r[a+1].value;i.push({open:o,close:s})}return i}},da=function(e,t,n){if(!e)return"";var i=e[Math.min(t,e.length-1)];return i?n?i.open:i.close:""},fa={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&Un(t[0],"none")?[]:On(t).map((function(t){for(var n={color:255,offsetX:Hn,offsetY:Hn,blur:Hn,spread:Hn,inset:!1},i=0,r=0;r<t.length;r++){var a=t[r];Un(a,"inset")?n.inset=!0:zn(a)?(0===i?n.offsetX=a:1===i?n.offsetY=a:2===i?n.blur=a:n.spread=a,i++):n.color=ni.parse(e,a)}return n}))}},pa={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(e,t){var n=[0,1,2],i=[];return t.filter(kn).forEach((function(e){switch(e.value){case"stroke":i.push(1);break;case"fill":i.push(0);break;case"markers":i.push(2)}})),n.forEach((function(e){-1===i.indexOf(e)&&i.push(e)})),i}},ma={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},va={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return Ln(t)?t.number:0}},ga=function(){function e(e,t){var n,i;this.animationDuration=xa(e,ha,t.animationDuration),this.backgroundClip=xa(e,di,t.backgroundClip),this.backgroundColor=xa(e,fi,t.backgroundColor),this.backgroundImage=xa(e,Qi,t.backgroundImage),this.backgroundOrigin=xa(e,Gi,t.backgroundOrigin),this.backgroundPosition=xa(e,Hi,t.backgroundPosition),this.backgroundRepeat=xa(e,Vi,t.backgroundRepeat),this.backgroundSize=xa(e,Xi,t.backgroundSize),this.borderTopColor=xa(e,Zi,t.borderTopColor),this.borderRightColor=xa(e,Ji,t.borderRightColor),this.borderBottomColor=xa(e,qi,t.borderBottomColor),this.borderLeftColor=xa(e,$i,t.borderLeftColor),this.borderTopLeftRadius=xa(e,tr,t.borderTopLeftRadius),this.borderTopRightRadius=xa(e,nr,t.borderTopRightRadius),this.borderBottomRightRadius=xa(e,ir,t.borderBottomRightRadius),this.borderBottomLeftRadius=xa(e,rr,t.borderBottomLeftRadius),this.borderTopStyle=xa(e,or,t.borderTopStyle),this.borderRightStyle=xa(e,sr,t.borderRightStyle),this.borderBottomStyle=xa(e,lr,t.borderBottomStyle),this.borderLeftStyle=xa(e,Ar,t.borderLeftStyle),this.borderTopWidth=xa(e,hr,t.borderTopWidth),this.borderRightWidth=xa(e,ur,t.borderRightWidth),this.borderBottomWidth=xa(e,dr,t.borderBottomWidth),this.borderLeftWidth=xa(e,fr,t.borderLeftWidth),this.boxShadow=xa(e,fa,t.boxShadow),this.color=xa(e,pr,t.color),this.direction=xa(e,mr,t.direction),this.display=xa(e,vr,t.display),this.float=xa(e,yr,t.cssFloat),this.fontFamily=xa(e,na,t.fontFamily),this.fontSize=xa(e,ia,t.fontSize),this.fontStyle=xa(e,oa,t.fontStyle),this.fontVariant=xa(e,aa,t.fontVariant),this.fontWeight=xa(e,ra,t.fontWeight),this.letterSpacing=xa(e,wr,t.letterSpacing),this.lineBreak=xa(e,br,t.lineBreak),this.lineHeight=xa(e,Mr,t.lineHeight),this.listStyleImage=xa(e,Br,t.listStyleImage),this.listStylePosition=xa(e,Er,t.listStylePosition),this.listStyleType=xa(e,Sr,t.listStyleType),this.marginTop=xa(e,_r,t.marginTop),this.marginRight=xa(e,Ir,t.marginRight),this.marginBottom=xa(e,Lr,t.marginBottom),this.marginLeft=xa(e,Fr,t.marginLeft),this.opacity=xa(e,$r,t.opacity);var r=xa(e,kr,t.overflow);this.overflowX=r[0],this.overflowY=r[r.length>1?1:0],this.overflowWrap=xa(e,Pr,t.overflowWrap),this.paddingTop=xa(e,Dr,t.paddingTop),this.paddingRight=xa(e,Rr,t.paddingRight),this.paddingBottom=xa(e,Or,t.paddingBottom),this.paddingLeft=xa(e,Nr,t.paddingLeft),this.paintOrder=xa(e,pa,t.paintOrder),this.position=xa(e,Qr,t.position),this.textAlign=xa(e,zr,t.textAlign),this.textDecorationColor=xa(e,ea,null!==(n=t.textDecorationColor)&&void 0!==n?n:t.color),this.textDecorationLine=xa(e,ta,null!==(i=t.textDecorationLine)&&void 0!==i?i:t.textDecoration),this.textShadow=xa(e,Gr,t.textShadow),this.textTransform=xa(e,Hr,t.textTransform),this.transform=xa(e,Vr,t.transform),this.transformOrigin=xa(e,Yr,t.transformOrigin),this.visibility=xa(e,Kr,t.visibility),this.webkitTextStrokeColor=xa(e,ma,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=xa(e,va,t.webkitTextStrokeWidth),this.wordBreak=xa(e,Zr,t.wordBreak),this.zIndex=xa(e,Jr,t.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},e.prototype.isTransparent=function(){return ii(this.backgroundColor)},e.prototype.isTransformed=function(){return null!==this.transform},e.prototype.isPositioned=function(){return 0!==this.position},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return 0!==this.float},e.prototype.isInlineLevel=function(){return sa(this.display,4)||sa(this.display,33554432)||sa(this.display,268435456)||sa(this.display,536870912)||sa(this.display,67108864)||sa(this.display,134217728)},e}(),ya=function(){function e(e,t){this.content=xa(e,la,t.content),this.quotes=xa(e,ua,t.quotes)}return e}(),wa=function(){function e(e,t){this.counterIncrement=xa(e,Aa,t.counterIncrement),this.counterReset=xa(e,ca,t.counterReset)}return e}(),xa=function(e,t,n){var i=new _n,r=null!=n?n.toString():t.initialValue;i.write(r);var a=new In(i.read());switch(t.type){case 2:var o=a.parseComponentValue();return t.parse(e,kn(o)?o.value:t.initialValue);case 0:return t.parse(e,a.parseComponentValue());case 1:return t.parse(e,a.parseComponentValues());case 4:return a.parseComponentValue();case 3:switch(t.format){case"angle":return qn.parse(e,a.parseComponentValue());case"color":return ni.parse(e,a.parseComponentValue());case"image":return Ri.parse(e,a.parseComponentValue());case"length":var s=a.parseComponentValue();return zn(s)?s:Hn;case"length-percentage":var l=a.parseComponentValue();return Qn(l)?l:Hn;case"time":return qr.parse(e,a.parseComponentValue())}}},ba="data-html2canvas-debug",Ma=function(e){switch(e.getAttribute(ba)){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},Ca=function(e,t){var n=Ma(e);return 1===n||t===n},Ba=function(){function e(e,t){this.context=e,this.textNodes=[],this.elements=[],this.flags=0,Ca(t,3),this.styles=new ga(e,window.getComputedStyle(t,null)),ds(t)&&(this.styles.animationDuration.some((function(e){return e>0}))&&(t.style.animationDuration="0s"),null!==this.styles.transform&&(t.style.transform="none")),this.bounds=s(this.context,t),Ca(t,4)&&(this.flags|=16)}return e}(),Ea="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAC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kFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqV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AZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///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4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",Sa="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ta="undefined"==typeof Uint8Array?[]:new Uint8Array(256),_a=0;_a<Sa.length;_a++)Ta[Sa.charCodeAt(_a)]=_a;for(var Ia=function(e){var t,n,i,r,a,o=.75*e.length,s=e.length,l=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var A="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(o):new Array(o),c=Array.isArray(A)?A:new Uint8Array(A);for(t=0;t<s;t+=4)n=Ta[e.charCodeAt(t)],i=Ta[e.charCodeAt(t+1)],r=Ta[e.charCodeAt(t+2)],a=Ta[e.charCodeAt(t+3)],c[l++]=n<<2|i>>4,c[l++]=(15&i)<<4|r>>2,c[l++]=(3&r)<<6|63&a;return A},La=function(e){for(var t=e.length,n=[],i=0;i<t;i+=2)n.push(e[i+1]<<8|e[i]);return n},Fa=function(e){for(var t=e.length,n=[],i=0;i<t;i+=4)n.push(e[i+3]<<24|e[i+2]<<16|e[i+1]<<8|e[i]);return n},ka=5,Pa=11,Ua=2,Da=65536>>ka,Ra=(1<<ka)-1,Oa=Da+(1024>>ka)+32,Na=65536>>Pa,za=(1<<Pa-ka)-1,Qa=function(e,t,n){return e.slice?e.slice(t,n):new Uint16Array(Array.prototype.slice.call(e,t,n))},Ga=function(e,t,n){return e.slice?e.slice(t,n):new Uint32Array(Array.prototype.slice.call(e,t,n))},Ha=function(e,t){var n=Ia(e),i=Array.isArray(n)?Fa(n):new Uint32Array(n),r=Array.isArray(n)?La(n):new Uint16Array(n),a=24,o=Qa(r,a/2,i[4]/2),s=2===i[5]?Qa(r,(a+i[4])/2):Ga(i,Math.ceil((a+i[4])/4));return new Va(i[0],i[1],i[2],i[3],o,s)},Va=function(){function e(e,t,n,i,r,a){this.initialValue=e,this.errorValue=t,this.highStart=n,this.highValueIndex=i,this.index=r,this.data=a}return e.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>ka])<<Ua)+(e&Ra),this.data[t];if(e<=65535)return t=((t=this.index[Da+(e-55296>>ka)])<<Ua)+(e&Ra),this.data[t];if(e<this.highStart)return t=Oa-Na+(e>>Pa),t=this.index[t],t+=e>>ka&za,t=((t=this.index[t])<<Ua)+(e&Ra),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),ja="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wa="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Xa=0;Xa<ja.length;Xa++)Wa[ja.charCodeAt(Xa)]=Xa;var Ya,Ka=1,Za=2,Ja=3,qa=4,$a=5,eo=7,to=8,no=9,io=10,ro=11,ao=12,oo=13,so=14,lo=15,Ao=function(e){for(var t=[],n=0,i=e.length;n<i;){var r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<i){var a=e.charCodeAt(n++);56320==(64512&a)?t.push(((1023&r)<<10)+(1023&a)+65536):(t.push(r),n--)}else t.push(r)}return t},co=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var n=e.length;if(!n)return"";for(var i=[],r=-1,a="";++r<n;){var o=e[r];o<=65535?i.push(o):(o-=65536,i.push(55296+(o>>10),o%1024+56320)),(r+1===n||i.length>16384)&&(a+=String.fromCharCode.apply(String,i),i.length=0)}return a},ho=Ha(Ea),uo="×",fo="÷",po=function(e){return ho.get(e)},mo=function(e,t,n){var i=n-2,r=t[i],a=t[n-1],o=t[n];if(a===Za&&o===Ja)return uo;if(a===Za||a===Ja||a===qa)return fo;if(o===Za||o===Ja||o===qa)return fo;if(a===to&&-1!==[to,no,ro,ao].indexOf(o))return uo;if(!(a!==ro&&a!==no||o!==no&&o!==io))return uo;if((a===ao||a===io)&&o===io)return uo;if(o===oo||o===$a)return uo;if(o===eo)return uo;if(a===Ka)return uo;if(a===oo&&o===so){for(;r===$a;)r=t[--i];if(r===so)return uo}if(a===lo&&o===lo){for(var s=0;r===lo;)s++,r=t[--i];if(s%2==0)return uo}return fo},vo=function(e){var t=Ao(e),n=t.length,i=0,r=0,a=t.map(po);return{next:function(){if(i>=n)return{done:!0,value:null};for(var e=uo;i<n&&(e=mo(t,a,++i))===uo;);if(e!==uo||i===n){var o=co.apply(null,t.slice(r,i));return r=i,{value:o,done:!1}}return{done:!0,value:null}}}},go=function(e){for(var t,n=vo(e),i=[];!(t=n.next()).done;)t.value&&i.push(t.value.slice());return i},yo=function(e){var t=123;if(e.createRange){var n=e.createRange();if(n.getBoundingClientRect){var i=e.createElement("boundtest");i.style.height=t+"px",i.style.display="block",e.body.appendChild(i),n.selectNode(i);var r=n.getBoundingClientRect(),a=Math.round(r.height);if(e.body.removeChild(i),a===t)return!0}}return!1},wo=function(e){var t=e.createElement("boundtest");t.style.width="50px",t.style.display="block",t.style.fontSize="12px",t.style.letterSpacing="0px",t.style.wordSpacing="0px",e.body.appendChild(t);var n=e.createRange();t.innerHTML="function"==typeof"".repeat?"👨".repeat(10):"";var i=t.firstChild,r=A(i.data).map((function(e){return c(e)})),a=0,o={},s=r.every((function(e,t){n.setStart(i,a),n.setEnd(i,a+e.length);var r=n.getBoundingClientRect();a+=e.length;var s=r.x>o.x||r.y>o.y;return o=r,0===t||s}));return e.body.removeChild(t),s},xo=function(){return void 0!==(new Image).crossOrigin},bo=function(){return"string"==typeof(new XMLHttpRequest).responseType},Mo=function(e){var t=new Image,n=e.createElement("canvas"),i=n.getContext("2d");if(!i)return!1;t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{i.drawImage(t,0,0),n.toDataURL()}catch(e){return!1}return!0},Co=function(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]},Bo=function(e){var t=e.createElement("canvas"),n=100;t.width=n,t.height=n;var i=t.getContext("2d");if(!i)return Promise.reject(!1);i.fillStyle="rgb(0, 255, 0)",i.fillRect(0,0,n,n);var r=new Image,a=t.toDataURL();r.src=a;var o=Eo(n,n,0,0,r);return i.fillStyle="red",i.fillRect(0,0,n,n),So(o).then((function(t){i.drawImage(t,0,0);var r=i.getImageData(0,0,n,n).data;i.fillStyle="red",i.fillRect(0,0,n,n);var o=e.createElement("div");return o.style.backgroundImage="url("+a+")",o.style.height=n+"px",Co(r)?So(Eo(n,n,0,0,o)):Promise.reject(!1)})).then((function(e){return i.drawImage(e,0,0),Co(i.getImageData(0,0,n,n).data)})).catch((function(){return!1}))},Eo=function(e,t,n,i,r){var a="http://www.w3.org/2000/svg",o=document.createElementNS(a,"svg"),s=document.createElementNS(a,"foreignObject");return o.setAttributeNS(null,"width",e.toString()),o.setAttributeNS(null,"height",t.toString()),s.setAttributeNS(null,"width","100%"),s.setAttributeNS(null,"height","100%"),s.setAttributeNS(null,"x",n.toString()),s.setAttributeNS(null,"y",i.toString()),s.setAttributeNS(null,"externalResourcesRequired","true"),o.appendChild(s),s.appendChild(r),o},So=function(e){return new Promise((function(t,n){var i=new Image;i.onload=function(){return t(i)},i.onerror=n,i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))}))},To={get SUPPORT_RANGE_BOUNDS(){var e=yo(document);return Object.defineProperty(To,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=To.SUPPORT_RANGE_BOUNDS&&wo(document);return Object.defineProperty(To,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=Mo(document);return Object.defineProperty(To,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e="function"==typeof Array.from&&"function"==typeof window.fetch?Bo(document):Promise.resolve(!1);return Object.defineProperty(To,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=xo();return Object.defineProperty(To,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e=bo();return Object.defineProperty(To,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(To,"SUPPORT_CORS_XHR",{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(To,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:e}),e}},_o=function(){function e(e,t){this.text=e,this.bounds=t}return e}(),Io=function(e,t,n,i){var r=Uo(t,n),a=[],s=0;return r.forEach((function(t){if(n.textDecorationLine.length||t.trim().length>0)if(To.SUPPORT_RANGE_BOUNDS){var r=Fo(i,s,t.length).getClientRects();if(r.length>1){var l=ko(t),A=0;l.forEach((function(t){a.push(new _o(t,o.fromDOMRectList(e,Fo(i,A+s,t.length).getClientRects()))),A+=t.length}))}else a.push(new _o(t,o.fromDOMRectList(e,r)))}else{var c=i.splitText(t.length);a.push(new _o(t,Lo(e,i))),i=c}else To.SUPPORT_RANGE_BOUNDS||(i=i.splitText(t.length));s+=t.length})),a},Lo=function(e,t){var n=t.ownerDocument;if(n){var i=n.createElement("html2canvaswrapper");i.appendChild(t.cloneNode(!0));var r=t.parentNode;if(r){r.replaceChild(i,t);var a=s(e,i);return i.firstChild&&r.replaceChild(i.firstChild,i),a}}return o.EMPTY},Fo=function(e,t,n){var i=e.ownerDocument;if(!i)throw new Error("Node has no owner document");var r=i.createRange();return r.setStart(e,t),r.setEnd(e,t+n),r},ko=function(e){if(To.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(t.segment(e)).map((function(e){return e.segment}))}return go(e)},Po=function(e,t){if(To.SUPPORT_NATIVE_TEXT_SEGMENTATION){var n=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(n.segment(e)).map((function(e){return e.segment}))}return Ro(e,t)},Uo=function(e,t){return 0!==t.letterSpacing?ko(e):Po(e,t)},Do=[32,160,4961,65792,65793,4153,4241],Ro=function(e,t){for(var n,i=Ge(e,{lineBreak:t.lineBreak,wordBreak:"break-word"===t.overflowWrap?"break-word":t.wordBreak}),r=[],a=function(){if(n.value){var e=n.value.slice(),t=A(e),i="";t.forEach((function(e){-1===Do.indexOf(e)?i+=c(e):(i.length&&r.push(i),r.push(c(e)),i="")})),i.length&&r.push(i)}};!(n=i.next()).done;)a();return r},Oo=function(){function e(e,t,n){this.text=No(t.data,n.textTransform),this.textBounds=Io(e,this.text,n,t)}return e}(),No=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(zo,Qo);case 2:return e.toUpperCase();default:return e}},zo=/(^|\s|:|-|\(|\))([a-z])/g,Qo=function(e,t,n){return e.length>0?t+n.toUpperCase():e},Go=function(e){function n(t,n){var i=e.call(this,t,n)||this;return i.src=n.currentSrc||n.src,i.intrinsicWidth=n.naturalWidth,i.intrinsicHeight=n.naturalHeight,i.context.cache.addImage(i.src),i}return t(n,e),n}(Ba),Ho=function(e){function n(t,n){var i=e.call(this,t,n)||this;return i.canvas=n,i.intrinsicWidth=n.width,i.intrinsicHeight=n.height,i}return t(n,e),n}(Ba),Vo=function(e){function n(t,n){var i=e.call(this,t,n)||this,r=new XMLSerializer,a=s(t,n);return n.setAttribute("width",a.width+"px"),n.setAttribute("height",a.height+"px"),i.svg="data:image/svg+xml,"+encodeURIComponent(r.serializeToString(n)),i.intrinsicWidth=n.width.baseVal.value,i.intrinsicHeight=n.height.baseVal.value,i.context.cache.addImage(i.svg),i}return t(n,e),n}(Ba),jo=function(e){function n(t,n){var i=e.call(this,t,n)||this;return i.value=n.value,i}return t(n,e),n}(Ba),Wo=function(e){function n(t,n){var i=e.call(this,t,n)||this;return i.start=n.start,i.reversed="boolean"==typeof n.reversed&&!0===n.reversed,i}return t(n,e),n}(Ba),Xo=[{type:15,flags:0,unit:"px",number:3}],Yo=[{type:16,flags:0,number:50}],Ko=function(e){return e.width>e.height?new o(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width<e.height?new o(e.left,e.top+(e.height-e.width)/2,e.width,e.width):e},Zo=function(e){var t=e.type===$o?new Array(e.value.length+1).join("•"):e.value;return 0===t.length?e.placeholder||"":t},Jo="checkbox",qo="radio",$o="password",es=707406591,ts=function(e){function n(t,n){var i=e.call(this,t,n)||this;switch(i.type=n.type.toLowerCase(),i.checked=n.checked,i.value=Zo(n),i.type!==Jo&&i.type!==qo||(i.styles.backgroundColor=3739148031,i.styles.borderTopColor=i.styles.borderRightColor=i.styles.borderBottomColor=i.styles.borderLeftColor=2779096575,i.styles.borderTopWidth=i.styles.borderRightWidth=i.styles.borderBottomWidth=i.styles.borderLeftWidth=1,i.styles.borderTopStyle=i.styles.borderRightStyle=i.styles.borderBottomStyle=i.styles.borderLeftStyle=1,i.styles.backgroundClip=[0],i.styles.backgroundOrigin=[0],i.bounds=Ko(i.bounds)),i.type){case Jo:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=Xo;break;case qo:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=Yo}return i}return t(n,e),n}(Ba),ns=function(e){function n(t,n){var i=e.call(this,t,n)||this,r=n.options[n.selectedIndex||0];return i.value=r&&r.text||"",i}return t(n,e),n}(Ba),is=function(e){function n(t,n){var i=e.call(this,t,n)||this;return i.value=n.value,i}return t(n,e),n}(Ba),rs=function(e){function n(t,n){var i=e.call(this,t,n)||this;i.src=n.src,i.width=parseInt(n.width,10)||0,i.height=parseInt(n.height,10)||0,i.backgroundColor=i.styles.backgroundColor;try{if(n.contentWindow&&n.contentWindow.document&&n.contentWindow.document.documentElement){i.tree=ls(t,n.contentWindow.document.documentElement);var r=n.contentWindow.document.documentElement?hi(t,getComputedStyle(n.contentWindow.document.documentElement).backgroundColor):ui.TRANSPARENT,a=n.contentWindow.document.body?hi(t,getComputedStyle(n.contentWindow.document.body).backgroundColor):ui.TRANSPARENT;i.backgroundColor=ii(r)?ii(a)?i.styles.backgroundColor:a:r}}catch(e){}return i}return t(n,e),n}(Ba),as=["OL","UL","MENU"],os=function(e,t,n,i){for(var r=t.firstChild,a=void 0;r;r=a)if(a=r.nextSibling,hs(r)&&r.data.trim().length>0)n.textNodes.push(new Oo(e,r,n.styles));else if(us(r))if(_s(r)&&r.assignedNodes)r.assignedNodes().forEach((function(t){return os(e,t,n,i)}));else{var o=ss(e,r);o.styles.isVisible()&&(As(r,o,i)?o.flags|=4:cs(o.styles)&&(o.flags|=2),-1!==as.indexOf(r.tagName)&&(o.flags|=8),n.elements.push(o),r.slot,r.shadowRoot?os(e,r.shadowRoot,o,i):Ss(r)||ys(r)||Ts(r)||os(e,r,o,i))}},ss=function(e,t){return Ms(t)?new Go(e,t):xs(t)?new Ho(e,t):ys(t)?new Vo(e,t):ps(t)?new jo(e,t):ms(t)?new Wo(e,t):vs(t)?new ts(e,t):Ts(t)?new ns(e,t):Ss(t)?new is(e,t):Cs(t)?new rs(e,t):new Ba(e,t)},ls=function(e,t){var n=ss(e,t);return n.flags|=4,os(e,t,n,n),n},As=function(e,t,n){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||ws(e)&&n.styles.isTransparent()},cs=function(e){return e.isPositioned()||e.isFloating()},hs=function(e){return e.nodeType===Node.TEXT_NODE},us=function(e){return e.nodeType===Node.ELEMENT_NODE},ds=function(e){return us(e)&&void 0!==e.style&&!fs(e)},fs=function(e){return"object"==typeof e.className},ps=function(e){return"LI"===e.tagName},ms=function(e){return"OL"===e.tagName},vs=function(e){return"INPUT"===e.tagName},gs=function(e){return"HTML"===e.tagName},ys=function(e){return"svg"===e.tagName},ws=function(e){return"BODY"===e.tagName},xs=function(e){return"CANVAS"===e.tagName},bs=function(e){return"VIDEO"===e.tagName},Ms=function(e){return"IMG"===e.tagName},Cs=function(e){return"IFRAME"===e.tagName},Bs=function(e){return"STYLE"===e.tagName},Es=function(e){return"SCRIPT"===e.tagName},Ss=function(e){return"TEXTAREA"===e.tagName},Ts=function(e){return"SELECT"===e.tagName},_s=function(e){return"SLOT"===e.tagName},Is=function(e){return e.tagName.indexOf("-")>0},Ls=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},e.prototype.getCounterValues=function(e){var t=this.counters[e];return t||[]},e.prototype.pop=function(e){var t=this;e.forEach((function(e){return t.counters[e].pop()}))},e.prototype.parse=function(e){var t=this,n=e.counterIncrement,i=e.counterReset,r=!0;null!==n&&n.forEach((function(e){var n=t.counters[e.counter];n&&0!==e.increment&&(r=!1,n.length||n.push(1),n[Math.max(0,n.length-1)]+=e.increment)}));var a=[];return r&&i.forEach((function(e){var n=t.counters[e.counter];a.push(e.counter),n||(n=t.counters[e.counter]=[]),n.push(e.reset)})),a},e}(),Fs={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},ks={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},Ps={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},Us={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Ds=function(e,t,n,i,r,a){return e<t||e>n?Ks(e,r,a.length>0):i.integers.reduce((function(t,n,r){for(;e>=n;)e-=n,t+=i.values[r];return t}),"")+a},Rs=function(e,t,n,i){var r="";do{n||e--,r=i(e)+r,e/=t}while(e*t>=t);return r},Os=function(e,t,n,i,r){var a=n-t+1;return(e<0?"-":"")+(Rs(Math.abs(e),a,i,(function(e){return c(Math.floor(e%a)+t)}))+r)},Ns=function(e,t,n){void 0===n&&(n=". ");var i=t.length;return Rs(Math.abs(e),i,!1,(function(e){return t[Math.floor(e%i)]}))+n},zs=1,Qs=2,Gs=4,Hs=8,Vs=function(e,t,n,i,r,a){if(e<-9999||e>9999)return Ks(e,4,r.length>0);var o=Math.abs(e),s=r;if(0===o)return t[0]+s;for(var l=0;o>0&&l<=4;l++){var A=o%10;0===A&&sa(a,zs)&&""!==s?s=t[A]+s:A>1||1===A&&0===l||1===A&&1===l&&sa(a,Qs)||1===A&&1===l&&sa(a,Gs)&&e>100||1===A&&l>1&&sa(a,Hs)?s=t[A]+(l>0?n[l-1]:"")+s:1===A&&l>0&&(s=n[l-1]+s),o=Math.floor(o/10)}return(e<0?i:"")+s},js="十百千萬",Ws="拾佰仟萬",Xs="マイナス",Ys="마이너스",Ks=function(e,t,n){var i=n?". ":"",r=n?"、":"",a=n?", ":"",o=n?" ":"";switch(t){case 0:return"•"+o;case 1:return"◦"+o;case 2:return"◾"+o;case 5:var s=Os(e,48,57,!0,i);return s.length<4?"0"+s:s;case 4:return Ns(e,"〇一二三四五六七八九",r);case 6:return Ds(e,1,3999,Fs,3,i).toLowerCase();case 7:return Ds(e,1,3999,Fs,3,i);case 8:return Os(e,945,969,!1,i);case 9:return Os(e,97,122,!1,i);case 10:return Os(e,65,90,!1,i);case 11:return Os(e,1632,1641,!0,i);case 12:case 49:return Ds(e,1,9999,ks,3,i);case 35:return Ds(e,1,9999,ks,3,i).toLowerCase();case 13:return Os(e,2534,2543,!0,i);case 14:case 30:return Os(e,6112,6121,!0,i);case 15:return Ns(e,"子丑寅卯辰巳午未申酉戌亥",r);case 16:return Ns(e,"甲乙丙丁戊己庚辛壬癸",r);case 17:case 48:return Vs(e,"零一二三四五六七八九",js,"負",r,Qs|Gs|Hs);case 47:return Vs(e,"零壹貳參肆伍陸柒捌玖",Ws,"負",r,zs|Qs|Gs|Hs);case 42:return Vs(e,"零一二三四五六七八九",js,"负",r,Qs|Gs|Hs);case 41:return Vs(e,"零壹贰叁肆伍陆柒捌玖",Ws,"负",r,zs|Qs|Gs|Hs);case 26:return Vs(e,"〇一二三四五六七八九","十百千万",Xs,r,0);case 25:return Vs(e,"零壱弐参四伍六七八九","拾百千万",Xs,r,zs|Qs|Gs);case 31:return Vs(e,"영일이삼사오육칠팔구","십백천만",Ys,a,zs|Qs|Gs);case 33:return Vs(e,"零一二三四五六七八九","十百千萬",Ys,a,0);case 32:return Vs(e,"零壹貳參四五六七八九","拾百千",Ys,a,zs|Qs|Gs);case 18:return Os(e,2406,2415,!0,i);case 20:return Ds(e,1,19999,Us,3,i);case 21:return Os(e,2790,2799,!0,i);case 22:return Os(e,2662,2671,!0,i);case 22:return Ds(e,1,10999,Ps,3,i);case 23:return Ns(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return Ns(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return Os(e,3302,3311,!0,i);case 28:return Ns(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",r);case 29:return Ns(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",r);case 34:return Os(e,3792,3801,!0,i);case 37:return Os(e,6160,6169,!0,i);case 38:return Os(e,4160,4169,!0,i);case 39:return Os(e,2918,2927,!0,i);case 40:return Os(e,1776,1785,!0,i);case 43:return Os(e,3046,3055,!0,i);case 44:return Os(e,3174,3183,!0,i);case 45:return Os(e,3664,3673,!0,i);case 46:return Os(e,3872,3881,!0,i);default:return Os(e,48,57,!0,i)}},Zs="data-html2canvas-ignore",Js=function(){function e(e,t,n){if(this.context=e,this.options=n,this.scrolledElements=[],this.referenceElement=t,this.counters=new Ls,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(e,t){var n=this,a=$s(e,t);if(!a.contentWindow)return Promise.reject("Unable to find iframe window");var o=e.defaultView.pageXOffset,s=e.defaultView.pageYOffset,l=a.contentWindow,A=l.document,c=nl(a).then((function(){return i(n,void 0,void 0,(function(){var e,n;return r(this,(function(i){switch(i.label){case 0:return this.scrolledElements.forEach(sl),l&&(l.scrollTo(t.left,t.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||l.scrollY===t.top&&l.scrollX===t.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(l.scrollX-t.left,l.scrollY-t.top,0,0))),e=this.options.onclone,void 0===(n=this.clonedReferenceElement)?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:A.fonts&&A.fonts.ready?[4,A.fonts.ready]:[3,2];case 1:i.sent(),i.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,tl(A)]:[3,4];case 3:i.sent(),i.label=4;case 4:return"function"==typeof e?[2,Promise.resolve().then((function(){return e(A,n)})).then((function(){return a}))]:[2,a]}}))}))}));return A.open(),A.write(al(document.doctype)+"<html></html>"),ol(this.referenceElement.ownerDocument,o,s),A.replaceChild(A.adoptNode(this.documentElement),A.documentElement),A.close(),c},e.prototype.createElementClone=function(e){if(Ca(e,2),xs(e))return this.createCanvasClone(e);if(bs(e))return this.createVideoClone(e);if(Bs(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return Ms(t)&&(Ms(e)&&e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),"lazy"===t.loading&&(t.loading="eager")),Is(t)?this.createCustomElementClone(t):t},e.prototype.createCustomElementClone=function(e){var t=document.createElement("html2canvascustomelement");return rl(e.style,t),t},e.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var n=[].slice.call(t.cssRules,0).reduce((function(e,t){return t&&"string"==typeof t.cssText?e+t.cssText:e}),""),i=e.cloneNode(!1);return i.textContent=n,i}}catch(e){if(this.context.logger.error("Unable to access cssRules property",e),"SecurityError"!==e.name)throw e}return e.cloneNode(!1)},e.prototype.createCanvasClone=function(e){var t;if(this.options.inlineImages&&e.ownerDocument){var n=e.ownerDocument.createElement("img");try{return n.src=e.toDataURL(),n}catch(t){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var i=e.cloneNode(!1);try{i.width=e.width,i.height=e.height;var r=e.getContext("2d"),a=i.getContext("2d");if(a)if(!this.options.allowTaint&&r)a.putImageData(r.getImageData(0,0,e.width,e.height),0,0);else{var o=null!==(t=e.getContext("webgl2"))&&void 0!==t?t:e.getContext("webgl");if(o){var s=o.getContextAttributes();!1===(null==s?void 0:s.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}a.drawImage(e,0,0)}return i}catch(t){this.context.logger.info("Unable to clone canvas as it is tainted",e)}return i},e.prototype.createVideoClone=function(e){var t=e.ownerDocument.createElement("canvas");t.width=e.offsetWidth,t.height=e.offsetHeight;var n=t.getContext("2d");try{return n&&(n.drawImage(e,0,0,t.width,t.height),this.options.allowTaint||n.getImageData(0,0,t.width,t.height)),t}catch(t){this.context.logger.info("Unable to clone video as it is tainted",e)}var i=e.ownerDocument.createElement("canvas");return i.width=e.offsetWidth,i.height=e.offsetHeight,i},e.prototype.appendChildNode=function(e,t,n){us(t)&&(Es(t)||t.hasAttribute(Zs)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(t))||this.options.copyStyles&&us(t)&&Bs(t)||e.appendChild(this.cloneNode(t,n))},e.prototype.cloneChildNodes=function(e,t,n){for(var i=this,r=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;r;r=r.nextSibling)if(us(r)&&_s(r)&&"function"==typeof r.assignedNodes){var a=r.assignedNodes();a.length&&a.forEach((function(e){return i.appendChildNode(t,e,n)}))}else this.appendChildNode(t,r,n)},e.prototype.cloneNode=function(e,t){if(hs(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var n=e.ownerDocument.defaultView;if(n&&us(e)&&(ds(e)||fs(e))){var i=this.createElementClone(e);i.style.transitionProperty="none";var r=n.getComputedStyle(e),a=n.getComputedStyle(e,":before"),o=n.getComputedStyle(e,":after");this.referenceElement===e&&ds(i)&&(this.clonedReferenceElement=i),ws(i)&&dl(i);var s=this.counters.parse(new wa(this.context,r)),l=this.resolvePseudoContent(e,i,a,Ya.BEFORE);Is(e)&&(t=!0),bs(e)||this.cloneChildNodes(e,i,t),l&&i.insertBefore(l,i.firstChild);var A=this.resolvePseudoContent(e,i,o,Ya.AFTER);return A&&i.appendChild(A),this.counters.pop(s),(r&&(this.options.copyStyles||fs(e))&&!Cs(e)||t)&&rl(r,i),0===e.scrollTop&&0===e.scrollLeft||this.scrolledElements.push([i,e.scrollLeft,e.scrollTop]),(Ss(e)||Ts(e))&&(Ss(i)||Ts(i))&&(i.value=e.value),i}return e.cloneNode(!1)},e.prototype.resolvePseudoContent=function(e,t,n,i){var r=this;if(n){var a=n.content,o=t.ownerDocument;if(o&&a&&"none"!==a&&"-moz-alt-content"!==a&&"none"!==n.display){this.counters.parse(new wa(this.context,n));var s=new ya(this.context,n),l=o.createElement("html2canvaspseudoelement");rl(n,l),s.content.forEach((function(t){if(0===t.type)l.appendChild(o.createTextNode(t.value));else if(22===t.type){var n=o.createElement("img");n.src=t.value,n.style.opacity="1",l.appendChild(n)}else if(18===t.type){if("attr"===t.name){var i=t.values.filter(kn);i.length&&l.appendChild(o.createTextNode(e.getAttribute(i[0].value)||""))}else if("counter"===t.name){var a=t.values.filter(Rn),A=a[0],c=a[1];if(A&&kn(A)){var h=r.counters.getCounterValue(A.value),u=c&&kn(c)?Sr.parse(r.context,c.value):3;l.appendChild(o.createTextNode(Ks(h,u,!1)))}}else if("counters"===t.name){var d=t.values.filter(Rn),f=(A=d[0],d[1]);if(c=d[2],A&&kn(A)){var p=r.counters.getCounterValues(A.value),m=c&&kn(c)?Sr.parse(r.context,c.value):3,v=f&&0===f.type?f.value:"",g=p.map((function(e){return Ks(e,m,!1)})).join(v);l.appendChild(o.createTextNode(g))}}}else if(20===t.type)switch(t.value){case"open-quote":l.appendChild(o.createTextNode(da(s.quotes,r.quoteDepth++,!0)));break;case"close-quote":l.appendChild(o.createTextNode(da(s.quotes,--r.quoteDepth,!1)));break;default:l.appendChild(o.createTextNode(t.value))}})),l.className=cl+" "+hl;var A=i===Ya.BEFORE?" "+cl:" "+hl;return fs(t)?t.className.baseValue+=A:t.className+=A,l}}},e.destroy=function(e){return!!e.parentNode&&(e.parentNode.removeChild(e),!0)},e}();!function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"}(Ya||(Ya={}));var qs,$s=function(e,t){var n=e.createElement("iframe");return n.className="html2canvas-container",n.style.visibility="hidden",n.style.position="fixed",n.style.left="-10000px",n.style.top="0px",n.style.border="0",n.width=t.width.toString(),n.height=t.height.toString(),n.scrolling="no",n.setAttribute(Zs,"true"),e.body.appendChild(n),n},el=function(e){return new Promise((function(t){e.complete?t():e.src?(e.onload=t,e.onerror=t):t()}))},tl=function(e){return Promise.all([].slice.call(e.images,0).map(el))},nl=function(e){return new Promise((function(t,n){var i=e.contentWindow;if(!i)return n("No window assigned for iframe");var r=i.document;i.onload=e.onload=function(){i.onload=e.onload=null;var n=setInterval((function(){r.body.childNodes.length>0&&"complete"===r.readyState&&(clearInterval(n),t(e))}),50)}}))},il=["all","d","content"],rl=function(e,t){for(var n=e.length-1;n>=0;n--){var i=e.item(n);-1===il.indexOf(i)&&t.style.setProperty(i,e.getPropertyValue(i))}return t},al=function(e){var t="";return e&&(t+="<!DOCTYPE ",e.name&&(t+=e.name),e.internalSubset&&(t+=e.internalSubset),e.publicId&&(t+='"'+e.publicId+'"'),e.systemId&&(t+='"'+e.systemId+'"'),t+=">"),t},ol=function(e,t,n){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||n!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,n)},sl=function(e){var t=e[0],n=e[1],i=e[2];t.scrollLeft=n,t.scrollTop=i},ll=":before",Al=":after",cl="___html2canvas___pseudoelement_before",hl="___html2canvas___pseudoelement_after",ul='{\n content: "" !important;\n display: none !important;\n}',dl=function(e){fl(e,"."+cl+ll+ul+"\n ."+hl+Al+ul)},fl=function(e,t){var n=e.ownerDocument;if(n){var i=n.createElement("style");i.textContent=t,e.appendChild(i)}},pl=function(){function e(){}return e.getOrigin=function(t){var n=e._link;return n?(n.href=t,n.href=n.href,n.protocol+n.hostname+n.port):"about:blank"},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement("a"),e._origin=e.getOrigin(t.location.href)},e._origin="about:blank",e}(),ml=function(){function e(e,t){this.context=e,this._options=t,this._cache={}}return e.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)?t:Ml(e)||wl(e)?((this._cache[e]=this.loadImage(e)).catch((function(){})),t):t},e.prototype.match=function(e){return this._cache[e]},e.prototype.loadImage=function(e){return i(this,void 0,void 0,(function(){var t,n,i,a,o=this;return r(this,(function(r){switch(r.label){case 0:return t=pl.isSameOrigin(e),n=!xl(e)&&!0===this._options.useCORS&&To.SUPPORT_CORS_IMAGES&&!t,i=!xl(e)&&!t&&!Ml(e)&&"string"==typeof this._options.proxy&&To.SUPPORT_CORS_XHR&&!n,t||!1!==this._options.allowTaint||xl(e)||Ml(e)||i||n?(a=e,i?[4,this.proxy(a)]:[3,2]):[2];case 1:a=r.sent(),r.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise((function(e,t){var i=new Image;i.onload=function(){return e(i)},i.onerror=t,(bl(a)||n)&&(i.crossOrigin="anonymous"),i.src=a,!0===i.complete&&setTimeout((function(){return e(i)}),500),o._options.imageTimeout>0&&setTimeout((function(){return t("Timed out ("+o._options.imageTimeout+"ms) loading image")}),o._options.imageTimeout)}))];case 3:return[2,r.sent()]}}))}))},e.prototype.has=function(e){return void 0!==this._cache[e]},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var t=this,n=this._options.proxy;if(!n)throw new Error("No proxy defined");var i=e.substring(0,256);return new Promise((function(r,a){var o=To.SUPPORT_RESPONSE_TYPE?"blob":"text",s=new XMLHttpRequest;s.onload=function(){if(200===s.status)if("text"===o)r(s.response);else{var e=new FileReader;e.addEventListener("load",(function(){return r(e.result)}),!1),e.addEventListener("error",(function(e){return a(e)}),!1),e.readAsDataURL(s.response)}else a("Failed to proxy resource "+i+" with status code "+s.status)},s.onerror=a;var l=n.indexOf("?")>-1?"&":"?";if(s.open("GET",""+n+l+"url="+encodeURIComponent(e)+"&responseType="+o),"text"!==o&&s instanceof XMLHttpRequest&&(s.responseType=o),t._options.imageTimeout){var A=t._options.imageTimeout;s.timeout=A,s.ontimeout=function(){return a("Timed out ("+A+"ms) proxying "+i)}}s.send()}))},e}(),vl=/^data:image\/svg\+xml/i,gl=/^data:image\/.*;base64,/i,yl=/^data:image\/.*/i,wl=function(e){return To.SUPPORT_SVG_DRAWING||!Cl(e)},xl=function(e){return yl.test(e)},bl=function(e){return gl.test(e)},Ml=function(e){return"blob"===e.substr(0,4)},Cl=function(e){return"svg"===e.substr(-3).toLowerCase()||vl.test(e)},Bl=function(){function e(e,t){this.type=0,this.x=e,this.y=t}return e.prototype.add=function(t,n){return new e(this.x+t,this.y+n)},e}(),El=function(e,t,n){return new Bl(e.x+(t.x-e.x)*n,e.y+(t.y-e.y)*n)},Sl=function(){function e(e,t,n,i){this.type=1,this.start=e,this.startControl=t,this.endControl=n,this.end=i}return e.prototype.subdivide=function(t,n){var i=El(this.start,this.startControl,t),r=El(this.startControl,this.endControl,t),a=El(this.endControl,this.end,t),o=El(i,r,t),s=El(r,a,t),l=El(o,s,t);return n?new e(this.start,i,o,l):new e(l,s,a,this.end)},e.prototype.add=function(t,n){return new e(this.start.add(t,n),this.startControl.add(t,n),this.endControl.add(t,n),this.end.add(t,n))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),Tl=function(e){return 1===e.type},_l=function(){function e(e){var t=e.styles,n=e.bounds,i=Wn(t.borderTopLeftRadius,n.width,n.height),r=i[0],a=i[1],o=Wn(t.borderTopRightRadius,n.width,n.height),s=o[0],l=o[1],A=Wn(t.borderBottomRightRadius,n.width,n.height),c=A[0],h=A[1],u=Wn(t.borderBottomLeftRadius,n.width,n.height),d=u[0],f=u[1],p=[];p.push((r+s)/n.width),p.push((d+c)/n.width),p.push((a+f)/n.height),p.push((l+h)/n.height);var m=Math.max.apply(Math,p);m>1&&(r/=m,a/=m,s/=m,l/=m,c/=m,h/=m,d/=m,f/=m);var v=n.width-s,g=n.height-h,y=n.width-c,w=n.height-f,x=t.borderTopWidth,b=t.borderRightWidth,M=t.borderBottomWidth,C=t.borderLeftWidth,B=Xn(t.paddingTop,e.bounds.width),E=Xn(t.paddingRight,e.bounds.width),S=Xn(t.paddingBottom,e.bounds.width),T=Xn(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=r>0||a>0?Il(n.left+C/3,n.top+x/3,r-C/3,a-x/3,qs.TOP_LEFT):new Bl(n.left+C/3,n.top+x/3),this.topRightBorderDoubleOuterBox=r>0||a>0?Il(n.left+v,n.top+x/3,s-b/3,l-x/3,qs.TOP_RIGHT):new Bl(n.left+n.width-b/3,n.top+x/3),this.bottomRightBorderDoubleOuterBox=c>0||h>0?Il(n.left+y,n.top+g,c-b/3,h-M/3,qs.BOTTOM_RIGHT):new Bl(n.left+n.width-b/3,n.top+n.height-M/3),this.bottomLeftBorderDoubleOuterBox=d>0||f>0?Il(n.left+C/3,n.top+w,d-C/3,f-M/3,qs.BOTTOM_LEFT):new Bl(n.left+C/3,n.top+n.height-M/3),this.topLeftBorderDoubleInnerBox=r>0||a>0?Il(n.left+2*C/3,n.top+2*x/3,r-2*C/3,a-2*x/3,qs.TOP_LEFT):new Bl(n.left+2*C/3,n.top+2*x/3),this.topRightBorderDoubleInnerBox=r>0||a>0?Il(n.left+v,n.top+2*x/3,s-2*b/3,l-2*x/3,qs.TOP_RIGHT):new Bl(n.left+n.width-2*b/3,n.top+2*x/3),this.bottomRightBorderDoubleInnerBox=c>0||h>0?Il(n.left+y,n.top+g,c-2*b/3,h-2*M/3,qs.BOTTOM_RIGHT):new Bl(n.left+n.width-2*b/3,n.top+n.height-2*M/3),this.bottomLeftBorderDoubleInnerBox=d>0||f>0?Il(n.left+2*C/3,n.top+w,d-2*C/3,f-2*M/3,qs.BOTTOM_LEFT):new Bl(n.left+2*C/3,n.top+n.height-2*M/3),this.topLeftBorderStroke=r>0||a>0?Il(n.left+C/2,n.top+x/2,r-C/2,a-x/2,qs.TOP_LEFT):new Bl(n.left+C/2,n.top+x/2),this.topRightBorderStroke=r>0||a>0?Il(n.left+v,n.top+x/2,s-b/2,l-x/2,qs.TOP_RIGHT):new Bl(n.left+n.width-b/2,n.top+x/2),this.bottomRightBorderStroke=c>0||h>0?Il(n.left+y,n.top+g,c-b/2,h-M/2,qs.BOTTOM_RIGHT):new Bl(n.left+n.width-b/2,n.top+n.height-M/2),this.bottomLeftBorderStroke=d>0||f>0?Il(n.left+C/2,n.top+w,d-C/2,f-M/2,qs.BOTTOM_LEFT):new Bl(n.left+C/2,n.top+n.height-M/2),this.topLeftBorderBox=r>0||a>0?Il(n.left,n.top,r,a,qs.TOP_LEFT):new Bl(n.left,n.top),this.topRightBorderBox=s>0||l>0?Il(n.left+v,n.top,s,l,qs.TOP_RIGHT):new Bl(n.left+n.width,n.top),this.bottomRightBorderBox=c>0||h>0?Il(n.left+y,n.top+g,c,h,qs.BOTTOM_RIGHT):new Bl(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=d>0||f>0?Il(n.left,n.top+w,d,f,qs.BOTTOM_LEFT):new Bl(n.left,n.top+n.height),this.topLeftPaddingBox=r>0||a>0?Il(n.left+C,n.top+x,Math.max(0,r-C),Math.max(0,a-x),qs.TOP_LEFT):new Bl(n.left+C,n.top+x),this.topRightPaddingBox=s>0||l>0?Il(n.left+Math.min(v,n.width-b),n.top+x,v>n.width+b?0:Math.max(0,s-b),Math.max(0,l-x),qs.TOP_RIGHT):new Bl(n.left+n.width-b,n.top+x),this.bottomRightPaddingBox=c>0||h>0?Il(n.left+Math.min(y,n.width-C),n.top+Math.min(g,n.height-M),Math.max(0,c-b),Math.max(0,h-M),qs.BOTTOM_RIGHT):new Bl(n.left+n.width-b,n.top+n.height-M),this.bottomLeftPaddingBox=d>0||f>0?Il(n.left+C,n.top+Math.min(w,n.height-M),Math.max(0,d-C),Math.max(0,f-M),qs.BOTTOM_LEFT):new Bl(n.left+C,n.top+n.height-M),this.topLeftContentBox=r>0||a>0?Il(n.left+C+T,n.top+x+B,Math.max(0,r-(C+T)),Math.max(0,a-(x+B)),qs.TOP_LEFT):new Bl(n.left+C+T,n.top+x+B),this.topRightContentBox=s>0||l>0?Il(n.left+Math.min(v,n.width+C+T),n.top+x+B,v>n.width+C+T?0:s-C+T,l-(x+B),qs.TOP_RIGHT):new Bl(n.left+n.width-(b+E),n.top+x+B),this.bottomRightContentBox=c>0||h>0?Il(n.left+Math.min(y,n.width-(C+T)),n.top+Math.min(g,n.height+x+B),Math.max(0,c-(b+E)),h-(M+S),qs.BOTTOM_RIGHT):new Bl(n.left+n.width-(b+E),n.top+n.height-(M+S)),this.bottomLeftContentBox=d>0||f>0?Il(n.left+C+T,n.top+w,Math.max(0,d-(C+T)),f-(M+S),qs.BOTTOM_LEFT):new Bl(n.left+C+T,n.top+n.height-(M+S))}return e}();!function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(qs||(qs={}));var Il=function(e,t,n,i,r){var a=(Math.sqrt(2)-1)/3*4,o=n*a,s=i*a,l=e+n,A=t+i;switch(r){case qs.TOP_LEFT:return new Sl(new Bl(e,A),new Bl(e,A-s),new Bl(l-o,t),new Bl(l,t));case qs.TOP_RIGHT:return new Sl(new Bl(e,t),new Bl(e+o,t),new Bl(l,A-s),new Bl(l,A));case qs.BOTTOM_RIGHT:return new Sl(new Bl(l,t),new Bl(l,t+s),new Bl(e+o,A),new Bl(e,A));case qs.BOTTOM_LEFT:default:return new Sl(new Bl(l,A),new Bl(l-o,A),new Bl(e,t+s),new Bl(e,t))}},Ll=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},Fl=function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]},kl=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},Pl=function(){function e(e,t,n){this.offsetX=e,this.offsetY=t,this.matrix=n,this.type=0,this.target=6}return e}(),Ul=function(){function e(e,t){this.path=e,this.target=t,this.type=1}return e}(),Dl=function(){function e(e){this.opacity=e,this.type=2,this.target=6}return e}(),Rl=function(e){return 0===e.type},Ol=function(e){return 1===e.type},Nl=function(e){return 2===e.type},zl=function(e,t){return e.length===t.length&&e.some((function(e,n){return e===t[n]}))},Ql=function(e,t,n,i,r){return e.map((function(e,a){switch(a){case 0:return e.add(t,n);case 1:return e.add(t+i,n);case 2:return e.add(t+i,n+r);case 3:return e.add(t,n+r)}return e}))},Gl=function(){function e(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return e}(),Hl=function(){function e(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new _l(this.container),this.container.styles.opacity<1&&this.effects.push(new Dl(this.container.styles.opacity)),null!==this.container.styles.transform){var n=this.container.bounds.left+this.container.styles.transformOrigin[0].number,i=this.container.bounds.top+this.container.styles.transformOrigin[1].number,r=this.container.styles.transform;this.effects.push(new Pl(n,i,r))}if(0!==this.container.styles.overflowX){var a=Ll(this.curves),o=kl(this.curves);zl(a,o)?this.effects.push(new Ul(a,6)):(this.effects.push(new Ul(a,2)),this.effects.push(new Ul(o,4)))}}return e.prototype.getEffects=function(e){for(var t=-1===[2,3].indexOf(this.container.styles.position),n=this.parent,i=this.effects.slice(0);n;){var r=n.effects.filter((function(e){return!Ol(e)}));if(t||0!==n.container.styles.position||!n.parent){if(i.unshift.apply(i,r),t=-1===[2,3].indexOf(n.container.styles.position),0!==n.container.styles.overflowX){var a=Ll(n.curves),o=kl(n.curves);zl(a,o)||i.unshift(new Ul(o,6))}}else i.unshift.apply(i,r);n=n.parent}return i.filter((function(t){return sa(t.target,e)}))},e}(),Vl=function(e,t,n,i){e.container.elements.forEach((function(r){var a=sa(r.flags,4),o=sa(r.flags,2),s=new Hl(r,e);sa(r.styles.display,2048)&&i.push(s);var l=sa(r.flags,8)?[]:i;if(a||o){var A=a||r.styles.isPositioned()?n:t,c=new Gl(s);if(r.styles.isPositioned()||r.styles.opacity<1||r.styles.isTransformed()){var h=r.styles.zIndex.order;if(h<0){var u=0;A.negativeZIndex.some((function(e,t){return h>e.element.container.styles.zIndex.order?(u=t,!1):u>0})),A.negativeZIndex.splice(u,0,c)}else if(h>0){var d=0;A.positiveZIndex.some((function(e,t){return h>=e.element.container.styles.zIndex.order?(d=t+1,!1):d>0})),A.positiveZIndex.splice(d,0,c)}else A.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else r.styles.isFloating()?A.nonPositionedFloats.push(c):A.nonPositionedInlineLevel.push(c);Vl(s,c,a?c:n,l)}else r.styles.isInlineLevel()?t.inlineLevel.push(s):t.nonInlineLevel.push(s),Vl(s,t,n,l);sa(r.flags,8)&&jl(r,l)}))},jl=function(e,t){for(var n=e instanceof Wo?e.start:1,i=e instanceof Wo&&e.reversed,r=0;r<t.length;r++){var a=t[r];a.container instanceof jo&&"number"==typeof a.container.value&&0!==a.container.value&&(n=a.container.value),a.listValue=Ks(n,a.container.styles.listStyleType,!0),n+=i?-1:1}},Wl=function(e){var t=new Hl(e,null),n=new Gl(t),i=[];return Vl(t,n,n,i),jl(t.container,i),n},Xl=function(e,t){switch(t){case 0:return ql(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return ql(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return ql(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);default:return ql(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},Yl=function(e,t){switch(t){case 0:return ql(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return ql(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return ql(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);default:return ql(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}},Kl=function(e,t){switch(t){case 0:return ql(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return ql(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return ql(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);default:return ql(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}},Zl=function(e,t){switch(t){case 0:return Jl(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return Jl(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return Jl(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);default:return Jl(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}},Jl=function(e,t){var n=[];return Tl(e)?n.push(e.subdivide(.5,!1)):n.push(e),Tl(t)?n.push(t.subdivide(.5,!0)):n.push(t),n},ql=function(e,t,n,i){var r=[];return Tl(e)?r.push(e.subdivide(.5,!1)):r.push(e),Tl(n)?r.push(n.subdivide(.5,!0)):r.push(n),Tl(i)?r.push(i.subdivide(.5,!0).reverse()):r.push(i),Tl(t)?r.push(t.subdivide(.5,!1).reverse()):r.push(t),r},$l=function(e){var t=e.bounds,n=e.styles;return t.add(n.borderLeftWidth,n.borderTopWidth,-(n.borderRightWidth+n.borderLeftWidth),-(n.borderTopWidth+n.borderBottomWidth))},eA=function(e){var t=e.styles,n=e.bounds,i=Xn(t.paddingLeft,n.width),r=Xn(t.paddingRight,n.width),a=Xn(t.paddingTop,n.width),o=Xn(t.paddingBottom,n.width);return n.add(i+t.borderLeftWidth,a+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+i+r),-(t.borderTopWidth+t.borderBottomWidth+a+o))},tA=function(e,t){return 0===e?t.bounds:2===e?eA(t):$l(t)},nA=function(e,t){return 0===e?t.bounds:2===e?eA(t):$l(t)},iA=function(e,t,n){var i=tA(sA(e.styles.backgroundOrigin,t),e),r=nA(sA(e.styles.backgroundClip,t),e),a=oA(sA(e.styles.backgroundSize,t),n,i),o=a[0],s=a[1],l=Wn(sA(e.styles.backgroundPosition,t),i.width-o,i.height-s);return[lA(sA(e.styles.backgroundRepeat,t),l,a,i,r),Math.round(i.left+l[0]),Math.round(i.top+l[1]),o,s]},rA=function(e){return kn(e)&&e.value===Ni.AUTO},aA=function(e){return"number"==typeof e},oA=function(e,t,n){var i=t[0],r=t[1],a=t[2],o=e[0],s=e[1];if(!o)return[0,0];if(Qn(o)&&s&&Qn(s))return[Xn(o,n.width),Xn(s,n.height)];var l=aA(a);if(kn(o)&&(o.value===Ni.CONTAIN||o.value===Ni.COVER))return aA(a)?n.width/n.height<a!=(o.value===Ni.COVER)?[n.width,n.width/a]:[n.height*a,n.height]:[n.width,n.height];var A=aA(i),c=aA(r),h=A||c;if(rA(o)&&(!s||rA(s)))return A&&c?[i,r]:l||h?h&&l?[A?i:r*a,c?r:i/a]:[A?i:n.width,c?r:n.height]:[n.width,n.height];if(l){var u=0,d=0;return Qn(o)?u=Xn(o,n.width):Qn(s)&&(d=Xn(s,n.height)),rA(o)?u=d*a:s&&!rA(s)||(d=u/a),[u,d]}var f=null,p=null;if(Qn(o)?f=Xn(o,n.width):s&&Qn(s)&&(p=Xn(s,n.height)),null===f||s&&!rA(s)||(p=A&&c?f/i*r:n.height),null!==p&&rA(o)&&(f=A&&c?p/r*i:n.width),null!==f&&null!==p)return[f,p];throw new Error("Unable to calculate background-size for element")},sA=function(e,t){var n=e[t];return void 0===n?e[0]:n},lA=function(e,t,n,i,r){var a=t[0],o=t[1],s=n[0],l=n[1];switch(e){case 2:return[new Bl(Math.round(i.left),Math.round(i.top+o)),new Bl(Math.round(i.left+i.width),Math.round(i.top+o)),new Bl(Math.round(i.left+i.width),Math.round(l+i.top+o)),new Bl(Math.round(i.left),Math.round(l+i.top+o))];case 3:return[new Bl(Math.round(i.left+a),Math.round(i.top)),new Bl(Math.round(i.left+a+s),Math.round(i.top)),new Bl(Math.round(i.left+a+s),Math.round(i.height+i.top)),new Bl(Math.round(i.left+a),Math.round(i.height+i.top))];case 1:return[new Bl(Math.round(i.left+a),Math.round(i.top+o)),new Bl(Math.round(i.left+a+s),Math.round(i.top+o)),new Bl(Math.round(i.left+a+s),Math.round(i.top+o+l)),new Bl(Math.round(i.left+a),Math.round(i.top+o+l))];default:return[new Bl(Math.round(r.left),Math.round(r.top)),new Bl(Math.round(r.left+r.width),Math.round(r.top)),new Bl(Math.round(r.left+r.width),Math.round(r.height+r.top)),new Bl(Math.round(r.left),Math.round(r.height+r.top))]}},AA="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",cA="Hidden Text",hA=function(){function e(e){this._data={},this._document=e}return e.prototype.parseMetrics=function(e,t){var n=this._document.createElement("div"),i=this._document.createElement("img"),r=this._document.createElement("span"),a=this._document.body;n.style.visibility="hidden",n.style.fontFamily=e,n.style.fontSize=t,n.style.margin="0",n.style.padding="0",n.style.whiteSpace="nowrap",a.appendChild(n),i.src=AA,i.width=1,i.height=1,i.style.margin="0",i.style.padding="0",i.style.verticalAlign="baseline",r.style.fontFamily=e,r.style.fontSize=t,r.style.margin="0",r.style.padding="0",r.appendChild(this._document.createTextNode(cA)),n.appendChild(r),n.appendChild(i);var o=i.offsetTop-r.offsetTop+2;n.removeChild(r),n.appendChild(this._document.createTextNode(cA)),n.style.lineHeight="normal",i.style.verticalAlign="super";var s=i.offsetTop-n.offsetTop+2;return a.removeChild(n),{baseline:o,middle:s}},e.prototype.getMetrics=function(e,t){var n=e+" "+t;return void 0===this._data[n]&&(this._data[n]=this.parseMetrics(e,t)),this._data[n]},e}(),uA=function(){function e(e,t){this.context=e,this.options=t}return e}(),dA=1e4,fA=function(e){function n(t,n){var i=e.call(this,t,n)||this;return i._activeEffects=[],i.canvas=n.canvas?n.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),n.canvas||(i.canvas.width=Math.floor(n.width*n.scale),i.canvas.height=Math.floor(n.height*n.scale),i.canvas.style.width=n.width+"px",i.canvas.style.height=n.height+"px"),i.fontMetrics=new hA(document),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-n.x,-n.y),i.ctx.textBaseline="bottom",i._activeEffects=[],i.context.logger.debug("Canvas renderer initialized ("+n.width+"x"+n.height+") with scale "+n.scale),i}return t(n,e),n.prototype.applyEffects=function(e){for(var t=this;this._activeEffects.length;)this.popEffect();e.forEach((function(e){return t.applyEffect(e)}))},n.prototype.applyEffect=function(e){this.ctx.save(),Nl(e)&&(this.ctx.globalAlpha=e.opacity),Rl(e)&&(this.ctx.translate(e.offsetX,e.offsetY),this.ctx.transform(e.matrix[0],e.matrix[1],e.matrix[2],e.matrix[3],e.matrix[4],e.matrix[5]),this.ctx.translate(-e.offsetX,-e.offsetY)),Ol(e)&&(this.path(e.path),this.ctx.clip()),this._activeEffects.push(e)},n.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},n.prototype.renderStack=function(e){return i(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return e.element.container.styles.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},n.prototype.renderNode=function(e){return i(this,void 0,void 0,(function(){return r(this,(function(t){switch(t.label){case 0:return sa(e.container.flags,16),e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return t.sent(),[4,this.renderNodeContent(e)];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},n.prototype.renderTextWithLetterSpacing=function(e,t,n){var i=this;0===t?this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+n):ko(e.text).reduce((function(t,r){return i.ctx.fillText(r,t,e.bounds.top+n),t+i.ctx.measureText(r).width}),e.bounds.left)},n.prototype.createFontStyle=function(e){var t=e.fontVariant.filter((function(e){return"normal"===e||"small-caps"===e})).join(""),n=yA(e.fontFamily).join(", "),i=Ln(e.fontSize)?""+e.fontSize.number+e.fontSize.unit:e.fontSize.number+"px";return[[e.fontStyle,t,e.fontWeight,i,n].join(" "),n,i]},n.prototype.renderTextNode=function(e,t){return i(this,void 0,void 0,(function(){var n,i,a,o,s,l,A,c,h=this;return r(this,(function(r){return n=this.createFontStyle(t),i=n[0],a=n[1],o=n[2],this.ctx.font=i,this.ctx.direction=1===t.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",s=this.fontMetrics.getMetrics(a,o),l=s.baseline,A=s.middle,c=t.paintOrder,e.textBounds.forEach((function(e){c.forEach((function(n){switch(n){case 0:h.ctx.fillStyle=ri(t.color),h.renderTextWithLetterSpacing(e,t.letterSpacing,l);var i=t.textShadow;i.length&&e.text.trim().length&&(i.slice(0).reverse().forEach((function(n){h.ctx.shadowColor=ri(n.color),h.ctx.shadowOffsetX=n.offsetX.number*h.options.scale,h.ctx.shadowOffsetY=n.offsetY.number*h.options.scale,h.ctx.shadowBlur=n.blur.number,h.renderTextWithLetterSpacing(e,t.letterSpacing,l)})),h.ctx.shadowColor="",h.ctx.shadowOffsetX=0,h.ctx.shadowOffsetY=0,h.ctx.shadowBlur=0),t.textDecorationLine.length&&(h.ctx.fillStyle=ri(t.textDecorationColor||t.color),t.textDecorationLine.forEach((function(t){switch(t){case 1:h.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top+l),e.bounds.width,1);break;case 2:h.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top),e.bounds.width,1);break;case 3:h.ctx.fillRect(e.bounds.left,Math.ceil(e.bounds.top+A),e.bounds.width,1)}})));break;case 1:t.webkitTextStrokeWidth&&e.text.trim().length&&(h.ctx.strokeStyle=ri(t.webkitTextStrokeColor),h.ctx.lineWidth=t.webkitTextStrokeWidth,h.ctx.lineJoin=window.chrome?"miter":"round",h.ctx.strokeText(e.text,e.bounds.left,e.bounds.top+l)),h.ctx.strokeStyle="",h.ctx.lineWidth=0,h.ctx.lineJoin="miter"}}))})),[2]}))}))},n.prototype.renderReplacedElement=function(e,t,n){if(n&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var i=eA(e),r=kl(t);this.path(r),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,e.intrinsicWidth,e.intrinsicHeight,i.left,i.top,i.width,i.height),this.ctx.restore()}},n.prototype.renderNodeContent=function(e){return i(this,void 0,void 0,(function(){var t,i,a,s,l,A,c,h,u,d,f,p,m,v,g,y,w,x;return r(this,(function(r){switch(r.label){case 0:this.applyEffects(e.getEffects(4)),t=e.container,i=e.curves,a=t.styles,s=0,l=t.textNodes,r.label=1;case 1:return s<l.length?(A=l[s],[4,this.renderTextNode(A,a)]):[3,4];case 2:r.sent(),r.label=3;case 3:return s++,[3,1];case 4:if(!(t instanceof Go))return[3,8];r.label=5;case 5:return r.trys.push([5,7,,8]),[4,this.context.cache.match(t.src)];case 6:return g=r.sent(),this.renderReplacedElement(t,i,g),[3,8];case 7:return r.sent(),this.context.logger.error("Error loading image "+t.src),[3,8];case 8:if(t instanceof Ho&&this.renderReplacedElement(t,i,t.canvas),!(t instanceof Vo))return[3,12];r.label=9;case 9:return r.trys.push([9,11,,12]),[4,this.context.cache.match(t.svg)];case 10:return g=r.sent(),this.renderReplacedElement(t,i,g),[3,12];case 11:return r.sent(),this.context.logger.error("Error loading svg "+t.svg.substring(0,255)),[3,12];case 12:return t instanceof rs&&t.tree?[4,new n(this.context,{scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,width:t.width,height:t.height}).render(t.tree)]:[3,14];case 13:c=r.sent(),t.width&&t.height&&this.ctx.drawImage(c,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),r.label=14;case 14:if(t instanceof ts&&(h=Math.min(t.bounds.width,t.bounds.height),t.type===Jo?t.checked&&(this.ctx.save(),this.path([new Bl(t.bounds.left+.39363*h,t.bounds.top+.79*h),new Bl(t.bounds.left+.16*h,t.bounds.top+.5549*h),new Bl(t.bounds.left+.27347*h,t.bounds.top+.44071*h),new Bl(t.bounds.left+.39694*h,t.bounds.top+.5649*h),new Bl(t.bounds.left+.72983*h,t.bounds.top+.23*h),new Bl(t.bounds.left+.84*h,t.bounds.top+.34085*h),new Bl(t.bounds.left+.39363*h,t.bounds.top+.79*h)]),this.ctx.fillStyle=ri(es),this.ctx.fill(),this.ctx.restore()):t.type===qo&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+h/2,t.bounds.top+h/2,h/4,0,2*Math.PI,!0),this.ctx.fillStyle=ri(es),this.ctx.fill(),this.ctx.restore())),pA(t)&&t.value.length){switch(u=this.createFontStyle(a),w=u[0],d=u[1],f=this.fontMetrics.getMetrics(w,d).baseline,this.ctx.font=w,this.ctx.fillStyle=ri(a.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=vA(t.styles.textAlign),x=eA(t),p=0,t.styles.textAlign){case 1:p+=x.width/2;break;case 2:p+=x.width}m=x.add(p,0,0,-x.height/2+1),this.ctx.save(),this.path([new Bl(x.left,x.top),new Bl(x.left+x.width,x.top),new Bl(x.left+x.width,x.top+x.height),new Bl(x.left,x.top+x.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new _o(t.value,m),a.letterSpacing,f),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!sa(t.styles.display,2048))return[3,20];if(null===t.styles.listStyleImage)return[3,19];if(0!==(v=t.styles.listStyleImage).type)return[3,18];g=void 0,y=v.url,r.label=15;case 15:return r.trys.push([15,17,,18]),[4,this.context.cache.match(y)];case 16:return g=r.sent(),this.ctx.drawImage(g,t.bounds.left-(g.width+10),t.bounds.top),[3,18];case 17:return r.sent(),this.context.logger.error("Error loading list-style-image "+y),[3,18];case 18:return[3,20];case 19:e.listValue&&-1!==t.styles.listStyleType&&(w=this.createFontStyle(a)[0],this.ctx.font=w,this.ctx.fillStyle=ri(a.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",x=new o(t.bounds.left,t.bounds.top+Xn(t.styles.paddingTop,t.bounds.width),t.bounds.width,Cr(a.lineHeight,a.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new _o(e.listValue,x),a.letterSpacing,Cr(a.lineHeight,a.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),r.label=20;case 20:return[2]}}))}))},n.prototype.renderStackContent=function(e){return i(this,void 0,void 0,(function(){var t,n,i,a,o,s,l,A,c,h,u,d,f,p,m;return r(this,(function(r){switch(r.label){case 0:return sa(e.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(e.element)];case 1:r.sent(),t=0,n=e.negativeZIndex,r.label=2;case 2:return t<n.length?(m=n[t],[4,this.renderStack(m)]):[3,5];case 3:r.sent(),r.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(e.element)];case 6:r.sent(),i=0,a=e.nonInlineLevel,r.label=7;case 7:return i<a.length?(m=a[i],[4,this.renderNode(m)]):[3,10];case 8:r.sent(),r.label=9;case 9:return i++,[3,7];case 10:o=0,s=e.nonPositionedFloats,r.label=11;case 11:return o<s.length?(m=s[o],[4,this.renderStack(m)]):[3,14];case 12:r.sent(),r.label=13;case 13:return o++,[3,11];case 14:l=0,A=e.nonPositionedInlineLevel,r.label=15;case 15:return l<A.length?(m=A[l],[4,this.renderStack(m)]):[3,18];case 16:r.sent(),r.label=17;case 17:return l++,[3,15];case 18:c=0,h=e.inlineLevel,r.label=19;case 19:return c<h.length?(m=h[c],[4,this.renderNode(m)]):[3,22];case 20:r.sent(),r.label=21;case 21:return c++,[3,19];case 22:u=0,d=e.zeroOrAutoZIndexOrTransformedOrOpacity,r.label=23;case 23:return u<d.length?(m=d[u],[4,this.renderStack(m)]):[3,26];case 24:r.sent(),r.label=25;case 25:return u++,[3,23];case 26:f=0,p=e.positiveZIndex,r.label=27;case 27:return f<p.length?(m=p[f],[4,this.renderStack(m)]):[3,30];case 28:r.sent(),r.label=29;case 29:return f++,[3,27];case 30:return[2]}}))}))},n.prototype.mask=function(e){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()},n.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},n.prototype.formatPath=function(e){var t=this;e.forEach((function(e,n){var i=Tl(e)?e.start:e;0===n?t.ctx.moveTo(i.x,i.y):t.ctx.lineTo(i.x,i.y),Tl(e)&&t.ctx.bezierCurveTo(e.startControl.x,e.startControl.y,e.endControl.x,e.endControl.y,e.end.x,e.end.y)}))},n.prototype.renderRepeat=function(e,t,n,i){this.path(e),this.ctx.fillStyle=t,this.ctx.translate(n,i),this.ctx.fill(),this.ctx.translate(-n,-i)},n.prototype.resizeImage=function(e,t,n){var i;if(e.width===t&&e.height===n)return e;var r=(null!==(i=this.canvas.ownerDocument)&&void 0!==i?i:document).createElement("canvas");return r.width=Math.max(1,t),r.height=Math.max(1,n),r.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t,n),r},n.prototype.renderBackgroundImage=function(e){return i(this,void 0,void 0,(function(){var t,n,i,a,o,s;return r(this,(function(l){switch(l.label){case 0:t=e.styles.backgroundImage.length-1,n=function(n){var a,o,s,l,A,c,h,u,d,f,p,m,v,g,y,w,x,b,M,C,B,E,S,T,_,I,L,F,k,P,U;return r(this,(function(r){switch(r.label){case 0:if(0!==n.type)return[3,5];a=void 0,o=n.url,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,i.context.cache.match(o)];case 2:return a=r.sent(),[3,4];case 3:return r.sent(),i.context.logger.error("Error loading background-image "+o),[3,4];case 4:return a&&(s=iA(e,t,[a.width,a.height,a.width/a.height]),w=s[0],E=s[1],S=s[2],M=s[3],C=s[4],g=i.ctx.createPattern(i.resizeImage(a,M,C),"repeat"),i.renderRepeat(w,g,E,S)),[3,6];case 5:Ui(n)?(l=iA(e,t,[null,null,null]),w=l[0],E=l[1],S=l[2],M=l[3],C=l[4],A=gi(n.angle,M,C),c=A[0],h=A[1],u=A[2],d=A[3],f=A[4],(p=document.createElement("canvas")).width=M,p.height=C,m=p.getContext("2d"),v=m.createLinearGradient(h,d,u,f),mi(n.stops,c).forEach((function(e){return v.addColorStop(e.stop,ri(e.color))})),m.fillStyle=v,m.fillRect(0,0,M,C),M>0&&C>0&&(g=i.ctx.createPattern(p,"repeat"),i.renderRepeat(w,g,E,S))):Di(n)&&(y=iA(e,t,[null,null,null]),w=y[0],x=y[1],b=y[2],M=y[3],C=y[4],B=0===n.position.length?[Vn]:n.position,E=Xn(B[0],M),S=Xn(B[B.length-1],C),T=xi(n,E,S,M,C),_=T[0],I=T[1],_>0&&I>0&&(L=i.ctx.createRadialGradient(x+E,b+S,0,x+E,b+S,_),mi(n.stops,2*_).forEach((function(e){return L.addColorStop(e.stop,ri(e.color))})),i.path(w),i.ctx.fillStyle=L,_!==I?(F=e.bounds.left+.5*e.bounds.width,k=e.bounds.top+.5*e.bounds.height,U=1/(P=I/_),i.ctx.save(),i.ctx.translate(F,k),i.ctx.transform(1,0,0,P,0,0),i.ctx.translate(-F,-k),i.ctx.fillRect(x,U*(b-k)+k,M,C*U),i.ctx.restore()):i.ctx.fill())),r.label=6;case 6:return t--,[2]}}))},i=this,a=0,o=e.styles.backgroundImage.slice(0).reverse(),l.label=1;case 1:return a<o.length?(s=o[a],[5,n(s)]):[3,4];case 2:l.sent(),l.label=3;case 3:return a++,[3,1];case 4:return[2]}}))}))},n.prototype.renderSolidBorder=function(e,t,n){return i(this,void 0,void 0,(function(){return r(this,(function(i){return this.path(Xl(n,t)),this.ctx.fillStyle=ri(e),this.ctx.fill(),[2]}))}))},n.prototype.renderDoubleBorder=function(e,t,n,a){return i(this,void 0,void 0,(function(){var i,o;return r(this,(function(r){switch(r.label){case 0:return t<3?[4,this.renderSolidBorder(e,n,a)]:[3,2];case 1:return r.sent(),[2];case 2:return i=Yl(a,n),this.path(i),this.ctx.fillStyle=ri(e),this.ctx.fill(),o=Kl(a,n),this.path(o),this.ctx.fill(),[2]}}))}))},n.prototype.renderNodeBackgroundAndBorders=function(e){return i(this,void 0,void 0,(function(){var t,n,i,a,o,s,l,A,c=this;return r(this,(function(r){switch(r.label){case 0:return this.applyEffects(e.getEffects(2)),t=e.container.styles,n=!ii(t.backgroundColor)||t.backgroundImage.length,i=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],a=mA(sA(t.backgroundClip,0),e.curves),n||t.boxShadow.length?(this.ctx.save(),this.path(a),this.ctx.clip(),ii(t.backgroundColor)||(this.ctx.fillStyle=ri(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:r.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach((function(t){c.ctx.save();var n=Ll(e.curves),i=t.inset?0:dA,r=Ql(n,-i+(t.inset?1:-1)*t.spread.number,(t.inset?1:-1)*t.spread.number,t.spread.number*(t.inset?-2:2),t.spread.number*(t.inset?-2:2));t.inset?(c.path(n),c.ctx.clip(),c.mask(r)):(c.mask(n),c.ctx.clip(),c.path(r)),c.ctx.shadowOffsetX=t.offsetX.number+i,c.ctx.shadowOffsetY=t.offsetY.number,c.ctx.shadowColor=ri(t.color),c.ctx.shadowBlur=t.blur.number,c.ctx.fillStyle=t.inset?ri(t.color):"rgba(0,0,0,1)",c.ctx.fill(),c.ctx.restore()})),r.label=2;case 2:o=0,s=0,l=i,r.label=3;case 3:return s<l.length?0!==(A=l[s]).style&&!ii(A.color)&&A.width>0?2!==A.style?[3,5]:[4,this.renderDashedDottedBorder(A.color,A.width,o,e.curves,2)]:[3,11]:[3,13];case 4:return r.sent(),[3,11];case 5:return 3!==A.style?[3,7]:[4,this.renderDashedDottedBorder(A.color,A.width,o,e.curves,3)];case 6:return r.sent(),[3,11];case 7:return 4!==A.style?[3,9]:[4,this.renderDoubleBorder(A.color,A.width,o,e.curves)];case 8:return r.sent(),[3,11];case 9:return[4,this.renderSolidBorder(A.color,o,e.curves)];case 10:r.sent(),r.label=11;case 11:o++,r.label=12;case 12:return s++,[3,3];case 13:return[2]}}))}))},n.prototype.renderDashedDottedBorder=function(e,t,n,a,o){return i(this,void 0,void 0,(function(){var i,s,l,A,c,h,u,d,f,p,m,v,g,y,w,x;return r(this,(function(r){return this.ctx.save(),i=Zl(a,n),s=Xl(a,n),2===o&&(this.path(s),this.ctx.clip()),Tl(s[0])?(l=s[0].start.x,A=s[0].start.y):(l=s[0].x,A=s[0].y),Tl(s[1])?(c=s[1].end.x,h=s[1].end.y):(c=s[1].x,h=s[1].y),u=0===n||2===n?Math.abs(l-c):Math.abs(A-h),this.ctx.beginPath(),3===o?this.formatPath(i):this.formatPath(s.slice(0,2)),d=t<3?3*t:2*t,f=t<3?2*t:t,3===o&&(d=t,f=t),p=!0,u<=2*d?p=!1:u<=2*d+f?(d*=m=u/(2*d+f),f*=m):(v=Math.floor((u+f)/(d+f)),g=(u-v*d)/(v-1),f=(y=(u-(v+1)*d)/v)<=0||Math.abs(f-g)<Math.abs(f-y)?g:y),p&&(3===o?this.ctx.setLineDash([0,d+f]):this.ctx.setLineDash([d,f])),3===o?(this.ctx.lineCap="round",this.ctx.lineWidth=t):this.ctx.lineWidth=2*t+1.1,this.ctx.strokeStyle=ri(e),this.ctx.stroke(),this.ctx.setLineDash([]),2===o&&(Tl(s[0])&&(w=s[3],x=s[0],this.ctx.beginPath(),this.formatPath([new Bl(w.end.x,w.end.y),new Bl(x.start.x,x.start.y)]),this.ctx.stroke()),Tl(s[1])&&(w=s[1],x=s[2],this.ctx.beginPath(),this.formatPath([new Bl(w.end.x,w.end.y),new Bl(x.start.x,x.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]}))}))},n.prototype.render=function(e){return i(this,void 0,void 0,(function(){var t;return r(this,(function(n){switch(n.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=ri(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),t=Wl(e),[4,this.renderStack(t)];case 1:return n.sent(),this.applyEffects([]),[2,this.canvas]}}))}))},n}(uA),pA=function(e){return e instanceof is||e instanceof ns||e instanceof ts&&e.type!==qo&&e.type!==Jo},mA=function(e,t){switch(e){case 0:return Ll(t);case 2:return Fl(t);default:return kl(t)}},vA=function(e){switch(e){case 1:return"center";case 2:return"right";default:return"left"}},gA=["-apple-system","system-ui"],yA=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter((function(e){return-1===gA.indexOf(e)})):e},wA=function(e){function n(t,n){var i=e.call(this,t,n)||this;return i.canvas=n.canvas?n.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),i.options=n,i.canvas.width=Math.floor(n.width*n.scale),i.canvas.height=Math.floor(n.height*n.scale),i.canvas.style.width=n.width+"px",i.canvas.style.height=n.height+"px",i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-n.x,-n.y),i.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+n.width+"x"+n.height+" at "+n.x+","+n.y+") with scale "+n.scale),i}return t(n,e),n.prototype.render=function(e){return i(this,void 0,void 0,(function(){var t,n;return r(this,(function(i){switch(i.label){case 0:return t=Eo(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,xA(t)];case 1:return n=i.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=ri(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}}))}))},n}(uA),xA=function(e){return new Promise((function(t,n){var i=new Image;i.onload=function(){t(i)},i.onerror=n,i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))}))},bA=function(){function e(e){var t=e.id,n=e.enabled;this.id=t,this.enabled=n,this.start=Date.now()}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,a([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,a([this.id,this.getTime()+"ms"],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.warn?console.warn.apply(console,a([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,a([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.instances={},e}(),MA=function(){function e(t,n){var i;this.windowBounds=n,this.instanceName="#"+e.instanceCount++,this.logger=new bA({id:this.instanceName,enabled:t.logging}),this.cache=null!==(i=t.cache)&&void 0!==i?i:new ml(this,t)}return e.instanceCount=1,e}(),CA=function(e,t){return void 0===t&&(t={}),BA(e,t)};"undefined"!=typeof window&&pl.setContext(window);var BA=function(e,t){return i(void 0,void 0,void 0,(function(){var i,a,A,c,h,u,d,f,p,m,v,g,y,w,x,b,M,C,B,E,S,T,_,I,L,F,k,P,U,D,R,O,N,z,Q,G,H,V;return r(this,(function(r){switch(r.label){case 0:if(!e||"object"!=typeof e)return[2,Promise.reject("Invalid element provided as first argument")];if(!(i=e.ownerDocument))throw new Error("Element is not attached to a Document");if(!(a=i.defaultView))throw new Error("Document is not attached to a Window");return A={allowTaint:null!==(T=t.allowTaint)&&void 0!==T&&T,imageTimeout:null!==(_=t.imageTimeout)&&void 0!==_?_:15e3,proxy:t.proxy,useCORS:null!==(I=t.useCORS)&&void 0!==I&&I},c=n({logging:null===(L=t.logging)||void 0===L||L,cache:t.cache},A),h={windowWidth:null!==(F=t.windowWidth)&&void 0!==F?F:a.innerWidth,windowHeight:null!==(k=t.windowHeight)&&void 0!==k?k:a.innerHeight,scrollX:null!==(P=t.scrollX)&&void 0!==P?P:a.pageXOffset,scrollY:null!==(U=t.scrollY)&&void 0!==U?U:a.pageYOffset},u=new o(h.scrollX,h.scrollY,h.windowWidth,h.windowHeight),d=new MA(c,u),f=null!==(D=t.foreignObjectRendering)&&void 0!==D&&D,p={allowTaint:null!==(R=t.allowTaint)&&void 0!==R&&R,onclone:t.onclone,ignoreElements:t.ignoreElements,inlineImages:f,copyStyles:f},d.logger.debug("Starting document clone with size "+u.width+"x"+u.height+" scrolled to "+-u.left+","+-u.top),m=new Js(d,e,p),(v=m.clonedReferenceElement)?[4,m.toIFrame(i,u)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return g=r.sent(),y=ws(v)||gs(v)?l(v.ownerDocument):s(d,v),w=y.width,x=y.height,b=y.left,M=y.top,C=EA(d,v,t.backgroundColor),B={canvas:t.canvas,backgroundColor:C,scale:null!==(N=null!==(O=t.scale)&&void 0!==O?O:a.devicePixelRatio)&&void 0!==N?N:1,x:(null!==(z=t.x)&&void 0!==z?z:0)+b,y:(null!==(Q=t.y)&&void 0!==Q?Q:0)+M,width:null!==(G=t.width)&&void 0!==G?G:Math.ceil(w),height:null!==(H=t.height)&&void 0!==H?H:Math.ceil(x)},f?(d.logger.debug("Document cloned, using foreign object rendering"),[4,new wA(d,B).render(v)]):[3,3];case 2:return E=r.sent(),[3,5];case 3:return d.logger.debug("Document cloned, element located at "+b+","+M+" with size "+w+"x"+x+" using computed rendering"),d.logger.debug("Starting DOM parsing"),S=ls(d,v),C===S.styles.backgroundColor&&(S.styles.backgroundColor=ui.TRANSPARENT),d.logger.debug("Starting renderer for element at "+B.x+","+B.y+" with size "+B.width+"x"+B.height),[4,new fA(d,B).render(S)];case 4:E=r.sent(),r.label=5;case 5:return(null===(V=t.removeContainer)||void 0===V||V)&&(Js.destroy(g)||d.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),d.logger.debug("Finished rendering"),[2,E]}}))}))},EA=function(e,t,n){var i=t.ownerDocument,r=i.documentElement?hi(e,getComputedStyle(i.documentElement).backgroundColor):ui.TRANSPARENT,a=i.body?hi(e,getComputedStyle(i.body).backgroundColor):ui.TRANSPARENT,o="string"==typeof n?hi(e,n):null===n?ui.TRANSPARENT:4294967295;return t===i.documentElement?ii(r)?ii(a)?o:a:r:o};return CA}()})),$m=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),(i=t.call(this)).isSpriteLabel=!0,i.sprite=new go(new ro({transparent:!0,opacity:0})),i.sprite.renderOrder=5e3,i.sprite.center.set(.5,.1),i.add(i.sprite),e.position&&(Array.isArray(e.position)?i.position.fromArray(e.position):i.position.copy(e.position)),i.userData=e.userData||e,i.element=document.createElement("div"),i.element.style.position="absolute",null!==e.html&&void 0!==e.html&&(e.html.constructor===String?i.element.innerHTML=e.html:i.element.appendChild(e.html),i._fromHTML(e,i.element)),i.cameraView=e.cameraView,i.onclick=e.onclick,i}return A(n,[{key:"_fromHTML",value:function(){var e=this;document.body.appendChild(this.element),this._onLoadElement(this.element,(function(){qm(e.element,{backgroundColor:"transparent",useCORS:!0,scale:4}).then((function(t){e.sprite.material.map&&e.sprite.material.map.dispose(),e.sprite.material.opacity=1,e.sprite.material.map=new ts(t),e.sprite.material.needsUpdate=!0;e.sprite.scale.set(t.width/100,t.height/100,1),e.element.parentElement&&e.element.parentElement.removeChild(e.element)}))}))}},{key:"setElement",value:function(e){this.userData=e.userData,e.html.constructor===String?this.element.innerHTML=e.html:(this.element.innerHTML="",this.element.appendChild(e.html)),this._fromHTML()}},{key:"updateElement",value:function(){this._fromHTML()}},{key:"_fromImage",value:function(e){}},{key:"toJSON",value:function(){return{position:this.position.toArray(),scale:this.scale.toArray(),html:encodeURIComponent(this.element.innerHTML),userData:this.userData}}},{key:"_onLoadElement",value:function(e,t){var n,i=e.getElementsByTagName("img"),r=i.length,a=0;function o(){a++,console.log("已经加载图片:"+a+"/"+r),a===r&&(console.log("内容加载完成"),t())}r<=0&&t();for(var s=0;s<i.length;s++)i[n=s].complete?o():i[n].onload=o}},{key:"_click",value:function(){this.onclick&&this.onclick(this),this.cameraView&&this.viewer.controls.flyTo(this.cameraView)}}]),n}(zt),ev=function(){function e(t){s(this,e),this.icon="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAvCAMAAAC18jgTAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAACvlBMVEUAAADnTDzAOSvnTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDzAOSvAOSvAOSvAOSvnTDznTDzAOSvAOSvAOSvAOSvAOSvAOSvAOSvAOSvnTDznTDzAOSvAOSvAOSvAOSvnTDznTDznTDznTDzAOSvAOSvAOSvAOSvnTDzAOSvAOSvAOSvAOSvnTDznTDzAOSvAOSvnTDzAOSvAOSvAOSvAOSvAOSvAOSvnTDzAOSvnTDzAOSvAOSvAOSvnTDznTDznTDzAOSvAOSvAOSvnTDznTDznTDzAOSvAOSvAOSvAOSvAOSvnTDznTDznTDznTDzAOSvAOSvAOSvAOSvAOSvnTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDznTDzoTDzlSzviSTrhSTrjSjrXRDXPQDLJPS/EOy3PQDHWRDXiSjrcRzfAOSu/OSvIPS7bRjfmTDzTQjPDOizCOizSQjPUQzTDOyzZRTbHPS7GPC7BOSvNPzHLPzDkSzveRzjBOizcRjfQQTLOQDHJPi/gSDnFPC3eSDjgSTnMPzDfSDnHPC7WRDTkSjvfSDgAAAAbHy20AAAAuXRSTlMAAAAYTpbF3O7w3ceaUxsffc/09dODIxZ+14gptr8wONFBJc3VLhKxvHH+fyLY4Cv14N7zi8bujD8gHj2E6ho+5E0BRPNLdf39eGv6oMMSDLivtYh50P5fUPtpWrqWmdgn0Klm+6IIlXYt4qgtAp/46jkFp6l9eqbdCkz2+lkLsr0PP+zySgKQndrjLxTEzmAIDelEAYqYBBnKRvFSB6y5DEDtlKEGKOUygh5X92QJrQ4860ePnNt8iUMldKgAAAABYktHRACIBR1IAAAACXBIWXMAAAK8AAACvAAsAdHPAAAAB3RJTUUH5AYdASUjJ2RCdAAAAtRJREFUOMt1lAdbkzEQx5OisgTBwXKAKCg4wY1bEXCi4MKJiFscuAEVt+LeA/fee4VioYi+BbTFMt0T5WN4l7R9O+952lzu/3veyyWXEMKNgjk1aNjI2cXVzb2xhyfOiWw4beLl3ZQZrFnzFj7mCLi+fv7MwtwCPE0EOC1bMRtr3cZAwBAYxOyYf1tBUBrczhDKY8r8V0oYhLUP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HRUaHVtYjo6SW1hZ2U6OldpZHRoADE1OJ/MhxoAAAAZdEVYdFRodW1iOjpNaW1ldHlwZQBpbWFnZS9wbmc/slZOAAAAF3RFWHRUaHVtYjo6TVRpbWUAMTU0Njk3NjcxMp4G7IoAAAASdEVYdFRodW1iOjpTaXplADEwMzgzQvuof6wAAABadEVYdFRodW1iOjpVUkkAZmlsZTovLy9kYXRhL3d3d3Jvb3Qvd3d3LmVhc3lpY29uLm5ldC9jZG4taW1nLmVhc3lpY29uLmNuL2ZpbGVzLzExOC8xMTg1NjU4LnBuZ9VKt4oAAAAASUVORK5CYII=",this.viewer=t,this.container=document.createElement("div"),this.container.setAttribute("id","markerContainer"),this.container.style.position="absolute",this.container.style.top="0",this.container.style.left="0",t.container.appendChild(this.container),this.defaultLayer=new Zm,this.layers=[this.defaultLayer],If.bindAll(["_onUpdate","_onClick"],this),t.addEventListener("update",this._onUpdate),this.spriteRoot=new zt,this.spriteRoot.name="spriteRoot",this.viewer.root.add(this.spriteRoot),this.viewer.domElement.addEventListener(ld.CLICK,this._onClick)}return A(e,[{key:"_onClick",value:function(e){var t=this.spriteRoot.children.filter((function(e){return e.onclick&&"function"==typeof e.onclick})),n=this.viewer.intersectObject(e,t);n&&n.object.parent._click(n.object)}},{key:"addMarker",value:function(e){if(void 0!==e.position)return void 0===e.element&&(e.element=new Image,e.element.src=this.icon,(e.onclick||e.cameraView)&&(e.element.style.cursor="pointer")),this._addHotSpot(e);console.error("缺少关键参数:position")}},{key:"add",value:function(e){if(void 0!==e.position){if(void 0!==e.element){if(e.element.constructor===String){e.element='<div class="hot-spot" >'.concat(e.element,"</div>");var t=document.createElement("div");t.innerHTML=e.element,e.element=t.children[0]}return this._addHotSpot(e)}console.error("缺少关键参数:element")}else console.error("缺少关键参数:position")}},{key:"addLayer",value:function(e){this.layers.indexOf(e)<0&&this.layers.push(e)}},{key:"hideAll",value:function(){this.layers.forEach((function(e){e.hide()}))}},{key:"showAll",value:function(){this.layers.forEach((function(e){e.show()}))}},{key:"onlyShow",value:function(e){this.hideAll(),e.show()}},{key:"toJSON",value:function(){var e=[];return this.layers.forEach((function(t){e.push(t.toJSON())})),e}},{key:"loadLayer",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.defaultLayer;viewer.camera.updateProjectionMatrix(),this.addLayer(n),e.forEach((function(e){var i=document.createElement("div");i.innerHTML=e.element,i.className="hot-spot",e.element=i,e.layer=n,t._addHotSpot(e)}))}},{key:"_addHotSpot",value:function(e){var t=this;if(e.element.style.position="absolute",this.container.appendChild(e.element),e.position=Array.isArray(e.position)?(new at).fromArray(e.position):(new at).copy(e.position),void 0!==e.objectId){var n=this.viewer.root.getObjectById(e.objectId);if(!n)return console.error("热点id与模型不匹配"),null;e.worldPos=e.position.clone(),n.worldToLocal(e.position)}var i=new Km(e);return e.layer=e.layer||this.defaultLayer,e.layer.add(i),i.focus=function(n){e.cameraView&&e.cameraView.position&&(i.cameraView.complete=function(){n?n():i.complete&&i.complete()},t.viewer.controls.flyTo(i.cameraView))},i}},{key:"_onUpdate",value:function(){var e=this;this.layers.forEach((function(t){t.visible&&t.spots.forEach((function(t){var n=t.position.clone();void 0!==t.objectId&&(n=e.viewer.root.getObjectById(t.objectId).localToWorld(t.position.clone())),t.updateScreenCoords(e._getProjectHotPos(n)),t.screenCoord?t.hided||(t.element.style.display="block"):t.element.style.display="none"}))}))}},{key:"_getProjectHotPos",value:function(e){var t=this.viewer,n=t.camera.position.clone().sub(e.clone()).normalize(),i=new at;t.camera.getWorldDirection(i).clone();var r=t.renderer.domElement.getBoundingClientRect(),a=t.renderer.domElement.offsetWidth,o=t.renderer.domElement.offsetHeight,s=a/2,l=o/2,A=e.clone();if(A.project(t.camera),i.x=-i.x,i.y=-i.y,i.z=-i.z,n.clone().angleTo(i)>.5*Math.PI)return null;var c=A.x*s+s,h=-A.y*l+l;return a<=Math.round(r.width)&&(c+=r.left),o<=Math.round(r.height)&&(h+=r.top),new tt(c,h)}},{key:"createLayer",value:function(){var e=new Zm;return this.addLayer(e),e}},{key:"deleteLayer",value:function(e){-1!==this.layers.indexOf(e)&&(e.spots.map((function(e){e.element.remove()})),this.layers.splice(this.layers.indexOf(e),1))}},{key:"export",value:function(){return this.toJSON().filter((function(e){return e.length>0}))}},{key:"import",value:function(e,t){var n=this,i=new DOMParser;return e.map((function(e){t=t||n.createLayer(),e.forEach((function(e){e.element=i.parseFromString(e.element,"text/html").body.children[0],e.layer=t,n._addHotSpot(e)}))})),t}},{key:"addSpriteLabel",value:function(e){e.position||console.warn("addSpriteLabel: options.position不能为空!");var t=new $m({position:e.position,html:e.content,userData:e.userData,cameraView:e.cameraView,onclick:e.onclick});return this.spriteRoot.add(t),t}}]),e}(),tv=function(){function e(){s(this,e)}return A(e,[{key:"init",value:function(){this.isActive=!1}},{key:"initParticleItem",value:function(e){}},{key:"update",value:function(e,t){}},{key:"reset",value:function(){}}]),e}(),nv="\nattribute vec4 vertexColor;\nvarying vec4 vColor;\nvarying vec2 vUv;\nvoid main()\n{\n vUv = uv;\n vColor = vertexColor;\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * mvPosition;\n}\n",iv="\n\nuniform sampler2D mainTex;\nvarying vec4 vColor;\nvarying vec2 vUv;\nvoid main()\n{\n vec4 texColor = texture2D(mainTex,vUv.xy);\n vec4 col = texColor * vColor;\n gl_FragColor = col;\n}\n\n",rv="\nattribute vec4 vertexColor;\nuniform vec4 _TintColor;\nvarying vec4 vColor;\nvarying vec2 vUv;\nvoid main()\n{\n vUv = uv;\n vColor = vec4(vertexColor.xyz * _TintColor.xyz,vertexColor.w * _TintColor.w);\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * mvPosition;\n}\n\n",av="\n\nuniform sampler2D mainTex;\nvarying vec4 vColor;\nvarying vec2 vUv;\nvoid main()\n{\n vec4 texColor = texture2D(mainTex,vUv.xy);\n vec4 col = texColor * vColor * 2.0;\n col.a = clamp(col.a,0.0,1.0);\n gl_FragColor = col;\n}\n\n",ov="\n uniform sampler2D mainTex;\n varying vec4 _TintColor;\n varying vec4 vColor;\n varying vec2 vUv;\n void main()\n {\n vec4 texColor = texture2D(mainTex,vUv.xy);\n vec3 col = texColor.xyz * vColor.xyz * _TintColor.xyz * 2.0;\n float a = (1 - texColor.w) * (_TintColor.w * vColor.w * 2.0);\n gl_FragColor = vec4(col.xyz,a);\n }\n\n",sv="\nuniform sampler2D mainTex;\nvarying vec4 vColor;\nvarying vec2 vUv;\nvoid main()\n{\n vec4 texColor = texture2D(mainTex,vUv.xy);\n vec4 col = texColor * vColor;\n col = lerp(vec4(1,1,1,1),col,col.w);\n gl_FragColor = col;\n}\n \n",lv="\n uniform sampler2D mainTex;\n varying vec4 vColor;\n varying vec2 vUv;\n void main()\n {\n vec4 col;\n vec4 texColor = texture2D(mainTex,vUv.xy);\n col.xyz = texColor.xyz * vColor.xyz * 2;\n col.w = vColor.w * texColor.w;\n col = lerp(vec4(0.5,0.5,0.5,0.5),col,col.a);\n gl_FragColor = col;\n }\n",Av="\n\n uniform sampler2D mainTex;\n varying vec4 vColor;\n varying vec2 vUv;\n void main()\n {\n vec4 texColor = texture2D(mainTex,vUv.xy);\n gl_FragColor = vColor * texColor * vColor.a;\n }\n",cv=function(){function e(){s(this,e)}return A(e,null,[{key:"randomValue",value:function(e,t){var n=Math.random();return Hh.lerp(e,t,n)}},{key:"randomVector3",value:function(e,t){return new at(this.randomValue(e.x,t.x),this.randomValue(e.y,t.y),this.randomValue(e.z,t.z))}},{key:"randomVector4",value:function(e,t){var n=Math.random();return e.lerp(t,n)}},{key:"getShader",value:function(e){return"normal_vertex"===e?nv:"normal_fragment"===e?iv:"normal_legacy_vertex"===e?rv:"normal_legacy_fragment"===e?av:"multily_legacy_fragment"===e?ov:"multipy_fragment"===e?sv:"multiplyDouble_fragment"===e?lv:"premultiplyBlend_fragment"===e?Av:""}},{key:"getShaderBlend",value:function(e){return"SrcAlpha"===e?P:"OneMinusSrcAlpha"===e?U:"One"===e?F:"DstColor"===e?R:"Zero"===e?L:"SrcColor"===e?k:F}}]),e}(),hv=function(){function e(t){s(this,e),null!=t?this.setJsonData(t):(this.times=[],this.values=[],this.currentIndex=0)}return A(e,[{key:"setJsonData",value:function(e){this.times=e.times,this.values=e.values,this.currentIndex=0}},{key:"getValue",value:function(e){var t=this.times.length;if(this.currentIndex<t-1&&this.times[this.currentIndex]<=e&&this.times[this.currentIndex+1]>=e)return Hh.lerp(this.values[this.currentIndex],this.values[this.currentIndex+1],(e-this.times[this.currentIndex])/(this.times[this.currentIndex+1]-this.times[this.currentIndex]));for(var n=0;n<t;n++){if(!(n<t-1))return this.currentIndex=n,this.values[n];if(this.times[n]<=e&&this.times[n+1]>=e)return this.currentIndex=n,Hh.lerp(this.values[n],this.values[n+1],(e-this.times[n])/(this.times[n+1]-this.times[n]))}return 0}}]),e}(),uv=function(){function e(t){s(this,e),null!=t?this.setJsonData(t):(this.m_Mode=e.TYPE.Constant,this.m_ConstantMin=0,this.m_ConstantMax=0,this.m_CurveMin=null,this.m_CurveMax=null)}return A(e,[{key:"setJsonData",value:function(t){this.m_Mode=t.mode,this.m_Mode===e.TYPE.Constant?this.setConstantValue(t.max):this.m_Mode===e.TYPE.TwoConstants?this.setConstantMinMax(t.min,t.max):this.m_Mode===e.TYPE.Curve?this.setCurves(new hv(t.maxCurve)):this.m_Mode===e.TYPE.TwoCurves&&this.setCurvesMinMax(new hv(t.minCurve),new hv(t.maxCurve))}},{key:"setConstantValue",value:function(t){this.m_Mode=e.TYPE.Constant,this.m_ConstantMin=0,this.m_ConstantMax=t,this.m_CurveMin=null,this.m_CurveMax=null}},{key:"setConstantMinMax",value:function(t,n){this.m_Mode=e.TYPE.TwoConstants,this.m_ConstantMin=t,this.m_ConstantMax=n,this.m_CurveMin=null,this.m_CurveMax=null}},{key:"setCurves",value:function(t){this.m_Mode=e.TYPE.Curve,this.m_CurveMax=t,this.m_CurveMin=null}},{key:"setCurvesMinMax",value:function(t,n){this.m_Mode=e.TYPE.TwoCurves,this.m_CurveMin=t,this.m_CurveMax=n}},{key:"getRandomValue",value:function(t){if(this.m_Mode==e.TYPE.Constant)return this.m_ConstantMax;if(this.m_Mode==e.TYPE.TwoConstants)return cv.randomValue(this.m_ConstantMin,this.m_ConstantMax);if(this.m_Mode==e.TYPE.Curve)return this.m_CurveMax.getValue(t);if(this.m_Mode==e.TYPE.TwoCurves){var n=Math.random(),i=this.m_CurveMin.getValue(t),r=this.m_CurveMax.getValue(t);return n>.5?r:i}return 0}}]),e}();uv.TYPE=Object.freeze({Constant:0,Curve:1,TwoCurves:2,TwoConstants:3});var dv=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),(i=t.call(this)).isActive=!0,null!=e?i.setJsonData(e):(i.rateOverTime=new uv,i.rateOverTime.setConstantValue(5)),i.density=1,i.rateOverTimeResult=i.rateOverTime.getRandomValue(),i.secondParticle=i.rateOverTimeResult*i.density,i.singleTime=1/i.secondParticle,i.playBackTime=0,i.cacheTime=0,i.createParticleCount=0,i}return A(n,[{key:"setJsonData",value:function(e){this.rateOverTime=new uv(e.rateOverTime)}},{key:"setDensity",value:function(e){this.density=e,this.secondParticle=this.rateOverTimeResult*this.density,0==this.secondParticle?this.singleTime=99999999:this.singleTime=1/this.secondParticle}},{key:"update",value:function(e,t){this.playBackTime+=e,this.cacheTime+=e,this.cacheTime>=this.singleTime&&(this.createParticleCount=Math.floor(this.cacheTime/this.singleTime),this.cacheTime=this.cacheTime%this.singleTime)}},{key:"reset",value:function(){b(u(n.prototype),"reset",this).call(this),this.createParticleCount=0}}]),n}(tv),fv=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),(i=t.call(this)).isActive=!0,null!=e?i.setJsonData(e):(i.shape=n.TYPE.Box,i.angle=25,i.radius=1,i.radiusThickness=1,i.donutRadius=.2,i.position=new at(0,0,0),i.rotation=new Bt(0,0,0),i.scale=new at(1,1,1)),i.startPosition=new at(0,0,0),i.moveDirection=new at(0,0,0),i}return A(n,[{key:"setJsonData",value:function(e){this.shape=e.shapeMode,this.shape===n.TYPE.Cone&&(this.angle=e.cone.angle,this.radius=e.cone.radius,this.radiusThickness=e.cone.radiusThickness),this.position=new at(e.position.x,e.position.y,e.position.z),this.rotation=new Bt(e.rotation.x,e.rotation.y,e.rotation.z),this.scale=new at(e.scale.x,e.scale.y,e.scale.z)}},{key:"update",value:function(e,t){if(b(u(n.prototype),"update",this).call(this,e,t),this.shape==n.TYPE.Cone){var i=Hh.lerp(0,this.angle,1-this.radiusThickness),r=et.degToRad(cv.randomValue(i,this.angle)),a=et.degToRad(cv.randomValue(0,360)),o=Math.sin(r);this.moveDirection=new at(o*Math.cos(a),Math.cos(r),o*Math.sin(a));var s=et.degToRad(cv.randomValue(0,360)),l=cv.randomValue(0,this.radius);this.startPosition=new at(Math.cos(s)*l,0,Math.sin(s)*l),this.startPosition=this.startPosition.multiply(this.scale).add(this.position),this.moveDirection.applyEuler(this.rotation).multiply(this.scale)}else if(this.shape==n.TYPE.Box){var A=this.scale.clone().multiplyScalar(.5);this.startPosition=cv.randomVector3(new at(-A.x,-A.y,-A.z),new at(A.x,A.y,A.z)),this.moveDirection.y=1,this.moveDirection.applyEuler(this.rotation)}}},{key:"reset",value:function(){b(u(n.prototype),"reset",this).call(this),this.startPosition.setScalar(0),this.moveDirection.setScalar(0)}}]),n}(tv);fv.TYPE=Object.freeze({Sphere:0,Hemisphere:2,Cone:4,Box:5,Circle:10});var pv=function(){function e(t){s(this,e),null!=t?this.setJsonData(t):(this.colorLocation=[],this.colors=[],this.alphaLocation=[],this.alphas=[])}return A(e,[{key:"setJsonData",value:function(e){this.colorLocation=e.colorLocation,this.colors=[];for(var t=0;t<e.colors.length;t++)this.colors[t]=new ut(e.colors[t].r,e.colors[t].g,e.colors[t].b,e.colors[t].a);this.alphaLocation=e.alphaLocation,this.alphas=e.alphas}},{key:"getValue",value:function(e){var t=this.lerp(e,this.colorLocation,this.colors),n=this.lerp(e,this.alphaLocation,this.alphas);return new ut(t.x,t.y,t.z,n)}},{key:"lerp",value:function(e,t,n){for(var i=0;i<t.length;i++){if(t[i]>=e&&0===i)return"number"==typeof n[i]?n[i]:n[i].clone();if(i<t.length-1&&t[i]<=e&&t[i+1]>e){var a=(e-t[i])/(t[i+1]-t[i]);return"number"==typeof n[i]?n[i]+(n[i+1]-n[i])*a:n[i].clone().lerp(n[i+1],a)}}return r("number"==n[n.length-1])?n[n.length-1]:n[n.length-1].clone()}}]),e}(),mv=function(){function e(t){s(this,e),null!=t?this.setJsonData(t):(this.m_mode=e.TYPE.Color,this.minColor=null,this.maxColor=new ut(1,1,1,1),this.minGradient=null,this.maxGradient=null)}return A(e,[{key:"setJsonData",value:function(t){if(this.m_mode=t.m_mode,this.m_mode===e.TYPE.Color)this.setColor(new ut(t.maxColor.r,t.maxColor.g,t.maxColor.b,t.maxColor.a));else if(this.m_mode===e.TYPE.TwoColors){var n=new ut(t.minColor.r,t.minColor.g,t.minColor.b,t.minColor.a),i=new ut(t.maxColor.r,t.maxColor.g,t.maxColor.b,t.maxColor.a);this.setColorMinMax(n,i)}else this.m_mode===e.TYPE.Gradient?this.setGradient(new pv(t.maxGradient)):this.m_mode===e.TYPE.TwoGradients&&this.setMinMaxGradient(new pv(t.minGradient),new pv(t.maxGradient))}},{key:"setColorMinMax",value:function(t,n){this.m_mode=e.TYPE.TwoColors,this.minColor=t,this.maxColor=n}},{key:"setGradient",value:function(t){this.m_mode=e.TYPE.Gradient,this.maxGradient=t}},{key:"setMinMaxGradient",value:function(t,n){this.m_mode=e.TYPE.TwoGradients,this.minGradient=t,this.maxGradient=n}},{key:"setColor",value:function(t){this.m_mode=e.TYPE.Color,this.minColor=null,this.maxColor=t}},{key:"getRandomValue",value:function(){if(this.m_mode==e.TYPE.Color)return this.maxColor;if(this.m_mode==e.TYPE.Gradient)return this.maxGradient.getValue(Math.random());if(this.m_mode==e.TYPE.TwoGradients){var t=Math.random(),n=this.minGradient.getValue(t),i=this.maxGradient.getValue(t);return cv.randomVector4(n,i)}return this.m_mode==e.TYPE.TwoColors?cv.randomVector4(this.minColor,this.maxColor):this.m_mode==e.TYPE.RandomColor?this.maxGradient.getValue(Math.random()):this.maxColor}},{key:"getLerpValue",value:function(t){if(this.m_mode==e.TYPE.Gradient)return this.maxGradient.getValue(t);if(this.m_mode==e.TYPE.TwoGradients){var n=Math.random(),i=this.minGradient.getValue(n),r=this.maxGradient.getValue(n);return n>.5?r:i}return this.maxColor}}]),e}();mv.TYPE=Object.freeze({Color:0,Gradient:1,TwoColors:2,TwoGradients:3,RandomColor:4});var vv=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),(i=t.call(this)).isActive=!0,i.duration=e.duration,i.isLoop=e.isLoop,i.startDelay=new uv(e.startDelay),i.startLifeTime=new uv(e.startLifeTime),i.startSpeed=new uv(e.startSpeed),i.startSize=new uv(e.startSize),i.startRotation=new uv(e.startRotation),i.startColor=new mv(e.startColor),i.gravityModifier=new uv(e.gravity),i.maxParticles=1e4,i}return A(n,[{key:"initParticleItem",value:function(e){e.startDelay=this.startDelay.getRandomValue(),e.lifeTime=this.startLifeTime.getRandomValue();var t=this.startSpeed.getRandomValue();e.startSpeed=new at(t,t,t),e.startSize=this.startSize.getRandomValue(),e.startRotation=this.startRotation.getRandomValue(),e.startColor=this.startColor.getRandomValue(),e.gravityModifier=this.gravityModifier.getRandomValue(),e.refresh()}},{key:"update",value:function(e,t){b(u(n.prototype),"update",this).call(this,e,t),t.setScaleXYZ(t.startSize,t.startSize,t.startSize),t.color=t.startColor.clone(),t.speed=t.moveDirection.clone().add(t.startSpeed),t.speed.add(new at(0,4.905*-t.gravityModifier*2*t.currentTime,0))}}]),n}(tv),gv=function(){function e(t){s(this,e),this.particleCount=t,this.bufferGeometry=null,this.material=null,this.mesh=null}return A(e,[{key:"init",value:function(){this.bufferGeometry=new si}},{key:"setColor",value:function(e,t){}},{key:"setPosition",value:function(e,t,n,i){}},{key:"setScale",value:function(e,t,n){}},{key:"setRotation",value:function(e,t,n,i){}},{key:"setAlpha",value:function(){}}]),e}();gv.RenderMode=Object.freeze({Billboard:0,StretchedBillboard:1,HorizontalBillboard:2,VerticalBillboard:3});var yv=function(){function e(t){s(this,e),this.particleSystem=t,this.index=0,this.render=null,this.startDelay=0,this.lifeTime=0,this.startSpeed=1,this.startSize=1,this.startColor=new ut(1,1,1,1),this.gravityModifier=0,this.startRotation=0,this.startPosition=new at(0,0,0),this.moveDirection=new at(0,0,0),this.active=!0,this.currentTime=0,this.pos0=new at(0,0,0),this.pos1=new at(0,0,0),this.pos2=new at(0,0,0),this.pos3=new at(0,0,0),this.speed=new at(1,1,1),this.rotationSpeed=new at(0,0,0),this.position=this.startPosition.clone(),this.rotation=new at(0,0,0),this.scale=new at(1,1,1),this.camera=null,this.localMatrix=new bt,this.moveMatrix=new bt,this.scaleMatrix=(new bt).makeScale(1,1,1),this.rotationEuler=new Bt(0,0,0),this.billboardRotationEuler=new Bt(0,0,0),this.startRotationEuler=new Bt(0,0,et.degToRad(this.startRotation)),this.directionEuler=new Bt(0,0,0),this.color=this.startColor.clone(),this.isDirty=!0,this.isColorDirty=!0,this.texStartFrame=0}return A(e,[{key:"setCamera",value:function(e){this.camera=e}},{key:"initRender",value:function(e,t){this.render=e,this.camera=t,this.pos0=new at(-this.render.width,-this.render.height,0),this.pos1=new at(this.render.width,-this.render.height,0),this.pos2=new at(this.render.width,this.render.height,0),this.pos3=new at(-this.render.width,this.render.height,0)}},{key:"refresh",value:function(){this.color=this.startColor.clone(),this.startRotationEuler=new Bt(0,0,et.degToRad(this.startRotation))}},{key:"setStartPosition",value:function(e){this.startPosition=e,this.setRotation(new at(0,0,0)),this.setPosition(this.startPosition.clone())}},{key:"setActive",value:function(e){this.active!=e&&(this.active=e,this.active?this.render.setColor(this.index,this.color):this.render.setColor(this.index,new ut(this.color.x,this.color.y,this.color.z,0)))}},{key:"reset",value:function(){this.currentTime=0,this.scale.set(1,1,1),this.rotation.set(0,0,0),this.rotationEuler.set(0,0,0),this.isDirty=!1,this.isColorDirty=!1,this.position.set(0,0,0),this.texStartFrame=0}},{key:"update",value:function(e){if(this.currentTime+=e,this.currentTime>=this.lifeTime)return this.setActive(!1),void this.reset();this.rotation.addScaledVector(this.rotationSpeed,e),this.setRotationAngleXYZ(this.rotation.x,this.rotation.y,this.rotation.z),this.position.add(this.speed.multiplyScalar(e)),this.setPosition(this.position),this.billboard(),!0===this.isDirty&&this.refreshMatrix(),!0===this.isColorDirty&&this.render.setColor(this.index,this.color)}},{key:"billboard",value:function(){if(null!=this.camera){var e=new at(0,0,0);this.camera.getWorldDirection(e),e.add(this.camera.position),e=this.particleSystem.worldToLocal(e);var t=this.particleSystem.worldToLocal(this.camera.position.clone());this.render.renderMode==gv.RenderMode.StretchedBillboard&&e.setY(t.y);var n=new bt;n.lookAt(t,e,new at(0,1,0));var i=new nt;i.setFromRotationMatrix(n),this.billboardRotationEuler.set(0,0,0),this.billboardRotationEuler.setFromQuaternion(i)}}},{key:"refreshMatrix",value:function(){this.localMatrix=this.scaleMatrix.clone(),this.localMatrix.premultiply(this.moveMatrix);var e=this.pos0.clone().applyEuler(this.startRotationEuler).applyEuler(this.rotationEuler).applyEuler(this.billboardRotationEuler).applyMatrix4(this.localMatrix),t=this.pos1.clone().applyEuler(this.startRotationEuler).applyEuler(this.rotationEuler).applyEuler(this.billboardRotationEuler).applyMatrix4(this.localMatrix),n=this.pos2.clone().applyEuler(this.startRotationEuler).applyEuler(this.rotationEuler).applyEuler(this.billboardRotationEuler).applyMatrix4(this.localMatrix),i=this.pos3.clone().applyEuler(this.startRotationEuler).applyEuler(this.rotationEuler).applyEuler(this.billboardRotationEuler).applyMatrix4(this.localMatrix);this.render.setPosition(4*this.index,e),this.render.setPosition(4*this.index+1,t),this.render.setPosition(4*this.index+2,n),this.render.setPosition(4*this.index+3,i),this.render.refreshPosition()}},{key:"setPosition",value:function(e){this.position.x==e&&this.position.y==e.y&&this.position.z==e.z||(this.position=e,this.moveMatrix.makeTranslation(this.position.x,this.position.y,this.position.z),this.isDirty=!0)}},{key:"setScale",value:function(e){this.setScaleXYZ(e.x,e.y,e.z)}},{key:"setScaleXYZ",value:function(e,t,n){this.scale.x==e&&this.scale.y==t&&this.scale.z==n||(this.scale.set(e,t,n),this.scaleMatrix.makeScale(this.scale.x,this.scale.y,this.scale.z),this.isDirty=!0)}},{key:"setRotationAngleXYZ",value:function(e,t,n){this.setRotationXYZ(et.degToRad(e),et.degToRad(t),et.degToRad(n))}},{key:"setRotation",value:function(e){this.setRotationXYZ(e.x,e.y,e.z)}},{key:"setRotationXYZ",value:function(e,t,n){this.rotationEuler.x==e&&this.rotationEuler.y==t&&this.rotationEuler.z==n||(this.rotation.set(et.radToDeg(e),et.radToDeg(t),et.radToDeg(n)),this.rotationEuler.set(e,t,n),this.isDirty=!0)}},{key:"setColor",value:function(e){this.color.x===e.x&&this.color.y===e.y&&this.color.z===e.z&&this.color.w===e.w||(this.color=e,this.isColorDirty=!0)}},{key:"multiplyColor",value:function(e){this.color.multiply(e),this.isColorDirty=!0}},{key:"setUVs",value:function(e,t){this.render.setUV(this.index,e,t)}}]),e}(),wv=function(e){h(n,e);var t=y(n);function n(e,i){var r;return s(this,n),(r=t.call(this,e)).width=.5,r.height=.5,r.mainTexture=null,r.renderMode=n.RenderMode.Billboard,null!=i?(""==i.texName?r.texPath="glow.png":r.texPath=i.texName,r.vertexShaderName=cv.getShader(i.vertexShaderName),r.fragmentShaderName=cv.getShader(i.fragmentShaderName),r.blendSrc=cv.getShaderBlend(i.blendSrc),r.blendDst=cv.getShaderBlend(i.blendDst),r.renderMode=i.renderMode,r.renderMode==gv.RenderMode.StretchedBillboard?r.lengthScale=i.lengthScale:r.lengthScale=1,null!=i.matColor&&(r.matColor=new ut(i.matColor.r,i.matColor.g,i.matColor.b,i.matColor.a))):(r.texPath="glow.png",r.lengthScale=1,r.vertexShaderName=cv.getShader("normal_vertex"),r.fragmentShaderName=cv.getShader("normal_fragment"),r.blendSrc=cv.getShaderBlend("SrcAlpha"),r.blendDst=cv.getShaderBlend("OneMinusSrcAlpha")),r.height*=r.lengthScale,r.init(),r}return A(n,[{key:"init",value:function(){b(u(n.prototype),"init",this).call(this),this.mainTexture=(new tA).load(this.texPath);for(var e=[],t=[],i=[],r=[],a=0;a<this.particleCount;a++){e.push(-this.width,-this.height,0),e.push(this.width,-this.height,0),e.push(this.width,this.height,0),e.push(-this.width,this.height,0);var o=4*a;i.push(o,o+1,o+2),i.push(o,o+2,o+3),r.push(0,0),r.push(1,0),r.push(1,1),r.push(0,1),t.push(1,1,1,1),t.push(1,1,1,1),t.push(1,1,1,1),t.push(1,1,1,1)}this.bufferGeometry.setIndex(i),this.bufferGeometry.setAttribute("position",new Yn(e,3)),this.bufferGeometry.setAttribute("vertexColor",new Yn(t,4)),this.bufferGeometry.setAttribute("uv",new Yn(r,2));var s={};s.mainTex={value:this.mainTexture},null!=this.matColor&&(s._TintColor={value:this.matColor}),this.material=new Ri({uniforms:s,vertexShader:this.vertexShaderName,fragmentShader:this.fragmentShaderName,transparent:!0,blending:5,blendSrc:this.blendSrc,blendDst:this.blendDst,vertexColors:!0,depthWrite:!1}),this.mesh=new Ei(this.bufferGeometry,this.material),this.mesh.renderOrder=2e3,this.mesh.frustumCulled=!1}},{key:"setColor",value:function(e,t){this.bufferGeometry.attributes.vertexColor.setXYZW(4*e,t.x,t.y,t.z,t.w),this.bufferGeometry.attributes.vertexColor.setXYZW(4*e+1,t.x,t.y,t.z,t.w),this.bufferGeometry.attributes.vertexColor.setXYZW(4*e+2,t.x,t.y,t.z,t.w),this.bufferGeometry.attributes.vertexColor.setXYZW(4*e+3,t.x,t.y,t.z,t.w),this.bufferGeometry.attributes.vertexColor.needsUpdate=!0}},{key:"setPosition",value:function(e,t){this.bufferGeometry.attributes.position.setXYZ(e,t.x,t.y,t.z)}},{key:"refreshPosition",value:function(){this.bufferGeometry.attributes.position.needsUpdate=!0}},{key:"setUV",value:function(e,t,n){this.bufferGeometry.attributes.uv.setXY(4*e,t.x,t.y),this.bufferGeometry.attributes.uv.setXY(4*e+1,n.x,t.y),this.bufferGeometry.attributes.uv.setXY(4*e+2,n.x,n.y),this.bufferGeometry.attributes.uv.setXY(4*e+3,t.x,n.y),this.bufferGeometry.attributes.uv.needsUpdate=!0}}]),n}(gv),xv=function(e){h(n,e);var t=y(n);function n(e){var i;if(s(this,n),i=t.call(this),null!=e)i.color=new mv(e.color);else{i.color=new mv;var r=new pv;r.colorLocation=[0,1],r.colors=[new at(1,1,1),new at(1,0,0)],r.alphaLocation=[0,1],r.alphas=[1,1],i.color.setGradient(r)}return i}return A(n,[{key:"update",value:function(e,t){b(u(n.prototype),"update",this).call(this,e,t);var i=t.currentTime/t.lifeTime;i=Hh.clamp(i,0,1);var r=this.color.getLerpValue(i);t.multiplyColor(r)}}]),n}(tv),bv=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),i=t.call(this),null!=e?(i.linearSpeedX=new uv(e.linearX),i.linearSpeedY=new uv(e.linearY),i.linearSpeedZ=new uv(e.linearZ)):(i.linearSpeedX=new uv,i.linearSpeedY=new uv,i.linearSpeedZ=new uv,i.linearSpeedX.setConstantValue(10)),i.speedVec=new at(0,0,0),i.linearSpeedX.m_Mode===uv.TYPE.TwoCurves||i.linearSpeedX.m_Mode===uv.TYPE.Curve?i.isCurve=!0:i.isCurve=!1,i}return A(n,[{key:"initParticleItem",value:function(e){b(u(n.prototype),"initParticleItem",this).call(this,e),!1===this.isCurve&&(this.speedVec.set(0,0,0),this.speedVec.set(this.linearSpeedX.getRandomValue(),this.linearSpeedY.getRandomValue(),this.linearSpeedZ.getRandomValue()),e.startSpeed.add(this.speedVec))}},{key:"update",value:function(e,t){b(u(n.prototype),"update",this).call(this,e,t),!0===this.isCurve&&(this.speedVec.set(this.linearSpeedX.getRandomValue(e),this.linearSpeedY.getRandomValue(e),this.linearSpeedZ.getRandomValue(e)),t.speed.add(this.speedVec))}},{key:"reset",value:function(){b(u(n.prototype),"reset",this).call(this),this.speedVec.set(0,0,0)}}]),n}(tv),Mv=function(e){h(n,e);var t=y(n);function n(){var e;return s(this,n),(e=t.call(this)).x=new uv,e.x.setConstantValue(5),e.y=new uv,e.z=new uv,e}return A(n,[{key:"update",value:function(e,t){b(u(n.prototype),"update",this).call(this,e,t);var i=t.currentTime/t.lifeTime,r=this.x.getRandomValue(i)*t.currentTime,a=this.y.getRandomValue(i)*t.currentTime,o=this.z.getRandomValue(i)*t.currentTime;t.speed.set(t.speed.x+r,t.speed.y+a,t.speed.z+o)}}]),n}(tv),Cv=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),i=t.call(this),null!=e?(null!=e.rx?i.rCurveX=new uv(e.rx):i.rCurveX=new uv,null!=e.ry?i.rCurveY=new uv(e.ry):i.rCurveY=new uv,null!=e.rz?i.rCurveZ=new uv(e.rz):i.rCurveZ=new uv):(i.rCurveX=new uv,i.rCurveY=new uv,i.rCurveZ=new uv),i.rCurveZ.m_Mode===uv.TYPE.Constant||i.rCurveZ.m_Mode===uv.TYPE.TwoConstants?i.isCurve=!1:i.isCurve=!0,i}return A(n,[{key:"initParticleItem",value:function(e){var t=this.rCurveX.getRandomValue(),n=this.rCurveY.getRandomValue(),i=this.rCurveZ.getRandomValue();e.rotationSpeed.set(t,n,i)}},{key:"update",value:function(e,t){if(b(u(n.prototype),"update",this).call(this,e,t),this.isCurve){var i=t.currentTime/t.lifeTime,r=this.rCurveX.getRandomValue(i),a=this.rCurveY.getRandomValue(i),o=this.rCurveZ.getRandomValue(i);t.rotationSpeed.set(r,a,o)}}}]),n}(tv),Bv=function(e){h(n,e);var t=y(n);function n(e){var i;if(s(this,n),i=t.call(this),null!=e)i.tileX=e.tileX,i.tileY=e.tileY,i.animation=e.animationMode,i.rowMode=e.rowMode,i.row=e.row,i.timeMode=e.timeMode,i.frameOverTime=new uv(e.frameOverTime),i.startFrame=new uv(e.startFrame),i.cycles=e.cycles,null!=e.speedRange&&(i.speedRange=new tt(e.speedRange.x,e.speedRange.y));else{i.tileX=8,i.tileY=8,i.animation=n.Animation.WholeSheet,i.rowMode=n.RowMode.Random,i.row=0,i.timeMode=n.TimeMode.LifeTime,i.frameOverTime=new uv;var r=new hv;r.times=[0,1],r.values=[0,1],i.frameOverTime.setCurves(r),i.speedRange=new tt(0,1),i.startFrame=new uv,i.startFrame.setConstantValue(0),i.cycles=1}return i}return A(n,[{key:"initParticleItem",value:function(e){b(u(n.prototype),"initParticleItem",this).call(this,e),e.texStartFrame=this.startFrame.getRandomValue()}},{key:"update",value:function(e,t){b(u(n.prototype),"update",this).call(this,e,t);var i,r,a=t.currentTime/t.lifeTime,o=0,s=0;if(this.animation===n.Animation.WholeSheet)o=0,s=this.tileX*this.tileY;else if(this.animation===n.Animation.SingleRow){var l=0;this.rowMode===n.RowMode.Custom?l=this.row:this.rowMode==n.RowMode.Random&&(l=Math.random()*this.tileX),o=l*this.tileY,s=l*this.tileY+this.tileX}var A=0,c=s-o;if(this.timeMode==n.TimeMode.LifeTime){var h=this.frameOverTime.getRandomValue(a)*this.cycles;A=parseInt(h*c)}else if(this.timeMode==n.TimeMode.Speed){var d=(t.speed.length()-this.speedRange.x)/(this.speedRange.y-this.speedRange.x);d=Hh.clamp(d*this.cycles,0,1),A=parseInt(c*d)}r=(A+=t.texStartFrame)-(i=parseInt(A/this.tileY))*this.tileY,t.setUVs(new tt(r/this.tileY,(this.tileX-i-1)/this.tileX),new tt((r+1)/this.tileY,(this.tileX-i)/this.tileX))}}]),n}(tv);Bv.Animation=Object.freeze({WholeSheet:0,SingleRow:1}),Bv.RowMode=Object.freeze({Custom:0,Random:1}),Bv.TimeMode=Object.freeze({LifeTime:0,Speed:1});var Ev=function(e){h(n,e);var t=y(n);function n(){var e;return s(this,n),(e=t.call(this)).dampen=0,e.speedLimitX=new uv,e.speedLimitY=new uv,e.speedLimitZ=new uv,e}return A(n,[{key:"update",value:function(e,t){b(u(n.prototype),"update",this).call(this,e,t);var i=t.currentTime/t.lifeTime;i=Hh.clamp(i);var r=this.speedLimitX.getRandomValue(i),a=this.speedLimitY.getRandomValue(i),o=this.speedLimitZ.getRandomValue(i);r=Math.min(r,t.speed.x),a=Math.min(a,t.speed.y),o=Math.min(o,t.speed.z);var s=Hh.lerp(t.speed.x,r,this.dampen),l=Hh.lerp(t.speed.y,a,this.dampen),A=Hh.lerp(t.speed.z,o,this.dampen);t.speed.set(s,l,A)}}]),n}(tv),Sv=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),i=t.call(this),null!=e?!0===e.separateAxes?(i.sizeCurveX=new uv(e.sizeX),i.sizeCurveY=new uv(e.sizeY),i.sizeCurveZ=new uv(e.sizeZ)):(i.sizeCurveX=new uv(e.sizeX),i.sizeCurveY=new uv(e.sizeX),i.sizeCurveZ=new uv(e.sizeX)):(i.sizeCurveX=new uv,i.sizeCurveY=new uv,i.sizeCurveZ=new uv),i}return A(n,[{key:"update",value:function(e,t){b(u(n.prototype),"update",this).call(this,e,t);var i=t.currentTime/t.lifeTime,r=this.sizeCurveX.getRandomValue(i),a=this.sizeCurveY.getRandomValue(i),o=this.sizeCurveZ.getRandomValue(i);t.setScaleXYZ(t.scale.x*r,t.scale.y*a,t.scale.z*o)}}]),n}(tv),Tv=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),(i=t.call(this)).render=null,i.camera=null,i.initParticleData(e),i}return A(n,[{key:"initParticleData",value:function(e){this.mainModule=new vv(e.main),this.emissionModule=new dv(e.emission),this.shapeModule=new fv(e.shape),this.statusModules=[this.mainModule],null!=e.velocityLifeTime&&(this.velocityLifetimeModule=new bv(e.velocityLifeTime),this.velocityLifetimeModule.isActive=!0,this.statusModules.push(this.velocityLifetimeModule)),null!=e.limitVelocityLifeTime&&(this.limitVelocityLifeTimeModule=new Ev(e.limitVelocityLifeTime),this.limitVelocityLifeTimeModule.isActive=!0,this.statusModules.push(this.limitVelocityLifeTimeModule)),null!=e.forceLifeTime&&(this.forceLifeTimeModule=new Mv(e.forceLifeTime),this.forceLifeTimeModule.isActive=!0,this.statusModules.push(this.forceLifeTimeModule)),null!=e.colorLifeTime&&(this.colorLifeTimeModule=new xv(e.colorLifeTime),this.colorLifeTimeModule.isActive=!0,this.statusModules.push(this.colorLifeTimeModule)),null!=e.sizeLifeTime&&(this.sizeLifeTimeModule=new Sv(e.sizeLifeTime),this.sizeLifeTimeModule.isActive=!0,this.statusModules.push(this.sizeLifeTimeModule)),null!=e.rotationLifeTime&&(this.rotationLifeTimeModule=new Cv(e.rotationLifeTime),this.rotationLifeTimeModule.isActive=!0,this.statusModules.push(this.rotationLifeTimeModule)),null!=e.texSheetAnimation&&(this.texSheetAnimationModule=new Bv(e.texSheetAnimation),this.texSheetAnimationModule.isActive=!0,this.statusModules.push(this.texSheetAnimationModule)),this.clock=new lc,this.totalParticleCount=this.mainModule.duration*this.emissionModule.secondParticle,this.totalParticleCount>this.mainModule.maxParticles&&(this.totalParticleCount=this.mainModule.maxParticles),this.render=new wv(this.totalParticleCount,e.render),this.add(this.render.mesh),this.itemPool=[],this.activeItemArray=[],this.removeItemArray=[],this.totalTime=0}},{key:"init",value:function(e){this.camera=e;for(var t=0;t<this.totalParticleCount;t++){var n=new yv(this);n.index=t,n.initRender(this.render,this.camera),n.setActive(!1),this.itemPool.push(n)}}},{key:"onBeforeRender",value:function(e,t,n){this.activeItemArray.map((function(e){e.setCamera(n)}))}},{key:"getItemByPool",value:function(){return this.itemPool.length>0?this.itemPool.pop():null}},{key:"pushItemToPool",value:function(e){this.itemPool.push(e)}},{key:"setDensity",value:function(e){this.emissionModule.setDensity(e);var t=this.mainModule.duration*this.emissionModule.secondParticle;if(t>this.mainModule.maxParticles&&(t=this.mainModule.maxParticles),t>this.totalParticleCount){for(var n=this.totalParticleCount;n<t;n++){var i=new yv(this);i.index=n,i.initRender(this.render,this.camera),i.setActive(!1),this.itemPool.push(i)}this.totalParticleCount=t}}},{key:"update",value:function(){var e=this.clock.getDelta();this.emissionModule.update(e,null);var t=this.emissionModule.createParticleCount;if(t>0)for(var n=0;n<t;n++){var i=this.getItemByPool();if(null==i)break;this.shapeModule.update(e,null),i.setStartPosition(this.shapeModule.startPosition.clone()),i.moveDirection=this.shapeModule.moveDirection.clone(),i.setActive(!0);for(var r=0;r<this.statusModules.length;r++)this.statusModules[r].isActive&&(this.statusModules[r].initParticleItem(i),this.statusModules[r].reset());this.activeItemArray.push(i),this.shapeModule.reset()}this.emissionModule.reset();for(var a=0;a<this.activeItemArray.length;a++){for(var o=this.activeItemArray[a],s=0;s<this.statusModules.length;s++)this.statusModules[s].isActive&&(this.statusModules[s].update(e,o),this.statusModules[s].reset());o.update(e),o.active||(this.removeItemArray.push(a),this.pushItemToPool(o))}for(var l=0;l<this.removeItemArray.length;l++)this.activeItemArray.splice(this.removeItemArray[l]-l,1);this.removeItemArray.splice(0,this.removeItemArray.length)}}]),n}(zt),_v=function(){function e(){s(this,e)}return A(e,null,[{key:"pushItem",value:function(e){this.pItems.push(e)}},{key:"removeItem",value:function(t){for(var n=0;n<this.pItems.length;n++)e.pItems[n]==t&&e.pItems.unshift(t)}},{key:"update",value:function(){for(var e=0;e<this.pItems.length;e++)this.pItems[e].update()}}]),e}();_v.pItems=[];var Iv={nodes:[{id:0,parentId:-1,name:"Fire_Smoke",localPosition:[0,0,0],rotation:[0,0,0],scale:[1,1,1]},{id:1,parentId:0,name:"Fire_Smoke",localPosition:[0,0,0],rotation:[270,0,0],scale:[1,1,1],main:{duration:5,isLoop:!0,startDelay:{mode:0,min:0,max:0},startLifeTime:{mode:3,min:2,max:3},startSpeed:{mode:3,min:0,max:0},startSize:{mode:3,min:5,max:35},startRotation:{mode:3,min:0,max:360},startColor:{m_mode:0,minColor:null,maxColor:{r:1,g:1,b:1,a:.219607845}},gravity:{mode:0,min:0,max:0}},emission:{rateOverTime:{mode:0,min:0,max:100}},shape:{shapeMode:0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}},velocityLifeTime:{linearX:{mode:3,min:0,max:0},linearY:{mode:3,min:0,max:0},linearZ:{mode:3,min:15,max:10}},colorLifeTime:{color:{m_mode:1,minColor:null,maxColor:null,maxGradient:{colorLocation:[0,.314702064,.417639434,.497062624,1],colors:[{r:1,g:.8980392,b:.831372559,a:1},{r:1,g:.7607843,b:.5372549,a:1},{r:.9137255,g:.623529434,b:.4392157,a:1},{r:.7176471,g:.5176471,b:.4627451,a:1},{r:.192156866,g:.192156866,b:.192156866,a:1}],alphaLocation:[0,.0441138335,.323537052,.7058824,.855878532,1],alphas:[.305882365,1,.8862745,.9529412,.843137264,0]}}},sizeLifeTime:{separateAxes:!1,sizeX:{mode:1,min:0,max:0,maxCurve:{times:[0,.05,.1,.15,.2,.25,.3,.350000024,.400000036,.418660671,.468660682,.518660665,.5686607,.6186607,.6686607,.7186607,.7686607,.818660736,.868660748,.91866076,.9686608,1],values:[.2159091,.285781056,.359360576,.434577644,.5093622,.5816443,.6493538,.7104207,.762774944,.779661953,.8188196,.8507291,.8764641,.8970983,.91370517,.9273583,.939131439,.9500981,.961331844,.9739063,.988895059,1]}}},texSheetAnimation:{tileX:8,tileY:8,animationMode:0,rowMode:1,row:0,timeMode:0,frameOverTime:{mode:1,min:0,max:0,maxCurve:{times:[0,1],values:[0,1]}},startFrame:{mode:0,min:0,max:0},cycles:1},render:{renderMode:0,lengthScale:-.8,texName:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAABgUExURUxpcT09P0VERhYTFSIgJDU0Ni4tMERCRDk3OkxMTVZVVktJS0VFSFBPUVNSU1NSVCMjJ0ZFRykpLUAgHFYwKWVIRCkqL3c0H4ZNPKdOJ/OMQ9JpNqprTvu6Xf7oi//93AGig8AAAAAgdFJOUwAkO/77EP79/f37bFLPsI/P4aj+/v6B/v7+/v74/fz9Rhu3BgAAIABJREFUeNrsndtu47oOhiNNNI4tHxJbss7u+7/lJuWk0303lBewsAD+BXr32RJPop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Gcx6I0+Bq89+AfQ+Jx4PiEd8pjOvcxLTy2tw+FvBgQZ9MWHjti774nb855eVEbfvM4nlPAI1SSn/L1E54hFjhe4LUPxdbTlf787AL05wc9IeWK+Jj5WAk/K29KeIMVCx1IhI9BeDtjIgOnZIt5w5BY+PnnZ469eBFd+AM/gZ9CL514JwVbzrsXvuM+Cl0FPqlA8OaNn3HOooh37AKe/EP5AcdEJIynA3p+xOu3/rw87VE3hkcXC/TrYShOWvKsfB3kUVU92jL+Bt6Qn7rZOsnfko9qvaX50wSf/KOWOP4Kb1a8QWzdpwnEi7whL+0x87dzHhcbmTA8eYddKn1M3Xc5P/P9f8iPpXzWnzdx6KUB325RfjjpkZpL+vUWtysoPwo/X+Id18WHIfGzri/Fyzzl24Pkb2DAf+U7iT7mqm7DFR63Cyg/T+EGn+AqPwg/Ryk68nXdlb+/eeHnICOiDCbFZ3TVxHFGdWSmcNucHe6l+vPknQHP1WP0XPI+93iFv1lscVc+Zr7cAB223/fTkHlr+4u83g5BHqc5Yn8PV3gXsIV8tpmfuyu8tGCpP6k6y82GXCG9D1d4M/Qh8TjqH6fL93xYnNJz6wj32n1fEfzKY8cAdIWXAnyRfw/RXFJzHnDO0i0GFUMxTwNW3t2yCLQN9gpvFl79RpxPvsBbHCjWSSMT9R/Kbxlg8YeQeKv81auWDN//7xd80Zl95d0nvLnIx/Bicqe7AH5Fw/Fl69RV3nzAs9YDp1zcOsK/wmPZNPPpyqGrlRmH+Mklje6jCw71qoJPrhjEpOG/yDtOmn9wQd4G767zf2+A3GN6+ySZDy6o1Br4iHcf8ibajy4p/eiCy895dzJn/V9IH76/+5d585n9f3jJ7sf8N33TN33TN33TN33TN33TN33TN33TN33TN33TN/0v0j8m0RSUgYfWTQAAAABJRU5ErkJggg==",matColor:{r:1,g:1,b:1,a:1},vertexShaderName:"normal_legacy_vertex",fragmentShaderName:"normal_legacy_fragment",blendSrc:"SrcAlpha",blendDst:"OneMinusSrcAlpha"}}]},Lv={nodes:[{id:0,parentId:-1,name:"Rain",localPosition:[0,81.6,0],rotation:[0,0,0],scale:[1,1,1],main:{duration:5,isLoop:!0,startDelay:{mode:0,min:0,max:0},startLifeTime:{mode:0,min:0,max:5},startSpeed:{mode:0,min:0,max:0},startSize:{mode:3,min:.5,max:1},startRotation:{mode:0,min:0,max:0},startColor:{m_mode:2,minColor:{r:1,g:1,b:1,a:.65882355},maxColor:{r:.8584906,g:.8584906,b:.8584906,a:.68235296}},gravity:{mode:3,min:3,max:6}},emission:{rateOverTime:{mode:0,min:0,max:200}},shape:{shapeMode:5,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:50,y:10,z:50}},velocityLifeTime:{linearX:{mode:0,min:0,max:1},linearY:{mode:0,min:0,max:-60},linearZ:{mode:0,min:0,max:0}},colorLifeTime:{color:{m_mode:1,minColor:null,maxColor:null,maxGradient:{colorLocation:[0,1],colors:[{r:1,g:1,b:1,a:1},{r:1,g:1,b:1,a:1}],alphaLocation:[0,.314702064,1],alphas:[0,.929411769,.5019608]}}},sizeLifeTime:{separateAxes:!1,sizeX:{mode:1,min:0,max:0,maxCurve:{times:[0,1],values:[0,1]}}},render:{renderMode:1,lengthScale:8,texName:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAABCUExURUxpcefv99Xk9fL2+vL1+vf5/Pf6/fr8/e3z+ff6/Pj6/fb5/HKf1Nrl8fj5++/0+t7n8/b4+/f6/MXc9f////7+/zJK5OYAAAAUdFJOUwBZHIKS4sH+c+jZ1Acy9WlLo6sPMZpK9wAAAKhJREFUOMuVk9sSgyAMRFGBoCC9Jf//q61t0YnAdrqvObOuS2KM1mM1WMH+AJYZz0eWEQJWBH+DmAlG5JcGbMDs+vMLv3XtAvkDRJgAWVABOmVZ3hVa80QHIO0SD4AnlGATdTsoquu8q7nc6kXQDguO0ArBJ/3vMGugfnOvAV8Bk6jfrKtctUPjfhyOYMyAm95i7inENxcm5QLk1Lm7bxeuf30hEkW9b0/Z7BfgolafUQAAAABJRU5ErkJggg==",vertexShaderName:"normal_vertex",fragmentShaderName:"normal_fragment",blendSrc:"SrcAlpha",blendDst:"One"}}]},Fv={nodes:[{id:0,parentId:-1,name:"snow",localPosition:[.8075409,40,16.9335175],rotation:[0,0,0],scale:[1,1,1],main:{duration:10,isLoop:!0,startDelay:{mode:0,min:0,max:0},startLifeTime:{mode:0,min:0,max:10},startSpeed:{mode:0,min:0,max:0},startSize:{mode:3,min:.5,max:1},startRotation:{mode:3,min:0,max:360},startColor:{m_mode:0,minColor:null,maxColor:{r:.870588243,g:.9382724,b:.992156863,a:.4392157}},gravity:{mode:3,min:.3,max:.5}},emission:{rateOverTime:{mode:0,min:0,max:100}},shape:{shapeMode:5,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:50,y:50,z:50}},velocityLifeTime:{linearX:{mode:3,min:10,max:-10},linearY:{mode:3,min:0,max:0},linearZ:{mode:3,min:10,max:-10}},colorLifeTime:{color:{m_mode:1,minColor:null,maxColor:null,maxGradient:{colorLocation:[.0882429257,1],colors:[{r:1,g:1,b:1,a:1},{r:1,g:1,b:1,a:1}],alphaLocation:[0,.126466781,.8294194,1],alphas:[0,1,1,0]}}},rotationLifeTime:{rz:{mode:0,min:0,max:45}},render:{renderMode:0,lengthScale:2,texName:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAByUExURUxpcf///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////4wLXbUAAAAmdFJOUwCHSMjp2+4EsgKQ5KEkfsIQcyyZqWu70Bv71hVaNPcJ8kBS4GI6NWpSxQAAB2hJREFUWMPlV+mO2zwS/HjJNEWJonhpKNLW+f6vuCVnsTPOJECC3X8rBElsmM3q6urq1j///H8999vtdv8vTt9vwzQ8/zoCbr1d/w7j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rN2cIAvs3WusGsbqjXZ1uF5zUrseH3ROdmCNffcQFrASvNCO3Wv0fSmxFtdqSFIUWHq3/95YlMnLGALcNh/t7CWi7SXCeHN6/mTK//AMEwEm9PcbVh2L11PRVvs3iuyx0o0li+kAcX39x54EhZYaOPH3Lyae63jOOOt5xek/eptAZ40TrdPaWDcAMvtFfkbab95Ley+TH2kOnTXGndF/gVpv4nx9psfn39D2t+9tP6KtP/V8y8l0LzlAIvWOwAAAABJRU5ErkJggg==",vertexShaderName:"normal_vertex",fragmentShaderName:"normal_fragment",blendSrc:"SrcAlpha",blendDst:"One"}}]},kv={nodes:[{id:0,parentId:-1,name:"WaterSpray",localPosition:[0,0,0],rotation:[0,0,0],scale:[1,1,1],main:{duration:5,isLoop:!0,startDelay:{mode:0,min:0,max:0},startLifeTime:{mode:0,min:0,max:1.7},startSpeed:{mode:0,min:0,max:0},startSize:{mode:0,min:0,max:4},startRotation:{mode:3,min:0,max:360},startColor:{m_mode:0,minColor:null,maxColor:{r:1,g:1,b:1,a:1}},gravity:{mode:0,min:0,max:1}},emission:{rateOverTime:{mode:0,min:0,max:20}},shape:{shapeMode:5,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:.5,y:.5,z:.5}},velocityLifeTime:{linearX:{mode:0,min:0,max:12},linearY:{mode:0,min:0,max:1},linearZ:{mode:0,min:0,max:1}},colorLifeTime:{color:{m_mode:1,minColor:null,maxColor:null,maxGradient:{colorLocation:[0,1],colors:[{r:1,g:1,b:1,a:1},{r:1,g:1,b:1,a:1}],alphaLocation:[0,.23823911,.4735332,1],alphas:[0,1,1,0]}}},sizeLifeTime:{separateAxes:!1,sizeX:{mode:1,min:0,max:0,maxCurve:{times:[0,.05,.1,.15,.2,.25,.3,.350000024,.400000036,.450000048,.50000006,.5500001,.6000001,.6500001,.7000001,.7500001,.800000131,.850000143,.900000155,.950000167,1],values:[0,.0751110539,.149811536,.223729327,.2964923,.367728353,.437065363,.504131258,.568553865,.629961133,.687980831,.7422409,.7923693,.8379938,.8787424,.914242864,.944123149,.9680111,.9855346,.9963217,1]}}},render:{renderMode:0,lengthScale:2,texName:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAMAAABrrFhUAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAA8UExURf///////////////////////////0xpcf///////////////////////////////////////////////63zjJ0AAAAUdFJOUxEnZhRDD1YAIjQvdxqHmbJN/NEIXLxfpAAAIABJREFUeNrsXIna2ygMHDBg8B3n/d91uQ0YxyR/2r2ab79uGl9CSKPRgIv+v/ThHO99+BP9//zzxwF/HPDHAX8c8McBtc/zTwS8/Xl+zWtE8F4KKf9OB9iH8zfvxrZ/XXZeOwCf2JBcwD83Ssh/Qgrg78tKdeEA/rsx4P9QIvDiV3x2A/zLHYD2cQA9flO6Ar8dAxpOOqyCxH/LAciKwYuPP64EfmH44/djQAhsOdzjJJIpkjEzPjeanJ7Bhl/nlNdlkPOeKDRdbXwG5wDD4C4cwBog4/xA41H8Pge8kW5vl4CWe0cUVpVb4p+YXpDqJk9Q4MbLqGL+S6fs1LNLB3wFGPGFa2HszD2CzLwwlyfcqJFeDPaOc9eRXg+esb+HCqPFPzk4yWxqmoIdlB0zmTd/hNzZai57D2vxrgOUQntGJ5QI8h3DQEeVgJ+/srsqTF+ebbwcH1oeTnhldi4Zw/lYN+/ixiADMl+inMBbGOBOvwhnafGJkzIDqjcamQuNHnNZ1cdV1WogGofwCzDg4IHDLQ0kLLlIXt9dCecHjZcD8ucGGlkyC5zg05cJdz6Tv8QBKNH8jrctvA0zceBm0kMcf8ryFvYsmoyShTPX0aoD8kel7KXJrq6hhd9zZR0gWgUk3B4I2S5EFoxSJ5tLSK+XoP9FDkCQZJocoJQ9U6gfBV9aAk3cwSdUDn0KaXAMP4uA/iYCmuuPsV2VhM1dKQ6GUEEu9aLIoTI/nKcHIS8A8Q0t+fnaed6oe9DlOgpARXGuzKf157Sbsxw4kFbq40PFZ5lXCW7ZaLI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zpoFRbu+4vLYD9MjYmZIPuyXgY2Od6DJkTGIDIUwrlt3S29Lp5ru7ZW4I+k4ET1T4zsEQAg63zPlp08J2aPM9SWGpPrzykkvzwa8QLoqQIyxtyYQJ4p/YYy/XcG/N27bFVwUQ4XEOU1rCwjTJTvY2ERgXp1+tdHtU0lz/rKXKHN/ROoSAZ5Y5MciYTM2DU/kwYOmqVYaJsF7L54yCDqFGg1amW//E/7KT0GoLTgmglc15wg6PG7ZSnFTO51CBMWoUA+e1ugjylfY0JBaApLFRwK6+ZQ6FZ5nUIkJyyej+x2Ec8zVHloATD5/lOYIiSbupqeUhcEahywm4bLVG2WqxjVdOwbYdkKWB0sk/fzaswah4R9Favz8JW5Bq3Ph4TcpdJByYQ0DP7iOoxw0ibhQUcSpgRnHxBcceKEAmpky+wBEqVjSHQe86horlvaTJNUcIRRa5SV9LbaYRBFhpTp55zKJywJvIY6Nv2gEVawI+tVCvO41vzNxRix5gSJsqru8d3zunHqs+LfWFTF3EB7nvaEV/ocdS1fcINDhVUA7a9/+ZwcJ9ywU8cQx0CeCc1yRGawKoqZIV0kD7G19w7Vdb1sg2W+BMRxhQfNL6gyImOFBC+BEBzHM2O9oiAPKjXawEblOwsnG5oz93O++mqfBq+P4d8J4dN3WtZ/lwMcBRtIETwbmb/DEBaK1e6tYpAr4c9julH3uOz6vRxQ8JgAeTHRpP2DY39zn/iA248HqKpuqKveP1Z7USvv/mO5biCwA4/g8EcGVl8Kf5Af/epgT6VQIgrTfPdX4DfvQfVoGdr2LC71zmHywA34Yu8+8UwK8+Bf4K4GeU7O8O+N3Pf4Z/AFx+hD+giV8iAAAAAElFTkSuQmCC",vertexShaderName:"normal_vertex",fragmentShaderName:"normal_fragment",blendSrc:"SrcAlpha",blendDst:"One"}},{id:1,parentId:0,name:"shui02",localPosition:[0,0,0],rotation:[0,0,0],scale:[1,1,1],main:{duration:5,isLoop:!0,startDelay:{mode:0,min:0,max:0},startLifeTime:{mode:0,min:0,max:.5},startSpeed:{mode:0,min:0,max:0},startSize:{mode:0,min:0,max:1},startRotation:{mode:3,min:0,max:360},startColor:{m_mode:0,minColor:null,maxColor:{r:1,g:1,b:1,a:1}},gravity:{mode:0,min:0,max:1}},emission:{rateOverTime:{mode:0,min:0,max:50}},shape:{shapeMode:5,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:.5,y:.5,z:.5}},velocityLifeTime:{linearX:{mode:0,min:0,max:12},linearY:{mode:0,min:0,max:1},linearZ:{mode:0,min:0,max:1}},colorLifeTime:{color:{m_mode:1,minColor:null,maxColor:null,maxGradient:{colorLocation:[0,1],colors:[{r:1,g:1,b:1,a:1},{r:1,g:1,b:1,a:1}],alphaLocation:[0,.5029374,1],alphas:[1,1,0]}}},sizeLifeTime:{separateAxes:!1,sizeX:{mode:1,min:0,max:0,maxCurve:{times:[0,.05,.1,.15,.2,.25,.3,.350000024,.400000036,.450000048,.50000006,.5500001,.6000001,.6500001,.7000001,.7500001,.800000131,.850000143,.900000155,.950000167,1],values:[.253846169,.327116847,.39655,.462154329,.5239385,.5819111,.636080742,.686456263,.7330462,.7758591,.814903855,.850189,.8817231,.909514964,.9335731,.9539063,.9705231,.9834323,.992642343,.998162031,1]}}},render:{renderMode:0,lengthScale:2,texName:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAABCUExURUxpcf///////////////////////////////////////////////////////////////////////////////////zezJKIAAAAVdFJOUwDvNFrATyQCBAjJGhBCc7TogWWZ2sfShx8AAAgESURBVHja7VuHlqM6DAUbI4le4v//1SfZhtCSIcHs7DlvfbZMyVhXV11kkuTdgRySit6+JKn5ZYWB5J5T8e0/3M34wMBdAM5dDHAbgHPQbgXw51X7ew/Rr0rniKh+EwB7GdBv2wB+zyF/PRQI/r/k/zUI/obz+574624A/28CvgEBu88vsogG8exLQ0O3wU9XYgDAnAfQHDNwyQeJskwAwAkQ2CQYPwzK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7xayd1Dtl/Ro1q4Xvh6nyj1qU54dku9BHAYm9hif4O68C4VzAy4GaHlr/cq+fPHNcUDYlu/VwO/ssERH/L0buGNorQp6jCZwOFwAReiwFc8cHK9R2ye+4xeSEBAHzJwVvUKRDq8ji4nvb3vTa8wy4XDImQcAW19/7tu970ca914glWP5xZ+dwXmy+IK0hDAXRkCf071n+/n8cffJtiZIo/6PqkNX3DMQF2voqC8z/G2FaHcsg4/zXsQ3/E2Y5m8W+IP5v9N2s/pZwBR30mH6mgBG+FiI08X8MTv0+A9xJosO83BLZWfstO984use9m25195zeLVb/+2TPXv17b+nX/n3/l3Vuc/HEpSE+zhftsAAAAASUVORK5CYII=",vertexShaderName:"normal_vertex",fragmentShaderName:"normal_fragment",blendSrc:"SrcAlpha",blendDst:"One"}}]},Pv={nodes:[{id:0,parentId:-1,name:"SmallFire",localPosition:[0,0,0],rotation:[0,0,0],scale:[1,1,1]},{id:1,parentId:0,name:"SmallFire",localPosition:[0,0,0],rotation:[270,0,0],scale:[1,1,1],main:{duration:5,isLoop:!0,startDelay:{mode:0,min:0,max:0},startLifeTime:{mode:3,min:1,max:2},startSpeed:{mode:3,min:-1,max:1},startSize:{mode:3,min:0,max:15},startRotation:{mode:3,min:180,max:360},startColor:{m_mode:0,minColor:null,maxColor:{r:1,g:.847058833,b:.7294118,a:.360784322}},gravity:{mode:0,min:0,max:0}},emission:{rateOverTime:{mode:0,min:0,max:75}},shape:{shapeMode:0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}},velocityLifeTime:{linearX:{mode:3,min:0,max:0},linearY:{mode:3,min:0,max:0},linearZ:{mode:3,min:15,max:10}},colorLifeTime:{color:{m_mode:1,minColor:null,maxColor:null,maxGradient:{colorLocation:[.114702068,.264698267,1],colors:[{r:1,g:1,b:1,a:1},{r:.6,g:.549019635,b:.466666669,a:1},{r:.796078444,g:.305882365,b:0,a:1}],alphaLocation:[0,.294117659,.4205844,.7058824,.8441138,1],alphas:[1,.8862745,1,.9529412,.843137264,0]}}},sizeLifeTime:{separateAxes:!1,sizeX:{mode:1,min:0,max:0,maxCurve:{times:[0,.05,.1,.15,.2,.200551927,.250551939,.300551951,.342321426,.392321438,.44232145,.492321461,.5420238,.560089767,.6100898,.6600898,.7100898,.7600898,.8100898,.860089839,.9084245,.9584245,1],values:[0,.0652164742,.329441279,.595537543,.6663684,.665323436,.5503927,.425050557,.3403294,.27294594,.22446236,.183398828,.138578773,.034826193,.0321929157,.03092101,.0305348318,.0305587333,.0305170622,.0299341753,.0284090918,.0117929261,0]}}},rotationLifeTime:{rz:{mode:3,min:-180,max:180}},texSheetAnimation:{tileX:8,tileY:8,animationMode:0,rowMode:1,row:0,timeMode:0,frameOverTime:{mode:1,min:0,max:0,maxCurve:{times:[0,1],values:[0,1]}},startFrame:{mode:0,min:0,max:0},cycles:1},render:{renderMode:0,lengthScale:-.13,texName:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIABAMAAAAGVsnJAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAhUExURUxpcf+ZRP+pVv+0ZP+7cP++c/+/dP/Eef/MfP/rov/92OmHeosAAAAKdFJOUwAOIz9cfKLJ8PuSEQDeAAAgAElEQVR42uxcQXubSBKlpeydRnL2aoFkXyMBco6xaZBzm1g0kveWiWiUPU4Eje5j0cw9lvAvSPIrF8/s3lSl75s5ZGa23/Wpoep1VXU3ojAMDQ0NDQ0NDQ0NDQ0NDQ0NDQ0Njf9zkMGJH9C/uf/uCQHo31sA4qD+E5uaCGt2vHM0djoBMtwwDcs1cfNs84T95h9y32GMIQJ4jLMbAt88Snk8hod3sjhhiEAv8oBPEAe6wXh0g/ETXCDLPJW/JEviAPlJtC/4BBFg2hRzJEPIfbMbm7CFnW2zweKvu93F5yg/RwOkFXhwIkDePiZjRIDO/aMYYPw2j7EU+Ucj4nOYN9/uxQdEIHL7KO6Q29OPe3mHDO+qsprjIfCiTK6xX5ztQ4w3X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0g51VD58OyhDJIEHvBQBe1J8E4MEQt7niDe6xDT+X8r17gMDwPyeQkjgGIX7M0aE37IYpJtj18EkAIbxEuKfPPLj1hzbM+wEC9D0lOPFceBlzj7Zfdw+ag1MKzTixiBdmi1/ZD6wk/4V76P0kOCAVdC1OeHeWEVNy4jn/++KbJ4F8p5r9DOVnGstTeSpP5ak8laeClL8Bg1M4lqVHmqIAAAAASUVORK5CYII=",matColor:{r:1,g:1,b:1,a:1},vertexShaderName:"normal_vertex",fragmentShaderName:"normal_legacy_fragment",blendSrc:"SrcAlpha",blendDst:"One"}},{id:11,parentId:1,name:"glow",localPosition:[0,0,0],rotation:[0,0,0],scale:[1,1,1],main:{duration:5,isLoop:!0,startDelay:{mode:0,min:0,max:0},startLifeTime:{mode:3,min:1,max:2},startSpeed:{mode:3,min:-1,max:1},startSize:{mode:3,min:10,max:30},startRotation:{mode:3,min:180,max:360},startColor:{m_mode:0,minColor:null,maxColor:{r:.06666667,g:.02745098,b:0,a:.192156866}},gravity:{mode:0,min:0,max:0}},emission:{rateOverTime:{mode:0,min:0,max:150}},shape:{shapeMode:0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}},velocityLifeTime:{linearX:{mode:3,min:0,max:0},linearY:{mode:3,min:0,max:0},linearZ:{mode:3,min:15,max:10}},colorLifeTime:{color:{m_mode:1,minColor:null,maxColor:null,maxGradient:{colorLocation:[.114702068,.264698267,1],colors:[{r:1,g:1,b:1,a:1},{r:.368627459,g:.3372549,b:.286274523,a:1},{r:.368627459,g:.141176477,b:0,a:1}],alphaLocation:[0,.294117659,.4205844,.7058824,.8441138,1],alphas:[1,.8862745,1,.9529412,.843137264,0]}}},sizeLifeTime:{separateAxes:!1,sizeX:{mode:1,min:0,max:0,maxCurve:{times:[0,.05,.1,.15,.2,.200551927,.250551939,.300551951,.350551963,.400551975,.450552,.500552,.5371929,.560089767,.6100898,.6600898,.7100898,.7600898,.8100898,.860089839,.9084245,.9584245,1],values:[0,.0652164742,.329441279,.595537543,.6663684,.665323436,.572160959,.486265123,.4074504,.335531384,.270322651,.211638719,.172669679,.034826193,.0321929157,.03092101,.0305348318,.0305587333,.0305170622,.0299341753,.0284090918,.0117929261,0]}}},rotationLifeTime:{rz:{mode:3,min:-180,max:180}},render:{renderMode:0,lengthScale:-.13,texName:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAADAUExURQEBAQ0NDQ8PDxgYGAMDAwYGBgoKCgAAAAICAgQEBAgICBEREQkJCRMTEycnJyEhIRUVFSQkJC4uLjIyMhoaGjY2NlFRURwcHFdXVzo6OisrKx4eHkJCQj4+PkxMTHV1dYSEhKOjo0lJSVxcXH5+fmBgYKqqqkZGRm1tbWRkZGhoaI6OjomJib29vbGxsZiYmJ2dncTExLe3t3BwcHl5eZOTk9XV1crKyvb29vz8/Orq6vDw8NDQ0Nvb2+Tk5ODg4JDEJ0YAAAtZSURBVHja7Zt5WxtHDIcnxgYbE3AKgYK5QqCEo0CxadIc5Pt/q+qckWZnDzvXP9HTJrRPm987kmZ2VtKGtV9s4TfAb4Bv+p8D/AX20wFU2NrakiRhce2quAP5sQCh3X4cQK40TAY/L4sRltAf1tkyBGFBdSfYj78UMb4bQGHt/YIZlAUIFgCoFR+NIsPiCGFB/aiZG/w7B9GVIHR0f7O65UgQnRBCF32z+Kg0cFZG6OKFsIT8IFPPORYiCJ2Cb9ae1NaNwT84V0SGVoLQou9Xb6Q3wFbjL2DrypD80CUTQjd9s3wSX60aQyxMENrDr/qyeFV/4SxSMEN3gtCmHzOP5Fk96fYqFBKLkWVoIgit/s/lRZlsPB7DL/xzTxlKXqgnCLX6Q7N+ltfFq/Z4/JKNfh57hgJBd4BMX2If5UV6Ykw4IgN7oYsPQoN+vnyVJ/GVzIiC/MBeYCcM5Eyo90Goj3/a+xR8kaeVo+IO2R4a/hAZ2AsYh/X1SFAfhV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Yn/xGVU4ci/c/le35gUPjLql7/yKah3+sOX/MqK1fqSGPrPi+t3/tSrw4dey3xntezHbqjT+KXZj/jYDf/bygd3xBGG3/DB3+LfG6593w8Ol/hKswHhJ370GnJfLPsn/f7u+DfALwf4H+mSXPcSYtHSAAAAAElFTkSuQmCC",matColor:{r:1,g:1,b:1,a:1},vertexShaderName:"normal_vertex",fragmentShaderName:"normal_legacy_fragment",blendSrc:"SrcAlpha",blendDst:"One"}}]},Uv={RAIN:Symbol("rain"),FLAME:Symbol("fire_smoke"),SNOW:Symbol("snow"),WATER_SPRAY:Symbol("water_spray"),CANDLE:Symbol("candle")};Object.freeze(Uv);var Dv=function(e){h(n,e);var t=y(n);function n(e){var i;if(s(this,n),(i=t.call(this)).rootNode=null,i.nodeArray=new Map,i.particleArray=[],i.camera=null,i.density=1,i.data=null,_v.pushItem(v(i)),e)switch(e){case Uv.FLAME:i.onLoad(Iv);break;case Uv.CANDLE:i.onLoad(Pv);break;case Uv.RAIN:i.onLoad(Lv);break;case Uv.SNOW:i.onLoad(Fv);break;case Uv.WATER_SPRAY:i.onLoad(kv)}return i}return A(n,[{key:"load",value:function(e){this.loadbyUrl(e)}},{key:"loadbyUrl",value:function(e){var t=this;(new Kl).load(e,(function(){t.onLoad(JSON.parse(t.data))}),null,null)}},{key:"onLoad",value:function(e){this.data=e,this.refreshLoad()}},{key:"refreshLoad",value:function(){if(null!=this.camera&&null!=this.data){for(var e=this.data,t=0;t<e.nodes.length;t++){var n=e.nodes[t],i=null;null==n.main?i=new zt:((i=new Tv(n)).init(this.camera),this.particleArray.push(i)),this.nodeArray.set(n.id,i),0==t&&(this.rootNode=i,this.add(this.rootNode));var r=new bt;r.makeTranslation(n.localPosition[0],n.localPosition[1],n.localPosition[2]);var a=new bt;a.makeScale(n.scale[0],n.scale[1],n.scale[2]),r.multiply(a);var o=new bt;o.makeRotationFromEuler(new Bt(et.degToRad(n.rotation[0]),et.degToRad(n.rotation[1]),et.degToRad(n.rotation[2]))),r.multiply(o),i.applyMatrix4(r),i.name=n.name,n.parentId>=0&&this.nodeArray.get(n.parentId).add(i)}this.data=null}}},{key:"setDensity",value:function(e){this.density=e;for(var t=0;t<this.particleArray.length;t++)this.particleArray[t].setDensity(e)}},{key:"onBeforeRender",value:function(e,t,n){this.camera=n,this.refreshLoad()}},{key:"destory",value:function(){_v.removeItem(this),this.removeFromParent()}}]),n}(zt),Rv=function(e,t){Ei.call(this,e);var n=this,i=void 0!==(t=t||{}).textureWidth?t.textureWidth:512,r=void 0!==t.textureHeight?t.textureHeight:512,a=void 0!==t.clipBias?t.clipBias:0,o=void 0!==t.alpha?t.alpha:1,s=void 0!==t.time?t.time:0,l=void 0!==t.waterNormals?t.waterNormals:null,A=void 0!==t.sunDirection?t.sunDirection:new at(.70707,.70707,0),c=new Fn(void 0!==t.sunColor?t.sunColor:16777215),h=new Fn(void 0!==t.waterColor?t.waterColor:8355711),u=void 0!==t.size?t.size:1,d=void 0!==t.eye?t.eye:new at(0,0,0),f=void 0!==t.distortionScale?t.distortionScale:20,p=void 0!==t.side?t.side:0,m=void 0!==t.fog&&t.fog,v=new vn,g=new at,y=new at,w=new at,x=new bt,b=new at(0,0,-1),M=new ut,C=new at,B=new at,E=new ut,S=new bt,T=new Ni,_=new dt(i,r,{minFilter:Z,magFilter:Z,format:Ae,stencilBuffer:!1});et.isPowerOfTwo(i)&&et.isPowerOfTwo(r)||(_.texture.generateMipmaps=!1);var I={uniforms:Di.merge([Yi.fog,Yi.lights,{normalSampler:{value:null},mirrorSampler:{value:null},alpha:{value:1},time:{value:0},size:{value:1},distortionScale:{value:20},textureMatrix:{value:new bt},sunColor:{value:new Fn(8355711)},sunDirection:{value:new at(.70707,.70707,0)},eye:{value:new at},waterColor:{value:new Fn(5592405)}}]),vertexShader:["uniform mat4 textureMatrix;","uniform float time;","varying vec4 mirrorCoord;","varying vec4 worldPosition;",Xi.fog_pars_vertex,Xi.shadowmap_pars_vertex,"void main() {","\tmirrorCoord = modelMatrix * vec4( position, 1.0 );","\tworldPosition = mirrorCoord.xyzw;","\tmirrorCoord = textureMatrix * mirrorCoord;","\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * mvPosition;",Xi.fog_vertex,Xi.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D mirrorSampler;","uniform float alpha;","uniform float time;","uniform float size;","uniform float distortionScale;","uniform sampler2D normalSampler;","uniform vec3 sunColor;","uniform vec3 sunDirection;","uniform vec3 eye;","uniform vec3 waterColor;","varying vec4 mirrorCoord;","varying vec4 worldPosition;","vec4 getNoise( vec2 uv ) {","\tvec2 uv0 = ( uv / 103.0 ) + vec2(time / 17.0, time / 29.0);","\tvec2 uv1 = uv / 107.0-vec2( time / -19.0, time / 31.0 );","\tvec2 uv2 = uv / vec2( 8907.0, 9803.0 ) + vec2( time / 101.0, time / 97.0 );","\tvec2 uv3 = uv / vec2( 1091.0, 1027.0 ) - vec2( time / 109.0, time / -113.0 );","\tvec4 noise = texture2D( normalSampler, uv0 ) +","\t\ttexture2D( normalSampler, uv1 ) +","\t\ttexture2D( normalSampler, uv2 ) +","\t\ttexture2D( normalSampler, uv3 );","\treturn noise * 0.5 - 1.0;","}","void sunLight( const vec3 surfaceNormal, const vec3 eyeDirection, float shiny, float spec, float diffuse, inout vec3 diffuseColor, inout vec3 specularColor ) {","\tvec3 reflection = normalize( reflect( -sunDirection, surfaceNormal ) );","\tfloat direction = max( 0.0, dot( eyeDirection, reflection ) );","\tspecularColor += pow( direction, shiny ) * sunColor * spec;","\tdiffuseColor += max( dot( sunDirection, surfaceNormal ), 0.0 ) * sunColor * diffuse;","}",Xi.common,Xi.packing,Xi.bsdfs,Xi.fog_pars_fragment,Xi.lights_pars_begin,Xi.shadowmap_pars_fragment,Xi.shadowmask_pars_fragment,"void main() {","\tvec4 noise = getNoise( worldPosition.xz * size );","\tvec3 surfaceNormal = normalize( noise.xzy * vec3( 1.5, 1.0, 1.5 ) );","\tvec3 diffuseLight = vec3(0.0);","\tvec3 specularLight = vec3(0.0);","\tvec3 worldToEye = eye-worldPosition.xyz;","\tvec3 eyeDirection = normalize( worldToEye );","\tsunLight( surfaceNormal, eyeDirection, 100.0, 2.0, 0.5, diffuseLight, specularLight );","\tfloat distance = length(worldToEye);","\tvec2 distortion = surfaceNormal.xz * ( 0.001 + 1.0 / distance ) * distortionScale;","\tvec3 reflectionSample = vec3( texture2D( mirrorSampler, mirrorCoord.xy / mirrorCoord.w + distortion ) );","\tfloat theta = max( dot( eyeDirection, surfaceNormal ), 0.0 );","\tfloat rf0 = 0.3;","\tfloat reflectance = rf0 + ( 1.0 - rf0 ) * pow( ( 1.0 - theta ), 5.0 );","\tvec3 scatter = max( 0.0, dot( surfaceNormal, eyeDirection ) ) * waterColor;","\tvec3 albedo = mix( ( sunColor * diffuseLight * 0.3 + scatter ) * getShadowMask(), ( vec3( 0.1 ) + reflectionSample * 0.9 + reflectionSample * specularLight ), reflectance);","\tvec3 outgoingLight = albedo;","\tgl_FragColor = vec4( outgoingLight, alpha );",Xi.tonemapping_fragment,Xi.fog_fragment,"}"].join("\n")},L=new Ri({fragmentShader:I.fragmentShader,vertexShader:I.vertexShader,uniforms:Di.clone(I.uniforms),transparent:!0,lights:!0,side:p,fog:m});L.uniforms.mirrorSampler.value=_.texture,L.uniforms.textureMatrix.value=S,L.uniforms.alpha.value=o,L.uniforms.time.value=s,L.uniforms.normalSampler.value=l,L.uniforms.sunColor.value=c,L.uniforms.waterColor.value=h,L.uniforms.size.value=u,L.uniforms.sunDirection.value=A,L.uniforms.distortionScale.value=f,L.uniforms.eye.value=d,n.material=L,n.onBeforeRender=function(e,t,i){y.setFromMatrixPosition(n.matrixWorld),w.setFromMatrixPosition(i.matrixWorld),x.extractRotation(n.matrixWorld),g.set(0,0,1),g.applyMatrix4(x),C.subVectors(y,w),C.reflect(g).negate(),C.add(y),x.extractRotation(i.matrixWorld),b.set(0,0,-1),b.applyMatrix4(x),b.add(w),B.subVectors(y,b),B.reflect(g).negate(),B.add(y),T.position.copy(C),T.up.set(0,1,0),T.up.applyMatrix4(x),T.up.reflect(g),T.lookAt(B),T.far=i.far,T.updateMatrixWorld(),T.projectionMatrix.copy(i.projectionMatrix),S.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),S.multiply(T.projectionMatrix),S.multiply(T.matrixWorldInverse),v.setFromNormalAndCoplanarPoint(g,y),v.applyMatrix4(T.matrixWorldInverse),M.set(v.normal.x,v.normal.y,v.normal.z,v.constant);var r=T.projectionMatrix;E.x=(Math.sign(M.x)+r.elements[8])/r.elements[0],E.y=(Math.sign(M.y)+r.elements[9])/r.elements[5],E.z=-1,E.w=(1+r.elements[10])/r.elements[14],M.multiplyScalar(2/M.dot(E)),r.elements[2]=M.x,r.elements[6]=M.y,r.elements[10]=M.z+1-a,r.elements[14]=M.w,d.setFromMatrixPosition(i.matrixWorld);var o=e.getRenderTarget(),s=e.vr.enabled,l=e.shadowMap.autoUpdate;n.visible=!1,e.vr.enabled=!1,e.shadowMap.autoUpdate=!1,e.setRenderTarget(_),e.clear(),e.render(t,T),n.visible=!0,e.vr.enabled=s,e.shadowMap.autoUpdate=l,e.setRenderTarget(o)}};function Ov(e,t,n){this.x=e||0,this.y=t||0,this.z=n||0}(Rv.prototype=Object.create(Ei.prototype)).constructor=Rv,Object.assign(Ov.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},cross:function(e){return void 0!==w?this.crossVectors(e,w):this.crossVectors(this,e)},crossVectors:function(e,t){var n=e.x,i=e.y,r=e.z,a=t.x,o=t.y,s=t.z;return this.x=i*s-r*o,this.y=r*a-n*s,this.z=n*o-i*a,this},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},fromArray:function(e){return this.x=e[0],this.y=e[1],this.z=e[2],this},applyMatrix4:function(e){var t=this.x,n=this.y,i=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*a,this}});var Nv="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4RHkRXhpZgAATU0AKgAAAAgABwESAAMAAAABAAEAAAEaAAUAAAABAAAAYgEbAAUAAAABAAAAagEoAAMAAAABAAIAAAExAAIAAABjAAAAcgEyAAIAAAAUAAAA1odpAAQAAAABAAAA6gAAARYACvzaAAAnEAAK/NoAACcQQWRvYmUgUGhvdG9zaG9wIENTNSAoMTIuMHgyMDEwMDExNSBbMjAxMDAxMTUubS45OTggMjAxMC8wMS8xNTowMjowMDowMCBjdXRvZmY7IG0gYnJhbmNoXSkgIFdpbmRvd3MAADIwMTM6MTI6MDUgMDA6NTQ6MDkAAAOgAQADAAAAAQABAACgAgAEAAAAAQAABACgAwAEAAAAAQAABAAAAAAAAAAABgEDAAMAAAABAAYAAAEaAAUAAAABAAABZAEbAAUAAAABAAABbAEoAAMAAAABAAIAAAIBAAQAAAABAAABdAICAAQAAAABAAAQaAAAAAAAAABIAAAAAQAAAEgAAAAB/9j/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQw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AEAoZmaAAYAAAAAAAEAMgAAAAEAWgAAAAYAAAAAAAEANQAAAAEALQAAAAYAAAAAAAE4QklNA/gAAAAAAHAAAP////////////////////////////8D6AAAAAD/////////////////////////////A+gAAAAA/////////////////////////////wPoAAAAAP////////////////////////////8D6AAAOEJJTQQAAAAAAAACAAA4QklNBAIAAAAAAAIAADhCSU0EMAAAAAAAAQEAOEJJTQQtAAAAAAAGAAEAAAANOEJJTQQIAAAAAAAQAAAAAQAAAkAAAAJAAAAAADhCSU0EHgAAAAAABAAAAAA4QklNBBoAAAAAA00AAAAGAAAAAAAAAAAAAAQAAAAEAAAAAAwAdwBhAHQAZQByAG4AbwByAG0AYQBsAHMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAABudWxsAAAAAgAAAAZib3VuZHNPYmpjAAAAAQAAAAAAAFJjdDEAAAAEAAAAAFRvcCBsb25nAAAAAAAAAABMZWZ0bG9uZwAAAAAAAAAAQnRvbWxvbmcAAAQAAAAAAFJnaHRsb25nAAAEAAAAAAZzbGljZXNWbExzAAAAAU9iamMAAAABAAAAAAAFc2xpY2UAAAASAAAAB3NsaWNlSURsb25nAAAAAAAAAAdncm91cElEbG9uZwAAAAAAAAAGb3JpZ2luZW51bQAAAAxFU2xpY2VPcmlnaW4AAAANYXV0b0dlbmVyYXRlZAAAAABUeXBlZW51bQAAAApFU2xpY2VUeXBlAAAAAEltZyAAAAAGYm91bmRzT2JqYwAAAAEAAAAAAABSY3QxAAAABAAAAABUb3AgbG9uZwAAAAAAAAAATGVmdGxvbmcAAAAAAAAAAEJ0b21sb25nAAAEAAAAAABSZ2h0bG9uZwAABAAAAAADdXJsVEVYVAAAAAEAAAAAAABudWxsVEVYVAAAAAEAAAAAAABNc2dlVEVYVAAAAAEAAAAAAAZhbHRUYWdURVhUAAAAAQAAAAAADmNlbGxUZX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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPD94cGFja2V0IGVuZD0ndyc/Pv/iDFhJQ0NfUFJPRklMRQABAQAADEhMaW5vAhAAAG1udHJSR0IgWFlaIAfOAAIACQAGADEAAGFjc3BNU0ZUAAAAAElFQyBzUkdCAAAAAAAAAAAAAAABAAD21gABAAAAANMtSFAgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEWNwcnQAAAFQAAAAM2Rlc2MAAAGEAAAAbHd0cHQAAAHwAAAAFGJrcHQAAAIEAAAAFHJYWVoAAAIYAAAAFGdYWVoAAAIsAAAAFG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wMnoDggYzjHOamj8ELqdxA6Ws2mOnysDlArfdIQ4Oc9cEdvrXHGUKaXtlZpeX/DnuYynhcFRnGtJb6vS3y6+npe3aul5eajHGklveq0imHMbBhC3oQckg88c/Wq9raR6ZNtupmjiwcBnO0HkkNu4yMdK3r3Tb7wVZJeW4u5VW5CmWMfKemCcjHoMjH4YrsRq+l+J7KRtRspopPKwxmjLQsBnqwzg9DnnGPWuGpmnJ71ON4d1v8AcfIYPNJZnmHs8PD3dLW3e+3lp66/f5pqDSaQ3mbZvs8i5hnhIkjde4BH3WHp3/lX0nTbrxfZzQW/nyeWPldQGmx7jrjtxxW1e/DyRI1+xXXmafKfNjVZv9WeMqGAx0wRnmjS9HXTdUhZG8ub/VsxPyuPY/3s+uc16CxVN0+aD9707d1+Z93PG0MppxUUpVZL7r7/AD/TZGPb+HZ9BgP2wzSQtGUYDAfAPJOMYIwe3Wug8HzQ2KyRuk9wjn5kdNysv9frwabeXE2h66ZLqGe6tZnBdlkAIB4brwT+WfbnGf8A8J3pfhDX4YWm1Ca0uE4XyT5mDjgFSQMHjkAHB9K5606teDSTk2r6f10PzfMM0xc68qivKTfLpt6eiOx1LTpNBg8xrCGa1k4DeQokQH3wcfz47VieIks7+zVcbWbdhZYR5gP1wc9c810Gh+O9F01f3V1qjWd0QNkqRxzRZHIJyAQODyAe3HfrP7O0HxJAM3drNJLGHxEximBHHK8qx+hr5+WZTwklKtTl6pP8U9vv16XPSwMop8soNt6Ky3d97a6efY8Jkkm8NSxyFYyoIIKjCNjAzjrz/wDWPv0ngfxPH4nV4447izuYmYxllIV8E5UdcgjkZ/pWhqHg7Q71rqGz1K8guGG4QugUlucjOfmyPWvLdbkvvBWo2l9ajWN1vMJPLZVHnDOWUYPOQcgevGOcD6en7LHR5Y3U+l016aM5Vh6levGdn1bbW2qWi7rof//Z",zv=function(e){h(n,e);var t=y(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this,n),(i=t.call(this,r)).mesh=e,i.color=r.color||"#17b2ff",i.distortion=r.distortion||3.7,i.speed=r.speed||1,i.size=r.size||1,i.water=new Rv(i.mesh.geometry,{textureWidth:512,textureHeight:512,waterNormals:(new tA).load(Nv,(function(e){e.wrapS=e.wrapT=V})),alpha:1,sunDirection:new Ov(0,1,0),sunColor:16777215,waterColor:i.color,distortionScale:i.distortion,size:i.size}),i.mesh.material0||(i.mesh.material0=i.mesh.material),i.material=i.mesh.material=i.water.material,i}return A(n,[{key:"setSpeed",value:function(e){this.speed=e,this.material.uniforms.baseSpeed.value=e}},{key:"setDistortion",value:function(e){this.distortion=e,this.material.uniforms.noiseScale.value=e}},{key:"setColor",value:function(e){this.material.uniforms.waterColor.value=new Fn(e)}},{key:"setSize",value:function(e){this.material.uniforms.size.value=e}},{key:"clear",value:function(){this.mesh.material=this.mesh.material0,this.paused=!0,AMRT.render()}},{key:"update",value:function(e){this.paused||(this.water.material.uniforms.time.value+=1/60*this.speed)}},{key:"onBeforeRender",value:function(e,t,n,i){this.water.material.uniforms.sunDirection.value=n.position.clone().normalize(),this.water.onBeforeRender(e,t,n)}},{key:"dispose",value:function(){this.material.dispose()}}]),n}(Cm),Qv=function e(t,n){Ei.call(this,t),this.type="Reflector";var i=this,r=void 0!==(n=n||{}).color?new Fn(n.color):new Fn(8355711),a=n.textureWidth||512,o=n.textureHeight||512,s=n.clipBias||0,l=n.shader||e.ReflectorShader,A=void 0!==n.recursion?n.recursion:0,c=new vn,h=new at,u=new at,d=new at,f=new bt,p=new at(0,0,-1),m=new ut,v=new at,g=new at,y=new ut,w=new bt,x=new Ni,b=new dt(a,o,{minFilter:Z,magFilter:Z,format:Ae,stencilBuffer:!1});et.isPowerOfTwo(a)&&et.isPowerOfTwo(o)||(b.texture.generateMipmaps=!1);var M=new Ri({uniforms:Di.clone(l.uniforms),fragmentShader:l.fragmentShader,vertexShader:l.vertexShader});M.uniforms.tDiffuse.value=b.texture,M.uniforms.color.value=r,M.uniforms.textureMatrix.value=w,this.material=M,this.onBeforeRender=function(e,t,n){if("recursion"in n.userData){if(n.userData.recursion===A)return;n.userData.recursion++}if(u.setFromMatrixPosition(i.matrixWorld),d.setFromMatrixPosition(n.matrixWorld),f.extractRotation(i.matrixWorld),h.set(0,0,1),h.applyMatrix4(f),v.subVectors(u,d),!(v.dot(h)>0)){v.reflect(h).negate(),v.add(u),f.extractRotation(n.matrixWorld),p.set(0,0,-1),p.applyMatrix4(f),p.add(d),g.subVectors(u,p),g.reflect(h).negate(),g.add(u),x.position.copy(v),x.up.set(0,1,0),x.up.applyMatrix4(f),x.up.reflect(h),x.lookAt(g),x.far=n.far,x.updateMatrixWorld(),x.projectionMatrix.copy(n.projectionMatrix),x.userData.recursion=0,w.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),w.multiply(x.projectionMatrix),w.multiply(x.matrixWorldInverse),w.multiply(i.matrixWorld),c.setFromNormalAndCoplanarPoint(h,u),c.applyMatrix4(x.matrixWorldInverse),m.set(c.normal.x,c.normal.y,c.normal.z,c.constant);var r=x.projectionMatrix;y.x=(Math.sign(m.x)+r.elements[8])/r.elements[0],y.y=(Math.sign(m.y)+r.elements[9])/r.elements[5],y.z=-1,y.w=(1+r.elements[10])/r.elements[14],m.multiplyScalar(2/m.dot(y)),r.elements[2]=m.x,r.elements[6]=m.y,r.elements[10]=m.z+1-s,r.elements[14]=m.w,i.visible=!1;var a=e.getRenderTarget(),o=e.vr.enabled,l=e.shadowMap.autoUpdate;e.vr.enabled=!1,e.shadowMap.autoUpdate=!1,e.setRenderTarget(b),e.clear(),e.render(t,x),e.vr.enabled=o,e.shadowMap.autoUpdate=l,e.setRenderTarget(a);var M=n.viewport;void 0!==M&&e.state.viewport(M),i.visible=!0}},this.getRenderTarget=function(){return b}};(Qv.prototype=Object.create(Ei.prototype)).constructor=Qv,Qv.ReflectorShader={uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec4 vUv;","void main() {","\tvUv = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec4 vUv;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );","}","void main() {","\tvec4 base = texture2DProj( tDiffuse, vUv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")};var Gv=function(e){h(n,e);var t=y(n);function n(e,i){var r;return s(this,n),(r=t.call(this,i)).mesh=e,r.mirror=new Qv(r.mesh.geometry,{clipBias:.003,textureWidth:1024*window.devicePixelRatio,textureHeight:1024*window.devicePixelRatio,color:"#777777",recursion:1}),r.mesh.material0||(r.mesh.material0=r.mesh.material),r.mirror.position.copy(e.position),r.mirror.rotation.copy(e.rotation),r.mirror.scale.copy(e.scale),r.mirror.updateMatrixWorld(!0),r.mesh.material=r.mirror.material,r}return A(n,[{key:"clear",value:function(){this.mesh.material=this.mesh.material0,this.paused=!0,AMRT.render()}},{key:"update",value:function(e){}},{key:"onBeforeRender",value:function(e,t,n,i){this.mirror.onBeforeRender(e,t,n)}},{key:"dispose",value:function(){this.material.dispose()}}]),n}(Cm),Hv=function(e){h(n,e);var t=y(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,n),e=t.call(this);var r=i.size?i.size:5,a=i.color?i.color:"#00fa00",o=i.speed?i.speed:1,l=i.texture?i.texture:"https://laozicloud-sdk.obs.cn-east-2.myhuaweicloud.com/assets/image/radar.png";return e.map=(new tA).load(l),e.map.center.set(.5,.5),e.circle=new Ei(new fl(r,64),new Nn({color:a,map:e.map,transparent:!0})),e.circle.renderOrder=6e3,e.circle.rotation.x=-Math.PI/2,e.circle.onBeforeRender=function(){e.map.rotation-=et.degToRad(2*o)},e.add(e.circle),e}return A(n)}(zt),Vv=function(e){h(n,e);var t=y(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,n),e=t.call(this);var r=i.startRadius?i.startRadius:2,a=i.endRadius?i.endRadius:8,o=i.color?i.color:"#ffab03",l=i.speed?i.speed:1,A=i.texture?i.texture:"https://laozicloud-sdk.obs.cn-east-2.myhuaweicloud.com/assets/image/tours.png",c=(new tA).load(A),h=new $i(2*r,2*r),u=new Nn({map:c,color:o,transparent:!0,side:2});e.tours=new Ei(h,u);var d=a/r;return e.tours.renderOrder=1e3,e.tours.onAfterRender=function(){this.scale.x+=.01*l,this.scale.y=this.scale.x,this.scale.x>.4*d&&(this.material.opacity-=.005),this.scale.x>=d&&(this.scale.x=this.scale.y=1,this.material.opacity=1)},e.tours.rotation.x=-Math.PI/2,e.add(e.tours),e}return A(n)}(zt),jv=function(e){h(n,e);var t=y(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,n),e=t.call(this),i.width||(i.width=100),i.height||(i.height=100),i.radius||(i.radius=10),e.canvas=document.createElement("canvas"),e.canvas.width=i.width,e.canvas.height=i.height,e.context=e.canvas.getContext("2d"),e.radius=i.radius||10,e.context.fillStyle="#00ff00",e.context.fillRect(0,0,i.width,i.height),e.colorStops=i.colorStops||{1:"#f00",.8:"#e2fa00",.6:"#33f900",.3:"#0349df",0:"#fff"},e.data=i.data||[{coord:[-54,0,-70],value:15},{coord:[-17,21,-52],value:13},{coord:[12,21,-52],value:22}],e.draw(e.data),e.material=new Nn({transparent:!0,map:new ts(e.canvas),side:2});var r=new qi(i.width,i.height);return e.map=new Ei(r,e.material),e.map.rotation.x=Math.PI/180*-90,e}return A(n,[{key:"setColorStops",value:function(e){this.colorStops=e}},{key:"setSource",value:function(e){this.draw(e),this.map.material.map.needsUpdate=!0}},{key:"draw",value:function(e){var t=this;this._convertPoints(e,this.radius),this.dataList=e;var n=this.context;n.clearRect(0,0,this.canvas.width,this.canvas.height);var i=this.dataList.reduce((function(e,t){return Math.max(e,t.value)}),0);this.dataList.forEach((function(e){t._drawRadiation(n,{x:e.x,y:e.y,radius:t.radius,weight:Math.max(Math.min((e.value-0)/(i-0),1),0),value:e.value})}));for(var r=this._createPalette(this.colorStops),a=this.canvas,o=a.width,s=a.height,l=n.getImageData(0,0,o,s),A=l.data,c=3;c<A.length;c+=4){var h=A[c],u=r.pickColor(h);A[c-3]=u[0],A[c-2]=u[1],A[c-1]=u[2]}n.putImageData(l,0,0)}},{key:"_getMinPoint",value:function(e,t){var n=e.reduce((function(e,t){return Math.max(e,t.value)}),0),i={x:0,y:0};e.forEach((function(r,a){var o=Math.max(Math.min((r.value-0)/(n-0),1),0),s=Math.round(t*o);r.x-s<i.x&&(i.x=r.x-s),r.z-s<i.y&&(i.y=r.z-s),e[a]={x:r.x,y:r.z,value:r.value}})),e.forEach((function(t,n){e[n].x-=i.x,e[n].y-=i.y}))}},{key:"_convertPoints",value:function(e){e.forEach((function(e){e.x=e.coord[0],e.y=e.coord[2]}));var t=this.canvas.width/2,n=this.canvas.height/2;e.forEach((function(i,r){i.x>0?i.x+=t:0==i.x?i.x=t:i.x<0&&(i.x=t+i.x),i.y>0?i.y+=n:0==i.y?i.y=n:i.y<0&&(i.y=n+i.y),e[r]=i}))}},{key:"_drawRadiation",value:function(e,t){var n=t.x,i=t.y,r=t.radius,a=t.weight;r=Math.round(r*a);var o=e.createRadialGradient(n,i,0,n,i,r);o.addColorStop(0,"rgba(25, 0, 0, 1)"),o.addColorStop(1,"rgba(0, 255, 0, 0)"),e.fillStyle=o,e.beginPath(),e.arc(n,i,r,0,2*Math.PI),e.closePath(),e.fill()}},{key:"_getColorByValue",value:function(e){return e>=0&&e<=5?["rgba("+this.colorStops[1]+",1)","rgba("+this.colorStops[0]+",0)"]:e>5&&e<=10?["rgba("+this.colorStops[2]+",1)","rgba("+this.colorStops[1]+",0)"]:e>10&&e<=20?["rgba("+this.colorStops[3]+",1)","rgba("+this.colorStops[2]+",0)"]:e>20?["rgba("+this.colorStops[4]+",1)","rgba("+this.colorStops[3]+",0)"]:void 0}},{key:"_getColorByValue2",value:function(e){return e>=0&&e<=5?["rgb("+this.colorStops[0]+")","rgba("+this.colorStops[1]+")"]:e>5&&e<=10?["rgb("+this.colorStops[1]+")","rgba("+this.colorStops[2]+")"]:e>10&&e<=20?["rgb("+this.colorStops[2]+")","rgba("+this.colorStops[3]+")"]:e>20?["rgb("+this.colorStops[3]+")","rgba("+this.colorStops[4]+")"]:void 0}},{key:"_createPalette",value:function(e){var t=256,n=document.createElement("canvas");n.width=t,n.height=20;var i=n.getContext("2d");i.fillStyle="#0000ff";var r=i.createLinearGradient(0,0,t,0);for(var a in e)r.addColorStop(a,e[a]);i.fillStyle=r,i.fillRect(0,0,t,20);var o=i.getImageData(0,0,t,1).data;return{canvas:n,pickColor:function(e){return o.slice(4*e,4*e+3)}}}}]),n}(zt),Wv=function(e){h(n,e);var t=y(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,n),(e=t.call(this)).matColor=i.color,e.path=i.path,e.uvSpeed=.01,e.speed=i.speed,e.radius=i.radius,e.texture=i.texture||"https://laozicloud-sdk.obs.cn-east-2.myhuaweicloud.com/assets/image/streamer.png",e.tension=i.tension;var r=(new tA).load(e.texture);r.wrapS=r.wrapT=V,r.repeat.set(1,1),r.needsUpdate=!0;var a=new Nn({map:r,side:1,transparent:!0});e.matColor&&(a.color=new Fn(e.matColor));var o=new cA(e.path);null!=e.tension&&(o.curveType="catmullrom",o.tension=e.tension);var l=new ms(o,20*e.path.length,e.radius);e.lineMesh=new Ei(l,a);var A=v(e);return e.lineMesh.onBeforeRender=function(){r&&(r.offset.x-=A.speed)},e.add(e.lineMesh),e}return A(n,[{key:"radius",get:function(){return this._radius},set:function(e){this._radius=e||.1}},{key:"speed",get:function(){return this._speed},set:function(e){this._speed=e?e*this.uvSpeed:this.uvSpeed}},{key:"matColor",get:function(){return this._matColor},set:function(e){e&&(this._matColor=e,this.lineMesh&&(this.lineMesh.material.color=new Fn(this.matColor)))}},{key:"path",get:function(){return this._path},set:function(e){if(e){this._path=[];for(var t=0;t<e.length;t++)this._path.push((new at).copy(e[t]))}else this._path=[new at(-1,0,-2),new at(-1,0,-.5),new at(1,0,-.5),new at(1,0,1)]}}]),n}(zt),Xv=function(){function e(t){var n=this;s(this,e),this.viewer=t,this.ParticleSystemManager=_v,t.controls.addEventListener("change",(function(){n.rain&&n.rain.position.copy(n.viewer.camera.position),n.snow&&n.snow.position.copy(n.viewer.camera.position)}))}return A(e,[{key:"addRain",value:function(){this.rain?this.viewer.root.add(this.rain):(this.rain=new Dv(Uv.RAIN),this.viewer.root.add(this.rain),this.rain.translateY(100),this.rain.position.copy(this.viewer.camera.position))}},{key:"removeRain",value:function(){this.rain&&this.viewer.root.remove(this.rain)}},{key:"addSnow",value:function(){this.snow?this.viewer.root.add(this.snow):(this.snow=new Dv(Uv.SNOW),this.viewer.root.add(this.snow),this.snow.translateY(100),this.snow.position.copy(this.viewer.camera.position))}},{key:"removeSnow",value:function(){this.snow&&this.viewer.root.remove(this.snow)}},{key:"addFire",value:function(){var e=new Dv(Uv.CANDLE);return this.viewer.root.add(e),e}},{key:"removeFire",value:function(e){this.viewer.root.remove(e)}},{key:"addSmoke",value:function(){var e=new Dv(Uv.FLAME);return this.viewer.root.add(e),e}},{key:"removeSmoke",value:function(e){this.viewer.root.remove(e)}},{key:"addSprayWater",value:function(e,t){var n=new Dv(Uv.WATER_SPRAY);return n.rotateY(et.degToRad(t)),n.rotateZ(et.degToRad(e)),this.viewer.root.add(n),n}},{key:"removeSprayWater",value:function(e){this.viewer.root.remove(e)}},{key:"addWaterSurface",value:function(e,t){var n=new zv(e,t);return this.viewer.add(n),n}},{key:"removeWaterSurface",value:function(e){e.mesh.material=e.mesh.material0,this.viewer.remove(e)}},{key:"addMirror",value:function(e){var t=new Gv(e);return this.viewer.add(t),t}},{key:"removeMirror",value:function(e){this.viewer.remove(e)}},{key:"addRadarScanning",value:function(e){var t=new Hv(e);return this.viewer.root.add(t),t}},{key:"addToursScanning",value:function(e){var t=new Vv(e);return this.viewer.root.add(t),t}},{key:"addHeatMap",value:function(e){var t=new jv(e);return this.viewer.root.add(t.map),t}},{key:"addStreamerPath",value:function(e){var t=new Wv(e);return this.viewer.root.add(t),t}}]),e}();function Yv(e){Wl.call(this,e),this.root=void 0}function Kv(e){if(e.sc&&e.sc.length>0){void 0===e.cid&&(e.cid=[]);for(var t=0;t<e.sc.length;t++)e.sc[t].pid=e.id,e.cid.push(e.sc[t].id);for(var n=0;n<e.sc.length;n++)Kv(e.sc[n])}}function Zv(e,t){if(e.sc&&e.sc.length>0)for(var n=0;n<e.sc.length;n++)t(e.sc[n]),Zv(e.sc[n],t)}Yv.prototype=Object.assign(Object.create(Wl.prototype),{constructor:Yv,load:function(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=new Kl(this.manager);a.setResponseType("json");var o=this;a.load(e,(function(e){o.data=e;var n=o.parse(r);t(n)}),n,i)},isInBox:function(e,t,n,i,r,a){return!(e<n||e>r||t<i||t>a)},parse:function(e){for(var t=[],n=this.data,i=0,r=0,a=0,o=0,s=0;s<n.length;s++)0===n[s].b&&n[s].d&&Array.isArray(n[s].d)&&(i+=n[s].d[0],r+=n[s].d[1],a+=n[s].d[2],o++);i/=o,r/=o,a/=o;for(var l=0;l<n.length;l++){var A=(new Ov).fromArray(n[l].d);A.y-=r;var c=new tt(n[l].x,n[l].z),h=(new tt).setScalar(n[l].e);e||this.root.localToWorld(A);var u=new an(A,n[l].c);u.id=l,u.acfi=n[l].a,u.acfl=n[l].b,u.ec=c,u.e=(new jc).setFromCenterAndSize(c,h),u.sc=[],void 0===t[u.acfl]&&(t[u.acfl]=[]),t[u.acfl].push(u)}for(var d=[],f=0,p=t[0].length;f<p;f++)d.push(t[0][f]);var m=d.length;if(t.length>1)for(var v=1;v<t.length;v++)for(var g=0,y=t[v].length;g<y;g++){for(var w=v-1,x=0,b=d;x<=w;){if(0==x){for(var M=0;M<m;M++)if(d[M].e.containsPoint(t[v][g].ec)){b=d[M];break}}else for(var C=0,B=b.sc.length;C<B;C++)if(b.sc[C].e.containsPoint(t[v][g].ec)){b=b.sc[C];break}x++}b.sc.push(t[v][g])}for(var E=0;E<m;E++)Kv(d[E]);for(var S=[],T=0;T<m;T++)S[d[T].id]=d[T],Zv(d[T],(function(e){S[e.id]=e}));for(var _=0,I=S.length;_<I;_++)delete S[_].sc,delete S[_].e,delete S[_].ec;return{levels:S,center:{x:i,y:r,z:a}}}});var Jv={wheeltime:0,WHEELMAX:300,initLevelDetect:function(e,t){Jv.detect=t,e.addEventListener("wheel",(function(e){e.preventDefault(),Jv.wheeltime=Date.now(),setTimeout((function(){Date.now()-Jv.wheeltime>=Jv.WHEELMAX&&t()}),Jv.WHEELMAX)}),!1),e.addEventListener("mouseup",(function(e){e.preventDefault(),Jv.detect(),t()}),!1),e.addEventListener("touchend",(function(e){e.preventDefault(),t()}),!1)}},qv=function(e){this.camera=e,this.focusLevels=function(e){for(var t=0,n=0,i=0,r=0,a=0,o=0,s=0,l=0,A=1e-6,c=0;c<e.length;c++)A+=e[c].center.y,0===c?(t=e[c].center.x,n=e[c].center.x,i=e[c].center.z,r=e[c].center.z,a=e[c].radius,o=e[c].radius,s=e[c].radius,l=e[c].radius):(e[c].center.x<t?(t=e[c].center.x,a=e[c].radius):e[c].center.x>n&&(n=e[c].center.x,o=e[c].radius),e[c].center.z<r?(r=e[c].center.z,l=e[c].radius):e[c].center.z>i&&(i=e[c].center.z,s=e[c].radius));var h=new at(t-a,A/=e.length,r-l),u=new at(n+o,A,i+s),d=new at((h.x+u.x)/2,A,(h.z+u.z)/2),f=Math.abs(h.x-u.x),p=Math.abs(h.z-u.z),m=Math.tan(Math.PI/180*.5*this.camera.fov),v=p/2/m,g=f/this.camera.aspect/2/m,y=(new at).copy(d);return y.y+=v>g?v:g,this.camera.position.copy(y),this.camera.lookAt(d),this.camera.updateProjectionMatrix(),d},this.focusSimple=function(){return this.camera.position.copy(new at(0,1e3,0)),this.camera.lookAt(new at),this.camera.updateProjectionMatrix(),new at}},$v=xd("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewoJJ3VzZSBzdHJpY3QnOwoKCWZ1bmN0aW9uIFZlY3RvcjMoeCwgeSwgeikgewoJICB0aGlzLnggPSB4IHx8IDA7CgkgIHRoaXMueSA9IHkgfHwgMDsKCSAgdGhpcy56ID0geiB8fCAwOwoJfQoKCU9iamVjdC5hc3NpZ24oVmVjdG9yMy5wcm90b3R5cGUsIHsKCSAgaXNWZWN0b3IzOiB0cnVlLAoJICBzZXQ6IGZ1bmN0aW9uIHNldCh4LCB5LCB6KSB7CgkgICAgdGhpcy54ID0geDsKCSAgICB0aGlzLnkgPSB5OwoJICAgIHRoaXMueiA9IHo7CgkgICAgcmV0dXJuIHRoaXM7CgkgIH0sCgkgIGNvcHk6IGZ1bmN0aW9uIGNvcHkodikgewoJICAgIHRoaXMueCA9IHYueDsKCSAgICB0aGlzLnkgPSB2Lnk7CgkgICAgdGhpcy56ID0gdi56OwoJICAgIHJldHVybiB0aGlzOwoJICB9LAoJICBkb3Q6IGZ1bmN0aW9uIGRvdCh2KSB7CgkgICAgcmV0dXJuIHRoaXMueCAqIHYueCArIHRoaXMueSAqIHYueSArIHRoaXMueiAqIHYuejsKCSAgfSwKCSAgbGVuZ3RoU3E6IGZ1bmN0aW9uIGxlbmd0aFNxKCkgewoJICAgIHJldHVybiB0aGlzLnggKiB0aGlzLnggKyB0aGlzLnkgKiB0aGlzLnkgKyB0aGlzLnogKiB0aGlzLno7CgkgIH0sCgkgIGxlbmd0aDogZnVuY3Rpb24gbGVuZ3RoKCkgewoJICAgIHJldHVybiBNYXRoLnNxcnQodGhpcy54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AgICAgICAgICAgICAgYTogci5pbmRleAoJICAgICAgICAgICAgfSk7CgkgICAgICAgICAgICByLmFib3J0KCk7CgkgICAgICAgICAgICByLmluZGV4ID0gbnVsbDsKCSAgICAgICAgICAgIHIgPSBudWxsOwoJICAgICAgICAgIH0KCSAgICAgICAgfQoJICAgICAgfQoKCSAgICAgIHZhciBsZXZlbCA9IGV2dC5kYXRhLmxldmVsOwoJICAgICAgdmFyIGluZGV4ID0gZXZ0LmRhdGEuaW5kZXg7CgkgICAgICB2YXIgbHIgPSBuZXcgTW9kZWxMb2FkZXIoKS5sb2FkKGV2dC5kYXRhLm11cmwsIGZ1bmN0aW9uIChnZW9EYXRhKSB7CgkgICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoewoJICAgICAgICAgIGE6IGdlb0RhdGEuYSwKCSAgICAgICAgICBiOiBsZXZlbCwKCSAgICAgICAgICBjOiBnZW9EYXRhLmMsCgkgICAgICAgICAgZDogaW5kZXgsCgkgICAgICAgICAgcDogZ2VvRGF0YS5wLAoKCSAgICAgICAgICAvKm46Z2VvRGF0YS5uLCovCgkgICAgICAgICAgdTogZ2VvRGF0YS51LAoJICAgICAgICAgIGk6IGdlb0RhdGEuaQoJICAgICAgICB9LCBbZ2VvRGF0YS5wLmJ1ZmZlciwKCSAgICAgICAgLypnZW9EYXRhLm4uYnVmZmVyLCovCgkgICAgICAgIGdlb0RhdGEudS5idWZmZXIsIGdlb0RhdGEuaS5idWZmZXJdKTsKCSAgICAgICAgbG9hZGluZ1tpbmRleF0gPSB1bmRlZmluZWQ7CgkgICAgICB9LCBmdW5jdGlvbiAobSkge30sIGZ1bmN0aW9uIChtKSB7CgkgICAgICAgIGxvYWRpbmdbaW5kZXhdID0gdW5kZWZpbmVkOwoJICAgICAgICBzZWxmLnBvc3RNZXNzYWdlKHsKCSAgICAgICAgICB4OiBpbmRleAoJICAgICAgICB9KTsKCSAgICAgIH0pOwoJICAgICAgbHIuZW5kID0gZmFsc2U7CgkgICAgICBsci5pbmRleCA9IGluZGV4OwoJICAgICAgbG9hZGluZ1tpbmRleF0gPSBscjsKCSAgICAgIGJyZWFrOwoKCSAgICBjYXNlICJjYW5jZWwiOgoJICAgICAgdmFyIGNpbmRleCA9IGV2dC5kYXRhLmRhdGE7CgoJICAgICAgZm9yICh2YXIgX2kgPSAwLCBjID0gY2luZGV4Lmxlbmd0aDsgX2kgPCBjOyBfaSsrKSB7CgkgICAgICAgIHZhciBzZCA9IGNpbmRleFtfaV07CgoJICAgICAgICBpZiAobG9hZGluZ1tzZF0gJiYgIWxvYWRpbmdbc2RdLmVuZCkgewoJICAgICAgICAgIHNlbGYucG9zdE1lc3NhZ2UoewoJICAgICAgICAgICAgeDogbG9hZGluZ1tzZF0uaW5kZXgKCSAgICAgICAgICB9KTsKCSAgICAgICAgICBsb2FkaW5nW3NkXS5hYm9ydCgpOwoJICAgICAgICAgIGxvYWRpbmdbc2RdID0gdW5kZWZpbmVkOwoJICAgICAgICB9CgkgICAgICB9CgoJICAgICAgYnJlYWs7CgkgIH0KCX07Cgp9KSgpOwoK",null,!1),tg="load",ng="init",ig="detect",rg="cancel";function ag(e){var t=this;this.scene=e,this.loadNum=3,this.loadMaxPT=2,this.currentNum=0,this.pLoadMaxPT=3,this.detectNum=1,this.loadWorkers=[],this.detectWorkers=[],this.todol=[],this.todod=[];for(var n=this,i=function(e){var i=new eg;i.isLoader=!0,i.num=0,i.onmessage=function(e){n.currentNum--,i.num--,n.loadEnd&&e.data&&(void 0!==e.data.d?n.loadEnd(e.data):void 0!==e.data.x&&(n.scene.loading[e.data.x]=void 0))},i.sendMessage=function(e){n.currentNum++,i.num++,i.postMessage(e)},t.loadWorkers.push(i)},r=0;r<this.loadNum;r++)i();for(var a=function(e){var i=new $v;i.isDetect=!0,i.running=!1,i.onmessage=function(e){i.running=!1,n.detectEnd&&n.detectEnd(e.data)},i.sendMessage=function(e){e.type==ig&&(i.running=!0),i.postMessage(e)},t.detectWorkers.push(i)},o=0;o<this.detectNum;o++)a();this.setTask=function(e){switch(e.type){case ng:case ig:this.todod=[e];break;case tg:this.todol=e.data;break;case rg:for(var t=0;t<this.loadNum;t++)this.loadWorkers[t].postMessage(e)}},this.setLoadEnd=function(e){this.loadEnd=e},this.setDetectEnd=function(e){this.detectEnd=e},this.update=function(){if(this.todol.length>0)for(var e=0;e<this.loadNum;e++)if(this.loadWorkers[e].num<this.loadMaxPT){var t=this.todol.pop();if(!t)break;this.scene.loading[t.index]={},this.loadWorkers[e].sendMessage(t),t.murl=null,t=null}if(this.todod.length>0)for(var n=0;n<this.detectNum;n++)if(!this.detectWorkers[n].running){var i=this.todod.pop();if(!i)break;this.detectWorkers[n].sendMessage(i),i.pos=null,i.state=null,i=null}}}var og={};function sg(e){this.pathUtil=e}function lg(e,t,n,i){this.scene=e,this.manager=t,this.pathUtil=n,this.root=i}function Ag(){this.GlobalParams={cbase:"http://172.16.10.37:8002/Data/ACFData/",tbase:"http://172.16.10.37:8002/Data/ACFData/",mbase:"http://172.16.10.37:8002/Data/ACFData/"}}og.mflag=!1,og.lflag=!1,og.pflag=!1,og.renderBefore=[],og.renderAfter=[],og.renderExtra=[],og.renderBeforeCount=0,og.renderAfterCount=0,og.renderExtraCount=0,og.resize=function(e){og.renderer.domElement.getBoundingClientRect(),og.lflag=!0},og.init=function(e,t,n){og.renderer=e,og.scene=t,og.camera=n,e.domElement.addEventListener("wheel",(function(e){e.preventDefault(),og.lflag=!0}),!1),e.domElement.addEventListener("mousedown",(function(e){e.preventDefault(),og.mflag=!0}),!1),e.domElement.addEventListener("touchstart",(function(e){e.preventDefault(),og.mflag=!0}),!1),e.domElement.addEventListener("mouseup",(function(e){e.preventDefault(),og.mflag=!1}),!1),e.domElement.addEventListener("touchend",(function(e){e.preventDefault(),og.mflag=!1}),!1),window.addEventListener("resize",og.resize,!1),og.resize()},og.addBefore=function(e){og.renderBefore.push(e),og.renderBeforeCount=og.renderBefore.length},og.addAfter=function(e){og.renderAfter.push(e),og.renderAfterCount=og.renderAfter.length},og.addExtra=function(e){og.renderExtra.push(e),og.renderExtraCount=og.renderExtra.length},og.render=function(){for(var e=0;e<og.renderExtraCount;e++)og.renderExtra[e]()},sg.prototype=Object.assign(sg.prototype,{constructor:sg,load:function(e){var t=this.parse(e);return(new tA).load(this.parseTextureUrl(e),(function(e){t&&t.material?(t.material.color.setRGB(1,1,1),t.material.map=e,t.material.transparent=!1,t.material.opacity=1,t.material.needsUpdate=!0,og.lflag=!0):e&&(e.dispose(),e=null)})),t},parse:function(e){var t=this.parseGeometry(e),n=new Nn;n.color.setHex(738436),n.transparent=!0,n.opacity=.2,n.side=2;var i=new Ei(t,n);return i.mid=e.a,i.level=e.b,i.index=e.d,i.ticket=0,e.c.length>0&&i.applyMatrix4((new bt).fromArray(e.c)),i},parseTextureUrl:function(e){return this.pathUtil.generatePicturePath(e.b,e.a)},parseGeometry:function(e){var t=new si;return t.name=e.a,t.setAttribute("position",new Zn(e.p,3)),t.setAttribute("uv",new Zn(e.u,2)),t.setIndex(new Zn(e.i,1)),t.clearGroups(),t.addGroup(0,e.i.length,0),t}}),lg.prototype=Object.assign(lg.prototype,{constructor:lg,load:function(e){for(var t=0;t<this.scene.loading.length;t++)this.scene.loading[t]&&(this.scene.loading[t].keep=!1);for(var n=0;n<this.scene.loaded.length;n++)this.scene.loaded[n]&&(this.scene.loaded[n].keep=!1);for(var i=0,r=e.length;i<r;i++)this.scene.loaded[e[i].v]?this.scene.loaded[e[i].v].keep=!0:this.scene.loading[e[i].v]?this.scene.loading[e[i].v].keep=!0:e[i].load=!0;var a={};a.type=rg,a.data=[];for(var o=0;o<this.scene.loading.length;o++)this.scene.loading[o]&&(this.scene.loading[o].keep||a.data.push(o));a.data.length>0&&this.manager.setTask(a);var s={};s.type=tg,s.data=[];var l=this.pathUtil;this.scene.toload=[];for(var A=0;A<e.length;A++)if(e[A].load){var c={};c.type=tg,c.level=e[A].l,c.index=e[A].v,c.murl=l.generateModelPath(c.level,e[A].i),s.data.push(c),this.scene.toload[e[A].v]=1}this.manager.setTask(s);for(var h=0;h<this.scene.loaded.length;h++)if(this.scene.loaded[h]&&!this.scene.loaded[h].keep){for(var u=!1,d=this.scene.levels[h];d.pid;){if(this.scene.toload[d.pid]){u=!0;break}d=this.scene.levels[d.pid]}if(u)continue;if((d=this.scene.levels[h]).cid){for(var f=[],p=0;p<d.cid.length;p++)f.push(d.cid[p]);for(;f.length>0;){for(var m=[],v=0,g=f.length;v<g;v++){if(this.scene.toload[f[v]]){u=!0;break}if(this.scene.levels[f[v]].cid)for(var y=0,w=this.scene.levels[f[v]].cid.length;y<w;y++)m.push(this.scene.levels[f[v]].cid[y])}if(u){m=[],f=[];break}f=[];for(var x=0,b=m.length;x<b;x++)f.push(m[x])}}u||(this.root.remove(this.scene.loaded[h]),this.scene.loaded[h].material.map&&(this.scene.loaded[h].material.map.dispose(),this.scene.loaded[h].material.map=null),this.scene.loaded[h].material.dispose(),this.scene.loaded[h].geometry.dispose(),this.scene.loaded[h].geometry.attributes.position.array=null,this.scene.loaded[h].geometry.attributes.uv.array=null,this.scene.loaded[h].geometry.index.array=null,this.scene.loaded[h].geometry=null,this.scene.loaded[h].material=null,this.scene.loaded[h]=void 0)}}}),Ag.prototype={config:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.isLocal=t,(e.mb||e.cb||e.tb)&&(e.mb?this.GlobalParams.mbase=e.mb:e.cb?this.GlobalParams.mbase=e.cb:e.tb&&(this.GlobalParams.mbase=e.tb),e.cb?this.GlobalParams.cbase=e.cb:e.mb?this.GlobalParams.cbase=e.mb:e.tb&&(this.GlobalParams.cbase=e.tb),e.tb?this.GlobalParams.tbase=e.tb:e.mb?this.GlobalParams.tbase=e.mb:e.cb&&(this.GlobalParams.tbase=e.cb)),this},generateModelPath:function(e,t){return this.GlobalParams.mbase+e+"/"+t+(this.isLocal?".json":".json.gz")},generatePicturePath:function(e,t){return this.GlobalParams.tbase+e+"/maps/"+t+".jpg"},generateConfigPath:function(e){return this.GlobalParams.cbase+e}},new Nc;var cg=new bt,hg=new Wi,ug=function(){function e(t){s(this,e),this.baseUrl=t}return A(e,[{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.viewer=e,this.scene=e.scene,this.camera=e.camera,this.renderer=e.renderer,this.sceneGroup=n.root,this.render=e.render,this.initCamera=n.initCamera,this.center={x:0,y:0,z:0},this.pathUtil=(new Ag).config(this.baseUrl,n.isLocal||!1),this.sources={loaded:[],loading:[],nlp:[],levels:[]},this.currCount=0,this.currLoaded=0;var i=new ag(this.sources);this.workerManager=i,n&&(og.pflag=void 0!==n.preloading&&n.preloading,i.loadNum=void 0!==n.concurrency?n.concurrency:i.loadNum,i.loadMaxPT=void 0!==n.capacity?n.capacity:i.loadMaxPT),i.setLoadEnd((function(e){if(t.currLoaded++,t.currLoaded>=t.currCount&&t.loadEnd&&t.loadEnd(),t.initLoad&&(t.initLoad(),t.initLoad=null),t.sources.loaded[e.d]);else{var n=new sg(t.pathUtil).load(e),i=t.sources,r=t.center.y;n.position.y=-r,n.keep=!0,t.sceneGroup.add(n),i.loading[n.index]=void 0,i.loaded[n.index]=n;for(var a=!1,o=i.levels[n.index];o.pid;){if(i.loaded[o.pid]&&!i.loaded[o.pid].keep){for(var s=[],l=0;l<i.levels[o.pid].cid.length;l++)i.levels[o.pid].cid[l]!=n.index&&s.push(i.levels[o.pid].cid[l]);for(;s.length>0;){for(var A=[],c=0,h=s.length;c<h;c++){if(!i.loaded[s[c]]&&i.toload[s[c]]){a=!0;break}if(i.levels[s[c]].cid)for(var u=0,d=i.levels[s[c]].cid.length;u<d;u++)i.levels[s[c]].cid[u]!=n.index&&(A.push(i.levels[s[c]].cid[u]),void 0===i.levels[s[c]].cid[u]&&(console.log(i.levels[s[c]]),console.log(u,c,s[c])))}if(a){A=[],s=[];break}s=[];for(var f=0,p=A.length;f<p;f++)s.push(A[f])}a||(t.sceneGroup.remove(i.loaded[o.pid]),i.loaded[o.pid].material.map&&(i.loaded[o.pid].material.map.dispose(),i.loaded[o.pid].material.map=null),i.loaded[o.pid].material.dispose(),i.loaded[o.pid].geometry.dispose(),i.loaded[o.pid].geometry.attributes.position.array=null,i.loaded[o.pid].geometry.attributes.uv.array=null,i.loaded[o.pid].geometry.index.array=null,i.loaded[o.pid].geometry=null,i.loaded[o.pid].material=null,i.loaded[o.pid]=void 0)}o=i.levels[o.pid]}if((o=i.levels[n.index]).cid){for(var m=[],v=0;v<o.cid.length;v++)m.push(o.cid[v]);for(;m.length>0;){for(var g=[],y=0,w=m.length;y<w;y++)if(i.loaded[m[y]]&&!i.loaded[m[y]].keep)t.sceneGroup.remove(i.loaded[m[y]]),i.loaded[m[y]].material.map&&(i.loaded[m[y]].material.map.dispose(),i.loaded[m[y]].material.map=null),i.loaded[m[y]].material.dispose(),i.loaded[m[y]].geometry.dispose(),i.loaded[m[y]].geometry.attributes.position.array=null,i.loaded[m[y]].geometry.attributes.uv.array=null,i.loaded[m[y]].geometry.index.array=null,i.loaded[m[y]].geometry=null,i.loaded[m[y]].material=null,i.loaded[m[y]]=void 0;else if(i.levels[m[y]].cid)for(var x=0,b=i.levels[m[y]].cid.length;x<b;x++)g.push(i.levels[m[y]].cid[x]);m=[];for(var M=0,C=g.length;M<C;M++)m.push(g[M])}}}})),i.setDetectEnd((function(e){t.currLoaded=0,t.currCount=e.length,new lg(t.sources,i,t.pathUtil,t.sceneGroup).load(e)})),og.init(this.renderer,this.scene,this.camera),og.addExtra((function(){t.workerManager.update()})),og.pflag&&og.addExtra((function(){i.preloading=!og.mflag&&!og.lflag&&0==i.currentNum}))}},{key:"load",value:function(e,t){var n=this;this.initLoad=t,this.levelLoader=new Yv,this.levelLoader.root=this.sceneGroup,this.levelLoader.load(this.pathUtil.generateConfigPath(e),(function(e){var t=e.levels,i=e.center;n.center=i,n.sources.levels=t,n.sources.center={x:0,y:0,z:0};var r={};if(r.type=ng,r.data=n.sources.levels,r.center=n.sources.center,n.workerManager.setTask(r),!n.viewer.isGISViewer){var a=new qv(n.camera).focusLevels(n.sources.levels);n.initCamera&&(n.viewer.controls.target.copy(a),n.viewer.controls.update(),n.viewer.camera.position.x=a.x,n.viewer.camera.position.z=a.z)}og.lflag=!0,og.render(!1),n.viewer.render(),Jv.initLevelDetect(n.viewer.map?n.viewer.map.canvas:n.renderer.domElement,(function(){n.detect()})),n.workerManager.update(),n.viewer.controls.update(),setTimeout((function(){n.detect()}),100)}))}},{key:"updateLevels",value:function(){var e=this.levelLoader.parse().levels,t=this.sceneGroup.getWorldScale().x;e.map((function(e){e.radius=e.radius*t})),this.sources.levels=e;var n={};n.type=ng,n.data=this.sources.levels,n.center=this.sources.center,this.workerManager.setTask(n)}},{key:"detect",value:function(){var e={};e.type=ig,e.pos=this.camera.position.toArray(),cg.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),e.state=hg.setFromMatrix(cg).toArray(),this.workerManager.setTask(e)}},{key:"renderBefore",value:function(){for(var e=0;e<og.renderBeforeCount;e++)og.renderBefore[e]()}},{key:"renderAfter",value:function(){for(var e=0;e<og.renderAfterCount;e++)og.renderAfter[e]();og.lflag&&(og.lflag=!1);for(var t=0;t<og.renderExtraCount;t++)og.renderExtra[t]()}}]),e}(),dg=function(){function e(t){s(this,e),void 0===t&&console.error("参数缺少viewer"),this.viewer=t,this.initialize()}return A(e,[{key:"initialize",value:function(){var e=this;this.largeSceneGroup=this.viewer.modelGroup,this.loaders=[],this.viewer.addEventListener("update",(function(){e.loaders.map((function(e){e&&e.renderBefore()})),e.loaders.map((function(e){e&&e.renderAfter()}))}))}},{key:"load",value:function(e,t,n){var i=new zt;i.path=e,i.isLargeScene=!0,void 0===this.viewer.isMapViewer&&this.largeSceneGroup.add(i),e=e.endsWith("/")?e:e+"/";var r=new ug({cb:e});return r.init(this.viewer,{initCamera:!0,root:i,isLocal:n}),this.loaders.push(r),i.loader=r,r.load(n?"level.json":"level.json.gz",(function(){t&&t(i)})),i}}]),e}(),fg=function(){function e(t,n){s(this,e),this.dv=new DataView(t),this.offset=0,this.littleEndian=void 0===n||n}return A(e,[{key:"getOffset",value:function(){return this.offset}},{key:"setOffset",value:function(e){this.offset=e}},{key:"size",value:function(){return this.dv.buffer.byteLength}},{key:"skip",value:function(e){this.offset+=e}},{key:"getBoolean",value:function(){return 1==(1&this.getUint8())}},{key:"getBooleanArray",value:function(e){for(var t=[],n=0;n<e;n++)t.push(this.getBoolean());return t}},{key:"getUint8",value:function(){var e=this.dv.getUint8(this.offset);return this.offset+=1,e}},{key:"getUint8Array",value:function(e){for(var t=new Uint8Array(e),n=0;n<e;n++)t[n]=this.getUint8();return t}},{key:"getInt16",value:function(){var e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}},{key:"getUint16",value:function(e){if(null!=e)return this.dv.getUint16(e,this.littleEndian);var t=this.dv.getUint16(this.offset,this.littleEndian);return this.offset+=2,t}},{key:"getUint16Array",value:function(e){for(var t=new Uint16Array(e),n=0;n<e;n++)t[n]=this.getUint16();return t}},{key:"getInt32",value:function(){var e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}},{key:"getInt32Array",value:function(e){for(var t=new Int32Array(e),n=0;n<e;n++)t[n]=this.getInt32();return t}},{key:"getUint32",value:function(){var e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}},{key:"getUint32Array",value:function(e){for(var t=new Uint32Array(e),n=0;n<e;n++)t[n]=this.getUint32();return t}},{key:"getMatrix4",value:function(){for(var e=new Matrix4,t=0;t<16;t++)e.elements[t]=this.getFloat32();return e}},{key:"getVector3",value:function(){for(var e=new at,t=0;t<3;t++)e.setComponent(t,this.getFloat32());return e}},{key:"getArray3",value:function(){for(var e=[],t=0;t<3;t++)e.push(this.getFloat32());return e}},{key:"getVector2",value:function(){for(var e=new tt,t=0;t<2;t++)e.setComponent(t,this.getFloat32());return e}},{key:"getArray2",value:function(){for(var e=[],t=0;t<2;t++)e.push(this.getFloat32());return e}},{key:"getInt64",value:function(){var e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),2147483648&t?(t=4294967295&~t,4294967295===(e=4294967295&~e)&&(t=t+1&4294967295),-(4294967296*t+(e=e+1&4294967295))):4294967296*t+e}},{key:"getInt64Array",value:function(e){for(var t=[],n=0;n<e;n++)t.push(this.getInt64());return t}},{key:"getUint64",value:function(){var e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),4294967296*t+e}},{key:"getFloat32",value:function(e){if(null!=e)return this.dv.getFloat32(e,this.littleEndian);var t=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}},{key:"getFloat32Array",value:function(e){for(var t=new Float32Array(e),n=0;n<e;n++)t[n]=this.getFloat32();return t}},{key:"getFloat64",value:function(){var e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}},{key:"getFloat64Array",value:function(e){for(var t=new Float64Array(e),n=0;n<e;n++)t[n]=this.getFloat64();return t}},{key:"getArrayBuffer",value:function(e){var t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}},{key:"getString",value:function(e){for(var t=[],n=0;n<e;n++)t[n]=this.getUint8();var i=t.indexOf(0);return i>=0&&(t=t.slice(0,i)),LoaderUtils.decodeText(new Uint8Array(t))}}]),e}(),pg=function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}};function mg(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===t||t}mg.prototype={constructor:mg,getOffset:function(){return this.offset},setOffset:function(e){this.offset=e},size:function(){return this.dv.buffer.byteLength},skip:function(e){this.offset+=e},getBoolean:function(){return 1==(1&this.getUint8())},getBooleanArray:function(e){for(var t=[],n=0;n<e;n++)t.push(this.getBoolean());return t},getUint8:function(){var e=this.dv.getUint8(this.offset);return this.offset+=1,e},getUint8Array:function(e){for(var t=new Uint8Array(e),n=0;n<e;n++)t[n]=this.getUint8();return t},getInt16:function(){var e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e},getUint16:function(e){if(null!=e)return this.dv.getUint16(e,this.littleEndian);var t=this.dv.getUint16(this.offset,this.littleEndian);return this.offset+=2,t},getUint16Array:function(e){for(var t=new Uint16Array(e),n=0;n<e;n++)t[n]=this.getUint16();return t},getInt32:function(){var e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e},getInt32Array:function(e){for(var t=new Int32Array(e),n=0;n<e;n++)t[n]=this.getInt32();return t},getUint32:function(){var e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e},getUint32Array:function(e){for(var t=new Uint32Array(e),n=0;n<e;n++)t[n]=this.getUint32();return t},getMatrix4:function(){for(var e=new Matrix4,t=0;t<16;t++)e.elements[t]=this.getFloat32();return e},getVector3:function(){for(var e=[],t=0;t<3;t++)e.push(this.getFloat32());return e},getVector2:function(){for(var e=[],t=0;t<2;t++)e.push(this.getFloat32());return e},getInt64:function(){var e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),2147483648&t?(t=4294967295&~t,4294967295===(e=4294967295&~e)&&(t=t+1&4294967295),-(4294967296*t+(e=e+1&4294967295))):4294967296*t+e},getInt64Array:function(e){for(var t=[],n=0;n<e;n++)t.push(this.getInt64());return t},getUint64:function(){var e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),4294967296*t+e},getFloat32:function(e){if(null!=e)return this.dv.getFloat32(e,this.littleEndian);var t=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t},getFloat32Array:function(e){for(var t=new Float32Array(e),n=0;n<e;n++)t[n]=this.getFloat32();return t},getFloat64:function(){var e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e},getFloat64Array:function(e){for(var t=[],n=0;n<e;n++)t.push(this.getFloat64());return t},getArrayBuffer:function(e){var t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},getString:function(e){for(var t=[],n=0;n<e;n++)t[n]=this.getUint8();var i=t.indexOf(0);return i>=0&&(t=t.slice(0,i)),pg(new Uint8Array(t))}};var vg=1,gg=2,yg=3,wg=4;var xg=function(){function e(t){var n=this;s(this,e),this.sceneManager=t,this.path="",this.loadingTasks={},this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerSourceURL="",this.currentNum=0,this.loadNum=3,this.loadMaxPT=2,this.loadWorkers=[],this.basisLoader=void 0,this.haveNewLoadTaskFlag=!1,this.cachePrioLoadTaskList=[],this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},this.setDecoderPath(If.getDecoderPath()),this._initDecoder().then((function(){n._initWorkers()}))}return A(e,[{key:"dispose",value:function(){this.sceneManager=null,this.path="",this.loadingTasks={},this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerSourceURL="",this.basisLoader.dispose(),this.basisLoader=null,this.loadWorkers.forEach((function(e){return e.terminate()})),this.loadWorkers=[],this.cachePrioLoadTaskList=[],this.haveNewLoadTaskFlag=!1}},{key:"setPath",value:function(e){this.path=e}},{key:"setDecoderConfig",value:function(e){return this.decoderConfig=e,this}},{key:"_loadLibrary",value:function(e,t){var n=new Kl(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),new Promise((function(t,i){n.load(e,t,void 0,i)}))}},{key:"setDecoderPath",value:function(e){return this.decoderPath=e,this}},{key:"_initDecoder",value:function(){var t=this;if(this.decoderPending)return this.decoderPending;var n="object"!==("undefined"==typeof WebAssembly?"undefined":r(WebAssembly))||"js"===this.decoderConfig.type,i=[];return n?i.push(this._loadLibrary("../amrt_decoder.js","text")):(i.push(this._loadLibrary("../amrt_wasm_wrapper.js","text")),i.push(this._loadLibrary("../../amrt_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(i).then((function(i){var r=i[0];n||(t.decoderConfig.wasmBinary=i[1]);var a=e.MrbsLoaderWorker.toString(),o=["/* draco decoder */",r,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join("\n");t.workerSourceURL=URL.createObjectURL(new Blob([o]))})),this.decoderPending}},{key:"_initWorkers",value:function(){for(var e=this,t=0;t<this.loadNum;t++){var n=new Worker(this.workerSourceURL);n.isLoader=!0,n.num=0,n.postMessage({type:"init",decoderConfig:this.decoderConfig}),n.onmessage=function(t){if(e.currentNum--,this.num--,t.data.succ)e.loadingTasks[t.data.file]=void 0,e.onReceiveMessageFromWebworker(t.data.file,t.data);else{var n=e.loadingTasks[t.data.file];void 0!==n&&n.state===yg&&(n.state=vg)}},n.sendMessage=function(t){e.currentNum++,this.num++,this.postMessage(t)},this.loadWorkers.push(n)}}},{key:"AddLoadTask",value:function(e){this.loadingTasks[e.file]=e,this.haveNewLoadTaskFlag=!0}},{key:"RefreshLoadFlag",value:function(){this.haveNewLoadTaskFlag=!0}},{key:"onReceiveMessageFromWebworker",value:function(e,t){var n=this,i=t.retData.texs.length,r=0;i>0?t.retData.texs.forEach((function(a){void 0===n.basisLoader&&(n.basisLoader=new Xf,n.basisLoader.setTranscoderPath(function(){var e="js/";if(document.getElementById("AMRT")){var t=document.getElementById("AMRT").src;e=t.slice(0,t.lastIndexOf("/"))+"/"}else for(var n=0;n<document.scripts.length;n++){var i=document.scripts[n];i.src&&"app.js"===i.src.slice(i.src.lastIndexOf("/")+1)&&(e=i.src.slice(0,i.src.lastIndexOf("/"))+"/")}return e}())),n.basisLoader.detectSupport(n.sceneManager.viewer.renderManager.getRenderer()).loadFromBuffer(a.imageArray.buffer,(function(o){a.imageArray=void 0,o.generateMipmaps=!0,a.tex=o,++r>=i&&n.sceneManager.onCompleteFileLoad(t.retData,e)}),(function(e){console.log("Error: Load basisu texture failed!!! errorCode: "+e)}))})):this.sceneManager.onCompleteFileLoad(t.retData,e)}},{key:"HandleFrameFileLoad",value:function(){var e=this;if(this.haveNewLoadTaskFlag){this.haveNewLoadTaskFlag=!1,this.cachePrioLoadTaskList=[];var t=!1;for(var n in this.loadingTasks){var i=this.loadingTasks[n];void 0!==i&&(i.state!==wg&&(i.priority=this.sceneManager.GetFilePriority(n,i.prioLevel,i.bReplace),i.state===gg?(i.priority,Number.MAX_VALUE):i.state===vg?(this.sceneManager.loadedAllInitChunkComplete||t||0===i.prioLevel&&(t=!0),i.priority===Number.MAX_VALUE&&i.prioLevel>0&&this.sceneManager.CheckIsFixedCamera()?this.sceneManager.CancelLoadingTask(n):this.cachePrioLoadTaskList.push(i)):i.state===yg&&this.sceneManager.CancelLoadingTask(n)))}this.sceneManager.loadedAllInitChunkComplete||t||(this.sceneManager.loadedAllInitChunkComplete=!0),this.cachePrioLoadTaskList.sort((function(e,t){return t.priority-e.priority}))}if([].forEach((function(t){var n={type:"cancel"};n.file=t.file,t.state=yg,e.loadWorkers[t.loaderInx].postMessage(n)})),this.cachePrioLoadTaskList.length>0)for(var r=0;r<this.loadNum;r++)if(this.loadWorkers[r].num<this.loadMaxPT){var a=this.cachePrioLoadTaskList.pop();if(!a)break;if(a.state===yg)this.sceneManager.CancelLoadingTask(a.file);else{var o=this.path+a.chunkIndex+"/"+a.level+"/"+a.file+".mrbs",s={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1},l={};l.murl=o,l.file=a.file,l.type="load",l.taskConfig=s,a.state=gg,a.loaderInx=r,this.loadWorkers[r].sendMessage(l)}}}}]),e}();xg.MrbsLoaderWorker=function(){var e,t,n={};function i(e,t,n,i){i.attributeIDs,i.attributeTypes;var a,o,s=i.decodeType,l=t.GetEncodedGeometryType(n);if(l===e.TRIANGULAR_MESH)a=new e.Mesh,o=t.DecodeBufferToMesh(n,a);else{if(l!==e.POINT_CLOUD)throw new Error("DRACOLoader: Unexpected geometry type.");a=new e.PointCloud,o=t.DecodeBufferToPointCloud(n,a)}if(!o.ok()||0===a.ptr)throw new Error("DRACOLoader: Decoding failed: "+o.error_msg());var A,c={index:null,attributes:[]};if(1===s)A=t.GetAttribute(a,0),c.attributes.push(r(e,t,a,"position",Float32Array,A));else{if(2!==s)throw new Error("DRACOLoader: Unexpected Draco_Data_Type.");A=t.GetAttribute(a,0),c.attributes.push(r(e,t,a,"index",Uint32Array,A))}return c.numPoints=a.num_points(),e.destroy(a),c}function r(e,t,n,i,r,a){var o,s,l=a.num_components(),A=n.num_points()*l;switch(r){case Float32Array:var c=4*A;o=e._malloc(c),t.GetAttributeDataArrayForAllPoints(n,a,e.DT_FLOAT32,c,o),s=new Float32Array(e.HEAPF32.buffer,o,A).slice(),e._free(o);break;case Int8Array:o=e._malloc(A),t.GetAttributeDataArrayForAllPoints(n,a,e.DT_INT8,A,o),s=new Int8Array(e.HEAP8.buffer,o,A).slice(),e._free(o);break;case Int16Array:c=2*A;o=e._malloc(c),t.GetAttributeDataArrayForAllPoints(n,a,e.DT_INT16,c,o),s=new Int16Array(e.HEAP16.buffer,o,A).slice(),e._free(o);break;case Int32Array:c=4*A;o=e._malloc(c),t.GetAttributeDataArrayForAllPoints(n,a,e.DT_INT32,c,o),s=new Int32Array(e.HEAP32.buffer,o,A).slice(),e._free(o);break;case Uint8Array:o=e._malloc(A),t.GetAttributeDataArrayForAllPoints(n,a,e.DT_UINT8,A,o),s=new Uint8Array(e.HEAPU8.buffer,o,A).slice(),e._free(o);break;case Uint16Array:c=2*A;o=e._malloc(c),t.GetAttributeDataArrayForAllPoints(n,a,e.DT_UINT16,c,o),s=new Uint16Array(e.HEAPU16.buffer,o,A).slice(),e._free(o);break;case Uint32Array:c=4*A;o=e._malloc(c),t.GetAttributeDataArrayForAllPoints(n,a,e.DT_UINT32,c,o),s=new Uint32Array(e.HEAPU32.buffer,o,A).slice(),e._free(o);break;default:throw new Error("DRACOLoader: Unexpected attribute type.")}return{name:i,array:s,itemSize:l}}self.onmessage=function(r){var l=r.data;switch(l.type){case"init":e=l.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"load":var A=function(e,t,n,r,l,A){""===self.path?a.extractUrlBase(e):self.path;var c=new s;c.setResponseType("arraybuffer");var h=c.load(e,(function(n){var r;h.end=!0;try{var s=l.taskConfig;A.then((function(e){var l=e.draco,A=new l.Decoder,c=new l.DecoderBuffer;r=function(e,t,n,r,s,l){var A={};if(function(e){var t="mrbs",n=4,i=function(e,t,n){void 0===t&&(t=0);void 0===n&&(n=e.byteLength);return a.decodeText(new Uint8Array(e,t,n))}(e,0,n);return e.byteLength>=n&&t===i}(t)){var c=new o(t);c.skip(4),c.getUint32();var h=0;try{h=c.getUint32()}catch(e){}for(var u=[],d=[],f=[],p=0;p<h;p++){for(var m=c.getUint32(),v=c.getOffset(),g=c.getOffset(),y={geometrys:[]};m-(c.getOffset()-g)>4;)for(var w=c.getUint32(),x=0;x<w;x++){var b={},M=c.getUint32(),C=c.getOffset(),B=c.getUint32(),E=4&B;if(b.bHasOpecity=8&B,E)if((I=c.getUint32())>0){var S=c.getArrayBuffer(I);l.Init(new Int8Array(S),S.byteLength),n.decodeType=1;var T=i(r,s,l,n);b.vertexNum=T.numPoints,b.vertexs=T.attributes[0].array}else b.vertexNum=0,b.vertexs=[];else b.vertexNum=c.getUint32(),b.vertexs=c.getFloat32Array(3*b.vertexNum);b.vertexs.buffer&&f.push(b.vertexs.buffer),b.subMeshNum=c.getUint32(),b.subMeshs=[];for(var _=0;_<b.subMeshNum;_++){if(b.subMeshs[_]={},b.subMeshs[_].itemByteNum=c.getUint32(),b.subMeshs[_].faceNum=c.getUint32(),E)if((I=c.getUint32())>0){S=c.getArrayBuffer(I);l.Init(new Int8Array(S),S.byteLength),n.decodeType=2;T=i(r,s,l,n);b.subMeshs[_].faces=T.attributes[0].array}else b.subMeshs[_].faces=[];else 4==b.subMeshs[_].itemByteNum?b.subMeshs[_].faces=c.getUint32Array(3*b.subMeshs[_].faceNum):2==b.subMeshs[_].itemByteNum?b.subMeshs[_].faces=c.getUint16Array(3*b.subMeshs[_].faceNum):1==b.subMeshs[_].itemByteNum&&(b.subMeshs[_].faces=c.getUint8Array(3*b.subMeshs[_].faceNum));b.subMeshs[_].faces.buffer&&f.push(b.subMeshs[_].faces.buffer)}if(b.bHaveTexture=1&B,b.bTextureFile=2&B,b.bHaveTexture){var I;if(E)if((I=c.getUint32())>0){S=c.getArrayBuffer(I);l.Init(new Int8Array(S),S.byteLength),n.decodeType=1;T=i(r,s,l,n);b.uvNum=T.numPoints,b.uvs=T.attributes[0].array}else b.uvNum=0,b.uvs=[];else b.uvNum=c.getUint32(),b.uvs=c.getFloat32Array(2*b.uvNum);if(b.uvs.buffer&&f.push(b.uvs.buffer),b.bTextureFile){var L=c.getUint8();b.textureFile=c.getString(L)}else{var F=c.getUint8();if(b.textureFile=c.getString(F),1&c.getUint32()){var k=c.getUint32();if(k>0){var P={};P.image=b.textureFile;var U=c.getArrayBuffer(k),D=new Uint8Array(U);D.buffer&&f.push(D.buffer),P.imageArray=D,d.push(P)}}}}y.geometrys.push(b),C+=M,c.setOffset(C)}u.push(y),v+=m,c.setOffset(v)}A.lods=u,A.texs=d,A.share=f}else console.log("mrbs file format error!!!!!!!!");return A}(0,n,s,l,A,c),t(r)}))}catch(t){console.log("decodeMrbsFile failed!!! File: "+e),console.log(t)}}),n,r);return h}(r.data.murl,(function(e){void 0===e?(n[r.data.file]=void 0,self.postMessage({succ:!1,file:r.data.file})):e.lods&&(self.postMessage({succ:!0,file:r.data.file,retData:{lods:e.lods,texs:e.texs}},e.share),n[r.data.file]=void 0)}),(function(e){}),(function(e){n[r.data.file]=void 0,self.postMessage({succ:!1,file:r.data.file})}),l,t);A.end=!1,n[r.data.file]=A;break;case"cancel":n[r.data.file]&&!n[r.data.file].end&&(self.postMessage({succ:!1,file:r.data.file}),n[r.data.file].abort(),n[r.data.file]=void 0)}};var a={decodeText:function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);for(var t="",n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch(e){return t}},extractUrlBase:function(e){var t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)}};function o(e,t){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===t||t}function s(){}o.prototype={constructor:o,getOffset:function(){return this.offset},setOffset:function(e){this.offset=e},size:function(){return this.dv.buffer.byteLength},skip:function(e){this.offset+=e},getBoolean:function(){return 1==(1&this.getUint8())},getBooleanArray:function(e){for(var t=[],n=0;n<e;n++)t.push(this.getBoolean());return t},getUint8:function(){var e=this.dv.getUint8(this.offset);return this.offset+=1,e},getUint8Array:function(e){for(var t=new Uint8Array(e),n=0;n<e;n++)t[n]=this.getUint8();return t},getInt16:function(){var e=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,e},getUint16:function(e){if(null!=e)return this.dv.getUint16(e,this.littleEndian);var t=this.dv.getUint16(this.offset,this.littleEndian);return this.offset+=2,t},getUint16Array:function(e){for(var t=new Uint16Array(e),n=0;n<e;n++)t[n]=this.getUint16();return t},getInt32:function(){var e=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,e},getInt32Array:function(e){for(var t=new Int32Array(e),n=0;n<e;n++)t[n]=this.getInt32();return t},getUint32:function(){var e=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,e},getUint32Array:function(e){for(var t=new Uint32Array(e),n=0;n<e;n++)t[n]=this.getUint32();return t},getMatrix4:function(){for(var e=new Matrix4,t=0;t<16;t++)e.elements[t]=this.getFloat32();return e},getVector3:function(){for(var e=[],t=0;t<3;t++)e.push(this.getFloat32());return e},getVector2:function(){for(var e=[],t=0;t<2;t++)e.push(this.getFloat32());return e},getInt64:function(){var e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),2147483648&t?(t=4294967295&~t,4294967295===(e=4294967295&~e)&&(t=t+1&4294967295),-(4294967296*t+(e=e+1&4294967295))):4294967296*t+e},getInt64Array:function(e){for(var t=[],n=0;n<e;n++)t.push(this.getInt64());return t},getUint64:function(){var e,t;return this.littleEndian?(e=this.getUint32(),t=this.getUint32()):(t=this.getUint32(),e=this.getUint32()),4294967296*t+e},getFloat32:function(e){if(null!=e)return this.dv.getFloat32(e,this.littleEndian);var t=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t},getFloat32Array:function(e){for(var t=new Float32Array(e),n=0;n<e;n++)t[n]=this.getFloat32();return t},getFloat64:function(){var e=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e},getFloat64Array:function(e){for(var t=[],n=0;n<e;n++)t.push(this.getFloat64());return t},getArrayBuffer:function(e){var t=this.dv.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},getString:function(e){for(var t=[],n=0;n<e;n++)t[n]=this.getUint8();var i=t.indexOf(0);return i>=0&&(t=t.slice(0,i)),a.decodeText(new Uint8Array(t))}},s.prototype=Object.assign(s.prototype,{constructor:s,load:function(e,t,i,r){if(void 0===n[e]){n[e]=[],n[e].push({onLoad:t,onProgress:i,onError:r});var a=new XMLHttpRequest;return a.open("GET",e,!0),a.addEventListener("load",(function(t){var i=this.response,r=n[e];if(delete n[e],200===this.status||0===this.status)for(var o=0,s=r.length;o<s;o++){(l=r[o]).onLoad&&l.onLoad(i)}else for(o=0,s=r.length;o<s;o++){var l;(l=r[o]).onError&&l.onError(t)}a.end=!0}),!1),a.addEventListener("progress",(function(t){for(var i=n[e],r=0,a=i.length;r<a;r++){var o=i[r];o.onProgress&&o.onProgress(t)}}),!1),a.addEventListener("error",(function(t){var i=n[e];delete n[e];for(var r=0,o=i.length;r<o;r++){var s=i[r];s.onError&&s.onError(t)}a.end=!0}),!1),a.addEventListener("abort",(function(t){var i=n[e];delete n[e];for(var r=0,o=i.length;r<o;r++){var s=i[r];s.onError&&s.onError(t)}a.end=!0}),!1),void 0!==this.responseType&&(a.responseType=this.responseType),a.send(null),a}n[e].push({onLoad:t,onProgress:i,onError:r})},setResponseType:function(e){return this.responseType=e,this}})};var bg,Mg,Cg,Bg=0,Eg=1,Sg=2,Tg=new tn(new at(1/0,1/0,1/0),new at(-1/0,-1/0,-1/0)),_g=new bt,Ig=new at,Lg=new bt,Fg=function(){function e(t,n,i){var r=this;s(this,e),this.viewer=t,this.loaders=i,this.frustum=new Wi,this.camera=t.camera,this.scene=t.scene,this.root=new zt,this.renderer=t.renderManager.getRenderer(),this.needsUpdate=!1,this.maxShowLevel=void 0!==n?n:100,this.updateFunc=this.updateFunc.bind(this),t.addEventListener(ld.UPDATE,this.updateFunc),this.clock=new lc,this.path="",this.rootMrbsFiles=[],this.sceneNodeTree={},this.lodScale=1,this.sceneBoundBox=new tn,this.hideDeltaTime=.2,this.DestroyDeltaTime=5,this.updateChildListDeltaTime=4.5,this.lastFileNodeDestroyTime=0,this.framesActiveList=[],this.activeFileList=[],this.frameActive={},this.minLevelInxForReplaceShow=0,this.loadedAllInitChunkComplete=!1,this.maxLevelAlreadyLoadedForScene=0,this.curFrameTime=this.clock.getElapsedTime(),this.loaderManager=new xg(this),this.bFixedCamera=!1,this.isDepthWrite=!1,this.interval=setInterval((function(){r.update()}),100)}return A(e,[{key:"dispose",value:function(){this.viewer.removeEventListener(ld.UPDATE,this.updateFunc),clearInterval(this.interval),this.rootMrbsFiles=[],this.sceneNodeTree={},this.framesActiveList=[],this.activeFileList=[],this.frameActive={},this.frustum=null,this.loaderManager.dispose(),this.loaderManager=null,this.root.parent.remove(this.root);for(var e=0;e<this.loaders.loaders.length;e++){if(this.loaders.loaders[e]===this){this.loaders.loaders.splice(e,1);break}}}},{key:"updateFunc",value:function(){this.updateFrustum(),this.loaderManager.HandleFrameFileLoad()}},{key:"load",value:function(e,t,n,i){var r=this;this.path=OA.extractUrlBase(e),this.loaderManager.setPath(this.path);var a=new Kl;a.setResponseType("arraybuffer"),a.load(e,(function(e){try{r.parseTreeFile(e,r.path),t&&t()}catch(e){console.error(e),i&&i(e)}}),n,i)}},{key:"loadConfig",value:function(e,t){var n=this;(new Kl).load(e,(function(e){var i=JSON.parse(e);if(i.xml){var r=JSON.parse(i.xml);if(r.SRSOrigin){var a=r.SRSOrigin.split(",");a.length>2&&n.root.position.set(Number(a[0]),Number(a[2]),Number(a[1]))}}if(i.coordinate){var o=i.coordinate.split(",");o.length>=2&&(n.coordinate=[Number(o[0]),Number(o[1])])}t&&t()}),null,(function(){t&&t()}))}},{key:"projectBoundingSphere",value:function(e,t,n,i){var r=new at;r.copy(e),r.applyMatrix4(n);var a=t*t,o=r.z*r.z,s=r.lengthSq();return-Math.PI*i*i*a*Math.sqrt(Math.abs((s-a)/(a-o)))/(a-o)}},{key:"computeRangePixels",value:function(e,t){var n=this.camera.fov;return 2*Math.atan(t/e)*180/Math.PI/(Math.max(n,1e-17)/window.innerHeight)}},{key:"GetChildListInNeedForLod",value:function(e){var t=this,n=[];e.isReshowlist=this.InformChildrenLodLoading(e,n),e.reshowlist=n,n.forEach((function(e){e.lastActiveTime=t.curFrameTime})),e.refChildNum=n.length,e.lastShowChildTime=this.curFrameTime,e.fileNode.totalRefChildNum=0,e.fileNode.lods.forEach((function(e){e.refChildNum&&(e.fileNode.totalRefChildNum+=e.refChildNum)}))}},{key:"GetChildListInNeed",value:function(e){var t=this,n=0;e.lods.forEach((function(e){var i=[];e.isReshowlist=t.InformChildrenLodLoading(e,i),e.reshowlist=i,i.forEach((function(e){e.lastActiveTime=t.curFrameTime})),n+=i.length,e.lastShowChildTime=t.curFrameTime})),e.totalRefChildNum=n}},{key:"removeChildListInNeed",value:function(e){e.lods.forEach((function(e){e.isReshowlist=!1,e.reshowlist=void 0,e.lastShowChildTime=void 0})),e.totalRefChildNum=0}},{key:"ShowChildListInNeed",value:function(e){var t=this;(!e.lastShowChildTime||this.curFrameTime-e.lastShowChildTime>=this.updateChildListDeltaTime)&&this.GetChildListInNeedForLod(e);var n=e.isReshowlist;return e.reshowlist&&e.reshowlist.length>0&&e.reshowlist.forEach((function(e){2===e.state&&e.lods.forEach((function(e){t.ShowLod(e)}))})),n}},{key:"traverseMrbsFile",value:function(e){for(var t=this,n=[e],i=[];n.length>0;){var r=n.pop(),a=this.sceneNodeTree[r];if(a)if(a.traverseTwice){a.traverseTwice=!1;for(var o=a.lods.length,s=function(e){var n=a.lods[e],i=0;n.children.forEach((function(e){var n=t.sceneNodeTree[e.file];n&&n.traverseState&&(n.traverseState>i&&(i=n.traverseState),n.traverseState=void 0)})),i!==Bg&&(a.level>=t.minLevelInxForReplaceShow||t.maxLevelAlreadyLoadedForScene-a.level<6&&!t.loadedAllInitChunkComplete)&&(2===a.state?(t.ShowLod(n),t.AddShowedFileNode(a)):(!a.traverseState||i>a.traverseState)&&(a.traverseState=i))},l=0;l<o;l++)s(l)}else{if(0===a.level)a.parentOkLevel=-1;else{var A=a.parentLod.fileNode;a.parentOkLevel=2===A.state?A.level:A.parentOkLevel}a.traverseState=Bg,void 0===a||void 0===a.lods||a.level>=this.maxShowLevel?(a.traverseState=Sg,this.AddShowedFileNode(a)):0===a.lods.length?(this.loadMrbsFile(r,a.level),this.AddShowedFileNode(a)):function(){for(var e=[],o=a.lods.length,s=0,l=0;l<o;l++){var A=a.lods[l],c=A.center.distanceTo(t.camera.position);if(s=t.maxShowLevel===a.level+1?A.range.x:0===A.computeType?c*t.lodScale:t.computeRangePixels(c,A.radius),A.range.x<=s&&s<A.range.y){var h=!1;if(3===a.state||1===a.state){t.cancelChildFileLoad(a);var u=t.CheckLodIsInFrustum(A);if(3===a.state&&(u?(t.loadMrbsFile(r,a.level),h=!0):-1===a.parentOkLevel&&a.level>=t.minLevelInxForReplaceShow&&i.push(a)),u||-1===a.parentOkLevel)if(-1!==a.parentOkLevel&&a.level-a.parentOkLevel<=2)a.traverseState=Sg;else if(t.ShowChildListInNeed(A))h=!0;else if(-1!==a.parentOkLevel){var d=t.CheckLodIsInFrustumTruly(A);a.traverseState=d?Sg:Eg}else a.traverseState=Eg;else a.traverseState=Sg}else t.ShowLod(A),h=!0;h&&t.AddShowedFileNode(a)}else A.children.forEach((function(t){t.range.x<=s&&s<t.range.y&&e.push(t.file)}))}e.length>0&&(a.traverseTwice?console.log("Error: sceneTreeFileNode.traverseTwice"):(a.traverseTwice=!0,n.push(r),e.forEach((function(e){n.push(e)})),e=void 0))}()}}i.forEach((function(e){t.LoadReplaceFileNode(e)}))}},{key:"updateFileMaxLoaded",value:function(e,t){e.lods.forEach((function(e){e.maxLoadedLevel<t&&(e.maxLoadedLevel=t)})),this.updateLodMaxLoaded(e.parentLod,t)}},{key:"updateLodMaxLoaded",value:function(e,t){for(;e&&e.maxLoadedLevel<t;)e.maxLoadedLevel=t,e=e.fileNode.parentLod}},{key:"AddShowedFileNode",value:function(e){for(;e;)e.lastTraverseShowTime=this.curFrameTime,e=e.parentLod?e.parentLod.fileNode:void 0}},{key:"LoadReplaceFileNode",value:function(e){for(var t=e;e&&e.level>=this.minLevelInxForReplaceShow&&e.lastTraverseShowTime!==this.curFrameTime;)t=e,e=e.parentLod?e.parentLod.fileNode:void 0;t&&this.loadMrbsFileByNode(t,t.level,!0)}},{key:"ShowLod",value:function(e){e.subMeshs.forEach((function(e){e.visible=!0})),this.UpdateLod(e)}},{key:"HideLod",value:function(e){e.subMeshs.forEach((function(e){e.visible=!1}))}},{key:"UpdateLod",value:function(e){e.lastActiveTime=this.curFrameTime,this.frameActive.activeLods.push(e),e.fileNode.lastActiveTime=this.curFrameTime}},{key:"updateFrustum",value:function(){Lg.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),this.frustum.setFromMatrix(Lg)}},{key:"update",value:function(){this.updateFrustum(),this.curFrameTime=this.clock.getElapsedTime(),this.frameActive={},this.frameActive.time=this.curFrameTime,this.frameActive.activeLods=[];for(var e=this.rootMrbsFiles.length,t=0;t<e;t++)this.traverseMrbsFile(this.rootMrbsFiles[t],0,-1);this.framesActiveList.push(this.frameActive);for(var n=this.framesActiveList.length,i=0;i<n&&!(this.curFrameTime-this.framesActiveList[i].time<=this.hideDeltaTime);){for(var r=this.framesActiveList[i].activeLods,a=r.length,o=0;o<a;o++){var s=r[o];this.curFrameTime-s.lastActiveTime>this.hideDeltaTime&&(this.HideLod(s),r.splice(o,1),o--,a--)}this.framesActiveList.splice(i,1),n--}this.DestroyTimeoutFileNode()}},{key:"traverseFileNodeForDestroy",value:function(e){for(var t=this,n=[e];n.length>0;){var i=n.pop(),r=this.sceneNodeTree[i];if(void 0===r||void 0===r.lods||r.level>=this.maxShowLevel)return;var a=r.lods.length;if(2===r.state&&this.curFrameTime-r.lastActiveTime>=this.DestroyDeltaTime){for(var o=0;o<a;o++){var s=r.lods[o];s.subMeshs.forEach((function(e){t.root.remove(e),e.geometry.dispose(),e.geometry=void 0,e.material.map&&(e.material.map.dispose(),e.material.map.image=void 0,e.material.map=void 0),e.material.dispose(),e.material=void 0,e=void 0})),s.subMeshs=[]}r.state=3}for(var l=0;l<a;l++){var A=r.lods[l];A.maxLoadedLevel>A.fileNode.level&&A.children.forEach((function(e){n.push(e.file)}))}}}},{key:"DestroyTimeoutFileNode",value:function(){if(this.curFrameTime-this.lastFileNodeDestroyTime>=10){for(var e=this.rootMrbsFiles.length,t=0;t<e;t++)this.traverseFileNodeForDestroy(this.rootMrbsFiles[t]);this.lastFileNodeDestroyTime=this.curFrameTime}}},{key:"InformChildrenLodLoading",value:function(e,t){for(var n=this,i=!0,r=[e];r.length>0;){var a=r.pop();a.maxLoadedLevel<=a.fileNode.level?i=!1:a.children.length>0?a.children.forEach((function(e){var a=n.sceneNodeTree[e.file];void 0===a||void 0===a.lods||a.level>=n.maxShowLevel?i=!1:2===a.state?t.push(a):a.lods.forEach((function(e){r.push(e)}))})):i=!1}return i}},{key:"InformChildrenHaveParentLoading",value:function(e,t){var n=this,i=this.sceneNodeTree[e];if(void 0===i||void 0===i.lods||i.level>=this.maxShowLevel)return!1;var r=!0;return 2===i.state?(t.push(i),r=!0):i.lods.forEach((function(e){n.InformChildrenLodLoading(e,t)||(r=!1)})),r}},{key:"CheckLodIsInFrustum",value:function(e){var t={center:e.center,radius:2*e.radius};return this.frustum.containsPoint(e.center)||this.frustum.intersectsSphere(t)}},{key:"CheckLodIsInFrustumTruly",value:function(e){var t={center:e.center,radius:1.5*e.radius};return this.frustum.containsPoint(e.center)||this.frustum.intersectsSphere(t)}},{key:"CancelLoadingTask",value:function(e){var t=this.sceneNodeTree[e];t.state=3,t.checkedChildLoad=!1,this.loaderManager.loadingTasks[e]=void 0}},{key:"GetFilePriority",value:function(e,t,n){var i=this.sceneNodeTree[e];if(!this.bFixedCamera&&(0===i.level||0===t))return 0;var r=Number.MAX_VALUE;if(!n)//!treeFileNode.totalRefChildNum || treeFileNode.totalRefChildNum < parent_file_ref_child_filenode_limit)
|
|
|
{for(var a=!1,o=i.lods.length,s=0;s<o;s++){var l=i.lods[s];if(this.CheckLodIsInFrustum(l)){a=!0;break}}if(!a)return r}return i.lods.forEach((function(e){Ig.copy(e.center),Ig.applyMatrix4(Lg),Ig.z=0;var t=Ig.lengthSq();r=Math.min(r,t)})),0===i.level&&(r*=1e-6),0===t&&(r*=1e-6),i.totalRefChildNum&&(r/=i.totalRefChildNum),r}},{key:"CheckIsFixedCamera",value:function(){return this.bFixedCamera}},{key:"CheckIsLoadedAllInitChunk",value:function(){return this.loadedAllInitChunkComplete}},{key:"InitRootMatrixAndCamera",value:function(e){var t=this,n=Tg.getCenter(new at);if(0==n.x&&0==n.y&&0==n.z&&99==Tg.max.x){if(!e)return;Tg=new tn(new at(1/0,1/0,1/0),new at(-1/0,-1/0,-1/0)),this.root.children.forEach((function(e){e.geometry.computeBoundingBox();var t=e.geometry.boundingBox;t.min.x<Tg.min.x&&(Tg.min.x=t.min.x),t.min.y<Tg.min.y&&(Tg.min.y=t.min.y),t.min.z<Tg.min.z&&(Tg.min.z=t.min.z),t.max.x>Tg.max.x&&(Tg.max.x=t.max.x),t.max.y>Tg.max.y&&(Tg.max.y=t.max.y),t.max.z>Tg.max.z&&(Tg.max.z=t.max.z)})),n=Tg.getCenter(new at)}this.root.rotateX(-Math.PI/2);var i=Tg;for(var r in this.viewer.isGISViewer?(this.root.position.x-=n.x,this.root.position.y-=n.z,this.root.position.z+=n.y,this.root.position.y=Math.abs(n.z)/2,this.root.updateMatrixWorld(),Tg.applyMatrix4(this.root.matrixWorld),_g=this.root.matrixWorld):(this.root.updateMatrix(),i=Tg.clone().applyMatrix4(this.root.matrix),_g=this.root.matrix),this.isFocus&&this.viewer.fitCamera(this.root,i),setTimeout((function(){t.update()}),1e3),this.viewer.camera.near=1,this.viewer.camera.updateProjectionMatrix(),this.bFixedCamera=!0,this.loaderManager.RefreshLoadFlag(),this.sceneNodeTree){this.sceneNodeTree[r].lods.forEach((function(e){e.center.applyMatrix4(_g)}))}}},{key:"resetGeoCenter",value:function(e){var t=new tn;t.setFromBufferAttribute(e);var n=new at;t.getCenter(n);for(var i=0;i<e.count;i++)e.setX(i,e.getX(i)-n.x),e.setY(i,e.getY(i)-n.y),e.setZ(i,e.getZ(i)-n.z);return n}},{key:"onCompleteFileLoad",value:function(e,t,n){for(var i=this.sceneNodeTree[t],r={},a=e.texs.length,o=0;o<a;o++)r[e.texs[o].image]=e.texs[o].tex;for(var s=e.lods.length,l=0;l<s;l++){var A=e.lods[l],c=i.lods[l];if(void 0===c)return void console.log("Error: "+t+" not find lod "+l);c.subMeshs=[],c.lastActiveTime=this.curFrameTime,new tn;for(var h=A.geometrys.length,u=0;u<h;u++)for(var d=A.geometrys[u],f=new Yn(d.vertexs,3),p=new Yn(d.uvs,2),m=d.subMeshs.length,v=0;v<m;v++){var g=new si;g.setAttribute("position",f),g.setAttribute("uv",p);var y=void 0,w=d.subMeshs[v];4==w.itemByteNum?y=new Xn(w.faces,1):2==w.itemByteNum?y=new jn(w.faces,1):1==w.itemByteNum&&(y=new Gn(w.faces,1)),g.setIndex(y),g.clearGroups(),g.addGroup(0,w.faces.length,0);var x=r[d.textureFile];if(x)et.isPowerOfTwo(x.image.width)&&et.isPowerOfTwo(x.image.height)&&(x.wrapS=V,x.wrapT=V);var b=new Nn({map:r[d.textureFile]});this.doubeside?b.side=2:b.side=0,d.bHasOpecity&&(this.transparent?(b.transparent=!0,b.depthWrite=this.isDepthWrite):b.alphaTest=this.alphaTest||.6);var M=new Ei(g,b);c.subMeshs.push(M),M.name=t+":"+l+":"+v,M.castShadow=!1,M.receiveShadow=!1,M.visible=!1,M.matrixAutoUpdate=!1,this.root.add(M),this.bFixedCamera||this.InitRootMatrixAndCamera(!1)}}this.bFixedCamera||this.InitRootMatrixAndCamera(!0),i.state=2,i.checkedChildLoad=!1,this.removeChildListInNeed(i),this.updateFileMaxLoaded(i,i.level),i.level>this.maxLevelAlreadyLoadedForScene&&(this.maxLevelAlreadyLoadedForScene=i.level)}},{key:"setDoubleSide",value:function(e){this.doubeside=e;for(var t=0;t<this.root.children.length;t++){var n=this.root.children[t];n.isMesh&&(Array.isArray(n.material)?(n.material[0].side=this.doubeside?2:0,n.material[0].needsUpdate=!0):(n.material.side=this.doubeside?2:0,n.material.needsUpdate=!0))}}},{key:"setDepthWrite",value:function(e){this.isDepthWrite=e;for(var t=0;t<this.root.children.length;t++){var n=this.root.children[t];n.isMesh&&(Array.isArray(n.material)?(n.material[0].depthWrite=!!this.isDepthWrite,n.material[0].needsUpdate=!0):(n.material.depthWrite=!!this.isDepthWrite,n.material.needsUpdate=!0))}}},{key:"loadMrbsFileByNode",value:function(e,t,n){if(!(1===e.state||2===e.state||e.level>=this.maxShowLevel)){e.state,e.state=1,e.lastActiveTime=this.curFrameTime;var i={};i.chunkIndex=e.chunkIndex,i.level=e.level,i.prioLevel=t,i.level===this.minLevelInxForReplaceShow&&(i.prioLevel=0),i.state=vg,i.file=e.fileName,i.bReplace=!!n,this.loaderManager.AddLoadTask(i)}}},{key:"loadMrbsFile",value:function(e,t){var n=this.sceneNodeTree[e];this.loadMrbsFileByNode(n,t)}},{key:"cancelChildFileLoad",value:function(e){if(!e.checkedChildLoad){e.checkedChildLoad=!0;var t=[];for(e.lods.forEach((function(e){e.children.forEach((function(e){t.push(e.file)}))}));t.length>0;){var n=t.pop(),i=this.sceneNodeTree[n];if(i&&e.level<this.maxShowLevel){var r=this.loaderManager.loadingTasks[n];r&&r.state===vg&&r.prioLevel>0&&(r.state=yg),i.lods.forEach((function(e){e.children.forEach((function(e){t.push(e.file)}))}))}}}}},{key:"convertArrayBufferToString",value:function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=e.byteLength),OA.decodeText(new Uint8Array(e,t,n))}},{key:"isBscbFormatBinary",value:function(e){var t=this.convertArrayBufferToString(e,0,4);return e.byteLength>=4&&"bscb"===t}},{key:"parseTreeFile",value:function(e,t){var n=this;if(this.isBscbFormatBinary(e)){this.rootMrbsFiles=[],this.ChunkRootMrbsFiles=[];var i=new fg(e);i.skip(4),i.getUint32();for(var r=i.getUint32(),a=0;a<r;a++)for(var o=i.getUint32(),s=i.getUint32(),l=0;l<s;l++){var A=i.getInt32();0!==o&&0===l&&(this.minLevelInxForReplaceShow=A);for(var c=i.getUint32(),h=0;h<c;h++){var u=o+"_"+A+"_"+h,d={};d.chunkIndex=o,d.level=A,d.state=3,d.lastTraverseShowTime=0,d.fileName=u,d.lods=[];for(var f=i.getUint32(),p=0;p<f;p++){var m={};m.center=i.getVector3(),m.radius=i.getFloat32(),m.range=i.getVector2(),m.computeType=i.getUint16(),m.subMeshs=[];var v=i.getUint16();m.children=[];for(var g=A+1,y=0;y<v;y++){var w={};w.range=i.getVector2();var x=i.getInt32();-1!==x&&(w.file=0===o&&l==s-1?x+"_"+g+"_0":o+"_"+g+"_"+x,m.children.push(w))}0===m.children.length&&(m.range.x=0,m.range.y=Number.MAX_VALUE),d.lods.push(m)}this.sceneNodeTree[u]=d,0===A?this.rootMrbsFiles.push(u):0!==o&&0===l&&this.ChunkRootMrbsFiles.push(u)}}}var b=function(e){var t=n.sceneNodeTree[e];t.lods.forEach((function(e){e.children.forEach((function(t){n.sceneNodeTree[t.file]&&(n.sceneNodeTree[t.file].parentLod=e)})),e.fileNode=t,e.maxLoadedLevel=0}))};for(var M in this.sceneNodeTree)b(M);this.computeRootBox(),this.rootMrbsFiles.forEach((function(e){n.loadMrbsFile(e,0)})),this.ChunkRootMrbsFiles.forEach((function(e){n.loadMrbsFile(e,0)}))}},{key:"computeRootBox",value:function(){var e,t=this,n=[];this.rootMrbsFiles.forEach((function(e){var i=t.sceneNodeTree[e];0===i.level&&i.lods.map((function(e){e.radius<9999999?n.push({radius:e.radius,center:e.center}):!isNaN(e.center.x)&&isFinite(e.center.x)&&Math.abs(e.center.x)<9999999&&n.push({radius:99,center:e.center})}))}));for(var i=0;i<n.length;i++)(e=n[i]).center.x-e.radius<Tg.min.x&&(Tg.min.x=e.center.x-e.radius),e.center.y-e.radius<Tg.min.y&&(Tg.min.y=e.center.y-e.radius),e.center.z-e.radius<Tg.min.z&&(Tg.min.z=e.center.z-e.radius),e.center.x+e.radius>Tg.max.x&&(Tg.max.x=e.center.x+e.radius),e.center.y+e.radius>Tg.max.y&&(Tg.max.y=e.center.y+e.radius),e.center.z+e.radius>Tg.max.z&&(Tg.max.z=e.center.z+e.radius)}}]),e}(),kg=function(){function e(t){s(this,e),void 0===t&&console.error("参数缺少viewer"),this.viewer=t,this.loaders=[],this.largeSceneGroup=this.viewer.modelGroup}return A(e,[{key:"load",value:function(e,t,n,i){var r=!0,a=!1,o=!0,s=0,l=!1;n&&(r=n.focus,a=n.doubeside,null!=n.transparent&&(o=n.transparent),s=n.alphaTest,l=n.isOnline);var A=new Fg(this.viewer,i,this);A.isFocus=r,A.doubeside=a,A.transparent=o,A.alphaTest=s;var c=new zt;return c.path=e,c.isLargeScene=!0,c.loader=A,this.loaders.push(A),c.add(A.root),this.largeSceneGroup.add(c),l?A.load(e+"/conf.mrcb",(function(){t&&t(c)})):A.loadConfig(e+"/confJson.json",(function(){A.load(e+"/conf.mrcb",(function(){c.coordinate=A.coordinate,t&&t(c)}))})),c}},{key:"dispose",value:function(){for(var e=this.loaders.length-1;e>=0;e--){this.loaders[e].dispose()}}}]),e}(),Pg=0,Ug=function(e){h(n,e);var t=y(n);function n(e){var i;s(this,n),(i=t.call(this,e)).enabled=!0,i.viewer=e,i.camera=e.camera,i.viewer.camera.controller=v(i),If.isMobile?i.dblClickHandler=function(e){1===e.touches.length&&(e.timeStamp-Pg<250&&this._dblClickHandler(e.touches[0]),Pg=e.timeStamp)}.bind(v(i)):i.dblClickHandler=i._dblClickHandler.bind(v(i)),e.container.addEventListener("dblclick",i.dblClickHandler),e.container.addEventListener("touchstart",i.dblClickHandler),e.container.position="relative";var r=e.containerRect,a=r.width,o=r.height;return(bg=new Image).src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABcJJREFUaEPVWmtoHFUU/s7djdBqG2i6M7Nb8dkiFqu/pBVfVUGR1AeK/SkqrWl3EgWL+qMFWzB/ov6wm9n04QP9VSoKVaMo+EAtKv6yiiK24gM3M7NNIY02YHbnyJ3d2Uwmuzsz+wjNhYXs3nvPOd+5557XDWGJD1ri8qPjAMw31QsTU+VeEj29RE6vVBCzmGJndqrcm5jSHrb+7aTS2gYgBRZnqR+EfsD99IUIOAlgHIxxZyWPtwuoZQDmy+o1iSTpDmMrEVa1olVmnBGEo+USG9qT1o+t0IgN4MzBzCWzs84gEXQAywNMZwD8CuAkAycJeMY1IWCEgLWofNYBWBbYd44ZRk+PGF01UPgzDpBYAOy89hAY+wFoPia/EHDMcZx31SH7uPf7RE7bnBD4TH4vO7gtPWR+7s1ZOeVGIcS9DNwH4CofLROEJ5Ss+VZUEJEBVIU/6iM8A9Cwok8M12PWDIB/fdHQdjFhFxjp2u+ErVFBRAJQzKd3MPOYx4DBxxzQcFo3v2ukqagA5H4zp14uiHahYpbuIKKdqezEgbCTCAVQNLTnGNjrE/6wqluPhxGOA8CjVcynn2Lml2oggL0p3dzXjFdTAEHhQXhMyZ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E3BxhYY/cqg+UFUEO00tvx7XX5NOoLxWovgbYpuvRoFRKsAgooLy2JjN3fDCHrgWgHg9/dVr9Nec9cTJthel906Yso1a3jFATBhaNcL8G4CyQePitV0qr3uEazzwHEW4FyJxeF6vaOoAGwjvRtg6efnnp06/cARABF8Yppm8JGEgyP+Nsx598TkgQh55JOFtuyinWJAdvjcAuS8eeTze58l+8wadKFL9qG7USxYcv9qECWodXNNaCDrJvNO0P4fGKofXnAvUzAAAAAASUVORK5CYII=",bg.style.position="absolute",bg.style.width="30px",bg.style.height="30px",bg.style.top=o/2-15+"px",bg.style.left=a/2-15+"px",bg.style.display="none",(Mg=new Image).src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD8AAAAwCAYAAACmCaIKAAAAAXNSR0IArs4c6QAAAT5JREFUaEPtWsENwjAMvFuHXeAHI/BjBmAFeMEK/GAoxjCKKKgfmrqiVpRcX0i9ND2f7ZrYBAAzOwHYpd8jrw3J20js7DAz2wK4ODZ6kFzRzO4AlgAOYxeTPI7FRuHMbO/YK3E9J/KWiJdIyEHGBe0MdRB5KV9gHLt82QGW26c8p4SnbF/et9sRxi6oYr4X80WVqy4ZJ4A/5TAnrK1michXI6WTiJR3GqwauJSvRkonkVDlzWwNYDHwjk+SVyeHyfBo8unUaPAiGfZOYRslxkP/IL/1tsjn/OM/96X8f+yYf4rc/sfBiWL+bZiwUAzbqJftm/3UtVvk5FNiLCLU7WOp5XcT+byN6kRI+Tp1zbNqW/mu3m6zaaEurbq06tLmU2QFCLWoNZaiIURNYBY3TztXbu0nvHYHj7uztSZHzl/kIiMOWht+IQAAAABJRU5ErkJggg==",Mg.style.position="absolute",Mg.style.width="30px",Mg.style.height="30px",Mg.style.top=o/2-15+"px",Mg.style.left=a/2-15+"px",Mg.style.display="none",e.container.appendChild(bg),e.container.appendChild(Mg),e.container.addEventListener(If.isMobile?"touchstart":"mousedown",(function(e){i.enabled&&(0===e.button||e.touches&&1===e.touches.length)&&(Cg&&clearTimeout(Cg),Cg=setTimeout((function(){bg.style.display="block"}),200))})),e.container.addEventListener(If.isMobile?"touchend":"mouseup",(function(e){i.enabled&&(0===e.button||e.touches)&&(Cg&&(clearTimeout(Cg),Cg=null),bg.style.display="none")})),window.addEventListener("resize",(function(){if(i.enabled){var e=i.viewer.container.getBoundingClientRect(),t=e.width,n=e.height;bg.style.top=n/2+"px",bg.style.left=t/2+"px"}})),i}return A(n,[{key:"update",value:function(){this.enabled&&this._update()}},{key:"_dblClickHandler",value:function(e){var t=this;if(this.enabled){var n=M(this.viewer.picker.rayIntersect(e),1)[0];if(n){var i=n.point,r=this.viewer.picker.vectorToScreen(i),a=(new at).subVectors(this.camera.position,this.target);a=(new at).addScaledVector(a,.8);var o=(new at).addVectors(i,a);this.tween&&this.tween.stop();var s={tx:this.target.x,ty:this.target.y,tz:this.target.z,px:this.camera.position.x,py:this.camera.position.y,pz:this.camera.position.z,cx:r.x-15,cy:r.y-15};this.tween=new ud.Tween(s).to({tx:i.x,ty:i.y,tz:i.z,px:o.x,py:o.y,pz:o.z,cx:this.viewer.containerRect.width/2-15,cy:this.viewer.containerRect.height/2-15},1e3).onUpdate((function(){t.target.set(s.tx,s.ty,s.tz),t.camera.position.set(s.px,s.py,s.pz),Mg.style.top=s.cy+"px",Mg.style.left=s.cx+"px"})).easing(ud.Easing.Cubic.InOut).onComplete((function(){Mg.style.display="none"})).repeat(0).start(),Mg.style.display="block"}}}},{key:"setPosition",value:function(e,t,n){this.object.position.set(e,t,n),this.dispatchEvent("change")}},{key:"setTarget",value:function(e,t,n){this.target.set(e,t,n),this.dispatchEvent("change")}}]),n}(yp),Dg=function(){function e(t,n,i,r){var a=this,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:50,l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:50;s(this,e),this.viewer=t,this.camera=new FA(i/-2,i/2,r/2,r/-2,.1,1e3),this.camera.position.set(0,0,1),this.bottom=o,this.left=l;var A=(new tA).load(n,(function(){A.wrapT=A.wrapS=V,A.repeat.multiplyScalar(.994),a.planeWidth=176,a.planeHeight=60;var e=new $i(a.planeWidth,a.planeHeight);a.plane=new Ei(e,new Nn({map:A,transparent:!0})),a.fitCamera(),a.camera.position.y=-r/2+a.bottom+a.planeHeight/2,a.camera.position.x=-i/2+a.left}));this.viewer.renderManager.getRenderer().autoClear=!1,this.viewer.renderManager.addBeforeRenderTask((function(e,t,n){a.onBeforeRender(e,t,n)})),this.viewer.renderManager.addAfterRenderTask((function(e,t,n){a.onAfterRender(e,t,n)}))}return A(e,[{key:"onBeforeRender",value:function(e,t,n){this.viewer.renderManager.getRenderer().clear(),this.plane&&e.domElement.width/e.domElement.height!==this.camera.aspect&&this.onResize(e.domElement.width,e.domElement.height)}},{key:"onAfterRender",value:function(){this.plane&&this.viewer.renderManager.getRenderer().render(this.plane,this.camera)}},{key:"fitCamera",value:function(){var e,t=(new tn).setFromObject(this.plane).getSize(new at),n=this.planeWidth/t.x,i=this.planeHeight/t.y;t.x>=t.y?(e=n)*t.y>this.planeHeight&&(e=i):(e=i)*t.x>this.planeWidth&&(e=n),this.camera.zoom=e,this.camera.updateProjectionMatrix()}},{key:"onResize",value:function(e,t){this.camera.aspect=e/t,this.camera.left=e/-2,this.camera.right=e/2,this.camera.top=t/2,this.camera.bottom=t/-2,this.camera.updateProjectionMatrix(),this.camera.position.y=-t/2+this.bottom+this.planeHeight/2,this.camera.position.x=e/2-this.left-this.planeWidth/2}}]),e}(),Rg=function(e){h(n,e);var t=y(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this,n),(i=t.call(this,e,r))._hotSpotManager=null,i._effectManager=null,i._largeSceneLoader=null,i._largeSceneLoader2=null,i._largeSceneControls=null,i._controls=null,i}return A(n,[{key:"hotSpotManager",get:function(){return this._hotSpotManager||(this._hotSpotManager=new ev(this)),this._hotSpotManager}},{key:"effectManager",get:function(){return this._effectManager||(this._effectManager=new Xv(this)),this._effectManager}},{key:"largeSceneLoader",get:function(){return this._largeSceneLoader||(this._largeSceneLoader=new dg(this)),this._largeSceneLoader}},{key:"largeSceneLoader2",get:function(){return this._largeSceneLoader2||(this._largeSceneLoader2=new kg(this)),this._largeSceneLoader2}},{key:"enableLargeSceneControls",get:function(){return this._enableLargeSceneControls||!1},set:function(e){e!=this._enableLargeSceneControls&&(e?(this._controls=this.controls,this._controls.enabled=!1,this._largeSceneControls||(this._largeSceneControls=new Ug(this),this.renderManager.addAfterRenderTask(this._largeSceneControls.update.bind(this._largeSceneControls))),this._largeSceneControls.enabled=!0,this.controls=this._largeSceneControls):(this.controls=this._controls,this._controls.enabled=!0,this._largeSceneControls.enabled=!1))}},{key:"addWatermark",value:function(e){new Dg(this,e,this.containerRect.width,this.containerRect.height)}}]),n}(Xm);var Og=6378137,Ng=.0066943799901413165,zg=484813681109536e-20,Qg=Math.PI/2,Gg=1e-10,Hg=.017453292519943295,Vg=57.29577951308232,jg=Math.PI/4,Wg=2*Math.PI,Xg=3.14159265359,Yg={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},Kg={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},Zg=/[\s_\-\/\(\)]/g;function Jg(e,t){if(e[t])return e[t];for(var n,i=Object.keys(e),r=t.toLowerCase().replace(Zg,""),a=-1;++a<i.length;)if((n=i[a]).toLowerCase().replace(Zg,"")===r)return e[n]}function qg(e){var t,n,i,r={},a=e.split("+").map((function(e){return e.trim()})).filter((function(e){return e})).reduce((function(e,t){var n=t.split("=");return n.push(!0),e[n[0].toLowerCase()]=n[1],e}),{}),o={proj:"projName",datum:"datumCode",rf:function(e){r.rf=parseFloat(e)},lat_0:function(e){r.lat0=e*Hg},lat_1:function(e){r.lat1=e*Hg},lat_2:function(e){r.lat2=e*Hg},lat_ts:function(e){r.lat_ts=e*Hg},lon_0:function(e){r.long0=e*Hg},lon_1:function(e){r.long1=e*Hg},lon_2:function(e){r.long2=e*Hg},alpha:function(e){r.alpha=parseFloat(e)*Hg},gamma:function(e){r.rectified_grid_angle=parseFloat(e)},lonc:function(e){r.longc=e*Hg},x_0:function(e){r.x0=parseFloat(e)},y_0:function(e){r.y0=parseFloat(e)},k_0:function(e){r.k0=parseFloat(e)},k:function(e){r.k0=parseFloat(e)},a:function(e){r.a=parseFloat(e)},b:function(e){r.b=parseFloat(e)},r_a:function(){r.R_A=!0},zone:function(e){r.zone=parseInt(e,10)},south:function(){r.utmSouth=!0},towgs84:function(e){r.datum_params=e.split(",").map((function(e){return parseFloat(e)}))},to_meter:function(e){r.to_meter=parseFloat(e)},units:function(e){r.units=e;var t=Jg(Kg,e);t&&(r.to_meter=t.to_meter)},from_greenwich:function(e){r.from_greenwich=e*Hg},pm:function(e){var t=Jg(Yg,e);r.from_greenwich=(t||parseFloat(e))*Hg},nadgrids:function(e){"@null"===e?r.datumCode="none":r.nadgrids=e},axis:function(e){var t="ewnsud";3===e.length&&-1!==t.indexOf(e.substr(0,1))&&-1!==t.indexOf(e.substr(1,1))&&-1!==t.indexOf(e.substr(2,1))&&(r.axis=e)},approx:function(){r.approx=!0}};for(t in a)n=a[t],t in o?"function"==typeof(i=o[t])?i(n):r[i]=n:r[t]=n;return"string"==typeof r.datumCode&&"WGS84"!==r.datumCode&&(r.datumCode=r.datumCode.toLowerCase()),r}var $g=/\s/,ey=/[A-Za-z]/,ty=/[A-Za-z84_]/,ny=/[,\]]/,iy=/[\d\.E\-\+]/;function ry(e){if("string"!=typeof e)throw new Error("not a string");this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=1}function ay(e,t,n){Array.isArray(t)&&(n.unshift(t),t=null);var i=t?{}:e,r=n.reduce((function(e,t){return oy(t,e),e}),i);t&&(e[t]=r)}function oy(e,t){if(Array.isArray(e)){var n=e.shift();if("PARAMETER"===n&&(n=e.shift()),1===e.length)return Array.isArray(e[0])?(t[n]={},void oy(e[0],t[n])):void(t[n]=e[0]);if(e.length)if("TOWGS84"!==n){if("AXIS"===n)return n in t||(t[n]=[]),void t[n].push(e);var i;switch(Array.isArray(n)||(t[n]={}),n){case"UNIT":case"PRIMEM":case"VERT_DATUM":return t[n]={name:e[0].toLowerCase(),convert:e[1]},void(3===e.length&&oy(e[2],t[n]));case"SPHEROID":case"ELLIPSOID":return t[n]={name:e[0],a:e[1],rf:e[2]},void(4===e.length&&oy(e[3],t[n]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return e[0]=["name",e[0]],void ay(t,n,e);default:for(i=-1;++i<e.length;)if(!Array.isArray(e[i]))return oy(e,t[n]);return ay(t,n,e)}}else t[n]=e;else t[n]=!0}else t[e]=!0}ry.prototype.readCharicter=function(){var e=this.text[this.place++];if(4!==this.state)for(;$g.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case 1:return this.neutral(e);case 2:return this.keyword(e);case 4:return this.quoted(e);case 5:return this.afterquote(e);case 3:return this.number(e);case-1:return}},ry.prototype.afterquote=function(e){if('"'===e)return this.word+='"',void(this.state=4);if(ny.test(e))return this.word=this.word.trim(),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in afterquote yet, index '+this.place)},ry.prototype.afterItem=function(e){return","===e?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===e?(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},ry.prototype.number=function(e){if(!iy.test(e)){if(ny.test(e))return this.word=parseFloat(this.word),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in number yet, index '+this.place)}this.word+=e},ry.prototype.quoted=function(e){'"'!==e?this.word+=e:this.state=5},ry.prototype.keyword=function(e){if(ty.test(e))this.word+=e;else{if("["===e){var t=[];return t.push(this.word),this.level++,null===this.root?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,void(this.state=1)}if(!ny.test(e))throw new Error("havn't handled \""+e+'" in keyword yet, index '+this.place);this.afterItem(e)}},ry.prototype.neutral=function(e){if(ey.test(e))return this.word=e,void(this.state=2);if('"'===e)return this.word="",void(this.state=4);if(iy.test(e))return this.word=e,void(this.state=3);if(!ny.test(e))throw new Error("havn't handled \""+e+'" in neutral yet, index '+this.place);this.afterItem(e)},ry.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function sy(e){return.017453292519943295*e}function ly(e){var t=new ry(e).output(),n=t.shift(),i=t.shift();t.unshift(["name",i]),t.unshift(["type",n]);var r={};return oy(t,r),function(e){if("GEOGCS"===e.type?e.projName="longlat":"LOCAL_CS"===e.type?(e.projName="identity",e.local=!0):"object"==typeof e.PROJECTION?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var t="",n=0,i=e.AXIS.length;n<i;++n){var r=[e.AXIS[n][0].toLowerCase(),e.AXIS[n][1].toLowerCase()];-1!==r[0].indexOf("north")||("y"===r[0]||"lat"===r[0])&&"north"===r[1]?t+="n":-1!==r[0].indexOf("south")||("y"===r[0]||"lat"===r[0])&&"south"===r[1]?t+="s":-1!==r[0].indexOf("east")||("x"===r[0]||"lon"===r[0])&&"east"===r[1]?t+="e":-1===r[0].indexOf("west")&&("x"!==r[0]&&"lon"!==r[0]||"west"!==r[1])||(t+="w")}2===t.length&&(t+="u"),3===t.length&&(e.axis=t)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),"metre"===e.units&&(e.units="meter"),e.UNIT.convert&&("GEOGCS"===e.type?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var a=e.GEOGCS;function o(t){return t*(e.to_meter||1)}"GEOGCS"===e.type&&(a=e),a&&(a.DATUM?e.datumCode=a.DATUM.name.toLowerCase():e.datumCode=a.name.toLowerCase(),"d_"===e.datumCode.slice(0,2)&&(e.datumCode=e.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==e.datumCode&&"new_zealand_1949"!==e.datumCode||(e.datumCode="nzgd49"),"wgs_1984"!==e.datumCode&&"world_geodetic_system_1984"!==e.datumCode||("Mercator_Auxiliary_Sphere"===e.PROJECTION&&(e.sphere=!0),e.datumCode="wgs84"),"_ferro"===e.datumCode.slice(-6)&&(e.datumCode=e.datumCode.slice(0,-6)),"_jakarta"===e.datumCode.slice(-8)&&(e.datumCode=e.datumCode.slice(0,-8)),~e.datumCode.indexOf("belge")&&(e.datumCode="rnb72"),a.DATUM&&a.DATUM.SPHEROID&&(e.ellps=a.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===e.ellps.toLowerCase().slice(0,13)&&(e.ellps="intl"),e.a=a.DATUM.SPHEROID.a,e.rf=parseFloat(a.DATUM.SPHEROID.rf,10)),a.DATUM&&a.DATUM.TOWGS84&&(e.datum_params=a.DATUM.TOWGS84),~e.datumCode.indexOf("osgb_1936")&&(e.datumCode="osgb36"),~e.datumCode.indexOf("osni_1952")&&(e.datumCode="osni52"),(~e.datumCode.indexOf("tm65")||~e.datumCode.indexOf("geodetic_datum_of_1965"))&&(e.datumCode="ire65"),"ch1903+"===e.datumCode&&(e.datumCode="ch1903"),~e.datumCode.indexOf("israel")&&(e.datumCode="isr93")),e.b&&!isFinite(e.b)&&(e.b=e.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",sy],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",sy],["x0","false_easting",o],["y0","false_northing",o],["long0","central_meridian",sy],["lat0","latitude_of_origin",sy],["lat0","standard_parallel_1",sy],["lat1","standard_parallel_1",sy],["lat2","standard_parallel_2",sy],["azimuth","Azimuth"],["alpha","azimuth",sy],["srsCode","name"]].forEach((function(t){return function(e,t){var n=t[0],i=t[1];!(n in e)&&i in e&&(e[n]=e[i],3===t.length&&(e[n]=t[2](e[n])))}(e,t)})),e.long0||!e.longc||"Albers_Conic_Equal_Area"!==e.projName&&"Lambert_Azimuthal_Equal_Area"!==e.projName||(e.long0=e.longc),e.lat_ts||!e.lat1||"Stereographic_South_Pole"!==e.projName&&"Polar Stereographic (variant B)"!==e.projName||(e.lat0=sy(e.lat1>0?90:-90),e.lat_ts=e.lat1)}(r),r}function Ay(e){var t=this;if(2===arguments.length){var n=arguments[1];"string"==typeof n?"+"===n.charAt(0)?Ay[e]=qg(arguments[1]):Ay[e]=ly(arguments[1]):Ay[e]=n}else if(1===arguments.length){if(Array.isArray(e))return e.map((function(e){Array.isArray(e)?Ay.apply(t,e):Ay(e)}));if("string"==typeof e){if(e in Ay)return Ay[e]}else"EPSG"in e?Ay["EPSG:"+e.EPSG]=e:"ESRI"in e?Ay["ESRI:"+e.ESRI]=e:"IAU2000"in e?Ay["IAU2000:"+e.IAU2000]=e:console.log(e);return}}!function(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("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"),e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]}(Ay);var cy=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var hy=["3857","900913","3785","102113"];function uy(e){if(!function(e){return"string"==typeof e}(e))return e;if(function(e){return e in Ay}(e))return Ay[e];if(function(e){return cy.some((function(t){return e.indexOf(t)>-1}))}(e)){var t=ly(e);if(function(e){var t=Jg(e,"authority");if(t){var n=Jg(t,"epsg");return n&&hy.indexOf(n)>-1}}(t))return Ay["EPSG:3857"];var n=function(e){var t=Jg(e,"extension");if(t)return Jg(t,"proj4")}(t);return n?qg(n):t}return function(e){return"+"===e[0]}(e)?qg(e):void 0}function dy(e,t){var n,i;if(e=e||{},!t)return e;for(i in t)void 0!==(n=t[i])&&(e[i]=n);return e}function fy(e,t,n){var i=e*t;return n/Math.sqrt(1-i*i)}function py(e){return e<0?-1:1}function my(e){return Math.abs(e)<=Xg?e:e-py(e)*Wg}function vy(e,t,n){var i=e*n,r=.5*e;return i=Math.pow((1-i)/(1+i),r),Math.tan(.5*(Qg-t))/i}function gy(e,t){for(var n,i,r=.5*e,a=Qg-2*Math.atan(t),o=0;o<=15;o++)if(n=e*Math.sin(a),a+=i=Qg-2*Math.atan(t*Math.pow((1-n)/(1+n),r))-a,Math.abs(i)<=1e-10)return a;return-9999}function yy(e){return e}var wy=[{init:function(){var e=this.b/this.a;this.es=1-e*e,"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=fy(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(e){var t,n,i=e.x,r=e.y;if(r*Vg>90&&r*Vg<-90&&i*Vg>180&&i*Vg<-180)return null;if(Math.abs(Math.abs(r)-Qg)<=Gg)return null;if(this.sphere)t=this.x0+this.a*this.k0*my(i-this.long0),n=this.y0+this.a*this.k0*Math.log(Math.tan(jg+.5*r));else{var a=Math.sin(r),o=vy(this.e,r,a);t=this.x0+this.a*this.k0*my(i-this.long0),n=this.y0-this.a*this.k0*Math.log(o)}return e.x=t,e.y=n,e},inverse:function(e){var t,n,i=e.x-this.x0,r=e.y-this.y0;if(this.sphere)n=Qg-2*Math.atan(Math.exp(-r/(this.a*this.k0)));else{var a=Math.exp(-r/(this.a*this.k0));if(-9999===(n=gy(this.e,a)))return null}return t=my(this.long0+i/(this.a*this.k0)),e.x=t,e.y=n,e},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:yy,inverse:yy,names:["longlat","identity"]}],xy={},by=[];function My(e,t){var n=by.length;return e.names?(by[n]=e,e.names.forEach((function(e){xy[e.toLowerCase()]=n})),this):(console.log(t),!0)}var Cy={start:function(){wy.forEach(My)},add:My,get:function(e){if(!e)return!1;var t=e.toLowerCase();return void 0!==xy[t]&&by[xy[t]]?by[xy[t]]:void 0}},By={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"}},Ey=By.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};By.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Sy={};Sy.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},Sy.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},Sy.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},Sy.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},Sy.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},Sy.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},Sy.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},Sy.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},Sy.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},Sy.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},Sy.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},Sy.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},Sy.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},Sy.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},Sy.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},Sy.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},Sy.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var Ty={};function _y(e){if(0===e.length)return null;var t="@"===e[0];return t&&(e=e.slice(1)),"null"===e?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:Ty[e]||null,isNull:!1}}function Iy(e){return e/3600*Math.PI/180}function Ly(e,t,n){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,n)))}function Fy(e){return e.map((function(e){return[Iy(e.longitudeShift),Iy(e.latitudeShift)]}))}function ky(e,t,n){return{name:Ly(e,t+8,t+16).trim(),parent:Ly(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,n),upperLatitude:e.getFloat64(t+88,n),lowerLongitude:e.getFloat64(t+104,n),upperLongitude:e.getFloat64(t+120,n),latitudeInterval:e.getFloat64(t+136,n),longitudeInterval:e.getFloat64(t+152,n),gridNodeCount:e.getInt32(t+168,n)}}function Py(e,t,n,i){for(var r=t+176,a=[],o=0;o<n.gridNodeCount;o++){var s={latitudeShift:e.getFloat32(r+16*o,i),longitudeShift:e.getFloat32(r+16*o+4,i),latitudeAccuracy:e.getFloat32(r+16*o+8,i),longitudeAccuracy:e.getFloat32(r+16*o+12,i)};a.push(s)}return a}function Uy(e,t){if(!(this instanceof Uy))return new Uy(e);t=t||function(e){if(e)throw e};var n=uy(e);if("object"==typeof n){var i=Uy.projections.get(n.projName);if(i){if(n.datumCode&&"none"!==n.datumCode){var r=Jg(Sy,n.datumCode);r&&(n.datum_params=n.datum_params||(r.towgs84?r.towgs84.split(","):null),n.ellps=r.ellipse,n.datumName=r.datumName?r.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||"enu",n.ellps=n.ellps||"wgs84",n.lat1=n.lat1||n.lat0;var a=function(e,t,n,i,r){if(!e){var a=Jg(By,i);a||(a=Ey),e=a.a,t=a.b,n=a.rf}return n&&!t&&(t=(1-1/n)*e),(0===n||Math.abs(e-t)<Gg)&&(r=!0,t=e),{a:e,b:t,rf:n,sphere:r}}(n.a,n.b,n.rf,n.ellps,n.sphere),o=function(e,t,n,i){var r=e*e,a=t*t,o=(r-a)/r,s=0;return i?(r=(e*=1-o*(.16666666666666666+o*(.04722222222222222+.022156084656084655*o)))*e,o=0):s=Math.sqrt(o),{es:o,e:s,ep2:(r-a)/a}}(a.a,a.b,a.rf,n.R_A),s=function(e){return void 0===e?null:e.split(",").map(_y)}(n.nadgrids),l=n.datum||function(e,t,n,i,r,a,o){var s={};return s.datum_type=void 0===e||"none"===e?5:4,t&&(s.datum_params=t.map(parseFloat),0===s.datum_params[0]&&0===s.datum_params[1]&&0===s.datum_params[2]||(s.datum_type=1),s.datum_params.length>3&&(0===s.datum_params[3]&&0===s.datum_params[4]&&0===s.datum_params[5]&&0===s.datum_params[6]||(s.datum_type=2,s.datum_params[3]*=zg,s.datum_params[4]*=zg,s.datum_params[5]*=zg,s.datum_params[6]=s.datum_params[6]/1e6+1))),o&&(s.datum_type=3,s.grids=o),s.a=n,s.b=i,s.es=r,s.ep2=a,s}(n.datumCode,n.datum_params,a.a,a.b,o.es,o.ep2,s);dy(this,n),dy(this,i),this.a=a.a,this.b=a.b,this.rf=a.rf,this.sphere=a.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=l,this.init(),t(null,this)}else t(e)}else t(e)}function Dy(e,t,n){var i,r,a,o,s=e.x,l=e.y,A=e.z?e.z:0;if(l<-Qg&&l>-1.001*Qg)l=-Qg;else if(l>Qg&&l<1.001*Qg)l=Qg;else{if(l<-Qg)return{x:-1/0,y:-1/0,z:e.z};if(l>Qg)return{x:1/0,y:1/0,z:e.z}}return s>Math.PI&&(s-=2*Math.PI),r=Math.sin(l),o=Math.cos(l),a=r*r,{x:((i=n/Math.sqrt(1-t*a))+A)*o*Math.cos(s),y:(i+A)*o*Math.sin(s),z:(i*(1-t)+A)*r}}function Ry(e,t,n,i){var r,a,o,s,l,A,c,h,u,d,f,p,m,v,g,y=1e-12,w=e.x,x=e.y,b=e.z?e.z:0;if(r=Math.sqrt(w*w+x*x),a=Math.sqrt(w*w+x*x+b*b),r/n<y){if(v=0,a/n<y)return Qg,g=-i,{x:e.x,y:e.y,z:e.z}}else v=Math.atan2(x,w);o=b/a,h=(s=r/a)*(1-t)*(l=1/Math.sqrt(1-t*(2-t)*s*s)),u=o*l,m=0;do{m++,A=t*(c=n/Math.sqrt(1-t*u*u))/(c+(g=r*h+b*u-c*(1-t*u*u))),p=(f=o*(l=1/Math.sqrt(1-A*(2-A)*s*s)))*h-(d=s*(1-A)*l)*u,h=d,u=f}while(p*p>1e-24&&m<30);return{x:v,y:Math.atan(f/Math.abs(d)),z:g}}function Oy(e){return 1===e||2===e}function Ny(e,t,n){if(function(e,t){return e.datum_type===t.datum_type&&!(e.a!==t.a||Math.abs(e.es-t.es)>5e-11)&&(1===e.datum_type?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:2!==e.datum_type||e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6])}(e,t))return n;if(5===e.datum_type||5===t.datum_type)return n;var i=e.a,r=e.es;if(3===e.datum_type){if(0!==zy(e,!1,n))return;i=Og,r=Ng}var a=t.a,o=t.b,s=t.es;if(3===t.datum_type&&(a=Og,o=6356752.314,s=Ng),r===s&&i===a&&!Oy(e.datum_type)&&!Oy(t.datum_type))return n;if((n=Dy(n,r,i),Oy(e.datum_type)&&(n=function(e,t,n){if(1===t)return{x:e.x+n[0],y:e.y+n[1],z:e.z+n[2]};if(2===t){var i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],l=n[5],A=n[6];return{x:A*(e.x-l*e.y+s*e.z)+i,y:A*(l*e.x+e.y-o*e.z)+r,z:A*(-s*e.x+o*e.y+e.z)+a}}}(n,e.datum_type,e.datum_params)),Oy(t.datum_type)&&(n=function(e,t,n){if(1===t)return{x:e.x-n[0],y:e.y-n[1],z:e.z-n[2]};if(2===t){var i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],l=n[5],A=n[6],c=(e.x-i)/A,h=(e.y-r)/A,u=(e.z-a)/A;return{x:c+l*h-s*u,y:-l*c+h+o*u,z:s*c-o*h+u}}}(n,t.datum_type,t.datum_params)),n=Ry(n,s,a,o),3===t.datum_type)&&0!==zy(t,!0,n))return;return n}function zy(e,t,n){if(null===e.grids||0===e.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},a=[],o=0;o<e.grids.length;o++){var s=e.grids[o];if(a.push(s.name),s.isNull){r=i;break}if(s.mandatory,null!==s.grid){var l=s.grid.subgrids[0],A=(Math.abs(l.del[1])+Math.abs(l.del[0]))/1e4,c=l.ll[0]-A,h=l.ll[1]-A,u=l.ll[0]+(l.lim[0]-1)*l.del[0]+A,d=l.ll[1]+(l.lim[1]-1)*l.del[1]+A;if(!(h>i.y||c>i.x||d<i.y||u<i.x||(r=Qy(i,t,l),isNaN(r.x))))break}else if(s.mandatory)return console.log("Unable to find mandatory grid '"+s.name+"'"),-1}return isNaN(r.x)?(console.log("Failed to find a grid shift table for location '"+-i.x*Vg+" "+i.y*Vg+" tried: '"+a+"'"),-1):(n.x=-r.x,n.y=r.y,0)}function Qy(e,t,n){var i={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return i;var r={x:e.x,y:e.y};r.x-=n.ll[0],r.y-=n.ll[1],r.x=my(r.x-Math.PI)+Math.PI;var a=Gy(r,n);if(t){if(isNaN(a.x))return i;a.x=r.x-a.x,a.y=r.y-a.y;var o,s,l=9;do{if(s=Gy(a,n),isNaN(s.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}o={x:r.x-(s.x+a.x),y:r.y-(s.y+a.y)},a.x+=o.x,a.y+=o.y}while(l--&&Math.abs(o.x)>1e-12&&Math.abs(o.y)>1e-12);if(l<0)return console.log("Inverse grid shift iterator failed to converge."),i;i.x=my(a.x+n.ll[0]),i.y=a.y+n.ll[1]}else isNaN(a.x)||(i.x=e.x+a.x,i.y=e.y+a.y);return i}function Gy(e,t){var n,i={x:e.x/t.del[0],y:e.y/t.del[1]},r=Math.floor(i.x),a=Math.floor(i.y),o=i.x-1*r,s=i.y-1*a,l={x:Number.NaN,y:Number.NaN};if(r<0||r>=t.lim[0])return l;if(a<0||a>=t.lim[1])return l;n=a*t.lim[0]+r;var A=t.cvs[n][0],c=t.cvs[n][1];n++;var h=t.cvs[n][0],u=t.cvs[n][1];n+=t.lim[0];var d=t.cvs[n][0],f=t.cvs[n][1];n--;var p=t.cvs[n][0],m=t.cvs[n][1],v=o*s,g=o*(1-s),y=(1-o)*(1-s),w=(1-o)*s;return l.x=y*A+g*h+w*p+v*d,l.y=y*c+g*u+w*m+v*f,l}function Hy(e,t,n){var i,r,a,o=n.x,s=n.y,l=n.z||0,A={};for(a=0;a<3;a++)if(!t||2!==a||void 0!==n.z)switch(0===a?(i=o,r=-1!=="ew".indexOf(e.axis[a])?"x":"y"):1===a?(i=s,r=-1!=="ns".indexOf(e.axis[a])?"y":"x"):(i=l,r="z"),e.axis[a]){case"e":case"n":A[r]=i;break;case"w":case"s":A[r]=-i;break;case"u":void 0!==n[r]&&(A.z=i);break;case"d":void 0!==n[r]&&(A.z=-i);break;default:return null}return A}function Vy(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t}function jy(e){if("function"==typeof Number.isFinite){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof e||e!=e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function Wy(e,t,n,i){var r;if(Array.isArray(n)&&(n=Vy(n)),function(e){jy(e.x),jy(e.y)}(n),e.datum&&t.datum&&function(e,t){return(1===e.datum.datum_type||2===e.datum.datum_type)&&"WGS84"!==t.datumCode||(1===t.datum.datum_type||2===t.datum.datum_type)&&"WGS84"!==e.datumCode}(e,t)&&(n=Wy(e,r=new Uy("WGS84"),n,i),e=r),i&&"enu"!==e.axis&&(n=Hy(e,!1,n)),"longlat"===e.projName)n={x:n.x*Hg,y:n.y*Hg,z:n.z||0};else if(e.to_meter&&(n={x:n.x*e.to_meter,y:n.y*e.to_meter,z:n.z||0}),!(n=e.inverse(n)))return;if(e.from_greenwich&&(n.x+=e.from_greenwich),n=Ny(e.datum,t.datum,n))return t.from_greenwich&&(n={x:n.x-t.from_greenwich,y:n.y,z:n.z||0}),"longlat"===t.projName?n={x:n.x*Vg,y:n.y*Vg,z:n.z||0}:(n=t.forward(n),t.to_meter&&(n={x:n.x/t.to_meter,y:n.y/t.to_meter,z:n.z||0})),i&&"enu"!==t.axis?Hy(t,!0,n):n}Uy.projections=Cy,Uy.projections.start();var Xy=Uy("WGS84");function Yy(e,t,n,i){var r,a,o;return Array.isArray(n)?(r=Wy(e,t,n,i)||{x:NaN,y:NaN},n.length>2?void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name?"number"==typeof r.z?[r.x,r.y,r.z].concat(n.splice(3)):[r.x,r.y,n[2]].concat(n.splice(3)):[r.x,r.y].concat(n.splice(2)):[r.x,r.y]):(a=Wy(e,t,n,i),2===(o=Object.keys(n)).length||o.forEach((function(i){if(void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name){if("x"===i||"y"===i||"z"===i)return}else if("x"===i||"y"===i)return;a[i]=n[i]})),a)}function Ky(e){return e instanceof Uy?e:e.oProj?e.oProj:Uy(e)}function Zy(e,t,n){e=Ky(e);var i,r=!1;return void 0===t?(t=e,e=Xy,r=!0):(void 0!==t.x||Array.isArray(t))&&(n=t,t=e,e=Xy,r=!0),t=Ky(t),n?Yy(e,t,n):(i={forward:function(n,i){return Yy(e,t,n,i)},inverse:function(n,i){return Yy(t,e,n,i)}},r&&(i.oProj=t),i)}var Jy="AJSAJS",qy="AFAFAF",$y=65,ew=73,tw=79,nw=86,iw=90,rw={forward:aw,inverse:function(e){var t=Aw(uw(e.toUpperCase()));if(t.lat&&t.lon)return[t.lon,t.lat,t.lon,t.lat];return[t.left,t.bottom,t.right,t.top]},toPoint:ow};function aw(e,t){return t=t||5,function(e,t){var n="00000"+e.easting,i="00000"+e.northing;return e.zoneNumber+e.zoneLetter+(r=e.easting,a=e.northing,o=e.zoneNumber,s=hw(o),l=Math.floor(r/1e5),A=Math.floor(a/1e5)%20,function(e,t,n){var i=n-1,r=Jy.charCodeAt(i),a=qy.charCodeAt(i),o=r+e-1,s=a+t,l=!1;return o>iw&&(o=o-iw+$y-1,l=!0),(o===ew||r<ew&&o>ew||(o>ew||r<ew)&&l)&&o++,(o===tw||r<tw&&o>tw||(o>tw||r<tw)&&l)&&++o===ew&&o++,o>iw&&(o=o-iw+$y-1),s>nw?(s=s-nw+$y-1,l=!0):l=!1,(s===ew||a<ew&&s>ew||(s>ew||a<ew)&&l)&&s++,(s===tw||a<tw&&s>tw||(s>tw||a<tw)&&l)&&++s===ew&&s++,s>nw&&(s=s-nw+$y-1),String.fromCharCode(o)+String.fromCharCode(s)}(l,A,s))+n.substr(n.length-5,t)+i.substr(i.length-5,t);var r,a,o,s,l,A}(function(e){var t,n,i,r,a,o,s,l,A=e.lat,c=e.lon,h=6378137,u=.00669438,d=.9996,f=sw(A),p=sw(c);l=Math.floor((c+180)/6)+1,180===c&&(l=60);A>=56&&A<64&&c>=3&&c<12&&(l=32);A>=72&&A<84&&(c>=0&&c<9?l=31:c>=9&&c<21?l=33:c>=21&&c<33?l=35:c>=33&&c<42&&(l=37));s=sw(6*(l-1)-180+3),t=u/(1-u),n=h/Math.sqrt(1-u*Math.sin(f)*Math.sin(f)),i=Math.tan(f)*Math.tan(f),r=t*Math.cos(f)*Math.cos(f),a=Math.cos(f)*(p-s),o=h*((1-u/4-3*u*u/64-5*u*u*u/256)*f-(3*u/8+3*u*u/32+45*u*u*u/1024)*Math.sin(2*f)+(15*u*u/256+45*u*u*u/1024)*Math.sin(4*f)-35*u*u*u/3072*Math.sin(6*f));var m=d*n*(a+(1-i+r)*a*a*a/6+(5-18*i+i*i+72*r-58*t)*a*a*a*a*a/120)+5e5,v=d*(o+n*Math.tan(f)*(a*a/2+(5-i+9*r+4*r*r)*a*a*a*a/24+(61-58*i+i*i+600*r-330*t)*a*a*a*a*a*a/720));A<0&&(v+=1e7);return{northing:Math.round(v),easting:Math.round(m),zoneNumber:l,zoneLetter:cw(A)}}({lat:e[1],lon:e[0]}),t)}function ow(e){var t=Aw(uw(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function sw(e){return e*(Math.PI/180)}function lw(e){return e/Math.PI*180}function Aw(e){var t=e.northing,n=e.easting,i=e.zoneLetter,r=e.zoneNumber;if(r<0||r>60)return null;var a,o,s,l,A,c,h,u,d,f=.9996,p=6378137,m=.00669438,v=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),g=n-5e5,y=t;i<"N"&&(y-=1e7),h=6*(r-1)-180+3,a=.006739496752268451,d=(u=y/f/6367449.145945056)+(3*v/2-27*v*v*v/32)*Math.sin(2*u)+(21*v*v/16-55*v*v*v*v/32)*Math.sin(4*u)+151*v*v*v/96*Math.sin(6*u),o=p/Math.sqrt(1-m*Math.sin(d)*Math.sin(d)),s=Math.tan(d)*Math.tan(d),l=a*Math.cos(d)*Math.cos(d),A=.99330562*p/Math.pow(1-m*Math.sin(d)*Math.sin(d),1.5),c=g/(o*f);var w=d-o*Math.tan(d)/A*(c*c/2-(5+3*s+10*l-4*l*l-9*a)*c*c*c*c/24+(61+90*s+298*l+45*s*s-1.6983531815716497-3*l*l)*c*c*c*c*c*c/720);w=lw(w);var x,b=(c-(1+2*s+l)*c*c*c/6+(5-2*l+28*s-3*l*l+8*a+24*s*s)*c*c*c*c*c/120)/Math.cos(d);if(b=h+lw(b),e.accuracy){var M=Aw({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});x={top:M.lat,right:M.lon,bottom:w,left:b}}else x={lat:w,lon:b};return x}function cw(e){var t="Z";return 84>=e&&e>=72?t="X":72>e&&e>=64?t="W":64>e&&e>=56?t="V":56>e&&e>=48?t="U":48>e&&e>=40?t="T":40>e&&e>=32?t="S":32>e&&e>=24?t="R":24>e&&e>=16?t="Q":16>e&&e>=8?t="P":8>e&&e>=0?t="N":0>e&&e>=-8?t="M":-8>e&&e>=-16?t="L":-16>e&&e>=-24?t="K":-24>e&&e>=-32?t="J":-32>e&&e>=-40?t="H":-40>e&&e>=-48?t="G":-48>e&&e>=-56?t="F":-56>e&&e>=-64?t="E":-64>e&&e>=-72?t="D":-72>e&&e>=-80&&(t="C"),t}function hw(e){var t=e%6;return 0===t&&(t=6),t}function uw(e){if(e&&0===e.length)throw"MGRSPoint coverting from nothing";for(var t,n=e.length,i=null,r="",a=0;!/[A-Z]/.test(t=e.charAt(a));){if(a>=2)throw"MGRSPoint bad conversion from: "+e;r+=t,a++}var o=parseInt(r,10);if(0===a||a+3>n)throw"MGRSPoint bad conversion from: "+e;var s=e.charAt(a++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+e;i=e.substring(a,a+=2);for(var l=hw(o),A=function(e,t){var n=Jy.charCodeAt(t-1),i=1e5,r=!1;for(;n!==e.charCodeAt(0);){if(++n===ew&&n++,n===tw&&n++,n>iw){if(r)throw"Bad character: "+e;n=$y,r=!0}i+=1e5}return i}(i.charAt(0),l),c=function(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;var n=qy.charCodeAt(t-1),i=0,r=!1;for(;n!==e.charCodeAt(0);){if(++n===ew&&n++,n===tw&&n++,n>nw){if(r)throw"Bad character: "+e;n=$y,r=!0}i+=1e5}return i}(i.charAt(1),l);c<dw(s);)c+=2e6;var h=n-a;if(h%2!=0)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"+e;var u,d,f,p=h/2,m=0,v=0;return p>0&&(u=1e5/Math.pow(10,p),d=e.substring(a,a+p),m=parseFloat(d)*u,f=e.substring(a+p),v=parseFloat(f)*u),{easting:m+A,northing:v+c,zoneLetter:s,zoneNumber:o,accuracy:u}}function dw(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}function fw(e,t,n){if(!(this instanceof fw))return new fw(e,t,n);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if("object"==typeof e)this.x=e.x,this.y=e.y,this.z=e.z||0;else if("string"==typeof e&&void 0===t){var i=e.split(",");this.x=parseFloat(i[0],10),this.y=parseFloat(i[1],10),this.z=parseFloat(i[2],10)||0}else this.x=e,this.y=t,this.z=n||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}fw.fromMGRS=function(e){return new fw(ow(e))},fw.prototype.toMGRS=function(e){return aw([this.x,this.y],e)};var pw=.046875,mw=.01953125,vw=.01068115234375;function gw(e){var t=[];t[0]=1-e*(.25+e*(pw+e*(mw+e*vw))),t[1]=e*(.75-e*(pw+e*(mw+e*vw)));var n=e*e;return t[2]=n*(.46875-e*(.013020833333333334+.007120768229166667*e)),n*=e,t[3]=n*(.3645833333333333-.005696614583333333*e),t[4]=n*e*.3076171875,t}function yw(e,t,n,i){return n*=t,t*=t,i[0]*e-n*(i[1]+t*(i[2]+t*(i[3]+t*i[4])))}function ww(e,t,n){for(var i=1/(1-t),r=e,a=20;a;--a){var o=Math.sin(r),s=1-t*o*o;if(r-=s=(yw(r,o,Math.cos(r),n)-e)*(s*Math.sqrt(s))*i,Math.abs(s)<Gg)return r}return r}var xw={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=gw(this.es),this.ml0=yw(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(e){var t,n,i,r=e.x,a=e.y,o=my(r-this.long0),s=Math.sin(a),l=Math.cos(a);if(this.es){var A=l*o,c=Math.pow(A,2),h=this.ep2*Math.pow(l,2),u=Math.pow(h,2),d=Math.abs(l)>Gg?Math.tan(a):0,f=Math.pow(d,2),p=Math.pow(f,2);t=1-this.es*Math.pow(s,2),A/=Math.sqrt(t);var m=yw(a,s,l,this.en);n=this.a*(this.k0*A*(1+c/6*(1-f+h+c/20*(5-18*f+p+14*h-58*f*h+c/42*(61+179*p-p*f-479*f)))))+this.x0,i=this.a*(this.k0*(m-this.ml0+s*o*A/2*(1+c/12*(5-f+9*h+4*u+c/30*(61+p-58*f+270*h-330*f*h+c/56*(1385+543*p-p*f-3111*f))))))+this.y0}else{var v=l*Math.sin(o);if(Math.abs(Math.abs(v)-1)<Gg)return 93;if(n=.5*this.a*this.k0*Math.log((1+v)/(1-v))+this.x0,i=l*Math.cos(o)/Math.sqrt(1-Math.pow(v,2)),(v=Math.abs(i))>=1){if(v-1>Gg)return 93;i=0}else i=Math.acos(i);a<0&&(i=-i),i=this.a*this.k0*(i-this.lat0)+this.y0}return e.x=n,e.y=i,e},inverse:function(e){var t,n,i,r,a=(e.x-this.x0)*(1/this.a),o=(e.y-this.y0)*(1/this.a);if(this.es)if(n=ww(t=this.ml0+o/this.k0,this.es,this.en),Math.abs(n)<Qg){var s=Math.sin(n),l=Math.cos(n),A=Math.abs(l)>Gg?Math.tan(n):0,c=this.ep2*Math.pow(l,2),h=Math.pow(c,2),u=Math.pow(A,2),d=Math.pow(u,2);t=1-this.es*Math.pow(s,2);var f=a*Math.sqrt(t)/this.k0,p=Math.pow(f,2);i=n-(t*=A)*p/(1-this.es)*.5*(1-p/12*(5+3*u-9*c*u+c-4*h-p/30*(61+90*u-252*c*u+45*d+46*c-p/56*(1385+3633*u+4095*d+1574*d*u)))),r=my(this.long0+f*(1-p/6*(1+2*u+c-p/20*(5+28*u+24*d+8*c*u+6*c-p/42*(61+662*u+1320*d+720*d*u))))/l)}else i=Qg*py(o),r=0;else{var m=Math.exp(a/this.k0),v=.5*(m-1/m),g=this.lat0+o/this.k0,y=Math.cos(g);t=Math.sqrt((1-Math.pow(y,2))/(1+Math.pow(v,2))),i=Math.asin(t),o<0&&(i=-i),r=0===v&&0===y?0:my(Math.atan2(v,y)+this.long0)}return e.x=r,e.y=i,e},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function bw(e){var t=Math.exp(e);return t=(t-1/t)/2}function Mw(e,t){e=Math.abs(e),t=Math.abs(t);var n=Math.max(e,t),i=Math.min(e,t)/(n||1);return n*Math.sqrt(1+Math.pow(i,2))}function Cw(e){var t=Math.abs(e);return t=function(e){var t=1+e,n=t-1;return 0===n?e:e*Math.log(t)/n}(t*(1+t/(Mw(1,t)+1))),e<0?-t:t}function Bw(e,t){for(var n,i=2*Math.cos(2*t),r=e.length-1,a=e[r],o=0;--r>=0;)n=i*a-o+e[r],o=a,a=n;return t+n*Math.sin(2*t)}function Ew(e,t,n){for(var i,r,a=Math.sin(t),o=Math.cos(t),s=bw(n),l=function(e){var t=Math.exp(e);return(t+1/t)/2}(n),A=2*o*l,c=-2*a*s,h=e.length-1,u=e[h],d=0,f=0,p=0;--h>=0;)i=f,r=d,u=A*(f=u)-i-c*(d=p)+e[h],p=c*f-r+A*d;return[(A=a*l)*u-(c=o*s)*p,A*p+c*u]}var Sw={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&&(xw.init.apply(this),this.forward=xw.forward,this.inverse=xw.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 e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),n=t;this.cgb[0]=t*(2+t*(-2/3+t*(t*(116/45+t*(26/45+t*(-2854/675)))-2))),this.cbg[0]=t*(t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))-2),n*=t,this.cgb[1]=n*(7/3+t*(t*(-227/45+t*(2704/315+t*(2323/945)))-1.6)),this.cbg[1]=n*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),n*=t,this.cgb[2]=n*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=n*(-26/15+t*(34/21+t*(1.6+t*(-12686/2835)))),n*=t,this.cgb[3]=n*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=n*(1237/630+t*(t*(-24832/14175)-2.4)),n*=t,this.cgb[4]=n*(4174/315+t*(-144838/6237)),this.cbg[4]=n*(-734/315+t*(109598/31185)),n*=t,this.cgb[5]=n*(601676/22275),this.cbg[5]=n*(444337/155925),n=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=t*(t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))-.5),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=n*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=n*(13/48+t*(t*(557/1440+t*(281/630+t*(-1983433/1935360)))-.6)),n*=t,this.utg[2]=n*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=n*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),n*=t,this.utg[3]=n*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=n*(49561/161280+t*(-179/168+t*(6601661/7257600))),n*=t,this.utg[4]=n*(-4583/161280+t*(108847/3991680)),this.gtu[4]=n*(34729/80640+t*(-3418889/1995840)),n*=t,this.utg[5]=n*(-20648693/638668800),this.gtu[5]=.6650675310896665*n;var i=Bw(this.cbg,this.lat0);this.Zb=-this.Qn*(i+function(e,t){for(var n,i=2*Math.cos(t),r=e.length-1,a=e[r],o=0;--r>=0;)n=i*a-o+e[r],o=a,a=n;return Math.sin(t)*n}(this.gtu,2*i))},forward:function(e){var t=my(e.x-this.long0),n=e.y;n=Bw(this.cbg,n);var i=Math.sin(n),r=Math.cos(n),a=Math.sin(t),o=Math.cos(t);n=Math.atan2(i,o*r),t=Math.atan2(a*r,Mw(i,r*o)),t=Cw(Math.tan(t));var s,l,A=Ew(this.gtu,2*n,2*t);return n+=A[0],t+=A[1],Math.abs(t)<=2.623395162778?(s=this.a*(this.Qn*t)+this.x0,l=this.a*(this.Qn*n+this.Zb)+this.y0):(s=1/0,l=1/0),e.x=s,e.y=l,e},inverse:function(e){var t,n,i=(e.x-this.x0)*(1/this.a),r=(e.y-this.y0)*(1/this.a);if(r=(r-this.Zb)/this.Qn,i/=this.Qn,Math.abs(i)<=2.623395162778){var a=Ew(this.utg,2*r,2*i);r+=a[0],i+=a[1],i=Math.atan(bw(i));var o=Math.sin(r),s=Math.cos(r),l=Math.sin(i),A=Math.cos(i);r=Math.atan2(o*A,Mw(l,A*s)),t=my((i=Math.atan2(l,A*s))+this.long0),n=Bw(this.cgb,r)}else t=1/0,n=1/0;return e.x=t,e.y=n,e},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]};var Tw={init:function(){var e=function(e,t){if(void 0===e){if((e=Math.floor(30*(my(t)+Math.PI)/Math.PI)+1)<0)return 0;if(e>60)return 60}return e}(this.zone,this.long0);if(void 0===e)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*Hg,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Sw.init.apply(this),this.forward=Sw.forward,this.inverse=Sw.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function _w(e,t){return Math.pow((1-e)/(1+e),t)}var Iw={init:function(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+jg)/(Math.pow(Math.tan(.5*this.lat0+jg),this.C)*_w(this.e*e,this.ratexp))},forward:function(e){var t=e.x,n=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+jg),this.C)*_w(this.e*Math.sin(n),this.ratexp))-Qg,e.x=this.C*t,e},inverse:function(e){for(var t=e.x/this.C,n=e.y,i=Math.pow(Math.tan(.5*n+jg)/this.K,1/this.C),r=20;r>0&&(n=2*Math.atan(i*_w(this.e*Math.sin(e.y),-.5*this.e))-Qg,!(Math.abs(n-e.y)<1e-14));--r)e.y=n;return r?(e.x=t,e.y=n,e):null},names:["gauss"]};var Lw={init:function(){Iw.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(e){var t,n,i,r;return e.x=my(e.x-this.long0),Iw.forward.apply(this,[e]),t=Math.sin(e.y),n=Math.cos(e.y),i=Math.cos(e.x),r=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*n*i),e.x=r*n*Math.sin(e.x),e.y=r*(this.cosc0*t-this.sinc0*n*i),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e},inverse:function(e){var t,n,i,r,a;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,a=Math.sqrt(e.x*e.x+e.y*e.y)){var o=2*Math.atan2(a,this.R2);t=Math.sin(o),n=Math.cos(o),r=Math.asin(n*this.sinc0+e.y*t*this.cosc0/a),i=Math.atan2(e.x*t,a*this.cosc0*n-e.y*this.sinc0*t)}else r=this.phic0,i=0;return e.x=i,e.y=r,Iw.inverse.apply(this,[e]),e.x=my(e.x+this.long0),e},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var Fw={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)<=Gg&&(this.k0=.5*(1+py(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=Gg&&(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)<=Gg&&(this.k0=.5*this.cons*fy(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/vy(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=fy(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Qg,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(e){var t,n,i,r,a,o,s=e.x,l=e.y,A=Math.sin(l),c=Math.cos(l),h=my(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=Gg&&Math.abs(l+this.lat0)<=Gg?(e.x=NaN,e.y=NaN,e):this.sphere?(t=2*this.k0/(1+this.sinlat0*A+this.coslat0*c*Math.cos(h)),e.x=this.a*t*c*Math.sin(h)+this.x0,e.y=this.a*t*(this.coslat0*A-this.sinlat0*c*Math.cos(h))+this.y0,e):(n=2*Math.atan(this.ssfn_(l,A,this.e))-Qg,r=Math.cos(n),i=Math.sin(n),Math.abs(this.coslat0)<=Gg?(a=vy(this.e,l*this.con,this.con*A),o=2*this.a*this.k0*a/this.cons,e.x=this.x0+o*Math.sin(s-this.long0),e.y=this.y0-this.con*o*Math.cos(s-this.long0),e):(Math.abs(this.sinlat0)<Gg?(t=2*this.a*this.k0/(1+r*Math.cos(h)),e.y=t*i):(t=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*i+this.cosX0*r*Math.cos(h))),e.y=t*(this.cosX0*i-this.sinX0*r*Math.cos(h))+this.y0),e.x=t*r*Math.sin(h)+this.x0,e))},inverse:function(e){var t,n,i,r,a;e.x-=this.x0,e.y-=this.y0;var o=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var s=2*Math.atan(o/(2*this.a*this.k0));return t=this.long0,n=this.lat0,o<=Gg?(e.x=t,e.y=n,e):(n=Math.asin(Math.cos(s)*this.sinlat0+e.y*Math.sin(s)*this.coslat0/o),t=Math.abs(this.coslat0)<Gg?this.lat0>0?my(this.long0+Math.atan2(e.x,-1*e.y)):my(this.long0+Math.atan2(e.x,e.y)):my(this.long0+Math.atan2(e.x*Math.sin(s),o*this.coslat0*Math.cos(s)-e.y*this.sinlat0*Math.sin(s))),e.x=t,e.y=n,e)}if(Math.abs(this.coslat0)<=Gg){if(o<=Gg)return n=this.lat0,t=this.long0,e.x=t,e.y=n,e;e.x*=this.con,e.y*=this.con,i=o*this.cons/(2*this.a*this.k0),n=this.con*gy(this.e,i),t=this.con*my(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else r=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,o<=Gg?a=this.X0:(a=Math.asin(Math.cos(r)*this.sinX0+e.y*Math.sin(r)*this.cosX0/o),t=my(this.long0+Math.atan2(e.x*Math.sin(r),o*this.cosX0*Math.cos(r)-e.y*this.sinX0*Math.sin(r)))),n=-1*gy(this.e,Math.tan(.5*(Qg+a)));return e.x=t,e.y=n,e},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(e,t,n){return t*=n,Math.tan(.5*(Qg+e))*Math.pow((1-t)/(1+t),.5*n)}};var kw={init:function(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),n=this.a,i=1/this.rf,r=2*i-Math.pow(i,2),a=this.e=Math.sqrt(r);this.R=this.k0*n*Math.sqrt(1-r)/(1-r*Math.pow(t,2)),this.alpha=Math.sqrt(1+r/(1-r)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var o=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+e/2)),l=Math.log((1+a*t)/(1-a*t));this.K=o-this.alpha*s+this.alpha*a/2*l},forward:function(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),i=-this.alpha*(t+n)+this.K,r=2*(Math.atan(Math.exp(i))-Math.PI/4),a=this.alpha*(e.x-this.lambda0),o=Math.atan(Math.sin(a)/(Math.sin(this.b0)*Math.tan(r)+Math.cos(this.b0)*Math.cos(a))),s=Math.asin(Math.cos(this.b0)*Math.sin(r)-Math.sin(this.b0)*Math.cos(r)*Math.cos(a));return e.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,e.x=this.R*o+this.x0,e},inverse:function(e){for(var t=e.x-this.x0,n=e.y-this.y0,i=t/this.R,r=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),a=Math.asin(Math.cos(this.b0)*Math.sin(r)+Math.sin(this.b0)*Math.cos(r)*Math.cos(i)),o=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(r))),s=this.lambda0+o/this.alpha,l=0,A=a,c=-1e3,h=0;Math.abs(A-c)>1e-7;){if(++h>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+a/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(A))/2)),c=A,A=2*Math.atan(Math.exp(l))-Math.PI/2}return e.x=s,e.y=A,e},names:["somerc"]},Pw=1e-7;var Uw={init:function(){var e,t,n,i,r,a,o,s,l,A,c,h,u,d=0,f=0,p=0,m=0,v=0,g=0,y=0;this.no_off=(u="object"==typeof(h=this).PROJECTION?Object.keys(h.PROJECTION)[0]:h.PROJECTION,"no_uoff"in h||"no_off"in h||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(u)),this.no_rot="no_rot"in this;var w=!1;"alpha"in this&&(w=!0);var x=!1;if("rectified_grid_angle"in this&&(x=!0),w&&(y=this.alpha),x&&(d=this.rectified_grid_angle*Hg),w||x)f=this.longc;else if(p=this.long1,v=this.lat1,m=this.long2,g=this.lat2,Math.abs(v-g)<=Pw||(e=Math.abs(v))<=Pw||Math.abs(e-Qg)<=Pw||Math.abs(Math.abs(this.lat0)-Qg)<=Pw||Math.abs(Math.abs(g)-Qg)<=Pw)throw new Error;var b=1-this.es;t=Math.sqrt(b),Math.abs(this.lat0)>Gg?(s=Math.sin(this.lat0),n=Math.cos(this.lat0),e=1-this.es*s*s,this.B=n*n,this.B=Math.sqrt(1+this.es*this.B*this.B/b),this.A=this.B*this.k0*t/e,(r=(i=this.B*t/(n*Math.sqrt(e)))*i-1)<=0?r=0:(r=Math.sqrt(r),this.lat0<0&&(r=-r)),this.E=r+=i,this.E*=Math.pow(vy(this.e,this.lat0,s),this.B)):(this.B=1/t,this.A=this.k0,this.E=i=r=1),w||x?(w?(c=Math.asin(Math.sin(y)/i),x||(d=y)):(c=d,y=Math.asin(i*Math.sin(c))),this.lam0=f-Math.asin(.5*(r-1/r)*Math.tan(c))/this.B):(a=Math.pow(vy(this.e,v,Math.sin(v)),this.B),o=Math.pow(vy(this.e,g,Math.sin(g)),this.B),r=this.E/a,l=(o-a)/(o+a),A=((A=this.E*this.E)-o*a)/(A+o*a),(e=p-m)<-Math.pi?m-=Wg:e>Math.pi&&(m+=Wg),this.lam0=my(.5*(p+m)-Math.atan(A*Math.tan(.5*this.B*(p-m))/l)/this.B),c=Math.atan(2*Math.sin(this.B*my(p-this.lam0))/(r-1/r)),d=y=Math.asin(i*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(d),this.cosrot=Math.cos(d),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(i*i-1)/Math.cos(y))),this.lat0<0&&(this.u_0=-this.u_0)),r=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(jg-r)),this.v_pole_s=this.ArB*Math.log(Math.tan(jg+r))},forward:function(e){var t,n,i,r,a,o,s,l,A={};if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-Qg)>Gg){if(t=.5*((a=this.E/Math.pow(vy(this.e,e.y,Math.sin(e.y)),this.B))-(o=1/a)),n=.5*(a+o),r=Math.sin(this.B*e.x),i=(t*this.singam-r*this.cosgam)/n,Math.abs(Math.abs(i)-1)<Gg)throw new Error;l=.5*this.ArB*Math.log((1-i)/(1+i)),o=Math.cos(this.B*e.x),s=Math.abs(o)<Pw?this.A*e.x:this.ArB*Math.atan2(t*this.cosgam+r*this.singam,o)}else l=e.y>0?this.v_pole_n:this.v_pole_s,s=this.ArB*e.y;return this.no_rot?(A.x=s,A.y=l):(s-=this.u_0,A.x=l*this.cosrot+s*this.sinrot,A.y=s*this.cosrot-l*this.sinrot),A.x=this.a*A.x+this.x0,A.y=this.a*A.y+this.y0,A},inverse:function(e){var t,n,i,r,a,o,s,l={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(n=e.y,t=e.x):(n=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),r=.5*((i=Math.exp(-this.BrA*n))-1/i),a=.5*(i+1/i),s=((o=Math.sin(this.BrA*t))*this.cosgam+r*this.singam)/a,Math.abs(Math.abs(s)-1)<Gg)l.x=0,l.y=s<0?-Qg:Qg;else{if(l.y=this.E/Math.sqrt((1+s)/(1-s)),l.y=gy(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(r*this.cosgam-o*this.singam,Math.cos(this.BrA*t))}return l.x+=this.lam0,l},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]};var Dw={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)<Gg)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),n=Math.cos(this.lat1),i=fy(this.e,t,n),r=vy(this.e,this.lat1,t),a=Math.sin(this.lat2),o=Math.cos(this.lat2),s=fy(this.e,a,o),l=vy(this.e,this.lat2,a),A=vy(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>Gg?this.ns=Math.log(i/s)/Math.log(r/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=i/(this.ns*Math.pow(r,this.ns)),this.rh=this.a*this.f0*Math.pow(A,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(e){var t=e.x,n=e.y;Math.abs(2*Math.abs(n)-Math.PI)<=Gg&&(n=py(n)*(Qg-2e-10));var i,r,a=Math.abs(Math.abs(n)-Qg);if(a>Gg)i=vy(this.e,n,Math.sin(n)),r=this.a*this.f0*Math.pow(i,this.ns);else{if((a=n*this.ns)<=0)return null;r=0}var o=this.ns*my(t-this.long0);return e.x=this.k0*(r*Math.sin(o))+this.x0,e.y=this.k0*(this.rh-r*Math.cos(o))+this.y0,e},inverse:function(e){var t,n,i,r,a,o=(e.x-this.x0)/this.k0,s=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(o*o+s*s),n=1):(t=-Math.sqrt(o*o+s*s),n=-1);var l=0;if(0!==t&&(l=Math.atan2(n*o,n*s)),0!==t||this.ns>0){if(n=1/this.ns,i=Math.pow(t/(this.a*this.f0),n),-9999===(r=gy(this.e,i)))return null}else r=-Qg;return a=my(l/this.ns+this.long0),e.x=a,e.y=r,e},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]};var Rw={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(e){var t,n,i,r,a,o,s,l=e.x,A=e.y,c=my(l-this.long0);return t=Math.pow((1+this.e*Math.sin(A))/(1-this.e*Math.sin(A)),this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.pow(Math.tan(A/2+this.s45),this.alfa)/t)-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)),a=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(r)),o=this.n*a,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(r/2+this.s45),this.n),e.y=s*Math.cos(o)/1,e.x=s*Math.sin(o)/1,this.czech||(e.y*=-1,e.x*=-1),e},inverse:function(e){var t,n,i,r,a,o,s,l=e.x;e.x=e.y,e.y=l,this.czech||(e.y*=-1,e.x*=-1),a=Math.sqrt(e.x*e.x+e.y*e.y),r=Math.atan2(e.y,e.x)/Math.sin(this.s0),i=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=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(t)),e.x=this.long0-n/this.alfa,o=t,s=0;var A=0;do{e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.e/2))-this.s45),Math.abs(o-e.y)<1e-10&&(s=1),o=e.y,A+=1}while(0===s&&A<15);return A>=15?null:e},names:["Krovak","krovak"]};function Ow(e,t,n,i,r){return e*r-t*Math.sin(2*r)+n*Math.sin(4*r)-i*Math.sin(6*r)}function Nw(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function zw(e){return.375*e*(1+.25*e*(1+.46875*e))}function Qw(e){return.05859375*e*e*(1+.75*e)}function Gw(e){return e*e*e*(35/3072)}function Hw(e,t,n){var i=t*n;return e/Math.sqrt(1-i*i)}function Vw(e){return Math.abs(e)<Qg?e:e-py(e)*Math.PI}function jw(e,t,n,i,r){var a,o;a=e/t;for(var s=0;s<15;s++)if(a+=o=(e-(t*a-n*Math.sin(2*a)+i*Math.sin(4*a)-r*Math.sin(6*a)))/(t-2*n*Math.cos(2*a)+4*i*Math.cos(4*a)-6*r*Math.cos(6*a)),Math.abs(o)<=1e-10)return a;return NaN}var Ww={init:function(){this.sphere||(this.e0=Nw(this.es),this.e1=zw(this.es),this.e2=Qw(this.es),this.e3=Gw(this.es),this.ml0=this.a*Ow(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(e){var t,n,i=e.x,r=e.y;if(i=my(i-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(r)*Math.sin(i)),n=this.a*(Math.atan2(Math.tan(r),Math.cos(i))-this.lat0);else{var a=Math.sin(r),o=Math.cos(r),s=Hw(this.a,this.e,a),l=Math.tan(r)*Math.tan(r),A=i*Math.cos(r),c=A*A,h=this.es*o*o/(1-this.es);t=s*A*(1-c*l*(1/6-(8-l+8*h)*c/120)),n=this.a*Ow(this.e0,this.e1,this.e2,this.e3,r)-this.ml0+s*a/o*c*(.5+(5-l+6*h)*c/24)}return e.x=t+this.x0,e.y=n+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,n,i=e.x/this.a,r=e.y/this.a;if(this.sphere){var a=r+this.lat0;t=Math.asin(Math.sin(a)*Math.cos(i)),n=Math.atan2(Math.tan(i),Math.cos(a))}else{var o=jw(this.ml0/this.a+r,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-Qg)<=Gg)return e.x=this.long0,e.y=Qg,r<0&&(e.y*=-1),e;var s=Hw(this.a,this.e,Math.sin(o)),l=s*s*s/this.a/this.a*(1-this.es),A=Math.pow(Math.tan(o),2),c=i*this.a/s,h=c*c;t=o-s*Math.tan(o)/l*c*c*(.5-(1+3*A)*c*c/24),n=c*(1-h*(A/3+(1+3*A)*A*h/15))/Math.cos(o)}return e.x=my(n+this.long0),e.y=Vw(t),e},names:["Cassini","Cassini_Soldner","cass"]};function Xw(e,t){var n;return e>1e-7?(1-e*e)*(t/(1-(n=e*t)*n)-.5/e*Math.log((1-n)/(1+n))):2*t}var Yw=.3333333333333333,Kw=.17222222222222222,Zw=.10257936507936508,Jw=.06388888888888888,qw=.0664021164021164,$w=.016415012942191543;var ex={init:function(){var e,t=Math.abs(this.lat0);if(Math.abs(t-Qg)<Gg?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<Gg?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=Xw(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(e){var t,n=[];return n[0]=e*Yw,t=e*e,n[0]+=t*Kw,n[1]=t*Jw,t*=e,n[0]+=t*Zw,n[1]+=t*qw,n[2]=t*$w,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),e=Math.sin(this.lat0),this.sinb1=Xw(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*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(e){var t,n,i,r,a,o,s,l,A,c,h=e.x,u=e.y;if(h=my(h-this.long0),this.sphere){if(a=Math.sin(u),c=Math.cos(u),i=Math.cos(h),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((n=this.mode===this.EQUIT?1+c*i:1+this.sinph0*a+this.cosph0*c*i)<=Gg)return null;t=(n=Math.sqrt(2/n))*c*Math.sin(h),n*=this.mode===this.EQUIT?a:this.cosph0*a-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(u+this.lat0)<Gg)return null;n=jg-.5*u,t=(n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)))*Math.sin(h),n*=i}}else{switch(s=0,l=0,A=0,i=Math.cos(h),r=Math.sin(h),a=Math.sin(u),o=Xw(this.e,a),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(s=o/this.qp,l=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:A=1+this.sinb1*s+this.cosb1*l*i;break;case this.EQUIT:A=1+l*i;break;case this.N_POLE:A=Qg+u,o=this.qp-o;break;case this.S_POLE:A=u-Qg,o=this.qp+o}if(Math.abs(A)<Gg)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:A=Math.sqrt(2/A),n=this.mode===this.OBLIQ?this.ymf*A*(this.cosb1*s-this.sinb1*l*i):(A=Math.sqrt(2/(1+l*i)))*s*this.ymf,t=this.xmf*A*l*r;break;case this.N_POLE:case this.S_POLE:o>=0?(t=(A=Math.sqrt(o))*r,n=i*(this.mode===this.S_POLE?A:-A)):t=n=0}}return e.x=this.a*t+this.x0,e.y=this.a*n+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,n,i,r,a,o,s,l,A,c,h=e.x/this.a,u=e.y/this.a;if(this.sphere){var d,f=0,p=0;if((n=.5*(d=Math.sqrt(h*h+u*u)))>1)return null;switch(n=2*Math.asin(n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(p=Math.sin(n),f=Math.cos(n)),this.mode){case this.EQUIT:n=Math.abs(d)<=Gg?0:Math.asin(u*p/d),h*=p,u=f*d;break;case this.OBLIQ:n=Math.abs(d)<=Gg?this.lat0:Math.asin(f*this.sinph0+u*p*this.cosph0/d),h*=p*this.cosph0,u=(f-Math.sin(n)*this.sinph0)*d;break;case this.N_POLE:u=-u,n=Qg-n;break;case this.S_POLE:n-=Qg}t=0!==u||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(h,u):0}else{if(s=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(h/=this.dd,u*=this.dd,(o=Math.sqrt(h*h+u*u))<Gg)return e.x=this.long0,e.y=this.lat0,e;r=2*Math.asin(.5*o/this.rq),i=Math.cos(r),h*=r=Math.sin(r),this.mode===this.OBLIQ?(s=i*this.sinb1+u*r*this.cosb1/o,a=this.qp*s,u=o*this.cosb1*i-u*this.sinb1*r):(s=u*r/o,a=this.qp*s,u=o*i)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(u=-u),!(a=h*h+u*u))return e.x=this.long0,e.y=this.lat0,e;s=1-a/this.qp,this.mode===this.S_POLE&&(s=-s)}t=Math.atan2(h,u),l=Math.asin(s),A=this.apa,c=l+l,n=l+A[0]*Math.sin(c)+A[1]*Math.sin(c+c)+A[2]*Math.sin(c+c+c)}return e.x=my(this.long0+t),e.y=n,e},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function tx(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}var nx={init:function(){Math.abs(this.lat1+this.lat2)<Gg||(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=fy(this.e3,this.sin_po,this.cos_po),this.qs1=Xw(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=fy(this.e3,this.sin_po,this.cos_po),this.qs2=Xw(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=Xw(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>Gg?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(e){var t=e.x,n=e.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var i=Xw(this.e3,this.sin_phi,this.cos_phi),r=this.a*Math.sqrt(this.c-this.ns0*i)/this.ns0,a=this.ns0*my(t-this.long0),o=r*Math.sin(a)+this.x0,s=this.rh-r*Math.cos(a)+this.y0;return e.x=o,e.y=s,e},inverse:function(e){var t,n,i,r,a,o;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),i=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),i=-1),r=0,0!==t&&(r=Math.atan2(i*e.x,i*e.y)),i=t*this.ns0/this.a,this.sphere?o=Math.asin((this.c-i*i)/(2*this.ns0)):(n=(this.c-i*i)/this.ns0,o=this.phi1z(this.e3,n)),a=my(r/this.ns0+this.long0),e.x=a,e.y=o,e},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(e,t){var n,i,r,a,o=tx(.5*t);if(e<Gg)return o;for(var s=e*e,l=1;l<=25;l++)if(o+=a=.5*(r=1-(i=e*(n=Math.sin(o)))*i)*r/Math.cos(o)*(t/(1-s)-n/r+.5/e*Math.log((1-i)/(1+i))),Math.abs(a)<=1e-7)return o;return null}};var ix={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(e){var t,n,i,r,a,o,s,l=e.x,A=e.y;return i=my(l-this.long0),t=Math.sin(A),n=Math.cos(A),r=Math.cos(i),1,(a=this.sin_p14*t+this.cos_p14*n*r)>0||Math.abs(a)<=Gg?(o=this.x0+1*this.a*n*Math.sin(i)/a,s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*n*r)/a):(o=this.x0+this.infinity_dist*n*Math.sin(i),s=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*n*r)),e.x=o,e.y=s,e},inverse:function(e){var t,n,i,r,a,o;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(r=Math.atan2(t,this.rc),n=Math.sin(r),o=tx((i=Math.cos(r))*this.sin_p14+e.y*n*this.cos_p14/t),a=Math.atan2(e.x*n,t*this.cos_p14*i-e.y*this.sin_p14*n),a=my(this.long0+a)):(o=this.phic0,a=0),e.x=a,e.y=o,e},names:["gnom"]};var rx={init:function(){this.sphere||(this.k0=fy(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(e){var t,n,i=e.x,r=e.y,a=my(i-this.long0);if(this.sphere)t=this.x0+this.a*a*Math.cos(this.lat_ts),n=this.y0+this.a*Math.sin(r)/Math.cos(this.lat_ts);else{var o=Xw(this.e,Math.sin(r));t=this.x0+this.a*this.k0*a,n=this.y0+this.a*o*.5/this.k0}return e.x=t,e.y=n,e},inverse:function(e){var t,n;return e.x-=this.x0,e.y-=this.y0,this.sphere?(t=my(this.long0+e.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(n=function(e,t){var n=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-n)<1e-6)return t<0?-1*Qg:Qg;for(var i,r,a,o,s=Math.asin(.5*t),l=0;l<30;l++)if(r=Math.sin(s),a=Math.cos(s),o=e*r,s+=i=Math.pow(1-o*o,2)/(2*a)*(t/(1-e*e)-r/(1-o*o)+.5/e*Math.log((1-o)/(1+o))),Math.abs(i)<=1e-10)return s;return NaN}(this.e,2*e.y*this.k0/this.a),t=my(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=n,e},names:["cea"]};var ax={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(e){var t=e.x,n=e.y,i=my(t-this.long0),r=Vw(n-this.lat0);return e.x=this.x0+this.a*i*this.rc,e.y=this.y0+this.a*r,e},inverse:function(e){var t=e.x,n=e.y;return e.x=my(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=Vw(this.lat0+(n-this.y0)/this.a),e},names:["Equirectangular","Equidistant_Cylindrical","eqc"]};var ox={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Nw(this.es),this.e1=zw(this.es),this.e2=Qw(this.es),this.e3=Gw(this.es),this.ml0=this.a*Ow(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(e){var t,n,i,r=e.x,a=e.y,o=my(r-this.long0);if(i=o*Math.sin(a),this.sphere)Math.abs(a)<=Gg?(t=this.a*o,n=-1*this.a*this.lat0):(t=this.a*Math.sin(i)/Math.tan(a),n=this.a*(Vw(a-this.lat0)+(1-Math.cos(i))/Math.tan(a)));else if(Math.abs(a)<=Gg)t=this.a*o,n=-1*this.ml0;else{var s=Hw(this.a,this.e,Math.sin(a))/Math.tan(a);t=s*Math.sin(i),n=this.a*Ow(this.e0,this.e1,this.e2,this.e3,a)-this.ml0+s*(1-Math.cos(i))}return e.x=t+this.x0,e.y=n+this.y0,e},inverse:function(e){var t,n,i,r,a,o,s,l,A;if(i=e.x-this.x0,r=e.y-this.y0,this.sphere)if(Math.abs(r+this.a*this.lat0)<=Gg)t=my(i/this.a+this.long0),n=0;else{var c;for(o=this.lat0+r/this.a,s=i*i/this.a/this.a+o*o,l=o,a=20;a;--a)if(l+=A=-1*(o*(l*(c=Math.tan(l))+1)-l-.5*(l*l+s)*c)/((l-o)/c-1),Math.abs(A)<=Gg){n=l;break}t=my(this.long0+Math.asin(i*Math.tan(l)/this.a)/Math.sin(n))}else if(Math.abs(r+this.ml0)<=Gg)n=0,t=my(this.long0+i/this.a);else{var h,u,d,f,p;for(o=(this.ml0+r)/this.a,s=i*i/this.a/this.a+o*o,l=o,a=20;a;--a)if(p=this.e*Math.sin(l),h=Math.sqrt(1-p*p)*Math.tan(l),u=this.a*Ow(this.e0,this.e1,this.e2,this.e3,l),d=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),l-=A=(o*(h*(f=u/this.a)+1)-f-.5*h*(f*f+s))/(this.es*Math.sin(2*l)*(f*f+s-2*o*f)/(4*h)+(o-f)*(h*d-2/Math.sin(2*l))-d),Math.abs(A)<=Gg){n=l;break}h=Math.sqrt(1-this.es*Math.pow(Math.sin(n),2))*Math.tan(n),t=my(this.long0+Math.asin(i*h/this.a)/Math.sin(n))}return e.x=t,e.y=n,e},names:["Polyconic","poly"]};var sx={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(e){var t,n=e.x,i=e.y-this.lat0,r=n-this.long0,a=i/zg*1e-5,o=r,s=1,l=0;for(t=1;t<=10;t++)s*=a,l+=this.A[t]*s;var A,c=l,h=o,u=1,d=0,f=0,p=0;for(t=1;t<=6;t++)A=d*c+u*h,u=u*c-d*h,d=A,f=f+this.B_re[t]*u-this.B_im[t]*d,p=p+this.B_im[t]*u+this.B_re[t]*d;return e.x=p*this.a+this.x0,e.y=f*this.a+this.y0,e},inverse:function(e){var t,n,i=e.x,r=e.y,a=i-this.x0,o=(r-this.y0)/this.a,s=a/this.a,l=1,A=0,c=0,h=0;for(t=1;t<=6;t++)n=A*o+l*s,l=l*o-A*s,A=n,c=c+this.C_re[t]*l-this.C_im[t]*A,h=h+this.C_im[t]*l+this.C_re[t]*A;for(var u=0;u<this.iterations;u++){var d,f=c,p=h,m=o,v=s;for(t=2;t<=6;t++)d=p*c+f*h,f=f*c-p*h,p=d,m+=(t-1)*(this.B_re[t]*f-this.B_im[t]*p),v+=(t-1)*(this.B_im[t]*f+this.B_re[t]*p);f=1,p=0;var g=this.B_re[1],y=this.B_im[1];for(t=2;t<=6;t++)d=p*c+f*h,f=f*c-p*h,p=d,g+=t*(this.B_re[t]*f-this.B_im[t]*p),y+=t*(this.B_im[t]*f+this.B_re[t]*p);var w=g*g+y*y;c=(m*g+v*y)/w,h=(v*g-m*y)/w}var x=c,b=h,M=1,C=0;for(t=1;t<=9;t++)M*=x,C+=this.D[t]*M;var B=this.lat0+C*zg*1e5,E=this.long0+b;return e.x=E,e.y=B,e},names:["New_Zealand_Map_Grid","nzmg"]};var lx={init:function(){},forward:function(e){var t=e.x,n=e.y,i=my(t-this.long0),r=this.x0+this.a*i,a=this.y0+this.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return e.x=r,e.y=a,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t=my(this.long0+e.x/this.a),n=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=n,e},names:["Miller_Cylindrical","mill"]};var Ax={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=gw(this.es)},forward:function(e){var t,n,i=e.x,r=e.y;if(i=my(i-this.long0),this.sphere){if(this.m)for(var a=this.n*Math.sin(r),o=20;o;--o){var s=(this.m*r+Math.sin(r)-a)/(this.m+Math.cos(r));if(r-=s,Math.abs(s)<Gg)break}else r=1!==this.n?Math.asin(this.n*Math.sin(r)):r;t=this.a*this.C_x*i*(this.m+Math.cos(r)),n=this.a*this.C_y*r}else{var l=Math.sin(r),A=Math.cos(r);n=this.a*yw(r,l,A,this.en),t=this.a*i*A/Math.sqrt(1-this.es*l*l)}return e.x=t,e.y=n,e},inverse:function(e){var t,n,i;return e.x-=this.x0,n=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,n/=this.C_x*(this.m+Math.cos(t)),this.m?t=tx((this.m*t+Math.sin(t))/this.n):1!==this.n&&(t=tx(Math.sin(t)/this.n)),n=my(n+this.long0),t=Vw(t)):(t=ww(e.y/this.a,this.es,this.en),(i=Math.abs(t))<Qg?(i=Math.sin(t),n=my(this.long0+e.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(t)))):i-Gg<Qg&&(n=this.long0)),e.x=n,e.y=t,e},names:["Sinusoidal","sinu"]};var cx={init:function(){},forward:function(e){for(var t=e.x,n=e.y,i=my(t-this.long0),r=n,a=Math.PI*Math.sin(n);;){var o=-(r+Math.sin(r)-a)/(1+Math.cos(r));if(r+=o,Math.abs(o)<Gg)break}r/=2,Math.PI/2-Math.abs(n)<Gg&&(i=0);var s=.900316316158*this.a*i*Math.cos(r)+this.x0,l=1.4142135623731*this.a*Math.sin(r)+this.y0;return e.x=s,e.y=l,e},inverse:function(e){var t,n;e.x-=this.x0,e.y-=this.y0,n=e.y/(1.4142135623731*this.a),Math.abs(n)>.999999999999&&(n=.999999999999),t=Math.asin(n);var i=my(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));i<-Math.PI&&(i=-Math.PI),i>Math.PI&&(i=Math.PI),n=(2*t+Math.sin(2*t))/Math.PI,Math.abs(n)>1&&(n=1);var r=Math.asin(n);return e.x=i,e.y=r,e},names:["Mollweide","moll"]};var hx={init:function(){Math.abs(this.lat1+this.lat2)<Gg||(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=Nw(this.es),this.e1=zw(this.es),this.e2=Qw(this.es),this.e3=Gw(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=fy(this.e,this.sinphi,this.cosphi),this.ml1=Ow(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<Gg?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=fy(this.e,this.sinphi,this.cosphi),this.ml2=Ow(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=Ow(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(e){var t,n=e.x,i=e.y;if(this.sphere)t=this.a*(this.g-i);else{var r=Ow(this.e0,this.e1,this.e2,this.e3,i);t=this.a*(this.g-r)}var a=this.ns*my(n-this.long0),o=this.x0+t*Math.sin(a),s=this.y0+this.rh-t*Math.cos(a);return e.x=o,e.y=s,e},inverse:function(e){var t,n,i,r;e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns>=0?(n=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(n=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var a=0;return 0!==n&&(a=Math.atan2(t*e.x,t*e.y)),this.sphere?(r=my(this.long0+a/this.ns),i=Vw(this.g-n/this.a),e.x=r,e.y=i,e):(i=jw(this.g-n/this.a,this.e0,this.e1,this.e2,this.e3),r=my(this.long0+a/this.ns),e.x=r,e.y=i,e)},names:["Equidistant_Conic","eqdc"]};var ux={init:function(){this.R=this.a},forward:function(e){var t,n,i=e.x,r=e.y,a=my(i-this.long0);Math.abs(r)<=Gg&&(t=this.x0+this.R*a,n=this.y0);var o=tx(2*Math.abs(r/Math.PI));(Math.abs(a)<=Gg||Math.abs(Math.abs(r)-Qg)<=Gg)&&(t=this.x0,n=r>=0?this.y0+Math.PI*this.R*Math.tan(.5*o):this.y0+Math.PI*this.R*-Math.tan(.5*o));var s=.5*Math.abs(Math.PI/a-a/Math.PI),l=s*s,A=Math.sin(o),c=Math.cos(o),h=c/(A+c-1),u=h*h,d=h*(2/A-1),f=d*d,p=Math.PI*this.R*(s*(h-f)+Math.sqrt(l*(h-f)*(h-f)-(f+l)*(u-f)))/(f+l);a<0&&(p=-p),t=this.x0+p;var m=l+h;return p=Math.PI*this.R*(d*m-s*Math.sqrt((f+l)*(l+1)-m*m))/(f+l),n=r>=0?this.y0+p:this.y0-p,e.x=t,e.y=n,e},inverse:function(e){var t,n,i,r,a,o,s,l,A,c,h,u;return e.x-=this.x0,e.y-=this.y0,h=Math.PI*this.R,a=(i=e.x/h)*i+(r=e.y/h)*r,h=3*(r*r/(l=-2*(o=-Math.abs(r)*(1+a))+1+2*r*r+a*a)+(2*(s=o-2*r*r+i*i)*s*s/l/l/l-9*o*s/l/l)/27)/(A=(o-s*s/3/l)/l)/(c=2*Math.sqrt(-A/3)),Math.abs(h)>1&&(h=h>=0?1:-1),u=Math.acos(h)/3,n=e.y>=0?(-c*Math.cos(u+Math.PI/3)-s/3/l)*Math.PI:-(-c*Math.cos(u+Math.PI/3)-s/3/l)*Math.PI,t=Math.abs(i)<Gg?this.long0:my(this.long0+Math.PI*(a-1+Math.sqrt(1+2*(i*i-r*r)+a*a))/2/i),e.x=t,e.y=n,e},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};var dx={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(e){var t,n,i,r,a,o,s,l,A,c,h,u,d,f,p,m,v,g,y,w,x,b,M=e.x,C=e.y,B=Math.sin(e.y),E=Math.cos(e.y),S=my(M-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=Gg?(e.x=this.x0+this.a*(Qg-C)*Math.sin(S),e.y=this.y0-this.a*(Qg-C)*Math.cos(S),e):Math.abs(this.sin_p12+1)<=Gg?(e.x=this.x0+this.a*(Qg+C)*Math.sin(S),e.y=this.y0+this.a*(Qg+C)*Math.cos(S),e):(g=this.sin_p12*B+this.cos_p12*E*Math.cos(S),v=(m=Math.acos(g))?m/Math.sin(m):1,e.x=this.x0+this.a*v*E*Math.sin(S),e.y=this.y0+this.a*v*(this.cos_p12*B-this.sin_p12*E*Math.cos(S)),e):(t=Nw(this.es),n=zw(this.es),i=Qw(this.es),r=Gw(this.es),Math.abs(this.sin_p12-1)<=Gg?(a=this.a*Ow(t,n,i,r,Qg),o=this.a*Ow(t,n,i,r,C),e.x=this.x0+(a-o)*Math.sin(S),e.y=this.y0-(a-o)*Math.cos(S),e):Math.abs(this.sin_p12+1)<=Gg?(a=this.a*Ow(t,n,i,r,Qg),o=this.a*Ow(t,n,i,r,C),e.x=this.x0+(a+o)*Math.sin(S),e.y=this.y0+(a+o)*Math.cos(S),e):(s=B/E,l=Hw(this.a,this.e,this.sin_p12),A=Hw(this.a,this.e,B),c=Math.atan((1-this.es)*s+this.es*l*this.sin_p12/(A*E)),y=0===(h=Math.atan2(Math.sin(S),this.cos_p12*Math.tan(c)-this.sin_p12*Math.cos(S)))?Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.abs(Math.abs(h)-Math.PI)<=Gg?-Math.asin(this.cos_p12*Math.sin(c)-this.sin_p12*Math.cos(c)):Math.asin(Math.sin(S)*Math.cos(c)/Math.sin(h)),u=this.e*this.sin_p12/Math.sqrt(1-this.es),m=l*y*(1-(w=y*y)*(p=(d=this.e*this.cos_p12*Math.cos(h)/Math.sqrt(1-this.es))*d)*(1-p)/6+(x=w*y)/8*(f=u*d)*(1-2*p)+(b=x*y)/120*(p*(4-7*p)-3*u*u*(1-7*p))-b*y/48*f),e.x=this.x0+m*Math.sin(h),e.y=this.y0+m*Math.cos(h),e))},inverse:function(e){var t,n,i,r,a,o,s,l,A,c,h,u,d,f,p,m,v,g,y,w,x,b,M;if(e.x-=this.x0,e.y-=this.y0,this.sphere){if((t=Math.sqrt(e.x*e.x+e.y*e.y))>2*Qg*this.a)return;return n=t/this.a,i=Math.sin(n),r=Math.cos(n),a=this.long0,Math.abs(t)<=Gg?o=this.lat0:(o=tx(r*this.sin_p12+e.y*i*this.cos_p12/t),s=Math.abs(this.lat0)-Qg,a=Math.abs(s)<=Gg?this.lat0>=0?my(this.long0+Math.atan2(e.x,-e.y)):my(this.long0-Math.atan2(-e.x,e.y)):my(this.long0+Math.atan2(e.x*i,t*this.cos_p12*r-e.y*this.sin_p12*i))),e.x=a,e.y=o,e}return l=Nw(this.es),A=zw(this.es),c=Qw(this.es),h=Gw(this.es),Math.abs(this.sin_p12-1)<=Gg?(o=jw(((u=this.a*Ow(l,A,c,h,Qg))-(t=Math.sqrt(e.x*e.x+e.y*e.y)))/this.a,l,A,c,h),a=my(this.long0+Math.atan2(e.x,-1*e.y)),e.x=a,e.y=o,e):Math.abs(this.sin_p12+1)<=Gg?(u=this.a*Ow(l,A,c,h,Qg),o=jw(((t=Math.sqrt(e.x*e.x+e.y*e.y))-u)/this.a,l,A,c,h),a=my(this.long0+Math.atan2(e.x,e.y)),e.x=a,e.y=o,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),p=Math.atan2(e.x,e.y),d=Hw(this.a,this.e,this.sin_p12),m=Math.cos(p),g=-(v=this.e*this.cos_p12*m)*v/(1-this.es),y=3*this.es*(1-g)*this.sin_p12*this.cos_p12*m/(1-this.es),b=1-g*(x=(w=t/d)-g*(1+g)*Math.pow(w,3)/6-y*(1+3*g)*Math.pow(w,4)/24)*x/2-w*x*x*x/6,f=Math.asin(this.sin_p12*Math.cos(x)+this.cos_p12*Math.sin(x)*m),a=my(this.long0+Math.asin(Math.sin(p)*Math.sin(x)/Math.cos(f))),M=Math.sin(f),o=Math.atan2((M-this.es*b*this.sin_p12)*Math.tan(f),M*(1-this.es)),e.x=a,e.y=o,e)},names:["Azimuthal_Equidistant","aeqd"]};var fx={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(e){var t,n,i,r,a,o,s,l=e.x,A=e.y;return i=my(l-this.long0),t=Math.sin(A),n=Math.cos(A),r=Math.cos(i),1,((a=this.sin_p14*t+this.cos_p14*n*r)>0||Math.abs(a)<=Gg)&&(o=1*this.a*n*Math.sin(i),s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*n*r)),e.x=o,e.y=s,e},inverse:function(e){var t,n,i,r,a,o,s;return e.x-=this.x0,e.y-=this.y0,n=tx((t=Math.sqrt(e.x*e.x+e.y*e.y))/this.a),i=Math.sin(n),r=Math.cos(n),o=this.long0,Math.abs(t)<=Gg?(s=this.lat0,e.x=o,e.y=s,e):(s=tx(r*this.sin_p14+e.y*i*this.cos_p14/t),a=Math.abs(this.lat0)-Qg,Math.abs(a)<=Gg?(o=this.lat0>=0?my(this.long0+Math.atan2(e.x,-e.y)):my(this.long0-Math.atan2(-e.x,e.y)),e.x=o,e.y=s,e):(o=my(this.long0+Math.atan2(e.x*i,t*this.cos_p14*r-e.y*this.sin_p14*i)),e.x=o,e.y=s,e))},names:["ortho"]},px=1,mx=2,vx=3,gx=4,yx=5,wx=6,xx=1,bx=2,Mx=3,Cx=4;function Bx(e,t,n,i){var r;return e<Gg?(i.value=xx,r=0):(r=Math.atan2(t,n),Math.abs(r)<=jg?i.value=xx:r>jg&&r<=Qg+jg?(i.value=bx,r-=Qg):r>Qg+jg||r<=-(Qg+jg)?(i.value=Mx,r=r>=0?r-Xg:r+Xg):(i.value=Cx,r+=Qg)),r}function Ex(e,t){var n=e+t;return n<-Xg?n+=Wg:n>+Xg&&(n-=Wg),n}var Sx={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>=Qg-jg/2?this.face=yx:this.lat0<=-(Qg-jg/2)?this.face=wx:Math.abs(this.long0)<=jg?this.face=px:Math.abs(this.long0)<=Qg+jg?this.face=this.long0>0?mx:gx:this.face=vx,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(e){var t,n,i,r,a,o,s={x:0,y:0},l={value:0};if(e.x-=this.long0,t=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(e.y)):e.y,n=e.x,this.face===yx)r=Qg-t,n>=jg&&n<=Qg+jg?(l.value=xx,i=n-Qg):n>Qg+jg||n<=-(Qg+jg)?(l.value=bx,i=n>0?n-Xg:n+Xg):n>-(Qg+jg)&&n<=-jg?(l.value=Mx,i=n+Qg):(l.value=Cx,i=n);else if(this.face===wx)r=Qg+t,n>=jg&&n<=Qg+jg?(l.value=xx,i=-n+Qg):n<jg&&n>=-jg?(l.value=bx,i=-n):n<-jg&&n>=-(Qg+jg)?(l.value=Mx,i=-n-Qg):(l.value=Cx,i=n>0?-n+Xg:-n-Xg);else{var A,c,h,u,d,f;this.face===mx?n=Ex(n,+Qg):this.face===vx?n=Ex(n,+Xg):this.face===gx&&(n=Ex(n,-Qg)),u=Math.sin(t),d=Math.cos(t),f=Math.sin(n),A=d*Math.cos(n),c=d*f,h=u,this.face===px?i=Bx(r=Math.acos(A),h,c,l):this.face===mx?i=Bx(r=Math.acos(c),h,-A,l):this.face===vx?i=Bx(r=Math.acos(-A),h,-c,l):this.face===gx?i=Bx(r=Math.acos(-c),h,A,l):(r=i=0,l.value=xx)}return o=Math.atan(12/Xg*(i+Math.acos(Math.sin(i)*Math.cos(jg))-Qg)),a=Math.sqrt((1-Math.cos(r))/(Math.cos(o)*Math.cos(o))/(1-Math.cos(Math.atan(1/Math.cos(i))))),l.value===bx?o+=Qg:l.value===Mx?o+=Xg:l.value===Cx&&(o+=1.5*Xg),s.x=a*Math.cos(o),s.y=a*Math.sin(o),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,e.x=s.x,e.y=s.y,e},inverse:function(e){var t,n,i,r,a,o,s,l,A,c,h,u,d={lam:0,phi:0},f={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,n=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),t=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?f.value=xx:e.y>=0&&e.y>=Math.abs(e.x)?(f.value=bx,t-=Qg):e.x<0&&-e.x>=Math.abs(e.y)?(f.value=Mx,t=t<0?t+Xg:t-Xg):(f.value=Cx,t+=Qg),A=Xg/12*Math.tan(t),a=Math.sin(A)/(Math.cos(A)-1/Math.sqrt(2)),o=Math.atan(a),(s=1-(i=Math.cos(t))*i*(r=Math.tan(n))*r*(1-Math.cos(Math.atan(1/Math.cos(o)))))<-1?s=-1:s>1&&(s=1),this.face===yx)l=Math.acos(s),d.phi=Qg-l,f.value===xx?d.lam=o+Qg:f.value===bx?d.lam=o<0?o+Xg:o-Xg:f.value===Mx?d.lam=o-Qg:d.lam=o;else if(this.face===wx)l=Math.acos(s),d.phi=l-Qg,f.value===xx?d.lam=-o+Qg:f.value===bx?d.lam=-o:f.value===Mx?d.lam=-o-Qg:d.lam=o<0?-o-Xg:-o+Xg;else{var p,m,v;A=(p=s)*p,m=(A+=(v=A>=1?0:Math.sqrt(1-A)*Math.sin(o))*v)>=1?0:Math.sqrt(1-A),f.value===bx?(A=m,m=-v,v=A):f.value===Mx?(m=-m,v=-v):f.value===Cx&&(A=m,m=v,v=-A),this.face===mx?(A=p,p=-m,m=A):this.face===vx?(p=-p,m=-m):this.face===gx&&(A=p,p=m,m=-A),d.phi=Math.acos(-v)-Qg,d.lam=Math.atan2(m,p),this.face===mx?d.lam=Ex(d.lam,-Qg):this.face===vx?d.lam=Ex(d.lam,-Xg):this.face===gx&&(d.lam=Ex(d.lam,+Qg))}return 0!==this.es&&(c=d.phi<0?1:0,h=Math.tan(d.phi),u=this.b/Math.sqrt(h*h+this.one_minus_f_squared),d.phi=Math.atan(Math.sqrt(this.a*this.a-u*u)/(this.one_minus_f*u)),c&&(d.phi=-d.phi)),d.lam+=this.long0,e.x=d.lam,e.y=d.phi,e},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},Tx=[[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]],_x=[[-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]],Ix=.8487,Lx=1.3523,Fx=Vg/5,kx=18,Px=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))};var Ux={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(e){var t=my(e.x-this.long0),n=Math.abs(e.y),i=Math.floor(n*Fx);i<0?i=0:i>=kx&&(i=17);var r={x:Px(Tx[i],n=Vg*(n-.08726646259971647*i))*t,y:Px(_x[i],n)};return e.y<0&&(r.y=-r.y),r.x=r.x*this.a*Ix+this.x0,r.y=r.y*this.a*Lx+this.y0,r},inverse:function(e){var t={x:(e.x-this.x0)/(this.a*Ix),y:Math.abs(e.y-this.y0)/(this.a*Lx)};if(t.y>=1)t.x/=Tx[18][0],t.y=e.y<0?-Qg:Qg;else{var n=Math.floor(t.y*kx);for(n<0?n=0:n>=kx&&(n=17);;)if(_x[n][0]>t.y)--n;else{if(!(_x[n+1][0]<=t.y))break;++n}var i=_x[n],r=5*(t.y-i[0])/(_x[n+1][0]-i[0]);r=function(e,t,n,i){for(var r=t;i;--i){var a=e(r);if(r-=a,Math.abs(a)<n)break}return r}((function(e){return(Px(i,e)-t.y)/function(e,t){return e[1]+t*(2*e[2]+3*t*e[3])}(i,e)}),r,Gg,100),t.x/=Px(Tx[n],r),t.y=(5*n+r)*Hg,e.y<0&&(t.y=-t.y)}return t.x=my(t.x+this.long0),t},names:["Robinson","robin"]};var Dx={init:function(){this.name="geocent"},forward:function(e){return Dy(e,this.es,this.a)},inverse:function(e){return Ry(e,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]},Rx=0,Ox=1,Nx=2,zx=3,Qx={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};var Gx={init:function(){if(Object.keys(Qx).forEach(function(e){if(void 0===this[e])this[e]=Qx[e].def;else{if(Qx[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);Qx[e].num&&(this[e]=parseFloat(this[e]))}Qx[e].degrees&&(this[e]=this[e]*Hg)}.bind(this)),Math.abs(Math.abs(this.lat0)-Qg)<Gg?this.mode=this.lat0<0?Ox:Rx:Math.abs(this.lat0)<Gg?this.mode=Nx:(this.mode=zx,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)},forward:function(e){e.x-=this.long0;var t,n,i,r,a=Math.sin(e.y),o=Math.cos(e.y),s=Math.cos(e.x);switch(this.mode){case zx:n=this.sinph0*a+this.cosph0*o*s;break;case Nx:n=o*s;break;case Ox:n=-a;break;case Rx:n=a}switch(t=(n=this.pn1/(this.p-n))*o*Math.sin(e.x),this.mode){case zx:n*=this.cosph0*a-this.sinph0*o*s;break;case Nx:n*=a;break;case Rx:n*=-o*s;break;case Ox:n*=o*s}return r=1/((i=n*this.cg+t*this.sg)*this.sw*this.h1+this.cw),t=(t*this.cg-n*this.sg)*this.cw*r,n=i*r,e.x=t*this.a,e.y=n*this.a,e},inverse:function(e){e.x/=this.a,e.y/=this.a;var t,n,i,r={x:e.x,y:e.y};i=1/(this.pn1-e.y*this.sw),t=this.pn1*e.x*i,n=this.pn1*e.y*this.cw*i,e.x=t*this.cg+n*this.sg,e.y=n*this.cg-t*this.sg;var a=Mw(e.x,e.y);if(Math.abs(a)<Gg)r.x=0,r.y=e.y;else{var o,s;switch(s=1-a*a*this.pfact,s=(this.p-Math.sqrt(s))/(this.pn1/a+a/this.pn1),o=Math.sqrt(1-s*s),this.mode){case zx:r.y=Math.asin(o*this.sinph0+e.y*s*this.cosph0/a),e.y=(o-this.sinph0*Math.sin(r.y))*a,e.x*=s*this.cosph0;break;case Nx:r.y=Math.asin(e.y*s/a),e.y=o*a,e.x*=s;break;case Rx:r.y=Math.asin(o),e.y=-e.y;break;case Ox:r.y=-Math.asin(o)}r.x=Math.atan2(e.x,e.y)}return e.x=r.x+this.long0,e.y=r.y,e},names:["Tilted_Perspective","tpers"]};var Hx={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(e){var t,n,i,r,a=e.x,o=e.y;if(a-=this.long0,"ellipse"===this.shape){o=Math.atan(this.radius_p2*Math.tan(o));var s=this.radius_p/Mw(this.radius_p*Math.cos(o),Math.sin(o));if(n=s*Math.cos(a)*Math.cos(o),i=s*Math.sin(a)*Math.cos(o),r=s*Math.sin(o),(this.radius_g-n)*n-i*i-r*r*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;t=this.radius_g-n,this.flip_axis?(e.x=this.radius_g_1*Math.atan(i/Mw(r,t)),e.y=this.radius_g_1*Math.atan(r/t)):(e.x=this.radius_g_1*Math.atan(i/t),e.y=this.radius_g_1*Math.atan(r/Mw(i,t)))}else"sphere"===this.shape&&(t=Math.cos(o),n=Math.cos(a)*t,i=Math.sin(a)*t,r=Math.sin(o),t=this.radius_g-n,this.flip_axis?(e.x=this.radius_g_1*Math.atan(i/Mw(r,t)),e.y=this.radius_g_1*Math.atan(r/t)):(e.x=this.radius_g_1*Math.atan(i/t),e.y=this.radius_g_1*Math.atan(r/Mw(i,t))));return e.x=e.x*this.a,e.y=e.y*this.a,e},inverse:function(e){var t,n,i,r,a=-1,o=0,s=0;if(e.x=e.x/this.a,e.y=e.y/this.a,"ellipse"===this.shape){this.flip_axis?(s=Math.tan(e.y/this.radius_g_1),o=Math.tan(e.x/this.radius_g_1)*Mw(1,s)):(o=Math.tan(e.x/this.radius_g_1),s=Math.tan(e.y/this.radius_g_1)*Mw(1,o));var l=s/this.radius_p;if(t=o*o+l*l+a*a,(i=(n=2*this.radius_g*a)*n-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;r=(-n-Math.sqrt(i))/(2*t),a=this.radius_g+r*a,o*=r,s*=r,e.x=Math.atan2(o,a),e.y=Math.atan(s*Math.cos(e.x)/a),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if("sphere"===this.shape){if(this.flip_axis?(s=Math.tan(e.y/this.radius_g_1),o=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+s*s)):(o=Math.tan(e.x/this.radius_g_1),s=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+o*o)),t=o*o+s*s+a*a,(i=(n=2*this.radius_g*a)*n-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;r=(-n-Math.sqrt(i))/(2*t),a=this.radius_g+r*a,o*=r,s*=r,e.x=Math.atan2(o,a),e.y=Math.atan(s*Math.cos(e.x)/a)}return e.x=e.x+this.long0,e},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]};function Vx(e){return e.startsWith("TMS")}function jx(e){return e.startsWith("EPSG")}function Wx(e){return jx(e)?e:"EPSG:".concat(e.match(/\d+/)[0])}Zy.defaultDatum="WGS84",Zy.Proj=Uy,Zy.WGS84=new Zy.Proj("WGS84"),Zy.Point=fw,Zy.toPoint=Vy,Zy.defs=Ay,Zy.nadgrid=function(e,t){var n=new DataView(t),i=function(e){var t=e.getInt32(8,!1);if(11===t)return!1;11!==(t=e.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian");return!0}(n),r=function(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:Ly(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}(n,i);r.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var a=function(e,t,n){for(var i=176,r=[],a=0;a<t.nSubgrids;a++){var o=ky(e,i,n),s=Py(e,i,o,n),l=Math.round(1+(o.upperLongitude-o.lowerLongitude)/o.longitudeInterval),A=Math.round(1+(o.upperLatitude-o.lowerLatitude)/o.latitudeInterval);r.push({ll:[Iy(o.lowerLongitude),Iy(o.lowerLatitude)],del:[Iy(o.longitudeInterval),Iy(o.latitudeInterval)],lim:[l,A],count:o.gridNodeCount,cvs:Fy(s)})}return r}(n,r,i),o={header:r,subgrids:a};return Ty[e]=o,o},Zy.transform=Wy,Zy.mgrs=rw,Zy.version="__VERSION__",function(e){e.Proj.projections.add(xw),e.Proj.projections.add(Sw),e.Proj.projections.add(Tw),e.Proj.projections.add(Lw),e.Proj.projections.add(Fw),e.Proj.projections.add(kw),e.Proj.projections.add(Uw),e.Proj.projections.add(Dw),e.Proj.projections.add(Rw),e.Proj.projections.add(Ww),e.Proj.projections.add(ex),e.Proj.projections.add(nx),e.Proj.projections.add(ix),e.Proj.projections.add(rx),e.Proj.projections.add(ax),e.Proj.projections.add(ox),e.Proj.projections.add(sx),e.Proj.projections.add(lx),e.Proj.projections.add(Ax),e.Proj.projections.add(cx),e.Proj.projections.add(hx),e.Proj.projections.add(ux),e.Proj.projections.add(dx),e.Proj.projections.add(fx),e.Proj.projections.add(Sx),e.Proj.projections.add(Ux),e.Proj.projections.add(Dx),e.Proj.projections.add(Gx),e.Proj.projections.add(Hx)}(Zy),Zy.defs("EPSG:4978","+proj=geocent +datum=WGS84 +units=m +no_defs");var Xx={DEGREE:1,METER:2};function Yx(e){return"EPSG:4326"===e}function Kx(e){switch(e){case"EPSG:4326":return Xx.DEGREE;case"EPSG:4978":return Xx.METER;default:var t=Zy.defs(Wx(e));if(!t)return;return"degrees"===(n=t.units)?Xx.DEGREE:"m"===n?Xx.METER:void 0}var n}function Zx(e){var t=Kx(e);if(void 0===e||void 0===t)throw new Error("Invalid crs parameter value '".concat(e,"'"));return t}var Jx={UNIT:Xx,isValid:function(e){Zx(e)},isGeographic:function(e){return Zx(e)==Xx.DEGREE},isMetricUnit:function(e){return Kx(e)==Xx.METER},toUnit:Kx,is4326:Yx,reasonnableEpsilon:function(e){return Yx(e)?.01:.001},formatToEPSG:Wx,formatToTms:function(e){return Vx(e)?e:"TMS:".concat(e.match(/\d+/)[0])},isTms:Vx,isEpsg:jx,tms_3857:"TMS:3857",tms_4326:"TMS:4326",defs:function(e,t){return Zy.defs(e,t)}},qx=new at(Zy.WGS84.a,Zy.WGS84.a,Zy.WGS84.b),$x=new at,eb=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:qx;s(this,e),this.size=new at,this._radiiSquared=new at,this._invRadiiSquared=new at,this.setSize(t)}return A(e,[{key:"geodeticSurfaceNormal",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new at;return e.toVector3(t).multiply(this._invRadiiSquared).normalize()}},{key:"geodeticSurfaceNormalCartographic",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new at,n=Hh.degToRad(e.longitude),i=Hh.degToRad(e.latitude),r=Math.cos(i);return t.set(r*Math.cos(n),r*Math.sin(n),Math.sin(i))}},{key:"setSize",value:function(e){this.size.set(e.x,e.y,e.z),this._radiiSquared.multiplyVectors(e,e),this._invRadiiSquared.x=0==e.x?0:1/this._radiiSquared.x,this._invRadiiSquared.y=0==e.y?0:1/this._radiiSquared.y,this._invRadiiSquared.z=0==e.z?0:1/this._radiiSquared.z}},{key:"cartographicToCartesian",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new at;$x.copy(e.geodesicNormal),t.multiplyVectors(this._radiiSquared,$x);var n=Math.sqrt($x.dot(t));return t.divideScalar(n),$x.multiplyScalar(e.altitude),t.add($x)}},{key:"cartesianToCartographic",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ob("EPSG:4326",0,0,0),n=Math.sqrt(e.x*e.x+e.y*e.y+e.z*e.z),i=this.size.x,r=this.size.z,a=Math.abs((i*i-r*r)/(i*i)),o=1-Math.sqrt(1-a),s=Math.sqrt(e.x*e.x+e.y*e.y),l=Math.atan2(e.y,e.x),A=Math.atan(e.z/s*(1-o+a*i/n)),c=Math.sin(A),h=Math.cos(A),u=Math.atan((e.z*(1-o)+a*i*c*c*c)/((1-o)*(s-a*i*h*h*h))),d=s*Math.cos(u)+e.z*Math.sin(u)-i*Math.sqrt(1-a*Math.sin(u)*Math.sin(u));return t.setFromValues(Hh.radToDeg(l),Hh.radToDeg(u),d)}},{key:"cartographicToCartesianArray",value:function(e){for(var t=[],n=0;n<e.length;n++)t.push(this.cartographicToCartesian(e[n]));return t}},{key:"intersection",value:function(e){var t=1e-4,n=e.origin,i=e.direction,r=i.x*i.x*this._invRadiiSquared.x+i.y*i.y*this._invRadiiSquared.y+i.z*i.z*this._invRadiiSquared.z,a=2*n.x*i.x*this._invRadiiSquared.x+2*n.y*i.y*this._invRadiiSquared.y+2*n.z*i.z*this._invRadiiSquared.z,o=n.x*n.x*this._invRadiiSquared.x+n.y*n.y*this._invRadiiSquared.y+n.z*n.z*this._invRadiiSquared.z-1,s=a*a-4*r*o;if(s<0||0===r||0===a||0===o)return!1;var l=(-a+(s=Math.sqrt(s)))/(2*r),A=(-a-s)/(2*r);if(l<=t&&A<=t)return!1;var c=0;if((c=l<=t?A:A<=t||l<A?l:A)<t)return!1;var h=new at;return h.addVectors(e.origin,i.clone().setLength(c)),h}},{key:"computeDistance",value:function(e,t){var n=Hh.degToRad(e.longitude),i=Hh.degToRad(e.latitude),r=Hh.degToRad(t.longitude),a=Hh.degToRad(t.latitude),o=Math.acos(Math.sin(i)*Math.sin(a)+Math.cos(i)*Math.cos(a)*Math.cos(r-n)),s=this.size.x,l=this.size.z,A=Math.sqrt((s*s-l*l)/(s*s)),c=(i+a)/2,h=s*(1-A*A)/Math.sqrt(1-A*A*Math.sin(c)*Math.sin(c)),u=s/Math.sqrt(1-A*A*Math.sin(c)*Math.sin(c));return o*Math.sqrt(h*u)}}]),e}();Zy.defs("EPSG:4978","+proj=geocent +datum=WGS84 +units=m +no_defs");var tb=new eb,nb={};function ib(e,t){return nb[e]||(nb[e]={}),nb[e][t]||(nb[e][t]=Zy(e,t)),nb[e][t]}var rb,ab,ob=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;s(this,e),this.isCoordinates=!0,Jx.isValid(t),this.crs=t,this.x=0,this.y=0,this.z=0,this._normal=new at,n.length>0?this.setFromArray(n):n.isVector3||n.isCoordinates?this.setFromVector3(n):this.setFromValues(n,i,r),this._normalNeedsUpdate=!0}return A(e,[{key:"setFromValues",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.x=null==e?0:e,this.y=null==t?0:t,this.z=null==n?0:n,this._normalNeedsUpdate=!0,this}},{key:"setFromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.setFromValues(e[t],e[t+1],e[t+2])}},{key:"setFromVector3",value:function(e){return this.setFromValues(e.x,e.y,e.z)}},{key:"clone",value:function(){return new e(this.crs,this)}},{key:"copy",value:function(e){return this.crs=e.crs,this.setFromVector3(e)}},{key:"longitude",get:function(){return this.x}},{key:"latitude",get:function(){return this.y}},{key:"altitude",get:function(){return this.z},set:function(e){this.z=e}},{key:"geodesicNormal",get:function(){return this._normalNeedsUpdate&&(this._normalNeedsUpdate=!1,Jx.is4326(this.crs)?tb.geodeticSurfaceNormalCartographic(this,this._normal):"EPSG:4978"==this.crs?tb.geodeticSurfaceNormal(this,this._normal):this._normal.set(0,0,1)),this._normal}},{key:"toVector3",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new at;return e.copy(this)}},{key:"applyMatrix4",value:function(e){return at.prototype.applyMatrix4.call(this,e)}},{key:"as",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new e(t);return this.crs==t?n.copy(this):(Jx.is4326(this.crs)&&"EPSG:3857"==t&&(this.y=Hh.clamp(this.y,-89.999999,89.999999)),n.setFromArray(ib(this.crs,t).forward([this.x,this.y,this.z]))),n.crs=t,n}}]),e}(),sb=new tt,lb=new tt,Ab=new tt,cb=new tt,hb=new tt,ub=new tt(2,2),db={row:0,col:0,invDiff:0};function fb(e,t){var n=e.zoom-t,i=Math.pow(2,n);return db.invDiff=1/i,db.row=(e.row-e.row%i)*db.invDiff,db.col=(e.col-e.col%i)*db.invDiff,db}for(var pb=new Array(8),mb=pb.length-1;mb>=0;mb--)pb[mb]=new ob("EPSG:4326",0,0,0,0);var vb=new ob("EPSG:4326",0,0),gb=new Map,yb=new Map;function wb(e){var t=Jx.formatToEPSG(e),n=gb.get(t),i=n.dimensions(lb),r=Jx.formatToTms(e);return{epsg:t,globalExtent:n,globalDimension:i,sTs:yb.get(r)||yb.get("default"),isInverted:!r.includes(":NI")}}function xb(e,t){var n=yb.get(Jx.formatToTms(e))||yb.get("default"),i=Math.pow(2,t);return Ab.set(i,i).multiply(n),Ab}var bb=function(){function e(t,n,i,r,a){s(this,e),this.isExtent=!0,this.crs=t,this.zoom=0,Jx.isTms(this.crs)?(this.row=0,this.col=0):(this.west=0,this.east=0,this.south=0,this.north=0),this.set(n,i,r,a)}return A(e,[{key:"clone",value:function(){return Jx.isTms(this.crs)?new e(this.crs,this.zoom,this.row,this.col):new e(this.crs,this.west,this.east,this.south,this.north)}},{key:"tiledCovering",value:function(t){if("EPSG:4326"==this.crs&&t==Jx.tms_3857){var n=[],i=rb.copy(this).as(Jx.formatToEPSG(t),ab),r=wb(Jx.formatToEPSG(t)),a=r.globalExtent,o=r.globalDimension,s=r.sTs;i.clampByExtent(a),i.dimensions(hb);var l=this.zoom+1||Math.floor(Math.log2(Math.round(o.x/(hb.x*s.x)))),A=xb(t,l),c=i.center(vb);cb.x=c.x-a.west,cb.y=a.north-i.north,cb.divide(o).multiply(A).floor();for(var h=Math.ceil((a.north-i.south)/o.x*A.y)-1;h>=cb.y;h--)n.push(new e(t,l,h,cb.x));return n}var u=new e(t,0,0,0),d=wb(this.crs),f=d.globalExtent,p=d.globalDimension,m=d.sTs,v=d.isInverted,g=this.center(vb);this.dimensions(hb);var y=Math.floor(Math.log2(Math.round(p.x/(hb.x*m.x)))),w=xb(t,y);return cb.x=g.x-f.west,cb.y=v?f.north-g.y:g.y-f.south,cb.divide(p).multiply(w).floor(),u.set(y,cb.y,cb.x),[u]}},{key:"as",value:function(t,n){if(Jx.isValid(t),n=n||new e("EPSG:4326",[0,0,0,0]),Jx.isTms(this.crs)){var i=wb(this.crs),r=i.epsg,a=i.globalExtent,o=i.globalDimension,s=xb(this.crs,this.zoom);return hb.set(1,1).divide(s).multiply(o),n.west=a.west+(o.x-hb.x*(s.x-this.col)),n.east=n.west+hb.x,n.south=a.south+hb.y*(s.y-this.row-1),n.north=n.south+hb.y,n.crs=r,n.zoom=this.zoom,t==r?n:n.as(t,n)}if(Jx.isEpsg(t)){if(this.crs!=t){var l=this.center(vb);pb[0].setFromValues(this.west,this.north),pb[1].setFromValues(l.x,this.north),pb[2].setFromValues(this.east,this.north),pb[3].setFromValues(this.east,l.y),pb[4].setFromValues(this.east,this.south),pb[5].setFromValues(l.x,this.south),pb[6].setFromValues(this.west,this.south),pb[7].setFromValues(this.west,l.y),n.set(1/0,-1/0,1/0,-1/0);for(var A=0;A<pb.length;A++)pb[A].crs=this.crs,pb[A].as(t,vb),n.north=Math.max(n.north,vb.y),n.south=Math.min(n.south,vb.y),n.east=Math.max(n.east,vb.x),n.west=Math.min(n.west,vb.x);return n.zoom=this.zoom,n.crs=t,n}return n.crs=t,n.zoom=this.zoom,n.set(this.west,this.east,this.south,this.north),n}}},{key:"center",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ob(this.crs);if(Jx.isTms(this.crs))throw new Error("Invalid operation for WMTS bbox");return this.dimensions(sb),e.crs=this.crs,e.setFromValues(this.west+.5*sb.x,this.south+.5*sb.y),e}},{key:"dimensions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new tt;return e.x=Math.abs(this.east-this.west),e.y=Math.abs(this.north-this.south),e}},{key:"isPointInside",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.crs==e.crs?vb.copy(e):e.as(this.crs,vb),vb.x<=this.east+t&&vb.x>=this.west-t&&vb.y<=this.north+t&&vb.y>=this.south-t}},{key:"isInside",value:function(e,t){return Jx.isTms(this.crs)?this.zoom==e.zoom?this.row==e.row&&this.col==e.col:!(this.zoom<e.zoom)&&(fb(this,e.zoom),db.row==e.row&&db.col==e.col):(e.as(this.crs,rb),t=null==t?Jx.reasonnableEpsilon(this.crs):t,this.east-rb.east<=t&&rb.west-this.west<=t&&this.north-rb.north<=t&&rb.south-this.south<=t)}},{key:"offsetToParent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ut;if(this.crs!=e.crs)throw new Error("unsupported mix");if(Jx.isTms(this.crs))return fb(this,e.zoom),t.set(this.col*db.invDiff-db.col,this.row*db.invDiff-db.row,db.invDiff,db.invDiff);e.dimensions(sb),this.dimensions(lb);var n=(this.west-e.west)/sb.x,i=(e.north-this.north)/sb.y,r=lb.x/sb.x,a=lb.y/sb.y;return t.set(n,i,r,a)}},{key:"tiledExtentParent",value:function(t){return t&&t<this.zoom?(fb(this,t),new e(this.crs,t,db.row,db.col)):this}},{key:"intersectsExtent",value:function(e){var t=e.crs==this.crs?e:e.as(this.crs,rb);return!(this.west>=t.east||this.east<=t.west||this.south>=t.north||this.north<=t.south)}},{key:"intersect",value:function(t){return this.intersectsExtent(t)?(t.crs!=this.crs&&(t=t.as(this.crs,rb)),new e(this.crs,Math.max(this.west,t.west),Math.min(this.east,t.east),Math.max(this.south,t.south),Math.min(this.north,t.north))):new e(this.crs,0,0,0,0)}},{key:"set",value:function(e,t,n,i){if(null==e)throw new Error("No values to set in the extent");return e.isExtent&&(Jx.isTms(e.crs)?(t=e.row,n=e.col,e=e.zoom):(t=e.east,n=e.south,i=e.north,e=e.west)),Jx.isTms(this.crs)?(this.zoom=e,this.row=t,this.col=n):e.isCoordinates?(this.west=e.x,this.east=t.x,this.south=e.y,this.north=t.y):void 0!==e.west?(this.west=e.west,this.east=e.east,this.south=e.south,this.north=e.north):4==e.length?(this.west=e[0],this.east=e[1],this.south=e[2],this.north=e[3]):void 0!==i&&(this.west=e,this.east=t,this.south=n,this.north=i),this}},{key:"copy",value:function(e){return this.crs=e.crs,this.set(e)}},{key:"union",value:function(e){if(e.crs!=this.crs)throw new Error("unsupported union between 2 diff crs");if(this.west===1/0)this.copy(e);else{var t=e.west;t<this.west&&(this.west=t);var n=e.east;n>this.east&&(this.east=n);var i=e.south;i<this.south&&(this.south=i);var r=e.north;r>this.north&&(this.north=r)}}},{key:"expandByCoordinates",value:function(e){var t=e.crs==this.crs?e:e.as(this.crs,vb);this.expandByValuesCoordinates(t.x,t.y)}},{key:"expandByValuesCoordinates",value:function(e,t){e<this.west&&(this.west=e),e>this.east&&(this.east=e),t<this.south&&(this.south=t),t>this.north&&(this.north=t)}},{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Jx.isTms(this.crs)?"".concat(this.zoom).concat(e).concat(this.row).concat(e).concat(this.col):"".concat(this.east).concat(e).concat(this.north).concat(e).concat(this.west).concat(e).concat(this.south)}},{key:"subdivision",value:function(){return this.subdivisionByScheme()}},{key:"subdivisionByScheme",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ub,n=[],i=this.dimensions(sb).divide(t),r=t.x-1;r>=0;r--)for(var a=t.y-1;a>=0;a--){var o=this.west+r*i.x,s=this.south+a*i.y;n.push(new e(this.crs,o,o+i.x,s,s+i.y))}return n}},{key:"transformedCopy",value:function(e,t,n){if(!Jx.isTms(n.crs)){if(this.crs=n.crs,this.zoom=n.zoom,this.west=(n.west+e.x)*t.x,this.east=(n.east+e.x)*t.x,this.west>this.east){var i=this.west;this.west=this.east,this.east=i}if(this.south=(n.south+e.y)*t.y,this.north=(n.north+e.y)*t.y,this.south>this.north){var r=this.south;this.south=this.north,this.north=r}}}},{key:"clampSouthNorth",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.south,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.north;return this.south=Math.max(this.south,e),this.north=Math.min(this.north,t),this}},{key:"clampWestEast",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.west,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.east;return this.west=Math.max(this.west,e),this.east=Math.min(this.east,t),this}},{key:"clampByExtent",value:function(e){return this.clampSouthNorth(e.south,e.north),this.clampWestEast(e.west,e.east)}}],[{key:"fromBox3",value:function(t,n){return new e(t,{west:n.min.x,east:n.max.x,south:n.min.y,north:n.max.y})}}]),e}();rb=new bb("EPSG:4326",[0,0,0,0]),ab=new bb("EPSG:4326",[0,0,0,0]),gb.set("EPSG:4326",new bb("EPSG:4326",-180,180,-90,90));var Mb=gb.get("EPSG:4326").as("EPSG:3857");Mb.clampSouthNorth(Mb.west,Mb.east),gb.set("EPSG:3857",Mb),yb.set("default",new tt(1,1)),yb.set(Jx.tms_3857,yb.get("default")),yb.set(Jx.tms_4326,new tt(2,1));var Cb={v:new at,coord1:new ob("EPSG:4978"),coord2:new ob("EPSG:4978"),offset:new tt};function Bb(e,t,n,i,r,a){var o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},s=arguments.length>7?arguments[7]:void 0,l=arguments.length>8?arguments[8]:void 0,A=s||new ob(i);o.worldFromLocal?A.setFromVector3(Cb.v.copy(r).applyMatrix4(o.worldFromLocal)):A.setFromVector3(r);var c=Sb.getTerrainObjectAt(e,A,t,n,l);if(c)return c.coord.z+=a,c.coord.as(i,Cb.coord2).toVector3(r),o.localFromWorld&&r.applyMatrix4(o.localFromWorld),{id:c.texture.id,version:c.texture.version,tile:c.tile}}var Eb,Sb={getElevationValueAt:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0,r=Rb(e,n,t,i||e.level0Nodes);if(r)return r.coord.z},getTerrainObjectAt:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;return Rb(e,n,t,i||e.level0Nodes,r)},FAST_READ_Z:0,PRECISE_READ_Z:1,placeObjectOnGround:function(e,t,n){var i,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4?arguments[4]:void 0;if(console.warn("placeObjectOnGround has been deprecated because it needs review and test"),i=a?a.concat(e.level0Nodes):e.level0Nodes,r.modifyGeometry){var o={worldFromLocal:n.matrixWorld,localFromWorld:(new bt).copy(n.matrixWorld).invert()},s=n.geometry;if(s.vertices){r.cache&&(r.cache.length=s.vertices.length);for(var l=!0,A=new ob(t),c=0;c<s.vertices.length;c++){var h=r.cache?r.cache[c]:void 0,u=Bb(e,r.method||Sb.FAST_READ_Z,i,t,s.vertices[c],r.offset||0,o,A,h);r.cache&&(r.cache[c]=u),u||(l=!1)}return s.verticesNeedUpdate=!0,l}if(s.isBufferGeometry){r.cache&&(r.cache.length=s.attributes.position.count);for(var d=!0,f=new at,p=new ob(t),m=0;m<s.attributes.position.count;m++){var v=r.cache?r.cache[m]:void 0;f.fromBufferAttribute(s.attributes.position,m);var g=f.z,y=Bb(e,r.method||Sb.FAST_READ_Z,i,t,f,r.offset||0,o,p,v);r.cache&&(r.cache[m]=y),y||(d=!1),g!=f.z&&(s.attributes.position.needsUpdate=!0),s.attributes.position.setXYZ(m,f.x,f.y,f.z)}return d}}else{r.cache&&(r.cache.length=1);var w={worldFromLocal:n.parent?n.parent.matrixWorld:void 0,localFromWorld:n.parent?(new bt).copy(n.parent.matrixWorld).invert():void 0},x=Bb(e,r.method||Sb.FAST_READ_Z,i,t,n.position,r.offset||0,w,void 0,r.cache?r.cache[0]:void 0);if(x)return r.cache&&(r.cache[0]=x),n.updateMatrix(),n.updateMatrixWorld(),!0}}};function Tb(e,t){if(t.extent){if(!t.extent.isPointInside(e))return;for(var n=0;n<t.children.length;n++){var i=Tb(e,t.children[n]);if(i)return i}var r=t.material.getElevationLayer();return r&&r.level>=0?t:void 0}}function _b(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];for(var a=0;a<i.length;a+=2)i[a]=Hh.clamp(i[a],0,t.image.width-1),i[a+1]=Hh.clamp(i[a+1],0,t.image.height-1);if(t.image.data){if(2===i.length){var o=t.image.data[i[1]*t.image.width+i[0]];return o!=e.noDataValue?o:void 0}for(var s=[],l=0;l<i.length;l+=2){var A=t.image.data[i[l+1]*t.image.width+i[l]];s.push(A!=e.noDataValue?A:void 0)}return s}Eb||((Eb=document.createElement("canvas")).width=2,Eb.height=2);for(var c=1/0,h=1/0,u=-1/0,d=-1/0,f=0;f<i.length;f+=2)c=Math.min(i[f],c),h=Math.min(i[f+1],h),u=Math.max(i[f],u),d=Math.max(i[f+1],d);var p=u-c+1,m=d-h+1;Eb.width=Math.max(Eb.width,p),Eb.height=Math.max(Eb.height,m);var v=Eb.getContext("2d");v.drawImage(t.image,c,h,p,m,0,0,p,m);for(var g=v.getImageData(0,0,p,m),y=[],w=0;w<i.length;w+=2){var x=i[w]-c,b=i[w+1]-h,M=Hh.lerp(e.colorTextureElevationMinZ,e.colorTextureElevationMaxZ,g.data[4*b*p+4*x]/255);y.push(M!=e.noDataValue?M:void 0)}return 2===i.length?y[0]:y}function Ib(e,t,n){var i=e.image.width,r=e.image.height,a=Math.max(0,t*i-.5),o=Math.max(0,n*r-.5),s=Math.floor(a),l=Math.ceil(a),A=Math.floor(o);return{u1:s,u2:l,v1:A,v2:Math.ceil(o),wu:a-s,wv:o-A}}function Lb(e,t,n){return null==e?t:null==t?e:Hh.lerp(e,t,n)}function Fb(e,t,n,i){var r=Ib(t,n,i),a=M(_b(e,t,r.u1,r.v1,r.u2,r.v1,r.u1,r.v2,r.u2,r.v2),4),o=a[0],s=a[1],l=a[2],A=a[3],c=Lb(o,s,r.wu),h=Lb(l,A,r.wu);return Lb(c,h,r.wv)}function kb(e,t,n){return function(e,t,n,i){var r=Ib(t,n,i);return _b(e,t,r.wu<=0?r.u1:r.u2,r.wv<=0?r.v1:r.v2)}(e.attachedLayers.filter((function(e){return e.isElevationLayer}))[0],t,n.x,n.y)}var Pb=new at;var Ub={v:new at,coord1:new ob("EPSG:4978"),coord2:new ob("EPSG:4978"),offset:new tt},Db=new tt;function Rb(e,t,n,i,r){var a=n.as(e.extent.crs,Ub.coord1),o=null;r&&r.tile&&r.tile.material&&(o=Tb(a,r.tile));for(var s=0;!o&&s<i.length;s++)o=Tb(a,i[s]);if(o){var l=o,A=l.material.getElevationLayer(),c=A.textures[0];if(r&&r.id===c.id&&r.version===c.version)return{coord:a,texture:c,tile:l};for(var h=Math.round(Math.log2(1/A.offsetScales[0].z)),u=0;u<h;u++)o=o.parent;return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new tt;if(e.crs!=t.crs)throw new Error("Unsupported mix: ".concat(e.crs," and ").concat(t.crs));t.dimensions(Db);var i=(e.x-t.west)/Db.x,r=(t.north-e.y)/Db.y;n.set(i,r)}(a,o.extent,Ub.offset),a.z=1==t?function(e,t,n,i,r){var a=i.x/r.x/16,o=Math.floor(n.x/a)*a,s=Math.floor(n.y/a)*a;1==o&&(o-=a),1==s&&(s-=a);var l=o,A=o+a,c=s,h=s+a,u=(n.x-o)/a,d=(n.y-s)/a,f=1==d||u/(1-d)>=1,p=new Tn(new at(l,h),new at(A,c),f?new at(A,h):new at(l,c));p.getBarycoord(new at(n.x,n.y),Pb);var m=e.attachedLayers.filter((function(e){return e.isElevationLayer}))[0],v=Fb(m,t,p.a.x,p.a.y),g=Fb(m,t,p.b.x,p.b.y),y=Fb(m,t,p.c.x,p.c.y);return v*Pb.x+g*Pb.y+y*Pb.z}(e,c,Ub.offset,l.extent.dimensions(),o.extent.dimensions()):kb(e,c,Ub.offset),null!=a.z?{coord:a,texture:c,tile:l}:void 0}}var Ob=1,Nb={frustum:new Wi,matrix:new bt,box3:new tn},zb=new tn(new at(-1,-1,-1),new at(1,1,1));function Qb(e,t,n){if(e.camera3D.isOrthographicCamera)e._preSSE=t;else{var i=Hh.degToRad(n);e._preSSE=t/(2*Math.tan(.5*i))}}var Gb=function(){function e(t,n,i){var r=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(s(this,e),this.crs=t,a.isCamera)console.warn("options.camera parameter is deprecated. Use options.camera.cameraThree to place a custom camera as a parameter. See the documentation of Camera."),this.camera3D=a;else if(a.cameraThree)this.camera3D=a.cameraThree;else if(a.type===Ob)this.camera3D=new FA;else this.camera3D=new Ni(30);if(this.camera3D.aspect=void 0!==this.camera3D.aspect?this.camera3D.aspect:1,this._viewMatrix=new bt,this.width=n,this.height=i,this._viewMatrixNeedsUpdate=!0,this.resize(n,i),this._preSSE=1/0,this.camera3D.isPerspectiveCamera){var o=this.camera3D.fov;Object.defineProperty(this.camera3D,"fov",{get:function(){return o},set:function(e){o=e,Qb(r,r.height,o)}})}}return A(e,[{key:"resize",value:function(e,t){var n=e/t;if(this.camera3D.aspect!==n){if(this.camera3D.isOrthographicCamera){this.camera3D.zoom*=this.width/e;var i=this.camera3D.top*this.camera3D.aspect/n;this.camera3D.bottom=-i,this.camera3D.top=i}else this.camera3D.isPerspectiveCamera&&(this.camera3D.fov=2*et.radToDeg(Math.atan(t/this.height*Math.tan(et.degToRad(this.camera3D.fov)/2))));this.camera3D.aspect=n}this.width=e,this.height=t,Qb(this,this.height,this.camera3D.fov),this.camera3D.updateProjectionMatrix&&(this.camera3D.updateProjectionMatrix(),this._viewMatrixNeedsUpdate=!0)}},{key:"update",value:function(){this.camera3D.updateMatrixWorld(),this._viewMatrixNeedsUpdate=!0}},{key:"position",value:function(e){return new ob(this.crs,this.camera3D.position).as(e||this.crs)}},{key:"setPosition",value:function(e){this.camera3D.position.copy(e.as(this.crs))}},{key:"isBox3Visible",value:function(e,t){return this.box3SizeOnScreen(e,t).intersectsBox(zb)}},{key:"isSphereVisible",value:function(e,t){return this._viewMatrixNeedsUpdate&&(this._viewMatrix.multiplyMatrices(this.camera3D.projectionMatrix,this.camera3D.matrixWorldInverse),this._viewMatrixNeedsUpdate=!1),t?(Nb.matrix.multiplyMatrices(this._viewMatrix,t),Nb.frustum.setFromProjectionMatrix(Nb.matrix)):Nb.frustum.setFromProjectionMatrix(this._viewMatrix),Nb.frustum.intersectsSphere(e)}},{key:"box3SizeOnScreen",value:function(e,t){var n=function(e,t,n){var i=e.camera3D.matrixWorldInverse;n&&(i=Nb.matrix.multiplyMatrices(e.camera3D.matrixWorldInverse,n));Hb[0].set(t.min.x,t.min.y,t.min.z).applyMatrix4(i),Hb[1].set(t.min.x,t.min.y,t.max.z).applyMatrix4(i),Hb[2].set(t.min.x,t.max.y,t.min.z).applyMatrix4(i),Hb[3].set(t.min.x,t.max.y,t.max.z).applyMatrix4(i),Hb[4].set(t.max.x,t.min.y,t.min.z).applyMatrix4(i),Hb[5].set(t.max.x,t.min.y,t.max.z).applyMatrix4(i),Hb[6].set(t.max.x,t.max.y,t.min.z).applyMatrix4(i),Hb[7].set(t.max.x,t.max.y,t.max.z).applyMatrix4(i);for(var r=!1,a=0;a<8;a++)Hb[a].z<=-e.camera3D.near?r=!0:Hb[a].z=-e.camera3D.near;return r?Hb:void 0}(this,e,t);if(!n)return Nb.box3.makeEmpty();for(var i=0;i<8;i++)n[i].applyMatrix4(this.camera3D.projectionMatrix);return Nb.box3.setFromPoints(n)}},{key:"adjustAltitudeToAvoidCollisionWithLayer",value:function(e,t,n){var i=e.camera.position().as("EPSG:4326");if(void 0!==t){var r=Sb.getElevationValueAt(t,i);if(void 0!==r)i.altitude-(r+n)<0&&(i.altitude=r+n,e.camera.camera3D.position.copy(i.as(e.referenceCrs)),e.notifyChange(this.camera3D))}}}]),e}(),Hb=[new at,new at,new at,new at,new at,new at,new at,new at];var Vb="update_start",jb="before_camera_update",Wb="after_camera_update",Xb="before_layer_update",Yb="after_layer_update",Kb="before_render",Zb="after_render",Jb="update_end";function qb(e,t){this.renderingState=0,this.needsRedraw=!1,this.scheduler=e,this.gfxEngine=t,this._updateLoopRestarted=!0}function $b(e,t,n){if(n){var i,r=S(n);try{for(r.s();!(i=r.n()).done;){var a=i.value,o=t.update(e,t,a),s=t.getObjectToUpdateForAttachedLayers(a);if(s)if(s.element){if(__DEBUG__&&!s.element.isObject3D)throw new Error("\n Invalid object for attached layer to update.\n Must be a THREE.Object and have a THREE.Material");var l,A=S(t.attachedLayers);try{for(A.s();!(l=A.n()).done;){var c=l.value;c.ready&&(c.update(e,c,s.element,s.parent),c.cache.flush())}}catch(e){A.e(e)}finally{A.f()}}else if(s.elements)for(var h=0;h<s.elements.length;h++){if(!s.elements[h].isObject3D)throw new Error("\n Invalid object for attached layer to update.\n Must be a THREE.Object and have a THREE.Material");var u,d=S(t.attachedLayers);try{for(d.s();!(u=d.n()).done;){var f=u.value;f.ready&&(f.update(e,f,s.elements[h],s.parent),f.cache.flush())}}catch(e){d.e(e)}finally{d.f()}}$b(e,t,o)}}catch(e){r.e(e)}finally{r.f()}}}function eM(e,t){var n=!1,i=new Set;return e.forEach((function(e){e===t||e.isCamera?(t.info.clear(),n=!0):e.layer===t&&i.add(e)})),n?new Set([t]):i}qb.prototype=Object.create(Je.prototype),qb.prototype.constructor=qb,qb.prototype.scheduleViewUpdate=function(e,t){var n=this;this.needsRedraw|=t,1!==this.renderingState&&(this.renderingState=1,__DEBUG__&&(document.title+=" ⌛"),this.animationFrame=requestAnimationFrame((function(t){n._step(e,t)})))},qb.prototype._update=function(e,t,n){var i={camera:e.camera,engine:this.gfxEngine,scheduler:this.scheduler,view:e};t.forEach((function(e){var n=e.layer||e;n.isLayer&&n.parent&&t.add(n.parent)}));var r,a=S(e.getLayers((function(e,t){return!t})));try{for(a.s();!(r=a.n()).done;){var o=r.value;if(i.geometryLayer=o,o.ready&&o.visible&&!o.frozen){e.execFrameRequesters(Xb,n,this._updateLoopRestarted,o);var s=eM(t,o);if(s.size>0){var l,A=S(o.attachedLayers);try{for(A.s();!(l=A.n()).done;){var c=l.value;c.ready&&c.preUpdate&&c.preUpdate(i,s)}}catch(e){A.e(e)}finally{A.f()}var h=o.preUpdate(i,s);$b(i,o,h),o.postUpdate(i,o,t)}o.cache.flush(),e.execFrameRequesters(Yb,n,this._updateLoopRestarted,o)}}}catch(e){a.e(e)}finally{a.f()}},qb.prototype._step=function(e,t){var n=t-this._lastTimestamp;e._executeFrameRequestersRemovals(),e.execFrameRequesters(Vb,n,this._updateLoopRestarted);var i=this.needsRedraw;this._lastTimestamp=t,this.needsRedraw=!1,this.renderingState=0;var r=new Set(e._changeSources);e._changeSources.clear();var a=this.gfxEngine.getWindowSize();e.execFrameRequesters(jb,n,this._updateLoopRestarted),e.camera.update(a.x,a.y),e.execFrameRequesters(Wb,n,this._updateLoopRestarted);var o=e.camera.camera3D.matrixAutoUpdate;e.camera.camera3D.matrixAutoUpdate=!1,this._update(e,r,n),0==this.scheduler.commandsWaitingExecutionCount()&&this.dispatchEvent({type:"command-queue-empty"}),i&&this._renderView(e,n),this._updateLoopRestarted=0===this.renderingState,__DEBUG__&&(document.title=document.title.substr(0,document.title.length-2)),e.camera.camera3D.matrixAutoUpdate=o,e.execFrameRequesters(Jb,n,this._updateLoopRestarted)},qb.prototype._renderView=function(e,t){e.execFrameRequesters(Kb,t,this._updateLoopRestarted),e.render?e.render():this.gfxEngine.renderView(e),e.execFrameRequesters(Zb,t,this._updateLoopRestarted)},qb.prototype.dispose=function(){this.animationFrame&&cancelAnimationFrame(this.animationFrame)};var tM=!1,nM=8;function iM(e,t,n){var i=e.getContext(),r=i.createShader(t);return i.shaderSource(r,n),i.compileShader(r),r}function rM(){return navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}var aM=function(){return tM},oM=function(){return!!document.documentMode},sM=function(){return nM},lM=function(e){var t=e.getContext();nM=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),t.getParameter(t.MAX_TEXTURE_SIZE);var n=t.createProgram(),i=iM(e,t.VERTEX_SHADER,"\nvoid main() {\n gl_Position = vec4( 0.0, 0.0, 0.0, 1.0 );\n}\n"),r="#define SAMPLE ".concat(nM,"\n");r+="\nuniform sampler2D uni[SAMPLE];\nvoid main() {\n gl_FragColor += texture2D(uni[SAMPLE-1], vec2(0));\n}\n";var a=iM(e,t.FRAGMENT_SHADER,r);if(t.attachShader(n,i),t.attachShader(n,a),t.linkProgram(n),!1===t.getProgramParameter(n,t.LINK_STATUS)){if(!(nM>16))throw new Error("The GPU capabilities could not be determined accurately.\n Impossible to link a shader with the Maximum texture units ".concat(nM));var o=t.getProgramInfoLog(n);console.warn("".concat(o,": using a maximum of 16 texture units instead of the reported value (").concat(nM,")")),rM()&&console.warn("It can come from a Mesa/Firefox bug;\n the shader compiles to an error when using more than 16 sampler uniforms,\n see https://bugzilla.mozilla.org/show_bug.cgi?id=777028"),nM=16}t.deleteProgram(n),t.deleteShader(i),t.deleteShader(a),tM=e.capabilities.logarithmicDepthBuffer},AM="\n#include <itowns/WebGL2_pars_vertex>\n#include <itowns/precision_qualifier>\n#include <common>\n#include <itowns/project_pars_vertex>\n#include <itowns/elevation_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nattribute vec2 uv_0;\n#if NUM_CRS > 1\nattribute float uv_1;\n#endif\nattribute vec3 normal;\n\nuniform mat4 modelMatrix;\nuniform bool lightingEnabled;\nvarying vec2 vHighPrecisionZW;\n\n#if MODE == MODE_FINAL\n#include <fog_pars_vertex>\nvarying vec3 vUv;\nvarying vec3 vNormal;\n#endif\nvoid main() {\n vec2 uv = vec2(uv_0.x, 1.0 - uv_0.y);\n\n #include <begin_vertex>\n #include <itowns/elevation_vertex>\n #include <project_vertex>\n #include <logdepthbuf_vertex>\n vHighPrecisionZW = gl_Position.zw;\n#if MODE == MODE_FINAL\n #include <fog_vertex>\n #if NUM_CRS > 1\n vUv = vec3(uv_0, (uv_1 > 0.) ? uv_1 : uv_0.y); // set uv_1 = uv_0 if uv_1 is undefined\n #else\n vUv = vec3(uv_0, 0.0);\n #endif\n vNormal = normalize ( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );\n#endif\n}\n",cM="\n#include <itowns/WebGL2_pars_fragment>\n#include <itowns/precision_qualifier>\n#include <logdepthbuf_pars_fragment>\n#include <itowns/pitUV>\n#include <itowns/color_layers_pars_fragment>\n#if MODE == MODE_FINAL\n#include <itowns/fog_pars_fragment>\n#include <itowns/overlay_pars_fragment>\n#include <itowns/lighting_pars_fragment>\n#endif\n#include <itowns/mode_pars_fragment>\n\nuniform vec3 diffuse;\nuniform float opacity;\nvarying vec3 vUv; // uv_0.x/uv_1.x, uv_0.y, uv_1.y\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n #include <logdepthbuf_fragment>\n\n#if MODE == MODE_ID\n\n #include <itowns/mode_id_fragment>\n\n#elif MODE == MODE_DEPTH\n\n #include <itowns/mode_depth_fragment>\n\n#else\n\n gl_FragColor = vec4(diffuse, opacity);\n\n uvs[0] = vec3(vUv.xy, 0.);\n\n#if NUM_CRS > 1\n uvs[1] = vec3(vUv.x, fract(vUv.z), floor(vUv.z));\n#endif\n\n vec4 color;\n #pragma unroll_loop\n for ( int i = 0; i < NUM_FS_TEXTURES; i ++ ) {\n color = getLayerColor( i , colorTextures[ i ], colorOffsetScales[ i ], colorLayers[ i ]);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, color.rgb, color.a);\n }\n\n #if defined(DEBUG)\n if (showOutline) {\n #pragma unroll_loop\n for ( int i = 0; i < NUM_CRS; i ++) {\n color = getOutlineColor( outlineColors[ i ], uvs[ i ].xy);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, color.rgb, color.a);\n }\n }\n #endif\n\n #include <itowns/fog_fragment>\n #include <itowns/lighting_fragment>\n #include <itowns/overlay_fragment>\n\n#endif\n}\n",hM=new RegExp("gl_Position.*(?![^]*gl_Position)"),uM=new RegExp("[^\\w]*main[^\\w]*(void)?[^\\w]*{"),dM=function(e){if(!e.vertexShader.includes("USE_LOGDEPTHBUF")&&!e.vertexShader.includes("logdepthbuf_pars_vertex")){e.vertexShader="#include <logdepthbuf_pars_vertex>\n#define EPSILON 1e-6\n".concat(e.vertexShader);var t=hM.exec(e.vertexShader),n=t[0].length+t.index;e.vertexShader="".concat(e.vertexShader.slice(0,n),"\n#include <logdepthbuf_vertex>\n").concat(e.vertexShader.slice(n)),e.fragmentShader="#include <itowns/precision_qualifier\n".concat(e.fragmentShader),e.fragmentShader="#include <logdepthbuf_pars_fragment>\n".concat(e.fragmentShader),n=(t=uM.exec(e.fragmentShader))[0].length+t.index,e.fragmentShader="".concat(e.fragmentShader.slice(0,n),"\n#include <logdepthbuf_fragment>\n").concat(e.fragmentShader.slice(n)),e.defines={USE_LOGDEPTHBUF:1,USE_LOGDEPTHBUF_EXT:1}}},fM=function(e,t){return e.replace(/#pragma unroll_loop\s+for\s*\(\s*int\s+i\s*=\s*([\w\d]+);\s*i\s+<\s+([\w\d]+);\s*i\s*\+\+\s*\)\s*\{\n([^}]*)\}/g,(function(e,n,i,r){var a="";n=n in t?t[n]:parseInt(n,10),i=i in t?t[i]:parseInt(i,10);for(var o=n;o<i;o++)a+=r.replace(/\bi\b/g," ".concat(o," "));return a}))},pM={FINAL:0,DEPTH:1,ID:2};var mM={MODES:pM,push:function(e,t){var n=void 0!==e.mode?e.mode:pM.FINAL;if(n==t)return function(){};var i=function(e){return function(t){var n=t.material;n&&(n.mode=e)}};return e.traverse(i(t)),function(){e.traverse(i(n))}}},vM=function(e,t,n){Object.keys(n).forEach((function(i){e.defines["".concat(t,"_").concat(i)]=n[i]}))},gM=function(e,t,n,i){e.defines[n]=i,Object.defineProperty(e,t,{get:function(){return e.defines[n]},set:function(t){e.defines[n]!=t&&(e.defines[n]=t,e.needsUpdate=!0)}})},yM=function(e,t,n){e.uniforms[t]=new Rc(n),Object.defineProperty(e,t,{get:function(){return e.uniforms[t].value},set:function(n){e.uniforms[t].value!=n&&(e.uniforms[t].value=n)}})},wM=new ut(0,0,1,1),xM=new ht,bM=255/256,MM=new ut(5.9371814131736755e-8,bM/65536,.0038909912109375,bM);function CM(e,t){return t?MM.dot(e)*t:MM.dot(e)}function BM(){var e=sM();return Math.min(e-1,15)}var EM={bias:0,zmin:0,zmax:0,scale:0,mode:0,textureOffset:0,opacity:0,crs:0,effect:0};function SM(e,t,n){var i,r=e.layers.value,a=e.textures.value,o=e.offsetScales.value,s=e.textureCount,l=0,A=S(t);try{for(A.s();!(i=A.n()).done;){var c=i.value;c.textureOffset=l;for(var h=0,u=c.textures.length;h<u;++h,++l)l<n&&(o[l]=c.offsetScales[h],a[l]=c.textures[h],r[l]=c)}}catch(e){A.e(e)}finally{A.f()}l>n&&console.warn("LayeredMaterial: Not enough texture units (".concat(n," < ").concat(l,"), excess textures have been discarded.")),s.value=l;for(var d=l;d<a.length;d++)a[d]=xM,o[d]=wM,r[d]=EM}var TM,_M={RGBA:0,COLOR:1,DATA:2},IM=[],LM=function(e){h(n,e);var t=y(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(s(this,n),e=t.call(this,i),TM=TM||[1,BM()],e.defines.NUM_VS_TEXTURES=TM[0],e.defines.NUM_FS_TEXTURES=TM[1],e.defines.USE_FOG=1,e.defines.NUM_CRS=r,vM(v(e),"ELEVATION",_M),vM(v(e),"MODE",mM.MODES),gM(v(e),"mode","MODE",mM.MODES.FINAL),__DEBUG__){e.defines.DEBUG=1;var a=[new at(1,0,0)];r>1&&a.push(new at(1,.5,0)),yM(v(e),"showOutline",!0),yM(v(e),"outlineWidth",.008),yM(v(e),"outlineColors",a)}aM()&&(e.defines.USE_LOGDEPTHBUF=1,e.defines.USE_LOGDEPTHBUF_EXT=1),e.vertexShader=AM,IM[r]=IM[r]||fM(cM,e.defines),e.fragmentShader=IM[r],yM(v(e),"diffuse",new Fn(.04,.23,.35)),yM(v(e),"opacity",e.opacity),yM(v(e),"lightingEnabled",!1),yM(v(e),"lightPosition",new at(-.5,0,1)),yM(v(e),"fogDistance",1e9),yM(v(e),"fogColor",new Fn(.76,.85,1)),yM(v(e),"overlayAlpha",0),yM(v(e),"overlayColor",new Fn(1,.3,0)),yM(v(e),"objectId",0),yM(v(e),"minBorderDistance",-.01),e.layers=[],e.elevationLayerIds=[],e.colorLayerIds=[],e.uniforms.elevationLayers=new Rc(new Array(TM[0]).fill(EM)),e.uniforms.elevationTextures=new Rc(new Array(TM[0]).fill(xM)),e.uniforms.elevationOffsetScales=new Rc(new Array(TM[0]).fill(wM)),e.uniforms.elevationTextureCount=new Rc(0),e.uniforms.colorLayers=new Rc(new Array(TM[1]).fill(EM)),e.uniforms.colorTextures=new Rc(new Array(TM[1]).fill(xM)),e.uniforms.colorOffsetScales=new Rc(new Array(TM[1]).fill(wM)),e.uniforms.colorTextureCount=new Rc(0);var o=e.visible;return Object.defineProperty(v(e),"visible",{get:function(){return o},set:function(e){o!=e&&(o=e,this.dispatchEvent({type:e?"shown":"hidden"}))}}),e}return A(n,[{key:"onBeforeCompile",value:function(e,t){t.capabilities.isWebGL2&&(this.defines.WEBGL2=!0,e.glslVersion="300 es")}},{key:"getUniformByType",value:function(e){return{layers:this.uniforms["".concat(e,"Layers")],textures:this.uniforms["".concat(e,"Textures")],offsetScales:this.uniforms["".concat(e,"OffsetScales")],textureCount:this.uniforms["".concat(e,"TextureCount")]}}},{key:"updateLayersUniforms",value:function(){var e=this,t=this.layers.filter((function(t){return e.colorLayerIds.includes(t.id)&&t.visible&&t.opacity>0}));if(t.sort((function(t,n){return e.colorLayerIds.indexOf(t.id)-e.colorLayerIds.indexOf(n.id)})),SM(this.getUniformByType("color"),t,this.defines.NUM_FS_TEXTURES),this.elevationLayerIds.some((function(t){return e.getLayer(t)}))||this.uniforms.elevationTextureCount.value&&!this.elevationLayerIds.length){var n=this.getElevationLayer()?[this.getElevationLayer()]:[];SM(this.getUniformByType("elevation"),n,this.defines.NUM_VS_TEXTURES)}this.layersNeedUpdate=!1}},{key:"dispose",value:function(){this.dispatchEvent({type:"dispose"}),this.layers.forEach((function(e){return e.dispose(!0)})),this.layers.length=0,this.layersNeedUpdate=!0}},{key:"setSequence",value:function(e){this.colorLayerIds=e,this.layersNeedUpdate=!0}},{key:"setSequenceElevation",value:function(e){this.elevationLayerIds[0]=e,this.layersNeedUpdate=!0}},{key:"removeLayer",value:function(e){var t=this.layers.findIndex((function(t){return t.id===e}));if(t>-1){this.layers[t].dispose(),this.layers.splice(t,1);var n=this.colorLayerIds.indexOf(e);n>-1?this.colorLayerIds.splice(n,1):this.elevationLayerIds=[]}}},{key:"addLayer",value:function(e){e.layer.id in this.layers&&console.warn('The "{layer.id}" layer was already present in the material, overwritting.'),this.layers.push(e)}},{key:"getLayer",value:function(e){return this.layers.find((function(t){return t.id===e}))}},{key:"getLayers",value:function(e){return this.layers.filter((function(t){return e.includes(t.id)}))}},{key:"getElevationLayer",value:function(){var e=this;return this.layers.find((function(t){return t.id===e.elevationLayerIds[0]}))}},{key:"setElevationScale",value:function(e){this.elevationLayerIds.length&&(this.getElevationLayer().scale=e)}}]),n}(vl);function FM(e,t,n){var i=e.image,r=i.width,a=i.height,o=i.data;if(!o)return{min:null,max:null};var s=function(e,t,n){var i=t.x,r=t.y,a=t.z,o=[Fb({noDataValue:n},e,i,r),Fb({noDataValue:n},e,i+a,r),Fb({noDataValue:n},e,i+a,r+a),Fb({noDataValue:n},e,i,r+a)].filter((function(e){return null!=e&&e>-10}));if(o.length)return{min:Math.min.apply(Math,C(o)),max:Math.max.apply(Math,C(o))}}(e,t,n)||{max:-1/0,min:1/0},l=s.min,A=s.max,c=Math.floor(t.z*r);if(c>2)for(var h=Math.floor(t.z*a),u=Math.floor(t.x*r),d=Math.floor(t.y*a),f=Math.max(Math.floor(c/32),2),p=d+h,m=d;m<p;m+=f)for(var v=m*(r||0)+u,g=v+c;v<g;v+=f){var y=o[v];y>-10&&y!=n&&(A=Math.max(A,y),l=Math.min(l,y))}return A===-1/0||l===1/0?{min:null,max:null}:{min:l,max:A}}function kM(e,t,n){var i=e%n/n,r=Math.floor(e/n)/n,a=t.x+i*t.z,o=t.y+r*t.w;return Math.floor(o*n)*n+Math.floor(a*n)}var PM=new ut,UM=function(e){h(n,e);var t=y(n);function n(e,i){var r;return s(this,n),(r=t.call(this)).layer=i,r.crs=i.parent.tileMatrixSets.indexOf(Jx.formatToTms(i.crs)),-1==r.crs&&console.error("Unknown crs:",i.crs),r.textures=[],r.offsetScales=[],r.level=-1,r.material=e,r._handlerCBEvent=function(){r.material.layersNeedUpdate=!0},i.addEventListener("visible-property-changed",r._handlerCBEvent),r}return A(n,[{key:"id",get:function(){return this.layer.id}},{key:"opacity",get:function(){return this.layer.opacity}},{key:"visible",get:function(){return this.layer.visible}},{key:"initFromParent",value:function(e,t){if(e&&e.level>this.level){var n,i=0,r=S(t);try{for(r.s();!(n=r.n()).done;){var a,o=n.value,s=S(e.textures);try{for(s.s();!(a=s.n()).done;){var l=a.value;if(o.isInside(l.extent)){this.setTexture(i++,l,o.offsetToParent(l.extent));break}}}catch(e){s.e(e)}finally{s.f()}}}catch(e){r.e(e)}finally{r.f()}__DEBUG__&&i!=t.length&&console.error("non-coherent result ".concat(i," vs ").concat(t.length,"."),t)}}},{key:"dispose",value:function(e){e&&(this.layer.removeEventListener("visible-property-changed",this._handlerCBEvent),this._listeners={});var t,n=S(this.textures);try{for(n.s();!(t=n.n()).done;){var i=t.value;i.isTexture&&i.dispose()}}catch(e){n.e(e)}finally{n.f()}this.level=-1,this.textures=[],this.offsetScales=[],this.material.layersNeedUpdate=!0}},{key:"setTexture",value:function(e,t,n){this.level=t&&0==e?t.extent.zoom:this.level,this.textures[e]=t||null,this.offsetScales[e]=n,this.material.layersNeedUpdate=!0}},{key:"setTextures",value:function(e,t){this.dispose(!1);for(var n=0,i=e.length;n<i;++n)this.setTexture(n,e[n],t[n])}}]),n}(Je),DM=function(e){h(n,e);var t=y(n);function n(){return s(this,n),t.apply(this,arguments)}return A(n,[{key:"effect",get:function(){return this.layer.fx}}]),n}(UM),RM=function(e){h(n,e);var t=y(n);function n(e,i){var r;s(this,n),r=t.call(this,e,i);var a={bias:0,scale:1,mode:_M.DATA,zmin:0,zmax:1/0},o=1;if(i.useRgbaTextureElevation)throw a.mode=_M.RGBA,a.zmax=5e3,new Error("Restore this feature");return i.useColorTextureElevation?(o=i.colorTextureElevationMaxZ-i.colorTextureElevationMinZ,a.mode=_M.COLOR,a.bias=i.colorTextureElevationMinZ,r.min=r.layer.colorTextureElevationMinZ,r.max=r.layer.colorTextureElevationMaxZ):(r.min=0,r.max=0),r.bias=i.bias||a.bias,r.scale=(i.scale||a.scale)*o,r.mode=i.mode||a.mode,r.zmin=i.zmin||a.zmin,r.zmax=i.zmax||a.zmax,r}return A(n,[{key:"initFromParent",value:function(e,t){b(u(n.prototype),"initFromParent",this).call(this,e,t),this.updateMinMaxElevation()}},{key:"setTextures",value:function(e,t){this.replaceNoDataValueFromTexture(e[0]),b(u(n.prototype),"setTextures",this).call(this,e,t),this.updateMinMaxElevation()}},{key:"updateMinMaxElevation",value:function(){if(this.textures[0]&&!this.layer.useColorTextureElevation){var e=FM(this.textures[0],this.offsetScales[0],this.layer.noDataValue),t=e.min,n=e.max;this.min==t&&this.max==n||(this.min=t,this.max=n,this.dispatchEvent({type:"updatedElevation",node:this}))}}},{key:"replaceNoDataValueFromTexture",value:function(e){var t=this.layer.noDataValue;if(null!=t){var n,i,r,a=this.textures[0],o=a&&a.image&&a.image.data,s=e.image&&e.image.data;!s||!o||(i=t,r=(n=s).length,n[0]>i&&n[r-1]>i&&n[Math.sqrt(r)-1]>i&&n[r-Math.sqrt(r)]>i)||(e.extent.offsetToParent(a.extent,PM),function(e,t,n,i){for(var r=0,a=e.length;r<a;++r)e[r]===n&&(e[r]=t[kM(r,i,256)])}(s,o,t,PM))}}}]),n}(UM);function OM(e,t,n){return e.pendingSubdivision?n:t}function NM(e,t){var n=t.groups.filter((function(t){return t<=e}));return n.length?n[n.length-1]:t.groups[0]}function zM(e,t,n){return Math.min(e,t+(n.increment||1))}function QM(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return-1==t?n.zoom?n.zoom.min:0:Math.min(e,Math.ceil((t+e)/2))}function GM(e,t){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.level,r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,s=a.source.zoom?a.source.zoom.max:1/0;if(o.lowestLevelError!=1/0)n=QM(o.lowestLevelError,r,a.source),n=o.lowestLevelError==n?n-1:n,1==e&&(n=NM(n,a.updateStrategy.options));else{switch(e){case 1:n=NM(i,a.updateStrategy.options);break;case 2:n=zM(i,r,a.updateStrategy.options);break;case 3:n=QM(i,r,a.source);break;default:n=OM(t,i,r)}n=Math.min(n,s)}return n}var HM,VM=function(){function e(t){s(this,e),this.layer=t}return A(e,[{key:"clear",value:function(){}},{key:"update",value:function(){}}]),e}(),jM=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),(i=t.call(this,e)).displayed={tiles:new Set},Object.defineProperty(i.displayed,"layers",{get:function(){var e=[];return i.displayed.tiles.forEach((function(t){var n=t.material;e=C(new Set([].concat(C(e),C(n.colorLayerIds.filter((function(e){return n.getLayer(e)}))),C(n.elevationLayerIds))))})),i.layer.attachedLayers.filter((function(t){return e.includes(t.id)}))}}),Object.defineProperty(i.displayed,"extent",{get:function(){var e=new bb(i.layer.extent.crs,1/0,-1/0,1/0,-1/0);return e.min=1/0,e.max=-1/0,i.displayed.tiles.forEach((function(t){e.union(t.extent),e.min=Math.min(t.obb.z.min,e.min),e.max=Math.max(t.obb.z.max,e.max)})),e}}),i}return A(n,[{key:"clear",value:function(){this.displayed.tiles.clear()}},{key:"update",value:function(e){e.material.visible?this.displayed.tiles.add(e):this.displayed.tiles.delete(e)}}]),n}(VM),WM={INFINITE:1/0,TEXTURE:9e5,GEOMETRY:9e5},XM=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:WM.INFINITE;s(this,e),this.lifeTime=t,this.lastTimeFlush=Date.now(),this.data=new Map}return A(e,[{key:"getByArray",value:function(e){return this.get(e[0],e[1],e[2])}},{key:"setByArray",value:function(e,t){return this.set(e,t[0],t[1],t[2])}},{key:"get",value:function(e,t,n){var i=this.data.get(e);if(null!=i){if(null!=i.lastTimeUsed)HM=i;else{var r=i.get(t);if(null==r)return;if(null!=r.lastTimeUsed)HM=r;else{var a=r.get(n);if(null==a)return;HM=a}}return HM.value?(HM.lastTimeUsed=Date.now(),HM.value):void 0}}},{key:"set",value:function(e,t,n,i){if(HM={value:e,lastTimeUsed:Date.now()},null==n)return this.data.set(t,HM),e;this.data.get(t)||this.data.set(t,new Map);var r=this.data.get(t);return null==i?(r.set(n,HM),e):(r.get(n)||r.set(n,new Map),r.get(n).set(i,HM),e)}},{key:"delete",value:function(e,t,n){var i=this.data.get(e);if(void 0!==i)if(null!=i.lastTimeUsed)this.data.get(e),this.data.delete(e);else{var r=i.get(t);if(void 0===r)return;if(null!=r.lastTimeUsed)i.get(t),i.delete(t),0==i.size&&this.data.delete(e);else{if(void 0===r.get(n))return;r.get(n),r.delete(n),0==r.size&&(i.delete(t),0==i.size&&this.data.delete(e))}}}},{key:"clear",value:function(){this.data.clear()}},{key:"flush",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();this.lifeTime==WM.INFINITE||this.lifeTime>t-this.lastTimeFlush||!this.data.size||(this.lastTimeFlush=1/0,this.data.forEach((function(n,i){e.lifeTime<t-n.lastTimeUsed?(e.data.get(i),e.data.delete(i)):(n.forEach((function(i,r){e.lifeTime<t-i.lastTimeUsed?(n.get(r),n.delete(r)):(i.forEach((function(n,r){e.lifeTime<t-n.lastTimeUsed?(i.get(r),i.delete(r)):e.lastTimeFlush=Math.min(e.lastTimeFlush,n.lastTimeUsed)})),i.size||(n.get(r),n.delete(r)))})),n.size||(e.data.get(i),e.data.delete(i)))})),0==this.data.size&&(this.lastTimeFlush=Date.now()))}}]),e}(),YM=new tA,KM=256;function ZM(e){if(!e.ok){var t=new Error("Error loading ".concat(e.url,": status ").concat(e.status));throw t.response=e,t}}var JM=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return fetch(e,t).then((function(e){return ZM(e),e.arrayBuffer()}))};function qM(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(t){var n=new Hi(e,KM,KM,me,ne);return n.internalFormat="R32F",n}return new Hi(e,KM,KM,le,ne)}var $M={text:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(fetch)return fetch(e,t).then((function(e){return ZM(e),e.text()}));console.log("fetch is not defind")},json:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(fetch)return fetch(e,t).then((function(e){return ZM(e),e.json()}));console.log("fetch is not defind")},xml:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(fetch)return fetch(e,t).then((function(e){return ZM(e),e.text()})).then((function(e){return(new window.DOMParser).parseFromString(e,"text/xml")}));console.log("fetch is not defind")},texture:function(e){var t,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};YM.crossOrigin=i.crossOrigin;var r=new Promise((function(e,i){t=e,n=i}));return YM.load(e,t,(function(){}),n),r},arrayBuffer:JM,textureFloat:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return JM(e,t).then((function(e){return qM(new Float32Array(e),t.isWebGL2)}))},multiple:function(e,t){var n,i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=[];for(var o in t){if(!this[o])throw new Error("".concat(o," is not a valid Fetcher method."));var s,l=S(t[o]);try{var A=function(){var t=s.value;n="".concat(e,".").concat(t),a.push(i[o](n,r).then((function(e){return{type:t,result:e}})))};for(l.s();!(s=l.n()).done;)A()}catch(e){l.e(e)}finally{l.f()}}return Promise.all(a).then((function(e){var t,n={},i=S(e);try{for(i.s();!(t=i.n()).done;){var r=t.value;n[r.type]=r.result}}catch(e){i.e(e)}finally{i.f()}return Promise.resolve(n)}))}},eC=new XM,tC={};function nC(e,t,n,i){n[e]=n[e]||{};var r,a=S(tC[e]);try{for(a.s();!(r=a.n()).done;){var o=r.value,s=rC(t[e][o],i);void 0!==s&&(n[e][o]=s)}}catch(e){a.e(e)}finally{a.f()}}function iC(e){if(!e)return{};if(e.stops||e.expression)return{color:e};if("string"==typeof e){var t=e.match(/(?:((hsl|rgb)a? *\(([\d.%]+(?:deg|g?rad|turn)?)[ ,]*([\d.%]+)[ ,]*([\d.%]+)[ ,/]*([\d.%]*)\))|(#((?:[\d\w]{3}){1,2})([\d\w]{1,2})?))/i);if(!t)return{color:e,opacity:1};if(t[7]){var n=1;return t[9]&&(n=.00392156862745098*parseInt(1==t[9].length?"".concat(t[9]).concat(t[9]):t[9],16)),{color:"#".concat(t[8]),opacity:n}}if(t[0])return{color:"".concat(t[2],"(").concat(t[3],",").concat(t[4],",").concat(t[5],")"),opacity:Number(t[6])||1}}}function rC(e,t){if(null!=e){if(e.expression)return e.expression.evaluate(t);if(e.stops){for(var n=e.stops.length-1;n>=0;n--){var i=e.stops[n];if(t.globals.zoom>=i[0])return i[1]}return e.stops[0][1]}return e}}function aC(e,t){var n=document.createElement("img"),i=document.createElement("canvas");if("string"==typeof e)n.src=e;else if(e&&e[t]){var r=e[t];i.width=r.width,i.height=r.height,i.getContext("2d").drawImage(e.img,r.x,r.y,r.width,r.height,0,0,r.width,r.height),n.src=i.toDataURL("image/png")}return n}var oC={left:[0,-.5],right:[-1,-.5],top:[-.5,0],bottom:[-.5,-1],"top-right":[-1,0],"bottom-left":[0,-1],"bottom-right":[-1,-1],center:[-.5,-.5],"top-left":[0,0]};function sC(e,t,n,i,r){var a;Object.defineProperty(e[t],n,{enumerable:!0,get:function(){return void 0===a?e.parent[t][n]||r:a},set:function(e){a=e}}),e[t][n]=i}var lC=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;s(this,e),this.isStyle=!0,this.order=0,this.parent=i||{zoom:{},fill:{},stroke:{},point:{},text:{}},n.zoom=n.zoom||{},n.fill=n.fill||{},n.stroke=n.stroke||{},n.point=n.point||{},n.text=n.text||{},this.zoom={},sC(this,"zoom","min",n.zoom.min),sC(this,"zoom","max",n.zoom.max),this.fill={},sC(this,"fill","color",n.fill.color),sC(this,"fill","opacity",n.fill.opacity,1),sC(this,"fill","pattern",n.fill.pattern),"string"==typeof this.fill.pattern&&$M.texture(this.fill.pattern).then((function(e){t.fill.pattern=e.image})),this.stroke={},sC(this,"stroke","color",n.stroke.color),sC(this,"stroke","opacity",n.stroke.opacity,1),sC(this,"stroke","width",n.stroke.width,1),sC(this,"stroke","dasharray",n.stroke.dasharray,[]),this.point={},sC(this,"point","color",n.point.color),sC(this,"point","line",n.point.line),sC(this,"point","opacity",n.point.opacity,1),sC(this,"point","radius",n.point.radius,2),sC(this,"point","width",n.point.width,0),this.text={},sC(this,"text","field",n.text.field),sC(this,"text","zOrder",n.text.zOrder,"auto"),sC(this,"text","color",n.text.color,"#000000"),sC(this,"text","anchor",n.text.anchor,"center"),sC(this,"text","offset",n.text.offset,[0,0]),sC(this,"text","padding",n.text.padding,2),sC(this,"text","size",n.text.size,16),sC(this,"text","placement",n.text.placement,"point"),sC(this,"text","rotation",n.text.rotation,"auto"),sC(this,"text","wrap",n.text.wrap,10),sC(this,"text","spacing",n.text.spacing,0),sC(this,"text","transform",n.text.transform,"none"),sC(this,"text","justify",n.text.justify,"center"),sC(this,"text","opacity",n.text.opacity,1),sC(this,"text","font",n.text.font,["Open Sans Regular","Arial Unicode MS Regular","sans-serif"]),sC(this,"text","haloColor",n.text.haloColor,"#000000"),sC(this,"text","haloWidth",n.text.haloWidth,0),sC(this,"text","haloBlur",n.text.haloBlur,0)}return A(e,[{key:"drawingStylefromContext",value:function(e){var t={};if((this.fill.color||this.fill.pattern)&&nC("fill",this,t,e),this.stroke.color&&nC("stroke",this,t,e),this.point.color&&nC("point",this,t,e),Object.keys(t).length)return t}},{key:"symbolStylefromContext",value:function(t){var n=new e;return nC("text",this,n,t),this.icon&&nC("icon",this,n,t),n}},{key:"copy",value:function(e){return Object.assign(this.fill,e.fill),Object.assign(this.stroke,e.stroke),Object.assign(this.point,e.point),Object.assign(this.text,e.text),this}},{key:"clone",value:function(){var t=new e;return t.copy(this)}},{key:"setFromGeojsonProperties",value:function(e,t){return t===pC.POINT?(this.point.color=e.fill,this.point.opacity=e["fill-opacity"],this.point.line=e.stroke,this.point.radius=e.radius,this.text.color=e["label-color"],this.text.opacity=e["label-opacity"],this.text.size=e["label-size"],e.icon&&(this.icon={image:e.icon,size:1})):(this.stroke.color=e.stroke,this.stroke.width=e["stroke-width"],this.stroke.opacity=e["stroke-opacity"],t!==pC.LINE&&(this.fill.color=e.fill,this.fill.opacity=e["fill-opacity"])),this}},{key:"setFromVectorTileLayer",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e.layout=e.layout||{},e.paint=e.paint||{},this.order=n,"fill"!==e.type||this.fill.color)if("line"!==e.type||this.stroke.color){if("circle"===e.type||i){var r=iC(void e.paint["circle-color"]),a=r.color,o=r.opacity;this.point.color=a,this.point.opacity=o,this.point.radius=void e.paint["circle-radius"]}else if("symbol"===e.type){this.text.zOrder=void e.layout["symbol-z-order"],"auto"==this.text.zOrder?this.text.zOrder=void e.layout["symbol-sort-key"]||"Y":"viewport-y"==this.text.zOrder?this.text.zOrder="Y":"source"==this.text.zOrder&&(this.text.zOrder=0),this.text.anchor=void e.layout["text-anchor"],this.text.offset=void e.layout["text-offset"],this.text.padding=void e.layout["text-padding"],this.text.size=void e.layout["text-size"],this.text.placement=void e.layout["symbol-placement"],this.text.rotation=void e.layout["text-rotation-alignment"],this.text.field=void e.layout["text-field"],this.text.wrap=void e.layout["text-max-width"],this.text.spacing=void e.layout["text-letter-spacing"],this.text.transform=void e.layout["text-transform"],this.text.justify=void e.layout["text-justify"];var s=iC(void e.paint["text-color"]),l=s.color,A=s.opacity;this.text.color=l,this.text.opacity=void e.paint["text-opacity"]||void 0!==A&&A,this.text.font=void e.layout["text-font"];var c=void e.paint["text-halo-color"];c&&(this.text.haloColor=c.color||c,this.text.haloWidth=void e.paint["text-halo-width"],this.text.haloBlur=void e.paint["text-halo-blur"]);var h=void e.layout["icon-image"];h&&(this.icon={key:h},this.icon.size=void e.layout["icon-size"]||1)}}else{var u=void e.paint["line-color"],d=iC(u),f=d.color,p=d.opacity;this.stroke.dasharray=void e.paint["line-dasharray"],this.stroke.color=f,this.stroke.lineCap=e.layout["line-cap"],this.stroke.width=void e.paint["line-width"],this.stroke.opacity=void e.paint["line-opacity"]||p}else{var m=iC(void(e.paint["fill-color"]||e.paint["fill-pattern"])),v=m.color,g=m.opacity;if(this.fill.color=v,this.fill.opacity=void e.paint["fill-opacity"]||g,e.paint["fill-pattern"]&&t&&(this.fill.pattern=aC(t,e.paint["fill-pattern"])),e.paint["fill-outline-color"]){var y=iC(void e.paint["fill-outline-color"]),w=y.color,x=y.opacity;this.stroke.color=w,this.stroke.opacity=x,this.stroke.width=1,this.stroke.dasharray=[]}}return this}},{key:"applyToHTML",value:function(e,t){var n=this;if(e.style.padding="".concat(this.text.padding,"px"),e.style.maxWidth="".concat(this.text.wrap,"em"),e.style.color=this.text.color,this.text.size>0&&(e.style.fontSize="".concat(this.text.size,"px")),e.style.fontFamily=this.text.font.join(","),e.style.textTransform=this.text.transform,e.style.letterSpacing="".concat(this.text.spacing,"em"),e.style.textAlign=this.text.justify,e.style["white-space"]="pre-line",this.text.haloWidth>0&&(e.style.setProperty("--text_stroke_display","block"),e.style.setProperty("--text_stroke_width","".concat(this.text.haloWidth,"px")),e.style.setProperty("--text_stroke_color",this.text.haloColor),e.setAttribute("data-before",e.textContent)),this.icon){var i=this.icon.image,r=this.icon.size,a=this.icon.key,o=eC.get(i||a,r);o||((o=a&&t?aC(t,a):aC(i)).style.position="absolute",eC.set(o,i||a,r));var s=function t(){var i=o.cloneNode();switch(i.width*=r,i.height*=r,n.text.anchor){case"left":i.style.right="calc(100% - ".concat(.5*i.width,"px)"),i.style.top="calc(50% - ".concat(.5*i.height,"px)");break;case"right":i.style.top="calc(50% - ".concat(.5*i.height,"px)");break;case"top":i.style.right="calc(50% - ".concat(.5*i.width,"px)");break;case"bottom":i.style.top="calc(100% - ".concat(.5*i.height,"px)"),i.style.right="calc(50% - ".concat(.5*i.width,"px)");break;case"bottom-left":i.style.top="calc(100% - ".concat(.5*i.height,"px)"),i.style.right="calc(100% - ".concat(.5*i.width,"px)");break;case"bottom-right":i.style.top="calc(100% - ".concat(.5*i.height,"px)");break;case"top-left":i.style.right="calc(100% - ".concat(.5*i.width,"px)");break;case"top-right":break;default:i.style.top="calc(50% - ".concat(.5*i.height,"px)"),i.style.right="calc(50% - ".concat(.5*i.width,"px)")}i.style["z-index"]=-1,e.appendChild(i),o.removeEventListener("load",t)};o.complete?s():o.addEventListener("load",s)}}},{key:"getTextAnchorPosition",value:function(){return oC[this.text.anchor]}},{key:"getTextFromProperties",value:function(e){return this.text.field.expression?rC(this.text.field,e):this.text.field.replace(/\{(.+?)\}/g,(function(t,n){return e.properties()[n]||""})).trim()}}]),e}(),AC={itowns_stroke_single_before:".itowns-stroke-single:before {\n display: var(--text_stroke_display);\n content: attr(data-before);\n opacity: 1;\n position: absolute;\n -webkit-text-stroke-width: var(--text_stroke_width);\n -webkit-text-stroke-color: var(--text_stroke_color);\n left: 0;\n right: 0;\n bottom: 0;\n top: 0;\n z-index: -1;\n white-space: inherit;\n overflow-wrap: inherit;\n letter-spacing: inherit;\n text-align: inherit;\n padding: inherit;\n font-family: inherit;\n text-transform: inherit;\n max-width: inherit;\n font-size: inherit;\n}\n"},cC=document.createElement("style");cC.type="text/css",Object.keys(AC).forEach((function(e){cC.innerHTML+="".concat(AC[e],"\n\n")})),document.getElementsByTagName("head")[0].appendChild(cC);var hC=new lC;function uC(e){return new bb(e,1/0,-1/0,1/0,-1/0)}tC.fill=Object.keys(hC.fill),tC.stroke=Object.keys(hC.stroke),tC.point=Object.keys(hC.point),tC.text=Object.keys(hC.text),tC.icon=["image","size","key"];var dC=new ob("EPSG:4326",0,0,0),fC=new at(0,0,1),pC={POINT:0,LINE:1,POLYGON:2},mC=function(){function e(t){s(this,e),this.indices=[],this.properties={},this.size=t.size,t.extent&&(this.extent=uC(t.extent.crs),this._currentExtent=uC(t.extent.crs))}return A(e,[{key:"startSubGeometry",value:function(e,t){var n=this.indices.length-1,i=this.extent?uC(this.extent.crs):void 0,r=n>-1?this.indices[n].offset+this.indices[n].count:t.vertices.length/this.size;this.indices.push({offset:r,count:e,extent:i}),this._currentExtent=i,function(e,t){e.vertices.length+=t*e.size,e.normals&&(e.normals.length=e.vertices.length)}(t,e)}},{key:"closeSubGeometry",value:function(e,t){var n=this.indices.length-1,i=n>-1?this.indices[n].offset+this.indices[n].count:t.vertices.length/this.size-e;this.indices.push({offset:i,count:e,extent:this._currentExtent}),this.extent&&(this.extent.union(this._currentExtent),this._currentExtent=uC(this.extent.crs))}},{key:"getLastSubGeometry",value:function(){var e=this.indices.length-1;return this.indices[e]}},{key:"pushCoordinates",value:function(e,t){e.as(t.crs,dC),t.normals&&dC.geodesicNormal.toArray(t.normals,t._pos),t._pushValues(dC.x,dC.y,dC.z),this._currentExtent&&this._currentExtent.expandByCoordinates(t.useCrsOut?dC:e)}},{key:"pushCoordinatesValues",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:fC;e.normals&&r.toArray(e.normals,e._pos),e._pushValues(t,n,i),this._currentExtent&&this._currentExtent.expandByValuesCoordinates(t,n,i)}},{key:"updateExtent",value:function(){if(this.extent){var e=this.indices[this.indices.length-1];e&&this.extent.union(e.extent)}}}]),e}();function vC(e,t){this.vertices[this._pos++]=e,this.vertices[this._pos++]=t}function gC(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.vertices[this._pos++]=e,this.vertices[this._pos++]=t,this.vertices[this._pos++]=n}var yC=function(){function e(t,n){if(s(this,e),!Object.keys(pC).find((function(e){return pC[e]===t})))throw new Error("Unsupported Feature type: ".concat(t));this.type=t,this.geometries=[],this.vertices=[],this.crs=n.crs,this.size=n.size,this.normals=3==n.size?[]:void 0,n.extent&&(this.extent=uC(n.extent.crs),this.useCrsOut=!n.forceExtentCrs),this._pos=0,this._pushValues=(3===this.size?gC:vC).bind(this),this.style=new lC({},n.style)}return A(e,[{key:"bindNewGeometry",value:function(){var e=new mC(this);return this.geometries.push(e),e}},{key:"updateExtent",value:function(e){this.extent&&this.extent.union(e.extent)}},{key:"geometryCount",get:function(){return this.geometries.length}}]),e}(),wC=function(){function e(t){s(this,e),this.isFeatureCollection=!0,this.crs=Jx.formatToEPSG(t.crs),this.features=[],this.mergeFeatures=void 0===t.mergeFeatures||t.mergeFeatures,this.extent=t.buildExtent?uC(t.forcedExtentCrs||this.crs):void 0,this.translation=new at,this.scale=new at(1,1,1),this.size="3d"==t.structure?3:2,this.filterExtent=t.filterExtent,this.overrideAltitudeInToZero=t.overrideAltitudeInToZero,this.style=t.style}return A(e,[{key:"updateExtent",value:function(e){if(this.extent){var t,n=S(e?[e]:this.features.map((function(e){return e.extent})));try{for(n.s();!(t=n.n()).done;){var i=t.value;this.extent.union(i)}}catch(e){n.e(e)}finally{n.f()}}}},{key:"removeEmptyFeature",value:function(){this.features=this.features.filter((function(e){return e.geometries.length}))}},{key:"pushFeature",value:function(e){this.features.push(e),this.updateExtent(e.extent)}},{key:"requestFeature",value:function(e,t){var n=this.features.find(t);if(n&&this.mergeFeatures)return n;var i=new yC(e,this);return this.features.push(i),i}},{key:"requestFeatureByType",value:function(e){return this.requestFeature(e,(function(t){return t.type===e}))}},{key:"requestFeatureById",value:function(e,t){return this.requestFeature(t,(function(t){return t.id===e}))}},{key:"newFeatureByReference",value:function(e){var t=new yC(e.type,this);return t.extent=e.extent,t.geometries=e.geometries,t.normals=e.normals,t.size=e.size,t.vertices=e.vertices,t._pos=e._pos,this.features.push(t),t}},{key:"transformCoordinates",value:function(e){return e.x=e.x/this.scale.x-this.translation.x,e.y=e.y/this.scale.y-this.translation.y,e.z=e.z/this.scale.z-this.translation.z,e}},{key:"setParentStyle",value:function(e){e&&this.features.forEach((function(t){t.style.parent=e}))}}]),e}(),xC=function(e){if(e.crsOut||e.crsIn){console.warn("Parsing options with crsIn and crsOut are deprecates, use { in, out } structure.");var t={in:{},out:{}};return t.in.crs=e.crsIn,t.in.isInverted=e.isInverted,t.in.styles=e.styles,t.in.layers=e.layers,t.in.filter=e.filter,t.out.crs=e.crsOut,t.out.mergeFeatures=e.mergeFeatures,t.out.withNormal=e.withNormal,t.out.withAltitude=e.withAltitude,e.out.withAltitude&&e.out.withNormal?t.structure="3d":t.structure="2d",t.out.filteringExtent=e.filteringExtent,t.out.style=e.style,t.out.overrideAltitudeInToZero=e.overrideAltitudeInToZero,t.out.filter=e.filter,t}return!e.out||void 0===e.out.withAltitude&&void 0===e.out.withNormal||(console.warn("Parsing options out.withAltitude and out.withNormal are deprecates, use out.structure: 2d or 3d."),e.out.withAltitude&&e.out.withNormal?e.structure="3d":e.structure="2d"),e};function bC(e){if(e.crs){if("epsg"==e.crs.type.toLowerCase())return"EPSG:".concat(e.crs.properties.code);if("name"==e.crs.type.toLowerCase()){var t=e.crs.properties.name.toLowerCase().indexOf("epsg:");if(t>=0){var n=e.crs.properties.name.indexOf(":",t+5);if(n>0)return"EPSG:".concat(e.crs.properties.name.substr(n+1))}}throw new Error("Unsupported CRS type '".concat(e.crs,"'"))}return"EPSG:4326"}var MC=new ob("EPSG:4978",0,0,0),CC=function(e,t,n){return MC.crs=n,MC.setFromArray(t[0]),!e.isPointInside(MC)},BC={populateGeometry:function(e,t,n,i,r){n.startSubGeometry(t.length,r);var a,o=!i.overrideAltitudeInToZero&&3==i.size&&"number"==typeof t[0][2],s=S(t);try{for(s.s();!(a=s.n()).done;){var l=a.value;MC.crs=e,MC.setFromValues(l[0],l[1],o?l[2]:0),n.pushCoordinates(MC,r)}}catch(e){s.e(e)}finally{s.f()}n.updateExtent()},point:function(e,t,n,i,r){this.default(e,t,[n],i,r)},default:function(e,t,n,i,r){if(!i.filterExtent||!CC(i.filterExtent,n,t)){var a=e.bindNewGeometry();a.properties=r,a.properties.style=new lC({},e.style).setFromGeojsonProperties(r,e.type),this.populateGeometry(t,n,a,i,e),e.updateExtent(a)}},polygon:function(e,t,n,i,r){if(!i.filterExtent||!CC(i.filterExtent,n[0],t)){var a=e.bindNewGeometry();a.properties=r,a.properties.style=new lC({},e.style).setFromGeojsonProperties(r,e.type);for(var o=0;o<n.length;o++)this.populateGeometry(t,n[o],a,i,e);e.updateExtent(a)}},multi:function(e,t,n,i,r,a){var o,s=S(i);try{for(s.s();!(o=s.n()).done;){var l=o.value;this[e](t,n,l,r,a)}}catch(e){s.e(e)}finally{s.f()}}};var EC=["type","geometry","properties"];function SC(e,t,n){for(var i=t.geometry.type.toLowerCase(),r=function(e){switch(e){case"point":case"multipoint":return pC.POINT;case"linestring":case"multilinestring":return pC.LINE;case"polygon":case"multipolygon":return pC.POLYGON;default:throw new Error("Unhandled geometry type ".concat(e))}}(i),a=n.requestFeatureByType(r),o="point"!=i?t.geometry.coordinates:[t.geometry.coordinates],s=t.properties||{},l=0,A=Object.keys(t);l<A.length;l++){var c=A[l];EC.includes(c.toLowerCase())||(s.geojson=s.geojson||{},s.geojson[c]=t[c])}return function(e,t,n,i,r,a){if(0!=i.length)switch(e){case"point":case"linestring":return BC.default(t,n,i,r,a);case"multipoint":return BC.multi("point",t,n,i,r,a);case"multilinestring":return BC.multi("default",t,n,i,r,a);case"polygon":return BC.polygon(t,n,i,r,a);case"multipolygon":return BC.multi("polygon",t,n,i,r,a);default:throw new Error("Unhandled geojson type ".concat(t.type))}}(i,a,e,o,n,s),a}function TC(e,t,n){var i,r=new wC(n),a=n.filter||function(){return!0},o=S(t);try{for(o.s();!(i=o.n()).done;){var s=i.value;a(s.properties,s.geometry)&&SC(e,s,r)}}catch(e){o.e(e)}finally{o.f()}return r.removeEmptyFeature(),r.updateExtent(),r}var _C={parse:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(t=xC(t)).in=t.in||{};var n=t.out,i=t.in;switch("string"==typeof e&&(e=JSON.parse(e)),i.crs=i.crs||bC(e),n.filteringExtent&&("boolean"==typeof n.filteringExtent?n.filterExtent=e.extent.as(i.crs):n.filteringExtent.isExtent&&(n.filterExtent=n.filteringExtent)),e.type.toLowerCase()){case"featurecollection":return Promise.resolve(TC(i.crs,e.features,n));case"feature":return Promise.resolve(TC(i.crs,[e],n));default:throw new Error("Unsupported GeoJSON type: '".concat(e.type))}}};function IC(e,t){return Array.from(e.getElementsByTagName(t))}function LC(e){return"#"===e[0]?e:`#${e}`}function FC(e){return e?.normalize(),e&&e.textContent||""}function kC(e,t,n){const i=e.getElementsByTagName(t),r=i.length?i[0]:null;return r&&n&&n(r),r}function PC(e,t,n){const i={};if(!e)return i;const r=e.getElementsByTagName(t),a=r.length?r[0]:null;return a&&n?n(a,i):i}function UC(e,t,n){const i=FC(kC(e,t));return i&&n&&n(i)||{}}function DC(e,t,n){const i=parseFloat(FC(kC(e,t)));if(!isNaN(i))return i&&n&&n(i)||{}}function RC(e,t,n){const i=parseFloat(FC(kC(e,t)));if(!isNaN(i))return i&&n&&n(i),i}function OC(e,t){const n={};for(const i of t)UC(e,i,(e=>{n[i]=e}));return n}function NC(e){return 1===e?.nodeType}function zC(e){return PC(e,"line",(e=>{const t=Object.assign({},UC(e,"color",(e=>({stroke:`#${e}`}))),DC(e,"opacity",(e=>({"stroke-opacity":e}))),DC(e,"width",(e=>({"stroke-width":96*e/25.4}))));return t}))}function QC(e){let t=[];if(null===e)return t;for(const n of Array.from(e.childNodes)){if(!NC(n))continue;const e=GC(n.nodeName);if("gpxtpx:TrackPointExtension"===e)t=t.concat(QC(n));else{const i=FC(n);t.push([e,HC(i)])}}return t}function GC(e){return["heart","gpxtpx:hr","hr"].includes(e)?"heart":e}function HC(e){const t=parseFloat(e);return isNaN(t)?e:t}function VC(e){const t=[parseFloat(e.getAttribute("lon")||""),parseFloat(e.getAttribute("lat")||"")];if(isNaN(t[0])||isNaN(t[1]))return null;RC(e,"ele",(e=>{t.push(e)}));const n=kC(e,"time");return{coordinates:t,time:n?FC(n):null,extendedValues:QC(kC(e,"extensions"))}}function jC(e){const t=OC(e,["name","cmt","desc","type","time","keywords"]),n=Array.from(e.getElementsByTagNameNS("http://www.garmin.com/xmlschemas/GpxExtensions/v3","*"));for(const i of n)i.parentNode?.parentNode===e&&(t[i.tagName.replace(":","_")]=FC(i));const i=IC(e,"link");return i.length&&(t.links=i.map((e=>Object.assign({href:e.getAttribute("href")},OC(e,["text","type"]))))),t}function WC(e,t){const n=IC(e,t),i=[],r=[],a={};for(let e=0;e<n.length;e++){const t=VC(n[e]);if(t){i.push(t.coordinates),t.time&&r.push(t.time);for(const[i,r]of t.extendedValues){const t="heart"===i?i:i.replace("gpxtpx:","")+"s";a[t]||(a[t]=Array(n.length).fill(null)),a[t][e]=r}}}if(!(i.length<2))return{line:i,times:r,extendedValues:a}}function XC(e){const t=WC(e,"rtept");if(t)return{type:"Feature",properties:Object.assign({_gpxType:"rte"},jC(e),zC(kC(e,"extensions"))),geometry:{type:"LineString",coordinates:t.line}}}function YC(e){const t=IC(e,"trkseg"),n=[],i=[],r=[];for(const e of t){const t=WC(e,"trkpt");t&&(r.push(t),t.times&&t.times.length&&i.push(t.times))}if(0===r.length)return null;const a=r.length>1,o=Object.assign({_gpxType:"trk"},jC(e),zC(kC(e,"extensions")),i.length?{coordinateProperties:{times:a?i:i[0]}}:{});for(const e of r){n.push(e.line),o.coordinateProperties||(o.coordinateProperties={});const t=o.coordinateProperties,i=Object.entries(e.extendedValues);for(let e=0;e<i.length;e++){const[n,o]=i[e];a?(t[n]||(t[n]=r.map((e=>new Array(e.line.length).fill(null)))),t[n][e]=o):t[n]=o}}return{type:"Feature",properties:o,geometry:a?{type:"MultiLineString",coordinates:n}:{type:"LineString",coordinates:n[0]}}}function KC(e){const t=Object.assign(jC(e),OC(e,["sym"])),n=VC(e);return n?{type:"Feature",properties:t,geometry:{type:"Point",coordinates:n.coordinates}}:null}function*ZC(e){for(const t of IC(e,"trk")){const e=YC(t);e&&(yield e)}for(const t of IC(e,"rte")){const e=XC(t);e&&(yield e)}for(const t of IC(e,"wpt")){const e=KC(t);e&&(yield e)}}function JC(e,t){const n={},i="stroke"==t||"fill"===t?t:t+"-color";return"#"===e[0]&&(e=e.substring(1)),6===e.length||3===e.length?n[i]="#"+e:8===e.length&&(n[t+"-opacity"]=parseInt(e.substring(0,2),16)/255,n[i]="#"+e.substring(6,8)+e.substring(4,6)+e.substring(2,4)),n}function qC(e,t,n){const i={};return RC(e,t,(e=>{i[n]=e})),i}function $C(e,t){return PC(e,"color",(e=>JC(FC(e),t)))}function eB(e){return Object.assign({},function(e){return PC(e,"PolyStyle",((e,t)=>Object.assign(t,PC(e,"color",(e=>JC(FC(e),"fill"))),UC(e,"fill",(e=>{if("0"===e)return{"fill-opacity":0}})),UC(e,"outline",(e=>{if("0"===e)return{"stroke-opacity":0}})))))}(e),function(e){return PC(e,"LineStyle",(e=>Object.assign($C(e,"stroke"),qC(e,"width","stroke-width"))))}(e),function(e){return PC(e,"LabelStyle",(e=>Object.assign($C(e,"label"),qC(e,"scale","label-scale"))))}(e),function(e){return PC(e,"IconStyle",(e=>Object.assign($C(e,"icon"),qC(e,"scale","icon-scale"),qC(e,"heading","icon-heading"),PC(e,"hotSpot",(e=>{const t=parseFloat(e.getAttribute("x")||""),n=parseFloat(e.getAttribute("y")||""),i=e.getAttribute("xunits")||"",r=e.getAttribute("yunits")||"";return isNaN(t)||isNaN(n)?{}:{"icon-offset":[t,n],"icon-offset-units":[i,r]}})),PC(e,"Icon",((e,t)=>(UC(e,"href",(e=>{t.icon=e})),t))))))}(e))}const tB=/\s*/g,nB=/^\s*|\s*$/g,iB=/\s+/;function rB(e){return e.replace(tB,"").split(",").map(parseFloat).filter((e=>!isNaN(e))).slice(0,3)}function aB(e){return e.replace(nB,"").split(iB).map(rB).filter((e=>e.length>=2))}function oB(e){let t=IC(e,"coord");var n,i,r;0===t.length&&(n=e,i="coord",r="*",t=Array.from(n.getElementsByTagNameNS(r,i)));const a=t.map((e=>FC(e).split(" ").map(parseFloat)));return 0===a.length?null:{geometry:a.length>2?{type:"LineString",coordinates:a}:{type:"Point",coordinates:a[0]},times:IC(e,"when").map((e=>FC(e)))}}function sB(e){if(0===e.length)return e;const t=e[0],n=e[e.length-1];let i=!0;for(let e=0;e<Math.max(t.length,n.length);e++)if(t[e]!==n[e]){i=!1;break}return i?e:e.concat([e[0]])}const lB=["Polygon","LineString","Point","Track","gx:Track"];function AB(e){return FC(kC(e,"coordinates"))}function cB(e){const t=[],n=[];for(const t of["MultiGeometry","MultiTrack","gx:MultiTrack"]){const n=kC(e,t);if(n)return cB(n)}for(const i of lB)for(const r of IC(e,i))switch(i){case"Point":{const e=rB(AB(r));e.length>=2&&t.push({type:"Point",coordinates:e});break}case"LineString":{const e=aB(AB(r));e.length>=2&&t.push({type:"LineString",coordinates:e});break}case"Polygon":{const e=[];for(const t of IC(r,"LinearRing")){const n=sB(aB(AB(t)));n.length>=4&&e.push(n)}e.length&&t.push({type:"Polygon",coordinates:e});break}case"Track":case"gx:Track":{const e=oB(r);if(!e)break;const{times:i,geometry:a}=e;t.push(a),i.length&&n.push(i);break}}return{geometries:t,coordTimes:n}}function hB(e){return PC(e,"ExtendedData",((e,t)=>{for(const n of IC(e,"Data"))t[n.getAttribute("name")||""]=FC(kC(n,"value"));for(const n of IC(e,"SimpleData"))t[n.getAttribute("name")||""]=FC(n);return t}))}function uB(e){return 0===e.length?null:1===e.length?e[0]:{type:"GeometryCollection",geometries:e}}function dB(e){return PC(e,"TimeSpan",(e=>({timespan:{begin:FC(kC(e,"begin")),end:FC(kC(e,"end"))}})))}function fB(e){return PC(e,"TimeStamp",(e=>({timestamp:FC(kC(e,"when"))})))}function pB(e,t){return UC(e,"styleUrl",(e=>(e=LC(e),t[e]?Object.assign({styleUrl:e},t[e]):{styleUrl:e})))}function mB(e){const t=kC(e,"description");for(const e of Array.from(t?.childNodes||[]))if(4===e.nodeType)return{description:{"@type":"html",value:FC(e)}};return{}}function vB(e,t){const{coordTimes:n,geometries:i}=cB(e),r={type:"Feature",geometry:uB(i),properties:Object.assign(OC(e,["name","address","visibility","open","phoneNumber","description"]),mB(e),pB(e,t),eB(e),hB(e),dB(e),fB(e),n.length?{coordinateProperties:{times:1===n.length?n[0]:n}}:{})};void 0!==r.properties?.visibility&&(r.properties.visibility="0"!==r.properties.visibility);const a=e.getAttribute("id");return null!==a&&""!==a&&(r.id=a),r}function gB(e){let t=e.getAttribute("id");const n=e.parentNode;return!t&&NC(n)&&"CascadingStyle"===n.localName&&(t=n.getAttribute("kml:id")||n.getAttribute("id")),LC(t||"")}function*yB(e){const t=function(e){const t={};for(const n of IC(e,"Style"))t[gB(n)]=eB(n);for(const n of IC(e,"StyleMap")){const e=LC(n.getAttribute("id")||"");UC(n,"styleUrl",(n=>{n=LC(n),t[n]&&(t[e]=t[n])}))}return t}(e);for(const n of IC(e,"Placemark")){const e=vB(n,t);e&&(yield e)}}var wB={parse:function(e,t){return t=xC(t),_C.parse((n=e,{type:"FeatureCollection",features:Array.from(yB(n))}),t);var n}},xB={parse:function(e,t){return t=xC(t),_C.parse((n=e,{type:"FeatureCollection",features:Array.from(ZC(n))}),t);var n}},bB=function(e,t,n,i,r){var a,o,s=8*r-i-1,l=(1<<s)-1,A=l>>1,c=-7,h=n?r-1:0,u=n?-1:1,d=e[t+h];for(h+=u,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+e[t+h],h+=u,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=i;c>0;o=256*o+e[t+h],h+=u,c-=8);if(0===a)a=1-A;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,i),a-=A}return(d?-1:1)*o*Math.pow(2,a-i)},MB=function(e,t,n,i,r,a){var o,s,l,A=8*a-r-1,c=(1<<A)-1,h=c>>1,u=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:a-1,f=i?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+h>=1?u/l:u*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=c?(s=0,o=c):o+h>=1?(s=(t*l-1)*Math.pow(2,r),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,r),o=0));r>=8;e[n+d]=255&s,d+=f,s/=256,r-=8);for(o=o<<r|s,A+=r;A>0;e[n+d]=255&o,d+=f,o/=256,A-=8);e[n+d-f]|=128*p},CB=BB;function BB(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}BB.Varint=0,BB.Fixed64=1,BB.Bytes=2,BB.Fixed32=5;var EB=4294967296,SB=1/EB,TB="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function _B(e){return e.type===BB.Bytes?e.readVarint()+e.pos:e.pos+1}function IB(e,t,n){return n?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function LB(e,t,n){var i=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));n.realloc(i);for(var r=n.pos-1;r>=e;r--)n.buf[r+i]=n.buf[r]}function FB(e,t){for(var n=0;n<e.length;n++)t.writeVarint(e[n])}function kB(e,t){for(var n=0;n<e.length;n++)t.writeSVarint(e[n])}function PB(e,t){for(var n=0;n<e.length;n++)t.writeFloat(e[n])}function UB(e,t){for(var n=0;n<e.length;n++)t.writeDouble(e[n])}function DB(e,t){for(var n=0;n<e.length;n++)t.writeBoolean(e[n])}function RB(e,t){for(var n=0;n<e.length;n++)t.writeFixed32(e[n])}function OB(e,t){for(var n=0;n<e.length;n++)t.writeSFixed32(e[n])}function NB(e,t){for(var n=0;n<e.length;n++)t.writeFixed64(e[n])}function zB(e,t){for(var n=0;n<e.length;n++)t.writeSFixed64(e[n])}function QB(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function GB(e,t,n){e[n]=t,e[n+1]=t>>>8,e[n+2]=t>>>16,e[n+3]=t>>>24}function HB(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}BB.prototype={destroy:function(){this.buf=null},readFields:function(e,t,n){for(n=n||this.length;this.pos<n;){var i=this.readVarint(),r=i>>3,a=this.pos;this.type=7&i,e(r,t,this),this.pos===a&&this.skip(i)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=QB(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=HB(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=QB(this.buf,this.pos)+QB(this.buf,this.pos+4)*EB;return this.pos+=8,e},readSFixed64:function(){var e=QB(this.buf,this.pos)+HB(this.buf,this.pos+4)*EB;return this.pos+=8,e},readFloat:function(){var e=bB(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=bB(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,n,i=this.buf;return t=127&(n=i[this.pos++]),n<128?t:(t|=(127&(n=i[this.pos++]))<<7,n<128?t:(t|=(127&(n=i[this.pos++]))<<14,n<128?t:(t|=(127&(n=i[this.pos++]))<<21,n<128?t:function(e,t,n){var i,r,a=n.buf;if(r=a[n.pos++],i=(112&r)>>4,r<128)return IB(e,i,t);if(r=a[n.pos++],i|=(127&r)<<3,r<128)return IB(e,i,t);if(r=a[n.pos++],i|=(127&r)<<10,r<128)return IB(e,i,t);if(r=a[n.pos++],i|=(127&r)<<17,r<128)return IB(e,i,t);if(r=a[n.pos++],i|=(127&r)<<24,r<128)return IB(e,i,t);if(r=a[n.pos++],i|=(1&r)<<31,r<128)return IB(e,i,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(n=i[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&TB?function(e,t,n){return TB.decode(e.subarray(t,n))}(this.buf,t,e):function(e,t,n){var i="",r=t;for(;r<n;){var a,o,s,l=e[r],A=null,c=l>239?4:l>223?3:l>191?2:1;if(r+c>n)break;1===c?l<128&&(A=l):2===c?128==(192&(a=e[r+1]))&&(A=(31&l)<<6|63&a)<=127&&(A=null):3===c?(a=e[r+1],o=e[r+2],128==(192&a)&&128==(192&o)&&((A=(15&l)<<12|(63&a)<<6|63&o)<=2047||A>=55296&&A<=57343)&&(A=null)):4===c&&(a=e[r+1],o=e[r+2],s=e[r+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&((A=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||A>=1114112)&&(A=null)),null===A?(A=65533,c=1):A>65535&&(A-=65536,i+=String.fromCharCode(A>>>10&1023|55296),A=56320|1023&A),i+=String.fromCharCode(A),r+=c}return i}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==BB.Bytes)return e.push(this.readVarint(t));var n=_B(this);for(e=e||[];this.pos<n;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==BB.Bytes)return e.push(this.readSVarint());var t=_B(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==BB.Bytes)return e.push(this.readBoolean());var t=_B(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==BB.Bytes)return e.push(this.readFloat());var t=_B(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==BB.Bytes)return e.push(this.readDouble());var t=_B(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==BB.Bytes)return e.push(this.readFixed32());var t=_B(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==BB.Bytes)return e.push(this.readSFixed32());var t=_B(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==BB.Bytes)return e.push(this.readFixed64());var t=_B(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==BB.Bytes)return e.push(this.readSFixed64());var t=_B(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===BB.Varint)for(;this.buf[this.pos++]>127;);else if(t===BB.Bytes)this.pos=this.readVarint()+this.pos;else if(t===BB.Fixed32)this.pos+=4;else{if(t!==BB.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var n=new Uint8Array(t);n.set(this.buf),this.buf=n,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),GB(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),GB(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),GB(this.buf,-1&e,this.pos),GB(this.buf,Math.floor(e*SB),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),GB(this.buf,-1&e,this.pos),GB(this.buf,Math.floor(e*SB),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var n,i;e>=0?(n=e%4294967296|0,i=e/4294967296|0):(i=~(-e/4294967296),4294967295^(n=~(-e%4294967296))?n=n+1|0:(n=0,i=i+1|0));if(e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,n){n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos]=127&e}(n,0,t),function(e,t){var n=(7&e)<<4;if(t.buf[t.pos++]|=n|((e>>>=3)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;if(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),!e)return;t.buf[t.pos++]=127&e}(i,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,n){for(var i,r,a=0;a<t.length;a++){if((i=t.charCodeAt(a))>55295&&i<57344){if(!r){i>56319||a+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):r=i;continue}if(i<56320){e[n++]=239,e[n++]=191,e[n++]=189,r=i;continue}i=r-55296<<10|i-56320|65536,r=null}else r&&(e[n++]=239,e[n++]=191,e[n++]=189,r=null);i<128?e[n++]=i:(i<2048?e[n++]=i>>6|192:(i<65536?e[n++]=i>>12|224:(e[n++]=i>>18|240,e[n++]=i>>12&63|128),e[n++]=i>>6&63|128),e[n++]=63&i|128)}return n}(this.buf,e,this.pos);var n=this.pos-t;n>=128&&LB(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n},writeFloat:function(e){this.realloc(4),MB(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),MB(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var n=0;n<t;n++)this.buf[this.pos++]=e[n]},writeRawMessage:function(e,t){this.pos++;var n=this.pos;e(t,this);var i=this.pos-n;i>=128&&LB(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i},writeMessage:function(e,t,n){this.writeTag(e,BB.Bytes),this.writeRawMessage(t,n)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,FB,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,kB,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,DB,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,PB,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,UB,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,RB,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,OB,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,NB,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,zB,t)},writeBytesField:function(e,t){this.writeTag(e,BB.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,BB.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,BB.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,BB.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,BB.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,BB.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,BB.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,BB.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,BB.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,BB.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var VB=jB;function jB(e,t){this.x=e,this.y=t}jB.prototype={clone:function(){return new jB(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,n=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=n,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),n=Math.sin(e),i=t*this.x-n*this.y,r=n*this.x+t*this.y;return this.x=i,this.y=r,this},_rotateAround:function(e,t){var n=Math.cos(e),i=Math.sin(e),r=t.x+n*(this.x-t.x)-i*(this.y-t.y),a=t.y+i*(this.x-t.x)+n*(this.y-t.y);return this.x=r,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},jB.convert=function(e){return e instanceof jB?e:Array.isArray(e)?new jB(e[0],e[1]):e};var WB=XB;function XB(e,t,n,i,r){this.properties={},this.extent=n,this.type=0,this._pbf=e,this._geometry=-1,this._keys=i,this._values=r,e.readFields(YB,this,t)}function YB(e,t,n){1==e?t.id=n.readVarint():2==e?function(e,t){var n=e.readVarint()+e.pos;for(;e.pos<n;){var i=t._keys[e.readVarint()],r=t._values[e.readVarint()];t.properties[i]=r}}(n,t):3==e?t.type=n.readVarint():4==e&&(t._geometry=n.pos)}function KB(e){for(var t,n,i=0,r=0,a=e.length,o=a-1;r<a;o=r++)t=e[r],i+=((n=e[o]).x-t.x)*(t.y+n.y);return i}XB.types=["Unknown","Point","LineString","Polygon"],XB.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,n=e.readVarint()+e.pos,i=1,r=0,a=0,o=0,s=[];e.pos<n;){if(r<=0){var l=e.readVarint();i=7&l,r=l>>3}if(r--,1===i||2===i)a+=e.readSVarint(),o+=e.readSVarint(),1===i&&(t&&s.push(t),t=[]),t.push(new VB(a,o));else{if(7!==i)throw new Error("unknown command "+i);t&&t.push(t[0].clone())}}return t&&s.push(t),s},XB.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,n=1,i=0,r=0,a=0,o=1/0,s=-1/0,l=1/0,A=-1/0;e.pos<t;){if(i<=0){var c=e.readVarint();n=7&c,i=c>>3}if(i--,1===n||2===n)(r+=e.readSVarint())<o&&(o=r),r>s&&(s=r),(a+=e.readSVarint())<l&&(l=a),a>A&&(A=a);else if(7!==n)throw new Error("unknown command "+n)}return[o,l,s,A]},XB.prototype.toGeoJSON=function(e,t,n){var i,r,a=this.extent*Math.pow(2,n),o=this.extent*e,s=this.extent*t,l=this.loadGeometry(),A=XB.types[this.type];function c(e){for(var t=0;t<e.length;t++){var n=e[t],i=180-360*(n.y+s)/a;e[t]=[360*(n.x+o)/a-180,360/Math.PI*Math.atan(Math.exp(i*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(i=0;i<l.length;i++)h[i]=l[i][0];c(l=h);break;case 2:for(i=0;i<l.length;i++)c(l[i]);break;case 3:for(l=function(e){var t=e.length;if(t<=1)return[e];for(var n,i,r=[],a=0;a<t;a++){var o=KB(e[a]);0!==o&&(void 0===i&&(i=o<0),i===o<0?(n&&r.push(n),n=[e[a]]):n.push(e[a]))}n&&r.push(n);return r}(l),i=0;i<l.length;i++)for(r=0;r<l[i].length;r++)c(l[i][r])}1===l.length?l=l[0]:A="Multi"+A;var u={type:"Feature",geometry:{type:A,coordinates:l},properties:this.properties};return"id"in this&&(u.id=this.id),u};var ZB=JB;function JB(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(qB,this,t),this.length=this._features.length}function qB(e,t,n){15===e?t.version=n.readVarint():1===e?t.name=n.readString():5===e?t.extent=n.readVarint():2===e?t._features.push(n.pos):3===e?t._keys.push(n.readString()):4===e&&t._values.push(function(e){var t=null,n=e.readVarint()+e.pos;for(;e.pos<n;){var i=e.readVarint()>>3;t=1===i?e.readString():2===i?e.readFloat():3===i?e.readDouble():4===i?e.readVarint64():5===i?e.readVarint():6===i?e.readSVarint():7===i?e.readBoolean():null}return t}(n))}function $B(e,t,n){if(3===e){var i=new ZB(n,n.readVarint()+n.pos);i.length&&(t[i.name]=i)}}JB.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new WB(this._pbf,t,this.extent,this._keys,this._values)};var eE=function(e,t){this.layers=e.readFields($B,{},t)},tE=gb.get("EPSG:3857").dimensions(),nE=new at(tE.x,tE.y,1),iE=new tt,rE=new tt;function aE(e,t){t.out=t.out||{};var n=new eE(new CB(e)),i=Object.keys(n.layers);if(!(i.length<1)){var r=e.extent.col,a=e.extent.zoom,o=t.in.isInverted?e.extent.row:(1<<a)-e.extent.row-1;t.out.buildExtent=!0,t.out.mergeFeatures=!0,t.out.structure="2d";var s=new wC(t.out),l=n.layers[i[0]],A=l.extent*Math.pow(2,a),c=-.5*A;return s.scale.set(A,-A,1).divide(nE),s.translation.set(-(l.extent*r+c),-(l.extent*o+c),0).divide(s.scale),i.forEach((function(e){if(t.in.layers[e])for(var i=n.layers[e],r=function(n){var r,o=i.feature(n),l=t.in.layers[e].filter((function(e){return e.filterExpression.filter({zoom:a},o)&&a>=e.zoom.min&&a<e.zoom.max})),A=void 0,c=S(l);try{var h=function(){var e=r.value;A?s.features.find((function(t){return t.id===e.id}))||((A=s.newFeatureByReference(A)).id=e.id,A.order=e.order,A.style=t.in.styles[A.id]):((A=s.requestFeatureById(e.id,o.type-1)).id=e.id,A.order=e.order,A.style=t.in.styles[A.id],function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=t.bindNewGeometry();n=n&&t.type===pC.POLYGON,i.properties=e.properties;var r=e._pbf;r.pos=e._geometry;for(var a=r.readVarint()+r.pos,o=1,s=0,l=0,A=0,c=0,h=0;r.pos<a;){if(s<=0){var u=r.readVarint();o=7&u,s=u>>3}if(s--,1===o||2===o)l+=r.readSVarint(),A+=r.readSVarint(),1===o&&(c&&(n&&h>0&&i.indices.length>0&&(t.updateExtent(i),(i=t.bindNewGeometry()).properties=e.properties),i.closeSubGeometry(c,t),i.getLastSubGeometry().ccw=h<0),c=0,h=0),c++,i.pushCoordinatesValues(t,l,A),1==c?(rE.set(l,A),iE.set(l,A)):n&&c>1&&(h+=(iE.x-l)*(iE.y+A),iE.set(l,A));else{if(7!==o)throw new Error("unknown command ".concat(o));c&&(c++,i.pushCoordinatesValues(t,rE.x,rE.y),n&&(h+=(iE.x-rE.x)*(iE.y+rE.y)))}}c&&(n&&h>0&&i.indices.length>0&&(t.updateExtent(i),(i=t.bindNewGeometry()).properties=e.properties),i.closeSubGeometry(c,t),i.getLastSubGeometry().ccw=h<0),t.updateExtent(i)}(o,A))};for(c.s();!(r=c.n()).done;)h()}catch(e){c.e(e)}finally{c.f()}},o=i.length-1;o>=0;o--)r(o)})),s.removeEmptyFeature(),s.features.sort((function(e,t){return e.order-t.order})),s.updateExtent(),s.extent=e.extent,Promise.resolve(s)}}var oE={parse:function(e,t){return t=xC(t),Promise.resolve(aE(e,t))}},sE=new Map([["image/x-bil;bits=32",$M.textureFloat],["geojson",$M.json],["application/json",$M.json],["application/kml",$M.xml],["application/gpx",$M.xml],["application/x-protobuf;type=mapbox-vector",$M.arrayBuffer]]),lE=new Map([["geojson",_C.parse],["application/json",_C.parse],["application/kml",wB.parse],["application/gpx",xB.parse],["application/x-protobuf;type=mapbox-vector",oE.parse]]),AE={getByArray:function(){},setByArray:function(e){return e},clear:function(){}};var cE=0,hE=function(e){h(n,e);var t=y(n);function n(e){var i;if(s(this,n),(i=t.call(this,e)).isSource=!0,!e.url)throw new Error("New Source: url is required");return i.uid=cE++,i.url=e.url,i.format=e.format,i.fetcher=e.fetcher||sE.get(e.format)||$M.texture,i.parser=e.parser||lE.get(e.format)||function(e){return e},i.isVectorSource=null!=(e.parser||lE.get(e.format)),i.networkOptions=e.networkOptions||{crossOrigin:"anonymous"},i.attribution=e.attribution,i.whenReady=Promise.resolve(),i._featuresCaches={},e.extent&&!e.extent.isExtent?i.extent=new bb(i.crs,e.extent):i.extent=e.extent,i}return A(n,[{key:"handlingError",value:function(e){throw new Error(e)}},{key:"urlFromExtent",value:function(e){throw new Error("In extended Source, you have to implement the method urlFromExtent!")}},{key:"requestToKey",value:function(e){return[e.zoom,e.row,e.col]}},{key:"loadData",value:function(e,t){var n=this,i=this._featuresCaches[t.crs],r=this.requestToKey(e),a=i.getByArray(r);return a||(a=i.setByArray(function(e,t){var n=e.urlFromExtent(t);return e.fetcher(n,e.networkOptions).then((function(e){return e.extent=t,e}),(function(t){return e.handlingError(t)}))}(this,e).then((function(e){return n.parser(e,{out:t,in:n})}),(function(e){return n.handlingError(e)})),r),this.onParsedFile&&a.then((function(e){return n.onParsedFile(e),console.warn("Source.onParsedFile was deprecated"),e}))),a}},{key:"onLayerAdded",value:function(e){this._featuresCaches[e.out.crs]||(this._featuresCaches[e.out.crs]=this.isVectorSource?new XM:AE)}},{key:"onLayerRemoved",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this._featuresCaches[e.unusedCrs];t&&(t.clear(),delete this._featuresCaches[e.unusedCrs])}},{key:"extentInsideLimit",value:function(e){throw new Error("In extented Source, you have to implement the method extentInsideLimit!")}}]),n}(A((function e(t){s(this,e),t.projection&&(console.warn("Source projection parameter is deprecated, use crs instead."),t.crs=t.crs||t.projection),this.crs=t.crs}))),uE=function(e){h(n,e);var t=y(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(s(this,n),r.projection&&(console.warn("Layer projection parameter is deprecated, use crs instead."),r.crs=r.crs||r.projection),void 0===r.source||!0===r.source)throw new Error("Layer ".concat(e," needs Source"));return(i=t.call(this)).isLayer=!0,Object.assign(v(i),r),Object.defineProperty(v(i),"id",{value:e,writable:!1}),i.options=r.options||{},i.updateStrategy||(i.updateStrategy={type:0,options:{}}),i.defineLayerProperty("frozen",!1),r.zoom?(i.zoom={max:r.zoom.max,min:r.zoom.min||0},null==i.zoom.max&&(i.zoom.max=1/0)):i.zoom={max:1/0,min:0},i.info=new VM(v(i)),i.source=i.source||new hE({url:"none"}),i.ready=!1,i._promises=[],i.whenReady=new Promise((function(e,t){i._resolve=e,i._reject=t})).then((function(){return i.ready=!0,i.source.onLayerAdded({out:v(i)}),v(i)})),i._promises.push(i.source.whenReady),i.cache=new XM(r.cacheLifeTime),i.mergeFeatures=void 0===i.mergeFeatures||r.mergeFeatures,i.filter=i.filter||i.source.filter,i}return A(n,[{key:"addInitializationStep",value:function(){var e;return this._promises.push(new Promise((function(t){e=t}))),e}},{key:"defineLayerProperty",value:function(e,t,n){var i=this,r=Object.getOwnPropertyDescriptor(this,e);if(!r||!r.set){var a=null==this[e]?t:this[e];Object.defineProperty(this,e,{get:function(){return a},set:function(t){if(a!==t){var r={type:"".concat(e,"-property-changed"),previous:{},new:{}};r.previous[e]=a,r.new[e]=t,a=t,n&&n(i,e),i.dispatchEvent(r)}}})}}},{key:"convert",value:function(e){return e}},{key:"getData",value:function(e,t){var n=this,i=this.source.requestToKey(this.source.isVectorSource?t:e),r=this.cache.getByArray(i);return r||(r=this.source.loadData(e,this).then((function(e){return n.convert(e,t)}),(function(e){throw e})),this.cache.setByArray(r,i)),r}},{key:"isValidData",value:function(e){}},{key:"delete",value:function(){console.warn("Function delete doesn't exist for this layer")}}]),n}(Je),dE=function(e){var t=Array.from(e);return t.sort((function(e,t){return e.sequence-t.sequence})),t.map((function(e){return e.id}))},fE=function(){try{var e=document.createElement("canvas");return!(!window.WebGLRenderingContext||!e.getContext("webgl")&&!e.getContext("experimental-webgl"))}catch(e){return!1}},pE=function(){try{var e=document.createElement("canvas");return!(!window.WebGL2RenderingContext||!e.getContext("webgl2"))}catch(e){return!1}},mE=function(e){var t={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},n='Your $0 does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">$1</a>',i=document.createElement("div");return i.id="webglmessage",i.style.fontFamily="monospace",i.style.fontSize="13px",i.style.fontWeight="normal",i.style.textAlign="center",i.style.background="#fff",i.style.color="#000",i.style.padding="1.5em",i.style.width="400px",i.style.margin="5em auto 0",n=(n=t[e]?n.replace("$0","graphics card"):n.replace("$0","browser")).replace("$1",{1:"WebGL",2:"WebGL 2"}[e]),i.innerHTML=n,i};function vE(e,t){return!(e.left>t.right||e.right<t.left||e.top>t.bottom||e.bottom<t.top)}var gE=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:12,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;s(this,e),this.x=t,this.y=n,this.grid=[],this.hidden=[],this.visible=[],this.resize(),this.reset(),this.width=i,this.height=r}return A(e,[{key:"reset",value:function(){for(var e=0;e<this.x;e++)for(var t=0;t<this.y;t++)this.grid[e][t].splice(0,this.grid[e][t].length);this.hidden=[],this.visible=[]}},{key:"resize",value:function(){for(var e=0;e<this.x;e++){this.grid[e]||(this.grid[e]=[]);for(var t=0;t<this.y;t++)this.grid[e][t]||(this.grid[e][t]=[])}}},{key:"insert",value:function(e){for(var t=Math.max(0,Math.floor(e.boundaries.left/this.width*this.x)),n=Math.min(this.x-1,Math.floor(e.boundaries.right/this.width*this.x)),i=Math.max(0,Math.floor(e.boundaries.top/this.height*this.y)),r=Math.min(this.y-1,Math.floor(e.boundaries.bottom/this.height*this.y)),a=t;a<=n;a++)for(var o=i;o<=r;o++)if(this.grid[a][o].length>0&&this.grid[a][o].some((function(t){return vE(t.boundaries,e.boundaries)})))return this.hidden.push(e),!1;for(var s=t;s<=n;s++)for(var l=i;l<=r;l++)this.grid[s][l].push(e);return!0}}]),e}(),yE=new bt,wE=new at,xE=function(){function e(){s(this,e),this.domElement=document.createElement("div"),this.domElement.style.overflow="hidden",this.domElement.style.position="absolute",this.domElement.style.height="100%",this.domElement.style.width="100%",this.domElement.style.zIndex=1,this.garbage=document.createElement("div"),this.garbage.style.display="none",this.domElement.appendChild(this.garbage),this.halfWidth=0,this.halfHeight=0,this.grid=new gE,this.infoTileLayer=void 0}return A(e,[{key:"setSize",value:function(e,t){this.domElement.style.width="".concat(e),this.domElement.style.height="".concat(t),this.halfWidth=e/2,this.halfHeight=t/2,this.grid.width=e,this.grid.height=t,this.grid.x=Math.ceil(e/20),this.grid.y=Math.ceil(t/20),this.grid.resize()}},{key:"registerLayer",value:function(e){this.domElement.appendChild(e.domElement)}},{key:"render",value:function(e,t){var n=this;this.infoTileLayer&&this.infoTileLayer.layer.attachedLayers.find((function(e){return e.isLabelLayer&&e.visible}))&&(this.grid.reset(),yE.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this.culling(e,this.infoTileLayer.displayed.extent),this.grid.visible.sort((function(e,t){var n=t.order-e.order;return 0==n?!e.visible&&t.visible?1:-1:n})),this.grid.visible.forEach((function(e){n.grid.insert(e)&&(e.visible=!0,e.updateCSSPosition())})),this.grid.hidden.forEach((function(e){e.visible=!1})))}},{key:"culling",value:function(e,t){var n=this;if(e.isLabel)!t.isPointInside(e.coordinates)||function(e){var t=e.parent;return t.material&&!t.material.visible&&t.children.find((function(e){return e.isTileMesh&&e.children.find((function(e){return e.isLabel}))}))}(e)||e.parent.level<4&&e.parent.layer.horizonCulling&&e.parent.layer.horizonCulling(e.horizonCullingPoint)?this.grid.hidden.push(e):(wE.setFromMatrixPosition(e.matrixWorld),wE.applyMatrix4(yE),e.updateProjectedPosition(wE.x*this.halfWidth+this.halfWidth,-wE.y*this.halfHeight+this.halfHeight),this.grid.visible.some((function(t){return t.projectedPosition.x==e.projectedPosition.x&&t.projectedPosition.y==e.projectedPosition.y&&t.baseContent==e.baseContent}))?(e.parent.remove(e),this.grid.hidden.push(e)):this.grid.visible.push(e));else{if(!e.visible)return void this.hideNodeDOM(e);if(e.extent&&!e.extent.intersectsExtent(t))return void this.hideNodeDOM(e);this.showNodeDOM(e),e.children.forEach((function(e){return n.culling(e,t)}))}}},{key:"removeLabelDOM",value:function(e){this.garbage.appendChild(e.content),this.garbage.innerHTML=""}},{key:"hideNodeDOM",value:function(e){var t=this;if(e.domElements){var n=Object.values(e.domElements);n.length>0?n.forEach((function(e){1==e.visible&&(e.dom.style.display="none",e.visible=!1)})):e.children.filter((function(e){return e.isTileMesh})).forEach((function(e){return t.hideNodeDOM(e)}))}}},{key:"showNodeDOM",value:function(e){e.domElements&&Object.values(e.domElements).forEach((function(e){0==e.visible&&(e.dom.style.display="block",e.visible=!0)}))}}]),e}(),bE=new ut,ME=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e);var i=!oM();void 0===n.antialias&&(n.antialias=!0),void 0===n.alpha&&(n.alpha=!0),void 0===n.logarithmicDepthBuffer&&(n.logarithmicDepthBuffer=this.gLDebug||i),void 0===n.isWebGL2&&(n.isWebGL2=!0);var r=t.domElement?t:void 0,a=r?r.domElement:t;this.width=a.clientWidth,this.height=a.clientHeight,this.positionBuffer=null,this._nextThreejsLayer=1,this.fullSizeRenderTarget=new dt(this.width,this.height),this.fullSizeRenderTarget.texture.minFilter=Z,this.fullSizeRenderTarget.texture.magFilter=X,this.fullSizeRenderTarget.depthBuffer=!0,this.fullSizeRenderTarget.depthTexture=new ns,this.fullSizeRenderTarget.depthTexture.type=ee,this.renderView=function(e){this.renderer.clear(),this.renderer.render(e.scene,e.camera.camera3D),this.label2dRenderer.render(e.scene,e.camera.camera3D)}.bind(this),this.onWindowResize=function(e,t){this.width=e,this.height=t,this.fullSizeRenderTarget.setSize(this.width,this.height),this.renderer.setSize(this.width,this.height),this.label2dRenderer.setSize(this.width,this.height)}.bind(this);try{this.label2dRenderer=new xE,this.label2dRenderer.setSize(this.width,this.height),a.appendChild(this.label2dRenderer.domElement),this.renderer=r||new(n.isWebGL2,$a)({canvas:document.createElement("canvas"),antialias:n.antialias,alpha:n.alpha,logarithmicDepthBuffer:n.logarithmicDepthBuffer}),this.renderer.domElement.style.position="relative",this.renderer.domElement.style.zIndex=0,this.renderer.domElement.style.top=0}catch(e){var o=n.isWebGL2?"2":"1";console.error("Failed to create WebGLRenderer webGL ".concat(o,".")),this.renderer=null}if(!this.renderer)throw fE()?pE()||a.appendChild(mE(2)):a.appendChild(mE(1)),new Error("WebGL unsupported");!r&&n.logarithmicDepthBuffer&&(this.renderer.capabilities.isWebGL2||this.renderer.extensions.get("EXT_frag_depth")||(this.renderer.dispose(),this.renderer=new(n.isWebGL2,$a)({canvas:document.createElement("canvas"),antialias:n.antialias,alpha:n.alpha,logarithmicDepthBuffer:!1}))),-1===this.renderer.domElement.tabIndex&&(this.renderer.domElement.tabIndex=-1),lM(this.renderer),this.renderer.setClearColor(197896),this.renderer.sortObjects=!0,this.renderer.debug.checkShaderErrors=__DEBUG__,r||(this.renderer.setPixelRatio(a.devicePixelRatio),this.renderer.setSize(a.clientWidth,a.clientHeight),a.appendChild(this.renderer.domElement))}return A(e,[{key:"getWindowSize",value:function(){return new tt(this.width,this.height)}},{key:"getRenderer",value:function(){return this.renderer}},{key:"renderViewToBuffer",value:function(e,t){return t||(t={x:0,y:0,width:this.width,height:this.height}),t.buffer=t.buffer||new Uint8Array(4*t.width*t.height),this.renderViewToRenderTarget(e,this.fullSizeRenderTarget,t),this.renderer.readRenderTargetPixels(this.fullSizeRenderTarget,t.x,this.height-(t.y+t.height),t.width,t.height,t.buffer),t.buffer}},{key:"renderViewToRenderTarget",value:function(e,t,n){t||(t=this.fullSizeRenderTarget);var i=this.renderer.getRenderTarget();return n&&(this.fullSizeRenderTarget.scissor.set(n.x,t.height-(n.y+n.height),n.width,n.height),this.fullSizeRenderTarget.scissorTest=!0),this.renderer.setRenderTarget(t),this.renderer.clear(!0,!0,!1),this.renderer.render(e.scene,e.camera.camera3D),this.renderer.setRenderTarget(i),this.fullSizeRenderTarget.scissorTest=!1,t}},{key:"bufferToImage",value:function(e,t,n){var i=document.createElement("canvas"),r=i.getContext("2d");i.width=t,i.height=n;var a=r.getImageData(0,0,t,n);a.data.set(e),r.putImageData(a,0,0);var o=new Image;return o.src=i.toDataURL(),o}},{key:"getUniqueThreejsLayer",value:function(){return this._nextThreejsLayer>31&&(console.warn("Too much three.js layers. Starting from now all of them will use layerMask = 31"),this._nextThreejsLayer=31),this._nextThreejsLayer++}},{key:"depthBufferRGBAValueToOrthoZ",value:function(e,t){if(bE.fromArray(e).divideScalar(255),aM()&&"PerspectiveCamera"==t.type){var n=CM(bE),i=2/(Math.log(t.far+1)/Math.LN2);return Math.pow(2,2*n/i)}var r=CM(bE);return r=2*r-1}},{key:"onRender",value:function(){}}]),e}();function CE(e,t,n,i,r,a,o){if(t==pC.LINE&&function(e,t,n,i,r,a){for(var o=e.x,s=e.y,l=i+a,A=i;l<i+r;A=l,l+=a){var c=t[l],h=t[l+1],u=t[A],d=t[A+1],f=o-c,p=s-h,m=u-c,v=d-h,g=Math.sqrt(m*m+v*v),y=(f*m+p*v)/g;if(y>=-n&&y<=g+n&&Math.abs(v*o-m*s+u*h-d*c)/g<=n)return!0}return!1}(e,n,i,r,a,o))return!0;if(t==pC.POLYGON&&function(e,t,n,i,r){for(var a=e.x,o=e.y,s=!1,l=n,A=n+i-r;l<n+i;A=l,l+=r){var c=t[l],h=t[l+1],u=t[A],d=t[A+1];h>o!=d>o&&a<(u-c)*(o-h)/(d-h)+c&&(s=!s)}return s}(e,n,r,a,o))return!0;if(t==pC.POINT){var s=function(e,t,n,i,r,a){for(var o,s=e.x,l=e.y,A=n*n,c=i;c<i+r;c+=a){var h=s-t[c],u=l-t[c+1],d=h*h+u*u;d<A&&(o=[t[c],t[c+1]],A=d)}return o}(e,n,i,r,a,o);if(s)return{coordinates:s}}}function BE(e,t,n,i){var r,a=e.as(t.crs),o=S(t.geometries);try{for(o.s();!(r=o.n()).done;){var s=r.value;if(null==s.extent||s.extent.isPointInside(a,n)){var l=s.indices[0].offset*t.size,A=s.indices[0].count*t.size,c=CE(a,t.type,t.vertices,n,l,A,t.size);c&&i.push({type:t.type,geometry:s,coordinates:c.coordinates,style:t.style})}}}catch(e){o.e(e)}finally{o.f()}}var EE=new bb("EPSG:4326",0,0,0,0),SE=new ob("EPSG:4326",0,0,0),TE=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,i=[];if(SE.copy(e),t.extent){if(SE.as(Jx.formatToEPSG(t.extent.crs),SE),t.extent.as(SE.crs,EE),!EE.isPointInside(SE,n))return i;(t.isFeatureCollection&&1!=t.scale.x&&1!=t.scale.y||0!=t.translation.x&&0!=t.translation.y)&&(SE.x=(SE.x+t.translation.x)*t.scale.x,SE.y=(SE.y+t.translation.y)*t.scale.y,1!=t.scale.x&&1!=t.scale.y&&(n*=Math.sqrt(Math.pow(t.scale.x,2)+Math.pow(t.scale.y,2))))}if(t.isFeatureCollection){var r,a=S(t.features);try{for(a.s();!(r=a.n()).done;){var o=r.value;o.extent&&!o.extent.isPointInside(SE,n)||BE(SE,o,n,i)}}catch(e){a.e(e)}finally{a.f()}}else t.geometries&&BE(SE,t,n,i);return i},_E=new bb("EPSG:4326",[0,0,0,0]),IE=0;function LE(e){var t=/\$\{u:([\w-_.|]+)\}/.exec(e);if(!t)return e;var n=t[1].split("|");return e.replace(t[0],n[IE++%n.length])}var FE=function(e,t){return LE(t.url.replace(/(\$\{z\}|%TILEMATRIX)/,e.zoom).replace(/(\$\{y\}|%ROW)/,e.row).replace(/(\$\{x\}|%COL)/,e.col))},kE=function(e,t){var n="EPSG:4326"==t.crs?9:2;e.as(t.crs,_E);var i=_E.west.toFixed(n),r=_E.south.toFixed(n),a=_E.east.toFixed(n),o=_E.north.toFixed(n),s=t.axisOrder||"wsen";return s=s.replace("w","".concat(i,",")).replace("s","".concat(r,",")).replace("e","".concat(a,",")).replace("n","".concat(o,",")).slice(0,-1),LE(t.url.replace("%bbox",s))},PE=function(e){return LE(e)},UE={executeCommand:function(e){var t=e.layer,n=e.extentsSource,i=e.extentsDestination||n;return Promise.all(n.map((function(e,n){return t.getData(e,i[n])})))}},DE=function(){function e(t){s(this,e),this.command=t,this.isCancelledCommandException=!0}return A(e,[{key:"toString",value:function(){return"Cancelled command ".concat(this.command.requester.id,"/").concat(this.command.layer.id)}}]),e}(),RE={executeCommand:function(e){var t=[],n=e.layer,i=e.requester,r=e.extentsSource;if(i&&!i.material)return Promise.reject(new DE(e));for(var a=0,o=r.length;a<o;a++)t.push(n.convert(i,r[a]));return Promise.all(t)}},OE=function(){function e(e){Wl.call(this,e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(e){return new o(e)})),this.register((function(e){return new l(e)})),this.register((function(e){return new A(e)})),this.register((function(e){return new s(e)})),this.register((function(e){return new i(e)})),this.register((function(e){return new c(e)}))}function t(){var e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}e.prototype=Object.assign(Object.create(Wl.prototype),{constructor:e,load:function(e,t,n,i){var r,a=this;r=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:OA.extractUrlBase(e),this.manager.itemStart(e);var o=function(t){i?i(t):console.error(t),a.manager.itemError(e),a.manager.itemEnd(e)},s=new Kl(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(e,(function(n){try{a.parse(n,r,(function(n){t(n),a.manager.itemEnd(e)}),o)}catch(e){o(e)}}),n,o)},setDRACOLoader:function(e){return this.dracoLoader=e,this},setDDSLoader:function(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')},setKTX2Loader:function(e){return this.ktx2Loader=e,this},setMeshoptDecoder:function(e){return this.meshoptDecoder=e,this},register:function(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this},unregister:function(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this},parse:function(e,t,i,r){var o,s={},l={};if("string"==typeof e)o=e;else if(OA.decodeText(new Uint8Array(e,0,4))===h){try{s[n.KHR_BINARY_GLTF]=new f(e)}catch(e){return void(r&&r(e))}o=s[n.KHR_BINARY_GLTF].content}else o=OA.decodeText(new Uint8Array(e));var A=JSON.parse(o);if(void 0===A.asset||A.asset.version[0]<2)r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{var c=new H(A,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(var u=0;u<this.pluginCallbacks.length;u++){var d=this.pluginCallbacks[u](c);l[d.name]=d,s[d.name]=!0}if(A.extensionsUsed)for(u=0;u<A.extensionsUsed.length;++u){var v=A.extensionsUsed[u],w=A.extensionsRequired||[];switch(v){case n.KHR_MATERIALS_UNLIT:s[v]=new a;break;case n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:s[v]=new g;break;case n.KHR_DRACO_MESH_COMPRESSION:s[v]=new p(A,this.dracoLoader);break;case n.KHR_TEXTURE_TRANSFORM:s[v]=new m;break;case n.KHR_MESH_QUANTIZATION:s[v]=new y;break;default:w.indexOf(v)>=0&&void 0===l[v]&&console.warn('THREE.GLTFLoader: Unknown extension "'+v+'".')}}c.setExtensions(s),c.setPlugins(l),c.parse(i,r)}}});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"};function i(e){this.parser=e,this.name=n.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}function a(){this.name=n.KHR_MATERIALS_UNLIT}function o(e){this.parser=e,this.name=n.KHR_MATERIALS_CLEARCOAT}function s(e){this.parser=e,this.name=n.KHR_MATERIALS_TRANSMISSION}function l(e){this.parser=e,this.name=n.KHR_TEXTURE_BASISU}function A(e){this.parser=e,this.name=n.EXT_TEXTURE_WEBP,this.isSupported=null}function c(e){this.name=n.EXT_MESHOPT_COMPRESSION,this.parser=e}i.prototype._markDefs=function(){for(var e=this.parser,t=this.parser.json.nodes||[],n=0,i=t.length;n<i;n++){var r=t[n];r.extensions&&r.extensions[this.name]&&void 0!==r.extensions[this.name].light&&e._addNodeRef(this.cache,r.extensions[this.name].light)}},i.prototype._loadLight=function(e){var t=this.parser,n="light:"+e,i=t.cache.get(n);if(i)return i;var r,a=t.json,o=((a.extensions&&a.extensions[this.name]||{}).lights||[])[e],s=new Fn(16777215);void 0!==o.color&&s.fromArray(o.color);var l=void 0!==o.range?o.range:0;switch(o.type){case"directional":(r=new PA(s)).target.position.set(0,0,-1),r.add(r.target);break;case"point":(r=new LA(s)).distance=l;break;case"spot":(r=new _A(s)).distance=l,o.spot=o.spot||{},o.spot.innerConeAngle=void 0!==o.spot.innerConeAngle?o.spot.innerConeAngle:0,o.spot.outerConeAngle=void 0!==o.spot.outerConeAngle?o.spot.outerConeAngle:Math.PI/4,r.angle=o.spot.outerConeAngle,r.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,r.target.position.set(0,0,-1),r.add(r.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return r.position.set(0,0,0),r.decay=2,void 0!==o.intensity&&(r.intensity=o.intensity),r.name=t.createUniqueName(o.name||"light_"+e),i=Promise.resolve(r),t.cache.add(n,i),i},i.prototype.createNodeAttachment=function(e){var t=this,n=this.parser,i=n.json.nodes[e],r=(i.extensions&&i.extensions[this.name]||{}).light;return void 0===r?null:this._loadLight(r).then((function(e){return n._getNodeRef(t.cache,r,e)}))},a.prototype.getMaterialType=function(){return Nn},a.prototype.extendParams=function(e,t,n){var i=[];e.color=new Fn(1,1,1),e.opacity=1;var r=t.pbrMetallicRoughness;if(r){if(Array.isArray(r.baseColorFactor)){var a=r.baseColorFactor;e.color.fromArray(a),e.opacity=a[3]}void 0!==r.baseColorTexture&&i.push(n.assignTexture(e,"map",r.baseColorTexture))}return Promise.all(i)},o.prototype.getMaterialType=function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?yl:null},o.prototype.extendMaterialParams=function(e,t){var n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();var r=[],a=i.extensions[this.name];if(void 0!==a.clearcoatFactor&&(t.clearcoat=a.clearcoatFactor),void 0!==a.clearcoatTexture&&r.push(n.assignTexture(t,"clearcoatMap",a.clearcoatTexture)),void 0!==a.clearcoatRoughnessFactor&&(t.clearcoatRoughness=a.clearcoatRoughnessFactor),void 0!==a.clearcoatRoughnessTexture&&r.push(n.assignTexture(t,"clearcoatRoughnessMap",a.clearcoatRoughnessTexture)),void 0!==a.clearcoatNormalTexture&&(r.push(n.assignTexture(t,"clearcoatNormalMap",a.clearcoatNormalTexture)),void 0!==a.clearcoatNormalTexture.scale)){var o=a.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new tt(o,-o)}return Promise.all(r)},s.prototype.getMaterialType=function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?yl:null},s.prototype.extendMaterialParams=function(e,t){var n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();var r=[],a=i.extensions[this.name];return void 0!==a.transmissionFactor&&(t.transmission=a.transmissionFactor),void 0!==a.transmissionTexture&&r.push(n.assignTexture(t,"transmissionMap",a.transmissionTexture)),Promise.all(r)},l.prototype.loadTexture=function(e){var t=this.parser,n=t.json,i=n.textures[e];if(!i.extensions||!i.extensions[this.name])return null;var r=i.extensions[this.name],a=n.images[r.source],o=t.options.ktx2Loader;if(!o){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,a,o)},A.prototype.loadTexture=function(e){var t=this.name,n=this.parser,i=n.json,r=i.textures[e];if(!r.extensions||!r.extensions[t])return null;var a=r.extensions[t],o=i.images[a.source],s=n.textureLoader;if(o.uri){var l=n.options.manager.getHandler(o.uri);null!==l&&(s=l)}return this.detectSupport().then((function(r){if(r)return n.loadTextureImage(e,o,s);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)}))},A.prototype.detectSupport=function(){return this.isSupported||(this.isSupported=new Promise((function(e){var t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported},c.prototype.loadBufferView=function(e){var t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){var i=n.extensions[this.name],r=this.parser.getDependency("buffer",i.buffer),a=this.parser.options.meshoptDecoder;if(!a||!a.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([r,a.ready]).then((function(e){var t=i.byteOffset||0,n=i.byteLength||0,r=i.count,o=i.byteStride,s=new ArrayBuffer(r*o),l=new Uint8Array(e[0],t,n);return a.decodeGltfBuffer(new Uint8Array(s),r,o,l,i.mode,i.filter),s}))}return null};var h="glTF",u=1313821514,d=5130562;function f(e){this.name=n.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,12);if(this.header={magic:OA.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==h)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(e,12),a=0;a<i;){var o=r.getUint32(a,!0);a+=4;var s=r.getUint32(a,!0);if(a+=4,s===u){var l=new Uint8Array(e,12+a,o);this.content=OA.decodeText(l)}else if(s===d){var A=12+a;this.body=e.slice(A,A+o)}a+=o}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function p(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=n.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}function m(){this.name=n.KHR_TEXTURE_TRANSFORM}function v(e){gl.call(this),this.isGLTFSpecularGlossinessMaterial=!0;var t=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),n=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),i=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),r=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),a=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor;"].join("\n"),o={specular:{value:(new Fn).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=o,this.onBeforeCompile=function(e){for(var s in o)e.uniforms[s]=o[s];e.fragmentShader=e.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",t).replace("#include <metalnessmap_pars_fragment>",n).replace("#include <roughnessmap_fragment>",i).replace("#include <metalnessmap_fragment>",r).replace("#include <lights_physical_fragment>",a)},Object.defineProperties(this,{specular:{get:function(){return o.specular.value},set:function(e){o.specular.value=e}},specularMap:{get:function(){return o.specularMap.value},set:function(e){o.specularMap.value=e,e?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return o.glossiness.value},set:function(e){o.glossiness.value=e}},glossinessMap:{get:function(){return o.glossinessMap.value},set:function(e){o.glossinessMap.value=e,e?(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(e)}function g(){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 v},extendParams:function(e,t,n){var i=t.extensions[this.name];e.color=new Fn(1,1,1),e.opacity=1;var r=[];if(Array.isArray(i.diffuseFactor)){var a=i.diffuseFactor;e.color.fromArray(a),e.opacity=a[3]}if(void 0!==i.diffuseTexture&&r.push(n.assignTexture(e,"map",i.diffuseTexture)),e.emissive=new Fn(0,0,0),e.glossiness=void 0!==i.glossinessFactor?i.glossinessFactor:1,e.specular=new Fn(1,1,1),Array.isArray(i.specularFactor)&&e.specular.fromArray(i.specularFactor),void 0!==i.specularGlossinessTexture){var o=i.specularGlossinessTexture;r.push(n.assignTexture(e,"glossinessMap",o)),r.push(n.assignTexture(e,"specularMap",o))}return Promise.all(r)},createMaterial:function(e){var t=new v(e);return t.fog=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,t.normalMapType=0,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t}}}function y(){this.name=n.KHR_MESH_QUANTIZATION}function w(e,t,n,i){Il.call(this,e,t,n,i)}p.prototype.decodePrimitive=function(e,t){var n=this.json,i=this.dracoLoader,r=e.extensions[this.name].bufferView,a=e.extensions[this.name].attributes,o={},s={},l={};for(var A in a){var c=F[A]||A.toLowerCase();o[c]=a[A]}for(A in e.attributes){c=F[A]||A.toLowerCase();if(void 0!==a[A]){var h=n.accessors[e.attributes[A]],u=T[h.componentType];l[c]=u,s[c]=!0===h.normalized}}return t.getDependency("bufferView",r).then((function(e){return new Promise((function(t){i.decodeDracoFile(e,(function(e){for(var n in e.attributes){var i=e.attributes[n],r=s[n];void 0!==r&&(i.normalized=r)}t(e)}),o,l)}))}))},m.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},v.prototype=Object.create(gl.prototype),v.prototype.constructor=v,v.prototype.copy=function(e){return gl.prototype.copy.call(this,e),this.specularMap=e.specularMap,this.specular.copy(e.specular),this.glossinessMap=e.glossinessMap,this.glossiness=e.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},w.prototype=Object.create(Il.prototype),w.prototype.constructor=w,w.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i*3+i,a=0;a!==i;a++)t[a]=n[r+a];return t},w.prototype.beforeStart_=w.prototype.copySampleValue_,w.prototype.afterEnd_=w.prototype.copySampleValue_,w.prototype.interpolate_=function(e,t,n,i){for(var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=2*o,l=3*o,A=i-t,c=(n-t)/A,h=c*c,u=h*c,d=e*l,f=d-l,p=-2*u+3*h,m=u-h,v=1-p,g=m-h+c,y=0;y!==o;y++){var w=a[f+y+o],x=a[f+y+s]*A,b=a[d+y+o],M=a[d+y]*A;r[y]=v*w+g*x+p*b+m*M}return r};var x=0,b=1,M=2,C=3,B=4,E=5,S=6,T={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},_={9728:X,9729:Z,9984:Y,9985:J,9986:K,9987:q},I={33071:j,33648:W,10497:V},L={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},F={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex",_BATCHID:"_BATCHID"},k={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},P={CUBICSPLINE:void 0,LINEAR:ke,STEP:Fe},U="OPAQUE",D="MASK",R="BLEND";function O(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}function N(e,t,n){for(var i in n.extensions)void 0===e[i]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[i]=n.extensions[i])}function z(e,t){void 0!==t.extras&&("object"===r(t.extras)?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function Q(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var n=0,i=t.weights.length;n<i;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){var r=t.extras.targetNames;if(e.morphTargetInfluences.length===r.length){e.morphTargetDictionary={};for(n=0,i=r.length;n<i;n++)e.morphTargetDictionary[r[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function G(e){for(var t="",n=Object.keys(e).sort(),i=0,r=n.length;i<r;i++)t+=n[i]+":"+e[n[i]]+";";return t}function H(e,n){this.json=e||{},this.extensions={},this.plugins={},this.options=n||{},this.cache=new t,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.nodeNamesUsed={},"undefined"!=typeof createImageBitmap&&!1===/Firefox/.test(navigator.userAgent)?this.textureLoader=new YA(this.options.manager):this.textureLoader=new tA(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Kl(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}function $(e,t,n){var i=t.attributes,r=[];function a(t,i){return n.getDependency("accessor",t).then((function(t){e.setAttribute(i,t)}))}for(var o in i){var s=F[o]||o.toLowerCase();s in e.attributes||r.push(a(i[o],s))}if(void 0!==t.indices&&!e.index){var l=n.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));r.push(l)}return z(e,t),function(e,t,n){var i=t.attributes,r=new tn;if(void 0!==i.POSITION){var a=(u=n.json.accessors[i.POSITION]).min,o=u.max;if(void 0!==a&&void 0!==o){r.set(new at(a[0],a[1],a[2]),new at(o[0],o[1],o[2]));var s=t.targets;if(void 0!==s){for(var l=new at,A=new at,c=0,h=s.length;c<h;c++){var u,d=s[c];if(void 0!==d.POSITION)a=(u=n.json.accessors[d.POSITION]).min,o=u.max,void 0!==a&&void 0!==o?(A.setX(Math.max(Math.abs(a[0]),Math.abs(o[0]))),A.setY(Math.max(Math.abs(a[1]),Math.abs(o[1]))),A.setZ(Math.max(Math.abs(a[2]),Math.abs(o[2]))),l.max(A)):console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}r.expandByVector(l)}e.boundingBox=r;var f=new an;r.getCenter(f.center),f.radius=r.min.distanceTo(r.max)/2,e.boundingSphere=f}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}(e,t,n),Promise.all(r).then((function(){return void 0!==t.targets?function(e,t,n){for(var i=!1,r=!1,a=0,o=t.length;a<o&&(void 0!==(A=t[a]).POSITION&&(i=!0),void 0!==A.NORMAL&&(r=!0),!i||!r);a++);if(!i&&!r)return Promise.resolve(e);var s=[],l=[];for(a=0,o=t.length;a<o;a++){var A=t[a];if(i){var c=void 0!==A.POSITION?n.getDependency("accessor",A.POSITION):e.attributes.position;s.push(c)}r&&(c=void 0!==A.NORMAL?n.getDependency("accessor",A.NORMAL):e.attributes.normal,l.push(c))}return Promise.all([Promise.all(s),Promise.all(l)]).then((function(t){var n=t[0],a=t[1];return i&&(e.morphAttributes.position=n),r&&(e.morphAttributes.normal=a),e.morphTargetsRelative=!0,e}))}(e,t.targets,n):e}))}function ee(e,t){var n=e.getIndex();if(null===n){var i=[],r=e.getAttribute("position");if(void 0===r)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(var a=0;a<r.count;a++)i.push(a);e.setIndex(i),n=e.getIndex()}var o=n.count-2,s=[];if(2===t)for(a=1;a<=o;a++)s.push(n.getX(0)),s.push(n.getX(a)),s.push(n.getX(a+1));else for(a=0;a<o;a++)a%2==0?(s.push(n.getX(a)),s.push(n.getX(a+1)),s.push(n.getX(a+2))):(s.push(n.getX(a+2)),s.push(n.getX(a+1)),s.push(n.getX(a)));s.length/3!==o&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var l=e.clone();return l.setIndex(s),l}return H.prototype.setExtensions=function(e){this.extensions=e},H.prototype.setPlugins=function(e){this.plugins=e},H.prototype.parse=function(e,t){var n=this,i=this.json,r=this.extensions;this.cache.removeAll(),this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])})).then((function(t){var a={scene:t[0][i.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:i.asset,parser:n,userData:{}};N(r,a,i),z(a,i),Promise.all(n._invokeAll((function(e){return e.afterRoot&&e.afterRoot(a)}))).then((function(){e(a)}))})).catch(t)},H.prototype._markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[],i=0,r=t.length;i<r;i++)for(var a=t[i].joints,o=0,s=a.length;o<s;o++)e[a[o]].isBone=!0;for(var l=0,A=e.length;l<A;l++){var c=e[l];void 0!==c.mesh&&(this._addNodeRef(this.meshCache,c.mesh),void 0!==c.skin&&(n[c.mesh].isSkinnedMesh=!0)),void 0!==c.camera&&this._addNodeRef(this.cameraCache,c.camera)}},H.prototype._addNodeRef=function(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)},H.prototype._getNodeRef=function(e,t,n){if(e.refs[t]<=1)return n;var i=n.clone();return i.name+="_instance_"+e.uses[t]++,i},H.prototype._invokeOne=function(e){var t=Object.values(this.plugins);t.push(this);for(var n=0;n<t.length;n++){var i=e(t[n]);if(i)return i}},H.prototype._invokeAll=function(e){var t=Object.values(this.plugins);t.unshift(this);for(var n=[],i=0;i<t.length;i++){var r=e(t[i]);r&&n.push(r)}return n},H.prototype.getDependency=function(e,t){var n=e+":"+t,i=this.cache.get(n);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this.loadNode(t);break;case"mesh":i=this._invokeOne((function(e){return e.loadMesh&&e.loadMesh(t)}));break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne((function(e){return e.loadBufferView&&e.loadBufferView(t)}));break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne((function(e){return e.loadMaterial&&e.loadMaterial(t)}));break;case"texture":i=this._invokeOne((function(e){return e.loadTexture&&e.loadTexture(t)}));break;case"skin":i=this.loadSkin(t);break;case"animation":i=this.loadAnimation(t);break;case"camera":i=this.loadCamera(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(n,i)}return i},H.prototype.getDependencies=function(e){var t=this.cache.get(e);if(!t){var n=this,i=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(i.map((function(t,i){return n.getDependency(e,i)}))),this.cache.add(e,t)}return t},H.prototype.loadBuffer=function(e){var t=this.json.buffers[e],i=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[n.KHR_BINARY_GLTF].body);var r=this.options;return new Promise((function(e,n){i.load(O(t.uri,r.path),e,void 0,(function(){n(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))},H.prototype.loadBufferView=function(e){var t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){var n=t.byteLength||0,i=t.byteOffset||0;return e.slice(i,i+n)}))},H.prototype.loadAccessor=function(e){var t=this,n=this.json,i=this.json.accessors[e];if(void 0===i.bufferView&&void 0===i.sparse)return Promise.resolve(null);var r=[];return void 0!==i.bufferView?r.push(this.getDependency("bufferView",i.bufferView)):r.push(null),void 0!==i.sparse&&(r.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),r.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(r).then((function(e){var r,a=e[0],o=L[i.type],s=T[i.componentType],l=s.BYTES_PER_ELEMENT,A=l*o,c=i.byteOffset||0,h=void 0!==i.bufferView?n.bufferViews[i.bufferView].byteStride:void 0,u=!0===i.normalized;if(h&&h!==A){var d=Math.floor(c/h),f="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+d+":"+i.count,p=t.cache.get(f);p||(p=new no(new s(a,d*h,i.count*h/l),h/l),t.cache.add(f,p)),r=new io(p,o,c%h/l,u)}else r=new zn(null===a?new s(i.count*o):new s(a,c,i.count*o),o,u);if(void 0!==i.sparse){var m=L.SCALAR,v=T[i.sparse.indices.componentType],g=i.sparse.indices.byteOffset||0,y=i.sparse.values.byteOffset||0,w=new v(e[1],g,i.sparse.count*m),x=new s(e[2],y,i.sparse.count*o);null!==a&&(r=new zn(r.array.slice(),r.itemSize,r.normalized));for(var b=0,M=w.length;b<M;b++){var C=w[b];if(r.setX(C,x[b*o]),o>=2&&r.setY(C,x[b*o+1]),o>=3&&r.setZ(C,x[b*o+2]),o>=4&&r.setW(C,x[b*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return r}))},H.prototype.loadTexture=function(e){var t=this.json,n=this.options,i=t.textures[e],r=t.images[i.source],a=this.textureLoader;if(r.uri){var o=n.manager.getHandler(r.uri);null!==o&&(a=o)}return this.loadTextureImage(e,r,a)},H.prototype.loadTextureImage=function(e,t,n){var i=this,r=this.json,a=this.options,o=r.textures[e],s=self.URL||self.webkitURL,l=t.uri,A=!1,c=!0;if("image/jpeg"===t.mimeType&&(c=!1),void 0!==t.bufferView)l=i.getDependency("bufferView",t.bufferView).then((function(e){if("image/png"===t.mimeType){var n=new DataView(e,25,1).getUint8(0,!1);c=6===n||4===n||3===n}A=!0;var i=new Blob([e],{type:t.mimeType});return l=s.createObjectURL(i)}));else if(void 0===t.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");return Promise.resolve(l).then((function(e){return new Promise((function(t,i){var r=t;!0===n.isImageBitmapLoader&&(r=function(e){t(new ts(e))}),n.load(O(e,a.path),r,void 0,i)}))})).then((function(t){!0===A&&s.revokeObjectURL(l),t.flipY=!1,o.name&&(t.name=o.name),c||(t.format=Ae);var n=(r.samplers||{})[o.sampler]||{};return t.magFilter=_[n.magFilter]||Z,t.minFilter=_[n.minFilter]||q,t.wrapS=I[n.wrapS]||V,t.wrapT=I[n.wrapT]||V,i.associations.set(t,{type:"textures",index:e}),t}))},H.prototype.assignTexture=function(e,t,i){var r=this;return this.getDependency("texture",i.index).then((function(a){if(void 0===i.texCoord||0==i.texCoord||"aoMap"===t&&1==i.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+i.texCoord+" for texture "+t+" not yet supported."),r.extensions[n.KHR_TEXTURE_TRANSFORM]){var o=void 0!==i.extensions?i.extensions[n.KHR_TEXTURE_TRANSFORM]:void 0;if(o){var s=r.associations.get(a);a=r.extensions[n.KHR_TEXTURE_TRANSFORM].extendTexture(a,o),r.associations.set(a,s)}}e[t]=a}))},H.prototype.assignFinalMaterial=function(e){var t=e.geometry,n=e.material,i=void 0!==t.attributes.tangent,r=void 0!==t.attributes.color,a=void 0===t.attributes.normal,o=!0===e.isSkinnedMesh,s=Object.keys(t.morphAttributes).length>0,l=s&&void 0!==t.morphAttributes.normal;if(e.isPoints){var A="PointsMaterial:"+n.uuid,c=this.cache.get(A);c||(c=new Xo,On.prototype.copy.call(c,n),c.color.copy(n.color),c.map=n.map,c.sizeAttenuation=!1,this.cache.add(A,c)),n=c}else if(e.isLine){A="LineBasicMaterial:"+n.uuid;var h=this.cache.get(A);h||(h=new Do,On.prototype.copy.call(h,n),h.color.copy(n.color),this.cache.add(A,h)),n=h}if(i||r||a||o||s){A="ClonedMaterial:"+n.uuid+":";n.isGLTFSpecularGlossinessMaterial&&(A+="specular-glossiness:"),o&&(A+="skinning:"),i&&(A+="vertex-tangents:"),r&&(A+="vertex-colors:"),a&&(A+="flat-shading:"),s&&(A+="morph-targets:"),l&&(A+="morph-normals:");var u=this.cache.get(A);u||(u=n.clone(),o&&(u.skinning=!0),r&&(u.vertexColors=!0),a&&(u.flatShading=!0),s&&(u.morphTargets=!0),l&&(u.morphNormals=!0),i&&(u.vertexTangents=!0,u.normalScale&&(u.normalScale.y*=-1),u.clearcoatNormalScale&&(u.clearcoatNormalScale.y*=-1)),this.cache.add(A,u),this.associations.set(u,this.associations.get(n))),n=u}n.aoMap&&void 0===t.attributes.uv2&&void 0!==t.attributes.uv&&t.setAttribute("uv2",t.attributes.uv),e.material=n},H.prototype.getMaterialType=function(){return gl},H.prototype.loadMaterial=function(e){var t,i=this,r=this.json,a=this.extensions,o=r.materials[e],s={},l=o.extensions||{},A=[];if(l[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var c=a[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=c.getMaterialType(),A.push(c.extendParams(s,o,i))}else if(l[n.KHR_MATERIALS_UNLIT]){var h=a[n.KHR_MATERIALS_UNLIT];t=h.getMaterialType(),A.push(h.extendParams(s,o,i))}else{var u=o.pbrMetallicRoughness||{};if(s.color=new Fn(1,1,1),s.opacity=1,Array.isArray(u.baseColorFactor)){var d=u.baseColorFactor;s.color.fromArray(d),s.opacity=d[3]}void 0!==u.baseColorTexture&&A.push(i.assignTexture(s,"map",u.baseColorTexture)),s.metalness=void 0!==u.metallicFactor?u.metallicFactor:1,s.roughness=void 0!==u.roughnessFactor?u.roughnessFactor:1,void 0!==u.metallicRoughnessTexture&&(A.push(i.assignTexture(s,"metalnessMap",u.metallicRoughnessTexture)),A.push(i.assignTexture(s,"roughnessMap",u.metallicRoughnessTexture))),t=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),A.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,s)}))))}!0===o.doubleSided&&(s.side=2);var f=o.alphaMode||U;return f===R?(s.transparent=!0,s.depthWrite=!1):(s.transparent=!1,f===D&&(s.alphaTest=void 0!==o.alphaCutoff?o.alphaCutoff:.5)),void 0!==o.normalTexture&&t!==Nn&&(A.push(i.assignTexture(s,"normalMap",o.normalTexture)),s.normalScale=new tt(1,-1),void 0!==o.normalTexture.scale&&s.normalScale.set(o.normalTexture.scale,-o.normalTexture.scale)),void 0!==o.occlusionTexture&&t!==Nn&&(A.push(i.assignTexture(s,"aoMap",o.occlusionTexture)),void 0!==o.occlusionTexture.strength&&(s.aoMapIntensity=o.occlusionTexture.strength)),void 0!==o.emissiveFactor&&t!==Nn&&(s.emissive=(new Fn).fromArray(o.emissiveFactor)),void 0!==o.emissiveTexture&&t!==Nn&&A.push(i.assignTexture(s,"emissiveMap",o.emissiveTexture)),Promise.all(A).then((function(){var r;return r=t===v?a[n.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s):new t(s),o.name&&(r.name=o.name),r.map&&(r.map.encoding=Ne),r.emissiveMap&&(r.emissiveMap.encoding=Ne),z(r,o),i.associations.set(r,{type:"materials",index:e}),o.extensions&&N(a,r,o),r}))},H.prototype.createUniqueName=function(e){for(var t=kc.sanitizeNodeName(e||""),n=t,i=1;this.nodeNamesUsed[n];++i)n=t+"_"+i;return this.nodeNamesUsed[n]=!0,n},H.prototype.loadGeometries=function(e){var t=this,i=this.extensions,r=this.primitiveCache;function a(e){return i[n.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return $(n,e,t)}))}for(var o,s,l=[],A=0,c=e.length;A<c;A++){var h,u=e[A],d=(s=void 0,(s=(o=u).extensions&&o.extensions[n.KHR_DRACO_MESH_COMPRESSION])?"draco:"+s.bufferView+":"+s.indices+":"+G(s.attributes):o.indices+":"+G(o.attributes)+":"+o.mode),f=r[d];if(f)l.push(f.promise);else h=u.extensions&&u.extensions[n.KHR_DRACO_MESH_COMPRESSION]?a(u):$(new si,u,t),r[d]={primitive:u,promise:h},l.push(h)}return Promise.all(l)},H.prototype.loadMesh=function(e){for(var t,n=this,i=this.json,r=this.extensions,a=i.meshes[e],o=a.primitives,s=[],l=0,A=o.length;l<A;l++){var c=void 0===o[l].material?(void 0===(t=this.cache).DefaultMaterial&&(t.DefaultMaterial=new gl({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:0})),t.DefaultMaterial):this.getDependency("material",o[l].material);s.push(c)}return s.push(n.loadGeometries(o)),Promise.all(s).then((function(t){for(var i=t.slice(0,t.length-1),s=t[t.length-1],l=[],A=0,c=s.length;A<c;A++){var h,u=s[A],d=o[A],f=i[A];if(d.mode===B||d.mode===E||d.mode===S||void 0===d.mode)!0!==(h=!0===a.isSkinnedMesh?new Bo(u,f):new Ei(u,f)).isSkinnedMesh||h.geometry.attributes.skinWeight.normalized||h.normalizeSkinWeights(),d.mode===E?h.geometry=ee(h.geometry,1):d.mode===S&&(h.geometry=ee(h.geometry,2));else if(d.mode===b)h=new jo(u,f);else if(d.mode===C)h=new Go(u,f);else if(d.mode===M)h=new Wo(u,f);else{if(d.mode!==x)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+d.mode);h=new qo(u,f)}Object.keys(h.geometry.morphAttributes).length>0&&Q(h,a),h.name=n.createUniqueName(a.name||"mesh_"+e),z(h,a),d.extensions&&N(r,h,d),n.assignFinalMaterial(h),l.push(h)}if(1===l.length)return l[0];var p=new ja;for(A=0,c=l.length;A<c;A++)p.add(l[A]);return p}))},H.prototype.loadCamera=function(e){var t,n=this.json.cameras[e],i=n[n.type];if(i)return"perspective"===n.type?t=new Ni(Hh.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):"orthographic"===n.type&&(t=new FA(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),z(t,n),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")},H.prototype.loadSkin=function(e){var t=this.json.skins[e],n={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(n):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return n.inverseBindMatrices=e,n}))},H.prototype.loadAnimation=function(e){for(var t=this.json.animations[e],n=[],i=[],r=[],a=[],o=[],s=0,l=t.channels.length;s<l;s++){var A=t.channels[s],c=t.samplers[A.sampler],h=A.target,u=void 0!==h.node?h.node:h.id,d=void 0!==t.parameters?t.parameters[c.input]:c.input,f=void 0!==t.parameters?t.parameters[c.output]:c.output;n.push(this.getDependency("node",u)),i.push(this.getDependency("accessor",d)),r.push(this.getDependency("accessor",f)),a.push(c),o.push(h)}return Promise.all([Promise.all(n),Promise.all(i),Promise.all(r),Promise.all(a),Promise.all(o)]).then((function(n){for(var i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],l=[],A=0,c=i.length;A<c;A++){var h=i[A],u=r[A],d=a[A],f=o[A],p=s[A];if(void 0!==h){var m;switch(h.updateMatrix(),h.matrixAutoUpdate=!0,k[p.path]){case k.weights:m=Rl;break;case k.rotation:m=Nl;break;default:m=Ql}var v=h.name?h.name:h.uuid,g=void 0!==f.interpolation?P[f.interpolation]:ke,y=[];k[p.path]===k.weights?h.traverse((function(e){!0===e.isMesh&&e.morphTargetInfluences&&y.push(e.name?e.name:e.uuid)})):y.push(v);var x=d.array;if(d.normalized){var b;if(x.constructor===Int8Array)b=1/127;else if(x.constructor===Uint8Array)b=1/255;else if(x.constructor==Int16Array)b=1/32767;else{if(x.constructor!==Uint16Array)throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");b=1/65535}for(var M=new Float32Array(x.length),C=0,B=x.length;C<B;C++)M[C]=x[C]*b;x=M}for(C=0,B=y.length;C<B;C++){var E=new m(y[C]+"."+k[p.path],u.array,x,g);"CUBICSPLINE"===f.interpolation&&(E.createInterpolant=function(e){return new w(this.times,this.values,this.getValueSize()/3,e)},E.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),l.push(E)}}}return new Gl(t.name?t.name:"animation_"+e,void 0,l)}))},H.prototype.loadNode=function(e){var t,n=this.json,i=this.extensions,r=this,a=n.nodes[e],o=a.name?r.createUniqueName(a.name):"";return(t=[],void 0!==a.mesh&&t.push(r.getDependency("mesh",a.mesh).then((function(e){var t=r._getNodeRef(r.meshCache,a.mesh,e);return void 0!==a.weights&&t.traverse((function(e){if(e.isMesh)for(var t=0,n=a.weights.length;t<n;t++)e.morphTargetInfluences[t]=a.weights[t]})),t}))),void 0!==a.camera&&t.push(r.getDependency("camera",a.camera).then((function(e){return r._getNodeRef(r.cameraCache,a.camera,e)}))),r._invokeAll((function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)})).forEach((function(e){t.push(e)})),Promise.all(t)).then((function(t){var n;if((n=!0===a.isBone?new _o:t.length>1?new ja:1===t.length?t[0]:new zt)!==t[0])for(var s=0,l=t.length;s<l;s++)n.add(t[s]);if(a.name&&(n.userData.name=a.name,n.name=o),z(n,a),a.extensions&&N(i,n,a),void 0!==a.matrix){var A=new bt;A.fromArray(a.matrix),n.applyMatrix4(A)}else void 0!==a.translation&&n.position.fromArray(a.translation),void 0!==a.rotation&&n.quaternion.fromArray(a.rotation),void 0!==a.scale&&n.scale.fromArray(a.scale);return r.associations.set(n,{type:"nodes",index:e}),n}))},H.prototype.loadScene=function(){function e(t,n,i,r){var a=i.nodes[t];return r.getDependency("node",t).then((function(e){return void 0===a.skin?e:r.getDependency("skin",a.skin).then((function(e){for(var n=[],i=0,a=(t=e).joints.length;i<a;i++)n.push(r.getDependency("node",t.joints[i]));return Promise.all(n)})).then((function(n){return e.traverse((function(e){if(e.isMesh){for(var i=[],r=[],a=0,o=n.length;a<o;a++){var s=n[a];if(s){i.push(s);var l=new bt;void 0!==t.inverseBindMatrices&&l.fromArray(t.inverseBindMatrices.array,16*a),r.push(l)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[a])}e.bind(new To(i,r),e.matrixWorld)}})),e}));var t})).then((function(t){n.add(t);var o=[];if(a.children)for(var s=a.children,l=0,A=s.length;l<A;l++){var c=s[l];o.push(e(c,t,i,r))}return Promise.all(o)}))}return function(t){var n=this.json,i=this.extensions,r=this.json.scenes[t],a=new ja;r.name&&(a.name=this.createUniqueName(r.name)),z(a,r),r.extensions&&N(i,a,r);for(var o=r.nodes||[],s=[],l=0,A=o.length;l<A;l++)s.push(e(o[l],a,n,this));return Promise.all(s).then((function(){return a}))}}(),e}(),NE=function(e){Wl.call(this,e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}};NE.prototype=Object.assign(Object.create(Wl.prototype),{constructor:NE,setDecoderPath:function(e){return this.decoderPath=e,this},setDecoderConfig:function(e){return this.decoderConfig=e,this},setWorkerLimit:function(e){return this.workerLimit=e,this},setVerbosity:function(){console.warn("THREE.DRACOLoader: The .setVerbosity() method has been removed.")},setDrawMode:function(){console.warn("THREE.DRACOLoader: The .setDrawMode() method has been removed.")},setSkipDequantization:function(){console.warn("THREE.DRACOLoader: The .setSkipDequantization() method has been removed.")},load:function(e,t,n,i){var r=this,a=new Kl(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,(function(e){var n={attributeIDs:r.defaultAttributeIDs,attributeTypes:r.defaultAttributeTypes,useUniqueIDs:!1};r.decodeGeometry(e,n).then(t).catch(i)}),n,i)},decodeDracoFile:function(e,t,n,i){var r={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:i||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,r).then(t)},decodeGeometry:function(e,t){var n=this;for(var i in t.attributeTypes){var r=t.attributeTypes[i];void 0!==r.BYTES_PER_ELEMENT&&(t.attributeTypes[i]=r.name)}var a,o=JSON.stringify(t);if(NE.taskCache.has(e)){var s=NE.taskCache.get(e);if(s.key===o)return s.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}var l=this.workerNextTaskID++,A=e.byteLength,c=this._getWorker(l,A).then((function(n){return a=n,new Promise((function(n,i){a._callbacks[l]={resolve:n,reject:i},a.postMessage({type:"decode",id:l,taskConfig:t,buffer:e},[e])}))})).then((function(e){return n._createGeometry(e.geometry)}));return c.catch((function(){return!0})).then((function(){a&&l&&n._releaseTask(a,l)})),NE.taskCache.set(e,{key:o,promise:c}),c},_createGeometry:function(e){var t=new si;e.index&&t.setIndex(new zn(e.index.array,1));for(var n=0;n<e.attributes.length;n++){var i=e.attributes[n],r=i.name,a=i.array,o=i.itemSize;t.setAttribute(r,new zn(a,o))}return t},_loadLibrary:function(e,t){var n=new Kl(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((function(t,i){n.load(e,t,void 0,i)}))},preload:function(){return this._initDecoder(),this},_initDecoder:function(){var e=this;if(this.decoderPending)return this.decoderPending;var t="object"!==("undefined"==typeof WebAssembly?"undefined":r(WebAssembly))||"js"===this.decoderConfig.type,n=[];return t?n.push(this._loadLibrary("draco_decoder.js","text")):(n.push(this._loadLibrary("draco_wasm_wrapper.js","text")),n.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(n).then((function(n){var i=n[0];t||(e.decoderConfig.wasmBinary=n[1]);var r=NE.DRACOWorker.toString(),a=["/* draco decoder */",i,"","/* worker */",r.substring(r.indexOf("{")+1,r.lastIndexOf("}"))].join("\n");e.workerSourceURL=URL.createObjectURL(new Blob([a]))})),this.decoderPending},_getWorker:function(e,t){var n=this;return this._initDecoder().then((function(){var i;n.workerPool.length<n.workerLimit?((i=new Worker(n.workerSourceURL))._callbacks={},i._taskCosts={},i._taskLoad=0,i.postMessage({type:"init",decoderConfig:n.decoderConfig}),i.onmessage=function(e){var t=e.data;switch(t.type){case"decode":i._callbacks[t.id].resolve(t);break;case"error":i._callbacks[t.id].reject(t);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+t.type+'"')}},n.workerPool.push(i)):n.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));return(i=n.workerPool[n.workerPool.length-1])._taskCosts[e]=t,i._taskLoad+=t,i}))},_releaseTask:function(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]},debug:function(){console.log("Task load: ",this.workerPool.map((function(e){return e._taskLoad})))},dispose:function(){for(var e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}),NE.DRACOWorker=function(){var e,t;function n(e,t,n,i,r,a){var o=a.num_components(),s=n.num_points()*o,l=s*r.BYTES_PER_ELEMENT,A=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,r),c=e._malloc(l);t.GetAttributeDataArrayForAllPoints(n,a,A,l,c);var h=new r(e.HEAPF32.buffer,c,s).slice();return e._free(c),{name:i,array:h,itemSize:o}}onmessage=function(i){var r=i.data;switch(r.type){case"init":e=r.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":var a=r.buffer,o=r.taskConfig;t.then((function(e){var t=e.draco,i=new t.Decoder,s=new t.DecoderBuffer;s.Init(new Int8Array(a),a.byteLength);try{var l=function(e,t,i,r){var a,o,s=r.attributeIDs,l=r.attributeTypes,A=t.GetEncodedGeometryType(i);if(A===e.TRIANGULAR_MESH)a=new e.Mesh,o=t.DecodeBufferToMesh(i,a);else{if(A!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");a=new e.PointCloud,o=t.DecodeBufferToPointCloud(i,a)}if(!o.ok()||0===a.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+o.error_msg());var c={index:null,attributes:[]};for(var h in s){var u,d,f=self[l[h]];if(r.useUniqueIDs)d=s[h],u=t.GetAttributeByUniqueId(a,d);else{if(-1===(d=t.GetAttributeId(a,e[s[h]])))continue;u=t.GetAttribute(a,d)}c.attributes.push(n(e,t,a,h,f,u))}A===e.TRIANGULAR_MESH&&(c.index=function(e,t,n){var i=3*n.num_faces(),r=4*i,a=e._malloc(r);t.GetTrianglesUInt32Array(n,r,a);var o=new Uint32Array(e.HEAPF32.buffer,a,i).slice();return e._free(a),{array:o,itemSize:1}}(e,t,a));return e.destroy(a),c}(t,i,s,o),A=l.attributes.map((function(e){return e.array.buffer}));l.index&&A.push(l.index.array.buffer),self.postMessage({type:"decode",id:r.id,geometry:l},A)}catch(e){console.error(e),self.postMessage({type:"error",id:r.id,error:e.message})}finally{t.destroy(s),t.destroy(i)}}))}}},NE.taskCache=new WeakMap,NE.setDecoderPath=function(){console.warn("THREE.DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.")},NE.setDecoderConfig=function(){console.warn("THREE.DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.")},NE.releaseDecoderModule=function(){console.warn("THREE.DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.")},NE.getDecoderModule=function(){console.warn("THREE.DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.")};var zE={};zE.LegacyGLTFLoader=function(){function e(e){Wl.call(this,e)}function t(){var e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}},update:function(t,n){for(var i in e){var r=e[i];r.update&&r.update(t,n)}}}}function n(e,t){var n={},i=e.material.uniforms;for(var r in i){var a=i[r];if(a.semantic){var o=a.node,s=e;o&&(s=t[o]),n[r]={semantic:a.semantic,sourceNode:s,targetNode:e,uniform:a}}}this.boundUniforms=n,this._m4=new bt}e.prototype=Object.assign(Object.create(Wl.prototype),{constructor:e,load:function(e,t,n,i){var r,a=this;r=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:OA.extractUrlBase(e);var o=new Kl(a.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.load(e,(function(e){a.parse(e,r,t)}),n,i)},parse:function(e,t,n){var s,l={};OA.decodeText(new Uint8Array(e,0,4))===a.magic?(l[i.KHR_BINARY_GLTF]=new o(e),s=l[i.KHR_BINARY_GLTF].content):s=OA.decodeText(new Uint8Array(e));var A=JSON.parse(s);A.extensionsUsed&&A.extensionsUsed.indexOf(i.KHR_MATERIALS_COMMON)>=0&&(l[i.KHR_MATERIALS_COMMON]=new r(A)),new B(A,l,{crossOrigin:this.crossOrigin,manager:this.manager,path:t||this.resourcePath||""}).parse((function(e,t,i,r){n({scene:e,scenes:t,cameras:i,animations:r})}))}}),e.Shaders={update:function(){console.warn("threeExamples.LegacyGLTFLoader.Shaders has been deprecated, and now updates automatically.")}},n.prototype.update=function(e,t){var n=this.boundUniforms;for(var i in n){var r=n[i];switch(r.semantic){case"MODELVIEW":r.uniform.value.multiplyMatrices(t.matrixWorldInverse,r.sourceNode.matrixWorld);break;case"MODELVIEWINVERSETRANSPOSE":var a=r.uniform.value;this._m4.multiplyMatrices(t.matrixWorldInverse,r.sourceNode.matrixWorld),a.getNormalMatrix(this._m4);break;case"PROJECTION":r.uniform.value.copy(t.projectionMatrix);break;case"JOINTMATRIX":for(var o=r.uniform.value,s=0;s<o.length;s++)o[s].getInverse(r.sourceNode.matrixWorld).multiply(r.targetNode.skeleton.bones[s].matrixWorld).multiply(r.targetNode.skeleton.boneInverses[s]).multiply(r.targetNode.bindMatrix);break;default:console.warn("Unhandled shader semantic: "+r.semantic)}}},e.Animations={update:function(){console.warn("threeExamples.LegacyGLTFLoader.Animation has been deprecated. Use THREE.AnimationMixer instead.")}};var i={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_MATERIALS_COMMON:"KHR_materials_common"};function r(e){this.name=i.KHR_MATERIALS_COMMON,this.lights={};var t=(e.extensions&&e.extensions[i.KHR_MATERIALS_COMMON]||{}).lights||{};for(var n in t){var r,a=t[n],o=a[a.type],s=(new Fn).fromArray(o.color);switch(a.type){case"directional":(r=new PA(s)).position.set(0,0,1);break;case"point":r=new LA(s);break;case"spot":(r=new _A(s)).position.set(0,0,1);break;case"ambient":r=new UA(s)}r&&(this.lights[n]=r)}}var a={magic:"glTF",version:1,contentFormat:0};function o(e){this.name=i.KHR_BINARY_GLTF;var t=new DataView(e,0,20),n={magic:OA.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0),contentLength:t.getUint32(12,!0),contentFormat:t.getUint32(16,!0)};for(var r in a){var o=a[r];if(n[r]!==o)throw new Error('Unsupported glTF-Binary header: Expected "%s" to be "%s".',r,o)}var s=new Uint8Array(e,20,n.contentLength);this.header=n,this.content=OA.decodeText(s),this.body=e.slice(20+n.contentLength,n.length)}o.prototype.loadShader=function(e,t){var n=t[e.extensions[i.KHR_BINARY_GLTF].bufferView],r=new Uint8Array(n);return OA.decodeText(r)};var s={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,TRIANGLES:4,LINES:1,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,VERTEX_SHADER:35633,FRAGMENT_SHADER:35632},l={5126:Number,35675:lt,35676:bt,35664:tt,35665:at,35666:ut,35678:ht},A={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},c={9728:X,9729:Z,9984:Y,9985:J,9986:K,9987:q},h={33071:j,33648:W,10497:V},u={6406:le,6407:Ae,6408:ce,6409:he,6410:ue},d={5121:$,32819:re,32820:ae,33635:oe},f={1028:1,1029:0},p={512:0,513:2,514:4,515:3,516:5,517:7,518:5,519:1},m={32774:I,32778:101,32779:102},v={0:L,1:F,768:k,769:203,770:P,771:U,772:D,773:207,774:R,775:209,776:210},g={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},y={scale:"scale",translation:"position",rotation:"quaternion"},w={LINEAR:ke,STEP:Fe},x={2884:"CULL_FACE",2929:"DEPTH_TEST",3042:"BLEND",3089:"SCISSOR_TEST",32823:"POLYGON_OFFSET_FILL",32926:"SAMPLE_ALPHA_TO_COVERAGE"};function b(e,t,n){if(!e)return Promise.resolve();var i,r=[];if("[object Array]"===Object.prototype.toString.call(e)){i=[];for(var a=e.length,o=0;o<a;o++){(l=t.call(n||this,e[o],o))&&(r.push(l),l instanceof Promise?l.then(function(e,t){i[e]=t}.bind(this,o)):i[o]=l)}}else for(var s in i={},e){var l;if(e.hasOwnProperty(s))(l=t.call(n||this,e[s],s))&&(r.push(l),l instanceof Promise?l.then(function(e,t){i[e]=t}.bind(this,s)):i[s]=l)}return Promise.all(r).then((function(){return i}))}function M(e,t){return"string"!=typeof e||""===e?"":/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:(t||"")+e}function C(e){this.isDeferredShaderMaterial=!0,this.params=e}function B(e,n,i){this.json=e||{},this.extensions=n||{},this.options=i||{},this.cache=new t}return C.prototype.create=function(){var e=Di.clone(this.params.uniforms);for(var t in this.params.uniforms){var n=this.params.uniforms[t];n.value instanceof ht&&(e[t].value=n.value,e[t].value.needsUpdate=!0),e[t].semantic=n.semantic,e[t].node=n.node}return this.params.uniforms=e,new vl(this.params)},B.prototype._withDependencies=function(e){for(var t={},n=0;n<e.length;n++){var i=e[n],r="load"+i.charAt(0).toUpperCase()+i.slice(1),a=this.cache.get(i);if(void 0!==a)t[i]=a;else if(this[r]){var o=this[r]();this.cache.add(i,o),t[i]=o}}return b(t,(function(e){return e}))},B.prototype.parse=function(e){var t=this.json;this.cache.removeAll(),this._withDependencies(["scenes","cameras","animations"]).then((function(n){var i=[];for(var r in n.scenes)i.push(n.scenes[r]);var a=void 0!==t.scene?n.scenes[t.scene]:i[0],o=[];for(var r in n.cameras){var s=n.cameras[r];o.push(s)}var l=[];for(var r in n.animations)l.push(n.animations[r]);e(a,i,o,l)}))},B.prototype.loadShaders=function(){var e=this.json,t=this.extensions,n=this.options;return this._withDependencies(["bufferViews"]).then((function(r){return b(e.shaders,(function(e){return e.extensions&&e.extensions[i.KHR_BINARY_GLTF]?t[i.KHR_BINARY_GLTF].loadShader(e,r.bufferViews):new Promise((function(t){var i=new Kl(n.manager);i.setResponseType("text"),i.load(M(e.uri,n.path),(function(e){t(e)}))}))}))}))},B.prototype.loadBuffers=function(){var e=this.json,t=this.extensions,n=this.options;return b(e.buffers,(function(e,r){return"binary_glTF"===r?t[i.KHR_BINARY_GLTF].body:"arraybuffer"===e.type||void 0===e.type?new Promise((function(t){var i=new Kl(n.manager);i.setResponseType("arraybuffer"),i.load(M(e.uri,n.path),(function(e){t(e)}))})):void console.warn("threeExamples.LegacyGLTFLoader: "+e.type+" buffer type is not supported")}))},B.prototype.loadBufferViews=function(){var e=this.json;return this._withDependencies(["buffers"]).then((function(t){return b(e.bufferViews,(function(e){var n=t.buffers[e.buffer],i=void 0!==e.byteLength?e.byteLength:0;return n.slice(e.byteOffset,e.byteOffset+i)}))}))},B.prototype.loadAccessors=function(){var e=this.json;return this._withDependencies(["bufferViews"]).then((function(t){return b(e.accessors,(function(e){var n=t.bufferViews[e.bufferView],i=g[e.type],r=A[e.componentType],a=r.BYTES_PER_ELEMENT,o=a*i;if(e.byteStride&&e.byteStride!==o){var s=new r(n);return new io(new no(s,e.byteStride/a),i,e.byteOffset/a)}return new zn(s=new r(n,e.byteOffset,e.count*i),i)}))}))},B.prototype.loadTextures=function(){var e=this.json,t=this.options;return this._withDependencies(["bufferViews"]).then((function(n){return b(e.textures,(function(r){if(r.source)return new Promise((function(a){var o=e.images[r.source],s=o.uri,l=!1;if(o.extensions&&o.extensions[i.KHR_BINARY_GLTF]){var A=o.extensions[i.KHR_BINARY_GLTF],f=n.bufferViews[A.bufferView],p=new Blob([f],{type:A.mimeType});s=URL.createObjectURL(p),l=!0}var m=t.manager.getHandler(s);null===m&&(m=new tA(t.manager)),m.setCrossOrigin(t.crossOrigin),m.load(M(s,t.path),(function(t){if(l&&URL.revokeObjectURL(s),t.flipY=!1,void 0!==r.name&&(t.name=r.name),t.format=void 0!==r.format?u[r.format]:ce,void 0!==r.internalFormat&&t.format!==u[r.internalFormat]&&console.warn("threeExamples.LegacyGLTFLoader: Three.js doesn't support texture internalFormat which is different from texture format. internalFormat will be forced to be the same value as format."),t.type=void 0!==r.type?d[r.type]:$,r.sampler){var n=e.samplers[r.sampler];t.magFilter=c[n.magFilter]||Z,t.minFilter=c[n.minFilter]||K,t.wrapS=h[n.wrapS]||V,t.wrapT=h[n.wrapT]||V}a(t)}),void 0,(function(){l&&URL.revokeObjectURL(s),a()}))}))}))}))},B.prototype.loadMaterials=function(){var e=this.json;return this._withDependencies(["shaders","textures"]).then((function(t){return b(e.materials,(function(n){var r,a,o={},A={};if(n.extensions&&n.extensions[i.KHR_MATERIALS_COMMON]&&(a=n.extensions[i.KHR_MATERIALS_COMMON]),a){var c=["ambient","emission","transparent","transparency","doubleSided"];switch(a.technique){case"BLINN":case"PHONG":r=wl,c.push("diffuse","specular","shininess");break;case"LAMBERT":r=Ml,c.push("diffuse");break;default:r=Nn}c.forEach((function(e){void 0!==a.values[e]&&(o[e]=a.values[e])})),(a.doubleSided||o.doubleSided)&&(A.side=2),(a.transparent||o.transparent)&&(A.transparent=!0,A.opacity=void 0!==o.transparency?o.transparency:1)}else if(void 0===n.technique)r=wl,Object.assign(o,n.values);else{r=C;var h=e.techniques[n.technique];A.uniforms={};var u=e.programs[h.program];if(u){A.fragmentShader=t.shaders[u.fragmentShader],A.fragmentShader||(console.warn("ERROR: Missing fragment shader definition:",u.fragmentShader),r=wl);var d=t.shaders[u.vertexShader];d||(console.warn("ERROR: Missing vertex shader definition:",u.vertexShader),r=wl),A.vertexShader=function(e,t){var n={};for(var i in t.attributes){var r=t.attributes[i],a=(h=t.parameters[r]).type,o=h.semantic;n[i]={type:a,semantic:o}}var s=t.parameters,l=t.attributes,A={};for(var i in n){var c=s[r=l[i]];(o=c.semantic)&&(A[i]=c)}for(var r in A){o=(h=A[r]).semantic;var h,u=new RegExp("\\b"+r+"\\b","g");switch(o){case"POSITION":e=e.replace(u,"position");break;case"NORMAL":e=e.replace(u,"normal");break;case"TEXCOORD_0":case"TEXCOORD0":case"TEXCOORD":e=e.replace(u,"uv");break;case"TEXCOORD_1":e=e.replace(u,"uv2");break;case"COLOR_0":case"COLOR0":case"COLOR":e=e.replace(u,"color");break;case"WEIGHT":e=e.replace(u,"skinWeight");break;case"JOINT":e=e.replace(u,"skinIndex")}}return e}(d,h);var g=h.uniforms;for(var y in g){var w=g[y],b=h.parameters[w],M=b.type;if(!l[M])throw new Error("Unknown shader uniform param type: "+M);var B,E=b.count;void 0!==n.values&&(B=n.values[w]);var S=new l[M],T=b.semantic,_=b.node;switch(M){case s.FLOAT:S=b.value,"transparency"==w&&(A.transparent=!0),void 0!==B&&(S=B);break;case s.FLOAT_VEC2:case s.FLOAT_VEC3:case s.FLOAT_VEC4:case s.FLOAT_MAT3:b&&b.value&&S.fromArray(b.value),B&&S.fromArray(B);break;case s.FLOAT_MAT2:console.warn("FLOAT_MAT2 is not a supported uniform type");break;case s.FLOAT_MAT4:if(E){S=new Array(E);for(var k=0;k<E;k++)S[k]=new l[M];if(b&&b.value){var P=b.value;S.fromArray(P)}B&&S.fromArray(B)}else{if(b&&b.value){var U=b.value;S.fromArray(U)}B&&S.fromArray(B)}break;case s.SAMPLER_2D:S=void 0!==B?t.textures[B]:void 0!==b.value?t.textures[b.value]:null}A.uniforms[y]={value:S,semantic:T,node:_}}for(var D=h.states||{},R=D.enable||[],O=D.functions||{},N=!1,z=!1,Q=!1,G=0,H=R.length;G<H;G++){var V=R[G];switch(x[V]){case"CULL_FACE":N=!0;break;case"DEPTH_TEST":z=!0;break;case"BLEND":Q=!0;break;case"SCISSOR_TEST":case"POLYGON_OFFSET_FILL":case"SAMPLE_ALPHA_TO_COVERAGE":break;default:throw new Error("Unknown technique.states.enable: "+V)}}A.side=N?void 0!==O.cullFace?f[O.cullFace]:0:2,A.depthTest=z,A.depthFunc=void 0!==O.depthFunc?p[O.depthFunc]:2,A.depthWrite=void 0===O.depthMask||O.depthMask[0],A.blending=Q?5:0,A.transparent=Q;var j=O.blendEquationSeparate;void 0!==j?(A.blendEquation=m[j[0]],A.blendEquationAlpha=m[j[1]]):(A.blendEquation=I,A.blendEquationAlpha=I);var W=O.blendFuncSeparate;void 0!==W?(A.blendSrc=v[W[0]],A.blendDst=v[W[1]],A.blendSrcAlpha=v[W[2]],A.blendDstAlpha=v[W[3]]):(A.blendSrc=F,A.blendDst=L,A.blendSrcAlpha=F,A.blendDstAlpha=L)}}Array.isArray(o.diffuse)?A.color=(new Fn).fromArray(o.diffuse):"string"==typeof o.diffuse&&(A.map=t.textures[o.diffuse]),delete A.diffuse,"string"==typeof o.reflective&&(A.envMap=t.textures[o.reflective]),"string"==typeof o.bump&&(A.bumpMap=t.textures[o.bump]),Array.isArray(o.emission)?r===Nn?A.color=(new Fn).fromArray(o.emission):A.emissive=(new Fn).fromArray(o.emission):"string"==typeof o.emission&&(r===Nn?A.map=t.textures[o.emission]:A.emissiveMap=t.textures[o.emission]),Array.isArray(o.specular)?A.specular=(new Fn).fromArray(o.specular):"string"==typeof o.specular&&(A.specularMap=t.textures[o.specular]),void 0!==o.shininess&&(A.shininess=o.shininess);var X=new r(A);return void 0!==n.name&&(X.name=n.name),X}))}))},B.prototype.loadMeshes=function(){var e=this.json;return this._withDependencies(["accessors","materials"]).then((function(t){return b(e.meshes,(function(n){var i=new ja;void 0!==n.name&&(i.name=n.name),n.extras&&(i.userData=n.extras);var r=n.primitives||[];for(var a in r){var o=r[a];if(o.mode===s.TRIANGLES||void 0===o.mode){var l=new si,A=o.attributes;for(var c in A){if(!(f=A[c]))return;var h=t.accessors[f];switch(c){case"POSITION":l.setAttribute("position",h);break;case"NORMAL":l.setAttribute("normal",h);break;case"TEXCOORD_0":case"TEXCOORD0":case"TEXCOORD":l.setAttribute("uv",h);break;case"TEXCOORD_1":l.setAttribute("uv2",h);break;case"COLOR_0":case"COLOR0":case"COLOR":l.setAttribute("color",h);break;case"WEIGHT":l.setAttribute("skinWeight",h);break;case"JOINT":l.setAttribute("skinIndex",h);break;default:if(!o.material)break;if(!(m=e.materials[o.material]).technique)break;var u=e.techniques[m.technique].parameters||{};for(var d in u)u[d].semantic===c&&l.setAttribute(d,h)}}o.indices&&l.setIndex(t.accessors[o.indices]),(p=new Ei(l,m=void 0!==t.materials?t.materials[o.material]:new wl({color:0,emissive:8947848,specular:0,shininess:0,transparent:!1,depthTest:!0,side:0}))).castShadow=!0,p.name="0"===a?i.name:i.name+a,o.extras&&(p.userData=o.extras),i.add(p)}else if(o.mode===s.LINES){l=new si,A=o.attributes;for(var c in A){var f;if(!(f=A[c]))return;h=t.accessors[f];switch(c){case"POSITION":l.setAttribute("position",h);break;case"COLOR_0":case"COLOR0":case"COLOR":l.setAttribute("color",h)}}var p,m=t.materials[o.material];o.indices?(l.setIndex(t.accessors[o.indices]),p=new jo(l,m)):p=new Go(l,m),p.name="0"===a?i.name:i.name+a,o.extras&&(p.userData=o.extras),i.add(p)}else console.warn("Only triangular and line primitives are supported")}return i}))}))},B.prototype.loadCameras=function(){return b(this.json.cameras,(function(e){if("perspective"==e.type&&e.perspective){var t=e.perspective.yfov,n=void 0!==e.perspective.aspectRatio?e.perspective.aspectRatio:1,i=t*n,r=new Ni(Hh.radToDeg(i),n,e.perspective.znear||1,e.perspective.zfar||2e6);return void 0!==e.name&&(r.name=e.name),e.extras&&(r.userData=e.extras),r}if("orthographic"==e.type&&e.orthographic){r=new FA(window.innerWidth/-2,window.innerWidth/2,window.innerHeight/2,window.innerHeight/-2,e.orthographic.znear,e.orthographic.zfar);return void 0!==e.name&&(r.name=e.name),e.extras&&(r.userData=e.extras),r}}))},B.prototype.loadSkins=function(){var e=this.json;return this._withDependencies(["accessors"]).then((function(t){return b(e.skins,(function(e){var n=new bt;return void 0!==e.bindShapeMatrix&&n.fromArray(e.bindShapeMatrix),{bindShapeMatrix:n,jointNames:e.jointNames,inverseBindMatrices:t.accessors[e.inverseBindMatrices]}}))}))},B.prototype.loadAnimations=function(){var e=this.json;return this._withDependencies(["accessors","nodes"]).then((function(t){return b(e.animations,(function(e,n){var i=[];for(var r in e.channels){var a=e.channels[r],o=e.samplers[a.sampler];if(o){var s=a.target,l=s.id,A=void 0!==e.parameters?e.parameters[o.input]:o.input,c=void 0!==e.parameters?e.parameters[o.output]:o.output,h=t.accessors[A],u=t.accessors[c],d=t.nodes[l];if(d){d.updateMatrix(),d.matrixAutoUpdate=!0;var f=y[s.path]===y.rotation?Nl:Ql,p=d.name?d.name:d.uuid,m=void 0!==o.interpolation?w[o.interpolation]:ke;i.push(new f(p+"."+y[s.path],_l.arraySlice(h.array,0),_l.arraySlice(u.array,0),m))}}}return new Gl(l=void 0!==e.name?e.name:"animation_"+n,void 0,i)}))}))},B.prototype.loadNodes=function(){var e=this.json,t=this.extensions,n=this;return b(e.nodes,(function(e){var t,n=new bt;return e.jointName?((t=new _o).name=void 0!==e.name?e.name:e.jointName,t.jointName=e.jointName):(t=new zt,void 0!==e.name&&(t.name=e.name)),e.extras&&(t.userData=e.extras),void 0!==e.matrix?(n.fromArray(e.matrix),t.applyMatrix4(n)):(void 0!==e.translation&&t.position.fromArray(e.translation),void 0!==e.rotation&&t.quaternion.fromArray(e.rotation),void 0!==e.scale&&t.scale.fromArray(e.scale)),t})).then((function(r){return n._withDependencies(["meshes","skins","cameras"]).then((function(n){return b(r,(function(a,o){var s=e.nodes[o];if(void 0!==s.meshes)for(var l in s.meshes){var A=s.meshes[l],c=n.meshes[A];if(void 0!==c)for(var h in c.children){var u,d=c.children[h],f=d.material,p=d.geometry,m=d.userData,v=d.name;switch(f.isDeferredShaderMaterial?f=g=f.create():g=f,d.type){case"LineSegments":d=new jo(p,g);break;case"LineLoop":d=new Wo(p,g);break;case"Line":d=new Go(p,g);break;default:d=new Ei(p,g)}if(d.castShadow=!0,d.userData=m,d.name=v,s.skin&&(u=n.skins[s.skin]),u){var g,y=function(e){for(var t=Object.keys(r),n=0,i=t.length;n<i;n++){var a=r[t[n]];if(a.jointName===e)return a}return null},w=p;(g=f).skinning=!0,(d=new Bo(w,g)).castShadow=!0,d.userData=m,d.name=v;for(var x=[],b=[],M=0,C=u.jointNames.length;M<C;M++){var B=u.jointNames[M],E=y(B);if(E){x.push(E);var S=u.inverseBindMatrices.array,T=(new bt).fromArray(S,16*M);b.push(T)}else console.warn("WARNING: joint: '"+B+"' could not be found")}d.bind(new To(x,b),u.bindShapeMatrix);!function t(n,i,a){var o=n[a];if(void 0!==o)for(var s=0,l=o.length;s<l;s++){var A=o[s],c=r[A],h=e.nodes[A];void 0!==c&&!0===c.isBone&&void 0!==h&&(i.add(c),t(h,c,"children"))}}(s,d,"skeletons")}a.add(d)}else console.warn("LegacyGLTFLoader: Couldn't find node \""+A+'".')}if(void 0!==s.camera){var _=n.cameras[s.camera];a.add(_)}if(s.extensions&&s.extensions[i.KHR_MATERIALS_COMMON]&&s.extensions[i.KHR_MATERIALS_COMMON].light){var I=t[i.KHR_MATERIALS_COMMON].lights[s.extensions[i.KHR_MATERIALS_COMMON].light];a.add(I)}return a}))}))}))},B.prototype.loadScenes=function(){var e=this.json;function t(n,i,r){var a=r[n];i.add(a);var o=e.nodes[n];if(o.children)for(var s=o.children,l=0,A=s.length;l<A;l++){t(s[l],a,r)}}return this._withDependencies(["nodes"]).then((function(i){return b(e.scenes,(function(e){var r=new Qt;void 0!==e.name&&(r.name=e.name),e.extras&&(r.userData=e.extras);for(var a=e.nodes||[],o=0,s=a.length;o<s;o++){t(a[o],r,i.nodes)}return r.traverse((function(e){e.material&&e.material.isRawShaderMaterial&&(e.gltfShader=new n(e,i.nodes),e.onBeforeRender=function(e,t,n){this.gltfShader.update(t,n)})})),r}))}))},e}();var QE=zE.LegacyGLTFLoader;function GE(e,t,n){return t<=e&&e<=n}function HE(e){if(void 0===e)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function VE(e){this.tokens=[].slice.call(e)}VE.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():-1},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.shift());else this.tokens.push(e)}};function jE(e,t){if(e)throw TypeError("Decoder error");return t||65533}var WE="utf-8";function XE(e,t){if(!(this instanceof XE))return new XE(e,t);if((e=void 0!==e?String(e).toLowerCase():WE)!==WE)throw new Error("Encoding not supported. Only utf-8 is supported");t=HE(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=Boolean(t.fatal),this._ignoreBOM=Boolean(t.ignoreBOM),Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function YE(e){var t=e.fatal,n=0,i=0,r=0,a=128,o=191;this.handler=function(e,s){if(-1===s&&0!==r)return r=0,jE(t);if(-1===s)return-1;if(0===r){if(GE(s,0,127))return s;if(GE(s,194,223))r=1,n=s-192;else if(GE(s,224,239))224===s&&(a=160),237===s&&(o=159),r=2,n=s-224;else{if(!GE(s,240,244))return jE(t);240===s&&(a=144),244===s&&(o=143),r=3,n=s-240}return n<<=6*r,null}if(!GE(s,a,o))return n=r=i=0,a=128,o=191,e.prepend(s),jE(t);if(a=128,o=191,n+=s-128<<6*(r-(i+=1)),i!==r)return null;var l=n;return n=r=i=0,l}}XE.prototype={decode:function(e,t){var n;n="object"==typeof e&&e instanceof ArrayBuffer?new Uint8Array(e):"object"==typeof e&&"buffer"in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0),t=HE(t),this._streaming||(this._decoder=new YE({fatal:this._fatal}),this._BOMseen=!1),this._streaming=Boolean(t.stream);for(var i,r=new VE(n),a=[];!r.endOfStream()&&-1!==(i=this._decoder.handler(r,r.read()));)null!==i&&(Array.isArray(i)?a.push.apply(a,i):a.push(i));if(!this._streaming){do{if(-1===(i=this._decoder.handler(r,r.read())))break;null!==i&&(Array.isArray(i)?a.push.apply(a,i):a.push(i))}while(!r.endOfStream());this._decoder=null}return a.length&&(-1===["utf-8"].indexOf(this.encoding)||this._ignoreBOM||this._BOMseen||(65279===a[0]?(this._BOMseen=!0,a.shift()):this._BOMseen=!0)),function(e){for(var t="",n=0;n<e.length;++n){var i=e[n];i<=65535?t+=String.fromCharCode(i):(i-=65536,t+=String.fromCharCode(55296+(i>>10),56320+(1023&i)))}return t}(a)}};var KE=new XE("utf-8"),ZE="tileset",JE="batchtable",qE="boundingVolume",$E=function(){function e(t,n,i,r){s(this,e),this.type=JE,this.batchLength=i;var a=t;n>0&&(console.warn("Binary batch table content not supported yet."),a=t.slice(0,t.byteLength));var o=KE.decode(new Uint8Array(a)),l=JSON.parse(o);l.extensions&&(this.extensions=r.parseExtensions(l.extensions,this.type),delete l.extensions),this.content=l}return A(e,[{key:"getInfoById",value:function(e){if(e<0&&e<this.batchLength)throw new Error("Batch Id (".concat(e,") must be between 0 and\n ").concat(this.batchLength," to access feature properties from the batch\n table."));var t={batchTable:{}};for(var n in this.content)Object.prototype.hasOwnProperty.call(this.content,n)&&(t.batchTable[n]=this.content[n][e]);if(this.extensions)for(var i in t.extensions={},this.extensions)Object.prototype.hasOwnProperty.call(this.extensions,i)&&(t.extensions[i]=this.extensions[i].getInfoById(e));return t}}]),e}(),eS=(new bt).makeRotationX(Math.PI/2),tS=(new bt).makeRotationZ(-Math.PI/2),nS=new OE,iS=new QE;function rS(e){var t=["MODELVIEW","MODELVIEWINVERSETRANSPOSE","PROJECTION","JOINTMATRIX"];if(e.gltfShader){var n=[];for(var i in e.gltfShader.boundUniforms)n.push(i);for(var r=0,a=n;r<a.length;r++){var o=a[r],s=e.gltfShader.boundUniforms[o].semantic;t.includes(s)||delete e.gltfShader.boundUniforms[o]}}}var aS=function(e,t){var n=t.gltfUpAxis,i=t.urlBase;if(!e)throw new Error("No array buffer provided.");var a=new DataView(e,4),o=0,s={};if(s.magic=KE.decode(new Uint8Array(e,0,4)),s.magic){s.version=a.getUint32(o,!0),o+=Uint32Array.BYTES_PER_ELEMENT,s.byteLength=a.getUint32(o,!0),o+=Uint32Array.BYTES_PER_ELEMENT,s.FTJSONLength=a.getUint32(o,!0),o+=Uint32Array.BYTES_PER_ELEMENT,s.FTBinaryLength=a.getUint32(o,!0),o+=Uint32Array.BYTES_PER_ELEMENT,s.BTJSONLength=a.getUint32(o,!0),o+=Uint32Array.BYTES_PER_ELEMENT,s.BTBinaryLength=a.getUint32(o,!0);var l=(o+=Uint32Array.BYTES_PER_ELEMENT)+4,A=[],c={},h=new at;if(s.FTJSONLength>0){var u=l,d=e.slice(u,s.FTJSONLength+u),f=KE.decode(new Uint8Array(d));(c=JSON.parse(f)).RTC_CENTER?h.fromArray(c.RTC_CENTER):h.set(0,0,0)}if(s.FTBinaryLength>0&&console.warn("3D Tiles feature table binary not supported yet."),s.BTJSONLength>0){var p=l+s.FTJSONLength+s.FTBinaryLength,m=e.slice(p,s.BTJSONLength+p);A.push(new $E(m,s.BTBinaryLength,c.BATCH_LENGTH,t.registeredExtensions))}else A.push(Promise.resolve({}));var v=l+s.FTJSONLength+s.FTBinaryLength+s.BTJSONLength+s.BTBinaryLength,g=e.slice(v),y=new DataView(g,0,20);return A.push(new Promise((function(e){var a=function(i){var a,o=S(i.scenes);try{for(o.s();!(a=o.n()).done;){a.value.traverse(rS)}}catch(e){o.e(e)}finally{o.f()}void 0===n||"Y"===n?i.scene.applyMatrix4(eS):"X"===n&&i.scene.applyMatrix4(tS),i.scene.position.copy(h);var s=new Uint8Array(g,20,y.getUint32(12,!0)),l=KE.decode(new Uint8Array(s)),A=JSON.parse(l);A.extensions&&A.extensions.CESIUM_RTC&&(i.scene.position.fromArray(A.extensions.CESIUM_RTC.center),i.scene.updateMatrixWorld(!0));i.scene.traverse((function(e){if(e.isB3dm=!0,e.frustumCulled=!1,e.material){if(t.overrideMaterials){if(Array.isArray(e.material)){var n,i=S(e.material);try{for(i.s();!(n=i.n()).done;){n.value.dispose()}}catch(e){i.e(e)}finally{i.f()}}else e.material.dispose();"object"===r(t.overrideMaterials)&&t.overrideMaterials.isMaterial?e.material=t.overrideMaterials:e.material.depthWrite=!0}else aM()&&e.material.isRawShaderMaterial&&!t.doNotPatchMaterial&&(dM(e.material),console.warn("b3dm shader has been patched to add log depth buffer support"));e.material.transparent=t.opacity<1,e.material.opacity=t.opacity}})),e(i)};1===y.getUint32(4,!0)?iS.parse(g,i,a):nS.parse(g,i,a)}))),Promise.all(A).then((function(e){return{gltf:e[1],batchTable:e[0]}}))}throw new Error("Invalid b3dm file.")},oS=function(e,t){if(!e)throw new Error("No array buffer provided.");var n=new DataView(e),i=0,r={},a={},o={};if(r.magic=KE.decode(new Uint8Array(e,i,4)),i+=4,r.magic){r.version=n.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,r.byteLength=n.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,r.FTJSONLength=n.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,r.FTBinaryLength=n.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,r.BTJSONLength=n.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT,r.BTBinaryLength=n.getUint32(i,!0),i+=Uint32Array.BYTES_PER_ELEMENT;var s={};if(r.FTJSONLength>0){var l=i,A=e.slice(l,r.FTJSONLength+l),c=KE.decode(new Uint8Array(A));s=JSON.parse(c)}if(r.FTBinaryLength>0&&(o=function(e,t,n){var i,r=new si,a=KE.decode(new Uint8Array(e,t,n)),o=JSON.parse(a);o.POINTS_LENGTH&&(i=o.POINTS_LENGTH);if(o.POSITION){var s=o.POSITION.byteOffset+a.length+t,l=new Float32Array(e,s,3*i);r.setAttribute("position",new zn(l,3))}if(o.RGB){var A=o.RGB.byteOffset+a.length+t,c=new Uint8Array(e,A,3*i);r.setAttribute("color",new zn(c,3,!0))}if(o.POSITION_QUANTIZED)throw new Error("For pnts loader, POSITION_QUANTIZED: not yet managed");if(o.RGBA)throw new Error("For pnts loader, RGBA: not yet managed");if(o.RGB565)throw new Error("For pnts loader, RGB565: not yet managed");if(o.NORMAL)throw new Error("For pnts loader, NORMAL: not yet managed");if(o.NORMAL_OCT16P)throw new Error("For pnts loader, NORMAL_OCT16P: not yet managed");if(o.BATCH_ID)throw new Error("For pnts loader, BATCH_ID: not yet managed");var h=o.RTC_CENTER?(new at).fromArray(o.RTC_CENTER):void 0;return{geometry:r,offset:h}}(e,i,r.FTJSONLength)),r.BTJSONLength>0){var h=i+r.FTJSONLength+r.FTBinaryLength,u=e.slice(h,r.BTJSONLength+h);a=new $E(u,r.BTBinaryLength,s.BATCH_LENGTH,t)}var d={point:o,batchTable:a};return Promise.resolve(d)}throw new Error("Invalid pnts file.")};function sS(e,t,n){var i=OA.extractUrlBase(n),r={gltfUpAxis:t.tileset.asset.gltfUpAxis,urlBase:i,overrideMaterials:t.overrideMaterials,doNotPatchMaterial:t.doNotPatchMaterial,opacity:t.opacity,registeredExtensions:t.registeredExtensions};return aS(e,r).then((function(e){return{batchTable:e.batchTable,object3d:e.gltf.scene}}))}function lS(e,t){return oS(e,t.registeredExtensions).then((function(e){var n=t.material?t.material.clone():new Xo({size:.05,vertexColors:!0}),i=new qo(e.point.geometry,n);return e.point.offset&&i.position.copy(e.point.offset),{object3d:i}}))}var AS={executeCommand:function(e){var t=e.layer,n=e.metadata,i=new zt;!function(e,t,n,i){e.frustumCulled=!1,e.layer=t,n.transform&&e.applyMatrix4(n.transform),e.geometricError=n.geometricError,e.tileId=n.tileId,n.refine?e.additiveRefinement="ADD"===n.refine.toUpperCase():e.additiveRefinement=!!i&&i.additiveRefinement,e.viewerRequestVolume=n.viewerRequestVolume,e.boundingVolume=n.boundingVolume,e.boundingVolume.region&&e.add(e.boundingVolume.region),e.updateMatrixWorld()}(i,t,n,e.requester);var r=n.content&&(n.content.url||n.content.uri),a=function(e){e.layers.set(t.threejsLayer),e.userData.metadata=n,e.layer=t,e.material&&(e.material.transparent=t.opacity<1,e.material.opacity=t.opacity,e.material.wireframe=t.wireframe)};if(r){var o=r.startsWith("http")?r:n.baseURL+r,s={b3dm:sS,pnts:lS};return $M.arrayBuffer(o,t.source.networkOptions).then((function(e){if(void 0!==e){var r,l=KE.decode(new Uint8Array(e,0,4));if("{"===l[0]){e=JSON.parse(KE.decode(new Uint8Array(e)));var A=o.slice(0,o.lastIndexOf("/")+1);t.tileset.extendTileset(e,n.tileId,A,t.registeredExtensions)}else if("b3dm"==l)r=s.b3dm;else{if("pnts"!=l)return Promise.reject("Unsupported magic code ".concat(l));r=s.pnts}if(r)return r(e,t,o).then((function(e){return i.content=e.object3d,e.batchTable&&(i.batchTable=e.batchTable),i.add(e.object3d),i.traverse(a),i}))}return i.traverse(a),i}))}return i.traverse(a),Promise.resolve(i)}},cS=1;var hS={executeCommand:function(e){var t=e.layer,n=e.requester;return n.load().then((function(i){var r=new qo(i,t.material);return function(e){var t=e.geometry.attributes.position.count,n=new Uint8Array(4*t),i=cS++;if(t>65535||i>65535)return console.warn("Currently picking is limited to Points with less than 65535 elements and less than 65535 Points instances"),e;for(var r=0;r<t;r++){var a=i<<16|r;n[4*r+0]=(4278190080&a)>>24,n[4*r+1]=(16711680&a)>>16,n[4*r+2]=(65280&a)>>8,n[4*r+3]=(255&a)>>0}e.baseId=i,e.geometry.setAttribute("unique_id",new zn(n,4,!0))}(r),r.frustumCulled=!1,r.matrixAutoUpdate=!1,t.isEntwinePointTileLayer||(r.position.copy(n.bbox.min),r.scale.copy(t.scale)),r.updateMatrix(),r.tightbbox=i.boundingBox.applyMatrix4(r.matrix),r.layers.set(t.threejsLayer),r.layer=t,r.extent=bb.fromBox3(e.view.referenceCrs,n.bbox),r.userData.node=n,r}))}};function uS(e,t){var n=t.priority-e.priority;return 0===n?t.timestamp-e.timestamp:n}function dS(){return{queue:function(e){var t=e.layer,n=this.storages.get(t.id);n||(n={q:new PriorityQueue({comparator:uS}),priority:1,accumulator:0},this.storages.set(t.id,n)),n.priority=t.priority||1,n.q.queue(e),this.counters.pending++},storages:new Map,counters:{executing:0,executed:0,failed:0,cancelled:0,pending:0},execute:function(e,t){var n=this;return this.counters.pending--,this.counters.executing++,t.executeCommand(e).then((function(t){n.counters.executing--,e.resolve(t),n.counters.executed++}),(function(t){n.counters.executing--,e.reject(t),n.counters.failed++,__DEBUG__&&n.counters.failed<3&&console.error(t)}))}}}function fS(){this.defaultQueue=dS(),this.hostQueues=new Map,this.providers={},this.maxCommandsPerHost=6,this.initDefaultProviders()}function pS(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=e.camera.camera3D.layers.mask;return e.camera.camera3D.layers.mask=1<<n,function(){e.camera.camera3D.layers.mask=i}}!function(t){if("object"===(void 0===e?"undefined":r(e))&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).PriorityQueue=t()}}((function(){return function e(t,n,i){function r(o,s){if(!n[o]){if(!t[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var A=new Error("Cannot find module '"+o+"'");throw A.code="MODULE_NOT_FOUND",A}var c=n[o]={exports:{}};t[o][0].call(c.exports,(function(e){var n=t[o][1][e];return r(n||e)}),c,c.exports,e,t,n,i)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<i.length;o++)r(i[o]);return r}({1:[function(e,t,n){var i,r,a,o,s,l={}.hasOwnProperty;i=e("./PriorityQueue/AbstractPriorityQueue"),r=e("./PriorityQueue/ArrayStrategy"),o=e("./PriorityQueue/BinaryHeapStrategy"),a=e("./PriorityQueue/BHeapStrategy"),s=function(e){function t(e){e||(e={}),e.strategy||(e.strategy=o),e.comparator||(e.comparator=function(e,t){return(e||0)-(t||0)}),t.__super__.constructor.call(this,e)}return function(e,t){for(var n in t)l.call(t,n)&&(e[n]=t[n]);function i(){this.constructor=e}i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype}(t,e),t}(i),s.ArrayStrategy=r,s.BinaryHeapStrategy=o,s.BHeapStrategy=a,t.exports=s},{"./PriorityQueue/AbstractPriorityQueue":2,"./PriorityQueue/ArrayStrategy":3,"./PriorityQueue/BHeapStrategy":4,"./PriorityQueue/BinaryHeapStrategy":5}],2:[function(e,t,n){t.exports=function(){function e(e){var t;if(null==(null!=e?e.strategy:void 0))throw"Must pass options.strategy, a strategy";if(null==(null!=e?e.comparator:void 0))throw"Must pass options.comparator, a comparator";this.priv=new e.strategy(e),this.length=(null!=e&&null!=(t=e.initialValues)?t.length:void 0)||0}return e.prototype.queue=function(e){this.length++,this.priv.queue(e)},e.prototype.dequeue=function(e){if(!this.length)throw"Empty queue";return this.length--,this.priv.dequeue()},e.prototype.peek=function(e){if(!this.length)throw"Empty queue";return this.priv.peek()},e.prototype.clear=function(){return this.length=0,this.priv.clear()},e}()},{}],3:[function(e,t,n){var i;i=function(e,t,n){var i,r,a;for(r=0,i=e.length;r<i;)n(e[a=r+i>>>1],t)>=0?r=a+1:i=a;return r},t.exports=function(){function e(e){var t;this.options=e,this.comparator=this.options.comparator,this.data=(null!=(t=this.options.initialValues)?t.slice(0):void 0)||[],this.data.sort(this.comparator).reverse()}return e.prototype.queue=function(e){var t;t=i(this.data,e,this.comparator),this.data.splice(t,0,e)},e.prototype.dequeue=function(){return this.data.pop()},e.prototype.peek=function(){return this.data[this.data.length-1]},e.prototype.clear=function(){this.data.length=0},e}()},{}],4:[function(e,t,n){t.exports=function(){function e(e){var t,n,i,r,a,o,s,l;for(this.comparator=(null!=e?e.comparator:void 0)||function(e,t){return e-t},this.pageSize=(null!=e?e.pageSize:void 0)||512,this.length=0,s=0;1<<s<this.pageSize;)s+=1;if(1<<s!==this.pageSize)throw"pageSize must be a power of two";for(this._shift=s,this._emptyMemoryPageTemplate=t=[],n=0,a=this.pageSize;0<=a?n<a:n>a;0<=a?++n:--n)t.push(null);if(this._memory=[],this._mask=this.pageSize-1,e.initialValues)for(i=0,r=(o=e.initialValues).length;i<r;i++)l=o[i],this.queue(l)}return e.prototype.queue=function(e){this.length+=1,this._write(this.length,e),this._bubbleUp(this.length,e)},e.prototype.dequeue=function(){var e,t;return e=this._read(1),t=this._read(this.length),this.length-=1,this.length>0&&(this._write(1,t),this._bubbleDown(1,t)),e},e.prototype.peek=function(){return this._read(1)},e.prototype.clear=function(){this.length=0,this._memory.length=0},e.prototype._write=function(e,t){var n;for(n=e>>this._shift;n>=this._memory.length;)this._memory.push(this._emptyMemoryPageTemplate.slice(0));return this._memory[n][e&this._mask]=t},e.prototype._read=function(e){return this._memory[e>>this._shift][e&this._mask]},e.prototype._bubbleUp=function(e,t){var n,i,r,a;for(n=this.comparator;e>1&&(i=e&this._mask,e<this.pageSize||i>3?r=e&~this._mask|i>>1:i<2?(r=e-this.pageSize>>this._shift,r+=r&~(this._mask>>1),r|=this.pageSize>>1):r=e-2,!(n(a=this._read(r),t)<0));)this._write(r,t),this._write(e,a),e=r},e.prototype._bubbleDown=function(e,t){var n,i,r,a,o;for(o=this.comparator;e<this.length;)if(e>this._mask&&!(e&this._mask-1)?n=i=e+2:e&this.pageSize>>1?(n=(e&~this._mask)>>1,i=(n=(n|=e&this._mask>>1)+1<<this._shift)+1):i=(n=e+(e&this._mask))+1,n!==i&&i<=this.length)if(r=this._read(n),a=this._read(i),o(r,t)<0&&o(r,a)<=0)this._write(n,t),this._write(e,r),e=n;else{if(!(o(a,t)<0))break;this._write(i,t),this._write(e,a),e=i}else{if(!(n<=this.length))break;if(!(o(r=this._read(n),t)<0))break;this._write(n,t),this._write(e,r),e=n}},e}()},{}],5:[function(e,t,n){t.exports=function(){function e(e){var t;this.comparator=(null!=e?e.comparator:void 0)||function(e,t){return e-t},this.length=0,this.data=(null!=(t=e.initialValues)?t.slice(0):void 0)||[],this._heapify()}return e.prototype._heapify=function(){var e,t,n;if(this.data.length>0)for(e=t=1,n=this.data.length;1<=n?t<n:t>n;e=1<=n?++t:--t)this._bubbleUp(e)},e.prototype.queue=function(e){this.data.push(e),this._bubbleUp(this.data.length-1)},e.prototype.dequeue=function(){var e,t;return t=this.data[0],e=this.data.pop(),this.data.length>0&&(this.data[0]=e,this._bubbleDown(0)),t},e.prototype.peek=function(){return this.data[0]},e.prototype.clear=function(){this.length=0,this.data.length=0},e.prototype._bubbleUp=function(e){for(var t,n;e>0&&(t=e-1>>>1,this.comparator(this.data[e],this.data[t])<0);)n=this.data[t],this.data[t]=this.data[e],this.data[e]=n,e=t},e.prototype._bubbleDown=function(e){var t,n,i,r,a;for(t=this.data.length-1;r=(n=1+(e<<1))+1,i=e,n<=t&&this.comparator(this.data[n],this.data[i])<0&&(i=n),r<=t&&this.comparator(this.data[r],this.data[i])<0&&(i=r),i!==e;)a=this.data[i],this.data[i]=this.data[e],this.data[e]=a,e=i},e}()},{}]},{},[1])(1)})),fS.prototype.constructor=fS,fS.prototype.initDefaultProviders=function(){this.addProtocolProvider("tile",RE),this.addProtocolProvider("3d-tiles",AS),this.addProtocolProvider("pointcloud",hS)},fS.prototype.runCommand=function(e,t,n){var i=this,r=this.getProtocolProvider(e.layer.protocol);if(!r)throw new Error("No known provider for layer ".concat(e.layer.id));t.execute(e,r,n).then((function(){if(e.view.notifyChange(e.requester,e.redraw),t.counters.executing<i.maxCommandsPerHost){var n=i.deQueue(t);n&&i.runCommand(n,t)}}))},fS.prototype.execute=function(e){var t=this,n=e.layer,i=n.source&&n.source.url?new URL(PE(n.source.url),document.location).host:void 0;e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),i&&!this.hostQueues.has(i)&&this.hostQueues.set(i,dS());var r=i?this.hostQueues.get(i):this.defaultQueue;return e.timestamp=Date.now(),r.queue(e),r.counters.executing<this.maxCommandsPerHost&&Promise.resolve().then((function(){if(r.counters.executing<t.maxCommandsPerHost){var e=t.deQueue(r);e&&t.runCommand(e,r)}})),e.promise},fS.prototype.addProtocolProvider=function(e,t){if("function"!=typeof t.executeCommand)throw new Error("Can't add provider for ".concat(e,": missing a executeCommand function."));this.providers[e]=t},fS.prototype.getProtocolProvider=function(e){return this.providers[e]||UE},fS.prototype.commandsWaitingExecutionCount=function(){var e,t=this.defaultQueue.counters.pending+this.defaultQueue.counters.executing,n=S(this.hostQueues);try{for(n.s();!(e=n.n()).done;){var i=e.value;t+=i[1].counters.pending+i[1].counters.executing}}catch(e){n.e(e)}finally{n.f()}return t},fS.prototype.commandsRunningCount=function(){var e,t=this.defaultQueue.counters.executing,n=S(this.hostQueues);try{for(n.s();!(e=n.n()).done;){t+=e.value[1].counters.executing}}catch(e){n.e(e)}finally{n.f()}return t},fS.prototype.resetCommandsCount=function(e){var t=this.defaultQueue.counters[e];this.defaultQueue.counters[e]=0;var n,i=S(this.hostQueues);try{for(i.s();!(n=i.n()).done;){var r=n.value;t+=r[1].counters[e],r[1].counters[e]=0}}catch(e){i.e(e)}finally{i.f()}return t},fS.prototype.deQueue=function(e){for(var t=function(e){var t,n,i,r=0,a=S(e);try{for(a.s();!(i=a.n()).done;){var o=i.value[1];o.q.length>0&&(r+=o.priority,o.accumulator+=o.priority,(!t||o.accumulator>n)&&(t=o,n=o.accumulator))}}catch(e){a.e(e)}finally{a.f()}if(t)return t.accumulator-=r,t.q}(e.storages);t&&t.length>0;){var n=t.dequeue();if(!n.earlyDropFunction||!n.earlyDropFunction(n))return n;e.counters.pending--,e.counters.cancelled++,n.reject(new DE(n))}};var mS=new ut;function vS(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=e.mainLoop.gfxEngine.getWindowSize();n=n||new tt(Math.floor(r.x/2),Math.floor(r.y/2));var a=t.level0Nodes.map((function(e){return mM.push(e,mM.MODES.ID)})),o=pS(e,t.object3d,t.threejsLayer),s=e.mainLoop.gfxEngine.renderViewToBuffer({camera:e.camera,scene:t.object3d},{x:n.x-i,y:n.y-i,width:1+2*i,height:1+2*i});o(),a.forEach((function(e){return e()}));var l=[];return gS(i,(function(e,t){var n=4*(2*t*i+e),r=s.slice(n,n+4||void 0);mS.fromArray(r).divideScalar(255);var a=CM(mS,Math.pow(256,3)),o=Math.round(a);l.includes(o)||l.push(o)})),l}function gS(e,t){for(var n,i=0;i<=e;i++){for(var r=i*i,a=-i;a<=i;a++)for(var o=a*a,s=-i;s<=i;s++){var l=o+s*s;if(!(l>r)&&(!(l<=n)&&!1===t(a,s)))return}n=r}}function yS(e){return e.layer?e.layer:e.parent?yS(e.parent):void 0}var wS,xS=new Nc,bS=function(e,t,n,i){var r,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=vS(e,i,t,n),s=function(e){o.includes(e.id)&&e.isTileMesh&&a.push({object:e,layer:i})},l=S(i.level0Nodes);try{for(l.s();!(r=l.n()).done;){var A=r.value;A.traverse(s)}}catch(e){l.e(e)}finally{l.f()}return a},MS=function(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5?arguments[5]:void 0;if(void 0!==a?xS.layers.set(a):xS.layers.enableAll(),n<0){var o=e.viewToNormalizedCoords(t);xS.setFromCamera(o,e.camera.camera3D);var s,l=xS.intersectObject(i,!0),A=S(l);try{for(A.s();!(s=A.n()).done;){var c=s.value;c.layer=yS(c.object),r.push(c)}}catch(e){A.e(e)}finally{A.f()}return r}var h={x:t.x-n,y:t.y-n,width:1+2*n,height:1+2*n},u=e.mainLoop.gfxEngine.renderViewToBuffer({scene:i,camera:e.camera},h),d=new Fn;e.mainLoop.gfxEngine.renderer.getClearColor(d);var f=Math.round(255*d.r),p=Math.round(255*d.g),m=Math.round(255*d.b),v=e.viewToNormalizedCoords(t),g=v.clone();return gS(n,(function(t,a){var o=4*((a+n)*(2*n+1)+(t+n)),s=u[o],l=u[o+1],A=u[o+2];if(!(Math.abs(f-s)<=1&&Math.abs(p-l)<=1&&Math.abs(m-A)<=1)){g.setX(v.x+t/e.camera.width).setY(v.y+a/e.camera.height),xS.setFromCamera(g,e.camera.camera3D);var c,h=S(xS.intersectObject(i,!0));try{for(h.s();!(c=h.n()).done;){var d=c.value;d.layer=yS(d.object),r.push(d)}}catch(e){h.e(e)}finally{h.f()}return 0==r.length}})),r},CS=0,BS=1,ES=2,SS=3,TS=4,_S=[1,3,7,60],IS=function(){function e(){s(this,e),this.state=CS,this.lastErrorTimestamp=0,this.errorCount=0,this.failureParams={lowestLevelError:1/0}}return A(e,[{key:"canTryUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();switch(this.state){case CS:return!0;case SS:case BS:case TS:return!1;default:var t=1e3*this.secondsUntilNextTry();return t<=e-this.lastErrorTimestamp}}},{key:"secondsUntilNextTry",value:function(){if(this.state!==ES)return 0;var e=Math.max(0,Math.min(this.errorCount,_S.length)-1);return _S[e]}},{key:"newTry",value:function(){this.state=BS}},{key:"success",value:function(){this.lastErrorTimestamp=0,this.state=CS}},{key:"noMoreUpdatePossible",value:function(){this.state=TS}},{key:"noData",value:function(e){this.state=CS,this.failureParams.lowestLevelError=Math.min(e.targetLevel,this.failureParams.lowestLevelError)}},{key:"failure",value:function(e,t,n){n&&null!=n.targetLevel&&(this.failureParams.lowestLevelError=Math.min(n.targetLevel,this.failureParams.lowestLevelError)),this.lastErrorTimestamp=e,this.state=t?SS:ES,this.errorCount++}},{key:"inError",value:function(){return this.state==SS||this.state==ES}}]),e}(),LS={cleanup:function(e){if(e.layer=null,"function"==typeof e.dispose)e.dispose();else if(e.geometry&&e.geometry.dispose(),e.material)if(Array.isArray(e.material)){var t,n=S(e.material);try{for(n.s();!(t=n.n()).done;){t.value.dispose()}}catch(e){n.e(e)}finally{n.f()}}else e.material.dispose()},removeChildren:function(e,t){var n=t.children.filter((function(t){return(t.layer&&t.layer.id)===e.id}));return t.remove.apply(t,C(n)),n},removeChildrenAndCleanup:function(e,t){var n=t.children.filter((function(t){return(t.layer&&t.layer.id)===e.id}));return t.remove.apply(t,C(n)),t.layer===e&&this.cleanup(t),n},removeChildrenAndCleanupRecursively:function(e,t){var n,i=t.children.filter((function(t){return(t.layer&&t.layer.id)===e.id})),r=S(i);try{for(r.s();!(n=r.n()).done;){var a=n.value;this.removeChildrenAndCleanupRecursively(e,a)}}catch(e){r.e(e)}finally{r.f()}return t.remove.apply(t,C(i)),t.layer&&t.layer.id===e.id&&this.cleanup(t),i}},FS=new ob("EPSG:4326"),kS="";kS=void 0!==document.documentElement.style.transform?"transform":void 0!==document.documentElement.style.webkitTransform?"webkitTransform":void 0!==document.documentElement.style.mozTransform?"mozTransform":void 0!==document.documentElement.style.oTransform?"oTransform":"transform";var PS=function(e){h(n,e);var t=y(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(s(this,n),null==r)throw new Error("coordinates are mandatory to add a Label");var l=(e=t.call(this)).visible;return Object.defineProperty(v(e),"visible",{set:function(e){e!=l&&(l=e,this.content.style.display=e?"block":"none")},get:function(){return l}}),e.isLabel=!0,e.coordinates=r,e.projectedPosition={x:0,y:0},e.boundaries={left:0,right:0,top:0,bottom:0},e.content=document.createElement("div"),e.content.classList.add("itowns-label"),e.content.style.userSelect="none",e.content.style.position="absolute","string"==typeof i?e.content.textContent=i:e.content.appendChild(i),e.baseContent=i,a.isStyle?(e.anchor=a.getTextAnchorPosition(),a.text.haloWidth>0&&e.content.classList.add("itowns-stroke-single"),a.applyToHTML(e.content,o)):e.anchor=[0,0],e.zoom={min:a.zoom&&null!=a.zoom.min?a.zoom.min:2,max:a.zoom&&null!=a.zoom.max?a.zoom.max:24},e.order=a.order||0,e.padding=2,e}return A(n,[{key:"updateProjectedPosition",value:function(e,t){var n=Math.round(e),i=Math.round(t);n==this.projectedPosition.x&&i==this.projectedPosition.y||(this.projectedPosition.x=n,this.projectedPosition.y=i,this.boundaries.left=e+this.offset.left-this.padding,this.boundaries.right=e+this.offset.right+this.padding,this.boundaries.top=t+this.offset.top-this.padding,this.boundaries.bottom=t+this.offset.bottom+this.padding)}},{key:"updateCSSPosition",value:function(){this.content.style[kS]="translate(".concat(this.boundaries.left+this.padding,"px, ").concat(this.boundaries.top+this.padding,"px)")}},{key:"initDimensions",value:function(){if(!this.offset){wS=this.content.getBoundingClientRect();var e=Math.round(wS.width),t=Math.round(wS.height);this.offset={left:e*this.anchor[0],top:t*this.anchor[1]},this.offset.right=this.offset.left+e,this.offset.bottom=this.offset.top+t}}},{key:"update3dPosition",value:function(e){this.coordinates.as(e,FS),FS.toVector3(this.position),this.parent.worldToLocal(this.position),this.updateMatrixWorld()}},{key:"updateElevationFromLayer",value:function(e){var t=Sb.getElevationValueAt(e,this.coordinates,Sb.FAST_READ_Z);if(t&&t!=this.coordinates.z)return this.coordinates.z=t,this.updateHorizonCullingPoint(),!0}},{key:"updateHorizonCullingPoint",value:function(){this.horizonCullingPoint&&this.getWorldPosition(this.horizonCullingPoint)}}]),n}(zt),US=new ob("EPSG:4326",0,0,0),DS=new bb("EPSG:4326",0,0,0,0),RS=function(e){h(n,e);var t=y(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this,n),(i=t.call(this,e,r)).isLabelLayer=!0,i.domElement=document.createElement("div"),i.domElement.id="itowns-label-".concat(i.id),i.defineLayerProperty("visible",!0,(function(){i.domElement.style.display=i.visible?"block":"none"})),i.buildExtent=!0,i}return A(n,[{key:"convert",value:function(e,t){var n=this,i=[],r=this.style&&this.style.text&&this.style.text.field;t.as(e.crs,DS),US.crs=e.crs;var a={zoom:t.zoom};return e.features.forEach((function(t){if(t.type===pC.POINT){var o=t.style&&t.style.text.field;t.geometries.forEach((function(s){if(US.setFromArray(t.vertices,s.size*s.indices[0].offset),e.transformCoordinates(US),2==t.size&&(US.z=0),DS.isPointInside(US)){var l,A=s.properties.style&&s.properties.style.text.field,c={globals:a,properties:function(){return s.properties}};if(A||o||r)A?l=s.properties.style.getTextFromProperties(c):o?l=t.style.getTextFromProperties(c):r&&(l=n.style.getTextFromProperties(c));else if(!(s.properties.style&&s.properties.style.icon||t.style&&t.style.icon||n.style&&n.style.icon))return;var h=(s.properties.style||t.style||n.style).symbolStylefromContext(c),u=new PS(l,US.clone(),h,n.source.sprites);u.layerId=n.id,2==t.size&&(u.needsAltitude=!0),i.push(u)}}))}})),i}},{key:"preUpdate",value:function(){}},{key:"update",value:function(e,t,n,i){var r=this;if(i||!n.children.length){if(!this.frozen&&n.visible&&this.visible){var a=n.getExtentsByProjection(this.source.crs)||[n.extent],o=a[0].zoom;if(!(o<t.zoom.min||o>t.zoom.max)){void 0===n.layerUpdateState[this.id]&&(n.layerUpdateState[this.id]=new IS);var s=n.material.getElevationLayer();if(s&&n.layerUpdateState[s.id].canTryUpdate()&&n.children.forEach((function(t){t.isLabel&&t.needsAltitude&&t.updateElevationFromLayer(r.parent)&&t.update3dPosition(e.view.referenceCrs)})),n.layerUpdateState[this.id].canTryUpdate()){if(this.source.extentInsideLimit(n.extent,o)){n.layerUpdateState[this.id].newTry();var l={layer:this,extentsSource:a,view:e.view,threejsLayer:this.threejsLayer,requester:n};return e.scheduler.execute(l).then((function(t){if(t){var i=e.view.mainLoop.gfxEngine.label2dRenderer,a=[];if(t.forEach((function(t){n.parent?t.forEach((function(t){t.needsAltitude&&t.updateElevationFromLayer(r.parent),n.children.find((function(e){return e.isLabel&&e.baseContent==t.baseContent}))||(n.add(t),t.update3dPosition(e.view.referenceCrs),n.level<4&&(t.horizonCullingPoint=new at,t.updateHorizonCullingPoint()),a.push(t.content))})):t.forEach((function(e){LS.removeChildrenAndCleanupRecursively(r,e),i.removeLabelDOM(e)}))})),a.length>0){var o,s=n.domElements[r.id];s||(s={dom:document.createElement("div"),visible:!0},n.domElements[r.id]=s),(o=s.dom).append.apply(o,a);var l=n.findClosestDomElement(r.id);(l&&l.dom||r.domElement).appendChild(s.dom),s.visible=!0,t.forEach((function(e){return e.forEach((function(e){return e.initDimensions()}))})),t.forEach((function(e){return e.forEach((function(e){e.visible=!1}))})),n.children.sort((function(e){return e.isLabel?-e.order:1})),n.addEventListener("removed",(function(){t.forEach((function(e){return e.forEach((function(e){return n.remove(e)}))})),r.removeNodeDomElement(n)}))}n.layerUpdateState[r.id].noMoreUpdatePossible()}}))}n.layerUpdateState[this.id].noMoreUpdatePossible()}}}}else LS.removeChildrenAndCleanupRecursively(this,n)}},{key:"removeLabelsFromNodeRecursive",value:function(e){var t=this;e.children.forEach((function(n){n.isLabel&&n.layerId===t.id?e.remove(n):n.isTileMesh&&t.removeLabelsFromNodeRecursive(n)})),this.removeNodeDomElement(e)}},{key:"removeNodeDomElement",value:function(e){if(e.domElements[this.id]){var t=e.domElements[this.id].dom;t.parentElement.removeChild(t),delete e.domElements[this.id]}}},{key:"delete",value:function(){var e=this;this.domElement.parentElement.removeChild(this.domElement),this.parent.level0Nodes.forEach((function(t){return e.removeLabelsFromNodeRecursive(t)}))}}]),n}(uE),OS="layers-initialized",NS="layer-removed",zS="layer-added",QS="initialized",GS="camera-moved",HS=function(e,t){e.object3d&&(e.object3d.visible=e.visible),e.threejsLayer&&(e.visible?t.camera.camera3D.layers.enable(e.threejsLayer):t.camera.camera3D.layers.disable(e.threejsLayer))};var VS,jS=new tt,WS=new bt,XS=new tt,YS=new dn,KS=new at,ZS=new at,JS=new ob("EPSG:4326"),qS=[],$S=function(e){h(n,e);var t=y(n);function n(e,i){var r,a,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(s(this,n),!i)throw new Error("Invalid viewerDiv parameter (must non be null/undefined)");(r=t.call(this)).domElement=i,r.referenceCrs=e,JS.crs=e,a=o.renderer&&o.renderer.domElement?new ME(o.renderer):new ME(i,o.renderer),r.engine=a,r.mainLoop=o.mainLoop||new qb(new fS,a),r.scene=o.scene3D||new Qt,o.scene3D||(r.scene.autoUpdate=!1),r.camera=new Gb(r.referenceCrs,r.mainLoop.gfxEngine.getWindowSize().x,r.mainLoop.gfxEngine.getWindowSize().y,o.camera),r._frameRequesters={},r._layers=[],window.addEventListener("resize",(function(){return r.resize()}),!1),r._changeSources=new Set,__DEBUG__&&(r.isDebugMode=!0),r._delayedFrameRequesterRemoval=[],r._allLayersAreReadyCallback=function(){r.getLayers().every((function(e){return e.ready}))&&0==r.mainLoop.scheduler.commandsWaitingExecutionCount()&&0==r.mainLoop.renderingState&&(r.dispatchEvent({type:OS}),r.removeFrameRequester(Jb,r._allLayersAreReadyCallback))},r.camera.resize(r.domElement.clientWidth,r.domElement.clientHeight);var l=function e(){r.removeEventListener(OS,e),r.dispatchEvent({type:QS})};return r.addEventListener(OS,l),r._fullSizeDepthBuffer=new Uint8Array(4*r.camera.width*r.camera.height),r._pixelDepthBuffer=new Uint8Array(4),r.domElement.tabIndex=-1,r.domElement.focus(),qS.push(v(r)),r}return A(n,[{key:"dispose",value:function(){var e=qS.indexOf(this);if(-1!=e){this.controls&&this.controls.dispose&&this.controls.dispose(),this.removeAllFrameRequesters(),this.removeAllEvents();var t,n=S(this.getLayers((function(e){return!e.isTiledGeometryLayer&&!e.isAtmosphere})));try{for(n.s();!(t=n.n()).done;){var i=t.value;this.removeLayer(i.id)}}catch(e){n.e(e)}finally{n.f()}var r,a=S(this.getLayers((function(e){return e.isAtmosphere})));try{for(a.s();!(r=a.n()).done;){var o=r.value;this.removeLayer(o.id)}}catch(e){a.e(e)}finally{a.f()}var s,l=S(this.getLayers((function(e){return e.isTiledGeometryLayer})));try{for(l.s();!(s=l.n()).done;){var A=s.value;this.removeLayer(A.id)}}catch(e){l.e(e)}finally{l.f()}qS.splice(e,1),this.mainLoop.dispose()}else console.warn("View already disposed")}},{key:"addLayer",value:function(e,t){var n=this;if(!e||!e.isLayer)return Promise.reject(new Error("Add Layer type object"));if(this.getLayerById(e.id))return e._reject(new Error("Invalid id '".concat(e.id,"': id already used")));if(e=function(e,t,n){var i=t.source;if(n&&!t.extent&&(t.extent=n.extent,i&&!i.extent&&(i.extent=n.extent)),t.isGeometryLayer?(n&&(t.threejsLayer=e.mainLoop.gfxEngine.getUniqueThreejsLayer()),t.defineLayerProperty("visible",!0,(function(){return HS(t,e)})),HS(t,e),t.crs=e.referenceCrs):t.crs||(n&&n.tileMatrixSets&&n.tileMatrixSets.includes(Jx.formatToTms(i.crs))?t.crs=i.crs:t.crs=n&&n.extent.crs),t.isLabelLayer)e.mainLoop.gfxEngine.label2dRenderer.registerLayer(t);else if(t.labelEnabled||t.addLabelLayer){t.labelEnabled&&console.info("layer.labelEnabled is deprecated use addLabelLayer, instead of"),t.buildExtent=!0;var r=new RS("".concat(t.id,"-label"),{source:i,style:t.style,zoom:t.zoom,crs:i.crs,visible:t.visible});t.addEventListener("visible-property-changed",(function(){r.visible=t.visible})),e.addEventListener(NS,(function n(i){i.layerId===t.id&&e.removeLayer(r.id),e.removeEventListener(NS,n)})),t.whenReady=t.whenReady.then((function(){return e.addLayer(r),t}))}return t}(this,e,t),t)if(e.isColorLayer){var i=this.getLayers((function(e){return e.isColorLayer}));if(e.sequence=i.length,!(t.countColorLayersTextures.apply(t,C(i).concat([e]))<=BM()))return e._reject(new Error("Cant add color layer ".concat(e.id,": the maximum layer is reached")));t.attach(e)}else e.isElevationLayer&&"image/x-bil;bits=32"==e.source.format?(e.source.networkOptions.isWebGL2=this.mainLoop.gfxEngine.renderer.capabilities.isWebGL2,t.attach(e)):t.attach(e);else{if("function"!=typeof e.update)return e._reject(new Error("Cant add GeometryLayer: missing a update function"));if("function"!=typeof e.preUpdate)return e._reject(new Error("Cant add GeometryLayer: missing a preUpdate function"));this._layers.push(e)}return e.object3d&&!e.object3d.parent&&e.object3d!==this.scene&&this.scene.add(e.object3d),Promise.all(e._promises).then((function(){e._resolve(),n.notifyChange(t||e,!1),n._frameRequesters[Jb]&&n._frameRequesters[Jb].includes(n._allLayersAreReadyCallback)||n.addFrameRequester(Jb,n._allLayersAreReadyCallback),n.dispatchEvent({type:zS,layerId:e.id})}),e._reject),e.whenReady}},{key:"removeLayer",value:function(e){var t=this.getLayerById(e);if(t){var n=t.parent;if(t.delete(),n&&!n.detach(t))throw new Error("Error to detach ".concat(e," from ").concat(n.id));if(null==n&&this._layers.splice(this._layers.findIndex((function(t){return t.id==e})),1),t.isColorLayer){var i,r=S(this.getLayers((function(e){return e.isColorLayer})));try{for(r.s();!(i=r.n()).done;){var a=i.value;a.sequence>t.sequence&&a.sequence--}}catch(e){r.e(e)}finally{r.f()}}var o,s=0,l=S(qS);try{for(l.s();!(o=l.n()).done;){s+=o.value.getLayers((function(e){return e.source.uid==t.source.uid&&e.crs==t.crs})).length}}catch(e){l.e(e)}finally{l.f()}return t.source.onLayerRemoved({unusedCrs:0==s?t.crs:void 0}),this.notifyChange(this.camera),this.dispatchEvent({type:NS,layerId:e}),!0}throw new Error("".concat(e," doesn't exist"))}},{key:"notifyChange",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&(this._changeSources.add(e),(e.isTileMesh||e.isCamera)&&(this._fullSizeDepthBuffer.needsUpdate=!0)),this.mainLoop.scheduleViewUpdate(this,t)}},{key:"getLayers",value:function(e){var t,n=[],i=S(this._layers);try{for(i.s();!(t=i.n()).done;){var r=t.value;if(e&&!e(r)||n.push(r),r.attachedLayers){var a,o=S(r.attachedLayers);try{for(o.s();!(a=o.n()).done;){var s=a.value;e&&!e(s,r)||n.push(s)}}catch(e){o.e(e)}finally{o.f()}}}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"getLayerById",value:function(e){return this.getLayers((function(t){return t.id===e}))[0]}},{key:"addFrameRequester",value:function(e,t){if("function"!=typeof t)throw new Error("frameRequester must be a function");this._frameRequesters[e]?this._frameRequesters[e].push(t):this._frameRequesters[e]=[t]}},{key:"removeFrameRequester",value:function(e,t){this._frameRequesters[e].includes(t)?this._delayedFrameRequesterRemoval.push({when:e,frameRequester:t}):console.error("Invalid call to removeFrameRequester: frameRequester isn't registered")}},{key:"removeAllFrameRequesters",value:function(){for(var e in this._frameRequesters)if(Object.prototype.hasOwnProperty.call(this._frameRequesters,e)){var t,n=S(this._frameRequesters[e]);try{for(n.s();!(t=n.n()).done;){var i=t.value;this.removeFrameRequester(e,i)}}catch(e){n.e(e)}finally{n.f()}}this._executeFrameRequestersRemovals()}},{key:"removeAllEvents",value:function(){if(void 0!==this._listeners){for(var e in this._listeners)Object.prototype.hasOwnProperty.call(this._listeners,e)&&delete this._listeners[e];this._listeners=void 0}}},{key:"_executeFrameRequestersRemovals",value:function(){var e,t=S(this._delayedFrameRequesterRemoval);try{for(t.s();!(e=t.n()).done;){var n=e.value,i=this._frameRequesters[n.when].indexOf(n.frameRequester);i>=0?this._frameRequesters[n.when].splice(i,1):console.warn("FrameReq has already been removed")}}catch(e){t.e(e)}finally{t.f()}this._delayedFrameRequesterRemoval.length=0}},{key:"execFrameRequesters",value:function(e,t,n){if(this._frameRequesters[e]){this._delayedFrameRequesterRemoval.length>0&&this._executeFrameRequestersRemovals();for(var i=arguments.length,r=new Array(i>3?i-3:0),a=3;a<i;a++)r[a-3]=arguments[a];var o,s=S(this._frameRequesters[e]);try{for(s.s();!(o=s.n()).done;){var l=o.value;l.update?l.update(t,n,r):l(t,n,r)}}catch(e){s.e(e)}finally{s.f()}}}},{key:"eventToViewCoords",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jS,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.domElement.getBoundingClientRect();if(void 0!==e.touches&&e.touches.length)return t.set(e.touches[n].clientX-i.x,e.touches[n].clientY-i.y);var r=e.target.getBoundingClientRect();return t.set(r.x+e.offsetX-i.x,r.y+e.offsetY-i.y)}},{key:"eventToNormalizedCoords",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.viewToNormalizedCoords(this.eventToViewCoords(e,jS,t))}},{key:"viewToNormalizedCoords",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:jS;return t.x=e.x/this.camera.width*2-1,t.y=e.y/this.camera.height*-2+1,t}},{key:"normalizedToViewCoords",value:function(e){return jS.x=.5*(e.x+1)*this.camera.width,jS.y=-.5*(e.y-1)*this.camera.height,jS}},{key:"pickObjectsAt",value:function(e){for(var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length,r=new Array(i>2?i-2:0),a=2;a<i;a++)r[a-2]=arguments[a];var o=[];if((r=0==r.length?this.getLayers((function(e){return e.isGeometryLayer})):r).forEach((function(e){"string"==typeof e&&(e=t.getLayerById(e)),e&&(e.isGeometryLayer||e.isObject3D)&&o.push(e)})),0==o.length)return[];for(var s=[],l=e instanceof Event?this.eventToViewCoords(e):e,A=0,c=o;A<c.length;A++){var h=c[A];if(h.isGeometryLayer){if(!h.ready){console.warn("view.pickObjectAt : layer is not ready : ",h);continue}h.pickObjectsAt(this,l,n,s)}else MS(this,l,n,h,s)}return s}},{key:"getScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.28;return this.getScaleFromDistance(e,this.getDistanceFromCamera())}},{key:"getScaleFromDistance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.28,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;e/=1e3;var n=Hh.degToRad(this.camera.camera3D.fov),i=this.camera.height/(2*t*Math.tan(.5*n));return e*i}},{key:"getDistanceFromCamera",value:function(e){return this.getPickingPositionFromDepth(e,ZS),this.camera.camera3D.position.distanceTo(ZS)}},{key:"getPixelsToMeters",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0;return this.camera.camera3D.isOrthographicCamera?e*(VS=(this.camera.camera3D.right-this.camera.camera3D.left)/this.camera.camera3D.zoom)/this.camera.width:this.getPixelsToMetersFromDistance(e,this.getDistanceFromCamera(t))}},{key:"getPixelsToMetersFromDistance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e*t/this.camera._preSSE}},{key:"getMetersToPixels",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0;return this.camera.camera3D.isOrthographicCamera?(VS=(this.camera.camera3D.right-this.camera.camera3D.left)/this.camera.camera3D.zoom,e*this.camera.width/VS):this.getMetersToPixelsFromDistance(e,this.getDistanceFromCamera(t))}},{key:"getMetersToPixelsFromDistance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.camera._preSSE*e/t}},{key:"pickFeaturesAt",value:function(e){for(var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,i=arguments.length,r=new Array(i>2?i-2:0),a=2;a<i;a++)r[a-2]=arguments[a];Array.isArray(r[0])&&(console.warn("Deprecated: the ...where argument of View#pickFeaturesAt should not be an array anymore, but a list: use the spread operator if needed."),r=r[0]);var o=[],s={};(r=0==r.length?this.getLayers((function(e){return e.isColorLayer||e.isGeometryLayer})):r).forEach((function(e){"string"==typeof e&&(e=t.getLayerById(e)),e&&e.isLayer&&(s[e.id]=[],e.isColorLayer&&o.push(e.id))}));var l=e instanceof Event?this.eventToViewCoords(e,jS):e,A=this.pickObjectsAt.apply(this,[l,n].concat(C(r)));if(A.length>0&&A.forEach((function(e){return s[e.layer.id].push(e)})),0==o.length)return s;this.getPickingPositionFromDepth(l,ZS);var c,h=this.camera.camera3D.position.distanceTo(ZS);JS.setFromVector3(ZS);var u={M:this.getPixelsToMetersFromDistance(n,h),D:.001*n};this.isPlanarView?u.D=u.M:this.getPixelsToDegrees&&(u.D=this.getMetersToDegrees(u.M));var d,f=bS(this,l,n,this.tileLayer),p=S(f);try{for(p.s();!(d=p.n()).done;){var m=d.value;if(m.object.material){var v,g=S(m.object.material.getLayers(o));try{for(g.s();!(v=g.n()).done;){var y,w=v.value,x=S(w.textures);try{for(x.s();!(y=x.n()).done;){var b=y.value;b.features&&(c=Jx.isMetricUnit(b.features.crs)?u.M:u.D,s[w.id]=s[w.id].concat(TE(JS,b.features,c)))}}catch(e){x.e(e)}finally{x.f()}}}catch(e){g.e(e)}finally{g.f()}}}}catch(e){p.e(e)}finally{p.f()}return s}},{key:"readDepthBuffer",value:function(e,t,n,i,r){var a=this.mainLoop.gfxEngine,o=this.tileLayer.wireframe,s=this.tileLayer.opacity,l=this.tileLayer.visible;o&&(this.tileLayer.wireframe=!1),s<1&&(this.tileLayer.opacity=1),l||(this.tileLayer.visible=!0);var A=this.tileLayer.level0Nodes.map((function(e){return mM.push(e,mM.MODES.DEPTH)}));return r=a.renderViewToBuffer({camera:this.camera,scene:this.tileLayer.object3d},{x:e,y:t,width:n,height:i,buffer:r}),A.forEach((function(e){return e()})),this.tileLayer.wireframe!==o&&(this.tileLayer.wireframe=o),this.tileLayer.opacity!==s&&(this.tileLayer.opacity=s),this.tileLayer.visible!==l&&(this.tileLayer.visible=l),r}},{key:"getPickingPositionFromDepth",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new at;if(this.tileLayer&&0!=this.tileLayer.level0Nodes.length&&this.tileLayer.level0Nodes[0]){var n=this.mainLoop,i=0==n.scheduler.commandsWaitingExecutionCount()&&0==n.renderingState,r=n.gfxEngine,a=r.getWindowSize(),o=this.camera.camera3D;(e=e||a.clone().multiplyScalar(.5)).x=Math.floor(e.x),e.y=Math.floor(e.y);var s,l=o.layers.mask;if(o.layers.mask=1<<this.tileLayer.threejsLayer,i){this._fullSizeDepthBuffer.needsUpdate&&(this.readDepthBuffer(0,0,a.x,a.y,this._fullSizeDepthBuffer),this._fullSizeDepthBuffer.needsUpdate=!1);var A=4*((a.y-e.y-1)*a.x+e.x);s=this._fullSizeDepthBuffer.slice(A,A+4)}else s=this.readDepthBuffer(e.x,e.y,1,1,this._pixelDepthBuffer);if(XS.x=e.x/a.x*2-1,XS.y=-e.y/a.y*2+1,aM()&&"PerspectiveCamera"==o.type){YS.origin.copy(o.position),YS.direction.set(XS.x,XS.y,.5),WS.multiplyMatrices(o.matrixWorld,WS.copy(o.projectionMatrix).invert()),YS.direction.applyMatrix4(WS),YS.direction.sub(YS.origin),KS.set(0,0,1),KS.applyMatrix4(WS),KS.sub(YS.origin);var c=KS.angleTo(YS.direction),h=r.depthBufferRGBAValueToOrthoZ(s,o),u=h/Math.cos(c);t.addVectors(o.position,YS.direction.setLength(u))}else{var d=r.depthBufferRGBAValueToOrthoZ(s,o);t.set(XS.x,XS.y,d),t.unproject(o)}if(o.layers.mask=l,!(t.length()>1e7))return t}else t=void 0}},{key:"pickCoordinates",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ob(this.tileLayer.extent.crs);return e instanceof Event?this.eventToViewCoords(e):e&&void 0!==e.x&&void 0!==e.y?jS.copy(e):jS.set(this.mainLoop.gfxEngine.width/2,this.mainLoop.gfxEngine.height/2),this.getPickingPositionFromDepth(jS,ZS),JS.crs=this.referenceCrs,JS.setFromVector3(ZS),JS.as(t.crs,t),t}},{key:"resize",value:function(e,t){null==e&&(e=this.domElement.clientWidth),null==t&&(t=this.domElement.clientHeight),this._fullSizeDepthBuffer=new Uint8Array(4*e*t),this.mainLoop.gfxEngine.onWindowResize(e,t),this.camera.resize(e,t),this.notifyChange(this.camera.camera3D)}}]),n}(Je),eT=1e3/60,tT=0,nT=1,iT=2,rT=function(e){e.id&&(clearInterval(e.id),e.id=void 0),e.waitTimer&&(clearInterval(e.waitTimer),e.waitTimer=void 0),e.keyframe=0},aT=function(e){rT(e),e.isEnded()&&e.dispatchEvent({type:"animation-ended"}),e.dispatchEvent({type:"animation-stopped"}),e.duration=0},oT=function(e){h(n,e);var t=y(n);function n(){var e;return s(this,n),(e=t.call(this)).id=null,e.keyframe=0,e.duration=0,e.state=tT,e.waitTimer=null,e}return A(n,[{key:"isPlaying",value:function(){return this.state===nT}},{key:"isStopped",value:function(){return this.state===tT}},{key:"isEnded",value:function(){return this.state===iT}},{key:"play",value:function(e){this.duration=e,this.dispatchEvent({type:"animation-started"}),this.state=nT,rT(this),this.id=setInterval(this.frame.bind(this),eT)}},{key:"playLater",value:function(e,t){var n=Math.floor(eT*t);window.clearInterval(this.waitTimer);var i=this;this.waitTimer=window.setTimeout((function(){i.play(e)}),n)}},{key:"stop",value:function(){this.state=tT,aT(this)}},{key:"frame",value:function(){this.keyframe<this.duration?(this.keyframe++,this.dispatchEvent({type:"animation-frame"})):(this.state=iT,aT(this))}}]),n}(Je);function sT(e){var t={index:null,position:null,normal:null,uvs:[]},n=[],i=e.builder,r=e.segment||8,a=(r+1)*(r+1)+(e.disableSkirt?0:4*r);if(a>Math.pow(2,32))throw new Error("Tile segments count is too big");var o=r*r*2+(e.disableSkirt?0:4*r*2);t.position=new Float32Array(3*a),t.normal=new Float32Array(3*a);var s=e.builder.uvCount;s>1&&(t.uvs[1]=new Float32Array(a)),n[0]=function(){},e.buildIndexAndUv_0&&(a<Math.pow(2,8)?t.index=new Uint8Array(3*o):a<Math.pow(2,16)?t.index=new Uint16Array(3*o):a<Math.pow(2,32)&&(t.index=new Uint32Array(3*o)),t.uvs[0]=new Float32Array(2*a),n[0]=function(e,n,i){t.uvs[0][2*e+0]=n,t.uvs[0][2*e+1]=i});var l=Math.max(2,Math.floor(r)||2),A=Math.max(2,Math.floor(r)||2),c=0,h=[],u=[],d=[];i.prepare(e);for(var f=0;f<=A;f++){var p=[],m=f/A;i.vProjecte(m,e),s>1&&function(){var r=i.computeUvs[1](e);n[1]=function(e){t.uvs[1][e]=r}}();for(var v=0;v<=l;v++){var g=v/l,y=3*c;i.uProjecte(g,e);var w=i.vertexPosition(e,e.projected),x=i.vertexNormal(e);w.sub(e.center),e.quatNormalToZ&&(w.applyQuaternion(e.quatNormalToZ),x.applyQuaternion(e.quatNormalToZ)),w.toArray(t.position,y),x.toArray(t.normal,y);var b,M=S(n);try{for(M.s();!(b=M.n()).done;){(0,b.value)(c,g,m)}}catch(e){M.e(e)}finally{M.f()}e.disableSkirt||0!==f&&f!==A&&(v===l?u.push(c):0===v&&d.push(c)),p.push(c),c++}h.push(p),0===f?u=u.concat(p):f===A&&(u=u.concat(p.slice().reverse()))}function C(e,n,i,r){return t.index[r+0]=e,t.index[r+1]=n,t.index[r+2]=i,r+3}e.disableSkirt||(u=u.concat(d.reverse()));var B=0;if(e.buildIndexAndUv_0)for(var E=0;E<A;E++)for(var T=0;T<l;T++){var _=h[E][T+1],I=h[E][T],L=h[E+1][T],F=h[E+1][T+1];B=C(F,I,_,B),B=C(F,L,I,B)}var k=c;if(!e.disableSkirt){var P=(new at).fromArray(t.position).distanceTo((new at).fromArray(t.position,3)),U=function(){},D=function(){};e.buildIndexAndUv_0&&(U=function(e,t,n,i,r){return e=C(t,n,i,e),e=C(t,i,r,e)},D=function(e){t.uvs[0][2*c+0]=t.uvs[0][2*e+0],t.uvs[0][2*c+1]=t.uvs[0][2*e+1]});for(var R=0;R<u.length;R++){var O=u[R],N=3*c,z=3*O;t.position[N+0]=t.position[z+0]-t.normal[z+0]*P,t.position[N+1]=t.position[z+1]-t.normal[z+1]*P,t.position[N+2]=t.position[z+2]-t.normal[z+2]*P,t.normal[N+0]=t.normal[z+0],t.normal[N+1]=t.normal[z+1],t.normal[N+2]=t.normal[z+2],D(O),s>1&&(t.uvs[1][c]=t.uvs[1][O]);var Q=(R+1)%u.length;B=U(B,O,c,0===Q?k:c+1,u[Q]),c++}}return t}function lT(e){e.buildIndexAndUv_0=!0,e.center=e.builder.center(e.extent).clone();var t=sT(e);t.index=new zn(t.index,1),t.uvs[0]=new zn(t.uvs[0],2),t.position=new zn(t.position,3),t.normal=new zn(t.normal,3);for(var n=1;n<e.builder.uvCount;n++)t.uvs[1]=new zn(t.uvs[1],1);return t}var AT=function(e){h(n,e);var t=y(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:lT(e);s(this,n),(i=t.call(this)).center=e.center,i.extent=e.extent,i.setIndex(r.index),i.setAttribute("position",r.position),i.setAttribute("normal",r.normal);for(var a=0;a<r.uvs.length;a++)i.setAttribute("uv_".concat(a),r.uvs[a]);return i.computeBoundingBox(),i.OBB={},i}return A(n)}(si),cT=Math.PI/4,hT=1/(2*Math.PI),uT=new at(0,0,1),dT=new at(0,1,0),fT=new nt,pT=new nt,mT=new nt;function vT(e){return 1-(.5-Math.log(Math.tan(cT+.5*Hh.degToRad(e)))*hT)}var gT,yT,wT=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,e),this.tmp={coords:[new ob("EPSG:4326",0,0),new ob("EPSG:4326",0,0)],position:new at,dimension:new tt},this.crs=t.crs,this.uvCount=t.uvCount,this.computeUvs=[function(){},function(e){var t=vT(e.projected.latitude)*e.nbRow;return(isFinite(t)?t:0)-e.deltaUV1}]}return A(e,[{key:"prepare",value:function(e){e.nbRow=Math.pow(2,e.level+1);var t=vT(e.extent.south);isFinite(t)||(t=0);var n=t%(1/e.nbRow);e.deltaUV1=(t-n)*e.nbRow,e.quatNormalToZ=mT.setFromAxisAngle(dT,-(.5*Math.PI-Hh.degToRad(e.extent.center().latitude))),e.projected={longitude:0,latitude:0},e.extent.dimensions(this.tmp.dimension)}},{key:"center",value:function(e){return e.center(this.tmp.coords[0]).as(this.crs,this.tmp.coords[1]).toVector3()}},{key:"vertexPosition",value:function(e){return this.tmp.coords[0].setFromValues(e.projected.longitude,e.projected.latitude),this.tmp.coords[0].as(this.crs,this.tmp.coords[1]).toVector3(this.tmp.position),this.tmp.position}},{key:"vertexNormal",value:function(){return this.tmp.coords[1].geodesicNormal}},{key:"uProjecte",value:function(e,t){t.projected.longitude=t.extent.west+e*this.tmp.dimension.x}},{key:"vProjecte",value:function(e,t){t.projected.latitude=t.extent.south+e*this.tmp.dimension.y}},{key:"computeSharableExtent",value:function(e){var t=Math.abs(e.west-e.east)/2,n=new bb(e.crs,-t,t,e.south,e.north),i=Hh.degToRad(e.west-n.west),r=Hh.degToRad(90-e.center(this.tmp.coords[0]).latitude);return fT.setFromAxisAngle(uT,i),pT.setFromAxisAngle(dT,r),fT.multiply(pT),{sharableExtent:n,quaternion:fT.clone(),position:this.center(e)}}}]),e}(),xT=new wT({crs:"EPSG:4978",uvCount:1}),bT=new at,MT=new tt,CT=new at,BT=new ob("EPSG:4326",0,0,0),ET=function(e){h(n,e);var t=y(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new at(1/0,1/0,1/0),r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new at(-1/0,-1/0,-1/0);return s(this,n),zt.DefaultUp.set(0,0,1),(e=t.call(this)).box3D=new tn(i.clone(),r.clone()),e.natBox=e.box3D.clone(),e.z={min:0,max:0,scale:1},g(e,v(e))}return A(n,[{key:"clone",value:function(){return(new n).copy(this)}},{key:"copy",value:function(e){return b(u(n.prototype),"copy",this).call(this,e),this.box3D.copy(e.box3D),this.natBox.copy(e.natBox),this.z.min=e.z.min,this.z.max=e.z.max,this.z.scale=e.z.scale,this}},{key:"update",value:function(){this.updateMatrixWorld(!0)}},{key:"updateZ",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.z.scale;this.z={min:e,max:t,scale:n,delta:Math.abs(t-e)*n},this.box3D.min.z=this.natBox.min.z+e*n,this.box3D.max.z=this.natBox.max.z+t*n}},{key:"updateScaleZ",value:function(e){e>0&&this.updateZ(this.z.min,this.z.max,e)}},{key:"isSphereAboveXYBox",value:function(e){var t=this.worldToLocal(e.center),n=Math.max(this.box3D.min.x,Math.min(t.x,this.box3D.max.x)),i=Math.max(this.box3D.min.y,Math.min(t.y,this.box3D.max.y));return Math.sqrt((n-t.x)*(n-t.x)+(i-t.y)*(i-t.y))<e.radius}},{key:"setFromExtent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.min||0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.max||0;if("EPSG:4326"==e.crs){var r=xT.computeSharableExtent(e),a=r.sharableExtent,o=r.quaternion,s=r.position,l=Math.max(Math.floor(a.dimensions(MT).x/90+1),2),A={extent:a,level:0,segment:l,disableSkirt:!0,builder:xT},c=new AT(A);gT||(gT=new n),gT.box3D.copy(c.boundingBox),gT.natBox.copy(c.boundingBox),this.copy(gT),this.updateZ(t,i),this.position.copy(s),this.quaternion.copy(o),this.updateMatrixWorld(!0)}else{if(Jx.isTms(e.crs)||!Jx.isMetricUnit(e.crs))throw new Error("Unsupported extent crs");e.center(BT).toVector3(this.position),e.dimensions(MT),bT.set(MT.x,MT.y,Math.abs(i-t)),this.box3D.setFromCenterAndSize(CT,bT),this.updateMatrixWorld(!0)}return this}}]),n}(zt),ST=new at,TT=new ob("EPSG:4326",0,0,0),_T=new eb,IT=[],LT=new at;function FT(e){return e-360*Math.floor((e+180)/360)}function kT(e){return e.getLayers((function(e){return e.isTiledGeometryLayer}))[0]}var PT=function(e){h(n,e);var t=y(n);function n(){var e;return s(this,n),e=t.call(this),zt.DefaultUp.set(0,0,1),e.seaLevel=new zt,e.target=new zt,e.target.rotation.order="ZXY",e.camera=new Oi,e.add(e.seaLevel),e.seaLevel.add(e.target),e.target.add(e.camera),e.coord=new ob("EPSG:4978",0,0),e.targetWorldPosition=new at,e.removeAll=function(){},e._onChangeCallback=null,e}return A(n,[{key:"applyTransformToCamera",value:function(e,t){var n=this;this.proxy?(t.quaternion._onChange(this._onChangeCallback),this.camera.matrixWorld.decompose(this.proxy.position,t.quaternion,t.scale),t.quaternion._onChange((function(){return n.removeProxy(e,t)}))):this.camera.matrixWorld.decompose(t.position,t.quaternion,t.scale)}},{key:"setProxy",value:function(e,t){var n=this;!this.proxy&&e&&t&&(this.proxy={position:new at},Object.keys(t.position).forEach((function(i){return function(e,t,n,i){n.proxy.position[i]=t.position[i],Object.defineProperty(t.position,i,{get:function(){return n.proxy.position[i]},set:function(r){n.removeProxy(e,t),t.position[i]=r}})}(e,t,n,i)})),this._onChangeCallback=t.quaternion._onChangeCallback,t.quaternion._onChange((function(){return n.removeProxy(e,t)})))}},{key:"removeProxy",value:function(e,t){var n=this;this.stop(e),this.proxy&&e&&t&&(Object.keys(t.position).forEach((function(e){return Object.defineProperty(t.position,e,{value:n.proxy.position[e],writable:!0})})),t.quaternion._onChange(this._onChangeCallback),this.proxy=null)}},{key:"setTargetFromCoordinate",value:function(e,t){t.as(kT(e).extent.crs,this.coord);var n=Math.max(0,this.coord.z);this.coord.z=n,this.coord.as(e.referenceCrs).toVector3(ST),"EPSG:4978"==e.referenceCrs?(this.lookAt(ST),this.seaLevel.position.set(0,0,ST.length()-n)):(this.position.set(ST.x,ST.y,0),this.seaLevel.position.set(0,0,0)),this.target.position.set(0,0,n)}},{key:"setFromPositions",value:function(e,t){this.setTargetFromCoordinate(e,new ob(e.referenceCrs,ST)),this.target.rotation.set(0,0,0),this.updateMatrixWorld(!0),this.camera.position.copy(t),this.target.worldToLocal(this.camera.position);var n=this.camera.position.length();this.target.rotation.x=Math.asin(this.camera.position.z/n);var i=Hh.clamp(this.camera.position.y/(Math.cos(this.target.rotation.x)*n),-1,1);this.target.rotation.z=Math.sign(-this.camera.position.x)*Math.acos(i),this.camera.position.set(0,n,0)}},{key:"applyParams",value:function(e,t){t.coord&&this.setTargetFromCoordinate(e,t.coord),null!=t.tilt&&(this.target.rotation.x=Hh.degToRad(t.tilt)),null!=t.heading&&(this.target.rotation.z=Hh.degToRad(FT(t.heading+180))),t.range&&this.camera.position.set(0,t.range,0),this.camera.rotation.set(.5*-Math.PI,0,Math.PI),this.updateMatrixWorld(!0),this.targetWorldPosition.setFromMatrixPosition(this.seaLevel.matrixWorld)}},{key:"getParams",value:function(){return{coord:this.coord.clone(),tilt:this.tilt,heading:this.heading,range:this.range,targetWorldPosition:this.targetWorldPosition}}},{key:"setfromCamera",value:function(e,t,n){t.updateMatrixWorld(!0),null==n&&(n=e.getPickingPositionFromDepth()||function(e,t){var n=new at(0,0,.5);if(n.unproject(t),n.sub(t.position).normalize(),"EPSG:4978"==e.referenceCrs)return _T.intersection({direction:n,origin:t.position});var i=t.position.z/n.z;return n.multiplyScalar(i).add(t.position)}(e,t));var i=n&&!isNaN(n.x)?t.position.distanceTo(n):100;t.localToWorld(ST.set(0,0,-i)),this.setFromPositions(e,t.position)}},{key:"copyObject3D",value:function(e){return this.copy(e,!1),this.seaLevel.copy(e.seaLevel,!1),this.target.copy(e.target,!1),this.camera.copy(e.camera),this}},{key:"animateCameraToLookAtTarget",value:function(e,t,i){var r=this;i.easing=i.easing||ud.Easing.Quartic.InOut,this.setfromCamera(e,t);var a=new ud.Group;this.start=(this.start||new n).copyObject3D(this),this.end=(this.end||new n).copyObject3D(this);var o,s,l=i.time||2500,A={t:0},c=[],h={promise:new Promise((function(e,t){o=e,s=t})),resolve:o,reject:s};return this.addPlaceTargetOnGround(e,t,i.coord,A),this.end.applyParams(e,i),c.push(new ud.Tween(A,a).to({t:1},l).easing(i.easing).onUpdate((function(t){"EPSG:4978"==e.referenceCrs&&r.quaternion.slerpQuaternions(r.start.quaternion,r.end.quaternion,t.t),r.camera.quaternion.slerpQuaternions(r.start.camera.quaternion,r.end.camera.quaternion,t.t),r.target.rotation.set(0,0,0),r.target.rotateZ(Hh.lerp(r.start.target.rotation.z,r.end.target.rotation.z,t.t)),r.target.rotateX(Hh.lerp(r.start.target.rotation.x,r.end.target.rotation.x,t.t))})).onComplete(i.onComplete)),"EPSG:4978"!=e.referenceCrs&&c.push(new ud.Tween(this.position,a).to(this.end.position,l).easing(i.easing).onComplete(i.onComplete)),c.push(new ud.Tween(this.seaLevel.position,a).to(this.end.seaLevel.position,l).easing(i.easing)),c.push(new ud.Tween(this.camera.position,a).to(this.end.camera.position,l).easing(i.easing)),this.animationFrameRequester=function(){a.update(),r.updateMatrixWorld(!0),r.applyTransformToCamera(e,t),r.targetWorldPosition.setFromMatrixPosition(r.seaLevel.matrixWorld),i.callback&&i.callback(r),TT.crs=e.referenceCrs,TT.setFromVector3(r.targetWorldPosition).as(kT(e).extent.crs,r.coord),e.notifyChange(t)},this.removeAll=function(t){this.removeAll=function(){},a.removeAll(),this.animationFrameRequester&&e.removeFrameRequester(Kb,this.animationFrameRequester),h.resolve(void 0!==t),this.animationFrameRequester=null},c[c.length-1].onComplete(this.removeAll),c.forEach((function(e){return e.start()})),e.addFrameRequester(Kb,this.animationFrameRequester),e.notifyChange(t),h}},{key:"stop",value:function(e){this.removePlaceTargetOnGround(e),this.removeAll()}},{key:"addPlaceTargetOnGround",value:function(e,t,n){var i=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{t:1};if(this.removePlaceTargetOnGround(e),e&&t){var a=this.target.position.z;this.placeTargetOnGround=function(){var o=Math.max(0,Sb.getElevationValueAt(kT(e),n||i.coord,Sb.PRECISE_READ_Z)||0);i.target.position.z=a*(1-r.t)+o*r.t,i.target.updateMatrixWorld(!0),i.applyTransformToCamera(e,t)},this.placeTargetOnGround(),e.addFrameRequester(Kb,this.placeTargetOnGround)}}},{key:"removePlaceTargetOnGround",value:function(e){e&&this.placeTargetOnGround&&(e.removeFrameRequester(Kb,this.placeTargetOnGround),this.placeTargetOnGround=null)}},{key:"tilt",get:function(){return Hh.radToDeg(this.target.rotation.x)}},{key:"heading",get:function(){return FT(Hh.radToDeg(this.target.rotation.z)+180)}},{key:"range",get:function(){return this.camera.position.y}}]),n}(zt);function UT(e){return IT[e.uuid]=IT[e.uuid]||new PT(e),IT[e.uuid]}var DT,RT,OT,NT={defaultStopPlaceOnGroundAtEnd:!1,Easing:ud.Easing,stop:function(e,t){UT(t).stop(e)},getTransformCameraLookingAtTarget:function(e,t,n){var i=UT(t);return i.setfromCamera(e,t,n),i.getParams()},transformCameraToLookAtTarget:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.isExtent&&(n=this.getCameraTransformOptionsFromExtent(e,t,n)),n.proxy=void 0===n.proxy||n.proxy;var i=UT(t);return i.stop(e),i.setfromCamera(e,t),n.proxy&&i.setProxy(e,t),i.applyParams(e,n),i.addPlaceTargetOnGround(e,t,n.coord),i.applyTransformToCamera(e,t),e.notifyChange(t),Promise.resolve(i.getParams())},getCameraTransformOptionsFromExtent:function(e,t,n){var i,r={coord:new ob(n.crs,0,0,0),heading:0,tilt:e.isPlanarView?90:89.9};if(e.isGlobeView?(n=n.as("EPSG:4326"),yT||(yT=new ET),yT.setFromExtent(n),yT.box3D.getSize(LT),i={x:LT.y,y:LT.x}):i=(n=n.as(e.referenceCrs)).dimensions(),n.center(r.coord),t.isOrthographicCamera)i.x/i.y>t.aspect?t.zoom=(t.right-t.left)/i.x:t.zoom=(t.top-t.bottom)/i.y,t.updateProjectionMatrix(),r.range=1e3;else if(t.isPerspectiveCamera){var a=et.degToRad(t.fov);if(i.x/i.y>t.aspect){var o=.5*e.domElement.clientHeight/Math.tan(.5*a),s=2*Math.atan(.5*e.domElement.clientWidth/o);r.range=i.x/(2*Math.tan(.5*s))}else r.range=i.y/(2*Math.tan(.5*a))}return r},animateCameraToLookAtTarget:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};i.proxy=void 0===i.proxy||i.proxy;var r=UT(t);return r.stop(e),i.proxy&&r.setProxy(e,t),r.animateCameraToLookAtTarget(e,t,i).promise.then((function(t){var i=r.getParams();return(void 0===i.stopPlaceOnGroundAtEnd?n.defaultStopPlaceOnGroundAtEnd:i.stopPlaceOnGroundAtEnd)&&r.stop(e),i.finished=t,i}))},sequenceAnimationsToLookAtTarget:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[{}],r=function(e){return e.reduce((function(e,t){return e.then((function(e){return!e.length||e[e.length-1].finished?t().then(Array.prototype.concat.bind(e)):Promise.resolve([{finished:!1}])}))}),Promise.resolve([]))},a=i.map((function(i){return function(){return n.animateCameraToLookAtTarget(e,t,i)}}));return r(a)},getDiffParams:function(e,t){var n;if(e&&t)return Math.abs(e.range-t.range)/e.range>.001&&((n=n||{}).range={previous:e.range,new:t.range}),Math.abs(e.tilt-t.tilt)>.1&&((n=n||{}).tilt={previous:e.tilt,new:t.tilt}),Math.abs(e.heading-t.heading)>.1&&((n=n||{}).heading={previous:e.heading,new:t.heading}),(Math.abs(e.coord.x-t.coord.x)>1e-6||Math.abs(e.coord.y-t.coord.y)>1e-6)&&((n=n||{}).coord={previous:e.coord,new:t.coord}),n}},zT=37,QT=38,GT=39,HT=40,VT=16,jT=17,WT=function(){function e(){s(this,e),this.NONE={},this.ORBIT={mouseButton:_.LEFT,keyboard:jT,enable:!0,finger:2},this.DOLLY={mouseButton:_.MIDDLE,enable:!0},this.PAN={mouseButton:_.RIGHT,up:QT,bottom:HT,left:zT,right:GT,enable:!0,finger:3},this.MOVE_GLOBE={mouseButton:_.LEFT,enable:!0,finger:1},this.PANORAMIC={mouseButton:_.LEFT,keyboard:VT,enable:!0}}return A(e,[{key:"inputToState",value:function(e,t){for(var n=0,i=Object.keys(this);n<i.length;n++){var r=this[i[n]];if(r.enable&&r.mouseButton===e&&r.keyboard===t)return r}return this.NONE}},{key:"touchToState",value:function(e){for(var t=0,n=Object.keys(this);t<n.length;t++){var i=this[n[t]];if(i.enable&&e==i.finger)return i}return this.NONE}}]),e}(),XT=function(e){h(n,e);var t=y(n);function n(e,i){var r;return s(this,n),(r=t.call(this)).view=e,r.camera=e.camera.camera3D,new ob("EPSG:4978",0,0,0),r}return A(n,[{key:"setTilt",value:function(e,t){return this.lookAtCoordinate({tilt:e},t)}},{key:"setHeading",value:function(e,t){return this.lookAtCoordinate({heading:e},t)}},{key:"setRange",value:function(e,t){return this.lookAtCoordinate({range:e},t)}},{key:"getRange",value:function(e){return NT.getTransformCameraLookingAtTarget(this.view,this.camera,e).range}},{key:"getTilt",value:function(e){return NT.getTransformCameraLookingAtTarget(this.view,this.camera,e).tilt}},{key:"getHeading",value:function(e){return NT.getTransformCameraLookingAtTarget(this.view,this.camera,e).heading}},{key:"zoomIn",value:function(){}},{key:"zoomOut",value:function(){}},{key:"pickGeoPosition",value:function(e){var t=this.view.getPickingPositionFromDepth(e);if(t)return new ob("EPSG:4978",t).as("EPSG:4326")}},{key:"getLookAtCoordinate",value:function(){return NT.getTransformCameraLookingAtTarget(this.view,this.camera).coord}},{key:"getView",value:function(){this.getLookAtCoordinate();var e=NT.getTransformCameraLookingAtTarget(this.view,this.view.camera.camera3D);return e.coord=[e.coord.x,e.coord.y],e}},{key:"setView",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(e=Object.assign({},e)).coord&&Array.isArray(e.coord)&&(e.coord=new ob("EPSG:4326").setFromArray(e.coord).as("EPSG:4978",DT)),Math.abs(e.heading-this.getHeading())<.5&&(e.heading=this.getHeading()),this.lookAtCoordinate(e,t)}},{key:"flyTo",value:function(e){return this.setView(e,!0)}},{key:"fit",value:function(e){if(e){var t=(new tn).setFromObject(e).getSize(new at);return this.flyTo({coord:new ob("EPSG:4978").setFromVector3(e.getWorldPosition(new at)).as("EPSG:4326"),range:Math.max(t.x,t.z),tilt:90})}}},{key:"lookAtCoordinate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.isAnimationEnabled();if(!t.isExtent&&(t.zoom?t.range=this.view.tileLayer.computeDistanceCameraFromTileZoom(t.zoom,this.view.camera):t.scale&&(t.range=this.view.getScaleFromDistance(t.pitch,t.scale),(t.range<this.minDistance||t.range>this.maxDistance)&&(console.warn("This scale ".concat(t.scale," can not be reached")),t.range=Hh.clamp(t.range,this.minDistance,this.maxDistance))),void 0!==t.tilt)){var i=90-Hh.radToDeg(this.maxPolarAngle),r=90-Hh.radToDeg(this.minPolarAngle);(t.tilt<i||t.tilt>r)&&(t.tilt=Hh.clamp(t.tilt,i,r),console.warn("Tilt was clamped to ",t.tilt," the interval is between ".concat(i," and ").concat(r," degree")))}return n?(t.callback=function(e){},this.dispatchEvent({type:"animation-started"}),NT.animateCameraToLookAtTarget(this.view,this.camera,t).then((function(t){return e.dispatchEvent({type:"animation-ended"}),t}))):NT.transformCameraToLookAtTarget(this.view,this.camera,t).then((function(e){return e}))}}]),n}(Je),YT=1e-6,KT=new tt,ZT=new tt,JT=new tt,qT=new Gc(1,.01,0),$T=new Gc(1,0,0),e_=1,t_=new tt,n_=new tt,i_=new tt,r_=new at,a_=new tt,o_=new tt,s_=new tt,l_=new nt,A_=new ob("EPSG:4978"),c_=new ob("EPSG:4978",0,0,0),h_=new ob("EPSG:4326",0,0,0);function u_(e,t){c_.setFromVector3(e).as("EPSG:4326",h_),t.position.copy(e),t.lookAt(h_.geodesicNormal.add(e)),t.rotateX(.5*Math.PI),t.updateMatrixWorld(!0)}var d_,f_,p_=0,m_=!0,v_=.25,g_=new nt(0,0,0,1),y_=new at,w_=new at,x_=new nt,b_=new an,M_=new at,C_=new at,B_={},E_="orientation-changed",S_="range-changed",T_="camera-target-changed",__=new nt,I_=new nt,L_=new at(1,0,0),F_=1/0,k_=new at,P_=new at,U_=new Nc,D_=new at,R_=new at,O_=new an,N_=function(e){h(n,e);var t=y(n);function n(e,i){var r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s(this,n),(r=t.call(this,e)).player=new oT,r.states=new WT,r.state=r.states.NONE,r.enabled=!0,a.zoomSpeed&&(console.warn("Controls zoomSpeed parameter is deprecated. Use zoomInFactor and zoomOutFactor instead."),a.zoomFactor=a.zoomFactor||a.zoomSpeed),r.zoomFactor=a.zoomFactor||1.25,r.minDistance=a.minDistance||50,r.maxDistance=a.maxDistance||8*qx.x,r.minZoom=0,r.maxZoom=1/0,r.rotateSpeed=a.rotateSpeed||.25,r.keyPanSpeed=7,r.minPolarAngle=Hh.degToRad(.5),r.maxPolarAngle=Hh.degToRad(86),r.minAzimuthAngle=-1/0,r.maxAzimuthAngle=1/0,r.handleCollision=void 0===a.handleCollision||a.handleCollision,r.minDistanceCollision=60,r.enableKeys=!0,r.enableDamping=!0,r.dampingMoveFactor=null!=a.dampingMoveFactor?a.dampingMoveFactor:v_,r.enablePan=!0,r.startEvent={type:"start"},r.endEvent={type:"end"},r.updateHelper=function(){},r._onEndingMove=null,r._onMouseMove=r.onMouseMove.bind(v(r)),r._onMouseUp=r.onMouseUp.bind(v(r)),r._onMouseDown=r.onMouseDown.bind(v(r)),r._onMouseWheel=r.onMouseWheel.bind(v(r)),r._onContextMenuListener=r.onContextMenuListener.bind(v(r)),r._ondblclick=r.ondblclick.bind(v(r)),r._onTouchStart=r.onTouchStart.bind(v(r)),r._update=r.update.bind(v(r)),r._onTouchMove=r.onTouchMove.bind(v(r)),r._onKeyDown=r.onKeyDown.bind(v(r)),r._onKeyUp=r.onKeyUp.bind(v(r)),r._onBlurListener=r.onBlurListener.bind(v(r)),r.view.domElement.addEventListener("contextmenu",r._onContextMenuListener,!1),r.view.domElement.addEventListener("mousedown",r._onMouseDown,!1),r.view.domElement.addEventListener("mousewheel",r._onMouseWheel,!1),r.view.domElement.addEventListener("dblclick",r._ondblclick,!1),r.view.domElement.addEventListener("DOMMouseScroll",r._onMouseWheel,!1),r.view.domElement.addEventListener("touchstart",r._onTouchStart,!1),r.view.domElement.addEventListener("touchend",r._onMouseUp,!1),r.view.domElement.addEventListener("touchmove",r._onTouchMove,!1),r.player.addEventListener("animation-frame",r._update),window.addEventListener("keydown",r._onKeyDown,!1),window.addEventListener("keyup",r._onKeyUp,!1),window.addEventListener("blur",r._onBlurListener),OT||((OT=new zt).matrixWorldInverse=new bt),e.scene.add(OT),i.isExtent?i.center().as("EPSG:4978",c_):(i.coord.as("EPSG:4978",c_),i.tilt=i.tilt||89.5,i.heading=i.heading||0),u_(c_,OT),r.lookAtCoordinate(i,!1),A_.crs=r.view.referenceCrs,r}return A(n,[{key:"dollyInScale",get:function(){return this.zoomFactor}},{key:"dollyOutScale",get:function(){return 1/this.zoomFactor}},{key:"isPaused",get:function(){return this.state==this.states.NONE}},{key:"onEndingMove",value:function(e){this._onEndingMove&&(this.player.removeEventListener("animation-stopped",this._onEndingMove),this._onEndingMove=null),this.state=this.states.NONE,this.handlingEvent(e)}},{key:"rotateLeft",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;$T.theta-=e}},{key:"rotateUp",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;$T.phi-=e}},{key:"panLeft",value:function(e){var t=this.camera.matrix.elements;r_.fromArray(t),r_.multiplyScalar(-e),y_.add(r_)}},{key:"panUp",value:function(e){var t=this.camera.matrix.elements;r_.fromArray(t,4),r_.multiplyScalar(e),y_.add(r_)}},{key:"mouseToPan",value:function(e,t){var n=this.view.mainLoop.gfxEngine;if(this.state=this.states.PAN,this.camera.isPerspectiveCamera){var i=this.camera.position.distanceTo(this.getCameraTargetPosition());i*=2*Math.tan(Hh.degToRad(.5*this.camera.fov)),this.panLeft(e*i/n.width*this.camera.aspect),this.panUp(t*i/n.height)}else this.camera.isOrthographicCamera&&(this.panLeft(e*(this.camera.right-this.camera.left)/n.width),this.panUp(t*(this.camera.top-this.camera.bottom)/n.height))}},{key:"dolly",value:function(e){0!==e&&(RT=e>0?this.dollyInScale:this.dollyOutScale,this.camera.isPerspectiveCamera?e_/=RT:this.camera.isOrthographicCamera&&(this.camera.zoom=Hh.clamp(this.camera.zoom*RT,this.minZoom,this.maxZoom),this.camera.updateProjectionMatrix(),this.view.notifyChange(this.camera)))}},{key:"getMinDistanceCameraBoundingSphereObbsUp",value:function(e){if(e.level>10&&1==e.children.length&&e.geometry){var t=e.obb;O_.center.copy(this.camera.position),O_.radius=this.minDistanceCollision,t.isSphereAboveXYBox(O_)&&(F_=Math.min(O_.center.z-t.box3D.max.z,F_))}}},{key:"update",value:function(){if(F_=1/0,this.handleCollision&&this.view.tileLayer){var e,t=S(this.view.tileLayer.level0Nodes);try{for(t.s();!(e=t.n()).done;){e.value.traverse(this.getMinDistanceCameraBoundingSphereObbsUp.bind(this))}}catch(e){t.e(e)}finally{t.f()}}switch(this.state){case this.states.MOVE_GLOBE:if(F_<0)OT.translateY(-F_),this.camera.position.setLength(this.camera.position.length()-F_);else if(F_<this.minDistanceCollision){var n=this.minDistanceCollision*(1-F_/this.minDistanceCollision);OT.translateY(n),this.camera.position.setLength(this.camera.position.length()+n)}k_.copy(P_).applyQuaternion(l_),OT.position.applyQuaternion(l_),this.camera.position.applyQuaternion(l_);break;case this.states.PAN:this.camera.position.add(y_),OT.position.add(y_);break;case this.states.PANORAMIC:this.camera.worldToLocal(OT.position);var i=this.camera.position.clone().normalize().applyQuaternion(this.camera.quaternion.clone().invert());__.setFromAxisAngle(i,$T.theta).multiply(I_.setFromAxisAngle(L_,$T.phi)),OT.position.applyQuaternion(__),this.camera.localToWorld(OT.position);break;default:this.camera.position.applyMatrix4(OT.matrixWorldInverse),($T.theta||$T.phi)&&qT.setFromVector3(this.camera.position);var r=qT.radius*Math.sin(this.minPolarAngle),a=8*r,o=2*r;if(this.handleCollision)if(F_<a&&F_>o&&$T.phi>0){var s=a-o,l=1-(s-(F_-o))/s;$T.phi*=l*l}else if(F_<o&&F_>-o&&$T.phi>-.01){var A=2*o,c=-Math.asin(.25*(o-F_)/qT.radius);c=Hh.clamp(c,-.01,0);var h=1-(o-F_)/A;$T.phi=Hh.lerp($T.phi,c,h),F_-=Math.sin($T.phi)*qT.radius}qT.theta+=$T.theta,qT.phi+=$T.phi,qT.theta=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,qT.theta)),qT.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,qT.phi)),qT.radius=this.camera.position.length()*e_,qT.makeSafe(),qT.radius=Math.max(this.minDistance,Math.min(this.maxDistance,qT.radius)),this.camera.position.setFromSpherical(qT),F_<0&&(this.camera.position.y-=F_,qT.setFromVector3(this.camera.position),$T.phi=0),OT.localToWorld(this.camera.position)}this.camera.up.copy(OT.position).normalize(),this.camera.lookAt(OT.position),this.enableDamping?($T.theta*=.75,$T.phi*=.75,l_.slerp(g_,.2*this.dampingMoveFactor)):($T.theta=0,$T.phi=0,l_.set(0,0,0,1)),e_=1,y_.set(0,0,0),(w_.distanceToSquared(this.camera.position)>YT||8*(1-x_.dot(this.camera.quaternion))>YT)&&(this.view.notifyChange(this.camera),w_.copy(this.camera.position),x_.copy(this.camera.quaternion)),this.enableDamping&&this.state===this.states.ORBIT&&this.player.isStopped()&&($T.theta>YT||$T.phi>YT)&&this.player.playLater(60,2),this.view.dispatchEvent({type:GS,coord:A_.setFromVector3(OT.position),range:qT.radius,heading:-Hh.radToDeg(qT.theta),tilt:90-Hh.radToDeg(qT.phi)})}},{key:"onMouseMove",value:function(e){if(this.player.isPlaying()&&this.player.stop(),!1!==this.enabled){e.preventDefault();var t=this.view.eventToViewCoords(e);switch(this.state){case this.states.ORBIT:case this.states.PANORAMIC:ZT.copy(t),JT.subVectors(ZT,KT);var n=this.view.mainLoop.gfxEngine;this.rotateLeft(2*Math.PI*JT.x/n.width*this.rotateSpeed),this.rotateUp(2*Math.PI*JT.y/n.height*this.rotateSpeed),KT.copy(ZT);break;case this.states.DOLLY:o_.copy(t),s_.subVectors(o_,a_),this.dolly(-s_.y),a_.copy(o_);break;case this.states.PAN:this.enablePan&&(n_.copy(t),i_.subVectors(n_,t_),this.mouseToPan(i_.x,i_.y),t_.copy(n_));break;case this.states.MOVE_GLOBE:var i=this.view.viewToNormalizedCoords(t);U_.setFromCamera(i,this.camera),U_.ray.intersectSphere(b_,C_)?(P_.copy(C_).normalize(),l_.setFromUnitVectors(P_,k_),p_=Date.now()):this.onMouseUp()}this.state!==this.states.NONE&&this.update()}}},{key:"updateTarget",value:function(){this.view.getPickingPositionFromDepth(null,R_);var e=isNaN(R_.x)?100:this.camera.position.distanceTo(R_);D_.set(0,0,-e),this.camera.localToWorld(D_),u_(D_,OT),OT.matrixWorldInverse.copy(OT.matrixWorld).invert(),D_.copy(this.camera.position),D_.applyMatrix4(OT.matrixWorldInverse),qT.setFromVector3(D_)}},{key:"handlingEvent",value:function(e){e=e||NT.getTransformCameraLookingAtTarget(this.view,this.camera);var t=NT.getDiffParams(f_,e);if(t&&(t.range&&this.dispatchEvent({type:S_,previous:t.range.previous,new:t.range.new}),t.coord&&this.dispatchEvent({type:T_,previous:t.coord.previous,new:t.coord.new}),t.tilt||t.heading)){var n={type:E_};t.tilt&&(n.previous={tilt:t.tilt.previous},n.new={tilt:t.tilt.new}),t.heading&&(n.previous=n.previous||{},n.new=n.new||{},n.new.heading=t.heading.new,n.previous.heading=t.heading.previous),this.dispatchEvent(n)}}},{key:"onMouseDown",value:function(e){if(NT.stop(this.view,this.camera),this.player.stop(),this.onEndingMove(),!1!==this.enabled){this.updateTarget(),f_=NT.getTransformCameraLookingAtTarget(this.view,this.camera,R_),this.state=this.states.inputToState(e.button,d_);var t=this.view.eventToViewCoords(e);switch(this.state){case this.states.ORBIT:case this.states.PANORAMIC:KT.copy(t);break;case this.states.MOVE_GLOBE:this.view.getPickingPositionFromDepth(t,M_)?(b_.radius=M_.length(),k_.copy(M_).normalize(),this.updateHelper(M_,B_.picking)):this.state=this.states.NONE;break;case this.states.DOLLY:a_.copy(t);break;case this.states.PAN:t_.copy(t)}this.state!=this.states.NONE&&(this.view.domElement.addEventListener("mousemove",this._onMouseMove,!1),this.view.domElement.addEventListener("mouseup",this._onMouseUp,!1),this.view.domElement.addEventListener("mouseleave",this._onMouseUp,!1),this.dispatchEvent(this.startEvent))}}},{key:"ondblclick",value:function(e){if(!1!==this.enabled&&!d_){this.player.stop();var t=this.view.getPickingPositionFromDepth(this.view.eventToViewCoords(e)),n=this.getRange(t);return t&&n>this.minDistance?this.lookAtCoordinate({coord:new ob("EPSG:4978",t),range:.6*n,time:1500}):void 0}}},{key:"onMouseUp",value:function(){var e=this;!1!==this.enabled&&(this.view.domElement.removeEventListener("mousemove",this._onMouseMove,!1),this.view.domElement.removeEventListener("mouseup",this._onMouseUp,!1),this.view.domElement.removeEventListener("mouseleave",this._onMouseUp,!1),this.dispatchEvent(this.endEvent),this.player.stop(),this.enableDamping?this.state===this.states.ORBIT&&($T.theta>YT||$T.phi>YT)?(this.player.play(60),this._onEndingMove=function(){return e.onEndingMove()},this.player.addEventListener("animation-stopped",this._onEndingMove)):this.state===this.states.MOVE_GLOBE&&Date.now()-p_<50?(this.player.play(120),this._onEndingMove=function(){return e.onEndingMove()},this.player.addEventListener("animation-stopped",this._onEndingMove)):this.onEndingMove():this.onEndingMove())}},{key:"onMouseWheel",value:function(e){if(this.player.stop(),this.enabled&&this.states.DOLLY.enable){NT.stop(this.view,this.camera),e.preventDefault(),this.updateTarget();var t=0;void 0!==e.wheelDelta?t=e.wheelDelta:void 0!==e.detail&&(t=-e.detail),this.dolly(t);var n=this.getRange(R_);this.update();var i=this.getRange(R_);Math.abs(i-n)/n>.001&&this.dispatchEvent({type:S_,previous:n,new:i}),this.dispatchEvent(this.startEvent),this.dispatchEvent(this.endEvent)}}},{key:"onKeyUp",value:function(){!1!==this.enabled&&!1!==this.enableKeys&&(d_=void 0)}},{key:"onKeyDown",value:function(e){if(this.player.stop(),!1!==this.enabled&&!1!==this.enableKeys)switch(d_=e.keyCode,e.keyCode){case this.states.PAN.up:this.mouseToPan(0,this.keyPanSpeed),this.state=this.states.PAN,this.update();break;case this.states.PAN.bottom:this.mouseToPan(0,-this.keyPanSpeed),this.state=this.states.PAN,this.update();break;case this.states.PAN.left:this.mouseToPan(this.keyPanSpeed,0),this.state=this.states.PAN,this.update();break;case this.states.PAN.right:this.mouseToPan(-this.keyPanSpeed,0),this.state=this.states.PAN,this.update()}}},{key:"onTouchStart",value:function(e){if(this.player.stop(),!1!==this.enabled&&(this.state=this.states.touchToState(e.touches.length),this.updateTarget(),this.state!==this.states.NONE)){switch(this.state){case this.states.MOVE_GLOBE:var t=this.view.eventToViewCoords(e);this.view.getPickingPositionFromDepth(t,M_)?(b_.radius=M_.length(),k_.copy(M_).normalize(),this.updateHelper(M_,B_.picking)):this.state=this.states.NONE;break;case this.states.ORBIT:case this.states.DOLLY:var n=e.touches[0].pageX,i=e.touches[0].pageY,r=n-e.touches[1].pageX,a=i-e.touches[1].pageY,o=Math.sqrt(r*r+a*a);a_.set(0,o),KT.set(n,i);break;case this.states.PAN:t_.set(e.touches[0].pageX,e.touches[0].pageY)}this.dispatchEvent(this.startEvent)}}},{key:"onTouchMove",value:function(e){if(this.player.isPlaying()&&this.player.stop(),!1!==this.enabled){switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case this.states.MOVE_GLOBE.finger:var t=this.view.eventToViewCoords(e),n=this.view.viewToNormalizedCoords(t);U_.setFromCamera(n,this.camera),U_.ray.intersectSphere(b_,C_)?(P_.copy(C_).normalize(),l_.setFromUnitVectors(P_,k_),p_=Date.now()):this.onMouseUp.bind(this)();break;case this.states.ORBIT.finger:case this.states.DOLLY.finger:var i=this.view.mainLoop.gfxEngine;ZT.set(e.touches[0].pageX,e.touches[0].pageY),JT.subVectors(ZT,KT),this.rotateLeft(2*Math.PI*JT.x/i.width*this.rotateSpeed),this.rotateUp(2*Math.PI*JT.y/i.height*this.rotateSpeed),KT.copy(ZT);var r=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY,o=Math.sqrt(r*r+a*a);o_.set(0,o),s_.subVectors(o_,a_),this.dolly(s_.y),a_.copy(o_);break;case this.states.PAN.finger:n_.set(e.touches[0].pageX,e.touches[0].pageY),i_.subVectors(n_,t_),this.mouseToPan(i_.x,i_.y),t_.copy(n_);break;default:this.state=this.states.NONE}this.state!==this.states.NONE&&this.update()}}},{key:"onContextMenuListener",value:function(e){e.preventDefault()}},{key:"onBlurListener",value:function(){this.onKeyUp(),this.onMouseUp()}},{key:"dispose",value:function(){this.view.domElement.removeEventListener("contextmenu",this._onContextMenuListener,!1),this.view.domElement.removeEventListener("mousedown",this._onMouseDown,!1),this.view.domElement.removeEventListener("mousemove",this._onMouseMove,!1),this.view.domElement.removeEventListener("mousewheel",this._onMouseWheel,!1),this.view.domElement.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),this.view.domElement.removeEventListener("mouseup",this._onMouseUp,!1),this.view.domElement.removeEventListener("mouseleave",this._onMouseUp,!1),this.view.domElement.removeEventListener("dblclick",this._ondblclick,!1),this.view.domElement.removeEventListener("touchstart",this._onTouchStart,!1),this.view.domElement.removeEventListener("touchend",this._onMouseUp,!1),this.view.domElement.removeEventListener("touchmove",this._onTouchMove,!1),this.player.removeEventListener("animation-frame",this._onKeyUp),window.removeEventListener("keydown",this._onKeyDown,!1),window.removeEventListener("keyup",this._onKeyUp,!1),window.removeEventListener("blur",this._onBlurListener),this.dispatchEvent({type:"dispose"})}},{key:"pan",value:function(e){return this.mouseToPan(e.x,e.y),this.update(),Promise.resolve()}},{key:"getCameraOrientation",value:function(){return this.view.getPickingPositionFromDepth(null,R_),[this.getTilt(R_),this.getHeading(R_)]}},{key:"getCameraCoordinate",value:function(){return new ob("EPSG:4978",this.camera.position).as("EPSG:4326")}},{key:"getLookAtCoordinate",value:function(){return NT.getTransformCameraLookingAtTarget(this.view,this.camera).coord}},{key:"setAnimationEnabled",value:function(e){m_=e}},{key:"isAnimationEnabled",value:function(){return m_}},{key:"getZoom",value:function(){return this.view.tileLayer.computeTileZoomFromDistanceCamera(this.getRange(),this.view.camera)}},{key:"setZoom",value:function(e,t){return this.lookAtCoordinate({zoom:e},t)}},{key:"zoomIn",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.lookAtCoordinate({zoom:Math.min(this.getZoom()+1,18),time:500},e)}},{key:"zoomOut",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.lookAtCoordinate({zoom:this.getZoom()-1,time:500},e)}},{key:"getScale",value:function(e){return console.warn("Deprecated, use View#getScale instead."),this.view.getScale(e)}},{key:"pixelsToMeters",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;console.warn("Deprecated use View#getPixelsToMeters instead.");var n=this.getScale(t),i=e*t;return i/n/1e3}},{key:"pixelsToDegrees",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;console.warn("Deprecated, use View#getPixelsToMeters and GlobeControls#getMetersToDegrees instead.");var n=this.pixelsToMeters(e,t);return Hh.radToDeg(2*Math.asin(n/(2*qx.x)))}},{key:"metersToPixels",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.28;console.warn("Deprecated, use View#getMetersToPixels instead.");var n=this.getScale(t);return e*n/(t/=1e3)}},{key:"setScale",value:function(e,t,n){return this.lookAtCoordinate({scale:e,pitch:t},n)}},{key:"lookAtCoordinate",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.isAnimationEnabled();if(!t.isExtent&&(t.zoom?t.range=this.view.tileLayer.computeDistanceCameraFromTileZoom(t.zoom,this.view.camera):t.scale&&(t.range=this.view.getScaleFromDistance(t.pitch,t.scale),(t.range<this.minDistance||t.range>this.maxDistance)&&(console.warn("This scale ".concat(t.scale," can not be reached")),t.range=Hh.clamp(t.range,this.minDistance,this.maxDistance))),void 0!==t.tilt)){var i=90-Hh.radToDeg(this.maxPolarAngle),r=90-Hh.radToDeg(this.minPolarAngle);(t.tilt<i||t.tilt>r)&&(t.tilt=Hh.clamp(t.tilt,i,r),console.warn("Tilt was clamped to ",t.tilt," the interval is between ".concat(i," and ").concat(r," degree")))}return f_=NT.getTransformCameraLookingAtTarget(this.view,this.camera),n?(t.callback=function(e){return OT.position.copy(e.targetWorldPosition)},this.dispatchEvent({type:"animation-started"}),NT.animateCameraToLookAtTarget(this.view,this.camera,t).then((function(t){return e.dispatchEvent({type:"animation-ended"}),e.handlingEvent(t),t}))):NT.transformCameraToLookAtTarget(this.view,this.camera,t).then((function(t){return OT.position.copy(t.targetWorldPosition),e.handlingEvent(t),t}))}},{key:"getCameraTargetPosition",value:function(){return OT.position}}]),n}(XT);function z_(e){if(e.dispose)e.dispose();else if(e.geometry&&e.geometry.dispose(),e.material)if(Array.isArray(e.material)){var t,n=S(e.material);try{for(n.s();!(t=n.n()).done;){t.value.dispose()}}catch(e){n.e(e)}finally{n.f()}}else e.material.dispose()}function Q_(e,t){var n,i=S(e.children);try{for(i.s();!(n=i.n()).done;){Q_(n.value,t)}}catch(e){i.e(e)}finally{i.f()}t(e)}var G_=function(e){h(n,e);var t=y(n);function n(e,i){var r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(s(this,n),a.cacheLifeTime=null==a.cacheLifeTime?WM.GEOMETRY:a.cacheLifeTime,(r=t.call(this,e,a)).isGeometryLayer=!0,!i||!i.isObject3D)throw new Error("Missing/Invalid object3d parameter (must be a\n three.js Object3D instance)");return"Group"===i.type&&""===i.name&&(i.name=e),Object.defineProperty(v(r),"object3d",{value:i,writable:!1,configurable:!0}),r.defineLayerProperty("opacity",1,(function(){(r.parent?r.parent.object3d:r.object3d).traverse((function(e){e.layer==v(r)?r.changeOpacity(e):e.content&&e.content.layer==v(r)&&e.content.traverse(r.changeOpacity)}))})),r.defineLayerProperty("wireframe",!1,(function(){(r.parent?r.parent.object3d:r.object3d).traverse((function(e){e.layer==v(r)&&e.material?e.material.wireframe=r.wireframe:e.content&&e.content.layer==v(r)&&e.content.traverse((function(e){e.material&&e.layer==v(r)&&(e.material.wireframe=r.wireframe)}))}))})),r.attachedLayers=[],r.visible=null==a.visible||a.visible,Object.defineProperty(r.zoom,"max",{value:1/0,writable:!1}),r.filteringExtent=!r.source.isFileSource,r.structure="3d",r}return A(n,[{key:"getObjectToUpdateForAttachedLayers",value:function(e){if(e.parent&&e.material)return{element:e,parent:e.parent}}},{key:"postUpdate",value:function(){}},{key:"culling",value:function(){return!0}},{key:"attach",value:function(e){if(!e.update)throw new Error("Missing 'update' function -> can't attach layer\n ".concat(e.id));this.attachedLayers.push(e),e.parent=this}},{key:"detach",value:function(e){var t=this.attachedLayers.length;return this.attachedLayers=this.attachedLayers.filter((function(t){return t.id!=e.id})),e.parent=void 0,this.attachedLayers.length<t}},{key:"delete",value:function(){var e=this;this.parent&&Q_(this.parent.object3d,(function(t){t.layer&&t.layer.id==e.id&&(t.parent.remove(t),z_(t))})),this.object3d.parent&&this.object3d.parent.remove(this.object3d),this.object3d.traverse(z_)}},{key:"pickObjectsAt",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.options.defaultPickingRadius,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],r=this.parent?this.parent.object3d:this.object3d;return MS(e,t,n,r,i,this.threejsLayer)}},{key:"changeOpacity",value:function(e){e.material&&(null!=e.material.opacity&&(e.material.transparent=this.opacity<1,e.material.opacity=this.opacity),e.material.uniforms&&null!=e.material.uniforms.opacity&&(e.material.transparent=this.opacity<1,e.material.uniforms.opacity.value=this.opacity))}}]),n}(uE),H_=function(e){h(n,e);var t=y(n);function n(e,i,r,a){var o,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(s(this,n),o=t.call(this,e,i),!a)throw new Error("extent is mandatory to build a TileMesh");o.layer=r,o.extent=a,o.extent.zoom=l,o.level=l,o.material.objectId=o.id,o.obb=o.geometry.OBB.clone(),o.boundingSphere=new an,o.obb.box3D.getBoundingSphere(o.boundingSphere),o._tms=new Map;var A,c=S(r.tileMatrixSets);try{for(c.s();!(A=c.n()).done;){var h=A.value;o._tms.set(h,o.extent.tiledCovering(h))}}catch(e){c.e(e)}finally{c.f()}return o.frustumCulled=!1,o.matrixAutoUpdate=!1,o.rotationAutoUpdate=!1,o.layerUpdateState={},o.isTileMesh=!0,o.domElements={},o}return A(n,[{key:"setBBoxZ",value:function(e,t,n){null==e&&null==t||Math.floor(e)===Math.floor(this.obb.z.min)&&Math.floor(t)===Math.floor(this.obb.z.max)||(this.obb.updateZ(e,t,n),this.horizonCullingPointElevationScaled&&this.horizonCullingPointElevationScaled.setLength(this.obb.z.delta+this.horizonCullingPoint.length()),this.obb.box3D.getBoundingSphere(this.boundingSphere))}},{key:"getExtentsByProjection",value:function(e){return this._tms.get(Jx.formatToTms(e))}},{key:"findCommonAncestor",value:function(e){if(e)return e.level==this.level?e.id==this.id?e:0!=e.level?this.parent.findCommonAncestor(e.parent):void 0:e.level<this.level?this.parent.findCommonAncestor(e):this.findCommonAncestor(e.parent)}},{key:"onBeforeRender",value:function(){this.material.layersNeedUpdate&&this.material.updateLayersUniforms()}},{key:"findClosestDomElement",value:function(e){if(this.parent.isTileMesh)return this.parent.domElements[e]||this.parent.findClosestDomElement(e)}}]),n}(Ei),V_=new Map,j_=new XM;var W_=new tt;var X_=function(e,t,n){var i=n.builder,r=e,a=void 0!==r?r.level+1:0,o={extent:t,level:a,segment:n.segments||16,disableSkirt:n.disableSkirt};return function(e,t){var n=e.computeSharableExtent(t.extent),i=n.sharableExtent,r=n.quaternion,a=n.position,o=i.south.toFixed(6),s="".concat(e.crs,"_").concat(t.disableSkirt?0:1,"_").concat(t.segment),l=j_.get(o,t.level,s);if(!l){var A;l=new Promise((function(e){A=e})),j_.set(l,o,t.level,s),t.extent=i,t.center=e.center(t.extent).clone();var c,h=V_.get(s);t.buildIndexAndUv_0=!h,t.builder=e;try{c=sT(t)}catch(e){return Promise.reject(e)}h||((h={}).index=new zn(c.index,1),h.uv=new zn(c.uvs[0],2),V_.set(s,h)),c.index=h.index,c.uvs[0]=h.uv,c.position=new zn(c.position,3),c.normal=new zn(c.normal,3),t.builder.uvCount>1&&(c.uvs[1]=new zn(c.uvs[1],1));var u=new AT(t,c);return u.OBB=new ET(u.boundingBox.min,u.boundingBox.max),u._count=0,u.dispose=function(){u._count--,u._count<=0&&(u.index=null,delete u.attributes.uv_0,si.prototype.dispose.call(u),j_.delete(o,t.level,s))},A(u),Promise.resolve({geometry:u,quaternion:r,position:a})}return l.then((function(e){return{geometry:e,quaternion:r,position:a}}))}(i,o).then((function(e){e.geometry._count++;var o=n.tileMatrixSets.length,s=new LM(n.materialOptions,o),l=new H_(e.geometry,s,n,t,a);if(r&&r.isTileMesh){var A=i.computeSharableExtent(r.extent);e.position.sub(A.position).applyQuaternion(A.quaternion.invert()),e.quaternion.premultiply(A.quaternion)}return l.position.copy(e.position),l.quaternion.copy(e.quaternion),l.visible=!1,l.updateMatrix(),l.add(l.obb),function(e,t){if(e.material.transparent=t.opacity<1,e.material.opacity=t.opacity,t.diffuse&&(e.material.diffuse=t.diffuse),__DEBUG__&&(e.material.showOutline=t.showOutline||!1,e.material.wireframe=t.wireframe||!1),t.isGlobeLayer){e.horizonCullingPoint=e.extent.center().as("EPSG:4978").toVector3(),e.extent.dimensions(W_).multiplyScalar(Hh.DEG2RAD);var n=W_.length(),i=Math.abs(1/Math.cos(.5*n));e.horizonCullingPoint.setLength(i*e.horizonCullingPoint.length()),e.horizonCullingPointElevationScaled=e.horizonCullingPoint.clone()}}(l,n),r&&l.setBBoxZ(r.obb.z.min,r.obb.z.max),l}))};function Y_(e,t,n,i,r){if(e.isCancelledCommandException)t.layerUpdateState[n.id].success();else if(e instanceof SyntaxError)t.layerUpdateState[n.id].failure(0,!0);else{__DEBUG__&&(n.isColorLayer?console.warn("Error in process color on layer",n.id,", node",t,e):n.isElevationLayer?console.warn("Error in process elevation on layer",n.id,", node",t,e):console.warn("Error in process feature on layer",n.id,", node",t,e));var a=t.layerUpdateState[n.id].errorCount>4;t.layerUpdateState[n.id].failure(Date.now(),a,{targetLevel:i}),a||window.setTimeout((function(){r.notifyChange(t,!1)}),1e3*t.layerUpdateState[n.id].secondsUntilNextTry())}}var K_=Math.pow(131072,.5);function Z_(e){return e.visible?100:10}function J_(e){return!e.requester.parent||!e.requester.material||(!!(e.layer.isElevationLayer&&e.requester.material.getElevationLayer()&&e.targetLevel<=e.requester.material.getElevationLayer().level)||!e.requester.material.visible)}function q_(e,t,n,i,r){return{view:e,layer:t,extentsSource:n,extentsDestination:i,requester:r,priority:Z_(r.material),earlyDropFunction:J_}}function $_(e){return function(t){t.material&&t.material.removeLayer&&(t.material.removeLayer(e),t.material.elevationLayerIds[0]==e&&t.setBBoxZ(0,0)),t.layerUpdateState&&t.layerUpdateState[e]&&delete t.layerUpdateState[e]}}var eI,tI=new at,nI=new at,iI=function(e){h(n,e);var t=y(n);function n(e,i,r,a,o){var l;if(s(this,n),o.cacheLifeTime=WM.INFINITE,o.source=!1,(l=t.call(this,e,i,o)).isTiledGeometryLayer=!0,l.protocol="tile",l.sseSubdivisionThreshold=l.sseSubdivisionThreshold||1,l.schemeTile=r,l.builder=a,l.info=new jM(v(l)),!l.schemeTile)throw new Error("Cannot init tiled layer without schemeTile for layer ".concat(l.id));if(!l.builder)throw new Error("Cannot init tiled layer without builder for layer ".concat(l.id));l.level0Nodes=[];var A,c=[],h=S(l.schemeTile);try{for(h.s();!(A=h.n()).done;){var u=A.value;c.push(l.convert(void 0,u))}}catch(e){h.e(e)}finally{h.f()}return l._promises.push(Promise.all(c).then((function(e){var t;l.level0Nodes=e,(t=l.object3d).add.apply(t,C(e)),l.object3d.updateMatrixWorld()}))),l}return A(n,[{key:"pickObjectsAt",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.options.defaultPickingRadius,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return bS(e,t,n,this,i)}},{key:"preUpdate",value:function(e,t){var n=this;if(t.has(void 0)||0==t.size)return this.level0Nodes;__DEBUG__&&(this._latestUpdateStartingLevel=0),e.colorLayers=e.view.getLayers((function(e,t){return t&&t.id==n.id&&e.isColorLayer})),e.elevationLayers=e.view.getLayers((function(e,t){return t&&t.id==n.id&&e.isElevationLayer})),e.maxElevationLevel=-1;var i,r,a=S(e.elevationLayers);try{for(a.s();!(i=a.n()).done;){var o=i.value;e.maxElevationLevel=Math.max(o.source.zoom.max,e.maxElevationLevel)}}catch(e){a.e(e)}finally{a.f()}-1==e.maxElevationLevel&&(e.maxElevationLevel=1/0),this.colorLayersOrder=dE(e.colorLayers);var s,l=S(t.values());try{for(l.s();!(s=l.n()).done;){var A=s.value;if(A.isCamera)return this.level0Nodes;if(A.layer===this){if(r){if(!(r=A.findCommonAncestor(r)))return this.level0Nodes}else r=A;null==r.material&&(r=void 0)}}}catch(e){l.e(e)}finally{l.f()}return r?(__DEBUG__&&(this._latestUpdateStartingLevel=r.level),[r]):this.level0Nodes}},{key:"update",value:function(e,t,i){var r=this;if(!i.parent)return LS.removeChildrenAndCleanup(this,i);if(i.parent.pendingSubdivision)return i.visible=!1,i.material.visible=!1,void this.info.update(i);if(i.visible=!this.culling(i,e.camera),i.visible){var a=!1;return i.material.visible=!0,this.info.update(i),(i.pendingSubdivision||n.hasEnoughTexturesToSubdivide(e,i)&&this.subdivision(e,this,i))&&(this.subdivideNode(e,i),i.material.visible=i.pendingSubdivision,this.info.update(i),a=!0),i.material.visible&&!a?LS.removeChildren(this,i):a?i.children.filter((function(e){return e.layer==r})):void 0}return i.material.visible=!1,this.info.update(i),LS.removeChildren(this,i)}},{key:"convert",value:function(e,t){return X_(e,t,this)}},{key:"countColorLayersTextures",value:function(){return arguments.length}},{key:"culling",value:function(e,t){return!t.isBox3Visible(e.obb.box3D,e.obb.matrixWorld)}},{key:"subdivideNode",value:function(e,t){var n=this;if(!t.pendingSubdivision&&!t.children.some((function(e){return e.layer==n}))){var i=t.extent.subdivision();t.pendingSubdivision=!0;var r={view:e.view,requester:t,layer:this,priority:1e4,extentsSource:i,redraw:!1};return e.scheduler.execute(r).then((function(n){var i,r=S(n);try{for(r.s();!(i=r.n()).done;){var a=i.value;t.add(a),a.updateMatrixWorld(!0)}}catch(e){r.e(e)}finally{r.f()}t.pendingSubdivision=!1,e.view.notifyChange(t,!1)}),(function(e){if(t.pendingSubdivision=!1,!e.isCancelledCommandException)throw new Error(e)}))}}},{key:"subdivision",value:function(e,t,n){if(n.level<this.minSubdivisionLevel)return!0;if(this.maxSubdivisionLevel<=n.level)return!1;var i=n.material.getElevationLayer();if(i){var r=i.textures[0];if(r&&r.extent)if(i.offsetScales[0].z<1/Math.pow(2,this.maxDeltaElevationLevel))return!1}tI.setFromMatrixScale(n.matrixWorld),nI.copy(n.boundingSphere.center).applyMatrix4(n.matrixWorld);var a=Math.max(0,e.camera.camera3D.position.distanceTo(nI)-n.boundingSphere.radius*tI.x);if(e.camera.camera3D.isOrthographicCamera){var o=e.camera.camera3D,s=2*e.camera._preSSE*o.zoom/(o.top-o.bottom);n.screenSize=s*n.boundingSphere.radius*tI.x}else n.screenSize=e.camera._preSSE*(2*n.boundingSphere.radius*tI.x)/a;var l=n.screenSize/(2*K_);return this.sseSubdivisionThreshold<l}}],[{key:"hasEnoughTexturesToSubdivide",value:function(e,t){var n,i=t.layerUpdateState||{},r=t.material.getElevationLayer(),a=S(e.elevationLayers);try{for(a.s();!(n=a.n()).done;){var o=n.value,s=t.getExtentsByProjection(o.crs)[0].zoom;if(!(s>o.zoom.max||s<o.zoom.min)&&(!o.frozen&&o.ready&&o.source.extentInsideLimit(t.extent,s)&&(!r||r.level<0))){if(i[o.id]&&i[o.id].inError())continue;return!1}}}catch(e){a.e(e)}finally{a.f()}var l,A=S(e.colorLayers);try{for(A.s();!(l=A.n()).done;){var c=l.value;if(!c.frozen&&c.visible&&c.ready){var h=t.getExtentsByProjection(c.crs)[0].zoom;if(!(h>c.zoom.max||h<c.zoom.min)&&(!i[c.id]||!i[c.id].inError())&&(r=t.material.getLayer(c.id),c.source.extentInsideLimit(t.extent,h)&&(!r||r.level<0)))return!1}}}catch(e){A.e(e)}finally{A.f()}return!0}}]),n}(G_),rI=new bt,aI=new at,oI=0,sI=new at,lI=function(e){h(n,e);var t=y(n);function n(e,i){var r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};s(this,n);var o=yb.get(Jx.tms_4326),l=gb.get("EPSG:4326").subdivisionByScheme(o);a.tileMatrixSets=[Jx.tms_4326,Jx.tms_3857];var A=a.tileMatrixSets.length,c=new wT({crs:"EPSG:4978",uvCount:A});(r=t.call(this,e,i||new ja,l,c,a)).isGlobeLayer=!0,r.options.defaultPickingRadius=5,r.minSubdivisionLevel=null==r.minSubdivisionLevel?2:r.minSubdivisionLevel,r.maxSubdivisionLevel=null==r.maxSubdivisionLevel?19:r.maxSubdivisionLevel,r.maxDeltaElevation=r.maxDeltaElevation||4,r.extent=r.schemeTile[0].clone();for(var h=1;h<r.schemeTile.length;h++)r.extent.union(r.schemeTile[h]);return rI.copy(r.object3d.matrixWorld).invert(),rI.premultiply((new bt).makeScale(1/qx.x,1/qx.y,1/qx.z)),r}return A(n,[{key:"preUpdate",value:function(e,t){return aI.copy(e.camera.camera3D.position).applyMatrix4(rI),oI=aI.lengthSq()-1,b(u(n.prototype),"preUpdate",this).call(this,e,t)}},{key:"countColorLayersTextures",value:function(){for(var e=0,t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];for(var r=0,a=n;r<a.length;r++){var o=a[r],s=o.crs||o.source.crs;e+="EPSG:3857"==s?3:1}return e}},{key:"subdivision",value:function(e,t,i){if(5==i.level){var r=i.getExtentsByProjection(Jx.tms_4326)[0].row;if(31==r||0==r)return!1}return b(u(n.prototype),"subdivision",this).call(this,e,t,i)}},{key:"culling",value:function(e,t){return!!b(u(n.prototype),"culling",this).call(this,e,t)||!(e.level<this.minSubdivisionLevel)&&this.horizonCulling(e.horizonCullingPointElevationScaled)}},{key:"horizonCulling",value:function(e){sI.copy(e).applyMatrix4(rI),sI.sub(aI);var t=sI.lengthSq(),n=-sI.dot(aI);return oI<0?n>0:oI<n&&oI<n*n/t}},{key:"computeTileZoomFromDistanceCamera",value:function(e,t){var n=K_*(.5*this.sseSubdivisionThreshold)/t._preSSE/qx.x,i=e*n,r=Math.log(Math.PI/(2*Math.asin(i)))/Math.log(2),a=Math.PI/Math.pow(2,r);return i=(e-.5*(2*qx.x*Math.sin(.5*a)))*n,r=Math.log(Math.PI/(2*Math.asin(i)))/Math.log(2),isNaN(r)?0:Math.round(r)}},{key:"computeDistanceCameraFromTileZoom",value:function(e,t){var n=Math.PI/Math.pow(2,e),i=.5*(2*qx.x*Math.sin(.5*n)),r=i/K_;return t._preSSE*r/(.5*this.sseSubdivisionThreshold)+i}}]),n}(iI),AI={getSunPosition:function(){var e=Math,t=e.PI,n=e.sin,i=e.cos,r=e.tan,a=e.asin,o=e.atan2,s=t/180,l=23.4397*s;function A(e,t,a){return o(n(e),i(e)*n(t)-r(a)*i(t))}function c(e,t,r){return a(n(t)*n(r)+i(t)*i(r)*i(e))}return function(e,h,u){var d,f,p=s*-u,m=s*h,v=function(e){return function(e){return e.valueOf()/864e5-.5+2440588}(e)-2451545}(e),g=function(e){return s*(357.5291+.98560028*e)}(v),y=function(e){return s*(1.9148*n(e)+.02*n(2*e)+3e-4*n(3*e))}(g),w=function(e,n){return e+n+102.9372*s+t}(g,y),x=(d=w,a(n(f=0)*i(l)+i(f)*n(l)*n(d))),b=function(e,t){return o(n(e)*i(l)-r(t)*n(l),i(e))}(w,0),M=function(e,t){return s*(280.16+360.9856235*e)-t}(v,p),C=M-b;return{EclipticLongitude:w,declinaison:x,ascension:b,H:C,SiderealTime:M,altitude:c(C,m,x),azimuth:A(C,m,x)+t/2}}},getSunPositionInScene:function(e,t,n){var i=864e5,r=AI.getSunPosition()(e,t,n).ascension+e%i/i*-360+180;return new ob("EPSG:4326",r,t,5e7).as("EPSG:4978").toVector3()}},cI={uniforms:{luminance:{type:"f",value:1},turbidity:{type:"f",value:2},reileigh:{type:"f",value:1},mieCoefficient:{type:"f",value:.005},mieDirectionalG:{type:"f",value:.8},v3LightPosition:{type:"v3",value:new at},up:{type:"v3",value:new at(0,1,0)}},vertexShader:["varying vec3 vWorldPosition;","void main() {","vec4 worldPosition = modelMatrix * vec4( cameraPosition + position, 1.0 );","vWorldPosition = worldPosition.xyz;","gl_Position = projectionMatrix * modelViewMatrix * vec4( cameraPosition + position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D skySampler;","uniform vec3 v3LightPosition;","uniform vec3 up;","varying vec3 vWorldPosition;","// uniform sampler2D sDiffuse;","// const float turbidity = 10.0; //","// const float reileigh = 2.; //","// const float luminance = 1.0; //","// const float mieCoefficient = 0.005;","// const float mieDirectionalG = 0.8;","uniform float luminance;","uniform float turbidity;","uniform float reileigh;","uniform float mieCoefficient;","uniform float mieDirectionalG;","// constants for atmospheric scattering","const float e = 2.71828182845904523536028747135266249775724709369995957;","const float pi = 3.141592653589793238462643383279502884197169;","const float n = 1.0003; // refractive index of air","const float N = 2.545E25; // number of molecules per unit volume for air at","// 288.15K and 1013mb (sea level -45 celsius)","const float pn = 0.035; // depolatization factor for standard air","// wavelength of used primaries, according to preetham","const vec3 lambda = vec3(680E-9, 550E-9, 450E-9);","// mie stuff","// K coefficient for the primaries","const vec3 K = vec3(0.686, 0.678, 0.666);","const float v = 4.0;","// optical length at zenith for molecules","const float rayleighZenithLength = 8.4E3;","const float mieZenithLength = 1.25E3;","const float EE = 1000.0;","const float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;","// 66 arc seconds -> degrees, and the cosine of that","// earth shadow hack","const float cutoffAngle = pi/1.95;","const float steepness = 1.5;","vec3 totalRayleigh(vec3 lambda)","{","return (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn));","}","// A simplied version of the total Reayleigh scattering to works on browsers that use ANGLE","vec3 simplifiedRayleigh()","{","return 0.0005 / vec3(94, 40, 18);","}","float rayleighPhase(float cosTheta)","{ ","return (3.0 / (16.0*pi)) * (1.0 + pow(cosTheta, 2.0));","// return (1.0 / (3.0*pi)) * (1.0 + pow(cosTheta, 2.0));","// return (3.0 / 4.0) * (1.0 + pow(cosTheta, 2.0));","}","vec3 totalMie(vec3 lambda, vec3 K, float T)","{","float c = (0.2 * T ) * 10E-18;","return 0.434 * c * pi * pow((2.0 * pi) / lambda, vec3(v - 2.0)) * K;","}","float hgPhase(float cosTheta, float g)","{","return (1.0 / (4.0*pi)) * ((1.0 - pow(g, 2.0)) / pow(1.0 - 2.0*g*cosTheta + pow(g, 2.0), 1.5));","}","float sunIntensity(float zenithAngleCos)","{","return EE * max(0.0, 1.0 - exp(-((cutoffAngle - acos(zenithAngleCos))/steepness)));","}","// float logLuminance(vec3 c)","// {","// return log(c.r * 0.2126 + c.g * 0.7152 + c.b * 0.0722);","// }","// Filmic ToneMapping http://filmicgames.com/archives/75","float A = 0.15;","float B = 0.50;","float C = 0.10;","float D = 0.20;","float E = 0.02;","float F = 0.30;","float W = 1000.0;","vec3 Uncharted2Tonemap(vec3 x)","{","return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;","}","void main() ","{","vec3 up2 = normalize(cameraPosition.xyz);","float sunfade = 1.0-clamp(1.0-exp((v3LightPosition.y/450000.0)),0.0,1.0);","float reileighCoefficient = reileigh - (1.0* (1.0-sunfade));","vec3 sunDirection = normalize(v3LightPosition);","float sunE = sunIntensity(dot(sunDirection, up2));","// extinction (absorbtion + out scattering) ","// rayleigh coefficients","vec3 betaR = simplifiedRayleigh() * reileighCoefficient;","// mie coefficients","vec3 betaM = totalMie(lambda, K, turbidity) * mieCoefficient;","// optical length","// cutoff angle at 90 to avoid singularity in next formula.","float zenithAngle = acos(max(0.0, dot(up2, normalize(vWorldPosition - cameraPosition))));","float sR = rayleighZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));","float sM = mieZenithLength / (cos(zenithAngle) + 0.15 * pow(93.885 - ((zenithAngle * 180.0) / pi), -1.253));","// combined extinction factor","vec3 Fex = exp(-(betaR * sR + betaM * sM));","// in scattering","float cosTheta = dot(normalize(vWorldPosition - cameraPosition), sunDirection);","float rPhase = rayleighPhase(cosTheta*0.5+0.5);","vec3 betaRTheta = betaR * rPhase;","float mPhase = hgPhase(cosTheta, mieDirectionalG);","vec3 betaMTheta = betaM * mPhase;","vec3 Lin = pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * (1.0 - Fex),vec3(1.5));","Lin *= mix(vec3(1.0),pow(sunE * ((betaRTheta + betaMTheta) / (betaR + betaM)) * Fex,vec3(1.0/2.0)),clamp(pow(1.0-dot(up2, sunDirection),5.0),0.0,1.0));","//nightsky","vec3 direction = normalize(vWorldPosition - cameraPosition);","float theta = acos(direction.y); // elevation --\x3e y-axis, [-pi/2, pi/2]","float phi = atan(direction.z, direction.x); // azimuth --\x3e x-axis [-pi/2, pi/2]","vec2 uv = vec2(phi, theta) / vec2(2.0*pi, pi) + vec2(0.5, 0.0);","// vec3 L0 = texture2D(skySampler, uv).rgb+0.1 * Fex;","vec3 L0 = vec3(0.1) * Fex;","// composition + solar disc","//if (cosTheta > sunAngularDiameterCos)","float sundisk = smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);","// if (normalize(vWorldPosition - cameraPosition).y>0.0)","L0 += (sunE * 19000.0 * Fex)*sundisk;","vec3 whiteScale = 1.0/Uncharted2Tonemap(vec3(W));","vec3 texColor = (Lin+L0); ","texColor *= 0.04 ;","texColor += vec3(0.0,0.001,0.0025)*0.3;","float g_fMaxLuminance = 1.0;","float fLumScaled = 0.1 / luminance; ","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (g_fMaxLuminance * g_fMaxLuminance)))) / (1.0 + fLumScaled); ","float ExposureBias = fLumCompressed;","vec3 curr = Uncharted2Tonemap((log2(2.0/pow(luminance,4.0)))*texColor);","vec3 color = curr*whiteScale;","vec3 retColor = pow(color,vec3(1.0/(1.2+(1.2*sunfade))));","gl_FragColor.rgb = retColor;","gl_FragColor.a = 1. - ( (length(cameraPosition) - 6400000.) / 1000.);","}"].join("\n")},hI=function(e){h(n,e);var t=y(n);function n(){s(this,n);var e=Di.clone(cI.uniforms),i=new Ri({fragmentShader:cI.fragmentShader,vertexShader:cI.vertexShader,uniforms:e,side:1,transparent:!0,depthWrite:!1}),r=new el(4e4,32,15);return t.call(this,r,i)}return A(n)}(Ei),uI="\n#include <logdepthbuf_pars_fragment>\n\nuniform int atmoIN;\nvarying float intensity;\n\nvec4 glowColor = vec4(0.45, 0.74, 1. ,1.0);\n\nvoid main() {\n #include <logdepthbuf_fragment>\n gl_FragColor = glowColor * intensity;\n}\n",dI="\n#include <common>\n#include <logdepthbuf_pars_vertex>\n\nuniform int atmoIN;\nvarying float intensity;\n\nvoid main()\n{\n vec3 normalES = normalize( normalMatrix * normal );\n vec3 normalCAMES = normalize( normalMatrix * cameraPosition );\n\n if(atmoIN == 0) {\n intensity = pow(0.666 - dot(normalES, normalCAMES), 4. );\n } else {\n intensity = pow( 1. - dot(normalES, normalCAMES), 0.8 );\n }\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n #include <logdepthbuf_vertex>\n}\n",fI=new at(1,0,0),pI=new at,mI=new ob("EPSG:4326"),vI=new ob("EPSG:4326"),gI=new Fn(9688568),yI=new Fn,wI=new Fn(197896),xI=6e5,bI=160*qx.x,MI=function(e){h(n,e);var t=y(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"atmosphere",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,n),r.source=!1,(e=t.call(this,i,new zt,r)).isAtmosphere=!0;var a=new Ri({uniforms:{atmoIN:{type:"i",value:0},screenSize:{type:"v2",value:new tt(window.innerWidth,window.innerHeight)}},vertexShader:dI,fragmentShader:uI,side:1,blending:2,transparent:!0,wireframe:!1}),o=new $s(1,64,64),l=new Ei(o,a);l.scale.copy(qx).multiplyScalar(1.14),e.basicAtmosphere=new zt,e.realisticAtmosphere=new zt,e.realisticAtmosphere.visible=!1,e.object3d.add(e.basicAtmosphere),e.object3d.add(e.realisticAtmosphere),e.basicAtmosphere.add(l);var A=new Ri({uniforms:{atmoIN:{type:"i",value:1},screenSize:{type:"v2",value:new tt(window.innerWidth,window.innerHeight)}},vertexShader:dI,fragmentShader:uI,side:0,blending:2,transparent:!0,depthWrite:!1}),c=new Ei(o,A);return c.scale.copy(qx).multiplyScalar(1.002),e.basicAtmosphere.add(c),e.realisticLightingPosition={x:-.5,y:0,z:1},e.fog={enable:!0,distance:bI},e.realisticAtmosphereInitParams=r.Kr?r:{Kr:.0025,Km:.0015,ESun:20,g:-.95,innerRadius:64e5,outerRadius:67e5,wavelength:[.65,.57,.475],scaleDepth:.25},e.object3d.updateMatrixWorld(),e}return A(n,[{key:"update",value:function(e,t,n){n.material.fogDistance=this.fog.distance,n.material.lightingEnabled=this.realisticAtmosphere.visible,n.material.lightPosition=this.realisticLightingPosition}},{key:"preUpdate",value:function(e,t){var n=e.view.camera.camera3D.position;if(this.fog.enable){pI.setFromMatrixPosition(e.view.tileLayer.object3d.matrixWorld);var i=pI.distanceTo(n);this.fog.distance=bI*Math.pow(.25*(i-.99*qx.x)/qx.x,1.5)}else this.fog.distance=1e11;var r=e.view.mainLoop.gfxEngine.renderer;mI.crs=e.view.referenceCrs,mI.setFromVector3(n).as("EPSG:4326",vI);var a=vI.altitude;if(a<xI){var o=(xI-a)/xI;yI.copy(wI).lerp(gI,o),r.setClearColor(yI,r.getClearAlpha())}else r.setClearColor(wI,r.getClearAlpha())}},{key:"_initRealisticLighning",value:function(){var e=this.realisticAtmosphereInitParams,t={v3LightPosition:{value:fI.clone().normalize()},v3InvWavelength:{value:new at(1/Math.pow(e.wavelength[0],4),1/Math.pow(e.wavelength[1],4),1/Math.pow(e.wavelength[2],4))},fCameraHeight:{value:0},fCameraHeight2:{value:0},fInnerRadius:{value:e.innerRadius},fInnerRadius2:{value:e.innerRadius*e.innerRadius},fOuterRadius:{value:e.outerRadius},fOuterRadius2:{value:e.outerRadius*e.outerRadius},fKrESun:{value:e.Kr*e.ESun},fKmESun:{value:e.Km*e.ESun},fKr4PI:{value:4*e.Kr*Math.PI},fKm4PI:{value:4*e.Km*Math.PI},fScale:{value:1/(e.outerRadius-e.innerRadius)},fScaleDepth:{value:e.scaleDepth},fScaleOverScaleDepth:{value:1/(e.outerRadius-e.innerRadius)/e.scaleDepth},g:{value:e.g},g2:{value:e.g*e.g},nSamples:{value:3},fSamples:{value:3},tDisplacement:{value:new ht},tSkyboxDiffuse:{value:new ht},fNightScale:{value:1}},n=new Ei(new $s(e.innerRadius,50,50),new Ri({uniforms:t,vertexShader:"\nuniform vec3 v3LightPosition; // The direction vector to the light source\nuniform vec3 v3InvWavelength; // 1 / pow(wavelength, 4) for the red, green, and blue channels\nuniform float fCameraHeight; // The camera's current height\nuniform float fCameraHeight2; // fCameraHeight^2\nuniform float fOuterRadius; // The outer (atmosphere) radius\nuniform float fOuterRadius2; // fOuterRadius^2\nuniform float fInnerRadius; // The inner (planetary) radius\nuniform float fInnerRadius2; // fInnerRadius^2\nuniform float fKrESun; // Kr * ESun\nuniform float fKmESun; // Km * ESun\nuniform float fKr4PI; // Kr * 4 * PI\nuniform float fKm4PI; // Km * 4 * PI\nuniform float fScale; // 1 / (fOuterRadius - fInnerRadius)\nuniform float fScaleDepth; // The scale depth (i.e. the altitude at which the atmosphere's average density is found)\nuniform float fScaleOverScaleDepth; // fScale / fScaleDepth\n\nvarying vec3 c0;\nvarying vec3 c1;\n\nconst int nSamples = 3;\nconst float fSamples = 3.0;\n\nfloat scale(float fCos)\n{\n float x = 1.0 - fCos;\n return fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\n\nvoid main(void) {\n\n float cameraHeight2 = length(cameraPosition) * length(cameraPosition);\n\n // Get the ray from the camera to the vertex and its length (which is the far point of the ray passing through the atmosphere)\n vec3 v3Ray = position - cameraPosition;\n float fFar = length(v3Ray);\n v3Ray /= fFar;\n\n // Calculate the closest intersection of the ray with the outer atmosphere (which is the near point of the ray passing through the atmosphere)\n float B = 2.0 * dot(cameraPosition, v3Ray);\n float C = cameraHeight2 - fOuterRadius2;\n float fDet = max(0.0, B*B - 4.0 * C);\n float fNear = 0.5 * (-B - sqrt(fDet));\n\n // Calculate the ray's starting position, then calculate its scattering offset\n vec3 v3Start = cameraPosition + v3Ray * fNear;\n fFar -= fNear;\n float fDepth = exp((fInnerRadius - fOuterRadius) / fScaleDepth);\n float fCameraAngle = dot(-v3Ray, position) / length(position);\n float fLightAngle = dot(v3LightPosition, position) / length(position);\n float fCameraScale = scale(fCameraAngle);\n float fLightScale = scale(fLightAngle);\n float fCameraOffset = fDepth*fCameraScale;\n float fTemp = (fLightScale + fCameraScale);\n\n // Initialize the scattering loop variables\n float fSampleLength = fFar / fSamples;\n float fScaledLength = fSampleLength * fScale;\n vec3 v3SampleRay = v3Ray * fSampleLength;\n vec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\n\n // Now loop through the sample rays\n vec3 v3FrontColor = vec3(0.0, 0.0, 0.0);\n vec3 v3Attenuate = vec3(0.0, 0.0, 0.0);\n for(int i=0; i<nSamples; i++)\n {\n float fHeight = length(v3SamplePoint);\n float fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\n float fScatter = fDepth*fTemp - fCameraOffset;\n v3Attenuate = exp(-fScatter * (v3InvWavelength * fKr4PI + fKm4PI));\n v3FrontColor += v3Attenuate * (fDepth * fScaledLength);\n v3SamplePoint += v3SampleRay;\n }\n\n // Calculate the attenuation factor for the ground\n c0 = v3Attenuate;\n c1 = v3FrontColor * (v3InvWavelength * fKrESun + fKmESun);\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",fragmentShader:"\nvarying vec3 c0;\nvarying vec3 c1;\n\nvoid main (void) {\n\tgl_FragColor = vec4(c1, 1.0 - c0/4.);\n}",blending:2,transparent:!0,depthTest:!1,depthWrite:!1})),i=new Ei(new $s(e.outerRadius,196,196),new Ri({uniforms:t,vertexShader:"\nuniform vec3 v3LightPosition; // The direction vector to the light source\nuniform vec3 v3InvWavelength; // 1 / pow(wavelength, 4) for the red, green, and blue channels\nuniform float fCameraHeight; // The camera's current height\nuniform float fCameraHeight2; // fCameraHeight^2\nuniform float fOuterRadius; // The outer (atmosphere) radius\nuniform float fOuterRadius2; // fOuterRadius^2\nuniform float fInnerRadius; // The inner (planetary) radius\nuniform float fInnerRadius2; // fInnerRadius^2\nuniform float fKrESun; // Kr * ESun\nuniform float fKmESun; // Km * ESun\nuniform float fKr4PI; // Kr * 4 * PI\nuniform float fKm4PI; // Km * 4 * PI\nuniform float fScale; // 1 / (fOuterRadius - fInnerRadius)\nuniform float fScaleDepth; // The scale depth (i.e. the altitude at which the atmosphere's average density is found)\nuniform float fScaleOverScaleDepth; // fScale / fScaleDepth\n\nconst int nSamples = 3;\nconst float fSamples = 3.0;\n\nvarying vec3 v3Direction;\nvarying vec3 c0;\nvarying vec3 c1;\n\nfloat scale(float fCos) {\n float x = 1.0 - fCos;\n return fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\n\nvoid main(void) {\n float lengthCamera = length(cameraPosition);\n float cameraHeight2 = lengthCamera * lengthCamera;\n\n // Get the ray from the camera to the vertex and its length (which is the far point of the ray passing through the atmosphere)\n vec3 v3Ray = position - cameraPosition;\n float fFar = length(v3Ray);\n v3Ray /= fFar;\n\n // Calculate the closest intersection of the ray with the outer atmosphere (which is the near point of the ray passing through the atmosphere)\n float B = 2.0 * dot(cameraPosition, v3Ray);\n float C = cameraHeight2 - fOuterRadius2;\n float fDet = max(0.0, B*B - 4.0 * C);\n float fNear = 0.5 * (-B - sqrt(fDet));\n\n // Calculate the ray's starting position, then calculate its scattering offset\n vec3 v3Start = cameraPosition + v3Ray * fNear;\n fFar -= fNear;\n float fStartAngle = dot(v3Ray, v3Start) / fOuterRadius;\n float fStartDepth = exp(-1.0 / fScaleDepth);\n float fStartOffset = fStartDepth * scale(fStartAngle);\n\n // Initialize the scattering loop variables\n float fSampleLength = fFar / fSamples;\n float fScaledLength = fSampleLength * fScale;\n vec3 v3SampleRay = v3Ray * fSampleLength;\n vec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\n\n // Now loop through the sample rays\n vec3 v3FrontColor = vec3(0.0, 0.0, 0.0);\n for(int i=0; i<nSamples; i++)\n {\n float fHeight = length(v3SamplePoint);\n float fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fHeight));\n float fLightAngle = dot(v3LightPosition, v3SamplePoint) / fHeight;\n float fCameraAngle = dot(v3Ray, v3SamplePoint) / fHeight;\n float fScatter = (fStartOffset + fDepth * (scale(fLightAngle) - scale(fCameraAngle)));\n vec3 v3Attenuate = exp(-fScatter * (v3InvWavelength * fKr4PI + fKm4PI));\n\n v3FrontColor += v3Attenuate * (fDepth * fScaledLength);\n v3SamplePoint += v3SampleRay;\n }\n\n // Finally, scale the Mie and Rayleigh colors and set up the varying variables for the pixel shader\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n c0 = v3FrontColor * (v3InvWavelength * fKrESun);\n c1 = v3FrontColor * fKmESun;\n v3Direction = cameraPosition - position;\n}",fragmentShader:"\nuniform vec3 v3LightPos;\nuniform float g;\nuniform float g2;\n\nvarying vec3 v3Direction;\nvarying vec3 c0;\nvarying vec3 c1;\n\n// Calculates the Mie phase function\nfloat getMiePhase(float fCos, float fCos2, float g, float g2) {\n return 1.5 * ((1.0 - g2) / (2.0 + g2)) * (1.0 + fCos2) / pow(1.0 + g2 - 2.0 * g * fCos, 1.5);\n}\n\n// Calculates the Rayleigh phase function\nfloat getRayleighPhase(float fCos2) {\n return 0.75 + 0.75 * fCos2;\n}\n\nvoid main (void) {\n float fCos = dot(v3LightPos, v3Direction) / length(v3Direction);\n float fCos2 = fCos * fCos;\n\n vec3 color = getRayleighPhase(fCos2) * c0 + getMiePhase(fCos, fCos2, g, g2) * c1;\n\n gl_FragColor = vec4(color, 1.0);\n gl_FragColor.a = gl_FragColor.b;\n}",transparent:!0,side:1})),r=new hI;r.frustumCulled=!1,n.layers.mask=this.object3d.layers.mask,i.layers.mask=this.object3d.layers.mask,r.layers.mask=this.object3d.layers.mask,this.realisticAtmosphere.add(n),this.realisticAtmosphere.add(i),this.realisticAtmosphere.add(r);var a=10,o=2,s=.005,l=.8,A=1;r.material.uniforms.turbidity.value=a,r.material.uniforms.reileigh.value=o,r.material.uniforms.luminance.value=A,r.material.uniforms.mieCoefficient.value=s,r.material.uniforms.mieDirectionalG.value=l,r.material.uniforms.up.value=new at}},{key:"setRealisticOn",value:function(e){var t=this;e&&(this.realisticAtmosphere.children.length||this._initRealisticLighning(),this.realisticLightingPosition=AI.getSunPositionInScene((new Date).getTime(),48.85,2.35).normalize(),this.realisticAtmosphere.children.forEach((function(e){return e.material.uniforms.v3LightPosition.value.copy(t.realisticLightingPosition)}))),this.basicAtmosphere.visible=!e,this.realisticAtmosphere.visible=e}}]),n}(G_),CI=function(e){h(n,e);var t=y(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};s(this,n),zt.DefaultUp.set(0,0,1),(i=t.call(this,"EPSG:4978",e,a)).isGlobeView=!0,i.camera.camera3D.near=Math.max(15,2352e-9*qx.x),i.camera.camera3D.far=10*qx.x;var o=new lI("globe",a.object3d,a);i.mainLoop.gfxEngine.label2dRenderer.infoTileLayer=o.info;var l=new PA;return l.position.set(-.5,0,1),l.updateMatrixWorld(!0),o.object3d.add(l),i.addLayer(o),i.tileLayer=o,Array.isArray(r.coord)&&(r.coord=new ob("EPSG:4326").setFromArray(r.coord)),r.isExtent||(r.coord=r.coord||new ob("EPSG:4326",0,0),r.tilt=r.tilt||89.5,r.heading=r.heading||0,r.range=r.range||2*qx.x),a.noControls?NT.transformCameraToLookAtTarget(v(i),i.camera.camera3D,r):(i.controls=new N_(v(i),r),i.controls.handleCollision=void 0===a.handleCollision||a.handleCollision),i.addLayer(new MI("atmosphere",a.atmosphere)),i.camera.resize(e.clientWidth,e.clientHeight),i}return A(n,[{key:"addLayer",value:function(e){if(!e||!e.isLayer)return Promise.reject(new Error("Add Layer type object"));if(e.isColorLayer){if(!this.tileLayer.tileMatrixSets.includes(Jx.formatToTms(e.source.crs)))return e._reject("Only ".concat(this.tileLayer.tileMatrixSets," tileMatrixSet are currently supported for color layers"))}else if(e.isElevationLayer&&Jx.formatToTms(e.source.crs)!==this.tileLayer.tileMatrixSets[0])return e._reject("Only ".concat(this.tileLayer.tileMatrixSets[0]," tileMatrixSet is currently supported for elevation layers"));return b(u(n.prototype),"addLayer",this).call(this,e,this.tileLayer)}},{key:"getPixelsToDegrees",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1?arguments[1]:void 0;return this.getMetersToDegrees(this.getPixelsToMeters(e,t))}},{key:"getPixelsToDegreesFromDistance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.getMetersToDegrees(this.getPixelsToMetersFromDistance(e,t))}},{key:"getMetersToDegrees",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return Hh.radToDeg(2*Math.asin(e/(2*qx.x)))}}]),n}($S),BI=32,EI=84,SI=89,TI=_.LEFT,_I=_.MIDDLE,II=_.RIGHT,LI=new at,FI=new nt,kI=0,PI=new at,UI=-1,DI=0,RI=1,OI=2,NI=3,zI=4,QI={default:"auto",drag:"move",pan:"cell",travel:"wait",rotate:"move",ortho_zoom:"wait"},GI=new at,HI=new tt,VI=new tt,jI=new tt(0,0),WI=new at,XI=new at,YI=new at,KI=new at(0,0,0),ZI=0,JI=new at,qI=new nt,$I=new tt,eL=new at,tL=new at,nL=new nt,iL=new nt,rL=0,aL=0,oL=!1,sL=!1,lL=0,AL=0,cL=new Nc,hL=new vn(new at(0,0,-1)),uL={enableRotation:!0,rotateSpeed:2,minPanSpeed:.05,maxPanSpeed:15,zoomTravelTime:.2,zoomFactor:2,maxResolution:0,minResolution:1/0,maxAltitude:5e7,groundLevel:200,autoTravelTimeMin:1.5,autoTravelTimeMax:4,autoTravelTimeDist:5e4,smartTravelHeightMin:75,smartTravelHeightMax:500,instantTravel:!1,minZenithAngle:0,maxZenithAngle:82.5,focusOnMouseOver:!0,focusOnMouseClick:!0,handleCollision:!0,minDistanceCollision:30,enableSmartTravel:!0,enablePan:!0},dL="moved",fL=function(e){h(n,e);var t=y(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this,n),(i=t.call(this,e)).camera.isOrthographicCamera?(kI=i.camera.zoom,i.enableRotation=!1,i.enablePan=!1,i.maxAltitude=1/0,i.zoomTravelTime="number"==typeof r.zoomTravelTime?r.zoomTravelTime:uL.zoomTravelTime):(i.enableRotation=void 0===r.enableRotation?uL.enableRotation:r.enableRotation,i.rotateSpeed=r.rotateSpeed||uL.rotateSpeed,i.enablePan=void 0===r.enablePan?uL.enablePan:r.enablePan,i.minPanSpeed=r.minPanSpeed||uL.minPanSpeed,i.maxPanSpeed=r.maxPanSpeed||uL.maxPanSpeed,i.maxAltitude=r.maxAltitude||uL.maxAltitude,i.zoomTravelTime=r.zoomTravelTime||uL.zoomTravelTime),r.zoomInFactor&&(console.warn("Controls zoomInFactor parameter is deprecated. Use zoomFactor instead."),r.zoomFactor=r.zoomFactor||r.zoomInFactor),r.zoomOutFactor&&(console.warn("Controls zoomOutFactor parameter is deprecated. Use zoomFactor instead."),r.zoomFactor=r.zoomFactor||r.zoomInFactor||1/r.zoomOutFactor),0===r.zoomFactor&&(console.warn("Controls zoomFactor parameter can not be equal to 0. Its value will be set to default."),r.zoomFactor=uL.zoomFactor),i.zoomInFactor=r.zoomFactor||uL.zoomFactor,i.zoomOutFactor=1/(r.zoomFactor||uL.zoomFactor),i.maxResolution=r.maxResolution||uL.maxResolution,i.minResolution=r.minResolution||uL.minResolution,i.groundLevel=r.groundLevel||uL.groundLevel,i.autoTravelTimeMin=r.autoTravelTimeMin||uL.autoTravelTimeMin,i.autoTravelTimeMax=r.autoTravelTimeMax||uL.autoTravelTimeMax,i.autoTravelTimeDist=r.autoTravelTimeDist||uL.autoTravelTimeDist,r.smartZoomHeightMin&&(console.warn("Controls smartZoomHeightMin parameter is deprecated. Use smartTravelHeightMin instead."),r.smartTravelHeightMin=r.smartTravelHeightMin||r.smartZoomHeightMin),r.smartZoomHeightMax&&(console.warn("Controls smartZoomHeightMax parameter is deprecated. Use smartTravelHeightMax instead."),r.smartTravelHeightMax=r.smartTravelHeightMax||r.smartZoomHeightMax),i.smartTravelHeightMin=r.smartTravelHeightMin||uL.smartTravelHeightMin,i.smartTravelHeightMax=r.smartTravelHeightMax||uL.smartTravelHeightMax,i.instantTravel=r.instantTravel||uL.instantTravel,i.minZenithAngle=(r.minZenithAngle||uL.minZenithAngle)*Math.PI/180,i.maxZenithAngle=(r.maxZenithAngle||uL.maxZenithAngle)*Math.PI/180,i.focusOnMouseOver=r.focusOnMouseOver||uL.focusOnMouseOver,i.focusOnMouseClick=r.focusOnMouseClick||uL.focusOnMouseClick,i.handleCollision=void 0===r.handleCollision?uL.handleCollision:r.handleCollision,i.minDistanceCollision=uL.minDistanceCollision,i.enableSmartTravel=void 0===r.enableSmartTravel?uL.enableSmartTravel:r.enableSmartTravel,LI.copy(i.camera.position),FI.copy(i.camera.quaternion),i.state=UI,i.cursor=QI,i.view.controls&&(console.warn("Deprecated use of PlanarControls. See examples to correct PlanarControls implementation."),i.view.controls.dispose()),i.view.controls=v(i),i._handlerOnKeyDown=i.onKeyDown.bind(v(i)),i._handlerOnMouseDown=i.onMouseDown.bind(v(i)),i._handlerOnMouseUp=i.onMouseUp.bind(v(i)),i._handlerOnMouseMove=i.onMouseMove.bind(v(i)),i._handlerOnMouseWheel=i.onMouseWheel.bind(v(i)),i._handlerFocusOnMouseClick=i.onMouseClick.bind(v(i)),i._handlerFocusOnMouseOver=i.onMouseOver.bind(v(i)),i._handlerContextMenu=i.onContextMenu.bind(v(i)),i._handlerUpdate=i.update.bind(v(i)),i.view.addFrameRequester(Wb,i._handlerUpdate),i.addInputListeners(),i}return A(n,[{key:"dispose",value:function(){this.removeInputListeners(),this.view.removeFrameRequester(Wb,this._handlerUpdate)}},{key:"update",value:function(e,t){t&&(e=16);var n=this.state!==UI;switch(this.state){case NI:this.handleTravel(e),this.dispatchEvent({type:"range-changed"}),this.view.notifyChange(this.camera);break;case zI:this.handleZoomOrtho(e),this.dispatchEvent({type:"range-changed"}),this.view.notifyChange(this.camera);break;case DI:this.handleDragMovement(),this.view.notifyChange(this.camera);break;case OI:this.handleRotation(),this.view.dispatchEvent({type:GS,heading:this.getHeading(),tilt:this.getTilt()}),this.view.notifyChange(this.camera);break;case RI:this.handlePanMovement(),this.view.notifyChange(this.camera)}this.handleCollision&&this.view.camera.adjustAltitudeToAvoidCollisionWithLayer(this.view,this.view.tileLayer,this.minDistanceCollision),n&&this.view.dispatchEvent({type:dL}),jI.set(0,0)}},{key:"initiateDrag",value:function(){this.state=DI,WI.copy(this.getWorldPointAtScreenXY(HI)),YI.set(0,0,0)}},{key:"handleDragMovement",value:function(){this.getWorldPointFromMathPlaneAtScreenXY(HI,WI.z,XI),YI.subVectors(WI,XI),this.camera.position.add(YI),YI.set(0,0,0)}},{key:"initiatePan",value:function(){this.state=RI}},{key:"handlePanMovement",value:function(){JI.set(-jI.x,jI.y,0),this.camera.localToWorld(JI),this.camera.position.copy(JI)}},{key:"initiateRotation",value:function(){this.state=OI,KI.copy(this.getWorldPointAtScreenXY(new tt(.5*this.view.mainLoop.gfxEngine.width,.5*this.view.mainLoop.gfxEngine.height)));var e=this.camera.position.distanceTo(KI);ZI=Math.acos((this.camera.position.z-KI.z)/e)}},{key:"handleRotation",value:function(){var e=-this.rotateSpeed*jI.x/this.view.mainLoop.gfxEngine.width,t=-this.rotateSpeed*jI.y/this.view.mainLoop.gfxEngine.height,n=this.camera.position.clone().sub(KI);0===e&&0===t||(ZI+t>=this.minZenithAngle&&ZI+t<=this.maxZenithAngle&&0!==t&&(ZI+=t,JI.set(0,0,1),qI.setFromUnitVectors(this.camera.up,JI),n.applyQuaternion(qI),JI.setFromMatrixColumn(this.camera.matrix,0),qI.setFromAxisAngle(JI,t),n.applyQuaternion(qI),JI.set(0,0,1),qI.setFromUnitVectors(this.camera.up,JI).invert(),n.applyQuaternion(qI)),0!==e&&(JI.set(0,0,1),qI.setFromAxisAngle(JI,e),n.applyQuaternion(qI))),this.camera.position.copy(n),this.camera.lookAt(GI),this.camera.position.add(KI),this.camera.updateMatrixWorld()}},{key:"initiateZoom",value:function(e){var t;void 0!==e.wheelDelta?t=e.wheelDelta:void 0!==e.detail&&(t=-e.detail),PI.copy(this.getWorldPointAtScreenXY(HI));var n=new at;if(t>0||t<0&&this.maxAltitude>this.camera.position.z){var i=t>0?this.zoomInFactor:this.zoomOutFactor,r=this.view.getPixelsToMeters()/i;if(this.maxResolution>r||r>this.minResolution)return;this.camera.isOrthographicCamera?(this.state=zI,this.view.notifyChange(this.camera),lL=this.camera.zoom,AL=lL*i,PI.z=this.camera.position.z,rL=0,aL=this.zoomTravelTime,this.updateMouseCursorType()):(n.lerpVectors(this.camera.position,PI,1-1/i),this.initiateTravel(n,this.zoomTravelTime,null,!1))}}},{key:"handleZoomOrtho",value:function(e){rL=Math.min(rL+e/1e3/aL,1);var t=lL+rL*(AL-lL);this.camera.zoom!==t&&(this.camera.zoom=t,this.camera.updateProjectionMatrix(),this.view.viewToNormalizedCoords(HI,JI),JI.z=0,JI.unproject(this.camera),this.camera.position.x+=PI.x-JI.x,this.camera.position.y+=PI.y-JI.y,this.camera.updateMatrixWorld(!0)),this.testAnimationEnd()}},{key:"initiateSmartTravel",value:function(){var e=this.getWorldPointAtScreenXY(HI),t=new at;t.copy(e).sub(this.camera.position),t.z=0,t.normalize();var n=this.camera.position.distanceTo(e),i=Hh.lerp(this.smartTravelHeightMin,this.smartTravelHeightMax,Math.min(n/5e3,1)),r=new at;r.copy(e),this.enableRotation&&r.add(t.multiplyScalar(2*-i)),r.z=e.z+i,this.camera.isOrthographicCamera&&(lL=this.camera.zoom,AL=lL*(1+Math.min(n/5e3,1)),r.z=this.camera.position.z),this.initiateTravel(r,"auto",e,!0)}},{key:"initiateTravel",value:function(e,t,n,i){if(this.state=NI,this.view.notifyChange(this.camera),rL=0,this.updateMouseCursorType(),oL=this.enableRotation&&n&&(n.isQuaternion||n.isVector3),sL=i,tL.copy(this.camera.position),nL.copy(this.camera.quaternion),oL&&(n.isQuaternion?iL.copy(n):n.isVector3&&(e===n?(this.camera.lookAt(n),iL.copy(this.camera.quaternion),this.camera.quaternion.copy(nL)):(this.camera.position.copy(e),this.camera.lookAt(n),iL.copy(this.camera.quaternion),this.camera.quaternion.copy(nL),this.camera.position.copy(tL)))),eL.copy(e),this.instantTravel)aL=0;else if("auto"===t){var r=Math.min(1,e.distanceTo(this.camera.position)/this.autoTravelTimeDist);if(aL=Hh.lerp(this.autoTravelTimeMin,this.autoTravelTimeMax,r),oL){var a=.5-.5*iL.normalize().dot(this.camera.quaternion.normalize());aL*=1+2*a,aL=Math.min(aL,this.autoTravelTimeMax)}}else aL=t}},{key:"handleTravel",value:function(e){rL=Math.min(rL+e/1e3/aL,1);var t=sL?this.smooth(rL):rL;this.camera.position.lerpVectors(tL,eL,t);var n=lL+t*(AL-lL);this.camera.isOrthographicCamera&&this.camera.zoom!==n&&(this.camera.zoom=n,this.camera.updateProjectionMatrix()),!0===oL&&this.camera.quaternion.slerpQuaternions(nL,iL,t),this.testAnimationEnd()}},{key:"testAnimationEnd",value:function(){1===rL&&(this.state=UI,this.updateMouseCursorType())}},{key:"goToTopView",value:function(){var e=new at,t=new nt;e.copy(this.getWorldPointAtScreenXY(new tt(.5*this.view.mainLoop.gfxEngine.width,.5*this.view.mainLoop.gfxEngine.height))),e.z+=Math.min(this.maxAltitude,this.camera.position.distanceTo(e)),t.setFromAxisAngle(new at(1,0,0),0),this.initiateTravel(e,"auto",t,!0)}},{key:"goToStartView",value:function(){this.camera.isOrthographicCamera&&(lL=this.camera.zoom,AL=kI),this.initiateTravel(LI,"auto",FI,!0)}},{key:"getWorldPointFromMathPlaneAtScreenXY",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new at;return $I.copy(this.view.viewToNormalizedCoords(e)),cL.setFromCamera($I,this.camera),hL.constant=t,cL.ray.intersectPlane(hL,n),n}},{key:"getWorldPointAtScreenXY",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new at;return this.view.getPickingPositionFromDepth(e,t)||this.getWorldPointFromMathPlaneAtScreenXY(e,this.groundLevel,t),t}},{key:"addInputListeners",value:function(){this.view.domElement.addEventListener("keydown",this._handlerOnKeyDown,!1),this.view.domElement.addEventListener("mousedown",this._handlerOnMouseDown,!1),this.view.domElement.addEventListener("mouseup",this._handlerOnMouseUp,!1),this.view.domElement.addEventListener("mouseleave",this._handlerOnMouseUp,!1),this.view.domElement.addEventListener("mousemove",this._handlerOnMouseMove,!1),this.view.domElement.addEventListener("mousewheel",this._handlerOnMouseWheel,!1),this.focusOnMouseOver&&this.view.domElement.addEventListener("mouseover",this._handlerFocusOnMouseOver,!1),this.focusOnMouseClick&&this.view.domElement.addEventListener("click",this._handlerFocusOnMouseClick,!1),this.view.domElement.addEventListener("contextmenu",this._handlerContextMenu,!1),this.view.domElement.addEventListener("MozMousePixelScroll",this._handlerOnMouseWheel,!1)}},{key:"removeInputListeners",value:function(){this.view.domElement.removeEventListener("keydown",this._handlerOnKeyDown,!0),this.view.domElement.removeEventListener("mousedown",this._handlerOnMouseDown,!1),this.view.domElement.removeEventListener("mouseup",this._handlerOnMouseUp,!1),this.view.domElement.removeEventListener("mouseleave",this._handlerOnMouseUp,!1),this.view.domElement.removeEventListener("mousemove",this._handlerOnMouseMove,!1),this.view.domElement.removeEventListener("mousewheel",this._handlerOnMouseWheel,!1),this.view.domElement.removeEventListener("mouseover",this._handlerFocusOnMouseOver,!1),this.view.domElement.removeEventListener("click",this._handlerFocusOnMouseClick,!1),this.view.domElement.removeEventListener("contextmenu",this._handlerContextMenu,!1),this.view.domElement.removeEventListener("MozMousePixelScroll",this._handlerOnMouseWheel,!1)}},{key:"updateMouseCursorType",value:function(){switch(this.state){case UI:this.view.domElement.style.cursor=this.cursor.default;break;case DI:this.view.domElement.style.cursor=this.cursor.drag;break;case RI:this.view.domElement.style.cursor=this.cursor.pan;break;case NI:this.view.domElement.style.cursor=this.cursor.travel;break;case zI:this.view.domElement.style.cursor=this.cursor.ortho_zoom;break;case OI:this.view.domElement.style.cursor=this.cursor.rotate}}},{key:"updateMousePositionAndDelta",value:function(e){this.view.eventToViewCoords(e,HI),jI.copy(HI).sub(VI),VI.copy(HI)}},{key:"setCursor",value:function(e,t){this.cursor[e]=t,this.updateMouseCursorType()}},{key:"onMouseDown",value:function(e){if(e.preventDefault(),UI===this.state){if(eI=e.button,this.updateMousePositionAndDelta(e),TI===e.button)if(e.ctrlKey){if(!this.enableRotation)return;this.initiateRotation()}else this.initiateDrag();else if(_I===e.button){if(!this.enableSmartTravel)return;this.initiateSmartTravel()}else if(II===e.button){if(!this.enablePan)return;this.initiatePan()}this.updateMouseCursorType()}}},{key:"onMouseUp",value:function(e){e.preventDefault(),NI!==this.state&&zI!==this.state&&eI===e.button&&(this.state=UI),this.updateMouseCursorType()}},{key:"onMouseMove",value:function(e){e.preventDefault(),this.updateMousePositionAndDelta(e),UI!==this.state&&this.view.notifyChange()}},{key:"onKeyDown",value:function(e){if(UI===this.state)switch(e.keyCode){case EI:this.camera.isOrthographicCamera||this.goToTopView();break;case SI:this.goToStartView();break;case BI:this.enableSmartTravel&&this.initiateSmartTravel(e)}}},{key:"onMouseWheel",value:function(e){e.preventDefault(),e.stopPropagation(),UI===this.state&&this.initiateZoom(e)}},{key:"onMouseOver",value:function(){this.view.domElement.focus()}},{key:"onMouseClick",value:function(){this.view.domElement.focus()}},{key:"onContextMenu",value:function(e){e.preventDefault()}},{key:"smooth",value:function(e){return Math.pow(Math.pow(e,2)*(3-2*e),1.2)}},{key:"zoomIn",value:function(){this._getScreenCenter(),this.initiateZoom({wheelDelta:1})}},{key:"zoomOut",value:function(){this._getScreenCenter(),this.initiateZoom({wheelDelta:-1})}},{key:"_getScreenCenter",value:function(){var e=this.view.domElement.getBoundingClientRect();HI.set(e.x+e.width/2-e.x,e.y+e.height/2-e.y)}}]),n}(XT),pL=new nt,mL=new at,vL=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(s(this,e),t.projection&&(console.warn("PlanarTileBuilder projection parameter is deprecated, use crs instead."),t.crs=t.crs||t.projection),!t.crs)throw new Error("options.crs is mandatory for PlanarTileBuilder");this.crs=t.crs,this.tmp={coords:new ob("EPSG:4326",0,0),position:new at,normal:new at(0,0,1)},this.uvCount=t.uvCount||1}return A(e,[{key:"prepare",value:function(e){e.nbRow=Math.pow(2,e.zoom+1),e.projected=new at}},{key:"center",value:function(e){return e.center(this.tmp.coords),mL.set(this.tmp.coords.x,this.tmp.coords.y,0),mL}},{key:"vertexPosition",value:function(e){return this.tmp.position.set(e.projected.x,e.projected.y,0),this.tmp.position}},{key:"vertexNormal",value:function(){return this.tmp.normal}},{key:"uProjecte",value:function(e,t){t.projected.x=t.extent.west+e*(t.extent.east-t.extent.west)}},{key:"vProjecte",value:function(e,t){t.projected.y=t.extent.south+e*(t.extent.north-t.extent.south)}},{key:"computeSharableExtent",value:function(e){return{sharableExtent:new bb(e.crs,0,Math.abs(e.west-e.east),0,Math.abs(e.north-e.south)),quaternion:pL,position:this.center(e).clone()}}}]),e}(),gL=function(e){h(n,e);var t=y(n);function n(e,i,r){var a,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};s(this,n);var l=Jx.formatToTms(i.crs),A=[l];return gb.get(i.crs)||gb.set(i.crs,i),o.tileMatrixSets=A,(a=t.call(this,e,r||new ja,[i],new vL({crs:i.crs}),o)).isPlanarLayer=!0,a.extent=i,a.minSubdivisionLevel=null==a.minSubdivisionLevel?0:a.minSubdivisionLevel,a.maxSubdivisionLevel=null==a.maxSubdivisionLevel?5:a.maxSubdivisionLevel,a.maxDeltaElevation=a.maxDeltaElevation||4,a}return A(n)}(iI),yL=function(e){h(n,e);var t=y(n);function n(e,i){var r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};s(this,n),zt.DefaultUp.set(0,0,1),(r=t.call(this,i.crs,e,a)).isPlanarView=!0;var o=i.dimensions(),l=Math.max(o.x,o.y),A=r.camera.camera3D;A.near=.1,A.far=A.isOrthographicCamera?2e3:2*l,A.updateProjectionMatrix();var c=new gL("planar",i,a.object3d,a);r.mainLoop.gfxEngine.label2dRenderer.infoTileLayer=c.info,r.addLayer(c);var h=a.placement||{};return Array.isArray(h.coord)&&(h.coord=new ob("EPSG:4326").setFromArray(h.coord)),h.isExtent||(h.coord=h.coord||i.center(),h.tilt=h.tilt||90,h.heading=h.heading||0,h.range=h.range||l),NT.transformCameraToLookAtTarget(v(r),A,h),a.noControls||(r.controls=new fL(v(r),a.controls)),r.tileLayer=c,r}return A(n,[{key:"addLayer",value:function(e){return b(u(n.prototype),"addLayer",this).call(this,e,this.tileLayer)}}]),n}($S),wL=new ob("EPSG:4326",0,0,0),xL=new bt;function bL(e,t){e.geometry&&e.geometry.applyMatrix4(t),e.children.forEach((function(e){return bL(e,t)}))}function ML(e,t){if(e){e.layer=t,e.material&&(e.material.transparent=t.opacity<1,e.material.opacity=t.opacity,e.material.wireframe=t.wireframe,t.size&&(e.material.size=t.size),t.linewidth&&(e.material.linewidth=t.linewidth)),e.layers.set(t.threejsLayer);var n,i=S(e.children);try{for(i.s();!(n=i.n()).done;){ML(n.value,t)}}catch(e){i.e(e)}finally{i.f()}return e}}var CL={update:function(e,t,n){if(n.parent||!n.children.length){if(n.visible){if(void 0===n.layerUpdateState[t.id])n.layerUpdateState[t.id]=new IS;else if(!n.layerUpdateState[t.id].canTryUpdate())return;var i=n.children.filter((function(e){return e.layer==t}));if(i.length>0)return i;var r=n.getExtentsByProjection(t.source.crs)||[n.extent],a=r[0].zoom;if(a==t.zoom.min&&this.source.extentInsideLimit(n.extent,a)&&(!t.source.isFileSource||n.extent.isPointInside(t.source.extent.center(wL)))){n.layerUpdateState[t.id].newTry();var o={layer:t,extentsSource:r,view:e.view,threejsLayer:t.threejsLayer,requester:n};return e.scheduler.execute(o).then((function(e){if(e=e[0]){var i=!e.layer;if(ML(e,t),t.onMeshCreated&&t.onMeshCreated(e),n.layerUpdateState[t.id].success(),!n.parent)return void LS.removeChildrenAndCleanupRecursively(t,e);i&&(xL.copy(n.matrixWorld).invert().elements[14]-=e.minAltitude,bL(e,xL)),e.minAltitude&&(e.position.z=e.minAltitude),e.layer=t,n.add(e),n.updateMatrixWorld()}else n.layerUpdateState[t.id].failure(1,!0)}),(function(i){return Y_(i,n,t,n.level,e.view)}))}n.layerUpdateState[t.id].noMoreUpdatePossible()}}else LS.removeChildrenAndCleanupRecursively(t,n)}};new at,new Fn(1,1,1),new Fn(.5,.5,.5),new Fn(.5,.5,.5),new Fn(.63,.32,.18),new Fn(0,1,0),new Fn(0,.8,0),new Fn(0,.6,0),new Fn(1,.66,0),new Fn(1,0,1),new Fn(1,0,0),new Fn(0,0,1),new Fn(.8,.8,1),new Fn(.4,.4,.7),new Fn(1,1,0),new Fn(.3,.6,.6);var BL={38:{method:"translateZ",sign:-1},40:{method:"translateZ",sign:1},37:{method:"translateX",sign:-1},39:{method:"translateX",sign:1},33:{method:"rotateZ",sign:1,noSpeed:!0},34:{method:"rotateZ",sign:-1,noSpeed:!0},wheelup:{method:"translateZ",sign:1,oneshot:!0},wheeldown:{method:"translateZ",sign:-1,oneshot:!0}};function EL(e){e.preventDefault(),this._isMouseDown=!0;var t=this.view.eventToViewCoords(e);this._onMouseDownMouseX=t.x,this._onMouseDownMouseY=t.y}function SL(e){e.preventDefault(),this._isMouseDown=!0,this._onMouseDownMouseX=e.touches[0].pageX,this._onMouseDownMouseY=e.touches[0].pageY}function TL(e){if(!0===this._isMouseDown){var t=this.view.eventToViewCoords(e),n=Hh.degToRad(this._camera3D.fov)/this.view.mainLoop.gfxEngine.height;this._camera3D.rotateY((t.x-this._onMouseDownMouseX)*n),this._camera3D.rotateX((t.y-this._onMouseDownMouseY)*n),this._onMouseDownMouseX=t.x,this._onMouseDownMouseY=t.y,this.view.notifyChange(this._camera3D,!1)}}function _L(){this._isMouseDown=!1}function IL(e){var t=BL[e.keyCode];t&&(this.moves.delete(t),e.preventDefault())}function LL(e){var t=BL[e.keyCode];t&&(this.moves.add(t),this.view.notifyChange(this._camera3D,!1),e.preventDefault())}function FL(e){var t=0;void 0!==e.wheelDelta?t=e.wheelDelta:void 0!==e.detail&&(t=-e.detail),t<0?this.moves.add(BL.wheelup):this.moves.add(BL.wheeldown),this.view.notifyChange(this._camera3D,!1)}var kL=function(e){h(n,e);var t=y(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,n),(i=t.call(this)).view=e,i.options=r,i._camera3D=e.camera.camera3D,i.moves=new Set,i.moveSpeed=10,i._onMouseDownMouseX=0,i._onMouseDownMouseY=0,i._isMouseDown=!1,e.domElement.addEventListener("mousedown",EL.bind(v(i)),!1),e.domElement.addEventListener("touchstart",SL.bind(v(i)),!1);var a=TL.bind(v(i));return e.domElement.addEventListener("mousemove",a,!1),e.domElement.addEventListener("touchmove",a,!1),e.domElement.addEventListener("mouseup",_L.bind(v(i)),!1),e.domElement.addEventListener("touchend",_L.bind(v(i)),!1),e.domElement.addEventListener("mousewheel",FL.bind(v(i)),!1),e.domElement.addEventListener("DOMMouseScroll",FL.bind(v(i)),!1),window.addEventListener("keyup",IL.bind(v(i)),!0),window.addEventListener("keydown",LL.bind(v(i)),!0),i.view.addFrameRequester(Wb,i.update.bind(v(i))),r.focusOnMouseOver&&e.domElement.addEventListener("mouseover",(function(){return e.domElement.focus()})),r.focusOnClick&&e.domElement.addEventListener("click",(function(){return e.domElement.focus()})),i}return A(n,[{key:"isUserInteracting",value:function(){return 0!==this.moves.size||this._isMouseDown}},{key:"update",value:function(e,t){t&&(e=16);var n,i=S(this.moves);try{for(i.s();!(n=i.n()).done;){var r=n.value;this._camera3D[r.method](r.sign*(r.noSpeed?1:this.moveSpeed)*e/1e3)}}catch(e){i.e(e)}finally{i.f()}if(this.moves.size>0||this._isMouseDown){this.view.notifyChange(this._camera3D);var a,o=S(this.moves);try{for(o.s();!(a=o.n()).done;){var s=a.value;s.oneshot&&this.moves.delete(s)}}catch(e){o.e(e)}finally{o.f()}}}}]),n}(Je);function PL(e,t,n){var i=.5*Hh.degToRad(n-e.fov);return Hh.clamp(t,-i,i)}var UL=new at(0,1,0);function DL(e,t,n){t.quaternion.setFromUnitVectors(UL,t.up),t.rotateY(n.rotateY),t.rotateX(n.rotateX),e.notifyChange(e.camera.camera3D)}var RL={38:{method:"translateZ",sign:-1},40:{method:"translateZ",sign:1},37:{method:"translateX",sign:-1},39:{method:"translateX",sign:1},33:{method:"translateY",sign:1},34:{method:"translateY",sign:-1}};function OL(e){this.camera.position.z+=e}var NL=new at,zL=new nt,QL=new Bt(0,0,0,"YXZ");function GL(e){NL.copy(this.camera.position),NL.normalize(),this.camera.position.add(NL.multiplyScalar(e))}var HL=function(e){h(n,e);var t=y(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(s(this,n),(i=t.call(this)).isFirstPersonControls=!0,i.camera=e.camera.camera3D,i.view=e,i.moves=new Set,r.panoramaRatio){var a=200*r.panoramaRatio/(2*Math.PI);r.verticalFOV=2==r.panoramaRatio?180:Hh.radToDeg(2*Math.atan(200/(2*a)))}return r.verticalFOV=r.verticalFOV||180,r.moveSpeed=void 0===r.moveSpeed?10:r.moveSpeed,i.options=r,i._isMouseDown=!1,i._onMouseDownMouseX=0,i._onMouseDownMouseY=0,i._state={rotateX:0,rotateY:0,snapshot:function(){return{rotateX:this.rotateX,rotateY:this.rotateY}}},i.reset(),i.eventListeners=r.disableEventListeners,r.disableEventListeners||(i._onMouseDown=i.onMouseDown.bind(v(i)),i._onMouseMove=i.onMouseMove.bind(v(i)),i._onMouseUp=i.onMouseUp.bind(v(i)),i._onMouseWheel=i.onMouseWheel.bind(v(i)),i._onKeyUp=i.onKeyUp.bind(v(i)),i._onKeyDown=i.onKeyDown.bind(v(i)),e.domElement.addEventListener("mousedown",i._onMouseDown,!1),e.domElement.addEventListener("touchstart",i._onMouseDown,!1),e.domElement.addEventListener("mousemove",i._onMouseMove,!1),e.domElement.addEventListener("touchmove",i._onMouseMove,!1),e.domElement.addEventListener("mouseup",i._onMouseUp,!1),e.domElement.addEventListener("touchend",i._onMouseUp,!1),e.domElement.addEventListener("mousewheel",i._onMouseWheel,!1),e.domElement.addEventListener("DOMMouseScroll",i._onMouseWheel,!1),document.addEventListener("keydown",i._onKeyDown,!1),document.addEventListener("keyup",i._onKeyUp,!1)),i.view.addFrameRequester(Wb,i.update.bind(v(i))),i._onFocus=function(){return e.domElement.focus()},i.focusOnMouseOver=r.focusOnMouseOver,r.focusOnMouseOver&&e.domElement.addEventListener("mouseover",i._onFocus),i.focusOnClick=r.focusOnClick,r.focusOnClick&&e.domElement.addEventListener("click",i._onFocus),"EPSG:4978"==e.referenceCrs?i.moveCameraVertical=GL:i.moveCameraVertical=OL,i}return A(n,[{key:"isUserInteracting",value:function(){return 0!==this.moves.size&&!this._isMouseDown}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];zL.setFromUnitVectors(UL,this.camera.up),zL.invert(),zL.multiply(this.camera.quaternion),QL.setFromQuaternion(zL),e||(this._state.rotateX=QL.x),this._state.rotateY=QL.y}},{key:"update",value:function(e,t,n){if(0!=this.enabled){t&&(e=16);var i,r=this.camera.position.y,a=S(this.moves);try{for(a.s();!(i=a.n()).done;){var o=i.value;"translateY"===o.method?this.moveCameraVertical(o.sign*this.options.moveSpeed*e/1e3):this.camera[o.method](o.sign*this.options.moveSpeed*e/1e3)}}catch(e){a.e(e)}finally{a.f()}!0!==this._isMouseDown&&!0!==n||DL(this.view,this.camera,this._state),this.moves.size&&this.view.notifyChange(this.view.camera.camera3D),this.camera.position.y=r}}},{key:"onMouseDown",value:function(e){if(0!=this.enabled){this._isMouseDown=!0;var t=this.view.eventToViewCoords(e);this._onMouseDownMouseX=t.x,this._onMouseDownMouseY=t.y,this._stateOnMouseDown=this._state.snapshot()}}},{key:"onMouseUp",value:function(){0!=this.enabled&&(this._isMouseDown=!1)}},{key:"onMouseMove",value:function(e){if(0!=this.enabled&&!0===this._isMouseDown){var t=Hh.degToRad(this.camera.fov)/this.view.mainLoop.gfxEngine.height,n=this.view.eventToViewCoords(e);this._state.rotateY=(n.x-this._onMouseDownMouseX)*t+this._stateOnMouseDown.rotateY,this._state.rotateX=PL(this.camera,(n.y-this._onMouseDownMouseY)*t+this._stateOnMouseDown.rotateX,this.options.verticalFOV),DL(this.view,this.camera,this._state)}}},{key:"onMouseWheel",value:function(e){if(0!=this.enabled){var t=0;void 0!==e.wheelDelta?t=-e.wheelDelta:void 0!==e.detail&&(t=e.detail),this.camera.fov=Hh.clamp(this.camera.fov+Math.sign(t),10,Math.min(100,this.options.verticalFOV)),this.camera.updateProjectionMatrix(),this._state.rotateX=PL(this.camera,this._state.rotateX,this.options.verticalFOV),DL(this.view,this.camera,this._state)}}},{key:"onKeyUp",value:function(e){if(0!=this.enabled){var t=RL[e.keyCode];t&&(this.moves.delete(t),this.view.notifyChange(void 0,!1),e.preventDefault())}}},{key:"onKeyDown",value:function(e){if(0!=this.enabled){var t=RL[e.keyCode];t&&(this.moves.add(t),this.view.notifyChange(void 0,!1),e.preventDefault())}}},{key:"dispose",value:function(){this.eventListeners||(this.view.domElement.removeEventListener("mousedown",this._onMouseDown,!1),this.view.domElement.removeEventListener("touchstart",this._onMouseDown,!1),this.view.domElement.removeEventListener("mousemove",this._onMouseMove,!1),this.view.domElement.removeEventListener("touchmove",this._onMouseMove,!1),this.view.domElement.removeEventListener("mouseup",this._onMouseUp,!1),this.view.domElement.removeEventListener("touchend",this._onMouseUp,!1),this.view.domElement.removeEventListener("mousewheel",this._onMouseWheel,!1),this.view.domElement.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("keyup",this._onKeyUp,!1)),this.focusOnMouseOver&&this.view.domElement.removeEventListener("mouseover",this._onFocus),this.focusOnClick&&this.view.domElement.removeEventListener("click",this._onFocus),this.dispatchEvent({type:"dispose"})}}]),n}(Je);new Nn({color:16777215,depthTest:!1,transparent:!0,opacity:.5}),new at,new at,new nt;var VL=Jm((function(e){function t(e,t,a){a=a||2;var o,s,l,h,u,f,p,m=t&&t.length,v=m?t[0]*a:e.length,g=n(e,0,v,a,!0),y=[];if(!g||g.next===g.prev)return y;if(m&&(g=function(e,t,r,a){var o,s,l,h=[];for(o=0,s=t.length;o<s;o++)(l=n(e,t[o]*a,o<s-1?t[o+1]*a:e.length,a,!1))===l.next&&(l.steiner=!0),h.push(d(l));for(h.sort(A),o=0;o<h.length;o++)c(h[o],r),r=i(r,r.next);return r}(e,t,g,a)),e.length>80*a){o=l=e[0],s=h=e[1];for(var w=a;w<v;w+=a)(u=e[w])<o&&(o=u),(f=e[w+1])<s&&(s=f),u>l&&(l=u),f>h&&(h=f);p=0!==(p=Math.max(l-o,h-s))?1/p:0}return r(g,y,a,o,s,p),y}function n(e,t,n,i,r){var a,o;if(r===E(e,t,n,i)>0)for(a=t;a<n;a+=i)o=M(a,e[a],e[a+1],o);else for(a=n-i;a>=t;a-=i)o=M(a,e[a],e[a+1],o);return o&&v(o,o.next)&&(C(o),o=o.next),o}function i(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!v(i,i.next)&&0!==m(i.prev,i,i.next))i=i.next;else{if(C(i),(i=t=i.prev)===i.next)break;n=!0}}while(n||i!==t);return t}function r(e,t,n,A,c,h,d){if(e){!d&&h&&function(e,t,n,i){var r=e;do{null===r.z&&(r.z=u(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,a,o,s,l,A=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,i=n,s=0,t=0;t<A&&(s++,i=i.nextZ);t++);for(l=A;s>0||l>0&&i;)0!==s&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,l--),a?a.nextZ=r:e=r,r.prevZ=a,a=r;n=i}a.nextZ=null,A*=2}while(o>1)}(r)}(e,A,c,h);for(var f,p,m=e;e.prev!==e.next;)if(f=e.prev,p=e.next,h?o(e,A,c,h):a(e))t.push(f.i/n),t.push(e.i/n),t.push(p.i/n),C(e),e=p.next,m=p.next;else if((e=p)===m){d?1===d?r(e=s(i(e),t,n),t,n,A,c,h,2):2===d&&l(e,t,n,A,c,h):r(i(e),t,n,A,c,h,1);break}}}function a(e){var t=e.prev,n=e,i=e.next;if(m(t,n,i)>=0)return!1;for(var r=e.next.next;r!==e.prev;){if(f(t.x,t.y,n.x,n.y,i.x,i.y,r.x,r.y)&&m(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function o(e,t,n,i){var r=e.prev,a=e,o=e.next;if(m(r,a,o)>=0)return!1;for(var s=r.x<a.x?r.x<o.x?r.x:o.x:a.x<o.x?a.x:o.x,l=r.y<a.y?r.y<o.y?r.y:o.y:a.y<o.y?a.y:o.y,A=r.x>a.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,c=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,h=u(s,l,t,n,i),d=u(A,c,t,n,i),p=e.prevZ,v=e.nextZ;p&&p.z>=h&&v&&v.z<=d;){if(p!==e.prev&&p!==e.next&&f(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,v!==e.prev&&v!==e.next&&f(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;p&&p.z>=h;){if(p!==e.prev&&p!==e.next&&f(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;v&&v.z<=d;){if(v!==e.prev&&v!==e.next&&f(r.x,r.y,a.x,a.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function s(e,t,n){var r=e;do{var a=r.prev,o=r.next.next;!v(a,o)&&g(a,r,r.next,o)&&x(a,o)&&x(o,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(o.i/n),C(r),C(r.next),r=e=o),r=r.next}while(r!==e);return i(r)}function l(e,t,n,a,o,s){var l=e;do{for(var A=l.next.next;A!==l.prev;){if(l.i!==A.i&&p(l,A)){var c=b(l,A);return l=i(l,l.next),c=i(c,c.next),r(l,t,n,a,o,s),void r(c,t,n,a,o,s)}A=A.next}l=l.next}while(l!==e)}function A(e,t){return e.x-t.x}function c(e,t){if(t=function(e,t){var n,i=t,r=e.x,a=e.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==t);if(!n)return null;if(r===o)return n;var l,A=n,c=n.x,u=n.y,d=1/0;i=n;do{r>=i.x&&i.x>=c&&r!==i.x&&f(a<u?r:o,a,c,u,a<u?o:r,a,i.x,i.y)&&(l=Math.abs(a-i.y)/(r-i.x),x(i,e)&&(l<d||l===d&&(i.x>n.x||i.x===n.x&&h(n,i)))&&(n=i,d=l)),i=i.next}while(i!==A);return n}(e,t),t){var n=b(t,e);i(t,t.next),i(n,n.next)}}function h(e,t){return m(e.prev,e,t.prev)<0&&m(t.next,e,e.next)<0}function u(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function d(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function f(e,t,n,i,r,a,o,s){return(r-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(i-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function p(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&g(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(x(e,t)&&x(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)&&(m(e.prev,e,t.prev)||m(e,t.prev,t))||v(e,t)&&m(e.prev,e,e.next)>0&&m(t.prev,t,t.next)>0)}function m(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function v(e,t){return e.x===t.x&&e.y===t.y}function g(e,t,n,i){var r=w(m(e,t,n)),a=w(m(e,t,i)),o=w(m(n,i,e)),s=w(m(n,i,t));return r!==a&&o!==s||(!(0!==r||!y(e,n,t))||(!(0!==a||!y(e,i,t))||(!(0!==o||!y(n,e,i))||!(0!==s||!y(n,t,i)))))}function y(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function w(e){return e>0?1:e<0?-1:0}function x(e,t){return m(e.prev,e,e.next)<0?m(e,t,e.next)>=0&&m(e,e.prev,t)>=0:m(e,t,e.prev)<0||m(e,e.next,t)<0}function b(e,t){var n=new B(e.i,e.x,e.y),i=new B(t.i,t.x,t.y),r=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function M(e,t,n,i){var r=new B(e,t,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 C(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function B(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function E(e,t,n,i){for(var r=0,a=t,o=n-i;a<n;a+=i)r+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return r}e.exports=t,e.exports.default=t,t.deviation=function(e,t,n,i){var r=t&&t.length,a=r?t[0]*n:e.length,o=Math.abs(E(e,0,a,n));if(r)for(var s=0,l=t.length;s<l;s++){var A=t[s]*n,c=s<l-1?t[s+1]*n:e.length;o-=Math.abs(E(e,A,c,n))}var h=0;for(s=0;s<i.length;s+=3){var u=i[s]*n,d=i[s+1]*n,f=i[s+2]*n;h+=Math.abs((e[u]-e[f])*(e[d+1]-e[u+1])-(e[u]-e[d])*(e[f+1]-e[u+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)},t.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},i=0,r=0;r<e.length;r++){for(var a=0;a<e[r].length;a++)for(var o=0;o<t;o++)n.vertices.push(e[r][a][o]);r>0&&(i+=e[r-1].length,n.holes.push(i))}return n}}));function jL(e,t,n){for(var i=t[e],r=arguments.length,a=new Array(r>3?r-3:0),o=3;o<r;o++)a[o-3]=arguments[o];if(i){if("function"!=typeof i)return i;var s=i.apply(void 0,a);if(s)return s}return"function"==typeof n?n.apply(void 0,a):n}function WL(){return new Fn(16777215*Math.random())}function XL(e,t,n){for(var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=(i*=3)+3*t,a=i;a<r;a+=3)e[a]=255*n.r,e[a+1]=255*n.g,e[a+2]=255*n.b}function YL(e,t,n,i){for(var r=n;r<i;r++)t[r]=e}var KL=new ob("EPSG:4326",0,0);function ZL(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:e.length/3,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:a;a*=3;var l,A=(s*=3)+(o*=3);l=isNaN(i)?Array.isArray(i)?function(e){return i[(e-s)/3]}:function(t){return i({},KL.setFromArray(e,t))}:function(){return i};for(var c=s,h=a;c<A;c+=3,h+=3){var u=l(c)+(Array.isArray(r)?r[(c-s)/3]:r);n.minAltitude&&(n.minAltitude=Math.min(u,n.minAltitude)),n[h]=e[c]+t[c]*u,n[h+1]=e[c+1]+t[c+1]*u,n[h+2]=e[c+2]+t[c+2]*u}}function JL(e,t,n,i,r){var a=e.length;e.length+=6*(i-1);for(var o=n,s=a;o<n+i-1;++o,++s)r?(e[s]=o,e[++s]=o+t,e[++s]=o+1,e[++s]=o+1,e[++s]=o+t,e[++s]=o+t+1):(e[s]=o+t,e[++s]=o,e[++s]=o+t+1,e[++s]=o+t+1,e[++s]=o,e[++s]=o+1)}var qL=new Xo;var $L=new Do;var eF=new Fn,tF=new Nn;function nF(e,t){if(e.vertices){var n;switch(e.type){case pC.POINT:n=function(e,t){var n,i=e.vertices,r=e.normals,a=new Uint8Array(i.length),o=t.batchId?new Uint32Array(i.length/3):void 0,s=0;0!==t.altitude?ZL(i,r,n=new Float32Array(i.length),t.altitude):n=new Float32Array(i);var l,A=S(e.geometries);try{for(A.s();!(l=A.n()).done;){var c=l.value,h=jL("color",t,WL,c.properties),u=c.indices[0].offset,d=c.indices[0].count;XL(a,d,h,u),o&&(YL(t.batchId(c.properties,s),o,u,u+d),s++)}}catch(e){A.e(e)}finally{A.f()}var f=new si;f.setAttribute("position",new zn(n,3)),f.setAttribute("color",new zn(a,3,!0)),o&&f.setAttribute("batchId",new zn(o,1));var p=new qo(f,qL);return p.minAltitude=0,p}(e,t);break;case pC.LINE:n=function(e,t){var n,i=e.vertices,r=e.normals,a=new Uint8Array(i.length),o=i.length/3,s=t.batchId?new Uint32Array(o):void 0,l=0;0!==t.altitude?ZL(i,r,n=new Float32Array(i.length),t.altitude):n=new Float32Array(i);var A,c=new si;if(c.setAttribute("position",new zn(n,3)),e.geometries.length>1){var h,u=2*(o-e.geometries.length),d=new Uint16Array(u),f=0,p=S(e.geometries);try{for(p.s();!(h=p.n()).done;){var m=h.value,v=jL("color",t,WL,m.properties),g=m.indices[0].offset;if(g>65535){console.warn("Feature to Line: integer overflow, too many points in lines");break}var y=m.indices[0].count,w=g+y;XL(a,y,v,g);for(var x=g;x<w-1&&x<65535;x++)d[f++]=x,d[f++]=x+1;s&&(YL(t.batchId(m.properties,l),s,g,w),l++)}}catch(e){p.e(e)}finally{p.f()}c.setAttribute("color",new zn(a,3,!0)),s&&c.setAttribute("batchId",new zn(s,1)),c.setIndex(new zn(d,1)),A=new jo(c,$L)}else XL(a,o,jL("color",t,WL,e.geometries[0].properties)),c.setAttribute("color",new zn(a,3,!0)),s&&(YL(t.batchId(e.geometries[0].properties,l),s,0,o),c.setAttribute("batchId",new zn(s,1))),A=new Go(c,$L);return A.minAltitude=0,A}(e,t);break;case pC.POLYGON:n=t.extrude?function(e,t){var n=e.vertices,i=e.geometries[0].indices[0].offset,r=e.geometries[0].indices[0].count,a=function(e,t,n){for(var i=3*n,r=0,a=i+(t*=3)-3,o=t;o<i;a=o,o+=3)r+=e[a]*e[o+1]-e[o]*e[a+1];return.5*r}(n,i,r)<0,o=e.normals,s=new Float32Array(2*n.length),l=new Uint8Array(2*n.length),A=[],c=n.length/3;s.minAltitude=1/0;var h,u=t.batchId?new Uint32Array(s.length/3):void 0,d=0,f=S(e.geometries);try{var p=function(){var e=h.value,i=jL("altitude",t,0,e.properties),r=jL("extrude",t,0,e.properties),f=jL("color",t,WL,e.properties);eF.copy(f),eF.multiplyScalar(.6);var p=e.indices[0].offset,m=e.indices.slice(-1)[0],v=m.offset+m.count,g=v-p;ZL(n,o,s,i,0,p,g),XL(l,g,eF,p);var y=p+c,w=v+c;ZL(n,o,s,i,r,y,g,p),XL(l,g,f,y);var x=s.slice(3*y,3*w),b=e.indices.map((function(e){return e.offset-p})).slice(1),M=VL(x,b,3),C=A.length;A.length+=M.length;for(var B=0;B<M.length;B++)A[C+B]=M[B]+y;var E,T=S(e.indices);try{for(T.s();!(E=T.n()).done;){var _=E.value;JL(A,c,_.offset,_.count,a)}}catch(e){T.e(e)}finally{T.f()}if(u){var I=t.batchId(e.properties,d);YL(I,u,p,v),YL(I,u,y,w),d++}};for(f.s();!(h=f.n()).done;)p()}catch(e){f.e(e)}finally{f.f()}var m=new si;m.setAttribute("position",new zn(s,3)),m.setAttribute("color",new zn(l,3,!0)),u&&m.setAttribute("batchId",new zn(u,1)),m.setIndex(new zn(new Uint16Array(A),1));var v=new Ei(m,tF);return v.minAltitude=isNaN(s.minAltitude)?0:s.minAltitude,v}(e,t):function(e,t){var n=e.vertices,i=e.normals,r=new Float32Array(n),a=new Uint8Array(n.length),o=[];r.minAltitude=1/0;var s,l=t.batchId?new Uint32Array(r.length/3):void 0,A=0,c=S(e.geometries);try{var h=function(){var e=s.value,c=e.indices[0].offset;if(c>65535)return console.warn("Feature to Polygon: integer overflow, too many points in polygons"),"break";var h=jL("color",t,WL,e.properties),u=e.indices.slice(-1)[0],d=u.offset+u.count,f=d-c,p=jL("altitude",t,0,e.properties);0!==p&&ZL(n,i,r,p,0,c,f),XL(a,f,h,c);var m=r.slice(3*c,3*d),v=e.indices.map((function(e){return e.offset-c})).slice(1),g=VL(m,v,3),y=o.length;o.length+=g.length;for(var w=0;w<g.length;w++)o[y+w]=g[w]+c;l&&(YL(t.batchId(e.properties,A),l,c,d),A++)};for(c.s();!(s=c.n()).done&&"break"!==h(););}catch(e){c.e(e)}finally{c.f()}var u=new si;u.setAttribute("position",new zn(r,3)),u.setAttribute("color",new zn(a,3,!0)),l&&u.setAttribute("batchId",new zn(l,1)),u.setIndex(new zn(new Uint16Array(o),1));var d=new Ei(u,tF);return d.minAltitude=isNaN(r.minAltitude)?0:r.minAltitude,d}(e,t)}return n.material.vertexColors=!1,n.material.color=new Fn(t.color||16777215),void 0!==t.opacity&&t.opacity<1&&(n.material.transparent=!0,n.material.opacity=t.opacity,n.material.needsUpdate=!0),n.feature=e,n}}function iF(e,t){if(e&&0!=e.length){if(1==e.length)return KL.crs=e[0].crs,KL.setFromValues(0,0,0),nF(e[0],t);var n=new ja;n.minAltitude=1/0;var i,r=S(e);try{for(r.s();!(i=r.n()).done;){var a=i.value;KL.crs=a.crs,KL.setFromValues(0,0,0);var o=nF(a,t);n.add(o),n.minAltitude=Math.min(o.minAltitude,n.minAltitude)}}catch(e){r.e(e)}finally{r.f()}return n}}var rF=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(t){if(t)return iF(t.features,e)}};Hh.DEG2RAD,new bt,new at,new at,(new at).set(0,0,1),new ob("EPSG:4326",0,0,0),new Bt,new nt;var aF={color_layers_pars_fragment:"\nstruct Layer {\n int textureOffset;\n int crs;\n float effect;\n float opacity;\n};\n\nuniform sampler2D colorTextures[NUM_FS_TEXTURES];\nuniform vec4 colorOffsetScales[NUM_FS_TEXTURES];\nuniform Layer colorLayers[NUM_FS_TEXTURES];\nuniform int colorTextureCount;\n\nvec3 uvs[NUM_CRS];\n\nfloat getBorderDistance(vec2 uv) {\n vec2 p2 = min(uv, 1. -uv);\n return min(p2.x, p2.y);\n}\n\nfloat tolerance = 0.99;\n\nvec4 applyWhiteToInvisibleEffect(vec4 color, float intensity) {\n float a = dot(color.rgb, vec3(0.333333333));\n if (a >= tolerance) {\n color.a *= 1.0 - pow(abs(a), intensity);\n }\n return color;\n}\n\nvec4 applyLightColorToInvisibleEffect(vec4 color, float intensity) {\n float a = max(0.05,1. - length(color.xyz - 1.));\n color.a *= 1.0 - pow(abs(a), intensity);\n color.rgb *= color.rgb * color.rgb;\n return color;\n}\n\n#if defined(DEBUG)\nuniform bool showOutline;\nuniform vec3 outlineColors[NUM_CRS];\nuniform float outlineWidth;\n\nvec4 getOutlineColor(vec3 outlineColor, vec2 uv) {\n float alpha = 1. - clamp(getBorderDistance(uv) / outlineWidth, 0., 1.);\n return vec4(outlineColor, alpha);\n}\n#endif\n\nuniform float minBorderDistance;\nvec4 getLayerColor(int textureOffset, sampler2D tex, vec4 offsetScale, Layer layer) {\n if ( textureOffset >= colorTextureCount ) return vec4(0);\n\n vec3 uv;\n // #pragma unroll_loop\n for ( int i = 0; i < NUM_CRS; i ++ ) {\n if ( i == layer.crs ) uv = uvs[ i ];\n }\n\n float borderDistance = getBorderDistance(uv.xy);\n if (textureOffset != layer.textureOffset + int(uv.z) || borderDistance < minBorderDistance ) return vec4(0);\n vec4 color = texture2D(tex, pitUV(uv.xy, offsetScale));\n if(color.a > 0.0) {\n if(layer.effect > 2.0) {\n color.rgb /= color.a;\n color = applyLightColorToInvisibleEffect(color, layer.effect);\n } else if(layer.effect > 0.0) {\n color.rgb /= color.a;\n color = applyWhiteToInvisibleEffect(color, layer.effect);\n }\n }\n\n color.a *= layer.opacity;\n return color;\n}\n",elevation_pars_vertex:"\n#if NUM_VS_TEXTURES > 0\n struct Layer {\n float scale;\n float bias;\n int mode;\n float zmin;\n float zmax;\n };\n\n uniform Layer elevationLayers[NUM_VS_TEXTURES];\n uniform sampler2D elevationTextures[NUM_VS_TEXTURES];\n uniform vec4 elevationOffsetScales[NUM_VS_TEXTURES];\n uniform int elevationTextureCount;\n\n highp float decode32(highp vec4 rgba) {\n highp float Sign = 1.0 - step(128.0,rgba[0])*2.0;\n highp float Exponent = 2.0 * mod(rgba[0],128.0) + step(128.0,rgba[1]) - 127.0;\n highp float Mantissa = mod(rgba[1],128.0)*65536.0 + rgba[2]*256.0 +rgba[3] + float(0x800000);\n highp float Result = Sign * exp2(Exponent) * (Mantissa * exp2(-23.0 ));\n return Result;\n }\n\n float getElevationMode(vec2 uv, sampler2D tex, int mode) {\n if (mode == ELEVATION_RGBA)\n return decode32(texture2D( tex, uv ).abgr * 255.0);\n if (mode == ELEVATION_DATA || mode == ELEVATION_COLOR)\n #if defined(WEBGL2)\n return texture2D( tex, uv ).r;\n #else\n return texture2D( tex, uv ).w;\n #endif\n return 0.;\n }\n\n float getElevation(vec2 uv, sampler2D tex, vec4 offsetScale, Layer layer) {\n uv = uv * offsetScale.zw + offsetScale.xy;\n float d = getElevationMode(uv, tex, layer.mode);\n if (d < layer.zmin || d > layer.zmax) d = 0.;\n return d * layer.scale + layer.bias;\n }\n#endif\n",elevation_vertex:"\n#if NUM_VS_TEXTURES > 0\n if(elevationTextureCount > 0) {\n float elevation = getElevation(uv, elevationTextures[0], elevationOffsetScales[0], elevationLayers[0]);\n transformed += elevation * normal;\n }\n#endif\n",fog_fragment:"\n#if defined(USE_FOG)\n float fogFactor = 1. - min( exp(-fogDepth / fogDistance), 1.);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor);\n#endif\n",fog_pars_fragment:"\n#if defined(USE_FOG)\nuniform vec3 fogColor;\nuniform float fogDistance;\nvarying float fogDepth;\n#endif\n",lighting_fragment:"\nif (lightingEnabled) {\n float light = min(2. * dot(vNormal, lightPosition), 1.);\n gl_FragColor.rgb *= light;\n}\n",lighting_pars_fragment:"\nuniform bool lightingEnabled;\nuniform vec3 lightPosition;\nvarying vec3 vNormal;\n",mode_depth_fragment:"\n#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\ngl_FragColor = packDepthToRGBA(gl_FragDepthEXT);\n#else\nfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\ngl_FragColor = packDepthToRGBA(fragCoordZ);\n#endif\n",mode_id_fragment:"\ngl_FragColor = packDepthToRGBA(float(objectId) / 16777216.0);\n",mode_pars_fragment:"\n#if MODE == MODE_ID || MODE == MODE_DEPTH\n#include <packing>\n#endif\n\n#if MODE == MODE_ID\nuniform int objectId;\n#endif\n",overlay_fragment:"\ngl_FragColor.rgb = mix(gl_FragColor.rgb, overlayColor, overlayAlpha);\n",overlay_pars_fragment:"\nuniform vec3 overlayColor;\nuniform float overlayAlpha;\n",pitUV:"\nvec2 pitUV(vec2 uv, vec4 pit)\n{\n return uv * pit.zw + vec2(pit.x, 1.0 - pit.w - pit.y);\n}\n",precision_qualifier:"\nprecision highp float;\nprecision highp int;\n",projective_texturing_vertex:"\nfor(int i = 0; i < ORIENTED_IMAGES_COUNT; ++i)\n projectiveTextureCoords[i] = projectiveTextureMatrix[i] * mvPosition;\n",projective_texturing_pars_vertex:"\nuniform mat4 projectiveTextureMatrix[ORIENTED_IMAGES_COUNT];\nvarying vec4 projectiveTextureCoords[ORIENTED_IMAGES_COUNT];\n",projective_texturing_pars_fragment:"\nuniform sampler2D projectiveTexture[ORIENTED_IMAGES_COUNT];\nuniform sampler2D mask[ORIENTED_IMAGES_COUNT];\nvarying vec4 projectiveTextureCoords[ORIENTED_IMAGES_COUNT];\nuniform float projectiveTextureAlphaBorder;\nuniform float opacity;\nuniform bool boostLight;\n\nstruct Distortion {\n vec2 size;\n#if USE_DISTORTION\n vec2 pps;\n vec4 polynom;\n vec3 l1l2;\n#endif\n};\n\nuniform Distortion projectiveTextureDistortion[ORIENTED_IMAGES_COUNT];\n\nfloat getAlphaBorder(vec2 p)\n{\n vec2 d = clamp(projectiveTextureAlphaBorder * min(p, 1. - p), 0., 1.);\n return min(d.x, d.y);\n}\n\n#if USE_DISTORTION\nvoid distort(inout vec2 p, vec4 polynom, vec2 pps)\n{\n vec2 v = p - pps;\n float v2 = dot(v, v);\n if (v2 > polynom.w) {\n p = vec2(-1.);\n }\n else {\n p += (v2 * (polynom.x + v2 * (polynom.y + v2 * polynom.z) ) ) * v;\n }\n}\n\nvoid distort(inout vec2 p, vec4 polynom, vec3 l1l2, vec2 pps)\n{\n if ((l1l2.x == 0.) && (l1l2.y == 0.)) {\n distort(p, polynom, pps);\n } else {\n vec2 AB = (p - pps) / l1l2.z;\n float R = length(AB);\n float lambda = atan(R) / R;\n vec2 ab = lambda * AB;\n float rho2 = dot(ab, ab);\n float r357 = 1. + rho2* (polynom.x + rho2* (polynom.y + rho2 * polynom.z));\n p = pps + l1l2.z * (r357 * ab + vec2(dot(l1l2.xy, ab), l1l2.y * ab.x));\n }\n}\n#endif\n\nvec4 mixBaseColor(vec4 aColor, vec4 baseColor) {\n #ifdef USE_BASE_MATERIAL\n baseColor.rgb = aColor.a == 1.0 ? aColor.rgb : mix(baseColor, aColor, aColor.a).rgb;\n baseColor.a = min(1.0, aColor.a + baseColor.a);\n #else\n baseColor.rgb += aColor.rgb * aColor.a;\n baseColor.a += aColor.a;\n #endif\n return baseColor;\n}\n\nvec4 projectiveTextureColor(vec4 coords, Distortion distortion, sampler2D tex, sampler2D mask, vec4 baseColor) {\n vec3 p = coords.xyz / coords.w;\n if(p.z * p.z < 1.) {\n#if USE_DISTORTION\n p.xy *= distortion.size;\n distort(p.xy, distortion.polynom, distortion.l1l2, distortion.pps);\n p.xy /= distortion.size;\n#endif\n\n float d = getAlphaBorder(p.xy) * texture2D(mask, p.xy).r;\n\n if(d > 0.) {\n\n#if DEBUG_ALPHA_BORDER\n vec3 r = texture2D(tex, p.xy).rgb;\n return mixBaseColor(vec4( r.r * d, r.g, r.b, 1.0), baseColor);\n#else\n vec4 color = texture2D(tex, p.xy);\n color.a *= d;\n if (boostLight) {\n return mixBaseColor(vec4(sqrt(color.rgb), color.a), baseColor);\n } else {\n return mixBaseColor(color, baseColor);\n }\n#endif\n\n }\n }\n return mixBaseColor(vec4(0.), baseColor);\n}\n",project_pars_vertex:"\nattribute vec3 position;\nuniform mat4 projectionMatrix;\nuniform mat4 modelViewMatrix;\n",WebGL2_pars_vertex:"\n#if defined(WEBGL2)\n#define attribute in\n#define varying out\n#define texture2D texture\n#endif\n",WebGL2_pars_fragment:"\n#if defined(WEBGL2)\n#define varying in\nout highp vec4 pc_fragColor;\n#define gl_FragColor pc_fragColor\n#define gl_FragDepthEXT gl_FragDepth\n#define texture2D texture\n#define textureCube texture\n#define texture2DProj textureProj\n#define texture2DLodEXT textureLod\n#define texture2DProjLodEXT textureProjLod\n#define textureCubeLodEXT textureLod\n#define texture2DGradEXT textureGrad\n#define texture2DProjGradEXT textureProjGrad\n#define textureCubeGradEXT textureGrad\n#endif\n",install:function(e,t,n){return n?(Object.keys(t).forEach((function(i){"install"!=i&&(e[n+i]=t[i])})),e):Object.assign(e,this)}};aF.install(Xi,aF,"itowns/");var oF=new bb("EPSG:4326",[0,0,0,0]);function sF(e,t,n,i,r,a,o,s){e.beginPath();var l,A=S(n);try{for(A.s();!(l=A.n()).done;){var c=l.value;if(c.extent&&c.extent.intersectsExtent(a)){var h=c.offset*r,u=h+c.count*r;e.moveTo(t[h],t[h+1]);for(var d=h+r;d<u;d+=r)e.lineTo(t[d],t[d+1])}}}catch(e){A.e(e)}finally{A.f()}i.stroke&&(!function(e,t,n){t.strokeStyle!==e.stroke.color&&(t.strokeStyle=e.stroke.color);var i=(e.stroke.width||2)*n;t.lineWidth!==i&&(t.lineWidth=i);var r=null==e.stroke.opacity?1:e.stroke.opacity;r!==t.globalAlpha&&"number"==typeof r&&(t.globalAlpha=r);t.lineCap!==e.stroke.lineCap&&(t.lineCap=e.stroke.lineCap);t.setLineDash(e.stroke.dasharray.map((function(e){return e*n*2})))}(i,e,o),e.stroke()),s&&i.fill&&(!function(e,t,n){e.fill.pattern&&t.fillStyle.src!==e.fill.pattern.src?(t.fillStyle=t.createPattern(e.fill.pattern,"repeat"),t.fillStyle.setTransform?t.fillStyle.setTransform(matrix.scale(n)):console.warn("Raster pattern isn't completely supported on Ie and edge")):t.fillStyle!==e.fill.color&&(t.fillStyle=e.fill.color);e.fill.opacity!==t.globalAlpha&&(t.globalAlpha=e.fill.opacity)}(i,e,o),e.fill())}function lF(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4?arguments[4]:void 0;e.beginPath();var a=null==i.point.opacity?1:i.point.opacity;a!==e.globalAlpha&&(e.globalAlpha=a),e.arc(t,n,(i.point.radius||3)*r,0,2*Math.PI,!1),i.point.color&&(e.fillStyle=i.point.color,e.fill()),i.point.line&&(e.lineWidth=(i.point.width||1)*r,e.strokeStyle=i.point.line,e.stroke())}document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGMatrix();var AF=new ob("EPSG:4326",0,0,0);function cF(e,t,n,i,r){var a,o=n.dimensions().x/e.canvas.width,s={zoom:n.zoom},l=S(t.geometries);try{var A=function(){var l=a.value;if(l.extent.intersectsExtent(n)){var A={globals:s,properties:function(){return l.properties}},c=(l.properties.style||i).drawingStylefromContext(A);if(c)if(t.type===pC.POINT){var h,u=(Math.round(c.point.radius*r)||3*r)*o,d=S(l.indices);try{for(d.s();!(h=d.n()).done;)for(var f=h.value,p=f.offset*t.size,m=p+f.count*t.size,v=p;v<m;v+=t.size)AF.setFromArray(t.vertices,v),n.isPointInside(AF,u)&&lF(e,t.vertices[v],t.vertices[v+1],c,r)}catch(e){d.e(e)}finally{d.f()}}else!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[{offset:0,count:1}],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4?arguments[4]:void 0,a=arguments.length>5?arguments[5]:void 0,o=arguments.length>6?arguments[6]:void 0,s=arguments.length>7?arguments[7]:void 0;if(0!==t.length)if(i.length){var l,A=S(i);try{for(A.s();!(l=A.n()).done;){sF(e,t,n,l.value,r,a,o,s)}}catch(e){A.e(e)}finally{A.f()}}else sF(e,t,n,i,r,a,o,s)}(e,t.vertices,l.indices,c,t.size,n,r,t.type==pC.POLYGON)}};for(l.s();!(a=l.n()).done;)A()}catch(e){l.e(e)}finally{l.f()}}var hF=new tt,uF=new tt,dF=new tt,fF=new bb("EPSG:4326",0,0,0,0),pF=function(e,t,n,i,r){var a;if(e){t.dimensions(uF);var o=document.createElement("canvas");AF.crs=t.crs,o.width=n,o.height=n;var s=o.getContext("2d");r&&(s.fillStyle=r.getStyle(),s.fillRect(0,0,n,n)),s.globalCompositeOperation=i.globalCompositeOperation||"source-over",s.imageSmoothingEnabled=!1,s.lineJoin="round";var l=e.crs==t.crs?t:t.as(e.crs,oF),A=e.translation,c=e.scale;fF.transformedCopy(A,c,l),dF.set(s.canvas.width,s.canvas.width).divide(uF),hF.set(t.west,t.south).add(A).multiply(dF).negate(),s.setTransform(dF.x/c.x,0,0,dF.y/c.y,hF.x,hF.y);var h,u=c.x/dF.x,d=S(e.features);try{for(d.s();!(h=d.n()).done;){var f=h.value;cF(s,f,fF,f.style||i,u)}}catch(e){d.e(e)}finally{d.f()}(a=new ts(o)).flipY=!1}else if(r){var p=new Uint8Array(3);p[0]=255*r.r,p[1]=255*r.g,p[2]=255*r.b,a=new Hi(p,1,1,Ae)}else a=new ht;return a},mF=new bb("EPSG:4326",[0,0,0,0]),vF=function(e){return e.generateMipmaps=!1,e.magFilter=Z,e.minFilter=Z,e};var gF=function(e,t,n){var i;if(e.isFeatureCollection){var r=n.source.backgroundLayer,a=r&&r.paint?new Fn(r.paint["background-color"]):void 0;t.as(Jx.formatToEPSG(n.crs),mF),(i=pF(e,mF,256,n.style,a)).features=e,i.extent=t}else{if(!e.isTexture)throw new Error("Data type is not supported to convert into texture");i=e}return n.isColorLayer?function(e,t){return e.anisotropy=16,e.premultiplyAlpha=t,vF(e)}(i,n.transparent):n.isElevationLayer?(i.flipY&&(i.flipY=!1),vF(i)):void 0},yF=function(e){h(n,e);var t=y(n);function n(e,i){return s(this,n),i.cacheLifeTime=null==i.cacheLifeTime?WM.TEXTURE:i.cacheLifeTime,t.call(this,e,i)}return A(n,[{key:"convert",value:function(e,t){return gF(e,t,this)}},{key:"delete",value:function(){var e,t=S(this.parent.level0Nodes);try{for(t.s();!(e=t.n()).done;){e.value.traverse($_(this.id))}}catch(e){t.e(e)}finally{t.f()}}}]),n}(uE),wF=function(e){h(n,e);var t=y(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this,n),(i=t.call(this,e,r)).isColorLayer=!0,i.style=new lC(r.style),i.defineLayerProperty("visible",!0),i.defineLayerProperty("opacity",1),i.defineLayerProperty("sequence",0),i.transparent=r.transparent||i.opacity<1,i.noTextureParentOutsideLimit=!!r.source&&r.source.isFileSource,i.fx=r.fx||0,i.buildExtent=!0,i.structure="2d",i}return A(n,[{key:"setupRasterNode",value:function(e){var t=new DM(e.material,this);return e.material.addLayer(t),e.material.setSequence(this.parent.colorLayersOrder),t}},{key:"update",value:function(e,t,n,i){return function(e,t,n,i){var r=n.material;if(i&&r){var a=n.getExtentsByProjection(t.crs),o=a[0].zoom;if(!(o>t.zoom.max||o<t.zoom.min)){var s=r.getLayer(t.id);if(void 0===n.layerUpdateState[t.id]){if(n.layerUpdateState[t.id]=new IS,!t.source.extentInsideLimit(n.extent,o)&&(t.noTextureParentOutsideLimit||!i.material||!i.material.getLayer||!i.material.getLayer(t.id)))return void n.layerUpdateState[t.id].noMoreUpdatePossible();if(!s){s=t.setupRasterNode(n);var l=i.material&&i.material.getLayer(t.id);s.initFromParent(l,a)}if(s.level>=t.source.zoom.min)return void e.view.notifyChange(n,!1)}if(r.visible&&t.visible&&n.layerUpdateState[t.id].canTryUpdate())if(s.level>=a[0].zoom)n.layerUpdateState[t.id].noMoreUpdatePossible();else if(!t.frozen){var A=n.layerUpdateState[t.id].failureParams,c=a[0].zoom||n.level,h=GM(t.updateStrategy.type,n,c,s.level,t,A);if(!(!t.source.isVectorSource&&h<=s.level||h>c)){if(!t.source.extentInsideLimit(n.extent,h))return n.layerUpdateState[t.id].noData({targetLevel:h}),void e.view.notifyChange(n,!1);var u=a.map((function(e){return e.tiledExtentParent(h)}));n.layerUpdateState[t.id].newTry();var d=q_(e.view,t,u,a,n);return e.scheduler.execute(d).then((function(e){var i=a.map((function(t,n){return t.offsetToParent(e[n].extent,s.offsetScales[n])}));s.setTextures(e,i),n.layerUpdateState[t.id].success()}),(function(i){return Y_(i,n,t,h,e.view)}))}A.lowestLevelError!=1/0&&n.layerUpdateState[t.id].noMoreUpdatePossible()}}}}(e,this,n,i)}}]),n}(yF),xF=function(e){h(n,e);var t=y(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,n),(i=t.call(this,e,r)).isElevationLayer=!0;var a=1;return i.useColorTextureElevation&&(a=i.colorTextureElevationMaxZ-i.colorTextureElevationMinZ),i.defineLayerProperty("scale",i.scale||1,(function(e){e.parent.object3d.traverse((function(t){t.layer==e.parent&&t.material&&(t.material.setElevationScale(e.scale*a),t.obb.updateScaleZ(e.scale))}))})),i}return A(n,[{key:"setupRasterNode",value:function(e){var t=this,n=new RM(e.material,this);e.material.addLayer(n),e.material.setSequenceElevation(this.id);var i=function(){return e.setBBoxZ(n.min,n.max,t.scale)};return i(),n.addEventListener("updatedElevation",i),n}},{key:"update",value:function(e,t,n,i){return function(e,t,n,i){var r=n.material;if(i&&r){var a=n.getExtentsByProjection(t.crs),o=a[0].zoom;if(!(o>t.zoom.max||o<t.zoom.min)){var s=r.getElevationLayer();if(s||(s=t.setupRasterNode(n)),void 0===n.layerUpdateState[t.id]){n.layerUpdateState[t.id]=new IS;var l=i.material&&i.material.getLayer(t.id);if(s.initFromParent(l,a),s.level>=t.source.zoom.min)return void e.view.notifyChange(n,!1)}if(!t.frozen&&r.visible&&n.layerUpdateState[t.id].canTryUpdate()){var A=n.layerUpdateState[t.id].failureParams,c=GM(t.updateStrategy.type,n,a[0].zoom,s.level,t,A);if(!(c<=s.level||c>a[0].zoom)){if(!t.source.extentInsideLimit(n.extent,c))return n.layerUpdateState[t.id].noData({targetLevel:c}),void e.view.notifyChange(n,!1);var h=a.map((function(e){return e.tiledExtentParent(c)}));n.layerUpdateState[t.id].newTry();var u=q_(e.view,t,h,a,n);return e.scheduler.execute(u).then((function(e){if(c<=s.level)n.layerUpdateState[t.id].noMoreUpdatePossible();else{var i=a.map((function(t,n){return t.offsetToParent(e[n].extent,s.offsetScales[n])}));s.setTextures(e,i),n.layerUpdateState[t.id].success()}}),(function(i){return Y_(i,n,t,c,e.view)}))}n.layerUpdateState[t.id].noMoreUpdatePossible()}}}}(e,this,n,i)}}]),n}(yF);new at;var bF=new Ei,MF=new tn;bF.geometry.boundingBox=MF,new at;var CF=new Ei,BF=new tn;function EF(e,t,n,i,r,a){var o={view:e,requester:r,layer:n,priority:r?1/(r.distance+1):100,metadata:i,redraw:a};return t.execute(o)}function SF(e){return e.children.filter((function(t){return t.layer==e.layer&&t.tileId}))}function TF(e,t,n,i){n.additiveRefinement?function(e,t,n,i){var r,a=S(t.tileset.tiles[n.tileId].children);try{var o=function(){var a=r.value;if(a.promise||a.loaded)return"continue";var o=n.matrixWorld;if(a.transform&&(o=FF.multiplyMatrices(n.matrixWorld,a.transform)),!(!i||!i(t,e.camera,a,o)))return"continue";a.promise=EF(e.view,e.scheduler,t,a,n,!0).then((function(i){n.add(i),i.updateMatrixWorld();var r=LF(t.extent.crs,i.boundingVolume,i.matrixWorld);i.traverse((function(e){e.extent=r})),t.onTileContentLoaded(i),e.view.notifyChange(a),a.loaded=!0,delete a.promise}))};for(a.s();!(r=a.n()).done;)o()}catch(e){a.e(e)}finally{a.f()}}(e,t,n,i):function(e,t,n){if(!n.pendingSubdivision&&0==SF(n).length){var i=function(){var i=t.tileset.tiles[n.tileId].children;if(null==i||0===i.length)return{v:void 0};n.pendingSubdivision=!0;for(var r=[],a=function(a){r.push(EF(e.view,e.scheduler,t,i[a],n,!1).then((function(r){i[a].loaded=!0,n.add(r),r.updateMatrixWorld(),n.additiveRefinement&&e.view.notifyChange(n),t.tileset.tiles[r.tileId].loaded=!0,t.onTileContentLoaded(r)})))},o=0;o<i.length;o++)a(o);Promise.all(r).then((function(){n.pendingSubdivision=!1,e.view.notifyChange(n)}))}();if("object"===r(i))i.v}}(e,t,n)}CF.geometry.boundingBox=BF;var _F=new tn,IF=new an;function LF(e,t,n){if(t.region){var i=_F.copy(t.region.box3D).applyMatrix4(t.region.matrixWorld);return bb.fromBox3(e,i)}if(t.box){var r=_F.copy(t.box).applyMatrix4(n);return bb.fromBox3(e,r)}var a=IF.copy(t.sphere).applyMatrix4(n);return new bb(e,{west:a.center.x-a.radius,east:a.center.x+a.radius,south:a.center.y-a.radius,north:a.center.y+a.radius})}var FF=new bt;function kF(e,t,n,i){return!(!n.viewerRequestVolume||!n.viewerRequestVolume.viewerRequestVolumeCulling(t,i))||!(!n.boundingVolume||!n.boundingVolume.boundingVolumeCulling(t,i))}function PF(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=t.additiveRefinement||n>0,r=0;r<t.children.length;r++)t.children[r].content?PF(e,t.children[r],n+1):i&&t.children[r].traverse(UF);if(i)t.dispose&&t.dispose(),delete t.content,e.tileset.tiles[t.tileId].loaded=!1,t.remove.apply(t,C(t.children)),0==n&&t.parent&&t.parent.remove(t);else{var a=SF(t);t.remove.apply(t,C(a))}}function UF(e){var t,n=S(e.children);try{for(n.s();!(t=n.n()).done;){UF(t.value)}}catch(e){n.e(e)}finally{n.f()}if(e.material)if(Array.isArray(e.material)){var i,r=S(e.material);try{for(r.s();!(i=r.n()).done;){i.value.dispose()}}catch(e){r.e(e)}finally{r.f()}}else e.material.dispose();e.geometry&&e.geometry.dispose(),e.remove.apply(e,C(e.children))}function DF(){if(!this.visible)return[];var e=Date.now();if(this._cleanableTiles.length&&e-this._cleanableTiles[0].cleanableSince>this.cleanupDelay){this.root.cleanableSince=void 0;for(var t=0;t<this._cleanableTiles.length;t++){var n=this._cleanableTiles[t];if(!(e-n.cleanableSince>this.cleanupDelay))break;PF(this,n)}this._cleanableTiles.splice(0,t)}return[this.root]}var RF=new tn,OF=new an;function NF(e,t){e.content&&(e.content.visible=t)}function zF(e,t){t.cleanableSince||(t.cleanableSince=Date.now(),e._cleanableTiles.push(t))}function QF(e,t,n){if(void 0===t.tileset.tiles[n.tileId].children)return!1;if(t.tileset.tiles[n.tileId].isTileset)return!0;var i=function(e,t){if(t.distance=0,t.boundingVolume.region)RF.copy(t.boundingVolume.region.box3D),RF.applyMatrix4(t.boundingVolume.region.matrixWorld),t.distance=RF.distanceToPoint(e.camera3D.position);else if(t.boundingVolume.box)RF.copy(t.boundingVolume.box),RF.applyMatrix4(t.matrixWorld),t.distance=RF.distanceToPoint(e.camera3D.position);else{if(!t.boundingVolume.sphere)return 1/0;OF.copy(t.boundingVolume.sphere),OF.applyMatrix4(t.matrixWorld),t.distance=Math.max(0,OF.distanceToPoint(e.camera3D.position))}return 0===t.distance?1/0:e._preSSE*(t.geometricError/t.distance)}(e.camera,n);return i>t.sseThreshold}var GF=new bt,HF=new at,VF=new at,jF=new bb("EPSG:4326",0,0,0,0),WF=new at,XF=new at,YF=function(){function e(t,n,i){if(s(this,e),this.type=qE,t.region)this.initBoundingRegion(t.region,n);else if(t.box)this.initBoundingBox(t.box);else{if(!t.sphere)throw new Error("3D Tiles nodes must have a bounding volume");this.initBoundingSphere(t.sphere)}t.extensions&&(this.extensions=i.parseExtensions(t.extensions,this.type))}return A(e,[{key:"initBoundingRegion",value:function(e,t){jF.set(Hh.radToDeg(e[0]),Hh.radToDeg(e[2]),Hh.radToDeg(e[1]),Hh.radToDeg(e[3]));var n=new ET;n.setFromExtent(jF),n.updateZ(e[4],e[5]),n.matrix.premultiply(t),n.matrix.decompose(n.position,n.quaternion,n.scale),this.region=n}},{key:"initBoundingBox",value:function(e){HF.set(e[0],e[1],e[2]),VF.set(e[3],e[7],e[11]).multiplyScalar(2),this.box=new tn,this.box.setFromCenterAndSize(HF,VF)}},{key:"initBoundingSphere",value:function(e){WF.set(e[0],e[1],e[2]),this.sphere=new an(WF,e[3])}},{key:"boundingVolumeCulling",value:function(e,t){return!(!this.region||e.isBox3Visible(this.region.box3D,GF.multiplyMatrices(t,this.region.matrix)))||(!(!this.box||e.isBox3Visible(this.box,t))||this.sphere&&!e.isSphereVisible(this.sphere,t))}},{key:"viewerRequestVolumeCulling",value:function(e,t){return this.region?(console.warn("Region viewerRequestVolume not yet supported"),!0):this.box?(console.warn("Bounding box viewerRequestVolume not yet supported"),!0):!(!this.sphere||(XF.copy(this.sphere.center),XF.applyMatrix4(t),e.camera3D.position.distanceTo(XF)<=this.sphere.radius))}}]),e}(),KF=new bt,ZF=function(){function e(t,n,i){s(this,e),this.type=ZE,this.asset=t.asset,this.properties=t.properties,this.geometricError=t.geometricError,this.extensionsUsed=t.extensionsUsed,this.extensionsRequired=t.extensionsRequired,this.tiles=[],this.parseTiles(t.root,n,void 0,i),t.extensions&&(this.extensions=i.parseExtensions(t.extensions,this.type))}return A(e,[{key:"parseTiles",value:function(e,t,n,i){if(e.transform=e.transform?(new bt).fromArray(e.transform):void 0,e._worldFromLocalTransform=e.transform,n&&n._worldFromLocalTransform&&(e.transform?e._worldFromLocalTransform=(new bt).multiplyMatrices(n._worldFromLocalTransform,e.transform):e._worldFromLocalTransform=n._worldFromLocalTransform),(e.viewerRequestVolume&&e.viewerRequestVolume.region||e.boundingVolume&&e.boundingVolume.region)&&(e._worldFromLocalTransform?KF.copy(e._worldFromLocalTransform).invert():KF.identity()),e.viewerRequestVolume=e.viewerRequestVolume?new YF(e.viewerRequestVolume,KF,i):void 0,e.boundingVolume=e.boundingVolume?new YF(e.boundingVolume,KF,i):void 0,this.tiles.push(e),e.tileId=this.tiles.length-1,e.baseURL=t,e.children){var r,a=S(e.children);try{for(a.s();!(r=a.n()).done;){var o=r.value;this.parseTiles(o,t,e,i)}}catch(e){a.e(e)}finally{a.f()}}}},{key:"extendTileset",value:function(e,t,n,i){this.parseTiles(e.root,n,this.tiles[t],i),this.tiles[t].children=[e.root],this.tiles[t].isTileset=!0}}]),e}(),JF=function(){function e(){s(this,e)}return A(e,[{key:"registerExtension",value:function(e,t){this[e]=t}},{key:"getExtension",value:function(e,t){if(this[e]&&this[e][t])return this[e][t];console.error("".concat("No extension manager registered for extension "," ").concat(e," and for class ").concat(t))}},{key:"isExtensionRegistered",value:function(e){return this[e]}},{key:"parseExtensions",value:function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=new(this.getExtension(i,t))(e[i]));return n}}]),e}(),qF=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:kF,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:QF;return function(n,i,r){if(!r.parent.pendingSubdivision||r.parent.additiveRefinement){var a=!e||!e(i,n.camera,r,r.matrixWorld);if(r.visible=a,a){var o;if(r.cleanableSince&&(i._cleanableTiles.splice(i._cleanableTiles.indexOf(r),1),r.cleanableSince=void 0),r.pendingSubdivision||t(n,i,r))TF(n,i,r,e),NF(r,r.pendingSubdivision||r.additiveRefinement),o=SF(r);else{NF(r,!0);var s,l=S(SF(r));try{for(l.s();!(s=l.n()).done;){var A=s.value;A.visible=!1,zF(i,A)}}catch(e){l.e(e)}finally{l.f()}}return o}zF(i,r)}else r.visible=!1}}(),$F=function(e){h(n,e);var t=y(n);function n(e,i,r){var a;s(this,n),(a=t.call(this,e,new ja,{source:i.source})).isC3DTilesLayer=!0,a.sseThreshold=i.sseThreshold||16,a.cleanupDelay=i.cleanupDelay||1e3,a.onTileContentLoaded=i.onTileContentLoaded||function(){},a.protocol="3d-tiles",a.overrideMaterials=void 0===i.overrideMaterials||i.overrideMaterials,a.name=i.name,a.registeredExtensions=i.registeredExtensions||new JF,a._cleanableTiles=[];var o=a.addInitializationStep();return a.source.whenReady.then((function(e){if(a.tileset=new ZF(e,a.source.baseUrl,a.registeredExtensions),a.tileset.extensionsUsed){var t,n=S(a.tileset.extensionsUsed);try{for(n.s();!(t=n.n()).done;){var i=t.value;a.registeredExtensions.isExtensionRegistered(i)||(a.tileset.extensionsRequired&&a.tileset.extensionsRequired.includes(i)?console.error('3D Tiles tileset required extension "'.concat(i,'" must be registered to the 3D Tiles layer of iTowns to be parsed and used.')):console.warn('3D Tiles tileset used extension "'.concat(i,'" must be registered to the 3D Tiles layer of iTowns to be parsed and used.')))}}catch(e){n.e(e)}finally{n.f()}}(function(e,t,n,i){return EF(e,t,n,i,void 0,!0).then((function(t){n.object3d.add(t),t.updateMatrixWorld(),n.tileset.tiles[t.tileId].loaded=!0,n.root=t,n.extent=LF(n.crs||e.referenceCrs,t.boundingVolume,t.matrixWorld),n.onTileContentLoaded(t)}))})(r,r.mainLoop.scheduler,v(a),e.root).then(o)})),a}return A(n,[{key:"preUpdate",value:function(){return DF.bind(this)()}},{key:"update",value:function(e,t,n){return qF(e,t,n)}},{key:"getObjectToUpdateForAttachedLayers",value:function(e){if(e.content){var t=[];e.content.traverse((function(n){n.isObject3D&&n.material&&n.layer==e.layer&&t.push(n)}));var n=e.parent;return n&&n.content?{elements:t,parent:n.content}:{elements:t}}}},{key:"findBatchTable",value:function(e){return e.batchTable?e.batchTable:e.parent?this.findBatchTable(e.parent):void 0}},{key:"getInfoFromIntersectObject",value:function(e){for(var t={},n=-1,i={},r=0;r<e.length;r++){var a=e[r].object.geometry.attributes;if(a&&a._BATCHID){var o=e[r].face.a;n=a._BATCHID.array[o],i=this.findBatchTable(e[r].object);break}}if(-1!==n)return t.batchID=n,Object.assign(t,i.getInfoById(n)),t}}]),n}(G_);(new bt).set(1,0,0,1,0,1,0,1,0,0,2,0,0,0,0,2),new Hi(new Uint8Array([255,255,255]),1,1,Ae,$),new ht,new vl,new tA,new lt,new ob("EPSG:4978",0,0,0),new at,new at,new at;var ek=new Ei,tk=new tn;ek.geometry.boundingBox=tk;for(var nk=function(e){h(n,e);var t=y(n);function n(e){var i;if(s(this,n),e.parsedData&&(console.warn("FileSource parsedData parameter is deprecated, use features instead of."),e.features=e.features||e.parsedData),e.projection&&(console.warn("FileSource projection parameter is deprecated, use crs instead."),e.crs=e.crs||e.projection),!e.crs){if(!e.features||!e.features.crs)throw new Error("source.crs is required in FileSource");e.crs=e.features.crs}if(!e.url&&!e.fetchedData&&!e.features)throw new Error("url, fetchedData and features are not set in\n FileSource; at least one needs to be present");return e.url=e.url||"fake-file-url",(i=t.call(this,e)).isFileSource=!0,i.fetchedData=e.fetchedData,i.fetchedData||e.features?e.features&&(i._featuresCaches[e.features.crs]=new XM,i._featuresCaches[e.features.crs].setByArray(Promise.resolve(e.features),[0])):i.whenReady=i.fetcher(i.urlFromExtent(),i.networkOptions).then((function(e){i.fetchedData=e})),i.whenReady.then((function(){return i.fetchedData})),i.zoom={min:0,max:1/0},i}return A(n,[{key:"urlFromExtent",value:function(){return this.url}},{key:"onLayerAdded",value:function(e){var t=this;e.in=this,b(u(n.prototype),"onLayerAdded",this).call(this,e);var i=this._featuresCaches[e.out.crs].getByArray([0]);i||(e.out.buildExtent="EPSG:4978"!=this.crs,e.out.buildExtent&&(e.out.forcedExtentCrs="EPSG:4978"!=e.out.crs?e.out.crs:Jx.formatToEPSG(this.crs)),i=this.parser(this.fetchedData,e),this._featuresCaches[e.out.crs].setByArray(i,[0])),i.then((function(n){t.extent=n.extent,n.isFeatureCollection&&n.setParentStyle(e.out.style)}))}},{key:"loadData",value:function(e,t){return this._featuresCaches[t.crs].getByArray([0])}},{key:"extentInsideLimit",value:function(e){return this.extent.intersectsExtent(e)}}]),n}(hE),ik=new bb(Jx.tms_4326,0,0,0),rk=function(e){h(n,e);var t=y(n);function n(e){var i;if(s(this,n),!e.crs&&!e.projection)throw new Error("New TMSSource/WMTSSource: crs projection is required");if(e.format=e.format||"image/png",(i=t.call(this,e)).isTMSSource=!0,e.extent||(i.extent=gb.get(e.crs)),i.zoom=e.zoom,i.isInverted=e.isInverted||!1,i.url=e.url,i.crs=Jx.formatToTms(e.crs),i.tileMatrixSetLimits=e.tileMatrixSetLimits,i.extentSetlimits={},!i.zoom)if(i.tileMatrixSetLimits){var r=Object.keys(i.tileMatrixSetLimits),a=r.length,o=Number(r[a-1]),l=o-a+1;i.zoom={min:l,max:o}}else i.zoom={min:0,max:1/0};return i}return A(n,[{key:"urlFromExtent",value:function(e){return FE(e,this)}},{key:"onLayerAdded",value:function(e){b(u(n.prototype),"onLayerAdded",this).call(this,e);var t=e.out.parent,i=t?t.extent.crs:e.out.crs;if(this.tileMatrixSetLimits&&!this.extentSetlimits[i]){this.extentSetlimits[i]={},ik.crs=this.crs;for(var r=this.zoom.max;r>=this.zoom.min;r--){var a=this.tileMatrixSetLimits[r],o=ik.set(r,a.minTileRow,a.minTileCol).as(i),s=o.west,l=o.north,A=ik.set(r,a.maxTileRow,a.maxTileCol).as(i),c=A.east,h=A.south;this.extentSetlimits[i][r]=new bb(i,s,c,h,l)}}}},{key:"extentInsideLimit",value:function(e,t){return t>=this.zoom.min&&t<=this.zoom.max&&(null==this.extentSetlimits[e.crs]||this.extentSetlimits[e.crs][t].intersectsExtent(e))}}]),n}(hE),ak=function(e){h(n,e);var t=y(n);function n(e){var i;if(s(this,n),e.projection&&(console.warn("WFSSource projection parameter is deprecated, use crs instead."),e.crs=e.crs||e.projection),!e.typeName)throw new Error("source.typeName is required in wfs source.");if(!e.crs)throw new Error("source.crs is required in wfs source");for(var r in e.format=e.format||"application/json",(i=t.call(this,e)).isWFSSource=!0,i.typeName=e.typeName,i.version=e.version||"2.0.2",i.url="".concat(e.url,"SERVICE=WFS&REQUEST=GetFeature&typeName=").concat(i.typeName,"&VERSION=").concat(i.version,"&SRSNAME=").concat(i.crs,"&BBOX=%bbox,").concat(i.crs),void 0!==e.tk&&(i.url+="&tk="+e.tk),e.format&&(i.url=i.url+"&outputFormat="+e.format),e.name&&(i.url=i.url+"&name="+e.name),i.zoom={min:0,max:1/0},i.vendorSpecific=e.vendorSpecific,i.vendorSpecific)Object.prototype.hasOwnProperty.call(i.vendorSpecific,r)&&(i.url="".concat(i.url,"&").concat(r,"=").concat(i.vendorSpecific[r]));return i}return A(n,[{key:"handlingError",value:function(e){var t=this;return e.response&&400==e.response.status?e.response.text().then((function(n){var i="".concat(t.url,"SERVICE=WFS&REQUEST=GetCapabilities&VERSION=").concat(t.version),r=(new DOMParser).parseFromString(n,"application/xml").querySelector("Exception"),a=r.getAttribute("exceptionCode"),o=r.querySelector("ExceptionText").textContent;console.error("Source ".concat(t.typeName,': bad request when fetching data. Server says: "').concat(a,": ").concat(o,'". \nReviewing ').concat(i," may help."),e)})):b(u(n.prototype),"handlingError",this).call(this,e)}},{key:"requestToKey",value:function(e){return Jx.isTms(e.crs)?b(u(n.prototype),"requestToKey",this).call(this,e):[e.zoom,e.south,e.west]}},{key:"urlFromExtent",value:function(e){return kE(e,this)}},{key:"extentInsideLimit",value:function(e){return this.extent.intersectsExtent(e)}}]),n}(hE),ok=function(e){h(n,e);var t=y(n);function n(e){var i;if(s(this,n),!e.name)throw new Error("New WMTSSource: name is required");return(i=t.call(this,e)).isWMTSSource=!0,i.url="".concat(i.url)+(i.url.includes("?")?"&":"?")+"LAYER=".concat(e.name)+"&FORMAT=".concat(i.format)+"&SERVICE=WMTS"+"&VERSION=".concat(e.version||"1.0.0")+"&REQUEST=GetTile"+"&STYLE=".concat(e.style||"normal")+"&TILEMATRIXSET=".concat(e.tileMatrixSet)+"&TILEMATRIX=%TILEMATRIX&TILEROW=%ROW&TILECOL=%COL",void 0!==e.tk&&(i.url+="&tk="+e.tk),i}return A(n)}(rk),sk={POSITION_CARTESIAN:{numElements:3,arrayType:Float32Array,attributeName:"position"},COLOR_PACKED:{numElements:4,arrayType:Uint8Array,attributeName:"color",normalized:!0},INTENSITY:{numElements:1,numByte:2,arrayType:Uint16Array,attributeName:"intensity",normalized:!0},CLASSIFICATION:{numElements:1,arrayType:Uint8Array,attributeName:"classification",normalized:!0},NORMAL_SPHEREMAPPED:{numElements:2,arrayType:Uint8Array,attributeName:"sphereMappedNormal"},NORMAL_OCT16:{numElements:2,arrayType:Uint8Array,attributeName:"oct16Normal"},NORMAL:{numElements:3,arrayType:Float32Array,attributeName:"normal"}},lk=function(){var e=ck[Ak],t=sk[e];t.potreeName=e,t.numByte=t.numByte||t.arrayType.BYTES_PER_ELEMENT,t.byteSize=t.numElements*t.numByte,t.normalized=t.normalized||!1;var n="getUint".concat(8*t.numByte);t.getValue=1===t.numByte?function(e,t){return e[n](t)}:function(e,t){return e[n](t,!0)}},Ak=0,ck=Object.keys(sk);Ak<ck.length;Ak++)lk();var hk=function(e){h(n,e);var t=y(n);function n(e){var i;return s(this,n),(i=t.call(this,e)).baseUrl=i.url.slice(0,i.url.lastIndexOf("/")+1),i.whenReady=$M.json(i.url,i.networkOptions),i}return A(n)}(hE);!function(t){if("object"==(void 0===e?"undefined":r(e))&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"==typeof window?"undefined"==typeof global?"undefined"==typeof self?this:self:global:window).shp=t()}}((function(){var e=Math.floor,t=Math.log,n=Math.abs,a=Math.pow,s=String.fromCharCode,l=Math.min;return function e(t,n,i){function r(o,s){if(!n[o]){if(!t[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var A=new Error("Cannot find module '"+o+"'");throw A.code="MODULE_NOT_FOUND",A}var c=n[o]={exports:{}};t[o][0].call(c.exports,(function(e){return r(t[o][1][e]||e)}),c,c.exports,e,t,n,i)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<i.length;o++)r(i[o]);return r}({1:[function(e,t){var n=e("lie"),i=e("./combine"),r=e("buffer").Buffer;t.exports=function(e,t){return new n((function(n,a){var o=i(e,t),s=new XMLHttpRequest;s.open("GET",o,!0),"prj"!==t&&"cpg"!==t&&(s.responseType="arraybuffer"),s.addEventListener("load",(function(){return 399<s.status?"prj"===t||"cpg"===t?n(!1):a(new Error(s.status)):n("prj"!==t&&"cpg"!==t?r.from(s.response):s.response)}),!1),s.send()}))}},{"./combine":3,buffer:8,lie:12}],2:[function(e,t){(function(n){(function(){var r=e("./binaryajax-browser"),a=e("./combine"),s=e("buffer").Buffer;t.exports=function(){var e=o(i().mark((function e(t,o){var l,A,c,h;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.fetch){e.next=2;break}return e.abrupt("return",r(t,o));case 2:return l=a(t,o),A="prj"===o||"cpg"===o,e.prev=3,e.next=6,fetch(l);case 6:if(!(399<(c=e.sent).status)){e.next=9;break}throw new Error(c.statusText);case 9:if(!A){e.next=11;break}return e.abrupt("return",c.text());case 11:return e.next=13,c.arrayBuffer();case 13:return h=e.sent,e.abrupt("return",s.from(h));case 17:if(e.prev=17,e.t0=e.catch(3),console.log("ERROR",e.t0,o),!A&&"dbf"!==o){e.next=21;break}return e.abrupt("return",!1);case 21:throw e.t0;case 22:case"end":return e.stop()}}),e,null,[[3,17]])})));return function(t,n){return e.apply(this,arguments)}}()}).call(this)}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{"./binaryajax-browser":1,"./combine":3,buffer:8}],3:[function(e,t){(function(e){(function(){var n=e.URL;t.exports=function(e,t){if(!t)return e;var i=new n(e);return i.pathname="".concat(i.pathname,".").concat(t),i.href}}).call(this)}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{}],4:[function(e,t){function n(e,t){return function(e){for(var t,n,i=0,r=1,a=e.length;r<a;)t=n||e[0],i+=((n=e[r])[0]-t[0])*(n[1]+t[1]),r++;return 0<i}(t)||!e.length?e.push([t]):e[e.length-1].push(t),e}function i(e,t){return this instanceof i?(this.buffer=e,this.headers=this.parseHeader(),this.headers.length<this.buffer.byteLength&&(this.buffer=this.buffer.slice(0,this.headers.length)),this.shpFuncs(t),void(this.rows=this.getRows())):new i(e,t)}i.prototype.parsePoint=function(e){return{type:"Point",coordinates:this.parseCoord(e,0)}},i.prototype.parseZPoint=function(e){var t=this.parsePoint(e);return t.coordinates.push(e.readDoubleLE(16)),t},i.prototype.parsePointArray=function(e,t,n){for(var i=[],r=0;r<n;)i.push(this.parseCoord(e,t)),t+=16,r++;return i},i.prototype.parseZPointArray=function(e,t,n,i){for(var r=0;r<n;)i[r].push(e.readDoubleLE(t)),r++,t+=8;return i},i.prototype.parseArrayGroup=function(e,t,n,i,r){for(var a,o,s=[],l=0,A=0;l<i;)n+=4,a=A,(o=(A=++l===i?r:e.readInt32LE(n))-a)&&(s.push(this.parsePointArray(e,t,o)),t+=o<<4);return s},i.prototype.parseZArrayGroup=function(e,t,n,i){for(var r=0;r<n;)i[r]=this.parseZPointArray(e,t,i[r].length,i[r]),t+=i[r].length<<3,r++;return i},i.prototype.parseMultiPoint=function(e){var t={},n=e.readInt32LE(32,!0);if(!n)return null;var i=this.parseCoord(e,0),r=this.parseCoord(e,16);return t.bbox=[i[0],i[1],r[0],r[1]],1===n?(t.type="Point",t.coordinates=this.parseCoord(e,36)):(t.type="MultiPoint",t.coordinates=this.parsePointArray(e,36,n)),t},i.prototype.parseZMultiPoint=function(e){var t,n=this.parseMultiPoint(e);if(!n)return null;if("Point"===n.type)return n.coordinates.push(e.readDoubleLE(72)),n;var i=52+((t=n.coordinates.length)<<4);return n.coordinates=this.parseZPointArray(e,i,t,n.coordinates),n},i.prototype.parsePolyline=function(e){var t={},n=e.readInt32LE(32);if(!n)return null;var i=this.parseCoord(e,0),r=this.parseCoord(e,16);t.bbox=[i[0],i[1],r[0],r[1]];var a,o=e.readInt32LE(36);return 1===n?(t.type="LineString",a=44,t.coordinates=this.parsePointArray(e,a,o)):(t.type="MultiLineString",a=40+(n<<2),40,t.coordinates=this.parseArrayGroup(e,a,40,n,o)),t},i.prototype.parseZPolyline=function(e){var t=this.parsePolyline(e);if(!t)return null;var n,i=t.coordinates.length;if("LineString"===t.type)return n=60+(i<<4),t.coordinates=this.parseZPointArray(e,n,i,t.coordinates),t;var r=t.coordinates.reduce((function(e,t){return e+t.length}),0);return n=56+(r<<4)+(i<<2),t.coordinates=this.parseZArrayGroup(e,n,i,t.coordinates),t},i.prototype.polyFuncs=function(e){return e?"LineString"===e.type?(e.type="Polygon",e.coordinates=[e.coordinates],e):(e.coordinates=e.coordinates.reduce(n,[]),1===e.coordinates.length?(e.type="Polygon",e.coordinates=e.coordinates[0],e):(e.type="MultiPolygon",e)):e},i.prototype.parsePolygon=function(e){return this.polyFuncs(this.parsePolyline(e))},i.prototype.parseZPolygon=function(e){return this.polyFuncs(this.parseZPolyline(e))};var r={1:"parsePoint",3:"parsePolyline",5:"parsePolygon",8:"parseMultiPoint",11:"parseZPoint",13:"parseZPolyline",15:"parseZPolygon",18:"parseZMultiPoint"};i.prototype.shpFuncs=function(e){var t=this.headers.shpCode;if(20<t&&(t-=20),!(t in r))throw new Error("I don't know that shp type");this.parseFunc=this[r[t]],this.parseCoord=function(e){return e?function(t,n){var i=[t.readDoubleLE(n),t.readDoubleLE(n+8)];return e.inverse(i)}:function(e,t){return[e.readDoubleLE(t),e.readDoubleLE(t+8)]}}(e)},i.prototype.getShpCode=function(){return this.parseHeader().shpCode},i.prototype.parseHeader=function(){var e=this.buffer.slice(0,100);return{length:e.readInt32BE(24)<<1,version:e.readInt32LE(28),shpCode:e.readInt32LE(32),bbox:[e.readDoubleLE(36),e.readDoubleLE(44),e.readDoubleLE(52),e.readDoubleLE(52)]}},i.prototype.getRows=function(){for(var e,t=100,n=this.buffer.byteLength,i=[];t<n&&(e=this.getRow(t));)t+=8,t+=e.len,e.type?i.push(this.parseFunc(e.data)):i.push(null);return i},i.prototype.getRow=function(e){var t=this.buffer.slice(e,e+12),n=t.readInt32BE(4)<<1,i=t.readInt32BE(0);return 0===n?{id:i,len:n,type:0}:{id:i,len:n,data:this.buffer.slice(e+12,e+n+8),type:t.readInt32LE(8)}},t.exports=function(e,t){return new i(e,t).rows}},{}],5:[function(e,t){var n=e("jszip");t.exports=function(){var e=o(i().mark((function e(t){var r,a,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=new n,e.next=3,r.loadAsync(t);case 3:return a=r.file(/.+/),s={},e.next=6,Promise.all(a.map(function(){var e=o(i().mark((function e(t){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("shp"!==t.name.slice(-3).toLowerCase()&&"dbf"!==t.name.slice(-3).toLowerCase()){e.next=6;break}return e.next=3,t.async("nodebuffer");case 3:e.t0=e.sent,e.next=9;break;case 6:return e.next=8,t.async("text");case 8:e.t0=e.sent;case 9:n=e.t0,s[t.name]=n;case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 6:return e.abrupt("return",s);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{jszip:11}],6:[function(e,t,n){function i(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function r(e){return o[63&e>>18]+o[63&e>>12]+o[63&e>>6]+o[63&e]}function a(e,t,n){for(var i,a=[],o=t;o<n;o+=3)i=(16711680&e[o]<<16)+(65280&e[o+1]<<8)+(255&e[o+2]),a.push(r(i));return a.join("")}n.byteLength=function(e){var t=i(e),n=t[0],r=t[1];return 3*(n+r)/4-r},n.toByteArray=function(e){var t,n,r=i(e),a=r[0],o=r[1],A=new l(function(e,t,n){return 3*(t+n)/4-n}(0,a,o)),c=0,h=0<o?a-4:a;for(n=0;n<h;n+=4)t=s[e.charCodeAt(n)]<<18|s[e.charCodeAt(n+1)]<<12|s[e.charCodeAt(n+2)]<<6|s[e.charCodeAt(n+3)],A[c++]=255&t>>16,A[c++]=255&t>>8,A[c++]=255&t;return 2===o&&(t=s[e.charCodeAt(n)]<<2|s[e.charCodeAt(n+1)]>>4,A[c++]=255&t),1===o&&(t=s[e.charCodeAt(n)]<<10|s[e.charCodeAt(n+1)]<<4|s[e.charCodeAt(n+2)]>>2,A[c++]=255&t>>8,A[c++]=255&t),A},n.fromByteArray=function(e){for(var t,n=e.length,i=n%3,r=[],s=16383,l=0,A=n-i;l<A;l+=s)r.push(a(e,l,l+s>A?A:l+s));return 1===i?(t=e[n-1],r.push(o[t>>2]+o[63&t<<4]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],r.push(o[t>>10]+o[63&t>>4]+o[63&t<<2]+"=")),r.join("")};for(var o=[],s=[],l="undefined"==typeof Uint8Array?Array:Uint8Array,A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,h=A.length;c<h;++c)o[c]=A[c],s[A.charCodeAt(c)]=c;s[45]=62,s[95]=63},{}],7:[function(){},{}],8:[function(e,t,n){(function(){(function(){function t(e){if(2147483647<e)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=i.prototype,t}function i(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return o(e,t,n)}function o(e,t,n){if("string"==typeof e)return u(e,t);if(ArrayBuffer.isView(e))return d(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+r(e));if(H(e,ArrayBuffer)||e&&H(e.buffer,ArrayBuffer))return function(e,t,n){if(0>t||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return(r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n)).__proto__=i.prototype,r}(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var a=e.valueOf&&e.valueOf();if(null!=a&&a!==e)return i.from(a,t,n);var o=f(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return i.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+r(e))}function A(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(0>e)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e,n,i){return A(e),0>=e||void 0===n?t(e):"string"==typeof i?t(e).fill(n,i):t(e).fill(n)}function h(e){return A(e),t(0>e?0:0|p(e))}function u(e,n){if(("string"!=typeof n||""===n)&&(n="utf8"),!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var r=0|m(e,n),a=t(r),o=a.write(e,n);return o!==r&&(a=a.slice(0,o)),a}function d(e){for(var n=0>e.length?0:0|p(e.length),i=t(n),r=0;r<n;r+=1)i[r]=255&e[r];return i}function f(e){if(i.isBuffer(e)){var n=0|p(e.length),r=t(n);return 0===r.length||e.copy(r,0,0,n),r}return void 0===e.length?"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0:"number"!=typeof e.length||V(e.length)?t(0):d(e)}function p(e){if(e>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|e}function m(e,t){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||H(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+r(e));var n=e.length,a=2<arguments.length&&!0===arguments[2];if(!a&&0===n)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Q(e).length;default:if(o)return a?-1:z(e).length;t=(""+t).toLowerCase(),o=!0}}function v(e,t,n){var i=!1;if((void 0===t||0>t)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),0>=n)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return F(this,t,n);case"utf8":case"utf-8":return T(this,t,n);case"ascii":return I(this,t,n);case"latin1":case"binary":return L(this,t,n);case"base64":return S(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function g(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function y(e,t,n,r,a){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):2147483647<n?n=2147483647:-2147483648>n&&(n=-2147483648),V(n=+n)&&(n=a?0:e.length-1),0>n&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(0>n){if(!a)return-1;n=0}if("string"==typeof t&&(t=i.from(t,r)),i.isBuffer(t))return 0===t.length?-1:w(e,t,n,r,a);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):w(e,[t],n,r,a);throw new TypeError("val must be string, number or Buffer")}function w(e,t,n,i,r){function a(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var o,s=1,l=e.length,A=t.length;if(void 0!==i&&("ucs2"===(i=(i+"").toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(2>e.length||2>t.length)return-1;s=2,l/=2,A/=2,n/=2}if(r){var c=-1;for(o=n;o<l;o++)if(a(e,o)!==a(t,-1===c?0:o-c))-1!==c&&(o-=o-c),c=-1;else if(-1===c&&(c=o),o-c+1===A)return c*s}else for(n+A>l&&(n=l-A),o=n;0<=o;o--){for(var h=!0,u=0;u<A;u++)if(a(e,o+u)!==a(t,u)){h=!1;break}if(h)return o}return-1}function x(e,t,n,i){n=+n||0;var r=e.length-n;i?(i=+i)>r&&(i=r):i=r;var a=t.length;i>a/2&&(i=a/2);for(var o,s=0;s<i;++s){if(V(o=parseInt(t.substr(2*s,2),16)))return s;e[n+s]=o}return s}function b(e,t,n,i){return G(z(t,e.length-n),e,n,i)}function M(e,t,n,i){return G(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,i)}function C(e,t,n,i){return M(e,t,n,i)}function B(e,t,n,i){return G(Q(t),e,n,i)}function E(e,t,n,i){return G(function(e,t){for(var n,i,r,a=[],o=0;o<e.length&&!(0>(t-=2));++o)i=(n=e.charCodeAt(o))>>8,r=n%256,a.push(r),a.push(i);return a}(t,e.length-n),e,n,i)}function S(e,t,n){return 0===t&&n===e.length?j.fromByteArray(e):j.fromByteArray(e.slice(t,n))}function T(e,t,n){n=l(e.length,n);for(var i=[],r=t;r<n;){var a,o,s,A,c=e[r],h=null,u=239<c?4:223<c?3:191<c?2:1;if(r+u<=n)1===u?128>c&&(h=c):2===u?128==(192&(a=e[r+1]))&&(127<(A=(31&c)<<6|63&a)&&(h=A)):3===u?(a=e[r+1],o=e[r+2],128==(192&a)&&128==(192&o)&&(2047<(A=(15&c)<<12|(63&a)<<6|63&o)&&(55296>A||57343<A)&&(h=A))):4===u&&(a=e[r+1],o=e[r+2],s=e[r+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(65535<(A=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)&&1114112>A&&(h=A)));null===h?(h=65533,u=1):65535<h&&(h-=65536,i.push(55296|1023&h>>>10),h=56320|1023&h),i.push(h),r+=u}return _(i)}function _(e){var t=e.length;if(t<=4096)return s.apply(String,e);for(var n="",i=0;i<t;)n+=s.apply(String,e.slice(i,i+=4096));return n}function I(e,t,n){var i="";n=l(e.length,n);for(var r=t;r<n;++r)i+=s(127&e[r]);return i}function L(e,t,n){var i="";n=l(e.length,n);for(var r=t;r<n;++r)i+=s(e[r]);return i}function F(e,t,n){var i=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>i)&&(n=i);for(var r="",a=t;a<n;++a)r+=N(e[a]);return r}function k(e,t,n){for(var i=e.slice(t,n),r="",a=0;a<i.length;a+=2)r+=s(i[a]+256*i[a+1]);return r}function P(e,t,n){if(0!=e%1||0>e)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function U(e,t,n,r,a,o){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function D(e,t,n,i){if(n+i>e.length)throw new RangeError("Index out of range");if(0>n)throw new RangeError("Index out of range")}function R(e,t,n,i,r){return t=+t,n>>>=0,r||D(e,0,n,4),W.write(e,t,n,i,23,4),n+4}function O(e,t,n,i,r){return t=+t,n>>>=0,r||D(e,0,n,8),W.write(e,t,n,i,52,8),n+8}function N(e){return 16>e?"0"+e.toString(16):e.toString(16)}function z(e,t){t=t||1/0;for(var n,i=e.length,r=null,a=[],o=0;o<i;++o){if(55295<(n=e.charCodeAt(o))&&57344>n){if(!r){if(56319<n){-1<(t-=3)&&a.push(239,191,189);continue}if(o+1===i){-1<(t-=3)&&a.push(239,191,189);continue}r=n;continue}if(56320>n){-1<(t-=3)&&a.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&-1<(t-=3)&&a.push(239,191,189);if(r=null,128>n){if(0>(t-=1))break;a.push(n)}else if(2048>n){if(0>(t-=2))break;a.push(192|n>>6,128|63&n)}else if(65536>n){if(0>(t-=3))break;a.push(224|n>>12,128|63&n>>6,128|63&n)}else{if(!(1114112>n))throw new Error("Invalid code point");if(0>(t-=4))break;a.push(240|n>>18,128|63&n>>12,128|63&n>>6,128|63&n)}}return a}function Q(e){return j.toByteArray(function(e){if(2>(e=(e=e.split("=")[0]).trim().replace(X,"")).length)return"";for(;0!=e.length%4;)e+="=";return e}(e))}function G(e,t,n,i){for(var r=0;r<i&&!(r+n>=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function H(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function V(e){return e!=e}var j=e("base64-js"),W=e("ieee754");n.Buffer=i,n.SlowBuffer=function(e){return+e!=e&&(e=0),i.alloc(+e)},n.INSPECT_MAX_BYTES=50,n.kMaxLength=2147483647,i.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){return i.isBuffer(this)?this.buffer:void 0}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){return i.isBuffer(this)?this.byteOffset:void 0}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(e,t,n){return o(e,t,n)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(e,t,n){return c(e,t,n)},i.allocUnsafe=function(e){return h(e)},i.allocUnsafeSlow=function(e){return h(e)},i.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==i.prototype},i.compare=function(e,t){if(H(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),H(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,a=0,o=l(n,r);a<o;++a)if(e[a]!==t[a]){n=e[a],r=t[a];break}return n<r?-1:r<n?1:0},i.isEncoding=function(e){switch((e+"").toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return i.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=i.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var o=e[n];if(H(o,Uint8Array)&&(o=i.from(o)),!i.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,a),a+=o.length}return r},i.byteLength=m,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var e=this.length;if(0!=e%2)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},i.prototype.swap32=function(){var e=this.length;if(0!=e%4)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},i.prototype.swap64=function(){var e=this.length;if(0!=e%8)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},i.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?T(this,0,e):v.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(e){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===i.compare(this,e)},i.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},i.prototype.compare=function(e,t,n,a,o){if(H(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+r(e));if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===a&&(a=0),void 0===o&&(o=this.length),0>t||n>e.length||0>a||o>this.length)throw new RangeError("out of range index");if(a>=o&&t>=n)return 0;if(a>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var s=(o>>>=0)-(a>>>=0),A=(n>>>=0)-(t>>>=0),c=l(s,A),h=this.slice(a,o),u=e.slice(t,n),d=0;d<c;++d)if(h[d]!==u[d]){s=h[d],A=u[d];break}return s<A?-1:A<s?1:0},i.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},i.prototype.indexOf=function(e,t,n){return y(this,e,t,n,!0)},i.prototype.lastIndexOf=function(e,t,n){return y(this,e,t,n,!1)},i.prototype.write=function(e,t,n,i){if(void 0===t)i="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)i=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var r=this.length-t;if((void 0===n||n>r)&&(n=r),0<e.length&&(0>n||0>t)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var a=!1;;)switch(i){case"hex":return x(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return M(this,e,t,n);case"latin1":case"binary":return C(this,e,t,n);case"base64":return B(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},i.prototype.slice=function(e,t){var n=this.length;0>(e=~~e)?0>(e+=n)&&(e=0):e>n&&(e=n),0>(t=void 0===t?n:~~t)?0>(t+=n)&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return r.__proto__=i.prototype,r},i.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);for(var i=this[e],r=1,a=0;++a<t&&(r*=256);)i+=this[e+a]*r;return i},i.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);for(var i=this[e+--t],r=1;0<t&&(r*=256);)i+=this[e+--t]*r;return i},i.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);for(var i=this[e],r=1,o=0;++o<t&&(r*=256);)i+=this[e+o]*r;return i>=(r*=128)&&(i-=a(2,8*t)),i},i.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||P(e,t,this.length);for(var i=t,r=1,o=this[e+--i];0<i&&(r*=256);)o+=this[e+--i]*r;return o>=(r*=128)&&(o-=a(2,8*t)),o},i.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return e>>>=0,t||P(e,4,this.length),W.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),W.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),W.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),W.read(this,e,!1,52,8)},i.prototype.writeUIntLE=function(e,t,n,i){(e=+e,t>>>=0,n>>>=0,i)||U(this,e,t,n,a(2,8*n)-1,0);var r=1,o=0;for(this[t]=255&e;++o<n&&(r*=256);)this[t+o]=255&e/r;return t+n},i.prototype.writeUIntBE=function(e,t,n,i){(e=+e,t>>>=0,n>>>=0,i)||U(this,e,t,n,a(2,8*n)-1,0);var r=n-1,o=1;for(this[t+r]=255&e;0<=--r&&(o*=256);)this[t+r]=255&e/o;return t+n},i.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,1,255,0),this[t]=255&e,t+1},i.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},i.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t>>>=0,!i){var r=a(2,8*n-1);U(this,e,t,n,r-1,-r)}var o=0,s=1,l=0;for(this[t]=255&e;++o<n&&(s*=256);)0>e&&0===l&&0!==this[t+o-1]&&(l=1),this[t+o]=255&(e/s>>0)-l;return t+n},i.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t>>>=0,!i){var r=a(2,8*n-1);U(this,e,t,n,r-1,-r)}var o=n-1,s=1,l=0;for(this[t+o]=255&e;0<=--o&&(s*=256);)0>e&&0===l&&0!==this[t+o+1]&&(l=1),this[t+o]=255&(e/s>>0)-l;return t+n},i.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,1,127,-128),0>e&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},i.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||U(this,e,t,4,2147483647,-2147483648),0>e&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeFloatLE=function(e,t,n){return R(this,e,t,!0,n)},i.prototype.writeFloatBE=function(e,t,n){return R(this,e,t,!1,n)},i.prototype.writeDoubleLE=function(e,t,n){return O(this,e,t,!0,n)},i.prototype.writeDoubleBE=function(e,t,n){return O(this,e,t,!1,n)},i.prototype.copy=function(e,t,n,r){if(!i.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),0<r&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(0>t)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("Index out of range");if(0>r)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var a=r-n;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,n,r);else if(this===e&&n<t&&t<r)for(var o=a-1;0<=o;--o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,r),t);return a},i.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!i.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var a=e.charCodeAt(0);("utf8"===r&&128>a||"latin1"===r)&&(e=a)}}else"number"==typeof e&&(e&=255);if(0>t||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var s=i.isBuffer(e)?e:i.from(e,r),l=s.length;if(0===l)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=s[o%l]}return this};var X=/[^+/0-9A-Za-z-_]/g}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":6,buffer:8,ieee754:9}],9:[function(i,r,o){
|
|
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
|
o.read=function(e,t,n,i,r){var o,s,l=8*r-i-1,A=(1<<l)-1,c=A>>1,h=-7,u=n?r-1:0,d=n?-1:1,f=e[t+u];for(u+=d,o=f&(1<<-h)-1,f>>=-h,h+=l;0<h;o=256*o+e[t+u],u+=d,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=i;0<h;s=256*s+e[t+u],u+=d,h-=8);if(0===o)o=1-c;else{if(o===A)return s?NaN:1/0*(f?-1:1);s+=a(2,i),o-=c}return(f?-1:1)*s*a(2,o-i)},o.write=function(i,r,o,s,l,A){var c,h,u,d=Math.LN2,f=8*A-l-1,p=(1<<f)-1,m=p>>1,v=23===l?a(2,-24)-a(2,-77):0,g=s?0:A-1,y=s?1:-1,w=0>r||0===r&&0>1/r?1:0;for(r=n(r),isNaN(r)||r===1/0?(h=isNaN(r)?1:0,c=p):(c=e(t(r)/d),1>r*(u=a(2,-c))&&(c--,u*=2),2<=(r+=1<=c+m?v/u:v*a(2,1-m))*u&&(c++,u/=2),c+m>=p?(h=0,c=p):1<=c+m?(h=(r*u-1)*a(2,l),c+=m):(h=r*a(2,m-1)*a(2,l),c=0));8<=l;i[o+g]=255&h,g+=y,h/=256,l-=8);for(c=c<<l|h,f+=l;0<f;i[o+g]=255&c,g+=y,c/=256,f-=8);i[o+g-y]|=128*w}},{}],10:[function(e,t){(function(e){(function(){function n(){A=!0;for(var e,t,n=c.length;n;){for(t=c,c=[],e=-1;++e<n;)t[e]();n=c.length}A=!1}var i,r=e.MutationObserver||e.WebKitMutationObserver;if(r){var a=0,o=new r(n),s=e.document.createTextNode("");o.observe(s,{characterData:!0}),i=function(){s.data=a=++a%2}}else if(e.setImmediate||void 0===e.MessageChannel)i="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){n(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(n,0)};else{var l=new e.MessageChannel;l.port1.onmessage=n,i=function(){l.port2.postMessage(0)}}var A,c=[];t.exports=function(e){1!==c.push(e)||A||i()}}).call(this)}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{}],11:[function(t,i,a){(function(o,A,c){(function(){
|
|
|
/*!
|
|
|
JSZip v3.6.0 - A JavaScript class for generating and reading zip files
|
|
|
<http://stuartk.com/jszip>
|
|
|
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
|
|
|
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/master/LICENSE.markdown.
|
|
|
JSZip uses the library pako released under the MIT license :
|
|
|
https://github.com/nodeca/pako/blob/master/LICENSE
|
|
|
*/
|
|
|
!function(e){"object"==r(a)&&void 0!==i?i.exports=e():("undefined"==typeof window?void 0===o?"undefined"==typeof self?this:self:o:window).JSZip=e()}((function(){return function e(n,i,r){function a(s,l){if(!i[s]){if(!n[s]){var A="function"==typeof t&&t;if(!l&&A)return A(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var h=i[s]={exports:{}};n[s][0].call(h.exports,(function(e){return a(n[s][1][e]||e)}),h,h.exports,e,n,i,r)}return i[s].exports}for(var o="function"==typeof t&&t,s=0;s<r.length;s++)a(r[s]);return a}({1:[function(t,i,a){(function(o){!function(e){"object"==r(a)&&void 0!==i?i.exports=e():("undefined"==typeof window?void 0===o?"undefined"==typeof self?this:self:o:window).JSZip=e()}((function(){return function e(n,i,r){function a(s,l){if(!i[s]){if(!n[s]){var A="function"==typeof t&&t;if(!l&&A)return A(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var h=i[s]={exports:{}};n[s][0].call(h.exports,(function(e){return a(n[s][1][e]||e)}),h,h.exports,e,n,i,r)}return i[s].exports}for(var o="function"==typeof t&&t,s=0;s<r.length;s++)a(r[s]);return a}({1:[function(t,i,a){(function(o){!function(e){"object"==r(a)&&void 0!==i?i.exports=e():("undefined"==typeof window?void 0===o?"undefined"==typeof self?this:self:o:window).JSZip=e()}((function(){return function e(n,i,r){function a(s,l){if(!i[s]){if(!n[s]){var A="function"==typeof t&&t;if(!l&&A)return A(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var h=i[s]={exports:{}};n[s][0].call(h.exports,(function(e){return a(n[s][1][e]||e)}),h,h.exports,e,n,i,r)}return i[s].exports}for(var o="function"==typeof t&&t,s=0;s<r.length;s++)a(r[s]);return a}({1:[function(t,i,a){(function(o){!function(e){"object"==r(a)&&void 0!==i?i.exports=e():("undefined"==typeof window?void 0===o?"undefined"==typeof self?this:self:o:window).JSZip=e()}((function(){return function e(n,i,r){function a(s,l){if(!i[s]){if(!n[s]){var A="function"==typeof t&&t;if(!l&&A)return A(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var h=i[s]={exports:{}};n[s][0].call(h.exports,(function(e){return a(n[s][1][e]||e)}),h,h.exports,e,n,i,r)}return i[s].exports}for(var o="function"==typeof t&&t,s=0;s<r.length;s++)a(r[s]);return a}({1:[function(t,i,a){(function(o){!function(e){"object"==r(a)&&void 0!==i?i.exports=e():("undefined"==typeof window?void 0===o?"undefined"==typeof self?this:self:o:window).JSZip=e()}((function(){return function e(n,i,r){function a(s,l){if(!i[s]){if(!n[s]){var A="function"==typeof t&&t;if(!l&&A)return A(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var h=i[s]={exports:{}};n[s][0].call(h.exports,(function(e){return a(n[s][1][e]||e)}),h,h.exports,e,n,i,r)}return i[s].exports}for(var o="function"==typeof t&&t,s=0;s<r.length;s++)a(r[s]);return a}({1:[function(t,i,a){(function(o){!function(e){"object"==r(a)&&void 0!==i?i.exports=e():("undefined"==typeof window?void 0===o?"undefined"==typeof self?this:self:o:window).JSZip=e()}((function(){return function e(n,i,r){function a(s,l){if(!i[s]){if(!n[s]){var A="function"==typeof t&&t;if(!l&&A)return A(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var h=i[s]={exports:{}};n[s][0].call(h.exports,(function(e){return a(n[s][1][e]||e)}),h,h.exports,e,n,i,r)}return i[s].exports}for(var o="function"==typeof t&&t,s=0;s<r.length;s++)a(r[s]);return a}({1:[function(e,t,n){var i=e("./utils"),r=e("./support");n.encode=function(e){for(var t,n,r,a,o,s,l,A=[],c=0,h=e.length,u=h,d="string"!==i.getTypeOf(e);c<e.length;)u=h-c,r=d?(t=e[c++],n=c<h?e[c++]:0,c<h?e[c++]:0):(t=e.charCodeAt(c++),n=c<h?e.charCodeAt(c++):0,c<h?e.charCodeAt(c++):0),a=t>>2,o=(3&t)<<4|n>>4,s=1<u?(15&n)<<2|r>>6:64,l=2<u?63&r:64,A.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(a)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(o)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(s)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l));return A.join("")},n.decode=function(e){var t,n,i,a,o,s,l=0,A=0;if("data:"===e.substr(0,5))throw new Error("Invalid base64 input, it looks like a data url.");var c,h=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)==="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(64)&&h--,e.charAt(e.length-2)==="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(64)&&h--,0!=h%1)throw new Error("Invalid base64 input, bad content length.");for(c=r.uint8array?new Uint8Array(0|h):Array(0|h);l<e.length;)t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e.charAt(l++))<<2|(a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e.charAt(l++)))>>4,n=(15&a)<<4|(o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e.charAt(l++)))>>2,i=(3&o)<<6|(s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(e.charAt(l++))),c[A++]=t,64!==o&&(c[A++]=n),64!==s&&(c[A++]=i);return c}},{"./support":30,"./utils":32}],2:[function(e,t){function n(e,t,n,i,r){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=i,this.compressedContent=r}var i=e("./external"),r=e("./stream/DataWorker"),a=e("./stream/Crc32Probe"),o=e("./stream/DataLengthProbe");n.prototype={getContentWorker:function(){var e=new r(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new r(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},n.createWorkerFrom=function(e,t,n){return e.pipe(new a).pipe(new o("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new o("compressedSize")).withStreamInfo("compression",t)},t.exports=n},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){var i=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t){var n=e("./utils"),i=function(){for(var e,t=[],n=0;256>n;n++){e=n;for(var i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"===n.getTypeOf(e)?function(e,t,n){e^=-1;for(var r=0;r<0+n;r++)e=e>>>8^i[255&(e^t.charCodeAt(r))];return-1^e}(0|t,e,e.length):function(e,t,n){e^=-1;for(var r=0;r<0+n;r++)e=e>>>8^i[255&(e^t[r])];return-1^e}(0|t,e,e.length):0}},{"./utils":32}],5:[function(e,t,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t){var n;n="undefined"==typeof Promise?e("lie"):Promise,t.exports={Promise:n}},{lie:37}],7:[function(e,t,n){function i(e,t){s.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,a=e("pako"),o=e("./utils"),s=e("./stream/GenericWorker"),l=r?"uint8array":"array";n.magic="\b\0",o.inherits(i,s),i.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(l,e.data),!1)},i.prototype.flush=function(){s.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},i.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this._pako=null},i.prototype._createPako=function(){this._pako=new a[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new i("Deflate",e)},n.uncompressWorker=function(){return new i("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t){function n(e,t){var n,i="";for(n=0;n<t;n++)i+=s(255&e),e>>>=8;return i}function i(e,t,i,r,o,s){var h,u,d=e.file,f=e.compression,p=s!==l.utf8encode,m=a.transformTo("string",s(d.name)),v=a.transformTo("string",l.utf8encode(d.name)),g=d.comment,y=a.transformTo("string",s(g)),w=a.transformTo("string",l.utf8encode(g)),x=v.length!==d.name.length,b=w.length!==g.length,M="",C="",B="",E=d.dir,S=d.date,T={crc32:0,compressedSize:0,uncompressedSize:0};t&&!i||(T.crc32=e.crc32,T.compressedSize=e.compressedSize,T.uncompressedSize=e.uncompressedSize);var _=0;t&&(_|=8),!p&&(x||b)&&(_|=2048);var I,L=0,F=0;E&&(L|=16),"UNIX"===o?(F=798,L|=((I=d.unixPermissions)||(I=E?16893:33204),(65535&I)<<16)):(F=20,L|=63&(d.dosPermissions||0)),h=S.getUTCHours(),h<<=6,h|=S.getUTCMinutes(),h<<=5,h|=S.getUTCSeconds()/2,u=S.getUTCFullYear()-1980,u<<=4,u|=S.getUTCMonth()+1,u<<=5,u|=S.getUTCDate(),x&&(M+="up"+n((C=n(1,1)+n(A(m),4)+v).length,2)+C),b&&(M+="uc"+n((B=n(1,1)+n(A(y),4)+w).length,2)+B);var k="";return k+="\n\0",k+=n(_,2),k+=f.magic,k+=n(h,2),k+=n(u,2),k+=n(T.crc32,4),k+=n(T.compressedSize,4),k+=n(T.uncompressedSize,4),k+=n(m.length,2),k+=n(M.length,2),{fileRecord:c.LOCAL_FILE_HEADER+k+m+M,dirRecord:c.CENTRAL_FILE_HEADER+n(F,2)+k+n(y.length,2)+"\0\0\0\0"+n(L,4)+n(r,4)+m+M+y}}function r(e,t,n,i){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=i,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}var a=e("../utils"),o=e("../stream/GenericWorker"),l=e("../utf8"),A=e("../crc32"),c=e("../signature");a.inherits(r,o),r.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-i-1))/n:100}}))},r.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},r.prototype.closedSource=function(e){this.accumulate=!1;var t,r=this.streamFiles&&!e.file.dir,a=i(e,r,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(a.dirRecord),r)this.push({data:(t=e,c.DATA_DESCRIPTOR+n(t.crc32,4)+n(t.compressedSize,4)+n(t.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:a.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},r.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var i,r,o,s,l,A,h=this.bytesWritten-e,u=(i=this.dirRecords.length,r=h,o=e,s=this.zipComment,l=this.encodeFileName,A=a.transformTo("string",l(s)),c.CENTRAL_DIRECTORY_END+"\0\0\0\0"+n(i,2)+n(i,2)+n(r,4)+n(o,4)+n(A.length,2)+A);this.push({data:u,meta:{percent:100}})},r.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},r.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()})),e.on("error",(function(e){t.error(e)})),this},r.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},r.prototype.error=function(e){var t=this._sources;if(!o.prototype.error.call(this,e))return!1;for(var n=0;n<t.length;n++)try{t[n].error(e)}catch(n){}return!0},r.prototype.lock=function(){o.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=r},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,n){var i=e("../compressions"),r=e("./ZipFileWorker");n.generateWorker=function(e,t,n){var a=new r(t.streamFiles,n,t.platform,t.encodeFileName),o=0;try{e.forEach((function(e,n){o++;var r=function(e,t){var n=e||t,r=i[n];if(!r)throw new Error(n+" is not a valid compression method !");return r}(n.options.compression,t.compression),s=n.options.compressionOptions||t.compressionOptions||{},l=n.dir,A=n.date;n._compressWorker(r,s).withStreamInfo("file",{name:e,dir:l,date:A,comment:n.comment||"",unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(a)})),a.entriesCount=o}catch(e){a.error(e)}return a}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t){function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var e=new n;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}(n.prototype=e("./object")).loadAsync=e("./load"),n.support=e("./support"),n.defaults=e("./defaults"),n.version="3.5.0",n.loadAsync=function(e,t){return(new n).loadAsync(e,t)},n.external=e("./external"),t.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t){function n(e){return new r.Promise((function(t,n){var i=e.decompressed.getContentWorker().pipe(new s);i.on("error",(function(e){n(e)})).on("end",(function(){i.streamInfo.crc32===e.decompressed.crc32?t():n(new Error("Corrupted zip : CRC32 mismatch"))})).resume()}))}var i=e("./utils"),r=e("./external"),a=e("./utf8"),o=e("./zipEntries"),s=e("./stream/Crc32Probe"),l=e("./nodejsUtils");t.exports=function(e,t){var s=this;return t=i.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),l.isNode&&l.isStream(e)?r.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then((function(e){var n=new o(t);return n.load(e),n})).then((function(e){var i=[r.Promise.resolve(e)],a=e.files;if(t.checkCRC32)for(var o=0;o<a.length;o++)i.push(n(a[o]));return r.Promise.all(i)})).then((function(e){for(var n,i=e.shift(),r=i.files,a=0;a<r.length;a++)n=r[a],s.file(n.fileNameStr,n.decompressed,{binary:!0,optimizedBinaryString:!0,date:n.date,dir:n.dir,comment:n.fileCommentStr.length?n.fileCommentStr:null,unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions,createFolders:t.createFolders});return i.zipComment.length&&(s.comment=i.zipComment),s}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t){function n(e,t){r.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}var i=e("../utils"),r=e("../stream/GenericWorker");i.inherits(n,r),n.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on("data",(function(e){t.push({data:e,meta:{percent:0}})})).on("error",(function(e){t.isPaused?this.generatedError=e:t.error(e)})).on("end",(function(){t.isPaused?t._upstreamEnded=!0:t.end()}))},n.prototype.pause=function(){return!!r.prototype.pause.call(this)&&(this._stream.pause(),!0)},n.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=n},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t){function n(e,t,n){i.call(this,t),this._helper=e;var r=this;e.on("data",(function(e,t){r.push(e)||r._helper.pause(),n&&n(t)})).on("error",(function(e){r.emit("error",e)})).on("end",(function(){r.push(null)}))}var i=e("readable-stream").Readable;e("../utils").inherits(n,i),n.prototype._read=function(){this._helper.resume()},t.exports=n},{"../utils":32,"readable-stream":16}],14:[function(e,t){t.exports={isNode:void 0!==A,newBufferFrom:function(e,t){if(A.from&&A.from!==Uint8Array.from)return A.from(e,t);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new A(e,t)},allocBuffer:function(e){if(A.alloc)return A.alloc(e);var t=new A(e);return t.fill(0),t},isBuffer:function(e){return A.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},{}],15:[function(e,t){function n(e,t,n){var r,a=o.getTypeOf(t),l=o.extend(n||{},A);l.date=l.date||new Date,null!==l.compression&&(l.compression=l.compression.toUpperCase()),"string"==typeof l.unixPermissions&&(l.unixPermissions=parseInt(l.unixPermissions,8)),l.unixPermissions&&16384&l.unixPermissions&&(l.dir=!0),l.dosPermissions&&16&l.dosPermissions&&(l.dir=!0),l.dir&&(e=i(e)),l.createFolders&&(r=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return 0<t?e.substring(0,t):""}(e))&&p.call(this,r,!0);var u,m="string"===a&&!1===l.binary&&!1===l.base64;n&&void 0!==n.binary||(l.binary=!m),(t instanceof c&&0===t.uncompressedSize||l.dir||!t||0===t.length)&&(l.base64=!1,l.binary=!0,t="",l.compression="STORE",a="string"),u=t instanceof c||t instanceof s?t:d.isNode&&d.isStream(t)?new f(e,t):o.prepareContent(e,t,l.binary,l.optimizedBinaryString,l.base64);var v=new h(e,u,l);this.files[e]=v}function i(e){return"/"!==e.slice(-1)&&(e+="/"),e}function r(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var a=e("./utf8"),o=e("./utils"),s=e("./stream/GenericWorker"),l=e("./stream/StreamHelper"),A=e("./defaults"),c=e("./compressedObject"),h=e("./zipObject"),u=e("./generate"),d=e("./nodejsUtils"),f=e("./nodejs/NodejsStreamInputAdapter"),p=function(e,t){return t=void 0===t?A.createFolders:t,e=i(e),this.files[e]||n.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};t.exports={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,n,i;for(t in this.files)this.files.hasOwnProperty(t)&&(i=this.files[t],(n=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(n,i))},filter:function(e){var t=[];return this.forEach((function(n,i){e(n,i)&&t.push(i)})),t},file:function(e,t,i){if(1!==arguments.length)return e=this.root+e,n.call(this,e,t,i),this;if(r(e)){var a=e;return this.filter((function(e,t){return!t.dir&&a.test(e)}))}var o=this.files[this.root+e];return o&&!o.dir?o:null},folder:function(e){if(!e)return this;if(r(e))return this.filter((function(t,n){return n.dir&&e.test(t)}));var t=this.root+e,n=p.call(this,t),i=this.clone();return i.root=n.name,i},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter((function(t,n){return n.name.slice(0,e.length)===e})),i=0;i<n.length;i++)delete this.files[n[i].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,n={};try{if((n=o.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:a.utf8encode})).type=n.type.toLowerCase(),n.compression=n.compression.toUpperCase(),"binarystring"===n.type&&(n.type="string"),!n.type)throw new Error("No output type specified.");o.checkSupport(n.type),"darwin"!==n.platform&&"freebsd"!==n.platform&&"linux"!==n.platform&&"sunos"!==n.platform||(n.platform="UNIX"),"win32"===n.platform&&(n.platform="DOS");var i=n.comment||this.comment||"";t=u.generateWorker(this,n,i)}catch(e){(t=new s("error")).error(e)}return new l(t,n.type||"string",n.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}}},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t){t.exports=e("stream")},{stream:void 0}],17:[function(e,t){function n(e){i.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}var i=e("./DataReader");e("../utils").inherits(n,i),n.prototype.byteAt=function(e){return this.data[this.zero+e]},n.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),n=e.charCodeAt(1),i=e.charCodeAt(2),r=e.charCodeAt(3),a=this.length-4;0<=a;--a)if(this.data[a]===t&&this.data[a+1]===n&&this.data[a+2]===i&&this.data[a+3]===r)return a-this.zero;return-1},n.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),i=e.charCodeAt(2),r=e.charCodeAt(3),a=this.readData(4);return t===a[0]&&n===a[1]&&i===a[2]&&r===a[3]},n.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./DataReader":18}],18:[function(e,t){function n(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}var i=e("../utils");n.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||0>e)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,n=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return i.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(127&e>>25),(15&e>>21)-1,31&e>>16,31&e>>11,63&e>>5,(31&e)<<1))}},t.exports=n},{"../utils":32}],19:[function(e,t){function n(e){i.call(this,e)}var i=e("./Uint8ArrayReader");e("../utils").inherits(n,i),n.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t){function n(e){i.call(this,e)}var i=e("./DataReader");e("../utils").inherits(n,i),n.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},n.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},n.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},n.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./DataReader":18}],21:[function(e,t){function n(e){i.call(this,e)}var i=e("./ArrayReader");e("../utils").inherits(n,i),n.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(e,t){var n=e("../utils"),i=e("../support"),r=e("./ArrayReader"),a=e("./StringReader"),o=e("./NodeBufferReader"),s=e("./Uint8ArrayReader");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new o(e):i.uint8array?new s(n.transformTo("uint8array",e)):new r(n.transformTo("array",e)):new a(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t){function n(e){i.call(this,"ConvertWorker to "+e),this.destType=e}var i=e("./GenericWorker"),r=e("../utils");r.inherits(n,i),n.prototype.processChunk=function(e){this.push({data:r.transformTo(this.destType,e.data),meta:e.meta})},t.exports=n},{"../utils":32,"./GenericWorker":28}],25:[function(e,t){function n(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}var i=e("./GenericWorker"),r=e("../crc32");e("../utils").inherits(n,i),n.prototype.processChunk=function(e){this.streamInfo.crc32=r(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=n},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t){function n(e){r.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}var i=e("../utils"),r=e("./GenericWorker");i.inherits(n,r),n.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}r.prototype.processChunk.call(this,e)},t.exports=n},{"../utils":32,"./GenericWorker":28}],27:[function(e,t){function n(e){r.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=i.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}var i=e("../utils"),r=e("./GenericWorker");i.inherits(n,r),n.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},n.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},n.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},n.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=l(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=n},{"../utils":32,"./GenericWorker":28}],28:[function(e,t){function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n<this._listeners[e].length;n++)this._listeners[e][n].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.end()})),e.on("error",(function(e){t.error(e)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},t.exports=n},{}],29:[function(e,t){function n(e,t,n){var o=t;"blob"===t||"arraybuffer"===t?o="uint8array":"base64"===t&&(o="string");try{this._internalType=o,this._outputType=t,this._mimeType=n,i.checkSupport(o),this._worker=e.pipe(new r(o)),e.lock()}catch(n){this._worker=new a("error"),this._worker.error(n)}}var i=e("../utils"),r=e("./ConvertWorker"),a=e("./GenericWorker"),o=e("../base64"),s=e("../support"),l=e("../external"),c=null;if(s.nodestream)try{c=e("../nodejs/NodejsStreamOutputAdapter")}catch(n){}n.prototype={accumulate:function(e){return t=this,n=e,new l.Promise((function(e,r){var a=[],s=t._internalType,l=t._outputType,c=t._mimeType;t.on("data",(function(e,t){a.push(e),n&&n(t)})).on("error",(function(e){a=[],r(e)})).on("end",(function(){try{var t=function(e,t,n){return"blob"===e?i.newBlob(i.transformTo("arraybuffer",t),n):"base64"===e?o.encode(t):i.transformTo(e,t)}(l,function(e,t){var n,i=0,r=null,a=0;for(n=0;n<t.length;n++)a+=t[n].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(r=new Uint8Array(a),n=0;n<t.length;n++)r.set(t[n],i),i+=t[n].length;return r;case"nodebuffer":return A.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}(s,a),c);e(t)}catch(t){r(t)}a=[]})).resume()}));var t,n},on:function(e,t){var n=this;return"data"===e?this._worker.on(e,(function(e){t.call(n,e.data,e.meta)})):this._worker.on(e,(function(){i.delay(t,arguments,n)})),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(i.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new c(this,{objectMode:"nodebuffer"!==this._outputType},e)}},t.exports=n},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,n){if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,n.nodebuffer=void 0!==A,n.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)n.blob=!1;else{var i=new ArrayBuffer(0);try{n.blob=0===new Blob([i],{type:"application/zip"}).size}catch(e){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);r.append(i),n.blob=0===r.getBlob("application/zip").size}catch(e){n.blob=!1}}}try{n.nodestream=!!e("readable-stream").Readable}catch(e){n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){function i(){l.call(this,"utf-8 decode"),this.leftOver=null}function r(){l.call(this,"utf-8 encode")}for(var a=e("./utils"),o=e("./support"),s=e("./nodejsUtils"),l=e("./stream/GenericWorker"),A=Array(256),c=0;256>c;c++)A[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;A[254]=A[254]=1,n.utf8encode=function(e){return o.nodebuffer?s.newBufferFrom(e,"utf-8"):function(e){var t,n,i,r,a,s=e.length,l=0;for(r=0;r<s;r++)55296==(64512&(n=e.charCodeAt(r)))&&r+1<s&&56320==(64512&(i=e.charCodeAt(r+1)))&&(n=65536+(n-55296<<10)+(i-56320),r++),l+=128>n?1:2048>n?2:65536>n?3:4;for(t=o.uint8array?new Uint8Array(l):Array(l),r=a=0;a<l;r++)55296==(64512&(n=e.charCodeAt(r)))&&r+1<s&&56320==(64512&(i=e.charCodeAt(r+1)))&&(n=65536+(n-55296<<10)+(i-56320),r++),128>n?t[a++]=n:(2048>n?t[a++]=192|n>>>6:(65536>n?t[a++]=224|n>>>12:(t[a++]=240|n>>>18,t[a++]=128|63&n>>>12),t[a++]=128|63&n>>>6),t[a++]=128|63&n);return t}(e)},n.utf8decode=function(e){return o.nodebuffer?a.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,n,i,r,o=e.length,s=Array(2*o);for(t=n=0;t<o;)if(128>(i=e[t++]))s[n++]=i;else if(4<(r=A[i]))s[n++]=65533,t+=r-1;else{for(i&=2===r?31:3===r?15:7;1<r&&t<o;)i=i<<6|63&e[t++],r--;1<r?s[n++]=65533:65536>i?s[n++]=i:(i-=65536,s[n++]=55296|1023&i>>10,s[n++]=56320|1023&i)}return s.length!==n&&(s.subarray?s=s.subarray(0,n):s.length=n),a.applyFromCharCode(s)}(e=a.transformTo(o.uint8array?"uint8array":"array",e))},a.inherits(i,l),i.prototype.processChunk=function(e){var t=a.transformTo(o.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var i=t;(t=new Uint8Array(i.length+this.leftOver.length)).set(this.leftOver,0),t.set(i,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var r=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return 0>n||0===n?t:n+A[e[n]]>t?n:t}(t),s=t;r!==t.length&&(o.uint8array?(s=t.subarray(0,r),this.leftOver=t.subarray(r,t.length)):(s=t.slice(0,r),this.leftOver=t.slice(r,t.length))),this.push({data:n.utf8decode(s),meta:e.meta})},i.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=i,a.inherits(r,l),r.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=r},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,n,i){function r(e){return e}function a(e,t){for(var n=0;n<e.length;++n)t[n]=255&e.charCodeAt(n);return t}function o(t){var n=65536,r=i.getTypeOf(t),a=!0;if("uint8array"===r?a=p.applyCanBeUsed.uint8array:"nodebuffer"===r&&(a=p.applyCanBeUsed.nodebuffer),a)for(;1<n;)try{return p.stringifyByChunk(t,r,n)}catch(t){n=e(n/2)}return p.stringifyByChar(t)}function A(e,t){for(var n=0;n<e.length;n++)t[n]=e[n];return t}var c=t("./support"),h=t("./base64"),u=t("./nodejsUtils"),d=t("set-immediate-shim"),f=t("./external");i.newBlob=function(e,t){i.checkSupport("blob");try{return new Blob([e],{type:t})}catch(i){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(e),n.getBlob(t)}catch(t){throw new Error("Bug : can't construct the Blob.")}}};var p={stringifyByChunk:function(e,t,n){var i=[],r=0,a=e.length;if(a<=n)return s.apply(null,e);for(;r<a;)"array"===t||"nodebuffer"===t?i.push(s.apply(null,e.slice(r,l(r+n,a)))):i.push(s.apply(null,e.subarray(r,l(r+n,a)))),r+=n;return i.join("")},stringifyByChar:function(e){for(var t="",n=0;n<e.length;n++)t+=s(e[n]);return t},applyCanBeUsed:{uint8array:function(){try{return c.uint8array&&1===s.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return c.nodebuffer&&1===s.apply(null,u.allocBuffer(1)).length}catch(e){return!1}}()}};i.applyFromCharCode=o;var m={};m.string={string:r,array:function(e){return a(e,Array(e.length))},arraybuffer:function(e){return m.string.uint8array(e).buffer},uint8array:function(e){return a(e,new Uint8Array(e.length))},nodebuffer:function(e){return a(e,u.allocBuffer(e.length))}},m.array={string:o,array:r,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return u.newBufferFrom(e)}},m.arraybuffer={string:function(e){return o(new Uint8Array(e))},array:function(e){return A(new Uint8Array(e),Array(e.byteLength))},arraybuffer:r,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return u.newBufferFrom(new Uint8Array(e))}},m.uint8array={string:o,array:function(e){return A(e,Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:r,nodebuffer:function(e){return u.newBufferFrom(e)}},m.nodebuffer={string:o,array:function(e){return A(e,Array(e.length))},arraybuffer:function(e){return m.nodebuffer.uint8array(e).buffer},uint8array:function(e){return A(e,new Uint8Array(e.length))},nodebuffer:r},i.transformTo=function(e,t){if(t=t||"",!e)return t;i.checkSupport(e);var n=i.getTypeOf(t);return m[n][e](t)},i.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":c.nodebuffer&&u.isBuffer(e)?"nodebuffer":c.uint8array&&e instanceof Uint8Array?"uint8array":c.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(e){if(!c[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(e){var t,n,i="";for(n=0;n<(e||"").length;n++)i+="\\x"+(16>(t=e.charCodeAt(n))?"0":"")+t.toString(16).toUpperCase();return i},i.delay=function(e,t,n){d((function(){e.apply(n||null,t||[])}))},i.inherits=function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n},i.extend=function(){var e,t,n={};for(e=0;e<arguments.length;e++)for(t in arguments[e])arguments[e].hasOwnProperty(t)&&void 0===n[t]&&(n[t]=arguments[e][t]);return n},i.prepareContent=function(e,t,n,r,o){return f.Promise.resolve(t).then((function(e){return c.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new f.Promise((function(t,n){var i=new FileReader;i.onload=function(e){t(e.target.result)},i.onerror=function(e){n(e.target.error)},i.readAsArrayBuffer(e)})):e})).then((function(t){var s,l=i.getTypeOf(t);return l?("arraybuffer"===l?t=i.transformTo("uint8array",t):"string"===l&&(o?t=h.decode(t):n&&!0!==r&&(t=a(s=t,c.uint8array?new Uint8Array(s.length):Array(s.length)))),t):f.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,"set-immediate-shim":54}],33:[function(e,t){function i(e){this.files=[],this.loadOptions=e}var r=e("./reader/readerFor"),a=e("./utils"),o=e("./signature"),s=e("./zipEntry"),l=(e("./utf8"),e("./support"));i.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+a.pretty(t)+", expected "+a.pretty(e)+")")}},isSignature:function(e,t){var n=this.reader.index;this.reader.setIndex(e);var i=this.reader.readString(4)===t;return this.reader.setIndex(n),i},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=l.uint8array?"uint8array":"array",n=a.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(n)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,n,i=this.zip64EndOfCentralSize-44;0<i;)e=this.reader.readInt(2),t=this.reader.readInt(4),n=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(e=new s({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(0>e)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(e);var t=e;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===a.MAX_VALUE_16BITS||this.diskWithCentralDirStart===a.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===a.MAX_VALUE_16BITS||this.centralDirRecords===a.MAX_VALUE_16BITS||this.centralDirSize===a.MAX_VALUE_32BITS||this.centralDirOffset===a.MAX_VALUE_32BITS){if(this.zip64=!0,0>(e=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR)))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),0>this.relativeOffsetEndOfZip64CentralDir))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var i=this.centralDirOffset+this.centralDirSize;this.zip64&&(i+=20,i+=12+this.zip64EndOfCentralSize);var r=t-i;if(0<r)this.isSignature(t,o.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(0>r)throw new Error("Corrupted zip: missing "+n(r)+" bytes.")},prepareReader:function(e){this.reader=r(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=i},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(e,t){function n(e,t){this.options=e,this.loadOptions=t}var i=e("./reader/readerFor"),r=e("./utils"),a=e("./compressedObject"),o=e("./crc32"),s=e("./utf8"),l=e("./compressions"),A=e("./support");n.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,n;if(e.skip(22),this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in l)if(l.hasOwnProperty(t)&&l[t].magic===e)return l[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+r.pretty(this.compressionMethod)+" unknown (inner file : "+r.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=65535&this.externalFileAttributes>>16),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=i(this.extraFields[1].value);this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,i,r=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<r;)t=e.readInt(2),n=e.readInt(2),i=e.readData(n),this.extraFields[t]={id:t,length:n,value:i};e.setIndex(r)},handleUTF8:function(){var e=A.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=s.utf8decode(this.fileName),this.fileCommentStr=s.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var n=r.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var i=this.findExtraFieldUnicodeComment();if(null!==i)this.fileCommentStr=i;else{var a=r.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(a)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=i(e.value);return 1===t.readInt(1)&&o(this.fileName)===t.readInt(4)?s.utf8decode(t.readData(e.length-5)):null}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=i(e.value);return 1===t.readInt(1)&&o(this.fileComment)===t.readInt(4)?s.utf8decode(t.readData(e.length-5)):null}return null}},t.exports=n},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t){function n(e,t,n){this.name=e,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=t,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}}var i=e("./stream/StreamHelper"),r=e("./stream/DataWorker"),a=e("./utf8"),o=e("./compressedObject"),s=e("./stream/GenericWorker");n.prototype={internalStream:function(e){var t=null,n="string";try{if(!e)throw new Error("No output type specified.");var r="string"===(n=e.toLowerCase())||"text"===n;"binarystring"!==n&&"text"!==n||(n="string"),t=this._decompressWorker();var o=!this._dataBinary;o&&!r&&(t=t.pipe(new a.Utf8EncodeWorker)),!o&&r&&(t=t.pipe(new a.Utf8DecodeWorker))}catch(e){(t=new s("error")).error(e)}return new i(t,n,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof o&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new a.Utf8EncodeWorker)),o.createWorkerFrom(n,e,t)},_decompressWorker:function(){return this._data instanceof o?this._data.getContentWorker():this._data instanceof s?this._data:new r(this._data)}};for(var l=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],A=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},c=0;c<l.length;c++)n.prototype[l[c]]=A;t.exports=n},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t){(function(e){function n(){var e,t;r=!0;for(var n=c.length;n;){for(t=c,c=[],e=-1;++e<n;)t[e]();n=c.length}r=!1}var i,r,a=e.MutationObserver||e.WebKitMutationObserver;if(a){var o=0,s=new a(n),l=e.document.createTextNode("");s.observe(l,{characterData:!0}),i=function(){l.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)i="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){n(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(n,0)};else{var A=new e.MessageChannel;A.port1.onmessage=n,i=function(){A.port2.postMessage(0)}}var c=[];t.exports=function(e){1!==c.push(e)||r||i()}}).call(this,void 0===o?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:o)},{}],37:[function(e,t){function n(){}function i(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,e!==n&&l(this,e)}function a(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function o(e,t,n){c((function(){var i;try{i=t(n)}catch(t){return h.reject(e,t)}i===e?h.reject(e,new TypeError("Cannot resolve promise with itself")):h.resolve(e,i)}))}function s(e){var t=e&&e.then;if(e&&("object"==r(e)||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function l(e,t){function n(t){r||(r=!0,h.reject(e,t))}function i(t){r||(r=!0,h.resolve(e,t))}var r=!1,a=A((function(){t(i,n)}));"error"===a.status&&n(a.value)}function A(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}var c=e("immediate"),h={},u=["REJECTED"],d=["FULFILLED"],f=["PENDING"];(t.exports=i).prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){throw n}))}))},i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){if("function"!=typeof e&&this.state===d||"function"!=typeof t&&this.state===u)return this;var i=new this.constructor(n);return this.state===f?this.queue.push(new a(i,e,t)):o(i,this.state===d?e:t,this.outcome),i},a.prototype.callFulfilled=function(e){h.resolve(this.promise,e)},a.prototype.otherCallFulfilled=function(e){o(this.promise,this.onFulfilled,e)},a.prototype.callRejected=function(e){h.reject(this.promise,e)},a.prototype.otherCallRejected=function(e){o(this.promise,this.onRejected,e)},h.resolve=function(e,t){var n=A(s,t);if("error"===n.status)return h.reject(e,n.value);var i=n.value;if(i)l(e,i);else{e.state=d,e.outcome=t;for(var r=-1,a=e.queue.length;++r<a;)e.queue[r].callFulfilled(t)}return e},h.reject=function(e,t){e.state=u,e.outcome=t;for(var n=-1,i=e.queue.length;++n<i;)e.queue[n].callRejected(t);return e},i.resolve=function(e){return e instanceof this?e:h.resolve(new this(n),e)},i.reject=function(e){var t=new this(n);return h.reject(t,e)},i.all=function(e){function t(e,t){i.resolve(e).then((function(e){o[t]=e,++s!==r||a||(a=!0,h.resolve(A,o))}),(function(e){a||(a=!0,h.reject(A,e))}))}var i=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,a=!1;if(!r)return this.resolve([]);for(var o=Array(r),s=0,l=-1,A=new this(n);++l<r;)t(e[l],l);return A},i.race=function(e){if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var t=e.length,i=!1;if(!t)return this.resolve([]);for(var r,a=-1,o=new this(n);++a<t;)r=e[a],this.resolve(r).then((function(e){i||(i=!0,h.resolve(o,e))}),(function(e){i||(i=!0,h.reject(o,e))}));return o}},{immediate:36}],38:[function(e,t){var n={};(0,e("./lib/utils/common").assign)(n,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,n){function i(e){if(!(this instanceof i))return new i(e);this.options=o.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&16>t.windowBits&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new A,this.strm.avail_out=0;var n=a.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw new Error(l[n]);if(t.header&&a.deflateSetHeader(this.strm,t.header),t.dictionary){var r;if(r="string"==typeof t.dictionary?s.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=a.deflateSetDictionary(this.strm,r)))throw new Error(l[n]);this._dict_set=!0}}function r(e,t){var n=new i(t);if(n.push(e,!0),n.err)throw n.msg||l[n.err];return n.result}var a=e("./zlib/deflate"),o=e("./utils/common"),s=e("./utils/strings"),l=e("./zlib/messages"),A=e("./zlib/zstream"),c=Object.prototype.toString;i.prototype.push=function(e,t){var n,i,r=this.strm,l=this.options.chunkSize;if(this.ended)return!1;i=t===~~t?t:!0===t?4:0,r.input="string"==typeof e?s.string2buf(e):"[object ArrayBuffer]"===c.call(e)?new Uint8Array(e):e,r.next_in=0,r.avail_in=r.input.length;do{if(0===r.avail_out&&(r.output=new o.Buf8(l),r.next_out=0,r.avail_out=l),1!==(n=a.deflate(r,i))&&0!==n)return this.onEnd(n),!(this.ended=!0);0!==r.avail_out&&(0!==r.avail_in||4!==i&&2!==i)||("string"===this.options.to?this.onData(s.buf2binstring(o.shrinkBuf(r.output,r.next_out))):this.onData(o.shrinkBuf(r.output,r.next_out)))}while((0<r.avail_in||0===r.avail_out)&&1!==n);return 4===i?(n=a.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,0===n):2!=i||(this.onEnd(0),!(r.avail_out=0))},i.prototype.onData=function(e){this.chunks.push(e)},i.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Deflate=i,n.deflate=r,n.deflateRaw=function(e,t){return(t=t||{}).raw=!0,r(e,t)},n.gzip=function(e,t){return(t=t||{}).gzip=!0,r(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,n){function i(e){if(!(this instanceof i))return new i(e);this.options=o.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&16>t.windowBits&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&16>t.windowBits)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&48>t.windowBits&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var n=a.inflateInit2(this.strm,t.windowBits);if(n!==l.Z_OK)throw new Error(A[n]);this.header=new h,a.inflateGetHeader(this.strm,this.header)}function r(e,t){var n=new i(t);if(n.push(e,!0),n.err)throw n.msg||A[n.err];return n.result}var a=e("./zlib/inflate"),o=e("./utils/common"),s=e("./utils/strings"),l=e("./zlib/constants"),A=e("./zlib/messages"),c=e("./zlib/zstream"),h=e("./zlib/gzheader"),u=Object.prototype.toString;i.prototype.push=function(e,t){var n,i,r,A,c,h,d=this.strm,f=this.options.chunkSize,p=this.options.dictionary,m=!1;if(this.ended)return!1;i=t===~~t?t:!0===t?l.Z_FINISH:l.Z_NO_FLUSH,d.input="string"==typeof e?s.binstring2buf(e):"[object ArrayBuffer]"===u.call(e)?new Uint8Array(e):e,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new o.Buf8(f),d.next_out=0,d.avail_out=f),(n=a.inflate(d,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&p&&(h="string"==typeof p?s.string2buf(p):"[object ArrayBuffer]"===u.call(p)?new Uint8Array(p):p,n=a.inflateSetDictionary(this.strm,h)),n===l.Z_BUF_ERROR&&!0===m&&(n=l.Z_OK,m=!1),n!==l.Z_STREAM_END&&n!==l.Z_OK)return this.onEnd(n),!(this.ended=!0);d.next_out&&(0!==d.avail_out&&n!==l.Z_STREAM_END&&(0!==d.avail_in||i!==l.Z_FINISH&&i!==l.Z_SYNC_FLUSH)||("string"===this.options.to?(r=s.utf8border(d.output,d.next_out),A=d.next_out-r,c=s.buf2string(d.output,r),d.next_out=A,d.avail_out=f-A,A&&o.arraySet(d.output,d.output,r,A,0),this.onData(c)):this.onData(o.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(m=!0)}while((0<d.avail_in||0===d.avail_out)&&n!==l.Z_STREAM_END);return n===l.Z_STREAM_END&&(i=l.Z_FINISH),i===l.Z_FINISH?(n=a.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===l.Z_OK):i!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(d.avail_out=0))},i.prototype.onData=function(e){this.chunks.push(e)},i.prototype.onEnd=function(e){e===l.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=o.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=i,n.inflate=r,n.inflateRaw=function(e,t){return(t=t||{}).raw=!0,r(e,t)},n.ungzip=r},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,n){var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(e){for(var t,n=Array.prototype.slice.call(arguments,1);n.length;)if(t=n.shift()){if("object"!=r(t))throw new TypeError(t+"must be non-object");for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var a={arraySet:function(e,t,n,i,r){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+i),r);else for(var a=0;a<i;a++)e[r+a]=t[n+a]},flattenChunks:function(e){var t,n,i,r,a,o;for(t=i=0,n=e.length;t<n;t++)i+=e[t].length;for(o=new Uint8Array(i),t=r=0,n=e.length;t<n;t++)a=e[t],o.set(a,r),r+=a.length;return o}},o={arraySet:function(e,t,n,i,r){for(var a=0;a<i;a++)e[r+a]=t[n+a]},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){e?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,a)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(i)},{}],42:[function(e,t,n){function i(e,t){if(65537>t&&(e.subarray&&o||!e.subarray&&a))return s.apply(null,r.shrinkBuf(e,t));for(var n="",i=0;i<t;i++)n+=s(e[i]);return n}var r=e("./common"),a=!0,o=!0;try{s.apply(null,[0])}catch(n){a=!1}try{s.apply(null,new Uint8Array(1))}catch(n){o=!1}for(var l=new r.Buf8(256),A=0;256>A;A++)l[A]=252<=A?6:248<=A?5:240<=A?4:224<=A?3:192<=A?2:1;l[254]=l[254]=1,n.string2buf=function(e){var t,n,i,a,o,s=e.length,l=0;for(a=0;a<s;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<s&&56320==(64512&(i=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),l+=128>n?1:2048>n?2:65536>n?3:4;for(t=new r.Buf8(l),a=o=0;o<l;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<s&&56320==(64512&(i=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(i-56320),a++),128>n?t[o++]=n:(2048>n?t[o++]=192|n>>>6:(65536>n?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|63&n>>>12),t[o++]=128|63&n>>>6),t[o++]=128|63&n);return t},n.buf2binstring=function(e){return i(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n<i;n++)t[n]=e.charCodeAt(n);return t},n.buf2string=function(e,t){var n,r,a,o,s=t||e.length,A=Array(2*s);for(n=r=0;n<s;)if(128>(a=e[n++]))A[r++]=a;else if(4<(o=l[a]))A[r++]=65533,n+=o-1;else{for(a&=2===o?31:3===o?15:7;1<o&&n<s;)a=a<<6|63&e[n++],o--;1<o?A[r++]=65533:65536>a?A[r++]=a:(a-=65536,A[r++]=55296|1023&a>>10,A[r++]=56320|1023&a)}return i(A,r)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return 0>n||0===n?t:n+l[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t){t.exports=function(e,t,n,i){for(var r=0|65535&e,a=0|65535&e>>>16,o=0;0!==n;){for(n-=o=2e3<n?2e3:n;a=0|a+(r=0|r+t[i++]),--o;);r%=65521,a%=65521}return r|a<<16|0}},{}],44:[function(e,t){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t){var n=function(){for(var e,t=[],n=0;256>n;n++){e=n;for(var i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,i,r){e^=-1;for(var a=r;a<r+i;a++)e=e>>>8^n[255&(e^t[a])];return-1^e}},{}],46:[function(e,t,n){function i(e,t){return e.msg=C[t],t}function r(e){return(e<<1)-(4<e?9:0)}function a(e){for(var t=e.length;0<=--t;)e[t]=0}function o(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(w.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function s(e,t){x._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,o(e.strm)}function l(e,t){e.pending_buf[e.pending++]=t}function A(e,t){e.pending_buf[e.pending++]=255&t>>>8,e.pending_buf[e.pending++]=255&t}function c(e,t){var n,i,r=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,A=e.window,c=e.w_mask,h=e.prev,u=e.strstart+258,d=A[a+o-1],f=A[a+o];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do{if(A[(n=t)+o]===f&&A[n+o-1]===d&&A[n]===A[a]&&A[++n]===A[a+1]){a+=2,n++;do{}while(A[++a]===A[++n]&&A[++a]===A[++n]&&A[++a]===A[++n]&&A[++a]===A[++n]&&A[++a]===A[++n]&&A[++a]===A[++n]&&A[++a]===A[++n]&&A[++a]===A[++n]&&a<u);if(i=258-(u-a),a=u-258,o<i){if(e.match_start=t,s<=(o=i))break;d=A[a+o-1],f=A[a+o]}}}while((t=h[t&c])>l&&0!=--r);return o<=e.lookahead?o:e.lookahead}function h(e){var t,n,i,r,a,o,s,l,A,c,h=e.w_size;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=h+(h-262)){for(w.arraySet(e.window,e.window,h,h,0),e.match_start-=h,e.strstart-=h,e.block_start-=h,t=n=e.hash_size;i=e.head[--t],e.head[t]=h<=i?i-h:0,--n;);for(t=n=h;i=e.prev[--t],e.prev[t]=h<=i?i-h:0,--n;);r+=h}if(0===e.strm.avail_in)break;if(o=e.strm,s=e.window,l=e.strstart+e.lookahead,c=void 0,(A=r)<(c=o.avail_in)&&(c=A),n=0===c?0:(o.avail_in-=c,w.arraySet(s,o.input,o.next_in,c,l),1===o.state.wrap?o.adler=b(o.adler,s,c,l):2===o.state.wrap&&(o.adler=M(o.adler,s,c,l)),o.next_in+=c,o.total_in+=c,c),e.lookahead+=n,3<=e.lookahead+e.insert)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[a+3-1])&e.hash_mask,e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(3>e.lookahead+e.insert)););}while(e.lookahead<262&&0!==e.strm.avail_in)}function u(e,t){for(var n,i;;){if(e.lookahead<262){if(h(e),e.lookahead<262&&0===t)return 1;if(0===e.lookahead)break}if(n=0,3<=e.lookahead&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-262&&(e.match_length=c(e,n)),3<=e.match_length)if(i=x._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&3<=e.lookahead){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else i=x._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(s(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(s(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(s(e,!1),0===e.strm.avail_out)?1:2}function d(e,t){for(var n,i,r;;){if(e.lookahead<262){if(h(e),e.lookahead<262&&0===t)return 1;if(0===e.lookahead)break}if(n=0,3<=e.lookahead&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-262&&(e.match_length=c(e,n),5>=e.match_length&&(1===e.strategy||3===e.match_length&&4096<e.strstart-e.match_start)&&(e.match_length=2)),3<=e.prev_length&&e.match_length<=e.prev_length){for(r=e.strstart+e.lookahead-3,i=x._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=r&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=2,e.strstart++,i&&(s(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((i=x._tr_tally(e,0,e.window[e.strstart-1]))&&s(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=x._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(s(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(s(e,!1),0===e.strm.avail_out)?1:2}function f(e,t,n,i,r){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=i,this.func=r}function p(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new w.Buf16(1146),this.dyn_dtree=new w.Buf16(122),this.bl_tree=new w.Buf16(78),a(this.dyn_ltree),a(this.dyn_dtree),a(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new w.Buf16(16),this.heap=new w.Buf16(573),a(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new w.Buf16(573),a(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function m(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,0>t.wrap&&(t.wrap=-t.wrap),t.status=t.wrap?42:113,e.adler=2===t.wrap?0:1,t.last_flush=0,x._tr_init(t),0):i(e,-2)}function v(e){var t,n=m(e);return 0===n&&((t=e.state).window_size=2*t.w_size,a(t.head),t.max_lazy_match=y[t.level].max_lazy,t.good_match=y[t.level].good_length,t.nice_match=y[t.level].nice_length,t.max_chain_length=y[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),n}function g(e,t,n,r,a,o){if(!e)return-2;var s=1;if(-1===t&&(t=6),0>r?(s=0,r=-r):15<r&&(s=2,r-=16),1>a||9<a||8!==n||8>r||15<r||0>t||9<t||0>o||4<o)return i(e,-2);8===r&&(r=9);var l=new p;return(e.state=l).strm=e,l.wrap=s,l.gzhead=null,l.w_bits=r,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=a+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new w.Buf8(2*l.w_size),l.head=new w.Buf16(l.hash_size),l.prev=new w.Buf16(l.w_size),l.lit_bufsize=1<<a+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new w.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=o,l.method=n,v(e)}var y,w=e("../utils/common"),x=e("./trees"),b=e("./adler32"),M=e("./crc32"),C=e("./messages");y=[new f(0,0,0,0,(function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(1>=e.lookahead){if(h(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+n;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,s(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-262&&(s(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(s(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(s(e,!1),e.strm.avail_out),1)})),new f(4,4,8,4,u),new f(4,5,16,8,u),new f(4,6,32,32,u),new f(4,4,16,16,d),new f(8,16,32,32,d),new f(8,16,128,128,d),new f(8,32,128,256,d),new f(32,128,258,1024,d),new f(32,258,258,4096,d)],n.deflateInit=function(e,t){return g(e,t,8,15,8,0)},n.deflateInit2=g,n.deflateReset=v,n.deflateResetKeep=m,n.deflateSetHeader=function(e,t){return e&&e.state&&2===e.state.wrap?(e.state.gzhead=t,0):-2},n.deflate=function(e,t){var n,c,u,d;if(!e||!e.state||5<t||0>t)return e?i(e,-2):-2;if(c=e.state,!e.output||!e.input&&0!==e.avail_in||666===c.status&&4!==t)return i(e,0===e.avail_out?-5:-2);if(c.strm=e,n=c.last_flush,c.last_flush=t,42===c.status)if(2===c.wrap)e.adler=0,l(c,31),l(c,139),l(c,8),c.gzhead?(l(c,(c.gzhead.text?1:0)+(c.gzhead.hcrc?2:0)+(c.gzhead.extra?4:0)+(c.gzhead.name?8:0)+(c.gzhead.comment?16:0)),l(c,255&c.gzhead.time),l(c,255&c.gzhead.time>>8),l(c,255&c.gzhead.time>>16),l(c,255&c.gzhead.time>>24),l(c,9===c.level?2:2<=c.strategy||2>c.level?4:0),l(c,255&c.gzhead.os),c.gzhead.extra&&c.gzhead.extra.length&&(l(c,255&c.gzhead.extra.length),l(c,255&c.gzhead.extra.length>>8)),c.gzhead.hcrc&&(e.adler=M(e.adler,c.pending_buf,c.pending,0)),c.gzindex=0,c.status=69):(l(c,0),l(c,0),l(c,0),l(c,0),l(c,0),l(c,9===c.level?2:2<=c.strategy||2>c.level?4:0),l(c,3),c.status=113);else{var f=8+(c.w_bits-8<<4)<<8;f|=(2<=c.strategy||2>c.level?0:6>c.level?1:6===c.level?2:3)<<6,0!==c.strstart&&(f|=32),f+=31-f%31,c.status=113,A(c,f),0!==c.strstart&&(A(c,e.adler>>>16),A(c,65535&e.adler)),e.adler=1}if(69===c.status)if(c.gzhead.extra){for(u=c.pending;c.gzindex<(65535&c.gzhead.extra.length)&&(c.pending!==c.pending_buf_size||(c.gzhead.hcrc&&c.pending>u&&(e.adler=M(e.adler,c.pending_buf,c.pending-u,u)),o(e),u=c.pending,c.pending!==c.pending_buf_size));)l(c,255&c.gzhead.extra[c.gzindex]),c.gzindex++;c.gzhead.hcrc&&c.pending>u&&(e.adler=M(e.adler,c.pending_buf,c.pending-u,u)),c.gzindex===c.gzhead.extra.length&&(c.gzindex=0,c.status=73)}else c.status=73;if(73===c.status)if(c.gzhead.name){u=c.pending;do{if(c.pending===c.pending_buf_size&&(c.gzhead.hcrc&&c.pending>u&&(e.adler=M(e.adler,c.pending_buf,c.pending-u,u)),o(e),u=c.pending,c.pending===c.pending_buf_size)){d=1;break}d=c.gzindex<c.gzhead.name.length?255&c.gzhead.name.charCodeAt(c.gzindex++):0,l(c,d)}while(0!==d);c.gzhead.hcrc&&c.pending>u&&(e.adler=M(e.adler,c.pending_buf,c.pending-u,u)),0===d&&(c.gzindex=0,c.status=91)}else c.status=91;if(91===c.status)if(c.gzhead.comment){u=c.pending;do{if(c.pending===c.pending_buf_size&&(c.gzhead.hcrc&&c.pending>u&&(e.adler=M(e.adler,c.pending_buf,c.pending-u,u)),o(e),u=c.pending,c.pending===c.pending_buf_size)){d=1;break}d=c.gzindex<c.gzhead.comment.length?255&c.gzhead.comment.charCodeAt(c.gzindex++):0,l(c,d)}while(0!==d);c.gzhead.hcrc&&c.pending>u&&(e.adler=M(e.adler,c.pending_buf,c.pending-u,u)),0===d&&(c.status=103)}else c.status=103;if(103===c.status&&(c.gzhead.hcrc?(c.pending+2>c.pending_buf_size&&o(e),c.pending+2<=c.pending_buf_size&&(l(c,255&e.adler),l(c,255&e.adler>>8),e.adler=0,c.status=113)):c.status=113),0!==c.pending){if(o(e),0===e.avail_out)return c.last_flush=-1,0}else if(0===e.avail_in&&r(t)<=r(n)&&4!==t)return i(e,-5);if(666===c.status&&0!==e.avail_in)return i(e,-5);if(0!==e.avail_in||0!==c.lookahead||0!==t&&666!==c.status){var p=2===c.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(h(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,n=x._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(s(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(s(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(s(e,!1),0===e.strm.avail_out)?1:2}(c,t):3===c.strategy?function(e,t){for(var n,i,r,a,o=e.window;;){if(258>=e.lookahead){if(h(e),258>=e.lookahead&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,3<=e.lookahead&&0<e.strstart&&(i=o[r=e.strstart-1])===o[++r]&&i===o[++r]&&i===o[++r]){a=e.strstart+258;do{}while(i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&i===o[++r]&&r<a);e.match_length=258-(a-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(3<=e.match_length?(n=x._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=x._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(s(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(s(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(s(e,!1),0===e.strm.avail_out)?1:2}(c,t):y[c.level].func(c,t);if(3!==p&&4!==p||(c.status=666),1===p||3===p)return 0===e.avail_out&&(c.last_flush=-1),0;if(2===p&&(1===t?x._tr_align(c):5!=t&&(x._tr_stored_block(c,0,0,!1),3==t&&(a(c.head),0===c.lookahead&&(c.strstart=0,c.block_start=0,c.insert=0))),o(e),0===e.avail_out))return c.last_flush=-1,0}return 4===t?0>=c.wrap?1:(2===c.wrap?(l(c,255&e.adler),l(c,255&e.adler>>8),l(c,255&e.adler>>16),l(c,255&e.adler>>24),l(c,255&e.total_in),l(c,255&e.total_in>>8),l(c,255&e.total_in>>16),l(c,255&e.total_in>>24)):(A(c,e.adler>>>16),A(c,65535&e.adler)),o(e),0<c.wrap&&(c.wrap=-c.wrap),0===c.pending?1:0):0},n.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&103!==t&&113!==t&&666!==t?i(e,-2):(e.state=null,113===t?i(e,-3):0):-2},n.deflateSetDictionary=function(e,t){var n,i,r,o,s,l,A,c,u=t.length;if(!e||!e.state)return-2;if(2===(o=(n=e.state).wrap)||1===o&&42!==n.status||n.lookahead)return-2;for(1===o&&(e.adler=b(e.adler,t,u,0)),n.wrap=0,u>=n.w_size&&(0===o&&(a(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new w.Buf8(n.w_size),w.arraySet(c,t,u-n.w_size,n.w_size,0),t=c,u=n.w_size),s=e.avail_in,l=e.next_in,A=e.input,e.avail_in=u,e.next_in=0,e.input=t,h(n);n.lookahead>=3;){for(i=n.strstart,r=n.lookahead-2;n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+3-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++,--r;);n.strstart=i,n.lookahead=2,h(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=l,e.input=A,e.avail_in=s,n.wrap=o,0},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t){t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,t){t.exports=function(e,t){var n,i,r,a,o,s,l,A,c,h,u,d,f,p,m,v,g,y,w,x,b,M,C,B,E;n=e.state,i=e.next_in,B=e.input,r=i+(e.avail_in-5),a=e.next_out,E=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),l=n.dmax,A=n.wsize,c=n.whave,h=n.wnext,u=n.window,d=n.hold,f=n.bits,p=n.lencode,m=n.distcode,v=(1<<n.lenbits)-1,g=(1<<n.distbits)-1;e:do{15>f&&(d+=B[i++]<<f,f+=8,d+=B[i++]<<f,f+=8),y=p[d&v];t:for(;;){if(d>>>=w=y>>>24,f-=w,0==(w=255&y>>>16))E[a++]=65535&y;else{if(!(16&w)){if(0==(64&w)){y=p[(65535&y)+(d&(1<<w)-1)];continue t}if(32&w){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}x=65535&y,(w&=15)&&(f<w&&(d+=B[i++]<<f,f+=8),x+=d&(1<<w)-1,d>>>=w,f-=w),15>f&&(d+=B[i++]<<f,f+=8,d+=B[i++]<<f,f+=8),y=m[d&g];n:for(;;){if(d>>>=w=y>>>24,f-=w,!(16&(w=255&y>>>16))){if(0==(64&w)){y=m[(65535&y)+(d&(1<<w)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(b=65535&y,f<(w&=15)&&(d+=B[i++]<<f,(f+=8)<w&&(d+=B[i++]<<f,f+=8)),l<(b+=d&(1<<w)-1)){e.msg="invalid distance too far back",n.mode=30;break e}if(d>>>=w,f-=w,(w=a-o)<b){if(c<(w=b-w)&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(C=u,(M=0)===h){if(M+=A-w,w<x){for(x-=w;E[a++]=u[M++],--w;);M=a-b,C=E}}else if(h<w){if(M+=A+h-w,(w-=h)<x){for(x-=w;E[a++]=u[M++],--w;);if(M=0,h<x){for(x-=w=h;E[a++]=u[M++],--w;);M=a-b,C=E}}}else if(M+=h-w,w<x){for(x-=w;E[a++]=u[M++],--w;);M=a-b,C=E}for(;2<x;)E[a++]=C[M++],E[a++]=C[M++],E[a++]=C[M++],x-=3;x&&(E[a++]=C[M++],1<x&&(E[a++]=C[M++]))}else{for(M=a-b;E[a++]=E[M++],E[a++]=E[M++],E[a++]=E[M++],2<(x-=3););x&&(E[a++]=E[M++],1<x&&(E[a++]=E[M++]))}break}}break}}while(i<r&&a<s);i-=x=f>>3,d&=(1<<(f-=x<<3))-1,e.next_in=i,e.next_out=a,e.avail_in=i<r?r-i+5:5-(i-r),e.avail_out=a<s?s-a+257:257-(a-s),n.hold=d,n.bits=f}},{}],49:[function(e,t,n){function i(e){return(255&e>>>24)+(65280&e>>>8)+((65280&e)<<8)+((255&e)<<24)}function r(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new f.Buf16(320),this.work=new f.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new f.Buf32(852),t.distcode=t.distdyn=new f.Buf32(592),t.sane=1,t.back=-1,0):-2}function o(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,a(e)):-2}function l(e,t){var n,i;return e&&e.state?(i=e.state,0>t?(n=0,t=-t):(n=1+(t>>4),48>t&&(t&=15)),t&&(8>t||15<t)?-2:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=n,i.wbits=t,o(e))):-2}function A(e,t){var n,i;return e?(i=new r,(e.state=i).window=null,0!==(n=l(e,t))&&(e.state=null),n):-2}function c(e){if(y){var t;for(u=new f.Buf32(512),d=new f.Buf32(32),t=0;144>t;)e.lens[t++]=8;for(;256>t;)e.lens[t++]=9;for(;280>t;)e.lens[t++]=7;for(;288>t;)e.lens[t++]=8;for(g(1,e.lens,0,288,u,0,e.work,{bits:9}),t=0;32>t;)e.lens[t++]=5;g(2,e.lens,0,32,d,0,e.work,{bits:5}),y=!1}e.lencode=u,e.lenbits=9,e.distcode=d,e.distbits=5}function h(e,t,n,i){var r,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new f.Buf8(a.wsize)),i>=a.wsize?(f.arraySet(a.window,t,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(r=a.wsize-a.wnext)&&(r=i),f.arraySet(a.window,t,n-i,r,a.wnext),(i-=r)?(f.arraySet(a.window,t,n-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=r))),0}var u,d,f=e("../utils/common"),p=e("./adler32"),m=e("./crc32"),v=e("./inffast"),g=e("./inftrees"),y=!0;n.inflateReset=o,n.inflateReset2=l,n.inflateResetKeep=a,n.inflateInit=function(e){return A(e,15)},n.inflateInit2=A,n.inflate=function(e,t){var n,r,a,o,l,A,u,d,y,w,x,b,M,C,B,E,S,T,_,I,L,F,k,P,U=0,D=new f.Buf8(4),R=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return-2;12===(n=e.state).mode&&(n.mode=13),l=e.next_out,a=e.output,u=e.avail_out,o=e.next_in,r=e.input,A=e.avail_in,d=n.hold,y=n.bits,w=A,x=u,F=0;e:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;16>y;){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}if(2&n.wrap&&35615===d){D[n.check=0]=255&d,D[1]=255&d>>>8,n.check=m(n.check,D,2,0),y=d=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&d)<<8)+(d>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&d)){e.msg="unknown compression method",n.mode=30;break}if(y-=4,L=8+(15&(d>>>=4)),0===n.wbits)n.wbits=L;else if(L>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<<L,e.adler=n.check=1,n.mode=512&d?10:12,y=d=0;break;case 2:for(;16>y;){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}if(n.flags=d,8!=(255&n.flags)){e.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=1&d>>8),512&n.flags&&(D[0]=255&d,D[1]=255&d>>>8,n.check=m(n.check,D,2,0)),y=d=0,n.mode=3;case 3:for(;32>y;){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}n.head&&(n.head.time=d),512&n.flags&&(D[0]=255&d,D[1]=255&d>>>8,D[2]=255&d>>>16,D[3]=255&d>>>24,n.check=m(n.check,D,4,0)),y=d=0,n.mode=4;case 4:for(;16>y;){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}n.head&&(n.head.xflags=255&d,n.head.os=d>>8),512&n.flags&&(D[0]=255&d,D[1]=255&d>>>8,n.check=m(n.check,D,2,0)),y=d=0,n.mode=5;case 5:if(1024&n.flags){for(;16>y;){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}n.length=d,n.head&&(n.head.extra_len=d),512&n.flags&&(D[0]=255&d,D[1]=255&d>>>8,n.check=m(n.check,D,2,0)),y=d=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(A<(b=n.length)&&(b=A),b&&(n.head&&(L=n.head.extra_len-n.length,n.head.extra||(n.head.extra=Array(n.head.extra_len)),f.arraySet(n.head.extra,r,o,b,L)),512&n.flags&&(n.check=m(n.check,r,b,o)),A-=b,o+=b,n.length-=b),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===A)break e;for(b=0;L=r[o+b++],n.head&&L&&65536>n.length&&(n.head.name+=s(L)),L&&b<A;);if(512&n.flags&&(n.check=m(n.check,r,b,o)),A-=b,o+=b,L)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===A)break e;for(b=0;L=r[o+b++],n.head&&L&&65536>n.length&&(n.head.comment+=s(L)),L&&b<A;);if(512&n.flags&&(n.check=m(n.check,r,b,o)),A-=b,o+=b,L)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;16>y;){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}if(d!==(65535&n.check)){e.msg="header crc mismatch",n.mode=30;break}y=d=0}n.head&&(n.head.hcrc=1&n.flags>>9,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;32>y;){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}e.adler=n.check=i(d),y=d=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=l,e.avail_out=u,e.next_in=o,e.avail_in=A,n.hold=d,n.bits=y,2;e.adler=n.check=1,n.mode=12;case 12:if(5===t||6===t)break e;case 13:if(n.last){d>>>=7&y,y-=7&y,n.mode=27;break}for(;3>y;){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}switch(n.last=1&d,y-=1,3&(d>>>=1)){case 0:n.mode=14;break;case 1:if(c(n),n.mode=20,6!==t)break;d>>>=2,y-=2;break e;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}d>>>=2,y-=2;break;case 14:for(d>>>=7&y,y-=7&y;32>y;){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}if((65535&d)!=(65535^d>>>16)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&d,y=d=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(b=n.length){if(A<b&&(b=A),u<b&&(b=u),0===b)break e;f.arraySet(a,r,o,b,l),A-=b,o+=b,u-=b,l+=b,n.length-=b;break}n.mode=12;break;case 17:for(;14>y;){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}if(n.nlen=257+(31&d),d>>>=5,y-=5,n.ndist=1+(31&d),d>>>=5,y-=5,n.ncode=4+(15&d),d>>>=4,y-=4,286<n.nlen||30<n.ndist){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;3>y;){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}n.lens[R[n.have++]]=7&d,d>>>=3,y-=3}for(;19>n.have;)n.lens[R[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,k={bits:n.lenbits},F=g(0,n.lens,0,19,n.lencode,0,n.work,k),n.lenbits=k.bits,F){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;E=255&(U=n.lencode[d&(1<<n.lenbits)-1])>>>16,S=65535&U,!((B=U>>>24)<=y);){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}if(16>S)d>>>=B,y-=B,n.lens[n.have++]=S;else{if(16===S){for(P=B+2;y<P;){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}if(d>>>=B,y-=B,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}L=n.lens[n.have-1],b=3+(3&d),d>>>=2,y-=2}else if(17===S){for(P=B+3;y<P;){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}y-=B,L=0,b=3+(7&(d>>>=B)),d>>>=3,y-=3}else{for(P=B+7;y<P;){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}y-=B,L=0,b=11+(127&(d>>>=B)),d>>>=7,y-=7}if(n.have+b>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;b--;)n.lens[n.have++]=L}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,k={bits:n.lenbits},F=g(1,n.lens,0,n.nlen,n.lencode,0,n.work,k),n.lenbits=k.bits,F){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,k={bits:n.distbits},F=g(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,k),n.distbits=k.bits,F){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(6<=A&&258<=u){e.next_out=l,e.avail_out=u,e.next_in=o,e.avail_in=A,n.hold=d,n.bits=y,v(e,x),l=e.next_out,a=e.output,u=e.avail_out,o=e.next_in,r=e.input,A=e.avail_in,d=n.hold,y=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;E=255&(U=n.lencode[d&(1<<n.lenbits)-1])>>>16,S=65535&U,!((B=U>>>24)<=y);){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}if(E&&0==(240&E)){for(T=B,_=E,I=S;E=255&(U=n.lencode[I+((d&(1<<T+_)-1)>>T)])>>>16,S=65535&U,!(T+(B=U>>>24)<=y);){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}d>>>=T,y-=T,n.back+=T}if(d>>>=B,y-=B,n.back+=B,n.length=S,0===E){n.mode=26;break}if(32&E){n.back=-1,n.mode=12;break}if(64&E){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&E,n.mode=22;case 22:if(n.extra){for(P=n.extra;y<P;){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}n.length+=d&(1<<n.extra)-1,d>>>=n.extra,y-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;E=255&(U=n.distcode[d&(1<<n.distbits)-1])>>>16,S=65535&U,!((B=U>>>24)<=y);){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}if(0==(240&E)){for(T=B,_=E,I=S;E=255&(U=n.distcode[I+((d&(1<<T+_)-1)>>T)])>>>16,S=65535&U,!(T+(B=U>>>24)<=y);){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}d>>>=T,y-=T,n.back+=T}if(d>>>=B,y-=B,n.back+=B,64&E){e.msg="invalid distance code",n.mode=30;break}n.offset=S,n.extra=15&E,n.mode=24;case 24:if(n.extra){for(P=n.extra;y<P;){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}n.offset+=d&(1<<n.extra)-1,d>>>=n.extra,y-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===u)break e;if(b=x-u,n.offset>b){if((b=n.offset-b)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}M=b>n.wnext?(b-=n.wnext,n.wsize-b):n.wnext-b,b>n.length&&(b=n.length),C=n.window}else C=a,M=l-n.offset,b=n.length;for(u<b&&(b=u),u-=b,n.length-=b;a[l++]=C[M++],--b;);0===n.length&&(n.mode=21);break;case 26:if(0===u)break e;a[l++]=n.length,u--,n.mode=21;break;case 27:if(n.wrap){for(;32>y;){if(0===A)break e;A--,d|=r[o++]<<y,y+=8}if(x-=u,e.total_out+=x,n.total+=x,x&&(e.adler=n.check=n.flags?m(n.check,a,x,l-x):p(n.check,a,x,l-x)),x=u,(n.flags?d:i(d))!==n.check){e.msg="incorrect data check",n.mode=30;break}y=d=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;32>y;){if(0===A)break e;A--,d+=r[o++]<<y,y+=8}if(d!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=30;break}y=d=0}n.mode=29;case 29:F=1;break e;case 30:F=-3;break e;case 31:return-4;default:return-2}return e.next_out=l,e.avail_out=u,e.next_in=o,e.avail_in=A,n.hold=d,n.bits=y,(n.wsize||x!==e.avail_out&&30>n.mode&&(27>n.mode||4!==t))&&h(e,e.output,e.next_out,x-e.avail_out)?(n.mode=31,-4):(w-=e.avail_in,x-=e.avail_out,e.total_in+=w,e.total_out+=x,n.total+=x,n.wrap&&x&&(e.adler=n.check=n.flags?m(n.check,a,x,e.next_out-x):p(n.check,a,x,e.next_out-x)),e.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0==w&&0===x||4===t)&&0===F&&(F=-5),F)},n.inflateEnd=function(e){if(!e||!e.state)return-2;var t=e.state;return t.window&&(t.window=null),e.state=null,0},n.inflateGetHeader=function(e,t){var n;return e&&e.state?0==(2&(n=e.state).wrap)?-2:((n.head=t).done=!1,0):-2},n.inflateSetDictionary=function(e,t){var n,i=t.length;return e&&e.state?0!==(n=e.state).wrap&&11!==n.mode?-2:11===n.mode&&p(1,t,i,0)!==n.check?-3:h(e,t,i,i)?(n.mode=31,-4):(n.havedict=1,0):-2},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t){var n=e("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],r=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],o=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,s,l,A,c,h,u){var d,f,p,m,v,g,y,w,x,b=u.bits,M=0,C=0,B=0,E=0,S=0,T=0,_=0,I=0,L=0,F=0,k=null,P=0,U=new n.Buf16(16),D=new n.Buf16(16),R=null,O=0;for(M=0;15>=M;M++)U[M]=0;for(C=0;C<l;C++)U[t[s+C]]++;for(S=b,E=15;1<=E&&0===U[E];E--);if(E<S&&(S=E),0==E)return A[c++]=20971520,A[c++]=20971520,u.bits=1,0;for(B=1;B<E&&0===U[B];B++);for(S<B&&(S=B),M=I=1;15>=M;M++)if(I<<=1,0>(I-=U[M]))return-1;if(0<I&&(0===e||1!==E))return-1;for(D[1]=0,M=1;15>M;M++)D[M+1]=D[M]+U[M];for(C=0;C<l;C++)0!==t[s+C]&&(h[D[t[s+C]]++]=C);if(g=0===e?(k=R=h,19):1===e?(k=i,P-=257,R=r,O-=257,256):(k=a,R=o,-1),M=B,v=c,_=C=F=0,p=-1,m=(L=1<<(T=S))-1,1===e&&852<L||2===e&&592<L)return 1;for(;;){for(y=M-_,x=h[C]<g?(w=0,h[C]):h[C]>g?(w=R[O+h[C]],k[P+h[C]]):(w=96,0),d=1<<M-_,B=f=1<<T;A[v+(F>>_)+(f-=d)]=y<<24|w<<16|x|0,0!==f;);for(d=1<<M-1;F&d;)d>>=1;if(0===d?F=0:(F&=d-1,F+=d),C++,0==--U[M]){if(M===E)break;M=t[s+h[C]]}if(S<M&&(F&m)!==p){for(0===_&&(_=S),v+=B,I=1<<(T=M-_);T+_<E&&!(0>=(I-=U[T+_]));)T++,I<<=1;if(L+=1<<T,1===e&&852<L||2===e&&592<L)return 1;A[p=F&m]=S<<24|T<<16|v-c|0}}return 0!=F&&(A[v+F]=4194304|M-_<<24),u.bits=S,0}},{"../utils/common":41}],51:[function(e,t){t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,n){function i(e){for(var t=e.length;0<=--t;)e[t]=0}function r(e,t,n,i,r){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=e&&e.length}function a(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function o(e){return 256>e?T[e]:T[256+(e>>>7)]}function s(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=255&t>>>8}function l(e,t,n){e.bi_valid>16-n?(e.bi_buf|=65535&t<<e.bi_valid,s(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=65535&t<<e.bi_valid,e.bi_valid+=n)}function A(e,t,n){l(e,n[2*t],n[2*t+1])}function c(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1}function h(e,t,n){var i,r,a=Array(16),o=0;for(i=1;i<=15;i++)a[i]=o=o+n[i-1]<<1;for(r=0;r<=t;r++){var s=e[2*r+1];0!==s&&(e[2*r]=c(a[s]++,s))}}function u(e){var t;for(t=0;286>t;t++)e.dyn_ltree[2*t]=0;for(t=0;30>t;t++)e.dyn_dtree[2*t]=0;for(t=0;19>t;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function d(e){8<e.bi_valid?s(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function f(e,t,n,i){var r=2*t,a=2*n;return e[r]<e[a]||e[r]===e[a]&&i[t]<=i[n]}function p(e,t,n){for(var i=e.heap[n],r=n<<1;r<=e.heap_len&&(r<e.heap_len&&f(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!f(t,i,e.heap[r],e.depth));)e.heap[n]=e.heap[r],n=r,r<<=1;e.heap[n]=i}function m(e,t,n){var i,r,a,s,c=0;if(0!==e.last_lit)for(;i=e.pending_buf[e.d_buf+2*c]<<8|e.pending_buf[e.d_buf+2*c+1],r=e.pending_buf[e.l_buf+c],c++,0===i?A(e,r,t):(A(e,(a=_[r])+256+1,t),0!==(s=b[a])&&l(e,r-=I[a],s),A(e,a=o(--i),n),0!==(s=M[a])&&l(e,i-=P[a],s)),c<e.last_lit;);A(e,256,t)}function v(e,t){var n,i,r,a=t.dyn_tree,o=t.stat_desc.static_tree,s=t.stat_desc.has_stree,l=t.stat_desc.elems,A=-1;for(e.heap_len=0,e.heap_max=573,n=0;n<l;n++)0===a[2*n]?a[2*n+1]=0:(e.heap[++e.heap_len]=A=n,e.depth[n]=0);for(;2>e.heap_len;)a[2*(r=e.heap[++e.heap_len]=2>A?++A:0)]=1,e.depth[r]=0,e.opt_len--,s&&(e.static_len-=o[2*r+1]);for(t.max_code=A,n=e.heap_len>>1;1<=n;n--)p(e,a,n);for(r=l;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],p(e,a,1),i=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=i,a[2*r]=a[2*n]+a[2*i],e.depth[r]=(e.depth[n]>=e.depth[i]?e.depth[n]:e.depth[i])+1,a[2*n+1]=a[2*i+1]=r,e.heap[1]=r++,p(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,i,r,a,o,s,l=t.dyn_tree,A=t.max_code,c=t.stat_desc.static_tree,h=t.stat_desc.has_stree,u=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,f=t.stat_desc.max_length,p=0;for(a=0;a<=15;a++)e.bl_count[a]=0;for(l[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;573>n;n++)f<(a=l[2*l[2*(i=e.heap[n])+1]+1]+1)&&(a=f,p++),l[2*i+1]=a,A<i||(e.bl_count[a]++,o=0,d<=i&&(o=u[i-d]),s=l[2*i],e.opt_len+=s*(a+o),h&&(e.static_len+=s*(c[2*i+1]+o)));if(0!=p){do{for(a=f-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[f]--,p-=2}while(0<p);for(a=f;0!==a;a--)for(i=e.bl_count[a];0!==i;)A<(r=e.heap[--n])||(l[2*r+1]!==a&&(e.opt_len+=(a-l[2*r+1])*l[2*r],l[2*r+1]=a),i--)}}(e,t),h(a,A,e.bl_count)}function g(e,t,n){var i,r,a=-1,o=t[1],s=0,l=7,A=4;for(0===o&&(l=138,A=3),t[2*(n+1)+1]=65535,i=0;i<=n;i++)r=o,o=t[2*(i+1)+1],++s<l&&r===o||(s<A?e.bl_tree[2*r]+=s:0===r?10>=s?e.bl_tree[34]++:e.bl_tree[36]++:(r!==a&&e.bl_tree[2*r]++,e.bl_tree[32]++),a=r,A=(s=0)===o?(l=138,3):r===o?(l=6,3):(l=7,4))}function y(e,t,n){var i,r,a=-1,o=t[1],s=0,c=7,h=4;for(0===o&&(c=138,h=3),i=0;i<=n;i++)if(r=o,o=t[2*(i+1)+1],!(++s<c&&r===o)){if(s<h)for(;A(e,r,e.bl_tree),0!=--s;);else 0===r?10>=s?(A(e,17,e.bl_tree),l(e,s-3,3)):(A(e,18,e.bl_tree),l(e,s-11,7)):(r!==a&&(A(e,r,e.bl_tree),s--),A(e,16,e.bl_tree),l(e,s-3,2));a=r,h=(s=0)===o?(c=138,3):r===o?(c=6,3):(c=7,4)}}function w(e,t,n,i){var r,a,o;l(e,0+(i?1:0),3),a=t,o=n,d(r=e),s(r,o),s(r,~o),x.arraySet(r.pending_buf,r.window,a,o,r.pending),r.pending+=o}var x=e("../utils/common"),b=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],M=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],E=Array(576);i(E);var S=Array(60);i(S);var T=Array(512);i(T);var _=Array(256);i(_);var I=Array(29);i(I);var L,F,k,P=Array(30);i(P);var U=!1;n._tr_init=function(e){U||(function(){var e,t,n,i,a,o=Array(16);for(i=n=0;28>i;i++)for(I[i]=n,e=0;e<1<<b[i];e++)_[n++]=i;for(_[n-1]=i,i=a=0;16>i;i++)for(P[i]=a,e=0;e<1<<M[i];e++)T[a++]=i;for(a>>=7;30>i;i++)for(P[i]=a<<7,e=0;e<1<<M[i]-7;e++)T[256+a++]=i;for(t=0;t<=15;t++)o[t]=0;for(e=0;143>=e;)E[2*e+1]=8,e++,o[8]++;for(;255>=e;)E[2*e+1]=9,e++,o[9]++;for(;279>=e;)E[2*e+1]=7,e++,o[7]++;for(;287>=e;)E[2*e+1]=8,e++,o[8]++;for(h(E,287,o),e=0;30>e;e++)S[2*e+1]=5,S[2*e]=c(e,5);L=new r(E,b,257,286,15),F=new r(S,M,0,30,15),k=new r([],C,0,19,7)}(),U=!0),e.l_desc=new a(e.dyn_ltree,L),e.d_desc=new a(e.dyn_dtree,F),e.bl_desc=new a(e.bl_tree,k),e.bi_buf=0,e.bi_valid=0,u(e)},n._tr_stored_block=w,n._tr_flush_block=function(e,t,n,i){var r,a,o=0;0<e.level?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;31>=t;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;256>t;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),v(e,e.l_desc),v(e,e.d_desc),o=function(e){var t;for(g(e,e.dyn_ltree,e.l_desc.max_code),g(e,e.dyn_dtree,e.d_desc.max_code),v(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*B[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),r=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=r&&(r=a)):r=a=n+5,n+4<=r&&-1!==t?w(e,t,n,i):4===e.strategy||a===r?(l(e,2+(i?1:0),3),m(e,E,S)):(l(e,4+(i?1:0),3),function(e,t,n,i){var r;for(l(e,t-257,5),l(e,n-1,5),l(e,i-4,4),r=0;r<i;r++)l(e,e.bl_tree[2*B[r]+1],3);y(e,e.dyn_ltree,t-1),y(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),m(e,e.dyn_ltree,e.dyn_dtree)),u(e),i&&d(e)},n._tr_tally=function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=255&t>>>8,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(_[n]+256+1)]++,e.dyn_dtree[2*o(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){var t;l(e,2,3),A(e,256,E),16===(t=e).bi_valid?(s(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":41}],53:[function(e,t){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t){t.exports="function"==typeof c?c:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)}},{}]},{},[10])(10)}))}).call(this,void 0===o?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:o)},{}]},{},[1])(1)}))}).call(this,void 0===o?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:o)},{}]},{},[1])(1)}))}).call(this,void 0===o?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:o)},{}]},{},[1])(1)}))}).call(this,void 0===o?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:o)},{}]},{},[1])(1)}))}).call(this,void 0===o?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:o)},{}]},{},[1])(1)}))}).call(this)}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global,t("buffer").Buffer,t("timers").setImmediate)},{buffer:8,timers:22}],12:[function(e,t){function n(){}function i(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,e!==n&&l(this,e)}function a(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function o(e,t,n){c((function(){var i;try{i=t(n)}catch(t){return h.reject(e,t)}i===e?h.reject(e,new TypeError("Cannot resolve promise with itself")):h.resolve(e,i)}))}function s(e){var t=e&&e.then;if(e&&("object"==r(e)||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function l(e,t){function n(t){r||(r=!0,h.reject(e,t))}function i(t){r||(r=!0,h.resolve(e,t))}var r=!1,a=A((function(){t(i,n)}));"error"===a.status&&n(a.value)}function A(e,t){var n={};try{n.value=e(t),n.status="success"}catch(t){n.status="error",n.value=t}return n}var c=e("immediate"),h={},u=["REJECTED"],d=["FULFILLED"],f=["PENDING"];t.exports=i,i.prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){throw n}))}))},i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){if("function"!=typeof e&&this.state===d||"function"!=typeof t&&this.state===u)return this;var i=new this.constructor(n);this.state!==f?o(i,this.state===d?e:t,this.outcome):this.queue.push(new a(i,e,t));return i},a.prototype.callFulfilled=function(e){h.resolve(this.promise,e)},a.prototype.otherCallFulfilled=function(e){o(this.promise,this.onFulfilled,e)},a.prototype.callRejected=function(e){h.reject(this.promise,e)},a.prototype.otherCallRejected=function(e){o(this.promise,this.onRejected,e)},h.resolve=function(e,t){var n=A(s,t);if("error"===n.status)return h.reject(e,n.value);var i=n.value;if(i)l(e,i);else{e.state=d,e.outcome=t;for(var r=-1,a=e.queue.length;++r<a;)e.queue[r].callFulfilled(t)}return e},h.reject=function(e,t){e.state=u,e.outcome=t;for(var n=-1,i=e.queue.length;++n<i;)e.queue[n].callRejected(t);return e},i.resolve=function(e){return e instanceof this?e:h.resolve(new this(n),e)},i.reject=function(e){var t=new this(n);return h.reject(t,e)},i.all=function(e){function t(e,t){i.resolve(e).then((function(e){o[t]=e,++s!==r||a||(a=!0,h.resolve(A,o))}),(function(e){a||(a=!0,h.reject(A,e))}))}var i=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,a=!1;if(!r)return this.resolve([]);for(var o=Array(r),s=0,l=-1,A=new this(n);++l<r;)t(e[l],l);return A},i.race=function(e){function t(e){i.resolve(e).then((function(e){a||(a=!0,h.resolve(s,e))}),(function(e){a||(a=!0,h.reject(s,e))}))}var i=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,a=!1;if(!r)return this.resolve([]);for(var o=-1,s=new this(n);++o<r;)t(e[o]);return s}},{immediate:10}],13:[function(e,t){!function(){function e(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function n(){return 1}function i(e){u||"string"==typeof e||"number"==typeof e||(u=!0,console.error(new TypeError("LRU: key must be a string or number. Almost certainly a bug! "+r(e)).stack))}function a(e){return this instanceof a?("number"==typeof e&&(e={max:e}),!e&&(e={}),this._max=e.max,(!this._max||"number"!=typeof this._max||0>=this._max)&&(this._max=1/0),this._lengthCalculator=e.length||n,"function"!=typeof this._lengthCalculator&&(this._lengthCalculator=n),this._allowStale=e.stale||!1,this._maxAge=e.maxAge||null,this._dispose=e.dispose,void this.reset()):new a(e)}function o(e,t,n){i(t);var r=e._cache[t];return r&&(s(e,r)?(c(e,r),!e._allowStale&&(r=void 0)):n&&function(e,t){A(e,t),t.lu=e._mru++,e._lruList[t.lu]=t}(e,r),r&&(r=r.value)),r}function s(e,t){if(!t||!t.maxAge&&!e._maxAge)return!1;var n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e._maxAge&&n>e._maxAge}function l(e){for(;e._lru<e._mru&&e._length>e._max;)c(e,e._lruList[e._lru])}function A(e,t){for(delete e._lruList[t.lu];e._lru<e._mru&&!e._lruList[e._lru];)e._lru++}function c(e,t){t&&(e._dispose&&e._dispose(t.key,t.value),e._length-=t.length,e._itemCount--,delete e._cache[t.key],A(e,t))}function h(e,t,n,i,r,a){this.key=e,this.value=t,this.lu=n,this.length=i,this.now=r,a&&(this.maxAge=a)}"object"==r(t)&&t.exports?t.exports=a:this.LRUCache=a;var u=!1;Object.defineProperty(a.prototype,"max",{set:function(e){e&&"number"==typeof e&&!(0>=e)||(e=1/0),this._max=e,this._length>this._max&&l(this)},get:function(){return this._max},enumerable:!0}),Object.defineProperty(a.prototype,"lengthCalculator",{set:function(e){if("function"!=typeof e)for(var t in this._lengthCalculator=n,this._length=this._itemCount,this._cache)this._cache[t].length=1;else for(var t in this._lengthCalculator=e,this._length=0,this._cache)this._cache[t].length=this._lengthCalculator(this._cache[t].value),this._length+=this._cache[t].length;this._length>this._max&&l(this)},get:function(){return this._lengthCalculator},enumerable:!0}),Object.defineProperty(a.prototype,"length",{get:function(){return this._length},enumerable:!0}),Object.defineProperty(a.prototype,"itemCount",{get:function(){return this._itemCount},enumerable:!0}),a.prototype.forEach=function(e,t){t=t||this;for(var n=0,i=this._itemCount,r=this._mru-1;0<=r&&n<i;r--)if(this._lruList[r]){n++;var a=this._lruList[r];s(this,a)&&(c(this,a),!this._allowStale&&(a=void 0)),a&&e.call(t,a.value,a.key,this)}},a.prototype.keys=function(){for(var e=Array(this._itemCount),t=0,n=this._mru-1;0<=n&&t<this._itemCount;n--)if(this._lruList[n]){var i=this._lruList[n];e[t++]=i.key}return e},a.prototype.values=function(){for(var e=Array(this._itemCount),t=0,n=this._mru-1;0<=n&&t<this._itemCount;n--)if(this._lruList[n]){var i=this._lruList[n];e[t++]=i.value}return e},a.prototype.reset=function(){if(this._dispose&&this._cache)for(var e in this._cache)this._dispose(e,this._cache[e].value);this._cache=Object.create(null),this._lruList=Object.create(null),this._mru=0,this._lru=0,this._length=0,this._itemCount=0},a.prototype.dump=function(){for(var e=[],t=0,n=this._mru-1;0<=n&&t<this._itemCount;n--)if(this._lruList[n]){var i=this._lruList[n];s(this,i)||(++t,e.push({k:i.key,v:i.value,e:i.now+(i.maxAge||0)}))}return e},a.prototype.dumpLru=function(){return this._lruList},a.prototype.set=function(t,n,r){r=r||this._maxAge,i(t);var a=r?Date.now():0,o=this._lengthCalculator(n);if(e(this._cache,t))return o>this._max?(c(this,this._cache[t]),!1):(this._dispose&&this._dispose(t,this._cache[t].value),this._cache[t].now=a,this._cache[t].maxAge=r,this._cache[t].value=n,this._length+=o-this._cache[t].length,this._cache[t].length=o,this.get(t),this._length>this._max&&l(this),!0);var s=new h(t,n,this._mru++,o,a,r);return s.length>this._max?(this._dispose&&this._dispose(t,n),!1):(this._length+=s.length,this._lruList[s.lu]=this._cache[t]=s,this._itemCount++,this._length>this._max&&l(this),!0)},a.prototype.has=function(t){return i(t),!!e(this._cache,t)&&!s(this,this._cache[t])},a.prototype.get=function(e){return i(e),o(this,e,!0)},a.prototype.peek=function(e){return i(e),o(this,e,!1)},a.prototype.pop=function(){var e=this._lruList[this._lru];return c(this,e),e||null},a.prototype.del=function(e){i(e),c(this,this._cache[e])},a.prototype.load=function(e){this.reset();for(var t,n=Date.now(),r=e.length-1;0<=r;r--){i((t=e[r]).k);var a=t.e||0;if(0===a)this.set(t.k,t.v);else{var o=a-n;0<o&&this.set(t.k,t.v,o)}}}}()},{}],14:[function(e,t){function n(e){var t=new i;return(t.write(e)+t.end()).replace(/\0/g,"").trim()}e("text-encoding-polyfill");var i=e("string_decoder").StringDecoder;t.exports=function e(t,i){if(!t)return n;try{new TextDecoder(t.trim())}catch(o){var a=r.exec(t);return a&&!i?e("windows-"+a[1],!0):n}return function(e){var n=new TextDecoder(t);return(n.decode(e,{stream:!0})+n.decode()).replace(/\0/g,"").trim()}};var r=/^(?:ANSI\s)?(\d+)$/m},{string_decoder:19,"text-encoding-polyfill":20}],15:[function(e,t){function n(e,t,n){for(var i=[],r=32;r<t&&(i.push({name:n(e.slice(r,r+11)),dataType:s(e.readUInt8(r+11)),len:e.readUInt8(r+16),decimal:e.readUInt8(r+17)}),13!==e.readUInt8(r+32));)r+=32;return i}function i(e,t,n,i,r){var a=r(e.slice(t,t+n));return"N"===i||"F"===i||"O"===i?parseFloat(a,10):"D"===i?new Date(a.slice(0,4),parseInt(a.slice(4,6),10)-1,a.slice(6,8)):"L"===i?"y"===a.toLowerCase()||"t"===a.toLowerCase():a}function r(e,t,n,r){for(var a,o,s={},l=0,A=n.length;l<A;)a=i(e,t,(o=n[l]).len,o.dataType,r),t+=o.len,void 0!==a&&(s[o.name]=a),l++;return s}var a=e("./decoder");t.exports=function(e,t){for(var i=a(t),o=function(e){return{lastUpdated:new Date(e.readUInt8(1)+1900,e.readUInt8(2),e.readUInt8(3)),records:e.readUInt32LE(4),headerLen:e.readUInt16LE(8),recLen:e.readUInt16LE(10)}}(e),s=n(e,o.headerLen-1,i),l=2+(s.length+1<<5),A=o.recLen,c=o.records,h=[];c;)h.push(r(e,l,s,i)),l+=A,c--;return h}},{"./decoder":14}],16:[function(e,t){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function r(e){if(A===setTimeout)return setTimeout(e,0);if((A===n||!A)&&setTimeout)return A=setTimeout,setTimeout(e,0);try{return A(e,0)}catch(t){try{return A.call(null,e,0)}catch(t){return A.call(this,e,0)}}}function a(){f&&u&&(f=!1,u.length?d=u.concat(d):p=-1,d.length&&o())}function o(){if(!f){var e=r(a);f=!0;for(var t=d.length;t;){for(u=d,d=[];++p<t;)u&&u[p].run();p=-1,t=d.length}u=null,f=!1,function(e){if(c===clearTimeout)return clearTimeout(e);if((c===i||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(e);try{c(e)}catch(t){try{return c.call(null,e)}catch(t){return c.call(this,e)}}}(e)}}function s(e,t){this.fun=e,this.array=t}function l(){}var A,c,h=t.exports={};!function(){try{A="function"==typeof setTimeout?setTimeout:n}catch(e){A=n}try{c="function"==typeof clearTimeout?clearTimeout:i}catch(e){c=i}}();var u,d=[],f=!1,p=-1;h.nextTick=function(e){var t=Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];d.push(new s(e,t)),1!==d.length||f||r(o)},s.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=l,h.addListener=l,h.once=l,h.off=l,h.removeListener=l,h.removeAllListeners=l,h.emit=l,h.prependListener=l,h.prependOnceListener=l,h.listeners=function(){return[]},h.binding=function(){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},{}],17:[function(i,o,A){!function(e,t){"object"==r(A)&&void 0!==o?o.exports=t():e.proj4=t()}(this,(function(){var i=Math.asin,o=Math.acos,A=Number.NaN,c=Math.atan2,h=Math.round,u=Math.PI,d=Math.atan,f=Math.exp,p=Math.tan,m=Math.sin,v=Math.cos,g=Math.sqrt;function y(e,t){if(e[t])return e[t];for(var n,i=Object.keys(e),r=t.toLowerCase().replace(be,""),a=-1;++a<i.length;)if((n=i[a]).toLowerCase().replace(be,"")===r)return e[n]}function w(e){if("string"!=typeof e)throw new Error("not a string");this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=1}function x(e,t,n){Array.isArray(t)&&(n.unshift(t),t=null);var i=t?{}:e,r=n.reduce((function(e,t){return b(t,e),e}),i);t&&(e[t]=r)}function b(e,t){if(Array.isArray(e)){var n=e.shift();if("PARAMETER"===n&&(n=e.shift()),1===e.length)return Array.isArray(e[0])?(t[n]={},void b(e[0],t[n])):void(t[n]=e[0]);if(e.length)if("TOWGS84"!==n){if("AXIS"===n)return n in t||(t[n]=[]),void t[n].push(e);var i;switch(Array.isArray(n)||(t[n]={}),n){case"UNIT":case"PRIMEM":case"VERT_DATUM":return t[n]={name:e[0].toLowerCase(),convert:e[1]},void(3===e.length&&b(e[2],t[n]));case"SPHEROID":case"ELLIPSOID":return t[n]={name:e[0],a:e[1],rf:e[2]},void(4===e.length&&b(e[3],t[n]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return e[0]=["name",e[0]],void x(t,n,e);default:for(i=-1;++i<e.length;)if(!Array.isArray(e[i]))return b(e,t[n]);return x(t,n,e)}}else t[n]=e;else t[n]=!0}else t[e]=!0}function M(e){return e*Ee}function C(e){var t=this;if(2===arguments.length){var n=arguments[1];C[e]="string"==typeof n?"+"===n.charAt(0)?Me(arguments[1]):Se(arguments[1]):n}else if(1===arguments.length){if(Array.isArray(e))return e.map((function(e){Array.isArray(e)?C.apply(t,e):C(e)}));if("string"!=typeof e)"EPSG"in e?C["EPSG:"+e.EPSG]=e:"ESRI"in e?C["ESRI:"+e.ESRI]=e:"IAU2000"in e?C["IAU2000:"+e.IAU2000]=e:console.log(e);else if(e in C)return C[e]}}function B(e){if(!function(e){return"string"==typeof e}(e))return e;if(function(e){return e in C}(e))return C[e];if(function(e){return Te.some((function(t){return-1<e.indexOf(t)}))}(e)){var t=Se(e);if(function(e){var t=y(e,"authority");if(t){var n=y(t,"epsg");return n&&-1<_e.indexOf(n)}}(t))return C["EPSG:3857"];var n=function(e){var t=y(e,"extension");return t?y(t,"proj4"):void 0}(t);return n?Me(n):t}return function(e){return"+"===e[0]}(e)?Me(e):void 0}function E(e){return e}function S(e,t){var n=Oe.length;return e.names?(Oe[n]=e,e.names.forEach((function(e){Re[e.toLowerCase()]=n})),this):(console.log(t),!0)}function T(e,t,i,r,a){if(!e){var o=y(Ne,r);o||(o=ze),e=o.a,t=o.b,i=o.rf}return i&&!t&&(t=(1-1/i)*e),(0===i||n(e-t)<fe)&&(a=!0,t=e),{a:e,b:t,rf:i,sphere:a}}function _(e){if(0===e.length)return null;var t="@"===e[0];return t&&(e=e.slice(1)),"null"===e?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:Ge[e]||null,isNull:!1}}function I(e){return e/3600*u/180}function L(e,t,n){return s.apply(null,new Uint8Array(e.buffer.slice(t,n)))}function F(e){return e.map((function(e){return[I(e.longitudeShift),I(e.latitudeShift)]}))}function k(e,t,n){return{name:L(e,t+8,t+16).trim(),parent:L(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,n),upperLatitude:e.getFloat64(t+88,n),lowerLongitude:e.getFloat64(t+104,n),upperLongitude:e.getFloat64(t+120,n),latitudeInterval:e.getFloat64(t+136,n),longitudeInterval:e.getFloat64(t+152,n),gridNodeCount:e.getInt32(t+168,n)}}function P(e,t,n,i){for(var r,a=t+176,o=[],s=0;s<n.gridNodeCount;s++)r={latitudeShift:e.getFloat32(a+16*s,i),longitudeShift:e.getFloat32(a+16*s+4,i),latitudeAccuracy:e.getFloat32(a+16*s+8,i),longitudeAccuracy:e.getFloat32(a+16*s+12,i)},o.push(r);return o}function U(e,t){if(!(this instanceof U))return new U(e);t=t||function(e){if(e)throw e};var n=B(e);if("object"==r(n)){var i=U.projections.get(n.projName);if(i){if(n.datumCode&&"none"!==n.datumCode){var a=y(Qe,n.datumCode);a&&(n.datum_params=n.datum_params||(a.towgs84?a.towgs84.split(","):null),n.ellps=a.ellipse,n.datumName=a.datumName?a.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||"enu",n.ellps=n.ellps||"wgs84",n.lat1=n.lat1||n.lat0;var o=T(n.a,n.b,n.rf,n.ellps,n.sphere),s=function(e,t,n,i){var r=e*e,a=t*t,o=(r-a)/r,s=0;return i?(r=(e*=1-o*(he+o*(ue+o*de)))*e,o=0):s=g(o),{es:o,e:s,ep2:(r-a)/a}}(o.a,o.b,o.rf,n.R_A),l=function(e){return void 0===e?null:e.split(",").map(_)}(n.nadgrids),A=n.datum||function(e,t,n,i,r,a,o){var s={};return s.datum_type=void 0===e||"none"===e?5:4,t&&(s.datum_params=t.map(parseFloat),(0!==s.datum_params[0]||0!==s.datum_params[1]||0!==s.datum_params[2])&&(s.datum_type=1),3<s.datum_params.length&&(0!==s.datum_params[3]||0!==s.datum_params[4]||0!==s.datum_params[5]||0!==s.datum_params[6])&&(s.datum_type=2,s.datum_params[3]*=Ae,s.datum_params[4]*=Ae,s.datum_params[5]*=Ae,s.datum_params[6]=s.datum_params[6]/1e6+1)),o&&(s.datum_type=3,s.grids=o),s.a=n,s.b=i,s.es=r,s.ep2=a,s}(n.datumCode,n.datum_params,o.a,o.b,s.es,s.ep2,l);Ie(this,n),Ie(this,i),this.a=o.a,this.b=o.b,this.rf=o.rf,this.sphere=o.sphere,this.es=s.es,this.e=s.e,this.ep2=s.ep2,this.datum=A,this.init(),t(null,this)}else t(e)}else t(e)}function D(e,t){return e.datum_type===t.datum_type&&!(e.a!==t.a||5e-11<n(e.es-t.es))&&(1===e.datum_type?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:2!==e.datum_type||e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6])}function R(e,t,n){var i,r,a,o=e.x,s=e.y,l=e.z?e.z:0;if(s<-ce&&s>-1.001*ce)s=-ce;else if(s>ce&&s<1.001*ce)s=ce;else{if(s<-ce)return{x:-1/0,y:-1/0,z:e.z};if(s>ce)return{x:1/0,y:1/0,z:e.z}}return o>u&&(o-=2*u),r=m(s),a=v(s),{x:((i=n/g(1-t*(r*r)))+l)*a*v(o),y:(i+l)*a*m(o),z:(i*(1-t)+l)*r}}function O(e,t,i,r){var a,o,s,l,A,h,u,f,p,m,v,y,w,x,b,M=1e-12,C=e.x,B=e.y,E=e.z?e.z:0;if(a=g(C*C+B*B),o=g(C*C+B*B+E*E),a/i<M){if(x=0,o/i<M)return ce,b=-r,{x:e.x,y:e.y,z:e.z}}else x=c(B,C);s=E/o,f=(l=a/o)*(1-t)*(A=1/g(1-t*(2-t)*l*l)),p=s*A,w=0;do{w++,u=i/g(1-t*p*p),y=(v=s*(A=1/g(1-(h=t*u/(u+(b=a*f+E*p-u*(1-t*p*p))))*(2-h)*l*l)))*f-(m=l*(1-h)*A)*p,f=m,p=v}while(y*y>M*M&&w<30);return{x:x,y:d(v/n(m)),z:b}}function N(e){return 1===e||2===e}function z(e,t,i){if(null===e.grids||0===e.grids.length)return console.log("Grid shift grids not found"),-1;for(var r,a={x:-i.x,y:i.y},o={x:A,y:A},s=[],l=0;l<e.grids.length;l++){if(r=e.grids[l],s.push(r.name),r.isNull){o=a;break}if(null!==r.grid){var c=r.grid.subgrids[0],h=(n(c.del[1])+n(c.del[0]))/1e4,u=c.ll[0]-h,d=c.ll[1]-h,f=c.ll[0]+(c.lim[0]-1)*c.del[0]+h,p=c.ll[1]+(c.lim[1]-1)*c.del[1]+h;if(!(d>a.y||u>a.x||p<a.y||f<a.x||(o=Q(a,t,c),isNaN(o.x))))break}else if(r.mandatory)return console.log("Unable to find mandatory grid '"+r.name+"'"),-1}return isNaN(o.x)?(console.log("Failed to find a grid shift table for location '"+-a.x*me+" "+a.y*me+" tried: '"+s+"'"),-1):(i.x=-o.x,i.y=o.y,0)}function Q(e,t,i){var r={x:A,y:A};if(isNaN(e.x))return r;var a={x:e.x,y:e.y};a.x-=i.ll[0],a.y-=i.ll[1],a.x=ke(a.x-u)+u;var o=G(a,i);if(t){if(isNaN(o.x))return r;o.x=a.x-o.x,o.y=a.y-o.y;var s,l,c=9;do{if(l=G(o,i),isNaN(l.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}s={x:a.x-(l.x+o.x),y:a.y-(l.y+o.y)},o.x+=s.x,o.y+=s.y}while(c--&&n(s.x)>1e-12&&n(s.y)>1e-12);if(0>c)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=ke(o.x+i.ll[0]),r.y=o.y+i.ll[1]}else isNaN(o.x)||(r.x=e.x+o.x,r.y=e.y+o.y);return r}function G(t,n){var i,r={x:t.x/n.del[0],y:t.y/n.del[1]},a=e(r.x),o=e(r.y),s=r.x-1*a,l=r.y-1*o,c={x:A,y:A};if(0>a||a>=n.lim[0])return c;if(0>o||o>=n.lim[1])return c;i=o*n.lim[0]+a;var h=n.cvs[i][0],u=n.cvs[i][1];i++;var d=n.cvs[i][0],f=n.cvs[i][1];i+=n.lim[0];var p=n.cvs[i][0],m=n.cvs[i][1];i--;var v=n.cvs[i][0],g=n.cvs[i][1],y=s*l,w=s*(1-l),x=(1-s)*(1-l),b=(1-s)*l;return c.x=x*h+w*d+b*v+y*p,c.y=x*u+w*f+b*g+y*m,c}function H(e){var t=Number.isFinite;if("function"==typeof t){if(t(e))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof e||e!=e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function V(e,t,n){var i;if(Array.isArray(n)&&(n=je(n)),We(n),e.datum&&t.datum&&function(e,t){return(1===e.datum.datum_type||2===e.datum.datum_type)&&"WGS84"!==t.datumCode||(1===t.datum.datum_type||2===t.datum.datum_type)&&"WGS84"!==e.datumCode}(e,t)&&(n=V(e,i=new U("WGS84"),n),e=i),"enu"!==e.axis&&(n=Ve(e,!1,n)),"longlat"===e.projName)n={x:n.x*pe,y:n.y*pe,z:n.z||0};else if(e.to_meter&&(n={x:n.x*e.to_meter,y:n.y*e.to_meter,z:n.z||0}),!(n=e.inverse(n)))return;return e.from_greenwich&&(n.x+=e.from_greenwich),(n=He(e.datum,t.datum,n))?(t.from_greenwich&&(n={x:n.x-t.from_greenwich,y:n.y,z:n.z||0}),"longlat"===t.projName?n={x:n.x*me,y:n.y*me,z:n.z||0}:(n=t.forward(n),t.to_meter&&(n={x:n.x/t.to_meter,y:n.y/t.to_meter,z:n.z||0})),"enu"===t.axis?n:Ve(t,!0,n)):void 0}function j(e,t,n){var i,r,a;return Array.isArray(n)?(i=V(e,t,n)||{x:NaN,y:NaN},2<n.length?void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.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=V(e,t,n),2===(a=Object.keys(n)).length||a.forEach((function(i){if(void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name){if("x"===i||"y"===i||"z"===i)return}else if("x"===i||"y"===i)return;r[i]=n[i]})),r)}function W(e){return e instanceof U?e:e.oProj?e.oProj:U(e)}function X(e,t,n){e=W(e);var i,r=!1;return void 0===t?(t=e,e=Xe,r=!0):(void 0!==t.x||Array.isArray(t))&&(n=t,t=e,e=Xe,r=!0),t=W(t),n?j(e,t,n):(i={forward:function(n){return j(e,t,n)},inverse:function(n){return j(t,e,n)}},r&&(i.oProj=t),i)}function Y(t,n){return n=n||5,function(e,t){var n="00000"+e.easting,i="00000"+e.northing;return e.zoneNumber+e.zoneLetter+ee(e.easting,e.northing,e.zoneNumber)+n.substr(n.length-5,t)+i.substr(i.length-5,t)}(function(t){var n,i,r,a,o,s,l=t.lat,A=t.lon,c=6378137,u=.00669438,d=.9996,f=Z(l);s=e((A+180)/6)+1,180===A&&(s=60),56<=l&&64>l&&3<=A&&12>A&&(s=32),72<=l&&84>l&&(0<=A&&9>A?s=31:9<=A&&21>A?s=33:21<=A&&33>A?s=35:33<=A&&42>A&&(s=37)),n=u/(1-u),i=c/g(1-u*m(f)*m(f)),r=p(f)*p(f),a=n*v(f)*v(f),o=c*((1-u/4-3*u*u/64-5*u*u*u/256)*f-(3*u/8+3*u*u/32+45*u*u*u/1024)*m(2*f)+(15*u*u/256+45*u*u*u/1024)*m(4*f)-35*u*u*u/3072*m(6*f));var y=d*i*(65+65*(1-r+a)*65*65/6+65*(5-18*r+r*r+72*a-58*n)*65*65*65*65/120)+5e5,w=d*(o+i*p(f)*(2112.5+65*(5-r+9*a+4*a*a)*65*65*65/24+65*(61-58*r+r*r+600*a-330*n)*65*65*65*65*65/720));return 0>l&&(w+=1e7),{northing:h(w),easting:h(y),zoneNumber:s,zoneLetter:$(l)}}({lat:t[1],lon:t[0]}),n)}function K(e){var t=q(ne(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function Z(e){return e*(u/180)}function J(e){return e/u*180}function q(e){var t=e.northing,n=e.easting,i=e.zoneLetter,r=e.zoneNumber;if(0>r||60<r)return null;var o,s,l,A,c,h,u,d,f,y=.9996,w=6378137,x=.00669438,b=(1-g(1-x))/(1+g(1-x)),M=t;"N">i&&(M-=1e7),u=6*(r-1)-180+3,o=x/(1-x),f=(d=M/y/6367449.145945056)+(3*b/2-27*b*b*b/32)*m(2*d)+(21*b*b/16-55*b*b*b*b/32)*m(4*d)+151*b*b*b/96*m(6*d),s=w/g(1-x*m(f)*m(f)),l=p(f)*p(f),A=o*v(f)*v(f),c=w*(1-x)/a(1-x*m(f)*m(f),1.5),h=(n-5e5)/(s*y);var C=f-s*p(f)/c*(h*h/2-(5+3*l+10*A-4*A*A-9*o)*h*h*h*h/24+(61+90*l+298*A+45*l*l-252*o-3*A*A)*h*h*h*h*h*h/720);C=J(C);var B,E=(h-(1+2*l+A)*h*h*h/6+(5-2*A+28*l-3*A*A+8*o+24*l*l)*h*h*h*h*h/120)/v(f);if(E=u+J(E),e.accuracy){var S=q({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});B={top:S.lat,right:S.lon,bottom:C,left:E}}else B={lat:C,lon:E};return B}function $(e){var t="Z";return 84>=e&&72<=e?t="X":72>e&&64<=e?t="W":64>e&&56<=e?t="V":56>e&&48<=e?t="U":48>e&&40<=e?t="T":40>e&&32<=e?t="S":32>e&&24<=e?t="R":24>e&&16<=e?t="Q":16>e&&8<=e?t="P":8>e&&0<=e?t="N":0>e&&-8<=e?t="M":-8>e&&-16<=e?t="L":-16>e&&-24<=e?t="K":-24>e&&-32<=e?t="J":-32>e&&-40<=e?t="H":-40>e&&-48<=e?t="G":-48>e&&-56<=e?t="F":-56>e&&-64<=e?t="E":-64>e&&-72<=e?t="D":-72>e&&-80<=e&&(t="C"),t}function ee(t,n,i){var r=te(i);return function(e,t,n){var i=n-1,r="AJSAJS".charCodeAt(i),a="AFAFAF".charCodeAt(i),o=r+e-1,l=a+t,A=!1;return 90<o&&(o=o-90+65-1,A=!0),(73===o||73>r&&73<o||(73<o||73>r)&&A)&&o++,(79===o||79>r&&79<o||(79<o||79>r)&&A)&&73==++o&&o++,90<o&&(o=o-90+65-1),86<l?(l=l-86+65-1,A=!0):A=!1,(73===l||73>a&&73<l||(73<l||73>a)&&A)&&l++,(79===l||79>a&&79<l||(79<l||79>a)&&A)&&73==++l&&l++,86<l&&(l=l-86+65-1),s(o)+s(l)}(e(t/1e5),e(n/1e5)%20,r)}function te(e){var t=e%6;return 0===t&&(t=6),t}function ne(e){if(e&&0===e.length)throw"MGRSPoint coverting from nothing";for(var t,n=e.length,i=null,r="",o=0;!/[A-Z]/.test(t=e.charAt(o));){if(2<=o)throw"MGRSPoint bad conversion from: "+e;r+=t,o++}var s=parseInt(r,10);if(0===o||o+3>n)throw"MGRSPoint bad conversion from: "+e;var l=e.charAt(o++);if("A">=l||"B"===l||"Y"===l||"Z"<=l||"I"===l||"O"===l)throw"MGRSPoint zone letter "+l+" not handled: "+e;i=e.substring(o,o+=2);for(var A=te(s),c=function(e,t){for(var n="AJSAJS".charCodeAt(t-1),i=1e5,r=!1;n!==e.charCodeAt(0);){if(73===++n&&n++,79===n&&n++,90<n){if(r)throw"Bad character: "+e;n=65,r=!0}i+=1e5}return i}(i.charAt(0),A),h=function(e,t){if("V"<e)throw"MGRSPoint given invalid Northing "+e;for(var n="AFAFAF".charCodeAt(t-1),i=0,r=!1;n!==e.charCodeAt(0);){if(73===++n&&n++,79===n&&n++,86<n){if(r)throw"Bad character: "+e;n=65,r=!0}i+=1e5}return i}(i.charAt(1),A);h<ie(l);)h+=2e6;var u=n-o;if(0!=u%2)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"+e;var d,f,p,m=u/2,v=0,g=0;return 0<m&&(d=1e5/a(10,m),f=e.substring(o,o+m),v=parseFloat(f)*d,p=e.substring(o+m),g=parseFloat(p)*d),{easting:v+c,northing:g+h,zoneLetter:l,zoneNumber:s,accuracy:d}}function ie(e){var t;if(0<=(t="C"===e?11e5:"D"===e?2e6:"E"===e?28e5:"F"===e?37e5:"G"===e?46e5:"H"===e?55e5:"J"===e?64e5:"K"===e?73e5:"L"===e?82e5:"M"===e?91e5:"N"===e?0:"P"===e?8e5:"Q"===e?17e5:"R"===e?26e5:"S"===e?35e5:"T"===e?44e5:"U"===e?53e5:"V"===e?62e5:"W"===e?7e6:"X"===e?79e5:-1))return t;throw"Invalid zone letter: "+e}function re(e,t,n){if(!(this instanceof re))return new re(e,t,n);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if("object"==r(e))this.x=e.x,this.y=e.y,this.z=e.z||0;else if("string"==typeof e&&void 0===t){var i=e.split(",");this.x=parseFloat(i[0],10),this.y=parseFloat(i[1],10),this.z=parseFloat(i[2],10)||0}else this.x=e,this.y=t,this.z=n||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}function ae(e,t,i,r){var a;return e<fe?(r.value=tn.AREA_0,a=0):(a=c(t,i),n(a)<=ve?r.value=tn.AREA_0:a>ve&&a<=ce+ve?(r.value=tn.AREA_1,a-=ce):a>ce+ve||a<=-(ce+ve)?(r.value=tn.AREA_2,a=0<=a?a-ye:a+ye):(r.value=tn.AREA_3,a+=ce)),a}function oe(e,t){var n=e+t;return n<-ye?n+=ge:n>+ye&&(n-=ge),n}var se=6378137,le=.0066943799901413165,Ae=484813681109536e-20,ce=u/2,he=.16666666666666666,ue=.04722222222222222,de=.022156084656084655,fe=1e-10,pe=.017453292519943295,me=57.29577951308232,ve=u/4,ge=2*u,ye=3.14159265359,we={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},xe={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},be=/[\s_\-\/\(\)]/g,Me=function(e){var t,n,i,r={},a=e.split("+").map((function(e){return e.trim()})).filter((function(e){return e})).reduce((function(e,t){var n=t.split("=");return n.push(!0),e[n[0].toLowerCase()]=n[1],e}),{}),o={proj:"projName",datum:"datumCode",rf:function(e){r.rf=parseFloat(e)},lat_0:function(e){r.lat0=e*pe},lat_1:function(e){r.lat1=e*pe},lat_2:function(e){r.lat2=e*pe},lat_ts:function(e){r.lat_ts=e*pe},lon_0:function(e){r.long0=e*pe},lon_1:function(e){r.long1=e*pe},lon_2:function(e){r.long2=e*pe},alpha:function(e){r.alpha=parseFloat(e)*pe},gamma:function(e){r.rectified_grid_angle=parseFloat(e)},lonc:function(e){r.longc=e*pe},x_0:function(e){r.x0=parseFloat(e)},y_0:function(e){r.y0=parseFloat(e)},k_0:function(e){r.k0=parseFloat(e)},k:function(e){r.k0=parseFloat(e)},a:function(e){r.a=parseFloat(e)},b:function(e){r.b=parseFloat(e)},r_a:function(){r.R_A=!0},zone:function(e){r.zone=parseInt(e,10)},south:function(){r.utmSouth=!0},towgs84:function(e){r.datum_params=e.split(",").map((function(e){return parseFloat(e)}))},to_meter:function(e){r.to_meter=parseFloat(e)},units:function(e){r.units=e;var t=y(xe,e);t&&(r.to_meter=t.to_meter)},from_greenwich:function(e){r.from_greenwich=e*pe},pm:function(e){var t=y(we,e);r.from_greenwich=(t||parseFloat(e))*pe},nadgrids:function(e){"@null"===e?r.datumCode="none":r.nadgrids=e},axis:function(e){3===e.length&&-1!=="ewnsud".indexOf(e.substr(0,1))&&-1!=="ewnsud".indexOf(e.substr(1,1))&&-1!=="ewnsud".indexOf(e.substr(2,1))&&(r.axis=e)},approx:function(){r.approx=!0}};for(t in a)n=a[t],t in o?"function"==typeof(i=o[t])?i(n):r[i]=n:r[t]=n;return"string"==typeof r.datumCode&&"WGS84"!==r.datumCode&&(r.datumCode=r.datumCode.toLowerCase()),r},Ce=/[,\]]/,Be=/[\d\.E\-\+]/;w.prototype.readCharicter=function(){var e=this.text[this.place++];if(4!==this.state)for(;/\s/.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case 1:return this.neutral(e);case 2:return this.keyword(e);case 4:return this.quoted(e);case 5:return this.afterquote(e);case 3:return this.number(e)}},w.prototype.afterquote=function(e){if('"'===e)return this.word+='"',void(this.state=4);if(Ce.test(e))return this.word=this.word.trim(),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in afterquote yet, index '+this.place)},w.prototype.afterItem=function(e){return","===e?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===e?(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},w.prototype.number=function(e){if(!Be.test(e)){if(Ce.test(e))return this.word=parseFloat(this.word),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in number yet, index '+this.place)}this.word+=e},w.prototype.quoted=function(e){return'"'===e?void(this.state=5):void(this.word+=e)},w.prototype.keyword=function(e){if(/[A-Za-z84]/.test(e))this.word+=e;else{if("["===e){var t=[];return t.push(this.word),this.level++,null===this.root?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,void(this.state=1)}if(!Ce.test(e))throw new Error("havn't handled \""+e+'" in keyword yet, index '+this.place);this.afterItem(e)}},w.prototype.neutral=function(e){if(/[A-Za-z]/.test(e))return this.word=e,void(this.state=2);if('"'===e)return this.word="",void(this.state=4);if(Be.test(e))return this.word=e,void(this.state=3);if(!Ce.test(e))throw new Error("havn't handled \""+e+'" in neutral yet, index '+this.place);this.afterItem(e)},w.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};var Ee=.017453292519943295,Se=function(e){var t=function(e){return new w(e).output()}(e),n=t.shift(),i=t.shift();t.unshift(["name",i]),t.unshift(["type",n]);var a={};return b(t,a),function(e){function t(t){return t*(e.to_meter||1)}if("GEOGCS"===e.type?e.projName="longlat":"LOCAL_CS"===e.type?(e.projName="identity",e.local=!0):"object"==r(e.PROJECTION)?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var n,i="",a=0,o=e.AXIS.length;a<o;++a)-1!==(n=[e.AXIS[a][0].toLowerCase(),e.AXIS[a][1].toLowerCase()])[0].indexOf("north")||("y"===n[0]||"lat"===n[0])&&"north"===n[1]?i+="n":-1!==n[0].indexOf("south")||("y"===n[0]||"lat"===n[0])&&"south"===n[1]?i+="s":-1!==n[0].indexOf("east")||("x"===n[0]||"lon"===n[0])&&"east"===n[1]?i+="e":(-1!==n[0].indexOf("west")||("x"===n[0]||"lon"===n[0])&&"west"===n[1])&&(i+="w");2===i.length&&(i+="u"),3===i.length&&(e.axis=i)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),"metre"===e.units&&(e.units="meter"),e.UNIT.convert&&("GEOGCS"===e.type?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var s=e.GEOGCS;"GEOGCS"===e.type&&(s=e),s&&(e.datumCode=s.DATUM?s.DATUM.name.toLowerCase():s.name.toLowerCase(),"d_"===e.datumCode.slice(0,2)&&(e.datumCode=e.datumCode.slice(2)),("new_zealand_geodetic_datum_1949"===e.datumCode||"new_zealand_1949"===e.datumCode)&&(e.datumCode="nzgd49"),("wgs_1984"===e.datumCode||"world_geodetic_system_1984"===e.datumCode)&&("Mercator_Auxiliary_Sphere"===e.PROJECTION&&(e.sphere=!0),e.datumCode="wgs84"),"_ferro"===e.datumCode.slice(-6)&&(e.datumCode=e.datumCode.slice(0,-6)),"_jakarta"===e.datumCode.slice(-8)&&(e.datumCode=e.datumCode.slice(0,-8)),~e.datumCode.indexOf("belge")&&(e.datumCode="rnb72"),s.DATUM&&s.DATUM.SPHEROID&&(e.ellps=s.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===e.ellps.toLowerCase().slice(0,13)&&(e.ellps="intl"),e.a=s.DATUM.SPHEROID.a,e.rf=parseFloat(s.DATUM.SPHEROID.rf,10)),s.DATUM&&s.DATUM.TOWGS84&&(e.datum_params=s.DATUM.TOWGS84),~e.datumCode.indexOf("osgb_1936")&&(e.datumCode="osgb36"),~e.datumCode.indexOf("osni_1952")&&(e.datumCode="osni52"),(~e.datumCode.indexOf("tm65")||~e.datumCode.indexOf("geodetic_datum_of_1965"))&&(e.datumCode="ire65"),"ch1903+"===e.datumCode&&(e.datumCode="ch1903"),~e.datumCode.indexOf("israel")&&(e.datumCode="isr93")),e.b&&!isFinite(e.b)&&(e.b=e.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",M],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",M],["x0","false_easting",t],["y0","false_northing",t],["long0","central_meridian",M],["lat0","latitude_of_origin",M],["lat0","standard_parallel_1",M],["lat1","standard_parallel_1",M],["lat2","standard_parallel_2",M],["azimuth","Azimuth"],["alpha","azimuth",M],["srsCode","name"]].forEach((function(t){return function(e,t){var n=t[0],i=t[1];!(n in e)&&i in e&&(e[n]=e[i],3===t.length&&(e[n]=t[2](e[n])))}(e,t)})),!e.long0&&e.longc&&("Albers_Conic_Equal_Area"===e.projName||"Lambert_Azimuthal_Equal_Area"===e.projName)&&(e.long0=e.longc),!e.lat_ts&&e.lat1&&("Stereographic_South_Pole"===e.projName||"Polar Stereographic (variant B)"===e.projName)&&(e.lat0=M(0<e.lat1?90:-90),e.lat_ts=e.lat1)}(a),a};!function(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("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"),e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]}(C);var Te=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],_e=["3857","900913","3785","102113"],Ie=function(e,t){var n,i;if(e=e||{},!t)return e;for(i in t)void 0!==(n=t[i])&&(e[i]=n);return e},Le=function(e,t,n){var i=e*t;return n/g(1-i*i)},Fe=function(e){return 0>e?-1:1},ke=function(e){return n(e)<=ye?e:e-Fe(e)*ge},Pe=function(e,t,n){var i=e*n;return i=a((1-i)/(1+i),.5*e),p(.5*(ce-t))/i},Ue=function(e,t){for(var i,r,o=ce-2*d(t),s=0;15>=s;s++)if(i=e*m(o),o+=r=ce-2*d(t*a((1-i)/(1+i),.5*e))-o,1e-10>=n(r))return o;return-9999},De=[{init:function(){var e=this.b/this.a;this.es=1-e*e,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=g(this.es),this.lat_ts?this.sphere?this.k0=v(this.lat_ts):this.k0=Le(this.e,m(this.lat_ts),v(this.lat_ts)):!this.k0&&(this.k?this.k0=this.k:this.k0=1)},forward:function(e){var i,r,a=e.x,o=e.y;if(90<o*me&&-90>o*me&&180<a*me&&-180>a*me)return null;if(n(n(o)-ce)<=fe)return null;if(this.sphere)i=this.x0+this.a*this.k0*ke(a-this.long0),r=this.y0+this.a*this.k0*t(p(ve+.5*o));else{var s=m(o),l=Pe(this.e,o,s);i=this.x0+this.a*this.k0*ke(a-this.long0),r=this.y0-this.a*this.k0*t(l)}return e.x=i,e.y=r,e},inverse:function(e){var t,n,i=e.x-this.x0,r=e.y-this.y0;if(this.sphere)n=ce-2*d(f(-r/(this.a*this.k0)));else{var a=f(-r/(this.a*this.k0));if(-9999===(n=Ue(this.e,a)))return null}return t=ke(this.long0+i/(this.a*this.k0)),e.x=t,e.y=n,e},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:E,inverse:E,names:["longlat","identity"]}],Re={},Oe=[],Ne={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"}},ze=Ne.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Ne.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Qe={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},Ge={};U.projections={start:function(){De.forEach(S)},add:S,get:function(e){if(!e)return!1;var t=e.toLowerCase();return void 0!==Re[t]&&Oe[Re[t]]?Oe[Re[t]]:void 0}},U.projections.start();var He=function(e,t,n){if(D(e,t))return n;if(5===e.datum_type||5===t.datum_type)return n;var i=e.a,r=e.es;if(3===e.datum_type){if(0!==z(e,!1,n))return;i=se,r=le}var a=t.a,o=t.b,s=t.es;if(3===t.datum_type&&(a=se,o=6356752.314,s=le),r===s&&i===a&&!N(e.datum_type)&&!N(t.datum_type))return n;if((n=R(n,r,i),N(e.datum_type)&&(n=function(e,t,n){if(1===t)return{x:e.x+n[0],y:e.y+n[1],z:e.z+n[2]};if(2===t){var i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],l=n[5],A=n[6];return{x:A*(e.x-l*e.y+s*e.z)+i,y:A*(l*e.x+e.y-o*e.z)+r,z:A*(-s*e.x+o*e.y+e.z)+a}}}(n,e.datum_type,e.datum_params)),N(t.datum_type)&&(n=function(e,t,n){if(1===t)return{x:e.x-n[0],y:e.y-n[1],z:e.z-n[2]};if(2===t){var i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],l=n[5],A=n[6],c=(e.x-i)/A,h=(e.y-r)/A,u=(e.z-a)/A;return{x:c+l*h-s*u,y:-l*c+h+o*u,z:s*c-o*h+u}}}(n,t.datum_type,t.datum_params)),n=O(n,s,a,o),3===t.datum_type)&&0!==z(t,!0,n))return;return n},Ve=function(e,t,n){var i,r,a,o=n.x,s=n.y,l=n.z||0,A={};for(a=0;3>a;a++)if(!t||2!==a||void 0!==n.z)switch(0===a?(i=o,r=-1==="ew".indexOf(e.axis[a])?"y":"x"):1===a?(i=s,r=-1==="ns".indexOf(e.axis[a])?"x":"y"):(i=l,r="z"),e.axis[a]){case"e":case"n":A[r]=i;break;case"w":case"s":A[r]=-i;break;case"u":void 0!==n[r]&&(A.z=i);break;case"d":void 0!==n[r]&&(A.z=-i);break;default:return null}return A},je=function(e){var t={x:e[0],y:e[1]};return 2<e.length&&(t.z=e[2]),3<e.length&&(t.m=e[3]),t},We=function(e){H(e.x),H(e.y)},Xe=U("WGS84");re.fromMGRS=function(e){return new re(K(e))},re.prototype.toMGRS=function(e){return Y([this.x,this.y],e)};var Ye=.046875,Ke=.01953125,Ze=.01068115234375,Je=function(e){var t=[];t[0]=1-e*(.25+e*(Ye+e*(Ke+e*Ze))),t[1]=e*(.75-e*(Ye+e*(Ke+e*Ze)));var n=e*e;return t[2]=n*(.46875-e*(.013020833333333334+.007120768229166667*e)),n*=e,t[3]=n*(.3645833333333333-.005696614583333333*e),t[4]=n*e*.3076171875,t},qe=function(e,t,n,i){return n*=t,t*=t,i[0]*e-n*(i[1]+t*(i[2]+t*(i[3]+t*i[4])))},$e=function(e,t,i){for(var r=e,a=20;a;--a){var o=m(r),s=1-t*o*o;if(r-=s=(qe(r,o,v(r),i)-e)*(s*g(s))*(1/(1-t)),n(s)<fe)return r}return r},et={init:function(){this.x0=void 0===this.x0?0:this.x0,this.y0=void 0===this.y0?0:this.y0,this.long0=void 0===this.long0?0:this.long0,this.lat0=void 0===this.lat0?0:this.lat0,this.es&&(this.en=Je(this.es),this.ml0=qe(this.lat0,m(this.lat0),v(this.lat0),this.en))},forward:function(e){var i,r,s,l=e.x,A=e.y,c=ke(l-this.long0),h=m(A),u=v(A);if(this.es){var d=u*c,f=a(d,2),y=this.ep2*a(u,2),w=a(y,2),x=n(u)>fe?p(A):0,b=a(x,2),M=a(b,2);i=1-this.es*a(h,2),d/=g(i);var C=qe(A,h,u,this.en);r=this.a*(this.k0*d*(1+f/6*(1-b+y+f/20*(5-18*b+M+14*y-58*b*y+f/42*(61+179*M-M*b-479*b)))))+this.x0,s=this.a*(this.k0*(C-this.ml0+h*c*d/2*(1+f/12*(5-b+9*y+4*w+f/30*(61+M-58*b+270*y-330*b*y+f/56*(1385+543*M-M*b-3111*b))))))+this.y0}else{var B=u*m(c);if(n(n(B)-1)<fe)return 93;if(r=.5*this.a*this.k0*t((1+B)/(1-B))+this.x0,s=u*v(c)/g(1-a(B,2)),1<=(B=n(s))){if(B-1>fe)return 93;s=0}else s=o(s);0>A&&(s=-s),s=this.a*this.k0*(s-this.lat0)+this.y0}return e.x=r,e.y=s,e},inverse:function(e){var t,r,o,s,l=(e.x-this.x0)*(1/this.a),A=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+A/this.k0,r=$e(t,this.es,this.en),n(r)<ce){var h=m(r),u=v(r),d=n(u)>fe?p(r):0,y=this.ep2*a(u,2),w=a(y,2),x=a(d,2),b=a(x,2);t=1-this.es*a(h,2);var M=l*g(t)/this.k0,C=a(M,2);o=r-(t*=d)*C/(1-this.es)*.5*(1-C/12*(5+3*x-9*y*x+y-4*w-C/30*(61+90*x-252*y*x+45*b+46*y-C/56*(1385+3633*x+4095*b+1574*b*x)))),s=ke(this.long0+M*(1-C/6*(1+2*x+y-C/20*(5+28*x+24*b+8*y*x+6*y-C/42*(61+662*x+1320*b+720*b*x))))/u)}else o=ce*Fe(A),s=0;else{var B=f(l/this.k0),E=.5*(B-1/B),S=this.lat0+A/this.k0,T=v(S);t=g((1-a(T,2))/(1+a(E,2))),o=i(t),0>A&&(o=-o),s=0===E&&0===T?0:ke(c(E,T)+this.long0)}return e.x=s,e.y=o,e},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]},tt=function(e){var t=f(e);return t=(t-1/t)/2},nt=function(e,t){var i=(0,Math.max)(e=n(e),t=n(t)),r=l(e,t)/(i||1);return i*g(1+a(r,2))},it=function(e){var i=n(e);return i=function(e){var n=1+e,i=n-1;return 0===i?e:e*t(n)/i}(i*(1+i/(nt(1,i)+1))),0>e?-i:i},rt=function(e,t){for(var n,i=2*v(2*t),r=e.length-1,a=e[r],o=0;0<=--r;)n=i*a-o+e[r],o=a,a=n;return t+n*m(2*t)},at=function(e){var t=f(e);return t=(t+1/t)/2},ot=function(e,t,n){for(var i,r,a=m(t),o=v(t),s=tt(n),l=at(n),A=2*o*l,c=-2*a*s,h=e.length-1,u=e[h],d=0,f=0,p=0;0<=--h;)i=f,r=d,u=A*(f=u)-i-c*(d=p)+e[h],p=c*f-r+A*d;return[(A=a*l)*u-(c=o*s)*p,A*p+c*u]},st={init:function(){if(!this.approx&&(isNaN(this.es)||0>=this.es))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&&(et.init.apply(this),this.forward=et.forward,this.inverse=et.inverse),this.x0=void 0===this.x0?0:this.x0,this.y0=void 0===this.y0?0:this.y0,this.long0=void 0===this.long0?0:this.long0,this.lat0=void 0===this.lat0?0:this.lat0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+g(1-this.es)),t=e/(2-e),n=t;this.cgb[0]=t*(2+t*(-2/3+t*(t*(116/45+t*(26/45+t*(-2854/675)))-2))),this.cbg[0]=t*(t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))-2),n*=t,this.cgb[1]=n*(7/3+t*(t*(-227/45+t*(2704/315+t*(2323/945)))-1.6)),this.cbg[1]=n*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),n*=t,this.cgb[2]=n*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=n*(-26/15+t*(34/21+t*(1.6+t*(-12686/2835)))),n*=t,this.cgb[3]=n*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=n*(1237/630+t*(t*(-24832/14175)-2.4)),n*=t,this.cgb[4]=n*(4174/315+t*(-144838/6237)),this.cbg[4]=n*(-734/315+t*(109598/31185)),n*=t,this.cgb[5]=n*(601676/22275),this.cbg[5]=n*(444337/155925),n=a(t,2),this.Qn=this.k0/(1+t)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=t*(t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))-.5),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=n*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=n*(13/48+t*(t*(557/1440+t*(281/630+t*(-1983433/1935360)))-.6)),n*=t,this.utg[2]=n*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=n*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),n*=t,this.utg[3]=n*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=n*(49561/161280+t*(-179/168+t*(6601661/7257600))),n*=t,this.utg[4]=n*(-4583/161280+t*(108847/3991680)),this.gtu[4]=n*(34729/80640+t*(-3418889/1995840)),n*=t,this.utg[5]=n*(-20648693/638668800),this.gtu[5]=.6650675310896665*n;var i=rt(this.cbg,this.lat0);this.Zb=-this.Qn*(i+function(e,t){for(var n,i=2*v(t),r=e.length-1,a=e[r],o=0;0<=--r;)n=i*a-o+e[r],o=a,a=n;return m(t)*n}(this.gtu,2*i))},forward:function(e){var t=ke(e.x-this.long0),i=e.y;i=rt(this.cbg,i);var r=m(i),a=v(i),o=m(t),s=v(t);i=c(r,s*a),t=c(o*a,nt(r,a*s)),t=it(p(t));var l,A,h=ot(this.gtu,2*i,2*t);return i+=h[0],t+=h[1],2.623395162778>=n(t)?(l=this.a*(this.Qn*t)+this.x0,A=this.a*(this.Qn*i+this.Zb)+this.y0):(l=1/0,A=1/0),e.x=l,e.y=A,e},inverse:function(e){var t,i,r=(e.x-this.x0)*(1/this.a),a=(e.y-this.y0)*(1/this.a);if(a=(a-this.Zb)/this.Qn,r/=this.Qn,2.623395162778>=n(r)){var o=ot(this.utg,2*a,2*r);a+=o[0],r+=o[1],r=d(tt(r));var s=m(a),l=v(a),A=m(r),h=v(r);a=c(s*h,nt(A,h*l)),r=c(A,h*l),t=ke(r+this.long0),i=rt(this.cgb,a)}else t=1/0,i=1/0;return e.x=t,e.y=i,e},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"]},lt={init:function(){var t=function(t,n){if(void 0===t){if(0>(t=e(30*(ke(n)+u)/u)+1))return 0;if(60<t)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*n(t)-183)*pe,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,st.init.apply(this),this.forward=st.forward,this.inverse=st.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},At=function(e,t){return a((1-e)/(1+e),t)},ct={init:function(){var e=m(this.lat0),t=v(this.lat0);t*=t,this.rc=g(1-this.es)/(1-this.es*e*e),this.C=g(1+this.es*t*t/(1-this.es)),this.phic0=i(e/this.C),this.ratexp=.5*this.C*this.e,this.K=p(.5*this.phic0+ve)/(a(p(.5*this.lat0+ve),this.C)*At(this.e*e,this.ratexp))},forward:function(e){var t=e.x,n=e.y;return e.y=2*d(this.K*a(p(.5*n+ve),this.C)*At(this.e*m(n),this.ratexp))-ce,e.x=this.C*t,e},inverse:function(e){for(var t=e.x/this.C,i=e.y,r=a(p(.5*i+ve)/this.K,1/this.C),o=20;0<o&&(i=2*d(r*At(this.e*m(e.y),-.5*this.e))-ce,!(n(i-e.y)<1e-14));--o)e.y=i;return o?(e.x=t,e.y=i,e):null},names:["gauss"]},ht={init:function(){ct.init.apply(this),this.rc&&(this.sinc0=m(this.phic0),this.cosc0=v(this.phic0),this.R2=2*this.rc,!this.title&&(this.title="Oblique Stereographic Alternative"))},forward:function(e){var t,n,i,r;return e.x=ke(e.x-this.long0),ct.forward.apply(this,[e]),t=m(e.y),n=v(e.y),i=v(e.x),r=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*n*i),e.x=r*n*m(e.x),e.y=r*(this.cosc0*t-this.sinc0*n*i),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e},inverse:function(e){var t,n,r,a,o;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,o=g(e.x*e.x+e.y*e.y)){var s=2*c(o,this.R2);t=m(s),n=v(s),a=i(n*this.sinc0+e.y*t*this.cosc0/o),r=c(e.x*t,o*this.cosc0*n-e.y*this.sinc0*t)}else a=this.phic0,r=0;return e.x=r,e.y=a,ct.inverse.apply(this,[e]),e.x=ke(e.x+this.long0),e},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},ut={init:function(){this.coslat0=v(this.lat0),this.sinlat0=m(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&n(this.coslat0)<=fe&&(this.k0=.5*(1+Fe(this.lat0)*m(this.lat_ts))):(n(this.coslat0)<=fe&&(0<this.lat0?this.con=1:this.con=-1),this.cons=g(a(1+this.e,1+this.e)*a(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&n(this.coslat0)<=fe&&(this.k0=.5*this.cons*Le(this.e,m(this.lat_ts),v(this.lat_ts))/Pe(this.e,this.con*this.lat_ts,this.con*m(this.lat_ts))),this.ms1=Le(this.e,this.sinlat0,this.coslat0),this.X0=2*d(this.ssfn_(this.lat0,this.sinlat0,this.e))-ce,this.cosX0=v(this.X0),this.sinX0=m(this.X0))},forward:function(e){var t,i,r,a,o,s=e.x,l=e.y,A=m(l),c=v(l),h=ke(s-this.long0);return n(n(s-this.long0)-u)<=fe&&n(l+this.lat0)<=fe?(e.x=NaN,e.y=NaN,e):this.sphere?(this.k0,this.sinlat0,this.coslat0,v(h),e.x=65*this.a*c*m(h)+this.x0,e.y=65*this.a*(this.coslat0*A-this.sinlat0*c*v(h))+this.y0,e):(t=2*d(this.ssfn_(l,A,this.e))-ce,r=v(t),i=m(t),n(this.coslat0)<=fe?(a=Pe(this.e,l*this.con,this.con*A),o=2*this.a*this.k0*a/this.cons,e.x=this.x0+o*m(s-this.long0),e.y=this.y0-this.con*o*v(s-this.long0),e):(n(this.sinlat0)<fe?(this.a,this.k0,v(h),e.y=65*i):(this.a,this.k0,this.ms1,this.cosX0,this.sinX0,this.cosX0,v(h),e.y=65*(this.cosX0*i-this.sinX0*r*v(h))+this.y0),e.x=65*r*m(h)+this.x0,e))},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,r,a,o,s,l=g(e.x*e.x+e.y*e.y);if(this.sphere){var A=2*d(l/(2*this.a*this.k0));return t=this.long0,r=this.lat0,l<=fe?(e.x=t,e.y=r,e):(r=i(v(A)*this.sinlat0+e.y*m(A)*this.coslat0/l),t=n(this.coslat0)<fe?0<this.lat0?ke(this.long0+c(e.x,-1*e.y)):ke(this.long0+c(e.x,e.y)):ke(this.long0+c(e.x*m(A),l*this.coslat0*v(A)-e.y*this.sinlat0*m(A))),e.x=t,e.y=r,e)}if(n(this.coslat0)<=fe){if(l<=fe)return r=this.lat0,t=this.long0,e.x=t,e.y=r,e;e.x*=this.con,e.y*=this.con,a=l*this.cons/(2*this.a*this.k0),r=this.con*Ue(this.e,a),t=this.con*ke(this.con*this.long0+c(e.x,-1*e.y))}else o=2*d(l*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,l<=fe?s=this.X0:(s=i(v(o)*this.sinX0+e.y*m(o)*this.cosX0/l),t=ke(this.long0+c(e.x*m(o),l*this.cosX0*v(o)-e.y*this.sinX0*m(o)))),r=-1*Ue(this.e,p(.5*(ce+s)));return e.x=t,e.y=r,e},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(e,t,n){return t*=n,p(.5*(ce+e))*a((1-t)/(1+t),.5*n)}},dt={init:function(){var e=this.lat0;this.lambda0=this.long0;var n=m(e),r=this.a,o=1/this.rf,s=2*o-a(o,2),l=this.e=g(s);this.R=this.k0*r*g(1-s)/(1-s*a(n,2)),this.alpha=g(1+s/(1-s)*a(v(e),4)),this.b0=i(n/this.alpha);var A=t(p(u/4+this.b0/2)),c=t(p(u/4+e/2)),h=t((1+l*n)/(1-l*n));this.K=A-this.alpha*c+this.alpha*l/2*h},forward:function(e){var n=t(p(u/4-e.y/2)),r=this.e/2*t((1+this.e*m(e.y))/(1-this.e*m(e.y))),a=-this.alpha*(n+r)+this.K,o=2*(d(f(a))-u/4);this.alpha,e.x,this.lambda0;var s=d(m(73)/(m(this.b0)*p(o)+v(this.b0)*v(73))),l=i(v(this.b0)*m(o)-m(this.b0)*v(o)*v(73));return e.y=this.R/2*t((1+m(l))/(1-m(l)))+this.y0,e.x=this.R*s+this.x0,e},inverse:function(e){for(var r=e.x-this.x0,a=e.y-this.y0,o=r/this.R,s=2*(d(f(a/this.R))-u/4),l=i(v(this.b0)*m(s)+m(this.b0)*v(s)*v(o)),A=(d(m(o)/(v(this.b0)*v(o)-m(this.b0)*p(s))),this.lambda0+73/this.alpha),c=0,h=l,g=-1e3,y=0;1e-7<n(h-g);){if(20<++y)return;c=1/this.alpha*(t(p(u/4+l/2))-this.K)+this.e*t(p(u/4+i(this.e*m(h))/2)),g=h,h=2*d(f(c))-u/2}return e.x=A,e.y=h,e},names:["somerc"]},ft=1e-7,pt={init:function(){var e,o,s,l,A,c,h,u,f,y,w,x=Math.pi,b=0,M=0,C=0,B=0,E=0,S=0,T=0;this.no_off=function(e){var t="object"==r(e.PROJECTION)?Object.keys(e.PROJECTION)[0]:e.PROJECTION;return"no_uoff"in e||"no_off"in e||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(t)}(this),this.no_rot="no_rot"in this;var _=!1;"alpha"in this&&(_=!0);var I=!1;if("rectified_grid_angle"in this&&(I=!0),_&&(T=this.alpha),I&&(b=this.rectified_grid_angle*pe),_||I)M=this.longc;else if(C=this.long1,E=this.lat1,B=this.long2,S=this.lat2,n(E-S)<=ft||(e=n(E))<=ft||n(e-ce)<=ft||n(n(this.lat0)-ce)<=ft||n(n(S)-ce)<=ft)throw new Error;var L=1-this.es;o=g(L),n(this.lat0)>fe?(u=m(this.lat0),s=v(this.lat0),e=1-this.es*u*u,this.B=s*s,this.B=g(1+this.es*this.B*this.B/L),this.A=this.B*this.k0*o/e,0>=(A=(l=this.B*o/(s*g(e)))*l-1)?A=0:(A=g(A),0>this.lat0&&(A=-A)),this.E=A+=l,this.E*=a(Pe(this.e,this.lat0,u),this.B)):(this.B=1/o,this.A=this.k0,this.E=l=A=1),_||I?(_?(w=i(m(T)/l),!I&&(b=T)):T=i(l*m(w=b)),this.lam0=M-i(.5*(A-1/A)*p(w))/this.B):(c=a(Pe(this.e,E,m(E)),this.B),h=a(Pe(this.e,S,m(S)),this.B),A=this.E/c,f=(h-c)/(h+c),y=((y=this.E*this.E)-h*c)/(y+h*c),(e=C-B)<-x?B-=ge:e>x&&(B+=ge),this.lam0=ke(.5*(C+B)-d(y*p(.5*this.B*(C-B))/f)/this.B),w=d(2*m(this.B*ke(C-this.lam0))/(A-1/A)),b=T=i(l*m(w))),this.singam=m(w),this.cosgam=v(w),this.sinrot=m(b),this.cosrot=v(b),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=n(this.ArB*d(g(l*l-1)/v(T))),0>this.lat0&&(this.u_0=-this.u_0)),A=.5*w,this.v_pole_n=this.ArB*t(p(ve-A)),this.v_pole_s=this.ArB*t(p(ve+A))},forward:function(e){var i,r,o,s,l,A,h,u={};if(e.x-=this.lam0,n(n(e.y)-ce)>fe){if(i=.5*((s=this.E/a(Pe(this.e,e.y,m(e.y)),this.B))-(l=1/s)),r=.5*(s+l),m(this.B*e.x),o=(i*this.singam-86*this.cosgam)/r,n(n(o)-1)<fe)throw new Error;h=.5*this.ArB*t((1-o)/(1+o)),l=v(this.B*e.x),A=n(l)<ft?this.A*e.x:this.ArB*c(i*this.cosgam+86*this.singam,l)}else h=0<e.y?this.v_pole_n:this.v_pole_s,A=this.ArB*e.y;return this.no_rot?(u.x=A,u.y=h):(A-=this.u_0,u.x=h*this.cosrot+A*this.sinrot,u.y=A*this.cosrot-h*this.sinrot),u.x=this.a*u.x+this.x0,u.y=this.a*u.y+this.y0,u},inverse:function(e){var t,i,r,o,s,l,A,h={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(i=e.y,t=e.x):(i=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),o=.5*((r=f(-this.BrA*i))-1/r),s=.5*(r+1/r),A=((l=m(this.BrA*t))*this.cosgam+o*this.singam)/s,n(n(A)-1)<fe)h.x=0,h.y=0>A?-ce:ce;else{if(h.y=this.E/g((1+A)/(1-A)),h.y=Ue(this.e,a(h.y,1/this.B)),h.y===1/0)throw new Error;h.x=-this.rB*c(o*this.cosgam-l*this.singam,v(this.BrA*t))}return h.x+=this.lam0,h},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]},mt={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(n(this.lat1+this.lat2)<fe)){var e=this.b/this.a;this.e=g(1-e*e);var i=m(this.lat1),r=v(this.lat1),o=Le(this.e,i,r),s=Pe(this.e,this.lat1,i),l=m(this.lat2),A=v(this.lat2),c=Le(this.e,l,A),h=Pe(this.e,this.lat2,l),u=Pe(this.e,this.lat0,m(this.lat0));this.ns=n(this.lat1-this.lat2)>fe?t(o/c)/t(s/h):i,isNaN(this.ns)&&(this.ns=i),this.f0=o/(this.ns*a(s,this.ns)),this.rh=this.a*this.f0*a(u,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(e){var t=e.x,i=e.y;n(2*n(i)-u)<=fe&&(i=Fe(i)*(ce-2*fe));var r,o,s=n(n(i)-ce);if(s>fe)r=Pe(this.e,i,m(i)),o=this.a*this.f0*a(r,this.ns);else{if(0>=(s=i*this.ns))return null;o=0}var l=this.ns*ke(t-this.long0);return e.x=this.k0*(o*m(l))+this.x0,e.y=this.k0*(this.rh-o*v(l))+this.y0,e},inverse:function(e){var t,n,i,r,o,s=(e.x-this.x0)/this.k0,l=this.rh-(e.y-this.y0)/this.k0;0<this.ns?(t=g(s*s+l*l),n=1):(t=-g(s*s+l*l),n=-1);var A=0;if(0!==t&&(A=c(n*s,n*l)),0!==t||0<this.ns){if(n=1/this.ns,i=a(t/(this.a*this.f0),n),-9999===(r=Ue(this.e,i)))return null}else r=-ce;return o=ke(A/this.ns+this.long0),e.x=o,e.y=r,e},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc"]},vt={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=g(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=g(this.e2),this.alfa=g(1+this.e2*a(v(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=i(m(this.fi0)/this.alfa),this.g=a((1+this.e*m(this.fi0))/(1-this.e*m(this.fi0)),this.alfa*this.e/2),this.k=p(this.u0/2+this.s45)/a(p(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*g(1-this.e2)/(1-this.e2*a(m(this.fi0),2)),this.s0=1.37008346281555,this.n=m(this.s0),this.ro0=this.k1*this.n0/p(this.s0),this.ad=this.s90-this.uq},forward:function(e){var t,n,r,o,s,l,A,c=e.x,h=e.y,u=ke(c-this.long0);return t=a((1+this.e*m(h))/(1-this.e*m(h)),this.alfa*this.e/2),n=2*(d(this.k*a(p(h/2+this.s45),this.alfa)/t)-this.s45),r=-u*this.alfa,o=i(v(this.ad)*m(n)+m(this.ad)*v(n)*v(r)),s=i(v(n)*m(r)/v(o)),l=this.n*s,A=this.ro0*a(p(this.s0/2+this.s45),this.n)/a(p(o/2+this.s45),this.n),e.y=A*v(l)/1,e.x=A*m(l)/1,this.czech||(e.y*=-1,e.x*=-1),e},inverse:function(e){var t,r,o,s,l,A,h,u=e.x;e.x=e.y,e.y=u,this.czech||(e.y*=-1,e.x*=-1),l=g(e.x*e.x+e.y*e.y),s=c(e.y,e.x)/m(this.s0),o=2*(d(a(this.ro0/l,1/this.n)*p(this.s0/2+this.s45))-this.s45),t=i(v(this.ad)*m(o)-m(this.ad)*v(o)*v(s)),r=i(v(o)*m(s)/v(t)),e.x=this.long0-r/this.alfa,A=t,h=0;var f=0;do{e.y=2*(d(a(this.k,-1/this.alfa)*a(p(t/2+this.s45),1/this.alfa)*a((1+this.e*m(A))/(1-this.e*m(A)),this.e/2))-this.s45),1e-10>n(A-e.y)&&(h=1),A=e.y,f+=1}while(0===h&&15>f);return 15<=f?null:e},names:["Krovak","krovak"]},gt=function(e,t,n,i,r){return e*r-t*m(2*r)+n*m(4*r)-i*m(6*r)},yt=function(e){return 1-.25*e*(1+e/16*(3+1.25*e))},wt=function(e){return.375*e*(1+.25*e*(1+.46875*e))},xt=function(e){return.05859375*e*e*(1+.75*e)},bt=function(e){return e*e*e*(35/3072)},Mt=function(e,t,n){var i=t*n;return e/g(1-i*i)},Ct=function(e){return n(e)<ce?e:e-Fe(e)*u},Bt=function(e,t,i,r,a){var o,s;o=e/t;for(var l=0;15>l;l++)if(o+=s=(e-(t*o-i*m(2*o)+r*m(4*o)-a*m(6*o)))/(t-2*i*v(2*o)+4*r*v(4*o)-6*a*v(6*o)),1e-10>=n(s))return o;return NaN},Et={init:function(){this.sphere||(this.e0=yt(this.es),this.e1=wt(this.es),this.e2=xt(this.es),this.e3=bt(this.es),this.ml0=this.a*gt(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(e){var t,n,r=e.x,a=e.y;if(r=ke(r-this.long0),this.sphere)t=this.a*i(v(a)*m(r)),n=this.a*(c(p(a),v(r))-this.lat0);else{var o=m(a),s=v(a),l=Mt(this.a,this.e,o),A=p(a)*p(a),h=r*v(a),u=h*h,d=this.es*s*s/(1-this.es);t=l*h*(1-u*A*(1/6-(8-A+8*d)*u/120)),n=this.a*gt(this.e0,this.e1,this.e2,this.e3,a)-this.ml0+l*o/s*u*(.5+(5-A+6*d)*u/24)}return e.x=t+this.x0,e.y=n+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,r,o=e.x/this.a,s=e.y/this.a;if(this.sphere){var l=s+this.lat0;t=i(m(l)*v(o)),r=c(p(o),v(l))}else{var A=this.ml0/this.a+s,h=Bt(A,this.e0,this.e1,this.e2,this.e3);if(n(n(h)-ce)<=fe)return e.x=this.long0,e.y=ce,0>s&&(e.y*=-1),e;var u=Mt(this.a,this.e,m(h)),d=u*u*u/this.a/this.a*(1-this.es),f=a(p(h),2),g=o*this.a/u,y=g*g;t=h-u*p(h)/d*g*g*(.5-(1+3*f)*g*g/24),r=g*(1-y*(f/3+(1+3*f)*f*y/15))/v(h)}return e.x=ke(r+this.long0),e.y=Ct(t),e},names:["Cassini","Cassini_Soldner","cass"]},St=function(e,n){var i;return 1e-7<e?(1-e*e)*(n/(1-(i=e*n)*i)-.5/e*t((1-i)/(1+i))):2*n},Tt=.3333333333333333,_t=.17222222222222222,It=.10257936507936508,Lt=.06388888888888888,Ft=.0664021164021164,kt=.016415012942191543,Pt={init:function(){var e,t=n(this.lat0);if(this.mode=n(t-ce)<fe?0>this.lat0?this.S_POLE:this.N_POLE:n(t)<fe?this.EQUIT:this.OBLIQ,0<this.es)switch(this.qp=St(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(e){var t,n=[];return n[0]=e*Tt,t=e*e,n[0]+=t*_t,n[1]=t*Lt,t*=e,n[0]+=t*It,n[1]+=t*Ft,n[2]=t*kt,n}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=g(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=g(.5*this.qp),e=m(this.lat0),this.sinb1=St(this.e,e)/this.qp,this.cosb1=g(1-this.sinb1*this.sinb1),this.dd=v(this.lat0)/(g(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=m(this.lat0),this.cosph0=v(this.lat0))},forward:function(e){var t,i,r,a,o,s,l,A,c,h,u=e.x,d=e.y;if(u=ke(u-this.long0),this.sphere){if(o=m(d),h=v(d),r=v(u),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+h*r:1+this.sinph0*o+this.cosph0*h*r)<=fe)return null;t=(i=g(2/i))*h*m(u),i*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*h*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),n(d+this.lat0)<fe)return null;i=ve-.5*d,t=(i=2*(this.mode===this.S_POLE?v(i):m(i)))*m(u),i*=r}}else{switch(l=0,A=0,c=0,r=v(u),a=m(u),o=m(d),s=St(this.e,o),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(l=s/this.qp,A=g(1-l*l)),this.mode){case this.OBLIQ:c=1+this.sinb1*l+this.cosb1*A*r;break;case this.EQUIT:c=1+A*r;break;case this.N_POLE:c=ce+d,s=this.qp-s;break;case this.S_POLE:c=d-ce,s=this.qp+s}if(n(c)<fe)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:c=g(2/c),i=this.mode===this.OBLIQ?this.ymf*c*(this.cosb1*l-this.sinb1*A*r):(c=g(2/(1+A*r)))*l*this.ymf,t=this.xmf*c*A*a;break;case this.N_POLE:case this.S_POLE:0<=s?(t=(c=g(s))*a,i=r*(this.mode===this.S_POLE?c:-c)):t=i=0}}return e.x=this.a*t+this.x0,e.y=this.a*i+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,r,a,o,s,l,A,h=e.x/this.a,u=e.y/this.a;if(this.sphere){var d,f=0,p=0;if(1<(r=.5*(d=g(h*h+u*u))))return null;switch(r=2*i(r),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(p=m(r),f=v(r)),this.mode){case this.EQUIT:r=n(d)<=fe?0:i(u*p/d),h*=p,u=f*d;break;case this.OBLIQ:r=n(d)<=fe?this.lat0:i(f*this.sinph0+u*p*this.cosph0/d),h*=p*this.cosph0,u=(f-m(r)*this.sinph0)*d;break;case this.N_POLE:u=-u,r=ce-r;break;case this.S_POLE:r-=ce}t=0!==u||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?c(h,u):0}else{if(A=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(h/=this.dd,u*=this.dd,(l=g(h*h+u*u))<fe)return e.x=this.long0,e.y=this.lat0,e;o=2*i(.5*l/this.rq),a=v(o),h*=o=m(o),this.mode===this.OBLIQ?(A=a*this.sinb1+u*o*this.cosb1/l,s=this.qp*A,u=l*this.cosb1*a-u*this.sinb1*o):(A=u*o/l,s=this.qp*A,u=l*a)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(u=-u),!(s=h*h+u*u))return e.x=this.long0,e.y=this.lat0,e;A=1-s/this.qp,this.mode===this.S_POLE&&(A=-A)}t=c(h,u),r=function(e,t){var n=e+e;return e+t[0]*m(n)+t[1]*m(n+n)+t[2]*m(n+n+n)}(i(A),this.apa)}return e.x=ke(this.long0+t),e.y=r,e},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},Ut=function(e){return 1<n(e)&&(e=1<e?1:-1),i(e)},Dt={init:function(){n(this.lat1+this.lat2)<fe||(this.temp=this.b/this.a,this.es=1-a(this.temp,2),this.e3=g(this.es),this.sin_po=m(this.lat1),this.cos_po=v(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=Le(this.e3,this.sin_po,this.cos_po),this.qs1=St(this.e3,this.sin_po,this.cos_po),this.sin_po=m(this.lat2),this.cos_po=v(this.lat2),this.t2=this.sin_po,this.ms2=Le(this.e3,this.sin_po,this.cos_po),this.qs2=St(this.e3,this.sin_po,this.cos_po),this.sin_po=m(this.lat0),this.cos_po=v(this.lat0),this.t3=this.sin_po,this.qs0=St(this.e3,this.sin_po,this.cos_po),this.ns0=n(this.lat1-this.lat2)>fe?(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*g(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(e){var t=e.x,n=e.y;this.sin_phi=m(n),this.cos_phi=v(n);var i=St(this.e3,this.sin_phi,this.cos_phi),r=this.a*g(this.c-this.ns0*i)/this.ns0,a=this.ns0*ke(t-this.long0),o=r*m(a)+this.x0,s=this.rh-r*v(a)+this.y0;return e.x=o,e.y=s,e},inverse:function(e){var t,n,r,a,o,s;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,0<=this.ns0?(t=g(e.x*e.x+e.y*e.y),r=1):(t=-g(e.x*e.x+e.y*e.y),r=-1),a=0,0!==t&&(a=c(r*e.x,r*e.y)),r=t*this.ns0/this.a,this.sphere?s=i((this.c-r*r)/(2*this.ns0)):(n=(this.c-r*r)/this.ns0,s=this.phi1z(this.e3,n)),o=ke(a/this.ns0+this.long0),e.x=o,e.y=s,e},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(e,i){var r,a,o,s,l=Ut(.5*i);if(e<fe)return l;for(var A=1;25>=A;A++)if(l+=s=.5*(o=1-(a=e*(r=m(l)))*a)*o/v(l)*(i/(1-e*e)-r/o+.5/e*t((1-a)/(1+a))),1e-7>=n(s))return l;return null}},Rt={init:function(){this.sin_p14=m(this.lat0),this.cos_p14=v(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(e){var t,i,r,a,o,s,l,A=e.x,c=e.y;return r=ke(A-this.long0),t=m(c),i=v(c),a=v(r),1,0<(o=this.sin_p14*t+this.cos_p14*i*a)||n(o)<=fe?(s=this.x0+1*this.a*i*m(r)/o,l=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*i*a)/o):(s=this.x0+this.infinity_dist*i*m(r),l=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*i*a)),e.x=s,e.y=l,e},inverse:function(e){var t,n,i,r,a,o;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=g(e.x*e.x+e.y*e.y))?(r=c(t,this.rc),n=m(r),i=v(r),o=Ut(i*this.sin_p14+e.y*n*this.cos_p14/t),a=c(e.x*n,t*this.cos_p14*i-e.y*this.sin_p14*n),a=ke(this.long0+a)):(o=this.phic0,a=0),e.x=a,e.y=o,e},names:["gnom"]},Ot={init:function(){this.sphere||(this.k0=Le(this.e,m(this.lat_ts),v(this.lat_ts)))},forward:function(e){var t,n,i=e.x,r=e.y,a=ke(i-this.long0);if(this.sphere)t=this.x0+this.a*a*v(this.lat_ts),n=this.y0+this.a*m(r)/v(this.lat_ts);else{var o=St(this.e,m(r));t=this.x0+this.a*this.k0*a,n=this.y0+this.a*o*.5/this.k0}return e.x=t,e.y=n,e},inverse:function(e){var r,o;return e.x-=this.x0,e.y-=this.y0,this.sphere?(r=ke(this.long0+e.x/this.a/v(this.lat_ts)),o=i(e.y/this.a*v(this.lat_ts))):(o=function(e,r){var o=1-(1-e*e)/(2*e)*t((1-e)/(1+e));if(1e-6>n(n(r)-o))return 0>r?-1*ce:ce;for(var s,l,A,c,h=i(.5*r),u=0;30>u;u++)if(l=m(h),A=v(h),h+=s=a(1-(c=e*l)*c,2)/(2*A)*(r/(1-e*e)-l/(1-c*c)+.5/e*t((1-c)/(1+c))),1e-10>=n(s))return h;return NaN}(this.e,2*e.y*this.k0/this.a),r=ke(this.long0+e.x/(this.a*this.k0))),e.x=r,e.y=o,e},names:["cea"]},Nt={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=v(this.lat_ts)},forward:function(e){var t=e.x,n=e.y,i=ke(t-this.long0),r=Ct(n-this.lat0);return e.x=this.x0+this.a*i*this.rc,e.y=this.y0+this.a*r,e},inverse:function(e){var t=e.x,n=e.y;return e.x=ke(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=Ct(this.lat0+(n-this.y0)/this.a),e},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},zt={init:function(){this.temp=this.b/this.a,this.es=1-a(this.temp,2),this.e=g(this.es),this.e0=yt(this.es),this.e1=wt(this.es),this.e2=xt(this.es),this.e3=bt(this.es),this.ml0=this.a*gt(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(e){var t,i,r,a=e.x,o=e.y,s=ke(a-this.long0);if(r=s*m(o),this.sphere)n(o)<=fe?(t=this.a*s,i=-1*this.a*this.lat0):(t=this.a*m(r)/p(o),i=this.a*(Ct(o-this.lat0)+(1-v(r))/p(o)));else if(n(o)<=fe)t=this.a*s,i=-1*this.ml0;else{var l=Mt(this.a,this.e,m(o))/p(o);t=l*m(r),i=this.a*gt(this.e0,this.e1,this.e2,this.e3,o)-this.ml0+l*(1-v(r))}return e.x=t+this.x0,e.y=i+this.y0,e},inverse:function(e){var t,r,o,s,l,A,c,h,u;if(o=e.x-this.x0,s=e.y-this.y0,this.sphere)if(n(s+this.a*this.lat0)<=fe)t=ke(o/this.a+this.long0),r=0;else{var d;for(A=this.lat0+s/this.a,c=o*o/this.a/this.a+A*A,h=A,l=20;l;--l)if(h+=u=-1*(A*(h*(d=p(h))+1)-h-.5*(h*h+c)*d)/((h-A)/d-1),n(u)<=fe){r=h;break}t=ke(this.long0+i(o*p(h)/this.a)/m(r))}else if(n(s+this.ml0)<=fe)r=0,t=ke(this.long0+o/this.a);else{var f,y,w,x,b;for(A=(this.ml0+s)/this.a,c=o*o/this.a/this.a+A*A,h=A,l=20;l;--l)if(b=this.e*m(h),f=g(1-b*b)*p(h),y=this.a*gt(this.e0,this.e1,this.e2,this.e3,h),w=this.e0-2*this.e1*v(2*h)+4*this.e2*v(4*h)-6*this.e3*v(6*h),h-=u=(A*(f*(x=y/this.a)+1)-x-.5*f*(x*x+c))/(this.es*m(2*h)*(x*x+c-2*A*x)/(4*f)+(A-x)*(f*w-2/m(2*h))-w),n(u)<=fe){r=h;break}f=g(1-this.es*a(m(r),2))*p(r),t=ke(this.long0+i(o*f/this.a)/m(r))}return e.x=t,e.y=r,e},names:["Polyconic","poly"]},Qt={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(e){var t,n=e.x,i=e.y-this.lat0,r=n-this.long0,a=1,o=0;for(t=1;10>=t;t++)a*=i/Ae*1e-5,o+=this.A[t]*a;var s,l=o,A=r,c=1,h=0,u=0,d=0;for(t=1;6>=t;t++)s=h*l+c*A,c=c*l-h*A,h=s,u=u+this.B_re[t]*c-this.B_im[t]*h,d=d+this.B_im[t]*c+this.B_re[t]*h;return e.x=d*this.a+this.x0,e.y=u*this.a+this.y0,e},inverse:function(e){var t,n,i=e.x,r=e.y,a=i-this.x0,o=(r-this.y0)/this.a,s=a/this.a,l=1,A=0,c=0,h=0;for(t=1;6>=t;t++)n=A*o+l*s,l=l*o-A*s,A=n,c=c+this.C_re[t]*l-this.C_im[t]*A,h=h+this.C_im[t]*l+this.C_re[t]*A;for(var u=0;u<this.iterations;u++){var d,f=c,p=h,m=o,v=s;for(t=2;6>=t;t++)d=p*c+f*h,f=f*c-p*h,p=d,m+=(t-1)*(this.B_re[t]*f-this.B_im[t]*p),v+=(t-1)*(this.B_im[t]*f+this.B_re[t]*p);f=1,p=0;var g=this.B_re[1],y=this.B_im[1];for(t=2;6>=t;t++)d=p*c+f*h,f=f*c-p*h,p=d,g+=t*(this.B_re[t]*f-this.B_im[t]*p),y+=t*(this.B_im[t]*f+this.B_re[t]*p);var w=g*g+y*y;c=(m*g+v*y)/w,h=(v*g-m*y)/w}var x=c,b=h,M=1,C=0;for(t=1;9>=t;t++)M*=x,C+=this.D[t]*M;var B=this.lat0+C*Ae*1e5,E=this.long0+b;return e.x=E,e.y=B,e},names:["New_Zealand_Map_Grid","nzmg"]},Gt={init:function(){},forward:function(e){var n=e.x,i=e.y,r=ke(n-this.long0),a=this.x0+this.a*r,o=this.y0+this.a*t(p(u/4+i/2.5))*1.25;return e.x=a,e.y=o,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t=ke(this.long0+e.x/this.a),n=2.5*(d(f(.8*e.y/this.a))-u/4);return e.x=t,e.y=n,e},names:["Miller_Cylindrical","mill"]},Ht={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=g((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Je(this.es)},forward:function(e){var t,r,a=e.x,o=e.y;if(a=ke(a-this.long0),this.sphere){if(this.m)for(var s,l=this.n*m(o),A=20;A&&(o-=s=(this.m*o+m(o)-l)/(this.m+v(o)),!(n(s)<fe));--A);else o=1===this.n?o:i(this.n*m(o));t=this.a*this.C_x*a*(this.m+v(o)),r=this.a*this.C_y*o}else{var c=m(o),h=v(o);r=this.a*qe(o,c,h,this.en),t=this.a*a*h/g(1-this.es*c*c)}return e.x=t,e.y=r,e},inverse:function(e){var t,i,r,a;return e.x-=this.x0,r=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,r/=this.C_x*(this.m+v(t)),this.m?t=Ut((this.m*t+m(t))/this.n):1!==this.n&&(t=Ut(m(t)/this.n)),r=ke(r+this.long0),t=Ct(t)):(t=$e(e.y/this.a,this.es,this.en),(a=n(t))<ce?(a=m(t),i=this.long0+e.x*g(1-this.es*a*a)/(this.a*v(t)),r=ke(i)):a-fe<ce&&(r=this.long0)),e.x=r,e.y=t,e},names:["Sinusoidal","sinu"]},Vt={init:function(){},forward:function(e){for(var t,i=e.x,r=e.y,a=ke(i-this.long0),o=r,s=u*m(r);o+=t=-(o+m(o)-s)/(1+v(o)),!(n(t)<fe););o/=2,u/2-n(r)<fe&&(a=0);var l=.900316316158*this.a*a*v(o)+this.x0,A=1.4142135623731*this.a*m(o)+this.y0;return e.x=l,e.y=A,e},inverse:function(e){var t,r;e.x-=this.x0,e.y-=this.y0,r=e.y/(1.4142135623731*this.a),.999999999999<n(r)&&(r=.999999999999),t=i(r);var a=ke(this.long0+e.x/(.900316316158*this.a*v(t)));a<-u&&(a=-u),a>u&&(a=u),r=(2*t+m(2*t))/u,1<n(r)&&(r=1);var o=i(r);return e.x=a,e.y=o,e},names:["Mollweide","moll"]},jt={init:function(){n(this.lat1+this.lat2)<fe||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-a(this.temp,2),this.e=g(this.es),this.e0=yt(this.es),this.e1=wt(this.es),this.e2=xt(this.es),this.e3=bt(this.es),this.sinphi=m(this.lat1),this.cosphi=v(this.lat1),this.ms1=Le(this.e,this.sinphi,this.cosphi),this.ml1=gt(this.e0,this.e1,this.e2,this.e3,this.lat1),n(this.lat1-this.lat2)<fe?this.ns=this.sinphi:(this.sinphi=m(this.lat2),this.cosphi=v(this.lat2),this.ms2=Le(this.e,this.sinphi,this.cosphi),this.ml2=gt(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=gt(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(e){var t,n=e.x,i=e.y;if(this.sphere)t=this.a*(this.g-i);else{var r=gt(this.e0,this.e1,this.e2,this.e3,i);t=this.a*(this.g-r)}var a=this.ns*ke(n-this.long0),o=this.x0+t*m(a),s=this.y0+this.rh-t*v(a);return e.x=o,e.y=s,e},inverse:function(e){var t,n,i,r;e.x-=this.x0,e.y=this.rh-e.y+this.y0,0<=this.ns?(n=g(e.x*e.x+e.y*e.y),t=1):(n=-g(e.x*e.x+e.y*e.y),t=-1);var a=0;if(0!==n&&(a=c(t*e.x,t*e.y)),this.sphere)return r=ke(this.long0+a/this.ns),i=Ct(this.g-n/this.a),e.x=r,e.y=i,e;var o=this.g-n/this.a;return i=Bt(o,this.e0,this.e1,this.e2,this.e3),r=ke(this.long0+a/this.ns),e.x=r,e.y=i,e},names:["Equidistant_Conic","eqdc"]},Wt={init:function(){this.R=this.a},forward:function(e){var t,i,r=e.x,a=e.y,o=ke(r-this.long0);n(a)<=fe&&(t=this.x0+this.R*o,i=this.y0);var s=Ut(2*n(a/u));(n(o)<=fe||n(n(a)-ce)<=fe)&&(t=this.x0,i=0<=a?this.y0+u*this.R*p(.5*s):this.y0+u*this.R*-p(.5*s));var l=.5*n(u/o-o/u),A=l*l,c=m(s),h=v(s),d=h/(c+h-1),f=d*(2/c-1),y=f*f,w=u*this.R*(l*(d-y)+g(A*(d-y)*(d-y)-(y+A)*(d*d-y)))/(y+A);0>o&&(w=-w),t=this.x0+w;var x=A+d;return w=u*this.R*(f*x-l*g((y+A)*(A+1)-x*x))/(y+A),i=0<=a?this.y0+w:this.y0-w,e.x=t,e.y=i,e},inverse:function(e){var t,i,r,a,s,l,A,c,h,d,f,p,m;return e.x-=this.x0,e.y-=this.y0,f=u*this.R,s=(r=e.x/f)*r+(a=e.y/f)*a,m=a*a/(c=-2*(l=-n(a)*(1+s))+1+2*a*a+s*s)+(2*(A=l-2*a*a+r*r)*A*A/c/c/c-9*l*A/c/c)/27,d=2*g(-(h=(l-A*A/3/c)/c)/3),1<n(f=3*m/h/d)&&(f=0<=f?1:-1),p=o(f)/3,i=0<=e.y?(-d*v(p+u/3)-A/3/c)*u:-(-d*v(p+u/3)-A/3/c)*u,t=n(r)<fe?this.long0:ke(this.long0+u*(s-1+g(1+2*(r*r-a*a)+s*s))/2/r),e.x=t,e.y=i,e},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]},Xt={init:function(){this.sin_p12=m(this.lat0),this.cos_p12=v(this.lat0)},forward:function(e){var t,r,a,s,l,A,h,f,y,w,x,b,M,C,B,E,S,T,_,I,L,F,k=e.x,P=e.y,U=m(e.y),D=v(e.y),R=ke(k-this.long0);return this.sphere?n(this.sin_p12-1)<=fe?(e.x=this.x0+this.a*(ce-P)*m(R),e.y=this.y0-this.a*(ce-P)*v(R),e):n(this.sin_p12+1)<=fe?(e.x=this.x0+this.a*(ce+P)*m(R),e.y=this.y0+this.a*(ce+P)*v(R),e):(T=this.sin_p12*U+this.cos_p12*D*v(R),S=(E=o(T))?E/m(E):1,e.x=this.x0+this.a*S*D*m(R),e.y=this.y0+this.a*S*(this.cos_p12*U-this.sin_p12*D*v(R)),e):(t=yt(this.es),r=wt(this.es),a=xt(this.es),s=bt(this.es),n(this.sin_p12-1)<=fe?(l=this.a*gt(t,r,a,s,ce),A=this.a*gt(t,r,a,s,P),e.x=this.x0+(l-A)*m(R),e.y=this.y0-(l-A)*v(R),e):n(this.sin_p12+1)<=fe?(l=this.a*gt(t,r,a,s,ce),A=this.a*gt(t,r,a,s,P),e.x=this.x0+(l+A)*m(R),e.y=this.y0+(l+A)*v(R),e):(h=U/D,f=Mt(this.a,this.e,this.sin_p12),y=Mt(this.a,this.e,U),w=d((1-this.es)*h+this.es*f*this.sin_p12/(y*D)),_=0===(x=c(m(R),this.cos_p12*p(w)-this.sin_p12*v(R)))?i(this.cos_p12*m(w)-this.sin_p12*v(w)):n(n(x)-u)<=fe?-i(this.cos_p12*m(w)-this.sin_p12*v(w)):i(m(R)*v(w)/m(x)),b=this.e*this.sin_p12/g(1-this.es),E=f*_*(1-(I=_*_)*(B=(M=this.e*this.cos_p12*v(x)/g(1-this.es))*M)*(1-B)/6+(L=I*_)/8*(C=b*M)*(1-2*B)+(F=L*_)/120*(B*(4-7*B)-3*b*b*(1-7*B))-F*_/48*C),e.x=this.x0+E*m(x),e.y=this.y0+E*v(x),e))},inverse:function(e){var t,r,o,s,l,A,h,u,d,f,y,w,x,b,M,C,B,E,S,T,_,I,L;return e.x-=this.x0,e.y-=this.y0,this.sphere?(t=g(e.x*e.x+e.y*e.y))>2*ce*this.a?void 0:(r=t/this.a,o=m(r),s=v(r),l=this.long0,n(t)<=fe?A=this.lat0:(A=Ut(s*this.sin_p12+e.y*o*this.cos_p12/t),h=n(this.lat0)-ce,l=n(h)<=fe?0<=this.lat0?ke(this.long0+c(e.x,-e.y)):ke(this.long0-c(-e.x,e.y)):ke(this.long0+c(e.x*o,t*this.cos_p12*s-e.y*this.sin_p12*o))),e.x=l,e.y=A,e):(u=yt(this.es),d=wt(this.es),f=xt(this.es),y=bt(this.es),n(this.sin_p12-1)<=fe?(w=this.a*gt(u,d,f,y,ce),t=g(e.x*e.x+e.y*e.y),A=Bt((w-t)/this.a,u,d,f,y),l=ke(this.long0+c(e.x,-1*e.y)),e.x=l,e.y=A,e):n(this.sin_p12+1)<=fe?(w=this.a*gt(u,d,f,y,ce),t=g(e.x*e.x+e.y*e.y),A=Bt((t-w)/this.a,u,d,f,y),l=ke(this.long0+c(e.x,e.y)),e.x=l,e.y=A,e):(t=g(e.x*e.x+e.y*e.y),M=c(e.x,e.y),x=Mt(this.a,this.e,this.sin_p12),C=v(M),E=-(B=this.e*this.cos_p12*C)*B/(1-this.es),S=3*this.es*(1-E)*this.sin_p12*this.cos_p12*C/(1-this.es),I=1-E*(_=(T=t/x)-E*(1+E)*a(T,3)/6-S*(1+3*E)*a(T,4)/24)*_/2-T*_*_*_/6,b=i(this.sin_p12*v(_)+this.cos_p12*m(_)*C),l=ke(this.long0+i(m(M)*m(_)/v(b))),L=m(b),A=c((L-this.es*I*this.sin_p12)*p(b),L*(1-this.es)),e.x=l,e.y=A,e))},names:["Azimuthal_Equidistant","aeqd"]},Yt={init:function(){this.sin_p14=m(this.lat0),this.cos_p14=v(this.lat0)},forward:function(e){var t,i,r,a,o,s,l,A=e.x,c=e.y;return r=ke(A-this.long0),t=m(c),i=v(c),a=v(r),1,(0<(o=this.sin_p14*t+this.cos_p14*i*a)||n(o)<=fe)&&(s=1*this.a*i*m(r),l=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*i*a)),e.x=s,e.y=l,e},inverse:function(e){var t,i,r,a,o,s,l;return e.x-=this.x0,e.y-=this.y0,t=g(e.x*e.x+e.y*e.y),i=Ut(t/this.a),r=m(i),a=v(i),s=this.long0,n(t)<=fe?(l=this.lat0,e.x=s,e.y=l,e):(l=Ut(a*this.sin_p14+e.y*r*this.cos_p14/t),o=n(this.lat0)-ce,n(o)<=fe?(s=0<=this.lat0?ke(this.long0+c(e.x,-e.y)):ke(this.long0-c(-e.x,e.y)),e.x=s,e.y=l,e):(s=ke(this.long0+c(e.x*r,t*this.cos_p14*a-e.y*this.sin_p14*r)),e.x=s,e.y=l,e))},names:["ortho"]},Kt=1,Zt=2,Jt=3,qt=4,$t=5,en=6,tn={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4},nn={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.face=this.lat0>=ce-ve/2?$t:this.lat0<=-(ce-ve/2)?en:n(this.long0)<=ve?Kt:n(this.long0)<=ce+ve?0<this.long0?Zt:qt:Jt,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(e){var t,n,i,r,a,s,l={x:0,y:0},A={value:0};if(e.x-=this.long0,t=0===this.es?e.y:d(this.one_minus_f_squared*p(e.y)),n=e.x,this.face===$t)r=ce-t,n>=ve&&n<=ce+ve?(A.value=tn.AREA_0,i=n-ce):n>ce+ve||n<=-(ce+ve)?(A.value=tn.AREA_1,i=0<n?n-ye:n+ye):n>-(ce+ve)&&n<=-ve?(A.value=tn.AREA_2,i=n+ce):(A.value=tn.AREA_3,i=n);else if(this.face===en)r=ce+t,n>=ve&&n<=ce+ve?(A.value=tn.AREA_0,i=-n+ce):n<ve&&n>=-ve?(A.value=tn.AREA_1,i=-n):n<-ve&&n>=-(ce+ve)?(A.value=tn.AREA_2,i=-n-ce):(A.value=tn.AREA_3,i=0<n?-n+ye:-n-ye);else{var c,h,u,f,y,w;this.face===Zt?n=oe(n,+ce):this.face===Jt?n=oe(n,+ye):this.face===qt&&(n=oe(n,-ce)),f=m(t),y=v(t),w=m(n),c=y*v(n),h=y*w,u=f,this.face===Kt?i=ae(r=o(c),u,h,A):this.face===Zt?i=ae(r=o(h),u,-c,A):this.face===Jt?i=ae(r=o(-c),u,-h,A):this.face===qt?i=ae(r=o(-h),u,c,A):(r=i=0,A.value=tn.AREA_0)}return s=d(12/ye*(i+o(m(i)*v(ve))-ce)),a=g((1-v(r))/(v(s)*v(s))/(1-v(d(1/v(i))))),A.value===tn.AREA_1?s+=ce:A.value===tn.AREA_2?s+=ye:A.value===tn.AREA_3&&(s+=1.5*ye),l.x=a*v(s),l.y=a*m(s),l.x=l.x*this.a+this.x0,l.y=l.y*this.a+this.y0,e.x=l.x,e.y=l.y,e},inverse:function(e){var t,i,r,a,s,l,A,h,u,f,y,w,x={lam:0,phi:0},b={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,i=d(g(e.x*e.x+e.y*e.y)),t=c(e.y,e.x),0<=e.x&&e.x>=n(e.y)?b.value=tn.AREA_0:0<=e.y&&e.y>=n(e.x)?(b.value=tn.AREA_1,t-=ce):0>e.x&&-e.x>=n(e.y)?(b.value=tn.AREA_2,t=0>t?t+ye:t-ye):(b.value=tn.AREA_3,t+=ce),u=ye/12*p(t),s=m(u)/(v(u)-1/g(2)),l=d(s),-1>(A=1-(r=v(t))*r*(a=p(i))*a*(1-v(d(1/v(l)))))?A=-1:1<A&&(A=1),this.face===$t)h=o(A),x.phi=ce-h,x.lam=b.value===tn.AREA_0?l+ce:b.value===tn.AREA_1?0>l?l+ye:l-ye:b.value===tn.AREA_2?l-ce:l;else if(this.face===en)h=o(A),x.phi=h-ce,x.lam=b.value===tn.AREA_0?-l+ce:b.value===tn.AREA_1?-l:b.value===tn.AREA_2?-l-ce:0>l?-l-ye:-l+ye;else{var M,C,B;u=(M=A)*M,C=1<=(u+=(B=1<=u?0:g(1-u)*m(l))*B)?0:g(1-u),b.value===tn.AREA_1?(u=C,C=-B,B=u):b.value===tn.AREA_2?(C=-C,B=-B):b.value===tn.AREA_3&&(u=C,C=B,B=-u),this.face===Zt?(u=M,M=-C,C=u):this.face===Jt?(M=-M,C=-C):this.face===qt&&(u=M,M=C,C=-u),x.phi=o(-B)-ce,x.lam=c(C,M),this.face===Zt?x.lam=oe(x.lam,-ce):this.face===Jt?x.lam=oe(x.lam,-ye):this.face===qt&&(x.lam=oe(x.lam,+ce))}0!==this.es&&(f=0>x.phi?1:0,y=p(x.phi),w=this.b/g(y*y+this.one_minus_f_squared),x.phi=d(g(this.a*this.a-w*w)/(this.one_minus_f*w)),f&&(x.phi=-x.phi));return x.lam+=this.long0,e.x=x.lam,e.y=x.phi,e},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},rn=[[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]],an=[[-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]],on=.8487,sn=1.3523,ln=me/5,An=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},cn={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 i=ke(t.x-this.long0),r=n(t.y),a=e(r*ln);0>a?a=0:18<=a&&(a=17);var o={x:An(rn[a],r=me*(r-1/ln*a))*i,y:An(an[a],r)};return 0>t.y&&(o.y=-o.y),o.x=o.x*this.a*on+this.x0,o.y=o.y*this.a*sn+this.y0,o},inverse:function(t){var i={x:(t.x-this.x0)/(this.a*on),y:n(t.y-this.y0)/(this.a*sn)};if(1<=i.y)i.x/=rn[18][0],i.y=0>t.y?-ce:ce;else{var r=e(18*i.y);for(0>r?r=0:18<=r&&(r=17);;)if(an[r][0]>i.y)--r;else{if(!(an[r+1][0]<=i.y))break;++r}var a=an[r],o=5*(i.y-a[0])/(an[r+1][0]-a[0]);o=function(e,t,i,r){for(var a,o=t;r&&(o-=a=e(o),!(n(a)<i));--r);return o}((function(e){return(An(a,e)-i.y)/function(e,t){return e[1]+t*(2*e[2]+3*t*e[3])}(a,e)}),o,fe,100),i.x/=An(rn[r],o),i.y=(5*r+o)*pe,0>t.y&&(i.y=-i.y)}return i.x=ke(i.x+this.long0),i},names:["Robinson","robin"]},hn={init:function(){this.name="geocent"},forward:function(e){return R(e,this.es,this.a)},inverse:function(e){return O(e,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]},un=0,dn=1,fn=2,pn=3,mn={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}},vn={init:function(){if(Object.keys(mn).forEach(function(e){if(void 0===this[e])this[e]=mn[e].def;else{if(mn[e].num&&isNaN(this[e]))throw new Error("Invalid parameter value, must be numeric "+e+" = "+this[e]);mn[e].num&&(this[e]=parseFloat(this[e]))}mn[e].degrees&&(this[e]*=pe)}.bind(this)),n(n(this.lat0)-ce)<fe?this.mode=0>this.lat0?dn:un:n(this.lat0)<fe?this.mode=fn:(this.mode=pn,this.sinph0=m(this.lat0),this.cosph0=v(this.lat0)),this.pn1=this.h/this.a,0>=this.pn1||1e10<this.pn1)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=v(t),this.sg=m(t),this.cw=v(e),this.sw=m(e)},forward:function(e){e.x-=this.long0;var t,n,i,r,a=m(e.y),o=v(e.y),s=v(e.x);switch(this.mode){case pn:n=this.sinph0*a+this.cosph0*o*s;break;case fn:n=o*s;break;case dn:n=-a;break;case un:n=a}switch(t=(n=this.pn1/(this.p-n))*o*m(e.x),this.mode){case pn:n*=this.cosph0*a-this.sinph0*o*s;break;case fn:n*=a;break;case un:n*=-o*s;break;case dn:n*=o*s}return r=1/((i=n*this.cg+t*this.sg)*this.sw*this.h1+this.cw),t=(t*this.cg-n*this.sg)*this.cw*r,n=i*r,e.x=t*this.a,e.y=n*this.a,e},inverse:function(e){e.x/=this.a,e.y/=this.a;var t,r,a,o={x:e.x,y:e.y};a=1/(this.pn1-e.y*this.sw),t=this.pn1*e.x*a,r=this.pn1*e.y*this.cw*a,e.x=t*this.cg+r*this.sg,e.y=r*this.cg-t*this.sg;var s=nt(e.x,e.y);if(n(s)<fe)o.x=0,o.y=e.y;else{var l,A;switch(A=1-s*s*this.pfact,A=(this.p-g(A))/(this.pn1/s+s/this.pn1),l=g(1-A*A),this.mode){case pn:o.y=i(l*this.sinph0+e.y*A*this.cosph0/s),e.y=(l-this.sinph0*m(o.y))*s,e.x*=A*this.cosph0;break;case fn:o.y=i(e.y*A/s),e.y=l*s,e.x*=A;break;case un:o.y=i(l),e.y=-e.y;break;case dn:o.y=-i(l)}o.x=c(e.x,e.y)}return e.x=o.x+this.long0,e.y=o.y,e},names:["Tilted_Perspective","tpers"]};return X.defaultDatum="WGS84",X.Proj=U,X.WGS84=new X.Proj("WGS84"),X.Point=re,X.toPoint=je,X.defs=C,X.nadgrid=function(e,t){var n=new DataView(t),i=function(e){var t=e.getInt32(8,!1);return 11!==t&&(11!==(t=e.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(n),r=function(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:L(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}(n,i);1<r.nSubgrids&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var a=function(e,t,n){for(var i=176,r=[],a=0;a<t.nSubgrids;a++){var o=k(e,i,n),s=P(e,i,o,n),l=h(1+(o.upperLongitude-o.lowerLongitude)/o.longitudeInterval),A=h(1+(o.upperLatitude-o.lowerLatitude)/o.latitudeInterval);r.push({ll:[I(o.lowerLongitude),I(o.lowerLatitude)],del:[I(o.longitudeInterval),I(o.latitudeInterval)],lim:[l,A],count:o.gridNodeCount,cvs:F(s)})}return r}(n,r,i),o={header:r,subgrids:a};return Ge[e]=o,o},X.transform=V,X.mgrs={forward:Y,inverse:function(e){var t=q(ne(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]},toPoint:K},X.version="2.7.4",function(e){e.Proj.projections.add(et),e.Proj.projections.add(st),e.Proj.projections.add(lt),e.Proj.projections.add(ht),e.Proj.projections.add(ut),e.Proj.projections.add(dt),e.Proj.projections.add(pt),e.Proj.projections.add(mt),e.Proj.projections.add(vt),e.Proj.projections.add(Et),e.Proj.projections.add(Pt),e.Proj.projections.add(Dt),e.Proj.projections.add(Rt),e.Proj.projections.add(Ot),e.Proj.projections.add(Nt),e.Proj.projections.add(zt),e.Proj.projections.add(Qt),e.Proj.projections.add(Gt),e.Proj.projections.add(Ht),e.Proj.projections.add(Vt),e.Proj.projections.add(jt),e.Proj.projections.add(Wt),e.Proj.projections.add(Xt),e.Proj.projections.add(Yt),e.Proj.projections.add(nn),e.Proj.projections.add(cn),e.Proj.projections.add(hn),e.Proj.projections.add(vn)}(X),X}))},{}],18:[function(e,t,n){function i(e,t){for(var n in e)t[n]=e[n]}function r(e,t,n){return o(e,t,n)}
|
|
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var a=e("buffer"),o=a.Buffer;o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?t.exports=a:(i(a,n),n.Buffer=r),r.prototype=Object.create(o.prototype),i(o,r),r.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},r.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=o(e);return void 0===t?i.fill(0):"string"==typeof n?i.fill(t,n):i.fill(t),i},r.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},r.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a.SlowBuffer(e)}},{buffer:8}],19:[function(e,t,n){function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(u.isEncoding===d||!d(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=o,this.end=s,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=A,t=3;break;default:return this.write=c,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=u.allocUnsafe(t)}function r(e){return 127>=e?0:6==e>>5?2:14==e>>4?3:30==e>>3?4:2==e>>6?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,n=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"<22>";if(1<e.lastNeed&&1<t.length){if(128!=(192&t[1]))return e.lastNeed=1,"<22>";if(2<e.lastNeed&&2<t.length&&128!=(192&t[2]))return e.lastNeed=2,"<22>"}}(this,e);return void 0===n?this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length)):n}function o(e,t){if(0==(e.length-t)%2){var n=e.toString("utf16le",t);if(n){var i=n.charCodeAt(n.length-1);if(55296<=i&&56319>=i)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function s(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0==n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1==n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function A(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function c(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}var u=e("safe-buffer").Buffer,d=u.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};n.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"<22>":t},i.prototype.text=function(e,t){var n=function(e,t,n){var i=t.length-1;if(i<n)return 0;var a=r(t[i]);return 0<=a?(0<a&&(e.lastNeed=a-1),a):--i<n||-2===a?0:0<=(a=r(t[i]))?(0<a&&(e.lastNeed=a-2),a):--i<n||-2===a?0:0<=(a=r(t[i]))?(0<a&&(2===a?a=0:e.lastNeed=a-3),a):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var i=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},i.prototype.fillLast=function(e){return this.lastNeed<=e.length?(e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),void(this.lastNeed-=e.length))}},{"safe-buffer":18}],20:[function(e,t){t.exports=e("./lib/encoding.js")},{"./lib/encoding.js":21}],21:[function(t,n){!function(i){function a(e,t,n){return t<=e&&e<=n}function o(e){if(void 0===e)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function l(e){for(var t,n="",i=0;i<e.length;++i)65535>=(t=e[i])?n+=s(t):n+=s(55296+((t-=65536)>>10),56320+(1023&t));return n}function A(e){return 0<=e&&127>=e}function c(e){this.tokens=[].slice.call(e),this.tokens.reverse()}function h(e,t){if(e)throw TypeError("Decoder error");return t||65533}function u(e){throw TypeError("The code point "+e+" could not be encoded.")}function d(e){return e=(e+"").trim().toLowerCase(),Object.prototype.hasOwnProperty.call(H,e)?H[e]:null}function f(e,t){return t&&t[e]||null}function p(e,t){var n=t.indexOf(e);return-1===n?null:n}function m(e){if(!("encoding-indexes"in i))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return i["encoding-indexes"][e]}function v(e,t){if(!(this instanceof v))throw TypeError("Called as a function. Did you forget 'new'?");e=void 0===e?"utf-8":e+"",t=o(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var n=d(e);if(null===n||"replacement"===n.name)throw RangeError("Unknown encoding: "+e);if(!X[n.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var i=this;return i._encoding=n,!!t.fatal&&(i._error_mode="fatal"),!!t.ignoreBOM&&(i._ignoreBOM=!0),Object.defineProperty||(this.encoding=i._encoding.name.toLowerCase(),this.fatal="fatal"===i._error_mode,this.ignoreBOM=i._ignoreBOM),i}function g(e,t){if(!(this instanceof g))throw TypeError("Called as a function. Did you forget 'new'?");t=o(t),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=t.fatal?"fatal":"replacement";var n=this;if(t.NONSTANDARD_allowLegacyEncoding){var r=d(e=void 0===e?"utf-8":e+"");if(null===r||"replacement"===r.name)throw RangeError("Unknown encoding: "+e);if(!W[r.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");n._encoding=r}else n._encoding=d("utf-8"),void 0!==e&&"console"in i&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=n._encoding.name.toLowerCase()),n}function y(e){var t=e.fatal,n=0,i=0,r=0,o=128,s=191;this.handler=function(e,l){if(-1===l&&0!==r)return r=0,h(t);if(-1===l)return-1;if(0===r){if(a(l,0,127))return l;if(a(l,194,223))r=1,n=31&l;else if(a(l,224,239))224===l&&(o=160),237===l&&(s=159),r=2,n=15&l;else{if(!a(l,240,244))return h(t);240===l&&(o=144),244===l&&(s=143),r=3,n=7&l}return null}if(!a(l,o,s))return n=r=i=0,o=128,s=191,e.prepend(l),h(t);if(o=128,s=191,n=n<<6|63&l,(i+=1)!==r)return null;var A=n;return n=r=i=0,A}}function w(e){e.fatal,this.handler=function(e,t){if(-1===t)return-1;if(Q(t))return t;var n,i;a(t,128,2047)?(n=1,i=192):a(t,2048,65535)?(n=2,i=224):a(t,65536,1114111)&&(n=3,i=240);for(var r=[(t>>6*n)+i];0<n;){var o=t>>6*(n-1);r.push(128|63&o),n-=1}return r}}function x(e,t){var n=t.fatal;this.handler=function(t,i){if(-1===i)return-1;if(A(i))return i;var r=e[i-128];return null===r?h(n):r}}function b(e,t){t.fatal,this.handler=function(t,n){if(-1===n)return-1;if(Q(n))return n;var i=p(n,e);return null===i&&u(n),i+128}}function M(e){var t=e.fatal,n=0,i=0,r=0;this.handler=function(e,o){if(-1===o&&0===n&&0===i&&0===r)return-1;var s;if(-1===o&&(0!==n||0!==i||0!==r)&&(n=0,i=0,r=0,h(t)),0!==r){s=null,a(o,48,57)&&(s=function(e){if(39419<e&&189e3>e||1237575<e)return null;if(7457===e)return 59335;var t,n=0,i=0,r=m("gb18030-ranges");for(t=0;t<r.length;++t){var a=r[t];if(!(a[0]<=e))break;n=a[0],i=a[1]}return i+e-n}(10*(126*(10*(n-129)+i-48)+r-129)+o-48));var l=[i,r,o];return n=0,i=0,r=0,null===s?(e.prepend(l),h(t)):s}if(0!==i)return a(o,129,254)?(r=o,null):(e.prepend([i,o]),n=0,i=0,h(t));if(0!==n){if(a(o,48,57))return i=o,null;var c=n,u=null;n=0;var d=127>o?64:65;return(a(o,64,126)||a(o,128,254))&&(u=190*(c-129)+(o-d)),null===(s=null===u?null:f(u,m("gb18030")))&&A(o)&&e.prepend(o),null===s?h(t):s}return A(o)?o:128===o?8364:a(o,129,254)?(n=o,null):h(t)}}function C(e,t){e.fatal,this.handler=function(e,n){if(-1===n)return-1;if(Q(n))return n;if(58853===n)return u(n);if(t&&8364===n)return 128;var i=p(n,m("gb18030"));if(null!==i){var r=i%190;return[z(i/190)+129,r+(63>r?64:65)]}if(t)return u(n);i=function(e){if(59335===e)return 7457;var t,n=0,i=0,r=m("gb18030-ranges");for(t=0;t<r.length;++t){var a=r[t];if(!(a[1]<=e))break;n=a[1],i=a[0]}return i+e-n}(n);var a=z(i/10/126/10),o=z((i-=10*a*126*10)/10/126),s=z((i-=10*o*126)/10);return[a+129,o+48,s+129,i-10*s+48]}}function B(e){var t=e.fatal,n=0;this.handler=function(e,i){if(-1===i&&0!==n)return n=0,h(t);if(-1===i&&0===n)return-1;if(0!==n){var r=n,o=null;n=0;var s=127>i?64:98;switch((a(i,64,126)||a(i,161,254))&&(o=157*(r-129)+(i-s)),o){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var l=null===o?null:f(o,m("big5"));return null===l&&A(i)&&e.prepend(i),null===l?h(t):l}return A(i)?i:a(i,129,254)?(n=i,null):h(t)}}function E(e){e.fatal,this.handler=function(e,t){if(-1===t)return-1;if(Q(t))return t;var n=function(e){j=j||m("big5").map((function(e,t){return t<5024?null:e}));var t=j;return 9552===e||9566===e||9569===e||9578===e||21313===e||21317===e?t.lastIndexOf(e):p(e,t)}(t);if(null===n)return u(t);var i=z(n/157)+129;if(161>i)return u(t);var r=n%157;return[i,r+(63>r?64:98)]}}function S(e){var t=e.fatal,n=!1,i=0;this.handler=function(e,r){if(-1===r&&0!==i)return i=0,h(t);if(-1===r&&0===i)return-1;if(142===i&&a(r,161,223))return i=0,65216+r;if(143===i&&a(r,161,254))return n=!0,i=r,null;if(0!==i){var o=i;i=0;var s=null;return a(o,161,254)&&a(r,161,254)&&(s=f(94*(o-161)+(r-161),m(n?"jis0212":"jis0208"))),n=!1,a(r,161,254)||e.prepend(r),null===s?h(t):s}return A(r)?r:142===r||143===r||a(r,161,254)?(i=r,null):h(t)}}function T(e){e.fatal,this.handler=function(e,t){if(-1===t)return-1;if(Q(t))return t;if(165===t)return 92;if(8254===t)return 126;if(a(t,65377,65439))return[142,t-65377+161];8722===t&&(t=65293);var n=p(t,m("jis0208"));return null===n?u(t):[z(n/94)+161,n%94+161]}}function _(e){var t=e.fatal,n=0,i=1,r=2,o=3,s=4,l=5,A=6,c=n,u=n,d=0,p=!1;this.handler=function(e,v){switch(c){default:case n:return 27===v?(c=l,null):a(v,0,127)&&14!==v&&15!==v&&27!==v?(p=!1,v):-1===v?-1:(p=!1,h(t));case i:return 27===v?(c=l,null):92===v?(p=!1,165):126===v?(p=!1,8254):a(v,0,127)&&14!==v&&15!==v&&27!==v&&92!==v&&126!==v?(p=!1,v):-1===v?-1:(p=!1,h(t));case r:return 27===v?(c=l,null):a(v,33,95)?(p=!1,65344+v):-1===v?-1:(p=!1,h(t));case o:return 27===v?(c=l,null):a(v,33,126)?(p=!1,d=v,c=s,null):-1===v?-1:(p=!1,h(t));case s:if(27===v)return c=l,h(t);if(a(v,33,126)){c=o;var g=f(94*(d-33)+v-33,m("jis0208"));return null===g?h(t):g}return-1===v?(c=o,e.prepend(v),h(t)):(c=o,h(t));case l:return 36===v||40===v?(d=v,c=A,null):(e.prepend(v),p=!1,c=u,h(t));case A:var y=d;d=0;var w=null;if(40===y&&66===v&&(w=n),40===y&&74===v&&(w=i),40===y&&73===v&&(w=r),36===y&&(64===v||66===v)&&(w=o),null!==w){c=c=w;var x=p;return p=!0,x?h(t):null}return e.prepend([y,v]),p=!1,c=u,h(t)}}}function I(e){e.fatal;var t=0,n=1,i=2,r=t;this.handler=function(e,a){if(-1===a&&r!==t)return e.prepend(a),r=t,[27,40,66];if(-1===a&&r===t)return-1;if(!(r!==t&&r!==n||14!==a&&15!==a&&27!==a))return u(65533);if(r===t&&Q(a))return a;if(r===n&&(Q(a)&&92!==a&&126!==a||165==a||8254==a)){if(Q(a))return a;if(165===a)return 92;if(8254===a)return 126}if(Q(a)&&r!==t)return e.prepend(a),r=t,[27,40,66];if((165===a||8254===a)&&r!==n)return e.prepend(a),r=n,[27,40,74];8722===a&&(a=65293);var o=p(a,m("jis0208"));return null===o?u(a):r!==i?(e.prepend(a),r=i,[27,36,66]):[z(o/94)+33,o%94+33]}}function L(e){var t=e.fatal,n=0;this.handler=function(e,i){if(-1===i&&0!==n)return n=0,h(t);if(-1===i&&0===n)return-1;if(0!==n){var r=n,o=null;n=0;var s=127>i?64:65,l=160>r?129:193;if((a(i,64,126)||a(i,128,252))&&(o=188*(r-l)+i-s),a(o,8836,10715))return 48508+o;var c=null===o?null:f(o,m("jis0208"));return null===c&&A(i)&&e.prepend(i),null===c?h(t):c}return A(i)||128===i?i:a(i,161,223)?65216+i:a(i,129,159)||a(i,224,252)?(n=i,null):h(t)}}function F(e){e.fatal,this.handler=function(e,t){if(-1===t)return-1;if(Q(t)||128===t)return t;if(165===t)return 92;if(8254===t)return 126;if(a(t,65377,65439))return t-65377+161;8722===t&&(t=65293);var n=function(e){return V=V||m("jis0208").map((function(e,t){return a(t,8272,8835)?null:e})),V.indexOf(e)}(t);if(null===n)return u(t);var i=z(n/188),r=n%188;return[i+(31>i?129:193),r+(63>r?64:65)]}}function k(e){var t=e.fatal,n=0;this.handler=function(e,i){if(-1===i&&0!==n)return n=0,h(t);if(-1===i&&0===n)return-1;if(0!==n){var r=n,o=null;n=0,a(i,65,254)&&(o=190*(r-129)+(i-65));var s=null===o?null:f(o,m("euc-kr"));return null===o&&A(i)&&e.prepend(i),null===s?h(t):s}return A(i)?i:a(i,129,254)?(n=i,null):h(t)}}function P(e){e.fatal,this.handler=function(e,t){if(-1===t)return-1;if(Q(t))return t;var n=p(t,m("euc-kr"));return null===n?u(t):[z(n/190)+129,n%190+65]}}function U(e,t){var n=e>>8,i=255&e;return t?[n,i]:[i,n]}function D(e,t){var n=t.fatal,i=null,r=null;this.handler=function(t,o){if(-1===o&&(null!==i||null!==r))return h(n);if(-1===o&&null===i&&null===r)return-1;if(null===i)return i=o,null;var s;if(s=e?(i<<8)+o:(o<<8)+i,i=null,null!==r){var l=r;return r=null,a(s,56320,57343)?65536+1024*(l-55296)+(s-56320):(t.prepend(U(s,e)),h(n))}return a(s,55296,56319)?(r=s,null):a(s,56320,57343)?h(n):s}}function R(e,t){t.fatal,this.handler=function(t,n){if(-1===n)return-1;if(a(n,0,65535))return U(n,e);var i=U(55296+(n-65536>>10),e),r=U(56320+(1023&n-65536),e);return i.concat(r)}}function O(e){e.fatal,this.handler=function(e,t){return-1===t?-1:A(t)?t:63360+t-128}}function N(e){e.fatal,this.handler=function(e,t){return-1===t?-1:Q(t)?t:a(t,63360,63487)?t-63360+128:u(t)}}void 0!==n&&n.exports&&!i["encoding-indexes"]&&t("./encoding-indexes.js");var z=e,Q=A;c.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():-1},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.pop());else this.tokens.push(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.shift());else this.tokens.unshift(e)}};var G=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],H={};G.forEach((function(e){e.encodings.forEach((function(e){e.labels.forEach((function(t){H[t]=e}))}))}));var V,j,W={},X={};Object.defineProperty&&(Object.defineProperty(v.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(v.prototype,"fatal",{get:function(){return"fatal"===this._error_mode}}),Object.defineProperty(v.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}})),v.prototype.decode=function(e,t){var n;n="object"==r(e)&&e instanceof ArrayBuffer?new Uint8Array(e):"object"==r(e)&&"buffer"in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(0),t=o(t),this._do_not_flush||(this._decoder=X[this._encoding.name]({fatal:"fatal"===this._error_mode}),this._BOMseen=!1),this._do_not_flush=!!t.stream;for(var i,a,s=new c(n),A=[];-1!==(a=s.read())&&-1!==(i=this._decoder.handler(s,a));)null!==i&&(Array.isArray(i)?A.push.apply(A,i):A.push(i));if(!this._do_not_flush){do{if(-1===(i=this._decoder.handler(s,s.read())))break;null!==i&&(Array.isArray(i)?A.push.apply(A,i):A.push(i))}while(!s.endOfStream());this._decoder=null}return function(e){return!function(e,t){return-1!==e.indexOf(t)}(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)||this._ignoreBOM||this._BOMseen||(0<e.length&&65279===e[0]?(this._BOMseen=!0,e.shift()):0<e.length&&(this._BOMseen=!0)),l(e)}.call(this,A)},Object.defineProperty&&Object.defineProperty(g.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),g.prototype.encode=function(e,t){e=void 0===e?"":e+"",t=o(t),this._do_not_flush||(this._encoder=W[this._encoding.name]({fatal:"fatal"===this._fatal})),this._do_not_flush=!!t.stream;for(var n,i,r=new c(function(e){for(var t=e+"",n=t.length,i=0,r=[];i<n;){var a=t.charCodeAt(i);if(55296>a||57343<a)r.push(a);else if(56320<=a&&57343>=a)r.push(65533);else if(55296<=a&&56319>=a)if(i===n-1)r.push(65533);else{var o=t.charCodeAt(i+1);56320<=o&&57343>=o?(r.push(65536+((1023&a)<<10)+(1023&o)),i+=1):r.push(65533)}i+=1}return r}(e)),a=[];-1!==(i=r.read())&&-1!==(n=this._encoder.handler(r,i));)Array.isArray(n)?a.push.apply(a,n):a.push(n);if(!this._do_not_flush){for(;-1!==(n=this._encoder.handler(r,r.read()));)Array.isArray(n)?a.push.apply(a,n):a.push(n);this._encoder=null}return new Uint8Array(a)},W["UTF-8"]=function(e){return new w(e)},X["UTF-8"]=function(e){return new y(e)},"encoding-indexes"in i&&G.forEach((function(e){"Legacy single-byte encodings"!==e.heading||e.encodings.forEach((function(e){var t=e.name,n=m(t.toLowerCase());X[t]=function(e){return new x(n,e)},W[t]=function(e){return new b(n,e)}}))})),X.GBK=function(e){return new M(e)},W.GBK=function(e){return new C(e,!0)},W.gb18030=function(e){return new C(e)},X.gb18030=function(e){return new M(e)},W.Big5=function(e){return new E(e)},X.Big5=function(e){return new B(e)},W["EUC-JP"]=function(e){return new T(e)},X["EUC-JP"]=function(e){return new S(e)},W["ISO-2022-JP"]=function(e){return new I(e)},X["ISO-2022-JP"]=function(e){return new _(e)},W.Shift_JIS=function(e){return new F(e)},X.Shift_JIS=function(e){return new L(e)},W["EUC-KR"]=function(e){return new P(e)},X["EUC-KR"]=function(e){return new k(e)},W["UTF-16BE"]=function(e){return new R(!0,e)},X["UTF-16BE"]=function(e){return new D(!0,e)},W["UTF-16LE"]=function(e){return new R(!1,e)},X["UTF-16LE"]=function(e){return new D(!1,e)},W["x-user-defined"]=function(e){return new N(e)},X["x-user-defined"]=function(e){return new O(e)},i.TextEncoder||(i.TextEncoder=g),i.TextDecoder||(i.TextDecoder=v),void 0!==n&&n.exports&&(n.exports={TextEncoder:i.TextEncoder,TextDecoder:i.TextDecoder,EncodingIndexes:i["encoding-indexes"]})}(this||{})},{"./encoding-indexes.js":7}],22:[function(e,t,n){(function(t,i){(function(){function r(e,t){this._id=e,this._clearFn=t}var a=e("process/browser.js").nextTick,o=Function.prototype.apply,s=Array.prototype.slice,l={},A=0;n.setTimeout=function(){return new r(o.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new r(o.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(e){e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},n.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},n._unrefActive=n.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n.setImmediate="function"==typeof t?t:function(e){var t=A++,i=!(2>arguments.length)&&s.call(arguments,1);return l[t]=!0,a((function(){l[t]&&(i?e.apply(null,i):e.call(null),n.clearImmediate(t))})),t},n.clearImmediate="function"==typeof i?i:function(e){delete l[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":16,timers:22}],23:[function(e,t){(function(n){(function(){function r(e){if(!e)throw new Error("forgot to pass buffer");return v.isBuffer(e)?e:a(e)?v.from(e):a(e.buffer)?1===e.BYTES_PER_ELEMENT?v.from(e):v.from(e.buffer):void 0}function a(e){return e instanceof n.ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(e)}function s(e,t){return"string"==typeof e&&y.has(e)?p.resolve(y.get(e)):s.getShapefile(e,t).then((function(t){return"string"==typeof e&&y.set(e,t),t}))}function l(e,t){return A.apply(this,arguments)}function A(){return A=o(i().mark((function e(t,n){var r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u(t);case 2:return r=e.sent,e.abrupt("return",s.parseZip(r,n));case 4:case"end":return e.stop()}}),e)}))),A.apply(this,arguments)}var c=e("proj4");c.default&&(c=c.default);var h=e("./unzip"),u=e("./binaryajax"),d=e("./parseShp"),f=e("parsedbf"),p=e("lie"),m=e("lru-cache"),v=e("buffer").Buffer,g=n.URL,y=new m({max:20});s.combine=function(e){var t=M(e,2),n=t[0],i=t[1],r={type:"FeatureCollection",features:[]},a=0,o=n.length;for(i||(i=[]);a<o;)r.features.push({type:"Feature",geometry:n[a],properties:i[a]||{}}),a++;return r},s.parseZip=function(){var e=o(i().mark((function e(t,n){var a,o,l,A;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r(t),e.next=3,h(t);case 3:for(l in a=e.sent,o=[],n=n||[],a)-1===l.indexOf("__MACOSX")&&("shp"===l.slice(-3).toLowerCase()?(o.push(l.slice(0,-4)),a[l.slice(0,-3)+l.slice(-3).toLowerCase()]=a[l]):"prj"===l.slice(-3).toLowerCase()?a[l.slice(0,-3)+l.slice(-3).toLowerCase()]=c(a[l]):"json"===l.slice(-4).toLowerCase()||-1<n.indexOf(l.split(".").pop())?o.push(l.slice(0,-3)+l.slice(-3).toLowerCase()):("dbf"===l.slice(-3).toLowerCase()||"cpg"===l.slice(-3).toLowerCase())&&(a[l.slice(0,-3)+l.slice(-3).toLowerCase()]=a[l]));if(o.length){e.next=8;break}throw new Error("no layers founds");case 8:return A=o.map((function(e){var t,i,r=e.lastIndexOf(".");return-1<r&&-1<e.slice(r).indexOf("json")?(t=JSON.parse(a[e])).fileName=e.slice(0,r):-1<n.indexOf(e.slice(r+1))?(t=a[e]).fileName=e:(a[e+".dbf"]&&(i=f(a[e+".dbf"],a[e+".cpg"])),(t=s.combine([d(a[e+".shp"],a[e+".prj"]),i])).fileName=e),t})),e.abrupt("return",1===A.length?A[0]:A);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();var w=function(){var e=o(i().mark((function e(t){var n,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.all([u(t,"shp"),u(t,"prj")]);case 2:n=e.sent,r=!1;try{n[1]&&(r=c(n[1]))}catch(e){r=!1}return e.abrupt("return",d(n[0],r));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),x=function(){var e=o(i().mark((function e(t){var n,r,a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.all([u(t,"dbf"),u(t,"cpg")]);case 2:return n=e.sent,r=M(n,2),a=r[0],o=r[1],e.abrupt("return",a?f(a,o):void 0);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),b=function(e,t){return new g(e).pathname.slice(-4).toLowerCase()===t};s.getShapefile=function(){var e=o(i().mark((function e(t,n){var r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"==typeof t){e.next=2;break}return e.abrupt("return",s.parseZip(t));case 2:if(!b(t,".zip")){e.next=4;break}return e.abrupt("return",l(t,n));case 4:return e.next=6,p.all([w(t),x(t)]);case 6:return r=e.sent,e.abrupt("return",s.combine(r));case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),s.parseShp=function(e,t){if(e=r(e),v.isBuffer(t)&&(t=t.toString()),"string"==typeof t)try{t=c(t)}catch(e){t=!1}return d(e,t)},s.parseDbf=function(e,t){return e=r(e),f(e,t)},t.exports=s}).call(this)}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{"./binaryajax":2,"./parseShp":4,"./unzip":5,buffer:8,lie:12,"lru-cache":13,parsedbf:15,proj4:17}]},{},[23])(23)}));var uk,dk,fk,pk,mk,vk,gk,yk,wk=shp,xk=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n=xC(n),e.zip?t=wk.parseZip(e.zip):e.shp&&e.shx&&e.dbf&&(t=Promise.all([wk.parseShp(e.shp,e.prj),wk.parseDbf(e.dbf)]).then(wk.combine)),n.in=n.in||{},n.in.crs=e.prj?Zy(e.prj).oProj.datumName:void 0,Promise.resolve(t).then((function(e){return _C.parse(e,n)}))},bk=function(){function e(t){s(this,e),this.classes=t.classes,this.inverseHierarchy={},this.instancesIdxs=[];var n={},i=0,r=t.parentCounts;void 0===r&&(r=new Array(t.instancesLength)).fill(1);for(var a=0;a<t.instancesLength;a++){for(var o=0;o<r[a];o++)a!==t.parentIds[i]&&(void 0===this.inverseHierarchy[a]&&(this.inverseHierarchy[a]=[]),this.inverseHierarchy[a].push(t.parentIds[i]),i++);var l=t.classIds[a];void 0===n[l]&&(n[l]=0),this.instancesIdxs[a]={classId:l,instanceIdx:n[l]},n[l]++}}return A(e,[{key:"getInfoById",value:function(e){var t={},n=this.instancesIdxs[e].classId,i=this.classes[n].name,r=this.instancesIdxs[e].instanceIdx,a=this.classes[n].instances;for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(t[o]=a[o][r]);var s={};if(s[i]=t,this.inverseHierarchy&&this.inverseHierarchy[e]){var l,A=S(this.inverseHierarchy[e]);try{for(A.s();!(l=A.n()).done;){var c=l.value;Object.assign(s,this.getInfoById(c))}}catch(e){A.e(e)}finally{A.f()}}return s}}]),e}(),Mk="a7fbb569ae07158a0350f2952b4ee2a1",Ck={token:Mk,TianDiTu:{imagery:{id:"TianDiTu_imagery",url:"https://${u:t0|t1|t2|t3|t4|t5|t6|t7}.tianditu.gov.cn/img_w/wmts",crs:"EPSG:3857",networkOptions:{crossOrigin:"anonymous"},format:"tiles",tk:Mk,style:"default",zoom:{min:1,max:18},name:"img",tileMatrixSet:"w",type:"WMTS"},imageryLabel:{id:"TianDiTu_imageryLabel",url:"https://${u:t0|t1|t2|t3|t4|t5|t6|t7}.tianditu.gov.cn/cia_w/wmts",crs:"EPSG:3857",networkOptions:{crossOrigin:"anonymous"},format:"tiles",tk:Mk,style:"default",zoom:{min:1,max:18},name:"cia",tileMatrixSet:"w",type:"WMTS"},vector:{id:"TianDiTu_vector",url:"https://${u:t0|t1|t2|t3|t4|t5|t6|t7}.tianditu.gov.cn/vec_w/wmts",crs:"EPSG:3857",networkOptions:{crossOrigin:"anonymous"},format:"tiles",tk:Mk,style:"default",zoom:{min:1,max:18},name:"vec",tileMatrixSet:"w",type:"WMTS"},vectorLabel:{id:"TianDiTu_vectorLabel",url:"https://${u:t0|t1|t2|t3|t4|t5|t6|t7}.tianditu.gov.cn/cva_w/wmts",crs:"EPSG:3857",networkOptions:{crossOrigin:"anonymous"},format:"tiles",tk:Mk,style:"default",zoom:{min:1,max:18},name:"cva",tileMatrixSet:"w",type:"WMTS"}},ArcGIS:{imagery:{id:"ArcGIS_imagery",url:"https://server.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/WMTS",crs:"EPSG:3857",networkOptions:{crossOrigin:"anonymous"},format:"tiles",style:"default",zoom:{min:1,max:23},name:"img",tileMatrixSet:"GoogleMapsCompatible",type:"WMTS"},vector:{id:"ArcGIS_vector",url:"http://cache1.arcgisonline.cn/arcgis/rest/services/ChinaOnlineCommunity_Mobile/MapServer/tile/${z}/${y}/${x}",crs:"EPSG:3857",networkOptions:{crossOrigin:"anonymous"},format:"tiles",style:"default",zoom:{min:1,max:21},name:"img",tileMatrixSet:"w",type:"WMTS"},vector_blue:{id:"ArcGIS_vector_blue",url:"http://cache1.arcgisonline.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer/tile/${z}/${y}/${x}",crs:"EPSG:3857",networkOptions:{crossOrigin:"anonymous"},format:"tiles",style:"default",zoom:{min:1,max:21},name:"img",tileMatrixSet:"w",type:"WMTS"}},GaoDe:{imagery:{id:"GaoDe_imagery",crs:"EPSG:3857",isInverted:!0,format:"image/png",url:"https://webst02.is.autonavi.com/appmaptile?style=6&x=${x}&y=${y}&z=${z}",tileMatrixSet:"w",zoom:{min:1,max:18},type:"TMS"},imageryLabel:{id:"GaoDe_imageryLabel",url:"https://webst02.is.autonavi.com/appmaptile?style=8&x=${x}&y=${y}&z=${z}",crs:"EPSG:3857",format:"tiles",tk:"a7fbb569ae07158a0350f2952b4ee2a1",style:"default",zoom:{min:1,max:18},name:"cia",tileMatrixSet:"w",type:"TMS"},vector:{id:"GaoDe_vector",crs:"EPSG:3857",isInverted:!0,format:"image/png",url:"https://webst02.is.autonavi.com/appmaptile?style=7&x=${x}&y=${y}&z=${z}",tileMatrixSet:"PM",zoom:{min:1,max:18},type:"TMS"}},WORLD_DTM:{id:"MNT_WORLD_SRTM3",noDataValue:-99999,updateStrategy:{type:1,options:{groups:[3,7,9]}},source:{format:"image/x-bil;bits=32",crs:"EPSG:4326",url:"https://t0.tianditu.gov.cn/mapservice/swdx?T=elv_c&x=${x}&y=${y}&l=${z}",tk:Mk,name:"img",tileMatrixSet:"w",tileMatrixSetLimits:{3:{minTileRow:1,maxTileRow:6,minTileCol:0,maxTileCol:16},4:{minTileRow:2,maxTileRow:12,minTileCol:0,maxTileCol:32},5:{minTileRow:5,maxTileRow:25,minTileCol:0,maxTileCol:64},6:{minTileRow:10,maxTileRow:51,minTileCol:0,maxTileCol:128},7:{minTileRow:20,maxTileRow:103,minTileCol:0,maxTileCol:256},8:{minTileRow:41,maxTileRow:207,minTileCol:0,maxTileCol:512},9:{minTileRow:82,maxTileRow:415,minTileCol:0,maxTileCol:1024},10:{minTileRow:164,maxTileRow:830,minTileCol:0,maxTileCol:2048}}}},MNT_HIGHRES:{id:"IGN_MNT_HIGHRES",noDataValue:-99999,updateStrategy:{type:1,options:{groups:[11,14]}},source:{url:"https://wxs.ign.fr/altimetrie/geoportail/wmts",crs:"EPSG:4326",format:"image/x-bil;bits=32",attribution:{name:"IGN",url:"http://www.ign.fr/"},name:"ELEVATION.ELEVATIONGRIDCOVERAGE.HIGHRES",tileMatrixSet:"WGS84G",tileMatrixSetLimits:{11:{minTileRow:442,maxTileRow:1267,minTileCol:1344,maxTileCol:2683},12:{minTileRow:885,maxTileRow:2343,minTileCol:3978,maxTileCol:5126},13:{minTileRow:1770,maxTileRow:4687,minTileCol:7957,maxTileCol:10253},14:{minTileRow:3540,maxTileRow:9375,minTileCol:15914,maxTileCol:20507}}}}},Bk=function(){function e(t){var n=this;s(this,e),this.view=t.mapView,this._visible=!0,this.element=document.createElement("div"),this.element.innerHTML='\n<div>\n <div class="bottom-widget right-widget" id="widgets-scale" title="离地高度"\n style="width:200px; height: 30px; transform: translate(-80px, 0px);">90 km\n </div>\n <div class="bottom-widget right-widget column-widget" id="widgets-navigation" style="transform: translate(0px, -40px);">\n <div class="widget-button-bar" id="widgets">\n <button class="widget-button" id="compass" title="指北针" tabindex="-1"\n style="transform: rotate(0deg);"></button>\n </div>\n <div class="widget-button-bar">\n <button class="widget-button" id="button-3d" title="切换3D/2D" tabindex="-1" ">3D\n </button>\n </div>\n\n <div class="widget-button-bar">\n <button class="widget-button" id="home-button" title="默认视角" tabindex="-1" ">\n </button>\n </div>\n\n <div class="widget-button-bar" id="zoom-button-bar">\n <button class="widget-button" id="zoom-in-button" title="放大" tabindex="-1" "><span\n class="widget-zoom-button-logo"></span></button>\n <button class="widget-button" id="zoom-out-button" title="缩小" tabindex="-1" ">\n <span id="zoom-out-logo" class="widget-zoom-button-logo"></span>\n </button>\n </div>\n </div>\n</div>',t.container.appendChild(this.element),this.compass=t.container.querySelector("#compass"),this.widgetsScale=t.container.querySelector("#widgets-scale"),this.btn3d=t.container.querySelector("#button-3d"),this.element.querySelector("#zoom-in-button").onclick=function(){n.view.controls.zoomIn()},this.element.querySelector("#zoom-out-button").onclick=function(){n.view.controls.zoomOut()},this.btn3d.onclick=function(){n.view.controls.setTilt("3D"===n.btn3d.innerText?40:90,!0),n.btn3d.innerText="3D"===n.btn3d.innerText?"2D":"3D"},this.element.querySelector("#home-button").onclick=function(){t.controls.flyTo(t.defaultView)},this.view.controls.addEventListener("range-changed",(function(e){var t=Math.round(n.view.getPixelsToMeters(200)),i=Math.pow(10,t.toString().length-1);t=Math.round(t/i)*i;var r=n.view.getMetersToPixels(t),a="m";t>=1e3&&(t/=1e3,a="km"),n.widgetsScale.innerHTML="".concat(t," ").concat(a),n.widgetsScale.style.width="".concat(r,"px")})),this.view.addEventListener(AMRT.Event.CAMERA_MOVED,(function(e){n.compass.style.transform="rotate(".concat(-e.heading,"deg)"),n.btn3d.innerText=e.tilt<89?"2D":"3D"}))}return A(e,[{key:"visible",get:function(){return this._visible},set:function(e){this._visible=e,this.element.style.display=e?"block":"none"}}]),e}(),Ek={coord:[108.5525,34.3227],range:10204904,tilt:90,heading:.001},Sk="globe",Tk="planar",_k=function(e){h(n,e);var t=y(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this,n),zt.DefaultUp.set(0,0,1),window.__DEBUG__=!1,r.logarithmicDepthBuffer=!0,(i=t.call(this,e,r)).name="GISViewer",i.options=r,i.isGISViewer=!0,i}return A(n,[{key:"initialize",value:function(e){b(u(n.prototype),"initialize",this).call(this,e),this.camera.frustumCulled=!0,this.scene.background=null,this.renderer.setClearAlpha(1),this.defaultView=Ek,this.controlsMap={},this.viewType=e.viewType||Sk,this.viewType===Sk?(this.mapView=new CI(this.container,this.defaultView,{camera:this.camera,renderer:this.renderer,scene3D:this.scene}),this.controlsMap[pp.GLOBE]=this.mapView.controls,this.viewMode=pp.GLOBE):this.viewType===Tk&&(e.extent=e.extent||new bb("EPSG:3857",-20037508.342789244,20037508.342789244,-20037508.342789255,20037508.342789244),this.mapView=new yL(this.container,e.extent,{disableSkirt:!1,maxSubdivisionLevel:19,placement:e.view,camera:this.camera,renderer:this.renderer,scene3D:this.scene}),this.viewMode=pp.PLANAR,this.controlsMap[pp.PLANAR]=this.mapView.controls),this.globe=this.mapView,this.mapView.render=this.renderManager.render,this.controls=this.mapView.controls,this.camera.near=.1,this.camera.updateProjectionMatrix(),If.bindAll(["onUpdate","_onGlobeComplete"],this),this.onGlebeComplete=!1,this.controls.enabled=!1,this.mapView.addEventListener(QS,this._onGlobeComplete),setTimeout(this._onGlobeComplete,2e3),this.mapCenter=this.coordinatesToVector3(e.view?e.view.coord:Ek.coord),this.addEventListener("update",this.onUpdate),Ck.token=e.mapToken||Ck.token,this._elevationLayers=[],this.initLayer(e),this.navigationBar=new Bk(this),e.navigation||(this.navigationBar.visible=!1)}},{key:"_onGlobeComplete",value:function(){var e=this;this.onGlebeComplete||(this.options.showTerrain&&(this._elevationLayers.push(this.loadElevationLayer(Ck.WORLD_DTM)),this._elevationLayers.push(this.loadElevationLayer(Ck.MNT_HIGHRES))),this.mapView.isGlobeView&&this.options.view?(this.defaultView=this.options.view,this.defaultView.onComplete=function(){e.defaultView.onComplete=null,e.controls.enabled=!0,e.dispatchEvent(ld.MAP_INIT)},this.controls.flyTo(this.defaultView)):(this.controls.enabled=!0,this.dispatchEvent(ld.MAP_INIT)),this.onGlebeComplete=!0)}},{key:"initLayer",value:function(e){var t=this;(e.mapSource||[Ck.TianDiTu.imagery]).forEach((function(e){t.loadColorLayer(e)}))}},{key:"addModel",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{noFit:!0};return b(u(n.prototype),"addModel",this).call(this,e,t)}},{key:"loadModel",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.onLoad;return i.noSky=!0,i.focus=!1,i.background=!1,i.addModel=!1,i.onLoad=function(e){var n=new ja;if(n.name="modelBox",n.isModelBox=!0,t.modelGroup.add(n),!i.coord&&e.coordinate&&2===e.coordinate.split(",").length){var a=e.coordinate.split(",");i.coord=[Number(a[1]),Number(a[0])]}i.coord&&(i.coord.isVector3?n.position.copy(i.coord):Array.isArray(i.coord)?3===i.coord.length?n.position.fromArray(i.coord):2===i.coord.length&&n.position.copy(t.coordinatesToVector3(i.coord)):i.coord.isCoordinates&&n.position.copy(t.coordinatesToVector3(i.coord)));var o=n.position.clone().normalize().add(n.position);e.isModel&&(e.position.y+=e.getSize().y/2),n.lookAt(o),n.rotateX(Math.PI/2),n.add(e),r&&r(e)},b(u(n.prototype),"loadModel",this).call(this,e,i)}},{key:"loadColorLayer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;e.tk=Ck.token,e.zoom=e.zoom||{min:1,max:18},e.crs=e.crs||"EPSG:3857";var n=e.id;"WMTS"===e.type?e=new ok(e):"TMS"===e.type&&(e=new rk(e));var i=new wF(n,{source:e});return this.mapView.addLayer(i).then((function(){t&&t()})),i}},{key:"loadWFSLayer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.protocol="wfs",e.crs=e.crs||"EPSG:4326",e.typeName=e.name;var t=new ak(e),n=new G_(e.id||(new ja).id,new ja,{name:e.name,update:CL.update,convert:rF({color:new Fn(e.color||"#00ff00"),opacity:e.opacity,altitude:5}),source:t,zoom:{min:3},transparent:!0,opacity:.5});return this.mapView.addLayer(n),n}},{key:"loadSHPLayer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.mapView;return $M.multiple(e.url,{arrayBuffer:["shp","dbf","shx"],text:["prj"]}).then((function(e){return xk(e,{out:{crs:"EPSG:3857",buildExtent:!0}})})).then((function(n){var i=new nk({features:n}),r=new lC(e.style),a=new wF(e.id||(new ja).id,{source:i,style:r,addLabelLayer:!0});return t.addLayer(a)}))}},{key:"loadGeoJSONLayer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.format=e.format||"application/json",e.crs=e.crs||"EPSG:4326";var t=new nk(e),n=new wF(e.id||(new ja).id,{transparent:!0,source:t,style:new lC(e.style)});return this.mapView.addLayer(n),n}},{key:"removeLayerById",value:function(e){this.mapView.removeLayer(e)}},{key:"getLayerById",value:function(e){return this.mapView.getLayerById(e)}},{key:"getLayers",value:function(){return this.mapView.getLayers().splice(2)}},{key:"load3DTilesLayer",value:function(e,t){var n=new JF;n.registerExtension("3DTILES_batch_table_hierarchy",c({},JE,bk));var i=e.id||(new zt).id,r=new $F(i,{name:e.name||i,source:new hk(e),registeredExtensions:n},this.mapView);return $S.prototype.addLayer.call(this.mapView,r).then((function(){t&&t()})),r}},{key:"coordinatesToVector3",value:function(e){return Array.isArray(e)&&(e=new ob("EPSG:4326",e[0],e[1])),e.as(this.mapView.referenceCrs).toVector3()}},{key:"vector3ToCoordinates",value:function(e){var t=new ob("EPSG:4978").setFromVector3(e).as("EPSG:4326");return[t.longitude,t.latitude]}},{key:"pickPosition",value:function(e){return this.mapView.getPickingPositionFromDepth(this.mapView.eventToViewCoords(e))}},{key:"pickCoordinates",value:function(e,t){return this.mapView.pickCoordinates(e,t)}},{key:"computeDistance",value:function(e,t){return e.isVector3&&(e=this.vector3ToCoordinates(e)),t.isVector3&&(t=this.vector3ToCoordinates(t)),e.isCoordinates&&(e=[e.x,e.y]),t.isCoordinates&&(t=[t.x,t.y]),If.computeDistance(e,t)}},{key:"getObjectCoord",value:function(e){return this.vector3ToCoordinates(e.getWorldPosition(new at))}},{key:"setObjectCoord",value:function(e,t){e&&(e.isModel&&(e=e.parent),e.position.copy(this.coordinatesToVector3(t)))}},{key:"setViewMode",value:function(e){if(this.viewMode!==e){switch(this.viewMode=e,this.controls.enabled=!1,e){case pp.GLOBE:this.controls=this.mapView.controls=this.controlsMap[pp.GLOBE];break;case pp.ROAM_FREE:this.controls=this.mapView.controls=this.controlsMap[pp.ROAM_FREE]||new HL(this.mapView);break;case pp.FLY:this.controls=this.mapView.controls=this.controlsMap[pp.FLY]||new kL(this.mapView);case pp.DRIVE:case pp.ROAM_AUTO:}this.controls.enabled=!0}}},{key:"fitCamera",value:function(){}},{key:"_initControls",value:function(){this.camera.defaultPos=this.camera.position.clone()}},{key:"_proxyEvent",value:function(){var e=this;this.renderManager.addEventListener(ld.UPDATE,(function(){e.dispatchEvent(ld.UPDATE)})),this.modelManager.addEventListener(ld.MODEL_UPDATE,(function(){e.dispatchEvent(ld.MODEL_UPDATE)}))}},{key:"loadElevationLayer",value:function(e){e.source=new ok(e.source);var t=new xF(e.id,e);return this.mapView.addLayer(t),t}},{key:"showElevationLayer",value:function(){this._elevationLayers.forEach((function(e){e.visible=!0}))}},{key:"hideElevationLayer",value:function(){this._elevationLayers.forEach((function(e){e.visible=!1}))}},{key:"getCoordsByAddress",value:function(e,t){var n=this;lu.getCoordsByAddress(e,(function(e){if(e.bound){var i=e.bound.split(","),r=n.computeDistance([Number(i[0]),Number(i[1])],[Number(i[0]),Number(i[3])]),a=n.computeDistance([Number(i[0]),Number(i[1])],[Number(i[2]),Number(i[1])]);e.range=Math.max(r,a)}t(e.coord,e.range)}))}},{key:"positioning",value:function(e,t){var n=this;Ek.onComplete=function(){n.controls.flyTo({coord:e,tilt:90,heading:.001,range:t}),Ek.onComplete=void 0},this.controls.flyTo(Ek)}},{key:"onUpdate",value:function(){}},{key:"dispose",value:function(){this.mapView.dispose(),b(u(n.prototype),"dispose",this).call(this)}}]),n}(Rg),Ik=function(){function e(){s(this,e)}return A(e,null,[{key:"createLine",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#ffffff",n=new Li;return e.forEach((function(e){n.vertices.push((new at).copy(e))})),new Go(n,new Do({color:t}))}},{key:"createSprite",value:function(e,t){var n=new go(new ro({map:(new tA).load(e,(function(e){}))}));return n.scale.set(t,t,t),n}},{key:"createPointLight",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#ffffff",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=new LA(e,t,n);return i}},{key:"createSpotLight",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"#ffffff",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Math.PI/3,r=new _A(e,t,n,i);return r}},{key:"createBoundingBox",value:function(e,t){return new Lh(e,t)}},{key:"createFontMesh",value:function(e,t,n){(n=n||{}).font=e;var i=new Js(t,n);return i.computeBoundingBox(),new Ei(i,new Vh([new wl({color:n.color,shading:1}),new wl({color:n.color,shading:2})]))}},{key:"createLightHelper",value:function(e){var t;return e.isDirectionalLight?t=new Bh(e,1):e.isSpotLight?t=new nh(e):e.isPointLight&&(t=new lh(e)),t}},{key:"createPlane",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#ffffff",i=new $i(e,t),r=new Ei(i,new Nn({color:n}));return r.rotation.x=-Math.PI/2,r}}]),e}(),Lk=function(e,t){hu.call(this),void 0===du&&console.error("TexturePass relies on CopyShader");var n=du;this.map=e,this.opacity=void 0!==t?t:1,this.uniforms=Di.clone(n.uniforms),this.material=new Ri({uniforms:this.uniforms,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,depthTest:!1,depthWrite:!1}),this.needsSwap=!1,this.fsQuad=new hu.FullScreenQuad(null)};Lk.prototype=Object.assign(Object.create(hu.prototype),{constructor:Lk,render:function(e,t,n){var i=e.autoClear;e.autoClear=!1,this.fsQuad.material=this.material,this.uniforms.opacity.value=this.opacity,this.uniforms.tDiffuse.value=this.map,this.material.transparent=this.opacity<1,e.setRenderTarget(this.renderToScreen?null:n),this.clear&&e.clear(),this.fsQuad.render(e),e.autoClear=i}});var Fk={uniforms:{tDiffuse:{value:null},pixelSize:{value:null},kernel:{value:null}},vertexShader:"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }\n ",fragmentShader:"\n uniform sampler2D tDiffuse;\n uniform float pixelSize;\n uniform float kernel[25];\n varying vec2 vUv;\n void main(){\n vec4 texel = \n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2(-2, 2)))) * kernel[0] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2(-1, 2)))) * kernel[1] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2( 0, 2)))) * kernel[2] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2( 1, 2)))) * kernel[3] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2( 2, 2)))) * kernel[4] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2(-2, 1)))) * kernel[5] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2(-1, 1)))) * kernel[6] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2( 0, 1)))) * kernel[7] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2( 1, 1)))) * kernel[8] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2( 2, 1)))) * kernel[9] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2(-2, 0)))) * kernel[10] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2(-1, 0)))) * kernel[11] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2( 0, 0)))) * kernel[12] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2( 1, 0)))) * kernel[13] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2( 2, 0)))) * kernel[14] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2(-2,-1)))) * kernel[15] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2(-1,-1)))) * kernel[16] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2( 0,-1)))) * kernel[17] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2( 1,-1)))) * kernel[18] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2( 2,-1)))) * kernel[19] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2(-2,-2)))) * kernel[20] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2(-1,-2)))) * kernel[21] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2( 0,-2)))) * kernel[22] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2( 1,-2)))) * kernel[23] +\n texture2D(tDiffuse, fract(1.0 + (vUv + pixelSize * vec2( 2,-2)))) * kernel[24] ;\n\n gl_FragColor = texel / 256.0;\n }\n "},kk=new Kf;function Pk(e){if(uk||((uk=new $a({antialias:!0,alpha:!0})).setPixelRatio(window.devicePixelRatio),uk.setClearAlpha(0)),uk.setSize(e,e),dk)pk&&dk.remove(pk),mk&&dk.remove(mk),fk.left=e/-2,fk.right=e/2,fk.top=e/2,fk.bottom=e/-2,fk.updateProjectionMatrix();else{(dk=new Qt).background=null,dk.add(new UA(16777215,.7));var t=new PA(16777215,.7);t.position.set(-1,1,-1).normalize(),dk.add(t),fk=new FA(e/-2,e/2,e/2,e/-2,1,1e3)}fk.position.set(0,0,-e-1),fk.lookAt(0,0,0)}var Uk,Dk,Rk,Ok,Nk,zk,Qk,Gk,Hk=function(){function e(){s(this,e)}return A(e,null,[{key:"generateMaterialIcon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:128;if(Pk(t),pk)pk.material=e;else{var n=new el(1,32,32);pd(n),pk=new Ei(n,e)}return dk.add(pk),pk.scale.set(t/2,t/2,t/2),uk.render(dk,fk),uk.domElement.style.background="transparent",uk.domElement.toDataURL("image/png")}},{key:"generateHDRIcon",value:function(e,t,n){Pk(t=t||128),kk.renderer=uk,kk.load(e,(function(e){var i=new Nn({map:e,side:2});if(mk)mk.material=i;else{var r=new $i(1,1);mk=new Ei(r,i)}dk.add(mk),mk.position.set(0,0,0),mk.scale.set(t,t,t),mk.rotateY(Math.PI),uk.render(dk,fk),n&&n(uk.domElement.toDataURL("image/jpeg"))}))}},{key:"generateTextureIcon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:128;Pk(t);var n=new Nn({map:e,side:2});if(mk)mk.material=n;else{var i=new $i(1,1);mk=new Ei(i,n)}return dk.add(mk),mk.position.set(0,0,0),mk.scale.set(t,t,t),uk.render(dk,fk),uk.domElement.toDataURL("image/jpeg")}},{key:"generateBlurMap",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,i=arguments.length>3?arguments[3]:void 0;Pk(t),vk||(vk=new vu(uk),gk=new Lk,(yk=new fu(Fk)).uniforms.pixelSize.value=2/t,yk.uniforms.kernel.value=[1,4,6,4,1,4,16,24,16,4,6,24,36,24,6,4,16,24,16,4,1,4,6,4,1]),vk.setSize(t,t),vk.passes.length=0,vk.addPass(gk);for(var r=0;r<n;r++)vk.addPass(yk);kk.renderer=uk,kk.load(e,(function(e){gk.map=e,vk.render(),i(vk.renderer.domElement.toDataURL("image/png"))}),(function(){}),(function(){}),256,ie)}}]),e}(),Vk=new tn,jk=[1,1,1],Wk=new at,Xk=new Nn({color:16777215,transparent:!0,opacity:0,depthWrite:!1}),Yk=0,Kk=!1,Zk=0,Jk=30,qk=.3,$k=function(){function e(){s(this,e)}return A(e,null,[{key:"getVisible",value:function(){return Kk}},{key:"createShadow",value:function(e,t){Gk&&Gk===e?(Qk.root.children.includes(Ok)||Qk.root.add(Ok),eP()):(Gk=e,Qk=t,function(){(Nk=e.boundingBox).getCenter(Wk);var t=Nk,n=t.max,i=t.min;Yk=parseInt((n.y-i.y)/100*1e3)/1e3,(zk=new Ei(new qi(1,1).rotateX(-Math.PI/2),Xk)).renderOrder=1,zk.name="_shadow.mesh",Gk._shadow=zk,(Ok=new ja).name="_shadow.group",Ok.add(zk),Gk.parent.updateMatrixWorld(),Gk.parent.matrixWorld.decompose(Ok.position,Ok.quaternion,Ok.scale),Qk.root.add(Ok),eP()}()),Kk=!0}},{key:"updateShadow",value:function(){eP()}},{key:"clearShadow",value:function(){Kk&&(zk.material.opacity=0,Jk=30,qk=.3,Zk=0,Qk.root.remove(Ok))}},{key:"getBlurLevel",value:function(){return Jk/5}},{key:"setBlurLevel",value:function(e){isNaN(e)||e>10||e<1||(Jk=5*e,eP())}},{key:"getStrength",value:function(){return 10*qk}},{key:"setStrength",value:function(e){isNaN(e)||e>10||e<1||(qk=e/10,eP())}},{key:"getHeight",value:function(){return Zk/Yk}},{key:"setHeight",value:function(e){isNaN(e)||e>100||e<0||(Zk=Yk*e,eP())}},{key:"importShadow",value:function(t,n,i){i&&i.visible&&(e.createShadow(t,n),Zk=Yk*i.height||0,qk=i.strength/10||.3,Jk=5*i.blur||30,Kk=!0,eP())}}]),e}();function eP(){var e;if(Gk){Uk||((Uk=new $a({antialias:!0,alpha:!0})).setClearAlpha(0),Uk.setPixelRatio(window.devicePixelRatio),Uk.setSize(512,512),Uk.domElement.style.width="512px",Uk.domElement.style.height="512px",(Dk=new Qt).overrideMaterial=new Nn({color:0}),Rk=new FA(-1,1,1,-1,0,1e3)),Dk.remove(Dk.children[0]),Dk.add(Gk),Gk.updateMatrixWorld(),Vk.setFromObject(Gk);var t=Vk.max,n=Vk.min;Vk.getCenter(Wk);var i=t.x-n.x,r=t.z-n.z;(e=zk.geometry).scale.apply(e,[1.2*i/jk[0],1,1.2*r/jk[2]]),jk=[1.2*i,1,1.2*r],zk.position.set(Wk.x,n.y-Zk,Wk.z),Rk.left=-1.2*i/2,Rk.right=1.2*i/2,Rk.top=1.2*r/2,Rk.bottom=-1.2*r/2,Rk.far=t.y-n.y,Rk.updateProjectionMatrix(),Rk.position.set(Wk.x,t.y+.1,Wk.z),Rk.lookAt(Wk.x,n.y,Wk.z),Rk.updateMatrixWorld(),Uk.render(Dk,Rk),Qk.modelGroup.add(Gk),zk.material.map&&zk.material.map.dispose(),Hk.generateBlurMap(Uk.domElement.toDataURL("image/png"),512,Jk,(function(e){zk.material.opacity=qk,zk.material.map=(new tA).load(e),zk.material.needsUpdate=!0}))}}var tP,nP=new at,iP=new at,rP=new at,aP=function(e){h(n,e);var t=y(n);function n(e,i,r){var a;s(this,n),(a=t.call(this)).name="DirectionalLightIcon",a.light=i,a.camera=e,a.light.updateMatrixWorld(),a.color=r||"#1296db",a.matrix=i.matrixWorld,a.matrixAutoUpdate=!1,a.lightIcon=new go(new ro({map:(new tA).load("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAACUVJREFUeF7tW32MFGcZ/z0zd3yYKrezUFotpnA7e1RsJYG0pWhC+LDRVk0aISJVS5TCznJYiAWrMaCJEqspWphZKGrbCKI9Y+JHbRqwNVFKacBUKpbb2YOL0AZ6t7OHJS1wu/OYdz9gP2Z3Znb2OI33/rXZeT5/87zv+zzP+w5hlEZYTz4Aovvy6pl/k45HnxoNU2g0lHYkXr+Z7LZXiDCl4D8GWMrePhS7pf9a2zMqAIQTqbXMvL3cWSLqTsciO/4vAFAS5mYwtlQ4S9hixdRvjwFwjREYlSkwFgFjU+B/cA3o0JOzZWB2Okf7sE69FGSqjtQUeN9PTittly/eZ1P2gNct1dMaENJNnQhawWnqB3ijpak9zYIwEgAoidS3wPwIgIkFM+kpKxZZ6WajOwDPHB8XGhh3ppS0lAlc1iwITgAQ88pms8GQkXyYQI9WO2tfagsNrZ8+1AgEVwCm6KlIjtisI6QpEEQmKHHbQQDvL0WVzPK8gfj0s25vrPp52Eh2M+hxJz6ZSR2IR1KBABDMimH+EcAnWgmCYpgPAfhSUebTlqb+yK/zSiK1CsxP1OF7ztLUT7rJdI2APAC6+VmA94GorZUguBnX6HlY7/0ik/S0Iw1zFqDlVlz9tZsOTwAIISGj7x4iex8Y7x1tEJSEuQyMXznaQXibWVqe0TqfdXM+v1Z6ISrRhHf2LbJtex+hUMVVDuq3tMh0L/JCu/om2blcuI14sqDPMg1KspzOrO4874nfMI8QMKealoEBSZKWp9d0/smLHN8A5CNB7/0okfQLANNqMahf0ISN5GIG7gbTF0CY6hy6OAfinxPwfFqLHnCi6dhuLpBkvOjw7DSz/flMvOuvXp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UhO2I/jBhJiybe/kjg5umvm2F7t8AeBFoBeakYgAL3qdaMYAaBa5IHxjETCCa4DfFzM2Bfwi1gr6wrZKT5bLCvLJTBCbRiUCpuinbshR7lCpmSI+xGr2k5kgzgveUQGgmLgE/mQmqPOC/z91kP5273HRKgAAAABJRU5ErkJggg=="),sizeAttenuation:!1,depthTest:!1})),a.add(a.lightIcon),a.lightIcon.scale.multiplyScalar(2e-4),a.targetLines=[];for(var o=new Nn({depthTest:!0,color:a.color}),l=0;l<4;l++){var A=new ki(.001,.001,.25);A.translate(0,0,.125);var c=new Ei(A,o);c.renderOrder=5001,a.targetLines.push(c),a.add(c)}return a.targetLines[0].geometry.translate(0,.0075,0),a.targetLines[1].geometry.translate(0,-.0075,0),a.targetLines[2].geometry.translate(.0075,0,0),a.targetLines[3].geometry.translate(-.0075,0,0),a.size=1,a.update(),a}return A(n,[{key:"dispose",value:function(){this.lightIcon.geometry.dispose(),this.lightIcon.material.dispose(),this.targetLines.forEach((function(e){e.geometry.dispose(),e.material.dispose()}))}},{key:"update",value:function(){var e=this;nP.setFromMatrixPosition(this.light.matrixWorld),nP.normalize(),iP.setFromMatrixPosition(this.light.target.matrixWorld),iP.normalize(),rP.subVectors(iP,nP),rP.normalize(),this.lightIcon.lookAt(iP);var t=nP.distanceTo(this.camera.position)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),n=this.size/75;this.lightIcon.scale.set(n,n,n),this.targetLines.forEach((function(n){n.lookAt(iP),n.scale.set(1,1,1).multiplyScalar(t*e.size/4)}))}}]),n}(zt),oP=function(){function e(){s(this,e)}return A(e,null,[{key:"screenShot",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.hideAxes(e),i=this.hideGrid(e),r=(tP=e.renderManager.defaultRenderer).getPixelRatio()||1,a=t.width||300*r,o=t.height||300*r,s=tP.getSize(),l=tP.domElement.width,A=tP.domElement.height;tP.domElement.width=a,tP.domElement.height=o,tP.setSize(a,o);var c=e.camera.clone();c.aspect=a/o,c.updateProjectionMatrix(),e.renderManager.render(!0),tP.render(e.scene,c);var h=tP.domElement.toDataURL("image/png");return tP.domElement.width=l,tP.domElement.height=A,tP.setSize(s.x,s.y),n&&e.sceneManager.showAxesHelper(),i&&e.sceneManager.showGridHelp(),h}},{key:"encircleScreenShot",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.hideAxes(e),i=this.hideGrid(e),r=(tP=e.renderManager.defaultRenderer).getPixelRatio()||1,a=t.count||16,o=t.width||300*r,s=t.height||300*r,l=tP.getSize(),A=tP.domElement.width,c=tP.domElement.height,h=e.camera.aspect;tP.domElement.width=o,tP.domElement.height=s,tP.setSize(o,s);var u=t.callback,d=o/s,f=e.camera,p=e.camera.clone();e.camera=p,f.aspect=d,f.updateProjectionMatrix(),p.aspect=d,p.updateProjectionMatrix(),e.controls.update();var m=new yp({camera:f,renderer:tP,renderManager:e.renderManager}),v=[];m.setPosition(e.camera.position.x,e.camera.position.y,e.camera.position.z),m.setTarget(e.controls.target.x,e.controls.target.y,e.controls.target.z);for(var g=0;g<a;g++){if(m.update(),e.renderManager.render2(e.scene,f),v.push(tP.domElement.toDataURL("image/png")),v.length===a){f.position.copy(p.position),f.aspect=h,f.updateProjectionMatrix(),p.aspect=h,p.updateProjectionMatrix(),e.camera=f,tP.domElement.width=A,tP.domElement.height=c,tP.setSize(l.x,l.y),u&&u(v),m.update(),m.dispose();break}m.rotateLeft(360/a),m.update()}n&&e.sceneManager.showAxesHelper(),i&&e.sceneManager.showGridHelp()}},{key:"hideAxes",value:function(e){var t=e.sceneManager.axesHelper,n=!1;return t&&t.parent&&(e.sceneManager.hideAxesHelper(),n=!0),n}},{key:"hideGrid",value:function(e){var t=e.sceneManager.gridHelp,n=!1;return t&&t.visible&&(e.sceneManager.hideGridHelp(),n=!0),n}}]),e}(),sP=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),this.init(t,n)}return A(e,[{key:"init",value:function(t,n){this.model=t,this.path=n.path,this.directions=n.directions,this.target=n.target,this.rotate=n.rotate,this.tension=n.tension?n.tension:.2,this.time=n.time?n.time:3e3,this.loopType=n.loopType==e.LOOPTYPE_PINGPONG?e.LOOPTYPE_PINGPONG:e.LOOPTYPE_NORMAL,this.loop=n.loop||1/0,this.loopTypeState=0,this.tween=null,this.onUpdate=n.onUpdate,this.onRepeat=n.onRepeat,this.onComplete=n.onComplete}},{key:"path",get:function(){return this._path},set:function(e){if(this._path=[],e)for(var t=0;t<e.length;t++)this._path.push((new at).copy(e[t]))}},{key:"directions",get:function(){return this._directions},set:function(e){if(this._directions=[],e)for(var t=0;t<e.length;t++)this._directions.push((new at).copy(e[t]))}},{key:"model",get:function(){return this._model},set:function(e){this._model=e}},{key:"target",get:function(){return this._target},set:function(e){e&&(this._target=(new at).copy(e))}},{key:"rotate",get:function(){return this._rotate},set:function(e){e&&(this._rotate=(new at).copy(e))}},{key:"tension",get:function(){return this._tension},set:function(e){this._tension=e}},{key:"time",get:function(){return this._time},set:function(e){this._time=e}},{key:"loopType",get:function(){return this._loopType},set:function(e){this._loopType=e}},{key:"loop",get:function(){return this._loop},set:function(e){this._loop=e}},{key:"onUpdate",set:function(e){e&&(this.updateCallBack=e)}},{key:"onRepeat",set:function(e){e&&(this.repeatCallBack=e)}},{key:"onComplete",set:function(e){e&&(this.completeCallBack=e)}},{key:"begin",value:function(){if(this.isValidData()){this.model.pathTween&&this.model.pathTween.stop(),this.model.pathTween=this,this.curve=new lP(this.path,"catmullrom",this.tension);var e=this.curve.getLines();!this.model.isCamera&&this.tension&&(this.model.moveLines&&this.model.parent.remove(this.model.moveLines),this.model.moveLines=e,this.model.parent.add(e)),this.directions&&this.directions.length===this.path.length&&(this.curveDir=new cA(this.directions));this.tween=new ud.Tween({t:0}).to({t:1},this.time).onUpdate(this._onUpdate.bind(this)).onComplete(this._onComplete.bind(this)).onRepeat(this._onRepeat.bind(this)).repeat(this.loop-1).start()}}},{key:"_onUpdate",value:function(t){var n=t.t,i=1;this.loopType===e.LOOPTYPE_PINGPONG&&1===this.loopTypeState&&(n=1-t.t,i=-1);var r=new at,a=new at;if(this.curve.getPoint(n,r),this.curve.getPoint(n+.03*i,a),this.rotate&&!this.model.isCamera){var o,s=new at(0,0,1);o=this.target?this.target.clone().sub(r).normalize():a.clone().sub(r).normalize();var l=this.getInitRotateQua4(this.rotate),A=this.getLookAtRotateQue4(s,o),c=l.multiply(A);this.model.quaternion.copy(c)}else if(this.model.isCamera)if(this.target)this.model.target=this.target.clone(),this.model.controller.target=this.target.clone(),this.model.lookAt(this.target.clone());else{if(this.curveDir){var h=new at;this.curveDir.getPoint(n,h),a=this.model.getWorldPosition().clone().addScaledVector(h,10)}this.model.target=a.clone(),this.model.controller.target=a.clone(),this.model.lookAt(a.clone())}else this.target?(this.model.target=this.target.clone(),this.model.lookAt(this.target.clone())):(this.model.target=a.clone(),this.model.lookAt(a.clone()));this.model.position.copy(r.clone()),this.updateCallBack&&this.updateCallBack()}},{key:"_onRepeat",value:function(){this.repeatCallBack&&this.repeatCallBack(),this.loopTypeState++,this.loopTypeState%=2,this.tween&&(this.tween._valuesStart.t=0,this.tween._duration=this.time)}},{key:"_onComplete",value:function(){this.completeCallBack&&this.completeCallBack()}},{key:"start",value:function(){this.tween&&(this.tween._duration=(1-this.tween._object.t)*this.time,this.tween.start())}},{key:"stop",value:function(){this.tween&&(this.tween.stop(),this.tween._duration=(1-this.tween._object.t)*this.time)}},{key:"end",value:function(){this.tween&&this.tween.end()}},{key:"getInitRotateQua4",value:function(e){var t=new nt;if(0===e.x&&0===e.y&&0===e.z)return t;var n=new nt;n.setFromAxisAngle(new at(1,0,0),e.x);var i=new nt;i.setFromAxisAngle(new at(0,1,0),e.y);var r=new nt;return r.setFromAxisAngle(new at(0,0,1),e.z),t.multiply(n),t.multiply(i),t.multiply(r),t}},{key:"getLookAtRotateQue4",value:function(e,t){var n=new nt;if(0===e.x&&0===e.y&&0===e.z||0===t.x&&0===t.y&&0===t.z||e.x===t.x&&e.y===t.y&&e.z===t.z)return n;var i=e.clone(),r=new at(0,1,0).clone().cross(i).normalize(),a=new at(e.x,0,e.z).normalize(),o=new at(t.x,0,t.z).normalize(),s=a.angleTo(o);r.angleTo(o)>Math.PI/2&&(s=-s);var l=new at(t.x,0,t.z).normalize(),A=t.clone(),c=l.angleTo(A);A.y>0&&(c=-c);var h=new nt;h.setFromAxisAngle(new at(1,0,0),c);var u=new nt;return u.setFromAxisAngle(new at(0,1,0),s),n.multiply(u),n.multiply(h),n}},{key:"isValidData",value:function(){return this.model?!this.path||this.path.length<2?(console.error("路径数据错误!"),!1):"number"!=typeof this.tension||this.tension<0||this.tension>1?(console.error("平滑系数取值为0-1之间!"),!1):"number"!=typeof this.time||this.time<=0?(console.error("时间应为正数!"),!1):0!==this.loopType&&1!==this.loopType?(console.error("循环类型只能取0或1!"),!1):!("number"!=typeof this.loop||this.loop<1)||(console.error("循环次数应大于0!"),!1):(console.error("未设置动画模型!"),!1)}}]),e}(),lP=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"catmullrom",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;s(this,e);var a=new cA(t);a.curveType=n,a.tension=i,this.curve=a,this.path=t,this.accuracy=r||10*t.length,this.curveType=n,this.tension=i,this.points=a.getPoints(this.accuracy),this.compute()}return A(e,[{key:"compute",value:function(){var e=this.points.length;this.allLen=0,this.lenArr=[0];for(var t=0;t<e-1;t++){var n=this.points[t],i=this.points[t+1],r=n.distanceTo(i);this.allLen+=r,this.lenArr.push(this.lenArr[t]+r)}var a=this.path.length,o=this.path[0].clone().sub(this.path[1]);this.firstPoint=this.path[0].clone().add(o);var s=this.path[a-1].clone().sub(this.path[a-2]);this.lastPoint=this.path[a-1].clone().add(s)}},{key:"getPoint",value:function(e,t){if(e<0)return t?t.set(this.firstPoint.x,this.firstPoint.y,this.firstPoint.z):t=this.firstPoint.clone(),t;if(e>1)return t?t.set(this.lastPoint.x,this.lastPoint.y,this.lastPoint.z):t=this.lastPoint.clone(),t;for(var n=this.allLen*e,i=0;i<this.lenArr.length-1;i++){var r=this.lenArr[i],a=this.lenArr[i+1];if(n==r)return t?t.set(this.points[i].x,this.points[i].y,this.points[i].z):t=this.points[i].clone(),t;if(r<n&&a>n){var o=this.points[i],s=n-r,l=this.points[i+1].clone().sub(o).normalize(),A=o.clone().addScaledVector(l,s);return t?t.set(A.x,A.y,A.z):t=this.points[i].clone(),t}}var c=this.points[this.points.length-1];return t?t.set(c.x,c.y,c.z):t=c.clone(),t}},{key:"getLines",value:function(){for(var e=this.points,t=[],n=[],i=0;i<e.length-1;i++)t.push(e[i].x),t.push(e[i].y),t.push(e[i].z),t.push(e[i+1].x),t.push(e[i+1].y),t.push(e[i+1].z),n.push(1,0,0,1,0,0);var r=new si;r.setAttribute("position",new Yn(t,3)),r.setAttribute("color",new Yn(n,3));var a=new jo(r,new Bl({color:16711680,dashSize:4,gapSize:3}));return a.computeLineDistances(),a}}]),e}();sP.LOOPTYPE_NORMAL=0,sP.LOOPTYPE_PINGPONG=1;var AP=function(e){h(n,e);var t=y(n);function n(e,i,r){var a;return s(this,n),(a=t.call(this)).viewer=e,a.viewer.modelGroup.add(v(a)),a.renderer=e.renderer,a.model=i,a.miniMinSize=200,a.leftMargin=10,a.topMargin=10,a.initScene(),a.hideNodeNames=r,a.needUpdateMap=!0,a}return A(n,[{key:"initScene",value:function(){this.miniCamera=new FA,this.miniScene=new Qt,this.miniScene.add(new UA(10066329));var e=this.viewer.modelGroup.boundingBox.getCenter(new at),t=this.model.getWorldPosition(new at),n=new ro({map:this.texture,sizeAttenuation:!1,depthTest:!1,depthWrite:!1});this.miniMan=new go(n.clone()),this.miniMan.isPathPoint=!0,this.miniMan.renderOrder=5e3,this.miniMan.scale.set(5,5,5),this.miniMan.position.set(t.x,1,t.z),this.miniScene.add(this.miniMan);var i=new qi(1,1),r=new Nn({side:2});this.miniPlane=new Ei(i,r),this.miniPlane.rotation.x=Math.PI/180*-90,this.miniPlane.position.set(e.x,0,e.z),this.miniScene.add(this.miniPlane)}},{key:"updateMap",value:function(){if(this._needUpdateMap){this.setNodesVisible(!1);var e=this.viewer.container.clientWidth,t=this.viewer.container.clientHeight,n=e/t,i=this.viewer.modelGroup.boundingBox,r=i.getSize(new at),a=i.getCenter(new at);this.model?this.model.position.y:r.y;var o,s,l=a.clone().addScaledVector(new at(0,1,0),r.y),A=a.clone();n>r.x/r.z?o=(s=r.z)*n:s=(o=r.x)/n;var c=-(o*=1.1)/2,h=o/2,u=(s*=1.1)/2,d=-s/2,f=2*r.y;this.miniCamera.left=c,this.miniCamera.right=h,this.miniCamera.top=u,this.miniCamera.bottom=d,this.miniCamera.near=.1,this.miniCamera.far=f,this.miniCamera.updateProjectionMatrix(),this.miniCamera.position.copy(l),this.miniCamera.lookAt(A),n>1?(this.insetHeight=this.miniMinSize,this.insetWidth=this.insetHeight*n):(this.insetWidth=this.miniMinSize,this.insetHeight=this.insetWidth/n),this.renderer1||(this.renderer1=new $a({antialias:!0,alpha:!0,preserveDrawingBuffer:!0}));var p=this.renderer1;p.setClearAlpha(0),p.setPixelRatio(window.devicePixelRatio),p.setSize(e,t),p.setViewport(0,0,e,t),p.setClearColor(2236962,0),p.render(this.viewer.scene,this.miniCamera);var m=(new tA).load(p.domElement.toDataURL());p.clearDepth(),p.setScissorTest(!0),p.setScissor(this.leftMargin,t-this.insetHeight-this.topMargin,this.insetWidth,this.insetHeight),p.setViewport(this.leftMargin,t-this.insetHeight-this.topMargin,this.insetWidth,this.insetHeight),p.setClearColor(2236962,0),p.render(this.miniScene,this.miniCamera),p.setScissorTest(!1),this.miniPlane.geometry.dispose(),this.miniPlane.geometry=new qi(o,s),this.miniPlane.geometry.verticesNeedUpdate=!0,this.miniPlane.material.map=m,this.miniPlane.material.needsUpdate=!0,this.needUpdateMap=!1,this.setNodesVisible(!0)}}},{key:"show",value:function(){this.visible=!0}},{key:"hide",value:function(){this.visible=!1}},{key:"setNodes",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this._hideNodes=[],t&&t.length>0&&this.viewer.modelGroup.traverse((function(n){"Object3D"!==n.type&&"Mesh"!==n.type||t.forEach((function(t){t==n.name&&e._hideNodes.push(n)}))}))}},{key:"setNodesVisible",value:function(e){this.model.visible=e,this._hideNodes.forEach((function(t){t&&(t.visible=e)}))}},{key:"onAfterRender",value:function(e,t,n,i,r){if(this.visible){var a=this.viewer.container.clientWidth,o=this.viewer.container.clientHeight,s=this.renderer.autoClear;this.renderer.autoClear=!1,this.renderer.clearDepth(),this.renderer.setScissorTest(!0),this.renderer.setScissor(this.leftMargin,o-this.insetHeight-this.topMargin,this.insetWidth,this.insetHeight),this.renderer.setViewport(this.leftMargin,o-this.insetHeight-this.topMargin,this.insetWidth,this.insetHeight),this.renderer.setClearColor(2236962,1),this.renderer.render(this.miniScene,this.miniCamera),this.renderer.setScissorTest(!1),this.updateMan(),this.renderer.autoClear=s,this.renderer.setViewport(0,0,a,o)}}},{key:"updateMan",value:function(){var e=new at(0,0,1),t=this.model.getWorldDirection(new at),n=this.getLookAtRotate(e,t);this.miniMan.material.rotation=n;var i=this.model.getWorldPosition(new at);this.miniMan.position.set(i.x,1,i.z)}},{key:"getLookAtRotate",value:function(e,t){var n=new at(t.x,0,t.z);if(0===e.x&&0===e.y&&0===e.z||0===n.x&&0===n.y&&0===n.z||e.x===n.x&&e.y===n.y&&e.z===n.z)return 0;var i=e.angleTo(n);return n.x<0?-i:i}},{key:"getLookAtRotateQue4",value:function(e,t){var n=new nt,i=new nt;if(i.setFromAxisAngle(new at(1,0,0),-Math.PI/2),n.multiply(i),0===e.x&&0===e.y&&0===e.z||0===t.x&&0===t.y&&0===t.z||e.x===t.x&&e.y===t.y&&e.z===t.z)return n;var r=e.clone(),a=new at(0,1,0).clone().cross(r).normalize(),o=new at(e.x,0,e.z).normalize(),s=new at(t.x,0,t.z).normalize(),l=o.angleTo(s);a.angleTo(s)>Math.PI/2&&(l=-l);var A=new nt;return A.setFromAxisAngle(new at(0,0,1),l),n.multiply(A),n}},{key:"hideNodeNames",set:function(e){this.setNodes(e)}},{key:"needUpdateMap",get:function(){return this._needUpdateMap},set:function(e){this._needUpdateMap=!!e,this.updateMap()}},{key:"texture",get:function(){return this._texture||(this._texture=(new tA).load("https://laozicloud-sdk.obs.myhuaweicloud.com/assets/image/miniMan2.png"),this._texture.wrapS=this._texture.wrapT=V,this._texture.repeat.set(1,1),this._texture.needsUpdate=!0),this._texture},set:function(e){e&&(this._texture=(new tA).load(e),this._texture.wrapS=this._texture.wrapT=V,this._texture.repeat.set(1,1),this._texture.needsUpdate=!0,this.miniMan.material.map=this._texture,this.miniMan.material.needsUpdate=!0)}},{key:"miniMinSize",get:function(){return this._miniMinSize},set:function(e){e&&(this._miniMinSize=e)}},{key:"manSize",get:function(){return this._manSize},set:function(e){e&&(this._manSize=e,this.miniMan.scale.set(e,e,e))}}]),n}(zt),cP=function(e){h(n,e);var t=y(n);function n(e,i){var r;return s(this,n),(r=t.call(this)).viewer=e,r.viewer.modelGroup.add(v(r)),r.renderer=e.renderer,r.model=i||r.createModel(),r.modelScale=.1,r.viewMinSize=200,r.rightMargin=10,r.bottomMargin=10,r._freeCamera=new Ni(r.viewer.camera.fov,r.viewer.camera.aspect,r.viewer.camera.near,r.viewer.camera.far),r.needUpdateMap=!0,r}return A(n,[{key:"updateMap",value:function(){if(this._needUpdateMap){var e=this.viewer.container.clientWidth,t=this.viewer.container.clientHeight,n=e/t;n>1?(this.insetHeight=this.viewMinSize,this.insetWidth=this.insetHeight*n):(this.insetWidth=this.viewMinSize,this.insetHeight=this.insetWidth/n),this.renderer1||(this.renderer1=new $a({antialias:!0,alpha:!0,preserveDrawingBuffer:!0}));var i=this.renderer1;i.setClearAlpha(0),i.setPixelRatio(window.devicePixelRatio),i.setSize(e,t),i.setViewport(0,0,e,t),i.setClearColor(2236962,0),i.render(this.viewer.scene,this._freeCamera),i.clearDepth(),i.setScissorTest(!0),i.setScissor(e-this.rightMargin-this.insetWidth,this.bottomMargin,this.insetWidth,this.insetHeight),i.setViewport(e-this.rightMargin-this.insetWidth,this.bottomMargin,this.insetWidth,this.insetHeight),i.setClearColor(2236962,0),i.render(this.viewer.scene,this._freeCamera),i.setScissorTest(!1),this.needUpdateMap=!1}}},{key:"createModel",value:function(){var e=new kf(this.viewer),t=new Ei(new Fi(2,2,4),new Gf({}));e.add(t);var n=new Ei(new Fi(1,1,3),new Gf({}));return n.position.z=2,e.add(n),this.add(e),e}},{key:"updateCameraQua",value:function(){this.model.recalculationBound();var e=this.model.boundingSphere,t=(new nt).copy(this.model.quaternion),n=(new nt).setFromAxisAngle(new at(0,1,0),Math.PI),i=(new nt).multiply(t).multiply(n);this._freeCamera.quaternion.copy(i);var r=this.model.getWorldDirection(new at),a=e.center.clone().addScaledVector(r,e.radius);this._freeCamera.position.copy(a)}},{key:"show",value:function(){this.visible=!0}},{key:"hide",value:function(){this.visible=!1}},{key:"onAfterRender",value:function(e,t,n,i,r){if(this.visible){this.updateCameraQua();var a=this.viewer.container.clientWidth,o=this.viewer.container.clientHeight,s=this.renderer.autoClear;this.renderer.autoClear=!1,this.renderer.clearDepth(),this.renderer.setScissorTest(!0),this.renderer.setScissor(a-this.rightMargin-this.insetWidth,this.bottomMargin,this.insetWidth,this.insetHeight),this.renderer.setViewport(a-this.rightMargin-this.insetWidth,this.bottomMargin,this.insetWidth,this.insetHeight),this.renderer.setClearColor(2236962,1),this.renderer.render(this.viewer.scene,this._freeCamera),this.renderer.setScissorTest(!1),this.renderer.autoClear=s,this.renderer.setViewport(0,0,a,o)}}},{key:"modelScale",get:function(){return this.model.scale.x},set:function(e){e&&this.model.scale.set(e,e,e)}},{key:"needUpdateMap",get:function(){return this._needUpdateMap},set:function(e){this._needUpdateMap=!!e,this.updateMap()}},{key:"viewMinSize",get:function(){return this._viewMinSize},set:function(e){e&&(this._viewMinSize=e)}}]),n}(zt);function hP(e,t){var n,i;this.viewer=e,this.camera=e.camera,this.rotateSpeed=.002,this.moveSpeed=5,this.Ammo=t,this.physicsWorld,this.rigidBodies=[],this.count=0,this.movingRegion=new tn(new at(-1/0,-1/0,-1/0),new at(1/0,1/0,1/0)),this.init=function(e){var t=this;this.Ammo().then((function(i){n=i,t.initPhysicsWorld(),e&&e(i)}))},this.initPhysicsWorld=function(){var e=new n.btDefaultCollisionConfiguration,t=new n.btCollisionDispatcher(e),i=new n.btDbvtBroadphase,r=new n.btSequentialImpulseConstraintSolver,a=new n.btDiscreteDynamicsWorld(t,i,r,e);a.setGravity(new n.btVector3(0,-9.82,0)),this.physicsWorld=a},this.bindModels=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;Array.isArray(t)||(t=[t]),t.forEach((function(t){t.traverse((function(t){t.isMesh&&e.createRigidBody(t,n)}))}))},this.createRigidBody=function(e,t){var i,a,o=e.getWorldScale(new at),s=e.getWorldPosition(new at),l=e.getWorldQuaternion(new nt);if(e.isMesh){var A=this.getMeshData(e);i=A.faces,0==(a=A.vertices).length&&console.error("no vertices to define mesh shape with"),o||(o={x:1,y:1,z:1});var c=new n.btTriangleMesh;if(r.count++,!(r.count>200)){console.log(r.count);for(var h=0,u=i.length;h<u;h++){var d=i[h].a,f=i[h].b,p=i[h].c;a[d]&&a[f]&&a[p]&&"number"==typeof a[d].x&&"number"==typeof a[d].y&&"number"==typeof a[d].z&&"number"==typeof a[f].x&&"number"==typeof a[f].y&&"number"==typeof a[f].z&&"number"==typeof a[p].x&&"number"==typeof a[p].y&&"number"==typeof a[p].z&&c.addTriangle(new n.btVector3(a[d].x,a[d].y,a[d].z),new n.btVector3(a[f].x,a[f].y,a[f].z),new n.btVector3(a[p].x,a[p].y,a[p].z),!1)}var m=new n.btGImpactMeshShape(c);m.setMargin(.01),m.setLocalScaling(new n.btVector3(o.x,o.y,o.z)),m.updateBound();var v=new n.btTransform;v.setIdentity(),v.setOrigin(new n.btVector3(s.x,s.y,s.z)),v.setRotation(new n.btQuaternion(l.x,l.y,l.z,l.w));var g=new n.btDefaultMotionState(v),y=new n.btVector3(0,0,0);m.calculateLocalInertia(t,y);var w=new n.btRigidBodyConstructionInfo(t,g,m,y),x=new n.btRigidBody(w);return x.setFriction(.5),e.userData.physicsBody=x,e.userData.collided=!1,t>0&&(this.rigidBodies.push(e),x.setActivationState(4)),this.physicsWorld.addRigidBody(x),x}}else console.error("cannot make mesh shape for non-Mesh object")},this.getMeshData=function(e){var t=null!==e.geometry.index?e.geometry.index:void 0,n=e.geometry.attributes,i=e.scale;if(void 0!==n.position){for(var r=n.position,a=[],o=[],s=0;s<r.count;s++)a.push({x:i.x*r.getX(s),y:i.y*r.getY(s),z:i.z*r.getZ(s)});if(void 0!==t)for(var l=0;l<t.count;l+=3)o.push({a:t.getX(l),b:t.getX(l+1),c:t.getX(l+2)});else for(var A=0;A<r.count;A+=3)o.push({a:A,b:A+1,c:A+2});return{vertices:a,faces:o}}console.error("getMeshData(): Position attribute required for conversion.")},this.createPerson=function(){var e=this.person.position,t=this.person.quaternion,a=this.person.boundingBox.getSize(),o=Math.max(a.x,a.y,a.z),s={x:o,y:o/2,z:o},l=new n.btBoxShape(new n.btVector3(.5*s.x,.5*s.y,.5*s.z)),A=new n.btTransform;A.setIdentity(),A.setOrigin(new n.btVector3(e.x,e.y,e.z)),A.setRotation(new n.btQuaternion(t.x,t.y,t.z,t.w));var c=new n.btDefaultMotionState(A),h=new n.btVector3(0,0,0);l.calculateLocalInertia(800,h);var u=new n.btRigidBody(new n.btRigidBodyConstructionInfo(800,c,l,h));u.setActivationState(4),function(e){e._getPosAndRot=function(){var t=null,i=e.getMotionState();if(i){var r=new n.btTransform;i.getWorldTransform(r);var a=r.getOrigin(),o=r.getRotation();t=[new at(a.x(),a.y(),a.z()),new nt(o.x(),o.y(),o.z(),o.w())]}return t},e._getPosition=function(){return e._getPosAndRot()[0]},e._setPosition=function(t,i,r){var a=e._getPosAndRot()[1],o=new n.btTransform;o.setIdentity(),o.setOrigin(new n.btVector3(t,i,r)),o.setRotation(new n.btQuaternion(a.x,a.y,a.z,a.w)),e.setCenterOfMassTransform(o)},e._addPosition=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=e.getMotionState();if(a){var o=new n.btTransform;a.getWorldTransform(o);var s=o.getOrigin(),l=o.getRotation(),A=new n.btTransform;A.setIdentity(),A.setOrigin(new n.btVector3(s.x()+t,s.y()+i,s.z()+r)),A.setRotation(new n.btQuaternion(l.x(),l.y(),l.z(),l.w())),e.setCenterOfMassTransform(A)}},e._getRotation=function(){return e._getPosAndRot()[1]},e._setLinearVelocity=function(t,i,r){e.setLinearVelocity(new n.btVector3(t,i,r))}}(u),this.physicsWorld.addRigidBody(u),this.person.userData.physicsBody=u,this.person.userData.collided=!1,this.rigidBodies.push(this.person),i=function(e,t,n){var i=new AMRT.BoxGeometry(e,t,n,1,1,1),a=new AMRT.Mesh(i,new Gf);return r.viewer.scene.add(a),a}(s.x,s.y,s.z)},this.setView=function(){var e,t,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(void 0!==a.position&&(e=Array.isArray(a.position)?(new AMRT.Vector3).fromArray(a.position):(new AMRT.Vector3).copy(a.position),r.person.position.copy(e)),void 0!==a.rotation&&(Array.isArray(a.rotation)?r.person.rotation.fromArray(a.rotation):r.person.rotation.setFromVector3(a.rotation)),r.person.userData.physicsBody){var o=r.person.userData.physicsBody,s=o.getMotionState();if(s){var l=new n.btTransform;s.getWorldTransform(l),e||(e=l.getOrigin(),e=new AMRT.Vector3(e.x(),e.y(),e.z())),t=r.person.getWorldQuaternion(new nt);var A=new n.btTransform;A.setIdentity(),A.setOrigin(new n.btVector3(e.x,e.y,e.z)),A.setRotation(new n.btQuaternion(t.x,t.y,t.z,t.w)),o.setCenterOfMassTransform(A)}}void 0!==a.cameraDirection?(i=Array.isArray(a.cameraDirection)?(new at).fromArray(a.cameraDirection):(new at).copy(a.cameraDirection)).normalize().negate():((i=this.person.getWorldDirection(new at)).y-=.4,i.normalize().negate()),a.distance&&(N=a.distance),a.minDistance&&(z=a.minDistance),a.maxDistance&&(Q=a.maxDistance),L(i)},this.getView=function(){return{position:this.person.position.toArray(),rotation:this.person.rotation.toArray(),cameraDirection:this.camera.getWorldDirection(new at),distance:N,minDistance:z,maxDistance:Q}};var r=this,a={type:"change"},o=new Bt(0,0,0,"YXZ"),s=Math.PI/2,l=new at,A=!1,c=!1,h=!1,u=!1,d=!1,f=!1,p=performance.now(),m=new at,v=new at;new Nc;var g,y=function(){if(!0===r.enabled){var e=performance.now(),t=(e-p)/1e3;m.x-=10*m.x*t,m.z-=10*m.z*t,m.y-=10*m.y*t,v.z=Number(A)-Number(c),v.x=Number(u)-Number(h),v.y=Number(f)-Number(d),v.normalize(),A||c||h||u?((A||c)&&(m.z-=v.z*r.moveSpeed*t,r.moveForward(-m.z*t)),(h||u)&&(m.x-=v.x*r.moveSpeed*t,r.moveRight(-m.x*t)),w("run")):(r.moveForward(0),w("stop")),p=e,r.physicsWorld.stepSimulation(t,10)}}.bind(this);function w(e){if(r.person)if(e){if(e!=g)switch(e){case"run":r.person.animation.play(P);break;case"up":r.person.animation.play(D);break;case"down":r.person.animation.play(R);break;case"jump":r.person.animation.play(U);break;default:r.person.animation.stop()}}else this.person.animation.stop();g=e}function x(e,t,a){var o;a=a||e,r.person.recalculationBound();var s=r.person.position.clone();if(Math.abs(t)>0){s.addScaledVector(e,t),o=s.clone().sub(r.person.position).normalize(),t=t<0?-1:1;var l=s.clone().addScaledVector(a,t*N*1e4);if(r.person.lookAt(l),r.person.userData.physicsBody)r.person.userData.physicsBody.setLinearVelocity(new n.btVector3(o.x*r.moveSpeed,o.y*r.moveSpeed,o.z*r.moveSpeed))}if(r.person.userData.physicsBody){var A=r.person.userData.physicsBody.getMotionState();if(A){var c=new n.btTransform;A.getWorldTransform(c);var h=c.getOrigin(),u=r.person.getWorldQuaternion(new nt);r.person.position.set(h.x(),h.y(),h.z()),i.position.set(h.x(),h.y(),h.z()),i.quaternion.copy(u)}L()}}function b(e){switch(e.keyCode){case 38:case 87:A=!0;break;case 37:case 65:h=!0;break;case 40:case 83:c=!0;break;case 39:case 68:u=!0;break;case 82:d=!0;break;case 70:f=!0;break;case 32:r.jump()}}function M(e){switch(e.keyCode){case 38:case 87:A=!1;break;case 37:case 65:h=!1;break;case 40:case 83:c=!1;break;case 39:case 68:u=!1;break;case 82:d=!1;break;case 70:f=!1}}function C(e){0===e.button&&document.addEventListener(ld.MOVE,E,!1)}function B(){document.removeEventListener(ld.MOVE,E,!1)}function E(e){if(!1!==r.enabled){var t=e.movementX||e.mozMovementX||e.webkitMovementX||0,n=e.movementY||e.mozMovementY||e.webkitMovementY||0;G.set(t,n,0),0!=r.rotationAngle&&G.applyAxisAngle(new AMRT.Vector3(0,0,1),r.rotationAngle*Hh.DEG2RAD),o.setFromQuaternion(r.camera.quaternion),o.y+=G.x*r.rotateSpeed,o.x-=G.y*r.rotateSpeed,o.x=Math.max(-s,Math.min(s,o.x)),r.camera.quaternion.setFromEuler(o);var i=r.camera.getWorldDirection(new at),l=r.person.getWorldPosition(new at).clone().addScaledVector(i,-N);r.dispatchEvent(a),r.camera.position.copy(l)}}function S(e){!1!==r.enabled&&(e.deltaY<0?(--N<z&&(N=z),L()):e.deltaY>0&&(++N>Q&&(N=Q),L()))}function T(e){r.preX=e.targetTouches[0].clientX,r.preY=e.targetTouches[0].clientY,document.addEventListener("touchmove",I,!1)}function _(){document.removeEventListener("touchmove",I,!1)}function I(e){if(!1!==r.enabled){var t=e.targetTouches[0].clientX-r.preX||0,n=e.targetTouches[0].clientY-r.preY||0;G.set(t,n,0),0!=r.rotationAngle&&G.applyAxisAngle(new AMRT.Vector3(0,0,1),r.rotationAngle*Hh.DEG2RAD),o.setFromQuaternion(r.camera.quaternion),o.y-=G.x*r.rotateSpeed,o.x-=G.y*r.rotateSpeed,o.x=Math.max(-s,Math.min(s,o.x)),r.camera.quaternion.setFromEuler(o);var i=r.camera.getWorldDirection(new at),l=r.person.getWorldPosition(new at).clone().addScaledVector(i,-N);r.dispatchEvent(a),r.camera.position.copy(l),r.preX=e.targetTouches[0].clientX,r.preY=e.targetTouches[0].clientY}}function L(e){e||(e=r.camera.getWorldDirection(new at).negate());var t=r.person.getWorldPosition(new at),n=t.clone().addScaledVector(e,N);r.camera.position.copy(n),r.camera.lookAt(t)}this.moveForward=function(e){l.setFromMatrixColumn(r.camera.matrix,2),l.y=0,l.normalize().negate(),x(l,e)},this.moveRight=function(e){l.setFromMatrixColumn(r.camera.matrix,0),l.y=0,l.normalize().negate(),x(l,-e)},new at,this.connect=function(){document.addEventListener(ld.START,C,!1),document.addEventListener(ld.END,B,!1),document.addEventListener("keydown",b,!1),document.addEventListener("keyup",M,!1),document.addEventListener("touchstart",T,!1),document.addEventListener("touchend",_,!1),document.addEventListener("wheel",S,!1)},this.disconnect=function(){document.removeEventListener(ld.START,C,!1),document.removeEventListener(ld.END,B,!1),document.removeEventListener("keydown",b,!1),document.removeEventListener("keyup",M,!1),document.removeEventListener("touchstart",T,!1),document.removeEventListener("touchend",_,!1),document.removeEventListener("wheel",S,!1)},this.rotationAngle=0;var F,k=!1;new at;var P,U,D,R,O,N,z,Q,G=new at;Object.defineProperties(this,{person:{get:function(){return O},set:function(e){(O=e).boundingBox.getSize(new at).y;var t=O.boundingSphere;N=5*t.radius,z=1*t.radius,Q=20*t.radius,O.name="threePersonControls",r.createPerson()}},distance:{get:function(){return N},set:function(e){N=e}},maxDistance:{get:function(){return Q},set:function(e){Q=e}},minDistance:{get:function(){return z},set:function(e){z=e}},enabled:{get:function(){return k},set:function(e){e=k=Boolean(e),r.viewer.controls.enabled=!e,e?(r.connect(),F=r.viewer.camera.near,r.viewer.camera.near=.1,r.viewer.camera.updateProjectionMatrix(),r.viewer.addEventListener("update",y)):(r.disconnect(),r.viewer.camera.near=F,r.viewer.camera.updateProjectionMatrix(),r.viewer.removeEventListener("update",y))}},runAnimationName:{set:function(e){P=e}},upAnimationName:{set:function(e){D=e}},downAnimationName:{set:function(e){R=e}},jumpAnimationName:{set:function(e){U=e}}})}return hP.prototype=Object.create(Je.prototype),hP.prototype.constructor=hP,e.ACESFilmicToneMapping=5,e.AMRTBasicMaterial=El,e.AMRTShadowMaterial=Sl,e.AddEquation=I,e.AddOperation=2,e.AdditiveBlending=2,e.AlphaFormat=le,e.AlwaysDepth=1,e.AlwaysStencilFunc=519,e.AmbientLight=UA,e.AmbientLightProbe=rc,e.AmmoHelper=hP,e.Anchor=Ym,e.AnimationClip=Gl,e.AnimationLoader=Zl,e.AnimationMixer=Dc,e.AnimationObjectGroup=Pc,e.AnimationUtils=_l,e.ArcCurve=rA,e.ArrayCamera=Wa,e.ArrowHelper=Rh,e.Audio=fc,e.AudioAnalyser=wc,e.AudioContext=$A,e.AudioListener=dc,e.AudioLoader=ec,e.AxesHelper=Oh,e.AxisHelper=function(e){return console.warn("AxisHelper has been renamed to AxesHelper."),new Oh(e)},e.BackSide=1,e.BasicDepthPacking=3200,e.BasicEditorTool=Nm,e.BasicModelTool=Pm,e.BasicShadowMap=0,e.BinaryTextureLoader=function(e){return console.warn("BinaryTextureLoader has been renamed to DataTextureLoader."),new ql(e)},e.Bone=_o,e.BooleanKeyframeTrack=Ul,e.BoundingBoxHelper=function(e,t){return console.warn("BoundingBoxHelper has been deprecated. Creating a BoxHelper instead."),new Lh(e,t)},e.Box2=jc,e.Box3=tn,e.Box3Helper=Fh,e.BoxBufferGeometry=ki,e.BoxGeometry=Fi,e.BoxHelper=Lh,e.BufferAttribute=zn,e.BufferGeometry=si,e.BufferGeometryLoader=QA,e.ByteType=1010,e.Cache=Xl,e.Camera=Oi,e.CameraHelper=Th,e.CameraViewMode=pp,e.CanvasRenderer=function(){console.error("CanvasRenderer has been removed")},e.CanvasTexture=ts,e.CatmullRomCurve3=cA,e.CineonToneMapping=4,e.CircleBufferGeometry=fl,e.CircleGeometry=dl,e.ClampToEdgeWrapping=j,e.Clipping=ip,e.Clock=lc,e.ClosedSplineCurve3=jh,e.Color=Fn,e.ColorKeyframeTrack=Dl,e.CompressedTexture=es,e.CompressedTextureLoader=Jl,e.ConeBufferGeometry=ul,e.ConeGeometry=hl,e.CubeCamera=Qi,e.CubeGeometry=Fi,e.CubeReflectionMapping=N,e.CubeRefractionMapping=z,e.CubeTexture=hr,e.CubeTextureLoader=eA,e.CubeUVReflectionMapping=G,e.CubeUVRefractionMapping=H,e.CubicBezierCurve=fA,e.CubicBezierCurve3=pA,e.CubicInterpolant=Ll,e.CullFaceBack=1,e.CullFaceFront=2,e.CullFaceFrontBack=3,e.CullFaceNone=0,e.Curve=nA,e.CurvePath=bA,e.CustomBlending=5,e.CylinderBufferGeometry=cl,e.CylinderGeometry=Al,e.Cylindrical=Hc,e.DataTexture=Hi,e.DataTexture2DArray=ur,e.DataTexture3D=dr,e.DataTextureLoader=ql,e.DecrementStencilOp=7683,e.DecrementWrapStencilOp=34056,e.DefaultLoadingManager=jl,e.DepthFormat=fe,e.DepthStencilFormat=pe,e.DepthTexture=ns,e.DirectionalLight=PA,e.DirectionalLightHelper=Bh,e.DirectionalLightIcon=aP,e.DirectionalLightShadow=kA,e.DiscreteInterpolant=kl,e.DodecahedronBufferGeometry=ps,e.DodecahedronGeometry=fs,e.DoubleSide=2,e.DstAlphaFactor=D,e.DstColorFactor=R,e.DynamicBufferAttribute=function(e,t){return console.warn("DynamicBufferAttribute has been removed. Use new BufferAttribute().setDynamic( true ) instead."),new zn(e,t).setDynamic(!0)},e.DynamicCopyUsage=35050,e.DynamicDrawUsage=Ye,e.DynamicReadUsage=35049,e.EdgesGeometry=ll,e.EdgesHelper=function(e,t){return console.warn("EdgesHelper has been removed. Use EdgesGeometry instead."),new jo(new ll(e.geometry),new Do({color:void 0!==t?t:16777215}))},e.EllipseCurve=iA,e.EntityFactory=Ik,e.EqualDepth=4,e.EqualStencilFunc=514,e.EquirectangularReflectionMapping=303,e.EquirectangularRefractionMapping=Q,e.Euler=Bt,e.Event=ld,e.EventDispatcher=Je,e.Exploding=Ld,e.ExtrudeBufferGeometry=Ys,e.ExtrudeBufferGeometry2=Jh,e.ExtrudeGeometry=Xs,e.ExtrudeGeometry2=Zh,e.Face3=Dn,e.Face4=function(e,t,n,i,r,a,o){return console.warn("Face4 has been removed. A Face3 will be created instead."),new Dn(e,t,n,r,a,o)},e.FaceColors=1,e.FaceNormalsHelper=xh,e.FileLoader=Kl,e.FlatShading=1,e.Float32Attribute=function(e,t){return console.warn("Float32Attribute has been removed. Use new Float32BufferAttribute() instead."),new Yn(e,t)},e.Float32BufferAttribute=Yn,e.Float64Attribute=function(e,t){return console.warn("Float64Attribute has been removed. Use new Float64BufferAttribute() instead."),new Kn(e,t)},e.Float64BufferAttribute=Kn,e.FloatType=ne,e.FlyLineTool=Om,e.Fog=to,e.FogExp2=eo,e.Font=ZA,e.FontLoader=qA,e.FreeCamera=cP,e.FrontFaceDirectionCCW=1,e.FrontFaceDirectionCW=0,e.FrontSide=0,e.Frustum=Wi,e.GISViewer=_k,e.GammaEncoding=ze,e.Geometry=Li,e.GeometryUtils=Yh,e.GreaterDepth=6,e.GreaterEqualDepth=5,e.GreaterEqualStencilFunc=518,e.GreaterStencilFunc=516,e.GridHelper=ph,e.Group=ja,e.HalfFloatType=ie,e.HemisphereLight=EA,e.HemisphereLightHelper=dh,e.HemisphereLightProbe=ic,e.IconHelper=Hk,e.IcosahedronBufferGeometry=ds,e.IcosahedronGeometry=us,e.ImageBitmapLoader=YA,e.ImageLoader=$l,e.ImageUtils=At,e.ImmediateRenderObject=Kc,e.IncrementStencilOp=7682,e.IncrementWrapStencilOp=34055,e.InstancedBufferAttribute=zA,e.InstancedBufferGeometry=NA,e.InstancedInterleavedBuffer=Oc,e.InstancedMesh=Uo,e.Int16Attribute=function(e,t){return console.warn("Int16Attribute has been removed. Use new Int16BufferAttribute() instead."),new Vn(e,t)},e.Int16BufferAttribute=Vn,e.Int32Attribute=function(e,t){return console.warn("Int32Attribute has been removed. Use new Int32BufferAttribute() instead."),new Wn(e,t)},e.Int32BufferAttribute=Wn,e.Int8Attribute=function(e,t){return console.warn("Int8Attribute has been removed. Use new Int8BufferAttribute() instead."),new Qn(e,t)},e.Int8BufferAttribute=Qn,e.IntType=1013,e.InterleavedBuffer=no,e.InterleavedBufferAttribute=io,e.Interpolant=Il,e.InterpolateDiscrete=Fe,e.InterpolateLinear=ke,e.InterpolateSmooth=Pe,e.InvertStencilOp=5386,e.JSONLoader=function(){console.error("JSONLoader has been removed.")},e.KeepStencilOp=We,e.KeyframeTrack=Pl,e.LOD=bo,e.LargeSceneLoader=dg,e.LargeSceneLoader2=kg,e.LatheBufferGeometry=rl,e.LatheGeometry=il,e.Layers=Et,e.LensFlare=function(){console.error("LensFlare has been moved to /examples/js/objects/Lensflare.js")},e.LessDepth=2,e.LessEqualDepth=3,e.LessEqualStencilFunc=515,e.LessStencilFunc=513,e.Light=BA,e.LightProbe=nc,e.LightProbeHelper=fh,e.LightShadow=SA,e.Line=Go,e.Line3=Yc,e.LineBasicMaterial=Do,e.LineCurve=mA,e.LineCurve3=vA,e.LineDashedMaterial=Bl,e.LineLoop=Wo,e.LinePieces=1,e.LineSegments=jo,e.LineStrip=0,e.LinearEncoding=Oe,e.LinearFilter=Z,e.LinearInterpolant=Fl,e.LinearMipMapLinearFilter=1008,e.LinearMipMapNearestFilter=1007,e.LinearMipmapLinearFilter=q,e.LinearMipmapNearestFilter=J,e.LinearToneMapping=1,e.Loader=Wl,e.LoaderUtils=OA,e.LoadingManager=Vl,e.LogLuvEncoding=3003,e.LoopOnce=Ie,e.LoopPingPong=2202,e.LoopRepeat=Le,e.LuminanceAlphaFormat=ue,e.LuminanceFormat=he,e.MOUSE=_,e.MapSource=Ck,e.Material=On,e.MaterialLoader=RA,e.Math=et,e.MathUtils=Hh,e.Matrix3=lt,e.Matrix4=bt,e.MaxEquation=104,e.Measure3D=Lm,e.Measure3DTool=Dm,e.Mesh=Ei,e.MeshBasicMaterial=Nn,e.MeshDepthMaterial=Ra,e.MeshDistanceMaterial=Oa,e.MeshLambertMaterial=Ml,e.MeshMatcapMaterial=Cl,e.MeshNormalMaterial=bl,e.MeshPhongMaterial=wl,e.MeshPhysicalMaterial=yl,e.MeshStandardMaterial=gl,e.MeshToonMaterial=xl,e.MinEquation=103,e.MinimapTool=AP,e.MirroredRepeatWrapping=W,e.MixOperation=1,e.MultiMaterial=Vh,e.MultiplyBlending=4,e.MultiplyOperation=0,e.NearestFilter=X,e.NearestMipMapLinearFilter=1005,e.NearestMipMapNearestFilter=1004,e.NearestMipmapLinearFilter=K,e.NearestMipmapNearestFilter=Y,e.NeverDepth=0,e.NeverStencilFunc=512,e.NoBlending=0,e.NoColors=0,e.NoToneMapping=0,e.NormalBlending=1,e.NotEqualDepth=7,e.NotEqualStencilFunc=517,e.NumberKeyframeTrack=Rl,e.Object3D=zt,e.ObjectLoader=HA,e.ObjectSpaceNormalMap=1,e.OctahedronBufferGeometry=hs,e.OctahedronGeometry=cs,e.OneFactor=F,e.OneMinusDstAlphaFactor=207,e.OneMinusDstColorFactor=209,e.OneMinusSrcAlphaFactor=U,e.OneMinusSrcColorFactor=203,e.OrthographicCamera=FA,e.PCFShadowMap=1,e.PCFSoftShadowMap=2,e.ParametricBufferGeometry=as,e.ParametricGeometry=rs,e.Particle=function(e){return console.warn("Particle has been renamed to Sprite."),new go(e)},e.ParticleBasicMaterial=function(e){return console.warn("ParticleBasicMaterial has been renamed to PointsMaterial."),new Xo(e)},e.ParticleSystem=function(e,t){return console.warn("ParticleSystem has been renamed to Points."),new qo(e,t)},e.ParticleSystemMaterial=function(e){return console.warn("ParticleSystemMaterial has been renamed to PointsMaterial."),new Xo(e)},e.Path=MA,e.PathEditor=Tm,e.PathEditorTool=Um,e.PathTween=sP,e.PerspectiveCamera=Ni,e.Plane=vn,e.PlaneBufferGeometry=$i,e.PlaneGeometry=qi,e.PlaneHelper=kh,e.PointCloud=function(e,t){return console.warn("PointCloud has been renamed to Points."),new qo(e,t)},e.PointCloudMaterial=function(e){return console.warn("PointCloudMaterial has been renamed to PointsMaterial."),new Xo(e)},e.PointLight=LA,e.PointLightHelper=lh,e.Points=qo,e.PointsMaterial=Xo,e.PolarGridHelper=mh,e.PolyhedronBufferGeometry=ss,e.PolyhedronGeometry=os,e.PositionalAudio=yc,e.PositionalAudioHelper=vh,e.PropertyBinding=kc,e.PropertyMixer=xc,e.QuadraticBezierCurve=gA,e.QuadraticBezierCurve3=yA,e.Quaternion=nt,e.QuaternionKeyframeTrack=Nl,e.QuaternionLinearInterpolant=Ol,e.REVISION=T,e.RGBADepthPacking=je,e.RGBAFormat=ce,e.RGBA_ASTC_10x10_Format=37819,e.RGBA_ASTC_10x5_Format=37816,e.RGBA_ASTC_10x6_Format=37817,e.RGBA_ASTC_10x8_Format=37818,e.RGBA_ASTC_12x10_Format=37820,e.RGBA_ASTC_12x12_Format=37821,e.RGBA_ASTC_4x4_Format=Ee,e.RGBA_ASTC_5x4_Format=37809,e.RGBA_ASTC_5x5_Format=37810,e.RGBA_ASTC_6x5_Format=37811,e.RGBA_ASTC_6x6_Format=37812,e.RGBA_ASTC_8x5_Format=37813,e.RGBA_ASTC_8x6_Format=37814,e.RGBA_ASTC_8x8_Format=37815,e.RGBA_BPTC_Format=Se,e.RGBA_ETC2_EAC_Format=_e,e.RGBA_PVRTC_2BPPV1_Format=Ce,e.RGBA_PVRTC_4BPPV1_Format=Me,e.RGBA_S3TC_DXT1_Format=ge,e.RGBA_S3TC_DXT3_Format=ye,e.RGBA_S3TC_DXT5_Format=we,e.RGBDEncoding=Ve,e.RGBEEncoding=Qe,e.RGBEFormat=de,e.RGBELoader=Nh,e.RGBFormat=Ae,e.RGBM16Encoding=He,e.RGBM7Encoding=Ge,e.RGB_ETC1_Format=Be,e.RGB_ETC2_Format=Te,e.RGB_PVRTC_2BPPV1_Format=be,e.RGB_PVRTC_4BPPV1_Format=xe,e.RGB_S3TC_DXT1_Format=ve,e.RawShaderMaterial=vl,e.Ray=dn,e.Raycaster=Nc,e.RectAreaLight=DA,e.RectAreaLightHelper=Ah,e.RedFormat=me,e.ReinhardToneMapping=2,e.RenderOrder2=Ze,e.RenderOrder3=3e3,e.RenderOrder5=Ke,e.RepeatWrapping=V,e.ReplaceStencilOp=7681,e.ReverseSubtractEquation=102,e.RingBufferGeometry=nl,e.RingGeometry=tl,e.Scene=Qt,e.SceneUtils=Kh,e.ScreenHelper=oP,e.SelectionTool=Rm,e.ShaderChunk=Xi,e.ShaderLib=Ki,e.ShaderMaterial=Ri,e.ShadowHelper=$k,e.ShadowMaterial=ml,e.Shape=CA,e.ShapeBufferGeometry=ol,e.ShapeGeometry=al,e.ShapePath=KA,e.ShapeUtils=Vs,e.ShortType=1011,e.Skeleton=To,e.SkeletonHelper=sh,e.SkinnedMesh=Bo,e.SmoothShading=2,e.Sphere=an,e.SphereBufferGeometry=el,e.SphereGeometry=$s,e.Spherical=Gc,e.SphericalHarmonics3=tc,e.SphericalReflectionMapping=305,e.Spline=Xh,e.SplineCurve=wA,e.SplineCurve3=Wh,e.SpotLight=_A,e.SpotLightHelper=nh,e.SpotLightShadow=TA,e.Sprite=go,e.SpriteMaterial=ro,e.SrcAlphaFactor=P,e.SrcAlphaSaturateFactor=210,e.SrcColorFactor=k,e.StaticCopyUsage=35046,e.StaticDrawUsage=Xe,e.StaticReadUsage=35045,e.StereoCamera=sc,e.StreamCopyUsage=35042,e.StreamDrawUsage=35040,e.StreamReadUsage=35041,e.StringKeyframeTrack=zl,e.SubtractEquation=101,e.SubtractiveBlending=3,e.TOUCH={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},e.TWEEN=ud,e.TangentSpaceNormalMap=0,e.TetrahedronBufferGeometry=As,e.TetrahedronGeometry=ls,e.TextBufferGeometry=qs,e.TextGeometry=Js,e.Texture=ht,e.TextureLoader=tA,e.TorusBufferGeometry=xs,e.TorusGeometry=ws,e.TorusKnotBufferGeometry=ys,e.TorusKnotGeometry=gs,e.TransFormMode=Mm,e.TransformControls=bm,e.Triangle=Tn,e.TriangleFanDrawMode=2,e.TriangleStripDrawMode=1,e.TrianglesDrawMode=0,e.TubeBufferGeometry=vs,e.TubeGeometry=ms,e.UVMapping=O,e.Uint16Attribute=function(e,t){return console.warn("Uint16Attribute has been removed. Use new Uint16BufferAttribute() instead."),new jn(e,t)},e.Uint16BufferAttribute=jn,e.Uint32Attribute=function(e,t){return console.warn("Uint32Attribute has been removed. Use new Uint32BufferAttribute() instead."),new Xn(e,t)},e.Uint32BufferAttribute=Xn,e.Uint8Attribute=function(e,t){return console.warn("Uint8Attribute has been removed. Use new Uint8BufferAttribute() instead."),new Gn(e,t)},e.Uint8BufferAttribute=Gn,e.Uint8ClampedAttribute=function(e,t){return console.warn("Uint8ClampedAttribute has been removed. Use new Uint8ClampedBufferAttribute() instead."),new Hn(e,t)},e.Uint8ClampedBufferAttribute=Hn,e.Uncharted2ToneMapping=3,e.Uniform=Rc,e.UniformsLib=Yi,e.UniformsUtils=Di,e.UnsignedByteType=$,e.UnsignedInt248Type=se,e.UnsignedIntType=te,e.UnsignedShort4444Type=re,e.UnsignedShort5551Type=ae,e.UnsignedShort565Type=oe,e.UnsignedShortType=ee,e.VSMShadowMap=3,e.Vector2=tt,e.Vector3=at,e.Vector4=ut,e.VectorKeyframeTrack=Ql,e.Vertex=function(e,t,n){return console.warn("Vertex has been removed. Use Vector3 instead."),new at(e,t,n)},e.VertexColors=2,e.VertexNormalsHelper=eh,e.VideoTexture=li,e.Viewer=Rg,e.WebGLMultisampleRenderTarget=ft,e.WebGLRenderTarget=dt,e.WebGLRenderTargetCube=Gi,e.WebGLRenderer=$a,e.WebGLUtils=Ga,e.WireframeGeometry=is,e.WireframeHelper=function(e,t){return console.warn("WireframeHelper has been removed. Use WireframeGeometry instead."),new jo(new is(e.geometry),new Do({color:void 0!==t?t:16777215}))},e.WorkerBufferAttribute=Zn,e.WrapAroundEnding=Re,e.XHRLoader=function(e){return console.warn("XHRLoader has been renamed to FileLoader."),new Kl(e)},e.ZeroCurvatureEnding=Ue,e.ZeroFactor=L,e.ZeroSlopeEnding=De,e.ZeroStencilOp=0,e._Math=et,e.sRGBEncoding=Ne,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
|