static.kuangkie.pc.bundle.7a39bb22b147d7cc096a.js Maven / Gradle / Ivy
/*! For license information please see bundle.7a39bb22b147d7cc096a.js.LICENSE.txt */
(self.webpackChunkaldehyde=self.webpackChunkaldehyde||[]).push([[743],{5058:function(e,t,r){var n,i;e.exports=(n=r(67294),i=r(73935),function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=162)}([function(e,t,r){"use strict";(function(t,n){function i(){try{var e=h;return h=null,e.apply(this,arguments)}catch(e){return p.e=e,p}}function a(e){return null==e||!0===e||!1===e||"string"==typeof e||"number"==typeof e}function o(e,t,r){if(a(e))return e;var n={value:r,configurable:!0,enumerable:!1,writable:!0};return f.defineProperty(e,t,n),e}function s(e){try{return e+""}catch(e){return"[no string representation]"}}function l(e){return null!==e&&"object"==typeof e&&"string"==typeof e.message&&"string"==typeof e.name}function c(e){return l(e)&&f.propertyIsWritable(e,"stack")}function u(e){return{}.toString.call(e)}var h,f=r(36),d="undefined"==typeof navigator,p={e:{}},m="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:void 0!==this?this:null,g=function(){var e=[Array.prototype,Object.prototype,Function.prototype],t=function(t){for(var r=0;r1,n=t.length>0&&!(1===t.length&&"constructor"===t[0]),i=v.test(e+"")&&f.names(e).length>0;if(r||n||i)return!0}return!1}catch(e){return!1}},isIdentifier:function(e){return b.test(e)},inheritedDataKeys:g,getDataPropertyOrDefault:function(e,t,r){if(!f.isES5)return{}.hasOwnProperty.call(e,t)?e[t]:void 0;var n=Object.getOwnPropertyDescriptor(e,t);return null!=n?null==n.get&&null==n.set?n.value:r:void 0},thrower:function(e){throw e},isArray:f.isArray,asArray:w,notEnumerableProp:o,isPrimitive:a,isObject:function(e){return"function"==typeof e||"object"==typeof e&&null!==e},isError:l,canEvaluate:d,errorObj:p,tryCatch:function(e){return h=e,i},inherits:function(e,t){function r(){for(var r in this.constructor=e,this.constructor$=t,t.prototype)n.call(t.prototype,r)&&"$"!==r.charAt(r.length-1)&&(this[r+"$"]=t.prototype[r])}var n={}.hasOwnProperty;return r.prototype=t.prototype,e.prototype=new r,e.prototype},withAppended:function(e,t){var r,n=e.length,i=new Array(n+1);for(r=0;r10||e[0]>0}(),C.isNode&&C.toFastProperties(n);try{throw new Error}catch(e){C.lastLineError=e}e.exports=C}).call(t,r(13),r(5))},function(e,t,r){var n;(function(){var r=this,i=r._,a={},o=Array.prototype,s=Object.prototype,l=Function.prototype,c=o.push,u=o.slice,h=o.concat,f=s.toString,d=s.hasOwnProperty,p=o.forEach,m=o.map,g=o.reduce,v=o.reduceRight,b=o.filter,y=o.every,w=o.some,x=o.indexOf,_=o.lastIndexOf,S=Array.isArray,C=Object.keys,E=l.bind,A=function(e){return e instanceof A?e:this instanceof A?void(this._wrapped=e):new A(e)};void 0!==e&&e.exports&&(t=e.exports=A),t._=A,A.VERSION="1.6.0";var T=A.each=A.forEach=function(e,t,r){if(null==e)return e;if(p&&e.forEach===p)e.forEach(t,r);else if(e.length===+e.length){for(var n=0,i=e.length;n2;if(null==e&&(e=[]),g&&e.reduce===g)return n&&(t=A.bind(t,n)),i?e.reduce(t,r):e.reduce(t);if(T(e,(function(e,a,o){i?r=t.call(n,r,e,a,o):(r=e,i=!0)})),!i)throw new TypeError(k);return r},A.reduceRight=A.foldr=function(e,t,r,n){var i=arguments.length>2;if(null==e&&(e=[]),v&&e.reduceRight===v)return n&&(t=A.bind(t,n)),i?e.reduceRight(t,r):e.reduceRight(t);var a=e.length;if(a!==+a){var o=A.keys(e);a=o.length}if(T(e,(function(s,l,c){l=o?o[--a]:--a,i?r=t.call(n,r,e[l],l,c):(r=e[l],i=!0)})),!i)throw new TypeError(k);return r},A.find=A.detect=function(e,t,r){var n;return R(e,(function(e,i,a){if(t.call(r,e,i,a))return n=e,!0})),n},A.filter=A.select=function(e,t,r){var n=[];return null==e?n:b&&e.filter===b?e.filter(t,r):(T(e,(function(e,i,a){t.call(r,e,i,a)&&n.push(e)})),n)},A.reject=function(e,t,r){return A.filter(e,(function(e,n,i){return!t.call(r,e,n,i)}),r)},A.every=A.all=function(e,t,r){t||(t=A.identity);var n=!0;return null==e?n:y&&e.every===y?e.every(t,r):(T(e,(function(e,i,o){if(!(n=n&&t.call(r,e,i,o)))return a})),!!n)};var R=A.some=A.any=function(e,t,r){t||(t=A.identity);var n=!1;return null==e?n:w&&e.some===w?e.some(t,r):(T(e,(function(e,i,o){if(n||(n=t.call(r,e,i,o)))return a})),!!n)};A.contains=A.include=function(e,t){return null!=e&&(x&&e.indexOf===x?-1!=e.indexOf(t):R(e,(function(e){return e===t})))},A.invoke=function(e,t){var r=u.call(arguments,2),n=A.isFunction(t);return A.map(e,(function(e){return(n?t:e[t]).apply(e,r)}))},A.pluck=function(e,t){return A.map(e,A.property(t))},A.where=function(e,t){return A.filter(e,A.matches(t))},A.findWhere=function(e,t){return A.find(e,A.matches(t))},A.max=function(e,t,r){if(!t&&A.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);var n=-1/0,i=-1/0;return T(e,(function(e,a,o){var s=t?t.call(r,e,a,o):e;s>i&&(n=e,i=s)})),n},A.min=function(e,t,r){if(!t&&A.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);var n=1/0,i=1/0;return T(e,(function(e,a,o){var s=t?t.call(r,e,a,o):e;sn||void 0===r)return 1;if(r>>1;r.call(n,e[s])=0;r--)t=[e[r].apply(this,t)];return t[0]}},A.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},A.keys=function(e){if(!A.isObject(e))return[];if(C)return C(e);var t=[];for(var r in e)A.has(e,r)&&t.push(r);return t},A.values=function(e){for(var t=A.keys(e),r=t.length,n=new Array(r),i=0;i":">",'"':""","'":"'"}};D.unescape=A.invert(D.escape);var L={escape:new RegExp("["+A.keys(D.escape).join("")+"]","g"),unescape:new RegExp("("+A.keys(D.unescape).join("|")+")","g")};A.each(["escape","unescape"],(function(e){A[e]=function(t){return null==t?"":(""+t).replace(L[e],(function(t){return D[e][t]}))}})),A.result=function(e,t){if(null!=e){var r=e[t];return A.isFunction(r)?r.call(e):r}},A.mixin=function(e){T(A.functions(e),(function(t){var r=A[t]=e[t];A.prototype[t]=function(){var e=[this._wrapped];return c.apply(e,arguments),z.call(this,r.apply(A,e))}}))};var F=0;A.uniqueId=function(e){var t=++F+"";return e?e+t:t},A.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,U={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},j=/\\|'|\r|\n|\t|\u2028|\u2029/g;A.template=function(e,t,r){var n;r=A.defaults({},r,A.templateSettings);var i=new RegExp([(r.escape||N).source,(r.interpolate||N).source,(r.evaluate||N).source].join("|")+"|$","g"),a=0,o="__p+='";e.replace(i,(function(t,r,n,i,s){return o+=e.slice(a,s).replace(j,(function(e){return"\\"+U[e]})),r&&(o+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),n&&(o+="'+\n((__t=("+n+"))==null?'':__t)+\n'"),i&&(o+="';\n"+i+"\n__p+='"),a=s+t.length,t})),o+="';\n",r.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{n=new Function(r.variable||"obj","_",o)}catch(e){throw e.source=o,e}if(t)return n(t,A);var s=function(e){return n.call(this,e,A)};return s.source="function("+(r.variable||"obj")+"){\n"+o+"}",s},A.chain=function(e){return A(e).chain()};var z=function(e){return this._chain?A(e).chain():e};A.mixin(A),T(["pop","push","reverse","shift","sort","splice","unshift"],(function(e){var t=o[e];A.prototype[e]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=e&&"splice"!=e||0!==r.length||delete r[0],z.call(this,r)}})),T(["concat","join","slice"],(function(e){var t=o[e];A.prototype[e]=function(){return z.call(this,t.apply(this._wrapped,arguments))}})),A.extend(A.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),void 0!==(n=function(){return A}.apply(t,[]))&&(e.exports=n)}).call(this)},function(e,t){e.exports=n},function(e,t){e.exports=function(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}},function(e,t,r){var n=r(110),i=r(271),a=r(78);e.exports=function(e,t,r){var o=i(e);return r&&a(e,t,r)&&(t=void 0),t?n(o,t):o}},function(e,t){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function i(e){if(c===setTimeout)return setTimeout(e,0);if((c===r||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function a(){p&&f&&(p=!1,f.length?d=f.concat(d):m=-1,d.length&&o())}function o(){if(!p){var e=i(a);p=!0;for(var t=d.length;t;){for(f=d,d=[];++m1)for(var r=1;r1;)try{"array"===a||"nodebuffer"===a?n.push(String.fromCharCode.apply(null,e.slice(o,Math.min(o+r,i)))):n.push(String.fromCharCode.apply(null,e.subarray(o,Math.min(o+r,i)))),o+=r}catch(e){r=Math.floor(r/2)}return n.join("")}function o(e,t){for(var r=0;r=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|e}function h(e,t){if(a.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(e).length;default:if(n)return L(e).length;t=(""+t).toLowerCase(),n=!0}}function f(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return C(this,t,r);case"latin1":case"binary":return E(this,t,r);case"base64":return _(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function d(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function p(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,i);if("number"==typeof t)return t&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,i){function a(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var o,s=1,l=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,l/=2,c/=2,r/=2}if(i){var u=-1;for(o=r;ol&&(r=l-c),o=r;o>=0;o--){for(var h=!0,f=0;fi&&(n=i):n=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function _(e,t,r){return 0===t&&r===e.length?U.fromByteArray(e):U.fromByteArray(e.slice(t,r))}function S(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+h<=r)switch(h){case 1:c<128&&(u=c);break;case 2:128==(192&(a=e[i+1]))&&(l=(31&c)<<6|63&a)>127&&(u=l);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(l=(15&c)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,h=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=h}return function(e){var t=e.length;if(t<=H)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,n,i,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function I(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function M(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function P(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(e,t,r,n,i){return i||P(e,0,r,4),j.write(e,t,r,n,23,4),r+4}function B(e,t,r,n,i){return i||P(e,0,r,8),j.write(e,t,r,n,52,8),r+8}function D(e){return e<16?"0"+e.toString(16):e.toString(16)}function L(e,t){t=t||1/0;for(var r,n=e.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function F(e){return U.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function N(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}var U=r(209),j=r(251),z=r(103);t.Buffer=a,t.SlowBuffer=function(e){return+e!=e&&(e=0),a.alloc(+e)},t.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=n(),a.poolSize=8192,a._augment=function(e){return e.__proto__=a.prototype,e},a.from=function(e,t,r){return o(null,e,t,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(e,t,r){return function(e,t,r,n){return s(t),t<=0?i(e,t):void 0!==r?"string"==typeof n?i(e,t).fill(r,n):i(e,t).fill(r):i(e,t)}(null,e,t,r)},a.allocUnsafe=function(e){return l(null,e)},a.allocUnsafeSlow=function(e){return l(null,e)},a.isBuffer=function(e){return!(null==e||!e._isBuffer)},a.compare=function(e,t){if(!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},a.prototype.compare=function(e,t,r,n,i){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),l=Math.min(o,s),c=this.slice(n,i),u=e.slice(t,r),h=0;hi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":return b(this,e,t,r);case"latin1":case"binary":return y(this,e,t,r);case"base64":return w(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var H=4096;a.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUInt8=function(e,t){return t||k(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return t||k(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return t||k(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return t||k(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return t||k(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||k(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||k(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},a.prototype.readInt8=function(e,t){return t||k(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){t||k(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){t||k(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return t||k(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return t||k(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return t||k(e,4,this.length),j.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return t||k(e,4,this.length),j.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return t||k(e,8,this.length),j.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return t||k(e,8,this.length),j.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||R(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+r},a.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,1,255,0),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):M(this,e,t,!0),t+4},a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);R(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);R(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,1,127,-128),a.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):M(this,e,t,!0),t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},a.prototype.writeFloatLE=function(e,t,r){return O(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return O(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o=0&&y.splice(t,1)}function s(e){var t=document.createElement("style");return e.attrs.type="text/css",c(t,e.attrs),a(e,t),t}function l(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",c(t,e.attrs),a(e,t),t}function c(e,t){Object.keys(t).forEach((function(r){e.setAttribute(r,t[r])}))}function u(e,t){var r,n,i,a;if(t.transform&&e.css){if(!(a=t.transform(e.css)))return function(){};e.css=a}if(t.singleton){var c=b++;r=v||(v=s(t)),n=h.bind(null,r,c,!1),i=h.bind(null,r,c,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(r=l(t),n=d.bind(null,r,t),i=function(){o(r),r.href&&URL.revokeObjectURL(r.href)}):(r=s(t),n=f.bind(null,r),i=function(){o(r)});return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else i()}}function h(e,t,r,n){var i=r?"":n.css;if(e.styleSheet)e.styleSheet.cssText=x(t,i);else{var a=document.createTextNode(i),o=e.childNodes;o[t]&&e.removeChild(o[t]),o.length?e.insertBefore(a,o[t]):e.appendChild(a)}}function f(e,t){var r=t.css,n=t.media;if(n&&e.setAttribute("media",n),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}function d(e,t,r){var n=r.css,i=r.sourceMap,a=void 0===t.convertToAbsoluteUrls&&i;(t.convertToAbsoluteUrls||a)&&(n=w(n)),i&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var o=new Blob([n],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(o),s&&URL.revokeObjectURL(s)}var p={},m=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}((function(){return window&&document&&document.all&&!window.atob})),g=function(e){var t={};return function(r){return void 0===t[r]&&(t[r]=e.call(this,r)),t[r]}}((function(e){return document.querySelector(e)})),v=null,b=0,y=[],w=r(362);e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},void 0===t.singleton&&(t.singleton=m()),void 0===t.insertInto&&(t.insertInto="head"),void 0===t.insertAt&&(t.insertAt="bottom");var r=i(e,t);return n(r,t),function(e){for(var a=[],o=0;o-1&&e%1==0&&e<=r}},function(e,t,r){var n=r(116),i=r(52),a=r(3),o=r(290),s=n(Object,"keys"),l=s?function(e){var t=null==e?void 0:e.constructor;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&i(e)?o(e):a(e)?s(e):[]}:o;e.exports=l},function(e,t,r){function n(e){this._notes=o.indexBy(e,(function(e){return i(e.noteType,e.noteId)}))}function i(e,t){return e+"-"+t}function a(e){return{type:s.break,breakType:e}}var o=r(1),s=t.types={document:"document",paragraph:"paragraph",run:"run",text:"text",tab:"tab",hyperlink:"hyperlink",noteReference:"noteReference",image:"image",note:"note",commentReference:"commentReference",comment:"comment",table:"table",tableRow:"tableRow",tableCell:"tableCell",break:"break",bookmarkStart:"bookmarkStart"},l={baseline:"baseline",superscript:"superscript",subscript:"subscript"};n.prototype.resolve=function(e){return this.findNoteByKey(i(e.noteType,e.noteId))},n.prototype.findNoteByKey=function(e){return this._notes[e]||null},t.document=t.Document=function(e,t){return t=t||{},{type:s.document,children:e,notes:t.notes||new n({}),comments:t.comments||[]}},t.paragraph=t.Paragraph=function(e,t){return t=t||{},{type:s.paragraph,children:e,styleId:t.styleId||null,styleName:t.styleName||null,numbering:t.numbering||null,alignment:t.alignment||null}},t.run=t.Run=function(e,t){return t=t||{},{type:s.run,children:e,styleId:t.styleId||null,styleName:t.styleName||null,isBold:t.isBold,isUnderline:t.isUnderline,isItalic:t.isItalic,isStrikethrough:t.isStrikethrough,verticalAlignment:t.verticalAlignment||l.baseline,font:t.font||null}},t.Text=function(e){return{type:s.text,value:e}},t.tab=t.Tab=function(){return{type:s.tab}},t.Hyperlink=function(e,t){return{type:s.hyperlink,children:e,href:t.href,anchor:t.anchor}},t.noteReference=t.NoteReference=function(e){return{type:s.noteReference,noteType:e.noteType,noteId:e.noteId}},t.Notes=n,t.Note=function(e){return{type:s.note,noteType:e.noteType,noteId:e.noteId,body:e.body}},t.commentReference=function(e){return{type:s.commentReference,commentId:e.commentId}},t.comment=function(e){return{type:s.comment,commentId:e.commentId,body:e.body,authorName:e.authorName,authorInitials:e.authorInitials}},t.Image=function(e){return{type:s.image,read:e.readImage,altText:e.altText,contentType:e.contentType}},t.Table=function(e){return{type:s.table,children:e}},t.TableRow=function(e){return{type:s.tableRow,children:e}},t.TableCell=function(e,t){return t=t||{},{type:s.tableCell,children:e,colSpan:null==t.colSpan?1:t.colSpan,rowSpan:null==t.rowSpan?1:t.rowSpan}},t.lineBreak=a("line"),t.pageBreak=a("page"),t.columnBreak=a("column"),t.BookmarkStart=function(e){return{type:s.bookmarkStart,name:e.name}},t.verticalAlignment=l},function(e,t,r){(function(){var t,n,i,a,o,s,l,c,u,h,f={}.hasOwnProperty;h=r(3),u=r(53),c=r(291),o=null,t=null,n=null,i=null,a=null,s=null,l=null,e.exports=function(){function e(e){this.parent=e,this.options=this.parent.options,this.stringify=this.parent.stringify,null===o&&(o=r(147),t=r(143),n=r(144),i=r(145),a=r(146),s=r(382),l=r(384))}return e.prototype.clone=function(){throw new Error("Cannot clone generic XMLNode")},e.prototype.element=function(e,t,r){var n,i,a,o,s,l,d;if(o=null,null==t&&(t={}),t=t.valueOf(),h(t)||(r=(l=[t,r])[0],t=l[1]),null!=e&&(e=e.valueOf()),Array.isArray(e))for(i=0,s=e.length;i=0;r--)t=this._elements[r].wrapNodes(t);return t},o.prototype.matchesElement=function(e){return this.tagNames[e.tagName]&&s.isEqual(this.attributes||{},e.attributes||{})},o.prototype.wrap=function(e){return this.wrapNodes(e())},o.prototype.wrapNodes=function(e){return[l.elementWithTag(this,e)]},t.empty=n([]),t.ignore={wrap:function(){return[]}}},function(e,t,r){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var a,o,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,n)}));case 4:return t.nextTick((function(){e.call(null,r,n,i)}));default:for(a=new Array(s-1),o=0;odocument.F=Object<\/script>"),e.close(),l=e.F;n--;)delete l.prototype[a[n]];return l()};e.exports=Object.create||function(e,t){var r;return null!==e?(s.prototype=n(e),r=new s,s.prototype=null,r[o]=e):r=l(),void 0===t?r:i(r,t)}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,r){var n=r(27).f,i=r(26),a=r(35)("toStringTag");e.exports=function(e,t,r){e&&!i(e=r?e:e.prototype,a)&&n(e,a,{configurable:!0,value:t})}},function(e,t,r){var n=r(67)("keys"),i=r(51);e.exports=function(e){return n[e]||(n[e]=i(e))}},function(e,t,r){var n=r(11),i=r(17),a=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:n.version,mode:r(47)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t,r){var n=r(33);e.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;if("function"==typeof(r=e.valueOf)&&!n(i=r.call(e)))return i;if(!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,r){var n=r(17),i=r(11),a=r(47),o=r(71),s=r(27).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=a?{}:n.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:o.f(e)})}},function(e,t,r){t.f=r(35)},function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function i(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!function(e){return"number"==typeof e}(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,o,s,l,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var u=new Error('Uncaught, unspecified "error" event. ('+t+")");throw u.context=t,u}if(a(r=this._events[e]))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(i(r))for(s=Array.prototype.slice.call(arguments,1),o=(c=r.slice()).length,l=0;l0&&this._events[e].length>o&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function r(){this.removeListener(e,r),i||(i=!0,t.apply(this,arguments))}if(!n(t))throw TypeError("listener must be a function");var i=!1;return r.listener=t,this.on(e,r),this},r.prototype.removeListener=function(e,t){var r,a,o,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(o=(r=this._events[e]).length,a=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(r)){for(s=o;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){a=s;break}if(a<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(a,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,r){"use strict";var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.encode=function(e,t){for(var r,i,a,o,s,l,c,u="",h=0;h>2,s=(3&r)<<4|(i=e.charCodeAt(h++))>>4,l=(15&i)<<2|(a=e.charCodeAt(h++))>>6,c=63&a,isNaN(i)?l=c=64:isNaN(a)&&(c=64),u=u+n.charAt(o)+n.charAt(s)+n.charAt(l)+n.charAt(c);return u},t.decode=function(e,t){var r,i,a,o,s,l,c="",u=0;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");u>4,i=(15&o)<<4|(s=n.indexOf(e.charAt(u++)))>>2,a=(3&s)<<6|(l=n.indexOf(e.charAt(u++))),c+=String.fromCharCode(r),64!=s&&(c+=String.fromCharCode(i)),64!=l&&(c+=String.fromCharCode(a));return c}},function(e,t,r){"use strict";t.STORE={magic:"\0\0",compress:function(e,t){return e},uncompress:function(e){return e},compressInputType:null,uncompressInputType:null},t.DEFLATE=r(254)},function(e,t,r){"use strict";(function(t){e.exports=function(e,r){return new t(e,r)},e.exports.test=function(e){return t.isBuffer(e)}}).call(t,r(14).Buffer)},function(e,t,r){"use strict";var n=r(45),i=r(12),a=r(252),o=r(107),s=r(106),l=r(73),c=r(74),u=r(104),h=r(75),f=r(260),d=r(258),p=r(259),m=function(e){if(e._data instanceof u&&(e._data=e._data.getContent(),e.options.binary=!0,e.options.base64=!1,"uint8array"===i.getTypeOf(e._data))){var t=e._data;e._data=new Uint8Array(t.length),0!==t.length&&e._data.set(t,0)}return e._data},g=function(e){var t=m(e);return"string"===i.getTypeOf(t)?!e.options.binary&&n.nodebuffer?h(t,"utf-8"):e.asBinary():t},v=function(e){var t=m(this);return null==t?"":(this.options.base64&&(t=l.decode(t)),t=e&&this.options.binary?T.utf8decode(t):i.transformTo("string",t),e||this.options.binary||(t=i.transformTo("string",T.utf8encode(t))),t)},b=function(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this.options=r,this._initialMetadata={dir:r.dir,date:r.date}};b.prototype={asText:function(){return v.call(this,!0)},asBinary:function(){return v.call(this,!1)},asNodeBuffer:function(){var e=g(this);return i.transformTo("nodebuffer",e)},asUint8Array:function(){var e=g(this);return i.transformTo("uint8array",e)},asArrayBuffer:function(){return this.asUint8Array().buffer}};var y=function(e,t){var r,n="";for(r=0;r>>=8;return n},w=function(){var e,t,r={};for(e=0;e0?e.substring(0,t):""},S=function(e){return"/"!=e.slice(-1)&&(e+="/"),e},C=function(e,t){return t=void 0!==t&&t,e=S(e),this.files[e]||x.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]},E=function(e,t,r){var n,o=new u;return e._data instanceof u?(o.uncompressedSize=e._data.uncompressedSize,o.crc32=e._data.crc32,0===o.uncompressedSize||e.dir?(t=c.STORE,o.compressedContent="",o.crc32=0):e._data.compressionMethod===t.magic?o.compressedContent=e._data.getCompressedContent():(n=e._data.getContent(),o.compressedContent=t.compress(i.transformTo(t.compressInputType,n),r))):((n=g(e))&&0!==n.length&&!e.dir||(t=c.STORE,n=""),o.uncompressedSize=n.length,o.crc32=a(n),o.compressedContent=t.compress(i.transformTo(t.compressInputType,n),r)),o.compressedSize=o.compressedContent.length,o.compressionMethod=t.magic,o},A=function(e,t,r,n,s){var l,c,u,h,d=(r.compressedContent,i.transformTo("string",f.utf8encode(t.name))),p=t.comment||"",m=i.transformTo("string",f.utf8encode(p)),g=d.length!==t.name.length,v=m.length!==p.length,b=t.options,w="",x="",_="";u=t._initialMetadata.dir!==t.dir?t.dir:b.dir,h=t._initialMetadata.date!==t.date?t.date:b.date;var S=0,C=0;u&&(S|=16),"UNIX"===s?(C=798,S|=function(e,t){var r=e;return e||(r=t?16893:33204),(65535&r)<<16}(t.unixPermissions,u)):(C=20,S|=function(e,t){return 63&(e||0)}(t.dosPermissions)),l=h.getHours(),l<<=6,l|=h.getMinutes(),l<<=5,l|=h.getSeconds()/2,c=h.getFullYear()-1980,c<<=4,c|=h.getMonth()+1,c<<=5,c|=h.getDate(),g&&(x=y(1,1)+y(a(d),4)+d,w+="up"+y(x.length,2)+x),v&&(_=y(1,1)+y(this.crc32(m),4)+m,w+="uc"+y(_.length,2)+_);var E="";return E+="\n\0",E+=g||v?"\0\b":"\0\0",E+=r.compressionMethod,E+=y(l,2),E+=y(c,2),E+=y(r.crc32,4),E+=y(r.compressedSize,4),E+=y(r.uncompressedSize,4),E+=y(d.length,2),E+=y(w.length,2),{fileRecord:o.LOCAL_FILE_HEADER+E+d+w,dirRecord:o.CENTRAL_FILE_HEADER+y(C,2)+E+y(m.length,2)+"\0\0\0\0"+y(S,4)+y(n,4)+d+w+m,compressedObject:r}},T={load:function(e,t){throw new Error("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(e){var t,r,n,i,a=[];for(t in this.files)this.files.hasOwnProperty(t)&&(n=this.files[t],i=new b(n.name,n._data,w(n.options)),r=t.slice(this.root.length,t.length),t.slice(0,this.root.length)===this.root&&e(r,i)&&a.push(i));return a},file:function(e,t,r){if(1===arguments.length){if(i.isRegExp(e)){var n=e;return this.filter((function(e,t){return!t.dir&&n.test(e)}))}return this.filter((function(t,r){return!r.dir&&t===e}))[0]||null}return e=this.root+e,x.call(this,e,t,r),this},folder:function(e){if(!e)return this;if(i.isRegExp(e))return this.filter((function(t,r){return r.dir&&e.test(t)}));var t=this.root+e,r=C.call(this,t),n=this.clone();return n.root=r.name,n},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 r=this.filter((function(t,r){return r.name.slice(0,e.length)===e})),n=0;n-1&&e%1==0&&e-1?n:g.nextTick;l.WritableState=s;var y=r(44);y.inherits=r(28);var w,x={deprecate:r(371)},_=r(138),S=r(57).Buffer,C=i.Uint8Array||function(){},E=r(137);y.inherits(l,_),s.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(s.prototype,"buffer",{get:x.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(w=Function.prototype[Symbol.hasInstance],Object.defineProperty(l,Symbol.hasInstance,{value:function(e){return!!w.call(this,e)||this===l&&e&&e._writableState instanceof s}})):w=function(e){return e instanceof this},l.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},l.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&function(e){return S.isBuffer(e)||e instanceof C}(e);return a&&!S.isBuffer(e)&&(e=function(e){return S.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=o),n.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),g.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),g.nextTick(n,a),i=!1),i}(this,n,e,r))&&(n.pendingcb++,i=c(this,n,a,e,t,r)),i},l.prototype.cork=function(){this._writableState.corked++},l.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||f(this,e))},l.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),l.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},l.prototype._writev=null,l.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,m(e,t),r&&(t.finished?g.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),l.prototype.destroy=E.destroy,l.prototype._undestroy=E.undestroy,l.prototype._destroy=function(e,t){this.end(),t(e)}}).call(t,r(5),r(141).setImmediate,r(13))},function(e,t,r){(t=e.exports=r(135)).Stream=t,t.Readable=t,t.Writable=r(82),t.Duplex=r(30),t.Transform=r(136),t.PassThrough=r(357)},function(e,t,r){"use strict";function n(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&&(f.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=c,t=3;break;default:return this.write=u,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=f.allocUnsafe(t)}function i(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r: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))}function o(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}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 r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?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-r))}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function u(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}var f=r(57).Buffer,d=f.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}};t.StringDecoder=n,n.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(a>0&&(e.lastNeed=a-1),a):--n=0?(a>0&&(e.lastNeed=a-2),a):--n=0?(a>0&&(2===a?a=0:e.lastNeed=a-3),a):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},n.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return 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),this.lastNeed-=e.length}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6)),a=n(r(7)),o=n(r(10)),s=n(r(8)),l=n(r(9)),c=r(2),u=n(c),h=n(r(351)),f=n(r(241)),d=function(e){function t(e){(0,a.default)(this,t);var r=(0,o.default)(this,(t.__proto__||(0,i.default)(t)).call(this,e));return r.state=t.parse(e.data),r}return(0,l.default)(t,e),(0,s.default)(t,null,[{key:"parse",value:function(e){var t=[],r=[];return new f.default(e).forEach((function(e){if(r.length<1)e.forEach((function(e,t){r.push({key:"key-"+t,name:e,resizable:!0,sortable:!0,filterable:!0})}));else{var n={};e.forEach((function(e,t){n["key-"+t]=e})),t.push(n)}})),{rows:t,columns:r}}}]),(0,s.default)(t,[{key:"componentWillReceiveProps",value:function(e){this.setState(t.parse(e.data))}},{key:"render",value:function(){var e=this.state,t=e.rows,r=e.columns;return u.default.createElement(h.default,{columns:r,rowsCount:t.length,rowGetter:function(e){return t[e]},minHeight:this.props.height||650})}}]),t}(c.Component);t.default=d},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6)),a=n(r(7)),o=n(r(8)),s=n(r(10)),l=n(r(9)),c=r(2),u=n(c);r(367);var h=function(e){function t(){return(0,a.default)(this,t),(0,s.default)(this,(t.__proto__||(0,i.default)(t)).apply(this,arguments))}return(0,l.default)(t,e),(0,o.default)(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.originalWidth,r=e.originalHeight,n=this.getImageDimensions.call(this,t,r);this.props.texture.image.style.width=n.width+"px",this.props.texture.image.style.height=n.height+"px",this.props.texture.image.setAttribute("class","photo"),document.getElementById("pg-photo-container").appendChild(this.props.texture.image)}},{key:"getImageDimensions",value:function(e,t){var r=void 0,n=void 0,i=this.props,a=i.height,o=i.width;if(t<=a&&e<=o)n=e,r=t;else{var s=a/t,l=o/e;sl;)n(s,r=t[l++])&&(~a(c,r)||c.push(r));return c}},function(e,t,r){var n=r(25),i=r(11),a=r(31);e.exports=function(e,t){var r=(i.Object||{})[e]||Object[e],o={};o[e]=t(r),n(n.S+n.F*a((function(){r(1)})),"Object",o)}},function(e,t,r){e.exports=r(32)},function(e,t,r){"use strict";function n(e){var t;if(function(e){return e instanceof Error&&s.getPrototypeOf(e)===Error.prototype}(e)){(t=new o(e)).name=e.name,t.message=e.message,t.stack=e.stack;for(var r=s.keys(e),n=0;n=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return i.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1)}},e.exports=n},function(e,t,r){"use strict";t.base64=!1,t.binary=!1,t.dir=!1,t.createFolders=!1,t.date=null,t.compression=null,t.compressionOptions=null,t.comment=null,t.unixPermissions=null,t.dosPermissions=null},function(e,t,r){"use strict";t.LOCAL_FILE_HEADER="PK",t.CENTRAL_FILE_HEADER="PK",t.CENTRAL_DIRECTORY_END="PK",t.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",t.ZIP64_CENTRAL_DIRECTORY_END="PK",t.DATA_DESCRIPTOR="PK\b"},function(e,t,r){"use strict";function n(e,t){this.data=e,t||(this.data=a.string2binary(this.data)),this.length=this.data.length,this.index=0}var i=r(105),a=r(12);n.prototype=new i,n.prototype.byteAt=function(e){return this.data.charCodeAt(e)},n.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)},n.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.index,this.index+e);return this.index+=e,t},e.exports=n},function(e,t,r){"use strict";function n(e){e&&(this.data=e,this.length=this.data.length,this.index=0)}var i=r(105);n.prototype=new i,n.prototype.byteAt=function(e){return this.data[e]},n.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),a=this.length-4;a>=0;--a)if(this.data[a]===t&&this.data[a+1]===r&&this.data[a+2]===n&&this.data[a+3]===i)return a;return-1},n.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.index,this.index+e);return this.index+=e,t},e.exports=n},function(e,t,r){var n=r(270),i=r(38);e.exports=function(e,t){return null==t?e:n(t,i(t),e)}},function(e,t,r){var n=r(20);e.exports=function(e,t,r){if(null!=e){void 0!==r&&r in n(e)&&(t=[r]);for(var i=0,a=t.length;null!=e&&i=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;s[254]=s[254]=1,t.string2buf=function(e){var t,r,n,a,o,s=e.length,l=0;for(a=0;a>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},t.buf2binstring=function(e){return n(e,e.length)},t.binstring2buf=function(e){for(var t=new i.Buf8(e.length),r=0,n=t.length;r4)c[i++]=65533,r+=o-1;else{for(a&=2===o?31:3===o?15:7;o>1&&r1?c[i++]=65533:a<65536?c[i++]=a:(a-=65536,c[i++]=55296|a>>10&1023,c[i++]=56320|1023&a)}return n(c,i)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+s[e[r]]>t?r:t}},function(e,t,r){"use strict";e.exports=function(e,t,r,n){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{a=a+(i=i+t[n++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16|0}},function(e,t,r){"use strict";e.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}},function(e,t,r){"use strict";var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,t,r,i){var a=n,o=i+r;e^=-1;for(var s=i;s>>8^a[255&(e^t[s])];return-1^e}},function(e,t,r){"use strict";e.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}},function(e,t,r){"use strict";(function(t,n){function i(e,t){e=e||{};var n=t instanceof(_=_||r(30));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new P,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(M||(M=r(84).StringDecoder),this.decoder=new M(e.encoding),this.encoding=e.encoding)}function a(e){if(_=_||r(30),!(this instanceof a))return new a(e);this._readableState=new i(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),E.call(this)}function o(e,t,r,n,i){var a,o=e._readableState;return null===t?(o.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,u(e)}}(e,o)):(i||(a=l(o,t)),a?e.emit("error",a):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===A.prototype||(t=function(e){return A.from(e)}(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):s(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?s(e,o,t,!1):f(e,o)):s(e,o,t,!1))):n||(o.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=D?e=D:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function u(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(I("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?x.nextTick(h,e):h(e))}function h(e){I("emit readable"),e.emit("readable"),g(e)}function f(e,t){t.readingMore||(t.readingMore=!0,x.nextTick(d,e,t))}function d(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;return ea.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0==(e-=o)){o===a.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=A.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0==(e-=o)){o===a.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++i}return t.length-=i,r}(e,t),n}(e,t.buffer,t.decoder),r);var r}function b(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,x.nextTick(y,t,e))}function y(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function w(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return I("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?b(this):u(this),null;if(0===(e=c(e,t))&&t.ended)return 0===t.length&&b(this),null;var n,i=t.needReadable;return I("need readable",i),(0===t.length||t.length-e0?v(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&b(this)),null!==n&&this.emit("data",n),n},a.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},a.prototype.pipe=function(e,t){function r(e,t){I("onunpipe"),e===h&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,a())}function i(){I("onend"),e.end()}function a(){I("cleanup"),e.removeListener("close",l),e.removeListener("finish",c),e.removeListener("drain",p),e.removeListener("error",s),e.removeListener("unpipe",r),h.removeListener("end",i),h.removeListener("end",u),h.removeListener("data",o),m=!0,!f.awaitDrain||e._writableState&&!e._writableState.needDrain||p()}function o(t){I("ondata"),v=!1,!1!==e.write(t)||v||((1===f.pipesCount&&f.pipes===e||f.pipesCount>1&&-1!==w(f.pipes,e))&&!m&&(I("false write response, pause",h._readableState.awaitDrain),h._readableState.awaitDrain++,v=!0),h.pause())}function s(t){I("onerror",t),u(),e.removeListener("error",s),0===C(e,"error")&&e.emit("error",t)}function l(){e.removeListener("finish",c),u()}function c(){I("onfinish"),e.removeListener("close",l),u()}function u(){I("unpipe"),h.unpipe(e)}var h=this,f=this._readableState;switch(f.pipesCount){case 0:f.pipes=e;break;case 1:f.pipes=[f.pipes,e];break;default:f.pipes.push(e)}f.pipesCount+=1,I("pipe count=%d opts=%j",f.pipesCount,t);var d=t&&!1===t.end||e===n.stdout||e===n.stderr?u:i;f.endEmitted?x.nextTick(d):h.once("end",d),e.on("unpipe",r);var p=function(e){return function(){var t=e._readableState;I("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&C(e,"data")&&(t.flowing=!0,g(e))}}(h);e.on("drain",p);var m=!1,v=!1;return h.on("data",o),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?S(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",s),e.once("close",l),e.once("finish",c),e.emit("pipe",h),f.flowing||(I("pipe resume"),h.resume()),e},a.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function f(e,t,r,n,i,o,s,l,c,u,h,f){a.call(this,null,o,s,l,c,u,n,i,h,f),this.image={data:e,width:t,height:r},this.magFilter=void 0!==c?c:oo,this.minFilter=void 0!==u?u:oo,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function d(e,t,r,n,i,o,s,l,c,u){e=void 0!==e?e:[],t=void 0!==t?t:Za,a.call(this,e,t,r,n,i,o,s,l,c,u),this.flipY=!1}function p(){this.seq=[],this.map={}}function m(e,t,r){var n=e[0];if(n<=0||n>0)return e;var i=t*r,a=ps[i];if(void 0===a&&(a=new Float32Array(i),ps[i]=a),0!==t){n.toArray(a,0);for(var o=1,s=0;o!==t;++o)s+=r,e[o].toArray(a,s)}return a}function g(e,t){var r=ms[t];void 0===r&&(r=new Int32Array(t),ms[t]=r);for(var n=0;n!==t;++n)r[n]=e.allocTextureUnit();return r}function v(e,t){e.uniform1f(this.addr,t)}function b(e,t){e.uniform1i(this.addr,t)}function y(e,t){void 0===t.x?e.uniform2fv(this.addr,t):e.uniform2f(this.addr,t.x,t.y)}function w(e,t){void 0!==t.x?e.uniform3f(this.addr,t.x,t.y,t.z):void 0!==t.r?e.uniform3f(this.addr,t.r,t.g,t.b):e.uniform3fv(this.addr,t)}function x(e,t){void 0===t.x?e.uniform4fv(this.addr,t):e.uniform4f(this.addr,t.x,t.y,t.z,t.w)}function _(e,t){e.uniformMatrix2fv(this.addr,!1,t.elements||t)}function S(e,t){void 0===t.elements?e.uniformMatrix3fv(this.addr,!1,t):(vs.set(t.elements),e.uniformMatrix3fv(this.addr,!1,vs))}function C(e,t){void 0===t.elements?e.uniformMatrix4fv(this.addr,!1,t):(gs.set(t.elements),e.uniformMatrix4fv(this.addr,!1,gs))}function E(e,t,r){var n=r.allocTextureUnit();e.uniform1i(this.addr,n),r.setTexture2D(t||fs,n)}function A(e,t,r){var n=r.allocTextureUnit();e.uniform1i(this.addr,n),r.setTextureCube(t||ds,n)}function T(e,t){e.uniform2iv(this.addr,t)}function k(e,t){e.uniform3iv(this.addr,t)}function R(e,t){e.uniform4iv(this.addr,t)}function I(e,t){e.uniform1fv(this.addr,t)}function M(e,t){e.uniform1iv(this.addr,t)}function P(e,t){e.uniform2fv(this.addr,m(t,this.size,2))}function O(e,t){e.uniform3fv(this.addr,m(t,this.size,3))}function B(e,t){e.uniform4fv(this.addr,m(t,this.size,4))}function D(e,t){e.uniformMatrix2fv(this.addr,!1,m(t,this.size,4))}function L(e,t){e.uniformMatrix3fv(this.addr,!1,m(t,this.size,9))}function F(e,t){e.uniformMatrix4fv(this.addr,!1,m(t,this.size,16))}function N(e,t,r){var n=t.length,i=g(r,n);e.uniform1iv(this.addr,i);for(var a=0;a!==n;++a)r.setTexture2D(t[a]||fs,i[a])}function U(e,t,r){var n=t.length,i=g(r,n);e.uniform1iv(this.addr,i);for(var a=0;a!==n;++a)r.setTextureCube(t[a]||ds,i[a])}function j(e,t,r){this.id=e,this.addr=r,this.setValue=function(e){switch(e){case 5126:return v;case 35664:return y;case 35665:return w;case 35666:return x;case 35674:return _;case 35675:return S;case 35676:return C;case 35678:return E;case 35680:return A;case 5124:case 35670:return b;case 35667:case 35671:return T;case 35668:case 35672:return k;case 35669:case 35673:return R}}(t.type)}function z(e,t,r){this.id=e,this.addr=r,this.size=t.size,this.setValue=function(e){switch(e){case 5126:return I;case 35664:return P;case 35665:return O;case 35666:return B;case 35674:return D;case 35675:return L;case 35676:return F;case 35678:return N;case 35680:return U;case 5124:case 35670:return M;case 35667:case 35671:return T;case 35668:case 35672:return k;case 35669:case 35673:return R}}(t.type)}function H(e){this.id=e,p.call(this)}function G(e,t){e.seq.push(t),e.map[t.id]=t}function V(e,t,r){var n=e.name,i=n.length;for(bs.lastIndex=0;;){var a=bs.exec(n),o=bs.lastIndex,s=a[1],l="]"===a[2],c=a[3];if(l&&(s|=0),void 0===c||"["===c&&o+2===i){G(r,void 0===c?new j(s,e,t):new z(s,e,t));break}var u=r.map[s];void 0===u&&G(r,u=new H(s)),r=u}}function q(e,t,r){p.call(this),this.renderer=r;for(var n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),i=0;i.001&&M.scale>.001&&(S.x=M.x,S.y=M.y,S.z=M.z,x=M.size*M.scale/g.w,_.x=x*b,_.y=x,p.uniform3f(h.screenPosition,S.x,S.y,S.z),p.uniform2f(h.scale,_.x,_.y),p.uniform1f(h.rotation,M.rotation),p.uniform1f(h.opacity,M.opacity),p.uniform3f(h.color,M.color.r,M.color.g,M.color.b),m.setBlending(M.blending,M.blendEquation,M.blendSrc,M.blendDst),e.setTexture2D(M.texture,1),p.drawElements(p.TRIANGLES,6,p.UNSIGNED_SHORT,0))}}}m.enable(p.CULL_FACE),m.enable(p.DEPTH_TEST),m.buffers.depth.setMask(!0),e.resetGLState()}}}function K(e,t){function r(){var e=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),t=new Uint16Array([0,1,2,0,2,3]);o=p.createBuffer(),s=p.createBuffer(),p.bindBuffer(p.ARRAY_BUFFER,o),p.bufferData(p.ARRAY_BUFFER,e,p.STATIC_DRAW),p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,s),p.bufferData(p.ELEMENT_ARRAY_BUFFER,t,p.STATIC_DRAW),l=n(),h={position:p.getAttribLocation(l,"position"),uv:p.getAttribLocation(l,"uv")},f={uvOffset:p.getUniformLocation(l,"uvOffset"),uvScale:p.getUniformLocation(l,"uvScale"),rotation:p.getUniformLocation(l,"rotation"),scale:p.getUniformLocation(l,"scale"),color:p.getUniformLocation(l,"color"),map:p.getUniformLocation(l,"map"),opacity:p.getUniformLocation(l,"opacity"),modelViewMatrix:p.getUniformLocation(l,"modelViewMatrix"),projectionMatrix:p.getUniformLocation(l,"projectionMatrix"),fogType:p.getUniformLocation(l,"fogType"),fogDensity:p.getUniformLocation(l,"fogDensity"),fogNear:p.getUniformLocation(l,"fogNear"),fogFar:p.getUniformLocation(l,"fogFar"),fogColor:p.getUniformLocation(l,"fogColor"),alphaTest:p.getUniformLocation(l,"alphaTest")};var r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");r.width=8,r.height=8;var i=r.getContext("2d");i.fillStyle="white",i.fillRect(0,0,8,8),(d=new a(r)).needsUpdate=!0}function n(){var t=p.createProgram(),r=p.createShader(p.VERTEX_SHADER),n=p.createShader(p.FRAGMENT_SHADER);return p.shaderSource(r,["precision "+e.getPrecision()+" float;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uvOffset + uv * uvScale;","vec2 alignedPosition = position * scale;","vec2 rotatedPosition;","rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","vec4 finalPosition;","finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","finalPosition.xy += rotatedPosition;","finalPosition = projectionMatrix * finalPosition;","gl_Position = finalPosition;","}"].join("\n")),p.shaderSource(n,["precision "+e.getPrecision()+" float;","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","void main() {","vec4 texture = texture2D( map, vUV );","if ( texture.a < alphaTest ) discard;","gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","if ( fogType > 0 ) {","float depth = gl_FragCoord.z / gl_FragCoord.w;","float fogFactor = 0.0;","if ( fogType == 1 ) {","fogFactor = smoothstep( fogNear, fogFar, depth );","} else {","const float LOG2 = 1.442695;","fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );","fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","}","gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}","}"].join("\n")),p.compileShader(r),p.compileShader(n),p.attachShader(t,r),p.attachShader(t,n),p.linkProgram(t),t}function i(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:t.id-e.id}var o,s,l,h,f,d,p=e.context,m=e.state,g=new u,v=new c,b=new u;this.render=function(n,a){if(0!==t.length){void 0===l&&r(),p.useProgram(l),m.initAttributes(),m.enableAttribute(h.position),m.enableAttribute(h.uv),m.disableUnusedAttributes(),m.disable(p.CULL_FACE),m.enable(p.BLEND),p.bindBuffer(p.ARRAY_BUFFER,o),p.vertexAttribPointer(h.position,2,p.FLOAT,!1,16,0),p.vertexAttribPointer(h.uv,2,p.FLOAT,!1,16,8),p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,s),p.uniformMatrix4fv(f.projectionMatrix,!1,a.projectionMatrix.elements),m.activeTexture(p.TEXTURE0),p.uniform1i(f.map,0);var c=0,u=0,y=n.fog;y?(p.uniform3f(f.fogColor,y.color.r,y.color.g,y.color.b),y.isFog?(p.uniform1f(f.fogNear,y.near),p.uniform1f(f.fogFar,y.far),p.uniform1i(f.fogType,1),c=1,u=1):y.isFogExp2&&(p.uniform1f(f.fogDensity,y.density),p.uniform1i(f.fogType,2),c=2,u=2)):(p.uniform1i(f.fogType,0),c=0,u=0);for(var w=0,x=t.length;w0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function re(e,t){this.normal=void 0!==e?e:new u(1,0,0),this.constant=void 0!==t?t:0}function ne(e,t,r,n,i,a){this.planes=[void 0!==e?e:new re,void 0!==t?t:new re,void 0!==r?r:new re,void 0!==n?n:new re,void 0!==i?i:new re,void 0!==a?a:new re]}function ie(e,t,r,n){function a(t,r,n,i){var a=t.geometry,o=null,s=S,l=t.customDepthMaterial;if(n&&(s=C,l=t.customDistanceMaterial),l)o=l;else{var c=!1;r.morphTargets&&(a&&a.isBufferGeometry?c=a.morphAttributes&&a.morphAttributes.position&&a.morphAttributes.position.length>0:a&&a.isGeometry&&(c=a.morphTargets&&a.morphTargets.length>0)),t.isSkinnedMesh&&!1===r.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t);var u=t.isSkinnedMesh&&r.skinning,h=0;c&&(h|=w),u&&(h|=x),o=s[h]}if(e.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){var f=o.uuid,d=r.uuid,p=E[f];void 0===p&&(p={},E[f]=p);var m=p[d];void 0===m&&(m=o.clone(),p[d]=m),o=m}o.visible=r.visible,o.wireframe=r.wireframe;var g=r.side;return F.renderSingleSided&&g==aa&&(g=na),F.renderReverseSided&&(g===na?g=ia:g===ia&&(g=na)),o.side=g,o.clipShadows=r.clipShadows,o.clippingPlanes=r.clippingPlanes,o.wireframeLinewidth=r.wireframeLinewidth,o.linewidth=r.linewidth,n&&void 0!==o.uniforms.lightPos&&o.uniforms.lightPos.value.copy(i),o}function l(t,n,i,o){if(!1!==t.visible){if(t.layers.test(n.layers)&&(t.isMesh||t.isLine||t.isPoints)&&t.castShadow&&(!t.frustumCulled||d.intersectsObject(t))){t.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,t.matrixWorld);var s=r.update(t),c=t.material;if(Array.isArray(c))for(var u=s.groups,h=0,f=u.length;ht&&(t=e[r]);return t}function Ee(){return As++}function Ae(){Object.defineProperty(this,"id",{value:Ee()}),this.uuid=us.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.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function Te(){Object.defineProperty(this,"id",{value:Ee()}),this.uuid=us.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0}}function ke(e,t){le.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new Te,this.material=void 0!==t?t:new fe({color:16777215*Math.random()}),this.drawMode=Jo,this.updateMorphTargets()}function Re(e,t,r,n,i,a){Ae.call(this),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:n,heightSegments:i,depthSegments:a},this.fromBufferGeometry(new Ie(e,t,r,n,i,a)),this.mergeVertices()}function Ie(e,t,r,n,i,a){function o(e,t,r,n,i,a,o,m,g,v,b){var y,w,x=a/g,_=o/v,S=a/2,C=o/2,E=m/2,A=g+1,T=v+1,k=0,R=0,I=new u;for(w=0;w0?1:-1,h.push(I.x,I.y,I.z),f.push(y/g),f.push(1-w/v),k+=1}}for(w=0;w65535?we:be)(o,1),t.update(n,e.ELEMENT_ARRAY_BUFFER),a[r.id]=n,n}}}function Ve(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var r;switch(t.type){case"DirectionalLight":r={direction:new u,color:new W,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i};break;case"SpotLight":r={position:new u,direction:new u,color:new W,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i};break;case"PointLight":r={position:new u,color:new W,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i};break;case"HemisphereLight":r={direction:new u,skyColor:new W,groundColor:new W};break;case"RectAreaLight":r={color:new W,position:new u,halfWidth:new u,halfHeight:new u}}return e[t.id]=r,r}}}function qe(e,t,r){var n={};return{update:function(e){var i=r.frame,a=e.geometry,o=t.get(e,a);return n[o.id]!==i&&(a.isGeometry&&o.updateFromObject(e),t.update(o),n[o.id]=i),o},clear:function(){n={}}}}function We(e,t,r){var n=e.createShader(t);return e.shaderSource(n,r),e.compileShader(n),!1===e.getShaderParameter(n,e.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==e.getShaderInfoLog(n)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",t===e.VERTEX_SHADER?"vertex":"fragment",e.getShaderInfoLog(n),function(e){for(var t=e.split("\n"),r=0;r/gm,(function(e,t){var r=_s[t];if(void 0===r)throw new Error("Can not resolve #include <"+t+">");return $e(r)}))}function et(e){return e.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,(function(e,t,r,n){for(var i="",a=parseInt(t);a0?e.gammaFactor:1,g=function(e,t,r){return[(e=e||{}).derivatives||t.envMapCubeUV||t.bumpMap||t.normalMap||t.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(e.fragDepth||t.logarithmicDepthBuffer)&&r.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",e.drawBuffers&&r.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(e.shaderTextureLOD||t.envMap)&&r.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Je).join("\n")}(a,n,e.extensions),v=function(e){var t=[];for(var r in e){var n=e[r];!1!==n&&t.push("#define "+r+" "+n)}return t.join("\n")}(o),b=i.createProgram();r.isRawShaderMaterial?(d=[v,"\n"].filter(Je).join("\n"),p=[g,v,"\n"].filter(Je).join("\n")):(d=["precision "+n.precision+" float;","precision "+n.precision+" int;","#define SHADER_NAME "+r.__webglShader.name,v,n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+m,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.vertexColors?"#define USE_COLOR":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+n.numClippingPlanes,n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&e.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Je).join("\n"),p=[g,"precision "+n.precision+" float;","precision "+n.precision+" int;","#define SHADER_NAME "+r.__webglShader.name,v,n.alphaTest?"#define ALPHATEST "+n.alphaTest:"","#define GAMMA_FACTOR "+m,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+h:"",n.envMap?"#define "+f:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.vertexColors?"#define USE_COLOR":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+n.numClippingPlanes,"#define UNION_CLIPPING_PLANES "+(n.numClippingPlanes-n.numClipIntersection),n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&e.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",n.envMap&&e.extensions.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",n.toneMapping!==Va?"#define TONE_MAPPING":"",n.toneMapping!==Va?_s.tonemapping_pars_fragment:"",n.toneMapping!==Va?Ze("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.outputEncoding||n.mapEncoding||n.envMapEncoding||n.emissiveMapEncoding?_s.encodings_pars_fragment:"",n.mapEncoding?Ye("mapTexelToLinear",n.mapEncoding):"",n.envMapEncoding?Ye("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMapEncoding?Ye("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.outputEncoding?Ke("linearToOutputTexel",n.outputEncoding):"",n.depthPacking?"#define DEPTH_PACKING "+r.depthPacking:"","\n"].filter(Je).join("\n")),s=Qe(s=$e(s),n),l=Qe(l=$e(l),n),r.isShaderMaterial||(s=et(s),l=et(l));var y=d+s,w=p+l,x=We(i,i.VERTEX_SHADER,y),_=We(i,i.FRAGMENT_SHADER,w);i.attachShader(b,x),i.attachShader(b,_),void 0!==r.index0AttributeName?i.bindAttribLocation(b,0,r.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(b,0,"position"),i.linkProgram(b);var S,C,E=i.getProgramInfoLog(b),A=i.getShaderInfoLog(x),T=i.getShaderInfoLog(_),k=!0,R=!0;return!1===i.getProgramParameter(b,i.LINK_STATUS)?(k=!1,console.error("THREE.WebGLProgram: shader error: ",i.getError(),"gl.VALIDATE_STATUS",i.getProgramParameter(b,i.VALIDATE_STATUS),"gl.getProgramInfoLog",E,A,T)):""!==E?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",E):""!==A&&""!==T||(R=!1),R&&(this.diagnostics={runnable:k,material:r,programLog:E,vertexShader:{log:A,prefix:d},fragmentShader:{log:T,prefix:p}}),i.deleteShader(x),i.deleteShader(_),this.getUniforms=function(){return void 0===S&&(S=new q(i,b,e)),S},this.getAttributes=function(){return void 0===C&&(C=function(e,t,r){for(var n={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),a=0;a0,maxBones:h,useVertexTexture:t.floatVertexTextures,morphTargets:n.morphTargets,morphNormals:n.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numClippingPlanes:s,numClipIntersection:l,dithering:n.dithering,shadowMapEnabled:e.shadowMap.enabled&&c.receiveShadow&&a.shadows.length>0,shadowMapType:e.shadowMap.type,toneMapping:e.toneMapping,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:n.premultipliedAlpha,alphaTest:n.alphaTest,doubleSided:n.side===aa,flipSided:n.side===ia,depthPacking:void 0!==n.depthPacking&&n.depthPacking}},this.getProgramCode=function(e,t){var r=[];if(t.shaderID?r.push(t.shaderID):(r.push(e.fragmentShader),r.push(e.vertexShader)),void 0!==e.defines)for(var n in e.defines)r.push(n),r.push(e.defines[n]);for(var i=0;it||e.height>t){var r=t/Math.max(e.width,e.height),n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return n.width=Math.floor(e.width*r),n.height=Math.floor(e.height*r),n.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,n.width,n.height),console.warn("THREE.WebGLRenderer: image is too big ("+e.width+"x"+e.height+"). Resized to "+n.width+"x"+n.height,e),n}return e}function l(e){return us.isPowerOfTwo(e.width)&&us.isPowerOfTwo(e.height)}function c(t){return t===oo||t===so||t===lo?e.NEAREST:e.LINEAR}function u(e){var t=e.target;t.removeEventListener("dispose",u),f(t),o.textures--}function h(e){var t=e.target;t.removeEventListener("dispose",h),d(t),o.textures--}function f(t){var r=n.get(t);if(t.image&&r.__image__webglTextureCube)e.deleteTexture(r.__image__webglTextureCube);else{if(void 0===r.__webglInit)return;e.deleteTexture(r.__webglTexture)}n.remove(t)}function d(t){var r=n.get(t),i=n.get(t.texture);if(t){if(void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLRenderTargetCube)for(var a=0;a<6;a++)e.deleteFramebuffer(r.__webglFramebuffer[a]),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer[a]);else e.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer);n.remove(t.texture),n.remove(t)}}function p(t,i){var a=n.get(t);if(t.version>0&&a.__version!==t.version){var o=t.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",t);else{if(!1!==o.complete)return void g(a,t,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",t)}}r.activeTexture(e.TEXTURE0+i),r.bindTexture(e.TEXTURE_2D,a.__webglTexture)}function m(r,o,s){var l;if(s?(e.texParameteri(r,e.TEXTURE_WRAP_S,a(o.wrapS)),e.texParameteri(r,e.TEXTURE_WRAP_T,a(o.wrapT)),e.texParameteri(r,e.TEXTURE_MAG_FILTER,a(o.magFilter)),e.texParameteri(r,e.TEXTURE_MIN_FILTER,a(o.minFilter))):(e.texParameteri(r,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(r,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),o.wrapS===io&&o.wrapT===io||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",o),e.texParameteri(r,e.TEXTURE_MAG_FILTER,c(o.magFilter)),e.texParameteri(r,e.TEXTURE_MIN_FILTER,c(o.minFilter)),o.minFilter!==oo&&o.minFilter!==co&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",o)),l=t.get("EXT_texture_filter_anisotropic")){if(o.type===yo&&null===t.get("OES_texture_float_linear"))return;if(o.type===wo&&null===t.get("OES_texture_half_float_linear"))return;(o.anisotropy>1||n.get(o).__currentAnisotropy)&&(e.texParameterf(r,l.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,i.getMaxAnisotropy())),n.get(o).__currentAnisotropy=o.anisotropy)}}function g(t,n,c){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",u),t.__webglTexture=e.createTexture(),o.textures++),r.activeTexture(e.TEXTURE0+c),r.bindTexture(e.TEXTURE_2D,t.__webglTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,n.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,n.unpackAlignment);var h=s(n.image,i.maxTextureSize);(function(e){return e.wrapS!==io||e.wrapT!==io||e.minFilter!==oo&&e.minFilter!==co})(n)&&!1===l(h)&&(h=function(e){if(e instanceof HTMLImageElement||e instanceof HTMLCanvasElement){var t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return t.width=us.nearestPowerOfTwo(e.width),t.height=us.nearestPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,t.width,t.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+e.width+"x"+e.height+"). Resized to "+t.width+"x"+t.height,e),t}return e}(h));var f=l(h),d=a(n.format),p=a(n.type);m(e.TEXTURE_2D,n,f);var g,v=n.mipmaps;if(n.isDepthTexture){var b=e.DEPTH_COMPONENT;if(n.type===yo){if(!w)throw new Error("Float Depth Texture only supported in WebGL2.0");b=e.DEPTH_COMPONENT32F}else w&&(b=e.DEPTH_COMPONENT16);n.format===Mo&&b===e.DEPTH_COMPONENT&&n.type!==go&&n.type!==bo&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=go,p=a(n.type)),n.format===Po&&(b=e.DEPTH_STENCIL,n.type!==Co&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=Co,p=a(n.type))),r.texImage2D(e.TEXTURE_2D,0,b,h.width,h.height,0,d,p,null)}else if(n.isDataTexture)if(v.length>0&&f){for(var y=0,x=v.length;y-1?r.compressedTexImage2D(e.TEXTURE_2D,y,d,g.width,g.height,0,g.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):r.texImage2D(e.TEXTURE_2D,y,d,g.width,g.height,0,d,p,g.data);else if(v.length>0&&f){for(y=0,x=v.length;y0&&h.__version!==t.version){h.__image__webglTextureCube||(t.addEventListener("dispose",u),h.__image__webglTextureCube=e.createTexture(),o.textures++),r.activeTexture(e.TEXTURE0+c),r.bindTexture(e.TEXTURE_CUBE_MAP,h.__image__webglTextureCube),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var f=t&&t.isCompressedTexture,d=t.image[0]&&t.image[0].isDataTexture,p=[],g=0;g<6;g++)p[g]=f||d?d?t.image[g].image:t.image[g]:s(t.image[g],i.maxCubemapSize);var v=l(p[0]),b=a(t.format),y=a(t.type);for(m(e.TEXTURE_CUBE_MAP,t,v),g=0;g<6;g++)if(f)for(var w,x=p[g].mipmaps,_=0,S=x.length;_-1?r.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+g,_,b,w.width,w.height,0,w.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+g,_,b,w.width,w.height,0,b,y,w.data);else d?r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+g,0,b,p[g].width,p[g].height,0,b,y,p[g].data):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+g,0,b,b,y,p[g]);t.generateMipmaps&&v&&e.generateMipmap(e.TEXTURE_CUBE_MAP),h.__version=t.version,t.onUpdate&&t.onUpdate(t)}else r.activeTexture(e.TEXTURE0+c),r.bindTexture(e.TEXTURE_CUBE_MAP,h.__image__webglTextureCube)},this.setTextureCubeDynamic=function(t,i){r.activeTexture(e.TEXTURE0+i),r.bindTexture(e.TEXTURE_CUBE_MAP,n.get(t).__webglTexture)},this.setupRenderTarget=function(t){var i=n.get(t),a=n.get(t.texture);t.addEventListener("dispose",h),a.__webglTexture=e.createTexture(),o.textures++;var s=!0===t.isWebGLRenderTargetCube,c=l(t);if(s){i.__webglFramebuffer=[];for(var u=0;u<6;u++)i.__webglFramebuffer[u]=e.createFramebuffer()}else i.__webglFramebuffer=e.createFramebuffer();if(s){for(r.bindTexture(e.TEXTURE_CUBE_MAP,a.__webglTexture),m(e.TEXTURE_CUBE_MAP,t.texture,c),u=0;u<6;u++)v(i.__webglFramebuffer[u],t,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+u);t.texture.generateMipmaps&&c&&e.generateMipmap(e.TEXTURE_CUBE_MAP),r.bindTexture(e.TEXTURE_CUBE_MAP,null)}else r.bindTexture(e.TEXTURE_2D,a.__webglTexture),m(e.TEXTURE_2D,t.texture,c),v(i.__webglFramebuffer,t,e.COLOR_ATTACHMENT0,e.TEXTURE_2D),t.texture.generateMipmaps&&c&&e.generateMipmap(e.TEXTURE_2D),r.bindTexture(e.TEXTURE_2D,null);t.depthBuffer&&y(t)},this.updateRenderTargetMipmap=function(t){var i=t.texture;if(i.generateMipmaps&&l(t)&&i.minFilter!==oo&&i.minFilter!==co){var a=t&&t.isWebGLRenderTargetCube?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,o=n.get(i).__webglTexture;r.bindTexture(a,o),e.generateMipmap(a),r.bindTexture(a,null)}}}function it(){var e={};return{get:function(t){var r=t.uuid,n=e[r];return void 0===n&&(n={},e[r]=n),n},remove:function(t){delete e[t.uuid]},clear:function(){e={}}}}function at(e,t,r){function n(t,r,n){var i=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=1,N=null,U={},j=new o,z=new o,H={};return H[e.TEXTURE_2D]=n(e.TEXTURE_2D,e.TEXTURE_2D,1),H[e.TEXTURE_CUBE_MAP]=n(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),{buffers:{color:f,depth:d,stencil:p},init:function(){f.setClear(0,0,0,1),d.setClear(1),p.setClear(0),i(e.DEPTH_TEST),d.setFunc(La),l(!1),c(Ki),i(e.CULL_FACE),i(e.BLEND),s(fa)},initAttributes:function(){for(var e=0,t=g.length;e0&&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 i,a=void 0!==r.precision?r.precision:"highp",o=n(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);var s=!0===r.logarithmicDepthBuffer&&!!t.get("EXT_frag_depth"),l=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),c=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_TEXTURE_SIZE),h=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),f=e.getParameter(e.MAX_VERTEX_ATTRIBS),d=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),p=e.getParameter(e.MAX_VARYING_VECTORS),m=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),g=c>0,v=!!t.get("OES_texture_float");return{getMaxAnisotropy:function(){if(void 0!==i)return i;var r=t.get("EXT_texture_filter_anisotropic");return i=null!==r?e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:n,precision:a,logarithmicDepthBuffer:s,maxTextures:l,maxVertexTextures:c,maxTextureSize:u,maxCubemapSize:h,maxAttributes:f,maxVertexUniforms:d,maxVaryings:p,maxFragmentUniforms:m,vertexTextures:g,floatFragmentTextures:v,floatVertexTextures:g&&v}}function st(e){var t={};return{get:function(r){if(void 0!==t[r])return t[r];var n;switch(r){case"WEBGL_depth_texture":n=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=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":n=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":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":n=e.getExtension("WEBGL_compressed_texture_etc1");break;default:n=e.getExtension(r)}return null===n&&console.warn("THREE.WebGLRenderer: "+r+" extension not supported."),t[r]=n,n}}}function lt(){function e(){c.value!==n&&(c.value=n,c.needsUpdate=i>0),r.numPlanes=i,r.numIntersection=0}function t(e,t,n,i){var a=null!==e?e.length:0,o=null;if(0!==a){if(o=c.value,!0!==i||null===o){var u=n+4*a,h=t.matrixWorldInverse;l.getNormalMatrix(h),(null===o||o.length=0&&e.numSupportedMorphTargets++}if(e.morphNormals)for(e.numSupportedMorphNormals=0,f=0;f=0&&e.numSupportedMorphNormals++;var d=n.__webglShader.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(n.numClippingPlanes=ce.numPlanes,n.numIntersection=ce.numIntersection,d.clippingPlanes=ce.uniform),n.fog=t,n.lightsHash=ve.hash,e.lights&&(d.ambientLightColor.value=ve.ambient,d.directionalLights.value=ve.directional,d.spotLights.value=ve.spot,d.rectAreaLights.value=ve.rectArea,d.pointLights.value=ve.point,d.hemisphereLights.value=ve.hemi,d.directionalShadowMap.value=ve.directionalShadowMap,d.directionalShadowMatrix.value=ve.directionalShadowMatrix,d.spotShadowMap.value=ve.spotShadowMap,d.spotShadowMatrix.value=ve.spotShadowMatrix,d.pointShadowMap.value=ve.pointShadowMap,d.pointShadowMatrix.value=ve.pointShadowMatrix);var p=n.program.getUniforms(),m=q.seqWithValue(p.seq,d);n.uniformsList=m}function g(e,t,r,n){Z=0;var i=Ce.get(r);if(ue&&(he||e!==H)){var a=e===H&&r.id===j;ce.setState(r.clippingPlanes,r.clipIntersection,r.clipShadows,e,i,a)}!1===r.needsUpdate&&(void 0===i.program||r.fog&&i.fog!==t||r.lights&&i.lightsHash!==ve.hash?r.needsUpdate=!0:void 0===i.numClippingPlanes||i.numClippingPlanes===ce.numPlanes&&i.numIntersection===ce.numIntersection||(r.needsUpdate=!0)),r.needsUpdate&&(m(r,t,n),r.needsUpdate=!1);var o=!1,s=!1,l=!1,c=i.program,u=c.getUniforms(),h=i.__webglShader.uniforms;if(c.id!==F&&(D.useProgram(c.program),F=c.id,o=!0,s=!0,l=!0),r.id!==j&&(j=r.id,s=!0),o||e!==H){if(u.setValue(D,"projectionMatrix",e.projectionMatrix),_e.logarithmicDepthBuffer&&u.setValue(D,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),e!==H&&(H=e,s=!0,l=!0),r.isShaderMaterial||r.isMeshPhongMaterial||r.isMeshStandardMaterial||r.envMap){var d=u.map.cameraPosition;void 0!==d&&d.setValue(D,pe.setFromMatrixPosition(e.matrixWorld))}(r.isMeshPhongMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial||r.skinning)&&u.setValue(D,"viewMatrix",e.matrixWorldInverse),u.setValue(D,"toneMappingExposure",L.toneMappingExposure),u.setValue(D,"toneMappingWhitePoint",L.toneMappingWhitePoint)}if(r.skinning){u.setOptional(D,n,"bindMatrix"),u.setOptional(D,n,"bindMatrixInverse");var p=n.skeleton;if(p){var g=p.bones;if(_e.floatVertexTextures){if(void 0===p.boneTexture){var w=Math.sqrt(4*g.length);w=us.nextPowerOfTwo(Math.ceil(w)),w=Math.max(w,4);var x=new Float32Array(w*w*4);x.set(p.boneMatrices);var _=new f(x,w,w,To,yo);p.boneMatrices=x,p.boneTexture=_,p.boneTextureSize=w}u.setValue(D,"boneTexture",p.boneTexture),u.setValue(D,"boneTextureSize",p.boneTextureSize)}else u.setOptional(D,p,"boneMatrices")}}return s&&(r.lights&&function(e,t){e.ambientLightColor.needsUpdate=t,e.directionalLights.needsUpdate=t,e.pointLights.needsUpdate=t,e.spotLights.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}(h,l),t&&r.fog&&function(e,t){e.fogColor.value=t.color,t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)}(h,t),(r.isMeshBasicMaterial||r.isMeshLambertMaterial||r.isMeshPhongMaterial||r.isMeshStandardMaterial||r.isMeshNormalMaterial||r.isMeshDepthMaterial)&&function(e,t){var r;if(e.opacity.value=t.opacity,e.diffuse.value=t.color,t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),e.map.value=t.map,e.specularMap.value=t.specularMap,e.alphaMap.value=t.alphaMap,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?r=t.map:t.specularMap?r=t.specularMap:t.displacementMap?r=t.displacementMap:t.normalMap?r=t.normalMap:t.bumpMap?r=t.bumpMap:t.roughnessMap?r=t.roughnessMap:t.metalnessMap?r=t.metalnessMap:t.alphaMap?r=t.alphaMap:t.emissiveMap&&(r=t.emissiveMap),void 0!==r){r.isWebGLRenderTarget&&(r=r.texture);var n=r.offset,i=r.repeat;e.offsetRepeat.value.set(n.x,n.y,i.x,i.y)}e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap&&t.envMap.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio}(h,r),r.isLineBasicMaterial?v(h,r):r.isLineDashedMaterial?(v(h,r),function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(h,r)):r.isPointsMaterial?function(e,t){if(e.diffuse.value=t.color,e.opacity.value=t.opacity,e.size.value=t.size*re,e.scale.value=.5*te,e.map.value=t.map,null!==t.map){var r=t.map.offset,n=t.map.repeat;e.offsetRepeat.value.set(r.x,r.y,n.x,n.y)}}(h,r):r.isMeshLambertMaterial?function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(h,r):r.isMeshToonMaterial?function(e,t){b(e,t),t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(h,r):r.isMeshPhongMaterial?b(h,r):r.isMeshPhysicalMaterial?function(e,t){e.clearCoat.value=t.clearCoat,e.clearCoatRoughness.value=t.clearCoatRoughness,y(e,t)}(h,r):r.isMeshStandardMaterial?y(h,r):r.isMeshDepthMaterial?r.displacementMap&&(h.displacementMap.value=r.displacementMap,h.displacementScale.value=r.displacementScale,h.displacementBias.value=r.displacementBias):r.isMeshNormalMaterial&&function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(h,r),void 0!==h.ltcMat&&(h.ltcMat.value=ws.LTC_MAT_TEXTURE),void 0!==h.ltcMag&&(h.ltcMag.value=ws.LTC_MAG_TEXTURE),q.upload(D,i.uniformsList,h,L)),u.setValue(D,"modelViewMatrix",n.modelViewMatrix),u.setValue(D,"normalMatrix",n.normalMatrix),u.setValue(D,"modelMatrix",n.matrixWorld),c}function v(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity}function b(e,t){e.specular.value=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),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function y(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),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale)),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}function w(e,t){var r,n,i,a,o,s,l,c,u=0,h=0,f=0,d=t.matrixWorldInverse,p=0,m=0,g=0,v=0,b=0;for(r=0,n=e.length;r8&&(f.length=8);var v=n.morphAttributes;for(d=0,p=f.length;d=0){var c=i[s];if(void 0!==c){var u=c.normalized,h=c.itemSize,f=Ae.get(c),d=f.buffer,p=f.type,m=f.bytesPerElement;if(c.isInterleavedBufferAttribute){var g=c.data,v=g.stride,b=c.offset;g&&g.isInstancedInterleavedBuffer?(Se.enableAttributeAndDivisor(l,g.meshPerAttribute),void 0===r.maxInstancedCount&&(r.maxInstancedCount=g.meshPerAttribute*g.count)):Se.enableAttribute(l),D.bindBuffer(D.ARRAY_BUFFER,d),D.vertexAttribPointer(l,h,p,u,v*m,(n*v+b)*m)}else c.isInstancedBufferAttribute?(Se.enableAttributeAndDivisor(l,c.meshPerAttribute),void 0===r.maxInstancedCount&&(r.maxInstancedCount=c.meshPerAttribute*c.count)):Se.enableAttribute(l),D.bindBuffer(D.ARRAY_BUFFER,d),D.vertexAttribPointer(l,h,p,u,0,n*h*m)}else if(void 0!==o){var y=o[s];if(void 0!==y)switch(y.length){case 2:D.vertexAttrib2fv(l,y);break;case 3:D.vertexAttrib3fv(l,y);break;case 4:D.vertexAttrib4fv(l,y);break;default:D.vertexAttrib1fv(l,y)}}}}Se.disableUnusedAttributes()}}(i,s,n),null!==b&&D.bindBuffer(D.ELEMENT_ARRAY_BUFFER,Ae.get(b).buffer));var S=0;null!==b?S=b.count:void 0!==w&&(S=w.count);var C=n.drawRange.start*x,E=n.drawRange.count*x,A=null!==o?o.start*x:0,T=null!==o?o.count*x:1/0,k=Math.max(C,A),R=Math.min(S,C+E,A+T)-1,I=Math.max(0,R-k+1);if(0!==I){if(a.isMesh)if(!0===i.wireframe)Se.setLineWidth(i.wireframeLinewidth*t()),_.setMode(D.LINES);else switch(a.drawMode){case Jo:_.setMode(D.TRIANGLES);break;case Qo:_.setMode(D.TRIANGLE_STRIP);break;case $o:_.setMode(D.TRIANGLE_FAN)}else if(a.isLine){var M=i.linewidth;void 0===M&&(M=1),Se.setLineWidth(M*t()),a.isLineSegments?_.setMode(D.LINES):a.isLineLoop?_.setMode(D.LINE_LOOP):_.setMode(D.LINE_STRIP)}else a.isPoints&&_.setMode(D.POINTS);n&&n.isInstancedBufferGeometry?n.maxInstancedCount>0&&_.renderInstances(n,k,I):_.render(k,I)}},this.compile=function(e,t){I=[],e.traverse((function(e){e.isLight&&I.push(e)})),w(I,t),e.traverse((function(t){if(t.material)if(Array.isArray(t.material))for(var r=0;r=_e.maxTextures&&console.warn("WebGLRenderer: trying to use "+e+" texture units while this GPU supports only "+_e.maxTextures),Z+=1,e},this.setTexture2D=function(){var e=!1;return function(t,r){t&&t.isWebGLRenderTarget&&(e||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),e=!0),t=t.texture),Ee.setTexture2D(t,r)}}(),this.setTexture=function(){var e=!1;return function(t,r){e||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),e=!0),Ee.setTexture2D(t,r)}}(),this.setTextureCube=function(){var e=!1;return function(t,r){t&&t.isWebGLRenderTargetCube&&(e||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),e=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?Ee.setTextureCube(t,r):Ee.setTextureCubeDynamic(t,r)}}(),this.getRenderTarget=function(){return N},this.setRenderTarget=function(e){N=e,e&&void 0===Ce.get(e).__webglFramebuffer&&Ee.setupRenderTarget(e);var t,r=e&&e.isWebGLRenderTargetCube;if(e){var n=Ce.get(e);t=r?n.__webglFramebuffer[e.activeCubeFace]:n.__webglFramebuffer,G.copy(e.scissor),V=e.scissorTest,X.copy(e.viewport)}else t=null,G.copy(ae).multiplyScalar(re),V=oe,X.copy(se).multiplyScalar(re);if(U!==t&&(D.bindFramebuffer(D.FRAMEBUFFER,t),U=t),Se.scissor(G),Se.setScissorTest(V),Se.viewport(X),r){var i=Ce.get(e.texture);D.framebufferTexture2D(D.FRAMEBUFFER,D.COLOR_ATTACHMENT0,D.TEXTURE_CUBE_MAP_POSITIVE_X+e.activeCubeFace,i.__webglTexture,e.activeMipMapLevel)}},this.readRenderTargetPixels=function(e,t,r,n,i,a){if(!1!==(e&&e.isWebGLRenderTarget)){var o=Ce.get(e).__webglFramebuffer;if(o){var s=!1;o!==U&&(D.bindFramebuffer(D.FRAMEBUFFER,o),s=!0);try{var l=e.texture,c=l.format,u=l.type;if(c!==To&&x(c)!==D.getParameter(D.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(u===fo||x(u)===D.getParameter(D.IMPLEMENTATION_COLOR_READ_TYPE)||u===yo&&(xe.get("OES_texture_float")||xe.get("WEBGL_color_buffer_float"))||u===wo&&xe.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");D.checkFramebufferStatus(D.FRAMEBUFFER)===D.FRAMEBUFFER_COMPLETE?t>=0&&t<=e.width-n&&r>=0&&r<=e.height-i&&D.readPixels(t,r,n,i,x(c),x(u),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&D.bindFramebuffer(D.FRAMEBUFFER,U)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")}}function ut(e,t){this.name="",this.color=new W(e),this.density=void 0!==t?t:25e-5}function ht(e,t,r){this.name="",this.color=new W(e),this.near=void 0!==t?t:1,this.far=void 0!==r?r:1e3}function ft(){le.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function dt(e,t,r,n,i){le.call(this),this.lensFlares=[],this.positionScreen=new u,this.customUpdateCallback=void 0,void 0!==e&&this.add(e,t,r,n,i)}function pt(e){Z.call(this),this.type="SpriteMaterial",this.color=new W(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(e)}function mt(e){le.call(this),this.type="Sprite",this.material=void 0!==e?e:new pt}function gt(){le.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function vt(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var r=0,n=this.bones.length;r=e.HAVE_CURRENT_DATA&&(u.needsUpdate=!0)}()}function kt(e,t,r,n,i,o,s,l,c,u,h,f){a.call(this,null,o,s,l,c,u,n,i,h,f),this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function Rt(e,t,r,n,i,o,s,l,c){a.call(this,e,t,r,n,i,o,s,l,c),this.needsUpdate=!0}function It(e,t,r,n,i,o,s,l,c,u){if((u=void 0!==u?u:Mo)!==Mo&&u!==Po)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===r&&u===Mo&&(r=go),void 0===r&&u===Po&&(r=Co),a.call(this,null,n,i,o,s,l,u,r,c),this.image={width:e,height:t},this.magFilter=void 0!==s?s:oo,this.minFilter=void 0!==l?l:oo,this.flipY=!1,this.generateMipmaps=!1}function Mt(e){Te.call(this),this.type="WireframeGeometry";var t,r,n,i,a,o,s,l,c,h,f=[],d=[0,0],p={},m=["a","b","c"];if(e&&e.isGeometry){var g=e.faces;for(t=0,n=g.length;t=0?(f=e(v-1e-5,g,f),d.subVectors(h,f)):(f=e(v+1e-5,g,f),d.subVectors(f,h)),g-1e-5>=0?(f=e(v,g-1e-5,f),p.subVectors(h,f)):(f=e(v,g+1e-5,f),p.subVectors(f,h)),c.crossVectors(d,p).normalize(),s.push(c.x,c.y,c.z),l.push(v,g)}}for(n=0;n.9&&a<.1&&(t<.2&&(d[e+0]+=1),r<.2&&(d[e+2]+=1),n<.2&&(d[e+4]+=1))}}()}(),this.addAttribute("position",new xe(f,3)),this.addAttribute("normal",new xe(f.slice(),3)),this.addAttribute("uv",new xe(d,2)),this.normalizeNormals()}function Lt(e,t){Ae.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Ft(e,t)),this.mergeVertices()}function Ft(e,t){Dt.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 Nt(e,t){Ae.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Ut(e,t)),this.mergeVertices()}function Ut(e,t){Dt.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 jt(e,t){Ae.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new zt(e,t)),this.mergeVertices()}function zt(e,t){var r=(1+Math.sqrt(5))/2,n=[-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1];Dt.call(this,n,[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 Ht(e,t){Ae.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Gt(e,t)),this.mergeVertices()}function Gt(e,t){var r=(1+Math.sqrt(5))/2,n=1/r,i=[-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,-n,-r,0,-n,r,0,n,-r,0,n,r,-n,-r,0,-n,r,0,n,-r,0,n,r,0,-r,0,-n,r,0,-n,-r,0,n,r,0,n];Dt.call(this,i,[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 Vt(e,t,r,n,i,a){Ae.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:r,radialSegments:n,closed:i},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed.");var o=new qt(e,t,r,n,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals,this.fromBufferGeometry(o),this.mergeVertices()}function qt(e,t,r,n,a){function o(i){var a=e.getPointAt(i/t),o=s.normals[i],l=s.binormals[i];for(c=0;c<=n;c++){var u=c/n*Math.PI*2,d=Math.sin(u),g=-Math.cos(u);f.x=g*o.x+d*l.x,f.y=g*o.y+d*l.y,f.z=g*o.z+d*l.z,f.normalize(),m.push(f.x,f.y,f.z),h.x=a.x+r*f.x,h.y=a.y+r*f.y,h.z=a.z+r*f.z,p.push(h.x,h.y,h.z)}}Te.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:r,radialSegments:n,closed:a},t=t||64,r=r||1,n=n||8,a=a||!1;var s=e.computeFrenetFrames(t,a);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;var l,c,h=new u,f=new u,d=new i,p=[],m=[],g=[],v=[];!function(){for(l=0;l0)&&m.push(_,S,E),(l!==r-1||c0&&c(!0),t>0&&c(!1)),this.setIndex(f),this.addAttribute("position",new xe(d,3)),this.addAttribute("normal",new xe(p,3)),this.addAttribute("uv",new xe(m,2))}function hr(e,t,r,n,i,a,o){cr.call(this,0,e,t,r,n,i,a,o),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:r,heightSegments:n,openEnded:i,thetaStart:a,thetaLength:o}}function fr(e,t,r,n,i,a,o){ur.call(this,0,e,t,r,n,i,a,o),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:r,heightSegments:n,openEnded:i,thetaStart:a,thetaLength:o}}function dr(e,t,r,n){Ae.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:r,thetaLength:n},this.fromBufferGeometry(new pr(e,t,r,n)),this.mergeVertices()}function pr(e,t,r,n){Te.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:r,thetaLength:n},e=e||50,t=void 0!==t?Math.max(3,t):8,r=void 0!==r?r:0,n=void 0!==n?n:2*Math.PI;var a,o,s=[],l=[],c=[],h=[],f=new u,d=new i;for(l.push(0,0,0),c.push(0,0,1),h.push(.5,.5),o=0,a=3;o<=t;o++,a+=3){var p=r+o/t*n;f.x=e*Math.cos(p),f.y=e*Math.sin(p),l.push(f.x,f.y,f.z),c.push(0,0,1),d.x=(l[a]/e+1)/2,d.y=(l[a+1]/e+1)/2,h.push(d.x,d.y)}for(a=1;a<=t;a++)s.push(a,a+1,0);this.setIndex(s),this.addAttribute("position",new xe(l,3)),this.addAttribute("normal",new xe(c,3)),this.addAttribute("uv",new xe(h,2))}function mr(e){J.call(this,{uniforms:xs.merge([ws.lights,{opacity:{value:1}}]),vertexShader:_s.shadow_vert,fragmentShader:_s.shadow_frag}),this.lights=!0,this.transparent=!0,Object.defineProperties(this,{opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}}}),this.setValues(e)}function gr(e){J.call(this,e),this.type="RawShaderMaterial"}function vr(e){Z.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new W(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 W(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new i(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 br(e){vr.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(e)}function yr(e){Z.call(this),this.type="MeshPhongMaterial",this.color=new W(16777215),this.specular=new W(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new W(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=za,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 wr(e){yr.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(e)}function xr(e){Z.call(this,e),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new i(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)}function _r(e){Z.call(this),this.type="MeshLambertMaterial",this.color=new W(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new W(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=za,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 Sr(e){Z.call(this),this.type="LineDashedMaterial",this.color=new W(16777215),this.linewidth=1,this.scale=1,this.dashSize=3,this.gapSize=1,this.lights=!1,this.setValues(e)}function Cr(e,t,r){var n=this,i=!1,a=0,o=0;this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=r,this.itemStart=function(e){o++,!1===i&&void 0!==n.onStart&&n.onStart(e,a,o),i=!0},this.itemEnd=function(e){a++,void 0!==n.onProgress&&n.onProgress(e,a,o),a===o&&(i=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(e){void 0!==n.onError&&n.onError(e)}}function Er(e){this.manager=void 0!==e?e:Ps}function Ar(e){this.manager=void 0!==e?e:Ps,this._parser=null}function Tr(e){this.manager=void 0!==e?e:Ps,this._parser=null}function kr(e){this.manager=void 0!==e?e:Ps}function Rr(e){this.manager=void 0!==e?e:Ps}function Ir(e){this.manager=void 0!==e?e:Ps}function Mr(e,t){le.call(this),this.type="Light",this.color=new W(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function Pr(e,t,r){Mr.call(this,e,r),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(le.DefaultUp),this.updateMatrix(),this.groundColor=new W(t)}function Or(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new i(512,512),this.map=null,this.matrix=new h}function Br(){Or.call(this,new Be(50,1,.5,500))}function Dr(e,t,r,n,i,a){Mr.call(this,e,t),this.type="SpotLight",this.position.copy(le.DefaultUp),this.updateMatrix(),this.target=new le,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==r?r:0,this.angle=void 0!==n?n:Math.PI/3,this.penumbra=void 0!==i?i:0,this.decay=void 0!==a?a:1,this.shadow=new Br}function Lr(e,t,r,n){Mr.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!==r?r:0,this.decay=void 0!==n?n:1,this.shadow=new Or(new Be(90,1,.5,500))}function Fr(){Or.call(this,new De(-5,5,5,-5,.5,500))}function Nr(e,t){Mr.call(this,e,t),this.type="DirectionalLight",this.position.copy(le.DefaultUp),this.updateMatrix(),this.target=new le,this.shadow=new Fr}function Ur(e,t){Mr.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function jr(e,t,r,n){Mr.call(this,e,t),this.type="RectAreaLight",this.position.set(0,1,0),this.updateMatrix(),this.width=void 0!==r?r:10,this.height=void 0!==n?n:10}function zr(e,t,r,n){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new t.constructor(r),this.sampleValues=t,this.valueSize=r}function Hr(e,t,r,n){zr.call(this,e,t,r,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Gr(e,t,r,n){zr.call(this,e,t,r,n)}function Vr(e,t,r,n){zr.call(this,e,t,r,n)}function qr(e,t,r,n){if(void 0===e)throw new Error("track name is undefined");if(void 0===t||0===t.length)throw new Error("no keyframes in track named "+e);this.name=e,this.times=Bs.convertArray(t,this.TimeBufferType),this.values=Bs.convertArray(r,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation),this.validate(),this.optimize()}function Wr(e,t,r,n){qr.call(this,e,t,r,n)}function Xr(e,t,r,n){zr.call(this,e,t,r,n)}function Yr(e,t,r,n){qr.call(this,e,t,r,n)}function Kr(e,t,r,n){qr.call(this,e,t,r,n)}function Zr(e,t,r,n){qr.call(this,e,t,r,n)}function Jr(e,t,r){qr.call(this,e,t,r)}function Qr(e,t,r,n){qr.call(this,e,t,r,n)}function $r(e,t,r,n){qr.apply(this,arguments)}function en(e,t,r){this.name=e,this.tracks=r,this.duration=void 0!==t?t:-1,this.uuid=us.generateUUID(),this.duration<0&&this.resetDuration(),this.optimize()}function tn(e){this.manager=void 0!==e?e:Ps,this.textures={}}function rn(e){this.manager=void 0!==e?e:Ps}function nn(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}}function an(e){"boolean"==typeof e&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),e=void 0),this.manager=void 0!==e?e:Ps,this.withCredentials=!1}function on(e){this.manager=void 0!==e?e:Ps,this.texturePath=""}function sn(e,t,r,n,i){var a=.5*(n-t),o=.5*(i-r),s=e*e;return(2*r-2*n+a+o)*(e*s)+(-3*r+3*n-2*a-o)*s+a*e+r}function ln(e,t,r,n){return function(e,t){var r=1-e;return r*r*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,r)+function(e,t){return e*e*t}(e,n)}function cn(e,t,r,n,i){return function(e,t){var r=1-e;return r*r*r*t}(e,t)+function(e,t){var r=1-e;return 3*r*r*e*t}(e,r)+function(e,t){return 3*(1-e)*e*e*t}(e,n)+function(e,t){return e*e*e*t}(e,i)}function un(){this.arcLengthDivisions=200}function hn(e,t){un.call(this),this.v1=e,this.v2=t}function fn(){un.call(this),this.curves=[],this.autoClose=!1}function dn(e,t,r,n,i,a,o,s){un.call(this),this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=n,this.aStartAngle=i,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s||0}function pn(e){un.call(this),this.points=void 0===e?[]:e}function mn(e,t,r,n){un.call(this),this.v0=e,this.v1=t,this.v2=r,this.v3=n}function gn(e,t,r){un.call(this),this.v0=e,this.v1=t,this.v2=r}function vn(e){fn.call(this),this.currentPoint=new i,e&&this.fromPoints(e)}function bn(){vn.apply(this,arguments),this.holes=[]}function yn(){this.subPaths=[],this.currentPath=null}function wn(e){this.data=e}function xn(e){this.manager=void 0!==e?e:Ps}function _n(e){this.manager=void 0!==e?e:Ps}function Sn(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Be,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Be,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function Cn(e,t,r){le.call(this),this.type="CubeCamera";var n=new Be(90,1,e,t);n.up.set(0,-1,0),n.lookAt(new u(1,0,0)),this.add(n);var i=new Be(90,1,e,t);i.up.set(0,-1,0),i.lookAt(new u(-1,0,0)),this.add(i);var a=new Be(90,1,e,t);a.up.set(0,0,1),a.lookAt(new u(0,1,0)),this.add(a);var o=new Be(90,1,e,t);o.up.set(0,0,-1),o.lookAt(new u(0,-1,0)),this.add(o);var s=new Be(90,1,e,t);s.up.set(0,-1,0),s.lookAt(new u(0,0,1)),this.add(s);var c=new Be(90,1,e,t);c.up.set(0,-1,0),c.lookAt(new u(0,0,-1)),this.add(c);var h={format:Ao,magFilter:co,minFilter:co};this.renderTarget=new l(r,r,h),this.renderTarget.texture.name="CubeCamera",this.updateCubeMap=function(e,t){null===this.parent&&this.updateMatrixWorld();var r=this.renderTarget,l=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,r.activeCubeFace=0,e.render(t,n,r),r.activeCubeFace=1,e.render(t,i,r),r.activeCubeFace=2,e.render(t,a,r),r.activeCubeFace=3,e.render(t,o,r),r.activeCubeFace=4,e.render(t,s,r),r.texture.generateMipmaps=l,r.activeCubeFace=5,e.render(t,c,r),e.setRenderTarget(null)}}function En(e){Be.call(this),this.enabled=!1,this.cameras=e||[]}function An(){le.call(this),this.type="AudioListener",this.context=Gs.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function Tn(e){le.call(this),this.type="Audio",this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.loop=!1,this.startTime=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function kn(e){Tn.call(this,e),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function Rn(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 In(e,t,r){this.binding=e,this.valueSize=r;var n,i=Float64Array;switch(t){case"quaternion":n=this._slerp;break;case"string":case"bool":i=Array,n=this._select;break;default:n=this._lerp}this.buffer=new i(4*r),this._mixBufferRegion=n,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function Mn(e,t,r){var n=r||Pn.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,n)}function Pn(e,t,r){this.path=t,this.parsedPath=r||Pn.parseTrackName(t),this.node=Pn.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function On(e){this.uuid=us.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var r=0,n=arguments.length;r!==n;++r)t[arguments[r].uuid]=r;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 Bn(e,t,r){this._mixer=e,this._clip=t,this._localRoot=r||null;for(var n=t.tracks,i=n.length,a=new Array(i),o={endingStart:Yo,endingEnd:Yo},s=0;s!==i;++s){var l=n[s].createInterpolant(null);a[s]=l,l.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Go,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 Dn(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Ln(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}function Fn(){Te.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Nn(e,t,r,n){this.uuid=us.generateUUID(),this.data=e,this.itemSize=t,this.offset=r,this.normalized=!0===n}function Un(e,t){this.uuid=us.generateUUID(),this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function jn(e,t,r){Un.call(this,e,t),this.meshPerAttribute=r||1}function zn(e,t,r){de.call(this,e,t),this.meshPerAttribute=r||1}function Hn(e,t,r,n){this.ray=new ae(e,t),this.near=r||0,this.far=n||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function Gn(e,t){return e.distance-t.distance}function Vn(e,t,r,n){if(!1!==e.visible&&(e.raycast(t,r),!0===n))for(var i=e.children,a=0,o=i.length;a0?1:+e}),void 0===Function.prototype.name&&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),r=1;r>=4,r[i]=t[19===i?3&e|8:e]);return r.join("")}}(),clamp:function(e,t,r){return Math.max(t,Math.min(r,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,r,n,i){return n+(e-t)*(i-n)/(r-t)},lerp:function(e,t,r){return(1-r)*e+r*t},smoothstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*(3-2*e)},smootherstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-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*us.DEG2RAD},radToDeg:function(e){return e*us.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},nearestPowerOfTwo:function(e){return Math.pow(2,Math.round(Math.log(e)/Math.LN2))},nextPowerOfTwo:function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e}};Object.defineProperties(i.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(i.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?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),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?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),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)},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(){var e=new i,t=new i;return function(r,n){return e.set(r,r),t.set(n,n),this.clamp(e,t)}}(),clampLength:function(e,t){var r=this.length();return this.multiplyScalar(Math.max(e,Math.min(t,r))/r)},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},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length())},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,r=this.y-e.y;return t*t+r*r},distanceToManhattan:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.multiplyScalar(e/this.length())},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,r){return this.subVectors(t,e).multiplyScalar(r).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,r){return void 0!==r&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var r=Math.cos(t),n=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*r-a*n+e.x,this.y=i*n+a*r+e.y,this}});var hs=0;a.DEFAULT_IMAGE=void 0,a.DEFAULT_MAPPING=Ka,Object.defineProperty(a.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(a.prototype,n.prototype,{constructor:a,isTexture:!0,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.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){if(void 0!==e.textures[this.uuid])return e.textures[this.uuid];var t={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],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var r=this.image;void 0===r.uuid&&(r.uuid=us.generateUUID()),void 0===e.images[r.uuid]&&(e.images[r.uuid]={uuid:r.uuid,url:function(e){var t;return void 0!==e.toDataURL?t=e:((t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")).width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0,e.width,e.height)),t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}(r)}),t.image=r.uuid}return e.textures[this.uuid]=t,t},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(this.mapping===Ka){if(e.multiply(this.repeat),e.add(this.offset),e.x<0||e.x>1)switch(this.wrapS){case no:e.x=e.x-Math.floor(e.x);break;case io:e.x=e.x<0?0:1;break;case ao: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 no:e.y=e.y-Math.floor(e.y);break;case io:e.y=e.y<0?0:1;break;case ao:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}this.flipY&&(e.y=1-e.y)}}}),Object.assign(o.prototype,{isVector4:!0,set:function(e,t,r,n){return this.x=e,this.y=t,this.z=r,this.w=n,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?(console.warn("THREE.Vector4: .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.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?(console.warn("THREE.Vector4: .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.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},applyMatrix4:function(e){var t=this.x,r=this.y,n=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*r+a[8]*n+a[12]*i,this.y=a[1]*t+a[5]*r+a[9]*n+a[13]*i,this.z=a[2]*t+a[6]*r+a[10]*n+a[14]*i,this.w=a[3]*t+a[7]*r+a[11]*n+a[15]*i,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,r,n,i,a=e.elements,o=a[0],s=a[4],l=a[8],c=a[1],u=a[5],h=a[9],f=a[2],d=a[6],p=a[10];if(Math.abs(s-c)<.01&&Math.abs(l-f)<.01&&Math.abs(h-d)<.01){if(Math.abs(s+c)<.1&&Math.abs(l+f)<.1&&Math.abs(h+d)<.1&&Math.abs(o+u+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var m=(o+1)/2,g=(u+1)/2,v=(p+1)/2,b=(s+c)/4,y=(l+f)/4,w=(h+d)/4;return m>g&&m>v?m<.01?(r=0,n=.707106781,i=.707106781):(n=b/(r=Math.sqrt(m)),i=y/r):g>v?g<.01?(r=.707106781,n=0,i=.707106781):(r=b/(n=Math.sqrt(g)),i=w/n):v<.01?(r=.707106781,n=.707106781,i=0):(r=y/(i=Math.sqrt(v)),n=w/i),this.set(r,n,i,t),this}var x=Math.sqrt((d-h)*(d-h)+(l-f)*(l-f)+(c-s)*(c-s));return Math.abs(x)<.001&&(x=1),this.x=(d-h)/x,this.y=(l-f)/x,this.z=(c-s)/x,this.w=Math.acos((o+u+p-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(){var e=new o,t=new o;return function(r,n){return e.set(r,r,r,r),t.set(n,n,n,n),this.clamp(e,t)}}(),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)},lengthManhattan: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())},setLength:function(e){return this.multiplyScalar(e/this.length())},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,r){return this.subVectors(t,e).multiplyScalar(r).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,r){return void 0!==r&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),Object.assign(s.prototype,n.prototype,{isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.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"})}}),l.prototype=Object.create(s.prototype),l.prototype.constructor=l,l.prototype.isWebGLRenderTargetCube=!0,Object.assign(c,{slerp:function(e,t,r,n){return r.copy(e).slerp(t,n)},slerpFlat:function(e,t,r,n,i,a,o){var s=r[n+0],l=r[n+1],c=r[n+2],u=r[n+3],h=i[a+0],f=i[a+1],d=i[a+2],p=i[a+3];if(u!==p||s!==h||l!==f||c!==d){var m=1-o,g=s*h+l*f+c*d+u*p,v=g>=0?1:-1,b=1-g*g;if(b>Number.EPSILON){var y=Math.sqrt(b),w=Math.atan2(y,g*v);m=Math.sin(m*w)/y,o=Math.sin(o*w)/y}var x=o*v;if(s=s*m+h*x,l=l*m+f*x,c=c*m+d*x,u=u*m+p*x,m===1-o){var _=1/Math.sqrt(s*s+l*l+c*c+u*u);s*=_,l*=_,c*=_,u*=_}}e[t]=s,e[t+1]=l,e[t+2]=c,e[t+3]=u}}),Object.defineProperties(c.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(c.prototype,{set:function(e,t,r,n){return this._x=e,this._y=t,this._z=r,this._w=n,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(!1===(e&&e.isEuler))throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var r=e._x,n=e._y,i=e._z,a=e.order,o=Math.cos,s=Math.sin,l=o(r/2),c=o(n/2),u=o(i/2),h=s(r/2),f=s(n/2),d=s(i/2);return"XYZ"===a?(this._x=h*c*u+l*f*d,this._y=l*f*u-h*c*d,this._z=l*c*d+h*f*u,this._w=l*c*u-h*f*d):"YXZ"===a?(this._x=h*c*u+l*f*d,this._y=l*f*u-h*c*d,this._z=l*c*d-h*f*u,this._w=l*c*u+h*f*d):"ZXY"===a?(this._x=h*c*u-l*f*d,this._y=l*f*u+h*c*d,this._z=l*c*d+h*f*u,this._w=l*c*u-h*f*d):"ZYX"===a?(this._x=h*c*u-l*f*d,this._y=l*f*u+h*c*d,this._z=l*c*d-h*f*u,this._w=l*c*u+h*f*d):"YZX"===a?(this._x=h*c*u+l*f*d,this._y=l*f*u+h*c*d,this._z=l*c*d-h*f*u,this._w=l*c*u-h*f*d):"XZY"===a&&(this._x=h*c*u-l*f*d,this._y=l*f*u-h*c*d,this._z=l*c*d+h*f*u,this._w=l*c*u+h*f*d),!1!==t&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var r=t/2,n=Math.sin(r);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(r),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t,r=e.elements,n=r[0],i=r[4],a=r[8],o=r[1],s=r[5],l=r[9],c=r[2],u=r[6],h=r[10],f=n+s+h;return f>0?(t=.5/Math.sqrt(f+1),this._w=.25/t,this._x=(u-l)*t,this._y=(a-c)*t,this._z=(o-i)*t):n>s&&n>h?(t=2*Math.sqrt(1+n-s-h),this._w=(u-l)/t,this._x=.25*t,this._y=(i+o)/t,this._z=(a+c)/t):s>h?(t=2*Math.sqrt(1+s-n-h),this._w=(a-c)/t,this._x=(i+o)/t,this._y=.25*t,this._z=(l+u)/t):(t=2*Math.sqrt(1+h-n-s),this._w=(o-i)/t,this._x=(a+c)/t,this._y=(l+u)/t,this._z=.25*t),this.onChangeCallback(),this},setFromUnitVectors:function(){var e,t=new u;return function(r,n){return void 0===t&&(t=new u),(e=r.dot(n)+1)<1e-6?(e=0,Math.abs(r.x)>Math.abs(r.z)?t.set(-r.y,r.x,0):t.set(0,-r.z,r.y)):t.crossVectors(r,n),this._x=t.x,this._y=t.y,this._z=t.z,this._w=e,this.normalize()}}(),inverse:function(){return this.conjugate().normalize()},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 r=e._x,n=e._y,i=e._z,a=e._w,o=t._x,s=t._y,l=t._z,c=t._w;return this._x=r*c+a*o+n*l-i*s,this._y=n*c+a*s+i*o-r*l,this._z=i*c+a*l+r*s-n*o,this._w=a*c-r*o-n*s-i*l,this.onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var r=this._x,n=this._y,i=this._z,a=this._w,o=a*e._w+r*e._x+n*e._y+i*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=r,this._y=n,this._z=i,this;var s=Math.sqrt(1-o*o);if(Math.abs(s)<.001)return this._w=.5*(a+this._w),this._x=.5*(r+this._x),this._y=.5*(n+this._y),this._z=.5*(i+this._z),this;var l=Math.atan2(s,o),c=Math.sin((1-t)*l)/s,u=Math.sin(t*l)/s;return this._w=a*c+this._w*u,this._x=r*c+this._x*u,this._y=n*c+this._y*u,this._z=i*c+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},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(u.prototype,{isVector3:!0,set:function(e,t,r){return this.x=e,this.y=t,this.z=r,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("THREE.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("THREE.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("THREE.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(){var e=new c;return function(t){return!1===(t&&t.isEuler)&&console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(e.setFromEuler(t))}}(),applyAxisAngle:function(){var e=new c;return function(t,r){return this.applyQuaternion(e.setFromAxisAngle(t,r))}}(),applyMatrix3:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6]*n,this.y=i[1]*t+i[4]*r+i[7]*n,this.z=i[2]*t+i[5]*r+i[8]*n,this},applyMatrix4:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;this.x=i[0]*t+i[4]*r+i[8]*n+i[12],this.y=i[1]*t+i[5]*r+i[9]*n+i[13],this.z=i[2]*t+i[6]*r+i[10]*n+i[14];var a=i[3]*t+i[7]*r+i[11]*n+i[15];return this.divideScalar(a)},applyQuaternion:function(e){var t=this.x,r=this.y,n=this.z,i=e.x,a=e.y,o=e.z,s=e.w,l=s*t+a*n-o*r,c=s*r+o*t-i*n,u=s*n+i*r-a*t,h=-i*t-a*r-o*n;return this.x=l*s+h*-i+c*-o-u*-a,this.y=c*s+h*-a+u*-i-l*-o,this.z=u*s+h*-o+l*-a-c*-i,this},project:function(){var e=new h;return function(t){return e.multiplyMatrices(t.projectionMatrix,e.getInverse(t.matrixWorld)),this.applyMatrix4(e)}}(),unproject:function(){var e=new h;return function(t){return e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyMatrix4(e)}}(),transformDirection:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[4]*r+i[8]*n,this.y=i[1]*t+i[5]*r+i[9]*n,this.z=i[2]*t+i[6]*r+i[10]*n,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(){var e=new u,t=new u;return function(r,n){return e.set(r,r,r),t.set(n,n,n),this.clamp(e,t)}}(),clampLength:function(e,t){var r=this.length();return this.multiplyScalar(Math.max(e,Math.min(t,r))/r)},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)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(e){return this.multiplyScalar(e/this.length())},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,r){return this.subVectors(t,e).multiplyScalar(r).add(e)},cross:function(e,t){if(void 0!==t)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t);var r=this.x,n=this.y,i=this.z;return this.x=n*e.z-i*e.y,this.y=i*e.x-r*e.z,this.z=r*e.y-n*e.x,this},crossVectors:function(e,t){var r=e.x,n=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=n*s-i*o,this.y=i*a-r*s,this.z=r*o-n*a,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:function(){var e=new u;return function(t){return e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e=new u;return function(t){return this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(e){var t=this.dot(e)/Math.sqrt(this.lengthSq()*e.lengthSq());return Math.acos(us.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,r=this.y-e.y,n=this.z-e.z;return t*t+r*r+n*n},distanceToManhattan:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){var t=Math.sin(e.phi)*e.radius;return this.x=t*Math.sin(e.theta),this.y=Math.cos(e.phi)*e.radius,this.z=t*Math.cos(e.theta),this},setFromCylindrical:function(e){return this.x=e.radius*Math.sin(e.theta),this.y=e.y,this.z=e.radius*Math.cos(e.theta),this},setFromMatrixPosition:function(e){return this.setFromMatrixColumn(e,3)},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=n,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,r){return void 0!==r&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}}),Object.assign(h.prototype,{isMatrix4:!0,set:function(e,t,r,n,i,a,o,s,l,c,u,h,f,d,p,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=r,g[12]=n,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=l,g[6]=c,g[10]=u,g[14]=h,g[3]=f,g[7]=d,g[11]=p,g[15]=m,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 h).fromArray(this.elements)},copy:function(e){var t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this},copyPosition:function(e){var t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this},extractBasis:function(e,t,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this},extractRotation:function(){var e=new u;return function(t){var r=this.elements,n=t.elements,i=1/e.setFromMatrixColumn(t,0).length(),a=1/e.setFromMatrixColumn(t,1).length(),o=1/e.setFromMatrixColumn(t,2).length();return r[0]=n[0]*i,r[1]=n[1]*i,r[2]=n[2]*i,r[4]=n[4]*a,r[5]=n[5]*a,r[6]=n[6]*a,r[8]=n[8]*o,r[9]=n[9]*o,r[10]=n[10]*o,this}}(),makeRotationFromEuler:function(e){!1===(e&&e.isEuler)&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,r=e.x,n=e.y,i=e.z,a=Math.cos(r),o=Math.sin(r),s=Math.cos(n),l=Math.sin(n),c=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){var h=a*c,f=a*u,d=o*c,p=o*u;t[0]=s*c,t[4]=-s*u,t[8]=l,t[1]=f+d*l,t[5]=h-p*l,t[9]=-o*s,t[2]=p-h*l,t[6]=d+f*l,t[10]=a*s}else if("YXZ"===e.order){var m=s*c,g=s*u,v=l*c,b=l*u;t[0]=m+b*o,t[4]=v*o-g,t[8]=a*l,t[1]=a*u,t[5]=a*c,t[9]=-o,t[2]=g*o-v,t[6]=b+m*o,t[10]=a*s}else if("ZXY"===e.order)m=s*c,g=s*u,v=l*c,b=l*u,t[0]=m-b*o,t[4]=-a*u,t[8]=v+g*o,t[1]=g+v*o,t[5]=a*c,t[9]=b-m*o,t[2]=-a*l,t[6]=o,t[10]=a*s;else if("ZYX"===e.order)h=a*c,f=a*u,d=o*c,p=o*u,t[0]=s*c,t[4]=d*l-f,t[8]=h*l+p,t[1]=s*u,t[5]=p*l+h,t[9]=f*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,_=o*l;t[0]=s*c,t[4]=_-y*u,t[8]=x*u+w,t[1]=u,t[5]=a*c,t[9]=-o*c,t[2]=-l*c,t[6]=w*u+x,t[10]=y-_*u}else"XZY"===e.order&&(y=a*s,w=a*l,x=o*s,_=o*l,t[0]=s*c,t[4]=-u,t[8]=l*c,t[1]=y*u+_,t[5]=a*c,t[9]=w*u-x,t[2]=x*u-w,t[6]=o*c,t[10]=_*u+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){var t=this.elements,r=e._x,n=e._y,i=e._z,a=e._w,o=r+r,s=n+n,l=i+i,c=r*o,u=r*s,h=r*l,f=n*s,d=n*l,p=i*l,m=a*o,g=a*s,v=a*l;return t[0]=1-(f+p),t[4]=u-v,t[8]=h+g,t[1]=u+v,t[5]=1-(c+p),t[9]=d-m,t[2]=h-g,t[6]=d+m,t[10]=1-(c+f),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},lookAt:function(){var e=new u,t=new u,r=new u;return function(n,i,a){var o=this.elements;return r.subVectors(n,i),0===r.lengthSq()&&(r.z=1),r.normalize(),e.crossVectors(a,r),0===e.lengthSq()&&(r.z+=1e-4,e.crossVectors(a,r)),e.normalize(),t.crossVectors(r,e),o[0]=e.x,o[4]=t.x,o[8]=r.x,o[1]=e.y,o[5]=t.y,o[9]=r.y,o[2]=e.z,o[6]=t.z,o[10]=r.z,this}}(),multiply:function(e,t){return void 0!==t?(console.warn("THREE.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 r=e.elements,n=t.elements,i=this.elements,a=r[0],o=r[4],s=r[8],l=r[12],c=r[1],u=r[5],h=r[9],f=r[13],d=r[2],p=r[6],m=r[10],g=r[14],v=r[3],b=r[7],y=r[11],w=r[15],x=n[0],_=n[4],S=n[8],C=n[12],E=n[1],A=n[5],T=n[9],k=n[13],R=n[2],I=n[6],M=n[10],P=n[14],O=n[3],B=n[7],D=n[11],L=n[15];return i[0]=a*x+o*E+s*R+l*O,i[4]=a*_+o*A+s*I+l*B,i[8]=a*S+o*T+s*M+l*D,i[12]=a*C+o*k+s*P+l*L,i[1]=c*x+u*E+h*R+f*O,i[5]=c*_+u*A+h*I+f*B,i[9]=c*S+u*T+h*M+f*D,i[13]=c*C+u*k+h*P+f*L,i[2]=d*x+p*E+m*R+g*O,i[6]=d*_+p*A+m*I+g*B,i[10]=d*S+p*T+m*M+g*D,i[14]=d*C+p*k+m*P+g*L,i[3]=v*x+b*E+y*R+w*O,i[7]=v*_+b*A+y*I+w*B,i[11]=v*S+b*T+y*M+w*D,i[15]=v*C+b*k+y*P+w*L,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(){var e=new u;return function(t){for(var r=0,n=t.count;r>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,r){return this.r=e,this.g=t,this.b=r,this},setHSL:function(){function e(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+6*(t-e)*(2/3-r):e}return function(t,r,n){if(t=us.euclideanModulo(t,1),r=us.clamp(r,0,1),n=us.clamp(n,0,1),0===r)this.r=this.g=this.b=n;else{var i=n<=.5?n*(1+r):n+r-n*r,a=2*n-i;this.r=e(a,i,t+1/3),this.g=e(a,i,t),this.b=e(a,i,t-1/3)}return this}}(),setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var r;if(r=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var n,i=r[1],a=r[2];switch(i){case"rgb":case"rgba":if(n=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,t(n[5]),this;if(n=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,t(n[5]),this;break;case"hsl":case"hsla":if(n=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(n[1])/360,s=parseInt(n[2],10)/100,l=parseInt(n[3],10)/100;return t(n[5]),this.setHSL(o,s,l)}}}else if(r=/^\#([A-Fa-f0-9]+)$/.exec(e)){var c,u=(c=r[1]).length;if(3===u)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===u)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return e&&e.length>0&&(void 0!==(c=ys[e])?this.setHex(c):console.warn("THREE.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 r=t>0?1/t:1;return this.r=Math.pow(e.r,r),this.g=Math.pow(e.g,r),this.b=Math.pow(e.b,r),this},convertGammaToLinear:function(){var e=this.r,t=this.g,r=this.b;return this.r=e*e,this.g=t*t,this.b=r*r,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),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){var t,r,n=e||{h:0,s:0,l:0},i=this.r,a=this.g,o=this.b,s=Math.max(i,a,o),l=Math.min(i,a,o),c=(l+s)/2;if(l===s)t=0,r=0;else{var u=s-l;switch(r=c<=.5?u/(s+l):u/(2-s-l),s){case i:t=(a-o)/u+(a 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t}\n\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat theta = acos( dot( N, V ) );\n\tvec2 uv = vec2(\n\t\tsqrt( saturate( roughness ) ),\n\t\tsaturate( theta / ( 0.5 * PI ) ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.86267 + (0.49788 + 0.01436 * y ) * y;\n\tfloat b = 3.45068 + (4.18814 + y) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = (x > 0.0) ? v : 0.5 * inversesqrt( 1.0 - x * x ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transpose( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tvec3 result = vec3( LTC_ClippedSphereFormFactor( vectorFormFactor ) );\n\treturn result;\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) {\n\t\tvec4 plane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t\t\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; ++ i ) {\n\t\t\tvec4 plane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t\n\t#endif\n#endif\n",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#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#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transpose( const in mat3 v ) {\n\tmat3 tmp;\n\ttmp[0] = vec3(v[0].x, v[1].x, v[2].x);\n\ttmp[1] = vec3(v[0].y, v[1].y, v[2].y);\n\ttmp[2] = vec3(v[0].z, v[1].z, v[2].z);\n\treturn tmp;\n}\n",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\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))\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\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\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\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\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#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV(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\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n",defaultnormal_vertex:"#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",encodings_fragment:" gl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\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.w );\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.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, 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}\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 = value.rgb * cLogLuvM;\n\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract(Le);\n\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n\treturn vec4( max(vRGB, 0.0), 1.0 );\n}\n",envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n",envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n",fog_vertex:"\n#ifdef USE_FOG\nfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n varying float fogDepth;\n#endif\n",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif\n",gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif\n",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",lights_pars:"uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltcMat;\tuniform sampler2D ltcMag;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_BlinnPhong( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = BlinnExponentToGGXRoughness( material.specularShininess );\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tfloat norm = texture2D( ltcMag, uv ).a;\n\t\tvec4 t = texture2D( ltcMat, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( 1, 0, t.y ),\n\t\t\tvec3( 0, t.z, 0 ),\n\t\t\tvec3( t.w, 0, t.x )\n\t\t);\n\t\treflectedLight.directSpecular += lightColor * material.specularColor * norm * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tfloat norm = texture2D( ltcMag, uv ).a;\n\t\tvec4 t = texture2D( ltcMat, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( 1, 0, t.y ),\n\t\t\tvec3( 0, t.z, 0 ),\n\t\t\tvec3( t.w, 0, t.x )\n\t\t);\n\t\treflectedLight.directSpecular += lightColor * material.specularColor * norm * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\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#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",lights_template:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\t#ifndef STANDARD\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\n\t#else\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\n\t#endif\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n",logdepthbuf_fragment:"#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",map_particle_fragment:"#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif\n",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",normal_flip:"#ifdef DOUBLE_SIDED\n\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n#else\n\tfloat flipNormal = 1.0;\n#endif\n",normal_fragment:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal ) * flipNormal;\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 1.0 - 2.0 * rgb.xyz;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",project_vertex:"#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"#if defined( DITHERING )\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif\n",dithering_pars_fragment:"#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif\n",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif\n",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\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\t\tvec2 f = fract( uv * size + 0.5 );\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\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\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( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, 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( 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 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\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\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",tonemapping_pars_fragment:"#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\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\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\n#include \nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n",cube_vert:"varying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}\n",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",distanceRGBA_frag:"uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include \n#include \n#include \nvoid main () {\n\t#include \n\tgl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 );\n}\n",distanceRGBA_vert:"varying vec4 vWorldPosition;\n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition;\n}\n",equirect_frag:"uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n",equirect_vert:"varying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}\n",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}\n",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include \n#include \n#include