text: webpackJsonp([0,1],[function(e,t){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(i=window)}e.exports=i},function(t,i,r){(function(i,r,n){var o,o;!function(e){t.exports=e()}(function(){var t;return function e(t,i,r){function n(s,c){if(!i[s]){if(!t[s]){var u="function"==typeof o&&o;if(!c&&u)return o(s,!0);if(a)return a(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var h=i[s]={exports:{}};t[s][0].call(h.exports,function(e){var i=t[s][1][e];return n(i?i:e)},h,h.exports,e,t,i,r)}return i[s].exports}for(var a="function"==typeof o&&o,s=0;s<r.length;s++)n(r[s]);return n}({1:[function(e,t,i){function r(e){return e.BYTES_PER_ELEMENT&&"[object ArrayBuffer]"===n.call(e.buffer)||Array.isArray(e)}var n=Object.prototype.toString;t.exports=r},{}],2:[function(e,t,i){t.exports=function(e,t){return"number"==typeof e?e:"number"==typeof t?t:0}},{}],3:[function(e,t,i){"use strict";t.exports={createLink:function(e,t){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("link");r.href=e,r.rel="stylesheet";for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];r.setAttribute("data-"+n,o)}i.appendChild(r)},createStyle:function(e,t){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css";for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];r.setAttribute("data-"+n,o)}r.sheet?(r.innerHTML=e,r.sheet.cssText=e,i.appendChild(r)):r.styleSheet?(i.appendChild(r),r.styleSheet.cssText=e):(r.appendChild(document.createTextNode(e)),i.appendChild(r))}}},{}],4:[function(e,t,r){(function(t){"use strict";function i(){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}}function n(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(n()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=a.prototype):(null===e&&(e=new a(t)),e.length=t),e}function a(e,t,i){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(e,t,i);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return s(this,e,t,i)}function s(e,t,i,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?p(e,t,i,r):"string"==typeof t?h(e,t,i):f(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function u(e,t,i,r){return c(t),t<=0?o(e,t):void 0!==i?"string"==typeof r?o(e,t).fill(i,r):o(e,t).fill(i):o(e,t)}function l(e,t){if(c(t),e=o(e,t<0?0:0|m(t)),!a.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function h(e,t,i){if("string"==typeof i&&""!==i||(i="utf8"),!a.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var r=0|v(t,i);e=o(e,r);var n=e.write(t,i);return n!==r&&(e=e.slice(0,n)),e}function d(e,t){var i=t.length<0?0:0|m(t.length);e=o(e,i);for(var r=0;r<i;r+=1)e[r]=255&t[r];return e}function p(e,t,i,r){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===i&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,i):new Uint8Array(t,i,r),a.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=a.prototype):e=d(e,t),e}function f(e,t){if(a.isBuffer(t)){var i=0|m(t.length);return e=o(e,i),0===e.length?e:(t.copy(e,0,0,i),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||Z(t.length)?o(e,0):d(e,t);if("Buffer"===t.type&&$(t.data))return d(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function m(e){if(e>=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|e}function g(e){return+e!=e&&(e=0),a.alloc(+e)}function v(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 i=e.length;if(0===i)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return X(e).length;default:if(r)return Y(e).length;t=(""+t).toLowerCase(),r=!0}}function y(e,t,i){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if(i>>>=0,t>>>=0,i<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,i);case"utf8":case"utf-8":return S(this,t,i);case"ascii":return C(this,t,i);case"latin1":case"binary":return _(this,t,i);case"base64":return D(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,i);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function M(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function A(e,t,i,r,n){if(0===e.length)return-1;if("string"==typeof i?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=n?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(n)return-1;i=e.length-1}else if(i<0){if(!n)return-1;i=0}if("string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:w(e,t,i,r,n);if("number"==typeof t)return t&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):w(e,[t],i,r,n);throw new TypeError("val must be string, number or Buffer")}function w(e,t,i,r,n){function o(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}var a=1,s=e.length,c=t.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,i/=2}var u;if(n){var l=-1;for(u=i;u<s;u++)if(o(e,u)===o(t,l===-1?0:u-l)){if(l===-1&&(l=u),u-l+1===c)return l*a}else l!==-1&&(u-=u-l),l=-1}else for(i+c>s&&(i=s-c),u=i;u>=0;u--){for(var h=!0,d=0;d<c;d++)if(o(e,u+d)!==o(t,d)){h=!1;break}if(h)return u}return-1}function x(e,t,i,r){i=Number(i)||0;var n=e.length-i;r?(r=Number(r),r>n&&(r=n)):r=n;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[i+a]=s}return a}function E(e,t,i,r){return q(Y(t,e.length-i),e,i,r)}function b(e,t,i,r){return q(V(t),e,i,r)}function T(e,t,i,r){return b(e,t,i,r)}function L(e,t,i,r){return q(X(t),e,i,r)}function N(e,t,i,r){return q(W(t,e.length-i),e,i,r)}function D(e,t,i){return 0===t&&i===e.length?J.fromByteArray(e):J.fromByteArray(e.slice(t,i))}function S(e,t,i){i=Math.min(e.length,i);for(var r=[],n=t;n<i;){var o=e[n],a=null,s=o>239?4:o>223?3:o>191?2:1;if(n+s<=i){var c,u,l,h;switch(s){case 1:o<128&&(a=o);break;case 2:c=e[n+1],128===(192&c)&&(h=(31&o)<<6|63&c,h>127&&(a=h));break;case 3:c=e[n+1],u=e[n+2],128===(192&c)&&128===(192&u)&&(h=(15&o)<<12|(63&c)<<6|63&u,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:c=e[n+1],u=e[n+2],l=e[n+3],128===(192&c)&&128===(192&u)&&128===(192&l)&&(h=(15&o)<<18|(63&c)<<12|(63&u)<<6|63&l,h>65535&&h<1114112&&(a=h))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),n+=s}return I(r)}function I(e){var t=e.length;if(t<=ee)return String.fromCharCode.apply(String,e);for(var i="",r=0;r<t;)i+=String.fromCharCode.apply(String,e.slice(r,r+=ee));return i}function C(e,t,i){var r="";i=Math.min(e.length,i);for(var n=t;n<i;++n)r+=String.fromCharCode(127&e[n]);return r}function _(e,t,i){var r="";i=Math.min(e.length,i);for(var n=t;n<i;++n)r+=String.fromCharCode(e[n]);return r}function j(e,t,i){var r=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>r)&&(i=r);for(var n="",o=t;o<i;++o)n+=Q(e[o]);return n}function O(e,t,i){for(var r=e.slice(t,i),n="",o=0;o<r.length;o+=2)n+=String.fromCharCode(r[o]+256*r[o+1]);return n}function z(e,t,i){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,i,r,n,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<o)throw new RangeError('"value" argument is out of bounds');if(i+r>e.length)throw new RangeError("Index out of range")}function k(e,t,i,r){t<0&&(t=65535+t+1);for(var n=0,o=Math.min(e.length-i,2);n<o;++n)e[i+n]=(t&255<<8*(r?n:1-n))>>>8*(r?n:1-n)}function U(e,t,i,r){t<0&&(t=4294967295+t+1);for(var n=0,o=Math.min(e.length-i,4);n<o;++n)e[i+n]=t>>>8*(r?n:3-n)&255}function P(e,t,i,r,n,o){if(i+r>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function B(e,t,i,r,n){return n||P(e,t,i,4,3.4028234663852886e38,-3.4028234663852886e38),K.write(e,t,i,r,23,4),i+4}function F(e,t,i,r,n){return n||P(e,t,i,8,1.7976931348623157e308,-1.7976931348623157e308),K.write(e,t,i,r,52,8),i+8}function G(e){if(e=H(e).replace(te,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function H(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Q(e){return e<16?"0"+e.toString(16):e.toString(16)}function Y(e,t){t=t||1/0;for(var i,r=e.length,n=null,o=[],a=0;a<r;++a){if(i=e.charCodeAt(a),i>55295&&i<57344){if(!n){if(i>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}n=i;continue}if(i<56320){(t-=3)>-1&&o.push(239,191,189),n=i;continue}i=(n-55296<<10|i-56320)+65536}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=null,i<128){if((t-=1)<0)break;o.push(i)}else if(i<2048){if((t-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return o}function V(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}function W(e,t){for(var i,r,n,o=[],a=0;a<e.length&&!((t-=2)<0);++a)i=e.charCodeAt(a),r=i>>8,n=i%256,o.push(n),o.push(r);return o}function X(e){return J.toByteArray(G(e))}function q(e,t,i,r){for(var n=0;n<r&&!(n+i>=t.length||n>=e.length);++n)t[n+i]=e[n];return n}function Z(e){return e!==e}var J=e("base64-js"),K=e("ieee754"),$=e("isarray");r.Buffer=a,r.SlowBuffer=g,r.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),r.kMaxLength=n(),a.poolSize=8192,a._augment=function(e){return e.__proto__=a.prototype,e},a.from=function(e,t,i){return s(null,e,t,i)},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,i){return u(null,e,t,i)},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 i=e.length,r=t.length,n=0,o=Math.min(i,r);n<o;++n)if(e[n]!==t[n]){i=e[n],r=t[n];break}return i<r?-1:r<i?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!$(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var r=a.allocUnsafe(t),n=0;for(i=0;i<e.length;++i){var o=e[i];if(!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,n),n+=o.length}return r},a.byteLength=v,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)M(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)M(this,t,t+3),M(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)M(this,t,t+7),M(this,t+1,t+6),M(this,t+2,t+5),M(this,t+3,t+4);return this},a.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?S(this,0,e):y.apply(this,arguments)},a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},a.prototype.compare=function(e,t,i,r,n){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),t<0||i>e.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&t>=i)return 0;if(r>=n)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,r>>>=0,n>>>=0,this===e)return 0;for(var o=n-r,s=i-t,c=Math.min(o,s),u=this.slice(r,n),l=e.slice(t,i),h=0;h<c;++h)if(u[h]!==l[h]){o=u[h],s=l[h];break}return o<s?-1:s<o?1:0},a.prototype.includes=function(e,t,i){return this.indexOf(e,t,i)!==-1},a.prototype.indexOf=function(e,t,i){return A(this,e,t,i,!0)},a.prototype.lastIndexOf=function(e,t,i){return A(this,e,t,i,!1)},a.prototype.write=function(e,t,i,r){if(void 0===t)r="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)r=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}var n=this.length-t;if((void 0===i||i>n)&&(i=n),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return x(this,e,t,i);case"utf8":case"utf-8":return E(this,e,t,i);case"ascii":return b(this,e,t,i);case"latin1":case"binary":return T(this,e,t,i);case"base64":return L(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,e,t,i);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ee=4096;a.prototype.slice=function(e,t){var i=this.length;e=~~e,t=void 0===t?i:~~t,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<e&&(t=e);var r;if(a.TYPED_ARRAY_SUPPORT)r=this.subarray(e,t),r.__proto__=a.prototype;else{var n=t-e;r=new a(n,void 0);for(var o=0;o<n;++o)r[o]=this[o+e]}return r},a.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||z(e,t,this.length);for(var r=this[e],n=1,o=0;++o<t&&(n*=256);)r+=this[e+o]*n;return r},a.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||z(e,t,this.length);for(var r=this[e+--t],n=1;t>0&&(n*=256);)r+=this[e+--t]*n;return r},a.prototype.readUInt8=function(e,t){return t||z(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return t||z(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return t||z(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return t||z(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||z(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||z(e,t,this.length);for(var r=this[e],n=1,o=0;++o<t&&(n*=256);)r+=this[e+o]*n;return n*=128,r>=n&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||z(e,t,this.length);for(var r=t,n=1,o=this[e+--r];r>0&&(n*=256);)o+=this[e+--r]*n;return n*=128,o>=n&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return t||z(e,1,this.length),128&this[e]?(255-this[e]+1)*-1:this[e]},a.prototype.readInt16LE=function(e,t){t||z(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},a.prototype.readInt16BE=function(e,t){t||z(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},a.prototype.readInt32LE=function(e,t){return t||z(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||z(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||z(e,4,this.length),K.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return t||z(e,4,this.length),K.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return t||z(e,8,this.length),K.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return t||z(e,8,this.length),K.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,i,r){if(e=+e,t|=0,i|=0,!r){var n=Math.pow(2,8*i)-1;R(this,e,t,i,n,0)}var o=1,a=0;for(this[t]=255&e;++a<i&&(o*=256);)this[t+a]=e/o&255;return t+i},a.prototype.writeUIntBE=function(e,t,i,r){if(e=+e,t|=0,i|=0,!r){var n=Math.pow(2,8*i)-1;R(this,e,t,i,n,0)}var o=i-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+i},a.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||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,i){return e=+e,t|=0,i||R(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},a.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||R(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},a.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||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):U(this,e,t,!0),t+4},a.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||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):U(this,e,t,!1),t+4},a.prototype.writeIntLE=function(e,t,i,r){if(e=+e,t|=0,!r){var n=Math.pow(2,8*i-1);R(this,e,t,i,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o<i&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+i},a.prototype.writeIntBE=function(e,t,i,r){if(e=+e,t|=0,!r){var n=Math.pow(2,8*i-1);R(this,e,t,i,n-1,-n)}var o=i-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+i},a.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||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,i){return e=+e,t|=0,i||R(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},a.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||R(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},a.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||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):U(this,e,t,!0),t+4},a.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||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):U(this,e,t,!1),t+4},a.prototype.writeFloatLE=function(e,t,i){return B(this,e,t,!0,i)},a.prototype.writeFloatBE=function(e,t,i){return B(this,e,t,!1,i)},a.prototype.writeDoubleLE=function(e,t,i){return F(this,e,t,!0,i)},a.prototype.writeDoubleBE=function(e,t,i){return F(this,e,t,!1,i)},a.prototype.copy=function(e,t,i,r){if(i||(i=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<i&&(r=i),r===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-i&&(r=e.length-t+i);var n,o=r-i;if(this===e&&i<t&&t<r)for(n=o-1;n>=0;--n)e[n+t]=this[n+i];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(n=0;n<o;++n)e[n+t]=this[n+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+o),t);return o},a.prototype.fill=function(e,t,i,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,i=this.length):"string"==typeof i&&(r=i,i=this.length),1===e.length){var n=e.charCodeAt(0);n<256&&(e=n)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;o<i;++o)this[o]=e;else{var s=a.isBuffer(e)?e:Y(new a(e,r).toString()),c=s.length;for(o=0;o<i-t;++o)this[o+t]=s[o%c]}return this};var te=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof i?i:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":5,ieee754:6,isarray:7}],5:[function(e,t,i){"use strict";function r(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function n(e){return 3*e.length/4-r(e)}function o(e){var t,i,n,o,a,s,c=e.length;a=r(e),s=new h(3*c/4-a),n=a>0?c-4:c;var u=0;for(t=0,i=0;t<n;t+=4,i+=3)o=l[e.charCodeAt(t)]<<18|l[e.charCodeAt(t+1)]<<12|l[e.charCodeAt(t+2)]<<6|l[e.charCodeAt(t+3)],s[u++]=o>>16&255,s[u++]=o>>8&255,s[u++]=255&o;return 2===a?(o=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,s[u++]=255&o):1===a&&(o=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,s[u++]=o>>8&255,s[u++]=255&o),s}function a(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function s(e,t,i){for(var r,n=[],o=t;o<i;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],n.push(a(r));return n.join("")}function c(e){for(var t,i=e.length,r=i%3,n="",o=[],a=16383,c=0,l=i-r;c<l;c+=a)o.push(s(e,c,c+a>l?l:c+a));return 1===r?(t=e[i-1],n+=u[t>>2],n+=u[t<<4&63],n+="=="):2===r&&(t=(e[i-2]<<8)+e[i-1],n+=u[t>>10],n+=u[t>>4&63],n+=u[t<<2&63],n+="="),o.push(n),o.join("")}i.byteLength=n,i.toByteArray=o,i.fromByteArray=c;for(var u=[],l=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,f=d.length;p<f;++p)u[p]=d[p],l[d.charCodeAt(p)]=p;l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},{}],6:[function(e,t,i){i.read=function(e,t,i,r,n){var o,a,s=8*n-r-1,c=(1<<s)-1,u=c>>1,l=-7,h=i?n-1:0,d=i?-1:1,p=e[t+h];for(h+=d,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+h],h+=d,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+h],h+=d,l-=8);if(0===o)o=1-u;else{if(o===c)return a?NaN:(p?-1:1)*(1/0);a+=Math.pow(2,r),o-=u}return(p?-1:1)*a*Math.pow(2,o-r)},i.write=function(e,t,i,r,n,o){var a,s,c,u=8*o-n-1,l=(1<<u)-1,h=l>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),t+=a+h>=1?d/c:d*Math.pow(2,1-h),t*c>=2&&(a++,c/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(t*c-1)*Math.pow(2,n),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;e[i+p]=255&s,p+=f,s/=256,n-=8);for(a=a<<n|s,u+=n;u>0;e[i+p]=255&a,p+=f,a/=256,u-=8);e[i+p-f]|=128*m}},{}],7:[function(e,t,i){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],8:[function(e,t,i){(function(e){function t(e,t){for(var i=0,r=e.length-1;r>=0;r--){var n=e[r];"."===n?e.splice(r,1):".."===n?(e.splice(r,1),i++):i&&(e.splice(r,1),i--)}if(t)for(;i--;i)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var i=[],r=0;r<e.length;r++)t(e[r],r,e)&&i.push(e[r]);return i}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(e){return n.exec(e).slice(1)};i.resolve=function(){for(var i="",n=!1,o=arguments.length-1;o>=-1&&!n;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(i=a+"/"+i,n="/"===a.charAt(0))}return i=t(r(i.split("/"),function(e){return!!e}),!n).join("/"),(n?"/":"")+i||"."},i.normalize=function(e){var n=i.isAbsolute(e),o="/"===a(e,-1);return e=t(r(e.split("/"),function(e){return!!e}),!n).join("/"),e||n||(e="."),e&&o&&(e+="/"),(n?"/":"")+e},i.isAbsolute=function(e){return"/"===e.charAt(0)},i.join=function(){var e=Array.prototype.slice.call(arguments,0);return i.normalize(r(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},i.relative=function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var i=e.length-1;i>=0&&""===e[i];i--);return t>i?[]:e.slice(t,i-t+1)}e=i.resolve(e).substr(1),t=i.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),a=Math.min(n.length,o.length),s=a,c=0;c<a;c++)if(n[c]!==o[c]){s=c;break}for(var u=[],c=s;c<n.length;c++)u.push("..");return u=u.concat(o.slice(s)),u.join("/")},i.sep="/",i.delimiter=":",i.dirname=function(e){var t=o(e),i=t[0],r=t[1];return i||r?(r&&(r=r.substr(0,r.length-1)),i+r):"."},i.basename=function(e,t){var i=o(e)[2];return t&&i.substr(-1*t.length)===t&&(i=i.substr(0,i.length-t.length)),i},i.extname=function(e){return o(e)[3]};var a="b"==="ab".substr(-1)?function(e,t,i){return e.substr(t,i)}:function(e,t,i){return t<0&&(t=e.length+t),e.substr(t,i)}}).call(this,e("_process"))},{_process:9}],9:[function(e,t,i){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function o(e){if(h===setTimeout)return setTimeout(e,0);if((h===r||!h)&&setTimeout)return h=setTimeout,setTimeout(e,0);try{return h(e,0)}catch(t){try{return h.call(null,e,0)}catch(t){return h.call(this,e,0)}}}function a(e){if(d===clearTimeout)return clearTimeout(e);if((d===n||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function s(){g&&f&&(g=!1,f.length?m=f.concat(m):v=-1,m.length&&c())}function c(){if(!g){var e=o(s);g=!0;for(var t=m.length;t;){for(f=m,m=[];++v<t;)f&&f[v].run();v=-1,t=m.length}f=null,g=!1,a(e)}}function u(e,t){this.fun=e,this.array=t}function l(){}var h,d,p=t.exports={};!function(){try{h="function"==typeof setTimeout?setTimeout:r}catch(e){h=r}try{d="function"==typeof clearTimeout?clearTimeout:n}catch(e){d=n}}();var f,m=[],g=!1,v=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];m.push(new u(e,t)),1!==m.length||g||o(c)},u.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=l,p.addListener=l,p.once=l,p.off=l,p.removeListener=l,p.removeAllListeners=l,p.emit=l,p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},{}],10:[function(e,t,i){var r=e("buffer").Buffer;t.exports=function(e,t){if(r.isBuffer(e)&&r.isBuffer(t)){if("function"==typeof e.equals)return e.equals(t);if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}}},{buffer:4}],11:[function(e,t,i){(function(r){function n(){return"undefined"!=typeof document&&"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function o(){var e=arguments,t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+i.humanize(this.diff),!t)return e;var r="color: "+this.color;e=[e[0],r,"color: inherit"].concat(Array.prototype.slice.call(e,1));var n=0,o=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(n++,"%c"===e&&(o=n))}),e.splice(o,0,r),e}function a(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{null==e?i.storage.removeItem("debug"):i.storage.debug=e}catch(e){}}function c(){try{return i.storage.debug}catch(e){}if("undefined"!=typeof r&&"env"in r)return r.env.DEBUG}function u(){try{return window.localStorage}catch(e){}}i=t.exports=e("./debug"),i.log=a,i.formatArgs=o,i.save=s,i.load=c,i.useColors=n,i.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:u(),i.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],i.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},i.enable(c())}).call(this,e("_process"))},{"./debug":12,_process:9}],12:[function(e,t,i){function r(){return i.colors[l++%i.colors.length]}function n(e){function t(){}function n(){var e=n,t=+new Date,o=t-(u||t);e.diff=o,e.prev=u,e.curr=t,u=t,null==e.useColors&&(e.useColors=i.useColors()),null==e.color&&e.useColors&&(e.color=r());for(var a=new Array(arguments.length),s=0;s<a.length;s++)a[s]=arguments[s];a[0]=i.coerce(a[0]),"string"!=typeof a[0]&&(a=["%o"].concat(a));var c=0;a[0]=a[0].replace(/%([a-z%])/g,function(t,r){if("%%"===t)return t;c++;var n=i.formatters[r];if("function"==typeof n){var o=a[c];t=n.call(e,o),a.splice(c,1),c--}return t}),a=i.formatArgs.apply(e,a);var l=n.log||i.log||console.log.bind(console);l.apply(e,a)}t.enabled=!1,n.enabled=!0;var o=i.enabled(e)?n:t;return o.namespace=e,o}function o(e){i.save(e);for(var t=(e||"").split(/[\s,]+/),r=t.length,n=0;n<r;n++)t[n]&&(e=t[n].replace(/[\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*?"),"-"===e[0]?i.skips.push(new RegExp("^"+e.substr(1)+"$")):i.names.push(new RegExp("^"+e+"$")))}function a(){i.enable("")}function s(e){var t,r;for(t=0,r=i.skips.length;t<r;t++)if(i.skips[t].test(e))return!1;for(t=0,r=i.names.length;t<r;t++)if(i.names[t].test(e))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}i=t.exports=n.debug=n,i.coerce=c,i.disable=a,i.enable=o,i.enabled=s,i.humanize=e("ms"),i.names=[],i.skips=[],i.formatters={};var u,l=0},{ms:13}],13:[function(e,t,i){function r(e){if(e=String(e),!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var i=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return i*h;case"days":case"day":case"d":return i*l;case"hours":case"hour":case"hrs":case"hr":case"h":return i*u;case"minutes":case"minute":case"mins":case"min":case"m":return i*c;case"seconds":case"second":case"secs":case"sec":case"s":return i*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}function n(e){return e>=l?Math.round(e/l)+"d":e>=u?Math.round(e/u)+"h":e>=c?Math.round(e/c)+"m":e>=s?Math.round(e/s)+"s":e+"ms"}function o(e){return a(e,l,"day")||a(e,u,"hour")||a(e,c,"minute")||a(e,s,"second")||e+" ms"}function a(e,t,i){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+i:Math.ceil(e/t)+" "+i+"s"}var s=1e3,c=60*s,u=60*c,l=24*u,h=365.25*l;t.exports=function(e,t){t=t||{};var i=typeof e;if("string"===i&&e.length>0)return r(e);if("number"===i&&isNaN(e)===!1)return t.long?o(e):n(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e));
  }},{}],14:[function(e,t,i){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Sources cannot be null or undefined");return Object(e)}function n(e,t,i){var r=t[i];if(void 0!==r&&null!==r){if(s.call(e,i)&&(void 0===e[i]||null===e[i]))throw new TypeError("Cannot convert undefined or null to object ("+i+")");s.call(e,i)&&a(r)?e[i]=o(Object(e[i]),t[i]):e[i]=r}}function o(e,t){if(e===t)return e;t=Object(t);for(var i in t)s.call(t,i)&&n(e,t,i);if(Object.getOwnPropertySymbols)for(var r=Object.getOwnPropertySymbols(t),o=0;o<r.length;o++)c.call(t,r[o])&&n(e,t,r[o]);return e}var a=e("is-obj"),s=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;t.exports=function(e){e=r(e);for(var t=1;t<arguments.length;t++)o(e,arguments[t]);return e}},{"is-obj":15}],15:[function(e,t,i){"use strict";t.exports=function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}},{}],16:[function(t,i,r){!function(t,i,r,n){"use strict";function o(e,t){for(var i=0,r=e.length;i<r;i++)v(e[i],t)}function a(e){for(var t,i=0,r=e.length;i<r;i++)t=e[i],b(t,B[c(t)])}function s(e){return function(t){ne(t)&&(v(t,e),o(t.querySelectorAll(F),e))}}function c(e){var t=se.call(e,"is"),i=e.nodeName.toUpperCase(),r=H.call(P,t?R+t.toUpperCase():z+i);return t&&-1<r&&!u(i,t)?-1:r}function u(e,t){return-1<F.indexOf(e+'[is="'+t+'"]')}function l(e){var t=e.currentTarget,i=e.attrChange,r=e.attrName,n=e.target;ve&&(!n||n===t)&&t.attributeChangedCallback&&"style"!==r&&e.prevValue!==e.newValue&&t.attributeChangedCallback(r,i===e[S]?null:e.prevValue,i===e[C]?null:e.newValue)}function h(e){var t=s(e);return function(e){y.push(t,e.target)}}function d(e){ge&&(ge=!1,e.currentTarget.removeEventListener(j,d)),o((e.target||i).querySelectorAll(F),e.detail===N?N:L),re&&m()}function p(e,t){var i=this;ce.call(i,e,t),M.call(i,{target:i})}function f(e,t){ee(e,t),x?x.observe(e,he):(me&&(e.setAttribute=p,e[T]=w(e),e.addEventListener(O,M)),e.addEventListener(_,l)),e.createdCallback&&ve&&(e.created=!0,e.createdCallback(),e.created=!1)}function m(){for(var e,t=0,i=oe.length;t<i;t++)e=oe[t],G.contains(e)||(i--,oe.splice(t--,1),v(e,N))}function g(e){throw new Error("A "+e+" type is already registered")}function v(e,t){var i,r=c(e);-1<r&&(E(e,B[r]),r=0,t!==L||e[L]?t===N&&!e[N]&&(e[L]=!1,e[N]=!0,r=1):(e[N]=!1,e[L]=!0,r=1,re&&H.call(oe,e)<0&&oe.push(e)),r&&(i=e[t+"Callback"])&&i.call(e))}if(!(n in i)){var y,M,A,w,x,E,b,T="__"+n+(1e5*Math.random()>>0),L="attached",N="detached",D="extends",S="ADDITION",I="MODIFICATION",C="REMOVAL",_="DOMAttrModified",j="DOMContentLoaded",O="DOMSubtreeModified",z="<",R="=",k=/^[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+$/,U=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],P=[],B=[],F="",G=i.documentElement,H=P.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},Q=r.prototype,Y=Q.hasOwnProperty,V=Q.isPrototypeOf,W=r.defineProperty,X=r.getOwnPropertyDescriptor,q=r.getOwnPropertyNames,Z=r.getPrototypeOf,J=r.setPrototypeOf,K=!!r.__proto__,$=r.create||function e(t){return t?(e.prototype=t,new e):this},ee=J||(K?function(e,t){return e.__proto__=t,e}:q&&X?function(){function e(e,t){for(var i,r=q(t),n=0,o=r.length;n<o;n++)i=r[n],Y.call(e,i)||W(e,i,X(t,i))}return function(t,i){do e(t,i);while((i=Z(i))&&!V.call(i,t));return t}}():function(e,t){for(var i in t)e[i]=t[i];return e}),te=t.MutationObserver||t.WebKitMutationObserver,ie=(t.HTMLElement||t.Element||t.Node).prototype,re=!V.call(ie,G),ne=re?function(e){return 1===e.nodeType}:function(e){return V.call(ie,e)},oe=re&&[],ae=ie.cloneNode,se=ie.getAttribute,ce=ie.setAttribute,ue=ie.removeAttribute,le=i.createElement,he=te&&{attributes:!0,characterData:!0,attributeOldValue:!0},de=te||function(e){me=!1,G.removeEventListener(_,de)},pe=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,10)},fe=!1,me=!0,ge=!0,ve=!0;J||K?(E=function(e,t){V.call(t,e)||f(e,t)},b=f):(E=function(e,t){e[T]||(e[T]=r(!0),f(e,t))},b=E),re?(me=!1,function(){var t=X(ie,"addEventListener"),i=t.value,r=function(e){var t=new CustomEvent(_,{bubbles:!0});t.attrName=e,t.prevValue=se.call(this,e),t.newValue=null,t[C]=t.attrChange=2,ue.call(this,e),this.dispatchEvent(t)},n=function(t,i){var r=this.hasAttribute(t),n=r&&se.call(this,t);e=new CustomEvent(_,{bubbles:!0}),ce.call(this,t,i),e.attrName=t,e.prevValue=r?n:null,e.newValue=i,r?e[I]=e.attrChange=1:e[S]=e.attrChange=0,this.dispatchEvent(e)},o=function(e){var t,i=e.currentTarget,r=i[T],n=e.propertyName;r.hasOwnProperty(n)&&(r=r[n],t=new CustomEvent(_,{bubbles:!0}),t.attrName=r.name,t.prevValue=r.value||null,t.newValue=r.value=i[n]||null,null==t.prevValue?t[S]=t.attrChange=0:t[I]=t.attrChange=1,i.dispatchEvent(t))};t.value=function(e,t,a){e===_&&this.attributeChangedCallback&&this.setAttribute!==n&&(this[T]={className:{name:"class",value:this.className}},this.setAttribute=n,this.removeAttribute=r,i.call(this,"propertychange",o)),i.call(this,e,t,a)},W(ie,"addEventListener",t)}()):te||(G.addEventListener(_,de),G.setAttribute(T,1),G.removeAttribute(T),me&&(M=function(e){var t,i,r,n=this;if(n===e.target){t=n[T],n[T]=i=w(n);for(r in i){if(!(r in t))return A(0,n,r,t[r],i[r],S);if(i[r]!==t[r])return A(1,n,r,t[r],i[r],I)}for(r in t)if(!(r in i))return A(2,n,r,t[r],i[r],C)}},A=function(e,t,i,r,n,o){var a={attrChange:e,currentTarget:t,attrName:i,prevValue:r,newValue:n};a[o]=e,l(a)},w=function(e){for(var t,i,r={},n=e.attributes,o=0,a=n.length;o<a;o++)t=n[o],i=t.name,"setAttribute"!==i&&(r[i]=t.value);return r})),i[n]=function(e,t){if(r=e.toUpperCase(),fe||(fe=!0,te?(x=function(e,t){function i(e,t){for(var i=0,r=e.length;i<r;t(e[i++]));}return new te(function(r){for(var n,o,a,s=0,c=r.length;s<c;s++)n=r[s],"childList"===n.type?(i(n.addedNodes,e),i(n.removedNodes,t)):(o=n.target,ve&&o.attributeChangedCallback&&"style"!==n.attributeName&&(a=se.call(o,n.attributeName),a!==n.oldValue&&o.attributeChangedCallback(n.attributeName,n.oldValue,a)))})}(s(L),s(N)),x.observe(i,{childList:!0,subtree:!0})):(y=[],pe(function e(){for(;y.length;)y.shift().call(null,y.shift());pe(e)}),i.addEventListener("DOMNodeInserted",h(L)),i.addEventListener("DOMNodeRemoved",h(N))),i.addEventListener(j,d),i.addEventListener("readystatechange",d),i.createElement=function(e,t){var r=le.apply(i,arguments),n=""+e,o=H.call(P,(t?R:z)+(t||n).toUpperCase()),a=-1<o;return t&&(r.setAttribute("is",t=t.toLowerCase()),a&&(a=u(n.toUpperCase(),t))),ve=!i.createElement.innerHTMLHelper,a&&b(r,B[o]),r},ie.cloneNode=function(e){var t=ae.call(this,!!e),i=c(t);return-1<i&&b(t,B[i]),e&&a(t.querySelectorAll(F)),t}),-2<H.call(P,R+r)+H.call(P,z+r)&&g(e),!k.test(r)||-1<H.call(U,r))throw new Error("The type "+e+" is invalid");var r,n,l=function(){return f?i.createElement(m,r):i.createElement(m)},p=t||Q,f=Y.call(p,D),m=f?t[D].toUpperCase():r;return f&&-1<H.call(P,z+m)&&g(m),n=P.push((f?R:z)+r)-1,F=F.concat(F.length?",":"",f?m+'[is="'+e.toLowerCase()+'"]':m),l.prototype=B[n]=Y.call(p,"prototype")?p.prototype:$(ie),o(i.querySelectorAll(F),L),l}}}(window,document,Object,"registerElement")},{}],17:[function(e,t,i){t.exports=function(e){switch(e){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}},{}],18:[function(e,t,i){function r(e,t,i){if(!e)throw new TypeError("must specify data as first parameter");if(i=0|+(i||0),Array.isArray(e)&&Array.isArray(e[0])){var r=e[0].length,o=e.length*r;t&&"string"!=typeof t||(t=new(n(t||"float32"))(o+i));var a=t.length-i;if(o!==a)throw new Error("source length "+o+" ("+r+"x"+e.length+") does not match destination length "+a);for(var s=0,c=i;s<e.length;s++)for(var u=0;u<r;u++)t[c++]=e[s][u]}else if(t&&"string"!=typeof t)t.set(e,i);else{var l=n(t||"float32");0===i?t=new l(e):(t=new l(e.length+i),t.set(e,i))}return t}var n=e("dtype");t.exports=r},{dtype:17}],19:[function(e,t,i){function r(e,t,i){if(!s(t))throw new TypeError("iterator must be a function");arguments.length<3&&(i=this),"[object Array]"===c.call(e)?n(e,t,i):"string"==typeof e?o(e,t,i):a(e,t,i)}function n(e,t,i){for(var r=0,n=e.length;r<n;r++)u.call(e,r)&&t.call(i,e[r],r,e)}function o(e,t,i){for(var r=0,n=e.length;r<n;r++)t.call(i,e.charAt(r),r,e)}function a(e,t,i){for(var r in e)u.call(e,r)&&t.call(i,e[r],r,e)}var s=e("is-function");t.exports=r;var c=Object.prototype.toString,u=Object.prototype.hasOwnProperty},{"is-function":24}],20:[function(e,t,r){(function(e){"undefined"!=typeof window?t.exports=window:"undefined"!=typeof e?t.exports=e:"undefined"!=typeof self?t.exports=self:t.exports={}}).call(this,"undefined"!=typeof i?i:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],21:[function(e,t,i){t.exports=function(e){if(!e||"string"!=typeof e)throw new Error("must specify property for indexof search");return new Function("array","value","start",["start = start || 0","for (var i=start; i<array.length; i++)",'  if (array[i]["'+e+'"] === value)',"      return i","return -1"].join("\n"))}},{}],22:[function(e,t,i){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}},{}],23:[function(e,t,i){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function n(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}t.exports=function(e){return null!=e&&(r(e)||n(e)||!!e._isBuffer)}},{}],24:[function(e,t,i){function r(e){var t=n.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}t.exports=r;var n=Object.prototype.toString},{}],25:[function(e,t,i){function r(e){this.glyphs=[],this._measure=this.computeMetrics.bind(this),this.update(e)}function n(e){Object.defineProperty(r.prototype,e,{get:o(e),configurable:!0})}function o(e){return new Function(["return function "+e+"() {","  return this._"+e,"}"].join("\n"))()}function a(e,t){if(!e.chars||0===e.chars.length)return null;var i=f(e.chars,t);return i>=0?e.chars[i]:null}function s(e){for(var t=0;t<g.length;t++){var i=g[t].charCodeAt(0),r=f(e.chars,i);if(r>=0)return e.chars[r].height}return 0}function c(e){for(var t=0;t<v.length;t++){var i=v[t].charCodeAt(0),r=f(e.chars,i);if(r>=0)return e.chars[r]}return 0}function u(e){for(var t=0;t<y.length;t++){var i=y[t].charCodeAt(0),r=f(e.chars,i);if(r>=0)return e.chars[r].height}return 0}function l(e,t,i){if(!e.kernings||0===e.kernings.length)return 0;for(var r=e.kernings,n=0;n<r.length;n++){var o=r[n];if(o.first===t&&o.second===i)return o.amount}return 0}function h(e){return"center"===e?x:"right"===e?E:w}var d=e("word-wrapper"),p=e("xtend"),f=e("indexof-property")("id"),m=e("as-number"),g=["x","e","a","o","n","s","r","c","u","m","v","w","z"],v=["m","w"],y=["H","I","N","E","F","K","L","T","U","V","W","X","Y","Z"],M="\t".charCodeAt(0),A=" ".charCodeAt(0),w=0,x=1,E=2;t.exports=function(e){return new r(e)},r.prototype.update=function(e){if(e=p({measure:this._measure},e),this._opt=e,this._opt.tabSize=m(this._opt.tabSize,4),!e.font)throw new Error("must provide a valid bitmap font");var t=this.glyphs,i=e.text||"",r=e.font;this._setupSpaceGlyphs(r);var n=d.lines(i,e),o=e.width||0;t.length=0;var a=n.reduce(function(e,t){return Math.max(e,t.width,o)},0),c=0,f=0,g=m(e.lineHeight,r.common.lineHeight),v=r.common.base,y=g-v,M=e.letterSpacing||0,A=g*n.length-y,w=h(this._opt.align);f-=A,this._width=a,this._height=A,this._descender=g-v,this._baseline=v,this._xHeight=s(r),this._capHeight=u(r),this._lineHeight=g,this._ascender=g-y-this._xHeight;var b=this;n.forEach(function(e,n){for(var o,s=e.start,u=e.end,h=e.width,d=s;d<u;d++){var p=i.charCodeAt(d),m=b.getGlyph(r,p);if(m){o&&(c+=l(r,o.id,m.id));var v=c;w===x?v+=(a-h)/2:w===E&&(v+=a-h),t.push({position:[v,f],data:m,index:d,line:n}),c+=m.xadvance+M,o=m}}f+=g,c=0}),this._linesTotal=n.length},r.prototype._setupSpaceGlyphs=function(e){if(this._fallbackSpaceGlyph=null,this._fallbackTabGlyph=null,e.chars&&0!==e.chars.length){var t=a(e,A)||c(e)||e.chars[0],i=this._opt.tabSize*t.xadvance;this._fallbackSpaceGlyph=t,this._fallbackTabGlyph=p(t,{x:0,y:0,xadvance:i,id:M,xoffset:0,yoffset:0,width:0,height:0})}},r.prototype.getGlyph=function(e,t){var i=a(e,t);return i?i:t===M?this._fallbackTabGlyph:t===A?this._fallbackSpaceGlyph:null},r.prototype.computeMetrics=function(e,t,i,r){var n,o,a=this._opt.letterSpacing||0,s=this._opt.font,c=0,u=0,h=0;if(!s.chars||0===s.chars.length)return{start:t,end:t,width:0};i=Math.min(e.length,i);for(var d=t;d<i;d++){var p=e.charCodeAt(d),n=this.getGlyph(s,p);if(n){var f=(n.xoffset,o?l(s,o.id,n.id):0);c+=f;var m=c+n.xadvance+a,g=c+n.width;if(g>=r||m>=r)break;c=m,u=g,o=n}h++}return o&&(u+=o.xoffset),{start:t,end:t+h,width:u}},["width","height","descender","ascender","xHeight","baseline","capHeight","lineHeight"].forEach(n)},{"as-number":2,"indexof-property":21,"word-wrapper":51,xtend:54}],26:[function(e,t,i){(function(i){function r(e){var t=Object.prototype.toString;return"[object ArrayBuffer]"===t.call(e)}function n(e){if(d)return h(e,{responseType:"arraybuffer"});if("undefined"==typeof self.XMLHttpRequest)throw new Error("your browser does not support XHR loading");var t=new self.XMLHttpRequest;return t.overrideMimeType("text/plain; charset=x-user-defined"),h({xhr:t},e)}var o=e("xhr"),a=function(){},s=e("parse-bmfont-ascii"),c=e("parse-bmfont-xml"),u=e("parse-bmfont-binary"),l=e("./lib/is-binary"),h=e("xtend"),d=function(){return self.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}();t.exports=function(e,t){t="function"==typeof t?t:a,"string"==typeof e?e={uri:e}:e||(e={});var h=e.binary;h&&(e=n(e)),o(e,function(n,o,h){if(n)return t(n);if(!/^2/.test(o.statusCode))return t(new Error("http status code: "+o.statusCode));if(!h)return t(new Error("no body result"));var d=!1;if(r(h)){var p=new Uint8Array(h);h=new i(p,"binary")}l(h)&&(d=!0,"string"==typeof h&&(h=new i(h,"binary"))),d||(i.isBuffer(h)&&(h=h.toString(e.encoding)),h=h.trim());var f;try{var m=o.headers["content-type"];f=d?u(h):/json/.test(m)||"{"===h.charAt(0)?JSON.parse(h):/xml/.test(m)||"<"===h.charAt(0)?c(h):s(h)}catch(e){t(new Error("error parsing font "+e.message)),t=a}t(null,f)})}}).call(this,e("buffer").Buffer)},{"./lib/is-binary":27,buffer:4,"parse-bmfont-ascii":29,"parse-bmfont-binary":30,"parse-bmfont-xml":31,xhr:52,xtend:54}],27:[function(e,t,i){(function(i){var r=e("buffer-equal"),n=new i([66,77,70,3]);t.exports=function(e){return"string"==typeof e?"BMF"===e.substring(0,3):e.length>4&&r(e.slice(0,4),n)}}).call(this,e("buffer").Buffer)},{buffer:4,"buffer-equal":10}],28:[function(e,t,i){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function n(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},i=0;i<10;i++)t["_"+String.fromCharCode(i)]=i;var r=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==r.join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}var o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;t.exports=n()?Object.assign:function(e,t){for(var i,n,s=r(e),c=1;c<arguments.length;c++){i=Object(arguments[c]);for(var u in i)o.call(i,u)&&(s[u]=i[u]);if(Object.getOwnPropertySymbols){n=Object.getOwnPropertySymbols(i);for(var l=0;l<n.length;l++)a.call(i,n[l])&&(s[n[l]]=i[n[l]])}}return s}},{}],29:[function(e,t,i){function r(e,t){if(e=e.replace(/\t+/g," ").trim(),!e)return null;var i=e.indexOf(" ");if(i===-1)throw new Error("no named row at line "+t);var r=e.substring(0,i);e=e.substring(i+1),e=e.replace(/letter=[\'\"]\S+[\'\"]/gi,""),e=e.split("="),e=e.map(function(e){return e.trim().match(/(".*?"|[^"\s]+)+(?=\s*|\s*$)/g)});for(var o=[],a=0;a<e.length;a++){var s=e[a];0===a?o.push({key:s[0],data:""}):a===e.length-1?o[o.length-1].data=n(s[0]):(o[o.length-1].data=n(s[0]),o.push({key:s[1],data:""}))}var c={key:r,data:{}};return o.forEach(function(e){c.data[e.key]=e.data}),c}function n(e){return e&&0!==e.length?0===e.indexOf('"')||0===e.indexOf("'")?e.substring(1,e.length-1):e.indexOf(",")!==-1?o(e):parseInt(e,10):""}function o(e){return e.split(",").map(function(e){return parseInt(e,10)})}t.exports=function(e){if(!e)throw new Error("no data provided");e=e.toString().trim();var t={pages:[],chars:[],kernings:[]},i=e.split(/\r\n?|\n/g);if(0===i.length)throw new Error("no data in BMFont file");for(var n=0;n<i.length;n++){var o=r(i[n],n);if(o)if("page"===o.key){if("number"!=typeof o.data.id)throw new Error("malformed file at line "+n+" -- needs page id=N");if("string"!=typeof o.data.file)throw new Error("malformed file at line "+n+' -- needs page file="path"');t.pages[o.data.id]=o.data.file}else"chars"===o.key||"kernings"===o.key||("char"===o.key?t.chars.push(o.data):"kerning"===o.key?t.kernings.push(o.data):t[o.key]=o.data)}return t}},{}],30:[function(e,t,i){function r(e,t,i){if(i>t.length-1)return 0;var r=t.readUInt8(i++),u=t.readInt32LE(i);switch(i+=4,r){case 1:e.info=n(t,i);break;case 2:e.common=o(t,i);break;case 3:e.pages=a(t,i,u);break;case 4:e.chars=s(t,i,u);break;case 5:e.kernings=c(t,i,u)}return 5+u}function n(e,t){var i={};i.size=e.readInt16LE(t);var r=e.readUInt8(t+2);return i.smooth=r>>7&1,i.unicode=r>>6&1,i.italic=r>>5&1,i.bold=r>>4&1,r>>3&1&&(i.fixedHeight=1),i.charset=e.readUInt8(t+3)||"",i.stretchH=e.readUInt16LE(t+4),i.aa=e.readUInt8(t+6),i.padding=[e.readInt8(t+7),e.readInt8(t+8),e.readInt8(t+9),e.readInt8(t+10)],i.spacing=[e.readInt8(t+11),e.readInt8(t+12)],i.outline=e.readUInt8(t+13),i.face=l(e,t+14),i}function o(e,t){var i={};i.lineHeight=e.readUInt16LE(t),i.base=e.readUInt16LE(t+2),i.scaleW=e.readUInt16LE(t+4),i.scaleH=e.readUInt16LE(t+6),i.pages=e.readUInt16LE(t+8);e.readUInt8(t+10);return i.packed=0,i.alphaChnl=e.readUInt8(t+11),i.redChnl=e.readUInt8(t+12),i.greenChnl=e.readUInt8(t+13),i.blueChnl=e.readUInt8(t+14),i}function a(e,t,i){for(var r=[],n=u(e,t),o=n.length+1,a=i/o,s=0;s<a;s++)r[s]=e.slice(t,t+n.length).toString("utf8"),t+=o;return r}function s(e,t,i){for(var r=[],n=i/20,o=0;o<n;o++){var a={},s=20*o;a.id=e.readUInt32LE(t+0+s),a.x=e.readUInt16LE(t+4+s),a.y=e.readUInt16LE(t+6+s),a.width=e.readUInt16LE(t+8+s),a.height=e.readUInt16LE(t+10+s),a.xoffset=e.readInt16LE(t+12+s),a.yoffset=e.readInt16LE(t+14+s),a.xadvance=e.readInt16LE(t+16+s),a.page=e.readUInt8(t+18+s),a.chnl=e.readUInt8(t+19+s),r[o]=a}return r}function c(e,t,i){for(var r=[],n=i/10,o=0;o<n;o++){var a={},s=10*o;a.first=e.readUInt32LE(t+0+s),a.second=e.readUInt32LE(t+4+s),a.amount=e.readInt16LE(t+8+s),r[o]=a}return r}function u(e,t){for(var i=t;i<e.length&&0!==e[i];i++);return e.slice(t,i)}function l(e,t){return u(e,t).toString("utf8")}var h=[66,77,70];t.exports=function(e){if(e.length<6)throw new Error("invalid buffer length for BMFont");var t=h.every(function(t,i){return e.readUInt8(i)===t});if(!t)throw new Error("BMFont missing BMF byte header");var i=3,n=e.readUInt8(i++);if(n>3)throw new Error("Only supports BMFont Binary v3 (BMFont App v1.10)");for(var o={kernings:[],chars:[]},a=0;a<5;a++)i+=r(o,e,i);return o}},{}],31:[function(e,t,i){function r(e){var t=n(e);return t.reduce(function(e,t){var i=o(t.nodeName);return e[i]=t.nodeValue,e},{})}function n(e){for(var t=[],i=0;i<e.attributes.length;i++)t.push(e.attributes[i]);return t}function o(e){return c[e.toLowerCase()]||e}var a=e("./parse-attribs"),s=e("xml-parse-from-string"),c={scaleh:"scaleH",scalew:"scaleW",stretchh:"stretchH",lineheight:"lineHeight",alphachnl:"alphaChnl",redchnl:"redChnl",greenchnl:"greenChnl",bluechnl:"blueChnl"};t.exports=function(e){e=e.toString();var t=s(e),i={pages:[],chars:[],kernings:[]};["info","common"].forEach(function(e){var n=t.getElementsByTagName(e)[0];n&&(i[e]=a(r(n)))});var n=t.getElementsByTagName("pages")[0];if(!n)throw new Error("malformed file -- no <pages> element");for(var o=n.getElementsByTagName("page"),c=0;c<o.length;c++){var u=o[c],l=parseInt(u.getAttribute("id"),10),h=u.getAttribute("file");if(isNaN(l))throw new Error('malformed file -- page "id" attribute is NaN');if(!h)throw new Error('malformed file -- needs page "file" attribute');i.pages[parseInt(l,10)]=h}return["chars","kernings"].forEach(function(e){var n=t.getElementsByTagName(e)[0];if(n)for(var o=e.substring(0,e.length-1),s=n.getElementsByTagName(o),c=0;c<s.length;c++){var u=s[c];i[e].push(a(r(u)))}}),i}},{"./parse-attribs":32,"xml-parse-from-string":53}],32:[function(e,t,i){function r(e){return e.split(",").map(function(e){return parseInt(e,10)})}var n="chasrset";t.exports=function(e){n in e&&(e.charset=e[n],delete e[n]);for(var t in e)"face"!==t&&"charset"!==t&&("padding"===t||"spacing"===t?e[t]=r(e[t]):e[t]=parseInt(e[t],10));return e}},{}],33:[function(e,t,i){var r=e("trim"),n=e("for-each"),o=function(e){return"[object Array]"===Object.prototype.toString.call(e)};t.exports=function(e){if(!e)return{};var t={};return n(r(e).split("\n"),function(e){var i=e.indexOf(":"),n=r(e.slice(0,i)).toLowerCase(),a=r(e.slice(i+1));"undefined"==typeof t[n]?t[n]=a:o(t[n])?t[n].push(a):t[n]=[t[n],a]}),t}},{"for-each":19,trim:48}],34:[function(e,t,r){(function(e){var i=e.performance||{},r=function(){for(var e=["now","webkitNow","msNow","mozNow","oNow"];e.length;){var t=e.shift();if(t in i)return i[t].bind(i)}var r=Date.now||function(){return(new Date).getTime()},n=(i.timing||{}).navigationStart||r();return function(){return r()-n}}();r.performanceNow=i.now,r.noConflict=function(){i.now=r.performanceNow},r.conflict=function(){i.now=r},r.conflict(),t.exports=r}).call(this,"undefined"!=typeof i?i:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],35:[function(e,t,i){!function(e){function i(e,t){return function(){e.apply(t,arguments)}}function r(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],l(e,i(a,this),i(s,this))}function o(e){var t=this;return null===this._state?void this._deferreds.push(e):void d(function(){var i=t._state?e.onFulfilled:e.onRejected;if(null===i)return void(t._state?e.resolve:e.reject)(t._value);var r;try{r=i(t._value)}catch(t){return void e.reject(t)}e.resolve(r)})}function a(e){try{if(e===this)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var t=e.then;if("function"==typeof t)return void l(i(t,e),i(a,this),i(s,this))}this._state=!0,this._value=e,c.call(this)}catch(e){s.call(this,e)}}function s(e){this._state=!1,this._value=e,c.call(this)}function c(){for(var e=0,t=this._deferreds.length;e<t;e++)o.call(this,this._deferreds[e]);this._deferreds=null}function u(e,t,i,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=i,this.reject=r}function l(e,t,i){var r=!1;try{e(function(e){r||(r=!0,t(e))},function(e){r||(r=!0,i(e))})}catch(e){if(r)return;r=!0,i(e)}}var h=setTimeout,d="function"==typeof n&&n||function(e){h(e,1)},p=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};r.prototype.catch=function(e){return this.then(null,e)},r.prototype.then=function(e,t){var i=this;return new r(function(r,n){o.call(i,new u(e,t,r,n))})},r.all=function(){var e=Array.prototype.slice.call(1===arguments.length&&p(arguments[0])?arguments[0]:arguments);return new r(function(t,i){function r(o,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,function(e){r(o,e)},i)}e[o]=a,0===--n&&t(e)}catch(e){i(e)}}if(0===e.length)return t([]);for(var n=e.length,o=0;o<e.length;o++)r(o,e[o])})},r.resolve=function(e){return e&&"object"==typeof e&&e.constructor===r?e:new r(function(t){t(e)})},r.reject=function(e){return new r(function(t,i){i(e)})},r.race=function(e){return new r(function(t,i){for(var r=0,n=e.length;r<n;r++)e[r].then(t,i)})},r._setImmediateFn=function(e){d=e},"undefined"!=typeof t&&t.exports?t.exports=r:e.Promise||(e.Promise=r)}(this)},{}],36:[function(e,t,i){var r=e("dtype"),n=e("an-array"),o=e("is-buffer"),a=[0,2,3],s=[2,1,3];t.exports=function(e,t){e&&(n(e)||o(e))||(t=e||{},e=null),t="number"==typeof t?{count:t}:t||{};for(var i="string"==typeof t.type?t.type:"uint16",c="number"==typeof t.count?t.count:1,u=t.start||0,l=t.clockwise!==!1?a:s,h=l[0],d=l[1],p=l[2],f=6*c,m=e||new(r(i))(f),g=0,v=0;g<f;g+=6,v+=4){var y=g+u;m[y+0]=v+0,m[y+1]=v+1,m[y+2]=v+2,m[y+3]=v+h,m[y+4]=v+d,m[y+5]=v+p}return m}},{"an-array":1,dtype:17,"is-buffer":23}],37:[function(e,t,i){function r(e){var t=function(e){return e.trim()},i={};return n(e).map(t).filter(Boolean).forEach(function(e){var t=e.indexOf(":"),r=e.substr(0,t).trim(),n=e.substr(t+1).trim();i[r]=n}),i}function n(e){for(var t,i=[],r=0,n=";",o=/url\([^\)]+$/,a="";r<e.length;)t=e.indexOf(n,r),t===-1&&(t=e.length),a+=e.substring(r,t),o.test(a)?(a+=";",r=t+1):(i.push(a),a="",r=t+1);return i}function o(e){return Object.keys(e).map(function(t){return t+":"+e[t]}).join(";")}function a(e){return o(r(e))}t.exports.parse=r,t.exports.stringify=o,t.exports.normalize=a},{}],38:[function(e,t,i){function r(e){h.call(this),"string"==typeof e&&(e={text:e}),this._opt=c({},e),e&&this.update(e)}var n=e("layout-bmfont-text"),o=e("inherits"),a=e("quad-indices"),s=e("three-buffer-vertex-data"),c=e("object-assign"),u=e("./lib/vertices"),l=e("./lib/utils"),h=THREE.BufferGeometry;t.exports=function(e){return new r(e)},o(r,h),r.prototype.update=function(e){if("string"==typeof e&&(e={text:e}),e=c({},this._opt,e),!e.font)throw new TypeError("must specify a { font } in options");this.layout=n(e);var t=e.flipY!==!1,i=e.font,r=i.common.scaleW,o=i.common.scaleH,l=this.layout.glyphs.filter(function(e){var t=e.data;return t.width*t.height>0});this.visibleGlyphs=l;var h=u.positions(l),d=u.uvs(l,r,o,t),p=a({clockwise:!0,type:"uint16",count:l.length});if(s.index(this,p,1,"uint16"),s.attr(this,"position",h,2),s.attr(this,"uv",d,2),!e.multipage&&"page"in this.attributes)this.removeAttribute("page");else if(e.multipage){var f=u.pages(l);s.attr(this,"page",f,1)}},r.prototype.computeBoundingSphere=function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var e=this.attributes.position.array,t=this.attributes.position.itemSize;return!e||!t||e.length<2?(this.boundingSphere.radius=0,void this.boundingSphere.center.set(0,0,0)):(l.computeSphere(e,this.boundingSphere),void(isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')))},r.prototype.computeBoundingBox=function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var e=this.boundingBox,t=this.attributes.position.array,i=this.attributes.position.itemSize;return!t||!i||t.length<2?void e.makeEmpty():void l.computeBox(t,e)}},{"./lib/utils":39,"./lib/vertices":40,inherits:22,"layout-bmfont-text":25,"object-assign":28,"quad-indices":36,"three-buffer-vertex-data":41}],39:[function(e,t,i){function r(e){var t=e.length/n;o.min[0]=e[0],o.min[1]=e[1],o.max[0]=e[0],o.max[1]=e[1];for(var i=0;i<t;i++){var r=e[i*n+0],a=e[i*n+1];o.min[0]=Math.min(r,o.min[0]),o.min[1]=Math.min(a,o.min[1]),o.max[0]=Math.max(r,o.max[0]),o.max[1]=Math.max(a,o.max[1])}}var n=2,o={min:[0,0],max:[0,0]};t.exports.computeBox=function(e,t){r(e),t.min.set(o.min[0],o.min[1],0),t.max.set(o.max[0],o.max[1],0)},t.exports.computeSphere=function(e,t){r(e);var i=o.min[0],n=o.min[1],a=o.max[0],s=o.max[1],c=a-i,u=s-n,l=Math.sqrt(c*c+u*u);t.center.set(i+c/2,n+u/2,0),t.radius=l/2}},{}],40:[function(e,t,i){t.exports.pages=function e(t){var e=new Float32Array(4*t.length*1),i=0;return t.forEach(function(t){var r=t.data.page||0;e[i++]=r,e[i++]=r,e[i++]=r,e[i++]=r}),e},t.exports.uvs=function e(t,i,r,n){var e=new Float32Array(4*t.length*2),o=0;return t.forEach(function(t){var a=t.data,s=a.x+a.width,c=a.y+a.height,u=a.x/i,l=a.y/r,h=s/i,d=c/r;n&&(l=(r-a.y)/r,d=(r-c)/r),e[o++]=u,e[o++]=l,e[o++]=u,e[o++]=d,e[o++]=h,e[o++]=d,e[o++]=h,e[o++]=l}),e},t.exports.positions=function e(t){var e=new Float32Array(4*t.length*2),i=0;return t.forEach(function(t){var r=t.data,n=t.position[0]+r.xoffset,o=t.position[1]+r.yoffset,a=r.width,s=r.height;e[i++]=n,e[i++]=o,e[i++]=n,e[i++]=o+s,e[i++]=n+a,e[i++]=o+s,e[i++]=n+a,e[i++]=o}),e}},{}],41:[function(e,t,i){function r(e,t,i,r){"number"!=typeof i&&(i=1),"string"!=typeof r&&(r="uint16");var n=!e.index&&"function"!=typeof e.setIndex,a=n?e.getAttribute("index"):e.index,s=o(a,t,i,r);s&&(n?e.addAttribute("index",s):e.index=s)}function n(e,t,i,r,n){if("number"!=typeof r&&(r=3),"string"!=typeof n&&(n="float32"),Array.isArray(i)&&Array.isArray(i[0])&&i[0].length!==r)throw new Error("Nested vertex array has unexpected size; expected "+r+" but found "+i[0].length);var a=e.getAttribute(t),s=o(a,i,r,n);s&&e.addAttribute(t,s)}function o(e,t,i,r){if(t=t||[],!e||a(e,t,i)){t=s(t,r);var n=e&&"function"!=typeof e.setArray;return e&&!n||(n&&!c&&(c=!0,console.warn(["A WebGL buffer is being updated with a new size or itemSize, ","however this version of ThreeJS only supports fixed-size buffers.","\nThe old buffer may still be kept in memory.\n","To avoid memory leaks, it is recommended that you dispose ","your geometries and create new ones, or update to ThreeJS r82 or newer.\n","See here for discussion:\n","https://github.com/mrdoob/three.js/pull/9631"].join(""))),e=new THREE.BufferAttribute(t,i)),e.itemSize=i,e.needsUpdate=!0,"function"==typeof e.setArray&&e.setArray(t),e}return s(t,e.array),e.needsUpdate=!0,null}function a(e,t,i){if(e.itemSize!==i)return!0;if(!e.array)return!0;var r=e.array.length;return Array.isArray(t)&&Array.isArray(t[0])?r!==t.length*i:r!==t.length}var s=e("flatten-vertex-data"),c=!1;t.exports.attr=n,t.exports.index=r},{"flatten-vertex-data":18}],42:[function(e,i,r){!function(e,n){"object"==typeof r&&"undefined"!=typeof i?n(r):"function"==typeof t&&t.amd?t(["exports"],n):n(e.THREE=e.THREE||{})}(this,function(e){"use strict";function t(){}function i(e,t){this.x=e||0,this.y=t||0}function r(e,t,n,o,a,s,c,u,l,h){Object.defineProperty(this,"id",{value:Ka++}),this.uuid=Ja.generateUUID(),this.name="",this.image=void 0!==e?e:r.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:r.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:Qo,this.wrapT=void 0!==o?o:Qo,this.magFilter=void 0!==a?a:Zo,this.minFilter=void 0!==s?s:Ko,this.anisotropy=void 0!==l?l:1,this.format=void 0!==c?c:fa,this.type=void 0!==u?u:ea,this.offset=new i(0,0),this.repeat=new i(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==h?h:Fa,this.version=0,this.onUpdate=null}function n(e,t,i,r){this.x=e||0,this.y=t||0,this.z=i||0,this.w=void 0!==r?r:1}function o(e,t,i){this.uuid=Ja.generateUUID(),this.width=e,this.height=t,this.scissor=new n(0,0,e,t),this.scissorTest=!1,this.viewport=new n(0,0,e,t),i=i||{},void 0===i.minFilter&&(i.minFilter=Zo),this.texture=new r(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0===i.stencilBuffer||i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}function a(e,t,i){o.call(this,e,t,i),this.activeCubeFace=0,this.activeMipMapLevel=0;
  }function s(e,t,i,r){this._x=e||0,this._y=t||0,this._z=i||0,this._w=void 0!==r?r:1}function c(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0}function u(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function l(e,t,i,n,o,a,s,c,u,l){e=void 0!==e?e:[],t=void 0!==t?t:zo,r.call(this,e,t,i,n,o,a,s,c,u,l),this.flipY=!1}function h(){this.seq=[],this.map={}}function d(e,t,i){var r=e[0];if(r<=0||r>0)return e;var n=t*i,o=ts[n];if(void 0===o&&(o=new Float32Array(n),ts[n]=o),0!==t){r.toArray(o,0);for(var a=1,s=0;a!==t;++a)s+=i,e[a].toArray(o,s)}return o}function p(e,t){var i=is[t];void 0===i&&(i=new Int32Array(t),is[t]=i);for(var r=0;r!==t;++r)i[r]=e.allocTextureUnit();return i}function f(e,t){e.uniform1f(this.addr,t)}function m(e,t){e.uniform1i(this.addr,t)}function g(e,t){void 0===t.x?e.uniform2fv(this.addr,t):e.uniform2f(this.addr,t.x,t.y)}function v(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 y(e,t){void 0===t.x?e.uniform4fv(this.addr,t):e.uniform4f(this.addr,t.x,t.y,t.z,t.w)}function M(e,t){e.uniformMatrix2fv(this.addr,!1,t.elements||t)}function A(e,t){e.uniformMatrix3fv(this.addr,!1,t.elements||t)}function w(e,t){e.uniformMatrix4fv(this.addr,!1,t.elements||t)}function x(e,t,i){var r=i.allocTextureUnit();e.uniform1i(this.addr,r),i.setTexture2D(t||$a,r)}function E(e,t,i){var r=i.allocTextureUnit();e.uniform1i(this.addr,r),i.setTextureCube(t||es,r)}function b(e,t){e.uniform2iv(this.addr,t)}function T(e,t){e.uniform3iv(this.addr,t)}function L(e,t){e.uniform4iv(this.addr,t)}function N(e){switch(e){case 5126:return f;case 35664:return g;case 35665:return v;case 35666:return y;case 35674:return M;case 35675:return A;case 35676:return w;case 35678:return x;case 35680:return E;case 5124:case 35670:return m;case 35667:case 35671:return b;case 35668:case 35672:return T;case 35669:case 35673:return L}}function D(e,t){e.uniform1fv(this.addr,t)}function S(e,t){e.uniform1iv(this.addr,t)}function I(e,t){e.uniform2fv(this.addr,d(t,this.size,2))}function C(e,t){e.uniform3fv(this.addr,d(t,this.size,3))}function _(e,t){e.uniform4fv(this.addr,d(t,this.size,4))}function j(e,t){e.uniformMatrix2fv(this.addr,!1,d(t,this.size,4))}function O(e,t){e.uniformMatrix3fv(this.addr,!1,d(t,this.size,9))}function z(e,t){e.uniformMatrix4fv(this.addr,!1,d(t,this.size,16))}function R(e,t,i){var r=t.length,n=p(i,r);e.uniform1iv(this.addr,n);for(var o=0;o!==r;++o)i.setTexture2D(t[o]||$a,n[o])}function k(e,t,i){var r=t.length,n=p(i,r);e.uniform1iv(this.addr,n);for(var o=0;o!==r;++o)i.setTextureCube(t[o]||es,n[o])}function U(e){switch(e){case 5126:return D;case 35664:return I;case 35665:return C;case 35666:return _;case 35674:return j;case 35675:return O;case 35676:return z;case 35678:return R;case 35680:return k;case 5124:case 35670:return S;case 35667:case 35671:return b;case 35668:case 35672:return T;case 35669:case 35673:return L}}function P(e,t,i){this.id=e,this.addr=i,this.setValue=N(t.type)}function B(e,t,i){this.id=e,this.addr=i,this.size=t.size,this.setValue=U(t.type)}function F(e){this.id=e,h.call(this)}function G(e,t){e.seq.push(t),e.map[t.id]=t}function H(e,t,i){var r=e.name,n=r.length;for(rs.lastIndex=0;;){var o=rs.exec(r),a=rs.lastIndex,s=o[1],c="]"===o[2],u=o[3];if(c&&(s|=0),void 0===u||"["===u&&a+2===n){G(i,void 0===u?new P(s,e,t):new B(s,e,t));break}var l=i.map,h=l[s];void 0===h&&(h=new F(s),G(i,h)),i=h}}function Q(e,t,i){h.call(this),this.renderer=i;for(var r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n=0;n!==r;++n){var o=e.getActiveUniform(t,n),a=o.name,s=e.getUniformLocation(t,a);H(o,s,this)}}function Y(e,t,i){return void 0===t&&void 0===i?this.set(e):this.setRGB(e,t,i)}function V(e,t,i,n,o,a,s,c,u,l,h,d){r.call(this,null,a,s,c,u,l,n,o,h,d),this.image={data:e,width:t,height:i},this.magFilter=void 0!==u?u:Wo,this.minFilter=void 0!==l?l:Wo,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function W(e,t){this.min=void 0!==e?e:new i(+(1/0),+(1/0)),this.max=void 0!==t?t:new i(-(1/0),-(1/0))}function X(e,t){function r(){var e=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),t=new Uint16Array([0,1,2,0,2,3]);o=f.createBuffer(),a=f.createBuffer(),f.bindBuffer(f.ARRAY_BUFFER,o),f.bufferData(f.ARRAY_BUFFER,e,f.STATIC_DRAW),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,a),f.bufferData(f.ELEMENT_ARRAY_BUFFER,t,f.STATIC_DRAW),d=f.createTexture(),p=f.createTexture(),m.bindTexture(f.TEXTURE_2D,d),f.texImage2D(f.TEXTURE_2D,0,f.RGB,16,16,0,f.RGB,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.NEAREST),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.NEAREST),m.bindTexture(f.TEXTURE_2D,p),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,16,16,0,f.RGBA,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.NEAREST),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.NEAREST),s={vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","uniform sampler2D occlusionMap;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float vVisibility;","void main() {","vUV = uv;","vec2 pos = position;","if ( renderType == 2 ) {","vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );","vVisibility =        visibility.r / 9.0;","vVisibility *= 1.0 - visibility.g / 9.0;","vVisibility *=       visibility.b / 9.0;","vVisibility *= 1.0 - visibility.a / 9.0;","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join("\n"),fragmentShader:["uniform lowp int renderType;","uniform sampler2D map;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","varying float vVisibility;","void main() {","if ( renderType == 0 ) {","gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );","} else if ( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * vVisibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join("\n")},u=n(s),l={vertex:f.getAttribLocation(u,"position"),uv:f.getAttribLocation(u,"uv")},h={renderType:f.getUniformLocation(u,"renderType"),map:f.getUniformLocation(u,"map"),occlusionMap:f.getUniformLocation(u,"occlusionMap"),opacity:f.getUniformLocation(u,"opacity"),color:f.getUniformLocation(u,"color"),scale:f.getUniformLocation(u,"scale"),rotation:f.getUniformLocation(u,"rotation"),screenPosition:f.getUniformLocation(u,"screenPosition")}}function n(t){var i=f.createProgram(),r=f.createShader(f.FRAGMENT_SHADER),n=f.createShader(f.VERTEX_SHADER),o="precision "+e.getPrecision()+" float;\n";return f.shaderSource(r,o+t.fragmentShader),f.shaderSource(n,o+t.vertexShader),f.compileShader(r),f.compileShader(n),f.attachShader(i,r),f.attachShader(i,n),f.linkProgram(i),i}var o,a,s,u,l,h,d,p,f=e.context,m=e.state;this.render=function(n,s,g){if(0!==t.length){var v=new c,y=g.w/g.z,M=.5*g.z,A=.5*g.w,w=16/g.w,x=new i(w*y,w),E=new c(1,1,0),b=new i(1,1),T=new W;T.min.set(g.x,g.y),T.max.set(g.x+(g.z-16),g.y+(g.w-16)),void 0===u&&r(),f.useProgram(u),m.initAttributes(),m.enableAttribute(l.vertex),m.enableAttribute(l.uv),m.disableUnusedAttributes(),f.uniform1i(h.occlusionMap,0),f.uniform1i(h.map,1),f.bindBuffer(f.ARRAY_BUFFER,o),f.vertexAttribPointer(l.vertex,2,f.FLOAT,!1,16,0),f.vertexAttribPointer(l.uv,2,f.FLOAT,!1,16,8),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,a),m.disable(f.CULL_FACE),m.setDepthWrite(!1);for(var L=0,N=t.length;L<N;L++){w=16/g.w,x.set(w*y,w);var D=t[L];if(v.set(D.matrixWorld.elements[12],D.matrixWorld.elements[13],D.matrixWorld.elements[14]),v.applyMatrix4(s.matrixWorldInverse),v.applyProjection(s.projectionMatrix),E.copy(v),b.x=g.x+E.x*M+M-8,b.y=g.y+E.y*A+A-8,T.containsPoint(b)===!0){m.activeTexture(f.TEXTURE0),m.bindTexture(f.TEXTURE_2D,null),m.activeTexture(f.TEXTURE1),m.bindTexture(f.TEXTURE_2D,d),f.copyTexImage2D(f.TEXTURE_2D,0,f.RGB,b.x,b.y,16,16,0),f.uniform1i(h.renderType,0),f.uniform2f(h.scale,x.x,x.y),f.uniform3f(h.screenPosition,E.x,E.y,E.z),m.disable(f.BLEND),m.enable(f.DEPTH_TEST),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0),m.activeTexture(f.TEXTURE0),m.bindTexture(f.TEXTURE_2D,p),f.copyTexImage2D(f.TEXTURE_2D,0,f.RGBA,b.x,b.y,16,16,0),f.uniform1i(h.renderType,1),m.disable(f.DEPTH_TEST),m.activeTexture(f.TEXTURE1),m.bindTexture(f.TEXTURE_2D,d),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0),D.positionScreen.copy(E),D.customUpdateCallback?D.customUpdateCallback(D):D.updateLensFlares(),f.uniform1i(h.renderType,2),m.enable(f.BLEND);for(var S=0,I=D.lensFlares.length;S<I;S++){var C=D.lensFlares[S];C.opacity>.001&&C.scale>.001&&(E.x=C.x,E.y=C.y,E.z=C.z,w=C.size*C.scale/g.w,x.x=w*y,x.y=w,f.uniform3f(h.screenPosition,E.x,E.y,E.z),f.uniform2f(h.scale,x.x,x.y),f.uniform1f(h.rotation,C.rotation),f.uniform1f(h.opacity,C.opacity),f.uniform3f(h.color,C.color.r,C.color.g,C.color.b),m.setBlending(C.blending,C.blendEquation,C.blendSrc,C.blendDst),e.setTexture2D(C.texture,1),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0))}}}m.enable(f.CULL_FACE),m.enable(f.DEPTH_TEST),m.setDepthWrite(!0),e.resetGLState()}}}function q(e,t){function i(){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]);a=f.createBuffer(),u=f.createBuffer(),f.bindBuffer(f.ARRAY_BUFFER,a),f.bufferData(f.ARRAY_BUFFER,e,f.STATIC_DRAW),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,u),f.bufferData(f.ELEMENT_ARRAY_BUFFER,t,f.STATIC_DRAW),l=n(),h={position:f.getAttribLocation(l,"position"),uv:f.getAttribLocation(l,"uv")},d={uvOffset:f.getUniformLocation(l,"uvOffset"),uvScale:f.getUniformLocation(l,"uvScale"),rotation:f.getUniformLocation(l,"rotation"),scale:f.getUniformLocation(l,"scale"),color:f.getUniformLocation(l,"color"),map:f.getUniformLocation(l,"map"),opacity:f.getUniformLocation(l,"opacity"),modelViewMatrix:f.getUniformLocation(l,"modelViewMatrix"),projectionMatrix:f.getUniformLocation(l,"projectionMatrix"),fogType:f.getUniformLocation(l,"fogType"),fogDensity:f.getUniformLocation(l,"fogDensity"),fogNear:f.getUniformLocation(l,"fogNear"),fogFar:f.getUniformLocation(l,"fogFar"),fogColor:f.getUniformLocation(l,"fogColor"),alphaTest:f.getUniformLocation(l,"alphaTest")};var i=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");i.width=8,i.height=8;var o=i.getContext("2d");o.fillStyle="white",o.fillRect(0,0,8,8),p=new r(i),p.needsUpdate=!0}function n(){var t=f.createProgram(),i=f.createShader(f.VERTEX_SHADER),r=f.createShader(f.FRAGMENT_SHADER);return f.shaderSource(i,["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")),f.shaderSource(r,["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")),f.compileShader(i),f.compileShader(r),f.attachShader(t,i),f.attachShader(t,r),f.linkProgram(t),t}function o(e,t){return e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:t.id-e.id}var a,u,l,h,d,p,f=e.context,m=e.state,g=new c,v=new s,y=new c;this.render=function(r,n){if(0!==t.length){void 0===l&&i(),f.useProgram(l),m.initAttributes(),m.enableAttribute(h.position),m.enableAttribute(h.uv),m.disableUnusedAttributes(),m.disable(f.CULL_FACE),m.enable(f.BLEND),f.bindBuffer(f.ARRAY_BUFFER,a),f.vertexAttribPointer(h.position,2,f.FLOAT,!1,16,0),f.vertexAttribPointer(h.uv,2,f.FLOAT,!1,16,8),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,u),f.uniformMatrix4fv(d.projectionMatrix,!1,n.projectionMatrix.elements),m.activeTexture(f.TEXTURE0),f.uniform1i(d.map,0);var s=0,c=0,M=r.fog;M?(f.uniform3f(d.fogColor,M.color.r,M.color.g,M.color.b),M.isFog?(f.uniform1f(d.fogNear,M.near),f.uniform1f(d.fogFar,M.far),f.uniform1i(d.fogType,1),s=1,c=1):M.isFogExp2&&(f.uniform1f(d.fogDensity,M.density),f.uniform1i(d.fogType,2),s=2,c=2)):(f.uniform1i(d.fogType,0),s=0,c=0);for(var A=0,w=t.length;A<w;A++){var x=t[A];x.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,x.matrixWorld),x.z=-x.modelViewMatrix.elements[14]}t.sort(o);for(var E=[],A=0,w=t.length;A<w;A++){var x=t[A],b=x.material;if(b.visible!==!1){f.uniform1f(d.alphaTest,b.alphaTest),f.uniformMatrix4fv(d.modelViewMatrix,!1,x.modelViewMatrix.elements),x.matrixWorld.decompose(g,v,y),E[0]=y.x,E[1]=y.y;var T=0;r.fog&&b.fog&&(T=c),s!==T&&(f.uniform1i(d.fogType,T),s=T),null!==b.map?(f.uniform2f(d.uvOffset,b.map.offset.x,b.map.offset.y),f.uniform2f(d.uvScale,b.map.repeat.x,b.map.repeat.y)):(f.uniform2f(d.uvOffset,0,0),f.uniform2f(d.uvScale,1,1)),f.uniform1f(d.opacity,b.opacity),f.uniform3f(d.color,b.color.r,b.color.g,b.color.b),f.uniform1f(d.rotation,b.rotation),f.uniform2fv(d.scale,E),m.setBlending(b.blending,b.blendEquation,b.blendSrc,b.blendDst),m.setDepthTest(b.depthTest),m.setDepthWrite(b.depthWrite),b.map?e.setTexture2D(b.map,0):e.setTexture2D(p,0),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0)}}m.enable(f.CULL_FACE),e.resetGLState()}}}function Z(){Object.defineProperty(this,"id",{value:su++}),this.uuid=Ja.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=qn,this.side=Bn,this.shading=Qn,this.vertexColors=Yn,this.opacity=1,this.transparent=!1,this.blendSrc=lo,this.blendDst=ho,this.blendEquation=to,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=wo,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this._needsUpdate=!0}function J(e){Z.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,void 0!==e&&(void 0!==e.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(e))}function K(e){Z.call(this),this.type="MeshDepthMaterial",this.depthPacking=qa,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(e)}function $(e,t){this.min=void 0!==e?e:new c(+(1/0),+(1/0),+(1/0)),this.max=void 0!==t?t:new c(-(1/0),-(1/0),-(1/0))}function ee(e,t){this.center=void 0!==e?e:new c,this.radius=void 0!==t?t:0}function te(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function ie(e,t){this.normal=void 0!==e?e:new c(1,0,0),this.constant=void 0!==t?t:0}function re(e,t,i,r,n,o){this.planes=[void 0!==e?e:new ie,void 0!==t?t:new ie,void 0!==i?i:new ie,void 0!==r?r:new ie,void 0!==n?n:new ie,void 0!==o?o:new ie]}function ne(e,t,r,a){function s(t,i,r,n){var o=t.geometry,a=null,s=b,c=t.customDepthMaterial;if(r&&(s=T,c=t.customDistanceMaterial),c)a=c;else{var u=!1;i.morphTargets&&(o&&o.isBufferGeometry?u=o.morphAttributes&&o.morphAttributes.position&&o.morphAttributes.position.length>0:o&&o.isGeometry&&(u=o.morphTargets&&o.morphTargets.length>0));var l=t.isSkinnedMesh&&i.skinning,h=0;u&&(h|=w),l&&(h|=x),a=s[h]}if(e.localClippingEnabled&&i.clipShadows===!0&&0!==i.clippingPlanes.length){var d=a.uuid,p=i.uuid,f=L[d];void 0===f&&(f={},L[d]=f);var m=f[p];void 0===m&&(m=a.clone(),f[p]=m),a=m}a.visible=i.visible,a.wireframe=i.wireframe;var g=i.side;return U.renderSingleSided&&g==Gn&&(g=Bn),U.renderReverseSided&&(g===Bn?g=Fn:g===Fn&&(g=Bn)),a.side=g,a.clipShadows=i.clipShadows,a.clippingPlanes=i.clippingPlanes,a.wireframeLinewidth=i.wireframeLinewidth,a.linewidth=i.linewidth,r&&void 0!==a.uniforms.lightPos&&a.uniforms.lightPos.value.copy(n),a}function l(e,t,i){if(e.visible!==!1){var r=0!==(e.layers.mask&t.layers.mask);if(r&&(e.isMesh||e.isLine||e.isPoints)&&e.castShadow&&(e.frustumCulled===!1||p.intersectsObject(e)===!0)){var n=e.material;n.visible===!0&&(e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,e.matrixWorld),A.push(e))}for(var o=e.children,a=0,s=o.length;a<s;a++)l(o[a],t,i)}}var h=e.context,d=e.state,p=new re,f=new u,m=t.shadows,g=new i,v=new i(a.maxTextureSize,a.maxTextureSize),y=new c,M=new c,A=[],w=1,x=2,E=(w|x)+1,b=new Array(E),T=new Array(E),L={},N=[new c(1,0,0),new c(-1,0,0),new c(0,0,1),new c(0,0,-1),new c(0,1,0),new c(0,-1,0)],D=[new c(0,1,0),new c(0,1,0),new c(0,1,0),new c(0,1,0),new c(0,0,1),new c(0,0,-1)],S=[new n,new n,new n,new n,new n,new n],I=new K;I.depthPacking=Za,I.clipping=!0;for(var C=au.distanceRGBA,_=ns.clone(C.uniforms),j=0;j!==E;++j){var O=0!==(j&w),z=0!==(j&x),R=I.clone();R.morphTargets=O,R.skinning=z,b[j]=R;var k=new J({defines:{USE_SHADOWMAP:""},uniforms:_,vertexShader:C.vertexShader,fragmentShader:C.fragmentShader,morphTargets:O,skinning:z,clipping:!0});T[j]=k}var U=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Un,this.renderReverseSided=!0,this.renderSingleSided=!0,this.render=function(t,i){if(U.enabled!==!1&&(U.autoUpdate!==!1||U.needsUpdate!==!1)&&0!==m.length){d.buffers.color.setClear(1,1,1,1),d.disable(h.BLEND),d.setDepthTest(!0),d.setScissorTest(!1);for(var n,a,c=0,u=m.length;c<u;c++){var w=m[c],x=w.shadow;if(void 0!==x){var E=x.camera;if(g.copy(x.mapSize),g.min(v),w&&w.isPointLight){n=6,a=!0;var b=g.x,T=g.y;S[0].set(2*b,T,b,T),S[1].set(0,T,b,T),S[2].set(3*b,T,b,T),S[3].set(b,T,b,T),S[4].set(3*b,0,b,T),S[5].set(b,0,b,T),g.x*=4,g.y*=2}else n=1,a=!1;if(null===x.map){var L={minFilter:Wo,magFilter:Wo,format:fa};x.map=new o(g.x,g.y,L),E.updateProjectionMatrix()}x.isSpotLightShadow&&x.update(w),x&&x.isRectAreaLightShadow&&x.update(w);var I=x.map,C=x.matrix;M.setFromMatrixPosition(w.matrixWorld),E.position.copy(M),e.setRenderTarget(I),e.clear();for(var _=0;_<n;_++){if(a){y.copy(E.position),y.add(N[_]),E.up.copy(D[_]),E.lookAt(y);var j=S[_];d.viewport(j)}else y.setFromMatrixPosition(w.target.matrixWorld),E.lookAt(y);E.updateMatrixWorld(),E.matrixWorldInverse.getInverse(E.matrixWorld),C.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),C.multiply(E.projectionMatrix),C.multiply(E.matrixWorldInverse),f.multiplyMatrices(E.projectionMatrix,E.matrixWorldInverse),p.setFromMatrix(f),A.length=0,l(t,i,E);for(var O=0,z=A.length;O<z;O++){var R=A[O],k=r.update(R),P=R.material;if(P&&P.isMultiMaterial)for(var B=k.groups,F=P.materials,G=0,H=B.length;G<H;G++){var Q=B[G],Y=F[Q.materialIndex];if(Y.visible===!0){var V=s(R,Y,a,M);e.renderBufferDirect(E,null,k,V,R,Q)}}else{var V=s(R,P,a,M);e.renderBufferDirect(E,null,k,V,R,null)}}}}else console.warn("THREE.WebGLShadowMap:",w,"has no shadow.")}var W=e.getClearColor(),X=e.getClearAlpha();e.setClearColor(W,X),U.needsUpdate=!1}}}function oe(e,t){this.origin=void 0!==e?e:new c,this.direction=void 0!==t?t:new c}function ae(e,t,i,r){this._x=e||0,this._y=t||0,this._z=i||0,this._order=r||ae.DefaultOrder}function se(){this.mask=1}function ce(){function e(){n.setFromEuler(r,!1)}function t(){r.setFromQuaternion(n,void 0,!1)}Object.defineProperty(this,"id",{value:cu++}),this.uuid=Ja.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=ce.DefaultUp.clone();var i=new c,r=new ae,n=new s,o=new c(1,1,1);r.onChange(e),n.onChange(t),Object.defineProperties(this,{position:{enumerable:!0,value:i},rotation:{enumerable:!0,value:r},quaternion:{enumerable:!0,value:n},scale:{enumerable:!0,value:o},modelViewMatrix:{value:new u},normalMatrix:{value:new te}}),this.matrix=new u,this.matrixWorld=new u,this.matrixAutoUpdate=ce.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new se,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={},this.onBeforeRender=function(){},this.onAfterRender=function(){}}function ue(e,t){this.start=void 0!==e?e:new c,this.end=void 0!==t?t:new c}function le(e,t,i){this.a=void 0!==e?e:new c,this.b=void 0!==t?t:new c,this.c=void 0!==i?i:new c}function he(e,t,i,r,n,o){this.a=e,this.b=t,this.c=i,this.normal=r&&r.isVector3?r:new c,this.vertexNormals=Array.isArray(r)?r:[],this.color=n&&n.isColor?n:new Y,this.vertexColors=Array.isArray(n)?n:[],this.materialIndex=void 0!==o?o:0}function de(e){Z.call(this),this.type="MeshBasicMaterial",this.color=new Y(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Lo,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.lights=!1,this.setValues(e)}function pe(e,t,i){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.uuid=Ja.generateUUID(),this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=i===!0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function fe(e,t){pe.call(this,new Int8Array(e),t)}function me(e,t){pe.call(this,new Uint8Array(e),t)}function ge(e,t){pe.call(this,new Uint8ClampedArray(e),t)}function ve(e,t){pe.call(this,new Int16Array(e),t)}function ye(e,t){pe.call(this,new Uint16Array(e),t)}function Me(e,t){pe.call(this,new Int32Array(e),t)}function Ae(e,t){pe.call(this,new Uint32Array(e),t)}function we(e,t){pe.call(this,new Float32Array(e),t)}function xe(e,t){pe.call(this,new Float64Array(e),t)}function Ee(){this.indices=[],this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function be(){Object.defineProperty(this,"id",{value:Te()}),this.uuid=Ja.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(){return uu++}function Le(){Object.defineProperty(this,"id",{value:Te()}),this.uuid=Ja.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 Ne(e,t){ce.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new Le,this.material=void 0!==t?t:new de({color:16777215*Math.random()}),this.drawMode=Ua,this.updateMorphTargets()}function De(e,t,i,r,n,o){function a(e,t,i){var r=0;return r+=(e+1)*(t+1)*2,r+=(e+1)*(i+1)*2,r+=(i+1)*(t+1)*2}function s(e,t,i){var r=0;return r+=e*t*2,r+=e*i*2,r+=i*t*2,6*r}function u(e,t,i,r,n,o,a,s,u,h,d){for(var x=o/u,E=a/h,b=o/2,T=a/2,L=s/2,N=u+1,D=h+1,S=0,I=0,C=new c,_=0;_<D;_++)for(var j=_*E-T,O=0;O<N;O++){var z=O*x-b;C[e]=z*r,C[t]=j*n,C[i]=L,f[v]=C.x,f[v+1]=C.y,f[v+2]=C.z,C[e]=0,C[t]=0,C[i]=s>0?1:-1,m[v]=C.x,m[v+1]=C.y,m[v+2]=C.z,g[y]=O/u,g[y+1]=1-_/h,v+=3,y+=2,S+=1}for(_=0;_<h;_++)for(O=0;O<u;O++){var R=A+O+N*_,k=A+O+N*(_+1),U=A+(O+1)+N*(_+1),P=A+(O+1)+N*_;p[M]=R,p[M+1]=k,p[M+2]=P,p[M+3]=k,p[M+4]=U,p[M+5]=P,M+=6,I+=6}l.addGroup(w,I,d),w+=I,A+=S}Le.call(this),this.type="BoxBufferGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:n,depthSegments:o};var l=this;r=Math.floor(r)||1,n=Math.floor(n)||1,o=Math.floor(o)||1;var h=a(r,n,o),d=s(r,n,o),p=new(d>65535?Uint32Array:Uint16Array)(d),f=new Float32Array(3*h),m=new Float32Array(3*h),g=new Float32Array(2*h),v=0,y=0,M=0,A=0,w=0;u("z","y","x",-1,-1,i,t,e,o,n,0),u("z","y","x",1,-1,i,t,-e,o,n,1),u("x","z","y",1,1,e,i,t,r,o,2),u("x","z","y",1,-1,e,i,-t,r,o,3),u("x","y","z",1,-1,e,t,i,r,n,4),u("x","y","z",-1,-1,e,t,-i,r,n,5),this.setIndex(new pe(p,1)),this.addAttribute("position",new pe(f,3)),this.addAttribute("normal",new pe(m,3)),this.addAttribute("uv",new pe(g,2))}function Se(e,t,i,r){Le.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r};for(var n=e/2,o=t/2,a=Math.floor(i)||1,s=Math.floor(r)||1,c=a+1,u=s+1,l=e/a,h=t/s,d=new Float32Array(c*u*3),p=new Float32Array(c*u*3),f=new Float32Array(c*u*2),m=0,g=0,v=0;v<u;v++)for(var y=v*h-o,M=0;M<c;M++){var A=M*l-n;d[m]=A,d[m+1]=-y,p[m+2]=1,f[g]=M/a,f[g+1]=1-v/s,m+=3,g+=2}m=0;for(var w=new(d.length/3>65535?Uint32Array:Uint16Array)(a*s*6),v=0;v<s;v++)for(var M=0;M<a;M++){var x=M+c*v,E=M+c*(v+1),b=M+1+c*(v+1),T=M+1+c*v;w[m]=x,w[m+1]=E,w[m+2]=T,w[m+3]=E,w[m+4]=b,w[m+5]=T,m+=6}this.setIndex(new pe(w,1)),this.addAttribute("position",new pe(d,3)),this.addAttribute("normal",new pe(p,3)),this.addAttribute("uv",new pe(f,2))}function Ie(){ce.call(this),this.type="Camera",this.matrixWorldInverse=new u,this.projectionMatrix=new u}function Ce(e,t,i,r){Ie.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==i?i:.1,this.far=void 0!==r?r:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function _e(e,t,i,r,n,o){Ie.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=i,this.bottom=r,this.near=void 0!==n?n:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}function je(e,t,i){function r(e){s=e}function n(i){i.array instanceof Uint32Array&&t.get("OES_element_index_uint")?(c=e.UNSIGNED_INT,u=4):i.array instanceof Uint16Array?(c=e.UNSIGNED_SHORT,u=2):(c=e.UNSIGNED_BYTE,u=1)}function o(t,r){e.drawElements(s,r,c,t*u),i.calls++,i.vertices+=r,s===e.TRIANGLES&&(i.faces+=r/3)}function a(r,n,o){var a=t.get("ANGLE_instanced_arrays");return null===a?void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."):(a.drawElementsInstancedANGLE(s,o,c,n*u,r.maxInstancedCount),i.calls++,i.vertices+=o*r.maxInstancedCount,void(s===e.TRIANGLES&&(i.faces+=r.maxInstancedCount*o/3)))}var s,c,u;return{setMode:r,setIndex:n,render:o,renderInstances:a}}function Oe(e,t,i){function r(e){a=e}function n(t,r){e.drawArrays(a,t,r),i.calls++,i.vertices+=r,a===e.TRIANGLES&&(i.faces+=r/3)}function o(r){var n=t.get("ANGLE_instanced_arrays");if(null===n)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");var o=r.attributes.position,s=0;o.isInterleavedBufferAttribute?(s=o.data.count,n.drawArraysInstancedANGLE(a,0,s,r.maxInstancedCount)):(s=o.count,n.drawArraysInstancedANGLE(a,0,s,r.maxInstancedCount)),i.calls++,i.vertices+=s*r.maxInstancedCount,a===e.TRIANGLES&&(i.faces+=r.maxInstancedCount*s/3)}var a;return{setMode:r,render:n,renderInstances:o}}function ze(){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 c,color:new Y,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i};break;case"SpotLight":r={position:new c,direction:new c,color:new Y,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i};break;case"PointLight":r={position:new c,color:new Y,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new i};break;case"HemisphereLight":r={direction:new c,skyColor:new Y,groundColor:new Y};break;case"RectAreaLight":r={color:new Y,position:new c,halfWidth:new c,halfHeight:new c}}return e[t.id]=r,r}}}function Re(e){for(var t=e.split("\n"),i=0;i<t.length;i++)t[i]=i+1+": "+t[i];return t.join("\n")}function ke(e,t,i){var r=e.createShader(t);return e.shaderSource(r,i),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)===!1&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==e.getShaderInfoLog(r)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",t===e.VERTEX_SHADER?"vertex":"fragment",e.getShaderInfoLog(r),Re(i)),r}function Ue(e){switch(e){case Fa:return["Linear","( value )"];case Ga:return["sRGB","( value )"];case Qa:return["RGBE","( value )"];case Va:return["RGBM","( value, 7.0 )"];case Wa:return["RGBM","( value, 16.0 )"];case Xa:return["RGBD","( value, 256.0 )"];case Ha:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+e)}}function Pe(e,t){var i=Ue(t);return"vec4 "+e+"( vec4 value ) { return "+i[0]+"ToLinear"+i[1]+"; }"}function Be(e,t){var i=Ue(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function Fe(e,t){var i;switch(t){case Io:i="Linear";break;case Co:i="Reinhard";break;case _o:i="Uncharted2";break;case jo:i="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function Ge(e,t,i){e=e||{};var r=[e.derivatives||t.envMapCubeUV||t.bumpMap||t.normalMap||t.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(e.fragDepth||t.logarithmicDepthBuffer)&&i.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",e.drawBuffers&&i.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(e.shaderTextureLOD||t.envMap)&&i.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""];
  return r.filter(Ye).join("\n")}function He(e){var t=[];for(var i in e){var r=e[i];r!==!1&&t.push("#define "+i+" "+r)}return t.join("\n")}function Qe(e,t,i){for(var r={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),o=0;o<n;o++){var a=e.getActiveAttrib(t,o),s=a.name;r[s]=e.getAttribLocation(t,s)}return r}function Ye(e){return""!==e}function Ve(e,t){return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights)}function We(e){function t(e,t){var i=ru[t];if(void 0===i)throw new Error("Can not resolve #include <"+t+">");return We(i)}var i=/#include +<([\w\d.]+)>/g;return e.replace(i,t)}function Xe(e){function t(e,t,i,r){for(var n="",o=parseInt(t);o<parseInt(i);o++)n+=r.replace(/\[ i \]/g,"[ "+o+" ]");return n}var i=/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;return e.replace(i,t)}function qe(e,t,i,r){var n=e.context,o=i.extensions,a=i.defines,s=i.__webglShader.vertexShader,c=i.__webglShader.fragmentShader,u="SHADOWMAP_TYPE_BASIC";r.shadowMapType===Un?u="SHADOWMAP_TYPE_PCF":r.shadowMapType===Pn&&(u="SHADOWMAP_TYPE_PCF_SOFT");var l="ENVMAP_TYPE_CUBE",h="ENVMAP_MODE_REFLECTION",d="ENVMAP_BLENDING_MULTIPLY";if(r.envMap){switch(i.envMap.mapping){case zo:case Ro:l="ENVMAP_TYPE_CUBE";break;case Bo:case Fo:l="ENVMAP_TYPE_CUBE_UV";break;case ko:case Uo:l="ENVMAP_TYPE_EQUIREC";break;case Po:l="ENVMAP_TYPE_SPHERE"}switch(i.envMap.mapping){case Ro:case Uo:h="ENVMAP_MODE_REFRACTION"}switch(i.combine){case Lo:d="ENVMAP_BLENDING_MULTIPLY";break;case No:d="ENVMAP_BLENDING_MIX";break;case Do:d="ENVMAP_BLENDING_ADD"}}var p,f,m=e.gammaFactor>0?e.gammaFactor:1,g=Ge(o,r,e.extensions),v=He(a),y=n.createProgram();i.isRawShaderMaterial?(p=[v,"\n"].filter(Ye).join("\n"),f=[g,v,"\n"].filter(Ye).join("\n")):(p=["precision "+r.precision+" float;","precision "+r.precision+" int;","#define SHADER_NAME "+i.__webglShader.name,v,r.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+m,"#define MAX_BONES "+r.maxBones,r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+h:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.displacementMap&&r.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.vertexColors?"#define USE_COLOR":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.useVertexTexture?"#define BONE_TEXTURE":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&r.flatShading===!1?"#define USE_MORPHNORMALS":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+r.numClippingPlanes,r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+u:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.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(Ye).join("\n"),f=[g,"precision "+r.precision+" float;","precision "+r.precision+" int;","#define SHADER_NAME "+i.__webglShader.name,v,r.alphaTest?"#define ALPHATEST "+r.alphaTest:"","#define GAMMA_FACTOR "+m,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+l:"",r.envMap?"#define "+h:"",r.envMap?"#define "+d:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.vertexColors?"#define USE_COLOR":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+r.numClippingPlanes,"#define UNION_CLIPPING_PLANES "+(r.numClippingPlanes-r.numClipIntersection),r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+u:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&e.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",r.envMap&&e.extensions.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",r.toneMapping!==So?"#define TONE_MAPPING":"",r.toneMapping!==So?ru.tonemapping_pars_fragment:"",r.toneMapping!==So?Fe("toneMapping",r.toneMapping):"",r.outputEncoding||r.mapEncoding||r.envMapEncoding||r.emissiveMapEncoding?ru.encodings_pars_fragment:"",r.mapEncoding?Pe("mapTexelToLinear",r.mapEncoding):"",r.envMapEncoding?Pe("envMapTexelToLinear",r.envMapEncoding):"",r.emissiveMapEncoding?Pe("emissiveMapTexelToLinear",r.emissiveMapEncoding):"",r.outputEncoding?Be("linearToOutputTexel",r.outputEncoding):"",r.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(Ye).join("\n")),s=We(s,r),s=Ve(s,r),c=We(c,r),c=Ve(c,r),i.isShaderMaterial||(s=Xe(s),c=Xe(c));var M=p+s,A=f+c,w=ke(n,n.VERTEX_SHADER,M),x=ke(n,n.FRAGMENT_SHADER,A);n.attachShader(y,w),n.attachShader(y,x),void 0!==i.index0AttributeName?n.bindAttribLocation(y,0,i.index0AttributeName):r.morphTargets===!0&&n.bindAttribLocation(y,0,"position"),n.linkProgram(y);var E=n.getProgramInfoLog(y),b=n.getShaderInfoLog(w),T=n.getShaderInfoLog(x),L=!0,N=!0;n.getProgramParameter(y,n.LINK_STATUS)===!1?(L=!1,console.error("THREE.WebGLProgram: shader error: ",n.getError(),"gl.VALIDATE_STATUS",n.getProgramParameter(y,n.VALIDATE_STATUS),"gl.getProgramInfoLog",E,b,T)):""!==E?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",E):""!==b&&""!==T||(N=!1),N&&(this.diagnostics={runnable:L,material:i,programLog:E,vertexShader:{log:b,prefix:p},fragmentShader:{log:T,prefix:f}}),n.deleteShader(w),n.deleteShader(x);var D;this.getUniforms=function(){return void 0===D&&(D=new Q(n,y,e)),D};var S;return this.getAttributes=function(){return void 0===S&&(S=Qe(n,y)),S},this.destroy=function(){n.deleteProgram(y),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=lu++,this.code=t,this.usedTimes=1,this.program=y,this.vertexShader=w,this.fragmentShader=x,this}function Ze(e,t){function i(e){if(t.floatVertexTextures&&e&&e.skeleton&&e.skeleton.useVertexTexture)return 1024;var i=t.maxVertexUniforms,r=Math.floor((i-20)/4),n=r;return void 0!==e&&e&&e.isSkinnedMesh&&(n=Math.min(e.skeleton.bones.length,n),n<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+n+" (try OpenGL instead of ANGLE)")),n}function r(e,t){var i;return e?e.isTexture?i=e.encoding:e.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),i=e.texture.encoding):i=Fa,i===Fa&&t&&(i=Ha),i}var n=[],o={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"},a=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking"];this.getParameters=function(n,a,s,c,u,l){var h=o[n.type],d=i(l),p=e.getPrecision();null!==n.precision&&(p=t.getMaxPrecision(n.precision),p!==n.precision&&console.warn("THREE.WebGLProgram.getParameters:",n.precision,"not supported, using",p,"instead."));var f=e.getCurrentRenderTarget(),m={shaderID:h,precision:p,supportsVertexTextures:t.vertexTextures,outputEncoding:r(f?f.texture:null,e.gammaOutput),map:!!n.map,mapEncoding:r(n.map,e.gammaInput),envMap:!!n.envMap,envMapMode:n.envMap&&n.envMap.mapping,envMapEncoding:r(n.envMap,e.gammaInput),envMapCubeUV:!!n.envMap&&(n.envMap.mapping===Bo||n.envMap.mapping===Fo),lightMap:!!n.lightMap,aoMap:!!n.aoMap,emissiveMap:!!n.emissiveMap,emissiveMapEncoding:r(n.emissiveMap,e.gammaInput),bumpMap:!!n.bumpMap,normalMap:!!n.normalMap,displacementMap:!!n.displacementMap,roughnessMap:!!n.roughnessMap,metalnessMap:!!n.metalnessMap,specularMap:!!n.specularMap,alphaMap:!!n.alphaMap,gradientMap:!!n.gradientMap,combine:n.combine,vertexColors:n.vertexColors,fog:!!s,useFog:n.fog,fogExp:s&&s.isFogExp2,flatShading:n.shading===Hn,sizeAttenuation:n.sizeAttenuation,logarithmicDepthBuffer:t.logarithmicDepthBuffer,skinning:n.skinning,maxBones:d,useVertexTexture:t.floatVertexTextures&&l&&l.skeleton&&l.skeleton.useVertexTexture,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:c,numClipIntersection:u,shadowMapEnabled:e.shadowMap.enabled&&l.receiveShadow&&a.shadows.length>0,shadowMapType:e.shadowMap.type,toneMapping:e.toneMapping,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:n.premultipliedAlpha,alphaTest:n.alphaTest,doubleSided:n.side===Gn,flipSided:n.side===Fn,depthPacking:void 0!==n.depthPacking&&n.depthPacking};return m},this.getProgramCode=function(e,t){var i=[];if(t.shaderID?i.push(t.shaderID):(i.push(e.fragmentShader),i.push(e.vertexShader)),void 0!==e.defines)for(var r in e.defines)i.push(r),i.push(e.defines[r]);for(var n=0;n<a.length;n++)i.push(t[a[n]]);return i.join()},this.acquireProgram=function(t,i,r){for(var o,a=0,s=n.length;a<s;a++){var c=n[a];if(c.code===r){o=c,++o.usedTimes;break}}return void 0===o&&(o=new qe(e,r,t,i),n.push(o)),o},this.releaseProgram=function(e){if(0===--e.usedTimes){var t=n.indexOf(e);n[t]=n[n.length-1],n.pop(),e.destroy()}},this.programs=n}function Je(e,t,i){function r(e){var n=e.target,s=c[n.id];null!==s.index&&o(s.index),a(s.attributes),n.removeEventListener("dispose",r),delete c[n.id];var u=t.get(n);u.wireframe&&o(u.wireframe),t.delete(n);var l=t.get(s);l.wireframe&&o(l.wireframe),t.delete(s),i.memory.geometries--}function n(e){return e.isInterleavedBufferAttribute?t.get(e.data).__webglBuffer:t.get(e).__webglBuffer}function o(t){var i=n(t);void 0!==i&&(e.deleteBuffer(i),s(t))}function a(e){for(var t in e)o(e[t])}function s(e){e.isInterleavedBufferAttribute?t.delete(e.data):t.delete(e)}var c={};return{get:function(e){var t=e.geometry;if(void 0!==c[t.id])return c[t.id];t.addEventListener("dispose",r);var n;return t.isBufferGeometry?n=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new Le).setFromObject(e)),n=t._bufferGeometry),c[t.id]=n,i.memory.geometries++,n}}}function Ke(e,t,i){function r(t){var i=l.get(t);t.geometry.isGeometry&&i.updateFromObject(t);var r=i.index,o=i.attributes;null!==r&&n(r,e.ELEMENT_ARRAY_BUFFER);for(var a in o)n(o[a],e.ARRAY_BUFFER);var s=i.morphAttributes;for(var a in s)for(var c=s[a],u=0,h=c.length;u<h;u++)n(c[u],e.ARRAY_BUFFER);return i}function n(e,i){var r=e.isInterleavedBufferAttribute?e.data:e,n=t.get(r);void 0===n.__webglBuffer?o(n,r,i):n.version!==r.version&&a(n,r,i)}function o(t,i,r){t.__webglBuffer=e.createBuffer(),e.bindBuffer(r,t.__webglBuffer);var n=i.dynamic?e.DYNAMIC_DRAW:e.STATIC_DRAW;e.bufferData(r,i.array,n);var o=e.FLOAT,a=i.array;a instanceof Float32Array?o=e.FLOAT:a instanceof Float64Array?console.warn("Unsupported data buffer format: Float64Array"):a instanceof Uint16Array?o=e.UNSIGNED_SHORT:a instanceof Int16Array?o=e.SHORT:a instanceof Uint32Array?o=e.UNSIGNED_INT:a instanceof Int32Array?o=e.INT:a instanceof Int8Array?o=e.BYTE:a instanceof Uint8Array&&(o=e.UNSIGNED_BYTE),t.bytesPerElement=a.BYTES_PER_ELEMENT,t.type=o,t.version=i.version,i.onUploadCallback()}function a(t,i,r){e.bindBuffer(r,t.__webglBuffer),i.dynamic===!1?e.bufferData(r,i.array,e.STATIC_DRAW):i.updateRange.count===-1?e.bufferSubData(r,0,i.array):0===i.updateRange.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(e.bufferSubData(r,i.updateRange.offset*i.array.BYTES_PER_ELEMENT,i.array.subarray(i.updateRange.offset,i.updateRange.offset+i.updateRange.count)),i.updateRange.count=0),t.version=i.version}function s(e){return e.isInterleavedBufferAttribute?t.get(e.data).__webglBuffer:t.get(e).__webglBuffer}function c(e){return e.isInterleavedBufferAttribute?t.get(e.data):t.get(e)}function u(i){var r=t.get(i);if(void 0!==r.wireframe)return r.wireframe;var o=[],a=i.index,s=i.attributes,c=s.position;if(null!==a)for(var u=a.array,l=0,h=u.length;l<h;l+=3){var d=u[l+0],p=u[l+1],f=u[l+2];o.push(d,p,p,f,f,d)}else for(var u=s.position.array,l=0,h=u.length/3-1;l<h;l+=3){var d=l+0,p=l+1,f=l+2;o.push(d,p,p,f,f,d)}var m=c.count>65535?Uint32Array:Uint16Array,g=new pe(new m(o),1);return n(g,e.ELEMENT_ARRAY_BUFFER),r.wireframe=g,g}var l=new Je(e,t,i);return{getAttributeBuffer:s,getAttributeProperties:c,getWireframeAttribute:u,update:r}}function $e(e,t,i,r,n,o,a){function s(e,t){if(e.width>t||e.height>t){var i=t/Math.max(e.width,e.height),r=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");r.width=Math.floor(e.width*i),r.height=Math.floor(e.height*i);var n=r.getContext("2d");return n.drawImage(e,0,0,e.width,e.height,0,0,r.width,r.height),console.warn("THREE.WebGLRenderer: image is too big ("+e.width+"x"+e.height+"). Resized to "+r.width+"x"+r.height,e),r}return e}function c(e){return Ja.isPowerOfTwo(e.width)&&Ja.isPowerOfTwo(e.height)}function u(e){if(e instanceof HTMLImageElement||e instanceof HTMLCanvasElement){var t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");t.width=Ja.nearestPowerOfTwo(e.width),t.height=Ja.nearestPowerOfTwo(e.height);var i=t.getContext("2d");return i.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}function l(e){return e.wrapS!==Qo||e.wrapT!==Qo||e.minFilter!==Wo&&e.minFilter!==Zo}function h(t){return t===Wo||t===Xo||t===qo?e.NEAREST:e.LINEAR}function d(e){var t=e.target;t.removeEventListener("dispose",d),f(t),N.textures--}function p(e){var t=e.target;t.removeEventListener("dispose",p),m(t),N.textures--}function f(t){var i=r.get(t);if(t.image&&i.__image__webglTextureCube)e.deleteTexture(i.__image__webglTextureCube);else{if(void 0===i.__webglInit)return;e.deleteTexture(i.__webglTexture)}r.delete(t)}function m(t){var i=r.get(t),n=r.get(t.texture);if(t){if(void 0!==n.__webglTexture&&e.deleteTexture(n.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLRenderTargetCube)for(var o=0;o<6;o++)e.deleteFramebuffer(i.__webglFramebuffer[o]),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer[o]);else e.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&e.deleteRenderbuffer(i.__webglDepthbuffer);r.delete(t.texture),r.delete(t)}}function g(t,n){var o=r.get(t);if(t.version>0&&o.__version!==t.version){var a=t.image;if(void 0===a)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",t);else{if(a.complete!==!1)return void A(o,t,n);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",t)}}i.activeTexture(e.TEXTURE0+n),i.bindTexture(e.TEXTURE_2D,o.__webglTexture)}function v(t,a){var u=r.get(t);if(6===t.image.length)if(t.version>0&&u.__version!==t.version){u.__image__webglTextureCube||(t.addEventListener("dispose",d),u.__image__webglTextureCube=e.createTexture(),N.textures++),i.activeTexture(e.TEXTURE0+a),i.bindTexture(e.TEXTURE_CUBE_MAP,u.__image__webglTextureCube),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var l=t&&t.isCompressedTexture,h=t.image[0]&&t.image[0].isDataTexture,p=[],f=0;f<6;f++)l||h?p[f]=h?t.image[f].image:t.image[f]:p[f]=s(t.image[f],n.maxCubemapSize);var m=p[0],g=c(m),v=o(t.format),y=o(t.type);M(e.TEXTURE_CUBE_MAP,t,g);for(var f=0;f<6;f++)if(l)for(var A,w=p[f].mipmaps,x=0,E=w.length;x<E;x++)A=w[x],t.format!==fa&&t.format!==pa?i.getCompressedTextureFormats().indexOf(v)>-1?i.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+f,x,v,A.width,A.height,0,A.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+f,x,v,A.width,A.height,0,v,y,A.data);else h?i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,v,p[f].width,p[f].height,0,v,y,p[f].data):i.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+f,0,v,v,y,p[f]);t.generateMipmaps&&g&&e.generateMipmap(e.TEXTURE_CUBE_MAP),u.__version=t.version,t.onUpdate&&t.onUpdate(t)}else i.activeTexture(e.TEXTURE0+a),i.bindTexture(e.TEXTURE_CUBE_MAP,u.__image__webglTextureCube)}function y(t,n){i.activeTexture(e.TEXTURE0+n),i.bindTexture(e.TEXTURE_CUBE_MAP,r.get(t).__webglTexture)}function M(i,a,s){var c;if(s?(e.texParameteri(i,e.TEXTURE_WRAP_S,o(a.wrapS)),e.texParameteri(i,e.TEXTURE_WRAP_T,o(a.wrapT)),e.texParameteri(i,e.TEXTURE_MAG_FILTER,o(a.magFilter)),e.texParameteri(i,e.TEXTURE_MIN_FILTER,o(a.minFilter))):(e.texParameteri(i,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(i,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),a.wrapS===Qo&&a.wrapT===Qo||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",a),e.texParameteri(i,e.TEXTURE_MAG_FILTER,h(a.magFilter)),e.texParameteri(i,e.TEXTURE_MIN_FILTER,h(a.minFilter)),a.minFilter!==Wo&&a.minFilter!==Zo&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",a)),c=t.get("EXT_texture_filter_anisotropic")){if(a.type===aa&&null===t.get("OES_texture_float_linear"))return;if(a.type===sa&&null===t.get("OES_texture_half_float_linear"))return;(a.anisotropy>1||r.get(a).__currentAnisotropy)&&(e.texParameterf(i,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,n.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function A(t,r,a){void 0===t.__webglInit&&(t.__webglInit=!0,r.addEventListener("dispose",d),t.__webglTexture=e.createTexture(),N.textures++),i.activeTexture(e.TEXTURE0+a),i.bindTexture(e.TEXTURE_2D,t.__webglTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,r.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,r.unpackAlignment);var h=s(r.image,n.maxTextureSize);l(r)&&c(h)===!1&&(h=u(h));var p=c(h),f=o(r.format),m=o(r.type);M(e.TEXTURE_2D,r,p);var g,v=r.mipmaps;if(r.isDepthTexture){var y=e.DEPTH_COMPONENT;if(r.type===aa){if(!D)throw new Error("Float Depth Texture only supported in WebGL2.0");y=e.DEPTH_COMPONENT32F}else D&&(y=e.DEPTH_COMPONENT16);r.format===ya&&y===e.DEPTH_COMPONENT&&r.type!==ra&&r.type!==oa&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=ra,m=o(r.type)),r.format===Ma&&(y=e.DEPTH_STENCIL,r.type!==ha&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=ha,m=o(r.type))),i.texImage2D(e.TEXTURE_2D,0,y,h.width,h.height,0,f,m,null)}else if(r.isDataTexture)if(v.length>0&&p){for(var A=0,w=v.length;A<w;A++)g=v[A],i.texImage2D(e.TEXTURE_2D,A,f,g.width,g.height,0,f,m,g.data);r.generateMipmaps=!1}else i.texImage2D(e.TEXTURE_2D,0,f,h.width,h.height,0,f,m,h.data);else if(r.isCompressedTexture)for(var A=0,w=v.length;A<w;A++)g=v[A],r.format!==fa&&r.format!==pa?i.getCompressedTextureFormats().indexOf(f)>-1?i.compressedTexImage2D(e.TEXTURE_2D,A,f,g.width,g.height,0,g.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):i.texImage2D(e.TEXTURE_2D,A,f,g.width,g.height,0,f,m,g.data);else if(v.length>0&&p){for(var A=0,w=v.length;A<w;A++)g=v[A],i.texImage2D(e.TEXTURE_2D,A,f,f,m,g);r.generateMipmaps=!1}else i.texImage2D(e.TEXTURE_2D,0,f,f,m,h);r.generateMipmaps&&p&&e.generateMipmap(e.TEXTURE_2D),t.__version=r.version,r.onUpdate&&r.onUpdate(r)}function w(t,n,a,s){var c=o(n.texture.format),u=o(n.texture.type);i.texImage2D(s,0,c,n.width,n.height,0,c,u,null),e.bindFramebuffer(e.FRAMEBUFFER,t),e.framebufferTexture2D(e.FRAMEBUFFER,a,s,r.get(n.texture).__webglTexture,0),e.bindFramebuffer(e.FRAMEBUFFER,null)}function x(t,i){e.bindRenderbuffer(e.RENDERBUFFER,t),i.depthBuffer&&!i.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,i.width,i.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t)):i.depthBuffer&&i.stencilBuffer?(e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,i.width,i.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t)):e.renderbufferStorage(e.RENDERBUFFER,e.RGBA4,i.width,i.height),e.bindRenderbuffer(e.RENDERBUFFER,null)}function E(t,i){var n=i&&i.isWebGLRenderTargetCube;if(n)throw new Error("Depth Texture with cube render targets is not supported!");if(e.bindFramebuffer(e.FRAMEBUFFER,t),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");r.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),g(i.depthTexture,0);var o=r.get(i.depthTexture).__webglTexture;if(i.depthTexture.format===ya)e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,o,0);else{if(i.depthTexture.format!==Ma)throw new Error("Unknown depthTexture format");e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,o,0)}}function b(t){var i=r.get(t),n=t.isWebGLRenderTargetCube===!0;if(t.depthTexture){if(n)throw new Error("target.depthTexture not supported in Cube render targets");E(i.__webglFramebuffer,t)}else if(n){i.__webglDepthbuffer=[];for(var o=0;o<6;o++)e.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[o]),i.__webglDepthbuffer[o]=e.createRenderbuffer(),x(i.__webglDepthbuffer[o],t)}else e.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),i.__webglDepthbuffer=e.createRenderbuffer(),x(i.__webglDepthbuffer,t);e.bindFramebuffer(e.FRAMEBUFFER,null)}function T(t){var n=r.get(t),o=r.get(t.texture);t.addEventListener("dispose",p),o.__webglTexture=e.createTexture(),N.textures++;var a=t.isWebGLRenderTargetCube===!0,s=c(t);if(a){n.__webglFramebuffer=[];for(var u=0;u<6;u++)n.__webglFramebuffer[u]=e.createFramebuffer()}else n.__webglFramebuffer=e.createFramebuffer();if(a){i.bindTexture(e.TEXTURE_CUBE_MAP,o.__webglTexture),M(e.TEXTURE_CUBE_MAP,t.texture,s);for(var u=0;u<6;u++)w(n.__webglFramebuffer[u],t,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+u);t.texture.generateMipmaps&&s&&e.generateMipmap(e.TEXTURE_CUBE_MAP),i.bindTexture(e.TEXTURE_CUBE_MAP,null)}else i.bindTexture(e.TEXTURE_2D,o.__webglTexture),M(e.TEXTURE_2D,t.texture,s),w(n.__webglFramebuffer,t,e.COLOR_ATTACHMENT0,e.TEXTURE_2D),t.texture.generateMipmaps&&s&&e.generateMipmap(e.TEXTURE_2D),i.bindTexture(e.TEXTURE_2D,null);t.depthBuffer&&b(t)}function L(t){var n=t.texture;if(n.generateMipmaps&&c(t)&&n.minFilter!==Wo&&n.minFilter!==Zo){var o=t&&t.isWebGLRenderTargetCube?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,a=r.get(n).__webglTexture;i.bindTexture(o,a),e.generateMipmap(o),i.bindTexture(o,null)}}var N=a.memory,D="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext;this.setTexture2D=g,this.setTextureCube=v,this.setTextureCubeDynamic=y,this.setupRenderTarget=T,this.updateRenderTargetMipmap=L}function et(){var e={};return{get:function(t){var i=t.uuid,r=e[i];return void 0===r&&(r={},e[i]=r),r},delete:function(t){delete e[t.uuid]},clear:function(){e={}}}}function tt(e,t,i){function r(){var t=!1,i=new n,r=null,o=new n;return{setMask:function(i){r===i||t||(e.colorMask(i,i,i,i),r=i)},setLocked:function(e){t=e},setClear:function(t,r,n,a,s){s===!0&&(t*=a,r*=a,n*=a),i.set(t,r,n,a),o.equals(i)===!1&&(e.clearColor(t,r,n,a),o.copy(i))},reset:function(){t=!1,r=null,o.set(0,0,0,1)}}}function o(){var t=!1,i=null,r=null,n=null;return{setTest:function(t){t?p(e.DEPTH_TEST):f(e.DEPTH_TEST)},setMask:function(r){i===r||t||(e.depthMask(r),i=r)},setFunc:function(t){if(r!==t){if(t)switch(t){case yo:e.depthFunc(e.NEVER);break;case Mo:e.depthFunc(e.ALWAYS);break;case Ao:e.depthFunc(e.LESS);break;case wo:e.depthFunc(e.LEQUAL);break;case xo:e.depthFunc(e.EQUAL);break;case Eo:e.depthFunc(e.GEQUAL);break;case bo:e.depthFunc(e.GREATER);break;case To:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}else e.depthFunc(e.LEQUAL);r=t}},setLocked:function(e){t=e},setClear:function(t){n!==t&&(e.clearDepth(t),n=t)},reset:function(){t=!1,i=null,r=null,n=null}}}function a(){var t=!1,i=null,r=null,n=null,o=null,a=null,s=null,c=null,u=null;return{setTest:function(t){t?p(e.STENCIL_TEST):f(e.STENCIL_TEST)},setMask:function(r){i===r||t||(e.stencilMask(r),i=r)},setFunc:function(t,i,a){r===t&&n===i&&o===a||(e.stencilFunc(t,i,a),r=t,n=i,o=a)},setOp:function(t,i,r){a===t&&s===i&&c===r||(e.stencilOp(t,i,r),a=t,s=i,c=r)},setLocked:function(e){t=e},setClear:function(t){u!==t&&(e.clearStencil(t),u=t)},reset:function(){t=!1,i=null,r=null,n=null,o=null,a=null,s=null,c=null,u=null}}}function s(t,i,r){var n=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(var a=0;a<r;a++)e.texImage2D(i+a,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,n);return o}function c(){U.setClear(0,0,0,1),P.setClear(1),B.setClear(0),p(e.DEPTH_TEST),A(wo),T(!1),L(_n),p(e.CULL_FACE),p(e.BLEND),g(qn)}function u(){for(var e=0,t=G.length;e<t;e++)G[e]=0}function l(i){if(G[i]=1,0===H[i]&&(e.enableVertexAttribArray(i),H[i]=1),0!==Q[i]){var r=t.get("ANGLE_instanced_arrays");r.vertexAttribDivisorANGLE(i,0),Q[i]=0}}function h(t,i,r){G[t]=1,0===H[t]&&(e.enableVertexAttribArray(t),H[t]=1),Q[t]!==i&&(r.vertexAttribDivisorANGLE(t,i),Q[t]=i)}function d(){for(var t=0,i=H.length;t!==i;++t)H[t]!==G[t]&&(e.disableVertexAttribArray(t),H[t]=0)}function p(t){Y[t]!==!0&&(e.enable(t),Y[t]=!0)}function f(t){Y[t]!==!1&&(e.disable(t),Y[t]=!1)}function m(){if(null===V&&(V=[],t.get("WEBGL_compressed_texture_pvrtc")||t.get("WEBGL_compressed_texture_s3tc")||t.get("WEBGL_compressed_texture_etc1")))for(var i=e.getParameter(e.COMPRESSED_TEXTURE_FORMATS),r=0;r<i.length;r++)V.push(i[r]);return V}function g(t,r,n,o,a,s,c,u){t!==Xn?p(e.BLEND):f(e.BLEND),t===W&&u===ee||(t===Zn?u?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE,e.ONE,e.ONE)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE)):t===Jn?u?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.ONE_MINUS_SRC_COLOR)):t===Kn?u?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA)):(e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ZERO,e.SRC_COLOR)):u?(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)):(e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA)),W=t,ee=u),t===$n?(a=a||r,s=s||n,c=c||o,r===X&&a===J||(e.blendEquationSeparate(i(r),i(a)),X=r,J=a),n===q&&o===Z&&s===K&&c===$||(e.blendFuncSeparate(i(n),i(o),i(s),i(c)),q=n,Z=o,K=s,$=c)):(X=null,q=null,Z=null,J=null,K=null,$=null)}function v(e){U.setMask(e)}function y(e){P.setTest(e)}function M(e){P.setMask(e)}function A(e){P.setFunc(e)}function w(e){B.setTest(e)}function x(e){B.setMask(e)}function E(e,t,i){B.setFunc(e,t,i)}function b(e,t,i){B.setOp(e,t,i)}function T(t){te!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),te=t)}function L(t){t!==Cn?(p(e.CULL_FACE),t!==ie&&(t===_n?e.cullFace(e.BACK):t===jn?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):f(e.CULL_FACE),ie=t}function N(t){t!==re&&(ue&&e.lineWidth(t),re=t)}function D(t,i,r){t?(p(e.POLYGON_OFFSET_FILL),ne===i&&oe===r||(e.polygonOffset(i,r),ne=i,oe=r)):f(e.POLYGON_OFFSET_FILL)}function S(){return ae}function I(t){ae=t,t?p(e.SCISSOR_TEST):f(e.SCISSOR_TEST)}function C(t){void 0===t&&(t=e.TEXTURE0+se-1),le!==t&&(e.activeTexture(t),le=t)}function _(t,i){null===le&&C();var r=he[le];void 0===r&&(r={type:void 0,texture:void 0},he[le]=r),r.type===t&&r.texture===i||(e.bindTexture(t,i||fe[t]),r.type=t,r.texture=i)}function j(){try{e.compressedTexImage2D.apply(e,arguments)}catch(e){console.error(e)}}function O(){try{e.texImage2D.apply(e,arguments)}catch(e){console.error(e)}}function z(t){de.equals(t)===!1&&(e.scissor(t.x,t.y,t.z,t.w),de.copy(t))}function R(t){pe.equals(t)===!1&&(e.viewport(t.x,t.y,t.z,t.w),pe.copy(t))}function k(){for(var t=0;t<H.length;t++)1===H[t]&&(e.disableVertexAttribArray(t),H[t]=0);Y={},V=null,le=null,he={},W=null,te=null,ie=null,U.reset(),P.reset(),B.reset()}var U=new r,P=new o,B=new a,F=e.getParameter(e.MAX_VERTEX_ATTRIBS),G=new Uint8Array(F),H=new Uint8Array(F),Q=new Uint8Array(F),Y={},V=null,W=null,X=null,q=null,Z=null,J=null,K=null,$=null,ee=!1,te=null,ie=null,re=null,ne=null,oe=null,ae=null,se=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),ce=parseFloat(/^WebGL\ ([0-9])/.exec(e.getParameter(e.VERSION))[1]),ue=parseFloat(ce)>=1,le=null,he={},de=new n,pe=new n,fe={};return fe[e.TEXTURE_2D]=s(e.TEXTURE_2D,e.TEXTURE_2D,1),fe[e.TEXTURE_CUBE_MAP]=s(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),{buffers:{color:U,depth:P,stencil:B},init:c,initAttributes:u,enableAttribute:l,enableAttributeAndDivisor:h,disableUnusedAttributes:d,enable:p,disable:f,getCompressedTextureFormats:m,setBlending:g,
  setColorWrite:v,setDepthTest:y,setDepthWrite:M,setDepthFunc:A,setStencilTest:w,setStencilWrite:x,setStencilFunc:E,setStencilOp:b,setFlipSided:T,setCullFace:L,setLineWidth:N,setPolygonOffset:D,getScissorTest:S,setScissorTest:I,activeTexture:C,bindTexture:_,compressedTexImage2D:j,texImage2D:O,scissor:z,viewport:R,reset:k}}function it(e,t,i){function r(){if(void 0!==o)return o;var i=t.get("EXT_texture_filter_anisotropic");return o=null!==i?e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}function n(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var o,a=void 0!==i.precision?i.precision:"highp",s=n(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var c=i.logarithmicDepthBuffer===!0&&!!t.get("EXT_frag_depth"),u=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),l=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_TEXTURE_SIZE),d=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),p=e.getParameter(e.MAX_VERTEX_ATTRIBS),f=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),m=e.getParameter(e.MAX_VARYING_VECTORS),g=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),v=l>0,y=!!t.get("OES_texture_float"),M=v&&y;return{getMaxAnisotropy:r,getMaxPrecision:n,precision:a,logarithmicDepthBuffer:c,maxTextures:u,maxVertexTextures:l,maxTextureSize:h,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:M}}function rt(e){var t={};return{get:function(i){if(void 0!==t[i])return t[i];var r;switch(i){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=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":r=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":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":r=e.getExtension("WEBGL_compressed_texture_etc1");break;default:r=e.getExtension(i)}return null===r&&console.warn("THREE.WebGLRenderer: "+i+" extension not supported."),t[i]=r,r}}}function nt(){function e(){u.value!==r&&(u.value=r,u.needsUpdate=n>0),i.numPlanes=n,i.numIntersection=0}function t(e,t,r,n){var o=null!==e?e.length:0,a=null;if(0!==o){if(a=u.value,n!==!0||null===a){var l=r+4*o,h=t.matrixWorldInverse;c.getNormalMatrix(h),(null===a||a.length<l)&&(a=new Float32Array(l));for(var d=0,p=r;d!==o;++d,p+=4)s.copy(e[d]).applyMatrix4(h,c),s.normal.toArray(a,p),a[p+3]=s.constant}u.value=a,u.needsUpdate=!0}return i.numPlanes=o,a}var i=this,r=null,n=0,o=!1,a=!1,s=new ie,c=new te,u={value:null,needsUpdate:!1};this.uniform=u,this.numPlanes=0,this.numIntersection=0,this.init=function(e,i,a){var s=0!==e.length||i||0!==n||o;return o=i,r=t(e,a,0),n=e.length,s},this.beginShadows=function(){a=!0,t(null)},this.endShadows=function(){a=!1,e()},this.setState=function(i,s,c,l,h,d){if(!o||null===i||0===i.length||a&&!c)a?t(null):e();else{var p=a?0:n,f=4*p,m=h.clippingState||null;u.value=m,m=t(i,l,f,d);for(var g=0;g!==f;++g)m[g]=r[g];h.clippingState=m,this.numIntersection=s?this.numPlanes:0,this.numPlanes+=p}}}function ot(e){function t(){return null===pe?Ie:1}function i(){ct.init(),ct.scissor(ye.copy(Re).multiplyScalar(Ie)),ct.viewport(Ae.copy(Ue).multiplyScalar(Ie)),ct.buffers.color.setClear(xe.r,xe.g,xe.b,Ee,Z)}function r(){he=null,ve=null,ge="",me=-1,ct.reset()}function o(e){e.preventDefault(),r(),i(),ut.clear()}function a(e){var t=e.target;t.removeEventListener("dispose",a),s(t)}function s(e){l(e),ut.delete(e)}function l(e){var t=ut.get(e).program;e.program=void 0,void 0!==t&&dt.releaseProgram(t)}function h(e,t,i,r){var n;if(i&&i.isInstancedBufferGeometry&&(n=at.get("ANGLE_instanced_arrays"),null===n))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");void 0===r&&(r=0),ct.initAttributes();var o=i.attributes,a=t.getAttributes(),s=e.defaultAttributeValues;for(var c in a){var u=a[c];if(u>=0){var l=o[c];if(void 0!==l){var h=l.normalized,d=l.itemSize,p=ht.getAttributeProperties(l),f=p.__webglBuffer,m=p.type,g=p.bytesPerElement;if(l.isInterleavedBufferAttribute){var v=l.data,y=v.stride,M=l.offset;v&&v.isInstancedInterleavedBuffer?(ct.enableAttributeAndDivisor(u,v.meshPerAttribute,n),void 0===i.maxInstancedCount&&(i.maxInstancedCount=v.meshPerAttribute*v.count)):ct.enableAttribute(u),Je.bindBuffer(Je.ARRAY_BUFFER,f),Je.vertexAttribPointer(u,d,m,h,y*g,(r*y+M)*g)}else l.isInstancedBufferAttribute?(ct.enableAttributeAndDivisor(u,l.meshPerAttribute,n),void 0===i.maxInstancedCount&&(i.maxInstancedCount=l.meshPerAttribute*l.count)):ct.enableAttribute(u),Je.bindBuffer(Je.ARRAY_BUFFER,f),Je.vertexAttribPointer(u,d,m,h,0,r*d*g)}else if(void 0!==s){var A=s[c];if(void 0!==A)switch(A.length){case 2:Je.vertexAttrib2fv(u,A);break;case 3:Je.vertexAttrib3fv(u,A);break;case 4:Je.vertexAttrib4fv(u,A);break;default:Je.vertexAttrib1fv(u,A)}}}}ct.disableUnusedAttributes()}function d(e,t){return Math.abs(t[0])-Math.abs(e[0])}function p(e,t){return e.object.renderOrder!==t.object.renderOrder?e.object.renderOrder-t.object.renderOrder:e.material.program&&t.material.program&&e.material.program!==t.material.program?e.material.program.id-t.material.program.id:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function f(e,t){return e.object.renderOrder!==t.object.renderOrder?e.object.renderOrder-t.object.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function m(e,t,i,r,n){var o,a;i.transparent?(o=oe,a=++ae):(o=te,a=++ie);var s=o[a];void 0!==s?(s.id=e.id,s.object=e,s.geometry=t,s.material=i,s.z=Ye.z,s.group=n):(s={id:e.id,object:e,geometry:t,material:i,z:Ye.z,group:n},o.push(s))}function g(e){var t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),He.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),y(He)}function v(e){return He.center.set(0,0,0),He.radius=.7071067811865476,He.applyMatrix4(e.matrixWorld),y(He)}function y(e){if(!Pe.intersectsSphere(e))return!1;var t=Be.numPlanes;if(0===t)return!0;var i=le.clippingPlanes,r=e.center,n=-e.radius,o=0;do if(i[o].distanceToPoint(r)<n)return!1;while(++o!==t);return!0}function M(e,t){if(e.visible!==!1){var i=0!==(e.layers.mask&t.layers.mask);if(i)if(e.isLight)$.push(e);else if(e.isSprite)e.frustumCulled!==!1&&v(e)!==!0||ce.push(e);else if(e.isLensFlare)ue.push(e);else if(e.isImmediateRenderObject)le.sortObjects===!0&&(Ye.setFromMatrixPosition(e.matrixWorld),Ye.applyProjection(Qe)),m(e,null,e.material,Ye.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.update(),e.frustumCulled===!1||g(e)===!0)){var r=e.material;if(r.visible===!0){le.sortObjects===!0&&(Ye.setFromMatrixPosition(e.matrixWorld),Ye.applyProjection(Qe));var n=ht.update(e);if(r.isMultiMaterial)for(var o=n.groups,a=r.materials,s=0,c=o.length;s<c;s++){var u=o[s],l=a[u.materialIndex];l.visible===!0&&m(e,n,l,Ye.z,u)}else m(e,n,r,Ye.z,null)}}for(var h=e.children,s=0,c=h.length;s<c;s++)M(h[s],t)}}function A(e,t,i,r){for(var n=0,o=e.length;n<o;n++){var a=e[n],s=a.object,c=a.geometry,u=void 0===r?a.material:r,l=a.group;if(s.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,s.matrixWorld),s.normalMatrix.getNormalMatrix(s.modelViewMatrix),s.onBeforeRender(le,t,i,c,u,l),s.isImmediateRenderObject){x(u);var h=E(i,t.fog,u,s);ge="",s.render(function(e){le.renderBufferImmediate(e,h,u)})}else le.renderBufferDirect(i,t.fog,c,u,s,l);s.onAfterRender(le,t,i,c,u,l)}}function w(e,t,i){var r=ut.get(e),n=dt.getParameters(e,Xe,t,Be.numPlanes,Be.numIntersection,i),o=dt.getProgramCode(e,n),s=r.program,c=!0;if(void 0===s)e.addEventListener("dispose",a);else if(s.code!==o)l(e);else{if(void 0!==n.shaderID)return;c=!1}if(c){if(n.shaderID){var u=au[n.shaderID];r.__webglShader={name:e.type,uniforms:ns.clone(u.uniforms),vertexShader:u.vertexShader,fragmentShader:u.fragmentShader}}else r.__webglShader={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};e.__webglShader=r.__webglShader,s=dt.acquireProgram(e,n,o),r.program=s,e.program=s}var h=s.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var d=0;d<le.maxMorphTargets;d++)h["morphTarget"+d]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;for(var d=0;d<le.maxMorphNormals;d++)h["morphNormal"+d]>=0&&e.numSupportedMorphNormals++}var p=r.__webglShader.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&e.clipping!==!0||(r.numClippingPlanes=Be.numPlanes,r.numIntersection=Be.numIntersection,p.clippingPlanes=Be.uniform),r.fog=t,r.lightsHash=Xe.hash,e.lights&&(p.ambientLightColor.value=Xe.ambient,p.directionalLights.value=Xe.directional,p.spotLights.value=Xe.spot,p.rectAreaLights.value=Xe.rectArea,p.pointLights.value=Xe.point,p.hemisphereLights.value=Xe.hemi,p.directionalShadowMap.value=Xe.directionalShadowMap,p.directionalShadowMatrix.value=Xe.directionalShadowMatrix,p.spotShadowMap.value=Xe.spotShadowMap,p.spotShadowMatrix.value=Xe.spotShadowMatrix,p.pointShadowMap.value=Xe.pointShadowMap,p.pointShadowMatrix.value=Xe.pointShadowMatrix);var f=r.program.getUniforms(),m=Q.seqWithValue(f.seq,p);r.uniformsList=m}function x(e){e.side===Gn?ct.disable(Je.CULL_FACE):ct.enable(Je.CULL_FACE),ct.setFlipSided(e.side===Fn),e.transparent===!0?ct.setBlending(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha):ct.setBlending(Xn),ct.setDepthFunc(e.depthFunc),ct.setDepthTest(e.depthTest),ct.setDepthWrite(e.depthWrite),ct.setColorWrite(e.colorWrite),ct.setPolygonOffset(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)}function E(e,t,i,r){we=0;var n=ut.get(i);if(Fe&&(Ge||e!==ve)){var o=e===ve&&i.id===me;Be.setState(i.clippingPlanes,i.clipIntersection,i.clipShadows,e,n,o)}i.needsUpdate===!1&&(void 0===n.program?i.needsUpdate=!0:i.fog&&n.fog!==t?i.needsUpdate=!0:i.lights&&n.lightsHash!==Xe.hash?i.needsUpdate=!0:void 0===n.numClippingPlanes||n.numClippingPlanes===Be.numPlanes&&n.numIntersection===Be.numIntersection||(i.needsUpdate=!0)),i.needsUpdate&&(w(i,t,r),i.needsUpdate=!1);var a=!1,s=!1,c=!1,u=n.program,l=u.getUniforms(),h=n.__webglShader.uniforms;if(u.id!==he&&(Je.useProgram(u.program),he=u.id,a=!0,s=!0,c=!0),i.id!==me&&(me=i.id,s=!0),a||e!==ve){if(l.set(Je,e,"projectionMatrix"),st.logarithmicDepthBuffer&&l.setValue(Je,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),e!==ve&&(ve=e,s=!0,c=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.envMap){var d=l.map.cameraPosition;void 0!==d&&d.setValue(Je,Ye.setFromMatrixPosition(e.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.skinning)&&l.setValue(Je,"viewMatrix",e.matrixWorldInverse),l.set(Je,le,"toneMappingExposure"),l.set(Je,le,"toneMappingWhitePoint")}if(i.skinning){l.setOptional(Je,r,"bindMatrix"),l.setOptional(Je,r,"bindMatrixInverse");var p=r.skeleton;p&&(st.floatVertexTextures&&p.useVertexTexture?(l.set(Je,p,"boneTexture"),l.set(Je,p,"boneTextureWidth"),l.set(Je,p,"boneTextureHeight")):l.setOptional(Je,p,"boneMatrices"))}return s&&(i.lights&&z(h,c),t&&i.fog&&D(h,t),(i.isMeshBasicMaterial||i.isMeshLambertMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.isMeshNormalMaterial||i.isMeshDepthMaterial)&&b(h,i),i.isLineBasicMaterial?T(h,i):i.isLineDashedMaterial?(T(h,i),L(h,i)):i.isPointsMaterial?N(h,i):i.isMeshLambertMaterial?S(h,i):i.isMeshToonMaterial?C(h,i):i.isMeshPhongMaterial?I(h,i):i.isMeshPhysicalMaterial?j(h,i):i.isMeshStandardMaterial?_(h,i):i.isMeshDepthMaterial?i.displacementMap&&(h.displacementMap.value=i.displacementMap,h.displacementScale.value=i.displacementScale,h.displacementBias.value=i.displacementBias):i.isMeshNormalMaterial&&O(h,i),void 0!==h.ltcMat&&(h.ltcMat.value=THREE.UniformsLib.LTC_MAT_TEXTURE),void 0!==h.ltcMag&&(h.ltcMag.value=THREE.UniformsLib.LTC_MAG_TEXTURE),Q.upload(Je,n.uniformsList,h,le)),l.set(Je,r,"modelViewMatrix"),l.set(Je,r,"normalMatrix"),l.setValue(Je,"modelMatrix",r.matrixWorld),u}function b(e,t){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);var i;if(t.map?i=t.map:t.specularMap?i=t.specularMap:t.displacementMap?i=t.displacementMap:t.normalMap?i=t.normalMap:t.bumpMap?i=t.bumpMap:t.roughnessMap?i=t.roughnessMap:t.metalnessMap?i=t.metalnessMap:t.alphaMap?i=t.alphaMap:t.emissiveMap&&(i=t.emissiveMap),void 0!==i){i.isWebGLRenderTarget&&(i=i.texture);var r=i.offset,n=i.repeat;e.offsetRepeat.value.set(r.x,r.y,n.x,n.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}function T(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity}function L(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function N(e,t){if(e.diffuse.value=t.color,e.opacity.value=t.opacity,e.size.value=t.size*Ie,e.scale.value=.5*Te,e.map.value=t.map,null!==t.map){var i=t.map.offset,r=t.map.repeat;e.offsetRepeat.value.set(i.x,i.y,r.x,r.y)}}function D(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)}function S(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}function I(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 C(e,t){I(e,t),t.gradientMap&&(e.gradientMap.value=t.gradientMap)}function _(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 j(e,t){e.clearCoat.value=t.clearCoat,e.clearCoatRoughness.value=t.clearCoatRoughness,_(e,t)}function O(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)}function z(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}function R(e){for(var t=0,i=0,r=e.length;i<r;i++){var n=e[i];n.castShadow&&(Xe.shadows[t++]=n)}Xe.shadows.length=t}function k(e,t){var i,r,n,o,a,s,c,l=0,h=0,d=0,p=t.matrixWorldInverse,f=0,m=0,g=0,v=0,y=0;for(i=0,r=e.length;i<r;i++)if(n=e[i],o=n.color,a=n.intensity,s=n.distance,c=n.shadow&&n.shadow.map?n.shadow.map.texture:null,n.isAmbientLight)l+=o.r*a,h+=o.g*a,d+=o.b*a;else if(n.isDirectionalLight){var M=pt.get(n);M.color.copy(n.color).multiplyScalar(n.intensity),M.direction.setFromMatrixPosition(n.matrixWorld),Ye.setFromMatrixPosition(n.target.matrixWorld),M.direction.sub(Ye),M.direction.transformDirection(p),M.shadow=n.castShadow,n.castShadow&&(M.shadowBias=n.shadow.bias,M.shadowRadius=n.shadow.radius,M.shadowMapSize=n.shadow.mapSize),Xe.directionalShadowMap[f]=c,Xe.directionalShadowMatrix[f]=n.shadow.matrix,Xe.directional[f++]=M}else if(n.isSpotLight){var M=pt.get(n);M.position.setFromMatrixPosition(n.matrixWorld),M.position.applyMatrix4(p),M.color.copy(o).multiplyScalar(a),M.distance=s,M.direction.setFromMatrixPosition(n.matrixWorld),Ye.setFromMatrixPosition(n.target.matrixWorld),M.direction.sub(Ye),M.direction.transformDirection(p),M.coneCos=Math.cos(n.angle),M.penumbraCos=Math.cos(n.angle*(1-n.penumbra)),M.decay=0===n.distance?0:n.decay,M.shadow=n.castShadow,n.castShadow&&(M.shadowBias=n.shadow.bias,M.shadowRadius=n.shadow.radius,M.shadowMapSize=n.shadow.mapSize),Xe.spotShadowMap[g]=c,Xe.spotShadowMatrix[g]=n.shadow.matrix,Xe.spot[g++]=M}else if(n.isRectAreaLight){var M=pt.get(n);M.color.copy(o).multiplyScalar(a/(n.width*n.height)),M.position.setFromMatrixPosition(n.matrixWorld),M.position.applyMatrix4(p),We.identity(),Ve.copy(n.matrixWorld),Ve.premultiply(p),We.extractRotation(Ve),M.halfWidth.set(.5*n.width,0,0),M.halfHeight.set(0,.5*n.height,0),M.halfWidth.applyMatrix4(We),M.halfHeight.applyMatrix4(We),Xe.rectArea[v++]=M}else if(n.isPointLight){var M=pt.get(n);M.position.setFromMatrixPosition(n.matrixWorld),M.position.applyMatrix4(p),M.color.copy(n.color).multiplyScalar(n.intensity),M.distance=n.distance,M.decay=0===n.distance?0:n.decay,M.shadow=n.castShadow,n.castShadow&&(M.shadowBias=n.shadow.bias,M.shadowRadius=n.shadow.radius,M.shadowMapSize=n.shadow.mapSize),Xe.pointShadowMap[m]=c,void 0===Xe.pointShadowMatrix[m]&&(Xe.pointShadowMatrix[m]=new u),Ye.setFromMatrixPosition(n.matrixWorld).negate(),Xe.pointShadowMatrix[m].identity().setPosition(Ye),Xe.point[m++]=M}else if(n.isHemisphereLight){var M=pt.get(n);M.direction.setFromMatrixPosition(n.matrixWorld),M.direction.transformDirection(p),M.direction.normalize(),M.skyColor.copy(n.color).multiplyScalar(a),M.groundColor.copy(n.groundColor).multiplyScalar(a),Xe.hemi[y++]=M}Xe.ambient[0]=l,Xe.ambient[1]=h,Xe.ambient[2]=d,Xe.directional.length=f,Xe.spot.length=g,Xe.rectArea.length=v,Xe.point.length=m,Xe.hemi.length=y,Xe.hash=f+","+m+","+g+","+v+","+y+","+Xe.shadows.length}function U(){var e=we;return e>=st.maxTextures&&console.warn("WebGLRenderer: trying to use "+e+" texture units while this GPU supports only "+st.maxTextures),we+=1,e}function P(e){var t;if(e===Ho)return Je.REPEAT;if(e===Qo)return Je.CLAMP_TO_EDGE;if(e===Yo)return Je.MIRRORED_REPEAT;if(e===Wo)return Je.NEAREST;if(e===Xo)return Je.NEAREST_MIPMAP_NEAREST;if(e===qo)return Je.NEAREST_MIPMAP_LINEAR;if(e===Zo)return Je.LINEAR;if(e===Jo)return Je.LINEAR_MIPMAP_NEAREST;if(e===Ko)return Je.LINEAR_MIPMAP_LINEAR;if(e===ea)return Je.UNSIGNED_BYTE;if(e===ca)return Je.UNSIGNED_SHORT_4_4_4_4;if(e===ua)return Je.UNSIGNED_SHORT_5_5_5_1;if(e===la)return Je.UNSIGNED_SHORT_5_6_5;if(e===ta)return Je.BYTE;if(e===ia)return Je.SHORT;if(e===ra)return Je.UNSIGNED_SHORT;if(e===na)return Je.INT;if(e===oa)return Je.UNSIGNED_INT;if(e===aa)return Je.FLOAT;if(e===sa&&(t=at.get("OES_texture_half_float"),null!==t))return t.HALF_FLOAT_OES;if(e===da)return Je.ALPHA;if(e===pa)return Je.RGB;if(e===fa)return Je.RGBA;if(e===ma)return Je.LUMINANCE;if(e===ga)return Je.LUMINANCE_ALPHA;if(e===ya)return Je.DEPTH_COMPONENT;if(e===Ma)return Je.DEPTH_STENCIL;if(e===to)return Je.FUNC_ADD;if(e===io)return Je.FUNC_SUBTRACT;if(e===ro)return Je.FUNC_REVERSE_SUBTRACT;if(e===ao)return Je.ZERO;if(e===so)return Je.ONE;if(e===co)return Je.SRC_COLOR;if(e===uo)return Je.ONE_MINUS_SRC_COLOR;if(e===lo)return Je.SRC_ALPHA;if(e===ho)return Je.ONE_MINUS_SRC_ALPHA;if(e===po)return Je.DST_ALPHA;if(e===fo)return Je.ONE_MINUS_DST_ALPHA;if(e===mo)return Je.DST_COLOR;if(e===go)return Je.ONE_MINUS_DST_COLOR;if(e===vo)return Je.SRC_ALPHA_SATURATE;if((e===Aa||e===wa||e===xa||e===Ea)&&(t=at.get("WEBGL_compressed_texture_s3tc"),null!==t)){if(e===Aa)return t.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===wa)return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===xa)return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===Ea)return t.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((e===ba||e===Ta||e===La||e===Na)&&(t=at.get("WEBGL_compressed_texture_pvrtc"),null!==t)){if(e===ba)return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===Ta)return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===La)return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===Na)return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e===Da&&(t=at.get("WEBGL_compressed_texture_etc1"),null!==t))return t.COMPRESSED_RGB_ETC1_WEBGL;if((e===no||e===oo)&&(t=at.get("EXT_blend_minmax"),null!==t)){if(e===no)return t.MIN_EXT;if(e===oo)return t.MAX_EXT}return e===ha&&(t=at.get("WEBGL_depth_texture"),null!==t)?t.UNSIGNED_INT_24_8_WEBGL:0}console.log("THREE.WebGLRenderer",Sn),e=e||{};var B=void 0!==e.canvas?e.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),F=void 0!==e.context?e.context:null,G=void 0!==e.alpha&&e.alpha,H=void 0===e.depth||e.depth,V=void 0===e.stencil||e.stencil,W=void 0!==e.antialias&&e.antialias,Z=void 0===e.premultipliedAlpha||e.premultipliedAlpha,K=void 0!==e.preserveDrawingBuffer&&e.preserveDrawingBuffer,$=[],te=[],ie=-1,oe=[],ae=-1,se=new Float32Array(8),ce=[],ue=[];this.domElement=B,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=Io,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var le=this,he=null,pe=null,fe=null,me=-1,ge="",ve=null,ye=new n,Me=null,Ae=new n,we=0,xe=new Y(0),Ee=0,be=B.width,Te=B.height,Ie=1,Re=new n(0,0,be,Te),ke=!1,Ue=new n(0,0,be,Te),Pe=new re,Be=new nt,Fe=!1,Ge=!1,He=new ee,Qe=new u,Ye=new c,Ve=new u,We=new u,Xe={hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],shadows:[]},qe={calls:0,vertices:0,faces:0,points:0};this.info={render:qe,memory:{geometries:0,textures:0},programs:null};var Je;try{var ot={alpha:G,depth:H,stencil:V,antialias:W,premultipliedAlpha:Z,preserveDrawingBuffer:K};if(Je=F||B.getContext("webgl",ot)||B.getContext("experimental-webgl",ot),null===Je)throw null!==B.getContext("webgl")?"Error creating WebGL context with your selected attributes.":"Error creating WebGL context.";void 0===Je.getShaderPrecisionFormat&&(Je.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}}),B.addEventListener("webglcontextlost",o,!1)}catch(e){console.error("THREE.WebGLRenderer: "+e)}var at=new rt(Je);at.get("WEBGL_depth_texture"),at.get("OES_texture_float"),at.get("OES_texture_float_linear"),at.get("OES_texture_half_float"),at.get("OES_texture_half_float_linear"),at.get("OES_standard_derivatives"),at.get("ANGLE_instanced_arrays"),at.get("OES_element_index_uint")&&(Le.MaxIndex=4294967296);var st=new it(Je,at,e),ct=new tt(Je,at,P),ut=new et,lt=new $e(Je,at,ct,ut,st,P,this.info),ht=new Ke(Je,ut,this.info),dt=new Ze(this,st),pt=new ze;this.info.programs=dt.programs;var ft=new Oe(Je,at,qe),mt=new je(Je,at,qe),gt=new _e(-1,1,1,-1,0,1),vt=new Ce,yt=new Ne(new Se(2,2),new de({depthTest:!1,depthWrite:!1,fog:!1})),Mt=au.cube,At=new Ne(new De(5,5,5),new J({uniforms:Mt.uniforms,vertexShader:Mt.vertexShader,fragmentShader:Mt.fragmentShader,side:Fn,depthTest:!1,depthWrite:!1,fog:!1}));i(),this.context=Je,this.capabilities=st,this.extensions=at,this.properties=ut,this.state=ct;var wt=new ne(this,Xe,ht,st);this.shadowMap=wt;var xt=new q(this,ce),Et=new X(this,ue);this.getContext=function(){return Je},this.getContextAttributes=function(){return Je.getContextAttributes()},this.forceContextLoss=function(){at.get("WEBGL_lose_context").loseContext()},this.getMaxAnisotropy=function(){return st.getMaxAnisotropy()},this.getPrecision=function(){return st.precision},this.getPixelRatio=function(){return Ie},this.setPixelRatio=function(e){void 0!==e&&(Ie=e,this.setSize(Ue.z,Ue.w,!1))},this.getSize=function(){return{width:be,height:Te}},this.setSize=function(e,t,i){be=e,Te=t,B.width=e*Ie,B.height=t*Ie,i!==!1&&(B.style.width=e+"px",B.style.height=t+"px"),this.setViewport(0,0,e,t)},this.setViewport=function(e,t,i,r){ct.viewport(Ue.set(e,t,i,r))},this.setScissor=function(e,t,i,r){ct.scissor(Re.set(e,t,i,r))},this.setScissorTest=function(e){ct.setScissorTest(ke=e)},this.getClearColor=function(){return xe},this.setClearColor=function(e,t){xe.set(e),Ee=void 0!==t?t:1,ct.buffers.color.setClear(xe.r,xe.g,xe.b,Ee,Z)},this.getClearAlpha=function(){return Ee},this.setClearAlpha=function(e){Ee=e,ct.buffers.color.setClear(xe.r,xe.g,xe.b,Ee,Z)},this.clear=function(e,t,i){var r=0;(void 0===e||e)&&(r|=Je.COLOR_BUFFER_BIT),(void 0===t||t)&&(r|=Je.DEPTH_BUFFER_BIT),(void 0===i||i)&&(r|=Je.STENCIL_BUFFER_BIT),Je.clear(r)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.clearTarget=function(e,t,i,r){this.setRenderTarget(e),this.clear(t,i,r)},this.resetGLState=r,this.dispose=function(){oe=[],ae=-1,te=[],ie=-1,B.removeEventListener("webglcontextlost",o,!1)},this.renderBufferImmediate=function(e,t,i){ct.initAttributes();var r=ut.get(e);e.hasPositions&&!r.position&&(r.position=Je.createBuffer()),e.hasNormals&&!r.normal&&(r.normal=Je.createBuffer()),e.hasUvs&&!r.uv&&(r.uv=Je.createBuffer()),e.hasColors&&!r.color&&(r.color=Je.createBuffer());var n=t.getAttributes();if(e.hasPositions&&(Je.bindBuffer(Je.ARRAY_BUFFER,r.position),Je.bufferData(Je.ARRAY_BUFFER,e.positionArray,Je.DYNAMIC_DRAW),ct.enableAttribute(n.position),Je.vertexAttribPointer(n.position,3,Je.FLOAT,!1,0,0)),e.hasNormals){if(Je.bindBuffer(Je.ARRAY_BUFFER,r.normal),!i.isMeshPhongMaterial&&!i.isMeshStandardMaterial&&!i.isMeshNormalMaterial&&i.shading===Hn)for(var o=0,a=3*e.count;o<a;o+=9){var s=e.normalArray,c=(s[o+0]+s[o+3]+s[o+6])/3,u=(s[o+1]+s[o+4]+s[o+7])/3,l=(s[o+2]+s[o+5]+s[o+8])/3;s[o+0]=c,s[o+1]=u,s[o+2]=l,s[o+3]=c,s[o+4]=u,s[o+5]=l,s[o+6]=c,s[o+7]=u,s[o+8]=l}Je.bufferData(Je.ARRAY_BUFFER,e.normalArray,Je.DYNAMIC_DRAW),ct.enableAttribute(n.normal),Je.vertexAttribPointer(n.normal,3,Je.FLOAT,!1,0,0)}e.hasUvs&&i.map&&(Je.bindBuffer(Je.ARRAY_BUFFER,r.uv),Je.bufferData(Je.ARRAY_BUFFER,e.uvArray,Je.DYNAMIC_DRAW),ct.enableAttribute(n.uv),Je.vertexAttribPointer(n.uv,2,Je.FLOAT,!1,0,0)),e.hasColors&&i.vertexColors!==Yn&&(Je.bindBuffer(Je.ARRAY_BUFFER,r.color),Je.bufferData(Je.ARRAY_BUFFER,e.colorArray,Je.DYNAMIC_DRAW),ct.enableAttribute(n.color),Je.vertexAttribPointer(n.color,3,Je.FLOAT,!1,0,0)),ct.disableUnusedAttributes(),Je.drawArrays(Je.TRIANGLES,0,e.count),e.count=0},this.renderBufferDirect=function(e,i,r,n,o,a){x(n);var s=E(e,i,n,o),c=!1,u=r.id+"_"+s.id+"_"+n.wireframe;u!==ge&&(ge=u,c=!0);var l=o.morphTargetInfluences;if(void 0!==l){for(var p=[],f=0,m=l.length;f<m;f++){var g=l[f];p.push([g,f])}p.sort(d),p.length>8&&(p.length=8);for(var v=r.morphAttributes,f=0,m=p.length;f<m;f++){var g=p[f];if(se[f]=g[0],0!==g[0]){var y=g[1];n.morphTargets===!0&&v.position&&r.addAttribute("morphTarget"+f,v.position[y]),n.morphNormals===!0&&v.normal&&r.addAttribute("morphNormal"+f,v.normal[y])}else n.morphTargets===!0&&r.removeAttribute("morphTarget"+f),n.morphNormals===!0&&r.removeAttribute("morphNormal"+f)}for(var f=p.length,M=se.length;f<M;f++)se[f]=0;s.getUniforms().setValue(Je,"morphTargetInfluences",se),c=!0}var y=r.index,A=r.attributes.position,w=1;n.wireframe===!0&&(y=ht.getWireframeAttribute(r),w=2);var b;null!==y?(b=mt,b.setIndex(y)):b=ft,c&&(h(n,s,r),null!==y&&Je.bindBuffer(Je.ELEMENT_ARRAY_BUFFER,ht.getAttributeBuffer(y)));var T=0;null!==y?T=y.count:void 0!==A&&(T=A.count);var L=r.drawRange.start*w,N=r.drawRange.count*w,D=null!==a?a.start*w:0,S=null!==a?a.count*w:1/0,I=Math.max(L,D),C=Math.min(T,L+N,D+S)-1,_=Math.max(0,C-I+1);if(0!==_){if(o.isMesh)if(n.wireframe===!0)ct.setLineWidth(n.wireframeLinewidth*t()),b.setMode(Je.LINES);else switch(o.drawMode){case Ua:b.setMode(Je.TRIANGLES);break;case Pa:b.setMode(Je.TRIANGLE_STRIP);break;case Ba:b.setMode(Je.TRIANGLE_FAN)}else if(o.isLine){var j=n.linewidth;void 0===j&&(j=1),ct.setLineWidth(j*t()),o.isLineSegments?b.setMode(Je.LINES):b.setMode(Je.LINE_STRIP)}else o.isPoints&&b.setMode(Je.POINTS);r&&r.isInstancedBufferGeometry?r.maxInstancedCount>0&&b.renderInstances(r,I,_):b.render(I,_)}},this.render=function(e,t,i,r){if(void 0!==t&&t.isCamera!==!0)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");ge="",me=-1,ve=null,e.autoUpdate===!0&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),t.matrixWorldInverse.getInverse(t.matrixWorld),Qe.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Pe.setFromMatrix(Qe),$.length=0,ie=-1,ae=-1,ce.length=0,ue.length=0,Ge=this.localClippingEnabled,Fe=Be.init(this.clippingPlanes,Ge,t),M(e,t),te.length=ie+1,oe.length=ae+1,le.sortObjects===!0&&(te.sort(p),oe.sort(f)),Fe&&Be.beginShadows(),R($),wt.render(e,t),k($,t),Fe&&Be.endShadows(),qe.calls=0,qe.vertices=0,qe.faces=0,qe.points=0,void 0===i&&(i=null),this.setRenderTarget(i);var n=e.background;if(null===n?ct.buffers.color.setClear(xe.r,xe.g,xe.b,Ee,Z):n&&n.isColor&&(ct.buffers.color.setClear(n.r,n.g,n.b,1,Z),r=!0),(this.autoClear||r)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),n&&n.isCubeTexture?(vt.projectionMatrix.copy(t.projectionMatrix),vt.matrixWorld.extractRotation(t.matrixWorld),vt.matrixWorldInverse.getInverse(vt.matrixWorld),At.material.uniforms.tCube.value=n,At.modelViewMatrix.multiplyMatrices(vt.matrixWorldInverse,At.matrixWorld),ht.update(At),le.renderBufferDirect(vt,null,At.geometry,At.material,At,null)):n&&n.isTexture&&(yt.material.map=n,ht.update(yt),le.renderBufferDirect(gt,null,yt.geometry,yt.material,yt,null)),e.overrideMaterial){var o=e.overrideMaterial;A(te,e,t,o),A(oe,e,t,o)}else ct.setBlending(Xn),A(te,e,t),A(oe,e,t);xt.render(e,t),Et.render(e,t,Ae),i&&lt.updateRenderTargetMipmap(i),ct.setDepthTest(!0),ct.setDepthWrite(!0),ct.setColorWrite(!0)},this.setFaceCulling=function(e,t){ct.setCullFace(e),ct.setFlipSided(t===zn)},this.allocTextureUnit=U,this.setTexture2D=function(){var e=!1;return function(t,i){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),lt.setTexture2D(t,i)}}(),this.setTexture=function(){var e=!1;return function(t,i){e||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),e=!0),lt.setTexture2D(t,i)}}(),this.setTextureCube=function(){var e=!1;return function(t,i){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?lt.setTextureCube(t,i):lt.setTextureCubeDynamic(t,i)}}(),this.getCurrentRenderTarget=function(){return pe},this.setRenderTarget=function(e){pe=e,e&&void 0===ut.get(e).__webglFramebuffer&&lt.setupRenderTarget(e);var t,i=e&&e.isWebGLRenderTargetCube;
  if(e){var r=ut.get(e);t=i?r.__webglFramebuffer[e.activeCubeFace]:r.__webglFramebuffer,ye.copy(e.scissor),Me=e.scissorTest,Ae.copy(e.viewport)}else t=null,ye.copy(Re).multiplyScalar(Ie),Me=ke,Ae.copy(Ue).multiplyScalar(Ie);if(fe!==t&&(Je.bindFramebuffer(Je.FRAMEBUFFER,t),fe=t),ct.scissor(ye),ct.setScissorTest(Me),ct.viewport(Ae),i){var n=ut.get(e.texture);Je.framebufferTexture2D(Je.FRAMEBUFFER,Je.COLOR_ATTACHMENT0,Je.TEXTURE_CUBE_MAP_POSITIVE_X+e.activeCubeFace,n.__webglTexture,e.activeMipMapLevel)}},this.readRenderTargetPixels=function(e,t,i,r,n,o){if((e&&e.isWebGLRenderTarget)===!1)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");var a=ut.get(e).__webglFramebuffer;if(a){var s=!1;a!==fe&&(Je.bindFramebuffer(Je.FRAMEBUFFER,a),s=!0);try{var c=e.texture,u=c.format,l=c.type;if(u!==fa&&P(u)!==Je.getParameter(Je.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(l===ea||P(l)===Je.getParameter(Je.IMPLEMENTATION_COLOR_READ_TYPE)||l===aa&&(at.get("OES_texture_float")||at.get("WEBGL_color_buffer_float"))||l===sa&&at.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");Je.checkFramebufferStatus(Je.FRAMEBUFFER)===Je.FRAMEBUFFER_COMPLETE?t>=0&&t<=e.width-r&&i>=0&&i<=e.height-n&&Je.readPixels(t,i,r,n,P(u),P(l),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&Je.bindFramebuffer(Je.FRAMEBUFFER,fe)}}}}function at(e,t){this.name="",this.color=new Y(e),this.density=void 0!==t?t:25e-5}function st(e,t,i){this.name="",this.color=new Y(e),this.near=void 0!==t?t:1,this.far=void 0!==i?i:1e3}function ct(){ce.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function ut(e,t,i,r,n){ce.call(this),this.lensFlares=[],this.positionScreen=new c,this.customUpdateCallback=void 0,void 0!==e&&this.add(e,t,i,r,n)}function lt(e){Z.call(this),this.type="SpriteMaterial",this.color=new Y(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(e)}function ht(e){ce.call(this),this.type="Sprite",this.material=void 0!==e?e:new lt}function dt(){ce.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function pt(e,t,i){if(this.useVertexTexture=void 0===i||i,this.identityMatrix=new u,e=e||[],this.bones=e.slice(0),this.useVertexTexture){var r=Math.sqrt(4*this.bones.length);r=Ja.nextPowerOfTwo(Math.ceil(r)),r=Math.max(r,4),this.boneTextureWidth=r,this.boneTextureHeight=r,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new V(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,fa,aa)}else this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[];for(var n=0,o=this.bones.length;n<o;n++)this.boneInverses.push(new u)}}function ft(){ce.call(this),this.type="Bone"}function mt(e,t,i){Ne.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new u,this.bindMatrixInverse=new u;var r=[];if(this.geometry&&void 0!==this.geometry.bones){for(var n,o,a=0,s=this.geometry.bones.length;a<s;++a)o=this.geometry.bones[a],n=new ft,r.push(n),n.name=o.name,n.position.fromArray(o.pos),n.quaternion.fromArray(o.rotq),void 0!==o.scl&&n.scale.fromArray(o.scl);for(var a=0,s=this.geometry.bones.length;a<s;++a)o=this.geometry.bones[a],o.parent!==-1&&null!==o.parent&&void 0!==r[o.parent]?r[o.parent].add(r[a]):this.add(r[a])}this.normalizeSkinWeights(),this.updateMatrixWorld(!0),this.bind(new pt(r,void 0,i),this.matrixWorld)}function gt(e){Z.call(this),this.type="LineBasicMaterial",this.color=new Y(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(e)}function vt(e,t,i){return 1===i?(console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new yt(e,t)):(ce.call(this),this.type="Line",this.geometry=void 0!==e?e:new Le,void(this.material=void 0!==t?t:new gt({color:16777215*Math.random()})))}function yt(e,t){vt.call(this,e,t),this.type="LineSegments"}function Mt(e){Z.call(this),this.type="PointsMaterial",this.color=new Y(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.lights=!1,this.setValues(e)}function At(e,t){ce.call(this),this.type="Points",this.geometry=void 0!==e?e:new Le,this.material=void 0!==t?t:new Mt({color:16777215*Math.random()})}function wt(){ce.call(this),this.type="Group"}function xt(e,t,i,n,o,a,s,c,u){function l(){requestAnimationFrame(l),e.readyState>=e.HAVE_CURRENT_DATA&&(h.needsUpdate=!0)}r.call(this,e,t,i,n,o,a,s,c,u),this.generateMipmaps=!1;var h=this;l()}function Et(e,t,i,n,o,a,s,c,u,l,h,d){r.call(this,null,a,s,c,u,l,n,o,h,d),this.image={width:t,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function bt(e,t,i,n,o,a,s,c,u){r.call(this,e,t,i,n,o,a,s,c,u),this.needsUpdate=!0}function Tt(e,t,i,n,o,a,s,c,u,l){if(l=void 0!==l?l:ya,l!==ya&&l!==Ma)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&l===ya&&(i=ra),void 0===i&&l===Ma&&(i=ha),r.call(this,null,n,o,a,s,c,l,i,u),this.image={width:e,height:t},this.magFilter=void 0!==s?s:Wo,this.minFilter=void 0!==c?c:Wo,this.flipY=!1,this.generateMipmaps=!1}function Lt(e){function t(e,t){return e-t}Le.call(this);var i=[0,0],r={},n=["a","b","c"];if(e&&e.isGeometry){for(var o=e.vertices,a=e.faces,s=0,c=new Uint32Array(6*a.length),u=0,l=a.length;u<l;u++)for(var h=a[u],d=0;d<3;d++){i[0]=h[n[d]],i[1]=h[n[(d+1)%3]],i.sort(t);var p=i.toString();void 0===r[p]&&(c[2*s]=i[0],c[2*s+1]=i[1],r[p]=!0,s++)}for(var f=new Float32Array(2*s*3),u=0,l=s;u<l;u++)for(var d=0;d<2;d++){var m=o[c[2*u+d]],g=6*u+3*d;f[g+0]=m.x,f[g+1]=m.y,f[g+2]=m.z}this.addAttribute("position",new pe(f,3))}else if(e&&e.isBufferGeometry)if(null!==e.index){var v=e.index.array,o=e.attributes.position,y=e.groups,s=0;0===y.length&&e.addGroup(0,v.length);for(var c=new Uint32Array(2*v.length),M=0,A=y.length;M<A;++M)for(var w=y[M],x=w.start,E=w.count,u=x,b=x+E;u<b;u+=3)for(var d=0;d<3;d++){i[0]=v[u+d],i[1]=v[u+(d+1)%3],i.sort(t);var p=i.toString();void 0===r[p]&&(c[2*s]=i[0],c[2*s+1]=i[1],r[p]=!0,s++)}for(var f=new Float32Array(2*s*3),u=0,l=s;u<l;u++)for(var d=0;d<2;d++){var g=6*u+3*d,T=c[2*u+d];f[g+0]=o.getX(T),f[g+1]=o.getY(T),f[g+2]=o.getZ(T)}this.addAttribute("position",new pe(f,3))}else{for(var o=e.attributes.position.array,s=o.length/3,L=s/3,f=new Float32Array(2*s*3),u=0,l=L;u<l;u++)for(var d=0;d<3;d++){var g=18*u+6*d,N=9*u+3*d;f[g+0]=o[N],f[g+1]=o[N+1],f[g+2]=o[N+2];var T=9*u+3*((d+1)%3);f[g+3]=o[T],f[g+4]=o[T+1],f[g+5]=o[T+2]}this.addAttribute("position",new pe(f,3))}}function Nt(e,t,i){Le.call(this),this.type="ParametricBufferGeometry",this.parameters={func:e,slices:t,stacks:i};var r,n,o,a,s,c=[],u=[],l=t+1;for(r=0;r<=i;r++)for(s=r/i,n=0;n<=t;n++)a=n/t,o=e(a,s),c.push(o.x,o.y,o.z),u.push(a,s);var h,d,p,f,m=[];for(r=0;r<i;r++)for(n=0;n<t;n++)h=r*l+n,d=r*l+n+1,p=(r+1)*l+n+1,f=(r+1)*l+n,m.push(h,d,f),m.push(d,p,f);this.setIndex(new(m.length>65535?Ae:ye)(m,1)),this.addAttribute("position",new we(c,3)),this.addAttribute("uv",new we(u,2)),this.computeVertexNormals()}function Dt(e,t,i){be.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:i},this.fromBufferGeometry(new Nt(e,t,i)),this.mergeVertices()}function St(e,t,r,n){function o(e){for(var i=new c,r=new c,n=new c,o=0;o<t.length;o+=3)d(t[o+0],i),d(t[o+1],r),d(t[o+2],n),a(i,r,n,e)}function a(e,t,i,r){var n,o,a=Math.pow(2,r),s=[];for(n=0;n<=a;n++){s[n]=[];var c=e.clone().lerp(i,n/a),u=t.clone().lerp(i,n/a),l=a-n;for(o=0;o<=l;o++)0===o&&n===a?s[n][o]=c:s[n][o]=c.clone().lerp(u,o/l)}for(n=0;n<a;n++)for(o=0;o<2*(a-n)-1;o++){var d=Math.floor(o/2);o%2===0?(h(s[n][d+1]),h(s[n+1][d]),h(s[n][d])):(h(s[n][d+1]),h(s[n+1][d+1]),h(s[n+1][d]))}}function s(e){for(var t=new c,i=0;i<v.length;i+=3)t.x=v[i+0],t.y=v[i+1],t.z=v[i+2],t.normalize().multiplyScalar(e),v[i+0]=t.x,v[i+1]=t.y,v[i+2]=t.z}function u(){for(var e=new c,t=0;t<v.length;t+=3){e.x=v[t+0],e.y=v[t+1],e.z=v[t+2];var i=m(e)/2/Math.PI+.5,r=g(e)/Math.PI+.5;y.push(i,1-r)}p(),l()}function l(){for(var e=0;e<y.length;e+=6){var t=y[e+0],i=y[e+2],r=y[e+4],n=Math.max(t,i,r),o=Math.min(t,i,r);n>.9&&o<.1&&(t<.2&&(y[e+0]+=1),i<.2&&(y[e+2]+=1),r<.2&&(y[e+4]+=1))}}function h(e){v.push(e.x,e.y,e.z)}function d(t,i){var r=3*t;i.x=e[r+0],i.y=e[r+1],i.z=e[r+2]}function p(){for(var e=new c,t=new c,r=new c,n=new c,o=new i,a=new i,s=new i,u=0,l=0;u<v.length;u+=9,l+=6){e.set(v[u+0],v[u+1],v[u+2]),t.set(v[u+3],v[u+4],v[u+5]),r.set(v[u+6],v[u+7],v[u+8]),o.set(y[l+0],y[l+1]),a.set(y[l+2],y[l+3]),s.set(y[l+4],y[l+5]),n.copy(e).add(t).add(r).divideScalar(3);var h=m(n);f(o,l+0,e,h),f(a,l+2,t,h),f(s,l+4,r,h)}}function f(e,t,i,r){r<0&&1===e.x&&(y[t]=e.x-1),0===i.x&&0===i.z&&(y[t]=r/2/Math.PI+.5)}function m(e){return Math.atan2(e.z,-e.x)}function g(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}Le.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:e,indices:t,radius:r,detail:n},r=r||1,n=n||0;var v=[],y=[];o(n),s(r),u(),this.addAttribute("position",new we(v,3)),this.addAttribute("normal",new we(v.slice(),3)),this.addAttribute("uv",new we(y,2)),this.normalizeNormals(),this.boundingSphere=new ee(new c,r)}function It(e,t){var i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];St.call(this,i,r,e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Ct(e,t){be.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new It(e,t)),this.mergeVertices()}function _t(e,t){var i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];St.call(this,i,r,e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function jt(e,t){be.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new _t(e,t)),this.mergeVertices()}function Ot(e,t){var i=(1+Math.sqrt(5))/2,r=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],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];St.call(this,r,n,e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function zt(e,t){be.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Ot(e,t)),this.mergeVertices()}function Rt(e,t){var i=(1+Math.sqrt(5))/2,r=1/i,n=[-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,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],o=[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];St.call(this,n,o,e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function kt(e,t){be.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Rt(e,t)),this.mergeVertices()}function Ut(e,t,i,r){be.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:i,detail:r},this.fromBufferGeometry(new St(e,t,i,r)),this.mergeVertices()}function Pt(e,t,r,n,o){function a(){for(d=0;d<t;d++)s(d);s(o===!1?t:0),l(),u()}function s(i){var o=e.getPointAt(i/t),a=h.normals[i],s=h.binormals[i];for(p=0;p<=n;p++){var c=p/n*Math.PI*2,u=Math.sin(c),l=-Math.cos(c);m.x=l*a.x+u*s.x,m.y=l*a.y+u*s.y,m.z=l*a.z+u*s.z,m.normalize(),y.push(m.x,m.y,m.z),f.x=o.x+r*m.x,f.y=o.y+r*m.y,f.z=o.z+r*m.z,v.push(f.x,f.y,f.z)}}function u(){for(p=1;p<=t;p++)for(d=1;d<=n;d++){var e=(n+1)*(p-1)+(d-1),i=(n+1)*p+(d-1),r=(n+1)*p+d,o=(n+1)*(p-1)+d;A.push(e,i,o),A.push(i,r,o)}}function l(){for(d=0;d<=t;d++)for(p=0;p<=n;p++)g.x=d/t,g.y=p/n,M.push(g.x,g.y)}Le.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:r,radialSegments:n,closed:o},t=t||64,r=r||1,n=n||8,o=o||!1;var h=e.computeFrenetFrames(t,o);this.tangents=h.tangents,this.normals=h.normals,this.binormals=h.binormals;var d,p,f=new c,m=new c,g=new i,v=[],y=[],M=[],A=[];a(),this.setIndex(new(A.length>65535?Ae:ye)(A,1)),this.addAttribute("position",new we(v,3)),this.addAttribute("normal",new we(y,3)),this.addAttribute("uv",new we(M,2))}function Bt(e,t,i,r,n,o){be.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:i,radialSegments:r,closed:n},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");var a=new Pt(e,t,i,r,n);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function Ft(e,t,r,n,o,a){function s(e,t,i,r,n){var o=Math.cos(e),a=Math.sin(e),s=i/t*e,c=Math.cos(s);n.x=r*(2+c)*.5*o,n.y=r*(2+c)*a*.5,n.z=r*Math.sin(s)*.5}Le.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:e,tube:t,tubularSegments:r,radialSegments:n,p:o,q:a},e=e||100,t=t||40,r=Math.floor(r)||64,n=Math.floor(n)||8,o=o||2,a=a||3;var u,l,h=(n+1)*(r+1),d=n*r*2*3,p=new pe(new(d>65535?Uint32Array:Uint16Array)(d),1),f=new pe(new Float32Array(3*h),3),m=new pe(new Float32Array(3*h),3),g=new pe(new Float32Array(2*h),2),v=0,y=0,M=new c,A=new c,w=new i,x=new c,E=new c,b=new c,T=new c,L=new c;for(u=0;u<=r;++u){var N=u/r*o*Math.PI*2;for(s(N,o,a,e,x),s(N+.01,o,a,e,E),T.subVectors(E,x),L.addVectors(E,x),b.crossVectors(T,L),L.crossVectors(b,T),b.normalize(),L.normalize(),l=0;l<=n;++l){var D=l/n*Math.PI*2,S=-t*Math.cos(D),I=t*Math.sin(D);M.x=x.x+(S*L.x+I*b.x),M.y=x.y+(S*L.y+I*b.y),M.z=x.z+(S*L.z+I*b.z),f.setXYZ(v,M.x,M.y,M.z),A.subVectors(M,x).normalize(),m.setXYZ(v,A.x,A.y,A.z),w.x=u/r,w.y=l/n,g.setXY(v,w.x,w.y),v++}}for(l=1;l<=r;l++)for(u=1;u<=n;u++){var C=(n+1)*(l-1)+(u-1),_=(n+1)*l+(u-1),j=(n+1)*l+u,O=(n+1)*(l-1)+u;p.setX(y,C),y++,p.setX(y,_),y++,p.setX(y,O),y++,p.setX(y,_),y++,p.setX(y,j),y++,p.setX(y,O),y++}this.setIndex(p),this.addAttribute("position",f),this.addAttribute("normal",m),this.addAttribute("uv",g)}function Gt(e,t,i,r,n,o,a){be.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:i,radialSegments:r,p:n,q:o},void 0!==a&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Ft(e,t,i,r,n,o)),this.mergeVertices()}function Ht(e,t,i,r,n){Le.call(this),this.type="TorusBufferGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:n},e=e||100,t=t||40,i=Math.floor(i)||8,r=Math.floor(r)||6,n=n||2*Math.PI;var o,a,s=(i+1)*(r+1),u=i*r*2*3,l=new(u>65535?Uint32Array:Uint16Array)(u),h=new Float32Array(3*s),d=new Float32Array(3*s),p=new Float32Array(2*s),f=0,m=0,g=0,v=new c,y=new c,M=new c;for(o=0;o<=i;o++)for(a=0;a<=r;a++){var A=a/r*n,w=o/i*Math.PI*2;y.x=(e+t*Math.cos(w))*Math.cos(A),y.y=(e+t*Math.cos(w))*Math.sin(A),y.z=t*Math.sin(w),h[f]=y.x,h[f+1]=y.y,h[f+2]=y.z,v.x=e*Math.cos(A),v.y=e*Math.sin(A),M.subVectors(y,v).normalize(),d[f]=M.x,d[f+1]=M.y,d[f+2]=M.z,p[m]=a/r,p[m+1]=o/i,f+=3,m+=2}for(o=1;o<=i;o++)for(a=1;a<=r;a++){var x=(r+1)*o+a-1,E=(r+1)*(o-1)+a-1,b=(r+1)*(o-1)+a,T=(r+1)*o+a;l[g]=x,l[g+1]=E,l[g+2]=T,l[g+3]=E,l[g+4]=b,l[g+5]=T,g+=6}this.setIndex(new pe(l,1)),this.addAttribute("position",new pe(h,3)),this.addAttribute("normal",new pe(d,3)),this.addAttribute("uv",new pe(p,2))}function Qt(e,t,i,r,n){be.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:i,tubularSegments:r,arc:n},this.fromBufferGeometry(new Ht(e,t,i,r,n))}function Yt(e,t){return"undefined"==typeof e?void(e=[]):(be.call(this),this.type="ExtrudeGeometry",e=Array.isArray(e)?e:[e],this.addShapeList(e,t),void this.computeFaceNormals())}function Vt(e,t){t=t||{};var i=t.font;if((i&&i.isFont)===!1)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new be;var r=i.generateShapes(e,t.size,t.curveSegments);t.amount=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),Yt.call(this,r,t),this.type="TextGeometry"}function Wt(e,t,i,r,n,o,a){Le.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:n,thetaStart:o,thetaLength:a},e=e||50,t=Math.max(3,Math.floor(t)||8),i=Math.max(2,Math.floor(i)||6),r=void 0!==r?r:0,n=void 0!==n?n:2*Math.PI,o=void 0!==o?o:0,a=void 0!==a?a:Math.PI;for(var s=o+a,u=(t+1)*(i+1),l=new pe(new Float32Array(3*u),3),h=new pe(new Float32Array(3*u),3),d=new pe(new Float32Array(2*u),2),p=0,f=[],m=new c,g=0;g<=i;g++){for(var v=[],y=g/i,M=0;M<=t;M++){var A=M/t,w=-e*Math.cos(r+A*n)*Math.sin(o+y*a),x=e*Math.cos(o+y*a),E=e*Math.sin(r+A*n)*Math.sin(o+y*a);m.set(w,x,E).normalize(),l.setXYZ(p,w,x,E),h.setXYZ(p,m.x,m.y,m.z),d.setXY(p,A,1-y),v.push(p),p++}f.push(v)}for(var b=[],g=0;g<i;g++)for(var M=0;M<t;M++){var T=f[g][M+1],L=f[g][M],N=f[g+1][M],D=f[g+1][M+1];(0!==g||o>0)&&b.push(T,L,D),(g!==i-1||s<Math.PI)&&b.push(L,N,D)}this.setIndex(new(l.count>65535?Ae:ye)(b,1)),this.addAttribute("position",l),this.addAttribute("normal",h),this.addAttribute("uv",d),this.boundingSphere=new ee(new c,e)}function Xt(e,t,i,r,n,o,a){be.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:i,phiStart:r,phiLength:n,thetaStart:o,thetaLength:a},this.fromBufferGeometry(new Wt(e,t,i,r,n,o,a))}function qt(e,t,r,n,o,a){Le.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:r,phiSegments:n,thetaStart:o,thetaLength:a},e=e||20,t=t||50,o=void 0!==o?o:0,a=void 0!==a?a:2*Math.PI,r=void 0!==r?Math.max(3,r):8,n=void 0!==n?Math.max(1,n):1;var s,u,l,h=(r+1)*(n+1),d=r*n*2*3,p=new pe(new(d>65535?Uint32Array:Uint16Array)(d),1),f=new pe(new Float32Array(3*h),3),m=new pe(new Float32Array(3*h),3),g=new pe(new Float32Array(2*h),2),v=0,y=0,M=e,A=(t-e)/n,w=new c,x=new i;for(u=0;u<=n;u++){for(l=0;l<=r;l++)s=o+l/r*a,w.x=M*Math.cos(s),w.y=M*Math.sin(s),f.setXYZ(v,w.x,w.y,w.z),m.setXYZ(v,0,0,1),x.x=(w.x/t+1)/2,x.y=(w.y/t+1)/2,g.setXY(v,x.x,x.y),v++;M+=A}for(u=0;u<n;u++){var E=u*(r+1);for(l=0;l<r;l++){s=l+E;var b=s,T=s+r+1,L=s+r+2,N=s+1;p.setX(y,b),y++,p.setX(y,T),y++,p.setX(y,L),y++,p.setX(y,b),y++,p.setX(y,L),y++,p.setX(y,N),y++}}this.setIndex(p),this.addAttribute("position",f),this.addAttribute("normal",m),this.addAttribute("uv",g)}function Zt(e,t,i,r,n,o){be.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:i,phiSegments:r,thetaStart:n,thetaLength:o},this.fromBufferGeometry(new qt(e,t,i,r,n,o))}function Jt(e,t,i,r){be.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:i,heightSegments:r},this.fromBufferGeometry(new Se(e,t,i,r))}function Kt(e,t,r,n){Le.call(this),this.type="LatheBufferGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:n},t=Math.floor(t)||12,r=r||0,n=n||2*Math.PI,n=Ja.clamp(n,0,2*Math.PI);var o,a,s,u=(t+1)*e.length,l=t*e.length*2*3,h=new pe(new(l>65535?Uint32Array:Uint16Array)(l),1),d=new pe(new Float32Array(3*u),3),p=new pe(new Float32Array(2*u),2),f=0,m=0,g=1/t,v=new c,y=new i;for(a=0;a<=t;a++){var M=r+a*g*n,A=Math.sin(M),w=Math.cos(M);for(s=0;s<=e.length-1;s++)v.x=e[s].x*A,v.y=e[s].y,v.z=e[s].x*w,d.setXYZ(f,v.x,v.y,v.z),y.x=a/t,y.y=s/(e.length-1),p.setXY(f,y.x,y.y),f++}for(a=0;a<t;a++)for(s=0;s<e.length-1;s++){o=s+a*e.length;var x=o,E=o+e.length,b=o+e.length+1,T=o+1;h.setX(m,x),m++,h.setX(m,E),m++,h.setX(m,T),m++,h.setX(m,E),m++,h.setX(m,b),m++,h.setX(m,T),m++}if(this.setIndex(h),this.addAttribute("position",d),this.addAttribute("uv",p),this.computeVertexNormals(),n===2*Math.PI){var L=this.attributes.normal.array,N=new c,D=new c,S=new c;for(o=t*e.length*3,a=0,s=0;a<e.length;a++,s+=3)N.x=L[s+0],N.y=L[s+1],N.z=L[s+2],D.x=L[o+s+0],D.y=L[o+s+1],D.z=L[o+s+2],S.addVectors(N,D).normalize(),L[s+0]=L[o+s+0]=S.x,L[s+1]=L[o+s+1]=S.y,L[s+2]=L[o+s+2]=S.z}}function $t(e,t,i,r){be.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:i,phiLength:r},this.fromBufferGeometry(new Kt(e,t,i,r)),this.mergeVertices()}function ei(e,t){function i(e){var i,s,u,l=r.length/3,h=e.extractPoints(t),d=h.shape,p=h.holes;if(hu.isClockWise(d)===!1)for(d=d.reverse(),i=0,s=p.length;i<s;i++)u=p[i],hu.isClockWise(u)===!0&&(p[i]=u.reverse());var f=hu.triangulateShape(d,p);for(i=0,s=p.length;i<s;i++)u=p[i],d=d.concat(u);for(i=0,s=d.length;i<s;i++){var m=d[i];r.push(m.x,m.y,0),n.push(0,0,1),o.push(m.x,m.y)}for(i=0,s=f.length;i<s;i++){var g=f[i],v=g[0]+l,y=g[1]+l,M=g[2]+l;a.push(v,y,M),c+=3}}Le.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:e,curveSegments:t},t=t||12;var r=[],n=[],o=[],a=[],s=0,c=0;if(Array.isArray(e)===!1)i(e);else for(var u=0;u<e.length;u++)i(e[u]),this.addGroup(s,c,u),s+=c,c=0;this.setIndex(new(a.length>65535?Ae:ye)(a,1)),this.addAttribute("position",new we(r,3)),this.addAttribute("normal",new we(n,3)),this.addAttribute("uv",new we(o,2))}function ti(e,t){be.call(this),this.type="ShapeGeometry","object"==typeof t&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),t=t.curveSegments),this.parameters={shapes:e,curveSegments:t},this.fromBufferGeometry(new ei(e,t)),this.mergeVertices()}function ii(e,t){function i(e,t){return e-t}Le.call(this),t=void 0!==t?t:1;var r,n=Math.cos(Ja.DEG2RAD*t),o=[0,0],a={},s=["a","b","c"];e.isBufferGeometry?(r=new be,r.fromBufferGeometry(e)):r=e.clone(),r.mergeVertices(),r.computeFaceNormals();for(var c=r.vertices,u=r.faces,l=0,h=u.length;l<h;l++)for(var d=u[l],p=0;p<3;p++){o[0]=d[s[p]],o[1]=d[s[(p+1)%3]],o.sort(i);var f=o.toString();void 0===a[f]?a[f]={vert1:o[0],vert2:o[1],face1:l,face2:void 0}:a[f].face2=l}var m=[];for(var f in a){var g=a[f];if(void 0===g.face2||u[g.face1].normal.dot(u[g.face2].normal)<=n){var v=c[g.vert1];m.push(v.x),m.push(v.y),m.push(v.z),v=c[g.vert2],m.push(v.x),m.push(v.y),m.push(v.z)}}this.addAttribute("position",new we(m,3))}function ri(e,t,r,n,o,a,s,u){function l(){var e=(n+1)*(o+1);return a===!1&&(e+=(n+1)*m+n*m),e}function h(){var e=n*o*2*3;return a===!1&&(e+=n*m*3),e}function d(){var i,a,l=new c,h=new c,d=0,p=(t-e)/r;for(a=0;a<=o;a++){var m=[],g=a/o,v=g*(t-e)+e;for(i=0;i<=n;i++){var N=i/n,D=N*u+s,S=Math.sin(D),I=Math.cos(D);h.x=v*S,h.y=-g*r+T,h.z=v*I,M.setXYZ(x,h.x,h.y,h.z),l.set(S,p,I).normalize(),A.setXYZ(x,l.x,l.y,l.z),w.setXY(x,N,1-g),m.push(x),x++}b.push(m)}for(i=0;i<n;i++)for(a=0;a<o;a++){var C=b[a][i],_=b[a+1][i],j=b[a+1][i+1],O=b[a][i+1];y.setX(E,C),E++,y.setX(E,_),E++,y.setX(E,O),E++,y.setX(E,_),E++,y.setX(E,j),E++,y.setX(E,O),E++,d+=6}f.addGroup(L,d,0),L+=d}function p(r){var o,a,l,h=new i,d=new c,p=0,m=r===!0?e:t,g=r===!0?1:-1;for(a=x,o=1;o<=n;o++)M.setXYZ(x,0,T*g,0),A.setXYZ(x,0,g,0),h.x=.5,h.y=.5,w.setXY(x,h.x,h.y),x++;for(l=x,o=0;o<=n;o++){var v=o/n,b=v*u+s,N=Math.cos(b),D=Math.sin(b);d.x=m*D,d.y=T*g,d.z=m*N,M.setXYZ(x,d.x,d.y,d.z),A.setXYZ(x,0,g,0),h.x=.5*N+.5,h.y=.5*D*g+.5,w.setXY(x,h.x,h.y),x++}for(o=0;o<n;o++){var S=a+o,I=l+o;r===!0?(y.setX(E,I),E++,y.setX(E,I+1),E++,y.setX(E,S),E++):(y.setX(E,I+1),E++,y.setX(E,I),E++,y.setX(E,S),E++),p+=3}f.addGroup(L,p,r===!0?1:2),L+=p}Le.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:r,radialSegments:n,heightSegments:o,openEnded:a,thetaStart:s,thetaLength:u};var f=this;e=void 0!==e?e:20,t=void 0!==t?t:20,r=void 0!==r?r:100,n=Math.floor(n)||8,o=Math.floor(o)||1,a=void 0!==a&&a,s=void 0!==s?s:0,u=void 0!==u?u:2*Math.PI;var m=0;a===!1&&(e>0&&m++,t>0&&m++);var g=l(),v=h(),y=new pe(new(v>65535?Uint32Array:Uint16Array)(v),1),M=new pe(new Float32Array(3*g),3),A=new pe(new Float32Array(3*g),3),w=new pe(new Float32Array(2*g),2),x=0,E=0,b=[],T=r/2,L=0;d(),a===!1&&(e>0&&p(!0),t>0&&p(!1)),this.setIndex(y),this.addAttribute("position",M),this.addAttribute("normal",A),this.addAttribute("uv",w)}function ni(e,t,i,r,n,o,a,s){be.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:i,radialSegments:r,heightSegments:n,openEnded:o,thetaStart:a,thetaLength:s},this.fromBufferGeometry(new ri(e,t,i,r,n,o,a,s)),this.mergeVertices()}function oi(e,t,i,r,n,o,a){ni.call(this,0,e,t,i,r,n,o,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:n,thetaStart:o,thetaLength:a}}function ai(e,t,i,r,n,o,a){ri.call(this,0,e,t,i,r,n,o,a),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:i,heightSegments:r,openEnded:n,thetaStart:o,thetaLength:a}}function si(e,t,i,r){Le.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},e=e||50,t=void 0!==t?Math.max(3,t):8,i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI;var n=t+2,o=new Float32Array(3*n),a=new Float32Array(3*n),s=new Float32Array(2*n);a[2]=1,s[0]=.5,s[1]=.5;for(var u=0,l=3,h=2;u<=t;u++,l+=3,h+=2){var d=i+u/t*r;o[l]=e*Math.cos(d),o[l+1]=e*Math.sin(d),a[l+2]=1,s[h]=(o[l]/e+1)/2,s[h+1]=(o[l+1]/e+1)/2}for(var p=[],l=1;l<=t;l++)p.push(l,l+1,0);this.setIndex(new pe(new Uint16Array(p),1)),this.addAttribute("position",new pe(o,3)),this.addAttribute("normal",new pe(a,3)),this.addAttribute("uv",new pe(s,2)),this.boundingSphere=new ee(new c,e)}function ci(e,t,i,r){be.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:i,thetaLength:r},this.fromBufferGeometry(new si(e,t,i,r))}function ui(e,t,i,r,n,o){be.call(this),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:i,widthSegments:r,heightSegments:n,depthSegments:o},this.fromBufferGeometry(new De(e,t,i,r,n,o)),this.mergeVertices()}function li(){J.call(this,{uniforms:ns.merge([ou.lights,{opacity:{value:1}}]),vertexShader:ru.shadow_vert,fragmentShader:ru.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}}})}function hi(e){J.call(this,e),this.type="RawShaderMaterial"}function di(e){this.uuid=Ja.generateUUID(),this.type="MultiMaterial",this.materials=Array.isArray(e)?e:[],this.visible=!0}function pi(e){Z.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Y(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 Y(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 fi(e){pi.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(e)}function mi(e){Z.call(this),this.type="MeshPhongMaterial",this.color=new Y(16777215),this.specular=new Y(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Y(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=Lo,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 gi(e){mi.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(e)}function vi(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 yi(e){Z.call(this),this.type="MeshLambertMaterial",this.color=new Y(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Y(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Lo,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 Mi(e){Z.call(this),this.type="LineDashedMaterial",this.color=new Y(16777215),this.linewidth=1,this.scale=1,this.dashSize=3,this.gapSize=1,this.lights=!1,this.setValues(e)}function Ai(e,t,i){var r=this,n=!1,o=0,a=0;this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=i,this.itemStart=function(e){a++,n===!1&&void 0!==r.onStart&&r.onStart(e,o,a),n=!0},this.itemEnd=function(e){o++,void 0!==r.onProgress&&r.onProgress(e,o,a),o===a&&(n=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)}}function wi(e){this.manager=void 0!==e?e:mu}function xi(e){this.manager=void 0!==e?e:mu,this._parser=null}function Ei(e){this.manager=void 0!==e?e:mu,this._parser=null}function bi(e){this.manager=void 0!==e?e:mu}function Ti(e){this.manager=void 0!==e?e:mu}function Li(e){this.manager=void 0!==e?e:mu}function Ni(e,t){ce.call(this),this.type="Light",this.color=new Y(e),this.intensity=void 0!==t?t:1,this.receiveShadow=void 0}function Di(e,t,i){Ni.call(this,e,i),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(ce.DefaultUp),this.updateMatrix(),this.groundColor=new Y(t)}function Si(e){this.camera=e,this.bias=0,this.radius=1,this.mapSize=new i(512,512),this.map=null,this.matrix=new u}function Ii(){Si.call(this,new Ce(50,1,.5,500))}function Ci(e,t,i,r,n,o){Ni.call(this,e,t),this.type="SpotLight",this.position.copy(ce.DefaultUp),this.updateMatrix(),this.target=new ce,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(e){this.intensity=e/Math.PI}}),this.distance=void 0!==i?i:0,this.angle=void 0!==r?r:Math.PI/3,this.penumbra=void 0!==n?n:0,this.decay=void 0!==o?o:1,this.shadow=new Ii}function _i(e,t,i,r){Ni.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!==i?i:0,this.decay=void 0!==r?r:1,this.shadow=new Si(new Ce(90,1,.5,500))}function ji(e){Si.call(this,new _e(-5,5,5,-5,.5,500))}function Oi(e,t){Ni.call(this,e,t),this.type="DirectionalLight",this.position.copy(ce.DefaultUp),this.updateMatrix(),this.target=new ce,this.shadow=new ji}function zi(e,t){Ni.call(this,e,t),this.type="AmbientLight",this.castShadow=void 0}function Ri(e,t,i,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=void 0!==r?r:new t.constructor(i),this.sampleValues=t,this.valueSize=i}function ki(e,t,i,r){Ri.call(this,e,t,i,r),this._weightPrev=-0,
  this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function Ui(e,t,i,r){Ri.call(this,e,t,i,r)}function Pi(e,t,i,r){Ri.call(this,e,t,i,r)}function Bi(e,t,i,r){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=vu.convertArray(t,this.TimeBufferType),this.values=vu.convertArray(i,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation),this.validate(),this.optimize()}function Fi(e,t,i,r){Bi.call(this,e,t,i,r)}function Gi(e,t,i,r){Ri.call(this,e,t,i,r)}function Hi(e,t,i,r){Bi.call(this,e,t,i,r)}function Qi(e,t,i,r){Bi.call(this,e,t,i,r)}function Yi(e,t,i,r){Bi.call(this,e,t,i,r)}function Vi(e,t,i){Bi.call(this,e,t,i)}function Wi(e,t,i,r){Bi.call(this,e,t,i,r)}function Xi(e,t,i,r){Bi.apply(this,arguments)}function qi(e,t,i){this.name=e,this.tracks=i,this.duration=void 0!==t?t:-1,this.uuid=Ja.generateUUID(),this.duration<0&&this.resetDuration(),this.optimize()}function Zi(e){this.manager=void 0!==e?e:mu,this.textures={}}function Ji(e){this.manager=void 0!==e?e:mu}function Ki(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}}function $i(e){"boolean"==typeof e&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),e=void 0),this.manager=void 0!==e?e:mu,this.withCredentials=!1}function er(e){this.manager=void 0!==e?e:mu,this.texturePath=""}function tr(){}function ir(e,t){this.v1=e,this.v2=t}function rr(){this.curves=[],this.autoClose=!1}function nr(e,t,i,r,n,o,a,s){this.aX=e,this.aY=t,this.xRadius=i,this.yRadius=r,this.aStartAngle=n,this.aEndAngle=o,this.aClockwise=a,this.aRotation=s||0}function or(e){this.points=void 0===e?[]:e}function ar(e,t,i,r){this.v0=e,this.v1=t,this.v2=i,this.v3=r}function sr(e,t,i){this.v0=e,this.v1=t,this.v2=i}function cr(){ur.apply(this,arguments),this.holes=[]}function ur(e){rr.call(this),this.currentPoint=new i,e&&this.fromPoints(e)}function lr(){this.subPaths=[],this.currentPath=null}function hr(e){this.data=e}function dr(e){this.manager=void 0!==e?e:mu}function pr(e){this.manager=void 0!==e?e:mu}function fr(e,t,i,r){Ni.call(this,e,t),this.type="RectAreaLight",this.position.set(0,1,0),this.updateMatrix(),this.width=void 0!==i?i:10,this.height=void 0!==r?r:10}function mr(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Ce,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Ce,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function gr(e,t,i){ce.call(this),this.type="CubeCamera";var r=90,n=1,o=new Ce(r,n,e,t);o.up.set(0,-1,0),o.lookAt(new c(1,0,0)),this.add(o);var s=new Ce(r,n,e,t);s.up.set(0,-1,0),s.lookAt(new c(-1,0,0)),this.add(s);var u=new Ce(r,n,e,t);u.up.set(0,0,1),u.lookAt(new c(0,1,0)),this.add(u);var l=new Ce(r,n,e,t);l.up.set(0,0,-1),l.lookAt(new c(0,-1,0)),this.add(l);var h=new Ce(r,n,e,t);h.up.set(0,-1,0),h.lookAt(new c(0,0,1)),this.add(h);var d=new Ce(r,n,e,t);d.up.set(0,-1,0),d.lookAt(new c(0,0,-1)),this.add(d);var p={format:pa,magFilter:Zo,minFilter:Zo};this.renderTarget=new a(i,i,p),this.updateCubeMap=function(e,t){null===this.parent&&this.updateMatrixWorld();var i=this.renderTarget,r=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,i.activeCubeFace=0,e.render(t,o,i),i.activeCubeFace=1,e.render(t,s,i),i.activeCubeFace=2,e.render(t,u,i),i.activeCubeFace=3,e.render(t,l,i),i.activeCubeFace=4,e.render(t,h,i),i.texture.generateMipmaps=r,i.activeCubeFace=5,e.render(t,d,i),e.setRenderTarget(null)}}function vr(){ce.call(this),this.type="AudioListener",this.context=xu.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function yr(e){ce.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 Mr(e){yr.call(this,e),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function Ar(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 wr(e,t,i){this.binding=e,this.valueSize=i;var r,n=Float64Array;switch(t){case"quaternion":r=this._slerp;break;case"string":case"bool":n=Array,r=this._select;break;default:r=this._lerp}this.buffer=new n(4*i),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function xr(e,t,i){this.path=t,this.parsedPath=i||xr.parseTrackName(t),this.node=xr.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function Er(e){this.uuid=Ja.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var i=0,r=arguments.length;i!==r;++i)t[arguments[i].uuid]=i;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}}function br(e,t,i){this._mixer=e,this._clip=t,this._localRoot=i||null;for(var r=t.tracks,n=r.length,o=new Array(n),a={endingStart:za,endingEnd:za},s=0;s!==n;++s){var c=r[s].createInterpolant(null);o[s]=c,c.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(n),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Ia,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 Tr(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Lr(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}function Nr(){Le.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Dr(e,t,i,r){this.uuid=Ja.generateUUID(),this.data=e,this.itemSize=t,this.offset=i,this.normalized=r===!0}function Sr(e,t){this.uuid=Ja.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 Ir(e,t,i){Sr.call(this,e,t),this.meshPerAttribute=i||1}function Cr(e,t,i){pe.call(this,e,t),this.meshPerAttribute=i||1}function _r(e,t,i,r){this.ray=new oe(e,t),this.near=i||0,this.far=r||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 jr(e,t){return e.distance-t.distance}function Or(e,t,i,r){if(e.visible!==!1&&(e.raycast(t,i),r===!0))for(var n=e.children,o=0,a=n.length;o<a;o++)Or(n[o],t,i,!0)}function zr(e){this.autoStart=void 0===e||e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function Rr(e){function t(e,t,i,r,n,o,a){var s=.5*(i-e),c=.5*(r-t);return(2*(t-i)+s+c)*a+(-3*(t-i)-2*s-c)*o+s*n+t}this.points=e;var i,r,n,o,a,s,u,l,h,d=[],p={x:0,y:0,z:0};this.initFromArray=function(e){this.points=[];for(var t=0;t<e.length;t++)this.points[t]={x:e[t][0],y:e[t][1],z:e[t][2]}},this.getPoint=function(e){return i=(this.points.length-1)*e,r=Math.floor(i),n=i-r,d[0]=0===r?r:r-1,d[1]=r,d[2]=r>this.points.length-2?this.points.length-1:r+1,d[3]=r>this.points.length-3?this.points.length-1:r+2,s=this.points[d[0]],u=this.points[d[1]],l=this.points[d[2]],h=this.points[d[3]],o=n*n,a=n*o,p.x=t(s.x,u.x,l.x,h.x,n,o,a),p.y=t(s.y,u.y,l.y,h.y,n,o,a),p.z=t(s.z,u.z,l.z,h.z,n,o,a),p},this.getControlPointsArray=function(){var e,t,i=this.points.length,r=[];for(e=0;e<i;e++)t=this.points[e],r[e]=[t.x,t.y,t.z];return r},this.getLength=function(e){var t,i,r,n,o=0,a=0,s=0,u=new c,l=new c,h=[],d=0;for(h[0]=0,e||(e=100),r=this.points.length*e,u.copy(this.points[0]),t=1;t<r;t++)i=t/r,n=this.getPoint(i),l.copy(n),d+=l.distanceTo(u),u.copy(n),o=(this.points.length-1)*i,a=Math.floor(o),a!==s&&(h[a]=d,s=a);return h[h.length]=d,{chunks:h,total:d}},this.reparametrizeByArcLength=function(e){var t,i,r,n,o,a,s,u,l=[],h=new c,d=this.getLength();for(l.push(h.copy(this.points[0]).clone()),t=1;t<this.points.length;t++){for(a=d.chunks[t]-d.chunks[t-1],s=Math.ceil(e*a/d.total),n=(t-1)/(this.points.length-1),o=t/(this.points.length-1),i=1;i<s-1;i++)r=n+i*(1/s)*(o-n),u=this.getPoint(r),l.push(h.copy(u).clone());l.push(h.copy(this.points[t]).clone())}this.points=l}}function kr(e,t,i){return this.radius=void 0!==e?e:1,this.phi=void 0!==t?t:0,this.theta=void 0!==i?i:0,this}function Ur(e,t,i){return this.radius=void 0!==e?e:1,this.theta=void 0!==t?t:0,this.y=void 0!==i?i:0,this}function Pr(e,t){Ne.call(this,e,t),this.animationsMap={},this.animationsList=[];var i=this.geometry.morphTargets.length,r="__default",n=0,o=i-1,a=i/1;this.createAnimation(r,n,o,a),this.setAnimationWeight(r,1)}function Br(e){ce.call(this),this.material=e,this.render=function(e){}}function Fr(e,t,i,r){this.object=e,this.size=void 0!==t?t:1;var n=void 0!==i?i:16711680,o=void 0!==r?r:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=3*s.faces.length:s&&s.isBufferGeometry&&(a=s.attributes.normal.count);var c=new Le,u=new we(2*a*3,3);c.addAttribute("position",u),yt.call(this,c,new gt({color:n,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function Gr(e){ce.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;for(var t=new Le,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],r=0,n=1,o=32;r<o;r++,n++){var a=r/o*Math.PI*2,s=n/o*Math.PI*2;i.push(Math.cos(a),Math.sin(a),1,Math.cos(s),Math.sin(s),1)}t.addAttribute("position",new we(i,3));var c=new gt({fog:!1});this.cone=new yt(t,c),this.add(this.cone),this.update()}function Hr(e){this.bones=this.getBoneList(e);for(var t=new Le,i=[],r=[],n=new Y(0,0,1),o=new Y(0,1,0),a=0;a<this.bones.length;a++){var s=this.bones[a];s.parent&&s.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(n.r,n.g,n.b),r.push(o.r,o.g,o.b))}t.addAttribute("position",new we(i,3)),t.addAttribute("color",new we(r,3));var c=new gt({vertexColors:Wn,depthTest:!1,depthWrite:!1,transparent:!0});yt.call(this,t,c),this.root=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function Qr(e,t){this.light=e,this.light.updateMatrixWorld();var i=new Wt(t,4,2),r=new de({wireframe:!0,fog:!1});r.color.copy(this.light.color).multiplyScalar(this.light.intensity),Ne.call(this,i,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1}function Yr(e){ce.call(this),this.light=e,this.light.updateMatrixWorld();var t=new de({color:e.color,fog:!1}),i=new de({color:e.color,fog:!1,wireframe:!0}),r=new Le;r.addAttribute("position",new pe(new Float32Array(18),3)),this.add(new Ne(r,t)),this.add(new Ne(r,i)),this.update()}function Vr(e,t){ce.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;var i=new _t(t);i.rotateY(.5*Math.PI);var r=new de({vertexColors:Wn,wireframe:!0}),n=i.getAttribute("position"),o=new Float32Array(3*n.count);i.addAttribute("color",new pe(o,3)),this.add(new Ne(i,r)),this.update()}function Wr(e,t,i,r){e=e||10,t=t||10,i=new Y(void 0!==i?i:4473924),r=new Y(void 0!==r?r:8947848);for(var n=t/2,o=2*e/t,a=[],s=[],c=0,u=0,l=-e;c<=t;c++,l+=o){a.push(-e,0,l,e,0,l),a.push(l,0,-e,l,0,e);var h=c===n?i:r;h.toArray(s,u),u+=3,h.toArray(s,u),u+=3,h.toArray(s,u),u+=3,h.toArray(s,u),u+=3}var d=new Le;d.addAttribute("position",new we(a,3)),d.addAttribute("color",new we(s,3));var p=new gt({vertexColors:Wn});yt.call(this,d,p)}function Xr(e,t,i,r,n,o){e=e||10,t=t||16,i=i||8,r=r||64,n=new Y(void 0!==n?n:4473924),o=new Y(void 0!==o?o:8947848);var a,s,c,u,l,h,d,p=[],f=[];for(u=0;u<=t;u++)c=u/t*(2*Math.PI),a=Math.sin(c)*e,s=Math.cos(c)*e,p.push(0,0,0),p.push(a,0,s),d=1&u?n:o,f.push(d.r,d.g,d.b),f.push(d.r,d.g,d.b);for(u=0;u<=i;u++)for(d=1&u?n:o,h=e-e/i*u,l=0;l<r;l++)c=l/r*(2*Math.PI),a=Math.sin(c)*h,s=Math.cos(c)*h,p.push(a,0,s),f.push(d.r,d.g,d.b),c=(l+1)/r*(2*Math.PI),a=Math.sin(c)*h,s=Math.cos(c)*h,p.push(a,0,s),f.push(d.r,d.g,d.b);var m=new Le;m.addAttribute("position",new we(p,3)),m.addAttribute("color",new we(f,3));var g=new gt({vertexColors:Wn});yt.call(this,m,g)}function qr(e,t,i,r){this.object=e,this.size=void 0!==t?t:1;var n=void 0!==i?i:16776960,o=void 0!==r?r:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var c=new Le,u=new we(2*a*3,3);c.addAttribute("position",u),yt.call(this,c,new gt({color:n,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function Zr(e,t){ce.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,void 0===t&&(t=1);var i=new Le;i.addAttribute("position",new we([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));var r=new gt({fog:!1});this.add(new vt(i,r)),i=new Le,i.addAttribute("position",new we([0,0,0,0,0,1],3)),this.add(new vt(i,r)),this.update()}function Jr(e){function t(e,t,r){i(e,r),i(t,r)}function i(e,t){o.push(0,0,0),a.push(t.r,t.g,t.b),void 0===s[e]&&(s[e]=[]),s[e].push(o.length/3-1)}var r=new Le,n=new gt({color:16777215,vertexColors:Vn}),o=[],a=[],s={},c=new Y(16755200),u=new Y(16711680),l=new Y(43775),h=new Y(16777215),d=new Y(3355443);t("n1","n2",c),t("n2","n4",c),t("n4","n3",c),t("n3","n1",c),t("f1","f2",c),t("f2","f4",c),t("f4","f3",c),t("f3","f1",c),t("n1","f1",c),t("n2","f2",c),t("n3","f3",c),t("n4","f4",c),t("p","n1",u),t("p","n2",u),t("p","n3",u),t("p","n4",u),t("u1","u2",l),t("u2","u3",l),t("u3","u1",l),t("c","t",h),t("p","c",d),t("cn1","cn2",d),t("cn3","cn4",d),t("cf1","cf2",d),t("cf3","cf4",d),r.addAttribute("position",new we(o,3)),r.addAttribute("color",new we(a,3)),yt.call(this,r,n),this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}function Kr(e,t){void 0===t&&(t=16776960);var i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),n=new Le;n.setIndex(new pe(i,1)),n.addAttribute("position",new pe(r,3)),yt.call(this,n,new gt({color:t})),void 0!==e&&this.update(e)}function $r(e,t,i,r,n,o){ce.call(this),void 0===r&&(r=16776960),void 0===i&&(i=1),void 0===n&&(n=.2*i),void 0===o&&(o=.2*n),this.position.copy(t),this.line=new vt(Eu,new gt({color:r})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Ne(bu,new de({color:r})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,n,o)}function en(e){e=e||1;var t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new Le;r.addAttribute("position",new we(t,3)),r.addAttribute("color",new we(i,3));var n=new gt({vertexColors:Wn});yt.call(this,r,n)}function tn(e,t,i,r,n,o){nr.call(this,e,t,i,i,r,n,o)}function rn(e,t,i,r,n,o,a){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new he(e,t,i,n,o,a)}function nn(e){return console.warn("THREE.MeshFaceMaterial has been renamed to THREE.MultiMaterial."),new di(e)}function on(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new At(e,t)}function an(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new ht(e)}function sn(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new At(e,t)}function cn(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Mt(e)}function un(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Mt(e)}function ln(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Mt(e)}function hn(e,t,i){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new c(e,t,i)}function dn(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new pe(e,t).setDynamic(!0)}function pn(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new fe(e,t)}function fn(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new me(e,t)}function mn(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new ge(e,t)}function gn(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new ve(e,t)}function vn(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new ye(e,t)}function yn(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Me(e,t)}function Mn(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Ae(e,t)}function An(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new we(e,t)}function wn(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new xe(e,t)}function xn(e){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Tu.call(this,e),this.type="catmullrom",this.closed=!0}function En(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Kr(e,t)}function bn(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new yt(new ii(e.geometry),new gt({color:void 0!==t?t:16777215}))}function Tn(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new yt(new Lt(e.geometry),new gt({color:void 0!==t?t:16777215}))}function Ln(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new wi(e)}function Nn(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(e,t){console.warn("THREE.Projector: .projectVector() is now vector.project()."),e.project(t)},this.unprojectVector=function(e,t){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),e.unproject(t)},this.pickingRay=function(){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}}function Dn(){console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:e>0?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&&!function(){Object.assign=function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var r=arguments[i];if(void 0!==r&&null!==r)for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}}(),Object.assign(t.prototype,{addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[e]&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[e]&&i[e].indexOf(t)!==-1},removeEventListener:function(e,t){if(void 0!==this._listeners){var i=this._listeners,r=i[e];if(void 0!==r){var n=r.indexOf(t);n!==-1&&r.splice(n,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners,i=t[e.type];if(void 0!==i){e.target=this;var r=[],n=0,o=i.length;for(n=0;n<o;n++)r[n]=i[n];for(n=0;n<o;n++)r[n].call(this,e)}}}});var Sn="83",In={LEFT:0,MIDDLE:1,RIGHT:2},Cn=0,_n=1,jn=2,On=3,zn=0,Rn=1,kn=0,Un=1,Pn=2,Bn=0,Fn=1,Gn=2,Hn=1,Qn=2,Yn=0,Vn=1,Wn=2,Xn=0,qn=1,Zn=2,Jn=3,Kn=4,$n=5,eo={NoBlending:Xn,NormalBlending:qn,AdditiveBlending:Zn,SubtractiveBlending:Jn,MultiplyBlending:Kn,CustomBlending:$n},to=100,io=101,ro=102,no=103,oo=104,ao=200,so=201,co=202,uo=203,lo=204,ho=205,po=206,fo=207,mo=208,go=209,vo=210,yo=0,Mo=1,Ao=2,wo=3,xo=4,Eo=5,bo=6,To=7,Lo=0,No=1,Do=2,So=0,Io=1,Co=2,_o=3,jo=4,Oo=300,zo=301,Ro=302,ko=303,Uo=304,Po=305,Bo=306,Fo=307,Go={UVMapping:Oo,CubeReflectionMapping:zo,CubeRefractionMapping:Ro,EquirectangularReflectionMapping:ko,EquirectangularRefractionMapping:Uo,SphericalReflectionMapping:Po,CubeUVReflectionMapping:Bo,CubeUVRefractionMapping:Fo},Ho=1e3,Qo=1001,Yo=1002,Vo={RepeatWrapping:Ho,ClampToEdgeWrapping:Qo,MirroredRepeatWrapping:Yo},Wo=1003,Xo=1004,qo=1005,Zo=1006,Jo=1007,Ko=1008,$o={NearestFilter:Wo,NearestMipMapNearestFilter:Xo,NearestMipMapLinearFilter:qo,LinearFilter:Zo,LinearMipMapNearestFilter:Jo,LinearMipMapLinearFilter:Ko},ea=1009,ta=1010,ia=1011,ra=1012,na=1013,oa=1014,aa=1015,sa=1016,ca=1017,ua=1018,la=1019,ha=1020,da=1021,pa=1022,fa=1023,ma=1024,ga=1025,va=fa,ya=1026,Ma=1027,Aa=2001,wa=2002,xa=2003,Ea=2004,ba=2100,Ta=2101,La=2102,Na=2103,Da=2151,Sa=2200,Ia=2201,Ca=2202,_a=2300,ja=2301,Oa=2302,za=2400,Ra=2401,ka=2402,Ua=0,Pa=1,Ba=2,Fa=3e3,Ga=3001,Ha=3007,Qa=3002,Ya=3003,Va=3004,Wa=3005,Xa=3006,qa=3200,Za=3201,Ja={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var e,t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),i=new Array(36),r=0;return function(){for(var n=0;n<36;n++)8===n||13===n||18===n||23===n?i[n]="-":14===n?i[n]="4":(r<=2&&(r=33554432+16777216*Math.random()|0),e=15&r,r>>=4,i[n]=t[19===n?3&e|8:e]);return i.join("")}}(),clamp:function(e,t,i){return Math.max(t,Math.min(i,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,i,r,n){return r+(e-t)*(n-r)/(i-t)},lerp:function(e,t,i){return(1-i)*e+i*t},smoothstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t),e*e*(3-2*e))},smootherstep:function(e,t,i){return e<=t?0:e>=i?1:(e=(e-t)/(i-t),e*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*Ja.DEG2RAD},radToDeg:function(e){return e*Ja.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++,e}};i.prototype={constructor:i,isVector2:!0,get width(){return this.x},set width(e){this.x=e},get height(){return this.y},set height(e){this.y=e},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 isFinite(e)?(this.x*=e,this.y*=e):(this.x=0,this.y=0),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,t;return function(r,n){return void 0===e&&(e=new i,t=new i),e.set(r,r),t.set(n,n),this.clamp(e,t)}}(),clampLength:function(e,t){var i=this.length();return this.multiplyScalar(Math.max(e,Math.min(t,i))/i)},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,i=this.y-e.y;return t*t+i*i},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,i){return this.subVectors(t,e).multiplyScalar(i).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},fromAttribute:function(e,t,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var i=Math.cos(t),r=Math.sin(t),n=this.x-e.x,o=this.y-e.y;return this.x=n*i-o*r+e.x,this.y=n*r+o*i+e.y,this}};var Ka=0;r.DEFAULT_IMAGE=void 0,r.DEFAULT_MAPPING=Oo,r.prototype={constructor:r,isTexture:!0,set needsUpdate(e){e===!0&&this.version++},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return 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){function t(e){var t;return void 0!==e.toDataURL?t=e:(t=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),t.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")}if(void 0!==e.textures[this.uuid])return e.textures[this.uuid];var i={metadata:{version:4.4,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=Ja.generateUUID()),void 0===e.images[r.uuid]&&(e.images[r.uuid]={uuid:r.uuid,url:t(r)}),i.image=r.uuid}return e.textures[this.uuid]=i,i},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(this.mapping===Oo){if(e.multiply(this.repeat),e.add(this.offset),e.x<0||e.x>1)switch(this.wrapS){case Ho:e.x=e.x-Math.floor(e.x);break;case Qo:e.x=e.x<0?0:1;break;case Yo: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 Ho:e.y=e.y-Math.floor(e.y);break;case Qo:e.y=e.y<0?0:1;break;case Yo: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(r.prototype,t.prototype),n.prototype={constructor:n,isVector4:!0,set:function(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,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 isFinite(e)?(this.x*=e,this.y*=e,this.z*=e,this.w*=e):(this.x=0,this.y=0,this.z=0,this.w=0),this},applyMatrix4:function(e){var t=this.x,i=this.y,r=this.z,n=this.w,o=e.elements;return this.x=o[0]*t+o[4]*i+o[8]*r+o[12]*n,this.y=o[1]*t+o[5]*i+o[9]*r+o[13]*n,this.z=o[2]*t+o[6]*i+o[10]*r+o[14]*n,this.w=o[3]*t+o[7]*i+o[11]*r+o[15]*n,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,i,r,n,o=.01,a=.1,s=e.elements,c=s[0],u=s[4],l=s[8],h=s[1],d=s[5],p=s[9],f=s[2],m=s[6],g=s[10];if(Math.abs(u-h)<o&&Math.abs(l-f)<o&&Math.abs(p-m)<o){if(Math.abs(u+h)<a&&Math.abs(l+f)<a&&Math.abs(p+m)<a&&Math.abs(c+d+g-3)<a)return this.set(1,0,0,0),
  this;t=Math.PI;var v=(c+1)/2,y=(d+1)/2,M=(g+1)/2,A=(u+h)/4,w=(l+f)/4,x=(p+m)/4;return v>y&&v>M?v<o?(i=0,r=.707106781,n=.707106781):(i=Math.sqrt(v),r=A/i,n=w/i):y>M?y<o?(i=.707106781,r=0,n=.707106781):(r=Math.sqrt(y),i=A/r,n=x/r):M<o?(i=.707106781,r=.707106781,n=0):(n=Math.sqrt(M),i=w/n,r=x/n),this.set(i,r,n,t),this}var E=Math.sqrt((m-p)*(m-p)+(l-f)*(l-f)+(h-u)*(h-u));return Math.abs(E)<.001&&(E=1),this.x=(m-p)/E,this.y=(l-f)/E,this.z=(h-u)/E,this.w=Math.acos((c+d+g-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,t;return function(i,r){return void 0===e&&(e=new n,t=new n),e.set(i,i,i,i),t.set(r,r,r,r),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,i){return this.subVectors(t,e).multiplyScalar(i).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},fromAttribute:function(e,t,i){return void 0!==i&&console.warn("THREE.Vector4: offset has been removed from .fromAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}},Object.assign(o.prototype,t.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"})}}),a.prototype=Object.create(o.prototype),a.prototype.constructor=a,a.prototype.isWebGLRenderTargetCube=!0,s.prototype={constructor:s,get x(){return this._x},set x(e){this._x=e,this.onChangeCallback()},get y(){return this._y},set y(e){this._y=e,this.onChangeCallback()},get z(){return this._z},set z(e){this._z=e,this.onChangeCallback()},get w(){return this._w},set w(e){this._w=e,this.onChangeCallback()},set:function(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._w=r,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if((e&&e.isEuler)===!1)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var i=Math.cos(e._x/2),r=Math.cos(e._y/2),n=Math.cos(e._z/2),o=Math.sin(e._x/2),a=Math.sin(e._y/2),s=Math.sin(e._z/2),c=e.order;return"XYZ"===c?(this._x=o*r*n+i*a*s,this._y=i*a*n-o*r*s,this._z=i*r*s+o*a*n,this._w=i*r*n-o*a*s):"YXZ"===c?(this._x=o*r*n+i*a*s,this._y=i*a*n-o*r*s,this._z=i*r*s-o*a*n,this._w=i*r*n+o*a*s):"ZXY"===c?(this._x=o*r*n-i*a*s,this._y=i*a*n+o*r*s,this._z=i*r*s+o*a*n,this._w=i*r*n-o*a*s):"ZYX"===c?(this._x=o*r*n-i*a*s,this._y=i*a*n+o*r*s,this._z=i*r*s-o*a*n,this._w=i*r*n+o*a*s):"YZX"===c?(this._x=o*r*n+i*a*s,this._y=i*a*n+o*r*s,this._z=i*r*s-o*a*n,this._w=i*r*n-o*a*s):"XZY"===c&&(this._x=o*r*n-i*a*s,this._y=i*a*n-o*r*s,this._z=i*r*s+o*a*n,this._w=i*r*n+o*a*s),t!==!1&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var i=t/2,r=Math.sin(i);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(i),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t,i=e.elements,r=i[0],n=i[4],o=i[8],a=i[1],s=i[5],c=i[9],u=i[2],l=i[6],h=i[10],d=r+s+h;return d>0?(t=.5/Math.sqrt(d+1),this._w=.25/t,this._x=(l-c)*t,this._y=(o-u)*t,this._z=(a-n)*t):r>s&&r>h?(t=2*Math.sqrt(1+r-s-h),this._w=(l-c)/t,this._x=.25*t,this._y=(n+a)/t,this._z=(o+u)/t):s>h?(t=2*Math.sqrt(1+s-r-h),this._w=(o-u)/t,this._x=(n+a)/t,this._y=.25*t,this._z=(c+l)/t):(t=2*Math.sqrt(1+h-r-s),this._w=(a-n)/t,this._x=(o+u)/t,this._y=(c+l)/t,this._z=.25*t),this.onChangeCallback(),this},setFromUnitVectors:function(){var e,t,i=1e-6;return function(r,n){return void 0===e&&(e=new c),t=r.dot(n)+1,t<i?(t=0,Math.abs(r.x)>Math.abs(r.z)?e.set(-r.y,r.x,0):e.set(0,-r.z,r.y)):e.crossVectors(r,n),this._x=e.x,this._y=e.y,this._z=e.z,this._w=t,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 i=e._x,r=e._y,n=e._z,o=e._w,a=t._x,s=t._y,c=t._z,u=t._w;return this._x=i*u+o*a+r*c-n*s,this._y=r*u+o*s+n*a-i*c,this._z=n*u+o*c+i*s-r*a,this._w=o*u-i*a-r*s-n*c,this.onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var i=this._x,r=this._y,n=this._z,o=this._w,a=o*e._w+i*e._x+r*e._y+n*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=i,this._y=r,this._z=n,this;var s=Math.sqrt(1-a*a);if(Math.abs(s)<.001)return this._w=.5*(o+this._w),this._x=.5*(i+this._x),this._y=.5*(r+this._y),this._z=.5*(n+this._z),this;var c=Math.atan2(s,a),u=Math.sin((1-t)*c)/s,l=Math.sin(t*c)/s;return this._w=o*u+this._w*l,this._x=i*u+this._x*l,this._y=r*u+this._y*l,this._z=n*u+this._z*l,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(s,{slerp:function(e,t,i,r){return i.copy(e).slerp(t,r)},slerpFlat:function(e,t,i,r,n,o,a){var s=i[r+0],c=i[r+1],u=i[r+2],l=i[r+3],h=n[o+0],d=n[o+1],p=n[o+2],f=n[o+3];if(l!==f||s!==h||c!==d||u!==p){var m=1-a,g=s*h+c*d+u*p+l*f,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var M=Math.sqrt(y),A=Math.atan2(M,g*v);m=Math.sin(m*A)/M,a=Math.sin(a*A)/M}var w=a*v;if(s=s*m+h*w,c=c*m+d*w,u=u*m+p*w,l=l*m+f*w,m===1-a){var x=1/Math.sqrt(s*s+c*c+u*u+l*l);s*=x,c*=x,u*=x,l*=x}}e[t]=s,e[t+1]=c,e[t+2]=u,e[t+3]=l}}),c.prototype={constructor:c,isVector3:!0,set:function(e,t,i){return this.x=e,this.y=t,this.z=i,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 isFinite(e)?(this.x*=e,this.y*=e,this.z*=e):(this.x=0,this.y=0,this.z=0),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;return function(t){return(t&&t.isEuler)===!1&&console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),void 0===e&&(e=new s),this.applyQuaternion(e.setFromEuler(t))}}(),applyAxisAngle:function(){var e;return function(t,i){return void 0===e&&(e=new s),this.applyQuaternion(e.setFromAxisAngle(t,i))}}(),applyMatrix3:function(e){var t=this.x,i=this.y,r=this.z,n=e.elements;return this.x=n[0]*t+n[3]*i+n[6]*r,this.y=n[1]*t+n[4]*i+n[7]*r,this.z=n[2]*t+n[5]*i+n[8]*r,this},applyMatrix4:function(e){var t=this.x,i=this.y,r=this.z,n=e.elements;return this.x=n[0]*t+n[4]*i+n[8]*r+n[12],this.y=n[1]*t+n[5]*i+n[9]*r+n[13],this.z=n[2]*t+n[6]*i+n[10]*r+n[14],this},applyProjection:function(e){var t=this.x,i=this.y,r=this.z,n=e.elements,o=1/(n[3]*t+n[7]*i+n[11]*r+n[15]);return this.x=(n[0]*t+n[4]*i+n[8]*r+n[12])*o,this.y=(n[1]*t+n[5]*i+n[9]*r+n[13])*o,this.z=(n[2]*t+n[6]*i+n[10]*r+n[14])*o,this},applyQuaternion:function(e){var t=this.x,i=this.y,r=this.z,n=e.x,o=e.y,a=e.z,s=e.w,c=s*t+o*r-a*i,u=s*i+a*t-n*r,l=s*r+n*i-o*t,h=-n*t-o*i-a*r;return this.x=c*s+h*-n+u*-a-l*-o,this.y=u*s+h*-o+l*-n-c*-a,this.z=l*s+h*-a+c*-o-u*-n,this},project:function(){var e;return function(t){return void 0===e&&(e=new u),e.multiplyMatrices(t.projectionMatrix,e.getInverse(t.matrixWorld)),this.applyProjection(e)}}(),unproject:function(){var e;return function(t){return void 0===e&&(e=new u),e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyProjection(e)}}(),transformDirection:function(e){var t=this.x,i=this.y,r=this.z,n=e.elements;return this.x=n[0]*t+n[4]*i+n[8]*r,this.y=n[1]*t+n[5]*i+n[9]*r,this.z=n[2]*t+n[6]*i+n[10]*r,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,t;return function(i,r){return void 0===e&&(e=new c,t=new c),e.set(i,i,i),t.set(r,r,r),this.clamp(e,t)}}(),clampLength:function(e,t){var i=this.length();return this.multiplyScalar(Math.max(e,Math.min(t,i))/i)},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,i){return this.subVectors(t,e).multiplyScalar(i).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 i=this.x,r=this.y,n=this.z;return this.x=r*e.z-n*e.y,this.y=n*e.x-i*e.z,this.z=i*e.y-r*e.x,this},crossVectors:function(e,t){var i=e.x,r=e.y,n=e.z,o=t.x,a=t.y,s=t.z;return this.x=r*s-n*a,this.y=n*o-i*s,this.z=i*a-r*o,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:function(){var e;return function(t){return void 0===e&&(e=new c),e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e;return function(t){return void 0===e&&(e=new c),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(Ja.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t*t+i*i+r*r},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(),i=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=i,this.z=r,this},setFromMatrixColumn:function(e,t){if("number"==typeof e){console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).");var i=e;e=t,t=i}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},fromAttribute:function(e,t,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}},u.prototype={constructor:u,isMatrix4:!0,set:function(e,t,i,r,n,o,a,s,c,u,l,h,d,p,f,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=i,g[12]=r,g[1]=n,g[5]=o,g[9]=a,g[13]=s,g[2]=c,g[6]=u,g[10]=l,g[14]=h,g[3]=d,g[7]=p,g[11]=f,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 u).fromArray(this.elements)},copy:function(e){return this.elements.set(e.elements),this},copyPosition:function(e){var t=this.elements,i=e.elements;return t[12]=i[12],t[13]=i[13],t[14]=i[14],this},extractBasis:function(e,t,i){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,i){return this.set(e.x,t.x,i.x,0,e.y,t.y,i.y,0,e.z,t.z,i.z,0,0,0,0,1),this},extractRotation:function(){var e;return function(t){void 0===e&&(e=new c);var i=this.elements,r=t.elements,n=1/e.setFromMatrixColumn(t,0).length(),o=1/e.setFromMatrixColumn(t,1).length(),a=1/e.setFromMatrixColumn(t,2).length();return i[0]=r[0]*n,i[1]=r[1]*n,i[2]=r[2]*n,i[4]=r[4]*o,i[5]=r[5]*o,i[6]=r[6]*o,i[8]=r[8]*a,i[9]=r[9]*a,i[10]=r[10]*a,this}}(),makeRotationFromEuler:function(e){(e&&e.isEuler)===!1&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,i=e.x,r=e.y,n=e.z,o=Math.cos(i),a=Math.sin(i),s=Math.cos(r),c=Math.sin(r),u=Math.cos(n),l=Math.sin(n);if("XYZ"===e.order){var h=o*u,d=o*l,p=a*u,f=a*l;t[0]=s*u,t[4]=-s*l,t[8]=c,t[1]=d+p*c,t[5]=h-f*c,t[9]=-a*s,t[2]=f-h*c,t[6]=p+d*c,t[10]=o*s}else if("YXZ"===e.order){var m=s*u,g=s*l,v=c*u,y=c*l;t[0]=m+y*a,t[4]=v*a-g,t[8]=o*c,t[1]=o*l,t[5]=o*u,t[9]=-a,t[2]=g*a-v,t[6]=y+m*a,t[10]=o*s}else if("ZXY"===e.order){var m=s*u,g=s*l,v=c*u,y=c*l;t[0]=m-y*a,t[4]=-o*l,t[8]=v+g*a,t[1]=g+v*a,t[5]=o*u,t[9]=y-m*a,t[2]=-o*c,t[6]=a,t[10]=o*s}else if("ZYX"===e.order){var h=o*u,d=o*l,p=a*u,f=a*l;t[0]=s*u,t[4]=p*c-d,t[8]=h*c+f,t[1]=s*l,t[5]=f*c+h,t[9]=d*c-p,t[2]=-c,t[6]=a*s,t[10]=o*s}else if("YZX"===e.order){var M=o*s,A=o*c,w=a*s,x=a*c;t[0]=s*u,t[4]=x-M*l,t[8]=w*l+A,t[1]=l,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=A*l+w,t[10]=M-x*l}else if("XZY"===e.order){var M=o*s,A=o*c,w=a*s,x=a*c;t[0]=s*u,t[4]=-l,t[8]=c*u,t[1]=M*l+x,t[5]=o*u,t[9]=A*l-w,t[2]=w*l-A,t[6]=a*u,t[10]=x*l+M}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,i=e.x,r=e.y,n=e.z,o=e.w,a=i+i,s=r+r,c=n+n,u=i*a,l=i*s,h=i*c,d=r*s,p=r*c,f=n*c,m=o*a,g=o*s,v=o*c;return t[0]=1-(d+f),t[4]=l-v,t[8]=h+g,t[1]=l+v,t[5]=1-(u+f),t[9]=p-m,t[2]=h-g,t[6]=p+m,t[10]=1-(u+d),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,t,i;return function(r,n,o){void 0===e&&(e=new c,t=new c,i=new c);var a=this.elements;return i.subVectors(r,n).normalize(),0===i.lengthSq()&&(i.z=1),e.crossVectors(o,i).normalize(),0===e.lengthSq()&&(i.z+=1e-4,e.crossVectors(o,i).normalize()),t.crossVectors(i,e),a[0]=e.x,a[4]=t.x,a[8]=i.x,a[1]=e.y,a[5]=t.y,a[9]=i.y,a[2]=e.z,a[6]=t.z,a[10]=i.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 i=e.elements,r=t.elements,n=this.elements,o=i[0],a=i[4],s=i[8],c=i[12],u=i[1],l=i[5],h=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],y=i[7],M=i[11],A=i[15],w=r[0],x=r[4],E=r[8],b=r[12],T=r[1],L=r[5],N=r[9],D=r[13],S=r[2],I=r[6],C=r[10],_=r[14],j=r[3],O=r[7],z=r[11],R=r[15];return n[0]=o*w+a*T+s*S+c*j,n[4]=o*x+a*L+s*I+c*O,n[8]=o*E+a*N+s*C+c*z,n[12]=o*b+a*D+s*_+c*R,n[1]=u*w+l*T+h*S+d*j,n[5]=u*x+l*L+h*I+d*O,n[9]=u*E+l*N+h*C+d*z,n[13]=u*b+l*D+h*_+d*R,n[2]=p*w+f*T+m*S+g*j,n[6]=p*x+f*L+m*I+g*O,n[10]=p*E+f*N+m*C+g*z,n[14]=p*b+f*D+m*_+g*R,n[3]=v*w+y*T+M*S+A*j,n[7]=v*x+y*L+M*I+A*O,n[11]=v*E+y*N+M*C+A*z,n[15]=v*b+y*D+M*_+A*R,this},multiplyToArray:function(e,t,i){var r=this.elements;return this.multiplyMatrices(e,t),i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],i[9]=r[9],i[10]=r[10],i[11]=r[11],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],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},applyToVector3Array:function(){var e;return function(t,i,r){void 0===e&&(e=new c),void 0===i&&(i=0),void 0===r&&(r=t.length);for(var n=0,o=i;n<r;n+=3,o+=3)e.fromArray(t,o),e.applyMatrix4(this),e.toArray(t,o);return t}}(),applyToBufferAttribute:function(){var e;return function(t){void 0===e&&(e=new c);for(var i=0,r=t.count;i<r;i++)e.x=t.getX(i),e.y=t.getY(i),e.z=t.getZ(i),e.applyMatrix4(this),t.setXYZ(i,e.x,e.y,e.z);return t}}(),determinant:function(){var e=this.elements,t=e[0],i=e[4],r=e[8],n=e[12],o=e[1],a=e[5],s=e[9],c=e[13],u=e[2],l=e[6],h=e[10],d=e[14],p=e[3],f=e[7],m=e[11],g=e[15];return p*(+n*s*l-r*c*l-n*a*h+i*c*h+r*a*d-i*s*d)+f*(+t*s*d-t*c*h+n*o*h-r*o*d+r*c*u-n*s*u)+m*(+t*c*l-t*a*d-n*o*l+i*o*d+n*a*u-i*c*u)+g*(-r*a*u-t*s*l+t*a*h+r*o*l-i*o*h+i*s*u)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(e){var t=this.elements;return t[12]=e.x,t[13]=e.y,t[14]=e.z,this},getInverse:function(e,t){var i=this.elements,r=e.elements,n=r[0],o=r[1],a=r[2],s=r[3],c=r[4],u=r[5],l=r[6],h=r[7],d=r[8],p=r[9],f=r[10],m=r[11],g=r[12],v=r[13],y=r[14],M=r[15],A=p*y*h-v*f*h+v*l*m-u*y*m-p*l*M+u*f*M,w=g*f*h-d*y*h-g*l*m+c*y*m+d*l*M-c*f*M,x=d*v*h-g*p*h+g*u*m-c*v*m-d*u*M+c*p*M,E=g*p*l-d*v*l-g*u*f+c*v*f+d*u*y-c*p*y,b=n*A+o*w+a*x+s*E;if(0===b){var T="THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";if(t===!0)throw new Error(T);return console.warn(T),this.identity()}var L=1/b;return i[0]=A*L,i[1]=(v*f*s-p*y*s-v*a*m+o*y*m+p*a*M-o*f*M)*L,i[2]=(u*y*s-v*l*s+v*a*h-o*y*h-u*a*M+o*l*M)*L,i[3]=(p*l*s-u*f*s-p*a*h+o*f*h+u*a*m-o*l*m)*L,i[4]=w*L,i[5]=(d*y*s-g*f*s+g*a*m-n*y*m-d*a*M+n*f*M)*L,i[6]=(g*l*s-c*y*s-g*a*h+n*y*h+c*a*M-n*l*M)*L,i[7]=(c*f*s-d*l*s+d*a*h-n*f*h-c*a*m+n*l*m)*L,i[8]=x*L,i[9]=(g*p*s-d*v*s-g*o*m+n*v*m+d*o*M-n*p*M)*L,i[10]=(c*v*s-g*u*s+g*o*h-n*v*h-c*o*M+n*u*M)*L,i[11]=(d*u*s-c*p*s-d*o*h+n*p*h+c*o*m-n*u*m)*L,i[12]=E*L,i[13]=(d*v*a-g*p*a+g*o*f-n*v*f-d*o*y+n*p*y)*L,i[14]=(g*u*a-c*v*a-g*o*l+n*v*l+c*o*y-n*u*y)*L,i[15]=(c*p*a-d*u*a+d*o*l-n*p*l-c*o*f+n*u*f)*L,this},scale:function(e){var t=this.elements,i=e.x,r=e.y,n=e.z;return t[0]*=i,t[4]*=r,t[8]*=n,t[1]*=i,t[5]*=r,t[9]*=n,t[2]*=i,t[6]*=r,t[10]*=n,t[3]*=i,t[7]*=r,t[11]*=n,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,i,r))},makeTranslation:function(e,t,i){return this.set(1,0,0,e,0,1,0,t,0,0,1,i,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,t,-i,0,0,i,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,0,i,0,0,1,0,0,-i,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),i=Math.sin(e);return this.set(t,-i,0,0,i,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var i=Math.cos(t),r=Math.sin(t),n=1-i,o=e.x,a=e.y,s=e.z,c=n*o,u=n*a;return this.set(c*o+i,c*a-r*s,c*s+r*a,0,c*a+r*s,u*a+i,u*s-r*o,0,c*s-r*a,u*s+r*o,n*s*s+i,0,0,0,0,1),this},makeScale:function(e,t,i){return this.set(e,0,0,0,0,t,0,0,0,0,i,0,0,0,0,1),this},makeShear:function(e,t,i){return this.set(1,t,i,0,e,1,i,0,e,t,1,0,0,0,0,1),this},compose:function(e,t,i){return this.makeRotationFromQuaternion(t),this.scale(i),this.setPosition(e),this},decompose:function(){var e,t;return function(i,r,n){void 0===e&&(e=new c,t=new u);var o=this.elements,a=e.set(o[0],o[1],o[2]).length(),s=e.set(o[4],o[5],o[6]).length(),l=e.set(o[8],o[9],o[10]).length(),h=this.determinant();h<0&&(a=-a),i.x=o[12],i.y=o[13],i.z=o[14],t.elements.set(this.elements);var d=1/a,p=1/s,f=1/l;return t.elements[0]*=d,t.elements[1]*=d,t.elements[2]*=d,t.elements[4]*=p,t.elements[5]*=p,t.elements[6]*=p,t.elements[8]*=f,t.elements[9]*=f,t.elements[10]*=f,r.setFromRotationMatrix(t),n.x=a,n.y=s,n.z=l,this}}(),makeFrustum:function(e,t,i,r,n,o){var a=this.elements,s=2*n/(t-e),c=2*n/(r-i),u=(t+e)/(t-e),l=(r+i)/(r-i),h=-(o+n)/(o-n),d=-2*o*n/(o-n);return a[0]=s,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=l,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makePerspective:function(e,t,i,r){var n=i*Math.tan(Ja.DEG2RAD*e*.5),o=-n,a=o*t,s=n*t;return this.makeFrustum(a,s,o,n,i,r)},makeOrthographic:function(e,t,i,r,n,o){var a=this.elements,s=1/(t-e),c=1/(i-r),u=1/(o-n),l=(t+e)*s,h=(i+r)*c,d=(o+n)*u;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-l,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(e){for(var t=this.elements,i=e.elements,r=0;r<16;r++)if(t[r]!==i[r])return!1;return!0},fromArray:function(e,t){void 0===t&&(t=0);for(var i=0;i<16;i++)this.elements[i]=e[i+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e[t+9]=i[9],e[t+10]=i[10],e[t+11]=i[11],e[t+12]=i[12],e[t+13]=i[13],e[t+14]=i[14],e[t+15]=i[15],e}},l.prototype=Object.create(r.prototype),l.prototype.constructor=l,l.prototype.isCubeTexture=!0,Object.defineProperty(l.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}});var $a=new r,es=new l,ts=[],is=[];F.prototype.setValue=function(e,t){for(var i=this.seq,r=0,n=i.length;r!==n;++r){var o=i[r];o.setValue(e,t[o.id])}};var rs=/([\w\d_]+)(\])?(\[|\.)?/g;Q.prototype.setValue=function(e,t,i){var r=this.map[t];void 0!==r&&r.setValue(e,i,this.renderer)},Q.prototype.set=function(e,t,i){var r=this.map[i];void 0!==r&&r.setValue(e,t[i],this.renderer)},Q.prototype.setOptional=function(e,t,i){var r=t[i];void 0!==r&&this.setValue(e,i,r)},Q.upload=function(e,t,i,r){for(var n=0,o=t.length;n!==o;++n){var a=t[n],s=i[a.id];s.needsUpdate!==!1&&a.setValue(e,s.value,r)}},Q.seqWithValue=function(e,t){for(var i=[],r=0,n=e.length;r!==n;++r){var o=e[r];o.id in t&&i.push(o)}return i};var ns={merge:function(e){for(var t={},i=0;i<e.length;i++){var r=this.clone(e[i]);for(var n in r)t[n]=r[n]}return t},clone:function(e){var t={};for(var i in e){t[i]={};for(var r in e[i]){var n=e[i][r];n&&(n.isColor||n.isMatrix3||n.isMatrix4||n.isVector2||n.isVector3||n.isVector4||n.isTexture)?t[i][r]=n.clone():Array.isArray(n)?t[i][r]=n.slice():t[i][r]=n}}return t}},os="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",as="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",ss="#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",cs="#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",us="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",ls="\nvec3 transformed = vec3( position );\n",hs="\nvec3 objectNormal = vec3( normal );\n",ds="float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\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 ltcTextureCoords( const in GeometricContext geometry, 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\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 P = geometry.position;\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}\nvoid clipQuadToHorizon( inout vec3 L[5], out int n ) {\n\tint config = 0;\n\tif ( L[0].z > 0.0 ) config += 1;\n\tif ( L[1].z > 0.0 ) config += 2;\n\tif ( L[2].z > 0.0 ) config += 4;\n\tif ( L[3].z > 0.0 ) config += 8;\n\tn = 0;\n\tif ( config == 0 ) {\n\t} else if ( config == 1 ) {\n\t\tn = 3;\n\t\tL[1] = -L[1].z * L[0] + L[0].z * L[1];\n\t\tL[2] = -L[3].z * L[0] + L[0].z * L[3];\n\t} else if ( config == 2 ) {\n\t\tn = 3;\n\t\tL[0] = -L[0].z * L[1] + L[1].z * L[0];\n\t\tL[2] = -L[2].z * L[1] + L[1].z * L[2];\n\t} else if ( config == 3 ) {\n\t\tn = 4;\n\t\tL[2] = -L[2].z * L[1] + L[1].z * L[2];\n\t\tL[3] = -L[3].z * L[0] + L[0].z * L[3];\n\t} else if ( config == 4 ) {\n\t\tn = 3;\n\t\tL[0] = -L[3].z * L[2] + L[2].z * L[3];\n\t\tL[1] = -L[1].z * L[2] + L[2].z * L[1];\n\t} else if ( config == 5 ) {\n\t\tn = 0;\n\t} else if ( config == 6 ) {\n\t\tn = 4;\n\t\tL[0] = -L[0].z * L[1] + L[1].z * L[0];\n\t\tL[3] = -L[3].z * L[2] + L[2].z * L[3];\n\t} else if ( config == 7 ) {\n\t\tn = 5;\n\t\tL[4] = -L[3].z * L[0] + L[0].z * L[3];\n\t\tL[3] = -L[3].z * L[2] + L[2].z * L[3];\n\t} else if ( config == 8 ) {\n\t\tn = 3;\n\t\tL[0] = -L[0].z * L[3] + L[3].z * L[0];\n\t\tL[1] = -L[2].z * L[3] + L[3].z * L[2];\n\t\tL[2] =  L[3];\n\t} else if ( config == 9 ) {\n\t\tn = 4;\n\t\tL[1] = -L[1].z * L[0] + L[0].z * L[1];\n\t\tL[2] = -L[2].z * L[3] + L[3].z * L[2];\n\t} else if ( config == 10 ) {\n\t\tn = 0;\n\t} else if ( config == 11 ) {\n\t\tn = 5;\n\t\tL[4] = L[3];\n\t\tL[3] = -L[2].z * L[3] + L[3].z * L[2];\n\t\tL[2] = -L[2].z * L[1] + L[1].z * L[2];\n\t} else if ( config == 12 ) {\n\t\tn = 4;\n\t\tL[1] = -L[1].z * L[2] + L[2].z * L[1];\n\t\tL[0] = -L[0].z * L[3] + L[3].z * L[0];\n\t} else if ( config == 13 ) {\n\t\tn = 5;\n\t\tL[4] = L[3];\n\t\tL[3] = L[2];\n\t\tL[2] = -L[1].z * L[2] + L[2].z * L[1];\n\t\tL[1] = -L[1].z * L[0] + L[0].z * L[1];\n\t} else if ( config == 14 ) {\n\t\tn = 5;\n\t\tL[4] = -L[0].z * L[3] + L[3].z * L[0];\n\t\tL[0] = -L[0].z * L[1] + L[1].z * L[0];\n\t} else if ( config == 15 ) {\n\t\tn = 4;\n\t}\n\tif ( n == 3 )\n\t\tL[3] = L[0];\n\tif ( n == 4 )\n\t\tL[4] = L[0];\n}\nfloat integrateLtcBrdfOverRectEdge( vec3 v1, vec3 v2 ) {\n\tfloat cosTheta = dot( v1, v2 );\n\tfloat theta = acos( cosTheta );\n\tfloat res = cross( v1, v2 ).z * ( ( theta > 0.001 ) ? theta / sin( theta ) : 1.0 );\n\treturn res;\n}\nvoid initRectPoints( const in vec3 pos, const in vec3 halfWidth, const in vec3 halfHeight, out vec3 rectPoints[4] ) {\n\trectPoints[0] = pos - halfWidth - halfHeight;\n\trectPoints[1] = pos + halfWidth - halfHeight;\n\trectPoints[2] = pos + halfWidth + halfHeight;\n\trectPoints[3] = pos - halfWidth + halfHeight;\n}\nvec3 integrateLtcBrdfOverRect( const in GeometricContext geometry, const in mat3 brdfMat, const in vec3 rectPoints[4] ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 P = geometry.position;\n\tvec3 T1, T2;\n\tT1 = normalize(V - N * dot( V, N ));\n\tT2 = - cross( N, T1 );\n\tmat3 brdfWrtSurface = brdfMat * transpose( mat3( T1, T2, N ) );\n\tvec3 clippedRect[5];\n\tclippedRect[0] = brdfWrtSurface * ( rectPoints[0] - P );\n\tclippedRect[1] = brdfWrtSurface * ( rectPoints[1] - P );\n\tclippedRect[2] = brdfWrtSurface * ( rectPoints[2] - P );\n\tclippedRect[3] = brdfWrtSurface * ( rectPoints[3] - P );\n\tint n;\n\tclipQuadToHorizon(clippedRect, n);\n\tif ( n == 0 )\n\t\treturn vec3( 0, 0, 0 );\n\tclippedRect[0] = normalize( clippedRect[0] );\n\tclippedRect[1] = normalize( clippedRect[1] );\n\tclippedRect[2] = normalize( clippedRect[2] );\n\tclippedRect[3] = normalize( clippedRect[3] );\n\tclippedRect[4] = normalize( clippedRect[4] );\n\tfloat sum = 0.0;\n\tsum += integrateLtcBrdfOverRectEdge( clippedRect[0], clippedRect[1] );\n\tsum += integrateLtcBrdfOverRectEdge( clippedRect[1], clippedRect[2] );\n\tsum += integrateLtcBrdfOverRectEdge( clippedRect[2], clippedRect[3] );\n\tif (n >= 4)\n\t\tsum += integrateLtcBrdfOverRectEdge( clippedRect[3], clippedRect[4] );\n\tif (n == 5)\n\t\tsum += integrateLtcBrdfOverRectEdge( clippedRect[4], clippedRect[0] );\n\tsum = max( 0.0, sum );\n\tvec3 Lo_i = vec3( sum, sum, sum );\n\treturn Lo_i;\n}\nvec3 Rect_Area_Light_Specular_Reflectance(\n\t\tconst in GeometricContext geometry,\n\t\tconst in vec3 lightPos, const in vec3 lightHalfWidth, const in vec3 lightHalfHeight,\n\t\tconst in float roughness,\n\t\tconst in sampler2D ltcMat, const in sampler2D ltcMag ) {\n\tvec3 rectPoints[4];\n\tinitRectPoints( lightPos, lightHalfWidth, lightHalfHeight, rectPoints );\n\tvec2 uv = ltcTextureCoords( geometry, roughness );\n\tvec4 brdfLtcApproxParams, t;\n\tbrdfLtcApproxParams = texture2D( ltcMat, uv );\n\tt = texture2D( ltcMat, uv );\n\tfloat brdfLtcScalar = texture2D( ltcMag, uv ).a;\n\tmat3 brdfLtcApproxMat = mat3(\n\t\tvec3(   1,   0, t.y ),\n\t\tvec3(   0, t.z,   0 ),\n\t\tvec3( t.w,   0, t.x )\n\t);\n\tvec3 specularReflectance = integrateLtcBrdfOverRect( geometry, brdfLtcApproxMat, rectPoints );\n\tspecularReflectance *= brdfLtcScalar;\n\treturn specularReflectance;\n}\nvec3 Rect_Area_Light_Diffuse_Reflectance(\n\t\tconst in GeometricContext geometry,\n\t\tconst in vec3 lightPos, const in vec3 lightHalfWidth, const in vec3 lightHalfHeight ) {\n\tvec3 rectPoints[4];\n\tinitRectPoints( lightPos, lightHalfWidth, lightHalfHeight, rectPoints );\n\tmat3 diffuseBrdfMat = mat3(1);\n\tvec3 diffuseReflectance = integrateLtcBrdfOverRect( geometry, diffuseBrdfMat, rectPoints );\n\treturn diffuseReflectance;\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",ps="#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",fs="#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",ms="#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",gs="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n",vs="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n",ys="#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",Ms="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",As="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",ws="#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",xs="#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",Es="#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",bs="#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",Ts="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",Ls="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",Ns="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",Ds="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",Ss="  gl_FragColor = linearToOutputTexel( gl_FragColor );\n",Is="\nvec4 LinearToLinear( in vec4 value ) {\n  return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n  return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n  return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n  return 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  return 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  return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n  float maxComponent = max( max( value.r, value.g ), value.b );\n  float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n  return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n  return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n  float maxRGB = max( value.x, max( value.g, value.b ) );\n  float M      = clamp( maxRGB / maxRange, 0.0, 1.0 );\n  M            = ceil( M * 255.0 ) / 255.0;\n  return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n    return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n    float maxRGB = max( value.x, max( value.g, value.b ) );\n    float D      = max( maxRange / maxRGB, 1.0 );\n    D            = min( floor( D ) / 255.0, 1.0 );\n    return 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  vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n  Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n  vec4 vResult;\n  vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n  float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n  vResult.w = fract(Le);\n  vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n  return 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  float Le = value.z * 255.0 + value.w;\n  vec3 Xp_Y_XYZp;\n  Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n  Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n  Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n  vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n  return vec4( max(vRGB, 0.0), 1.0 );\n}\n",Cs="#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",_s="#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",js="#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",Os="#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",zs="#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",Rs="#ifdef USE_FOG\n\tuniform vec3 fogColor;\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",ks="#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",Us="#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",Ps="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",Bs="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_RECT_AREA_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\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",Fs="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",Gs="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",Hs="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    void RE_Direct_RectArea_BlinnPhong( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n        vec3 matDiffColor = material.diffuseColor;\n        vec3 matSpecColor = material.specularColor;\n        vec3 lightColor   = rectAreaLight.color;\n        float roughness = BlinnExponentToGGXRoughness( material.specularShininess );\n        vec3 spec = Rect_Area_Light_Specular_Reflectance(\n                geometry,\n                rectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight,\n                roughness,\n                ltcMat, ltcMag );\n        vec3 diff = Rect_Area_Light_Diffuse_Reflectance(\n                geometry,\n                rectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight );\n        reflectedLight.directSpecular += lightColor * matSpecColor * spec / PI2;\n        reflectedLight.directDiffuse  += lightColor * matDiffColor * diff / PI2;\n    }\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",Qs="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",Ys="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    void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n        vec3 matDiffColor = material.diffuseColor;\n        vec3 matSpecColor = material.specularColor;\n        vec3 lightColor   = rectAreaLight.color;\n        float roughness = material.specularRoughness;\n        vec3 spec = Rect_Area_Light_Specular_Reflectance(\n                geometry,\n                rectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight,\n                roughness,\n                ltcMat, ltcMag );\n        vec3 diff = Rect_Area_Light_Diffuse_Reflectance(\n                geometry,\n                rectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight );\n        reflectedLight.directSpecular += lightColor * matSpecColor * spec;\n        reflectedLight.directDiffuse  += lightColor * matDiffColor * diff;\n    }\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",Vs="\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\t\t\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n",Ws="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",Xs="#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",qs="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",Zs="#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",Js="#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",Ks="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",$s="#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",ec="#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",tc="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",ic="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",rc="#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",nc="#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",oc="#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",ac="#ifdef DOUBLE_SIDED\n\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n#else\n\tfloat flipNormal = 1.0;\n#endif\n",sc="#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",cc="#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",uc="vec3 packNormalToRGB( const in vec3 normal ) {\n  return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n  return 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  return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n  return linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n  return (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n  return ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",lc="#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",hc="#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",dc="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",pc="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",fc="#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    #if NUM_RECT_AREA_LIGHTS > 0\n    #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",mc="#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    #if NUM_RECT_AREA_LIGHTS > 0\n    #endif\n#endif\n",gc="#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    #if NUM_RECT_AREA_LIGHTS > 0\n    #endif\n#endif\n",vc="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#if NUM_RECT_AREA_LIGHTS > 0\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",yc="#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",Mc="#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 boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\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",Ac="#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",wc="#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",xc="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",Ec="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",bc="#if defined( TONE_MAPPING )\n  gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",Tc="#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n  return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n  color *= toneMappingExposure;\n  return 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  color *= toneMappingExposure;\n  return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n  color *= toneMappingExposure;\n  color = max( vec3( 0.0 ), color - 0.004 );\n  return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",Lc="#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",Nc="#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",Dc="#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",Sc="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",Ic="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",Cc="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",_c="#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",jc="uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n",Oc="varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",zc="#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\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",Rc="#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",kc="uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\n#include <packing>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tgl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 );\n}\n",Uc="varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition;\n}\n",Pc="uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\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",Bc="varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",Fc="uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",Gc="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",Hc="uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\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 <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <normal_flip>\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",Qc="#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n}\n",Yc="uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\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 <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <normal_flip>\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",Vc="#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n}\n",Wc="#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_flip>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",Xc="#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n}\n",qc="#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_flip>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",Zc="#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",Jc="#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED  ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#include <normal_flip>\n\t#include <normal_fragment>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#include <premultiplied_alpha_fragment>\n\t#include <encodings_fragment>\n}\n",Kc="#define NORMAL\n#if defined( FLAT_SHADED  ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n#if defined( FLAT_SHADED  ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}\n",$c="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",eu="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",tu="uniform float opacity;\n#include <common>\n#include <packing>\n#include <bsdfs>\n#include <lights_pars>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.0, 0.0, 0.0, opacity * ( 1.0  - getShadowMask() ) );\n}\n",iu="#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",ru={
  alphamap_fragment:os,alphamap_pars_fragment:as,alphatest_fragment:ss,aomap_fragment:cs,aomap_pars_fragment:us,begin_vertex:ls,beginnormal_vertex:hs,bsdfs:ds,bumpmap_pars_fragment:ps,clipping_planes_fragment:fs,clipping_planes_pars_fragment:ms,clipping_planes_pars_vertex:gs,clipping_planes_vertex:vs,color_fragment:ys,color_pars_fragment:Ms,color_pars_vertex:As,color_vertex:ws,common:xs,cube_uv_reflection_fragment:Es,defaultnormal_vertex:bs,displacementmap_pars_vertex:Ts,displacementmap_vertex:Ls,emissivemap_fragment:Ns,emissivemap_pars_fragment:Ds,encodings_fragment:Ss,encodings_pars_fragment:Is,envmap_fragment:Cs,envmap_pars_fragment:_s,envmap_pars_vertex:js,envmap_vertex:Os,fog_fragment:zs,fog_pars_fragment:Rs,gradientmap_pars_fragment:ks,lightmap_fragment:Us,lightmap_pars_fragment:Ps,lights_lambert_vertex:Bs,lights_pars:Fs,lights_phong_fragment:Gs,lights_phong_pars_fragment:Hs,lights_physical_fragment:Qs,lights_physical_pars_fragment:Ys,lights_template:Vs,logdepthbuf_fragment:Ws,logdepthbuf_pars_fragment:Xs,logdepthbuf_pars_vertex:qs,logdepthbuf_vertex:Zs,map_fragment:Js,map_pars_fragment:Ks,map_particle_fragment:$s,map_particle_pars_fragment:ec,metalnessmap_fragment:tc,metalnessmap_pars_fragment:ic,morphnormal_vertex:rc,morphtarget_pars_vertex:nc,morphtarget_vertex:oc,normal_flip:ac,normal_fragment:sc,normalmap_pars_fragment:cc,packing:uc,premultiplied_alpha_fragment:lc,project_vertex:hc,roughnessmap_fragment:dc,roughnessmap_pars_fragment:pc,shadowmap_pars_fragment:fc,shadowmap_pars_vertex:mc,shadowmap_vertex:gc,shadowmask_pars_fragment:vc,skinbase_vertex:yc,skinning_pars_vertex:Mc,skinning_vertex:Ac,skinnormal_vertex:wc,specularmap_fragment:xc,specularmap_pars_fragment:Ec,tonemapping_fragment:bc,tonemapping_pars_fragment:Tc,uv_pars_fragment:Lc,uv_pars_vertex:Nc,uv_vertex:Dc,uv2_pars_fragment:Sc,uv2_pars_vertex:Ic,uv2_vertex:Cc,worldpos_vertex:_c,cube_frag:jc,cube_vert:Oc,depth_frag:zc,depth_vert:Rc,distanceRGBA_frag:kc,distanceRGBA_vert:Uc,equirect_frag:Pc,equirect_vert:Bc,linedashed_frag:Fc,linedashed_vert:Gc,meshbasic_frag:Hc,meshbasic_vert:Qc,meshlambert_frag:Yc,meshlambert_vert:Vc,meshphong_frag:Wc,meshphong_vert:Xc,meshphysical_frag:qc,meshphysical_vert:Zc,normal_frag:Jc,normal_vert:Kc,points_frag:$c,points_vert:eu,shadow_frag:tu,shadow_vert:iu};Y.prototype={constructor:Y,isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,i){return this.r=e,this.g=t,this.b=i,this},setHSL:function(){function e(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+6*(t-e)*(2/3-i):e}return function(t,i,r){if(t=Ja.euclideanModulo(t,1),i=Ja.clamp(i,0,1),r=Ja.clamp(r,0,1),0===i)this.r=this.g=this.b=r;else{var n=r<=.5?r*(1+i):r+i-r*i,o=2*r-n;this.r=e(o,n,t+1/3),this.g=e(o,n,t),this.b=e(o,n,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 i;if(i=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var r,n=i[1],o=i[2];switch(n){case"rgb":case"rgba":if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(r[1],10))/255,this.g=Math.min(255,parseInt(r[2],10))/255,this.b=Math.min(255,parseInt(r[3],10))/255,t(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(r[1],10))/100,this.g=Math.min(100,parseInt(r[2],10))/100,this.b=Math.min(100,parseInt(r[3],10))/100,t(r[5]),this;break;case"hsl":case"hsla":if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(r[1])/360,s=parseInt(r[2],10)/100,c=parseInt(r[3],10)/100;return t(r[5]),this.setHSL(a,s,c)}}}else if(i=/^\#([A-Fa-f0-9]+)$/.exec(e)){var u=i[1],l=u.length;if(3===l)return this.r=parseInt(u.charAt(0)+u.charAt(0),16)/255,this.g=parseInt(u.charAt(1)+u.charAt(1),16)/255,this.b=parseInt(u.charAt(2)+u.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(u.charAt(0)+u.charAt(1),16)/255,this.g=parseInt(u.charAt(2)+u.charAt(3),16)/255,this.b=parseInt(u.charAt(4)+u.charAt(5),16)/255,this}if(e&&e.length>0){var u=nu[e];void 0!==u?this.setHex(u):console.warn("THREE.Color: Unknown color "+e)}return 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 i=t>0?1/t:1;return this.r=Math.pow(e.r,i),this.g=Math.pow(e.g,i),this.b=Math.pow(e.b,i),this},convertGammaToLinear:function(){var e=this.r,t=this.g,i=this.b;return this.r=e*e,this.g=t*t,this.b=i*i,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,i,r=e||{h:0,s:0,l:0},n=this.r,o=this.g,a=this.b,s=Math.max(n,o,a),c=Math.min(n,o,a),u=(c+s)/2;if(c===s)t=0,i=0;else{var l=s-c;switch(i=u<=.5?l/(s+c):l/(2-s-c),s){case n:t=(o-a)/l+(o<a?6:0);break;case o:t=(a-n)/l+2;break;case a:t=(n-o)/l+4}t/=6}return r.h=t,r.s=i,r.l=u,r},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,i){var r=this.getHSL();return r.h+=e,r.s+=t,r.l+=i,this.setHSL(r.h,r.s,r.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},sub:function(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e,t){return void 0===t&&(t=0),this.r=e[t],this.g=e[t+1],this.b=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e},toJSON:function(){return this.getHex()}};var nu={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};V.prototype=Object.create(r.prototype),V.prototype.constructor=V,V.prototype.isDataTexture=!0;var ou={common:{diffuse:{value:new Y(15658734)},opacity:{value:1},map:{value:null},offsetRepeat:{value:new n(0,0,1,1)},specularMap:{value:null},alphaMap:{value:null},envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new i(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Y(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new Y(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},offsetRepeat:{value:new n(0,0,1,1)}}},au={basic:{uniforms:ns.merge([ou.common,ou.aomap,ou.lightmap,ou.fog]),vertexShader:ru.meshbasic_vert,fragmentShader:ru.meshbasic_frag},lambert:{uniforms:ns.merge([ou.common,ou.aomap,ou.lightmap,ou.emissivemap,ou.fog,ou.lights,{emissive:{value:new Y(0)}}]),vertexShader:ru.meshlambert_vert,fragmentShader:ru.meshlambert_frag},phong:{uniforms:ns.merge([ou.common,ou.aomap,ou.lightmap,ou.emissivemap,ou.bumpmap,ou.normalmap,ou.displacementmap,ou.gradientmap,ou.fog,ou.lights,{emissive:{value:new Y(0)},specular:{value:new Y(1118481)},shininess:{value:30}}]),vertexShader:ru.meshphong_vert,fragmentShader:ru.meshphong_frag},standard:{uniforms:ns.merge([ou.common,ou.aomap,ou.lightmap,ou.emissivemap,ou.bumpmap,ou.normalmap,ou.displacementmap,ou.roughnessmap,ou.metalnessmap,ou.fog,ou.lights,{emissive:{value:new Y(0)},roughness:{value:.5},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ru.meshphysical_vert,fragmentShader:ru.meshphysical_frag},points:{uniforms:ns.merge([ou.points,ou.fog]),vertexShader:ru.points_vert,fragmentShader:ru.points_frag},dashed:{uniforms:ns.merge([ou.common,ou.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ru.linedashed_vert,fragmentShader:ru.linedashed_frag},depth:{uniforms:ns.merge([ou.common,ou.displacementmap]),vertexShader:ru.depth_vert,fragmentShader:ru.depth_frag},normal:{uniforms:ns.merge([ou.common,ou.bumpmap,ou.normalmap,ou.displacementmap,{opacity:{value:1}}]),vertexShader:ru.normal_vert,fragmentShader:ru.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:ru.cube_vert,fragmentShader:ru.cube_frag},equirect:{uniforms:{tEquirect:{value:null},tFlip:{value:-1}},vertexShader:ru.equirect_vert,fragmentShader:ru.equirect_frag},distanceRGBA:{uniforms:{lightPos:{value:new c}},vertexShader:ru.distanceRGBA_vert,fragmentShader:ru.distanceRGBA_frag}};au.physical={uniforms:ns.merge([au.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:ru.meshphysical_vert,fragmentShader:ru.meshphysical_frag},W.prototype={constructor:W,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new i;return function(t,i){var r=e.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=+(1/0),this.max.x=this.max.y=-(1/0),this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(e){var t=e||new i;return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){var t=e||new i;return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){var r=t||new i;return r.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y)},clampPoint:function(e,t){var r=t||new i;return r.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new i;return function(t){var i=e.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}};var su=0;Z.prototype={constructor:Z,isMaterial:!0,get needsUpdate(){return this._needsUpdate},set needsUpdate(e){e===!0&&this.update(),this._needsUpdate=e},setValues:function(e){if(void 0!==e)for(var t in e){var i=e[t];if(void 0!==i){var r=this[t];void 0!==r?r&&r.isColor?r.set(i):r&&r.isVector3&&i&&i.isVector3?r.copy(i):"overdraw"===t?this[t]=Number(i):this[t]=i:console.warn("THREE."+this.type+": '"+t+"' is not a property of this material.")}else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(e){function t(e){var t=[];for(var i in e){var r=e[i];delete r.metadata,t.push(r)}return t}var i=void 0===e;i&&(e={textures:{},images:{}});var r={metadata:{version:4.4,type:"Material",generator:"Material.toJSON"}};if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),void 0!==this.roughness&&(r.roughness=this.roughness),void 0!==this.metalness&&(r.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),void 0!==this.shininess&&(r.shininess=this.shininess),void 0!==this.clearCoat&&(r.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(r.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(e).uuid),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(e).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(e).uuid,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(e).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(e).uuid,r.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(r.size=this.size),void 0!==this.sizeAttenuation&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==qn&&(r.blending=this.blending),this.shading!==Qn&&(r.shading=this.shading),this.side!==Bn&&(r.side=this.side),this.vertexColors!==Yn&&(r.vertexColors=this.vertexColors),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),r.skinning=this.skinning,r.morphTargets=this.morphTargets,i){var n=t(e.textures),o=t(e.images);n.length>0&&(r.textures=n),o.length>0&&(r.images=o)}return r},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.lights=e.lights,this.blending=e.blending,this.side=e.side,this.shading=e.shading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.overdraw=e.overdraw,this.visible=e.visible,this.clipShadows=e.clipShadows,this.clipIntersection=e.clipIntersection;var t=e.clippingPlanes,i=null;if(null!==t){var r=t.length;i=new Array(r);for(var n=0;n!==r;++n)i[n]=t[n].clone()}return this.clippingPlanes=i,this},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},Object.assign(Z.prototype,t.prototype),J.prototype=Object.create(Z.prototype),J.prototype.constructor=J,J.prototype.isShaderMaterial=!0,J.prototype.copy=function(e){return Z.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=ns.clone(e.uniforms),this.defines=e.defines,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},J.prototype.toJSON=function(e){var t=Z.prototype.toJSON.call(this,e);return t.uniforms=this.uniforms,t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t},K.prototype=Object.create(Z.prototype),K.prototype.constructor=K,K.prototype.isMeshDepthMaterial=!0,K.prototype.copy=function(e){return Z.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},$.prototype={constructor:$,isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=+(1/0),i=+(1/0),r=+(1/0),n=-(1/0),o=-(1/0),a=-(1/0),s=0,c=e.length;s<c;s+=3){var u=e[s],l=e[s+1],h=e[s+2];u<t&&(t=u),l<i&&(i=l),h<r&&(r=h),u>n&&(n=u),l>o&&(o=l),h>a&&(a=h)}this.min.set(t,i,r),this.max.set(n,o,a)},setFromBufferAttribute:function(e){for(var t=+(1/0),i=+(1/0),r=+(1/0),n=-(1/0),o=-(1/0),a=-(1/0),s=0,c=e.count;s<c;s++){var u=e.getX(s),l=e.getY(s),h=e.getZ(s);u<t&&(t=u),l<i&&(i=l),h<r&&(r=h),u>n&&(n=u),l>o&&(o=l),h>a&&(a=h)}this.min.set(t,i,r),this.max.set(n,o,a)},setFromPoints:function(e){this.makeEmpty();for(var t=0,i=e.length;t<i;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new c;return function(t,i){var r=e.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}}(),setFromObject:function(){var e=new c;return function(t){var i=this;return t.updateMatrixWorld(!0),this.makeEmpty(),t.traverse(function(t){var r,n,o=t.geometry;if(void 0!==o)if(o.isGeometry){var a=o.vertices;for(r=0,n=a.length;r<n;r++)e.copy(a[r]),e.applyMatrix4(t.matrixWorld),i.expandByPoint(e)}else if(o.isBufferGeometry){var s=o.attributes.position;if(void 0!==s)for(r=0,n=s.count;r<n;r++)e.fromAttribute(s,r).applyMatrix4(t.matrixWorld),i.expandByPoint(e)}}),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=+(1/0),this.max.x=this.max.y=this.max.z=-(1/0),this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(e){var t=e||new c;return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(e){var t=e||new c;return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){var i=t||new c;return i.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)},intersectsSphere:function(){var e;return function(t){return void 0===e&&(e=new c),this.clampPoint(t.center,e),e.distanceToSquared(t.center)<=t.radius*t.radius}}(),intersectsPlane:function(e){var t,i;return e.normal.x>0?(t=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),t<=e.constant&&i>=e.constant},clampPoint:function(e,t){var i=t||new c;return i.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new c;return function(t){var i=e.copy(t).clamp(this.min,this.max);return i.sub(t).length()}}(),getBoundingSphere:function(){var e=new c;return function(t){var i=t||new ee;return this.getCenter(i.center),i.radius=.5*this.getSize(e).length(),i}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(){var e=[new c,new c,new c,new c,new c,new c,new c,new c];return function(t){return this.isEmpty()?this:(e[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),e[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),e[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),e[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),e[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),e[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),e[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),e[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(e),this)}}(),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}},ee.prototype={constructor:ee,set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(){var e=new $;return function(t,i){var r=this.center;void 0!==i?r.copy(i):e.setFromPoints(t).getCenter(r);for(var n=0,o=0,a=t.length;o<a;o++)n=Math.max(n,r.distanceToSquared(t[o]));return this.radius=Math.sqrt(n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return Math.abs(this.center.dot(e.normal)-e.constant)<=this.radius},clampPoint:function(e,t){var i=this.center.distanceToSquared(e),r=t||new c;return r.copy(e),i>this.radius*this.radius&&(r.sub(this.center).normalize(),r.multiplyScalar(this.radius).add(this.center)),r},getBoundingBox:function(e){var t=e||new $;return t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}},te.prototype={constructor:te,isMatrix3:!0,set:function(e,t,i,r,n,o,a,s,c){var u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=n,u[5]=s,u[6]=i,u[7]=o,u[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var t=e.elements;return this.set(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]),this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},applyToVector3Array:function(){var e;return function(t,i,r){void 0===e&&(e=new c),void 0===i&&(i=0),void 0===r&&(r=t.length);for(var n=0,o=i;n<r;n+=3,o+=3)e.fromArray(t,o),e.applyMatrix3(this),e.toArray(t,o);return t}}(),applyToBufferAttribute:function(){var e;return function(t){void 0===e&&(e=new c);for(var i=0,r=t.count;i<r;i++)e.x=t.getX(i),e.y=t.getY(i),e.z=t.getZ(i),e.applyMatrix3(this),t.setXYZ(i,e.x,e.y,e.z);return t}}(),multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],i=e[1],r=e[2],n=e[3],o=e[4],a=e[5],s=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-i*n*u+i*a*s+r*n*c-r*o*s},getInverse:function(e,t){e&&e.isMatrix4&&console.error("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");var i=e.elements,r=this.elements,n=i[0],o=i[1],a=i[2],s=i[3],c=i[4],u=i[5],l=i[6],h=i[7],d=i[8],p=d*c-u*h,f=u*l-d*s,m=h*s-c*l,g=n*p+o*f+a*m;if(0===g){var v="THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";if(t===!0)throw new Error(v);return console.warn(v),this.identity()}var y=1/g;return r[0]=p*y,r[1]=(a*h-d*o)*y,r[2]=(u*o-a*c)*y,r[3]=f*y,r[4]=(d*n-a*l)*y,r[5]=(a*s-u*n)*y,r[6]=m*y,r[7]=(o*l-h*n)*y,r[8]=(c*n-o*s)*y,this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(e){return this.setFromMatrix4(e).getInverse(this).transpose()},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},fromArray:function(e,t){void 0===t&&(t=0);for(var i=0;i<9;i++)this.elements[i]=e[i+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var i=this.elements;return e[t]=i[0],e[t+1]=i[1],e[t+2]=i[2],e[t+3]=i[3],e[t+4]=i[4],e[t+5]=i[5],e[t+6]=i[6],e[t+7]=i[7],e[t+8]=i[8],e}},ie.prototype={constructor:ie,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,i,r){return this.normal.set(e,t,i),this.constant=r,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new c,t=new c;return function(i,r,n){var o=e.subVectors(n,r).cross(t.subVectors(i,r)).normalize();return this.setFromNormalAndCoplanarPoint(o,i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return this.orthoPoint(e,t).sub(e).negate()},orthoPoint:function(e,t){var i=this.distanceToPoint(e),r=t||new c;return r.copy(this.normal).multiplyScalar(i)},intersectLine:function(){var e=new c;return function(t,i){var r=i||new c,n=t.delta(e),o=this.normal.dot(n);if(0!==o){var a=-(t.start.dot(this.normal)+this.constant)/o;if(!(a<0||a>1))return r.copy(n).multiplyScalar(a).add(t.start)}else if(0===this.distanceToPoint(t.start))return r.copy(t.start)}}(),intersectsLine:function(e){var t=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return t<0&&i>0||i<0&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){var t=e||new c;return t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var e=new c,t=new te;return function(i,r){var n=this.coplanarPoint(e).applyMatrix4(i),o=r||t.getNormalMatrix(i),a=this.normal.applyMatrix3(o).normalize();
  return this.constant=-n.dot(a),this}}(),translate:function(e){return this.constant=this.constant-e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}},re.prototype={constructor:re,set:function(e,t,i,r,n,o){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(i),a[3].copy(r),a[4].copy(n),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,i=0;i<6;i++)t[i].copy(e.planes[i]);return this},setFromMatrix:function(e){var t=this.planes,i=e.elements,r=i[0],n=i[1],o=i[2],a=i[3],s=i[4],c=i[5],u=i[6],l=i[7],h=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],v=i[14],y=i[15];return t[0].setComponents(a-r,l-s,f-h,y-m).normalize(),t[1].setComponents(a+r,l+s,f+h,y+m).normalize(),t[2].setComponents(a+n,l+c,f+d,y+g).normalize(),t[3].setComponents(a-n,l-c,f-d,y-g).normalize(),t[4].setComponents(a-o,l-u,f-p,y-v).normalize(),t[5].setComponents(a+o,l+u,f+p,y+v).normalize(),this},intersectsObject:function(){var e=new ee;return function(t){var i=t.geometry;return null===i.boundingSphere&&i.computeBoundingSphere(),e.copy(i.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSprite:function(){var e=new ee;return function(t){return e.center.set(0,0,0),e.radius=.7071067811865476,e.applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSphere:function(e){for(var t=this.planes,i=e.center,r=-e.radius,n=0;n<6;n++){var o=t[n].distanceToPoint(i);if(o<r)return!1}return!0},intersectsBox:function(){var e=new c,t=new c;return function(i){for(var r=this.planes,n=0;n<6;n++){var o=r[n];e.x=o.normal.x>0?i.min.x:i.max.x,t.x=o.normal.x>0?i.max.x:i.min.x,e.y=o.normal.y>0?i.min.y:i.max.y,t.y=o.normal.y>0?i.max.y:i.min.y,e.z=o.normal.z>0?i.min.z:i.max.z,t.z=o.normal.z>0?i.max.z:i.min.z;var a=o.distanceToPoint(e),s=o.distanceToPoint(t);if(a<0&&s<0)return!1}return!0}}(),containsPoint:function(e){for(var t=this.planes,i=0;i<6;i++)if(t[i].distanceToPoint(e)<0)return!1;return!0}},oe.prototype={constructor:oe,set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){var i=t||new c;return i.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(){var e=new c;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(e,t){var i=t||new c;i.subVectors(e,this.origin);var r=i.dot(this.direction);return r<0?i.copy(this.origin):i.copy(this.direction).multiplyScalar(r).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(){var e=new c;return function(t){var i=e.subVectors(t,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(t):(e.copy(this.direction).multiplyScalar(i).add(this.origin),e.distanceToSquared(t))}}(),distanceSqToSegment:function(){var e=new c,t=new c,i=new c;return function(r,n,o,a){e.copy(r).add(n).multiplyScalar(.5),t.copy(n).sub(r).normalize(),i.copy(this.origin).sub(e);var s,c,u,l,h=.5*r.distanceTo(n),d=-this.direction.dot(t),p=i.dot(this.direction),f=-i.dot(t),m=i.lengthSq(),g=Math.abs(1-d*d);if(g>0)if(s=d*f-p,c=d*p-f,l=h*g,s>=0)if(c>=-l)if(c<=l){var v=1/g;s*=v,c*=v,u=s*(s+d*c+2*p)+c*(d*s+c+2*f)+m}else c=h,s=Math.max(0,-(d*c+p)),u=-s*s+c*(c+2*f)+m;else c=-h,s=Math.max(0,-(d*c+p)),u=-s*s+c*(c+2*f)+m;else c<=-l?(s=Math.max(0,-(-d*h+p)),c=s>0?-h:Math.min(Math.max(-h,-f),h),u=-s*s+c*(c+2*f)+m):c<=l?(s=0,c=Math.min(Math.max(-h,-f),h),u=c*(c+2*f)+m):(s=Math.max(0,-(d*h+p)),c=s>0?h:Math.min(Math.max(-h,-f),h),u=-s*s+c*(c+2*f)+m);else c=d>0?-h:h,s=Math.max(0,-(d*c+p)),u=-s*s+c*(c+2*f)+m;return o&&o.copy(this.direction).multiplyScalar(s).add(this.origin),a&&a.copy(t).multiplyScalar(c).add(e),u}}(),intersectSphere:function(){var e=new c;return function(t,i){e.subVectors(t.center,this.origin);var r=e.dot(this.direction),n=e.dot(e)-r*r,o=t.radius*t.radius;if(n>o)return null;var a=Math.sqrt(o-n),s=r-a,c=r+a;return s<0&&c<0?null:s<0?this.at(c,i):this.at(s,i)}}(),intersectsSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var i=-(this.origin.dot(e.normal)+e.constant)/t;return i>=0?i:null},intersectPlane:function(e,t){var i=this.distanceToPlane(e);return null===i?null:this.at(i,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);if(0===t)return!0;var i=e.normal.dot(this.direction);return i*t<0},intersectBox:function(e,t){var i,r,n,o,a,s,c=1/this.direction.x,u=1/this.direction.y,l=1/this.direction.z,h=this.origin;return c>=0?(i=(e.min.x-h.x)*c,r=(e.max.x-h.x)*c):(i=(e.max.x-h.x)*c,r=(e.min.x-h.x)*c),u>=0?(n=(e.min.y-h.y)*u,o=(e.max.y-h.y)*u):(n=(e.max.y-h.y)*u,o=(e.min.y-h.y)*u),i>o||n>r?null:((n>i||i!==i)&&(i=n),(o<r||r!==r)&&(r=o),l>=0?(a=(e.min.z-h.z)*l,s=(e.max.z-h.z)*l):(a=(e.max.z-h.z)*l,s=(e.min.z-h.z)*l),i>s||a>r?null:((a>i||i!==i)&&(i=a),(s<r||r!==r)&&(r=s),r<0?null:this.at(i>=0?i:r,t)))},intersectsBox:function(){var e=new c;return function(t){return null!==this.intersectBox(t,e)}}(),intersectTriangle:function(){var e=new c,t=new c,i=new c,r=new c;return function(n,o,a,s,c){t.subVectors(o,n),i.subVectors(a,n),r.crossVectors(t,i);var u,l=this.direction.dot(r);if(l>0){if(s)return null;u=1}else{if(!(l<0))return null;u=-1,l=-l}e.subVectors(this.origin,n);var h=u*this.direction.dot(i.crossVectors(e,i));if(h<0)return null;var d=u*this.direction.dot(t.cross(e));if(d<0)return null;if(h+d>l)return null;var p=-u*e.dot(r);return p<0?null:this.at(p/l,c)}}(),applyMatrix4:function(e){return this.direction.add(this.origin).applyMatrix4(e),this.origin.applyMatrix4(e),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}},ae.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],ae.DefaultOrder="XYZ",ae.prototype={constructor:ae,isEuler:!0,get x(){return this._x},set x(e){this._x=e,this.onChangeCallback()},get y(){return this._y},set y(e){this._y=e,this.onChangeCallback()},get z(){return this._z},set z(e){this._z=e,this.onChangeCallback()},get order(){return this._order},set order(e){this._order=e,this.onChangeCallback()},set:function(e,t,i,r){return this._x=e,this._y=t,this._z=i,this._order=r||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this.onChangeCallback(),this},setFromRotationMatrix:function(e,t,i){var r=Ja.clamp,n=e.elements,o=n[0],a=n[4],s=n[8],c=n[1],u=n[5],l=n[9],h=n[2],d=n[6],p=n[10];return t=t||this._order,"XYZ"===t?(this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-l,p),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(d,u),this._z=0)):"YXZ"===t?(this._x=Math.asin(-r(l,-1,1)),Math.abs(l)<.99999?(this._y=Math.atan2(s,p),this._z=Math.atan2(c,u)):(this._y=Math.atan2(-h,o),this._z=0)):"ZXY"===t?(this._x=Math.asin(r(d,-1,1)),Math.abs(d)<.99999?(this._y=Math.atan2(-h,p),this._z=Math.atan2(-a,u)):(this._y=0,this._z=Math.atan2(c,o))):"ZYX"===t?(this._y=Math.asin(-r(h,-1,1)),Math.abs(h)<.99999?(this._x=Math.atan2(d,p),this._z=Math.atan2(c,o)):(this._x=0,this._z=Math.atan2(-a,u))):"YZX"===t?(this._z=Math.asin(r(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-l,u),this._y=Math.atan2(-h,o)):(this._x=0,this._y=Math.atan2(s,p))):"XZY"===t?(this._z=Math.asin(-r(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(d,u),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-l,p),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,i!==!1&&this.onChangeCallback(),this},setFromQuaternion:function(){var e;return function(t,i,r){return void 0===e&&(e=new u),e.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e,i,r)}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(){var e=new s;return function(t){return e.setFromEuler(this),this.setFromQuaternion(e,t)}}(),equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new c(this._x,this._y,this._z)},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}},se.prototype={constructor:se,set:function(e){this.mask=1<<e},enable:function(e){this.mask|=1<<e},toggle:function(e){this.mask^=1<<e},disable:function(e){this.mask&=~(1<<e)},test:function(e){return 0!==(this.mask&e.mask)}};var cu=0;ce.DefaultUp=new c(0,1,0),ce.DefaultMatrixAutoUpdate=!0,Object.assign(ce.prototype,t.prototype,{isObject3D:!0,applyMatrix:function(e){this.matrix.multiplyMatrices(e,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(){var e=new s;return function(t,i){return e.setFromAxisAngle(t,i),this.quaternion.multiply(e),this}}(),rotateX:function(){var e=new c(1,0,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateY:function(){var e=new c(0,1,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateZ:function(){var e=new c(0,0,1);return function(t){return this.rotateOnAxis(e,t)}}(),translateOnAxis:function(){var e=new c;return function(t,i){return e.copy(t).applyQuaternion(this.quaternion),this.position.add(e.multiplyScalar(i)),this}}(),translateX:function(){var e=new c(1,0,0);return function(t){return this.translateOnAxis(e,t)}}(),translateY:function(){var e=new c(0,1,0);return function(t){return this.translateOnAxis(e,t)}}(),translateZ:function(){var e=new c(0,0,1);return function(t){return this.translateOnAxis(e,t)}}(),localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var e=new u;return function(t){return t.applyMatrix4(e.getInverse(this.matrixWorld))}}(),lookAt:function(){var e=new u;return function(t){e.lookAt(t,this.position,this.up),this.quaternion.setFromRotationMatrix(e)}}(),add:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(null!==e.parent&&e.parent.remove(e),e.parent=this,e.dispatchEvent({type:"added"}),this.children.push(e)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)},remove:function(e){if(arguments.length>1)for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);var i=this.children.indexOf(e);i!==-1&&(e.parent=null,e.dispatchEvent({type:"removed"}),this.children.splice(i,1))},getObjectById:function(e){return this.getObjectByProperty("id",e)},getObjectByName:function(e){return this.getObjectByProperty("name",e)},getObjectByProperty:function(e,t){if(this[e]===t)return this;for(var i=0,r=this.children.length;i<r;i++){var n=this.children[i],o=n.getObjectByProperty(e,t);if(void 0!==o)return o}},getWorldPosition:function(e){var t=e||new c;return this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var e=new c,t=new c;return function(i){var r=i||new s;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,r,t),r}}(),getWorldRotation:function(){var e=new s;return function(t){var i=t||new ae;return this.getWorldQuaternion(e),i.setFromQuaternion(e,this.rotation.order,!1)}}(),getWorldScale:function(){var e=new c,t=new s;return function(i){var r=i||new c;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,t,r),r}}(),getWorldDirection:function(){var e=new s;return function(t){var i=t||new c;return this.getWorldQuaternion(e),i.set(0,0,1).applyQuaternion(e)}}(),raycast:function(){},traverse:function(e){e(this);for(var t=this.children,i=0,r=t.length;i<r;i++)t[i].traverse(e)},traverseVisible:function(e){if(this.visible!==!1){e(this);for(var t=this.children,i=0,r=t.length;i<r;i++)t[i].traverseVisible(e)}},traverseAncestors:function(e){var t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate===!0&&this.updateMatrix(),this.matrixWorldNeedsUpdate!==!0&&e!==!0||(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=this.children,i=0,r=t.length;i<r;i++)t[i].updateMatrixWorld(e)},toJSON:function(e){function t(e){var t=[];for(var i in e){var r=e[i];delete r.metadata,t.push(r)}return t}var i=void 0===e||""===e,r={};i&&(e={geometries:{},materials:{},textures:{},images:{}},r.metadata={version:4.4,type:"Object",generator:"Object3D.toJSON"});var n={};if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),this.castShadow===!0&&(n.castShadow=!0),this.receiveShadow===!0&&(n.receiveShadow=!0),this.visible===!1&&(n.visible=!1),n.matrix=this.matrix.toArray(),void 0!==this.geometry&&(void 0===e.geometries[this.geometry.uuid]&&(e.geometries[this.geometry.uuid]=this.geometry.toJSON(e)),n.geometry=this.geometry.uuid),void 0!==this.material&&(void 0===e.materials[this.material.uuid]&&(e.materials[this.material.uuid]=this.material.toJSON(e)),n.material=this.material.uuid),this.children.length>0){n.children=[];for(var o=0;o<this.children.length;o++)n.children.push(this.children[o].toJSON(e).object)}if(i){var a=t(e.geometries),s=t(e.materials),c=t(e.textures),u=t(e.images);a.length>0&&(r.geometries=a),s.length>0&&(r.materials=s),c.length>0&&(r.textures=c),u.length>0&&(r.images=u)}return r.object=n,r},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(var i=0;i<e.children.length;i++){var r=e.children[i];this.add(r.clone())}return this}}),ue.prototype={constructor:ue,set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){var t=e||new c;return t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){var t=e||new c;return t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){var i=t||new c;return this.delta(i).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(){var e=new c,t=new c;return function(i,r){e.subVectors(i,this.start),t.subVectors(this.end,this.start);var n=t.dot(t),o=t.dot(e),a=o/n;return r&&(a=Ja.clamp(a,0,1)),a}}(),closestPointToPoint:function(e,t,i){var r=this.closestPointToPointParameter(e,t),n=i||new c;return this.delta(n).multiplyScalar(r).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}},le.normal=function(){var e=new c;return function(t,i,r,n){var o=n||new c;o.subVectors(r,i),e.subVectors(t,i),o.cross(e);var a=o.lengthSq();return a>0?o.multiplyScalar(1/Math.sqrt(a)):o.set(0,0,0)}}(),le.barycoordFromPoint=function(){var e=new c,t=new c,i=new c;return function(r,n,o,a,s){e.subVectors(a,n),t.subVectors(o,n),i.subVectors(r,n);var u=e.dot(e),l=e.dot(t),h=e.dot(i),d=t.dot(t),p=t.dot(i),f=u*d-l*l,m=s||new c;if(0===f)return m.set(-2,-1,-1);var g=1/f,v=(d*h-l*p)*g,y=(u*p-l*h)*g;return m.set(1-v-y,y,v)}}(),le.containsPoint=function(){var e=new c;return function(t,i,r,n){var o=le.barycoordFromPoint(t,i,r,n,e);return o.x>=0&&o.y>=0&&o.x+o.y<=1}}(),le.prototype={constructor:le,set:function(e,t,i){return this.a.copy(e),this.b.copy(t),this.c.copy(i),this},setFromPointsAndIndices:function(e,t,i,r){return this.a.copy(e[t]),this.b.copy(e[i]),this.c.copy(e[r]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},area:function(){var e=new c,t=new c;return function(){return e.subVectors(this.c,this.b),t.subVectors(this.a,this.b),.5*e.cross(t).length()}}(),midpoint:function(e){var t=e||new c;return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(e){return le.normal(this.a,this.b,this.c,e)},plane:function(e){var t=e||new ie;return t.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(e,t){return le.barycoordFromPoint(e,this.a,this.b,this.c,t)},containsPoint:function(e){return le.containsPoint(e,this.a,this.b,this.c)},closestPointToPoint:function(){var e,t,i,r;return function(n,o){void 0===e&&(e=new ie,t=[new ue,new ue,new ue],i=new c,r=new c);var a=o||new c,s=1/0;if(e.setFromCoplanarPoints(this.a,this.b,this.c),e.projectPoint(n,i),this.containsPoint(i)===!0)a.copy(i);else{t[0].set(this.a,this.b),t[1].set(this.b,this.c),t[2].set(this.c,this.a);for(var u=0;u<t.length;u++){t[u].closestPointToPoint(i,!0,r);var l=i.distanceToSquared(r);l<s&&(s=l,a.copy(r))}}return a}}(),equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},he.prototype={constructor:he,clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.a=e.a,this.b=e.b,this.c=e.c,this.normal.copy(e.normal),this.color.copy(e.color),this.materialIndex=e.materialIndex;for(var t=0,i=e.vertexNormals.length;t<i;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(var t=0,i=e.vertexColors.length;t<i;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}},de.prototype=Object.create(Z.prototype),de.prototype.constructor=de,de.prototype.isMeshBasicMaterial=!0,de.prototype.copy=function(e){return Z.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this},pe.prototype={constructor:pe,isBufferAttribute:!0,set needsUpdate(e){e===!0&&this.version++},setArray:function(e){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==e?e.length/this.itemSize:0,this.array=e},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.dynamic=e.dynamic,this},copyAt:function(e,t,i){e*=this.itemSize,i*=t.itemSize;for(var r=0,n=this.itemSize;r<n;r++)this.array[e+r]=t.array[i+r];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,i=0,r=0,n=e.length;r<n;r++){var o=e[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",r),o=new Y),t[i++]=o.r,t[i++]=o.g,t[i++]=o.b}return this},copyIndicesArray:function(e){for(var t=this.array,i=0,r=0,n=e.length;r<n;r++){var o=e[r];t[i++]=o.a,t[i++]=o.b,t[i++]=o.c}return this},copyVector2sArray:function(e){for(var t=this.array,r=0,n=0,o=e.length;n<o;n++){var a=e[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",n),a=new i),t[r++]=a.x,t[r++]=a.y}return this},copyVector3sArray:function(e){for(var t=this.array,i=0,r=0,n=e.length;r<n;r++){var o=e[r];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",r),o=new c),t[i++]=o.x,t[i++]=o.y,t[i++]=o.z}return this},copyVector4sArray:function(e){for(var t=this.array,i=0,r=0,o=e.length;r<o;r++){var a=e[r];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",r),a=new n),t[i++]=a.x,t[i++]=a.y,t[i++]=a.z,t[i++]=a.w}return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},getX:function(e){return this.array[e*this.itemSize]},setX:function(e,t){return this.array[e*this.itemSize]=t,this},getY:function(e){return this.array[e*this.itemSize+1]},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},getZ:function(e){return this.array[e*this.itemSize+2]},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},getW:function(e){return this.array[e*this.itemSize+3]},setW:function(e,t){return this.array[e*this.itemSize+3]=t,this},setXY:function(e,t,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this},setXYZ:function(e,t,i,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this},setXYZW:function(e,t,i,r,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=i,this.array[e+2]=r,this.array[e+3]=n,this},onUpload:function(e){return this.onUploadCallback=e,this},clone:function(){return(new this.constructor).copy(this)}},fe.prototype=Object.create(pe.prototype),fe.prototype.constructor=fe,me.prototype=Object.create(pe.prototype),me.prototype.constructor=me,ge.prototype=Object.create(pe.prototype),ge.prototype.constructor=ge,ve.prototype=Object.create(pe.prototype),ve.prototype.constructor=ve,ye.prototype=Object.create(pe.prototype),ye.prototype.constructor=ye,Me.prototype=Object.create(pe.prototype),Me.prototype.constructor=Me,Ae.prototype=Object.create(pe.prototype),Ae.prototype.constructor=Ae,we.prototype=Object.create(pe.prototype),we.prototype.constructor=we,xe.prototype=Object.create(pe.prototype),xe.prototype.constructor=xe,Object.assign(Ee.prototype,{computeGroups:function(e){for(var t,i=[],r=void 0,n=e.faces,o=0;o<n.length;o++){var a=n[o];a.materialIndex!==r&&(r=a.materialIndex,void 0!==t&&(t.count=3*o-t.start,i.push(t)),t={start:3*o,materialIndex:r})}void 0!==t&&(t.count=3*o-t.start,i.push(t)),this.groups=i},fromGeometry:function(e){var t,r=e.faces,n=e.vertices,o=e.faceVertexUvs,a=o[0]&&o[0].length>0,s=o[1]&&o[1].length>0,c=e.morphTargets,u=c.length;if(u>0){t=[];for(var l=0;l<u;l++)t[l]=[];this.morphTargets.position=t}var h,d=e.morphNormals,p=d.length;if(p>0){h=[];for(var l=0;l<p;l++)h[l]=[];this.morphTargets.normal=h}for(var f=e.skinIndices,m=e.skinWeights,g=f.length===n.length,v=m.length===n.length,l=0;l<r.length;l++){var y=r[l];this.vertices.push(n[y.a],n[y.b],n[y.c]);var M=y.vertexNormals;if(3===M.length)this.normals.push(M[0],M[1],M[2]);else{var A=y.normal;this.normals.push(A,A,A)}var w=y.vertexColors;if(3===w.length)this.colors.push(w[0],w[1],w[2]);else{var x=y.color;this.colors.push(x,x,x)}if(a===!0){var E=o[0][l];void 0!==E?this.uvs.push(E[0],E[1],E[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",l),this.uvs.push(new i,new i,new i))}if(s===!0){var E=o[1][l];void 0!==E?this.uvs2.push(E[0],E[1],E[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",l),this.uvs2.push(new i,new i,new i))}for(var b=0;b<u;b++){var T=c[b].vertices;t[b].push(T[y.a],T[y.b],T[y.c])}for(var b=0;b<p;b++){var L=d[b].vertexNormals[l];h[b].push(L.a,L.b,L.c)}g&&this.skinIndices.push(f[y.a],f[y.b],f[y.c]),v&&this.skinWeights.push(m[y.a],m[y.b],m[y.c])}return this.computeGroups(e),this.verticesNeedUpdate=e.verticesNeedUpdate,this.normalsNeedUpdate=e.normalsNeedUpdate,this.colorsNeedUpdate=e.colorsNeedUpdate,this.uvsNeedUpdate=e.uvsNeedUpdate,this.groupsNeedUpdate=e.groupsNeedUpdate,this}}),Object.assign(be.prototype,t.prototype,{isGeometry:!0,applyMatrix:function(e){for(var t=(new te).getNormalMatrix(e),i=0,r=this.vertices.length;i<r;i++){var n=this.vertices[i];n.applyMatrix4(e)}for(var i=0,r=this.faces.length;i<r;i++){var o=this.faces[i];o.normal.applyMatrix3(t).normalize();for(var a=0,s=o.vertexNormals.length;a<s;a++)o.vertexNormals[a].applyMatrix3(t).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var e;return function(t){return void 0===e&&(e=new u),e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e;return function(t){return void 0===e&&(e=new u),e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e;return function(t){return void 0===e&&(e=new u),e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e;return function(t,i,r){return void 0===e&&(e=new u),e.makeTranslation(t,i,r),this.applyMatrix(e),this}}(),scale:function(){var e;return function(t,i,r){return void 0===e&&(e=new u),e.makeScale(t,i,r),this.applyMatrix(e),this}}(),lookAt:function(){var e;return function(t){void 0===e&&(e=new ce),e.lookAt(t),e.updateMatrix(),this.applyMatrix(e.matrix)}}(),fromBufferGeometry:function(e){function t(e,t,i,n){var o=void 0!==s?[d[e].clone(),d[t].clone(),d[i].clone()]:[],a=void 0!==u?[r.colors[e].clone(),r.colors[t].clone(),r.colors[i].clone()]:[],c=new he(e,t,i,o,a,n);r.faces.push(c),void 0!==l&&r.faceVertexUvs[0].push([p[e].clone(),p[t].clone(),p[i].clone()]),void 0!==h&&r.faceVertexUvs[1].push([f[e].clone(),f[t].clone(),f[i].clone()])}var r=this,n=null!==e.index?e.index.array:void 0,o=e.attributes,a=o.position.array,s=void 0!==o.normal?o.normal.array:void 0,u=void 0!==o.color?o.color.array:void 0,l=void 0!==o.uv?o.uv.array:void 0,h=void 0!==o.uv2?o.uv2.array:void 0;void 0!==h&&(this.faceVertexUvs[1]=[]);for(var d=[],p=[],f=[],m=0,g=0;m<a.length;m+=3,g+=2)r.vertices.push(new c(a[m],a[m+1],a[m+2])),void 0!==s&&d.push(new c(s[m],s[m+1],s[m+2])),void 0!==u&&r.colors.push(new Y(u[m],u[m+1],u[m+2])),void 0!==l&&p.push(new i(l[g],l[g+1])),void 0!==h&&f.push(new i(h[g],h[g+1]));if(void 0!==n){var v=e.groups;if(v.length>0)for(var m=0;m<v.length;m++)for(var y=v[m],M=y.start,A=y.count,g=M,w=M+A;g<w;g+=3)t(n[g],n[g+1],n[g+2],y.materialIndex);else for(var m=0;m<n.length;m+=3)t(n[m],n[m+1],n[m+2])}else for(var m=0;m<a.length/3;m+=3)t(m,m+1,m+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var e=this.boundingBox.getCenter().negate();return this.translate(e.x,e.y,e.z),e},normalize:function(){this.computeBoundingSphere();var e=this.boundingSphere.center,t=this.boundingSphere.radius,i=0===t?1:1/t,r=new u;return r.set(i,0,0,-i*e.x,0,i,0,-i*e.y,0,0,i,-i*e.z,0,0,0,1),this.applyMatrix(r),this},computeFaceNormals:function(){for(var e=new c,t=new c,i=0,r=this.faces.length;i<r;i++){var n=this.faces[i],o=this.vertices[n.a],a=this.vertices[n.b],s=this.vertices[n.c];e.subVectors(s,a),t.subVectors(o,a),e.cross(t),e.normalize(),n.normal.copy(e)}},computeVertexNormals:function(e){void 0===e&&(e=!0);var t,i,r,n,o,a;for(a=new Array(this.vertices.length),t=0,i=this.vertices.length;t<i;t++)a[t]=new c;if(e){var s,u,l,h=new c,d=new c;for(r=0,n=this.faces.length;r<n;r++)o=this.faces[r],s=this.vertices[o.a],u=this.vertices[o.b],l=this.vertices[o.c],h.subVectors(l,u),d.subVectors(s,u),h.cross(d),a[o.a].add(h),a[o.b].add(h),a[o.c].add(h)}else for(this.computeFaceNormals(),r=0,n=this.faces.length;r<n;r++)o=this.faces[r],a[o.a].add(o.normal),a[o.b].add(o.normal),a[o.c].add(o.normal);for(t=0,i=this.vertices.length;t<i;t++)a[t].normalize();for(r=0,n=this.faces.length;r<n;r++){o=this.faces[r];var p=o.vertexNormals;3===p.length?(p[0].copy(a[o.a]),p[1].copy(a[o.b]),p[2].copy(a[o.c])):(p[0]=a[o.a].clone(),p[1]=a[o.b].clone(),p[2]=a[o.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,i;for(this.computeFaceNormals(),e=0,t=this.faces.length;e<t;e++){i=this.faces[e];var r=i.vertexNormals;3===r.length?(r[0].copy(i.normal),r[1].copy(i.normal),r[2].copy(i.normal)):(r[0]=i.normal.clone(),r[1]=i.normal.clone(),r[2]=i.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,i,r,n;for(i=0,r=this.faces.length;i<r;i++)for(n=this.faces[i],n.__originalFaceNormal?n.__originalFaceNormal.copy(n.normal):n.__originalFaceNormal=n.normal.clone(),n.__originalVertexNormals||(n.__originalVertexNormals=[]),e=0,t=n.vertexNormals.length;e<t;e++)n.__originalVertexNormals[e]?n.__originalVertexNormals[e].copy(n.vertexNormals[e]):n.__originalVertexNormals[e]=n.vertexNormals[e].clone();var o=new be;for(o.faces=this.faces,e=0,t=this.morphTargets.length;e<t;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var a,s,u=this.morphNormals[e].faceNormals,l=this.morphNormals[e].vertexNormals;for(i=0,r=this.faces.length;i<r;i++)a=new c,s={a:new c,b:new c,c:new c},u.push(a),l.push(s)}var h=this.morphNormals[e];o.vertices=this.morphTargets[e].vertices,o.computeFaceNormals(),o.computeVertexNormals();var a,s;for(i=0,r=this.faces.length;i<r;i++)n=this.faces[i],a=h.faceNormals[i],s=h.vertexNormals[i],a.copy(n.normal),s.a.copy(n.vertexNormals[0]),s.b.copy(n.vertexNormals[1]),s.c.copy(n.vertexNormals[2])}for(i=0,r=this.faces.length;i<r;i++)n=this.faces[i],n.normal=n.__originalFaceNormal,n.vertexNormals=n.__originalVertexNormals},computeLineDistances:function(){for(var e=0,t=this.vertices,i=0,r=t.length;i<r;i++)i>0&&(e+=t[i].distanceTo(t[i-1])),this.lineDistances[i]=e},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new $),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new ee),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,i){if((e&&e.isGeometry)===!1)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e);var r,n=this.vertices.length,o=this.vertices,a=e.vertices,s=this.faces,c=e.faces,u=this.faceVertexUvs[0],l=e.faceVertexUvs[0],h=this.colors,d=e.colors;void 0===i&&(i=0),void 0!==t&&(r=(new te).getNormalMatrix(t));for(var p=0,f=a.length;p<f;p++){var m=a[p],g=m.clone();void 0!==t&&g.applyMatrix4(t),o.push(g)}for(var p=0,f=d.length;p<f;p++)h.push(d[p].clone());for(p=0,f=c.length;p<f;p++){var v,y,M,A=c[p],w=A.vertexNormals,x=A.vertexColors;v=new he(A.a+n,A.b+n,A.c+n),v.normal.copy(A.normal),void 0!==r&&v.normal.applyMatrix3(r).normalize();for(var E=0,b=w.length;E<b;E++)y=w[E].clone(),void 0!==r&&y.applyMatrix3(r).normalize(),v.vertexNormals.push(y);v.color.copy(A.color);for(var E=0,b=x.length;E<b;E++)M=x[E],v.vertexColors.push(M.clone());v.materialIndex=A.materialIndex+i,s.push(v)}for(p=0,f=l.length;p<f;p++){var T=l[p],L=[];if(void 0!==T){for(var E=0,b=T.length;E<b;E++)L.push(T[E].clone());u.push(L);
  }}},mergeMesh:function(e){return(e&&e.isMesh)===!1?void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e):(e.matrixAutoUpdate&&e.updateMatrix(),void this.merge(e.geometry,e.matrix))},mergeVertices:function(){var e,t,i,r,n,o,a,s,c={},u=[],l=[],h=4,d=Math.pow(10,h);for(i=0,r=this.vertices.length;i<r;i++)e=this.vertices[i],t=Math.round(e.x*d)+"_"+Math.round(e.y*d)+"_"+Math.round(e.z*d),void 0===c[t]?(c[t]=i,u.push(this.vertices[i]),l[i]=u.length-1):l[i]=l[c[t]];var p=[];for(i=0,r=this.faces.length;i<r;i++){n=this.faces[i],n.a=l[n.a],n.b=l[n.b],n.c=l[n.c],o=[n.a,n.b,n.c];for(var f=-1,m=0;m<3;m++)if(o[m]===o[(m+1)%3]){f=m,p.push(i);break}}for(i=p.length-1;i>=0;i--){var g=p[i];for(this.faces.splice(g,1),a=0,s=this.faceVertexUvs.length;a<s;a++)this.faceVertexUvs[a].splice(g,1)}var v=this.vertices.length-u.length;return this.vertices=u,v},sortFacesByMaterialIndex:function(){function e(e,t){return e.materialIndex-t.materialIndex}for(var t=this.faces,i=t.length,r=0;r<i;r++)t[r]._id=r;t.sort(e);var n,o,a=this.faceVertexUvs[0],s=this.faceVertexUvs[1];a&&a.length===i&&(n=[]),s&&s.length===i&&(o=[]);for(var r=0;r<i;r++){var c=t[r]._id;n&&n.push(a[c]),o&&o.push(s[c])}n&&(this.faceVertexUvs[0]=n),o&&(this.faceVertexUvs[1]=o)},toJSON:function(){function e(e,t,i){return i?e|1<<t:e&~(1<<t)}function t(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==d[t]?d[t]:(d[t]=h.length/3,h.push(e.x,e.y,e.z),d[t])}function i(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==f[t]?f[t]:(f[t]=p.length,p.push(e.getHex()),f[t])}function r(e){var t=e.x.toString()+e.y.toString();return void 0!==g[t]?g[t]:(g[t]=m.length/2,m.push(e.x,e.y),g[t])}var n={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),void 0!==this.parameters){var o=this.parameters;for(var a in o)void 0!==o[a]&&(n[a]=o[a]);return n}for(var s=[],c=0;c<this.vertices.length;c++){var u=this.vertices[c];s.push(u.x,u.y,u.z)}for(var l=[],h=[],d={},p=[],f={},m=[],g={},c=0;c<this.faces.length;c++){var v=this.faces[c],y=!0,M=!1,A=void 0!==this.faceVertexUvs[0][c],w=v.normal.length()>0,x=v.vertexNormals.length>0,E=1!==v.color.r||1!==v.color.g||1!==v.color.b,b=v.vertexColors.length>0,T=0;if(T=e(T,0,0),T=e(T,1,y),T=e(T,2,M),T=e(T,3,A),T=e(T,4,w),T=e(T,5,x),T=e(T,6,E),T=e(T,7,b),l.push(T),l.push(v.a,v.b,v.c),l.push(v.materialIndex),A){var L=this.faceVertexUvs[0][c];l.push(r(L[0]),r(L[1]),r(L[2]))}if(w&&l.push(t(v.normal)),x){var N=v.vertexNormals;l.push(t(N[0]),t(N[1]),t(N[2]))}if(E&&l.push(i(v.color)),b){var D=v.vertexColors;l.push(i(D[0]),i(D[1]),i(D[2]))}}return n.data={},n.data.vertices=s,n.data.normals=h,p.length>0&&(n.data.colors=p),m.length>0&&(n.data.uvs=[m]),n.data.faces=l,n},clone:function(){return(new be).copy(this)},copy:function(e){this.vertices=[],this.faces=[],this.faceVertexUvs=[[]],this.colors=[];for(var t=e.vertices,i=0,r=t.length;i<r;i++)this.vertices.push(t[i].clone());for(var n=e.colors,i=0,r=n.length;i<r;i++)this.colors.push(n[i].clone());for(var o=e.faces,i=0,r=o.length;i<r;i++)this.faces.push(o[i].clone());for(var i=0,r=e.faceVertexUvs.length;i<r;i++){var a=e.faceVertexUvs[i];void 0===this.faceVertexUvs[i]&&(this.faceVertexUvs[i]=[]);for(var s=0,c=a.length;s<c;s++){for(var u=a[s],l=[],h=0,d=u.length;h<d;h++){var p=u[h];l.push(p.clone())}this.faceVertexUvs[i].push(l)}}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var uu=0;Object.assign(Le.prototype,t.prototype,{isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(e){this.index=e},addAttribute:function(e,t){return(t&&t.isBufferAttribute)===!1&&(t&&t.isInterleavedBufferAttribute)===!1?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),void this.addAttribute(e,new pe(arguments[1],arguments[2]))):"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),void this.setIndex(t)):(this.attributes[e]=t,this)},getAttribute:function(e){return this.attributes[e]},removeAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,i){this.groups.push({start:e,count:t,materialIndex:void 0!==i?i:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix:function(e){var t=this.attributes.position;void 0!==t&&(e.applyToVector3Array(t.array),t.needsUpdate=!0);var i=this.attributes.normal;if(void 0!==i){var r=(new te).getNormalMatrix(e);r.applyToVector3Array(i.array),i.needsUpdate=!0}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var e;return function(t){return void 0===e&&(e=new u),e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e;return function(t){return void 0===e&&(e=new u),e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e;return function(t){return void 0===e&&(e=new u),e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e;return function(t,i,r){return void 0===e&&(e=new u),e.makeTranslation(t,i,r),this.applyMatrix(e),this}}(),scale:function(){var e;return function(t,i,r){return void 0===e&&(e=new u),e.makeScale(t,i,r),this.applyMatrix(e),this}}(),lookAt:function(){var e;return function(t){void 0===e&&(e=new ce),e.lookAt(t),e.updateMatrix(),this.applyMatrix(e.matrix)}}(),center:function(){this.computeBoundingBox();var e=this.boundingBox.getCenter().negate();return this.translate(e.x,e.y,e.z),e},setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var i=new we(3*t.vertices.length,3),r=new we(3*t.colors.length,3);if(this.addAttribute("position",i.copyVector3sArray(t.vertices)),this.addAttribute("color",r.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var n=new we(t.lineDistances.length,1);this.addAttribute("lineDistance",n.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},updateFromObject:function(e){var t=e.geometry;if(e.isMesh){var i=t.__directGeometry;if(t.elementsNeedUpdate===!0&&(i=void 0,t.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(t);i.verticesNeedUpdate=t.verticesNeedUpdate,i.normalsNeedUpdate=t.normalsNeedUpdate,i.colorsNeedUpdate=t.colorsNeedUpdate,i.uvsNeedUpdate=t.uvsNeedUpdate,i.groupsNeedUpdate=t.groupsNeedUpdate,t.verticesNeedUpdate=!1,t.normalsNeedUpdate=!1,t.colorsNeedUpdate=!1,t.uvsNeedUpdate=!1,t.groupsNeedUpdate=!1,t=i}var r;return t.verticesNeedUpdate===!0&&(r=this.attributes.position,void 0!==r&&(r.copyVector3sArray(t.vertices),r.needsUpdate=!0),t.verticesNeedUpdate=!1),t.normalsNeedUpdate===!0&&(r=this.attributes.normal,void 0!==r&&(r.copyVector3sArray(t.normals),r.needsUpdate=!0),t.normalsNeedUpdate=!1),t.colorsNeedUpdate===!0&&(r=this.attributes.color,void 0!==r&&(r.copyColorsArray(t.colors),r.needsUpdate=!0),t.colorsNeedUpdate=!1),t.uvsNeedUpdate&&(r=this.attributes.uv,void 0!==r&&(r.copyVector2sArray(t.uvs),r.needsUpdate=!0),t.uvsNeedUpdate=!1),t.lineDistancesNeedUpdate&&(r=this.attributes.lineDistance,void 0!==r&&(r.copyArray(t.lineDistances),r.needsUpdate=!0),t.lineDistancesNeedUpdate=!1),t.groupsNeedUpdate&&(t.computeGroups(e.geometry),this.groups=t.groups,t.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new Ee).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.addAttribute("position",new pe(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var i=new Float32Array(3*e.normals.length);this.addAttribute("normal",new pe(i,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var r=new Float32Array(3*e.colors.length);this.addAttribute("color",new pe(r,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var n=new Float32Array(2*e.uvs.length);this.addAttribute("uv",new pe(n,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var o=new Float32Array(2*e.uvs2.length);this.addAttribute("uv2",new pe(o,2).copyVector2sArray(e.uvs2))}if(e.indices.length>0){var a=e.vertices.length>65535?Uint32Array:Uint16Array,s=new a(3*e.indices.length);this.setIndex(new pe(s,1).copyIndicesArray(e.indices))}this.groups=e.groups;for(var c in e.morphTargets){for(var u=[],l=e.morphTargets[c],h=0,d=l.length;h<d;h++){var p=l[h],f=new we(3*p.length,3);u.push(f.copyVector3sArray(p))}this.morphAttributes[c]=u}if(e.skinIndices.length>0){var m=new we(4*e.skinIndices.length,4);this.addAttribute("skinIndex",m.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var g=new we(4*e.skinWeights.length,4);this.addAttribute("skinWeight",g.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new $);var e=this.attributes.position;void 0!==e?this.boundingBox.setFromBufferAttribute(e):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var e=new $,t=new c;return function(){null===this.boundingSphere&&(this.boundingSphere=new ee);var i=this.attributes.position;if(i){var r=this.boundingSphere.center;e.setFromBufferAttribute(i),e.getCenter(r);for(var n=0,o=0,a=i.count;o<a;o++)t.x=i.getX(o),t.y=i.getY(o),t.z=i.getZ(o),n=Math.max(n,r.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.index,t=this.attributes,i=this.groups;if(t.position){var r=t.position.array;if(void 0===t.normal)this.addAttribute("normal",new pe(new Float32Array(r.length),3));else for(var n=t.normal.array,o=0,a=n.length;o<a;o++)n[o]=0;var s,u,l,h=t.normal.array,d=new c,p=new c,f=new c,m=new c,g=new c;if(e){var v=e.array;0===i.length&&this.addGroup(0,v.length);for(var y=0,M=i.length;y<M;++y)for(var A=i[y],w=A.start,x=A.count,o=w,a=w+x;o<a;o+=3)s=3*v[o+0],u=3*v[o+1],l=3*v[o+2],d.fromArray(r,s),p.fromArray(r,u),f.fromArray(r,l),m.subVectors(f,p),g.subVectors(d,p),m.cross(g),h[s]+=m.x,h[s+1]+=m.y,h[s+2]+=m.z,h[u]+=m.x,h[u+1]+=m.y,h[u+2]+=m.z,h[l]+=m.x,h[l+1]+=m.y,h[l+2]+=m.z}else for(var o=0,a=r.length;o<a;o+=9)d.fromArray(r,o),p.fromArray(r,o+3),f.fromArray(r,o+6),m.subVectors(f,p),g.subVectors(d,p),m.cross(g),h[o]=m.x,h[o+1]=m.y,h[o+2]=m.z,h[o+3]=m.x,h[o+4]=m.y,h[o+5]=m.z,h[o+6]=m.x,h[o+7]=m.y,h[o+8]=m.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},merge:function(e,t){if((e&&e.isBufferGeometry)===!1)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);void 0===t&&(t=0);var i=this.attributes;for(var r in i)if(void 0!==e.attributes[r])for(var n=i[r],o=n.array,a=e.attributes[r],s=a.array,c=a.itemSize,u=0,l=c*t;u<s.length;u++,l++)o[l]=s[u];return this},normalizeNormals:function(){for(var e,t,i,r,n=this.attributes.normal.array,o=0,a=n.length;o<a;o+=3)e=n[o],t=n[o+1],i=n[o+2],r=1/Math.sqrt(e*e+t*t+i*i),n[o]*=r,n[o+1]*=r,n[o+2]*=r},toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e=new Le,t=this.index.array,i=this.attributes;for(var r in i){for(var n=i[r],o=n.array,a=n.itemSize,s=new o.constructor(t.length*a),c=0,u=0,l=0,h=t.length;l<h;l++){c=t[l]*a;for(var d=0;d<a;d++)s[u++]=o[c++]}e.addAttribute(r,new pe(s,a))}return e},toJSON:function(){var e={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),void 0!==this.parameters){var t=this.parameters;for(var i in t)void 0!==t[i]&&(e[i]=t[i]);return e}e.data={attributes:{}};var r=this.index;if(null!==r){var n=Array.prototype.slice.call(r.array);e.data.index={type:r.array.constructor.name,array:n}}var o=this.attributes;for(var i in o){var a=o[i],n=Array.prototype.slice.call(a.array);e.data.attributes[i]={itemSize:a.itemSize,type:a.array.constructor.name,array:n,normalized:a.normalized}}var s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));var c=this.boundingSphere;return null!==c&&(e.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),e},clone:function(){return(new Le).copy(this)},copy:function(e){var t=e.index;null!==t&&this.setIndex(t.clone());var i=e.attributes;for(var r in i){var n=i[r];this.addAttribute(r,n.clone())}for(var o=e.groups,a=0,s=o.length;a<s;a++){var c=o[a];this.addGroup(c.start,c.count,c.materialIndex)}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Le.MaxIndex=65535,Ne.prototype=Object.assign(Object.create(ce.prototype),{constructor:Ne,isMesh:!0,setDrawMode:function(e){this.drawMode=e},copy:function(e){return ce.prototype.copy.call(this,e),this.drawMode=e.drawMode,this},updateMorphTargets:function(){var e=this.geometry.morphTargets;if(void 0!==e&&e.length>0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var t=0,i=e.length;t<i;t++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[e[t].name]=t}},raycast:function(){function e(e,t,i,r,n,o,a){return le.barycoordFromPoint(e,t,i,r,y),n.multiplyScalar(y.x),o.multiplyScalar(y.y),a.multiplyScalar(y.z),n.add(o).add(a),n.clone()}function t(e,t,i,r,n,o,a){var s,c=e.material;if(s=c.side===Fn?i.intersectTriangle(o,n,r,!0,a):i.intersectTriangle(r,n,o,c.side!==Gn,a),null===s)return null;A.copy(a),A.applyMatrix4(e.matrixWorld);var u=t.ray.origin.distanceTo(A);return u<t.near||u>t.far?null:{distance:u,point:A.clone(),object:e}}function r(i,r,n,o,a,c,u,d){s.fromArray(o,3*c),l.fromArray(o,3*u),h.fromArray(o,3*d);var p=t(i,r,n,s,l,h,M);return p&&(a&&(m.fromArray(a,2*c),g.fromArray(a,2*u),v.fromArray(a,2*d),p.uv=e(M,s,l,h,m,g,v)),p.face=new he(c,u,d,le.normal(s,l,h)),p.faceIndex=c),p}var n=new u,o=new oe,a=new ee,s=new c,l=new c,h=new c,d=new c,p=new c,f=new c,m=new i,g=new i,v=new i,y=new c,M=new c,A=new c;return function(i,c){var u=this.geometry,y=this.material,A=this.matrixWorld;if(void 0!==y&&(null===u.boundingSphere&&u.computeBoundingSphere(),a.copy(u.boundingSphere),a.applyMatrix4(A),i.ray.intersectsSphere(a)!==!1&&(n.getInverse(A),o.copy(i.ray).applyMatrix4(n),null===u.boundingBox||o.intersectsBox(u.boundingBox)!==!1))){var w,x;if(u.isBufferGeometry){var E,b,T,L=u.index,N=u.attributes,D=N.position.array;if(void 0!==N.uv&&(w=N.uv.array),null!==L)for(var S=L.array,I=0,C=S.length;I<C;I+=3)E=S[I],b=S[I+1],T=S[I+2],x=r(this,i,o,D,w,E,b,T),x&&(x.faceIndex=Math.floor(I/3),c.push(x));else for(var I=0,C=D.length;I<C;I+=9)E=I/3,b=E+1,T=E+2,x=r(this,i,o,D,w,E,b,T),x&&(x.index=E,c.push(x))}else if(u.isGeometry){var _,j,O,z=y&&y.isMultiMaterial,R=z===!0?y.materials:null,k=u.vertices,U=u.faces,P=u.faceVertexUvs[0];P.length>0&&(w=P);for(var B=0,F=U.length;B<F;B++){var G=U[B],H=z===!0?R[G.materialIndex]:y;if(void 0!==H){if(_=k[G.a],j=k[G.b],O=k[G.c],H.morphTargets===!0){var Q=u.morphTargets,Y=this.morphTargetInfluences;s.set(0,0,0),l.set(0,0,0),h.set(0,0,0);for(var V=0,W=Q.length;V<W;V++){var X=Y[V];if(0!==X){var q=Q[V].vertices;s.addScaledVector(d.subVectors(q[G.a],_),X),l.addScaledVector(p.subVectors(q[G.b],j),X),h.addScaledVector(f.subVectors(q[G.c],O),X)}}s.add(_),l.add(j),h.add(O),_=s,j=l,O=h}if(x=t(this,i,o,_,j,O,M)){if(w){var Z=w[B];m.copy(Z[0]),g.copy(Z[1]),v.copy(Z[2]),x.uv=e(M,_,j,O,m,g,v)}x.face=G,x.faceIndex=B,c.push(x)}}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),De.prototype=Object.create(Le.prototype),De.prototype.constructor=De,Se.prototype=Object.create(Le.prototype),Se.prototype.constructor=Se,Ie.prototype=Object.create(ce.prototype),Ie.prototype.constructor=Ie,Ie.prototype.isCamera=!0,Ie.prototype.getWorldDirection=function(){var e=new s;return function(t){var i=t||new c;return this.getWorldQuaternion(e),i.set(0,0,-1).applyQuaternion(e)}}(),Ie.prototype.lookAt=function(){var e=new u;return function(t){e.lookAt(this.position,t,this.up),this.quaternion.setFromRotationMatrix(e)}}(),Ie.prototype.clone=function(){return(new this.constructor).copy(this)},Ie.prototype.copy=function(e){return ce.prototype.copy.call(this,e),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this},Ce.prototype=Object.assign(Object.create(Ie.prototype),{constructor:Ce,isPerspectiveCamera:!0,copy:function(e){return Ie.prototype.copy.call(this,e),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*Ja.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var e=Math.tan(.5*Ja.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*Ja.RAD2DEG*Math.atan(Math.tan(.5*Ja.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,i,r,n,o){this.aspect=e/t,this.view={fullWidth:e,fullHeight:t,offsetX:i,offsetY:r,width:n,height:o},this.updateProjectionMatrix()},clearViewOffset:function(){this.view=null,this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=this.near,t=e*Math.tan(.5*Ja.DEG2RAD*this.fov)/this.zoom,i=2*t,r=this.aspect*i,n=-.5*r,o=this.view;if(null!==o){var a=o.fullWidth,s=o.fullHeight;n+=o.offsetX*r/a,t-=o.offsetY*i/s,r*=o.width/a,i*=o.height/s}var c=this.filmOffset;0!==c&&(n+=e*c/this.getFilmWidth()),this.projectionMatrix.makeFrustum(n,n+r,t-i,t,e,this.far)},toJSON:function(e){var t=ce.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}),_e.prototype=Object.assign(Object.create(Ie.prototype),{constructor:_e,isOrthographicCamera:!0,copy:function(e){return Ie.prototype.copy.call(this,e),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this},setViewOffset:function(e,t,i,r,n,o){this.view={fullWidth:e,fullHeight:t,offsetX:i,offsetY:r,width:n,height:o},this.updateProjectionMatrix()},clearViewOffset:function(){this.view=null,this.updateProjectionMatrix()},updateProjectionMatrix:function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2,n=i-e,o=i+e,a=r+t,s=r-t;if(null!==this.view){var c=this.zoom/(this.view.width/this.view.fullWidth),u=this.zoom/(this.view.height/this.view.fullHeight),l=(this.right-this.left)/this.view.width,h=(this.top-this.bottom)/this.view.height;n+=l*(this.view.offsetX/c),o=n+l*(this.view.width/c),a-=h*(this.view.offsetY/u),s=a-h*(this.view.height/u)}this.projectionMatrix.makeOrthographic(n,o,a,s,this.near,this.far)},toJSON:function(e){var t=ce.prototype.toJSON.call(this,e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}});var lu=0;at.prototype.isFogExp2=!0,at.prototype.clone=function(){return new at(this.color.getHex(),this.density)},at.prototype.toJSON=function(e){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},st.prototype.isFog=!0,st.prototype.clone=function(){return new st(this.color.getHex(),this.near,this.far)},st.prototype.toJSON=function(e){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},ct.prototype=Object.create(ce.prototype),ct.prototype.constructor=ct,ct.prototype.copy=function(e,t){return ce.prototype.copy.call(this,e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this},ct.prototype.toJSON=function(e){var t=ce.prototype.toJSON.call(this,e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t},ut.prototype=Object.assign(Object.create(ce.prototype),{constructor:ut,isLensFlare:!0,copy:function(e){ce.prototype.copy.call(this,e),this.positionScreen.copy(e.positionScreen),this.customUpdateCallback=e.customUpdateCallback;for(var t=0,i=e.lensFlares.length;t<i;t++)this.lensFlares.push(e.lensFlares[t]);return this},add:function(e,t,i,r,n,o){void 0===t&&(t=-1),void 0===i&&(i=0),void 0===o&&(o=1),void 0===n&&(n=new Y(16777215)),void 0===r&&(r=qn),i=Math.min(i,Math.max(0,i)),this.lensFlares.push({texture:e,size:t,distance:i,x:0,y:0,z:0,scale:1,rotation:0,opacity:o,color:n,blending:r})},updateLensFlares:function(){var e,t,i=this.lensFlares.length,r=2*-this.positionScreen.x,n=2*-this.positionScreen.y;for(e=0;e<i;e++)t=this.lensFlares[e],t.x=this.positionScreen.x+r*t.distance,t.y=this.positionScreen.y+n*t.distance,t.wantedRotation=t.x*Math.PI*.25,t.rotation+=.25*(t.wantedRotation-t.rotation)}}),lt.prototype=Object.create(Z.prototype),lt.prototype.constructor=lt,lt.prototype.copy=function(e){return Z.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.rotation=e.rotation,this},ht.prototype=Object.assign(Object.create(ce.prototype),{constructor:ht,isSprite:!0,raycast:function(){var e=new c;return function(t,i){e.setFromMatrixPosition(this.matrixWorld);var r=t.ray.distanceSqToPoint(e),n=this.scale.x*this.scale.y/4;r>n||i.push({distance:Math.sqrt(r),point:this.position,face:null,object:this})}}(),clone:function(){return new this.constructor(this.material).copy(this)}}),dt.prototype=Object.assign(Object.create(ce.prototype),{constructor:dt,copy:function(e){ce.prototype.copy.call(this,e,!1);for(var t=e.levels,i=0,r=t.length;i<r;i++){var n=t[i];this.addLevel(n.object.clone(),n.distance)}return this},addLevel:function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var i=this.levels,r=0;r<i.length&&!(t<i[r].distance);r++);i.splice(r,0,{distance:t,object:e}),this.add(e)},getObjectForDistance:function(e){for(var t=this.levels,i=1,r=t.length;i<r&&!(e<t[i].distance);i++);return t[i-1].object},raycast:function(){var e=new c;return function(t,i){e.setFromMatrixPosition(this.matrixWorld);var r=t.ray.origin.distanceTo(e);this.getObjectForDistance(r).raycast(t,i)}}(),update:function(){var e=new c,t=new c;return function(i){var r=this.levels;if(r.length>1){e.setFromMatrixPosition(i.matrixWorld),t.setFromMatrixPosition(this.matrixWorld);var n=e.distanceTo(t);r[0].object.visible=!0;for(var o=1,a=r.length;o<a&&n>=r[o].distance;o++)r[o-1].object.visible=!1,r[o].object.visible=!0;for(;o<a;o++)r[o].object.visible=!1}}}(),toJSON:function(e){var t=ce.prototype.toJSON.call(this,e);t.object.levels=[];for(var i=this.levels,r=0,n=i.length;r<n;r++){var o=i[r];t.object.levels.push({object:o.object.uuid,distance:o.distance})}return t}}),Object.assign(pt.prototype,{calculateInverses:function(){this.boneInverses=[];for(var e=0,t=this.bones.length;e<t;e++){var i=new u;this.bones[e]&&i.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(i)}},pose:function(){for(var e,t=0,i=this.bones.length;t<i;t++)e=this.bones[t],e&&e.matrixWorld.getInverse(this.boneInverses[t]);for(var t=0,i=this.bones.length;t<i;t++)e=this.bones[t],e&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},update:function(){var e=new u;return function(){for(var t=0,i=this.bones.length;t<i;t++){var r=this.bones[t]?this.bones[t].matrixWorld:this.identityMatrix;e.multiplyMatrices(r,this.boneInverses[t]),e.toArray(this.boneMatrices,16*t)}this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)}}(),clone:function(){return new pt(this.bones,this.boneInverses,this.useVertexTexture)}}),ft.prototype=Object.assign(Object.create(ce.prototype),{constructor:ft,isBone:!0}),mt.prototype=Object.assign(Object.create(Ne.prototype),{constructor:mt,isSkinnedMesh:!0,bind:function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){if(this.geometry&&this.geometry.isGeometry)for(var e=0;e<this.geometry.skinWeights.length;e++){var t=this.geometry.skinWeights[e],i=1/t.lengthManhattan();i!==1/0?t.multiplyScalar(i):t.set(1,0,0,0)}else if(this.geometry&&this.geometry.isBufferGeometry)for(var r=new n,o=this.geometry.attributes.skinWeight,e=0;e<o.count;e++){r.x=o.getX(e),r.y=o.getY(e),r.z=o.getZ(e),r.w=o.getW(e);var i=1/r.lengthManhattan();i!==1/0?r.multiplyScalar(i):r.set(1,0,0,0),o.setXYZW(e,r.x,r.y,r.z,r.w)}},updateMatrixWorld:function(e){Ne.prototype.updateMatrixWorld.call(this,!0),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material,this.skeleton.useVertexTexture).copy(this)}}),gt.prototype=Object.create(Z.prototype),gt.prototype.constructor=gt,gt.prototype.isLineBasicMaterial=!0,gt.prototype.copy=function(e){return Z.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this},vt.prototype=Object.assign(Object.create(ce.prototype),{constructor:vt,isLine:!0,raycast:function(){var e=new u,t=new oe,i=new ee;return function(r,n){var o=r.linePrecision,a=o*o,s=this.geometry,u=this.matrixWorld;if(null===s.boundingSphere&&s.computeBoundingSphere(),i.copy(s.boundingSphere),i.applyMatrix4(u),r.ray.intersectsSphere(i)!==!1){e.getInverse(u),t.copy(r.ray).applyMatrix4(e);var l=new c,h=new c,d=new c,p=new c,f=this&&this.isLineSegments?2:1;if(s.isBufferGeometry){var m=s.index,g=s.attributes,v=g.position.array;if(null!==m)for(var y=m.array,M=0,A=y.length-1;M<A;M+=f){var w=y[M],x=y[M+1];l.fromArray(v,3*w),h.fromArray(v,3*x);var E=t.distanceSqToSegment(l,h,p,d);if(!(E>a)){p.applyMatrix4(this.matrixWorld);var b=r.ray.origin.distanceTo(p);b<r.near||b>r.far||n.push({distance:b,point:d.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}else for(var M=0,A=v.length/3-1;M<A;M+=f){l.fromArray(v,3*M),h.fromArray(v,3*M+3);var E=t.distanceSqToSegment(l,h,p,d);if(!(E>a)){p.applyMatrix4(this.matrixWorld);var b=r.ray.origin.distanceTo(p);b<r.near||b>r.far||n.push({distance:b,point:d.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}else if(s.isGeometry)for(var T=s.vertices,L=T.length,M=0;M<L-1;M+=f){var E=t.distanceSqToSegment(T[M],T[M+1],p,d);if(!(E>a)){p.applyMatrix4(this.matrixWorld);var b=r.ray.origin.distanceTo(p);b<r.near||b>r.far||n.push({distance:b,point:d.clone().applyMatrix4(this.matrixWorld),index:M,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),yt.prototype=Object.assign(Object.create(vt.prototype),{constructor:yt,isLineSegments:!0}),Mt.prototype=Object.create(Z.prototype),Mt.prototype.constructor=Mt,Mt.prototype.isPointsMaterial=!0,Mt.prototype.copy=function(e){return Z.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this},At.prototype=Object.assign(Object.create(ce.prototype),{constructor:At,isPoints:!0,raycast:function(){var e=new u,t=new oe,i=new ee;return function(r,n){function o(e,i){var o=t.distanceSqToPoint(e);if(o<d){var s=t.closestPointToPoint(e);s.applyMatrix4(u);var c=r.ray.origin.distanceTo(s);if(c<r.near||c>r.far)return;n.push({distance:c,distanceToRay:Math.sqrt(o),point:s.clone(),index:i,face:null,object:a})}}var a=this,s=this.geometry,u=this.matrixWorld,l=r.params.Points.threshold;if(null===s.boundingSphere&&s.computeBoundingSphere(),i.copy(s.boundingSphere),i.applyMatrix4(u),r.ray.intersectsSphere(i)!==!1){e.getInverse(u),t.copy(r.ray).applyMatrix4(e);var h=l/((this.scale.x+this.scale.y+this.scale.z)/3),d=h*h,p=new c;if(s.isBufferGeometry){var f=s.index,m=s.attributes,g=m.position.array;if(null!==f)for(var v=f.array,y=0,M=v.length;y<M;y++){var A=v[y];p.fromArray(g,3*A),o(p,A)}else for(var y=0,w=g.length/3;y<w;y++)p.fromArray(g,3*y),o(p,y)}else for(var x=s.vertices,y=0,w=x.length;y<w;y++)o(x[y],y)}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),wt.prototype=Object.assign(Object.create(ce.prototype),{constructor:wt}),xt.prototype=Object.create(r.prototype),xt.prototype.constructor=xt,Et.prototype=Object.create(r.prototype),Et.prototype.constructor=Et,Et.prototype.isCompressedTexture=!0,bt.prototype=Object.create(r.prototype),bt.prototype.constructor=bt,Tt.prototype=Object.create(r.prototype),Tt.prototype.constructor=Tt,Tt.prototype.isDepthTexture=!0,Lt.prototype=Object.create(Le.prototype),Lt.prototype.constructor=Lt,Nt.prototype=Object.create(Le.prototype),Nt.prototype.constructor=Nt,Dt.prototype=Object.create(be.prototype),Dt.prototype.constructor=Dt,St.prototype=Object.create(Le.prototype),St.prototype.constructor=St,It.prototype=Object.create(St.prototype),It.prototype.constructor=It,Ct.prototype=Object.create(be.prototype),Ct.prototype.constructor=Ct,_t.prototype=Object.create(St.prototype),_t.prototype.constructor=_t,jt.prototype=Object.create(be.prototype),jt.prototype.constructor=jt,Ot.prototype=Object.create(St.prototype),Ot.prototype.constructor=Ot,zt.prototype=Object.create(be.prototype),zt.prototype.constructor=zt,Rt.prototype=Object.create(St.prototype),Rt.prototype.constructor=Rt,kt.prototype=Object.create(be.prototype),kt.prototype.constructor=kt,Ut.prototype=Object.create(be.prototype),Ut.prototype.constructor=Ut,Pt.prototype=Object.create(Le.prototype),Pt.prototype.constructor=Pt,Bt.prototype=Object.create(be.prototype),Bt.prototype.constructor=Bt,Ft.prototype=Object.create(Le.prototype),Ft.prototype.constructor=Ft,Gt.prototype=Object.create(be.prototype),Gt.prototype.constructor=Gt,Ht.prototype=Object.create(Le.prototype),Ht.prototype.constructor=Ht,Qt.prototype=Object.create(be.prototype),Qt.prototype.constructor=Qt;var hu={area:function(e){for(var t=e.length,i=0,r=t-1,n=0;n<t;r=n++)i+=e[r].x*e[n].y-e[n].x*e[r].y;return.5*i},triangulate:function(){function e(e,t,i,r,n,o){var a,s,c,u,l,h,d,p,f;if(s=e[o[t]].x,c=e[o[t]].y,u=e[o[i]].x,l=e[o[i]].y,h=e[o[r]].x,d=e[o[r]].y,(u-s)*(d-c)-(l-c)*(h-s)<=0)return!1;var m,g,v,y,M,A,w,x,E,b,T,L,N,D,S;for(m=h-u,g=d-l,v=s-h,y=c-d,M=u-s,A=l-c,a=0;a<n;a++)if(p=e[o[a]].x,f=e[o[a]].y,!(p===s&&f===c||p===u&&f===l||p===h&&f===d)&&(w=p-s,x=f-c,E=p-u,b=f-l,T=p-h,L=f-d,S=m*b-g*E,N=M*x-A*w,D=v*L-y*T,S>=-Number.EPSILON&&D>=-Number.EPSILON&&N>=-Number.EPSILON))return!1;return!0}return function(t,i){var r=t.length;if(r<3)return null;var n,o,a,s=[],c=[],u=[];if(hu.area(t)>0)for(o=0;o<r;o++)c[o]=o;else for(o=0;o<r;o++)c[o]=r-1-o;
  var l=r,h=2*l;for(o=l-1;l>2;){if(h--<=0)return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),i?u:s;if(n=o,l<=n&&(n=0),o=n+1,l<=o&&(o=0),a=o+1,l<=a&&(a=0),e(t,n,o,a,l,c)){var d,p,f,m,g;for(d=c[n],p=c[o],f=c[a],s.push([t[d],t[p],t[f]]),u.push([c[n],c[o],c[a]]),m=o,g=o+1;g<l;m++,g++)c[m]=c[g];l--,h=2*l}}return i?u:s}}(),triangulateShape:function(e,t){function i(e){var t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function r(e,t,i){return e.x!==t.x?e.x<t.x?e.x<=i.x&&i.x<=t.x:t.x<=i.x&&i.x<=e.x:e.y<t.y?e.y<=i.y&&i.y<=t.y:t.y<=i.y&&i.y<=e.y}function n(e,t,i,n,o){var a=t.x-e.x,s=t.y-e.y,c=n.x-i.x,u=n.y-i.y,l=e.x-i.x,h=e.y-i.y,d=s*c-a*u,p=s*l-a*h;if(Math.abs(d)>Number.EPSILON){var f;if(d>0){if(p<0||p>d)return[];if(f=u*l-c*h,f<0||f>d)return[]}else{if(p>0||p<d)return[];if(f=u*l-c*h,f>0||f<d)return[]}if(0===f)return!o||0!==p&&p!==d?[e]:[];if(f===d)return!o||0!==p&&p!==d?[t]:[];if(0===p)return[i];if(p===d)return[n];var m=f/d;return[{x:e.x+m*a,y:e.y+m*s}]}if(0!==p||u*l!==c*h)return[];var g=0===a&&0===s,v=0===c&&0===u;if(g&&v)return e.x!==i.x||e.y!==i.y?[]:[e];if(g)return r(i,n,e)?[e]:[];if(v)return r(e,t,i)?[i]:[];var y,M,A,w,x,E,b,T;return 0!==a?(e.x<t.x?(y=e,A=e.x,M=t,w=t.x):(y=t,A=t.x,M=e,w=e.x),i.x<n.x?(x=i,b=i.x,E=n,T=n.x):(x=n,b=n.x,E=i,T=i.x)):(e.y<t.y?(y=e,A=e.y,M=t,w=t.y):(y=t,A=t.y,M=e,w=e.y),i.y<n.y?(x=i,b=i.y,E=n,T=n.y):(x=n,b=n.y,E=i,T=i.y)),A<=b?w<b?[]:w===b?o?[]:[x]:w<=T?[x,M]:[x,E]:A>T?[]:A===T?o?[]:[y]:w<=T?[y,M]:[y,E]}function o(e,t,i,r){var n=t.x-e.x,o=t.y-e.y,a=i.x-e.x,s=i.y-e.y,c=r.x-e.x,u=r.y-e.y,l=n*s-o*a,h=n*u-o*c;if(Math.abs(l)>Number.EPSILON){var d=c*s-u*a;return l>0?h>=0&&d>=0:h>=0||d>=0}return h>0}function a(e,t){function i(e,t){var i=y.length-1,r=e-1;r<0&&(r=i);var n=e+1;n>i&&(n=0);var a=o(y[e],y[r],y[n],s[t]);if(!a)return!1;var c=s.length-1,u=t-1;u<0&&(u=c);var l=t+1;return l>c&&(l=0),a=o(s[t],s[u],s[l],y[e]),!!a}function r(e,t){var i,r,o;for(i=0;i<y.length;i++)if(r=i+1,r%=y.length,o=n(e,t,y[i],y[r],!0),o.length>0)return!0;return!1}function a(e,i){var r,o,a,s,c;for(r=0;r<M.length;r++)for(o=t[M[r]],a=0;a<o.length;a++)if(s=a+1,s%=o.length,c=n(e,i,o[a],o[s],!0),c.length>0)return!0;return!1}for(var s,c,u,l,h,d,p,f,m,g,v,y=e.concat(),M=[],A=[],w=0,x=t.length;w<x;w++)M.push(w);for(var E=0,b=2*M.length;M.length>0;){if(b--,b<0){console.log("Infinite Loop! Holes left:"+M.length+", Probably Hole outside Shape!");break}for(u=E;u<y.length;u++){l=y[u],c=-1;for(var w=0;w<M.length;w++)if(d=M[w],p=l.x+":"+l.y+":"+d,void 0===A[p]){s=t[d];for(var T=0;T<s.length;T++)if(h=s[T],i(u,T)&&!r(l,h)&&!a(l,h)){c=T,M.splice(w,1),f=y.slice(0,u+1),m=y.slice(u),g=s.slice(c),v=s.slice(0,c+1),y=f.concat(g).concat(v).concat(m),E=u;break}if(c>=0)break;A[p]=!0}if(c>=0)break}}return y}i(e),t.forEach(i);for(var s,c,u,l,h,d,p={},f=e.concat(),m=0,g=t.length;m<g;m++)Array.prototype.push.apply(f,t[m]);for(s=0,c=f.length;s<c;s++)h=f[s].x+":"+f[s].y,void 0!==p[h]&&console.warn("THREE.ShapeUtils: Duplicate point",h,s),p[h]=s;var v=a(e,t),y=hu.triangulate(v,!1);for(s=0,c=y.length;s<c;s++)for(l=y[s],u=0;u<3;u++)h=l[u].x+":"+l[u].y,d=p[h],void 0!==d&&(l[u]=d);return y.concat()},isClockWise:function(e){return hu.area(e)<0},b2:function(){function e(e,t){var i=1-e;return i*i*t}function t(e,t){return 2*(1-e)*e*t}function i(e,t){return e*e*t}return function(r,n,o,a){return e(r,n)+t(r,o)+i(r,a)}}(),b3:function(){function e(e,t){var i=1-e;return i*i*i*t}function t(e,t){var i=1-e;return 3*i*i*e*t}function i(e,t){var i=1-e;return 3*i*e*e*t}function r(e,t){return e*e*e*t}return function(n,o,a,s,c){return e(n,o)+t(n,a)+i(n,s)+r(n,c)}}()};Yt.prototype=Object.create(be.prototype),Yt.prototype.constructor=Yt,Yt.prototype.addShapeList=function(e,t){for(var i=e.length,r=0;r<i;r++){var n=e[r];this.addShape(n,t)}},Yt.prototype.addShape=function(e,t){function r(e,t,i){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(i).add(e)}function n(e,t,r){var n,o,a=1,s=e.x-t.x,c=e.y-t.y,u=r.x-e.x,l=r.y-e.y,h=s*s+c*c,d=s*l-c*u;if(Math.abs(d)>Number.EPSILON){var p=Math.sqrt(h),f=Math.sqrt(u*u+l*l),m=t.x-c/p,g=t.y+s/p,v=r.x-l/f,y=r.y+u/f,M=((v-m)*l-(y-g)*u)/(s*l-c*u);n=m+s*M-e.x,o=g+c*M-e.y;var A=n*n+o*o;if(A<=2)return new i(n,o);a=Math.sqrt(A/2)}else{var w=!1;s>Number.EPSILON?u>Number.EPSILON&&(w=!0):s<-Number.EPSILON?u<-Number.EPSILON&&(w=!0):Math.sign(c)===Math.sign(l)&&(w=!0),w?(n=-c,o=s,a=Math.sqrt(h)):(n=s,o=c,a=Math.sqrt(h/2))}return new i(n/a,o/a)}function o(){if(w){var e=0,t=Q*e;for(W=0;W<Y;W++)H=R[W],l(H[2]+t,H[1]+t,H[0]+t);for(e=E+2*A,t=Q*e,W=0;W<Y;W++)H=R[W],l(H[0]+t,H[1]+t,H[2]+t)}else{for(W=0;W<Y;W++)H=R[W],l(H[2],H[1],H[0]);for(W=0;W<Y;W++)H=R[W],l(H[0]+Q*E,H[1]+Q*E,H[2]+Q*E)}}function a(){var e=0;for(s(k,e),e+=k.length,D=0,S=O.length;D<S;D++)N=O[D],s(N,e),e+=N.length}function s(e,t){var i,r;for(W=e.length;--W>=0;){i=W,r=W-1,r<0&&(r=e.length-1);var n=0,o=E+2*A;for(n=0;n<o;n++){var a=Q*n,s=Q*(n+1),c=t+i+a,u=t+r+a,l=t+r+s,d=t+i+s;h(c,u,l,d,e,n,o,i,r)}}}function u(e,t,i){I.vertices.push(new c(e,t,i))}function l(e,t,i){e+=C,t+=C,i+=C,I.faces.push(new he(e,t,i,null,null,0));var r=L.generateTopUV(I,e,t,i);I.faceVertexUvs[0].push(r)}function h(e,t,i,r,n,o,a,s,c){e+=C,t+=C,i+=C,r+=C,I.faces.push(new he(e,t,r,null,null,1)),I.faces.push(new he(t,i,r,null,null,1));var u=L.generateSideWallUV(I,e,t,i,r);I.faceVertexUvs[0].push([u[0],u[1],u[3]]),I.faceVertexUvs[0].push([u[1],u[2],u[3]])}var d,p,f,m,g,v=void 0!==t.amount?t.amount:100,y=void 0!==t.bevelThickness?t.bevelThickness:6,M=void 0!==t.bevelSize?t.bevelSize:y-2,A=void 0!==t.bevelSegments?t.bevelSegments:3,w=void 0===t.bevelEnabled||t.bevelEnabled,x=void 0!==t.curveSegments?t.curveSegments:12,E=void 0!==t.steps?t.steps:1,b=t.extrudePath,T=!1,L=void 0!==t.UVGenerator?t.UVGenerator:Yt.WorldUVGenerator;b&&(d=b.getSpacedPoints(E),T=!0,w=!1,p=void 0!==t.frames?t.frames:b.computeFrenetFrames(E,!1),f=new c,m=new c,g=new c),w||(A=0,y=0,M=0);var N,D,S,I=this,C=this.vertices.length,_=e.extractPoints(x),j=_.shape,O=_.holes,z=!hu.isClockWise(j);if(z){for(j=j.reverse(),D=0,S=O.length;D<S;D++)N=O[D],hu.isClockWise(N)&&(O[D]=N.reverse());z=!1}var R=hu.triangulateShape(j,O),k=j;for(D=0,S=O.length;D<S;D++)N=O[D],j=j.concat(N);for(var U,P,B,F,G,H,Q=j.length,Y=R.length,V=[],W=0,X=k.length,q=X-1,Z=W+1;W<X;W++,q++,Z++)q===X&&(q=0),Z===X&&(Z=0),V[W]=n(k[W],k[q],k[Z]);var J,K=[],$=V.concat();for(D=0,S=O.length;D<S;D++){for(N=O[D],J=[],W=0,X=N.length,q=X-1,Z=W+1;W<X;W++,q++,Z++)q===X&&(q=0),Z===X&&(Z=0),J[W]=n(N[W],N[q],N[Z]);K.push(J),$=$.concat(J)}for(U=0;U<A;U++){for(B=U/A,F=y*Math.cos(B*Math.PI/2),P=M*Math.sin(B*Math.PI/2),W=0,X=k.length;W<X;W++)G=r(k[W],V[W],P),u(G.x,G.y,-F);for(D=0,S=O.length;D<S;D++)for(N=O[D],J=K[D],W=0,X=N.length;W<X;W++)G=r(N[W],J[W],P),u(G.x,G.y,-F)}for(P=M,W=0;W<Q;W++)G=w?r(j[W],$[W],P):j[W],T?(m.copy(p.normals[0]).multiplyScalar(G.x),f.copy(p.binormals[0]).multiplyScalar(G.y),g.copy(d[0]).add(m).add(f),u(g.x,g.y,g.z)):u(G.x,G.y,0);var ee;for(ee=1;ee<=E;ee++)for(W=0;W<Q;W++)G=w?r(j[W],$[W],P):j[W],T?(m.copy(p.normals[ee]).multiplyScalar(G.x),f.copy(p.binormals[ee]).multiplyScalar(G.y),g.copy(d[ee]).add(m).add(f),u(g.x,g.y,g.z)):u(G.x,G.y,v/E*ee);for(U=A-1;U>=0;U--){for(B=U/A,F=y*Math.cos(B*Math.PI/2),P=M*Math.sin(B*Math.PI/2),W=0,X=k.length;W<X;W++)G=r(k[W],V[W],P),u(G.x,G.y,v+F);for(D=0,S=O.length;D<S;D++)for(N=O[D],J=K[D],W=0,X=N.length;W<X;W++)G=r(N[W],J[W],P),T?u(G.x,G.y+d[E-1].y,d[E-1].x+F):u(G.x,G.y,v+F)}o(),a()},Yt.WorldUVGenerator={generateTopUV:function(e,t,r,n){var o=e.vertices,a=o[t],s=o[r],c=o[n];return[new i(a.x,a.y),new i(s.x,s.y),new i(c.x,c.y)]},generateSideWallUV:function(e,t,r,n,o){var a=e.vertices,s=a[t],c=a[r],u=a[n],l=a[o];return Math.abs(s.y-c.y)<.01?[new i(s.x,1-s.z),new i(c.x,1-c.z),new i(u.x,1-u.z),new i(l.x,1-l.z)]:[new i(s.y,1-s.z),new i(c.y,1-c.z),new i(u.y,1-u.z),new i(l.y,1-l.z)]}},Vt.prototype=Object.create(Yt.prototype),Vt.prototype.constructor=Vt,Wt.prototype=Object.create(Le.prototype),Wt.prototype.constructor=Wt,Xt.prototype=Object.create(be.prototype),Xt.prototype.constructor=Xt,qt.prototype=Object.create(Le.prototype),qt.prototype.constructor=qt,Zt.prototype=Object.create(be.prototype),Zt.prototype.constructor=Zt,Jt.prototype=Object.create(be.prototype),Jt.prototype.constructor=Jt,Kt.prototype=Object.create(Le.prototype),Kt.prototype.constructor=Kt,$t.prototype=Object.create(be.prototype),$t.prototype.constructor=$t,ei.prototype=Object.create(Le.prototype),ei.prototype.constructor=ei,ti.prototype=Object.create(be.prototype),ti.prototype.constructor=ti,ii.prototype=Object.create(Le.prototype),ii.prototype.constructor=ii,ri.prototype=Object.create(Le.prototype),ri.prototype.constructor=ri,ni.prototype=Object.create(be.prototype),ni.prototype.constructor=ni,oi.prototype=Object.create(ni.prototype),oi.prototype.constructor=oi,ai.prototype=Object.create(ri.prototype),ai.prototype.constructor=ai,si.prototype=Object.create(Le.prototype),si.prototype.constructor=si,ci.prototype=Object.create(be.prototype),ci.prototype.constructor=ci,ui.prototype=Object.create(be.prototype),ui.prototype.constructor=ui;var du=Object.freeze({WireframeGeometry:Lt,ParametricGeometry:Dt,ParametricBufferGeometry:Nt,TetrahedronGeometry:Ct,TetrahedronBufferGeometry:It,OctahedronGeometry:jt,OctahedronBufferGeometry:_t,IcosahedronGeometry:zt,IcosahedronBufferGeometry:Ot,DodecahedronGeometry:kt,DodecahedronBufferGeometry:Rt,PolyhedronGeometry:Ut,PolyhedronBufferGeometry:St,TubeGeometry:Bt,TubeBufferGeometry:Pt,TorusKnotGeometry:Gt,TorusKnotBufferGeometry:Ft,TorusGeometry:Qt,TorusBufferGeometry:Ht,TextGeometry:Vt,SphereBufferGeometry:Wt,SphereGeometry:Xt,RingGeometry:Zt,RingBufferGeometry:qt,PlaneBufferGeometry:Se,PlaneGeometry:Jt,LatheGeometry:$t,LatheBufferGeometry:Kt,ShapeGeometry:ti,ShapeBufferGeometry:ei,ExtrudeGeometry:Yt,EdgesGeometry:ii,ConeGeometry:oi,ConeBufferGeometry:ai,CylinderGeometry:ni,CylinderBufferGeometry:ri,CircleBufferGeometry:si,CircleGeometry:ci,BoxBufferGeometry:De,BoxGeometry:ui});li.prototype=Object.create(J.prototype),li.prototype.constructor=li,li.prototype.isShadowMaterial=!0,hi.prototype=Object.create(J.prototype),hi.prototype.constructor=hi,hi.prototype.isRawShaderMaterial=!0,di.prototype={constructor:di,isMultiMaterial:!0,toJSON:function(e){for(var t={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},i=this.materials,r=0,n=i.length;r<n;r++){var o=i[r].toJSON(e);delete o.metadata,t.materials.push(o)}return t.visible=this.visible,t},clone:function(){for(var e=new this.constructor,t=0;t<this.materials.length;t++)e.materials.push(this.materials[t].clone());return e.visible=this.visible,e}},pi.prototype=Object.create(Z.prototype),pi.prototype.constructor=pi,pi.prototype.isMeshStandardMaterial=!0,pi.prototype.copy=function(e){return Z.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},fi.prototype=Object.create(pi.prototype),fi.prototype.constructor=fi,fi.prototype.isMeshPhysicalMaterial=!0,fi.prototype.copy=function(e){return pi.prototype.copy.call(this,e),this.defines={PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearCoat=e.clearCoat,this.clearCoatRoughness=e.clearCoatRoughness,this},mi.prototype=Object.create(Z.prototype),mi.prototype.constructor=mi,mi.prototype.isMeshPhongMaterial=!0,mi.prototype.copy=function(e){return Z.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},gi.prototype=Object.create(mi.prototype),gi.prototype.constructor=gi,gi.prototype.isMeshToonMaterial=!0,gi.prototype.copy=function(e){return mi.prototype.copy.call(this,e),this.gradientMap=e.gradientMap,this},vi.prototype=Object.create(Z.prototype),vi.prototype.constructor=vi,vi.prototype.isMeshNormalMaterial=!0,vi.prototype.copy=function(e){return Z.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},yi.prototype=Object.create(Z.prototype),yi.prototype.constructor=yi,yi.prototype.isMeshLambertMaterial=!0,yi.prototype.copy=function(e){return Z.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Mi.prototype=Object.create(Z.prototype),Mi.prototype.constructor=Mi,Mi.prototype.isLineDashedMaterial=!0,Mi.prototype.copy=function(e){return Z.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var pu=Object.freeze({ShadowMaterial:li,SpriteMaterial:lt,RawShaderMaterial:hi,ShaderMaterial:J,PointsMaterial:Mt,MultiMaterial:di,MeshPhysicalMaterial:fi,MeshStandardMaterial:pi,MeshPhongMaterial:mi,MeshToonMaterial:gi,MeshNormalMaterial:vi,MeshLambertMaterial:yi,MeshDepthMaterial:K,MeshBasicMaterial:de,LineDashedMaterial:Mi,LineBasicMaterial:gt,Material:Z}),fu={enabled:!1,files:{},add:function(e,t){this.enabled!==!1&&(this.files[e]=t)},get:function(e){if(this.enabled!==!1)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},mu=new Ai;Object.assign(wi.prototype,{load:function(e,t,i,r){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e);var n=this,o=fu.get(e);if(void 0!==o)return n.manager.itemStart(e),setTimeout(function(){t&&t(o),n.manager.itemEnd(e)},0),o;var a=/^data:(.*?)(;base64)?,(.*)$/,s=e.match(a);if(s){var c=s[1],u=!!s[2],l=s[3];l=window.decodeURIComponent(l),u&&(l=window.atob(l));try{var h,d=(this.responseType||"").toLowerCase();switch(d){case"arraybuffer":case"blob":h=new ArrayBuffer(l.length);for(var p=new Uint8Array(h),f=0;f<l.length;f++)p[f]=l.charCodeAt(f);"blob"===d&&(h=new Blob([h],{type:c}));break;case"document":var m=new DOMParser;h=m.parseFromString(l,c);break;case"json":h=JSON.parse(l);break;default:h=l}window.setTimeout(function(){t&&t(h),n.manager.itemEnd(e)},0)}catch(t){window.setTimeout(function(){r&&r(t),n.manager.itemError(e)},0)}}else{var g=new XMLHttpRequest;g.open("GET",e,!0),g.addEventListener("load",function(i){var o=i.target.response;fu.add(e,o),200===this.status?(t&&t(o),n.manager.itemEnd(e)):0===this.status?(console.warn("THREE.FileLoader: HTTP Status 0 received."),t&&t(o),n.manager.itemEnd(e)):(r&&r(i),n.manager.itemError(e))},!1),void 0!==i&&g.addEventListener("progress",function(e){i(e)},!1),g.addEventListener("error",function(t){r&&r(t),n.manager.itemError(e)},!1),void 0!==this.responseType&&(g.responseType=this.responseType),void 0!==this.withCredentials&&(g.withCredentials=this.withCredentials),g.overrideMimeType&&g.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),g.send(null)}return n.manager.itemStart(e),g},setPath:function(e){return this.path=e,this},setResponseType:function(e){return this.responseType=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setMimeType:function(e){return this.mimeType=e,this}}),Object.assign(xi.prototype,{load:function(e,t,i,r){function n(n){c.load(e[n],function(e){var i=o._parser(e,!0);a[n]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},u+=1,6===u&&(1===i.mipmapCount&&(s.minFilter=Zo),s.format=i.format,s.needsUpdate=!0,t&&t(s))},i,r)}var o=this,a=[],s=new Et;s.image=a;var c=new wi(this.manager);if(c.setPath(this.path),c.setResponseType("arraybuffer"),Array.isArray(e))for(var u=0,l=0,h=e.length;l<h;++l)n(l);else c.load(e,function(e){var i=o._parser(e,!0);if(i.isCubemap)for(var r=i.mipmaps.length/i.mipmapCount,n=0;n<r;n++){a[n]={mipmaps:[]};for(var c=0;c<i.mipmapCount;c++)a[n].mipmaps.push(i.mipmaps[n*i.mipmapCount+c]),a[n].format=i.format,a[n].width=i.width,a[n].height=i.height}else s.image.width=i.width,s.image.height=i.height,s.mipmaps=i.mipmaps;1===i.mipmapCount&&(s.minFilter=Zo),s.format=i.format,s.needsUpdate=!0,t&&t(s)},i,r);return s},setPath:function(e){return this.path=e,this}});var gu=Ei;Object.assign(Ei.prototype,{load:function(e,t,i,r){var n=this,o=new V,a=new wi(this.manager);return a.setResponseType("arraybuffer"),a.load(e,function(e){var i=n._parser(e);i&&(void 0!==i.image?o.image=i.image:void 0!==i.data&&(o.image.width=i.width,o.image.height=i.height,o.image.data=i.data),o.wrapS=void 0!==i.wrapS?i.wrapS:Qo,o.wrapT=void 0!==i.wrapT?i.wrapT:Qo,o.magFilter=void 0!==i.magFilter?i.magFilter:Zo,o.minFilter=void 0!==i.minFilter?i.minFilter:Ko,o.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.format&&(o.format=i.format),void 0!==i.type&&(o.type=i.type),void 0!==i.mipmaps&&(o.mipmaps=i.mipmaps),1===i.mipmapCount&&(o.minFilter=Zo),o.needsUpdate=!0,t&&t(o,i))},i,r),o}}),Object.assign(bi.prototype,{load:function(e,t,i,r){var n=this,o=document.createElementNS("http://www.w3.org/1999/xhtml","img");if(o.onload=function(){o.onload=null,URL.revokeObjectURL(o.src),t&&t(o),n.manager.itemEnd(e)},o.onerror=r,0===e.indexOf("data:"))o.src=e;else if(void 0!==this.crossOrigin)o.crossOrigin=this.crossOrigin,o.src=e;else{var a=new wi;a.setPath(this.path),a.setResponseType("blob"),a.setWithCredentials(this.withCredentials),a.load(e,function(e){o.src=URL.createObjectURL(e)},i,r)}return n.manager.itemStart(e),o},setCrossOrigin:function(e){return this.crossOrigin=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(Ti.prototype,{load:function(e,t,i,r){function n(i){a.load(e[i],function(e){o.images[i]=e,s++,6===s&&(o.needsUpdate=!0,t&&t(o))},void 0,r)}var o=new l,a=new bi(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);for(var s=0,c=0;c<e.length;++c)n(c);return o},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(Li.prototype,{load:function(e,t,i,n){var o=new r,a=new bi(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setWithCredentials(this.withCredentials),a.setPath(this.path),a.load(e,function(i){var r=e.search(/\.(jpg|jpeg)$/)>0||0===e.search(/^data\:image\/jpeg/);o.format=r?pa:fa,o.image=i,o.needsUpdate=!0,void 0!==t&&t(o)},i,n),o},setCrossOrigin:function(e){return this.crossOrigin=e,this},setWithCredentials:function(e){return this.withCredentials=e,this},setPath:function(e){return this.path=e,this}}),Ni.prototype=Object.assign(Object.create(ce.prototype),{constructor:Ni,isLight:!0,copy:function(e){return ce.prototype.copy.call(this,e),this.color.copy(e.color),this.intensity=e.intensity,this},toJSON:function(e){var t=ce.prototype.toJSON.call(this,e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),Di.prototype=Object.assign(Object.create(Ni.prototype),{constructor:Di,isHemisphereLight:!0,copy:function(e){return Ni.prototype.copy.call(this,e),this.groundColor.copy(e.groundColor),this}}),Object.assign(Si.prototype,{copy:function(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var e={};return 0!==this.bias&&(e.bias=this.bias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}),Ii.prototype=Object.assign(Object.create(Si.prototype),{constructor:Ii,isSpotLightShadow:!0,update:function(e){var t=2*Ja.RAD2DEG*e.angle,i=this.mapSize.width/this.mapSize.height,r=e.distance||500,n=this.camera;t===n.fov&&i===n.aspect&&r===n.far||(n.fov=t,n.aspect=i,n.far=r,n.updateProjectionMatrix())}}),Ci.prototype=Object.assign(Object.create(Ni.prototype),{constructor:Ci,isSpotLight:!0,copy:function(e){return Ni.prototype.copy.call(this,e),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),_i.prototype=Object.assign(Object.create(Ni.prototype),{constructor:_i,isPointLight:!0,copy:function(e){return Ni.prototype.copy.call(this,e),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}),ji.prototype=Object.assign(Object.create(Si.prototype),{constructor:ji}),Oi.prototype=Object.assign(Object.create(Ni.prototype),{constructor:Oi,isDirectionalLight:!0,copy:function(e){return Ni.prototype.copy.call(this,e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}),zi.prototype=Object.assign(Object.create(Ni.prototype),{constructor:zi,isAmbientLight:!0});var vu={arraySlice:function(e,t,i){return vu.isTypedArray(e)?new e.constructor(e.subarray(t,i)):e.slice(t,i)},convertArray:function(e,t,i){return!e||!i&&e.constructor===t?e:"number"==typeof t.BYTES_PER_ELEMENT?new t(e):Array.prototype.slice.call(e)},isTypedArray:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},getKeyframeOrder:function(e){function t(t,i){return e[t]-e[i]}for(var i=e.length,r=new Array(i),n=0;n!==i;++n)r[n]=n;return r.sort(t),r},sortedArray:function(e,t,i){for(var r=e.length,n=new e.constructor(r),o=0,a=0;a!==r;++o)for(var s=i[o]*t,c=0;c!==t;++c)n[a++]=e[s+c];return n},flattenJSON:function(e,t,i,r){for(var n=1,o=e[0];void 0!==o&&void 0===o[r];)o=e[n++];if(void 0!==o){var a=o[r];if(void 0!==a)if(Array.isArray(a)){do a=o[r],void 0!==a&&(t.push(o.time),i.push.apply(i,a)),o=e[n++];while(void 0!==o)}else if(void 0!==a.toArray){do a=o[r],void 0!==a&&(t.push(o.time),a.toArray(i,i.length)),o=e[n++];while(void 0!==o)}else do a=o[r],void 0!==a&&(t.push(o.time),i.push(a)),o=e[n++];while(void 0!==o)}}};Ri.prototype={constructor:Ri,evaluate:function(e){var t=this.parameterPositions,i=this._cachedIndex,r=t[i],n=t[i-1];e:{t:{var o;i:{r:if(!(e<r)){for(var a=i+2;;){if(void 0===r){if(e<n)break r;return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,e,n)}if(i===a)break;if(n=r,r=t[++i],e<r)break t}o=t.length;break i}{if(e>=n)break e;var s=t[1];e<s&&(i=2,n=s);for(var a=i-2;;){if(void 0===n)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(i===a)break;if(r=n,n=t[--i-1],e>=n)break t}o=i,i=0}}for(;i<o;){var c=i+o>>>1;e<t[c]?o=c:i=c+1}if(r=t[i],n=t[i-1],void 0===n)return this._cachedIndex=0,this.beforeStart_(0,e,r);if(void 0===r)return i=t.length,this._cachedIndex=i,this.afterEnd_(i-1,n,e)}this._cachedIndex=i,this.intervalChanged_(i,n,r)}return this.interpolate_(i,n,e,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(e){for(var t=this.resultBuffer,i=this.sampleValues,r=this.valueSize,n=e*r,o=0;o!==r;++o)t[o]=i[n+o];return t},interpolate_:function(e,t,i,r){throw new Error("call to abstract method")},intervalChanged_:function(e,t,i){}},Object.assign(Ri.prototype,{beforeStart_:Ri.prototype.copySampleValue_,afterEnd_:Ri.prototype.copySampleValue_}),ki.prototype=Object.assign(Object.create(Ri.prototype),{constructor:ki,DefaultSettings_:{endingStart:za,endingEnd:za},intervalChanged_:function(e,t,i){var r=this.parameterPositions,n=e-2,o=e+1,a=r[n],s=r[o];if(void 0===a)switch(this.getSettings_().endingStart){case Ra:n=e,a=2*t-i;break;case ka:n=r.length-2,a=t+r[n]-r[n+1];break;default:n=e,a=i}if(void 0===s)switch(this.getSettings_().endingEnd){case Ra:o=e,s=2*i-t;break;case ka:o=1,s=i+r[1]-r[0];break;default:o=e-1,s=t}var c=.5*(i-t),u=this.valueSize;this._weightPrev=c/(t-a),this._weightNext=c/(s-i),this._offsetPrev=n*u,this._offsetNext=o*u},interpolate_:function(e,t,i,r){for(var n=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=e*a,c=s-a,u=this._offsetPrev,l=this._offsetNext,h=this._weightPrev,d=this._weightNext,p=(i-t)/(r-t),f=p*p,m=f*p,g=-h*m+2*h*f-h*p,v=(1+h)*m+(-1.5-2*h)*f+(-.5+h)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,M=d*m-d*f,A=0;A!==a;++A)n[A]=g*o[u+A]+v*o[c+A]+y*o[s+A]+M*o[l+A];return n}}),Ui.prototype=Object.assign(Object.create(Ri.prototype),{constructor:Ui,interpolate_:function(e,t,i,r){for(var n=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=e*a,c=s-a,u=(i-t)/(r-t),l=1-u,h=0;h!==a;++h)n[h]=o[c+h]*l+o[s+h]*u;return n}}),Pi.prototype=Object.assign(Object.create(Ri.prototype),{constructor:Pi,interpolate_:function(e,t,i,r){return this.copySampleValue_(e-1)}});var yu;yu={TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:ja,InterpolantFactoryMethodDiscrete:function(e){return new Pi(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodLinear:function(e){return new Ui(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:function(e){return new ki(this.times,this.values,this.getValueSize(),e)},setInterpolation:function(e){var t;switch(e){case _a:t=this.InterpolantFactoryMethodDiscrete;break;case ja:t=this.InterpolantFactoryMethodLinear;break;case Oa:t=this.InterpolantFactoryMethodSmooth}if(void 0===t){var i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(e===this.DefaultInterpolation)throw new Error(i);this.setInterpolation(this.DefaultInterpolation)}return void console.warn(i)}this.createInterpolant=t},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return _a;case this.InterpolantFactoryMethodLinear:return ja;case this.InterpolantFactoryMethodSmooth:return Oa}},getValueSize:function(){return this.values.length/this.times.length},shift:function(e){if(0!==e)for(var t=this.times,i=0,r=t.length;i!==r;++i)t[i]+=e;return this},scale:function(e){if(1!==e)for(var t=this.times,i=0,r=t.length;i!==r;++i)t[i]*=e;return this},trim:function(e,t){for(var i=this.times,r=i.length,n=0,o=r-1;n!==r&&i[n]<e;)++n;for(;o!==-1&&i[o]>t;)--o;if(++o,0!==n||o!==r){n>=o&&(o=Math.max(o,1),n=o-1);var a=this.getValueSize();this.times=vu.arraySlice(i,n,o),this.values=vu.arraySlice(this.values,n*a,o*a)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("invalid value size in track",this),e=!1);var i=this.times,r=this.values,n=i.length;0===n&&(console.error("track is empty",this),e=!1);for(var o=null,a=0;a!==n;a++){var s=i[a];if("number"==typeof s&&isNaN(s)){console.error("time is not a valid number",this,a,s),e=!1;break}if(null!==o&&o>s){console.error("out of order keys",this,a,s,o),e=!1;break}o=s}if(void 0!==r&&vu.isTypedArray(r))for(var a=0,c=r.length;a!==c;++a){var u=r[a];if(isNaN(u)){console.error("value is not a valid number",this,a,u),e=!1;break}}return e},optimize:function(){for(var e=this.times,t=this.values,i=this.getValueSize(),r=this.getInterpolation()===Oa,n=1,o=e.length-1,a=1;a<o;++a){var s=!1,c=e[a],u=e[a+1];if(c!==u&&(1!==a||c!==c[0]))if(r)s=!0;else for(var l=a*i,h=l-i,d=l+i,p=0;p!==i;++p){var f=t[l+p];if(f!==t[h+p]||f!==t[d+p]){s=!0;break}}if(s){if(a!==n){e[n]=e[a];for(var m=a*i,g=n*i,p=0;p!==i;++p)t[g+p]=t[m+p]}++n}}if(o>0){e[n]=e[o];for(var m=o*i,g=n*i,p=0;p!==i;++p)t[g+p]=t[m+p];++n}return n!==e.length&&(this.times=vu.arraySlice(e,0,n),this.values=vu.arraySlice(t,0,n*i)),this}},Fi.prototype=Object.assign(Object.create(yu),{constructor:Fi,ValueTypeName:"vector"}),Gi.prototype=Object.assign(Object.create(Ri.prototype),{constructor:Gi,interpolate_:function(e,t,i,r){for(var n=this.resultBuffer,o=this.sampleValues,a=this.valueSize,c=e*a,u=(i-t)/(r-t),l=c+a;c!==l;c+=4)s.slerpFlat(n,0,o,c-a,o,c,u);return n}}),Hi.prototype=Object.assign(Object.create(yu),{constructor:Hi,ValueTypeName:"quaternion",DefaultInterpolation:ja,InterpolantFactoryMethodLinear:function(e){return new Gi(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),Qi.prototype=Object.assign(Object.create(yu),{constructor:Qi,ValueTypeName:"number"}),Yi.prototype=Object.assign(Object.create(yu),{constructor:Yi,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:_a,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Vi.prototype=Object.assign(Object.create(yu),{constructor:Vi,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:_a,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Wi.prototype=Object.assign(Object.create(yu),{constructor:Wi,ValueTypeName:"color"}),Xi.prototype=yu,yu.constructor=Xi,Object.assign(Xi,{parse:function(e){if(void 0===e.type)throw new Error("track type undefined, can not parse");var t=Xi._getTrackTypeForValueTypeName(e.type);if(void 0===e.times){var i=[],r=[];vu.flattenJSON(e.keys,i,r,"value"),e.times=i,e.values=r}return void 0!==t.parse?t.parse(e):new t(e.name,e.times,e.values,e.interpolation)},toJSON:function(e){var t,i=e.constructor;if(void 0!==i.toJSON)t=i.toJSON(e);else{t={name:e.name,times:vu.convertArray(e.times,Array),values:vu.convertArray(e.values,Array)};var r=e.getInterpolation();r!==e.DefaultInterpolation&&(t.interpolation=r)}return t.type=e.ValueTypeName,t},_getTrackTypeForValueTypeName:function(e){switch(e.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Qi;case"vector":case"vector2":case"vector3":case"vector4":return Fi;case"color":return Wi;case"quaternion":return Hi;
  case"bool":case"boolean":return Vi;case"string":return Yi}throw new Error("Unsupported typeName: "+e)}}),qi.prototype={constructor:qi,resetDuration:function(){for(var e=this.tracks,t=0,i=0,r=e.length;i!==r;++i){var n=this.tracks[i];t=Math.max(t,n.times[n.times.length-1])}this.duration=t},trim:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this},optimize:function(){for(var e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}},Object.assign(qi,{parse:function(e){for(var t=[],i=e.tracks,r=1/(e.fps||1),n=0,o=i.length;n!==o;++n)t.push(Xi.parse(i[n]).scale(r));return new qi(e.name,e.duration,t)},toJSON:function(e){for(var t=[],i=e.tracks,r={name:e.name,duration:e.duration,tracks:t},n=0,o=i.length;n!==o;++n)t.push(Xi.toJSON(i[n]));return r},CreateFromMorphTargetSequence:function(e,t,i,r){for(var n=t.length,o=[],a=0;a<n;a++){var s=[],c=[];s.push((a+n-1)%n,a,(a+1)%n),c.push(0,1,0);var u=vu.getKeyframeOrder(s);s=vu.sortedArray(s,1,u),c=vu.sortedArray(c,1,u),r||0!==s[0]||(s.push(n),c.push(c[0])),o.push(new Qi(".morphTargetInfluences["+t[a].name+"]",s,c).scale(1/i))}return new qi(e,-1,o)},findByName:function(e,t){var i=e;if(!Array.isArray(e)){var r=e;i=r.geometry&&r.geometry.animations||r.animations}for(var n=0;n<i.length;n++)if(i[n].name===t)return i[n];return null},CreateClipsFromMorphTargetSequences:function(e,t,i){for(var r={},n=/^([\w-]*?)([\d]+)$/,o=0,a=e.length;o<a;o++){var s=e[o],c=s.name.match(n);if(c&&c.length>1){var u=c[1],l=r[u];l||(r[u]=l=[]),l.push(s)}}var h=[];for(var u in r)h.push(qi.CreateFromMorphTargetSequence(u,r[u],t,i));return h},parseAnimation:function(e,t){if(!e)return console.error("  no animation in JSONLoader data"),null;for(var i=function(e,t,i,r,n){if(0!==i.length){var o=[],a=[];vu.flattenJSON(i,o,a,r),0!==o.length&&n.push(new e(t,o,a))}},r=[],n=e.name||"default",o=e.length||-1,a=e.fps||30,s=e.hierarchy||[],c=0;c<s.length;c++){var u=s[c].keys;if(u&&0!==u.length)if(u[0].morphTargets){for(var l={},h=0;h<u.length;h++)if(u[h].morphTargets)for(var d=0;d<u[h].morphTargets.length;d++)l[u[h].morphTargets[d]]=-1;for(var p in l){for(var f=[],m=[],d=0;d!==u[h].morphTargets.length;++d){var g=u[h];f.push(g.time),m.push(g.morphTarget===p?1:0)}r.push(new Qi(".morphTargetInfluence["+p+"]",f,m))}o=l.length*(a||1)}else{var v=".bones["+t[c].name+"]";i(Fi,v+".position",u,"pos",r),i(Hi,v+".quaternion",u,"rot",r),i(Fi,v+".scale",u,"scl",r)}}if(0===r.length)return null;var y=new qi(n,o,r);return y}}),Object.assign(Zi.prototype,{load:function(e,t,i,r){var n=this,o=new wi(n.manager);o.load(e,function(e){t(n.parse(JSON.parse(e)))},i,r)},setTextures:function(e){this.textures=e},parse:function(e){function t(e){return void 0===r[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),r[e]}var r=this.textures,n=new pu[e.type];if(void 0!==e.uuid&&(n.uuid=e.uuid),void 0!==e.name&&(n.name=e.name),void 0!==e.color&&n.color.setHex(e.color),void 0!==e.roughness&&(n.roughness=e.roughness),void 0!==e.metalness&&(n.metalness=e.metalness),void 0!==e.emissive&&n.emissive.setHex(e.emissive),void 0!==e.specular&&n.specular.setHex(e.specular),void 0!==e.shininess&&(n.shininess=e.shininess),void 0!==e.clearCoat&&(n.clearCoat=e.clearCoat),void 0!==e.clearCoatRoughness&&(n.clearCoatRoughness=e.clearCoatRoughness),void 0!==e.uniforms&&(n.uniforms=e.uniforms),void 0!==e.vertexShader&&(n.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(n.fragmentShader=e.fragmentShader),void 0!==e.vertexColors&&(n.vertexColors=e.vertexColors),void 0!==e.fog&&(n.fog=e.fog),void 0!==e.shading&&(n.shading=e.shading),void 0!==e.blending&&(n.blending=e.blending),void 0!==e.side&&(n.side=e.side),void 0!==e.opacity&&(n.opacity=e.opacity),void 0!==e.transparent&&(n.transparent=e.transparent),void 0!==e.alphaTest&&(n.alphaTest=e.alphaTest),void 0!==e.depthTest&&(n.depthTest=e.depthTest),void 0!==e.depthWrite&&(n.depthWrite=e.depthWrite),void 0!==e.colorWrite&&(n.colorWrite=e.colorWrite),void 0!==e.wireframe&&(n.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(n.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.wireframeLinecap&&(n.wireframeLinecap=e.wireframeLinecap),void 0!==e.wireframeLinejoin&&(n.wireframeLinejoin=e.wireframeLinejoin),void 0!==e.skinning&&(n.skinning=e.skinning),void 0!==e.morphTargets&&(n.morphTargets=e.morphTargets),void 0!==e.size&&(n.size=e.size),void 0!==e.sizeAttenuation&&(n.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(n.map=t(e.map)),void 0!==e.alphaMap&&(n.alphaMap=t(e.alphaMap),n.transparent=!0),void 0!==e.bumpMap&&(n.bumpMap=t(e.bumpMap)),void 0!==e.bumpScale&&(n.bumpScale=e.bumpScale),void 0!==e.normalMap&&(n.normalMap=t(e.normalMap)),void 0!==e.normalScale){var o=e.normalScale;Array.isArray(o)===!1&&(o=[o,o]),n.normalScale=(new i).fromArray(o)}if(void 0!==e.displacementMap&&(n.displacementMap=t(e.displacementMap)),void 0!==e.displacementScale&&(n.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(n.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(n.roughnessMap=t(e.roughnessMap)),void 0!==e.metalnessMap&&(n.metalnessMap=t(e.metalnessMap)),void 0!==e.emissiveMap&&(n.emissiveMap=t(e.emissiveMap)),void 0!==e.emissiveIntensity&&(n.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(n.specularMap=t(e.specularMap)),void 0!==e.envMap&&(n.envMap=t(e.envMap)),void 0!==e.reflectivity&&(n.reflectivity=e.reflectivity),void 0!==e.lightMap&&(n.lightMap=t(e.lightMap)),void 0!==e.lightMapIntensity&&(n.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(n.aoMap=t(e.aoMap)),void 0!==e.aoMapIntensity&&(n.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(n.gradientMap=t(e.gradientMap)),void 0!==e.materials)for(var a=0,s=e.materials.length;a<s;a++)n.materials.push(this.parse(e.materials[a]));return n}}),Object.assign(Ji.prototype,{load:function(e,t,i,r){var n=this,o=new wi(n.manager);o.load(e,function(e){t(n.parse(JSON.parse(e)))},i,r)},parse:function(e){var t=new Le,i=e.data.index,r={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};if(void 0!==i){var n=new r[i.type](i.array);t.setIndex(new pe(n,1))}var o=e.data.attributes;for(var a in o){var s=o[a],n=new r[s.type](s.array);t.addAttribute(a,new pe(n,s.itemSize,s.normalized))}var u=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==u)for(var l=0,h=u.length;l!==h;++l){var d=u[l];t.addGroup(d.start,d.count,d.materialIndex)}var p=e.data.boundingSphere;if(void 0!==p){var f=new c;void 0!==p.center&&f.fromArray(p.center),t.boundingSphere=new ee(f,p.radius)}return t}}),Ki.prototype={constructor:Ki,crossOrigin:void 0,extractUrlBase:function(e){var t=e.split("/");return 1===t.length?"./":(t.pop(),t.join("/")+"/")},initMaterials:function(e,t,i){for(var r=[],n=0;n<e.length;++n)r[n]=this.createMaterial(e[n],t,i);return r},createMaterial:function(){var e,t,i;return function(r,n,o){function a(e,i,r,a,c){var u,l=n+e,h=Ki.Handlers.get(l);null!==h?u=h.load(l):(t.setCrossOrigin(o),u=t.load(l)),void 0!==i&&(u.repeat.fromArray(i),1!==i[0]&&(u.wrapS=Ho),1!==i[1]&&(u.wrapT=Ho)),void 0!==r&&u.offset.fromArray(r),void 0!==a&&("repeat"===a[0]&&(u.wrapS=Ho),"mirror"===a[0]&&(u.wrapS=Yo),"repeat"===a[1]&&(u.wrapT=Ho),"mirror"===a[1]&&(u.wrapT=Yo)),void 0!==c&&(u.anisotropy=c);var d=Ja.generateUUID();return s[d]=u,d}void 0===e&&(e=new Y),void 0===t&&(t=new Li),void 0===i&&(i=new Zi);var s={},c={uuid:Ja.generateUUID(),type:"MeshLambertMaterial"};for(var u in r){var l=r[u];switch(u){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":c.name=l;break;case"blending":c.blending=eo[l];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",u,"is no longer supported.");break;case"colorDiffuse":c.color=e.fromArray(l).getHex();break;case"colorSpecular":c.specular=e.fromArray(l).getHex();break;case"colorEmissive":c.emissive=e.fromArray(l).getHex();break;case"specularCoef":c.shininess=l;break;case"shading":"basic"===l.toLowerCase()&&(c.type="MeshBasicMaterial"),"phong"===l.toLowerCase()&&(c.type="MeshPhongMaterial"),"standard"===l.toLowerCase()&&(c.type="MeshStandardMaterial");break;case"mapDiffuse":c.map=a(l,r.mapDiffuseRepeat,r.mapDiffuseOffset,r.mapDiffuseWrap,r.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":c.emissiveMap=a(l,r.mapEmissiveRepeat,r.mapEmissiveOffset,r.mapEmissiveWrap,r.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":c.lightMap=a(l,r.mapLightRepeat,r.mapLightOffset,r.mapLightWrap,r.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":c.aoMap=a(l,r.mapAORepeat,r.mapAOOffset,r.mapAOWrap,r.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":c.bumpMap=a(l,r.mapBumpRepeat,r.mapBumpOffset,r.mapBumpWrap,r.mapBumpAnisotropy);break;case"mapBumpScale":c.bumpScale=l;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":c.normalMap=a(l,r.mapNormalRepeat,r.mapNormalOffset,r.mapNormalWrap,r.mapNormalAnisotropy);break;case"mapNormalFactor":c.normalScale=[l,l];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":c.specularMap=a(l,r.mapSpecularRepeat,r.mapSpecularOffset,r.mapSpecularWrap,r.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":c.metalnessMap=a(l,r.mapMetalnessRepeat,r.mapMetalnessOffset,r.mapMetalnessWrap,r.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":c.roughnessMap=a(l,r.mapRoughnessRepeat,r.mapRoughnessOffset,r.mapRoughnessWrap,r.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":c.alphaMap=a(l,r.mapAlphaRepeat,r.mapAlphaOffset,r.mapAlphaWrap,r.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":c.side=Fn;break;case"doubleSided":c.side=Gn;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),c.opacity=l;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":c[u]=l;break;case"vertexColors":l===!0&&(c.vertexColors=Wn),"face"===l&&(c.vertexColors=Vn);break;default:console.error("THREE.Loader.createMaterial: Unsupported",u,l)}}return"MeshBasicMaterial"===c.type&&delete c.emissive,"MeshPhongMaterial"!==c.type&&delete c.specular,c.opacity<1&&(c.transparent=!0),i.setTextures(s),i.parse(c)}}()},Ki.Handlers={handlers:[],add:function(e,t){this.handlers.push(e,t)},get:function(e){for(var t=this.handlers,i=0,r=t.length;i<r;i+=2){var n=t[i],o=t[i+1];if(n.test(e))return o}return null}},Object.assign($i.prototype,{load:function(e,t,i,r){var n=this,o=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:Ki.prototype.extractUrlBase(e),a=new wi(this.manager);a.setWithCredentials(this.withCredentials),a.load(e,function(i){var r=JSON.parse(i),a=r.metadata;if(void 0!==a){var s=a.type;if(void 0!==s){if("object"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.ObjectLoader instead.");if("scene"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.SceneLoader instead.")}}var c=n.parse(r,o);t(c.geometry,c.materials)},i,r)},setTexturePath:function(e){this.texturePath=e},parse:function(e,t){function r(t){function r(e,t){return e&1<<t}var n,o,a,s,l,h,d,p,f,m,g,v,y,M,A,w,x,E,b,T,L,N,D,S,I,C,_,j=e.faces,O=e.vertices,z=e.normals,R=e.colors,k=0;if(void 0!==e.uvs){for(n=0;n<e.uvs.length;n++)e.uvs[n].length&&k++;for(n=0;n<k;n++)u.faceVertexUvs[n]=[]}for(s=0,l=O.length;s<l;)E=new c,E.x=O[s++]*t,E.y=O[s++]*t,E.z=O[s++]*t,u.vertices.push(E);for(s=0,l=j.length;s<l;)if(m=j[s++],g=r(m,0),v=r(m,1),y=r(m,3),M=r(m,4),A=r(m,5),w=r(m,6),x=r(m,7),g){if(T=new he,T.a=j[s],T.b=j[s+1],T.c=j[s+3],L=new he,L.a=j[s+1],L.b=j[s+2],L.c=j[s+3],s+=4,v&&(f=j[s++],T.materialIndex=f,L.materialIndex=f),a=u.faces.length,y)for(n=0;n<k;n++)for(S=e.uvs[n],u.faceVertexUvs[n][a]=[],u.faceVertexUvs[n][a+1]=[],o=0;o<4;o++)p=j[s++],C=S[2*p],_=S[2*p+1],I=new i(C,_),2!==o&&u.faceVertexUvs[n][a].push(I),0!==o&&u.faceVertexUvs[n][a+1].push(I);if(M&&(d=3*j[s++],T.normal.set(z[d++],z[d++],z[d]),L.normal.copy(T.normal)),A)for(n=0;n<4;n++)d=3*j[s++],D=new c(z[d++],z[d++],z[d]),2!==n&&T.vertexNormals.push(D),0!==n&&L.vertexNormals.push(D);if(w&&(h=j[s++],N=R[h],T.color.setHex(N),L.color.setHex(N)),x)for(n=0;n<4;n++)h=j[s++],N=R[h],2!==n&&T.vertexColors.push(new Y(N)),0!==n&&L.vertexColors.push(new Y(N));u.faces.push(T),u.faces.push(L)}else{if(b=new he,b.a=j[s++],b.b=j[s++],b.c=j[s++],v&&(f=j[s++],b.materialIndex=f),a=u.faces.length,y)for(n=0;n<k;n++)for(S=e.uvs[n],u.faceVertexUvs[n][a]=[],o=0;o<3;o++)p=j[s++],C=S[2*p],_=S[2*p+1],I=new i(C,_),u.faceVertexUvs[n][a].push(I);if(M&&(d=3*j[s++],b.normal.set(z[d++],z[d++],z[d])),A)for(n=0;n<3;n++)d=3*j[s++],D=new c(z[d++],z[d++],z[d]),b.vertexNormals.push(D);if(w&&(h=j[s++],b.color.setHex(R[h])),x)for(n=0;n<3;n++)h=j[s++],b.vertexColors.push(new Y(R[h]));u.faces.push(b)}}function o(){var t=void 0!==e.influencesPerVertex?e.influencesPerVertex:2;if(e.skinWeights)for(var i=0,r=e.skinWeights.length;i<r;i+=t){var o=e.skinWeights[i],a=t>1?e.skinWeights[i+1]:0,s=t>2?e.skinWeights[i+2]:0,c=t>3?e.skinWeights[i+3]:0;u.skinWeights.push(new n(o,a,s,c))}if(e.skinIndices)for(var i=0,r=e.skinIndices.length;i<r;i+=t){var l=e.skinIndices[i],h=t>1?e.skinIndices[i+1]:0,d=t>2?e.skinIndices[i+2]:0,p=t>3?e.skinIndices[i+3]:0;u.skinIndices.push(new n(l,h,d,p))}u.bones=e.bones,u.bones&&u.bones.length>0&&(u.skinWeights.length!==u.skinIndices.length||u.skinIndices.length!==u.vertices.length)&&console.warn("When skinning, number of vertices ("+u.vertices.length+"), skinIndices ("+u.skinIndices.length+"), and skinWeights ("+u.skinWeights.length+") should match.")}function a(t){if(void 0!==e.morphTargets)for(var i=0,r=e.morphTargets.length;i<r;i++){u.morphTargets[i]={},u.morphTargets[i].name=e.morphTargets[i].name,u.morphTargets[i].vertices=[];for(var n=u.morphTargets[i].vertices,o=e.morphTargets[i].vertices,a=0,s=o.length;a<s;a+=3){var l=new c;l.x=o[a]*t,l.y=o[a+1]*t,l.z=o[a+2]*t,n.push(l)}}if(void 0!==e.morphColors&&e.morphColors.length>0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');for(var h=u.faces,d=e.morphColors[0].colors,i=0,r=h.length;i<r;i++)h[i].color.fromArray(d,3*i)}}function s(){var t=[],i=[];void 0!==e.animation&&i.push(e.animation),void 0!==e.animations&&(e.animations.length?i=i.concat(e.animations):i.push(e.animations));for(var r=0;r<i.length;r++){var n=qi.parseAnimation(i[r],u.bones);n&&t.push(n)}if(u.morphTargets){var o=qi.CreateClipsFromMorphTargetSequences(u.morphTargets,10);t=t.concat(o)}t.length>0&&(u.animations=t)}var u=new be,l=void 0!==e.scale?1/e.scale:1;if(r(l),o(),a(l),s(),u.computeFaceNormals(),u.computeBoundingSphere(),void 0===e.materials||0===e.materials.length)return{geometry:u};var h=Ki.prototype.initMaterials(e.materials,t,this.crossOrigin);return{geometry:u,materials:h}}}),Object.assign(er.prototype,{load:function(e,t,i,r){""===this.texturePath&&(this.texturePath=e.substring(0,e.lastIndexOf("/")+1));var n=this,o=new wi(n.manager);o.load(e,function(i){var r=null;try{r=JSON.parse(i)}catch(t){return void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}var o=r.metadata;return void 0===o||void 0===o.type||"geometry"===o.type.toLowerCase()?void console.error("THREE.ObjectLoader: Can't load "+e+". Use THREE.JSONLoader instead."):void n.parse(r,t)},i,r)},setTexturePath:function(e){this.texturePath=e},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){var i=this.parseGeometries(e.geometries),r=this.parseImages(e.images,function(){void 0!==t&&t(a)}),n=this.parseTextures(e.textures,r),o=this.parseMaterials(e.materials,n),a=this.parseObject(e.object,i,o);return e.animations&&(a.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0!==t&&t(a),a},parseGeometries:function(e){var t={};if(void 0!==e)for(var i=new $i,r=new Ji,n=0,o=e.length;n<o;n++){var a,s=e[n];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":a=new du[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":a=new du[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":a=new du[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":a=new du[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":a=new du[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":a=new du[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"IcosahedronGeometry":case"OctahedronGeometry":case"TetrahedronGeometry":a=new du[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":a=new du[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":a=new du[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":a=new du[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"LatheGeometry":case"LatheBufferGeometry":a=new du[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"BufferGeometry":a=r.parse(s);break;case"Geometry":a=i.parse(s.data,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),t[s.uuid]=a}return t},parseMaterials:function(e,t){var i={};if(void 0!==e){var r=new Zi;r.setTextures(t);for(var n=0,o=e.length;n<o;n++){var a=r.parse(e[n]);i[a.uuid]=a}}return i},parseAnimations:function(e){for(var t=[],i=0;i<e.length;i++){var r=qi.parse(e[i]);t.push(r)}return t},parseImages:function(e,t){function i(e){return r.manager.itemStart(e),a.load(e,function(){r.manager.itemEnd(e)},void 0,function(){r.manager.itemError(e)})}var r=this,n={};if(void 0!==e&&e.length>0){var o=new Ai(t),a=new bi(o);a.setCrossOrigin(this.crossOrigin);for(var s=0,c=e.length;s<c;s++){var u=e[s],l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(u.url)?u.url:r.texturePath+u.url;n[u.uuid]=i(l)}}return n},parseTextures:function(e,t){function i(e,t){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),t[e])}var n={};if(void 0!==e)for(var o=0,a=e.length;o<a;o++){var s=e[o];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===t[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image);var c=new r(t[s.image]);c.needsUpdate=!0,c.uuid=s.uuid,void 0!==s.name&&(c.name=s.name),void 0!==s.mapping&&(c.mapping=i(s.mapping,Go)),void 0!==s.offset&&c.offset.fromArray(s.offset),void 0!==s.repeat&&c.repeat.fromArray(s.repeat),void 0!==s.wrap&&(c.wrapS=i(s.wrap[0],Vo),c.wrapT=i(s.wrap[1],Vo)),void 0!==s.minFilter&&(c.minFilter=i(s.minFilter,$o)),void 0!==s.magFilter&&(c.magFilter=i(s.magFilter,$o)),void 0!==s.anisotropy&&(c.anisotropy=s.anisotropy),void 0!==s.flipY&&(c.flipY=s.flipY),n[s.uuid]=c}return n},parseObject:function(){var e=new u;return function(t,i,r){function n(e){return void 0===i[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),i[e]}function o(e){if(void 0!==e)return void 0===r[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),r[e]}var a;switch(t.type){case"Scene":a=new ct,void 0!==t.background&&Number.isInteger(t.background)&&(a.background=new Y(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?a.fog=new st(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(a.fog=new at(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":a=new Ce(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(a.focus=t.focus),void 0!==t.zoom&&(a.zoom=t.zoom),void 0!==t.filmGauge&&(a.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(a.filmOffset=t.filmOffset),void 0!==t.view&&(a.view=Object.assign({},t.view));break;case"OrthographicCamera":a=new _e(t.left,t.right,t.top,t.bottom,t.near,t.far);break;case"AmbientLight":a=new zi(t.color,t.intensity);break;case"DirectionalLight":a=new Oi(t.color,t.intensity);break;case"PointLight":a=new _i(t.color,t.intensity,t.distance,t.decay);break;case"SpotLight":a=new Ci(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":a=new Di(t.color,t.groundColor,t.intensity);break;case"Mesh":var s=n(t.geometry),c=o(t.material);a=s.bones&&s.bones.length>0?new mt(s,c):new Ne(s,c);break;case"LOD":a=new dt;break;case"Line":a=new vt(n(t.geometry),o(t.material),t.mode);break;case"LineSegments":a=new yt(n(t.geometry),o(t.material));break;case"PointCloud":case"Points":a=new At(n(t.geometry),o(t.material));break;case"Sprite":a=new ht(o(t.material));break;case"Group":a=new wt;break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh type. Instantiates Object3D instead.");default:a=new ce}if(a.uuid=t.uuid,void 0!==t.name&&(a.name=t.name),void 0!==t.matrix?(e.fromArray(t.matrix),e.decompose(a.position,a.quaternion,a.scale)):(void 0!==t.position&&a.position.fromArray(t.position),void 0!==t.rotation&&a.rotation.fromArray(t.rotation),void 0!==t.quaternion&&a.quaternion.fromArray(t.quaternion),void 0!==t.scale&&a.scale.fromArray(t.scale)),void 0!==t.castShadow&&(a.castShadow=t.castShadow),void 0!==t.receiveShadow&&(a.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(a.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(a.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&a.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(a.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(a.visible=t.visible),void 0!==t.userData&&(a.userData=t.userData),void 0!==t.children)for(var u in t.children)a.add(this.parseObject(t.children[u],i,r));if("LOD"===t.type)for(var l=t.levels,h=0;h<l.length;h++){var d=l[h],u=a.getObjectByProperty("uuid",d.object);void 0!==u&&a.addLevel(u,d.distance)}return a}}()}),tr.prototype={constructor:tr,getPoint:function(e){return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),null},getPointAt:function(e){var t=this.getUtoTmapping(e);return this.getPoint(t)},getPoints:function(e){e||(e=5);for(var t=[],i=0;i<=e;i++)t.push(this.getPoint(i/e));return t},getSpacedPoints:function(e){e||(e=5);for(var t=[],i=0;i<=e;i++)t.push(this.getPointAt(i/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(e||(e=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,i,r=[],n=this.getPoint(0),o=0;for(r.push(0),i=1;i<=e;i++)t=this.getPoint(i/e),o+=t.distanceTo(n),r.push(o),n=t;return this.cacheArcLengths=r,r},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var i,r=this.getLengths(),n=0,o=r.length;i=t?t:e*r[o-1];for(var a,s=0,c=o-1;s<=c;)if(n=Math.floor(s+(c-s)/2),a=r[n]-i,a<0)s=n+1;else{if(!(a>0)){c=n;break}c=n-1}if(n=c,r[n]===i){var u=n/(o-1);return u}var l=r[n],h=r[n+1],d=h-l,p=(i-l)/d,u=(n+p)/(o-1);return u},getTangent:function(e){var t=1e-4,i=e-t,r=e+t;i<0&&(i=0),r>1&&(r=1);var n=this.getPoint(i),o=this.getPoint(r),a=o.clone().sub(n);return a.normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var i,r,n,o=new c,a=[],s=[],l=[],h=new c,d=new u;for(i=0;i<=e;i++)r=i/e,a[i]=this.getTangentAt(r),a[i].normalize();s[0]=new c,l[0]=new c;var p=Number.MAX_VALUE,f=Math.abs(a[0].x),m=Math.abs(a[0].y),g=Math.abs(a[0].z);for(f<=p&&(p=f,o.set(1,0,0)),m<=p&&(p=m,o.set(0,1,0)),g<=p&&o.set(0,0,1),h.crossVectors(a[0],o).normalize(),s[0].crossVectors(a[0],h),l[0].crossVectors(a[0],s[0]),i=1;i<=e;i++)s[i]=s[i-1].clone(),l[i]=l[i-1].clone(),h.crossVectors(a[i-1],a[i]),h.length()>Number.EPSILON&&(h.normalize(),n=Math.acos(Ja.clamp(a[i-1].dot(a[i]),-1,1)),s[i].applyMatrix4(d.makeRotationAxis(h,n))),l[i].crossVectors(a[i],s[i]);if(t===!0)for(n=Math.acos(Ja.clamp(s[0].dot(s[e]),-1,1)),n/=e,a[0].dot(h.crossVectors(s[0],s[e]))>0&&(n=-n),i=1;i<=e;i++)s[i].applyMatrix4(d.makeRotationAxis(a[i],n*i)),l[i].crossVectors(a[i],s[i]);return{tangents:a,normals:s,binormals:l}}},tr.create=function(e,t){return e.prototype=Object.create(tr.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},ir.prototype=Object.create(tr.prototype),ir.prototype.constructor=ir,ir.prototype.isLineCurve=!0,ir.prototype.getPoint=function(e){if(1===e)return this.v2.clone();var t=this.v2.clone().sub(this.v1);return t.multiplyScalar(e).add(this.v1),t},ir.prototype.getPointAt=function(e){return this.getPoint(e)},ir.prototype.getTangent=function(e){var t=this.v2.clone().sub(this.v1);return t.normalize()},rr.prototype=Object.assign(Object.create(tr.prototype),{constructor:rr,add:function(e){this.curves.push(e)},closePath:function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new ir(t,e))},getPoint:function(e){for(var t=e*this.getLength(),i=this.getCurveLengths(),r=0;r<i.length;){if(i[r]>=t){var n=i[r]-t,o=this.curves[r],a=o.getLength(),s=0===a?0:1-n/a;return o.getPointAt(s)}r++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,i=0,r=this.curves.length;i<r;i++)t+=this.curves[i].getLength(),e.push(t);return this.cacheLengths=e,e},getSpacedPoints:function(e){e||(e=40);for(var t=[],i=0;i<=e;i++)t.push(this.getPoint(i/e));return this.autoClose&&t.push(t[0]),t},getPoints:function(e){e=e||12;for(var t,i=[],r=0,n=this.curves;r<n.length;r++)for(var o=n[r],a=o&&o.isEllipseCurve?2*e:o&&o.isLineCurve?1:o&&o.isSplineCurve?e*o.points.length:e,s=o.getPoints(a),c=0;c<s.length;c++){var u=s[c];t&&t.equals(u)||(i.push(u),t=u)}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},createPointsGeometry:function(e){var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){for(var t=new be,i=0,r=e.length;i<r;i++){var n=e[i];t.vertices.push(new c(n.x,n.y,n.z||0))}return t}}),nr.prototype=Object.create(tr.prototype),nr.prototype.constructor=nr,nr.prototype.isEllipseCurve=!0,nr.prototype.getPoint=function(e){for(var t=2*Math.PI,r=this.aEndAngle-this.aStartAngle,n=Math.abs(r)<Number.EPSILON;r<0;)r+=t;for(;r>t;)r-=t;r<Number.EPSILON&&(r=n?0:t),this.aClockwise!==!0||n||(r===t?r=-t:r-=t);var o=this.aStartAngle+e*r,a=this.aX+this.xRadius*Math.cos(o),s=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){var c=Math.cos(this.aRotation),u=Math.sin(this.aRotation),l=a-this.aX,h=s-this.aY;a=l*c-h*u+this.aX,s=l*u+h*c+this.aY}return new i(a,s)};var Mu={tangentQuadraticBezier:function(e,t,i,r){return 2*(1-e)*(i-t)+2*e*(r-i)},tangentCubicBezier:function(e,t,i,r,n){return-3*t*(1-e)*(1-e)+3*i*(1-e)*(1-e)-6*e*i*(1-e)+6*e*r*(1-e)-3*e*e*r+3*e*e*n},tangentSpline:function(e,t,i,r,n){var o=6*e*e-6*e,a=3*e*e-4*e+1,s=-6*e*e+6*e,c=3*e*e-2*e;return o+a+s+c},interpolate:function(e,t,i,r,n){var o=.5*(i-e),a=.5*(r-t),s=n*n,c=n*s;return(2*t-2*i+o+a)*c+(-3*t+3*i-2*o-a)*s+o*n+t}};or.prototype=Object.create(tr.prototype),or.prototype.constructor=or,or.prototype.isSplineCurve=!0,or.prototype.getPoint=function(e){var t=this.points,r=(t.length-1)*e,n=Math.floor(r),o=r-n,a=t[0===n?n:n-1],s=t[n],c=t[n>t.length-2?t.length-1:n+1],u=t[n>t.length-3?t.length-1:n+2],l=Mu.interpolate;return new i(l(a.x,s.x,c.x,u.x,o),l(a.y,s.y,c.y,u.y,o))},ar.prototype=Object.create(tr.prototype),ar.prototype.constructor=ar,ar.prototype.getPoint=function(e){var t=hu.b3;return new i(t(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),t(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y))},ar.prototype.getTangent=function(e){var t=Mu.tangentCubicBezier;return new i(t(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),t(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y)).normalize()},sr.prototype=Object.create(tr.prototype),sr.prototype.constructor=sr,sr.prototype.getPoint=function(e){var t=hu.b2;return new i(t(e,this.v0.x,this.v1.x,this.v2.x),t(e,this.v0.y,this.v1.y,this.v2.y))},sr.prototype.getTangent=function(e){var t=Mu.tangentQuadraticBezier;return new i(t(e,this.v0.x,this.v1.x,this.v2.x),t(e,this.v0.y,this.v1.y,this.v2.y)).normalize()};var Au=Object.assign(Object.create(rr.prototype),{fromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,i=e.length;t<i;t++)this.lineTo(e[t].x,e[t].y)},moveTo:function(e,t){this.currentPoint.set(e,t)},lineTo:function(e,t){var r=new ir(this.currentPoint.clone(),new i(e,t));this.curves.push(r),this.currentPoint.set(e,t)},quadraticCurveTo:function(e,t,r,n){var o=new sr(this.currentPoint.clone(),new i(e,t),new i(r,n));this.curves.push(o),this.currentPoint.set(r,n)},bezierCurveTo:function(e,t,r,n,o,a){var s=new ar(this.currentPoint.clone(),new i(e,t),new i(r,n),new i(o,a));this.curves.push(s),this.currentPoint.set(o,a)},splineThru:function(e){var t=[this.currentPoint.clone()].concat(e),i=new or(t);this.curves.push(i),this.currentPoint.copy(e[e.length-1])},arc:function(e,t,i,r,n,o){var a=this.currentPoint.x,s=this.currentPoint.y;this.absarc(e+a,t+s,i,r,n,o)},absarc:function(e,t,i,r,n,o){this.absellipse(e,t,i,i,r,n,o)},ellipse:function(e,t,i,r,n,o,a,s){var c=this.currentPoint.x,u=this.currentPoint.y;this.absellipse(e+c,t+u,i,r,n,o,a,s)},absellipse:function(e,t,i,r,n,o,a,s){var c=new nr(e,t,i,r,n,o,a,s);if(this.curves.length>0){var u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);var l=c.getPoint(1);this.currentPoint.copy(l)}});cr.prototype=Object.assign(Object.create(Au),{constructor:cr,getPointsHoles:function(e){for(var t=[],i=0,r=this.holes.length;i<r;i++)t[i]=this.holes[i].getPoints(e);return t},extractAllPoints:function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},extractPoints:function(e){return this.extractAllPoints(e)}}),ur.prototype=Au,Au.constructor=ur,lr.prototype={moveTo:function(e,t){this.currentPath=new ur,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t)},lineTo:function(e,t){this.currentPath.lineTo(e,t)},quadraticCurveTo:function(e,t,i,r){this.currentPath.quadraticCurveTo(e,t,i,r)},bezierCurveTo:function(e,t,i,r,n,o){this.currentPath.bezierCurveTo(e,t,i,r,n,o)},splineThru:function(e){this.currentPath.splineThru(e)},toShapes:function(e,t){function i(e){for(var t=[],i=0,r=e.length;i<r;i++){var n=e[i],o=new cr;o.curves=n.curves,t.push(o)}return t}function r(e,t){for(var i=t.length,r=!1,n=i-1,o=0;o<i;n=o++){var a=t[n],s=t[o],c=s.x-a.x,u=s.y-a.y;
  if(Math.abs(u)>Number.EPSILON){if(u<0&&(a=t[o],c=-c,s=t[n],u=-u),e.y<a.y||e.y>s.y)continue;if(e.y===a.y){if(e.x===a.x)return!0}else{var l=u*(e.x-a.x)-c*(e.y-a.y);if(0===l)return!0;if(l<0)continue;r=!r}}else{if(e.y!==a.y)continue;if(s.x<=e.x&&e.x<=a.x||a.x<=e.x&&e.x<=s.x)return!0}}return r}var n=hu.isClockWise,o=this.subPaths;if(0===o.length)return[];if(t===!0)return i(o);var a,s,c,u=[];if(1===o.length)return s=o[0],c=new cr,c.curves=s.curves,u.push(c),u;var l=!n(o[0].getPoints());l=e?!l:l;var h,d=[],p=[],f=[],m=0;p[m]=void 0,f[m]=[];for(var g=0,v=o.length;g<v;g++)s=o[g],h=s.getPoints(),a=n(h),a=e?!a:a,a?(!l&&p[m]&&m++,p[m]={s:new cr,p:h},p[m].s.curves=s.curves,l&&m++,f[m]=[]):f[m].push({h:s,p:h[0]});if(!p[0])return i(o);if(p.length>1){for(var y=!1,M=[],A=0,w=p.length;A<w;A++)d[A]=[];for(var A=0,w=p.length;A<w;A++)for(var x=f[A],E=0;E<x.length;E++){for(var b=x[E],T=!0,L=0;L<p.length;L++)r(b.p,p[L].p)&&(A!==L&&M.push({froms:A,tos:L,hole:E}),T?(T=!1,d[L].push(b)):y=!0);T&&d[A].push(b)}M.length>0&&(y||(f=d))}for(var N,g=0,D=p.length;g<D;g++){c=p[g].s,u.push(c),N=f[g];for(var S=0,I=N.length;S<I;S++)c.holes.push(N[S].h)}return u}},Object.assign(hr.prototype,{isFont:!0,generateShapes:function(e,t,i){function r(e){for(var i=String(e).split(""),r=t/o.resolution,a=0,s=[],c=0;c<i.length;c++){var u=n(i[c],r,a);a+=u.offset,s.push(u.path)}return s}function n(e,t,r){var n=o.glyphs[e]||o.glyphs["?"];if(n){var a,s,c,u,l,h,d,p,f,m,g,v=new lr,y=[],M=hu.b2,A=hu.b3;if(n.o)for(var w=n._cachedOutline||(n._cachedOutline=n.o.split(" ")),x=0,E=w.length;x<E;){var b=w[x++];switch(b){case"m":a=w[x++]*t+r,s=w[x++]*t,v.moveTo(a,s);break;case"l":a=w[x++]*t+r,s=w[x++]*t,v.lineTo(a,s);break;case"q":if(c=w[x++]*t+r,u=w[x++]*t,d=w[x++]*t+r,p=w[x++]*t,v.quadraticCurveTo(d,p,c,u),g=y[y.length-1]){l=g.x,h=g.y;for(var T=1;T<=i;T++){var L=T/i;M(L,l,d,c),M(L,h,p,u)}}break;case"b":if(c=w[x++]*t+r,u=w[x++]*t,d=w[x++]*t+r,p=w[x++]*t,f=w[x++]*t+r,m=w[x++]*t,v.bezierCurveTo(d,p,f,m,c,u),g=y[y.length-1]){l=g.x,h=g.y;for(var T=1;T<=i;T++){var L=T/i;A(L,l,d,f,c),A(L,h,p,m,u)}}}}return{offset:n.ha*t,path:v}}}void 0===t&&(t=100),void 0===i&&(i=4);for(var o=this.data,a=r(e),s=[],c=0,u=a.length;c<u;c++)Array.prototype.push.apply(s,a[c].toShapes());return s}}),Object.assign(dr.prototype,{load:function(e,t,i,r){var n=this,o=new wi(this.manager);o.load(e,function(e){var i;try{i=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),i=JSON.parse(e.substring(65,e.length-2))}var r=n.parse(i);t&&t(r)},i,r)},parse:function(e){return new hr(e)}});var wu,xu={getContext:function(){return void 0===wu&&(wu=new(window.AudioContext||window.webkitAudioContext)),wu},setContext:function(e){wu=e}};Object.assign(pr.prototype,{load:function(e,t,i,r){var n=new wi(this.manager);n.setResponseType("arraybuffer"),n.load(e,function(e){var i=xu.getContext();i.decodeAudioData(e,function(e){t(e)})},i,r)}}),fr.prototype=Object.assign(Object.create(Ni.prototype),{constructor:fr,isRectAreaLight:!0,copy:function(e){return Ni.prototype.copy.call(this,e),this.width=e.width,this.height=e.height,this}}),Object.assign(mr.prototype,{update:function(){var e,t,i,r,n,o,a,s=new u,c=new u;return function(u){var l=e!==this||t!==u.focus||i!==u.fov||r!==u.aspect*this.aspect||n!==u.near||o!==u.far||a!==u.zoom;if(l){e=this,t=u.focus,i=u.fov,r=u.aspect*this.aspect,n=u.near,o=u.far,a=u.zoom;var h,d,p=u.projectionMatrix.clone(),f=this.eyeSep/2,m=f*n/t,g=n*Math.tan(Ja.DEG2RAD*i*.5)/a;c.elements[12]=-f,s.elements[12]=f,h=-g*r+m,d=g*r+m,p.elements[0]=2*n/(d-h),p.elements[8]=(d+h)/(d-h),this.cameraL.projectionMatrix.copy(p),h=-g*r-m,d=g*r-m,p.elements[0]=2*n/(d-h),p.elements[8]=(d+h)/(d-h),this.cameraR.projectionMatrix.copy(p)}this.cameraL.matrixWorld.copy(u.matrixWorld).multiply(c),this.cameraR.matrixWorld.copy(u.matrixWorld).multiply(s)}}()}),gr.prototype=Object.create(ce.prototype),gr.prototype.constructor=gr,vr.prototype=Object.assign(Object.create(ce.prototype),{constructor:vr,getInput:function(){return this.gain},removeFilter:function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},getFilter:function(){return this.filter},setFilter:function(e){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination)},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(e){this.gain.gain.value=e},updateMatrixWorld:function(){var e=new c,t=new s,i=new c,r=new c;return function(n){ce.prototype.updateMatrixWorld.call(this,n);var o=this.context.listener,a=this.up;this.matrixWorld.decompose(e,t,i),r.set(0,0,-1).applyQuaternion(t),o.positionX?(o.positionX.setValueAtTime(e.x,this.context.currentTime),o.positionY.setValueAtTime(e.y,this.context.currentTime),o.positionZ.setValueAtTime(e.z,this.context.currentTime),o.forwardX.setValueAtTime(r.x,this.context.currentTime),o.forwardY.setValueAtTime(r.y,this.context.currentTime),o.forwardZ.setValueAtTime(r.z,this.context.currentTime),o.upX.setValueAtTime(a.x,this.context.currentTime),o.upY.setValueAtTime(a.y,this.context.currentTime),o.upZ.setValueAtTime(a.z,this.context.currentTime)):(o.setPosition(e.x,e.y,e.z),o.setOrientation(r.x,r.y,r.z,a.x,a.y,a.z))}}()}),yr.prototype=Object.assign(Object.create(ce.prototype),{constructor:yr,getOutput:function(){return this.gain},setNodeSource:function(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this},setBuffer:function(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(this.isPlaying===!0)return void console.warn("THREE.Audio: Audio is already playing.");if(this.hasPlaybackControl===!1)return void console.warn("THREE.Audio: this Audio has no playback control.");var e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.onended=this.onEnded.bind(this),e.playbackRate.setValueAtTime(this.playbackRate,this.startTime),e.start(0,this.startTime),this.isPlaying=!0,this.source=e,this.connect()},pause:function(){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),this.startTime=this.context.currentTime,this.isPlaying=!1,this)},stop:function(){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),this.startTime=0,this.isPlaying=!1,this)},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(e){return e||(e=[]),this.isPlaying===!0?(this.disconnect(),this.filters=e,this.connect()):this.filters=e,this},getFilter:function(){return this.getFilters()[0]},setFilter:function(e){return this.setFilters(e?[e]:[])},setPlaybackRate:function(e){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.context.currentTime),this)},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(e){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this)},getVolume:function(){return this.gain.gain.value},setVolume:function(e){return this.gain.gain.value=e,this}}),Mr.prototype=Object.assign(Object.create(yr.prototype),{constructor:Mr,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(e){this.panner.refDistance=e},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(e){this.panner.rolloffFactor=e},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(e){this.panner.distanceModel=e},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(e){this.panner.maxDistance=e},updateMatrixWorld:function(){var e=new c;return function(t){ce.prototype.updateMatrixWorld.call(this,t),e.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(e.x,e.y,e.z)}}()}),Object.assign(Ar.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var e=0,t=this.getFrequencyData(),i=0;i<t.length;i++)e+=t[i];return e/t.length}}),wr.prototype={constructor:wr,accumulate:function(e,t){var i=this.buffer,r=this.valueSize,n=e*r+r,o=this.cumulativeWeight;if(0===o){for(var a=0;a!==r;++a)i[n+a]=i[a];o=t}else{o+=t;var s=t/o;this._mixBufferRegion(i,n,0,s,r)}this.cumulativeWeight=o},apply:function(e){var t=this.valueSize,i=this.buffer,r=e*t+t,n=this.cumulativeWeight,o=this.binding;if(this.cumulativeWeight=0,n<1){var a=3*t;this._mixBufferRegion(i,r,a,1-n,t)}for(var s=t,c=t+t;s!==c;++s)if(i[s]!==i[s+t]){o.setValue(i,r);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,i=this.valueSize,r=3*i;e.getValue(t,r);for(var n=i,o=r;n!==o;++n)t[n]=t[r+n%i];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,t,i,r,n){if(r>=.5)for(var o=0;o!==n;++o)e[t+o]=e[i+o]},_slerp:function(e,t,i,r,n){s.slerpFlat(e,t,e,t,e,i,r)},_lerp:function(e,t,i,r,n){for(var o=1-r,a=0;a!==n;++a){var s=t+a;e[s]=e[s]*o+e[i+a]*r}}},xr.prototype={constructor:xr,getValue:function(e,t){this.bind(),this.getValue(e,t)},setValue:function(e,t){this.bind(),this.setValue(e,t)},bind:function(){var e=this.node,t=this.parsedPath,i=t.objectName,r=t.propertyName,n=t.propertyIndex;if(e||(e=xr.findNode(this.rootNode,t.nodeName)||this.rootNode,this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e)return void console.error("  trying to update node for track: "+this.path+" but it wasn't found.");if(i){var o=t.objectIndex;switch(i){case"materials":if(!e.material)return void console.error("  can not bind to material as node does not have a material",this);if(!e.material.materials)return void console.error("  can not bind to material.materials as node.material does not have a materials array",this);e=e.material.materials;break;case"bones":if(!e.skeleton)return void console.error("  can not bind to bones as node does not have a skeleton",this);e=e.skeleton.bones;for(var a=0;a<e.length;a++)if(e[a].name===o){o=a;break}break;default:if(void 0===e[i])return void console.error("  can not bind to objectName of node, undefined",this);e=e[i]}if(void 0!==o){if(void 0===e[o])return void console.error("  trying to bind to objectIndex of objectName, but is undefined:",this,e);e=e[o]}}var s=e[r];if(void 0===s){var c=t.nodeName;return void console.error("  trying to update property for track: "+c+"."+r+" but it wasn't found.",e)}var u=this.Versioning.None;void 0!==e.needsUpdate?(u=this.Versioning.NeedsUpdate,this.targetObject=e):void 0!==e.matrixWorldNeedsUpdate&&(u=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=e);var l=this.BindingType.Direct;if(void 0!==n){if("morphTargetInfluences"===r){if(!e.geometry)return void console.error("  can not bind to morphTargetInfluences becasuse node does not have a geometry",this);if(!e.geometry.morphTargets)return void console.error("  can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets",this);for(var a=0;a<this.node.geometry.morphTargets.length;a++)if(e.geometry.morphTargets[a].name===n){n=a;break}}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=n}else void 0!==s.fromArray&&void 0!==s.toArray?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):void 0!==s.length?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=r;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][u]},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}},Object.assign(xr.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},_getValue_unbound:xr.prototype.getValue,_setValue_unbound:xr.prototype.setValue,BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(e,t){e[t]=this.node[this.propertyName]},function(e,t){for(var i=this.resolvedProperty,r=0,n=i.length;r!==n;++r)e[t++]=i[r]},function(e,t){e[t]=this.resolvedProperty[this.propertyIndex]},function(e,t){this.resolvedProperty.toArray(e,t)}],SetterByBindingTypeAndVersioning:[[function(e,t){this.node[this.propertyName]=e[t]},function(e,t){this.node[this.propertyName]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.node[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){for(var i=this.resolvedProperty,r=0,n=i.length;r!==n;++r)i[r]=e[t++]},function(e,t){for(var i=this.resolvedProperty,r=0,n=i.length;r!==n;++r)i[r]=e[t++];this.targetObject.needsUpdate=!0},function(e,t){for(var i=this.resolvedProperty,r=0,n=i.length;r!==n;++r)i[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty[this.propertyIndex]=e[t]},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(e,t){this.resolvedProperty.fromArray(e,t)},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0},function(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}]]}),xr.Composite=function(e,t,i){var r=i||xr.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)},xr.Composite.prototype={constructor:xr.Composite,getValue:function(e,t){this.bind();var i=this._targetGroup.nCachedObjects_,r=this._bindings[i];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){for(var i=this._bindings,r=this._targetGroup.nCachedObjects_,n=i.length;r!==n;++r)i[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,i=e.length;t!==i;++t)e[t].unbind()}},xr.create=function(e,t,i){return e&&e.isAnimationObjectGroup?new xr.Composite(e,t,i):new xr(e,t,i)},xr.parseTrackName=function(e){var t=/^((?:[\w-]+[\/:])*)([\w-]+)?(?:\.([\w-]+)(?:\[(.+)\])?)?\.([\w-]+)(?:\[(.+)\])?$/,i=t.exec(e);if(!i)throw new Error("cannot parse trackName at all: "+e);var r={nodeName:i[2],objectName:i[3],objectIndex:i[4],propertyName:i[5],propertyIndex:i[6]};if(null===r.propertyName||0===r.propertyName.length)throw new Error("can not parse propertyName from trackName: "+e);return r},xr.findNode=function(e,t){if(!t||""===t||"root"===t||"."===t||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){var i=function(e){for(var i=0;i<e.bones.length;i++){var r=e.bones[i];if(r.name===t)return r}return null},r=i(e.skeleton);if(r)return r}if(e.children){var n=function(e){for(var i=0;i<e.length;i++){var r=e[i];if(r.name===t||r.uuid===t)return r;var o=n(r.children);if(o)return o}return null},o=n(e.children);if(o)return o}return null},Er.prototype={constructor:Er,isAnimationObjectGroup:!0,add:function(e){for(var t=this._objects,i=t.length,r=this.nCachedObjects_,n=this._indicesByUUID,o=this._paths,a=this._parsedPaths,s=this._bindings,c=s.length,u=0,l=arguments.length;u!==l;++u){var h=arguments[u],d=h.uuid,p=n[d],f=void 0;if(void 0===p){p=i++,n[d]=p,t.push(h);for(var m=0,g=c;m!==g;++m)s[m].push(new xr(h,o[m],a[m]))}else if(p<r){f=t[p];var v=--r,y=t[v];n[y.uuid]=p,t[p]=y,n[d]=v,t[v]=h;for(var m=0,g=c;m!==g;++m){var M=s[m],A=M[v],w=M[p];M[p]=A,void 0===w&&(w=new xr(h,o[m],a[m])),M[v]=w}}else t[p]!==f&&console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")}this.nCachedObjects_=r},remove:function(e){for(var t=this._objects,i=this.nCachedObjects_,r=this._indicesByUUID,n=this._bindings,o=n.length,a=0,s=arguments.length;a!==s;++a){var c=arguments[a],u=c.uuid,l=r[u];if(void 0!==l&&l>=i){var h=i++,d=t[h];r[d.uuid]=l,t[l]=d,r[u]=h,t[h]=c;for(var p=0,f=o;p!==f;++p){var m=n[p],g=m[h],v=m[l];m[l]=g,m[h]=v}}}this.nCachedObjects_=i},uncache:function(e){for(var t=this._objects,i=t.length,r=this.nCachedObjects_,n=this._indicesByUUID,o=this._bindings,a=o.length,s=0,c=arguments.length;s!==c;++s){var u=arguments[s],l=u.uuid,h=n[l];if(void 0!==h)if(delete n[l],h<r){var d=--r,p=t[d],f=--i,m=t[f];n[p.uuid]=h,t[h]=p,n[m.uuid]=d,t[d]=m,t.pop();for(var g=0,v=a;g!==v;++g){var y=o[g],M=y[d],A=y[f];y[h]=M,y[d]=A,y.pop()}}else{var f=--i,m=t[f];n[m.uuid]=h,t[h]=m,t.pop();for(var g=0,v=a;g!==v;++g){var y=o[g];y[h]=y[f],y.pop()}}}this.nCachedObjects_=r},subscribe_:function(e,t){var i=this._bindingsIndicesByPath,r=i[e],n=this._bindings;if(void 0!==r)return n[r];var o=this._paths,a=this._parsedPaths,s=this._objects,c=s.length,u=this.nCachedObjects_,l=new Array(c);r=n.length,i[e]=r,o.push(e),a.push(t),n.push(l);for(var h=u,d=s.length;h!==d;++h){var p=s[h];l[h]=new xr(p,e,t)}return l},unsubscribe_:function(e){var t=this._bindingsIndicesByPath,i=t[e];if(void 0!==i){var r=this._paths,n=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a],c=e[a];t[c]=i,o[i]=s,o.pop(),n[i]=n[a],n.pop(),r[i]=r[a],r.pop()}}},br.prototype={constructor:br,play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(e){return this._startTime=e,this},setLoop:function(e,t){return this.loop=e,this.repetitions=t,this},setEffectiveWeight:function(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(e){return this._scheduleFading(e,0,1)},fadeOut:function(e){return this._scheduleFading(e,1,0)},crossFadeFrom:function(e,t,i){if(e.fadeOut(t),this.fadeIn(t),i){var r=this._clip.duration,n=e._clip.duration,o=n/r,a=r/n;e.warp(1,o,t),this.warp(a,1,t)}return this},crossFadeTo:function(e,t,i){return e.crossFadeFrom(this,t,i)},stopFading:function(){var e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},setEffectiveTimeScale:function(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(e){return this.timeScale=this._clip.duration/e,this.stopWarping()},syncWith:function(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()},halt:function(e){return this.warp(this._effectiveTimeScale,0,e)},warp:function(e,t,i){var r=this._mixer,n=r.time,o=this._timeScaleInterpolant,a=this.timeScale;null===o&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);var s=o.parameterPositions,c=o.sampleValues;return s[0]=n,s[1]=n+i,c[0]=e/a,c[1]=t/a,this},stopWarping:function(){var e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(e,t,i,r){var n=this._startTime;if(null!==n){var o=(e-n)*i;if(o<0||0===i)return;this._startTime=null,t=i*o}t*=this._updateTimeScale(e);var a=this._updateTime(t),s=this._updateWeight(e);if(s>0)for(var c=this._interpolants,u=this._propertyBindings,l=0,h=c.length;l!==h;++l)c[l].evaluate(a),u[l].accumulate(r,s)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var i=this._weightInterpolant;if(null!==i){var r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var i=this._timeScaleInterpolant;if(null!==i){var r=i.evaluate(e)[0];t*=r,e>i.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e;if(0===e)return t;var i=this._clip.duration,r=this.loop,n=this._loopCount;if(r===Sa){n===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(t>=i)t=i;else{if(!(t<0))break e;t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{var o=r===Ca;if(n===-1&&(e>=0?(n=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),t>=i||t<0){var a=Math.floor(t/i);t-=i*a,n+=Math.abs(a);var s=this.repetitions-n;if(s<0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=e>0?i:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(0===s){var c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}if(o&&1===(1&n))return this.time=t,i-t}return this.time=t,t},_setEndings:function(e,t,i){var r=this._interpolantSettings;i?(r.endingStart=Ra,r.endingEnd=Ra):(e?r.endingStart=this.zeroSlopeAtStart?Ra:za:r.endingStart=ka,t?r.endingEnd=this.zeroSlopeAtEnd?Ra:za:r.endingEnd=ka)},_scheduleFading:function(e,t,i){var r=this._mixer,n=r.time,o=this._weightInterpolant;null===o&&(o=r._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=n,s[0]=t,a[1]=n+e,s[1]=i,this}},Object.assign(Tr.prototype,t.prototype,{clipAction:function(e,t){var i=t||this._root,r=i.uuid,n="string"==typeof e?qi.findByName(i,e):e,o=null!==n?n.uuid:e,a=this._actionsByClip[o],s=null;if(void 0!==a){var c=a.actionByRoot[r];if(void 0!==c)return c;s=a.knownActions[0],null===n&&(n=s._clip)}if(null===n)return null;var u=new br(this,n,t);return this._bindAction(u,s),this._addInactiveAction(u,o,r),u},existingAction:function(e,t){var i=t||this._root,r=i.uuid,n="string"==typeof e?qi.findByName(i,e):e,o=n?n.uuid:e,a=this._actionsByClip[o];return void 0!==a?a.actionByRoot[r]||null:null},stopAllAction:function(){var e=this._actions,t=this._nActiveActions,i=this._bindings,r=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var n=0;n!==t;++n)e[n].reset();for(var n=0;n!==r;++n)i[n].useCount=0;return this},update:function(e){e*=this.timeScale;for(var t=this._actions,i=this._nActiveActions,r=this.time+=e,n=Math.sign(e),o=this._accuIndex^=1,a=0;a!==i;++a){var s=t[a];s.enabled&&s._update(r,e,n,o)}for(var c=this._bindings,u=this._nActiveBindings,a=0;a!==u;++a)c[a].apply(o);return this},getRoot:function(){return this._root},uncacheClip:function(e){var t=this._actions,i=e.uuid,r=this._actionsByClip,n=r[i];if(void 0!==n){for(var o=n.knownActions,a=0,s=o.length;a!==s;++a){var c=o[a];this._deactivateAction(c);var u=c._cacheIndex,l=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,l._cacheIndex=u,t[u]=l,t.pop(),this._removeInactiveBindingsForAction(c)}delete r[i]}},uncacheRoot:function(e){var t=e.uuid,i=this._actionsByClip;for(var r in i){var n=i[r].actionByRoot,o=n[t];void 0!==o&&(this._deactivateAction(o),this._removeInactiveAction(o))}var a=this._bindingsByRootAndName,s=a[t];if(void 0!==s)for(var c in s){var u=s[c];u.restoreOriginalState(),this._removeInactiveBinding(u)}},uncacheAction:function(e,t){var i=this.existingAction(e,t);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}}),Object.assign(Tr.prototype,{_bindAction:function(e,t){var i=e._localRoot||this._root,r=e._clip.tracks,n=r.length,o=e._propertyBindings,a=e._interpolants,s=i.uuid,c=this._bindingsByRootAndName,u=c[s];void 0===u&&(u={},c[s]=u);for(var l=0;l!==n;++l){var h=r[l],d=h.name,p=u[d];if(void 0!==p)o[l]=p;else{if(p=o[l],void 0!==p){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,d));continue}var f=t&&t._propertyBindings[l].binding.parsedPath;p=new wr(xr.create(i,d,f),h.ValueTypeName,h.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,s,d),o[l]=p}a[l].resultBuffer=p.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,i=e._clip.uuid,r=this._actionsByClip[i];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,i,t)}for(var n=e._propertyBindings,o=0,a=n.length;o!==a;++o){var s=n[o];0===s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,i=0,r=t.length;i!==r;++i){var n=t[i];0===--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(e,t,i){var r=this._actions,n=this._actionsByClip,o=n[t];if(void 0===o)o={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,n[t]=o;else{var a=o.knownActions;e._byClipCacheIndex=a.length,a.push(e)}e._cacheIndex=r.length,r.push(e),o.actionByRoot[i]=e},_removeInactiveAction:function(e){var t=this._actions,i=t[t.length-1],r=e._cacheIndex;i._cacheIndex=r,t[r]=i,t.pop(),e._cacheIndex=null;var n=e._clip.uuid,o=this._actionsByClip,a=o[n],s=a.knownActions,c=s[s.length-1],u=e._byClipCacheIndex;c._byClipCacheIndex=u,s[u]=c,s.pop(),e._byClipCacheIndex=null;var l=a.actionByRoot,h=(t._localRoot||this._root).uuid;delete l[h],0===s.length&&delete o[n],this._removeInactiveBindingsForAction(e)},_removeInactiveBindingsForAction:function(e){for(var t=e._propertyBindings,i=0,r=t.length;i!==r;++i){var n=t[i];0===--n.referenceCount&&this._removeInactiveBinding(n)}},_lendAction:function(e){var t=this._actions,i=e._cacheIndex,r=this._nActiveActions++,n=t[r];e._cacheIndex=r,t[r]=e,n._cacheIndex=i,t[i]=n},_takeBackAction:function(e){var t=this._actions,i=e._cacheIndex,r=--this._nActiveActions,n=t[r];e._cacheIndex=r,t[r]=e,n._cacheIndex=i,t[i]=n},_addInactiveBinding:function(e,t,i){var r=this._bindingsByRootAndName,n=r[t],o=this._bindings;void 0===n&&(n={},r[t]=n),n[i]=e,e._cacheIndex=o.length,o.push(e)},_removeInactiveBinding:function(e){var t=this._bindings,i=e.binding,r=i.rootNode.uuid,n=i.path,o=this._bindingsByRootAndName,a=o[r],s=t[t.length-1],c=e._cacheIndex;s._cacheIndex=c,t[c]=s,t.pop(),delete a[n];e:{for(var u in a)break e;delete o[r]}},_lendBinding:function(e){var t=this._bindings,i=e._cacheIndex,r=this._nActiveBindings++,n=t[r];e._cacheIndex=r,t[r]=e,n._cacheIndex=i,t[i]=n},_takeBackBinding:function(e){var t=this._bindings,i=e._cacheIndex,r=--this._nActiveBindings,n=t[r];e._cacheIndex=r,t[r]=e,n._cacheIndex=i,t[i]=n},_lendControlInterpolant:function(){var e=this._controlInterpolants,t=this._nActiveControlInterpolants++,i=e[t];return void 0===i&&(i=new Ui(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),i.__cacheIndex=t,e[t]=i),i},_takeBackControlInterpolant:function(e){var t=this._controlInterpolants,i=e.__cacheIndex,r=--this._nActiveControlInterpolants,n=t[r];e.__cacheIndex=r,t[r]=e,n.__cacheIndex=i,t[i]=n},_controlInterpolantsResultBuffer:new Float32Array(1)}),Lr.prototype.clone=function(){return new Lr(void 0===this.value.clone?this.value:this.value.clone())},Nr.prototype=Object.create(Le.prototype),Nr.prototype.constructor=Nr,Nr.prototype.isInstancedBufferGeometry=!0,Nr.prototype.addGroup=function(e,t,i){this.groups.push({start:e,count:t,materialIndex:i})},Nr.prototype.copy=function(e){var t=e.index;null!==t&&this.setIndex(t.clone());var i=e.attributes;for(var r in i){var n=i[r];this.addAttribute(r,n.clone())}for(var o=e.groups,a=0,s=o.length;a<s;a++){var c=o[a];this.addGroup(c.start,c.count,c.materialIndex)}return this},Dr.prototype={constructor:Dr,isInterleavedBufferAttribute:!0,get count(){return this.data.count},get array(){return this.data.array},setX:function(e,t){return this.data.array[e*this.data.stride+this.offset]=t,this},setY:function(e,t){return this.data.array[e*this.data.stride+this.offset+1]=t,this},setZ:function(e,t){return this.data.array[e*this.data.stride+this.offset+2]=t,this},setW:function(e,t){return this.data.array[e*this.data.stride+this.offset+3]=t,this},getX:function(e){return this.data.array[e*this.data.stride+this.offset]},getY:function(e){return this.data.array[e*this.data.stride+this.offset+1]},getZ:function(e){return this.data.array[e*this.data.stride+this.offset+2]},getW:function(e){return this.data.array[e*this.data.stride+this.offset+3]},setXY:function(e,t,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this},setXYZ:function(e,t,i,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this},setXYZW:function(e,t,i,r,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=i,this.data.array[e+2]=r,this.data.array[e+3]=n,this}},Sr.prototype={constructor:Sr,isInterleavedBuffer:!0,set needsUpdate(e){e===!0&&this.version++},setArray:function(e){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==e?e.length/this.stride:0,this.array=e},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.dynamic=e.dynamic,this},copyAt:function(e,t,i){e*=this.stride,i*=t.stride;for(var r=0,n=this.stride;r<n;r++)this.array[e+r]=t.array[i+r];return this},set:function(e,t){return void 0===t&&(t=0),this.array.set(e,t),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(e){return this.onUploadCallback=e,this}},Ir.prototype=Object.create(Sr.prototype),Ir.prototype.constructor=Ir,Ir.prototype.isInstancedInterleavedBuffer=!0,Ir.prototype.copy=function(e){return Sr.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},Cr.prototype=Object.create(pe.prototype),Cr.prototype.constructor=Cr,Cr.prototype.isInstancedBufferAttribute=!0,Cr.prototype.copy=function(e){return pe.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},_r.prototype={constructor:_r,linePrecision:1,set:function(e,t){
  this.ray.set(e,t)},setFromCamera:function(e,t){t&&t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize()):t&&t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,t){var i=[];return Or(e,this,i,t),i.sort(jr),i},intersectObjects:function(e,t){var i=[];if(Array.isArray(e)===!1)return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,n=e.length;r<n;r++)Or(e[r],this,i,t);return i.sort(jr),i}},zr.prototype={constructor:zr,start:function(){this.startTime=(performance||Date).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running&&this.start(),this.running){var t=(performance||Date).now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}},kr.prototype={constructor:kr,set:function(e,t,i){return this.radius=e,this.phi=t,this.theta=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this},makeSafe:function(){var e=1e-6;return this.phi=Math.max(e,Math.min(Math.PI-e,this.phi)),this},setFromVector3:function(e){return this.radius=e.length(),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e.x,e.z),this.phi=Math.acos(Ja.clamp(e.y/this.radius,-1,1))),this}},Ur.prototype={constructor:Ur,set:function(e,t,i){return this.radius=e,this.theta=t,this.y=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this},setFromVector3:function(e){return this.radius=Math.sqrt(e.x*e.x+e.z*e.z),this.theta=Math.atan2(e.x,e.z),this.y=e.y,this}},Pr.prototype=Object.create(Ne.prototype),Pr.prototype.constructor=Pr,Pr.prototype.createAnimation=function(e,t,i,r){var n={start:t,end:i,length:i-t+1,fps:r,duration:(i-t)/r,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[e]=n,this.animationsList.push(n)},Pr.prototype.autoCreateAnimations=function(e){for(var t,i=/([a-z]+)_?(\d+)/i,r={},n=this.geometry,o=0,a=n.morphTargets.length;o<a;o++){var s=n.morphTargets[o],c=s.name.match(i);if(c&&c.length>1){var u=c[1];r[u]||(r[u]={start:1/0,end:-(1/0)});var l=r[u];o<l.start&&(l.start=o),o>l.end&&(l.end=o),t||(t=u)}}for(var u in r){var l=r[u];this.createAnimation(u,l.start,l.end,e)}this.firstAnimation=t},Pr.prototype.setAnimationDirectionForward=function(e){var t=this.animationsMap[e];t&&(t.direction=1,t.directionBackwards=!1)},Pr.prototype.setAnimationDirectionBackward=function(e){var t=this.animationsMap[e];t&&(t.direction=-1,t.directionBackwards=!0)},Pr.prototype.setAnimationFPS=function(e,t){var i=this.animationsMap[e];i&&(i.fps=t,i.duration=(i.end-i.start)/i.fps)},Pr.prototype.setAnimationDuration=function(e,t){var i=this.animationsMap[e];i&&(i.duration=t,i.fps=(i.end-i.start)/i.duration)},Pr.prototype.setAnimationWeight=function(e,t){var i=this.animationsMap[e];i&&(i.weight=t)},Pr.prototype.setAnimationTime=function(e,t){var i=this.animationsMap[e];i&&(i.time=t)},Pr.prototype.getAnimationTime=function(e){var t=0,i=this.animationsMap[e];return i&&(t=i.time),t},Pr.prototype.getAnimationDuration=function(e){var t=-1,i=this.animationsMap[e];return i&&(t=i.duration),t},Pr.prototype.playAnimation=function(e){var t=this.animationsMap[e];t?(t.time=0,t.active=!0):console.warn("THREE.MorphBlendMesh: animation["+e+"] undefined in .playAnimation()")},Pr.prototype.stopAnimation=function(e){var t=this.animationsMap[e];t&&(t.active=!1)},Pr.prototype.update=function(e){for(var t=0,i=this.animationsList.length;t<i;t++){var r=this.animationsList[t];if(r.active){var n=r.duration/r.length;r.time+=r.direction*e,r.mirroredLoop?(r.time>r.duration||r.time<0)&&(r.direction*=-1,r.time>r.duration&&(r.time=r.duration,r.directionBackwards=!0),r.time<0&&(r.time=0,r.directionBackwards=!1)):(r.time=r.time%r.duration,r.time<0&&(r.time+=r.duration));var o=r.start+Ja.clamp(Math.floor(r.time/n),0,r.length-1),a=r.weight;o!==r.currentFrame&&(this.morphTargetInfluences[r.lastFrame]=0,this.morphTargetInfluences[r.currentFrame]=1*a,this.morphTargetInfluences[o]=0,r.lastFrame=r.currentFrame,r.currentFrame=o);var s=r.time%n/n;r.directionBackwards&&(s=1-s),r.currentFrame!==r.lastFrame?(this.morphTargetInfluences[r.currentFrame]=s*a,this.morphTargetInfluences[r.lastFrame]=(1-s)*a):this.morphTargetInfluences[r.currentFrame]=a}}},Br.prototype=Object.create(ce.prototype),Br.prototype.constructor=Br,Br.prototype.isImmediateRenderObject=!0,Fr.prototype=Object.create(yt.prototype),Fr.prototype.constructor=Fr,Fr.prototype.update=function(){var e=new c,t=new c,i=new te;return function(){var r=["a","b","c"];this.object.updateMatrixWorld(!0),i.getNormalMatrix(this.object.matrixWorld);var n=this.object.matrixWorld,o=this.geometry.attributes.position,a=this.object.geometry;if(a&&a.isGeometry)for(var s=a.vertices,c=a.faces,u=0,l=0,h=c.length;l<h;l++)for(var d=c[l],p=0,f=d.vertexNormals.length;p<f;p++){var m=s[d[r[p]]],g=d.vertexNormals[p];e.copy(m).applyMatrix4(n),t.copy(g).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),o.setXYZ(u,e.x,e.y,e.z),u+=1,o.setXYZ(u,t.x,t.y,t.z),u+=1}else if(a&&a.isBufferGeometry)for(var v=a.attributes.position,y=a.attributes.normal,u=0,p=0,f=v.count;p<f;p++)e.set(v.getX(p),v.getY(p),v.getZ(p)).applyMatrix4(n),t.set(y.getX(p),y.getY(p),y.getZ(p)),t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),o.setXYZ(u,e.x,e.y,e.z),u+=1,o.setXYZ(u,t.x,t.y,t.z),u+=1;return o.needsUpdate=!0,this}}(),Gr.prototype=Object.create(ce.prototype),Gr.prototype.constructor=Gr,Gr.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Gr.prototype.update=function(){var e=new c,t=new c;return function(){var i=this.light.distance?this.light.distance:1e3,r=i*Math.tan(this.light.angle);this.cone.scale.set(r,r,i),e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(t.sub(e)),this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}(),Hr.prototype=Object.create(yt.prototype),Hr.prototype.constructor=Hr,Hr.prototype.getBoneList=function(e){var t=[];e&&e.isBone&&t.push(e);for(var i=0;i<e.children.length;i++)t.push.apply(t,this.getBoneList(e.children[i]));return t},Hr.prototype.update=function(){var e=new c,t=new u,i=new u;return function(){var r=this.geometry,n=r.getAttribute("position");i.getInverse(this.root.matrixWorld);for(var o=0,a=0;o<this.bones.length;o++){var s=this.bones[o];s.parent&&s.parent.isBone&&(t.multiplyMatrices(i,s.matrixWorld),e.setFromMatrixPosition(t),n.setXYZ(a,e.x,e.y,e.z),t.multiplyMatrices(i,s.parent.matrixWorld),e.setFromMatrixPosition(t),n.setXYZ(a+1,e.x,e.y,e.z),a+=2)}r.getAttribute("position").needsUpdate=!0}}(),Qr.prototype=Object.create(Ne.prototype),Qr.prototype.constructor=Qr,Qr.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Qr.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},Yr.prototype=Object.create(ce.prototype),Yr.prototype.constructor=Yr,Yr.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose(),this.children[1].geometry.dispose(),this.children[1].material.dispose()},Yr.prototype.update=function(){var e=new c,t=new c;return function(){var i=this.children[0],r=this.children[1];if(this.light.target){e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld);var n=t.clone().sub(e);i.lookAt(n),r.lookAt(n)}i.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),r.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);var o=.5*this.light.width,a=.5*this.light.height,s=i.geometry.getAttribute("position"),c=s.array;c[0]=o,c[1]=-a,c[2]=0,c[3]=o,c[4]=a,c[5]=0,c[6]=-o,c[7]=a,c[8]=0,c[9]=-o,c[10]=a,c[11]=0,c[12]=-o,c[13]=-a,c[14]=0,c[15]=o,c[16]=-a,c[17]=0,s.needsUpdate=!0}}(),Vr.prototype=Object.create(ce.prototype),Vr.prototype.constructor=Vr,Vr.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},Vr.prototype.update=function(){var e=new c,t=new Y,i=new Y;return function(){var r=this.children[0],n=r.geometry.getAttribute("color");t.copy(this.light.color).multiplyScalar(this.light.intensity),i.copy(this.light.groundColor).multiplyScalar(this.light.intensity);for(var o=0,a=n.count;o<a;o++){var s=o<a/2?t:i;n.setXYZ(o,s.r,s.g,s.b)}r.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),n.needsUpdate=!0}}(),Wr.prototype=Object.create(yt.prototype),Wr.prototype.constructor=Wr,Xr.prototype=Object.create(yt.prototype),Xr.prototype.constructor=Xr,qr.prototype=Object.create(yt.prototype),qr.prototype.constructor=qr,qr.prototype.update=function(){var e=new c,t=new c,i=new te;return function(){this.object.updateMatrixWorld(!0),i.getNormalMatrix(this.object.matrixWorld);for(var r=this.object.matrixWorld,n=this.geometry.attributes.position,o=this.object.geometry,a=o.vertices,s=o.faces,c=0,u=0,l=s.length;u<l;u++){var h=s[u],d=h.normal;e.copy(a[h.a]).add(a[h.b]).add(a[h.c]).divideScalar(3).applyMatrix4(r),t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),n.setXYZ(c,e.x,e.y,e.z),c+=1,n.setXYZ(c,t.x,t.y,t.z),c+=1}return n.needsUpdate=!0,this}}(),Zr.prototype=Object.create(ce.prototype),Zr.prototype.constructor=Zr,Zr.prototype.dispose=function(){var e=this.children[0],t=this.children[1];e.geometry.dispose(),e.material.dispose(),t.geometry.dispose(),t.material.dispose()},Zr.prototype.update=function(){var e=new c,t=new c,i=new c;return function(){e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),i.subVectors(t,e);var r=this.children[0],n=this.children[1];r.lookAt(i),r.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),n.lookAt(i),n.scale.z=i.length()}}(),Jr.prototype=Object.create(yt.prototype),Jr.prototype.constructor=Jr,Jr.prototype.update=function(){function e(e,o,a,s){r.set(o,a,s).unproject(n);var c=i[e];if(void 0!==c)for(var u=t.getAttribute("position"),l=0,h=c.length;l<h;l++)u.setXYZ(c[l],r.x,r.y,r.z)}var t,i,r=new c,n=new Ie;return function(){t=this.geometry,i=this.pointMap;var r=1,o=1;n.projectionMatrix.copy(this.camera.projectionMatrix),e("c",0,0,-1),e("t",0,0,1),e("n1",-r,-o,-1),e("n2",r,-o,-1),e("n3",-r,o,-1),e("n4",r,o,-1),e("f1",-r,-o,1),e("f2",r,-o,1),e("f3",-r,o,1),e("f4",r,o,1),e("u1",.7*r,1.1*o,-1),e("u2",.7*-r,1.1*o,-1),e("u3",0,2*o,-1),e("cf1",-r,0,1),e("cf2",r,0,1),e("cf3",0,-o,1),e("cf4",0,o,1),e("cn1",-r,0,-1),e("cn2",r,0,-1),e("cn3",0,-o,-1),e("cn4",0,o,-1),t.getAttribute("position").needsUpdate=!0}}(),Kr.prototype=Object.create(yt.prototype),Kr.prototype.constructor=Kr,Kr.prototype.update=function(){var e=new $;return function(t){if(t&&t.isBox3?e.copy(t):e.setFromObject(t),!e.isEmpty()){var i=e.min,r=e.max,n=this.geometry.attributes.position,o=n.array;o[0]=r.x,o[1]=r.y,o[2]=r.z,o[3]=i.x,o[4]=r.y,o[5]=r.z,o[6]=i.x,o[7]=i.y,o[8]=r.z,o[9]=r.x,o[10]=i.y,o[11]=r.z,o[12]=r.x,o[13]=r.y,o[14]=i.z,o[15]=i.x,o[16]=r.y,o[17]=i.z,o[18]=i.x,o[19]=i.y,o[20]=i.z,o[21]=r.x,o[22]=i.y,o[23]=i.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}();var Eu=new Le;Eu.addAttribute("position",new we([0,0,0,0,1,0],3));var bu=new ri(0,.5,1,5,1);bu.translate(0,-.5,0),$r.prototype=Object.create(ce.prototype),$r.prototype.constructor=$r,$r.prototype.setDirection=function(){var e,t=new c;return function(i){i.y>.99999?this.quaternion.set(0,0,0,1):i.y<-.99999?this.quaternion.set(1,0,0,0):(t.set(i.z,0,-i.x).normalize(),e=Math.acos(i.y),this.quaternion.setFromAxisAngle(t,e))}}(),$r.prototype.setLength=function(e,t,i){void 0===t&&(t=.2*e),void 0===i&&(i=.2*t),this.line.scale.set(1,Math.max(0,e-t),1),this.line.updateMatrix(),this.cone.scale.set(i,t,i),this.cone.position.y=e,this.cone.updateMatrix()},$r.prototype.setColor=function(e){this.line.material.color.copy(e),this.cone.material.color.copy(e)},en.prototype=Object.create(yt.prototype),en.prototype.constructor=en;var Tu=function(){function e(){}var t=new c,i=new e,r=new e,n=new e;return e.prototype.init=function(e,t,i,r){this.c0=e,this.c1=i,this.c2=-3*e+3*t-2*i-r,this.c3=2*e-2*t+i+r},e.prototype.initNonuniformCatmullRom=function(e,t,i,r,n,o,a){var s=(t-e)/n-(i-e)/(n+o)+(i-t)/o,c=(i-t)/o-(r-t)/(o+a)+(r-i)/a;s*=o,c*=o,this.init(t,i,s,c)},e.prototype.initCatmullRom=function(e,t,i,r,n){this.init(t,i,n*(i-e),n*(r-t))},e.prototype.calc=function(e){var t=e*e,i=t*e;return this.c0+this.c1*e+this.c2*t+this.c3*i},tr.create(function(e){this.points=e||[],this.closed=!1},function(e){var o,a,s,u,l=this.points;u=l.length,u<2&&console.log("duh, you need at least 2 points"),o=(u-(this.closed?0:1))*e,a=Math.floor(o),s=o-a,this.closed?a+=a>0?0:(Math.floor(Math.abs(a)/l.length)+1)*l.length:0===s&&a===u-1&&(a=u-2,s=1);var h,d,p,f;if(this.closed||a>0?h=l[(a-1)%u]:(t.subVectors(l[0],l[1]).add(l[0]),h=t),d=l[a%u],p=l[(a+1)%u],this.closed||a+2<u?f=l[(a+2)%u]:(t.subVectors(l[u-1],l[u-2]).add(l[u-1]),f=t),void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var m="chordal"===this.type?.5:.25,g=Math.pow(h.distanceToSquared(d),m),v=Math.pow(d.distanceToSquared(p),m),y=Math.pow(p.distanceToSquared(f),m);v<1e-4&&(v=1),g<1e-4&&(g=v),y<1e-4&&(y=v),i.initNonuniformCatmullRom(h.x,d.x,p.x,f.x,g,v,y),r.initNonuniformCatmullRom(h.y,d.y,p.y,f.y,g,v,y),n.initNonuniformCatmullRom(h.z,d.z,p.z,f.z,g,v,y)}else if("catmullrom"===this.type){var M=void 0!==this.tension?this.tension:.5;i.initCatmullRom(h.x,d.x,p.x,f.x,M),r.initCatmullRom(h.y,d.y,p.y,f.y,M),n.initCatmullRom(h.z,d.z,p.z,f.z,M)}var A=new c(i.calc(s),r.calc(s),n.calc(s));return A})}(),Lu=tr.create(function(e){console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),this.points=void 0===e?[]:e},function(e){var t=this.points,i=(t.length-1)*e,r=Math.floor(i),n=i-r,o=t[0==r?r:r-1],a=t[r],s=t[r>t.length-2?t.length-1:r+1],u=t[r>t.length-3?t.length-1:r+2],l=Mu.interpolate;return new c(l(o.x,a.x,s.x,u.x,n),l(o.y,a.y,s.y,u.y,n),l(o.z,a.z,s.z,u.z,n))}),Nu=tr.create(function(e,t,i,r){this.v0=e,this.v1=t,this.v2=i,this.v3=r},function(e){var t=hu.b3;return new c(t(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),t(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y),t(e,this.v0.z,this.v1.z,this.v2.z,this.v3.z))}),Du=tr.create(function(e,t,i){this.v0=e,this.v1=t,this.v2=i},function(e){var t=hu.b2;return new c(t(e,this.v0.x,this.v1.x,this.v2.x),t(e,this.v0.y,this.v1.y,this.v2.y),t(e,this.v0.z,this.v1.z,this.v2.z))}),Su=tr.create(function(e,t){this.v1=e,this.v2=t},function(e){if(1===e)return this.v2.clone();var t=new c;return t.subVectors(this.v2,this.v1),t.multiplyScalar(e),t.add(this.v1),t});tn.prototype=Object.create(nr.prototype),tn.prototype.constructor=tn;var Iu={createMultiMaterialObject:function(e,t){for(var i=new wt,r=0,n=t.length;r<n;r++)i.add(new Ne(e,t[r]));return i},detach:function(e,t,i){e.applyMatrix(t.matrixWorld),t.remove(e),i.add(e)},attach:function(e,t,i){var r=new u;r.getInverse(i.matrixWorld),e.applyMatrix(r),t.remove(e),i.add(e)}},Cu=0,_u=1;xn.prototype=Object.create(Tu.prototype),Wr.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Object.assign(W.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign($.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),ue.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Ja.random16=function(){return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),Math.random()},Object.assign(te.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(e){return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(e)},applyToBuffer:function(e,t,i){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)}}),Object.assign(u.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){var e;return function(){return void 0===e&&(e=new c),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),e.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),e.applyProjection(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(e){return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(e)},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(e,t,i){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(e)}}),ie.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},s.prototype.multiplyVector3=function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},Object.assign(oe.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(cr.prototype,{extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Yt(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new ti(this,e)}}),Object.assign(c.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)}}),be.prototype.computeTangents=function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")},Object.assign(ce.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)}}),Object.defineProperties(ce.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(dt.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Ce.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(Ni.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(pe.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}}}),Object.assign(Le.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addDrawCall:function(e,t,i){void 0!==i&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}),Object.defineProperties(Le.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(Lr.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(Z.prototype,{wrapAround:{get:function(){console.warn("THREE."+this.type+": .wrapAround has been removed.")},set:function(){console.warn("THREE."+this.type+": .wrapAround has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE."+this.type+": .wrapRGB has been removed."),new Y}}}),Object.defineProperties(mi.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(J.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),t.prototype=Object.assign(Object.create({constructor:t,apply:function(e){console.warn("THREE.EventDispatcher: .apply is deprecated, just inherit or Object.assign the prototype to mix-in."),Object.assign(e,this)}}),t.prototype),Object.assign(ot.prototype,{supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}}),Object.defineProperties(ot.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){return this.shadowMap.cullFace},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),this.shadowMap.cullFace=e}}}),Object.defineProperties(ne.prototype,{cullFace:{get:function(){return this.renderReverseSided?jn:_n},set:function(e){var t=e!==_n;console.warn("WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to "+t+"."),this.renderReverseSided=t}}}),Object.defineProperties(o.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter;
  },set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),yr.prototype.load=function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var t=this,i=new pr;return i.load(e,function(e){t.setBuffer(e)}),this},Ar.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()};var ju={merge:function(e,t,i){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var r;t.isMesh&&(t.matrixAutoUpdate&&t.updateMatrix(),r=t.matrix,t=t.geometry),e.merge(t,r,i)},center:function(e){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}},Ou={crossOrigin:void 0,loadTexture:function(e,t,i,r){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var n=new Li;n.setCrossOrigin(this.crossOrigin);var o=n.load(e,i,void 0,r);return t&&(o.mapping=t),o},loadTextureCube:function(e,t,i,r){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var n=new Ti;n.setCrossOrigin(this.crossOrigin);var o=n.load(e,i,void 0,r);return t&&(o.mapping=t),o},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")}};e.WebGLRenderTargetCube=a,e.WebGLRenderTarget=o,e.WebGLRenderer=ot,e.ShaderLib=au,e.UniformsLib=ou,e.UniformsUtils=ns,e.ShaderChunk=ru,e.FogExp2=at,e.Fog=st,e.Scene=ct,e.LensFlare=ut,e.Sprite=ht,e.LOD=dt,e.SkinnedMesh=mt,e.Skeleton=pt,e.Bone=ft,e.Mesh=Ne,e.LineSegments=yt,e.Line=vt,e.Points=At,e.Group=wt,e.VideoTexture=xt,e.DataTexture=V,e.CompressedTexture=Et,e.CubeTexture=l,e.CanvasTexture=bt,e.DepthTexture=Tt,e.Texture=r,e.CompressedTextureLoader=xi,e.BinaryTextureLoader=Ei,e.DataTextureLoader=gu,e.CubeTextureLoader=Ti,e.TextureLoader=Li,e.ObjectLoader=er,e.MaterialLoader=Zi,e.BufferGeometryLoader=Ji,e.DefaultLoadingManager=mu,e.LoadingManager=Ai,e.JSONLoader=$i,e.ImageLoader=bi,e.FontLoader=dr,e.FileLoader=wi,e.Loader=Ki,e.Cache=fu,e.AudioLoader=pr,e.SpotLightShadow=Ii,e.SpotLight=Ci,e.PointLight=_i,e.RectAreaLight=fr,e.HemisphereLight=Di,e.DirectionalLightShadow=ji,e.DirectionalLight=Oi,e.AmbientLight=zi,e.LightShadow=Si,e.Light=Ni,e.StereoCamera=mr,e.PerspectiveCamera=Ce,e.OrthographicCamera=_e,e.CubeCamera=gr,e.Camera=Ie,e.AudioListener=vr,e.PositionalAudio=Mr,e.AudioContext=xu,e.AudioAnalyser=Ar,e.Audio=yr,e.VectorKeyframeTrack=Fi,e.StringKeyframeTrack=Yi,e.QuaternionKeyframeTrack=Hi,e.NumberKeyframeTrack=Qi,e.ColorKeyframeTrack=Wi,e.BooleanKeyframeTrack=Vi,e.PropertyMixer=wr,e.PropertyBinding=xr,e.KeyframeTrack=Xi,e.AnimationUtils=vu,e.AnimationObjectGroup=Er,e.AnimationMixer=Tr,e.AnimationClip=qi,e.Uniform=Lr,e.InstancedBufferGeometry=Nr,e.BufferGeometry=Le,e.GeometryIdCount=Te,e.Geometry=be,e.InterleavedBufferAttribute=Dr,e.InstancedInterleavedBuffer=Ir,e.InterleavedBuffer=Sr,e.InstancedBufferAttribute=Cr,e.Face3=he,e.Object3D=ce,e.Raycaster=_r,e.Layers=se,e.EventDispatcher=t,e.Clock=zr,e.QuaternionLinearInterpolant=Gi,e.LinearInterpolant=Ui,e.DiscreteInterpolant=Pi,e.CubicInterpolant=ki,e.Interpolant=Ri,e.Triangle=le,e.Spline=Rr,e.Math=Ja,e.Spherical=kr,e.Cylindrical=Ur,e.Plane=ie,e.Frustum=re,e.Sphere=ee,e.Ray=oe,e.Matrix4=u,e.Matrix3=te,e.Box3=$,e.Box2=W,e.Line3=ue,e.Euler=ae,e.Vector4=n,e.Vector3=c,e.Vector2=i,e.Quaternion=s,e.Color=Y,e.MorphBlendMesh=Pr,e.ImmediateRenderObject=Br,e.VertexNormalsHelper=Fr,e.SpotLightHelper=Gr,e.SkeletonHelper=Hr,e.PointLightHelper=Qr,e.RectAreaLightHelper=Yr,e.HemisphereLightHelper=Vr,e.GridHelper=Wr,e.PolarGridHelper=Xr,e.FaceNormalsHelper=qr,e.DirectionalLightHelper=Zr,e.CameraHelper=Jr,e.BoxHelper=Kr,e.ArrowHelper=$r,e.AxisHelper=en,e.CatmullRomCurve3=Tu,e.SplineCurve3=Lu,e.CubicBezierCurve3=Nu,e.QuadraticBezierCurve3=Du,e.LineCurve3=Su,e.ArcCurve=tn,e.EllipseCurve=nr,e.SplineCurve=or,e.CubicBezierCurve=ar,e.QuadraticBezierCurve=sr,e.LineCurve=ir,e.Shape=cr,e.ShapePath=lr,e.Path=ur,e.Font=hr,e.CurvePath=rr,e.Curve=tr,e.ShapeUtils=hu,e.SceneUtils=Iu,e.CurveUtils=Mu,e.WireframeGeometry=Lt,e.ParametricGeometry=Dt,e.ParametricBufferGeometry=Nt,e.TetrahedronGeometry=Ct,e.TetrahedronBufferGeometry=It,e.OctahedronGeometry=jt,e.OctahedronBufferGeometry=_t,e.IcosahedronGeometry=zt,e.IcosahedronBufferGeometry=Ot,e.DodecahedronGeometry=kt,e.DodecahedronBufferGeometry=Rt,e.PolyhedronGeometry=Ut,e.PolyhedronBufferGeometry=St,e.TubeGeometry=Bt,e.TubeBufferGeometry=Pt,e.TorusKnotGeometry=Gt,e.TorusKnotBufferGeometry=Ft,e.TorusGeometry=Qt,e.TorusBufferGeometry=Ht,e.TextGeometry=Vt,e.SphereBufferGeometry=Wt,e.SphereGeometry=Xt,e.RingGeometry=Zt,e.RingBufferGeometry=qt,e.PlaneBufferGeometry=Se,e.PlaneGeometry=Jt,e.LatheGeometry=$t,e.LatheBufferGeometry=Kt,e.ShapeGeometry=ti,e.ShapeBufferGeometry=ei,e.ExtrudeGeometry=Yt,e.EdgesGeometry=ii,e.ConeGeometry=oi,e.ConeBufferGeometry=ai,e.CylinderGeometry=ni,e.CylinderBufferGeometry=ri,e.CircleBufferGeometry=si,e.CircleGeometry=ci,e.BoxBufferGeometry=De,e.BoxGeometry=ui,e.ShadowMaterial=li,e.SpriteMaterial=lt,e.RawShaderMaterial=hi,e.ShaderMaterial=J,e.PointsMaterial=Mt,e.MultiMaterial=di;e.MeshPhysicalMaterial=fi;e.MeshStandardMaterial=pi,e.MeshPhongMaterial=mi,e.MeshToonMaterial=gi,e.MeshNormalMaterial=vi,e.MeshLambertMaterial=yi,e.MeshDepthMaterial=K,e.MeshBasicMaterial=de,e.LineDashedMaterial=Mi,e.LineBasicMaterial=gt,e.Material=Z,e.Float64BufferAttribute=xe,e.Float32BufferAttribute=we,e.Uint32BufferAttribute=Ae,e.Int32BufferAttribute=Me,e.Uint16BufferAttribute=ye,e.Int16BufferAttribute=ve,e.Uint8ClampedBufferAttribute=ge,e.Uint8BufferAttribute=me,e.Int8BufferAttribute=fe,e.BufferAttribute=pe,e.REVISION=Sn,e.MOUSE=In,e.CullFaceNone=Cn,e.CullFaceBack=_n,e.CullFaceFront=jn,e.CullFaceFrontBack=On,e.FrontFaceDirectionCW=zn,e.FrontFaceDirectionCCW=Rn,e.BasicShadowMap=kn,e.PCFShadowMap=Un,e.PCFSoftShadowMap=Pn,e.FrontSide=Bn,e.BackSide=Fn,e.DoubleSide=Gn,e.FlatShading=Hn,e.SmoothShading=Qn,e.NoColors=Yn,e.FaceColors=Vn,e.VertexColors=Wn,e.NoBlending=Xn,e.NormalBlending=qn,e.AdditiveBlending=Zn,e.SubtractiveBlending=Jn,e.MultiplyBlending=Kn,e.CustomBlending=$n,e.BlendingMode=eo,e.AddEquation=to,e.SubtractEquation=io,e.ReverseSubtractEquation=ro,e.MinEquation=no,e.MaxEquation=oo,e.ZeroFactor=ao,e.OneFactor=so,e.SrcColorFactor=co,e.OneMinusSrcColorFactor=uo,e.SrcAlphaFactor=lo,e.OneMinusSrcAlphaFactor=ho,e.DstAlphaFactor=po,e.OneMinusDstAlphaFactor=fo,e.DstColorFactor=mo,e.OneMinusDstColorFactor=go,e.SrcAlphaSaturateFactor=vo,e.NeverDepth=yo,e.AlwaysDepth=Mo,e.LessDepth=Ao,e.LessEqualDepth=wo,e.EqualDepth=xo,e.GreaterEqualDepth=Eo,e.GreaterDepth=bo,e.NotEqualDepth=To,e.MultiplyOperation=Lo,e.MixOperation=No,e.AddOperation=Do,e.NoToneMapping=So,e.LinearToneMapping=Io,e.ReinhardToneMapping=Co,e.Uncharted2ToneMapping=_o,e.CineonToneMapping=jo,e.UVMapping=Oo,e.CubeReflectionMapping=zo,e.CubeRefractionMapping=Ro,e.EquirectangularReflectionMapping=ko,e.EquirectangularRefractionMapping=Uo,e.SphericalReflectionMapping=Po,e.CubeUVReflectionMapping=Bo,e.CubeUVRefractionMapping=Fo,e.TextureMapping=Go,e.RepeatWrapping=Ho,e.ClampToEdgeWrapping=Qo,e.MirroredRepeatWrapping=Yo,e.TextureWrapping=Vo,e.NearestFilter=Wo,e.NearestMipMapNearestFilter=Xo,e.NearestMipMapLinearFilter=qo,e.LinearFilter=Zo,e.LinearMipMapNearestFilter=Jo,e.LinearMipMapLinearFilter=Ko,e.TextureFilter=$o,e.UnsignedByteType=ea,e.ByteType=ta,e.ShortType=ia,e.UnsignedShortType=ra,e.IntType=na,e.UnsignedIntType=oa,e.FloatType=aa,e.HalfFloatType=sa,e.UnsignedShort4444Type=ca,e.UnsignedShort5551Type=ua,e.UnsignedShort565Type=la,e.UnsignedInt248Type=ha,e.AlphaFormat=da,e.RGBFormat=pa,e.RGBAFormat=fa,e.LuminanceFormat=ma,e.LuminanceAlphaFormat=ga,e.RGBEFormat=va,e.DepthFormat=ya,e.DepthStencilFormat=Ma,e.RGB_S3TC_DXT1_Format=Aa,e.RGBA_S3TC_DXT1_Format=wa,e.RGBA_S3TC_DXT3_Format=xa,e.RGBA_S3TC_DXT5_Format=Ea,e.RGB_PVRTC_4BPPV1_Format=ba,e.RGB_PVRTC_2BPPV1_Format=Ta,e.RGBA_PVRTC_4BPPV1_Format=La,e.RGBA_PVRTC_2BPPV1_Format=Na,e.RGB_ETC1_Format=Da,e.LoopOnce=Sa,e.LoopRepeat=Ia,e.LoopPingPong=Ca,e.InterpolateDiscrete=_a,e.InterpolateLinear=ja,e.InterpolateSmooth=Oa,e.ZeroCurvatureEnding=za,e.ZeroSlopeEnding=Ra,e.WrapAroundEnding=ka,e.TrianglesDrawMode=Ua,e.TriangleStripDrawMode=Pa,e.TriangleFanDrawMode=Ba,e.LinearEncoding=Fa,e.sRGBEncoding=Ga,e.GammaEncoding=Ha,e.RGBEEncoding=Qa,e.LogLuvEncoding=Ya,e.RGBM7Encoding=Va,e.RGBM16Encoding=Wa,e.RGBDEncoding=Xa,e.BasicDepthPacking=qa,e.RGBADepthPacking=Za,e.CubeGeometry=ui,e.Face4=rn,e.LineStrip=Cu,e.LinePieces=_u,e.MeshFaceMaterial=nn,e.PointCloud=on,e.Particle=an,e.ParticleSystem=sn,e.PointCloudMaterial=cn,e.ParticleBasicMaterial=un,e.ParticleSystemMaterial=ln,e.Vertex=hn,e.DynamicBufferAttribute=dn,e.Int8Attribute=pn,e.Uint8Attribute=fn,e.Uint8ClampedAttribute=mn,e.Int16Attribute=gn,e.Uint16Attribute=vn,e.Int32Attribute=yn,e.Uint32Attribute=Mn,e.Float32Attribute=An,e.Float64Attribute=wn,e.ClosedSplineCurve3=xn,e.BoundingBoxHelper=En,e.EdgesHelper=bn,e.WireframeHelper=Tn,e.XHRLoader=Ln,e.GeometryUtils=ju,e.ImageUtils=Ou,e.Projector=Nn,e.CanvasRenderer=Dn,Object.defineProperty(e,"__esModule",{value:!0})})},{}],43:[function(e,t,i){THREE.BlendCharacter=function(){this.weightSchedule=[],this.warpSchedule=[],this.load=function(e,t){var i=this,r=new THREE.ObjectLoader;r.load(e,function(r){if(r.traverse(function(e){e instanceof THREE.SkinnedMesh&&(i.skinnedMesh=e)}),THREE.SkinnedMesh.call(i,i.skinnedMesh.geometry,i.skinnedMesh.material),void 0==i.skinnedMesh)return void console.log("unable to find skinned mesh in "+e);i.material.skinning=!0,i.mixer=new THREE.AnimationMixer(i);for(var n=0;n<i.geometry.animations.length;++n)i.mixer.clipAction(i.geometry.animations[n]);void 0!==t&&t()})},this.loadJSON=function(e,t){var i=this,r=new THREE.JSONLoader;r.load(e,function(e,r){var n=r[0];n.skinning=!0,THREE.SkinnedMesh.call(i,e,n);var o=new THREE.AnimationMixer(i);i.mixer=o;for(var a=0;a<e.animations.length;++a)o.clipAction(e.animations[a]);void 0!==t&&t()})},this.update=function(e){this.mixer.update(e)},this.play=function(e,t){return this.mixer.clipAction(e).setEffectiveWeight(t).play()},this.crossfade=function(e,t,i){this.mixer.stopAllAction();var r=this.play(e,1),n=this.play(t,1);r.crossFadeTo(n,i,!1)},this.warp=function(e,t,i){this.mixer.stopAllAction();var r=this.play(e,1),n=this.play(t,1);r.crossFadeTo(n,i,!0)},this.applyWeight=function(e,t){this.mixer.clipAction(e).setEffectiveWeight(t)},this.getWeight=function(e){return this.mixer.clipAction(e).getEffectiveWeight()},this.pauseAll=function(){this.mixer.timeScale=0},this.unPauseAll=function(){this.mixer.timeScale=1},this.stopAll=function(){this.mixer.stopAllAction()},this.showModel=function(e){this.visible=e}},THREE.BlendCharacter.prototype=Object.create(THREE.SkinnedMesh.prototype),THREE.BlendCharacter.prototype.constructor=THREE.BlendCharacter,THREE.BlendCharacter.prototype.getForward=function(){var e=new THREE.Vector3;return function(){return e.set(-this.matrix.elements[8],-this.matrix.elements[9],-this.matrix.elements[10]),e}}},{}],44:[function(e,t,i){THREE.ColladaLoader=function(){function e(e,i,r,n){var o=0;if(document.implementation&&document.implementation.createDocument){var a=new XMLHttpRequest;a.onreadystatechange=function(){4===a.readyState?0===a.status||200===a.status?a.response?(Ue=i,t(a.response,void 0,e)):n?n({type:"error",url:e}):console.error("ColladaLoader: Empty or non-existing file ("+e+")"):n?n({type:"error",url:e}):console.error("ColladaLoader: Couldn't load \""+e+'" ('+a.status+")"):3===a.readyState&&r&&(0===o&&(o=a.getResponseHeader("Content-Length")),r({total:o,loaded:a.responseText.length}))},a.open("GET",e,!0),a.send(null)}else alert("Don't know how to parse XML!")}function t(e,t,i){if(Re=(new DOMParser).parseFromString(e,"text/xml"),t=t||Ue,void 0!==i){var c=i.split("/");c.pop(),je=(c.length<1?".":c.join("/"))+"/"}r(),Ae(),Be=n("library_images image",L,"image"),Qe=n("library_materials material",V,"material"),Ye=n("library_effects effect",J,"effect"),He=n("library_geometries geometry",R,"geometry"),Ve=n("library_cameras camera",re,"camera"),We=n("library_lights light",oe,"light"),Ge=n("library_controllers controller",N,"controller"),Fe=n("library_animations animation",$,"animation"),Ce=n("library_visual_scenes visual_scene",I,"visual_scene"),_e=n("library_kinematics_models kinematics_model",se,"kinematics_model"),Oe=[],ze=[],Ne=o(),ke=new THREE.Group;for(var u=0;u<Ne.nodes.length;u++)ke.add(v(Ne.nodes[u]));ke.scale.multiplyScalar(Ze),s(),De=a(),g();var l={scene:ke,morphs:Oe,skins:ze,animations:Se,kinematics:Ie,dae:{images:Be,materials:Qe,cameras:Ve,lights:We,effects:Ye,geometries:He,controllers:Ge,animations:Fe,visualScenes:Ce,visualScene:Ne,scene:Ne,kinematicsModels:_e,kinematicsModel:De}};return t&&t(l),l}function i(e){Xe=e}function r(){var e=Re.querySelectorAll("asset"),t=e[0];if(t&&t.childNodes)for(var i=0;i<t.childNodes.length;i++){var r=t.childNodes[i];switch(r.nodeName){case"unit":var n=r.getAttribute("meter");n&&(Ze=parseFloat(n));break;case"up_axis":Je=r.textContent.charAt(0)}}}function n(e,t,i){for(var r=Re.querySelectorAll(e),n={},o=0,a=r.length,s=0;s<a;s++){var c=r[s],u=(new t).parse(c);u.id&&0!==u.id.length||(u.id=i+o++),n[u.id]=u}return n}function o(){var e=Re.querySelectorAll("scene instance_visual_scene")[0];if(e){var t=e.getAttribute("url").replace(/^#/,"");return Ce[t.length>0?t:"visual_scene0"]}return null}function a(){var e=Re.querySelectorAll("instance_kinematics_model")[0];if(e){var t=e.getAttribute("url").replace(/^#/,"");return _e[t.length>0?t:"kinematics_model0"]}return null}function s(){Se=[],c(ke)}function c(e){var t=Ne.getChildById(e.colladaId,!0),i=null;if(t&&t.keys){i={fps:60,hierarchy:[{node:t,keys:t.keys,sids:t.sids}],node:e,name:"animation_"+e.name,length:0},Se.push(i);for(var r=0,n=t.keys.length;r<n;r++)i.length=Math.max(i.length,t.keys[r].time)}else i={hierarchy:[{keys:[],sids:[]}]};for(var r=0,n=e.children.length;r<n;r++)for(var o=c(e.children[r]),a=0,s=o.hierarchy.length;a<s;a++)i.hierarchy.push({keys:[],sids:[]});return i}function u(){var e,t=1e6,i=-t,r=0;for(var n in Fe){var o=Fe[n];e=e||o.id;for(var a=0;a<o.sampler.length;a++){var s=o.sampler[a];s.create(),t=Math.min(t,s.startTime),i=Math.max(i,s.endTime),r=Math.max(r,s.input.length)}}return{start:t,end:i,frames:r,ID:e}}function l(e,t){var i=t instanceof j?Ge[t.url]:t;if(!i||!i.morph)return void console.log("could not find morph controller!");for(var r=i.morph,n=0;n<r.targets.length;n++){var o=r.targets[n],a=He[o];if(a.mesh&&a.mesh.primitives&&a.mesh.primitives.length){var s=a.mesh.primitives[0].geometry;s.vertices.length===e.vertices.length&&e.morphTargets.push({name:"target_1",vertices:s.vertices})}}e.morphTargets.push({name:"target_Z",vertices:e.vertices})}function h(e,t,i,r){if(e.world=e.world||new THREE.Matrix4,e.localworld=e.localworld||new THREE.Matrix4,e.world.copy(e.matrix),e.localworld.copy(e.matrix),e.channels&&e.channels.length){var n=e.channels[0],o=n.sampler.output[i];o instanceof THREE.Matrix4&&(e.world.copy(o),e.localworld.copy(o),0===i&&e.matrix.copy(o))}r&&e.world.multiplyMatrices(r,e.world),t.push(e);for(var a=0;a<e.nodes.length;a++)h(e.nodes[a],t,i,e.world)}function d(e,t){for(var i=0;i<e.length;i++){var r=e[i],n=-1;if("JOINT"==r.type){for(var o=0;o<t.joints.length;o++)if(r.sid===t.joints[o]){n=o;break}if(n>=0){var a=t.invBindMatrices[n];r.invBindMatrix=a,r.skinningMatrix=new THREE.Matrix4,r.skinningMatrix.multiplyMatrices(r.world,a),r.animatrix=new THREE.Matrix4,r.animatrix.copy(r.localworld),r.weights=[];for(var o=0;o<t.weights.length;o++)for(var s=0;s<t.weights[o].length;s++){var c=t.weights[o][s];c.joint===n&&r.weights.push(c)}}else console.warn("ColladaLoader: Could not find joint '"+r.sid+"'."),r.skinningMatrix=new THREE.Matrix4,r.weights=[]}}}function p(e){var t=[],i=function(e,t,r){var n={};n.name=t.sid,n.parent=e,n.matrix=t.matrix;var o=[new THREE.Vector3,new THREE.Quaternion,new THREE.Vector3];n.matrix.decompose(o[0],o[1],o[2]),n.pos=[o[0].x,o[0].y,o[0].z],n.scl=[o[2].x,o[2].y,o[2].z],n.rotq=[o[1].x,o[1].y,o[1].z,o[1].w],r.push(n);for(var a in t.nodes)i(t.sid,t.nodes[a],r)};return i(-1,e,t),t}function f(e,t,i){var r=[];h(t,r,-1),d(r,i.skin);for(var n=new THREE.Vector3,o=[],a=0;a<e.vertices.length;a++)o.push(new THREE.Vector3);for(a=0;a<r.length;a++)if("JOINT"==r[a].type)for(var s=0;s<r[a].weights.length;s++){var c=r[a].weights[s],u=c.index,l=c.weight,p=e.vertices[u],f=o[u];n.x=p.x,n.y=p.y,n.z=p.z,n.applyMatrix4(r[a].skinningMatrix),f.x+=n.x*l,f.y+=n.y*l,f.z+=n.z*l}for(var a=0;a<e.vertices.length;a++)e.vertices[a]=o[a]}function m(e,t,i){var r=Ge[t.url];if(i=void 0!==i?i:40,!r||!r.skin)return void console.log("ColladaLoader: Could not find skin controller.");if(!t.skeleton||!t.skeleton.length)return void console.log("ColladaLoader: Could not find the skeleton for the skin. ");for(var n=u(),o=Ne.getChildById(t.skeleton[0],!0)||Ne.getChildBySid(t.skeleton[0],!0),a=p(o),s=r.skin.joints,c=[],l=0;l<s.length;l++)for(var m=0;m<a.length;m++)a[m].name===s[l]&&(c[l]=a[m]);for(var l=0;l<c.length;l++)for(var m=0;m<c.length;m++)c[l].parent===c[m].name&&(c[l].parent=m);var l,m,g;new THREE.Vector3;for(l=0;l<e.vertices.length;l++)e.vertices[l].applyMatrix4(r.skin.bindShapeMatrix);for(var v=[],y=[],M=r.skin.weights,l=0;l<M.length;l++){var A=new THREE.Vector4(M[l][0]?M[l][0].joint:0,M[l][1]?M[l][1].joint:0,M[l][2]?M[l][2].joint:0,M[l][3]?M[l][3].joint:0),g=new THREE.Vector4(M[l][0]?M[l][0].weight:0,M[l][1]?M[l][1].weight:0,M[l][2]?M[l][2].weight:0,M[l][3]?M[l][3].weight:0);v.push(A),y.push(g)}e.skinIndices=v,e.skinWeights=y,e.bones=c;for(var w={name:n.ID,fps:30,length:n.frames/30,hierarchy:[]},m=0;m<c.length;m++)w.hierarchy.push({parent:c[m].parent,name:c[m].name,keys:[]});for(console.log("ColladaLoader:",n.ID+" has "+c.length+" bones."),f(e,o,r),i=0;i<n.frames;i++){var x=[];h(o,x,i),d(x,r.skin);for(var l=0;l<x.length;l++)for(var m=0;m<w.hierarchy.length;m++)if(w.hierarchy[m].name===x[l].sid){var E={};E.time=i/30,E.matrix=x[l].animatrix,0===i&&(x[l].matrix=E.matrix);var b=[new THREE.Vector3,new THREE.Quaternion,new THREE.Vector3];E.matrix.decompose(b[0],b[1],b[2]),E.pos=[b[0].x,b[0].y,b[0].z],E.scl=[b[2].x,b[2].y,b[2].z],E.rot=b[1],w.hierarchy[m].keys.push(E)}e.animation=w}}function g(){if(De&&0===De.joints.length)return void(Ie=void 0);var e={},t=function(t,i){var r=i.getAttribute("id"),n=Ne.getChildById(r,!0),o=De.joints[t];ke.traverse(function(i){i.colladaId==r&&(e[t]={node:i,transforms:n.transforms,joint:o,position:o.zeroPosition})})};Ie={joints:De&&De.joints,getJointValue:function(t){var i=e[t];return i?i.position:void console.log("getJointValue: joint "+t+" doesn't exist")},setJointValue:function(t,i){var n=e[t];if(n){var o=n.joint;if(i>o.limits.max||i<o.limits.min)console.log("setJointValue: joint "+t+" value "+i+" outside of limits (min: "+o.limits.min+", max: "+o.limits.max+")");else if(o.static)console.log("setJointValue: joint "+t+" is static");else{var a=n.node,s=o.axis,c=n.transforms,u=new THREE.Matrix4;for(r=0;r<c.length;r++){var l=c[r];if(l.sid&&l.sid.indexOf("joint"+t)!==-1)switch(o.type){case"revolute":u.multiply(h.makeRotationAxis(s,THREE.Math.degToRad(i)));break;case"prismatic":u.multiply(h.makeTranslation(s.x*i,s.y*i,s.z*i));break;default:console.warn("setJointValue: unknown joint type: "+o.type)}else{var h=new THREE.Matrix4;switch(l.type){case"matrix":u.multiply(l.obj);break;case"translate":u.multiply(h.makeTranslation(l.obj.x,l.obj.y,l.obj.z));break;case"rotate":u.multiply(h.makeRotationAxis(l.obj,l.angle))}}}var d=u.elements,p=Array.prototype.slice.call(d),f=[p[0],p[4],p[8],p[12],p[1],p[5],p[9],p[13],p[2],p[6],p[10],p[14],p[3],p[7],p[11],p[15]];a.matrix.set.apply(a.matrix,f),a.matrix.decompose(a.position,a.quaternion,a.scale)}}else console.log("setJointValue: joint "+t+" doesn't exist")}};var i=Re.querySelector("scene instance_kinematics_scene");if(i)for(var r=0;r<i.childNodes.length;r++){var n=i.childNodes[r];if(1==n.nodeType)switch(n.nodeName){case"bind_joint_axis":var o=n.getAttribute("target").split("/").pop(),a=n.querySelector("axis param").textContent,s=parseInt(a.split("joint").pop().split(".")[0]),c=Re.querySelector('[sid="'+o+'"]');if(c){var u=c.parentElement;t(s,u)}}}}function v(e,t){var i,r,n,o,a=new THREE.Object3D,s=!1;for(n=0;n<e.controllers.length;n++){var c=Ge[e.controllers[n].url];switch(c.type){case"skin":if(He[c.skin.source]){var u=new z;u.url=c.skin.source,u.instance_material=e.controllers[n].instance_material,e.geometries.push(u),s=!0,i=e.controllers[n]}else if(Ge[c.skin.source]){var h=Ge[c.skin.source];if(r=h,h.morph&&He[h.morph.source]){var u=new z;u.url=h.morph.source,u.instance_material=e.controllers[n].instance_material,e.geometries.push(u)}}break;case"morph":if(He[c.morph.source]){var u=new z;u.url=c.morph.source,u.instance_material=e.controllers[n].instance_material,e.geometries.push(u),r=e.controllers[n]}console.log("ColladaLoader: Morph-controller partially supported.")}}var d={};for(n=0;n<e.geometries.length;n++){var p,f=e.geometries[n],g=f.instance_material,y=He[f.url],M={},A=[],w=0;if(y){if(!y.mesh||!y.mesh.primitives)continue;if(0===a.name.length&&(a.name=y.id),g)for(o=0;o<g.length;o++){var x=g[o],E=Qe[x.target],b=E.instance_effect.url,T=Ye[b].shader,L=T.material;if(y.doubleSided){if(!(x.symbol in d)){var N=L.clone();N.side=THREE.DoubleSide,d[x.symbol]=N}L=d[x.symbol]}L.opacity=L.opacity?L.opacity:1,M[x.symbol]=w,A.push(L),p=L,p.name=null===E.name||""===E.name?E.id:E.name,w++}var D,S=p||new THREE.MeshLambertMaterial({color:14540253,side:y.doubleSided?THREE.DoubleSide:THREE.FrontSide}),I=y.mesh.geometry3js;if(w>1)for(S=new THREE.MultiMaterial(A),o=0;o<I.faces.length;o++){var C=I.faces[o];C.materialIndex=M[C.daeMaterial]}void 0!==i?(m(I,i),I.morphTargets.length>0?(S.morphTargets=!0,S.skinning=!1):(S.morphTargets=!1,S.skinning=!0),D=new THREE.SkinnedMesh(I,S,!1),D.name="skin_"+ze.length,ze.push(D)):void 0!==r?(l(I,r),S.morphTargets=!0,D=new THREE.Mesh(I,S),D.name="morph_"+Oe.length,Oe.push(D)):D=I.isLineStrip===!0?new THREE.Line(I):new THREE.Mesh(I,S),a.add(D)}}for(n=0;n<e.cameras.length;n++){var _=e.cameras[n],j=Ve[_.url],O=new THREE.PerspectiveCamera(j.yfov,parseFloat(j.aspect_ratio),parseFloat(j.znear),parseFloat(j.zfar));a.add(O)}for(n=0;n<e.lights.length;n++){var R=null,k=e.lights[n],U=We[k.url];if(U&&U.technique){var P=U.color.getHex(),B=U.intensity,F=U.distance,G=U.falloff_angle;switch(U.technique){case"directional":R=new THREE.DirectionalLight(P,B,F),R.position.set(0,0,1);break;case"point":R=new THREE.PointLight(P,B,F);break;case"spot":R=new THREE.SpotLight(P,B,F,G),R.position.set(0,0,1);break;case"ambient":R=new THREE.AmbientLight(P)}}R&&a.add(R)}if(a.name=e.name||e.id||"",a.colladaId=e.id||"",a.layer=e.layer||"",a.matrix=e.matrix,a.matrix.decompose(a.position,a.quaternion,a.scale),qe.centerGeometry&&a.geometry){var H=a.geometry.center();H.multiply(a.scale),H.applyQuaternion(a.quaternion),a.position.sub(H)}for(n=0;n<e.nodes.length;n++)a.add(v(e.nodes[n],e));return a}function y(e){for(var t=Re.querySelectorAll("library_nodes node"),i=0;i<t.length;i++){var r=t[i].attributes.getNamedItem("id");if(r&&r.value===e)return t[i]}}function M(e){var t=[],i=1e6,r=-1e6;for(var n in Fe)for(var o=Fe[n],a=0;a<o.channel.length;a++){var s=o.channel[a],c=o.sampler[a],n=s.target.split("/")[0];n==e.id&&(c.create(),s.sampler=c,i=Math.min(i,c.startTime),r=Math.max(r,c.endTime),t.push(s))}return t.length&&(e.startTime=i,e.endTime=r),t}function A(e){if(e.channels&&e.channels.length){for(var t=[],i=[],r=0,n=e.channels.length;r<n;r++){var o,a=e.channels[r],s=a.fullSid,c=a.sampler,u=c.input,l=e.getTransformBySid(a.sid);if(a.arrIndices){o=[];for(var h=0,d=a.arrIndices.length;h<d;h++)o[h]=Te(a.arrIndices[h])}else o=Le(a.member);if(l){i.indexOf(s)===-1&&i.push(s);for(var h=0,d=u.length;h<d;h++){var p=u[h],f=c.getData(l.type,h,o),m=w(t,p);if(!m){m=new ie(p);var g=x(t,p);t.splice(g===-1?t.length:g,0,m)}m.addTarget(s,l,o,f)}}else console.log('Could not find transform "'+a.sid+'" in node '+e.id)}for(var r=0;r<i.length;r++)for(var v=i[r],h=0;h<t.length;h++){var m=t[h];m.hasTarget(v)||E(t,m,h,v)}e.keys=t,e.sids=i}}function w(e,t){for(var i=null,r=0,n=e.length;r<n&&null===i;r++){var o=e[r];if(o.time===t)i=o;else if(o.time>t)break}return i}function x(e,t){for(var i=-1,r=0,n=e.length;r<n&&i===-1;r++){var o=e[r];o.time>=t&&(i=r)}return i}function E(e,t,i,r){var n=T(e,r,i?i-1:0),o=b(e,r,i+1);if(n&&o){var a,s=(t.time-n.time)/(o.time-n.time),c=n.getTarget(r),u=o.getTarget(r).data,l=c.data;if("matrix"===c.type)a=l;else if(l.length){a=[];for(var h=0;h<l.length;++h)a[h]=l[h]+(u[h]-l[h])*s}else a=l+(u-l)*s;t.addTarget(r,c.transform,c.member,a)}}function b(e,t,i){for(;i<e.length;i++){var r=e[i];if(r.hasTarget(t))return r}return null}function T(e,t,i){for(i=i>=0?i:i+e.length;i>=0;i--){var r=e[i];if(r.hasTarget(t))return r}return null}function L(){this.id="",this.init_from=""}function N(){this.id="",this.name="",this.type="",this.skin=null,this.morph=null}function D(){this.method=null,this.source=null,this.targets=null,this.weights=null}function S(){this.source="",this.bindShapeMatrix=null,this.invBindMatrices=[],this.joints=[],this.weights=[]}function I(){this.id="",this.name="",this.nodes=[],this.scene=new THREE.Group}function C(){this.id="",this.name="",this.sid="",this.nodes=[],this.controllers=[],this.transforms=[],this.geometries=[],this.channels=[],this.matrix=new THREE.Matrix4}function _(){this.sid="",this.type="",this.data=[],this.obj=null}function j(){this.url="",this.skeleton=[],this.instance_material=[]}function O(){this.symbol="",this.target=""}function z(){this.url="",this.instance_material=[]}function R(){this.id="",this.mesh=null}function k(e){this.geometry=e.id,this.primitives=[],this.vertices=null,this.geometry3js=null}function U(){this.material="",this.count=0,this.inputs=[],this.vcount=null,this.p=[],this.geometry=new THREE.Geometry}function P(){U.call(this),this.vcount=[]}function B(){U.call(this),this.vcount=1}function F(){U.call(this),this.vcount=3}function G(){this.source="",this.count=0,this.stride=0,this.params=[]}function H(){this.input={}}function Q(){this.semantic="",this.offset=0,this.source="",this.set=0}function Y(e){this.id=e,this.type=null}function V(){this.id="",this.name="",this.instance_effect=null}function W(){this.color=new THREE.Color,this.color.setRGB(Math.random(),Math.random(),Math.random()),this.color.a=1,this.texture=null,this.texcoord=null,this.texOpts=null}function X(e,t){this.type=e,this.effect=t,this.material=null}function q(e){this.effect=e,this.init_from=null,this.format=null}function Z(e){this.effect=e,this.source=null,this.wrap_s=null,this.wrap_t=null,this.minfilter=null,this.magfilter=null,this.mipfilter=null}function J(){this.id="",this.name="",this.shader=null,this.surface={},this.sampler={}}function K(){this.url=""}function $(){this.id="",this.name="",this.source={},this.sampler=[],this.channel=[]}function ee(e){this.animation=e,this.source="",this.target="",this.fullSid=null,this.sid=null,this.dotSyntax=null,this.arrSyntax=null,this.arrIndices=null,this.member=null}function te(e){this.id="",this.animation=e,this.inputs=[],this.input=null,this.output=null,this.strideOut=null,this.interpolation=null,this.startTime=null,this.endTime=null,this.duration=0}function ie(e){this.targets=[],this.time=e}function re(){this.id="",this.name="",this.technique=""}function ne(){this.url=""}function oe(){this.id="",this.name="",this.technique=""}function ae(){this.url=""}function se(){this.id="",this.name="",this.joints=[],this.links=[]}function ce(){this.sid="",this.name="",this.axis=new THREE.Vector3,this.limits={min:0,max:0},this.type="",this.static=!1,this.zeroPosition=0,this.middlePosition=0}function ue(){this.sid="",this.name="",this.transforms=[],this.attachments=[]}function le(){this.joint="",this.transforms=[],this.links=[]}function he(e){var t=e.getAttribute("id");return void 0!=Pe[t]?Pe[t]:(Pe[t]=new Y(t).parse(e),Pe[t])}function de(e){for(var t=me(e),i=[],r=0,n=t.length;r<n;r++)i.push("true"===t[r]||"1"===t[r]);return i}function pe(e){for(var t=me(e),i=[],r=0,n=t.length;r<n;r++)i.push(parseFloat(t[r]));return i}function fe(e){for(var t=me(e),i=[],r=0,n=t.length;r<n;r++)i.push(parseInt(t[r],10));return i}function me(e){return e.length>0?ge(e).split(/\s+/):[]}function ge(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")}function ve(e,t,i){return e.hasAttribute(t)?parseInt(e.getAttribute(t),10):i}function ye(e,t){var i=new THREE.ImageLoader;i.load(t,function(t){e.image=t,e.needsUpdate=!0})}function Me(e,t){e.doubleSided=!1;var i=t.querySelectorAll("extra double_sided")[0];i&&i&&1===parseInt(i.textContent,10)&&(e.doubleSided=!0)}function Ae(){if(qe.convertUpAxis!==!0||Je===qe.upAxis)Ke=null;else switch(Je){case"X":Ke="Y"===qe.upAxis?"XtoY":"XtoZ";break;case"Y":Ke="X"===qe.upAxis?"YtoX":"YtoZ";break;case"Z":Ke="X"===qe.upAxis?"ZtoX":"ZtoY"}}function we(e,t){if(qe.convertUpAxis===!0&&Je!==qe.upAxis)switch(Ke){case"XtoY":var i=e[0];e[0]=t*e[1],e[1]=i;break;case"XtoZ":var i=e[2];e[2]=e[1],e[1]=e[0],e[0]=i;break;case"YtoX":var i=e[0];e[0]=e[1],e[1]=t*i;break;case"YtoZ":var i=e[1];e[1]=t*e[2],e[2]=i;break;case"ZtoX":var i=e[0];e[0]=e[1],e[1]=e[2],e[2]=i;break;case"ZtoY":var i=e[1];e[1]=e[2],e[2]=t*i}}function xe(e,t){if(qe.convertUpAxis!==!0||Je===qe.upAxis)return t;switch(e){case"X":t="XtoY"===Ke?t*-1:t;break;case"Y":t="YtoZ"===Ke||"YtoX"===Ke?t*-1:t;break;case"Z":t="ZtoY"===Ke?t*-1:t}return t}function Ee(e,t){var i=[e[t],e[t+1],e[t+2]];return we(i,-1),new THREE.Vector3(i[0],i[1],i[2])}function be(e){if(qe.convertUpAxis){var t=[e[0],e[4],e[8]];we(t,-1),e[0]=t[0],e[4]=t[1],e[8]=t[2],t=[e[1],e[5],e[9]],we(t,-1),e[1]=t[0],e[5]=t[1],e[9]=t[2],t=[e[2],e[6],e[10]],we(t,-1),e[2]=t[0],e[6]=t[1],e[10]=t[2],t=[e[0],e[1],e[2]],we(t,-1),e[0]=t[0],e[1]=t[1],e[2]=t[2],t=[e[4],e[5],e[6]],we(t,-1),e[4]=t[0],e[5]=t[1],e[6]=t[2],t=[e[8],e[9],e[10]],we(t,-1),e[8]=t[0],e[9]=t[1],e[10]=t[2],t=[e[3],e[7],e[11]],we(t,-1),e[3]=t[0],e[7]=t[1],e[11]=t[2]}return(new THREE.Matrix4).set(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function Te(e){if(e>-1&&e<3){var t=["X","Y","Z"],i={X:0,Y:1,Z:2};e=Le(t[e]),
  e=i[e]}return e}function Le(e){if(qe.convertUpAxis)switch(e){case"X":switch(Ke){case"XtoY":case"XtoZ":case"YtoX":e="Y";break;case"ZtoX":e="Z"}break;case"Y":switch(Ke){case"XtoY":case"YtoX":case"ZtoX":e="X";break;case"XtoZ":case"YtoZ":case"ZtoY":e="Z"}break;case"Z":switch(Ke){case"XtoZ":e="X";break;case"YtoZ":case"ZtoX":case"ZtoY":e="Y"}}return e}var Ne,De,Se,Ie,Ce,_e,je,Oe,ze,Re=null,ke=null,Ue=null,Pe={},Be={},Fe={},Ge={},He={},Qe={},Ye={},Ve={},We={},Xe=THREE.SmoothShading,qe={centerGeometry:!1,convertUpAxis:!1,subdivideFaces:!0,upAxis:"Y",defaultEnvMap:null},Ze=1,Je="Y",Ke=null;return L.prototype.parse=function(e){this.id=e.getAttribute("id");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];"init_from"===i.nodeName&&(this.init_from=i.textContent)}return this},N.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),this.type="none";for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"skin":this.skin=(new S).parse(i),this.type=i.nodeName;break;case"morph":this.morph=(new D).parse(i),this.type=i.nodeName}}return this},D.prototype.parse=function(e){var t,i={},r=[];for(this.method=e.getAttribute("method"),this.source=e.getAttribute("source").replace(/^#/,""),t=0;t<e.childNodes.length;t++){var n=e.childNodes[t];if(1==n.nodeType)switch(n.nodeName){case"source":var o=(new Y).parse(n);i[o.id]=o;break;case"targets":r=this.parseInputs(n);break;default:console.log(n.nodeName)}}for(t=0;t<r.length;t++){var a=r[t],o=i[a.source];switch(a.semantic){case"MORPH_TARGET":this.targets=o.read();break;case"MORPH_WEIGHT":this.weights=o.read()}}return this},D.prototype.parseInputs=function(e){for(var t=[],i=0;i<e.childNodes.length;i++){var r=e.childNodes[i];if(1==r.nodeType)switch(r.nodeName){case"input":t.push((new Q).parse(r))}}return t},S.prototype.parse=function(e){var t,i,r={};this.source=e.getAttribute("source").replace(/^#/,""),this.invBindMatrices=[],this.joints=[],this.weights=[];for(var n=0;n<e.childNodes.length;n++){var o=e.childNodes[n];if(1==o.nodeType)switch(o.nodeName){case"bind_shape_matrix":var a=pe(o.textContent);this.bindShapeMatrix=be(a);break;case"source":var s=(new Y).parse(o);r[s.id]=s;break;case"joints":t=o;break;case"vertex_weights":i=o;break;default:console.log(o.nodeName)}}return this.parseJoints(t,r),this.parseWeights(i,r),this},S.prototype.parseJoints=function(e,t){for(var i=0;i<e.childNodes.length;i++){var r=e.childNodes[i];if(1==r.nodeType)switch(r.nodeName){case"input":var n=(new Q).parse(r),o=t[n.source];"JOINT"===n.semantic?this.joints=o.read():"INV_BIND_MATRIX"===n.semantic&&(this.invBindMatrices=o.read())}}},S.prototype.parseWeights=function(e,t){for(var i,r,n=[],o=0;o<e.childNodes.length;o++){var a=e.childNodes[o];if(1==a.nodeType)switch(a.nodeName){case"input":n.push((new Q).parse(a));break;case"v":i=fe(a.textContent);break;case"vcount":r=fe(a.textContent)}}for(var s=0,o=0;o<r.length;o++){for(var c=r[o],u=[],l=0;l<c;l++){for(var h={},d=0;d<n.length;d++){var p=n[d],f=i[s+p.offset];switch(p.semantic){case"JOINT":h.joint=f;break;case"WEIGHT":h.weight=t[p.source].data[f]}}u.push(h),s+=n.length}for(var l=0;l<u.length;l++)u[l].index=o;this.weights.push(u)}},I.prototype.getChildById=function(e,t){for(var i=0;i<this.nodes.length;i++){var r=this.nodes[i].getChildById(e,t);if(r)return r}return null},I.prototype.getChildBySid=function(e,t){for(var i=0;i<this.nodes.length;i++){var r=this.nodes[i].getChildBySid(e,t);if(r)return r}return null},I.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),this.nodes=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"node":this.nodes.push((new C).parse(i))}}return this},C.prototype.getChannelForTransform=function(e){for(var t=0;t<this.channels.length;t++){var i,r,n=this.channels[t],o=n.target.split("/"),a=(o.shift(),o.shift()),s=a.indexOf(".")>=0,c=a.indexOf("(")>=0;if(s)o=a.split("."),a=o.shift(),r=o.shift();else if(c){i=a.split("("),a=i.shift();for(var u=0;u<i.length;u++)i[u]=parseInt(i[u].replace(/\)/,""))}if(a===e)return n.info={sid:a,dotSyntax:s,arrSyntax:c,arrIndices:i},n}return null},C.prototype.getChildById=function(e,t){if(this.id===e)return this;if(t)for(var i=0;i<this.nodes.length;i++){var r=this.nodes[i].getChildById(e,t);if(r)return r}return null},C.prototype.getChildBySid=function(e,t){if(this.sid===e)return this;if(t)for(var i=0;i<this.nodes.length;i++){var r=this.nodes[i].getChildBySid(e,t);if(r)return r}return null},C.prototype.getTransformBySid=function(e){for(var t=0;t<this.transforms.length;t++)if(this.transforms[t].sid===e)return this.transforms[t];return null},C.prototype.parse=function(e){var t;this.id=e.getAttribute("id"),this.sid=e.getAttribute("sid"),this.name=e.getAttribute("name"),this.type=e.getAttribute("type"),this.layer=e.getAttribute("layer"),this.type="JOINT"===this.type?this.type:"NODE",this.nodes=[],this.transforms=[],this.geometries=[],this.cameras=[],this.lights=[],this.controllers=[],this.matrix=new THREE.Matrix4;for(var i=0;i<e.childNodes.length;i++){var r=e.childNodes[i];if(1==r.nodeType)switch(r.nodeName){case"node":this.nodes.push((new C).parse(r));break;case"instance_camera":this.cameras.push((new ne).parse(r));break;case"instance_controller":this.controllers.push((new j).parse(r));break;case"instance_geometry":this.geometries.push((new z).parse(r));break;case"instance_light":this.lights.push((new ae).parse(r));break;case"instance_node":t=r.getAttribute("url").replace(/^#/,"");var n=y(t);n&&this.nodes.push((new C).parse(n));break;case"rotate":case"translate":case"scale":case"matrix":case"lookat":case"skew":this.transforms.push((new _).parse(r));break;case"extra":break;default:console.log(r.nodeName)}}return this.channels=M(this),A(this),this.updateMatrix(),this},C.prototype.updateMatrix=function(){this.matrix.identity();for(var e=0;e<this.transforms.length;e++)this.transforms[e].apply(this.matrix)},_.prototype.parse=function(e){return this.sid=e.getAttribute("sid"),this.type=e.nodeName,this.data=pe(e.textContent),this.convert(),this},_.prototype.convert=function(){switch(this.type){case"matrix":this.obj=be(this.data);break;case"rotate":this.angle=THREE.Math.degToRad(this.data[3]);case"translate":we(this.data,-1),this.obj=new THREE.Vector3(this.data[0],this.data[1],this.data[2]);break;case"scale":we(this.data,1),this.obj=new THREE.Vector3(this.data[0],this.data[1],this.data[2]);break;default:console.log("Can not convert Transform of type "+this.type)}},_.prototype.apply=function(){var e=new THREE.Matrix4;return function(t){switch(this.type){case"matrix":t.multiply(this.obj);break;case"translate":t.multiply(e.makeTranslation(this.obj.x,this.obj.y,this.obj.z));break;case"rotate":t.multiply(e.makeRotationAxis(this.obj,this.angle));break;case"scale":t.scale(this.obj)}}}(),_.prototype.update=function(e,t){var i=["X","Y","Z","ANGLE"];switch(this.type){case"matrix":if(t)if(1===t.length)switch(t[0]){case 0:this.obj.n11=e[0],this.obj.n21=e[1],this.obj.n31=e[2],this.obj.n41=e[3];break;case 1:this.obj.n12=e[0],this.obj.n22=e[1],this.obj.n32=e[2],this.obj.n42=e[3];break;case 2:this.obj.n13=e[0],this.obj.n23=e[1],this.obj.n33=e[2],this.obj.n43=e[3];break;case 3:this.obj.n14=e[0],this.obj.n24=e[1],this.obj.n34=e[2],this.obj.n44=e[3]}else if(2===t.length){var r="n"+(t[0]+1)+(t[1]+1);this.obj[r]=e}else console.log("Incorrect addressing of matrix in transform.");else this.obj.copy(e);break;case"translate":case"scale":switch("[object Array]"===Object.prototype.toString.call(t)&&(t=i[t[0]]),t){case"X":this.obj.x=e;break;case"Y":this.obj.y=e;break;case"Z":this.obj.z=e;break;default:this.obj.x=e[0],this.obj.y=e[1],this.obj.z=e[2]}break;case"rotate":switch("[object Array]"===Object.prototype.toString.call(t)&&(t=i[t[0]]),t){case"X":this.obj.x=e;break;case"Y":this.obj.y=e;break;case"Z":this.obj.z=e;break;case"ANGLE":this.angle=THREE.Math.degToRad(e);break;default:this.obj.x=e[0],this.obj.y=e[1],this.obj.z=e[2],this.angle=THREE.Math.degToRad(e[3])}}},j.prototype.parse=function(e){this.url=e.getAttribute("url").replace(/^#/,""),this.skeleton=[],this.instance_material=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1===i.nodeType)switch(i.nodeName){case"skeleton":this.skeleton.push(i.textContent.replace(/^#/,""));break;case"bind_material":for(var r=i.querySelectorAll("instance_material"),n=0;n<r.length;n++){var o=r[n];this.instance_material.push((new O).parse(o))}break;case"extra":}}return this},O.prototype.parse=function(e){return this.symbol=e.getAttribute("symbol"),this.target=e.getAttribute("target").replace(/^#/,""),this},z.prototype.parse=function(e){this.url=e.getAttribute("url").replace(/^#/,""),this.instance_material=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType&&"bind_material"===i.nodeName){for(var r=i.querySelectorAll("instance_material"),n=0;n<r.length;n++){var o=r[n];this.instance_material.push((new O).parse(o))}break}}return this},R.prototype.parse=function(e){this.id=e.getAttribute("id"),Me(this,e);for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"mesh":this.mesh=new k(this).parse(i);break;case"extra":}}return this},k.prototype.parse=function(e){this.primitives=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"source":he(i);break;case"vertices":this.vertices=(new H).parse(i);break;case"linestrips":this.primitives.push((new B).parse(i));break;case"triangles":this.primitives.push((new F).parse(i));break;case"polygons":this.primitives.push((new U).parse(i));break;case"polylist":this.primitives.push((new P).parse(i))}}if(this.geometry3js=new THREE.Geometry,null===this.vertices)return this;for(var r=Pe[this.vertices.input.POSITION.source].data,t=0;t<r.length;t+=3)this.geometry3js.vertices.push(Ee(r,t).clone());for(var t=0;t<this.primitives.length;t++){var n=this.primitives[t];n.setVertices(this.vertices),this.handlePrimitive(n,this.geometry3js)}return this.geometry3js.calcNormals&&(this.geometry3js.computeVertexNormals(),delete this.geometry3js.calcNormals),this},k.prototype.handlePrimitive=function(e,t){if(e instanceof B)return void(t.isLineStrip=!0);var i,r,n,o,a,s,c,u=e.p,l=e.inputs,h=0,d=3,p=0,f=[];for(i=0;i<l.length;i++){n=l[i];var m=n.offset+1;switch(p=p<m?m:p,n.semantic){case"TEXCOORD":f.push(n.set)}}for(var g=0;g<u.length;++g)for(var v=u[g],y=0;y<v.length;){var M=[],A=[],w=null,x=[];for(d=e.vcount?e.vcount.length?e.vcount[h++]:e.vcount:v.length/p,i=0;i<d;i++)for(r=0;r<l.length;r++)switch(n=l[r],s=Pe[n.source],o=v[y+i*p+n.offset],c=s.accessor.params.length,a=o*c,n.semantic){case"VERTEX":M.push(o);break;case"NORMAL":A.push(Ee(s.data,a));break;case"TEXCOORD":w=w||{},void 0===w[n.set]&&(w[n.set]=[]),w[n.set].push(new THREE.Vector2(s.data[a],s.data[a+1]));break;case"COLOR":x.push((new THREE.Color).setRGB(s.data[a],s.data[a+1],s.data[a+2]))}if(0===A.length)if(n=this.vertices.input.NORMAL){s=Pe[n.source],c=s.accessor.params.length;for(var E=0,b=M.length;E<b;E++)A.push(Ee(s.data,M[E]*c))}else t.calcNormals=!0;if(!w&&(w={},n=this.vertices.input.TEXCOORD)){f.push(n.set),s=Pe[n.source],c=s.accessor.params.length;for(var E=0,b=M.length;E<b;E++)a=M[E]*c,void 0===w[n.set]&&(w[n.set]=[]),w[n.set].push(new THREE.Vector2(s.data[a],1-s.data[a+1]))}if(0===x.length&&(n=this.vertices.input.COLOR)){s=Pe[n.source],c=s.accessor.params.length;for(var E=0,b=M.length;E<b;E++)a=M[E]*c,x.push((new THREE.Color).setRGB(s.data[a],s.data[a+1],s.data[a+2]))}var T,L,N=null,D=[];if(3===d)D.push(new THREE.Face3(M[0],M[1],M[2],A,x.length?x:new THREE.Color));else if(4===d)D.push(new THREE.Face3(M[0],M[1],M[3],A.length?[A[0].clone(),A[1].clone(),A[3].clone()]:[],x.length?[x[0],x[1],x[3]]:new THREE.Color)),D.push(new THREE.Face3(M[1],M[2],M[3],A.length?[A[1].clone(),A[2].clone(),A[3].clone()]:[],x.length?[x[1],x[2],x[3]]:new THREE.Color));else if(d>4&&qe.subdivideFaces){var S=x.length?x:new THREE.Color;for(r=1;r<d-1;)D.push(new THREE.Face3(M[0],M[r],M[r+1],A.length?[A[0].clone(),A[r++].clone(),A[r].clone()]:[],S))}if(D.length)for(var E=0,b=D.length;E<b;E++)for(N=D[E],N.daeMaterial=e.material,t.faces.push(N),r=0;r<f.length;r++)T=w[f[r]],L=d>4?[T[0],T[E+1],T[E+2]]:4===d?0===E?[T[0],T[1],T[3]]:[T[1].clone(),T[2],T[3].clone()]:[T[0],T[1],T[2]],void 0===t.faceVertexUvs[r]&&(t.faceVertexUvs[r]=[]),t.faceVertexUvs[r].push(L);else console.log("dropped face with vcount "+d+" for geometry with id: "+t.id);y+=p*d}},U.prototype.setVertices=function(e){for(var t=0;t<this.inputs.length;t++)this.inputs[t].source===e.id&&(this.inputs[t].source=e.input.POSITION.source)},U.prototype.parse=function(e){this.material=e.getAttribute("material"),this.count=ve(e,"count",0);for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"input":this.inputs.push((new Q).parse(e.childNodes[t]));break;case"vcount":this.vcount=fe(i.textContent);break;case"p":this.p.push(fe(i.textContent));break;case"ph":console.warn("polygon holes not yet supported!")}}return this},P.prototype=Object.create(U.prototype),P.prototype.constructor=P,B.prototype=Object.create(U.prototype),B.prototype.constructor=B,F.prototype=Object.create(U.prototype),F.prototype.constructor=F,G.prototype.parse=function(e){this.params=[],this.source=e.getAttribute("source"),this.count=ve(e,"count",0),this.stride=ve(e,"stride",0);for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if("param"===i.nodeName){var r={};r.name=i.getAttribute("name"),r.type=i.getAttribute("type"),this.params.push(r)}}return this},H.prototype.parse=function(e){this.id=e.getAttribute("id");for(var t=0;t<e.childNodes.length;t++)if("input"===e.childNodes[t].nodeName){var i=(new Q).parse(e.childNodes[t]);this.input[i.semantic]=i}return this},Q.prototype.parse=function(e){return this.semantic=e.getAttribute("semantic"),this.source=e.getAttribute("source").replace(/^#/,""),this.set=ve(e,"set",-1),this.offset=ve(e,"offset",0),"TEXCOORD"===this.semantic&&this.set<0&&(this.set=0),this},Y.prototype.parse=function(e){this.id=e.getAttribute("id");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"bool_array":this.data=de(i.textContent),this.type=i.nodeName;break;case"float_array":this.data=pe(i.textContent),this.type=i.nodeName;break;case"int_array":this.data=fe(i.textContent),this.type=i.nodeName;break;case"IDREF_array":case"Name_array":this.data=me(i.textContent),this.type=i.nodeName;break;case"technique_common":for(var r=0;r<i.childNodes.length;r++)if("accessor"===i.childNodes[r].nodeName){this.accessor=(new G).parse(i.childNodes[r]);break}}}return this},Y.prototype.read=function(){var e=[],t=this.accessor.params[0];switch(t.type){case"IDREF":case"Name":case"name":case"float":return this.data;case"float4x4":for(var i=0;i<this.data.length;i+=16){var r=this.data.slice(i,i+16),n=be(r);e.push(n)}break;default:console.log("ColladaLoader: Source: Read dont know how to read "+t.type+".")}return e},V.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name");for(var t=0;t<e.childNodes.length;t++)if("instance_effect"===e.childNodes[t].nodeName){this.instance_effect=(new K).parse(e.childNodes[t]);break}return this},W.prototype.isColor=function(){return null===this.texture},W.prototype.isTexture=function(){return null!=this.texture},W.prototype.parse=function(e){"transparent"===e.nodeName&&(this.opaque=e.getAttribute("opaque"));for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"color":var r=pe(i.textContent);this.color=new THREE.Color,this.color.setRGB(r[0],r[1],r[2]),this.color.a=r[3];break;case"texture":this.texture=i.getAttribute("texture"),this.texcoord=i.getAttribute("texcoord"),this.texOpts={offsetU:0,offsetV:0,repeatU:1,repeatV:1,wrapU:1,wrapV:1},this.parseTexture(i)}}return this},W.prototype.parseTexture=function(e){if(!e.childNodes)return this;e.childNodes[1]&&"extra"===e.childNodes[1].nodeName&&(e=e.childNodes[1],e.childNodes[1]&&"technique"===e.childNodes[1].nodeName&&(e=e.childNodes[1]));for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"offsetU":case"offsetV":case"repeatU":case"repeatV":this.texOpts[i.nodeName]=parseFloat(i.textContent);break;case"wrapU":case"wrapV":"TRUE"===i.textContent.toUpperCase()?this.texOpts[i.nodeName]=1:this.texOpts[i.nodeName]=parseInt(i.textContent);break;default:this.texOpts[i.nodeName]=i.textContent}}return this},X.prototype.parse=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"emission":case"diffuse":case"specular":case"transparent":this[i.nodeName]=(new W).parse(i);break;case"bump":var r=i.getAttribute("bumptype");r?"heightfield"===r.toLowerCase()?this.bump=(new W).parse(i):"normalmap"===r.toLowerCase()?this.normal=(new W).parse(i):(console.error("Shader.prototype.parse: Invalid value for attribute 'bumptype' ("+r+") - valid bumptypes are 'HEIGHTFIELD' and 'NORMALMAP' - defaulting to 'HEIGHTFIELD'"),this.bump=(new W).parse(i)):(console.warn("Shader.prototype.parse: Attribute 'bumptype' missing from bump node - defaulting to 'HEIGHTFIELD'"),this.bump=(new W).parse(i));break;case"shininess":case"reflectivity":case"index_of_refraction":case"transparency":var n=i.querySelectorAll("float");n.length>0&&(this[i.nodeName]=parseFloat(n[0].textContent))}}return this.create(),this},X.prototype.create=function(){var e={},t=!1;if(void 0!==this.transparency&&void 0!==this.transparent){var i=(this.transparent,(this.transparent.color.r+this.transparent.color.g+this.transparent.color.b)/3*this.transparency);i>0&&(t=!0,e.transparent=!0,e.opacity=1-i)}var r={diffuse:"map",ambient:"lightMap",specular:"specularMap",emission:"emissionMap",bump:"bumpMap",normal:"normalMap"};for(var n in this)switch(n){case"ambient":case"emission":case"diffuse":case"specular":case"bump":case"normal":var o=this[n];if(o instanceof W)if(o.isTexture()){var a=o.texture,s=this.effect.sampler[a];if(void 0!==s&&void 0!==s.source){var c=this.effect.surface[s.source];if(void 0!==c){var u=Be[c.init_from];if(u){var l,h=je+u.init_from,d=THREE.Loader.Handlers.get(h);null!==d?l=d.load(h):(l=new THREE.Texture,ye(l,h)),l.wrapS=o.texOpts.wrapU?THREE.RepeatWrapping:THREE.ClampToEdgeWrapping,l.wrapT=o.texOpts.wrapV?THREE.RepeatWrapping:THREE.ClampToEdgeWrapping,l.offset.x=o.texOpts.offsetU,l.offset.y=o.texOpts.offsetV,l.repeat.x=o.texOpts.repeatU,l.repeat.y=o.texOpts.repeatV,e[r[n]]=l,"emission"===n&&(e.emissive=16777215)}}}}else"diffuse"!==n&&t||("emission"===n?e.emissive=o.color.getHex():e[n]=o.color.getHex());break;case"shininess":e[n]=this[n];break;case"reflectivity":e[n]=this[n],e[n]>0&&(e.envMap=qe.defaultEnvMap),e.combine=THREE.MixOperation;break;case"index_of_refraction":e.refractionRatio=this[n],1!==this[n]&&(e.envMap=qe.defaultEnvMap);break;case"transparency":}switch(e.shading=Xe,e.side=this.effect.doubleSided?THREE.DoubleSide:THREE.FrontSide,void 0!==e.diffuse&&(e.color=e.diffuse,delete e.diffuse),this.type){case"constant":void 0!=e.emissive&&(e.color=e.emissive),this.material=new THREE.MeshBasicMaterial(e);break;case"phong":case"blinn":this.material=new THREE.MeshPhongMaterial(e);break;case"lambert":default:this.material=new THREE.MeshLambertMaterial(e)}return this.material},q.prototype.parse=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"init_from":this.init_from=i.textContent;break;case"format":this.format=i.textContent;break;default:console.log("unhandled Surface prop: "+i.nodeName)}}return this},Z.prototype.parse=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"source":this.source=i.textContent;break;case"minfilter":this.minfilter=i.textContent;break;case"magfilter":this.magfilter=i.textContent;break;case"mipfilter":this.mipfilter=i.textContent;break;case"wrap_s":this.wrap_s=i.textContent;break;case"wrap_t":this.wrap_t=i.textContent;break;default:console.log("unhandled Sampler2D prop: "+i.nodeName)}}return this},J.prototype.create=function(){if(null===this.shader)return null},J.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),Me(this,e),this.shader=null;for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"profile_COMMON":this.parseTechnique(this.parseProfileCOMMON(i))}}return this},J.prototype.parseNewparam=function(e){for(var t=e.getAttribute("sid"),i=0;i<e.childNodes.length;i++){var r=e.childNodes[i];if(1==r.nodeType)switch(r.nodeName){case"surface":this.surface[t]=new q(this).parse(r);break;case"sampler2D":this.sampler[t]=new Z(this).parse(r);break;case"extra":break;default:console.log(r.nodeName)}}},J.prototype.parseProfileCOMMON=function(e){for(var t,i=0;i<e.childNodes.length;i++){var r=e.childNodes[i];if(1==r.nodeType)switch(r.nodeName){case"profile_COMMON":this.parseProfileCOMMON(r);break;case"technique":t=r;break;case"newparam":this.parseNewparam(r);break;case"image":var n=(new L).parse(r);Be[n.id]=n;break;case"extra":break;default:console.log(r.nodeName)}}return t},J.prototype.parseTechnique=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"constant":case"lambert":case"blinn":case"phong":this.shader=new X(i.nodeName,this).parse(i);break;case"extra":this.parseExtra(i)}}},J.prototype.parseExtra=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"technique":this.parseExtraTechnique(i)}}},J.prototype.parseExtraTechnique=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"bump":this.shader.parse(e)}}},K.prototype.parse=function(e){return this.url=e.getAttribute("url").replace(/^#/,""),this},$.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),this.source={};for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"animation":var r=(new $).parse(i);for(var n in r.source)this.source[n]=r.source[n];for(var o=0;o<r.channel.length;o++)this.channel.push(r.channel[o]),this.sampler.push(r.sampler[o]);break;case"source":var n=(new Y).parse(i);this.source[n.id]=n;break;case"sampler":this.sampler.push(new te(this).parse(i));break;case"channel":this.channel.push(new ee(this).parse(i))}}return this},ee.prototype.parse=function(e){this.source=e.getAttribute("source").replace(/^#/,""),this.target=e.getAttribute("target");var t=this.target.split("/"),i=(t.shift(),t.shift()),r=i.indexOf(".")>=0,n=i.indexOf("(")>=0;if(r)t=i.split("."),this.sid=t.shift(),this.member=t.shift();else if(n){var o=i.split("(");this.sid=o.shift();for(var a=0;a<o.length;a++)o[a]=parseInt(o[a].replace(/\)/,""));this.arrIndices=o}else this.sid=i;return this.fullSid=i,this.dotSyntax=r,this.arrSyntax=n,this},te.prototype.parse=function(e){this.id=e.getAttribute("id"),this.inputs=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"input":this.inputs.push((new Q).parse(i))}}return this},te.prototype.create=function(){for(var e=0;e<this.inputs.length;e++){var t=this.inputs[e],i=this.animation.source[t.source];switch(t.semantic){case"INPUT":this.input=i.read();break;case"OUTPUT":this.output=i.read(),this.strideOut=i.accessor.stride;break;case"INTERPOLATION":this.interpolation=i.read();break;case"IN_TANGENT":break;case"OUT_TANGENT":break;default:console.log(t.semantic)}}if(this.startTime=0,this.endTime=0,this.duration=0,this.input.length){this.startTime=1e8,this.endTime=-1e8;for(var e=0;e<this.input.length;e++)this.startTime=Math.min(this.startTime,this.input[e]),this.endTime=Math.max(this.endTime,this.input[e]);this.duration=this.endTime-this.startTime}},te.prototype.getData=function(e,t,i){var r;if("matrix"===e&&16===this.strideOut)r=this.output[t];else if(this.strideOut>1){r=[],t*=this.strideOut;for(var n=0;n<this.strideOut;++n)r[n]=this.output[t+n];if(3===this.strideOut)switch(e){case"rotate":case"translate":we(r,-1);break;case"scale":we(r,1)}else 4===this.strideOut&&"matrix"===e&&we(r,-1)}else r=this.output[t],i&&"translate"===e&&(r=xe(i,r));return r},ie.prototype.addTarget=function(e,t,i,r){this.targets.push({sid:e,member:i,transform:t,data:r})},ie.prototype.apply=function(e){for(var t=0;t<this.targets.length;++t){var i=this.targets[t];e&&i.sid!==e||i.transform.update(i.data,i.member)}},ie.prototype.getTarget=function(e){for(var t=0;t<this.targets.length;++t)if(this.targets[t].sid===e)return this.targets[t];return null},ie.prototype.hasTarget=function(e){for(var t=0;t<this.targets.length;++t)if(this.targets[t].sid===e)return!0;return!1},ie.prototype.interpolate=function(e,t){for(var i=0,r=this.targets.length;i<r;i++){var n,o=this.targets[i],a=e.getTarget(o.sid);if("matrix"!==o.transform.type&&a){var s=(t-this.time)/(e.time-this.time),c=a.data,u=o.data;if(s<0&&(s=0),s>1&&(s=1),u.length){n=[];for(var l=0;l<u.length;++l)n[l]=u[l]+(c[l]-u[l])*s}else n=u+(c-u)*s}else n=o.data;o.transform.update(n,o.member)}},re.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"optics":this.parseOptics(i)}}return this},re.prototype.parseOptics=function(e){for(var t=0;t<e.childNodes.length;t++)if("technique_common"===e.childNodes[t].nodeName)for(var i=e.childNodes[t],r=0;r<i.childNodes.length;r++)if(this.technique=i.childNodes[r].nodeName,"perspective"===this.technique)for(var n=i.childNodes[r],o=0;o<n.childNodes.length;o++){var a=n.childNodes[o];switch(a.nodeName){case"yfov":this.yfov=a.textContent;break;case"xfov":this.xfov=a.textContent;break;case"znear":this.znear=a.textContent;break;case"zfar":this.zfar=a.textContent;break;case"aspect_ratio":this.aspect_ratio=a.textContent}}else if("orthographic"===this.technique)for(var s=i.childNodes[r],o=0;o<s.childNodes.length;o++){var a=s.childNodes[o];switch(a.nodeName){case"xmag":this.xmag=a.textContent;break;case"ymag":this.ymag=a.textContent;break;case"znear":this.znear=a.textContent;break;case"zfar":this.zfar=a.textContent;break;case"aspect_ratio":this.aspect_ratio=a.textContent}}return this},ne.prototype.parse=function(e){return this.url=e.getAttribute("url").replace(/^#/,""),this},oe.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"technique_common":this.parseCommon(i);break;case"technique":this.parseTechnique(i)}}return this},oe.prototype.parseCommon=function(e){for(var t=0;t<e.childNodes.length;t++)switch(e.childNodes[t].nodeName){case"directional":case"point":case"spot":case"ambient":this.technique=e.childNodes[t].nodeName;for(var i=e.childNodes[t],r=0;r<i.childNodes.length;r++){var n=i.childNodes[r];switch(n.nodeName){case"color":var o=pe(n.textContent);this.color=new THREE.Color(0),this.color.setRGB(o[0],o[1],o[2]),this.color.a=o[3];break;case"falloff_angle":this.falloff_angle=parseFloat(n.textContent);break;case"quadratic_attenuation":var a=parseFloat(n.textContent);this.distance=a?Math.sqrt(1/a):0}}}return this},oe.prototype.parseTechnique=function(e){this.profile=e.getAttribute("profile");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"intensity":this.intensity=parseFloat(i.textContent)}}return this},ae.prototype.parse=function(e){return this.url=e.getAttribute("url").replace(/^#/,""),this},se.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),this.joints=[],this.links=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"technique_common":this.parseCommon(i)}}return this},se.prototype.parseCommon=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(e.childNodes[t].nodeName){case"joint":this.joints.push((new ce).parse(i));break;case"link":this.links.push((new ue).parse(i))}}return this},ce.prototype.parse=function(e){this.sid=e.getAttribute("sid"),this.name=e.getAttribute("name"),this.axis=new THREE.Vector3,this.limits={min:0,max:0},this.type="",this.static=!1,this.zeroPosition=0,this.middlePosition=0;var t=e.querySelector("axis"),i=pe(t.textContent);this.axis=Ee(i,0);var r=e.querySelector("limits min")?parseFloat(e.querySelector("limits min").textContent):-360,n=e.querySelector("limits max")?parseFloat(e.querySelector("limits max").textContent):360;this.limits={min:r,max:n};for(var o=["prismatic","revolute"],a=0;a<o.length;a++){var s=o[a],c=e.querySelector(s);c&&(this.type=s)}return this.limits.min>=this.limits.max&&(this.static=!0),this.middlePosition=(this.limits.min+this.limits.max)/2,this},ue.prototype.parse=function(e){this.sid=e.getAttribute("sid"),this.name=e.getAttribute("name"),this.transforms=[],this.attachments=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"attachment_full":this.attachments.push((new le).parse(i));break;case"rotate":case"translate":case"matrix":this.transforms.push((new _).parse(i))}}return this},le.prototype.parse=function(e){this.joint=e.getAttribute("joint").split("/").pop(),this.links=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"link":this.links.push((new ue).parse(i));break;case"rotate":case"translate":case"matrix":this.transforms.push((new _).parse(i))}}return this},{load:e,parse:t,setPreferredShading:i,applySkin:m,geometries:He,options:qe}}},{}],45:[function(e,t,i){THREE.GLTFLoader=function(){function e(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager}function t(){var e={};return{get:function(t){return e[t]},add:function(t,i){e[t]=i},remove:function(t){delete e[t]},removeAll:function(){e={}},update:function(t,i){for(var r in e){var n=e[r];n.update&&n.update(t,i)}}}}function i(e,t){var i={},r=e.material.uniforms;for(var n in r){var o=r[n];if(o.semantic){var a=o.node,s=e;a&&(s=t[a]),i[n]={semantic:o.semantic,sourceNode:s,targetNode:e,uniform:o}}}this.boundUniforms=i,this._m4=new THREE.Matrix4}function r(e,t){for(var i=[],r=0,n=t.length;r<n;r++){var o=t[r];o.times=THREE.AnimationUtils.arraySlice(o.times,0),o.values=THREE.AnimationUtils.arraySlice(o.values,0),o.target.updateMatrix(),o.target.matrixAutoUpdate=!0,i.push(new THREE.KeyframeTrack(o.name,o.times,o.values,o.type))}return new THREE.AnimationClip(e,void 0,i)}function n(e,t,i){if(!e)return Promise.resolve();var r,n=[];if("[object Array]"===Object.prototype.toString.call(e)){r=[];for(var o=e.length,a=0;a<o;a++){var s=t.call(i||this,e[a],a);s&&(n.push(s),s instanceof Promise?s.then(function(e,t){r[a]=t}.bind(this,c)):r[a]=s)}}else{r={};for(var c in e)if(e.hasOwnProperty(c)){var s=t.call(i||this,e[c],c);s&&(n.push(s),s instanceof Promise?s.then(function(e,t){r[e]=t}.bind(this,c)):r[c]=s)}}return Promise.all(n).then(function(){return r})}function o(e,t){return"string"!=typeof e||""===e?"":/^https?:\/\//i.test(e)?e:/^data:.*,.*$/i.test(e)?e:(t||"")+e}function a(e,t){var i={};for(var r in t.attributes){var n=t.attributes[r],o=t.parameters[n],a=o.type,s=o.semantic;i[r]={type:a,semantic:s}}var c=t.parameters,u=t.attributes,l={};for(var r in i){var n=u[r],h=c[n],s=h.semantic;s&&(l[r]=h)}for(var n in l){var o=l[n],s=o.semantic,d=new RegExp("\\b"+n+"\\b","g");switch(s){case"POSITION":e=e.replace(d,"position");break;case"NORMAL":e=e.replace(d,"normal");break;case"TEXCOORD_0":case"TEXCOORD0":case"TEXCOORD":e=e.replace(d,"uv");break;case"WEIGHT":e=e.replace(d,"skinWeight");break;case"JOINT":e=e.replace(d,"skinIndex")}}return e}function s(e){this.isDeferredShaderMaterial=!0,this.params=e}function c(e,i){this.json=e||{},this.options=i||{},this.cache=new t}e.prototype={constructor:e,load:function(e,t,i,r){var n=this,o=this.path&&"string"==typeof this.path?this.path:THREE.Loader.prototype.extractUrlBase(e),a=new THREE.FileLoader(n.manager);
  a.load(e,function(e){n.parse(JSON.parse(e),t,o)},i,r)},setCrossOrigin:function(e){this.crossOrigin=e},setPath:function(e){this.path=e},parse:function(e,t,i){console.time("GLTFLoader");var r=new c(e,{path:i||this.path,crossOrigin:!!this.crossOrigin});r.parse(function(e,i,r){console.timeEnd("GLTFLoader");var n={scene:e,cameras:i,animations:r};t(n)})}},e.Shaders=new t,i.prototype.update=function(e,t){e.updateMatrixWorld(),t.updateMatrixWorld(),t.matrixWorldInverse.getInverse(t.matrixWorld);var i=this.boundUniforms;for(var r in i){var n=i[r];switch(n.semantic){case"MODELVIEW":var o=n.uniform.value;o.multiplyMatrices(t.matrixWorldInverse,n.sourceNode.matrixWorld);break;case"MODELVIEWINVERSETRANSPOSE":var a=n.uniform.value;this._m4.multiplyMatrices(t.matrixWorldInverse,n.sourceNode.matrixWorld),a.getNormalMatrix(this._m4);break;case"PROJECTION":var o=n.uniform.value;o.copy(t.projectionMatrix);break;case"JOINTMATRIX":for(var s=n.uniform.value,c=0;c<s.length;c++)s[c].getInverse(n.sourceNode.matrixWorld).multiply(n.targetNode.skeleton.bones[c].matrixWorld).multiply(n.targetNode.skeleton.boneInverses[c]).multiply(n.targetNode.bindMatrix);break;default:console.warn("Unhandled shader semantic: "+n.semantic)}}},e.Animations={update:function(){console.warn("THREE.GLTFLoader.Animation has been deprecated. Use THREE.AnimationMixer instead.")}};var u={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,TRIANGLES:4,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,VERTEX_SHADER:35633,FRAGMENT_SHADER:35632},l={5126:Number,35675:THREE.Matrix3,35676:THREE.Matrix4,35664:THREE.Vector2,35665:THREE.Vector3,35666:THREE.Vector4,35678:THREE.Texture},h={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},d={9728:THREE.NearestFilter,9729:THREE.LinearFilter,9984:THREE.NearestMipMapNearestFilter,9985:THREE.LinearMipMapNearestFilter,9986:THREE.NearestMipMapLinearFilter,9987:THREE.LinearMipMapLinearFilter},p={33071:THREE.ClampToEdgeWrapping,33648:THREE.MirroredRepeatWrapping,10497:THREE.RepeatWrapping},f={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},m={scale:"scale",translation:"position",rotation:"quaternion"},g={LINEAR:THREE.InterpolateLinear,STEP:THREE.InterpolateDiscrete};return s.prototype.create=function(){var e=THREE.UniformsUtils.clone(this.params.uniforms);for(var t in this.params.uniforms){var i=this.params.uniforms[t];i.value instanceof THREE.Texture&&(e[t].value=i.value,e[t].value.needsUpdate=!0),e[t].semantic=i.semantic,e[t].node=i.node}return this.params.uniforms=e,new THREE.RawShaderMaterial(this.params)},c.prototype._withDependencies=function(e){for(var t={},i=0;i<e.length;i++){var r=e[i],o="load"+r.charAt(0).toUpperCase()+r.slice(1),a=this.cache.get(r);if(void 0!==a)t[r]=a;else if(this[o]){var s=this[o]();this.cache.add(r,s),t[r]=s}}return n(t,function(e){return e})},c.prototype.parse=function(e){var t=this.json;this.cache.removeAll(),this._withDependencies(["scenes","cameras","animations"]).then(function(i){var r=i.scenes[t.scene],n=[];for(var o in i.cameras){var a=i.cameras[o];n.push(a)}var s=[];for(var o in i.animations)s.push(i.animations[o]);e(r,n,s)})},c.prototype.loadShaders=function(){var e=this.json,t=this.options;return n(e.shaders,function(e){return new Promise(function(i){var r=new THREE.FileLoader;r.responseType="text",r.load(o(e.uri,t.path),function(e){i(e)})})})},c.prototype.loadBuffers=function(){var e=this.json,t=this.options;return n(e.buffers,function(e){if("arraybuffer"===e.type)return new Promise(function(i){var r=new THREE.FileLoader;r.responseType="arraybuffer",r.load(o(e.uri,t.path),function(e){i(e)})})})},c.prototype.loadBufferViews=function(){var e=this.json;return this._withDependencies(["buffers"]).then(function(t){return n(e.bufferViews,function(e){var i=t.buffers[e.buffer];return i.slice(e.byteOffset,e.byteOffset+e.byteLength)})})},c.prototype.loadAccessors=function(){var e=this.json;return this._withDependencies(["bufferViews"]).then(function(t){return n(e.accessors,function(e){var i=t.bufferViews[e.bufferView],r=f[e.type],n=h[e.componentType],o=n.BYTES_PER_ELEMENT,a=o*r;if(e.byteStride&&e.byteStride!==a){var s=new n(i),c=new THREE.InterleavedBuffer(s,e.byteStride/o);return new THREE.InterleavedBufferAttribute(c,r,e.byteOffset/o)}return s=new n(i,e.byteOffset,e.count*r),new THREE.BufferAttribute(s,r)})})},c.prototype.loadTextures=function(){var e=this.json,t=this.options;return n(e.textures,function(i){if(i.source)return new Promise(function(r){var n=e.images[i.source],a=THREE.Loader.Handlers.get(n.uri);null===a&&(a=new THREE.TextureLoader),a.crossOrigin=t.crossOrigin||!1,a.load(o(n.uri,t.path),function(t){if(t.flipY=!1,i.sampler){var n=e.samplers[i.sampler];t.magFilter=d[n.magFilter],t.minFilter=d[n.minFilter],t.wrapS=p[n.wrapS],t.wrapT=p[n.wrapT]}r(t)},void 0,function(){r()})})})},c.prototype.loadMaterials=function(){var e=this.json;return this._withDependencies(["shaders","textures"]).then(function(t){return n(e.materials,function(i){var r,n,o={},c={};if(i.extensions&&i.extensions.KHR_materials_common?n=i.extensions.KHR_materials_common:e.extensions&&e.extensions.KHR_materials_common&&(n=e.extensions.KHR_materials_common),n){switch(n.technique){case"BLINN":case"PHONG":r=THREE.MeshPhongMaterial;break;case"LAMBERT":r=THREE.MeshLambertMaterial;break;case"CONSTANT":default:r=THREE.MeshBasicMaterial}Object.assign(o,n.values),(n.doubleSided||o.doubleSided)&&(c.side=THREE.DoubleSide),(n.transparent||o.transparent)&&(c.transparent=!0,c.opacity=void 0!==o.transparency?o.transparency:1)}else if(void 0===i.technique)r=THREE.MeshPhongMaterial,Object.assign(o,i.values);else{r=s;var h=e.techniques[i.technique];c.uniforms={};var d=e.programs[h.program];if(d){c.fragmentShader=t.shaders[d.fragmentShader],c.fragmentShader||(console.warn("ERROR: Missing fragment shader definition:",d.fragmentShader),r=THREE.MeshPhongMaterial);var p=t.shaders[d.vertexShader];p||(console.warn("ERROR: Missing vertex shader definition:",d.vertexShader),r=THREE.MeshPhongMaterial),c.vertexShader=a(p,h);var f=h.uniforms;for(var m in f){var g=f[m],v=h.parameters[g],y=v.type;if(!l[y])throw new Error("Unknown shader uniform param type: "+y);var M=v.count,A=i.values[g],w=new l[y],x=v.semantic,E=v.node;switch(y){case u.FLOAT:w=v.value,"transparency"==g&&(c.transparent=!0),void 0!==A&&(w=A);break;case u.FLOAT_VEC2:case u.FLOAT_VEC3:case u.FLOAT_VEC4:case u.FLOAT_MAT3:v&&v.value&&w.fromArray(v.value),A&&w.fromArray(A);break;case u.FLOAT_MAT2:console.warn("FLOAT_MAT2 is not a supported uniform type");break;case u.FLOAT_MAT4:if(M){w=new Array(M);for(var b=0;b<M;b++)w[b]=new l[y];if(v&&v.value){var T=v.value;w.fromArray(T)}A&&w.fromArray(A)}else{if(v&&v.value){var L=v.value;w.fromArray(L)}A&&w.fromArray(A)}break;case u.SAMPLER_2D:w=A?t.textures[A]:null}c.uniforms[m]={value:w,semantic:x,node:E}}}}Array.isArray(o.diffuse)?c.color=(new THREE.Color).fromArray(o.diffuse):"string"==typeof o.diffuse&&(c.map=t.textures[o.diffuse]),delete c.diffuse,"string"==typeof o.reflective&&(c.envMap=t.textures[o.reflective]),"string"==typeof o.bump&&(c.bumpMap=t.textures[o.bump]),Array.isArray(o.emission)?r===THREE.MeshBasicMaterial?c.color=(new THREE.Color).fromArray(o.emission):c.emissive=(new THREE.Color).fromArray(o.emission):"string"==typeof o.emission&&(r===THREE.MeshBasicMaterial?c.map=t.textures[o.emission]:c.emissiveMap=t.textures[o.emission]),Array.isArray(o.specular)?c.specular=(new THREE.Color).fromArray(o.specular):"string"==typeof o.specular&&(c.specularMap=t.textures[o.specular]),void 0!==o.shininess&&(c.shininess=o.shininess);var N=new r(c);return N.name=i.name,N})})},c.prototype.loadMeshes=function(){var e=this.json;return this._withDependencies(["accessors","materials"]).then(function(t){return n(e.meshes,function(e){var i=new THREE.Object3D;i.name=e.name;var r=e.primitives;for(var n in r){var o=r[n];if(o.mode===u.TRIANGLES||void 0===o.mode){var a=new THREE.BufferGeometry,s=o.attributes;for(var c in s){var l=s[c];if(!l)return;var h=t.accessors[l];switch(c){case"POSITION":a.addAttribute("position",h);break;case"NORMAL":a.addAttribute("normal",h);break;case"TEXCOORD_0":case"TEXCOORD0":case"TEXCOORD":a.addAttribute("uv",h);break;case"WEIGHT":a.addAttribute("skinWeight",h);break;case"JOINT":a.addAttribute("skinIndex",h)}}if(o.indices){var d=t.accessors[o.indices];a.setIndex(d);var p={start:0,index:0,count:d.count};a.groups.push(p),a.computeBoundingSphere()}var f=t.materials[o.material],m=new THREE.Mesh(a,f);m.castShadow=!0,i.add(m)}else console.warn("Non-triangular primitives are not supported")}return i})})},c.prototype.loadCameras=function(){var e=this.json;return n(e.cameras,function(e){if("perspective"==e.type&&e.perspective){var t=e.perspective.yfov,i=e.perspective.xfov,r=e.perspective.aspect_ratio||1;i=void 0===i&&t?t*r:i;var n=new THREE.PerspectiveCamera(THREE.Math.radToDeg(i),r,e.perspective.znear||1,e.perspective.zfar||2e6);return n.name=e.name,n}if("orthographic"==e.type&&e.orthographic){var n=new THREE.OrthographicCamera(window.innerWidth/-2,window.innerWidth/2,window.innerHeight/2,window.innerHeight/-2,e.orthographic.znear,e.orthographic.zfar);return n.name=e.name,n}})},c.prototype.loadSkins=function(){var e=this.json;return this._withDependencies(["accessors"]).then(function(t){return n(e.skins,function(e){var i={bindShapeMatrix:(new THREE.Matrix4).fromArray(e.bindShapeMatrix),jointNames:e.jointNames,inverseBindMatrices:t.accessors[e.inverseBindMatrices]};return i})})},c.prototype.loadAnimations=function(){var e=this.json;return this._withDependencies(["accessors","nodes"]).then(function(t){return n(e.animations,function(e,i){var n=[];for(var o in e.channels){var a=e.channels[o],s=e.samplers[a.sampler];if(s&&e.parameters){var c=a.target,u=c.id,l=e.parameters[s.input],h=e.parameters[s.output],d=t.accessors[l],p=t.accessors[h],f=t.nodes[u];if(f){var v={times:d.array,values:p.array,target:f,type:g[s.interpolation],name:f.name+"."+m[c.path]};n.push(v)}}}return r("animation_"+i,n)})})},c.prototype.loadNodes=function(){var e=this.json,t=this;return n(e.nodes,function(e){var t,i=new THREE.Matrix4;return e.jointName?(t=new THREE.Bone,t.jointName=e.jointName):t=new THREE.Object3D,t.name=e.name,t.matrixAutoUpdate=!1,void 0!==e.matrix?(i.fromArray(e.matrix),t.applyMatrix(i)):(void 0!==e.translation&&t.position.fromArray(e.translation),void 0!==e.rotation&&t.quaternion.fromArray(e.rotation),void 0!==e.scale&&t.scale.fromArray(e.scale)),t}).then(function(i){return t._withDependencies(["meshes","skins","cameras","extensions"]).then(function(t){return n(i,function(r,n){var o=e.nodes[n];if(void 0!==o.meshes)for(var a in o.meshes){var s=o.meshes[a],c=t.meshes[s];for(var u in c.children){var l,h=c.children[u],d=h.material,p=h.geometry;d.isDeferredShaderMaterial?d=l=d.create():l=d,h=new THREE.Mesh(p,l),h.castShadow=!0;var f;if(o.skin&&(f=t.skins[o.skin]),f){var m=p,l=d;l.skinning=!0,h=new THREE.SkinnedMesh(m,l,!1),h.castShadow=!0;for(var g=[],v=[],y=Object.keys(i),M=0,A=f.jointNames.length;M<A;M++){for(var w,x=f.jointNames[M],E=0,b=y.length;E<b;E++){var T=i[y[E]];if(T.jointName===x){w=T;break}}if(w){w.skin=h,g.push(w);var L=f.inverseBindMatrices.array,N=(new THREE.Matrix4).fromArray(L,16*M);v.push(N)}else console.warn("WARNING: joint: ''"+x+"' could not be found")}h.bind(new THREE.Skeleton(g,v,!1),f.bindShapeMatrix)}r.add(h)}}if(void 0!==o.camera){var D=t.cameras[o.camera];r.add(D)}if(o.extensions&&o.extensions.KHR_materials_common&&o.extensions.KHR_materials_common.light){var S=t.extensions.KHR_materials_common.lights[o.extensions.KHR_materials_common.light];r.add(S)}return r})})})},c.prototype.loadExtensions=function(){var e=this.json;return n(e.extensions,function(e,t){switch(t){case"KHR_materials_common":var i={lights:{}},r=e.lights;for(var n in r){var o,a=r[n],s=a[a.type],c=(new THREE.Color).fromArray(s.color);switch(a.type){case"directional":o=new THREE.DirectionalLight(c),o.position.set(0,0,1);break;case"point":o=new THREE.PointLight(c);break;case"spot ":o=new THREE.SpotLight(c),o.position.set(0,0,1);break;case"ambient":o=new THREE.AmbientLight(c)}o&&(i.lights[n]=o)}return i}})},c.prototype.loadScenes=function(){function t(e,i,n){var o=n[e];i.add(o);var a=r.nodes[e];if(a.children)for(var s=a.children,c=0,u=s.length;c<u;c++){var l=s[c];t(l,o,n)}}var r=this.json;return this._withDependencies(["nodes"]).then(function(o){return n(r.scenes,function(r){var n=new THREE.Scene;n.name=r.name;for(var a=r.nodes,s=0,c=a.length;s<c;s++){var u=a[s];t(u,n,o.nodes)}return n.traverse(function(t){if(t.material&&t.material.isRawShaderMaterial){var r=new i(t,o.nodes);e.Shaders.add(t.uuid,r)}}),n})})},e}()},{}],46:[function(e,t,i){THREE.MTLLoader=function(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager},Object.assign(THREE.MTLLoader.prototype,THREE.EventDispatcher.prototype,{load:function(e,t,i,r){var n=this,o=new THREE.FileLoader(this.manager);o.setPath(this.path),o.load(e,function(e){t(n.parse(e))},i,r)},setPath:function(e){this.path=e},setTexturePath:function(e){this.texturePath=e},setBaseUrl:function(e){console.warn("THREE.MTLLoader: .setBaseUrl() is deprecated. Use .setTexturePath( path ) for texture path or .setPath( path ) for general base path instead."),this.setTexturePath(e)},setCrossOrigin:function(e){this.crossOrigin=e},setMaterialOptions:function(e){this.materialOptions=e},parse:function(e){for(var t=e.split("\n"),i={},r=/\s+/,n={},o=0;o<t.length;o++){var a=t[o];if(a=a.trim(),0!==a.length&&"#"!==a.charAt(0)){var s=a.indexOf(" "),c=s>=0?a.substring(0,s):a;c=c.toLowerCase();var u=s>=0?a.substring(s+1):"";if(u=u.trim(),"newmtl"===c)i={name:u},n[u]=i;else if(i)if("ka"===c||"kd"===c||"ks"===c){var l=u.split(r,3);i[c]=[parseFloat(l[0]),parseFloat(l[1]),parseFloat(l[2])]}else i[c]=u}}var h=new THREE.MTLLoader.MaterialCreator(this.texturePath||this.path,this.materialOptions);return h.setCrossOrigin(this.crossOrigin),h.setManager(this.manager),h.setMaterials(n),h}}),THREE.MTLLoader.MaterialCreator=function(e,t){this.baseUrl=e||"",this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.side=this.options&&this.options.side?this.options.side:THREE.FrontSide,this.wrap=this.options&&this.options.wrap?this.options.wrap:THREE.RepeatWrapping},THREE.MTLLoader.MaterialCreator.prototype={constructor:THREE.MTLLoader.MaterialCreator,setCrossOrigin:function(e){this.crossOrigin=e},setManager:function(e){this.manager=e},setMaterials:function(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}},convert:function(e){if(!this.options)return e;var t={};for(var i in e){var r=e[i],n={};t[i]=n;for(var o in r){var a=!0,s=r[o],c=o.toLowerCase();switch(c){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(s=[s[0]/255,s[1]/255,s[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===s[0]&&0===s[1]&&0===s[2]&&(a=!1)}a&&(n[c]=s)}}return t},preload:function(){for(var e in this.materialsInfo)this.create(e)},getIndex:function(e){return this.nameLookup[e]},getAsArray:function(){var e=0;for(var t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray},create:function(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]},createMaterial_:function(e){function t(e,t){if(!n[e]){var r=i.getTextureParams(t,n),a=i.loadTexture(o(i.baseUrl,r.url));a.repeat.copy(r.scale),a.offset.copy(r.offset),a.wrapS=i.wrap,a.wrapT=i.wrap,n[e]=a}}var i=this,r=this.materialsInfo[e],n={name:e,side:this.side},o=function(e,t){return"string"!=typeof t||""===t?"":/^https?:\/\//i.test(t)?t:e+t};for(var a in r){var s=r[a];if(""!==s)switch(a.toLowerCase()){case"kd":n.color=(new THREE.Color).fromArray(s);break;case"ks":n.specular=(new THREE.Color).fromArray(s);break;case"map_kd":t("map",s);break;case"map_ks":t("specularMap",s);break;case"map_bump":case"bump":t("bumpMap",s);break;case"ns":n.shininess=parseFloat(s);break;case"d":s<1&&(n.opacity=s,n.transparent=!0);break;case"Tr":s>0&&(n.opacity=1-s,n.transparent=!0)}}return this.materials[e]=new THREE.MeshPhongMaterial(n),this.materials[e]},getTextureParams:function(e,t){var i,r={scale:new THREE.Vector2(1,1),offset:new THREE.Vector2(0,0)},n=e.split(/\s+/);return i=n.indexOf("-bm"),i>=0&&(t.bumpScale=parseFloat(n[i+1]),n.splice(i,2)),i=n.indexOf("-s"),i>=0&&(r.scale.set(parseFloat(n[i+1]),parseFloat(n[i+2])),n.splice(i,4)),i=n.indexOf("-o"),i>=0&&(r.offset.set(parseFloat(n[i+1]),parseFloat(n[i+2])),n.splice(i,4)),r.url=n.join(" ").trim(),r},loadTexture:function(e,t,i,r,n){var o,a=THREE.Loader.Handlers.get(e),s=void 0!==this.manager?this.manager:THREE.DefaultLoadingManager;return null===a&&(a=new THREE.TextureLoader(s)),a.setCrossOrigin&&a.setCrossOrigin(this.crossOrigin),o=a.load(e,i,r,n),void 0!==t&&(o.mapping=t),o}}},{}],47:[function(e,t,i){THREE.OBJLoader=function(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager,this.materials=null,this.regexp={vertex_pattern:/^v\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,normal_pattern:/^vn\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,uv_pattern:/^vt\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,face_vertex:/^f\s+(-?\d+)\s+(-?\d+)\s+(-?\d+)(?:\s+(-?\d+))?/,face_vertex_uv:/^f\s+(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)(?:\s+(-?\d+)\/(-?\d+))?/,face_vertex_uv_normal:/^f\s+(-?\d+)\/(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\/(-?\d+)(?:\s+(-?\d+)\/(-?\d+)\/(-?\d+))?/,face_vertex_normal:/^f\s+(-?\d+)\/\/(-?\d+)\s+(-?\d+)\/\/(-?\d+)\s+(-?\d+)\/\/(-?\d+)(?:\s+(-?\d+)\/\/(-?\d+))?/,object_pattern:/^[og]\s*(.+)?/,smoothing_pattern:/^s\s+(\d+|on|off)/,material_library_pattern:/^mtllib /,material_use_pattern:/^usemtl /}},THREE.OBJLoader.prototype={constructor:THREE.OBJLoader,load:function(e,t,i,r){var n=this,o=new THREE.FileLoader(n.manager);o.setPath(this.path),o.load(e,function(e){t(n.parse(e))},i,r)},setPath:function(e){this.path=e},setMaterials:function(e){this.materials=e},_createParserState:function(){var e={objects:[],object:{},vertices:[],normals:[],uvs:[],materialLibraries:[],startObject:function(e,t){if(this.object&&this.object.fromDeclaration===!1)return this.object.name=e,void(this.object.fromDeclaration=t!==!1);var i=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],uvs:[]},materials:[],smooth:!0,startMaterial:function(e,t){var i=this._finalize(!1);i&&(i.inherited||i.groupCount<=0)&&this.materials.splice(i.index,1);var r={index:this.materials.length,name:e||"",mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:void 0!==i?i.smooth:this.smooth,groupStart:void 0!==i?i.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){var t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(r),r},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){var t=this.currentMaterial();if(t&&t.groupEnd===-1&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(var i=this.materials.length-1;i>=0;i--)this.materials[i].groupCount<=0&&this.materials.splice(i,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},i&&i.name&&"function"==typeof i.clone){var r=i.clone(0);r.inherited=!0,this.object.materials.push(r)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){var i=parseInt(e,10);return 3*(i>=0?i-1:i+t/3)},parseNormalIndex:function(e,t){var i=parseInt(e,10);return 3*(i>=0?i-1:i+t/3)},parseUVIndex:function(e,t){var i=parseInt(e,10);return 2*(i>=0?i-1:i+t/2)},addVertex:function(e,t,i){var r=this.vertices,n=this.object.geometry.vertices;n.push(r[e+0]),n.push(r[e+1]),n.push(r[e+2]),n.push(r[t+0]),n.push(r[t+1]),n.push(r[t+2]),n.push(r[i+0]),n.push(r[i+1]),n.push(r[i+2])},addVertexLine:function(e){var t=this.vertices,i=this.object.geometry.vertices;i.push(t[e+0]),i.push(t[e+1]),i.push(t[e+2])},addNormal:function(e,t,i){var r=this.normals,n=this.object.geometry.normals;n.push(r[e+0]),n.push(r[e+1]),n.push(r[e+2]),n.push(r[t+0]),n.push(r[t+1]),n.push(r[t+2]),n.push(r[i+0]),n.push(r[i+1]),n.push(r[i+2])},addUV:function(e,t,i){var r=this.uvs,n=this.object.geometry.uvs;n.push(r[e+0]),n.push(r[e+1]),n.push(r[t+0]),n.push(r[t+1]),n.push(r[i+0]),n.push(r[i+1])},addUVLine:function(e){var t=this.uvs,i=this.object.geometry.uvs;i.push(t[e+0]),i.push(t[e+1])},addFace:function(e,t,i,r,n,o,a,s,c,u,l,h){var d,p=this.vertices.length,f=this.parseVertexIndex(e,p),m=this.parseVertexIndex(t,p),g=this.parseVertexIndex(i,p);if(void 0===r?this.addVertex(f,m,g):(d=this.parseVertexIndex(r,p),this.addVertex(f,m,d),this.addVertex(m,g,d)),void 0!==n){var v=this.uvs.length;f=this.parseUVIndex(n,v),m=this.parseUVIndex(o,v),g=this.parseUVIndex(a,v),void 0===r?this.addUV(f,m,g):(d=this.parseUVIndex(s,v),this.addUV(f,m,d),this.addUV(m,g,d))}if(void 0!==c){var y=this.normals.length;f=this.parseNormalIndex(c,y),m=c===u?f:this.parseNormalIndex(u,y),g=c===l?f:this.parseNormalIndex(l,y),void 0===r?this.addNormal(f,m,g):(d=this.parseNormalIndex(h,y),this.addNormal(f,m,d),this.addNormal(m,g,d))}},addLineGeometry:function(e,t){this.object.geometry.type="Line";for(var i=this.vertices.length,r=this.uvs.length,n=0,o=e.length;n<o;n++)this.addVertexLine(this.parseVertexIndex(e[n],i));for(var a=0,o=t.length;a<o;a++)this.addUVLine(this.parseUVIndex(t[a],r))}};return e.startObject("",!1),e},parse:function(e){console.time("OBJLoader");var t=this._createParserState();e.indexOf("\r\n")!==-1&&(e=e.replace(/\r\n/g,"\n")),e.indexOf("\\\n")!==-1&&(e=e.replace(/\\\n/g,""));for(var i=e.split("\n"),r="",n="",o="",a=0,s=[],c="function"==typeof"".trimLeft,u=0,l=i.length;u<l;u++)if(r=i[u],r=c?r.trimLeft():r.trim(),a=r.length,0!==a&&(n=r.charAt(0),"#"!==n))if("v"===n)if(o=r.charAt(1)," "===o&&null!==(s=this.regexp.vertex_pattern.exec(r)))t.vertices.push(parseFloat(s[1]),parseFloat(s[2]),parseFloat(s[3]));else if("n"===o&&null!==(s=this.regexp.normal_pattern.exec(r)))t.normals.push(parseFloat(s[1]),parseFloat(s[2]),parseFloat(s[3]));else{if("t"!==o||null===(s=this.regexp.uv_pattern.exec(r)))throw new Error("Unexpected vertex/normal/uv line: '"+r+"'");t.uvs.push(parseFloat(s[1]),parseFloat(s[2]))}else if("f"===n)if(null!==(s=this.regexp.face_vertex_uv_normal.exec(r)))t.addFace(s[1],s[4],s[7],s[10],s[2],s[5],s[8],s[11],s[3],s[6],s[9],s[12]);else if(null!==(s=this.regexp.face_vertex_uv.exec(r)))t.addFace(s[1],s[3],s[5],s[7],s[2],s[4],s[6],s[8]);else if(null!==(s=this.regexp.face_vertex_normal.exec(r)))t.addFace(s[1],s[3],s[5],s[7],void 0,void 0,void 0,void 0,s[2],s[4],s[6],s[8]);else{if(null===(s=this.regexp.face_vertex.exec(r)))throw new Error("Unexpected face line: '"+r+"'");t.addFace(s[1],s[2],s[3],s[4])}else if("l"===n){var h=r.substring(1).trim().split(" "),d=[],p=[];if(r.indexOf("/")===-1)d=h;else for(var f=0,m=h.length;f<m;f++){var g=h[f].split("/");""!==g[0]&&d.push(g[0]),""!==g[1]&&p.push(g[1])}t.addLineGeometry(d,p)}else if(null!==(s=this.regexp.object_pattern.exec(r))){var v=(" "+s[0].substr(1).trim()).substr(1);t.startObject(v)}else if(this.regexp.material_use_pattern.test(r))t.object.startMaterial(r.substring(7).trim(),t.materialLibraries);else if(this.regexp.material_library_pattern.test(r))t.materialLibraries.push(r.substring(7).trim());else{if(null===(s=this.regexp.smoothing_pattern.exec(r))){if("\0"===r)continue;throw new Error("Unexpected line: '"+r+"'")}var y=s[1].trim().toLowerCase();t.object.smooth="1"===y||"on"===y;var M=t.object.currentMaterial();M&&(M.smooth=t.object.smooth)}t.finalize();var A=new THREE.Group;A.materialLibraries=[].concat(t.materialLibraries);for(var u=0,l=t.objects.length;u<l;u++){var w=t.objects[u],x=w.geometry,E=w.materials,b="Line"===x.type;if(0!==x.vertices.length){var T=new THREE.BufferGeometry;T.addAttribute("position",new THREE.BufferAttribute(new Float32Array(x.vertices),3)),x.normals.length>0?T.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(x.normals),3)):T.computeVertexNormals(),x.uvs.length>0&&T.addAttribute("uv",new THREE.BufferAttribute(new Float32Array(x.uvs),2));for(var L=[],N=0,D=E.length;N<D;N++){var S=E[N],M=void 0;if(null!==this.materials&&(M=this.materials.create(S.name),b&&M&&!(M instanceof THREE.LineBasicMaterial))){var I=new THREE.LineBasicMaterial;I.copy(M),M=I}M||(M=b?new THREE.LineBasicMaterial:new THREE.MeshPhongMaterial,M.name=S.name),M.shading=S.smooth?THREE.SmoothShading:THREE.FlatShading,L.push(M)}var C;if(L.length>1){for(var N=0,D=E.length;N<D;N++){var S=E[N];T.addGroup(S.groupStart,S.groupCount,N)}var _=new THREE.MultiMaterial(L);C=b?new THREE.LineSegments(T,_):new THREE.Mesh(T,_)}else C=b?new THREE.LineSegments(T,L[0]):new THREE.Mesh(T,L[0]);C.name=w.name,A.add(C)}}return console.timeEnd("OBJLoader"),A}}},{}],48:[function(e,t,i){function r(e){return e.replace(/^\s*|\s*$/g,"")}i=t.exports=r,i.left=function(e){return e.replace(/^\s*/,"")},i.right=function(e){return e.replace(/\s*$/,"")}},{}],49:[function(e,i,r){!function(e){if("performance"in e==!1&&(e.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in e.performance==!1){var t=e.performance.timing&&e.performance.timing.navigationStart?performance.timing.navigationStart:Date.now();e.performance.now=function(){return Date.now()-t}}}(this);var n=n||function(){var e=[];return{REVISION:"14",getAll:function(){return e},removeAll:function(){e=[]},add:function(t){e.push(t)},remove:function(t){var i=e.indexOf(t);i!==-1&&e.splice(i,1)},update:function(t){if(0===e.length)return!1;var i=0;for(t=void 0!==t?t:window.performance.now();i<e.length;)e[i].update(t)?i++:e.splice(i,1);return!0}}}();n.Tween=function(e){var t=e,i={},r={},o={},a=1e3,s=0,c=!1,u=!1,l=!1,h=0,d=null,p=n.Easing.Linear.None,f=n.Interpolation.Linear,m=[],g=null,v=!1,y=null,M=null,A=null;for(var w in e)i[w]=parseFloat(e[w],10);this.to=function(e,t){return void 0!==t&&(a=t),r=e,this},this.start=function(e){n.add(this),u=!0,v=!1,d=void 0!==e?e:window.performance.now(),d+=h;for(var a in r){if(r[a]instanceof Array){if(0===r[a].length)continue;r[a]=[t[a]].concat(r[a])}i[a]=t[a],i[a]instanceof Array==!1&&(i[a]*=1),o[a]=i[a]||0}return this},this.stop=function(){return u?(n.remove(this),u=!1,null!==A&&A.call(t),this.stopChainedTweens(),this):this},this.stopChainedTweens=function(){for(var e=0,t=m.length;e<t;e++)m[e].stop()},this.delay=function(e){return h=e,this},this.repeat=function(e){return s=e,this},this.yoyo=function(e){return c=e,this},this.easing=function(e){return p=e,this},this.interpolation=function(e){return f=e,this},this.chain=function(){return m=arguments,this},this.onStart=function(e){return g=e,this},this.onUpdate=function(e){return y=e,this},this.onComplete=function(e){return M=e,this},this.onStop=function(e){return A=e,this},this.update=function(e){var n;if(e<d)return!0;v===!1&&(null!==g&&g.call(t),v=!0);var u=(e-d)/a;u=u>1?1:u;var A=p(u);for(n in r){var w=i[n]||0,x=r[n];x instanceof Array?t[n]=f(x,A):("string"==typeof x&&(x=w+parseFloat(x,10)),"number"==typeof x&&(t[n]=w+(x-w)*A))}if(null!==y&&y.call(t,A),1==u){if(s>0){isFinite(s)&&s--;for(n in o){if("string"==typeof r[n]&&(o[n]=o[n]+parseFloat(r[n],10)),c){var E=o[n];o[n]=r[n],r[n]=E}i[n]=o[n]}return c&&(l=!l),d=e+h,!0}null!==M&&M.call(t);for(var b=0,T=m.length;b<T;b++)m[b].start(e);return!1}return!0}},n.Easing={Linear:{None:function(e){return e}},Quadratic:{In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Cubic:{In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},Quartic:{In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},Quintic:{In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},Exponential:{In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}},Circular:{In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},Elastic:{In:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),-(i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)))},Out:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/r)+1)},InOut:function(e){var t,i=.1,r=.4;return 0===e?0:1===e?1:(!i||i<1?(i=1,t=r/4):t=r*Math.asin(1/i)/(2*Math.PI),(e*=2)<1?-.5*(i*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)):i*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(e){return 1-n.Easing.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*n.Easing.Bounce.In(2*e):.5*n.Easing.Bounce.Out(2*e-1)+.5}}},n.Interpolation={Linear:function(e,t){var i=e.length-1,r=i*t,o=Math.floor(r),a=n.Interpolation.Utils.Linear;return t<0?a(e[0],e[1],r):t>1?a(e[i],e[i-1],i-r):a(e[o],e[o+1>i?i:o+1],r-o)},Bezier:function(e,t){var i,r=0,o=e.length-1,a=Math.pow,s=n.Interpolation.Utils.Bernstein;for(i=0;i<=o;i++)r+=a(1-t,o-i)*a(t,i)*e[i]*s(o,i);return r},CatmullRom:function(e,t){var i=e.length-1,r=i*t,o=Math.floor(r),a=n.Interpolation.Utils.CatmullRom;return e[0]===e[i]?(t<0&&(o=Math.floor(r=i*(1+t))),a(e[(o-1+i)%i],e[o],e[(o+1)%i],e[(o+2)%i],r-o)):t<0?e[0]-(a(e[0],e[0],e[1],e[1],-r)-e[0]):t>1?e[i]-(a(e[i],e[i],e[i-1],e[i-1],r-i)-e[i]):a(e[o?o-1:0],e[o],e[i<o+1?i:o+1],e[i<o+2?i:o+2],r-o)},Utils:{Linear:function(e,t,i){return(t-e)*i+e},Bernstein:function(e,t){var i=n.Interpolation.Utils.Factorial;return i(e)/i(t)/i(e-t)},Factorial:function(){var e=[1];return function(t){var i,r=1;if(e[t])return e[t];for(i=t;i>1;i--)r*=i;return e[t]=r}}(),CatmullRom:function(e,t,i,r,n){var o=.5*(i-e),a=.5*(r-t),s=n*n,c=n*s;return(2*t-2*i+o+a)*c+(-3*t+3*i-2*o-a)*s+o*n+t}}},function(e){"function"==typeof t&&t.amd?t([],function(){return n}):"object"==typeof r?i.exports=n:e.TWEEN=n}(this)},{}],50:[function(e,r,n){(function(i){!function(e){if("object"==typeof n&&"undefined"!=typeof r)r.exports=e();else if("function"==typeof t&&t.amd)t([],e);else{var o;o="undefined"!=typeof window?window:"undefined"!=typeof i?i:"undefined"!=typeof self?self:this,o.WebVRPolyfill=e()}}(function(){return function t(i,r,n){function o(s,c){if(!r[s]){if(!i[s]){var u="function"==typeof e&&e;if(!c&&u)return u(s,!0);if(a)return a(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var h=r[s]={exports:{}};i[s][0].call(h.exports,function(e){var t=i[s][1][e];return o(t?t:e)},h,h.exports,t,i,r,n)}return r[s].exports}for(var a="function"==typeof e&&e,s=0;s<n.length;s++)o(n[s]);
  return o}({1:[function(e,t,i){"use strict";function r(){}function n(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function o(){this._events=new r,this._eventsCount=0}var a=Object.prototype.hasOwnProperty,s="~";Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(s=!1)),o.prototype.eventNames=function(){var e,t,i=[];if(0===this._eventsCount)return i;for(t in e=this._events)a.call(e,t)&&i.push(s?t.slice(1):t);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},o.prototype.listeners=function(e,t){var i=s?s+e:e,r=this._events[i];if(t)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var n=0,o=r.length,a=new Array(o);n<o;n++)a[n]=r[n].fn;return a},o.prototype.emit=function(e,t,i,r,n,o){var a=s?s+e:e;if(!this._events[a])return!1;var c,u,l=this._events[a],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,i),!0;case 4:return l.fn.call(l.context,t,i,r),!0;case 5:return l.fn.call(l.context,t,i,r,n),!0;case 6:return l.fn.call(l.context,t,i,r,n,o),!0}for(u=1,c=new Array(h-1);u<h;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var d,p=l.length;for(u=0;u<p;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),h){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,i);break;case 4:l[u].fn.call(l[u].context,t,i,r);break;default:if(!c)for(d=1,c=new Array(h-1);d<h;d++)c[d-1]=arguments[d];l[u].fn.apply(l[u].context,c)}}return!0},o.prototype.on=function(e,t,i){var r=new n(t,i||this),o=s?s+e:e;return this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],r]:this._events[o].push(r):(this._events[o]=r,this._eventsCount++),this},o.prototype.once=function(e,t,i){var r=new n(t,i||this,!0),o=s?s+e:e;return this._events[o]?this._events[o].fn?this._events[o]=[this._events[o],r]:this._events[o].push(r):(this._events[o]=r,this._eventsCount++),this},o.prototype.removeListener=function(e,t,i,n){var o=s?s+e:e;if(!this._events[o])return this;if(!t)return 0===--this._eventsCount?this._events=new r:delete this._events[o],this;var a=this._events[o];if(a.fn)a.fn!==t||n&&!a.once||i&&a.context!==i||(0===--this._eventsCount?this._events=new r:delete this._events[o]);else{for(var c=0,u=[],l=a.length;c<l;c++)(a[c].fn!==t||n&&!a[c].once||i&&a[c].context!==i)&&u.push(a[c]);u.length?this._events[o]=1===u.length?u[0]:u:0===--this._eventsCount?this._events=new r:delete this._events[o]}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=s?s+e:e,this._events[t]&&(0===--this._eventsCount?this._events=new r:delete this._events[t])):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prototype.setMaxListeners=function(){return this},o.prefixed=s,o.EventEmitter=o,"undefined"!=typeof t&&(t.exports=o)},{}],2:[function(e,t,i){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function n(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},i=0;i<10;i++)t["_"+String.fromCharCode(i)]=i;var r=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==r.join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}var o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;t.exports=n()?Object.assign:function(e,t){for(var i,n,s=r(e),c=1;c<arguments.length;c++){i=Object(arguments[c]);for(var u in i)o.call(i,u)&&(s[u]=i[u]);if(Object.getOwnPropertySymbols){n=Object.getOwnPropertySymbols(i);for(var l=0;l<n.length;l++)a.call(i,n[l])&&(s[n[l]]=i[n[l]])}}return s}},{}],3:[function(e,t,i){function r(){this.leftProjectionMatrix=new Float32Array(16),this.leftViewMatrix=new Float32Array(16),this.rightProjectionMatrix=new Float32Array(16),this.rightViewMatrix=new Float32Array(16),this.pose=null}function n(){this.isPolyfilled=!0,this.displayId=l++,this.displayName="webvr-polyfill displayName",this.depthNear=.01,this.depthFar=1e4,this.isConnected=!0,this.isPresenting=!1,this.capabilities={hasPosition:!1,hasOrientation:!1,hasExternalDisplay:!1,canPresent:!1,maxLayers:1},this.stageParameters=null,this.waitingForPresent_=!1,this.layer_=null,this.fullscreenElement_=null,this.fullscreenWrapper_=null,this.fullscreenElementCachedStyle_=null,this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null,this.wakelock_=new u}function o(){this.isPolyfilled=!0,this.hardwareUnitId="webvr-polyfill hardwareUnitId",this.deviceId="webvr-polyfill deviceId",this.deviceName="webvr-polyfill deviceName"}function a(){}function s(){}var c=e("./util.js"),u=e("./wakelock.js"),l=1e3,h=!1,d=[0,0,.5,1],p=[.5,0,.5,1];n.prototype.getFrameData=function(e){return c.frameDataFromPose(e,this.getPose(),this)},n.prototype.getPose=function(){return this.getImmediatePose()},n.prototype.requestAnimationFrame=function(e){return window.requestAnimationFrame(e)},n.prototype.cancelAnimationFrame=function(e){return window.cancelAnimationFrame(e)},n.prototype.wrapForFullscreen=function(e){function t(){if(n.fullscreenElement_){var e=["position: absolute","top: 0","left: 0","width: "+Math.max(screen.width,screen.height)+"px","height: "+Math.min(screen.height,screen.width)+"px","border: 0","margin: 0","padding: 0"];n.fullscreenElement_.setAttribute("style",e.join("; ")+";")}}if(c.isIOS())return e;if(!this.fullscreenWrapper_){this.fullscreenWrapper_=document.createElement("div");var i=["height: "+Math.min(screen.height,screen.width)+"px !important","top: 0 !important","left: 0 !important","right: 0 !important","border: 0","margin: 0","padding: 0","z-index: 999999 !important","position: fixed"];this.fullscreenWrapper_.setAttribute("style",i.join("; ")+";"),this.fullscreenWrapper_.classList.add("webvr-polyfill-fullscreen-wrapper")}if(this.fullscreenElement_==e)return this.fullscreenWrapper_;this.removeFullscreenWrapper(),this.fullscreenElement_=e;var r=this.fullscreenElement_.parentElement;r.insertBefore(this.fullscreenWrapper_,this.fullscreenElement_),r.removeChild(this.fullscreenElement_),this.fullscreenWrapper_.insertBefore(this.fullscreenElement_,this.fullscreenWrapper_.firstChild),this.fullscreenElementCachedStyle_=this.fullscreenElement_.getAttribute("style");var n=this;return t(),this.fullscreenWrapper_},n.prototype.removeFullscreenWrapper=function(){if(this.fullscreenElement_){var e=this.fullscreenElement_;this.fullscreenElementCachedStyle_?e.setAttribute("style",this.fullscreenElementCachedStyle_):e.removeAttribute("style"),this.fullscreenElement_=null,this.fullscreenElementCachedStyle_=null;var t=this.fullscreenWrapper_.parentElement;return this.fullscreenWrapper_.removeChild(e),t.insertBefore(e,this.fullscreenWrapper_),t.removeChild(this.fullscreenWrapper_),e}},n.prototype.requestPresent=function(e){var t=this.isPresenting,i=this;return e instanceof Array||(h||(console.warn("Using a deprecated form of requestPresent. Should pass in an array of VRLayers."),h=!0),e=[e]),new Promise(function(r,n){function o(){var e=c.getFullscreenElement();i.isPresenting=m===e,i.isPresenting?(screen.orientation&&screen.orientation.lock&&screen.orientation.lock("landscape-primary").catch(function(e){console.error("screen.orientation.lock() failed due to",e.message)}),i.waitingForPresent_=!1,i.beginPresent_(),r()):(screen.orientation&&screen.orientation.unlock&&screen.orientation.unlock(),i.removeFullscreenWrapper(),i.wakelock_.release(),i.endPresent_(),i.removeFullscreenListeners_()),i.fireVRDisplayPresentChange_()}function a(){i.waitingForPresent_&&(i.removeFullscreenWrapper(),i.removeFullscreenListeners_(),i.wakelock_.release(),i.waitingForPresent_=!1,i.isPresenting=!1,n(new Error("Unable to present.")))}if(!i.capabilities.canPresent)return void n(new Error("VRDisplay is not capable of presenting."));if(0==e.length||e.length>i.capabilities.maxLayers)return void n(new Error("Invalid number of layers."));var s=e[0];if(!s.source)return void r();var u=s.leftBounds||d,l=s.rightBounds||p;if(t){var h=i.layer_;h.source!==s.source&&(h.source=s.source);for(var f=0;f<4;f++)h.leftBounds[f]!==u[f]&&(h.leftBounds[f]=u[f]),h.rightBounds[f]!==l[f]&&(h.rightBounds[f]=l[f]);return void r()}if(i.layer_={predistorted:s.predistorted,source:s.source,leftBounds:u.slice(0),rightBounds:l.slice(0)},i.waitingForPresent_=!1,i.layer_&&i.layer_.source){var m=i.wrapForFullscreen(i.layer_.source);i.addFullscreenListeners_(m,o,a),c.requestFullscreen(m)?(i.wakelock_.request(),i.waitingForPresent_=!0):(c.isIOS()||c.isWebViewAndroid())&&(i.wakelock_.request(),i.isPresenting=!0,i.beginPresent_(),i.fireVRDisplayPresentChange_(),r())}i.waitingForPresent_||c.isIOS()||(c.exitFullscreen(),n(new Error("Unable to present.")))})},n.prototype.exitPresent=function(){var e=this.isPresenting,t=this;return this.isPresenting=!1,this.layer_=null,this.wakelock_.release(),new Promise(function(i,r){e?(!c.exitFullscreen()&&c.isIOS()&&(t.endPresent_(),t.fireVRDisplayPresentChange_()),c.isWebViewAndroid()&&(t.removeFullscreenWrapper(),t.removeFullscreenListeners_(),t.endPresent_(),t.fireVRDisplayPresentChange_()),i()):r(new Error("Was not presenting to VRDisplay."))})},n.prototype.getLayers=function(){return this.layer_?[this.layer_]:[]},n.prototype.fireVRDisplayPresentChange_=function(){var e=new CustomEvent("vrdisplaypresentchange",{detail:{display:this}});window.dispatchEvent(e)},n.prototype.addFullscreenListeners_=function(e,t,i){this.removeFullscreenListeners_(),this.fullscreenEventTarget_=e,this.fullscreenChangeHandler_=t,this.fullscreenErrorHandler_=i,t&&(document.fullscreenEnabled?e.addEventListener("fullscreenchange",t,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenchange",t,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenchange",t,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenchange",t,!1)),i&&(document.fullscreenEnabled?e.addEventListener("fullscreenerror",i,!1):document.webkitFullscreenEnabled?e.addEventListener("webkitfullscreenerror",i,!1):document.mozFullScreenEnabled?document.addEventListener("mozfullscreenerror",i,!1):document.msFullscreenEnabled&&e.addEventListener("msfullscreenerror",i,!1))},n.prototype.removeFullscreenListeners_=function(){if(this.fullscreenEventTarget_){var e=this.fullscreenEventTarget_;if(this.fullscreenChangeHandler_){var t=this.fullscreenChangeHandler_;e.removeEventListener("fullscreenchange",t,!1),e.removeEventListener("webkitfullscreenchange",t,!1),document.removeEventListener("mozfullscreenchange",t,!1),e.removeEventListener("msfullscreenchange",t,!1)}if(this.fullscreenErrorHandler_){var i=this.fullscreenErrorHandler_;e.removeEventListener("fullscreenerror",i,!1),e.removeEventListener("webkitfullscreenerror",i,!1),document.removeEventListener("mozfullscreenerror",i,!1),e.removeEventListener("msfullscreenerror",i,!1)}this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null}},n.prototype.beginPresent_=function(){},n.prototype.endPresent_=function(){},n.prototype.submitFrame=function(e){},n.prototype.getEyeParameters=function(e){return null},a.prototype=new o,s.prototype=new o,t.exports.VRFrameData=r,t.exports.VRDisplay=n,t.exports.VRDevice=o,t.exports.HMDVRDevice=a,t.exports.PositionSensorVRDevice=s},{"./util.js":23,"./wakelock.js":25}],4:[function(e,t,i){function r(e){this.gl=e,this.ctxAttribs=e.getContextAttributes(),this.meshWidth=20,this.meshHeight=20,this.bufferScale=WebVRConfig.BUFFER_SCALE,this.bufferWidth=e.drawingBufferWidth,this.bufferHeight=e.drawingBufferHeight,this.realBindFramebuffer=e.bindFramebuffer,this.realEnable=e.enable,this.realDisable=e.disable,this.realColorMask=e.colorMask,this.realClearColor=e.clearColor,this.realViewport=e.viewport,o.isIOS()||(this.realCanvasWidth=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"width"),this.realCanvasHeight=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"height")),this.isPatched=!1,this.lastBoundFramebuffer=null,this.cullFace=!1,this.depthTest=!1,this.blend=!1,this.scissorTest=!1,this.stencilTest=!1,this.viewport=[0,0,0,0],this.colorMask=[!0,!0,!0,!0],this.clearColor=[0,0,0,0],this.attribs={position:0,texCoord:1},this.program=o.linkProgram(e,s,c,this.attribs),this.uniforms=o.getProgramUniforms(e,this.program),this.viewportOffsetScale=new Float32Array(8),this.setTextureBounds(),this.vertexBuffer=e.createBuffer(),this.indexBuffer=e.createBuffer(),this.indexCount=0,this.renderTarget=e.createTexture(),this.framebuffer=e.createFramebuffer(),this.depthStencilBuffer=null,this.depthBuffer=null,this.stencilBuffer=null,this.ctxAttribs.depth&&this.ctxAttribs.stencil?this.depthStencilBuffer=e.createRenderbuffer():this.ctxAttribs.depth?this.depthBuffer=e.createRenderbuffer():this.ctxAttribs.stencil&&(this.stencilBuffer=e.createRenderbuffer()),this.patch(),this.onResize(),WebVRConfig.CARDBOARD_UI_DISABLED||(this.cardboardUI=new n(e))}var n=e("./cardboard-ui.js"),o=e("./util.js"),a=e("./deps/wglu-preserve-state.js"),s=["attribute vec2 position;","attribute vec3 texCoord;","varying vec2 vTexCoord;","uniform vec4 viewportOffsetScale[2];","void main() {","  vec4 viewport = viewportOffsetScale[int(texCoord.z)];","  vTexCoord = (texCoord.xy * viewport.zw) + viewport.xy;","  gl_Position = vec4( position, 1.0, 1.0 );","}"].join("\n"),c=["precision mediump float;","uniform sampler2D diffuse;","varying vec2 vTexCoord;","void main() {","  gl_FragColor = texture2D(diffuse, vTexCoord);","}"].join("\n");r.prototype.destroy=function(){var e=this.gl;this.unpatch(),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer),e.deleteBuffer(this.indexBuffer),e.deleteTexture(this.renderTarget),e.deleteFramebuffer(this.framebuffer),this.depthStencilBuffer&&e.deleteRenderbuffer(this.depthStencilBuffer),this.depthBuffer&&e.deleteRenderbuffer(this.depthBuffer),this.stencilBuffer&&e.deleteRenderbuffer(this.stencilBuffer),this.cardboardUI&&this.cardboardUI.destroy()},r.prototype.onResize=function(){var e=this.gl,t=this,i=[e.RENDERBUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0];a(e,i,function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.framebuffer),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.texImage2D(e.TEXTURE_2D,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,t.bufferWidth,t.bufferHeight,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t.renderTarget,0),t.ctxAttribs.depth&&t.ctxAttribs.stencil?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthStencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t.depthStencilBuffer)):t.ctxAttribs.depth?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t.depthBuffer)):t.ctxAttribs.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,t.stencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.STENCIL_INDEX8,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,t.stencilBuffer)),!e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer incomplete!"),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),t.realClearColor.apply(e,t.clearColor)}),this.cardboardUI&&this.cardboardUI.onResize()},r.prototype.patch=function(){if(!this.isPatched){var e=this,t=this.gl.canvas,i=this.gl;o.isIOS()||(t.width=o.getScreenWidth()*this.bufferScale,t.height=o.getScreenHeight()*this.bufferScale,Object.defineProperty(t,"width",{configurable:!0,enumerable:!0,get:function(){return e.bufferWidth},set:function(i){e.bufferWidth=i,e.realCanvasWidth.set.call(t,i),e.onResize()}}),Object.defineProperty(t,"height",{configurable:!0,enumerable:!0,get:function(){return e.bufferHeight},set:function(i){e.bufferHeight=i,e.realCanvasHeight.set.call(t,i),e.onResize()}})),this.lastBoundFramebuffer=i.getParameter(i.FRAMEBUFFER_BINDING),null==this.lastBoundFramebuffer&&(this.lastBoundFramebuffer=this.framebuffer,this.gl.bindFramebuffer(i.FRAMEBUFFER,this.framebuffer)),this.gl.bindFramebuffer=function(t,r){e.lastBoundFramebuffer=r?r:e.framebuffer,e.realBindFramebuffer.call(i,t,e.lastBoundFramebuffer)},this.cullFace=i.getParameter(i.CULL_FACE),this.depthTest=i.getParameter(i.DEPTH_TEST),this.blend=i.getParameter(i.BLEND),this.scissorTest=i.getParameter(i.SCISSOR_TEST),this.stencilTest=i.getParameter(i.STENCIL_TEST),i.enable=function(t){switch(t){case i.CULL_FACE:e.cullFace=!0;break;case i.DEPTH_TEST:e.depthTest=!0;break;case i.BLEND:e.blend=!0;break;case i.SCISSOR_TEST:e.scissorTest=!0;break;case i.STENCIL_TEST:e.stencilTest=!0}e.realEnable.call(i,t)},i.disable=function(t){switch(t){case i.CULL_FACE:e.cullFace=!1;break;case i.DEPTH_TEST:e.depthTest=!1;break;case i.BLEND:e.blend=!1;break;case i.SCISSOR_TEST:e.scissorTest=!1;break;case i.STENCIL_TEST:e.stencilTest=!1}e.realDisable.call(i,t)},this.colorMask=i.getParameter(i.COLOR_WRITEMASK),i.colorMask=function(t,r,n,o){e.colorMask[0]=t,e.colorMask[1]=r,e.colorMask[2]=n,e.colorMask[3]=o,e.realColorMask.call(i,t,r,n,o)},this.clearColor=i.getParameter(i.COLOR_CLEAR_VALUE),i.clearColor=function(t,r,n,o){e.clearColor[0]=t,e.clearColor[1]=r,e.clearColor[2]=n,e.clearColor[3]=o,e.realClearColor.call(i,t,r,n,o)},this.viewport=i.getParameter(i.VIEWPORT),i.viewport=function(t,r,n,o){e.viewport[0]=t,e.viewport[1]=r,e.viewport[2]=n,e.viewport[3]=o,e.realViewport.call(i,t,r,n,o)},this.isPatched=!0,o.safariCssSizeWorkaround(t)}},r.prototype.unpatch=function(){if(this.isPatched){var e=this.gl,t=this.gl.canvas;o.isIOS()||(Object.defineProperty(t,"width",this.realCanvasWidth),Object.defineProperty(t,"height",this.realCanvasHeight)),t.width=this.bufferWidth,t.height=this.bufferHeight,e.bindFramebuffer=this.realBindFramebuffer,e.enable=this.realEnable,e.disable=this.realDisable,e.colorMask=this.realColorMask,e.clearColor=this.realClearColor,e.viewport=this.realViewport,this.lastBoundFramebuffer==this.framebuffer&&e.bindFramebuffer(e.FRAMEBUFFER,null),this.isPatched=!1,setTimeout(function(){o.safariCssSizeWorkaround(t)},1)}},r.prototype.setTextureBounds=function(e,t){e||(e=[0,0,.5,1]),t||(t=[.5,0,.5,1]),this.viewportOffsetScale[0]=e[0],this.viewportOffsetScale[1]=e[1],this.viewportOffsetScale[2]=e[2],this.viewportOffsetScale[3]=e[3],this.viewportOffsetScale[4]=t[0],this.viewportOffsetScale[5]=t[1],this.viewportOffsetScale[6]=t[2],this.viewportOffsetScale[7]=t[3]},r.prototype.submitFrame=function(){var e=this.gl,t=this,i=[];if(WebVRConfig.DIRTY_SUBMIT_FRAME_BINDINGS||i.push(e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING,e.ELEMENT_ARRAY_BUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0),a(e,i,function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),t.cullFace&&t.realDisable.call(e,e.CULL_FACE),t.depthTest&&t.realDisable.call(e,e.DEPTH_TEST),t.blend&&t.realDisable.call(e,e.BLEND),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realDisable.call(e,e.STENCIL_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),(t.ctxAttribs.alpha||o.isIOS())&&(t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)),e.useProgram(t.program),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.indexBuffer),e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.enableVertexAttribArray(t.attribs.position),e.enableVertexAttribArray(t.attribs.texCoord),e.vertexAttribPointer(t.attribs.position,2,e.FLOAT,!1,20,0),e.vertexAttribPointer(t.attribs.texCoord,3,e.FLOAT,!1,20,8),e.activeTexture(e.TEXTURE0),e.uniform1i(t.uniforms.diffuse,0),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.uniform4fv(t.uniforms.viewportOffsetScale,t.viewportOffsetScale),e.drawElements(e.TRIANGLES,t.indexCount,e.UNSIGNED_SHORT,0),t.cardboardUI&&t.cardboardUI.renderNoState(),t.realBindFramebuffer.call(t.gl,e.FRAMEBUFFER,t.framebuffer),t.ctxAttribs.preserveDrawingBuffer||(t.realClearColor.call(e,0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)),WebVRConfig.DIRTY_SUBMIT_FRAME_BINDINGS||t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.cullFace&&t.realEnable.call(e,e.CULL_FACE),t.depthTest&&t.realEnable.call(e,e.DEPTH_TEST),t.blend&&t.realEnable.call(e,e.BLEND),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realEnable.call(e,e.STENCIL_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),!t.ctxAttribs.alpha&&t.ctxAttribs.preserveDrawingBuffer||t.realClearColor.apply(e,t.clearColor)}),o.isIOS()){var r=e.canvas;r.width==t.bufferWidth&&r.height==t.bufferHeight||(t.bufferWidth=r.width,t.bufferHeight=r.height,t.onResize())}},r.prototype.updateDeviceInfo=function(e){var t=this.gl,i=this,r=[t.ARRAY_BUFFER_BINDING,t.ELEMENT_ARRAY_BUFFER_BINDING];a(t,r,function(t){var r=i.computeMeshVertices_(i.meshWidth,i.meshHeight,e);if(t.bindBuffer(t.ARRAY_BUFFER,i.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,r,t.STATIC_DRAW),!i.indexCount){var n=i.computeMeshIndices_(i.meshWidth,i.meshHeight);t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,n,t.STATIC_DRAW),i.indexCount=n.length}})},r.prototype.computeMeshVertices_=function(e,t,i){for(var r=new Float32Array(2*e*t*5),n=i.getLeftEyeVisibleTanAngles(),a=i.getLeftEyeNoLensTanAngles(),s=i.getLeftEyeVisibleScreenRect(a),c=0,u=0;u<2;u++){for(var l=0;l<t;l++)for(var h=0;h<e;h++,c++){var d=h/(e-1),p=l/(t-1),f=d,m=p,g=o.lerp(n[0],n[2],d),v=o.lerp(n[3],n[1],p),y=Math.sqrt(g*g+v*v),M=i.distortion.distortInverse(y),A=g*M/y,w=v*M/y;d=(A-a[0])/(a[2]-a[0]),p=(w-a[3])/(a[1]-a[3]);i.device.widthMeters/i.device.heightMeters;d=2*(s.x+d*s.width-.5),p=2*(s.y+p*s.height-.5),r[5*c+0]=d,r[5*c+1]=p,r[5*c+2]=f,r[5*c+3]=m,r[5*c+4]=u}var x=n[2]-n[0];n[0]=-(x+n[0]),n[2]=x-n[2],x=a[2]-a[0],a[0]=-(x+a[0]),a[2]=x-a[2],s.x=1-(s.x+s.width)}return r},r.prototype.computeMeshIndices_=function(e,t){for(var i=new Uint16Array(2*(e-1)*(t-1)*6),r=e/2,n=t/2,o=0,a=0,s=0;s<2;s++)for(var c=0;c<t;c++)for(var u=0;u<e;u++,o++)0!=u&&0!=c&&(u<=r==c<=n?(i[a++]=o,i[a++]=o-e-1,i[a++]=o-e,i[a++]=o-e-1,i[a++]=o,i[a++]=o-1):(i[a++]=o-1,i[a++]=o-e,i[a++]=o,i[a++]=o-e,i[a++]=o-1,i[a++]=o-e-1));return i},r.prototype.getOwnPropertyDescriptor_=function(e,t){var i=Object.getOwnPropertyDescriptor(e,t);return void 0!==i.get&&void 0!==i.set||(i.configurable=!0,i.enumerable=!0,i.get=function(){return this.getAttribute(t)},i.set=function(e){this.setAttribute(t,e)}),i},t.exports=r},{"./cardboard-ui.js":5,"./deps/wglu-preserve-state.js":7,"./util.js":23}],5:[function(e,t,i){function r(e){this.gl=e,this.attribs={position:0},this.program=n.linkProgram(e,a,s,this.attribs),this.uniforms=n.getProgramUniforms(e,this.program),this.vertexBuffer=e.createBuffer(),this.gearOffset=0,this.gearVertexCount=0,this.arrowOffset=0,this.arrowVertexCount=0,this.projMat=new Float32Array(16),this.listener=null,this.onResize()}var n=e("./util.js"),o=e("./deps/wglu-preserve-state.js"),a=["attribute vec2 position;","uniform mat4 projectionMat;","void main() {","  gl_Position = projectionMat * vec4( position, -1.0, 1.0 );","}"].join("\n"),s=["precision mediump float;","uniform vec4 color;","void main() {","  gl_FragColor = color;","}"].join("\n"),c=Math.PI/180,u=60,l=12,h=20,d=1,p=.75,f=.3125,m=4,g=28,v=1.5;r.prototype.destroy=function(){var e=this.gl;this.listener&&e.canvas.removeEventListener("click",this.listener,!1),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer)},r.prototype.listen=function(e,t){var i=this.gl.canvas;this.listener=function(r){var n=i.clientWidth/2,o=g*v;r.clientX>n-o&&r.clientX<n+o&&r.clientY>i.clientHeight-o?e(r):r.clientX<o&&r.clientY<o&&t(r)},i.addEventListener("click",this.listener,!1)},r.prototype.onResize=function(){var e=this.gl,t=this,i=[e.ARRAY_BUFFER_BINDING];o(e,i,function(e){function i(e,t){var i=(90-e)*c,r=Math.cos(i),n=Math.sin(i);o.push(f*r*A+a,f*n*A+A),o.push(t*r*A+a,t*n*A+A)}function r(t,i){o.push(w+t,e.drawingBufferHeight-w-i)}var o=[],a=e.drawingBufferWidth/2,s=e.drawingBufferWidth/(screen.width*window.devicePixelRatio);n.isIOS()||(s*=window.devicePixelRatio);var y=m*s/2,M=g*v*s,A=g*s/2,w=(g*v-g)*s;o.push(a-y,M),o.push(a-y,e.drawingBufferHeight),o.push(a+y,M),o.push(a+y,e.drawingBufferHeight),t.gearOffset=o.length/2;for(var x=0;x<=6;x++){var E=x*u;i(E,d),i(E+l,d),i(E+h,p),i(E+(u-h),p),i(E+(u-l),d)}t.gearVertexCount=o.length/2-t.gearOffset,t.arrowOffset=o.length/2;var b=y/Math.sin(45*c);r(0,A),r(A,0),r(A+b,b),r(b,A+b),r(b,A-b),r(0,A),r(A,2*A),r(A+b,2*A-b),r(b,A-b),r(0,A),r(b,A-y),r(g*s,A-y),r(b,A+y),r(g*s,A+y),t.arrowVertexCount=o.length/2-t.arrowOffset,e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(o),e.STATIC_DRAW)})},r.prototype.render=function(){var e=this.gl,t=this,i=[e.CULL_FACE,e.DEPTH_TEST,e.BLEND,e.SCISSOR_TEST,e.STENCIL_TEST,e.COLOR_WRITEMASK,e.VIEWPORT,e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING];o(e,i,function(e){e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.BLEND),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.colorMask(!0,!0,!0,!0),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.renderNoState()})},r.prototype.renderNoState=function(){var e=this.gl;e.useProgram(this.program),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.enableVertexAttribArray(this.attribs.position),e.vertexAttribPointer(this.attribs.position,2,e.FLOAT,!1,8,0),e.uniform4f(this.uniforms.color,1,1,1,1),n.orthoMatrix(this.projMat,0,e.drawingBufferWidth,0,e.drawingBufferHeight,.1,1024),e.uniformMatrix4fv(this.uniforms.projectionMat,!1,this.projMat),e.drawArrays(e.TRIANGLE_STRIP,0,4),e.drawArrays(e.TRIANGLE_STRIP,this.gearOffset,this.gearVertexCount),e.drawArrays(e.TRIANGLE_STRIP,this.arrowOffset,this.arrowVertexCount)},t.exports=r},{"./deps/wglu-preserve-state.js":7,"./util.js":23}],6:[function(e,t,i){function r(){this.displayName="Cardboard VRDisplay (webvr-polyfill)",this.capabilities.hasOrientation=!0,this.capabilities.canPresent=!0,this.bufferScale_=WebVRConfig.BUFFER_SCALE,this.poseSensor_=new c,this.distorter_=null,this.cardboardUI_=null,this.dpdb_=new s(!0,this.onDeviceParamsUpdated_.bind(this)),this.deviceInfo_=new a(this.dpdb_.getDeviceParams()),this.viewerSelector_=new l,this.viewerSelector_.on("change",this.onViewerChanged_.bind(this)),this.deviceInfo_.setViewer(this.viewerSelector_.getCurrentViewer()),WebVRConfig.ROTATE_INSTRUCTIONS_DISABLED||(this.rotateInstructions_=new u),d.isIOS()&&window.addEventListener("resize",this.onResize_.bind(this))}var n=e("./cardboard-distorter.js"),o=e("./cardboard-ui.js"),a=e("./device-info.js"),s=e("./dpdb/dpdb.js"),c=e("./sensor-fusion/fusion-pose-sensor.js"),u=e("./rotate-instructions.js"),l=e("./viewer-selector.js"),h=e("./base.js").VRDisplay,d=e("./util.js"),p={LEFT:"left",RIGHT:"right"};r.prototype=new h,r.prototype.getImmediatePose=function(){return{position:this.poseSensor_.getPosition(),orientation:this.poseSensor_.getOrientation(),linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},r.prototype.resetPose=function(){this.poseSensor_.resetPose()},r.prototype.getEyeParameters=function(e){var t,i=[.5*this.deviceInfo_.viewer.interLensDistance,0,0];if(e==p.LEFT)i[0]*=-1,t=this.deviceInfo_.getFieldOfViewLeftEye();else{if(e!=p.RIGHT)return console.error("Invalid eye provided: %s",e),null;t=this.deviceInfo_.getFieldOfViewRightEye()}return{fieldOfView:t,offset:i,renderWidth:.5*this.deviceInfo_.device.width*this.bufferScale_,renderHeight:this.deviceInfo_.device.height*this.bufferScale_}},r.prototype.onDeviceParamsUpdated_=function(e){d.isDebug()&&console.log("DPDB reported that device params were updated."),this.deviceInfo_.updateDeviceParams(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_)},r.prototype.updateBounds_=function(){this.layer_&&this.distorter_&&(this.layer_.leftBounds||this.layer_.rightBounds)&&this.distorter_.setTextureBounds(this.layer_.leftBounds,this.layer_.rightBounds)},r.prototype.beginPresent_=function(){var e=this.layer_.source.getContext("webgl");e||(e=this.layer_.source.getContext("experimental-webgl")),e||(e=this.layer_.source.getContext("webgl2")),e&&(this.layer_.predistorted?WebVRConfig.CARDBOARD_UI_DISABLED||(e.canvas.width=d.getScreenWidth()*this.bufferScale_,e.canvas.height=d.getScreenHeight()*this.bufferScale_,this.cardboardUI_=new o(e)):(this.distorter_=new n(e),this.distorter_.updateDeviceInfo(this.deviceInfo_),this.cardboardUI_=this.distorter_.cardboardUI),this.cardboardUI_&&this.cardboardUI_.listen(function(e){this.viewerSelector_.show(this.layer_.source.parentElement),e.stopPropagation(),e.preventDefault()}.bind(this),function(e){this.exitPresent(),e.stopPropagation(),e.preventDefault()}.bind(this)),this.rotateInstructions_&&(d.isLandscapeMode()&&d.isMobile()?this.rotateInstructions_.showTemporarily(3e3,this.layer_.source.parentElement):this.rotateInstructions_.update()),this.orientationHandler=this.onOrientationChange_.bind(this),window.addEventListener("orientationchange",this.orientationHandler),this.vrdisplaypresentchangeHandler=this.updateBounds_.bind(this),window.addEventListener("vrdisplaypresentchange",this.vrdisplaypresentchangeHandler),this.fireVRDisplayDeviceParamsChange_())},r.prototype.endPresent_=function(){this.distorter_&&(this.distorter_.destroy(),this.distorter_=null),this.cardboardUI_&&(this.cardboardUI_.destroy(),this.cardboardUI_=null),this.rotateInstructions_&&this.rotateInstructions_.hide(),this.viewerSelector_.hide(),window.removeEventListener("orientationchange",this.orientationHandler),window.removeEventListener("vrdisplaypresentchange",this.vrdisplaypresentchangeHandler)},r.prototype.submitFrame=function(e){if(this.distorter_)this.distorter_.submitFrame();else if(this.cardboardUI_&&this.layer_){var t=this.layer_.source.getContext("webgl").canvas;t.width==this.lastWidth&&t.height==this.lastHeight||this.cardboardUI_.onResize(),this.lastWidth=t.width,this.lastHeight=t.height,this.cardboardUI_.render()}},r.prototype.onOrientationChange_=function(e){this.viewerSelector_.hide(),this.rotateInstructions_&&this.rotateInstructions_.update(),this.onResize_()},r.prototype.onResize_=function(e){if(this.layer_){var t=this.layer_.source.getContext("webgl"),i=["position: absolute","top: 0","left: 0","width: "+Math.max(screen.width,screen.height)+"px","height: "+Math.min(screen.height,screen.width)+"px","border: 0","margin: 0","padding: 0 10px 10px 0"];t.canvas.setAttribute("style",i.join("; ")+";"),d.safariCssSizeWorkaround(t.canvas)}},r.prototype.onViewerChanged_=function(e){this.deviceInfo_.setViewer(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_),this.fireVRDisplayDeviceParamsChange_()},r.prototype.fireVRDisplayDeviceParamsChange_=function(){var e=new CustomEvent("vrdisplaydeviceparamschange",{detail:{vrdisplay:this,deviceInfo:this.deviceInfo_}});window.dispatchEvent(e)},t.exports=r},{"./base.js":3,"./cardboard-distorter.js":4,"./cardboard-ui.js":5,"./device-info.js":8,"./dpdb/dpdb.js":13,
  "./rotate-instructions.js":17,"./sensor-fusion/fusion-pose-sensor.js":19,"./util.js":23,"./viewer-selector.js":24}],7:[function(e,t,i){function r(e,t,i){if(!t)return void i(e);for(var r=[],n=null,o=0;o<t.length;++o){var a=t[o];switch(a){case e.TEXTURE_BINDING_2D:case e.TEXTURE_BINDING_CUBE_MAP:var s=t[++o];if(s<e.TEXTURE0||s>e.TEXTURE31){console.error("TEXTURE_BINDING_2D or TEXTURE_BINDING_CUBE_MAP must be followed by a valid texture unit"),r.push(null,null);break}n||(n=e.getParameter(e.ACTIVE_TEXTURE)),e.activeTexture(s),r.push(e.getParameter(a),null);break;case e.ACTIVE_TEXTURE:n=e.getParameter(e.ACTIVE_TEXTURE),r.push(null);break;default:r.push(e.getParameter(a))}}i(e);for(var o=0;o<t.length;++o){var a=t[o],c=r[o];switch(a){case e.ACTIVE_TEXTURE:break;case e.ARRAY_BUFFER_BINDING:e.bindBuffer(e.ARRAY_BUFFER,c);break;case e.COLOR_CLEAR_VALUE:e.clearColor(c[0],c[1],c[2],c[3]);break;case e.COLOR_WRITEMASK:e.colorMask(c[0],c[1],c[2],c[3]);break;case e.CURRENT_PROGRAM:e.useProgram(c);break;case e.ELEMENT_ARRAY_BUFFER_BINDING:e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,c);break;case e.FRAMEBUFFER_BINDING:e.bindFramebuffer(e.FRAMEBUFFER,c);break;case e.RENDERBUFFER_BINDING:e.bindRenderbuffer(e.RENDERBUFFER,c);break;case e.TEXTURE_BINDING_2D:var s=t[++o];if(s<e.TEXTURE0||s>e.TEXTURE31)break;e.activeTexture(s),e.bindTexture(e.TEXTURE_2D,c);break;case e.TEXTURE_BINDING_CUBE_MAP:var s=t[++o];if(s<e.TEXTURE0||s>e.TEXTURE31)break;e.activeTexture(s),e.bindTexture(e.TEXTURE_CUBE_MAP,c);break;case e.VIEWPORT:e.viewport(c[0],c[1],c[2],c[3]);break;case e.BLEND:case e.CULL_FACE:case e.DEPTH_TEST:case e.SCISSOR_TEST:case e.STENCIL_TEST:c?e.enable(a):e.disable(a);break;default:console.log("No GL restore behavior for 0x"+a.toString(16))}n&&e.activeTexture(n)}}t.exports=r},{}],8:[function(e,t,i){function r(e){this.width=e.width||c.getScreenWidth(),this.height=e.height||c.getScreenHeight(),this.widthMeters=e.widthMeters,this.heightMeters=e.heightMeters,this.bevelMeters=e.bevelMeters}function n(e){this.viewer=h.CardboardV2,this.updateDeviceParams(e),this.distortion=new a(this.viewer.distortionCoefficients)}function o(e){this.id=e.id,this.label=e.label,this.fov=e.fov,this.interLensDistance=e.interLensDistance,this.baselineLensDistance=e.baselineLensDistance,this.screenLensDistance=e.screenLensDistance,this.distortionCoefficients=e.distortionCoefficients,this.inverseCoefficients=e.inverseCoefficients}var a=e("./distortion/distortion.js"),s=e("./math-util.js"),c=e("./util.js"),u=new r({widthMeters:.11,heightMeters:.062,bevelMeters:.004}),l=new r({widthMeters:.1038,heightMeters:.0584,bevelMeters:.004}),h={CardboardV1:new o({id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]}),CardboardV2:new o({id:"CardboardV2",label:"Cardboard I/O 2015",fov:60,interLensDistance:.064,baselineLensDistance:.035,screenLensDistance:.039,distortionCoefficients:[.34,.55],inverseCoefficients:[-.33836704,-.18162185,.862655,-1.2462051,1.0560602,-.58208317,.21609078,-.05444823,.009177956,-.0009904169,6183535e-11,-16981803e-13]})};n.prototype.updateDeviceParams=function(e){this.device=this.determineDevice_(e)||this.device},n.prototype.getDevice=function(){return this.device},n.prototype.setViewer=function(e){this.viewer=e,this.distortion=new a(this.viewer.distortionCoefficients)},n.prototype.determineDevice_=function(e){if(!e)return c.isIOS()?(console.warn("Using fallback iOS device measurements."),l):(console.warn("Using fallback Android device measurements."),u);var t=.0254,i=t/e.xdpi,n=t/e.ydpi,o=c.getScreenWidth(),a=c.getScreenHeight();return new r({widthMeters:i*o,heightMeters:n*a,bevelMeters:.001*e.bevelMm})},n.prototype.getDistortedFieldOfViewLeftEye=function(){var e=this.viewer,t=this.device,i=this.distortion,r=e.screenLensDistance,n=(t.widthMeters-e.interLensDistance)/2,o=e.interLensDistance/2,a=e.baselineLensDistance-t.bevelMeters,c=t.heightMeters-a,u=s.radToDeg*Math.atan(i.distort(n/r)),l=s.radToDeg*Math.atan(i.distort(o/r)),h=s.radToDeg*Math.atan(i.distort(a/r)),d=s.radToDeg*Math.atan(i.distort(c/r));return{leftDegrees:Math.min(u,e.fov),rightDegrees:Math.min(l,e.fov),downDegrees:Math.min(h,e.fov),upDegrees:Math.min(d,e.fov)}},n.prototype.getLeftEyeVisibleTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,r=Math.tan(-s.degToRad*e.fov),n=Math.tan(s.degToRad*e.fov),o=Math.tan(s.degToRad*e.fov),a=Math.tan(-s.degToRad*e.fov),c=t.widthMeters/4,u=t.heightMeters/2,l=e.baselineLensDistance-t.bevelMeters-u,h=e.interLensDistance/2-c,d=-l,p=e.screenLensDistance,f=i.distort((h-c)/p),m=i.distort((d+u)/p),g=i.distort((h+c)/p),v=i.distort((d-u)/p),y=new Float32Array(4);return y[0]=Math.max(r,f),y[1]=Math.min(n,m),y[2]=Math.min(o,g),y[3]=Math.max(a,v),y},n.prototype.getLeftEyeNoLensTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,r=new Float32Array(4),n=i.distortInverse(Math.tan(-s.degToRad*e.fov)),o=i.distortInverse(Math.tan(s.degToRad*e.fov)),a=i.distortInverse(Math.tan(s.degToRad*e.fov)),c=i.distortInverse(Math.tan(-s.degToRad*e.fov)),u=t.widthMeters/4,l=t.heightMeters/2,h=e.baselineLensDistance-t.bevelMeters-l,d=e.interLensDistance/2-u,p=-h,f=e.screenLensDistance,m=(d-u)/f,g=(p+l)/f,v=(d+u)/f,y=(p-l)/f;return r[0]=Math.max(n,m),r[1]=Math.min(o,g),r[2]=Math.min(a,v),r[3]=Math.max(c,y),r},n.prototype.getLeftEyeVisibleScreenRect=function(e){var t=this.viewer,i=this.device,r=t.screenLensDistance,n=(i.widthMeters-t.interLensDistance)/2,o=t.baselineLensDistance-i.bevelMeters,a=(e[0]*r+n)/i.widthMeters,s=(e[1]*r+o)/i.heightMeters,c=(e[2]*r+n)/i.widthMeters,u=(e[3]*r+o)/i.heightMeters;return{x:a,y:u,width:c-a,height:s-u}},n.prototype.getFieldOfViewLeftEye=function(e){return e?this.getUndistortedFieldOfViewLeftEye():this.getDistortedFieldOfViewLeftEye()},n.prototype.getFieldOfViewRightEye=function(e){var t=this.getFieldOfViewLeftEye(e);return{leftDegrees:t.rightDegrees,rightDegrees:t.leftDegrees,upDegrees:t.upDegrees,downDegrees:t.downDegrees}},n.prototype.getUndistortedFieldOfViewLeftEye=function(){var e=this.getUndistortedParams_();return{leftDegrees:s.radToDeg*Math.atan(e.outerDist),rightDegrees:s.radToDeg*Math.atan(e.innerDist),downDegrees:s.radToDeg*Math.atan(e.bottomDist),upDegrees:s.radToDeg*Math.atan(e.topDist)}},n.prototype.getUndistortedViewportLeftEye=function(){var e=this.getUndistortedParams_(),t=this.viewer,i=this.device,r=t.screenLensDistance,n=i.widthMeters/r,o=i.heightMeters/r,a=i.width/n,s=i.height/o,c=Math.round((e.eyePosX-e.outerDist)*a),u=Math.round((e.eyePosY-e.bottomDist)*s);return{x:c,y:u,width:Math.round((e.eyePosX+e.innerDist)*a)-c,height:Math.round((e.eyePosY+e.topDist)*s)-u}},n.prototype.getUndistortedParams_=function(){var e=this.viewer,t=this.device,i=this.distortion,r=e.screenLensDistance,n=e.interLensDistance/2/r,o=t.widthMeters/r,a=t.heightMeters/r,c=o/2-n,u=(e.baselineLensDistance-t.bevelMeters)/r,l=e.fov,h=i.distortInverse(Math.tan(s.degToRad*l)),d=Math.min(c,h),p=Math.min(n,h),f=Math.min(u,h),m=Math.min(a-u,h);return{outerDist:d,innerDist:p,topDist:m,bottomDist:f,eyePosX:c,eyePosY:u}},n.Viewers=h,t.exports=n},{"./distortion/distortion.js":10,"./math-util.js":15,"./util.js":23}],9:[function(e,t,i){function r(e){this.display=e,this.hardwareUnitId=e.displayId,this.deviceId="webvr-polyfill:HMD:"+e.displayId,this.deviceName=e.displayName+" (HMD)"}function n(e){this.display=e,this.hardwareUnitId=e.displayId,this.deviceId="webvr-polyfill:PositionSensor: "+e.displayId,this.deviceName=e.displayName+" (PositionSensor)"}var o=(e("./base.js").VRDisplay,e("./base.js").HMDVRDevice),a=e("./base.js").PositionSensorVRDevice;r.prototype=new o,r.prototype.getEyeParameters=function(e){var t=this.display.getEyeParameters(e);return{currentFieldOfView:t.fieldOfView,maximumFieldOfView:t.fieldOfView,minimumFieldOfView:t.fieldOfView,recommendedFieldOfView:t.fieldOfView,eyeTranslation:{x:t.offset[0],y:t.offset[1],z:t.offset[2]},renderRect:{x:"right"==e?t.renderWidth:0,y:0,width:t.renderWidth,height:t.renderHeight}}},r.prototype.setFieldOfView=function(e,t,i,r){},n.prototype=new a,n.prototype.getState=function(){var e=this.display.getPose();return{position:e.position?{x:e.position[0],y:e.position[1],z:e.position[2]}:null,orientation:e.orientation?{x:e.orientation[0],y:e.orientation[1],z:e.orientation[2],w:e.orientation[3]}:null,linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},n.prototype.resetState=function(){return this.positionDevice.resetPose()},t.exports.VRDisplayHMDDevice=r,t.exports.VRDisplayPositionSensorDevice=n},{"./base.js":3}],10:[function(e,t,i){function r(e){this.coefficients=e}r.prototype.distortInverse=function(e){for(var t=0,i=1,r=e-this.distort(t);Math.abs(i-t)>1e-4;){var n=e-this.distort(i),o=i-n*((i-t)/(n-r));t=i,i=o,r=n}return i},r.prototype.distort=function(e){for(var t=e*e,i=0,r=0;r<this.coefficients.length;r++)i=t*(i+this.coefficients[r]);return(i+1)*e},r.prototype.solveLinear_=function(e,t){for(var i=e.length,r=0;r<i-1;++r)for(var n=r+1;n<i;++n){for(var o=e[r][n]/e[r][r],a=r+1;a<i;++a)e[a][n]-=o*e[a][r];t[n]-=o*t[r]}for(var s=new Array(i),r=i-1;r>=0;--r){for(var c=t[r],a=r+1;a<i;++a)c-=e[a][r]*s[a];s[r]=c/e[r][r]}return s},r.prototype.solveLeastSquares_=function(e,t){var i,r,n,o,a=e.length,s=e[0].length;if(a!=t.Length)throw new Error("Matrix / vector dimension mismatch");var c=new Array(s);for(n=0;n<s;++n)for(c[n]=new Array(s),r=0;r<s;++r){for(o=0,i=0;i<a;++i)o+=e[r][i]*e[n][i];c[n][r]=o}var u=new Array(s);for(r=0;r<s;++r){for(o=0,i=0;i<a;++i)o+=e[r][i]*t[i];u[r]=o}return this.solveLinear_(c,u)},r.prototype.approximateInverse=function(e,t){e=e||1,t=t||100;var i,n,o=6,a=new Array(o);for(n=0;n<o;++n)a[n]=new Array(t);var s=new Array(t);for(i=0;i<t;++i){var c=e*(i+1)/t,u=this.distort(c),l=u;for(n=0;n<o;++n)l*=u*u,a[n][i]=l;s[i]=c-u}var h=this.solveLeastSquares_(a,s);return new r(h)},t.exports=r},{}],11:[function(e,t,i){var r={format:1,last_updated:"2016-01-20T00:18:35Z",devices:[{type:"android",rules:[{mdmh:"asus/*/Nexus 7/*"},{ua:"Nexus 7"}],dpi:[320.8,323],bw:3,ac:500},{type:"android",rules:[{mdmh:"asus/*/ASUS_Z00AD/*"},{ua:"ASUS_Z00AD"}],dpi:[403,404.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Google//Pixel XL/"},{ua:"Pixel XL"}],dpi:[537.9,533],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"HTC/*/HTC6435LVW/*"},{ua:"HTC6435LVW"}],dpi:[449.7,443.3],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"HTC/*/HTC One XL/*"},{ua:"HTC One XL"}],dpi:[315.3,314.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"htc/*/Nexus 9/*"},{ua:"Nexus 9"}],dpi:289,bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One M9/*"},{ua:"HTC One M9"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One_M8/*"},{ua:"HTC One_M8"}],dpi:[449.7,447.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One/*"},{ua:"HTC One"}],dpi:472.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Huawei/*/Nexus 6P/*"},{ua:"Nexus 6P"}],dpi:[515.1,518],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 5X/*"},{ua:"Nexus 5X"}],dpi:[422,419.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGMS345/*"},{ua:"LGMS345"}],dpi:[221.7,219.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/LG-D800/*"},{ua:"LG-D800"}],dpi:[422,424.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/LG-D850/*"},{ua:"LG-D850"}],dpi:[537.9,541.9],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/VS985 4G/*"},{ua:"VS985 4G"}],dpi:[537.9,535.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 5/*"},{ua:"Nexus 5 "}],dpi:[442.4,444.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 4/*"},{ua:"Nexus 4"}],dpi:[319.8,318.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LG-P769/*"},{ua:"LG-P769"}],dpi:[240.6,247.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGMS323/*"},{ua:"LGMS323"}],dpi:[206.6,204.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGLS996/*"},{ua:"LGLS996"}],dpi:[403.4,401.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/4560MMX/*"},{ua:"4560MMX"}],dpi:[240,219.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/A250/*"},{ua:"Micromax A250"}],dpi:[480,446.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/Micromax AQ4501/*"},{ua:"Micromax AQ4501"}],dpi:240,bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/DROID RAZR/*"},{ua:"DROID RAZR"}],dpi:[368.1,256.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT830C/*"},{ua:"XT830C"}],dpi:[254,255.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1021/*"},{ua:"XT1021"}],dpi:[254,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1023/*"},{ua:"XT1023"}],dpi:[254,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1028/*"},{ua:"XT1028"}],dpi:[326.6,327.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1034/*"},{ua:"XT1034"}],dpi:[326.6,328.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1053/*"},{ua:"XT1053"}],dpi:[315.3,316.1],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1562/*"},{ua:"XT1562"}],dpi:[403.4,402.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/Nexus 6/*"},{ua:"Nexus 6 "}],dpi:[494.3,489.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1063/*"},{ua:"XT1063"}],dpi:[295,296.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1064/*"},{ua:"XT1064"}],dpi:[295,295.6],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1092/*"},{ua:"XT1092"}],dpi:[422,424.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1095/*"},{ua:"XT1095"}],dpi:[422,423.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/G4/*"},{ua:"Moto G (4)"}],dpi:401,bw:4,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/A0001/*"},{ua:"A0001"}],dpi:[403.4,401],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE E1005/*"},{ua:"ONE E1005"}],dpi:[442.4,441.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE A2005/*"},{ua:"ONE A2005"}],dpi:[391.9,405.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OPPO/*/X909/*"},{ua:"X909"}],dpi:[442.4,444.1],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9082/*"},{ua:"GT-I9082"}],dpi:[184.7,185.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G360P/*"},{ua:"SM-G360P"}],dpi:[196.7,205.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/Nexus S/*"},{ua:"Nexus S"}],dpi:[234.5,229.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300/*"},{ua:"GT-I9300"}],dpi:[304.8,303.9],bw:5,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-T230NU/*"},{ua:"SM-T230NU"}],dpi:216,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SGH-T399/*"},{ua:"SGH-T399"}],dpi:[217.7,231.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N9005/*"},{ua:"SM-N9005"}],dpi:[386.4,387],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SAMSUNG-SM-N900A/*"},{ua:"SAMSUNG-SM-N900A"}],dpi:[386.4,387.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9500/*"},{ua:"GT-I9500"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/GT-I9505/*"},{ua:"GT-I9505"}],dpi:439.4,bw:4,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G900F/*"},{ua:"SM-G900F"}],dpi:[415.6,431.6],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G900M/*"},{ua:"SM-G900M"}],dpi:[415.6,431.6],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G800F/*"},{ua:"SM-G800F"}],dpi:326.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G906S/*"},{ua:"SM-G906S"}],dpi:[562.7,572.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300/*"},{ua:"GT-I9300"}],dpi:[306.7,304.8],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-T535/*"},{ua:"SM-T535"}],dpi:[142.6,136.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-N920C/*"},{ua:"SM-N920C"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300I/*"},{ua:"GT-I9300I"}],dpi:[304.8,305.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9195/*"},{ua:"GT-I9195"}],dpi:[249.4,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SPH-L520/*"},{ua:"SPH-L520"}],dpi:[249.4,255.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SAMSUNG-SGH-I717/*"},{ua:"SAMSUNG-SGH-I717"}],dpi:285.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SPH-D710/*"},{ua:"SPH-D710"}],dpi:[217.7,204.2],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-N7100/*"},{ua:"GT-N7100"}],dpi:265.1,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SCH-I605/*"},{ua:"SCH-I605"}],dpi:265.1,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/Galaxy Nexus/*"},{ua:"Galaxy Nexus"}],dpi:[315.3,314.2],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N910H/*"},{ua:"SM-N910H"}],dpi:[515.1,518],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N910C/*"},{ua:"SM-N910C"}],dpi:[515.2,520.2],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G130M/*"},{ua:"SM-G130M"}],dpi:[165.9,164.8],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G928I/*"},{ua:"SM-G928I"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G920F/*"},{ua:"SM-G920F"}],dpi:580.6,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G920P/*"},{ua:"SM-G920P"}],dpi:[522.5,577],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G925F/*"},{ua:"SM-G925F"}],dpi:580.6,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G925V/*"},{ua:"SM-G925V"}],dpi:[522.5,576.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G935F/*"},{ua:"SM-G935F"}],dpi:534,bw:3,ac:500},{type:"android",rules:[{mdmh:"Sony/*/C6903/*"},{ua:"C6903"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"Sony/*/D6653/*"},{ua:"D6653"}],dpi:[428.6,427.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/E6653/*"},{ua:"E6653"}],dpi:[428.6,425.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/E6853/*"},{ua:"E6853"}],dpi:[403.4,401.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/SGP321/*"},{ua:"SGP321"}],dpi:[224.7,224.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"TCT/*/ALCATEL ONE TOUCH Fierce/*"},{ua:"ALCATEL ONE TOUCH Fierce"}],dpi:[240,247.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"THL/*/thl 5000/*"},{ua:"thl 5000"}],dpi:[480,443.3],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"ZTE/*/ZTE Blade L2/*"},{ua:"ZTE Blade L2"}],dpi:240,bw:3,ac:500},{type:"ios",rules:[{res:[640,960]}],dpi:[325.1,328.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[640,1136]}],dpi:[317.1,320.2],bw:3,ac:1e3},{type:"ios",rules:[{res:[750,1334]}],dpi:326.4,bw:4,ac:1e3},{type:"ios",rules:[{res:[1242,2208]}],dpi:[453.6,458.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[1125,2001]}],dpi:[410.9,415.4],bw:4,ac:1e3}]};t.exports=r},{}],12:[function(e,t,i){t.exports={format:1,last_updated:"2017-01-12T08:41:55Z",devices:[{type:"android",rules:[{mdmh:"asus/*/Nexus 7/*"},{ua:"Nexus 7"}],dpi:[320.8,323],bw:3,ac:500},{type:"android",rules:[{mdmh:"asus/*/ASUS_Z00AD/*"},{ua:"ASUS_Z00AD"}],dpi:[403,404.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Google//Pixel XL/"},{ua:"Pixel XL"}],dpi:[537.9,533],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"HTC/*/HTC6435LVW/*"},{ua:"HTC6435LVW"}],dpi:[449.7,443.3],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"HTC/*/HTC One XL/*"},{ua:"HTC One XL"}],dpi:[315.3,314.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"htc/*/Nexus 9/*"},{ua:"Nexus 9"}],dpi:289,bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One M9/*"},{ua:"HTC One M9"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One_M8/*"},{ua:"HTC One_M8"}],dpi:[449.7,447.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One/*"},{ua:"HTC One"}],dpi:472.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Huawei/*/Nexus 6P/*"},{ua:"Nexus 6P"}],dpi:[515.1,518],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 5X/*"},{ua:"Nexus 5X"}],dpi:[422,419.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGMS345/*"},{ua:"LGMS345"}],dpi:[221.7,219.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/LG-D800/*"},{ua:"LG-D800"}],dpi:[422,424.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/LG-D850/*"},{ua:"LG-D850"}],dpi:[537.9,541.9],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/VS985 4G/*"},{ua:"VS985 4G"}],dpi:[537.9,535.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 5/*"},{ua:"Nexus 5 B"}],dpi:[442.4,444.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 4/*"},{ua:"Nexus 4"}],dpi:[319.8,318.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LG-P769/*"},{ua:"LG-P769"}],dpi:[240.6,247.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGMS323/*"},{ua:"LGMS323"}],dpi:[206.6,204.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGLS996/*"},{ua:"LGLS996"}],dpi:[403.4,401.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/4560MMX/*"},{ua:"4560MMX"}],dpi:[240,219.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/A250/*"},{ua:"Micromax A250"}],dpi:[480,446.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/Micromax AQ4501/*"},{ua:"Micromax AQ4501"}],dpi:240,bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/DROID RAZR/*"},{ua:"DROID RAZR"}],dpi:[368.1,256.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT830C/*"},{ua:"XT830C"}],dpi:[254,255.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1021/*"},{ua:"XT1021"}],dpi:[254,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1023/*"},{ua:"XT1023"}],dpi:[254,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1028/*"},{ua:"XT1028"}],dpi:[326.6,327.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1034/*"},{ua:"XT1034"}],dpi:[326.6,328.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1053/*"},{ua:"XT1053"}],dpi:[315.3,316.1],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1562/*"},{ua:"XT1562"}],dpi:[403.4,402.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/Nexus 6/*"},{ua:"Nexus 6 B"}],dpi:[494.3,489.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1063/*"},{ua:"XT1063"}],dpi:[295,296.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1064/*"},{ua:"XT1064"}],dpi:[295,295.6],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1092/*"},{ua:"XT1092"}],dpi:[422,424.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1095/*"},{ua:"XT1095"}],dpi:[422,423.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/G4/*"},{ua:"Moto G (4)"}],dpi:401,bw:4,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/A0001/*"},{ua:"A0001"}],dpi:[403.4,401],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE E1005/*"},{ua:"ONE E1005"}],dpi:[442.4,441.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE A2005/*"},{ua:"ONE A2005"}],dpi:[391.9,405.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OPPO/*/X909/*"},{ua:"X909"}],dpi:[442.4,444.1],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9082/*"},{ua:"GT-I9082"}],dpi:[184.7,185.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G360P/*"},{ua:"SM-G360P"}],dpi:[196.7,205.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/Nexus S/*"},{ua:"Nexus S"}],dpi:[234.5,229.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300/*"},{ua:"GT-I9300"}],dpi:[304.8,303.9],bw:5,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-T230NU/*"},{ua:"SM-T230NU"}],dpi:216,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SGH-T399/*"},{ua:"SGH-T399"}],dpi:[217.7,231.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N9005/*"},{ua:"SM-N9005"}],dpi:[386.4,387],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SAMSUNG-SM-N900A/*"},{ua:"SAMSUNG-SM-N900A"}],dpi:[386.4,387.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9500/*"},{ua:"GT-I9500"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/GT-I9505/*"},{ua:"GT-I9505"}],dpi:439.4,bw:4,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G900F/*"},{ua:"SM-G900F"}],dpi:[415.6,431.6],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G900M/*"},{ua:"SM-G900M"}],dpi:[415.6,431.6],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G800F/*"},{ua:"SM-G800F"}],dpi:326.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G906S/*"},{ua:"SM-G906S"}],dpi:[562.7,572.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300/*"},{ua:"GT-I9300"}],dpi:[306.7,304.8],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-T535/*"},{ua:"SM-T535"}],dpi:[142.6,136.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-N920C/*"},{ua:"SM-N920C"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N920W8/*"},{ua:"SM-N920W8"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300I/*"},{ua:"GT-I9300I"}],dpi:[304.8,305.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9195/*"},{ua:"GT-I9195"}],dpi:[249.4,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SPH-L520/*"},{ua:"SPH-L520"}],dpi:[249.4,255.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SAMSUNG-SGH-I717/*"},{ua:"SAMSUNG-SGH-I717"}],dpi:285.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SPH-D710/*"},{ua:"SPH-D710"}],dpi:[217.7,204.2],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-N7100/*"},{ua:"GT-N7100"}],dpi:265.1,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SCH-I605/*"},{ua:"SCH-I605"}],dpi:265.1,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/Galaxy Nexus/*"},{ua:"Galaxy Nexus"}],dpi:[315.3,314.2],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N910H/*"},{ua:"SM-N910H"}],dpi:[515.1,518],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N910C/*"},{ua:"SM-N910C"}],dpi:[515.2,520.2],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G130M/*"},{ua:"SM-G130M"}],dpi:[165.9,164.8],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G928I/*"},{ua:"SM-G928I"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G920F/*"},{ua:"SM-G920F"}],dpi:580.6,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G920P/*"},{ua:"SM-G920P"}],dpi:[522.5,577],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G925F/*"},{ua:"SM-G925F"}],dpi:580.6,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G925V/*"},{ua:"SM-G925V"}],dpi:[522.5,576.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G930F/*"},{ua:"SM-G930F"}],dpi:576.6,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G935F/*"},{ua:"SM-G935F"}],dpi:533,bw:3,ac:500},{type:"android",rules:[{mdmh:"Sony/*/C6903/*"},{ua:"C6903"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"Sony/*/D6653/*"},{ua:"D6653"}],dpi:[428.6,427.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/E6653/*"},{ua:"E6653"}],dpi:[428.6,425.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/E6853/*"},{ua:"E6853"}],dpi:[403.4,401.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/SGP321/*"},{ua:"SGP321"}],dpi:[224.7,224.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"TCT/*/ALCATEL ONE TOUCH Fierce/*"},{ua:"ALCATEL ONE TOUCH Fierce"}],dpi:[240,247.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"THL/*/thl 5000/*"},{ua:"thl 5000"}],dpi:[480,443.3],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"ZTE/*/ZTE Blade L2/*"},{ua:"ZTE Blade L2"}],dpi:240,bw:3,ac:500},{type:"ios",rules:[{res:[640,960]}],dpi:[325.1,328.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[640,1136]}],dpi:[317.1,320.2],bw:3,ac:1e3},{type:"ios",rules:[{res:[750,1334]}],dpi:326.4,bw:4,ac:1e3},{type:"ios",rules:[{res:[1242,2208]}],dpi:[453.6,458.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[1125,2001]}],dpi:[410.9,415.4],bw:4,ac:1e3}]}},{}],13:[function(e,t,i){function r(e,t){if(this.dpdb=o,this.recalculateDeviceParams_(),e){this.onDeviceParamsUpdated=t;var i=new XMLHttpRequest,r=this;i.open("GET",s,!0),i.addEventListener("load",function(){r.loading=!1,i.status>=200&&i.status<=299?(r.dpdb=JSON.parse(i.response),r.recalculateDeviceParams_()):console.error("Error loading online DPDB!")}),i.send()}}function n(e){this.xdpi=e.xdpi,this.ydpi=e.ydpi,this.bevelMm=e.bevelMm}var o=e("./dpdb-cache.js"),a=e("../util.js"),s=e("./dpdb.json");r.prototype.getDeviceParams=function(){return this.deviceParams},r.prototype.recalculateDeviceParams_=function(){var e=this.calcDeviceParams_();e?(this.deviceParams=e,this.onDeviceParamsUpdated&&this.onDeviceParamsUpdated(this.deviceParams)):console.error("Failed to recalculate device parameters.")},r.prototype.calcDeviceParams_=function(){var e=this.dpdb;if(!e)return console.error("DPDB not available."),null;if(1!=e.format)return console.error("DPDB has unexpected format version."),null;if(!e.devices||!e.devices.length)return console.error("DPDB does not have a devices section."),null;var t=navigator.userAgent||navigator.vendor||window.opera,i=a.getScreenWidth(),r=a.getScreenHeight();if(!e.devices)return console.error("DPDB has no devices section."),null;for(var o=0;o<e.devices.length;o++){var s=e.devices[o];if(s.rules)if("ios"==s.type||"android"==s.type){if(a.isIOS()==("ios"==s.type)){for(var c=!1,u=0;u<s.rules.length;u++){var l=s.rules[u];if(this.matchRule_(l,t,i,r)){c=!0;break}}if(c){var h=s.dpi[0]||s.dpi,d=s.dpi[1]||s.dpi;return new n({xdpi:h,ydpi:d,bevelMm:s.bw})}}}else console.warn("Device["+o+"] has invalid type.");else console.warn("Device["+o+"] has no rules section.")}return console.warn("No DPDB device match."),null},r.prototype.matchRule_=function(e,t,i,r){if(!e.ua&&!e.res)return!1;if(e.ua&&t.indexOf(e.ua)<0)return!1;if(e.res){if(!e.res[0]||!e.res[1])return!1;var n=e.res[0],o=e.res[1];if(Math.min(i,r)!=Math.min(n,o)||Math.max(i,r)!=Math.max(n,o))return!1}return!0},t.exports=r},{"../util.js":23,"./dpdb-cache.js":11,"./dpdb.json":12}],14:[function(e,t,i){var r=e("./util.js"),n=e("./webvr-polyfill.js").WebVRPolyfill;window.WebVRConfig=r.extend({FORCE_ENABLE_VR:!1,K_FILTER:.98,PREDICTION_TIME_S:.04,TOUCH_PANNER_DISABLED:!0,CARDBOARD_UI_DISABLED:!1,ROTATE_INSTRUCTIONS_DISABLED:!1,YAW_ONLY:!1,MOUSE_KEYBOARD_CONTROLS_DISABLED:!1,DEFER_INITIALIZATION:!1,ENABLE_DEPRECATED_API:!1,BUFFER_SCALE:.5,DIRTY_SUBMIT_FRAME_BINDINGS:!1,ALWAYS_APPEND_POLYFILL_DISPLAY:!1},window.WebVRConfig),window.WebVRConfig.DEFER_INITIALIZATION?window.InitializeWebVRPolyfill=function(){new n}:new n},{"./util.js":23,"./webvr-polyfill.js":26}],15:[function(e,t,i){var r=window.MathUtil||{};r.degToRad=Math.PI/180,r.radToDeg=180/Math.PI,r.Vector2=function(e,t){this.x=e||0,this.y=t||0},r.Vector2.prototype={constructor:r.Vector2,set:function(e,t){return this.x=e,this.y=t,this},copy:function(e){return this.x=e.x,this.y=e.y,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}},r.Vector3=function(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0},r.Vector3.prototype={constructor:r.Vector3,set:function(e,t,i){return this.x=e,this.y=t,this.z=i,this},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},normalize:function(){var e=this.length();if(0!==e){var t=1/e;this.multiplyScalar(t)}else this.x=0,this.y=0,this.z=0;return this},multiplyScalar:function(e){this.x*=e,this.y*=e,this.z*=e},applyQuaternion:function(e){var t=this.x,i=this.y,r=this.z,n=e.x,o=e.y,a=e.z,s=e.w,c=s*t+o*r-a*i,u=s*i+a*t-n*r,l=s*r+n*i-o*t,h=-n*t-o*i-a*r;return this.x=c*s+h*-n+u*-a-l*-o,this.y=u*s+h*-o+l*-n-c*-a,this.z=l*s+h*-a+c*-o-u*-n,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},crossVectors:function(e,t){var i=e.x,r=e.y,n=e.z,o=t.x,a=t.y,s=t.z;return this.x=r*s-n*a,this.y=n*o-i*s,this.z=i*a-r*o,this}},r.Quaternion=function(e,t,i,r){this.x=e||0,this.y=t||0,this.z=i||0,this.w=void 0!==r?r:1},r.Quaternion.prototype={constructor:r.Quaternion,set:function(e,t,i,r){return this.x=e,this.y=t,this.z=i,this.w=r,this},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},setFromEulerXYZ:function(e,t,i){var r=Math.cos(e/2),n=Math.cos(t/2),o=Math.cos(i/2),a=Math.sin(e/2),s=Math.sin(t/2),c=Math.sin(i/2);return this.x=a*n*o+r*s*c,this.y=r*s*o-a*n*c,this.z=r*n*c+a*s*o,this.w=r*n*o-a*s*c,this},setFromEulerYXZ:function(e,t,i){var r=Math.cos(e/2),n=Math.cos(t/2),o=Math.cos(i/2),a=Math.sin(e/2),s=Math.sin(t/2),c=Math.sin(i/2);return this.x=a*n*o+r*s*c,this.y=r*s*o-a*n*c,
  this.z=r*n*c-a*s*o,this.w=r*n*o+a*s*c,this},setFromAxisAngle:function(e,t){var i=t/2,r=Math.sin(i);return this.x=e.x*r,this.y=e.y*r,this.z=e.z*r,this.w=Math.cos(i),this},multiply:function(e){return this.multiplyQuaternions(this,e)},multiplyQuaternions:function(e,t){var i=e.x,r=e.y,n=e.z,o=e.w,a=t.x,s=t.y,c=t.z,u=t.w;return this.x=i*u+o*a+r*c-n*s,this.y=r*u+o*s+n*a-i*c,this.z=n*u+o*c+i*s-r*a,this.w=o*u-i*a-r*s-n*c,this},inverse:function(){return this.x*=-1,this.y*=-1,this.z*=-1,this.normalize(),this},normalize:function(){var e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);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},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var i=this.x,r=this.y,n=this.z,o=this.w,a=o*e.w+i*e.x+r*e.y+n*e.z;if(a<0?(this.w=-e.w,this.x=-e.x,this.y=-e.y,this.z=-e.z,a=-a):this.copy(e),a>=1)return this.w=o,this.x=i,this.y=r,this.z=n,this;var s=Math.acos(a),c=Math.sqrt(1-a*a);if(Math.abs(c)<.001)return this.w=.5*(o+this.w),this.x=.5*(i+this.x),this.y=.5*(r+this.y),this.z=.5*(n+this.z),this;var u=Math.sin((1-t)*s)/c,l=Math.sin(t*s)/c;return this.w=o*u+this.w*l,this.x=i*u+this.x*l,this.y=r*u+this.y*l,this.z=n*u+this.z*l,this},setFromUnitVectors:function(){var e,t,i=1e-6;return function(n,o){return void 0===e&&(e=new r.Vector3),t=n.dot(o)+1,t<i?(t=0,Math.abs(n.x)>Math.abs(n.z)?e.set(-n.y,n.x,0):e.set(0,-n.z,n.y)):e.crossVectors(n,o),this.x=e.x,this.y=e.y,this.z=e.z,this.w=t,this.normalize(),this}}()},t.exports=r},{}],16:[function(e,t,i){function r(){this.displayName="Mouse and Keyboard VRDisplay (webvr-polyfill)",this.capabilities.hasOrientation=!0,window.addEventListener("keydown",this.onKeyDown_.bind(this)),window.addEventListener("mousemove",this.onMouseMove_.bind(this)),window.addEventListener("mousedown",this.onMouseDown_.bind(this)),window.addEventListener("mouseup",this.onMouseUp_.bind(this)),this.phi_=0,this.theta_=0,this.targetAngle_=null,this.angleAnimation_=null,this.orientation_=new o.Quaternion,this.rotateStart_=new o.Vector2,this.rotateEnd_=new o.Vector2,this.rotateDelta_=new o.Vector2,this.isDragging_=!1,this.orientationOut_=new Float32Array(4)}var n=e("./base.js").VRDisplay,o=e("./math-util.js"),a=e("./util.js"),s=.15,c=80,u=.5,l=.3;r.prototype=new n,r.prototype.getImmediatePose=function(){return this.orientation_.setFromEulerYXZ(this.phi_,this.theta_,0),this.orientationOut_[0]=this.orientation_.x,this.orientationOut_[1]=this.orientation_.y,this.orientationOut_[2]=this.orientation_.z,this.orientationOut_[3]=this.orientation_.w,{position:null,orientation:this.orientationOut_,linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},r.prototype.onKeyDown_=function(e){38==e.keyCode?this.animatePhi_(this.phi_+s):39==e.keyCode?this.animateTheta_(this.theta_-s):40==e.keyCode?this.animatePhi_(this.phi_-s):37==e.keyCode&&this.animateTheta_(this.theta_+s)},r.prototype.animateTheta_=function(e){this.animateKeyTransitions_("theta_",e)},r.prototype.animatePhi_=function(e){e=a.clamp(e,-Math.PI/2,Math.PI/2),this.animateKeyTransitions_("phi_",e)},r.prototype.animateKeyTransitions_=function(e,t){this.angleAnimation_&&cancelAnimationFrame(this.angleAnimation_);var i=this[e],r=new Date;this.angleAnimation_=requestAnimationFrame(function n(){var o=new Date-r;if(o>=c)return this[e]=t,void cancelAnimationFrame(this.angleAnimation_);this.angleAnimation_=requestAnimationFrame(n.bind(this));var a=o/c;this[e]=i+(t-i)*a}.bind(this))},r.prototype.onMouseDown_=function(e){this.rotateStart_.set(e.clientX,e.clientY),this.isDragging_=!0},r.prototype.onMouseMove_=function(e){if(this.isDragging_||this.isPointerLocked_()){if(this.isPointerLocked_()){var t=e.movementX||e.mozMovementX||0,i=e.movementY||e.mozMovementY||0;this.rotateEnd_.set(this.rotateStart_.x-t,this.rotateStart_.y-i)}else this.rotateEnd_.set(e.clientX,e.clientY);this.rotateDelta_.subVectors(this.rotateEnd_,this.rotateStart_),this.rotateStart_.copy(this.rotateEnd_),this.phi_+=2*Math.PI*this.rotateDelta_.y/screen.height*l,this.theta_+=2*Math.PI*this.rotateDelta_.x/screen.width*u,this.phi_=a.clamp(this.phi_,-Math.PI/2,Math.PI/2)}},r.prototype.onMouseUp_=function(e){this.isDragging_=!1},r.prototype.isPointerLocked_=function(){var e=document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement;return void 0!==e},r.prototype.resetPose=function(){this.phi_=0,this.theta_=0},t.exports=r},{"./base.js":3,"./math-util.js":15,"./util.js":23}],17:[function(e,t,i){function r(){this.loadIcon_();var e=document.createElement("div"),t=e.style;t.position="fixed",t.top=0,t.right=0,t.bottom=0,t.left=0,t.backgroundColor="gray",t.fontFamily="sans-serif",t.zIndex=1e6;var i=document.createElement("img");i.src=this.icon;var t=i.style;t.marginLeft="25%",t.marginTop="25%",t.width="50%",e.appendChild(i);var r=document.createElement("div"),t=r.style;t.textAlign="center",t.fontSize="16px",t.lineHeight="24px",t.margin="24px 25%",t.width="50%",r.innerHTML="Place your phone into your Cardboard viewer.",e.appendChild(r);var n=document.createElement("div"),t=n.style;t.backgroundColor="#CFD8DC",t.position="fixed",t.bottom=0,t.width="100%",t.height="48px",t.padding="14px 24px",t.boxSizing="border-box",t.color="#656A6B",e.appendChild(n);var o=document.createElement("div");o.style.float="left",o.innerHTML="No Cardboard viewer?";var a=document.createElement("a");a.href="https://www.google.com/get/cardboard/get-cardboard/",a.innerHTML="get one",a.target="_blank";var t=a.style;t.float="right",t.fontWeight=600,t.textTransform="uppercase",t.borderLeft="1px solid gray",t.paddingLeft="24px",t.textDecoration="none",t.color="#656A6B",n.appendChild(o),n.appendChild(a),this.overlay=e,this.text=r,this.hide()}var n=e("./util.js");r.prototype.show=function(e){e||this.overlay.parentElement?e&&(this.overlay.parentElement&&this.overlay.parentElement!=e&&this.overlay.parentElement.removeChild(this.overlay),e.appendChild(this.overlay)):document.body.appendChild(this.overlay),this.overlay.style.display="block";var t=this.overlay.querySelector("img"),i=t.style;n.isLandscapeMode()?(i.width="20%",i.marginLeft="40%",i.marginTop="3%"):(i.width="50%",i.marginLeft="25%",i.marginTop="25%")},r.prototype.hide=function(){this.overlay.style.display="none"},r.prototype.showTemporarily=function(e,t){this.show(t),this.timer=setTimeout(this.hide.bind(this),e)},r.prototype.disableShowTemporarily=function(){clearTimeout(this.timer)},r.prototype.update=function(){this.disableShowTemporarily(),!n.isLandscapeMode()&&n.isMobile()?this.show():this.hide()},r.prototype.loadIcon_=function(){this.icon=n.base64("image/svg+xml","PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjE5OHB4IiBoZWlnaHQ9IjI0MHB4IiB2aWV3Qm94PSIwIDAgMTk4IDI0MCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4bWxuczpza2V0Y2g9Imh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaC9ucyI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDMuMy4zICgxMjA4MSkgLSBodHRwOi8vd3d3LmJvaGVtaWFuY29kaW5nLmNvbS9za2V0Y2ggLS0+CiAgICA8dGl0bGU+dHJhbnNpdGlvbjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPjwvZGVmcz4KICAgIDxnIGlkPSJQYWdlLTEiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHNrZXRjaDp0eXBlPSJNU1BhZ2UiPgogICAgICAgIDxnIGlkPSJ0cmFuc2l0aW9uIiBza2V0Y2g6dHlwZT0iTVNBcnRib2FyZEdyb3VwIj4KICAgICAgICAgICAgPGcgaWQ9IkltcG9ydGVkLUxheWVycy1Db3B5LTQtKy1JbXBvcnRlZC1MYXllcnMtQ29weS0rLUltcG9ydGVkLUxheWVycy1Db3B5LTItQ29weSIgc2tldGNoOnR5cGU9Ik1TTGF5ZXJHcm91cCI+CiAgICAgICAgICAgICAgICA8ZyBpZD0iSW1wb3J0ZWQtTGF5ZXJzLUNvcHktNCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMC4wMDAwMDAsIDEwNy4wMDAwMDApIiBza2V0Y2g6dHlwZT0iTVNTaGFwZUdyb3VwIj4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTQ5LjYyNSwyLjUyNyBDMTQ5LjYyNSwyLjUyNyAxNTUuODA1LDYuMDk2IDE1Ni4zNjIsNi40MTggTDE1Ni4zNjIsNy4zMDQgQzE1Ni4zNjIsNy40ODEgMTU2LjM3NSw3LjY2NCAxNTYuNCw3Ljg1MyBDMTU2LjQxLDcuOTM0IDE1Ni40Miw4LjAxNSAxNTYuNDI3LDguMDk1IEMxNTYuNTY3LDkuNTEgMTU3LjQwMSwxMS4wOTMgMTU4LjUzMiwxMi4wOTQgTDE2NC4yNTIsMTcuMTU2IEwxNjQuMzMzLDE3LjA2NiBDMTY0LjMzMywxNy4wNjYgMTY4LjcxNSwxNC41MzYgMTY5LjU2OCwxNC4wNDIgQzE3MS4wMjUsMTQuODgzIDE5NS41MzgsMjkuMDM1IDE5NS41MzgsMjkuMDM1IEwxOTUuNTM4LDgzLjAzNiBDMTk1LjUzOCw4My44MDcgMTk1LjE1Miw4NC4yNTMgMTk0LjU5LDg0LjI1MyBDMTk0LjM1Nyw4NC4yNTMgMTk0LjA5NSw4NC4xNzcgMTkzLjgxOCw4NC4wMTcgTDE2OS44NTEsNzAuMTc5IEwxNjkuODM3LDcwLjIwMyBMMTQyLjUxNSw4NS45NzggTDE0MS42NjUsODQuNjU1IEMxMzYuOTM0LDgzLjEyNiAxMzEuOTE3LDgxLjkxNSAxMjYuNzE0LDgxLjA0NSBDMTI2LjcwOSw4MS4wNiAxMjYuNzA3LDgxLjA2OSAxMjYuNzA3LDgxLjA2OSBMMTIxLjY0LDk4LjAzIEwxMTMuNzQ5LDEwMi41ODYgTDExMy43MTIsMTAyLjUyMyBMMTEzLjcxMiwxMzAuMTEzIEMxMTMuNzEyLDEzMC44ODUgMTEzLjMyNiwxMzEuMzMgMTEyLjc2NCwxMzEuMzMgQzExMi41MzIsMTMxLjMzIDExMi4yNjksMTMxLjI1NCAxMTEuOTkyLDEzMS4wOTQgTDY5LjUxOSwxMDYuNTcyIEM2OC41NjksMTA2LjAyMyA2Ny43OTksMTA0LjY5NSA2Ny43OTksMTAzLjYwNSBMNjcuNzk5LDEwMi41NyBMNjcuNzc4LDEwMi42MTcgQzY3LjI3LDEwMi4zOTMgNjYuNjQ4LDEwMi4yNDkgNjUuOTYyLDEwMi4yMTggQzY1Ljg3NSwxMDIuMjE0IDY1Ljc4OCwxMDIuMjEyIDY1LjcwMSwxMDIuMjEyIEM2NS42MDYsMTAyLjIxMiA2NS41MTEsMTAyLjIxNSA2NS40MTYsMTAyLjIxOSBDNjUuMTk1LDEwMi4yMjkgNjQuOTc0LDEwMi4yMzUgNjQuNzU0LDEwMi4yMzUgQzY0LjMzMSwxMDIuMjM1IDYzLjkxMSwxMDIuMjE2IDYzLjQ5OCwxMDIuMTc4IEM2MS44NDMsMTAyLjAyNSA2MC4yOTgsMTAxLjU3OCA1OS4wOTQsMTAwLjg4MiBMMTIuNTE4LDczLjk5MiBMMTIuNTIzLDc0LjAwNCBMMi4yNDUsNTUuMjU0IEMxLjI0NCw1My40MjcgMi4wMDQsNTEuMDM4IDMuOTQzLDQ5LjkxOCBMNTkuOTU0LDE3LjU3MyBDNjAuNjI2LDE3LjE4NSA2MS4zNSwxNy4wMDEgNjIuMDUzLDE3LjAwMSBDNjMuMzc5LDE3LjAwMSA2NC42MjUsMTcuNjYgNjUuMjgsMTguODU0IEw2NS4yODUsMTguODUxIEw2NS41MTIsMTkuMjY0IEw2NS41MDYsMTkuMjY4IEM2NS45MDksMjAuMDAzIDY2LjQwNSwyMC42OCA2Ni45ODMsMjEuMjg2IEw2Ny4yNiwyMS41NTYgQzY5LjE3NCwyMy40MDYgNzEuNzI4LDI0LjM1NyA3NC4zNzMsMjQuMzU3IEM3Ni4zMjIsMjQuMzU3IDc4LjMyMSwyMy44NCA4MC4xNDgsMjIuNzg1IEM4MC4xNjEsMjIuNzg1IDg3LjQ2NywxOC41NjYgODcuNDY3LDE4LjU2NiBDODguMTM5LDE4LjE3OCA4OC44NjMsMTcuOTk0IDg5LjU2NiwxNy45OTQgQzkwLjg5MiwxNy45OTQgOTIuMTM4LDE4LjY1MiA5Mi43OTIsMTkuODQ3IEw5Ni4wNDIsMjUuNzc1IEw5Ni4wNjQsMjUuNzU3IEwxMDIuODQ5LDI5LjY3NCBMMTAyLjc0NCwyOS40OTIgTDE0OS42MjUsMi41MjcgTTE0OS42MjUsMC44OTIgQzE0OS4zNDMsMC44OTIgMTQ5LjA2MiwwLjk2NSAxNDguODEsMS4xMSBMMTAyLjY0MSwyNy42NjYgTDk3LjIzMSwyNC41NDIgTDk0LjIyNiwxOS4wNjEgQzkzLjMxMywxNy4zOTQgOTEuNTI3LDE2LjM1OSA4OS41NjYsMTYuMzU4IEM4OC41NTUsMTYuMzU4IDg3LjU0NiwxNi42MzIgODYuNjQ5LDE3LjE1IEM4My44NzgsMTguNzUgNzkuNjg3LDIxLjE2OSA3OS4zNzQsMjEuMzQ1IEM3OS4zNTksMjEuMzUzIDc5LjM0NSwyMS4zNjEgNzkuMzMsMjEuMzY5IEM3Ny43OTgsMjIuMjU0IDc2LjA4NCwyMi43MjIgNzQuMzczLDIyLjcyMiBDNzIuMDgxLDIyLjcyMiA2OS45NTksMjEuODkgNjguMzk3LDIwLjM4IEw2OC4xNDUsMjAuMTM1IEM2Ny43MDYsMTkuNjcyIDY3LjMyMywxOS4xNTYgNjcuMDA2LDE4LjYwMSBDNjYuOTg4LDE4LjU1OSA2Ni45NjgsMTguNTE5IDY2Ljk0NiwxOC40NzkgTDY2LjcxOSwxOC4wNjUgQzY2LjY5LDE4LjAxMiA2Ni42NTgsMTcuOTYgNjYuNjI0LDE3LjkxMSBDNjUuNjg2LDE2LjMzNyA2My45NTEsMTUuMzY2IDYyLjA1MywxNS4zNjYgQzYxLjA0MiwxNS4zNjYgNjAuMDMzLDE1LjY0IDU5LjEzNiwxNi4xNTggTDMuMTI1LDQ4LjUwMiBDMC40MjYsNTAuMDYxIC0wLjYxMyw1My40NDIgMC44MTEsNTYuMDQgTDExLjA4OSw3NC43OSBDMTEuMjY2LDc1LjExMyAxMS41MzcsNzUuMzUzIDExLjg1LDc1LjQ5NCBMNTguMjc2LDEwMi4yOTggQzU5LjY3OSwxMDMuMTA4IDYxLjQzMywxMDMuNjMgNjMuMzQ4LDEwMy44MDYgQzYzLjgxMiwxMDMuODQ4IDY0LjI4NSwxMDMuODcgNjQuNzU0LDEwMy44NyBDNjUsMTAzLjg3IDY1LjI0OSwxMDMuODY0IDY1LjQ5NCwxMDMuODUyIEM2NS41NjMsMTAzLjg0OSA2NS42MzIsMTAzLjg0NyA2NS43MDEsMTAzLjg0NyBDNjUuNzY0LDEwMy44NDcgNjUuODI4LDEwMy44NDkgNjUuODksMTAzLjg1MiBDNjUuOTg2LDEwMy44NTYgNjYuMDgsMTAzLjg2MyA2Ni4xNzMsMTAzLjg3NCBDNjYuMjgyLDEwNS40NjcgNjcuMzMyLDEwNy4xOTcgNjguNzAyLDEwNy45ODggTDExMS4xNzQsMTMyLjUxIEMxMTEuNjk4LDEzMi44MTIgMTEyLjIzMiwxMzIuOTY1IDExMi43NjQsMTMyLjk2NSBDMTE0LjI2MSwxMzIuOTY1IDExNS4zNDcsMTMxLjc2NSAxMTUuMzQ3LDEzMC4xMTMgTDExNS4zNDcsMTAzLjU1MSBMMTIyLjQ1OCw5OS40NDYgQzEyMi44MTksOTkuMjM3IDEyMy4wODcsOTguODk4IDEyMy4yMDcsOTguNDk4IEwxMjcuODY1LDgyLjkwNSBDMTMyLjI3OSw4My43MDIgMTM2LjU1Nyw4NC43NTMgMTQwLjYwNyw4Ni4wMzMgTDE0MS4xNCw4Ni44NjIgQzE0MS40NTEsODcuMzQ2IDE0MS45NzcsODcuNjEzIDE0Mi41MTYsODcuNjEzIEMxNDIuNzk0LDg3LjYxMyAxNDMuMDc2LDg3LjU0MiAxNDMuMzMzLDg3LjM5MyBMMTY5Ljg2NSw3Mi4wNzYgTDE5Myw4NS40MzMgQzE5My41MjMsODUuNzM1IDE5NC4wNTgsODUuODg4IDE5NC41OSw4NS44ODggQzE5Ni4wODcsODUuODg4IDE5Ny4xNzMsODQuNjg5IDE5Ny4xNzMsODMuMDM2IEwxOTcuMTczLDI5LjAzNSBDMTk3LjE3MywyOC40NTEgMTk2Ljg2MSwyNy45MTEgMTk2LjM1NSwyNy42MTkgQzE5Ni4zNTUsMjcuNjE5IDE3MS44NDMsMTMuNDY3IDE3MC4zODUsMTIuNjI2IEMxNzAuMTMyLDEyLjQ4IDE2OS44NSwxMi40MDcgMTY5LjU2OCwxMi40MDcgQzE2OS4yODUsMTIuNDA3IDE2OS4wMDIsMTIuNDgxIDE2OC43NDksMTIuNjI3IEMxNjguMTQzLDEyLjk3OCAxNjUuNzU2LDE0LjM1NyAxNjQuNDI0LDE1LjEyNSBMMTU5LjYxNSwxMC44NyBDMTU4Ljc5NiwxMC4xNDUgMTU4LjE1NCw4LjkzNyAxNTguMDU0LDcuOTM0IEMxNTguMDQ1LDcuODM3IDE1OC4wMzQsNy43MzkgMTU4LjAyMSw3LjY0IEMxNTguMDA1LDcuNTIzIDE1Ny45OTgsNy40MSAxNTcuOTk4LDcuMzA0IEwxNTcuOTk4LDYuNDE4IEMxNTcuOTk4LDUuODM0IDE1Ny42ODYsNS4yOTUgMTU3LjE4MSw1LjAwMiBDMTU2LjYyNCw0LjY4IDE1MC40NDIsMS4xMTEgMTUwLjQ0MiwxLjExMSBDMTUwLjE4OSwwLjk2NSAxNDkuOTA3LDAuODkyIDE0OS42MjUsMC44OTIiIGlkPSJGaWxsLTEiIGZpbGw9IiM0NTVBNjQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNOTYuMDI3LDI1LjYzNiBMMTQyLjYwMyw1Mi41MjcgQzE0My44MDcsNTMuMjIyIDE0NC41ODIsNTQuMTE0IDE0NC44NDUsNTUuMDY4IEwxNDQuODM1LDU1LjA3NSBMNjMuNDYxLDEwMi4wNTcgTDYzLjQ2LDEwMi4wNTcgQzYxLjgwNiwxMDEuOTA1IDYwLjI2MSwxMDEuNDU3IDU5LjA1NywxMDAuNzYyIEwxMi40ODEsNzMuODcxIEw5Ni4wMjcsMjUuNjM2IiBpZD0iRmlsbC0yIiBmaWxsPSIjRkFGQUZBIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTYzLjQ2MSwxMDIuMTc0IEM2My40NTMsMTAyLjE3NCA2My40NDYsMTAyLjE3NCA2My40MzksMTAyLjE3MiBDNjEuNzQ2LDEwMi4wMTYgNjAuMjExLDEwMS41NjMgNTguOTk4LDEwMC44NjMgTDEyLjQyMiw3My45NzMgQzEyLjM4Niw3My45NTIgMTIuMzY0LDczLjkxNCAxMi4zNjQsNzMuODcxIEMxMi4zNjQsNzMuODMgMTIuMzg2LDczLjc5MSAxMi40MjIsNzMuNzcgTDk1Ljk2OCwyNS41MzUgQzk2LjAwNCwyNS41MTQgOTYuMDQ5LDI1LjUxNCA5Ni4wODUsMjUuNTM1IEwxNDIuNjYxLDUyLjQyNiBDMTQzLjg4OCw1My4xMzQgMTQ0LjY4Miw1NC4wMzggMTQ0Ljk1Nyw1NS4wMzcgQzE0NC45Nyw1NS4wODMgMTQ0Ljk1Myw1NS4xMzMgMTQ0LjkxNSw1NS4xNjEgQzE0NC45MTEsNTUuMTY1IDE0NC44OTgsNTUuMTc0IDE0NC44OTQsNTUuMTc3IEw2My41MTksMTAyLjE1OCBDNjMuNTAxLDEwMi4xNjkgNjMuNDgxLDEwMi4xNzQgNjMuNDYxLDEwMi4xNzQgTDYzLjQ2MSwxMDIuMTc0IFogTTEyLjcxNCw3My44NzEgTDU5LjExNSwxMDAuNjYxIEM2MC4yOTMsMTAxLjM0MSA2MS43ODYsMTAxLjc4MiA2My40MzUsMTAxLjkzNyBMMTQ0LjcwNyw1NS4wMTUgQzE0NC40MjgsNTQuMTA4IDE0My42ODIsNTMuMjg1IDE0Mi41NDQsNTIuNjI4IEw5Ni4wMjcsMjUuNzcxIEwxMi43MTQsNzMuODcxIEwxMi43MTQsNzMuODcxIFoiIGlkPSJGaWxsLTMiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTQ4LjMyNyw1OC40NzEgQzE0OC4xNDUsNTguNDggMTQ3Ljk2Miw1OC40OCAxNDcuNzgxLDU4LjQ3MiBDMTQ1Ljg4Nyw1OC4zODkgMTQ0LjQ3OSw1Ny40MzQgMTQ0LjYzNiw1Ni4zNCBDMTQ0LjY4OSw1NS45NjcgMTQ0LjY2NCw1NS41OTcgMTQ0LjU2NCw1NS4yMzUgTDYzLjQ2MSwxMDIuMDU3IEM2NC4wODksMTAyLjExNSA2NC43MzMsMTAyLjEzIDY1LjM3OSwxMDIuMDk5IEM2NS41NjEsMTAyLjA5IDY1Ljc0MywxMDIuMDkgNjUuOTI1LDEwMi4wOTggQzY3LjgxOSwxMDIuMTgxIDY5LjIyNywxMDMuMTM2IDY5LjA3LDEwNC4yMyBMMTQ4LjMyNyw1OC40NzEiIGlkPSJGaWxsLTQiIGZpbGw9IiNGRkZGRkYiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNNjkuMDcsMTA0LjM0NyBDNjkuMDQ4LDEwNC4zNDcgNjkuMDI1LDEwNC4zNCA2OS4wMDUsMTA0LjMyNyBDNjguOTY4LDEwNC4zMDEgNjguOTQ4LDEwNC4yNTcgNjguOTU1LDEwNC4yMTMgQzY5LDEwMy44OTYgNjguODk4LDEwMy41NzYgNjguNjU4LDEwMy4yODggQzY4LjE1MywxMDIuNjc4IDY3LjEwMywxMDIuMjY2IDY1LjkyLDEwMi4yMTQgQzY1Ljc0MiwxMDIuMjA2IDY1LjU2MywxMDIuMjA3IDY1LjM4NSwxMDIuMjE1IEM2NC43NDIsMTAyLjI0NiA2NC4wODcsMTAyLjIzMiA2My40NSwxMDIuMTc0IEM2My4zOTksMTAyLjE2OSA2My4zNTgsMTAyLjEzMiA2My4zNDcsMTAyLjA4MiBDNjMuMzM2LDEwMi4wMzMgNjMuMzU4LDEwMS45ODEgNjMuNDAyLDEwMS45NTYgTDE0NC41MDYsNTUuMTM0IEMxNDQuNTM3LDU1LjExNiAxNDQuNTc1LDU1LjExMyAxNDQuNjA5LDU1LjEyNyBDMTQ0LjY0Miw1NS4xNDEgMTQ0LjY2OCw1NS4xNyAxNDQuNjc3LDU1LjIwNCBDMTQ0Ljc4MSw1NS41ODUgMTQ0LjgwNiw1NS45NzIgMTQ0Ljc1MSw1Ni4zNTcgQzE0NC43MDYsNTYuNjczIDE0NC44MDgsNTYuOTk0IDE0NS4wNDcsNTcuMjgyIEMxNDUuNTUzLDU3Ljg5MiAxNDYuNjAyLDU4LjMwMyAxNDcuNzg2LDU4LjM1NSBDMTQ3Ljk2NCw1OC4zNjMgMTQ4LjE0Myw1OC4zNjMgMTQ4LjMyMSw1OC4zNTQgQzE0OC4zNzcsNTguMzUyIDE0OC40MjQsNTguMzg3IDE0OC40MzksNTguNDM4IEMxNDguNDU0LDU4LjQ5IDE0OC40MzIsNTguNTQ1IDE0OC4zODUsNTguNTcyIEw2OS4xMjksMTA0LjMzMSBDNjkuMTExLDEwNC4zNDIgNjkuMDksMTA0LjM0NyA2OS4wNywxMDQuMzQ3IEw2OS4wNywxMDQuMzQ3IFogTTY1LjY2NSwxMDEuOTc1IEM2NS43NTQsMTAxLjk3NSA2NS44NDIsMTAxLjk3NyA2NS45MywxMDEuOTgxIEM2Ny4xOTYsMTAyLjAzNyA2OC4yODMsMTAyLjQ2OSA2OC44MzgsMTAzLjEzOSBDNjkuMDY1LDEwMy40MTMgNjkuMTg4LDEwMy43MTQgNjkuMTk4LDEwNC4wMjEgTDE0Ny44ODMsNTguNTkyIEMxNDcuODQ3LDU4LjU5MiAxNDcuODExLDU4LjU5MSAxNDcuNzc2LDU4LjU4OSBDMTQ2LjUwOSw1OC41MzMgMTQ1LjQyMiw1OC4xIDE0NC44NjcsNTcuNDMxIEMxNDQuNTg1LDU3LjA5MSAxNDQuNDY1LDU2LjcwNyAxNDQuNTIsNTYuMzI0IEMxNDQuNTYzLDU2LjAyMSAxNDQuNTUyLDU1LjcxNiAxNDQuNDg4LDU1LjQxNCBMNjMuODQ2LDEwMS45NyBDNjQuMzUzLDEwMi4wMDIgNjQuODY3LDEwMi4wMDYgNjUuMzc0LDEwMS45ODIgQzY1LjQ3MSwxMDEuOTc3IDY1LjU2OCwxMDEuOTc1IDY1LjY2NSwxMDEuOTc1IEw2NS42NjUsMTAxLjk3NSBaIiBpZD0iRmlsbC01IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTIuMjA4LDU1LjEzNCBDMS4yMDcsNTMuMzA3IDEuOTY3LDUwLjkxNyAzLjkwNiw0OS43OTcgTDU5LjkxNywxNy40NTMgQzYxLjg1NiwxNi4zMzMgNjQuMjQxLDE2LjkwNyA2NS4yNDMsMTguNzM0IEw2NS40NzUsMTkuMTQ0IEM2NS44NzIsMTkuODgyIDY2LjM2OCwyMC41NiA2Ni45NDUsMjEuMTY1IEw2Ny4yMjMsMjEuNDM1IEM3MC41NDgsMjQuNjQ5IDc1LjgwNiwyNS4xNTEgODAuMTExLDIyLjY2NSBMODcuNDMsMTguNDQ1IEM4OS4zNywxNy4zMjYgOTEuNzU0LDE3Ljg5OSA5Mi43NTUsMTkuNzI3IEw5Ni4wMDUsMjUuNjU1IEwxMi40ODYsNzMuODg0IEwyLjIwOCw1NS4xMzQgWiIgaWQ9IkZpbGwtNiIgZmlsbD0iI0ZBRkFGQSI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xMi40ODYsNzQuMDAxIEMxMi40NzYsNzQuMDAxIDEyLjQ2NSw3My45OTkgMTIuNDU1LDczLjk5NiBDMTIuNDI0LDczLjk4OCAxMi4zOTksNzMuOTY3IDEyLjM4NCw3My45NCBMMi4xMDYsNTUuMTkgQzEuMDc1LDUzLjMxIDEuODU3LDUwLjg0NSAzLjg0OCw0OS42OTYgTDU5Ljg1OCwxNy4zNTIgQzYwLjUyNSwxNi45NjcgNjEuMjcxLDE2Ljc2NCA2Mi4wMTYsMTYuNzY0IEM2My40MzEsMTYuNzY0IDY0LjY2NiwxNy40NjYgNjUuMzI3LDE4LjY0NiBDNjUuMzM3LDE4LjY1NCA2NS4zNDUsMTguNjYzIDY1LjM1MSwxOC42NzQgTDY1LjU3OCwxOS4wODggQzY1LjU4NCwxOS4xIDY1LjU4OSwxOS4xMTIgNjUuNTkxLDE5LjEyNiBDNjUuOTg1LDE5LjgzOCA2Ni40NjksMjAuNDk3IDY3LjAzLDIxLjA4NSBMNjcuMzA1LDIxLjM1MSBDNjkuMTUxLDIzLjEzNyA3MS42NDksMjQuMTIgNzQuMzM2LDI0LjEyIEM3Ni4zMTMsMjQuMTIgNzguMjksMjMuNTgyIDgwLjA1MywyMi41NjMgQzgwLjA2NCwyMi41NTcgODAuMDc2LDIyLjU1MyA4MC4wODgsMjIuNTUgTDg3LjM3MiwxOC4zNDQgQzg4LjAzOCwxNy45NTkgODguNzg0LDE3Ljc1NiA4OS41MjksMTcuNzU2IEM5MC45NTYsMTcuNzU2IDkyLjIwMSwxOC40NzIgOTIuODU4LDE5LjY3IEw5Ni4xMDcsMjUuNTk5IEM5Ni4xMzgsMjUuNjU0IDk2LjExOCwyNS43MjQgOTYuMDYzLDI1Ljc1NiBMMTIuNTQ1LDczLjk4NSBDMTIuNTI2LDczLjk5NiAxMi41MDYsNzQuMDAxIDEyLjQ4Niw3NC4wMDEgTDEyLjQ4Niw3NC4wMDEgWiBNNjIuMDE2LDE2Ljk5NyBDNjEuMzEyLDE2Ljk5NyA2MC42MDYsMTcuMTkgNTkuOTc1LDE3LjU1NCBMMy45NjUsNDkuODk5IEMyLjA4Myw1MC45ODUgMS4zNDEsNTMuMzA4IDIuMzEsNTUuMDc4IEwxMi41MzEsNzMuNzIzIEw5NS44NDgsMjUuNjExIEw5Mi42NTMsMTkuNzgyIEM5Mi4wMzgsMTguNjYgOTAuODcsMTcuOTkgODkuNTI5LDE3Ljk5IEM4OC44MjUsMTcuOTkgODguMTE5LDE4LjE4MiA4Ny40ODksMTguNTQ3IEw4MC4xNzIsMjIuNzcyIEM4MC4xNjEsMjIuNzc4IDgwLjE0OSwyMi43ODIgODAuMTM3LDIyLjc4NSBDNzguMzQ2LDIzLjgxMSA3Ni4zNDEsMjQuMzU0IDc0LjMzNiwyNC4zNTQgQzcxLjU4OCwyNC4zNTQgNjkuMDMzLDIzLjM0NyA2Ny4xNDIsMjEuNTE5IEw2Ni44NjQsMjEuMjQ5IEM2Ni4yNzcsMjAuNjM0IDY1Ljc3NCwxOS45NDcgNjUuMzY3LDE5LjIwMyBDNjUuMzYsMTkuMTkyIDY1LjM1NiwxOS4xNzkgNjUuMzU0LDE5LjE2NiBMNjUuMTYzLDE4LjgxOSBDNjUuMTU0LDE4LjgxMSA2NS4xNDYsMTguODAxIDY1LjE0LDE4Ljc5IEM2NC41MjUsMTcuNjY3IDYzLjM1NywxNi45OTcgNjIuMDE2LDE2Ljk5NyBMNjIuMDE2LDE2Ljk5NyBaIiBpZD0iRmlsbC03IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTQyLjQzNCw0OC44MDggTDQyLjQzNCw0OC44MDggQzM5LjkyNCw0OC44MDcgMzcuNzM3LDQ3LjU1IDM2LjU4Miw0NS40NDMgQzM0Ljc3MSw0Mi4xMzkgMzYuMTQ0LDM3LjgwOSAzOS42NDEsMzUuNzg5IEw1MS45MzIsMjguNjkxIEM1My4xMDMsMjguMDE1IDU0LjQxMywyNy42NTggNTUuNzIxLDI3LjY1OCBDNTguMjMxLDI3LjY1OCA2MC40MTgsMjguOTE2IDYxLjU3MywzMS4wMjMgQzYzLjM4NCwzNC4zMjcgNjIuMDEyLDM4LjY1NyA1OC41MTQsNDAuNjc3IEw0Ni4yMjMsNDcuNzc1IEM0NS4wNTMsNDguNDUgNDMuNzQyLDQ4LjgwOCA0Mi40MzQsNDguODA4IEw0Mi40MzQsNDguODA4IFogTTU1LjcyMSwyOC4xMjUgQzU0LjQ5NSwyOC4xMjUgNTMuMjY1LDI4LjQ2MSA1Mi4xNjYsMjkuMDk2IEwzOS44NzUsMzYuMTk0IEMzNi41OTYsMzguMDg3IDM1LjMwMiw0Mi4xMzYgMzYuOTkyLDQ1LjIxOCBDMzguMDYzLDQ3LjE3MyA0MC4wOTgsNDguMzQgNDIuNDM0LDQ4LjM0IEM0My42NjEsNDguMzQgNDQuODksNDguMDA1IDQ1Ljk5LDQ3LjM3IEw1OC4yODEsNDAuMjcyIEM2MS41NiwzOC4zNzkgNjIuODUzLDM0LjMzIDYxLjE2NCwzMS4yNDggQzYwLjA5MiwyOS4yOTMgNTguMDU4LDI4LjEyNSA1NS43MjEsMjguMTI1IEw1NS43MjEsMjguMTI1IFoiIGlkPSJGaWxsLTgiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTQ5LjU4OCwyLjQwNyBDMTQ5LjU4OCwyLjQwNyAxNTUuNzY4LDUuOTc1IDE1Ni4zMjUsNi4yOTcgTDE1Ni4zMjUsNy4xODQgQzE1Ni4zMjUsNy4zNiAxNTYuMzM4LDcuNTQ0IDE1Ni4zNjIsNy43MzMgQzE1Ni4zNzMsNy44MTQgMTU2LjM4Miw3Ljg5NCAxNTYuMzksNy45NzUgQzE1Ni41Myw5LjM5IDE1Ny4zNjMsMTAuOTczIDE1OC40OTUsMTEuOTc0IEwxNjUuODkxLDE4LjUxOSBDMTY2LjA2OCwxOC42NzUgMTY2LjI0OSwxOC44MTQgMTY2LjQzMiwxOC45MzQgQzE2OC4wMTEsMTkuOTc0IDE2OS4zODIsMTkuNCAxNjkuNDk0LDE3LjY1MiBDMTY5LjU0MywxNi44NjggMTY5LjU1MSwxNi4wNTcgMTY5LjUxNywxNS4yMjMgTDE2OS41MTQsMTUuMDYzIEwxNjkuNTE0LDEzLjkxMiBDMTcwLjc4LDE0LjY0MiAxOTUuNTAxLDI4LjkxNSAxOTUuNTAxLDI4LjkxNSBMMTk1LjUwMSw4Mi45MTUgQzE5NS41MDEsODQuMDA1IDE5NC43MzEsODQuNDQ1IDE5My43ODEsODMuODk3IEwxNTEuMzA4LDU5LjM3NCBDMTUwLjM1OCw1OC44MjYgMTQ5LjU4OCw1Ny40OTcgMTQ5LjU4OCw1Ni40MDggTDE0OS41ODgsMjIuMzc1IiBpZD0iRmlsbC05IiBmaWxsPSIjRkFGQUZBIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE5NC41NTMsODQuMjUgQzE5NC4yOTYsODQuMjUgMTk0LjAxMyw4NC4xNjUgMTkzLjcyMiw4My45OTcgTDE1MS4yNSw1OS40NzYgQzE1MC4yNjksNTguOTA5IDE0OS40NzEsNTcuNTMzIDE0OS40NzEsNTYuNDA4IEwxNDkuNDcxLDIyLjM3NSBMMTQ5LjcwNSwyMi4zNzUgTDE0OS43MDUsNTYuNDA4IEMxNDkuNzA1LDU3LjQ1OSAxNTAuNDUsNTguNzQ0IDE1MS4zNjYsNTkuMjc0IEwxOTMuODM5LDgzLjc5NSBDMTk0LjI2Myw4NC4wNCAxOTQuNjU1LDg0LjA4MyAxOTQuOTQyLDgzLjkxNyBDMTk1LjIyNyw4My43NTMgMTk1LjM4NCw4My4zOTcgMTk1LjM4NCw4Mi45MTUgTDE5NS4zODQsMjguOTgyIEMxOTQuMTAyLDI4LjI0MiAxNzIuMTA0LDE1LjU0MiAxNjkuNjMxLDE0LjExNCBMMTY5LjYzNCwxNS4yMiBDMTY5LjY2OCwxNi4wNTIgMTY5LjY2LDE2Ljg3NCAxNjkuNjEsMTcuNjU5IEMxNjkuNTU2LDE4LjUwMyAxNjkuMjE0LDE5LjEyMyAxNjguNjQ3LDE5LjQwNSBDMTY4LjAyOCwxOS43MTQgMTY3LjE5NywxOS41NzggMTY2LjM2NywxOS4wMzIgQzE2Ni4xODEsMTguOTA5IDE2NS45OTUsMTguNzY2IDE2NS44MTQsMTguNjA2IEwxNTguNDE3LDEyLjA2MiBDMTU3LjI1OSwxMS4wMzYgMTU2LjQxOCw5LjQzNyAxNTYuMjc0LDcuOTg2IEMxNTYuMjY2LDcuOTA3IDE1Ni4yNTcsNy44MjcgMTU2LjI0Nyw3Ljc0OCBDMTU2LjIyMSw3LjU1NSAxNTYuMjA5LDcuMzY1IDE1Ni4yMDksNy4xODQgTDE1Ni4yMDksNi4zNjQgQzE1NS4zNzUsNS44ODMgMTQ5LjUyOSwyLjUwOCAxNDkuNTI5LDIuNTA4IEwxNDkuNjQ2LDIuMzA2IEMxNDkuNjQ2LDIuMzA2IDE1NS44MjcsNS44NzQgMTU2LjM4NCw2LjE5NiBMMTU2LjQ0Miw2LjIzIEwxNTYuNDQyLDcuMTg0IEMxNTYuNDQyLDcuMzU1IDE1Ni40NTQsNy41MzUgMTU2LjQ3OCw3LjcxNyBDMTU2LjQ4OSw3LjggMTU2LjQ5OSw3Ljg4MiAxNTYuNTA3LDcuOTYzIEMxNTYuNjQ1LDkuMzU4IDE1Ny40NTUsMTAuODk4IDE1OC41NzIsMTEuODg2IEwxNjUuOTY5LDE4LjQzMSBDMTY2LjE0MiwxOC41ODQgMTY2LjMxOSwxOC43MiAxNjYuNDk2LDE4LjgzNyBDMTY3LjI1NCwxOS4zMzYgMTY4LDE5LjQ2NyAxNjguNTQzLDE5LjE5NiBDMTY5LjAzMywxOC45NTMgMTY5LjMyOSwxOC40MDEgMTY5LjM3NywxNy42NDUgQzE2OS40MjcsMTYuODY3IDE2OS40MzQsMTYuMDU0IDE2OS40MDEsMTUuMjI4IEwxNjkuMzk3LDE1LjA2NSBMMTY5LjM5NywxMy43MSBMMTY5LjU3MiwxMy44MSBDMTcwLjgzOSwxNC41NDEgMTk1LjU1OSwyOC44MTQgMTk1LjU1OSwyOC44MTQgTDE5NS42MTgsMjguODQ3IEwxOTUuNjE4LDgyLjkxNSBDMTk1LjYxOCw4My40ODQgMTk1LjQyLDgzLjkxMSAxOTUuMDU5LDg0LjExOSBDMTk0LjkwOCw4NC4yMDYgMTk0LjczNyw4NC4yNSAxOTQuNTUzLDg0LjI1IiBpZD0iRmlsbC0xMCIgZmlsbD0iIzYwN0Q4QiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNDUuNjg1LDU2LjE2MSBMMTY5LjgsNzAuMDgzIEwxNDMuODIyLDg1LjA4MSBMMTQyLjM2LDg0Ljc3NCBDMTM1LjgyNiw4Mi42MDQgMTI4LjczMiw4MS4wNDYgMTIxLjM0MSw4MC4xNTggQzExNi45NzYsNzkuNjM0IDExMi42NzgsODEuMjU0IDExMS43NDMsODMuNzc4IEMxMTEuNTA2LDg0LjQxNCAxMTEuNTAzLDg1LjA3MSAxMTEuNzMyLDg1LjcwNiBDMTEzLjI3LDg5Ljk3MyAxMTUuOTY4LDk0LjA2OSAxMTkuNzI3LDk3Ljg0MSBMMTIwLjI1OSw5OC42ODYgQzEyMC4yNiw5OC42ODUgOTQuMjgyLDExMy42ODMgOTQuMjgyLDExMy42ODMgTDcwLjE2Nyw5OS43NjEgTDE0NS42ODUsNTYuMTYxIiBpZD0iRmlsbC0xMSIgZmlsbD0iI0ZGRkZGRiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik05NC4yODIsMTEzLjgxOCBMOTQuMjIzLDExMy43ODUgTDY5LjkzMyw5OS43NjEgTDcwLjEwOCw5OS42NiBMMTQ1LjY4NSw1Ni4wMjYgTDE0NS43NDMsNTYuMDU5IEwxNzAuMDMzLDcwLjA4MyBMMTQzLjg0Miw4NS4yMDUgTDE0My43OTcsODUuMTk1IEMxNDMuNzcyLDg1LjE5IDE0Mi4zMzYsODQuODg4IDE0Mi4zMzYsODQuODg4IEMxMzUuNzg3LDgyLjcxNCAxMjguNzIzLDgxLjE2MyAxMjEuMzI3LDgwLjI3NCBDMTIwLjc4OCw4MC4yMDkgMTIwLjIzNiw4MC4xNzcgMTE5LjY4OSw4MC4xNzcgQzExNS45MzEsODAuMTc3IDExMi42MzUsODEuNzA4IDExMS44NTIsODMuODE5IEMxMTEuNjI0LDg0LjQzMiAxMTEuNjIxLDg1LjA1MyAxMTEuODQyLDg1LjY2NyBDMTEzLjM3Nyw4OS45MjUgMTE2LjA1OCw5My45OTMgMTE5LjgxLDk3Ljc1OCBMMTE5LjgyNiw5Ny43NzkgTDEyMC4zNTIsOTguNjE0IEMxMjAuMzU0LDk4LjYxNyAxMjAuMzU2LDk4LjYyIDEyMC4zNTgsOTguNjI0IEwxMjAuNDIyLDk4LjcyNiBMMTIwLjMxNyw5OC43ODcgQzEyMC4yNjQsOTguODE4IDk0LjU5OSwxMTMuNjM1IDk0LjM0LDExMy43ODUgTDk0LjI4MiwxMTMuODE4IEw5NC4yODIsMTEzLjgxOCBaIE03MC40MDEsOTkuNzYxIEw5NC4yODIsMTEzLjU0OSBMMTE5LjA4NCw5OS4yMjkgQzExOS42Myw5OC45MTQgMTE5LjkzLDk4Ljc0IDEyMC4xMDEsOTguNjU0IEwxMTkuNjM1LDk3LjkxNCBDMTE1Ljg2NCw5NC4xMjcgMTEzLjE2OCw5MC4wMzMgMTExLjYyMiw4NS43NDYgQzExMS4zODIsODUuMDc5IDExMS4zODYsODQuNDA0IDExMS42MzMsODMuNzM4IEMxMTIuNDQ4LDgxLjUzOSAxMTUuODM2LDc5Ljk0MyAxMTkuNjg5LDc5Ljk0MyBDMTIwLjI0Niw3OS45NDMgMTIwLjgwNiw3OS45NzYgMTIxLjM1NSw4MC4wNDIgQzEyOC43NjcsODAuOTMzIDEzNS44NDYsODIuNDg3IDE0Mi4zOTYsODQuNjYzIEMxNDMuMjMyLDg0LjgzOCAxNDMuNjExLDg0LjkxNyAxNDMuNzg2LDg0Ljk2NyBMMTY5LjU2Niw3MC4wODMgTDE0NS42ODUsNTYuMjk1IEw3MC40MDEsOTkuNzYxIEw3MC40MDEsOTkuNzYxIFoiIGlkPSJGaWxsLTEyIiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE2Ny4yMywxOC45NzkgTDE2Ny4yMyw2OS44NSBMMTM5LjkwOSw4NS42MjMgTDEzMy40NDgsNzEuNDU2IEMxMzIuNTM4LDY5LjQ2IDEzMC4wMiw2OS43MTggMTI3LjgyNCw3Mi4wMyBDMTI2Ljc2OSw3My4xNCAxMjUuOTMxLDc0LjU4NSAxMjUuNDk0LDc2LjA0OCBMMTE5LjAzNCw5Ny42NzYgTDkxLjcxMiwxMTMuNDUgTDkxLjcxMiw2Mi41NzkgTDE2Ny4yMywxOC45NzkiIGlkPSJGaWxsLTEzIiBmaWxsPSIjRkZGRkZGIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTkxLjcxMiwxMTMuNTY3IEM5MS42OTIsMTEzLjU2NyA5MS42NzIsMTEzLjU2MSA5MS42NTMsMTEzLjU1MSBDOTEuNjE4LDExMy41MyA5MS41OTUsMTEzLjQ5MiA5MS41OTUsMTEzLjQ1IEw5MS41OTUsNjIuNTc5IEM5MS41OTUsNjIuNTM3IDkxLjYxOCw2Mi40OTkgOTEuNjUzLDYyLjQ3OCBMMTY3LjE3MiwxOC44NzggQzE2Ny4yMDgsMTguODU3IDE2Ny4yNTIsMTguODU3IDE2Ny4yODgsMTguODc4IEMxNjcuMzI0LDE4Ljg5OSAxNjcuMzQ3LDE4LjkzNyAxNjcuMzQ3LDE4Ljk3OSBMMTY3LjM0Nyw2OS44NSBDMTY3LjM0Nyw2OS44OTEgMTY3LjMyNCw2OS45MyAxNjcuMjg4LDY5Ljk1IEwxMzkuOTY3LDg1LjcyNSBDMTM5LjkzOSw4NS43NDEgMTM5LjkwNSw4NS43NDUgMTM5Ljg3Myw4NS43MzUgQzEzOS44NDIsODUuNzI1IDEzOS44MTYsODUuNzAyIDEzOS44MDIsODUuNjcyIEwxMzMuMzQyLDcxLjUwNCBDMTMyLjk2Nyw3MC42ODIgMTMyLjI4LDcwLjIyOSAxMzEuNDA4LDcwLjIyOSBDMTMwLjMxOSw3MC4yMjkgMTI5LjA0NCw3MC45MTUgMTI3LjkwOCw3Mi4xMSBDMTI2Ljg3NCw3My4yIDEyNi4wMzQsNzQuNjQ3IDEyNS42MDYsNzYuMDgyIEwxMTkuMTQ2LDk3LjcwOSBDMTE5LjEzNyw5Ny43MzggMTE5LjExOCw5Ny43NjIgMTE5LjA5Miw5Ny43NzcgTDkxLjc3LDExMy41NTEgQzkxLjc1MiwxMTMuNTYxIDkxLjczMiwxMTMuNTY3IDkxLjcxMiwxMTMuNTY3IEw5MS43MTIsMTEzLjU2NyBaIE05MS44MjksNjIuNjQ3IEw5MS44MjksMTEzLjI0OCBMMTE4LjkzNSw5Ny41OTggTDEyNS4zODIsNzYuMDE1IEMxMjUuODI3LDc0LjUyNSAxMjYuNjY0LDczLjA4MSAxMjcuNzM5LDcxLjk1IEMxMjguOTE5LDcwLjcwOCAxMzAuMjU2LDY5Ljk5NiAxMzEuNDA4LDY5Ljk5NiBDMTMyLjM3Nyw2OS45OTYgMTMzLjEzOSw3MC40OTcgMTMzLjU1NCw3MS40MDcgTDEzOS45NjEsODUuNDU4IEwxNjcuMTEzLDY5Ljc4MiBMMTY3LjExMywxOS4xODEgTDkxLjgyOSw2Mi42NDcgTDkxLjgyOSw2Mi42NDcgWiIgaWQ9IkZpbGwtMTQiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTY4LjU0MywxOS4yMTMgTDE2OC41NDMsNzAuMDgzIEwxNDEuMjIxLDg1Ljg1NyBMMTM0Ljc2MSw3MS42ODkgQzEzMy44NTEsNjkuNjk0IDEzMS4zMzMsNjkuOTUxIDEyOS4xMzcsNzIuMjYzIEMxMjguMDgyLDczLjM3NCAxMjcuMjQ0LDc0LjgxOSAxMjYuODA3LDc2LjI4MiBMMTIwLjM0Niw5Ny45MDkgTDkzLjAyNSwxMTMuNjgzIEw5My4wMjUsNjIuODEzIEwxNjguNTQzLDE5LjIxMyIgaWQ9IkZpbGwtMTUiIGZpbGw9IiNGRkZGRkYiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNOTMuMDI1LDExMy44IEM5My4wMDUsMTEzLjggOTIuOTg0LDExMy43OTUgOTIuOTY2LDExMy43ODUgQzkyLjkzMSwxMTMuNzY0IDkyLjkwOCwxMTMuNzI1IDkyLjkwOCwxMTMuNjg0IEw5Mi45MDgsNjIuODEzIEM5Mi45MDgsNjIuNzcxIDkyLjkzMSw2Mi43MzMgOTIuOTY2LDYyLjcxMiBMMTY4LjQ4NCwxOS4xMTIgQzE2OC41MiwxOS4wOSAxNjguNTY1LDE5LjA5IDE2OC42MDEsMTkuMTEyIEMxNjguNjM3LDE5LjEzMiAxNjguNjYsMTkuMTcxIDE2OC42NiwxOS4yMTIgTDE2OC42Niw3MC4wODMgQzE2OC42Niw3MC4xMjUgMTY4LjYzNyw3MC4xNjQgMTY4LjYwMSw3MC4xODQgTDE0MS4yOCw4NS45NTggQzE0MS4yNTEsODUuOTc1IDE0MS4yMTcsODUuOTc5IDE0MS4xODYsODUuOTY4IEMxNDEuMTU0LDg1Ljk1OCAxNDEuMTI5LDg1LjkzNiAxNDEuMTE1LDg1LjkwNiBMMTM0LjY1NSw3MS43MzggQzEzNC4yOCw3MC45MTUgMTMzLjU5Myw3MC40NjMgMTMyLjcyLDcwLjQ2MyBDMTMxLjYzMiw3MC40NjMgMTMwLjM1Nyw3MS4xNDggMTI5LjIyMSw3Mi4zNDQgQzEyOC4xODYsNzMuNDMzIDEyNy4zNDcsNzQuODgxIDEyNi45MTksNzYuMzE1IEwxMjAuNDU4LDk3Ljk0MyBDMTIwLjQ1LDk3Ljk3MiAxMjAuNDMxLDk3Ljk5NiAxMjAuNDA1LDk4LjAxIEw5My4wODMsMTEzLjc4NSBDOTMuMDY1LDExMy43OTUgOTMuMDQ1LDExMy44IDkzLjAyNSwxMTMuOCBMOTMuMDI1LDExMy44IFogTTkzLjE0Miw2Mi44ODEgTDkzLjE0MiwxMTMuNDgxIEwxMjAuMjQ4LDk3LjgzMiBMMTI2LjY5NSw3Ni4yNDggQzEyNy4xNCw3NC43NTggMTI3Ljk3Nyw3My4zMTUgMTI5LjA1Miw3Mi4xODMgQzEzMC4yMzEsNzAuOTQyIDEzMS41NjgsNzAuMjI5IDEzMi43Miw3MC4yMjkgQzEzMy42ODksNzAuMjI5IDEzNC40NTIsNzAuNzMxIDEzNC44NjcsNzEuNjQxIEwxNDEuMjc0LDg1LjY5MiBMMTY4LjQyNiw3MC4wMTYgTDE2OC40MjYsMTkuNDE1IEw5My4xNDIsNjIuODgxIEw5My4xNDIsNjIuODgxIFoiIGlkPSJGaWxsLTE2IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE2OS44LDcwLjA4MyBMMTQyLjQ3OCw4NS44NTcgTDEzNi4wMTgsNzEuNjg5IEMxMzUuMTA4LDY5LjY5NCAxMzIuNTksNjkuOTUxIDEzMC4zOTMsNzIuMjYzIEMxMjkuMzM5LDczLjM3NCAxMjguNSw3NC44MTkgMTI4LjA2NCw3Ni4yODIgTDEyMS42MDMsOTcuOTA5IEw5NC4yODIsMTEzLjY4MyBMOTQuMjgyLDYyLjgxMyBMMTY5LjgsMTkuMjEzIEwxNjkuOCw3MC4wODMgWiIgaWQ9IkZpbGwtMTciIGZpbGw9IiNGQUZBRkEiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNOTQuMjgyLDExMy45MTcgQzk0LjI0MSwxMTMuOTE3IDk0LjIwMSwxMTMuOTA3IDk0LjE2NSwxMTMuODg2IEM5NC4wOTMsMTEzLjg0NSA5NC4wNDgsMTEzLjc2NyA5NC4wNDgsMTEzLjY4NCBMOTQuMDQ4LDYyLjgxMyBDOTQuMDQ4LDYyLjczIDk0LjA5Myw2Mi42NTIgOTQuMTY1LDYyLjYxMSBMMTY5LjY4MywxOS4wMSBDMTY5Ljc1NSwxOC45NjkgMTY5Ljg0NCwxOC45NjkgMTY5LjkxNywxOS4wMSBDMTY5Ljk4OSwxOS4wNTIgMTcwLjAzMywxOS4xMjkgMTcwLjAzMywxOS4yMTIgTDE3MC4wMzMsNzAuMDgzIEMxNzAuMDMzLDcwLjE2NiAxNjkuOTg5LDcwLjI0NCAxNjkuOTE3LDcwLjI4NSBMMTQyLjU5NSw4Ni4wNiBDMTQyLjUzOCw4Ni4wOTIgMTQyLjQ2OSw4Ni4xIDE0Mi40MDcsODYuMDggQzE0Mi4zNDQsODYuMDYgMTQyLjI5Myw4Ni4wMTQgMTQyLjI2Niw4NS45NTQgTDEzNS44MDUsNzEuNzg2IEMxMzUuNDQ1LDcwLjk5NyAxMzQuODEzLDcwLjU4IDEzMy45NzcsNzAuNTggQzEzMi45MjEsNzAuNTggMTMxLjY3Niw3MS4yNTIgMTMwLjU2Miw3Mi40MjQgQzEyOS41NCw3My41MDEgMTI4LjcxMSw3NC45MzEgMTI4LjI4Nyw3Ni4zNDggTDEyMS44MjcsOTcuOTc2IEMxMjEuODEsOTguMDM0IDEyMS43NzEsOTguMDgyIDEyMS43Miw5OC4xMTIgTDk0LjM5OCwxMTMuODg2IEM5NC4zNjIsMTEzLjkwNyA5NC4zMjIsMTEzLjkxNyA5NC4yODIsMTEzLjkxNyBMOTQuMjgyLDExMy45MTcgWiBNOTQuNTE1LDYyLjk0OCBMOTQuNTE1LDExMy4yNzkgTDEyMS40MDYsOTcuNzU0IEwxMjcuODQsNzYuMjE1IEMxMjguMjksNzQuNzA4IDEyOS4xMzcsNzMuMjQ3IDEzMC4yMjQsNzIuMTAzIEMxMzEuNDI1LDcwLjgzOCAxMzIuNzkzLDcwLjExMiAxMzMuOTc3LDcwLjExMiBDMTM0Ljk5NSw3MC4xMTIgMTM1Ljc5NSw3MC42MzggMTM2LjIzLDcxLjU5MiBMMTQyLjU4NCw4NS41MjYgTDE2OS41NjYsNjkuOTQ4IEwxNjkuNTY2LDE5LjYxNyBMOTQuNTE1LDYyLjk0OCBMOTQuNTE1LDYyLjk0OCBaIiBpZD0iRmlsbC0xOCIgZmlsbD0iIzYwN0Q4QiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xMDkuODk0LDkyLjk0MyBMMTA5Ljg5NCw5Mi45NDMgQzEwOC4xMiw5Mi45NDMgMTA2LjY1Myw5Mi4yMTggMTA1LjY1LDkwLjgyMyBDMTA1LjU4Myw5MC43MzEgMTA1LjU5Myw5MC42MSAxMDUuNjczLDkwLjUyOSBDMTA1Ljc1Myw5MC40NDggMTA1Ljg4LDkwLjQ0IDEwNS45NzQsOTAuNTA2IEMxMDYuNzU0LDkxLjA1MyAxMDcuNjc5LDkxLjMzMyAxMDguNzI0LDkxLjMzMyBDMTEwLjA0Nyw5MS4zMzMgMTExLjQ3OCw5MC44OTQgMTEyLjk4LDkwLjAyNyBDMTE4LjI5MSw4Ni45NiAxMjIuNjExLDc5LjUwOSAxMjIuNjExLDczLjQxNiBDMTIyLjYxMSw3MS40ODkgMTIyLjE2OSw2OS44NTYgMTIxLjMzMyw2OC42OTIgQzEyMS4yNjYsNjguNiAxMjEuMjc2LDY4LjQ3MyAxMjEuMzU2LDY4LjM5MiBDMTIxLjQzNiw2OC4zMTEgMTIxLjU2Myw2OC4yOTkgMTIxLjY1Niw2OC4zNjUgQzEyMy4zMjcsNjkuNTM3IDEyNC4yNDcsNzEuNzQ2IDEyNC4yNDcsNzQuNTg0IEMxMjQuMjQ3LDgwLjgyNiAxMTkuODIxLDg4LjQ0NyAxMTQuMzgyLDkxLjU4NyBDMTEyLjgwOCw5Mi40OTUgMTExLjI5OCw5Mi45NDMgMTA5Ljg5NCw5Mi45NDMgTDEwOS44OTQsOTIuOTQzIFogTTEwNi45MjUsOTEuNDAxIEMxMDcuNzM4LDkyLjA1MiAxMDguNzQ1LDkyLjI3OCAxMDkuODkzLDkyLjI3OCBMMTA5Ljg5NCw5Mi4yNzggQzExMS4yMTUsOTIuMjc4IDExMi42NDcsOTEuOTUxIDExNC4xNDgsOTEuMDg0IEMxMTkuNDU5LDg4LjAxNyAxMjMuNzgsODAuNjIxIDEyMy43OCw3NC41MjggQzEyMy43OCw3Mi41NDkgMTIzLjMxNyw3MC45MjkgMTIyLjQ1NCw2OS43NjcgQzEyMi44NjUsNzAuODAyIDEyMy4wNzksNzIuMDQyIDEyMy4wNzksNzMuNDAyIEMxMjMuMDc5LDc5LjY0NSAxMTguNjUzLDg3LjI4NSAxMTMuMjE0LDkwLjQyNSBDMTExLjY0LDkxLjMzNCAxMTAuMTMsOTEuNzQyIDEwOC43MjQsOTEuNzQyIEMxMDguMDgzLDkxLjc0MiAxMDcuNDgxLDkxLjU5MyAxMDYuOTI1LDkxLjQwMSBMMTA2LjkyNSw5MS40MDEgWiIgaWQ9IkZpbGwtMTkiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTEzLjA5Nyw5MC4yMyBDMTE4LjQ4MSw4Ny4xMjIgMTIyLjg0NSw3OS41OTQgMTIyLjg0NSw3My40MTYgQzEyMi44NDUsNzEuMzY1IDEyMi4zNjIsNjkuNzI0IDEyMS41MjIsNjguNTU2IEMxMTkuNzM4LDY3LjMwNCAxMTcuMTQ4LDY3LjM2MiAxMTQuMjY1LDY5LjAyNiBDMTA4Ljg4MSw3Mi4xMzQgMTA0LjUxNyw3OS42NjIgMTA0LjUxNyw4NS44NCBDMTA0LjUxNyw4Ny44OTEgMTA1LDg5LjUzMiAxMDUuODQsOTAuNyBDMTA3LjYyNCw5MS45NTIgMTEwLjIxNCw5MS44OTQgMTEzLjA5Nyw5MC4yMyIgaWQ9IkZpbGwtMjAiIGZpbGw9IiNGQUZBRkEiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTA4LjcyNCw5MS42MTQgTDEwOC43MjQsOTEuNjE0IEMxMDcuNTgyLDkxLjYxNCAxMDYuNTY2LDkxLjQwMSAxMDUuNzA1LDkwLjc5NyBDMTA1LjY4NCw5MC43ODMgMTA1LjY2NSw5MC44MTEgMTA1LjY1LDkwLjc5IEMxMDQuNzU2LDg5LjU0NiAxMDQuMjgzLDg3Ljg0MiAxMDQuMjgzLDg1LjgxNyBDMTA0LjI4Myw3OS41NzUgMTA4LjcwOSw3MS45NTMgMTE0LjE0OCw2OC44MTIgQzExNS43MjIsNjcuOTA0IDExNy4yMzIsNjcuNDQ5IDExOC42MzgsNjcuNDQ5IEMxMTkuNzgsNjcuNDQ5IDEyMC43OTYsNjcuNzU4IDEyMS42NTYsNjguMzYyIEMxMjEuNjc4LDY4LjM3NyAxMjEuNjk3LDY4LjM5NyAxMjEuNzEyLDY4LjQxOCBDMTIyLjYwNiw2OS42NjIgMTIzLjA3OSw3MS4zOSAxMjMuMDc5LDczLjQxNSBDMTIzLjA3OSw3OS42NTggMTE4LjY1Myw4Ny4xOTggMTEzLjIxNCw5MC4zMzggQzExMS42NCw5MS4yNDcgMTEwLjEzLDkxLjYxNCAxMDguNzI0LDkxLjYxNCBMMTA4LjcyNCw5MS42MTQgWiBNMTA2LjAwNiw5MC41MDUgQzEwNi43OCw5MS4wMzcgMTA3LjY5NCw5MS4yODEgMTA4LjcyNCw5MS4yODEgQzExMC4wNDcsOTEuMjgxIDExMS40NzgsOTAuODY4IDExMi45OCw5MC4wMDEgQzExOC4yOTEsODYuOTM1IDEyMi42MTEsNzkuNDk2IDEyMi42MTEsNzMuNDAzIEMxMjIuNjExLDcxLjQ5NCAxMjIuMTc3LDY5Ljg4IDEyMS4zNTYsNjguNzE4IEMxMjAuNTgyLDY4LjE4NSAxMTkuNjY4LDY3LjkxOSAxMTguNjM4LDY3LjkxOSBDMTE3LjMxNSw2Ny45MTkgMTE1Ljg4Myw2OC4zNiAxMTQuMzgyLDY5LjIyNyBDMTA5LjA3MSw3Mi4yOTMgMTA0Ljc1MSw3OS43MzMgMTA0Ljc1MSw4NS44MjYgQzEwNC43NTEsODcuNzM1IDEwNS4xODUsODkuMzQzIDEwNi4wMDYsOTAuNTA1IEwxMDYuMDA2LDkwLjUwNSBaIiBpZD0iRmlsbC0yMSIgZmlsbD0iIzYwN0Q4QiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNDkuMzE4LDcuMjYyIEwxMzkuMzM0LDE2LjE0IEwxNTUuMjI3LDI3LjE3MSBMMTYwLjgxNiwyMS4wNTkgTDE0OS4zMTgsNy4yNjIiIGlkPSJGaWxsLTIyIiBmaWxsPSIjRkFGQUZBIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE2OS42NzYsMTMuODQgTDE1OS45MjgsMTkuNDY3IEMxNTYuMjg2LDIxLjU3IDE1MC40LDIxLjU4IDE0Ni43ODEsMTkuNDkxIEMxNDMuMTYxLDE3LjQwMiAxNDMuMTgsMTQuMDAzIDE0Ni44MjIsMTEuOSBMMTU2LjMxNyw2LjI5MiBMMTQ5LjU4OCwyLjQwNyBMNjcuNzUyLDQ5LjQ3OCBMMTEzLjY3NSw3NS45OTIgTDExNi43NTYsNzQuMjEzIEMxMTcuMzg3LDczLjg0OCAxMTcuNjI1LDczLjMxNSAxMTcuMzc0LDcyLjgyMyBDMTE1LjAxNyw2OC4xOTEgMTE0Ljc4MSw2My4yNzcgMTE2LjY5MSw1OC41NjEgQzEyMi4zMjksNDQuNjQxIDE0MS4yLDMzLjc0NiAxNjUuMzA5LDMwLjQ5MSBDMTczLjQ3OCwyOS4zODggMTgxLjk4OSwyOS41MjQgMTkwLjAxMywzMC44ODUgQzE5MC44NjUsMzEuMDMgMTkxLjc4OSwzMC44OTMgMTkyLjQyLDMwLjUyOCBMMTk1LjUwMSwyOC43NSBMMTY5LjY3NiwxMy44NCIgaWQ9IkZpbGwtMjMiIGZpbGw9IiNGQUZBRkEiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTEzLjY3NSw3Ni40NTkgQzExMy41OTQsNzYuNDU5IDExMy41MTQsNzYuNDM4IDExMy40NDIsNzYuMzk3IEw2Ny41MTgsNDkuODgyIEM2Ny4zNzQsNDkuNzk5IDY3LjI4NCw0OS42NDUgNjcuMjg1LDQ5LjQ3OCBDNjcuMjg1LDQ5LjMxMSA2Ny4zNzQsNDkuMTU3IDY3LjUxOSw0OS4wNzMgTDE0OS4zNTUsMi4wMDIgQzE0OS40OTksMS45MTkgMTQ5LjY3NywxLjkxOSAxNDkuODIxLDIuMDAyIEwxNTYuNTUsNS44ODcgQzE1Ni43NzQsNi4wMTcgMTU2Ljg1LDYuMzAyIDE1Ni43MjIsNi41MjYgQzE1Ni41OTIsNi43NDkgMTU2LjMwNyw2LjgyNiAxNTYuMDgzLDYuNjk2IEwxNDkuNTg3LDIuOTQ2IEw2OC42ODcsNDkuNDc5IEwxMTMuNjc1LDc1LjQ1MiBMMTE2LjUyMyw3My44MDggQzExNi43MTUsNzMuNjk3IDExNy4xNDMsNzMuMzk5IDExNi45NTgsNzMuMDM1IEMxMTQuNTQyLDY4LjI4NyAxMTQuMyw2My4yMjEgMTE2LjI1OCw1OC4zODUgQzExOS4wNjQsNTEuNDU4IDEyNS4xNDMsNDUuMTQzIDEzMy44NCw0MC4xMjIgQzE0Mi40OTcsMzUuMTI0IDE1My4zNTgsMzEuNjMzIDE2NS4yNDcsMzAuMDI4IEMxNzMuNDQ1LDI4LjkyMSAxODIuMDM3LDI5LjA1OCAxOTAuMDkxLDMwLjQyNSBDMTkwLjgzLDMwLjU1IDE5MS42NTIsMzAuNDMyIDE5Mi4xODYsMzAuMTI0IEwxOTQuNTY3LDI4Ljc1IEwxNjkuNDQyLDE0LjI0NCBDMTY5LjIxOSwxNC4xMTUgMTY5LjE0MiwxMy44MjkgMTY5LjI3MSwxMy42MDYgQzE2OS40LDEzLjM4MiAxNjkuNjg1LDEzLjMwNiAxNjkuOTA5LDEzLjQzNSBMMTk1LjczNCwyOC4zNDUgQzE5NS44NzksMjguNDI4IDE5NS45NjgsMjguNTgzIDE5NS45NjgsMjguNzUgQzE5NS45NjgsMjguOTE2IDE5NS44NzksMjkuMDcxIDE5NS43MzQsMjkuMTU0IEwxOTIuNjUzLDMwLjkzMyBDMTkxLjkzMiwzMS4zNSAxOTAuODksMzEuNTA4IDE4OS45MzUsMzEuMzQ2IEMxODEuOTcyLDI5Ljk5NSAxNzMuNDc4LDI5Ljg2IDE2NS4zNzIsMzAuOTU0IEMxNTMuNjAyLDMyLjU0MyAxNDIuODYsMzUuOTkzIDEzNC4zMDcsNDAuOTMxIEMxMjUuNzkzLDQ1Ljg0NyAxMTkuODUxLDUyLjAwNCAxMTcuMTI0LDU4LjczNiBDMTE1LjI3LDYzLjMxNCAxMTUuNTAxLDY4LjExMiAxMTcuNzksNzIuNjExIEMxMTguMTYsNzMuMzM2IDExNy44NDUsNzQuMTI0IDExNi45OSw3NC42MTcgTDExMy45MDksNzYuMzk3IEMxMTMuODM2LDc2LjQzOCAxMTMuNzU2LDc2LjQ1OSAxMTMuNjc1LDc2LjQ1OSIgaWQ9IkZpbGwtMjQiIGZpbGw9IiM0NTVBNjQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTUzLjMxNiwyMS4yNzkgQzE1MC45MDMsMjEuMjc5IDE0OC40OTUsMjAuNzUxIDE0Ni42NjQsMTkuNjkzIEMxNDQuODQ2LDE4LjY0NCAxNDMuODQ0LDE3LjIzMiAxNDMuODQ0LDE1LjcxOCBDMTQzLjg0NCwxNC4xOTEgMTQ0Ljg2LDEyLjc2MyAxNDYuNzA1LDExLjY5OCBMMTU2LjE5OCw2LjA5MSBDMTU2LjMwOSw2LjAyNSAxNTYuNDUyLDYuMDYyIDE1Ni41MTgsNi4xNzMgQzE1Ni41ODMsNi4yODQgMTU2LjU0Nyw2LjQyNyAxNTYuNDM2LDYuNDkzIEwxNDYuOTQsMTIuMTAyIEMxNDUuMjQ0LDEzLjA4MSAxNDQuMzEyLDE0LjM2NSAxNDQuMzEyLDE1LjcxOCBDMTQ0LjMxMiwxNy4wNTggMTQ1LjIzLDE4LjMyNiAxNDYuODk3LDE5LjI4OSBDMTUwLjQ0NiwyMS4zMzggMTU2LjI0LDIxLjMyNyAxNTkuODExLDE5LjI2NSBMMTY5LjU1OSwxMy42MzcgQzE2OS42NywxMy41NzMgMTY5LjgxMywxMy42MTEgMTY5Ljg3OCwxMy43MjMgQzE2OS45NDMsMTMuODM0IDE2OS45MDQsMTMuOTc3IDE2OS43OTMsMTQuMDQyIEwxNjAuMDQ1LDE5LjY3IEMxNTguMTg3LDIwLjc0MiAxNTUuNzQ5LDIxLjI3OSAxNTMuMzE2LDIxLjI3OSIgaWQ9IkZpbGwtMjUiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTEzLjY3NSw3NS45OTIgTDY3Ljc2Miw0OS40ODQiIGlkPSJGaWxsLTI2IiBmaWxsPSIjNDU1QTY0Ij48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTExMy42NzUsNzYuMzQyIEMxMTMuNjE1LDc2LjM0MiAxMTMuNTU1LDc2LjMyNyAxMTMuNSw3Ni4yOTUgTDY3LjU4Nyw0OS43ODcgQzY3LjQxOSw0OS42OSA2Ny4zNjIsNDkuNDc2IDY3LjQ1OSw0OS4zMDkgQzY3LjU1Niw0OS4xNDEgNjcuNzcsNDkuMDgzIDY3LjkzNyw0OS4xOCBMMTEzLjg1LDc1LjY4OCBDMTE0LjAxOCw3NS43ODUgMTE0LjA3NSw3NiAxMTMuOTc4LDc2LjE2NyBDMTEzLjkxNCw3Ni4yNzkgMTEzLjc5Niw3Ni4zNDIgMTEzLjY3NSw3Ni4zNDIiIGlkPSJGaWxsLTI3IiBmaWxsPSIjNDU1QTY0Ij48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTY3Ljc2Miw0OS40ODQgTDY3Ljc2MiwxMDMuNDg1IEM2Ny43NjIsMTA0LjU3NSA2OC41MzIsMTA1LjkwMyA2OS40ODIsMTA2LjQ1MiBMMTExLjk1NSwxMzAuOTczIEMxMTIuOTA1LDEzMS41MjIgMTEzLjY3NSwxMzEuMDgzIDExMy42NzUsMTI5Ljk5MyBMMTEzLjY3NSw3NS45OTIiIGlkPSJGaWxsLTI4IiBmaWxsPSIjRkFGQUZBIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTExMi43MjcsMTMxLjU2MSBDMTEyLjQzLDEzMS41NjEgMTEyLjEwNywxMzEuNDY2IDExMS43OCwxMzEuMjc2IEw2OS4zMDcsMTA2Ljc1NSBDNjguMjQ0LDEwNi4xNDIgNjcuNDEyLDEwNC43MDUgNjcuNDEyLDEwMy40ODUgTDY3LjQxMiw0OS40ODQgQzY3LjQxMiw0OS4yOSA2Ny41NjksNDkuMTM0IDY3Ljc2Miw0OS4xMzQgQzY3Ljk1Niw0OS4xMzQgNjguMTEzLDQ5LjI5IDY4LjExMyw0OS40ODQgTDY4LjExMywxMDMuNDg1IEM2OC4xMTMsMTA0LjQ0NSA2OC44MiwxMDUuNjY1IDY5LjY1NywxMDYuMTQ4IEwxMTIuMTMsMTMwLjY3IEMxMTIuNDc0LDEzMC44NjggMTEyLjc5MSwxMzAuOTEzIDExMywxMzAuNzkyIEMxMTMuMjA2LDEzMC42NzMgMTEzLjMyNSwxMzAuMzgxIDExMy4zMjUsMTI5Ljk5MyBMMTEzLjMyNSw3NS45OTIgQzExMy4zMjUsNzUuNzk4IDExMy40ODIsNzUuNjQxIDExMy42NzUsNzUuNjQxIEMxMTMuODY5LDc1LjY0MSAxMTQuMDI1LDc1Ljc5OCAxMTQuMDI1LDc1Ljk5MiBMMTE0LjAyNSwxMjkuOTkzIEMxMTQuMDI1LDEzMC42NDggMTEzLjc4NiwxMzEuMTQ3IDExMy4zNSwxMzEuMzk5IEMxMTMuMTYyLDEzMS41MDcgMTEyLjk1MiwxMzEuNTYxIDExMi43MjcsMTMxLjU2MSIgaWQ9IkZpbGwtMjkiIGZpbGw9IiM0NTVBNjQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTEyLjg2LDQwLjUxMiBDMTEyLjg2LDQwLjUxMiAxMTIuODYsNDAuNTEyIDExMi44NTksNDAuNTEyIEMxMTAuNTQxLDQwLjUxMiAxMDguMzYsMzkuOTkgMTA2LjcxNywzOS4wNDEgQzEwNS4wMTIsMzguMDU3IDEwNC4wNzQsMzYuNzI2IDEwNC4wNzQsMzUuMjkyIEMxMDQuMDc0LDMzLjg0NyAxMDUuMDI2LDMyLjUwMSAxMDYuNzU0LDMxLjUwNCBMMTE4Ljc5NSwyNC41NTEgQzEyMC40NjMsMjMuNTg5IDEyMi42NjksMjMuMDU4IDEyNS4wMDcsMjMuMDU4IEMxMjcuMzI1LDIzLjA1OCAxMjkuNTA2LDIzLjU4MSAxMzEuMTUsMjQuNTMgQzEzMi44NTQsMjUuNTE0IDEzMy43OTMsMjYuODQ1IDEzMy43OTMsMjguMjc4IEMxMzMuNzkzLDI5LjcyNCAxMzIuODQxLDMxLjA2OSAxMzEuMTEzLDMyLjA2NyBMMTE5LjA3MSwzOS4wMTkgQzExNy40MDMsMzkuOTgyIDExNS4xOTcsNDAuNTEyIDExMi44Niw0MC41MTIgTDExMi44Niw0MC41MTIgWiBNMTI1LjAwNywyMy43NTkgQzEyMi43OSwyMy43NTkgMTIwLjcwOSwyNC4yNTYgMTE5LjE0NiwyNS4xNTggTDEwNy4xMDQsMzIuMTEgQzEwNS42MDIsMzIuOTc4IDEwNC43NzQsMzQuMTA4IDEwNC43NzQsMzUuMjkyIEMxMDQuNzc0LDM2LjQ2NSAxMDUuNTg5LDM3LjU4MSAxMDcuMDY3LDM4LjQzNCBDMTA4LjYwNSwzOS4zMjMgMTEwLjY2MywzOS44MTIgMTEyLjg1OSwzOS44MTIgTDExMi44NiwzOS44MTIgQzExNS4wNzYsMzkuODEyIDExNy4xNTgsMzkuMzE1IDExOC43MjEsMzguNDEzIEwxMzAuNzYyLDMxLjQ2IEMxMzIuMjY0LDMwLjU5MyAxMzMuMDkyLDI5LjQ2MyAxMzMuMDkyLDI4LjI3OCBDMTMzLjA5MiwyNy4xMDYgMTMyLjI3OCwyNS45OSAxMzAuOCwyNS4xMzYgQzEyOS4yNjEsMjQuMjQ4IDEyNy4yMDQsMjMuNzU5IDEyNS4wMDcsMjMuNzU5IEwxMjUuMDA3LDIzLjc1OSBaIiBpZD0iRmlsbC0zMCIgZmlsbD0iIzYwN0Q4QiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNjUuNjMsMTYuMjE5IEwxNTkuODk2LDE5LjUzIEMxNTYuNzI5LDIxLjM1OCAxNTEuNjEsMjEuMzY3IDE0OC40NjMsMTkuNTUgQzE0NS4zMTYsMTcuNzMzIDE0NS4zMzIsMTQuNzc4IDE0OC40OTksMTIuOTQ5IEwxNTQuMjMzLDkuNjM5IEwxNjUuNjMsMTYuMjE5IiBpZD0iRmlsbC0zMSIgZmlsbD0iI0ZBRkFGQSI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xNTQuMjMzLDEwLjQ0OCBMMTY0LjIyOCwxNi4yMTkgTDE1OS41NDYsMTguOTIzIEMxNTguMTEyLDE5Ljc1IDE1Ni4xOTQsMjAuMjA2IDE1NC4xNDcsMjAuMjA2IEMxNTIuMTE4LDIwLjIwNiAxNTAuMjI0LDE5Ljc1NyAxNDguODE0LDE4Ljk0MyBDMTQ3LjUyNCwxOC4xOTkgMTQ2LjgxNCwxNy4yNDkgMTQ2LjgxNCwxNi4yNjkgQzE0Ni44MTQsMTUuMjc4IDE0Ny41MzcsMTQuMzE0IDE0OC44NSwxMy41NTYgTDE1NC4yMzMsMTAuNDQ4IE0xNTQuMjMzLDkuNjM5IEwxNDguNDk5LDEyLjk0OSBDMTQ1LjMzMiwxNC43NzggMTQ1LjMxNiwxNy43MzMgMTQ4LjQ2MywxOS41NSBDMTUwLjAzMSwyMC40NTUgMTUyLjA4NiwyMC45MDcgMTU0LjE0NywyMC45MDcgQzE1Ni4yMjQsMjAuOTA3IDE1OC4zMDYsMjAuNDQ3IDE1OS44OTYsMTkuNTMgTDE2NS42MywxNi4yMTkgTDE1NC4yMzMsOS42MzkiIGlkPSJGaWxsLTMyIiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE0NS40NDUsNzIuNjY3IEwxNDUuNDQ1LDcyLjY2NyBDMTQzLjY3Miw3Mi42NjcgMTQyLjIwNCw3MS44MTcgMTQxLjIwMiw3MC40MjIgQzE0MS4xMzUsNzAuMzMgMTQxLjE0NSw3MC4xNDcgMTQxLjIyNSw3MC4wNjYgQzE0MS4zMDUsNjkuOTg1IDE0MS40MzIsNjkuOTQ2IDE0MS41MjUsNzAuMDExIEMxNDIuMzA2LDcwLjU1OSAxNDMuMjMxLDcwLjgyMyAxNDQuMjc2LDcwLjgyMiBDMTQ1LjU5OCw3MC44MjIgMTQ3LjAzLDcwLjM3NiAxNDguNTMyLDY5LjUwOSBDMTUzLjg0Miw2Ni40NDMgMTU4LjE2Myw1OC45ODcgMTU4LjE2Myw1Mi44OTQgQzE1OC4xNjMsNTAuOTY3IDE1Ny43MjEsNDkuMzMyIDE1Ni44ODQsNDguMTY4IEMxNTYuODE4LDQ4LjA3NiAxNTYuODI4LDQ3Ljk0OCAxNTYuOTA4LDQ3Ljg2NyBDMTU2Ljk4OCw0Ny43ODYgMTU3LjExNCw0Ny43NzQgMTU3LjIwOCw0Ny44NCBDMTU4Ljg3OCw0OS4wMTIgMTU5Ljc5OCw1MS4yMiAxNTkuNzk4LDU0LjA1OSBDMTU5Ljc5OCw2MC4zMDEgMTU1LjM3Myw2OC4wNDYgMTQ5LjkzMyw3MS4xODYgQzE0OC4zNiw3Mi4wOTQgMTQ2Ljg1LDcyLjY2NyAxNDUuNDQ1LDcyLjY2NyBMMTQ1LjQ0NSw3Mi42NjcgWiBNMTQyLjQ3Niw3MSBDMTQzLjI5LDcxLjY1MSAxNDQuMjk2LDcyLjAwMiAxNDUuNDQ1LDcyLjAwMiBDMTQ2Ljc2Nyw3Mi4wMDIgMTQ4LjE5OCw3MS41NSAxNDkuNyw3MC42ODIgQzE1NS4wMSw2Ny42MTcgMTU5LjMzMSw2MC4xNTkgMTU5LjMzMSw1NC4wNjUgQzE1OS4zMzEsNTIuMDg1IDE1OC44NjgsNTAuNDM1IDE1OC4wMDYsNDkuMjcyIEMxNTguNDE3LDUwLjMwNyAxNTguNjMsNTEuNTMyIDE1OC42Myw1Mi44OTIgQzE1OC42Myw1OS4xMzQgMTU0LjIwNSw2Ni43NjcgMTQ4Ljc2NSw2OS45MDcgQzE0Ny4xOTIsNzAuODE2IDE0NS42ODEsNzEuMjgzIDE0NC4yNzYsNzEuMjgzIEMxNDMuNjM0LDcxLjI4MyAxNDMuMDMzLDcxLjE5MiAxNDIuNDc2LDcxIEwxNDIuNDc2LDcxIFoiIGlkPSJGaWxsLTMzIiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE0OC42NDgsNjkuNzA0IEMxNTQuMDMyLDY2LjU5NiAxNTguMzk2LDU5LjA2OCAxNTguMzk2LDUyLjg5MSBDMTU4LjM5Niw1MC44MzkgMTU3LjkxMyw0OS4xOTggMTU3LjA3NCw0OC4wMyBDMTU1LjI4OSw0Ni43NzggMTUyLjY5OSw0Ni44MzYgMTQ5LjgxNiw0OC41MDEgQzE0NC40MzMsNTEuNjA5IDE0MC4wNjgsNTkuMTM3IDE0MC4wNjgsNjUuMzE0IEMxNDAuMDY4LDY3LjM2NSAxNDAuNTUyLDY5LjAwNiAxNDEuMzkxLDcwLjE3NCBDMTQzLjE3Niw3MS40MjcgMTQ1Ljc2NSw3MS4zNjkgMTQ4LjY0OCw2OS43MDQiIGlkPSJGaWxsLTM0IiBmaWxsPSIjRkFGQUZBIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE0NC4yNzYsNzEuMjc2IEwxNDQuMjc2LDcxLjI3NiBDMTQzLjEzMyw3MS4yNzYgMTQyLjExOCw3MC45NjkgMTQxLjI1Nyw3MC4zNjUgQzE0MS4yMzYsNzAuMzUxIDE0MS4yMTcsNzAuMzMyIDE0MS4yMDIsNzAuMzExIEMxNDAuMzA3LDY5LjA2NyAxMzkuODM1LDY3LjMzOSAxMzkuODM1LDY1LjMxNCBDMTM5LjgzNSw1OS4wNzMgMTQ0LjI2LDUxLjQzOSAxNDkuNyw0OC4yOTggQzE1MS4yNzMsNDcuMzkgMTUyLjc4NCw0Ni45MjkgMTU0LjE4OSw0Ni45MjkgQzE1NS4zMzIsNDYuOTI5IDE1Ni4zNDcsNDcuMjM2IDE1Ny4yMDgsNDcuODM5IEMxNTcuMjI5LDQ3Ljg1NCAxNTcuMjQ4LDQ3Ljg3MyAxNTcuMjYzLDQ3Ljg5NCBDMTU4LjE1Nyw0OS4xMzggMTU4LjYzLDUwLjg2NSAxNTguNjMsNTIuODkxIEMxNTguNjMsNTkuMTMyIDE1NC4yMDUsNjYuNzY2IDE0OC43NjUsNjkuOTA3IEMxNDcuMTkyLDcwLjgxNSAxNDUuNjgxLDcxLjI3NiAxNDQuMjc2LDcxLjI3NiBMMTQ0LjI3Niw3MS4yNzYgWiBNMTQxLjU1OCw3MC4xMDQgQzE0Mi4zMzEsNzAuNjM3IDE0My4yNDUsNzEuMDA1IDE0NC4yNzYsNzEuMDA1IEMxNDUuNTk4LDcxLjAwNSAxNDcuMDMsNzAuNDY3IDE0OC41MzIsNjkuNiBDMTUzLjg0Miw2Ni41MzQgMTU4LjE2Myw1OS4wMzMgMTU4LjE2Myw1Mi45MzkgQzE1OC4xNjMsNTEuMDMxIDE1Ny43MjksNDkuMzg1IDE1Ni45MDcsNDguMjIzIEMxNTYuMTMzLDQ3LjY5MSAxNTUuMjE5LDQ3LjQwOSAxNTQuMTg5LDQ3LjQwOSBDMTUyLjg2Nyw0Ny40MDkgMTUxLjQzNSw0Ny44NDIgMTQ5LjkzMyw0OC43MDkgQzE0NC42MjMsNTEuNzc1IDE0MC4zMDIsNTkuMjczIDE0MC4zMDIsNjUuMzY2IEMxNDAuMzAyLDY3LjI3NiAxNDAuNzM2LDY4Ljk0MiAxNDEuNTU4LDcwLjEwNCBMMTQxLjU1OCw3MC4xMDQgWiIgaWQ9IkZpbGwtMzUiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTUwLjcyLDY1LjM2MSBMMTUwLjM1Nyw2NS4wNjYgQzE1MS4xNDcsNjQuMDkyIDE1MS44NjksNjMuMDQgMTUyLjUwNSw2MS45MzggQzE1My4zMTMsNjAuNTM5IDE1My45NzgsNTkuMDY3IDE1NC40ODIsNTcuNTYzIEwxNTQuOTI1LDU3LjcxMiBDMTU0LjQxMiw1OS4yNDUgMTUzLjczMyw2MC43NDUgMTUyLjkxLDYyLjE3MiBDMTUyLjI2Miw2My4yOTUgMTUxLjUyNSw2NC4zNjggMTUwLjcyLDY1LjM2MSIgaWQ9IkZpbGwtMzYiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTE1LjkxNyw4NC41MTQgTDExNS41NTQsODQuMjIgQzExNi4zNDQsODMuMjQ1IDExNy4wNjYsODIuMTk0IDExNy43MDIsODEuMDkyIEMxMTguNTEsNzkuNjkyIDExOS4xNzUsNzguMjIgMTE5LjY3OCw3Ni43MTcgTDEyMC4xMjEsNzYuODY1IEMxMTkuNjA4LDc4LjM5OCAxMTguOTMsNzkuODk5IDExOC4xMDYsODEuMzI2IEMxMTcuNDU4LDgyLjQ0OCAxMTYuNzIyLDgzLjUyMSAxMTUuOTE3LDg0LjUxNCIgaWQ9IkZpbGwtMzciIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTE0LDEzMC40NzYgTDExNCwxMzAuMDA4IEwxMTQsNzYuMDUyIEwxMTQsNzUuNTg0IEwxMTQsNzYuMDUyIEwxMTQsMTMwLjAwOCBMMTE0LDEzMC40NzYiIGlkPSJGaWxsLTM4IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICA8L2c+CiAgICAgICAgICAgICAgICA8ZyBpZD0iSW1wb3J0ZWQtTGF5ZXJzLUNvcHkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDYyLjAwMDAwMCwgMC4wMDAwMDApIiBza2V0Y2g6dHlwZT0iTVNTaGFwZUdyb3VwIj4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTkuODIyLDM3LjQ3NCBDMTkuODM5LDM3LjMzOSAxOS43NDcsMzcuMTk0IDE5LjU1NSwzNy4wODIgQzE5LjIyOCwzNi44OTQgMTguNzI5LDM2Ljg3MiAxOC40NDYsMzcuMDM3IEwxMi40MzQsNDAuNTA4IEMxMi4zMDMsNDAuNTg0IDEyLjI0LDQwLjY4NiAxMi4yNDMsNDAuNzkzIEMxMi4yNDUsNDAuOTI1IDEyLjI0NSw0MS4yNTQgMTIuMjQ1LDQxLjM3MSBMMTIuMjQ1LDQxLjQxNCBMMTIuMjM4LDQxLjU0MiBDOC4xNDgsNDMuODg3IDUuNjQ3LDQ1LjMyMSA1LjY0Nyw0NS4zMjEgQzUuNjQ2LDQ1LjMyMSAzLjU3LDQ2LjM2NyAyLjg2LDUwLjUxMyBDMi44Niw1MC41MTMgMS45NDgsNTcuNDc0IDEuOTYyLDcwLjI1OCBDMS45NzcsODIuODI4IDIuNTY4LDg3LjMyOCAzLjEyOSw5MS42MDkgQzMuMzQ5LDkzLjI5MyA2LjEzLDkzLjczNCA2LjEzLDkzLjczNCBDNi40NjEsOTMuNzc0IDYuODI4LDkzLjcwNyA3LjIxLDkzLjQ4NiBMODIuNDgzLDQ5LjkzNSBDODQuMjkxLDQ4Ljg2NiA4NS4xNSw0Ni4yMTYgODUuNTM5LDQzLjY1MSBDODYuNzUyLDM1LjY2MSA4Ny4yMTQsMTAuNjczIDg1LjI2NCwzLjc3MyBDODUuMDY4LDMuMDggODQuNzU0LDIuNjkgODQuMzk2LDIuNDkxIEw4Mi4zMSwxLjcwMSBDODEuNTgzLDEuNzI5IDgwLjg5NCwyLjE2OCA4MC43NzYsMi4yMzYgQzgwLjYzNiwyLjMxNyA0MS44MDcsMjQuNTg1IDIwLjAzMiwzNy4wNzIgTDE5LjgyMiwzNy40NzQiIGlkPSJGaWxsLTEiIGZpbGw9IiNGRkZGRkYiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNODIuMzExLDEuNzAxIEw4NC4zOTYsMi40OTEgQzg0Ljc1NCwyLjY5IDg1LjA2OCwzLjA4IDg1LjI2NCwzLjc3MyBDODcuMjEzLDEwLjY3MyA4Ni43NTEsMzUuNjYgODUuNTM5LDQzLjY1MSBDODUuMTQ5LDQ2LjIxNiA4NC4yOSw0OC44NjYgODIuNDgzLDQ5LjkzNSBMNy4yMSw5My40ODYgQzYuODk3LDkzLjY2NyA2LjU5NSw5My43NDQgNi4zMTQsOTMuNzQ0IEw2LjEzMSw5My43MzMgQzYuMTMxLDkzLjczNCAzLjM0OSw5My4yOTMgMy4xMjgsOTEuNjA5IEMyLjU2OCw4Ny4zMjcgMS45NzcsODIuODI4IDEuOTYzLDcwLjI1OCBDMS45NDgsNTcuNDc0IDIuODYsNTAuNTEzIDIuODYsNTAuNTEzIEMzLjU3LDQ2LjM2NyA1LjY0Nyw0NS4zMjEgNS42NDcsNDUuMzIxIEM1LjY0Nyw0NS4zMjEgOC4xNDgsNDMuODg3IDEyLjIzOCw0MS41NDIgTDEyLjI0NSw0MS40MTQgTDEyLjI0NSw0MS4zNzEgQzEyLjI0NSw0MS4yNTQgMTIuMjQ1LDQwLjkyNSAxMi4yNDMsNDAuNzkzIEMxMi4yNCw0MC42ODYgMTIuMzAyLDQwLjU4MyAxMi40MzQsNDAuNTA4IEwxOC40NDYsMzcuMDM2IEMxOC41NzQsMzYuOTYyIDE4Ljc0NiwzNi45MjYgMTguOTI3LDM2LjkyNiBDMTkuMTQ1LDM2LjkyNiAxOS4zNzYsMzYuOTc5IDE5LjU1NCwzNy4wODIgQzE5Ljc0NywzNy4xOTQgMTkuODM5LDM3LjM0IDE5LjgyMiwzNy40NzQgTDIwLjAzMywzNy4wNzIgQzQxLjgwNiwyNC41ODUgODAuNjM2LDIuMzE4IDgwLjc3NywyLjIzNiBDODAuODk0LDIuMTY4IDgxLjU4MywxLjcyOSA4Mi4zMTEsMS43MDEgTTgyLjMxMSwwLjcwNCBMODIuMjcyLDAuNzA1IEM4MS42NTQsMC43MjggODAuOTg5LDAuOTQ5IDgwLjI5OCwxLjM2MSBMODAuMjc3LDEuMzczIEM4MC4xMjksMS40NTggNTkuNzY4LDEzLjEzNSAxOS43NTgsMzYuMDc5IEMxOS41LDM1Ljk4MSAxOS4yMTQsMzUuOTI5IDE4LjkyNywzNS45MjkgQzE4LjU2MiwzNS45MjkgMTguMjIzLDM2LjAxMyAxNy45NDcsMzYuMTczIEwxMS45MzUsMzkuNjQ0IEMxMS40OTMsMzkuODk5IDExLjIzNiw0MC4zMzQgMTEuMjQ2LDQwLjgxIEwxMS4yNDcsNDAuOTYgTDUuMTY3LDQ0LjQ0NyBDNC43OTQsNDQuNjQ2IDIuNjI1LDQ1Ljk3OCAxLjg3Nyw1MC4zNDUgTDEuODcxLDUwLjM4NCBDMS44NjIsNTAuNDU0IDAuOTUxLDU3LjU1NyAwLjk2NSw3MC4yNTkgQzAuOTc5LDgyLjg3OSAxLjU2OCw4Ny4zNzUgMi4xMzcsOTEuNzI0IEwyLjEzOSw5MS43MzkgQzIuNDQ3LDk0LjA5NCA1LjYxNCw5NC42NjIgNS45NzUsOTQuNzE5IEw2LjAwOSw5NC43MjMgQzYuMTEsOTQuNzM2IDYuMjEzLDk0Ljc0MiA2LjMxNCw5NC43NDIgQzYuNzksOTQuNzQyIDcuMjYsOTQuNjEgNy43MSw5NC4zNSBMODIuOTgzLDUwLjc5OCBDODQuNzk0LDQ5LjcyNyA4NS45ODIsNDcuMzc1IDg2LjUyNSw0My44MDEgQzg3LjcxMSwzNS45ODcgODguMjU5LDEwLjcwNSA4Ni4yMjQsMy41MDIgQzg1Ljk3MSwyLjYwOSA4NS41MiwxLjk3NSA4NC44ODEsMS42MiBMODQuNzQ5LDEuNTU4IEw4Mi42NjQsMC43NjkgQzgyLjU1MSwwLjcyNSA4Mi40MzEsMC43MDQgODIuMzExLDAuNzA0IiBpZD0iRmlsbC0yIiBmaWxsPSIjNDU1QTY0Ij48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTY2LjI2NywxMS41NjUgTDY3Ljc2MiwxMS45OTkgTDExLjQyMyw0NC4zMjUiIGlkPSJGaWxsLTMiIGZpbGw9IiNGRkZGRkYiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTIuMjAyLDkwLjU0NSBDMTIuMDI5LDkwLjU0NSAxMS44NjIsOTAuNDU1IDExLjc2OSw5MC4yOTUgQzExLjYzMiw5MC4wNTcgMTEuNzEzLDg5Ljc1MiAxMS45NTIsODkuNjE0IEwzMC4zODksNzguOTY5IEMzMC42MjgsNzguODMxIDMwLjkzMyw3OC45MTMgMzEuMDcxLDc5LjE1MiBDMzEuMjA4LDc5LjM5IDMxLjEyNyw3OS42OTYgMzAuODg4LDc5LjgzMyBMMTIuNDUxLDkwLjQ3OCBMMTIuMjAyLDkwLjU0NSIgaWQ9IkZpbGwtNCIgZmlsbD0iIzYwN0Q4QiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xMy43NjQsNDIuNjU0IEwxMy42NTYsNDIuNTkyIEwxMy43MDIsNDIuNDIxIEwxOC44MzcsMzkuNDU3IEwxOS4wMDcsMzkuNTAyIEwxOC45NjIsMzkuNjczIEwxMy44MjcsNDIuNjM3IEwxMy43NjQsNDIuNjU0IiBpZD0iRmlsbC01IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTguNTIsOTAuMzc1IEw4LjUyLDQ2LjQyMSBMOC41ODMsNDYuMzg1IEw3NS44NCw3LjU1NCBMNzUuODQsNTEuNTA4IEw3NS43NzgsNTEuNTQ0IEw4LjUyLDkwLjM3NSBMOC41Miw5MC4zNzUgWiBNOC43Nyw0Ni41NjQgTDguNzcsODkuOTQ0IEw3NS41OTEsNTEuMzY1IEw3NS41OTEsNy45ODUgTDguNzcsNDYuNTY0IEw4Ljc3LDQ2LjU2NCBaIiBpZD0iRmlsbC02IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTI0Ljk4Niw4My4xODIgQzI0Ljc1Niw4My4zMzEgMjQuMzc0LDgzLjU2NiAyNC4xMzcsODMuNzA1IEwxMi42MzIsOTAuNDA2IEMxMi4zOTUsOTAuNTQ1IDEyLjQyNiw5MC42NTggMTIuNyw5MC42NTggTDEzLjI2NSw5MC42NTggQzEzLjU0LDkwLjY1OCAxMy45NTgsOTAuNTQ1IDE0LjE5NSw5MC40MDYgTDI1LjcsODMuNzA1IEMyNS45MzcsODMuNTY2IDI2LjEyOCw4My40NTIgMjYuMTI1LDgzLjQ0OSBDMjYuMTIyLDgzLjQ0NyAyNi4xMTksODMuMjIgMjYuMTE5LDgyLjk0NiBDMjYuMTE5LDgyLjY3MiAyNS45MzEsODIuNTY5IDI1LjcwMSw4Mi43MTkgTDI0Ljk4Niw4My4xODIiIGlkPSJGaWxsLTciIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTMuMjY2LDkwLjc4MiBMMTIuNyw5MC43ODIgQzEyLjUsOTAuNzgyIDEyLjM4NCw5MC43MjYgMTIuMzU0LDkwLjYxNiBDMTIuMzI0LDkwLjUwNiAxMi4zOTcsOTAuMzk5IDEyLjU2OSw5MC4yOTkgTDI0LjA3NCw4My41OTcgQzI0LjMxLDgzLjQ1OSAyNC42ODksODMuMjI2IDI0LjkxOCw4My4wNzggTDI1LjYzMyw4Mi42MTQgQzI1LjcyMyw4Mi41NTUgMjUuODEzLDgyLjUyNSAyNS44OTksODIuNTI1IEMyNi4wNzEsODIuNTI1IDI2LjI0NCw4Mi42NTUgMjYuMjQ0LDgyLjk0NiBDMjYuMjQ0LDgzLjE2IDI2LjI0NSw4My4zMDkgMjYuMjQ3LDgzLjM4MyBMMjYuMjUzLDgzLjM4NyBMMjYuMjQ5LDgzLjQ1NiBDMjYuMjQ2LDgzLjUzMSAyNi4yNDYsODMuNTMxIDI1Ljc2Myw4My44MTIgTDE0LjI1OCw5MC41MTQgQzE0LDkwLjY2NSAxMy41NjQsOTAuNzgyIDEzLjI2Niw5MC43ODIgTDEzLjI2Niw5MC43ODIgWiBNMTIuNjY2LDkwLjUzMiBMMTIuNyw5MC41MzMgTDEzLjI2Niw5MC41MzMgQzEzLjUxOCw5MC41MzMgMTMuOTE1LDkwLjQyNSAxNC4xMzIsOTAuMjk5IEwyNS42MzcsODMuNTk3IEMyNS44MDUsODMuNDk5IDI1LjkzMSw4My40MjQgMjUuOTk4LDgzLjM4MyBDMjUuOTk0LDgzLjI5OSAyNS45OTQsODMuMTY1IDI1Ljk5NCw4Mi45NDYgTDI1Ljg5OSw4Mi43NzUgTDI1Ljc2OCw4Mi44MjQgTDI1LjA1NCw4My4yODcgQzI0LjgyMiw4My40MzcgMjQuNDM4LDgzLjY3MyAyNC4yLDgzLjgxMiBMMTIuNjk1LDkwLjUxNCBMMTIuNjY2LDkwLjUzMiBMMTIuNjY2LDkwLjUzMiBaIiBpZD0iRmlsbC04IiBmaWxsPSIjNjA3RDhCIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTEzLjI2Niw4OS44NzEgTDEyLjcsODkuODcxIEMxMi41LDg5Ljg3MSAxMi4zODQsODkuODE1IDEyLjM1NCw4OS43MDUgQzEyLjMyNCw4OS41OTUgMTIuMzk3LDg5LjQ4OCAxMi41NjksODkuMzg4IEwyNC4wNzQsODIuNjg2IEMyNC4zMzIsODIuNTM1IDI0Ljc2OCw4Mi40MTggMjUuMDY3LDgyLjQxOCBMMjUuNjMyLDgyLjQxOCBDMjUuODMyLDgyLjQxOCAyNS45NDgsODIuNDc0IDI1Ljk3OCw4Mi41ODQgQzI2LjAwOCw4Mi42OTQgMjUuOTM1LDgyLjgwMSAyNS43NjMsODIuOTAxIEwxNC4yNTgsODkuNjAzIEMxNCw4OS43NTQgMTMuNTY0LDg5Ljg3MSAxMy4yNjYsODkuODcxIEwxMy4yNjYsODkuODcxIFogTTEyLjY2Niw4OS42MjEgTDEyLjcsODkuNjIyIEwxMy4yNjYsODkuNjIyIEMxMy41MTgsODkuNjIyIDEzLjkxNSw4OS41MTUgMTQuMTMyLDg5LjM4OCBMMjUuNjM3LDgyLjY4NiBMMjUuNjY3LDgyLjY2OCBMMjUuNjMyLDgyLjY2NyBMMjUuMDY3LDgyLjY2NyBDMjQuODE1LDgyLjY2NyAyNC40MTgsODIuNzc1IDI0LjIsODIuOTAxIEwxMi42OTUsODkuNjAzIEwxMi42NjYsODkuNjIxIEwxMi42NjYsODkuNjIxIFoiIGlkPSJGaWxsLTkiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTIuMzcsOTAuODAxIEwxMi4zNyw4OS41NTQgTDEyLjM3LDkwLjgwMSIgaWQ9IkZpbGwtMTAiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNNi4xMyw5My45MDEgQzUuMzc5LDkzLjgwOCA0LjgxNiw5My4xNjQgNC42OTEsOTIuNTI1IEMzLjg2LDg4LjI4NyAzLjU0LDgzLjc0MyAzLjUyNiw3MS4xNzMgQzMuNTExLDU4LjM4OSA0LjQyMyw1MS40MjggNC40MjMsNTEuNDI4IEM1LjEzNCw0Ny4yODIgNy4yMSw0Ni4yMzYgNy4yMSw0Ni4yMzYgQzcuMjEsNDYuMjM2IDgxLjY2NywzLjI1IDgyLjA2OSwzLjAxNyBDODIuMjkyLDIuODg4IDg0LjU1NiwxLjQzMyA4NS4yNjQsMy45NCBDODcuMjE0LDEwLjg0IDg2Ljc1MiwzNS44MjcgODUuNTM5LDQzLjgxOCBDODUuMTUsNDYuMzgzIDg0LjI5MSw0OS4wMzMgODIuNDgzLDUwLjEwMSBMNy4yMSw5My42NTMgQzYuODI4LDkzLjg3NCA2LjQ2MSw5My45NDEgNi4xMyw5My45MDEgQzYuMTMsOTMuOTAxIDMuMzQ5LDkzLjQ2IDMuMTI5LDkxLjc3NiBDMi41NjgsODcuNDk1IDEuOTc3LDgyLjk5NSAxLjk2Miw3MC40MjUgQzEuOTQ4LDU3LjY0MSAyLjg2LDUwLjY4IDIuODYsNTAuNjggQzMuNTcsNDYuNTM0IDUuNjQ3LDQ1LjQ4OSA1LjY0Nyw0NS40ODkgQzUuNjQ2LDQ1LjQ4OSA4LjA2NSw0NC4wOTIgMTIuMjQ1LDQxLjY3OSBMMTMuMTE2LDQxLjU2IEwxOS43MTUsMzcuNzMgTDE5Ljc2MSwzNy4yNjkgTDYuMTMsOTMuOTAxIiBpZD0iRmlsbC0xMSIgZmlsbD0iI0ZBRkFGQSI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik02LjMxNyw5NC4xNjEgTDYuMTAyLDk0LjE0OCBMNi4xMDEsOTQuMTQ4IEw1Ljg1Nyw5NC4xMDEgQzUuMTM4LDkzLjk0NSAzLjA4NSw5My4zNjUgMi44ODEsOTEuODA5IEMyLjMxMyw4Ny40NjkgMS43MjcsODIuOTk2IDEuNzEzLDcwLjQyNSBDMS42OTksNTcuNzcxIDIuNjA0LDUwLjcxOCAyLjYxMyw1MC42NDggQzMuMzM4LDQ2LjQxNyA1LjQ0NSw0NS4zMSA1LjUzNSw0NS4yNjYgTDEyLjE2Myw0MS40MzkgTDEzLjAzMyw0MS4zMiBMMTkuNDc5LDM3LjU3OCBMMTkuNTEzLDM3LjI0NCBDMTkuNTI2LDM3LjEwNyAxOS42NDcsMzcuMDA4IDE5Ljc4NiwzNy4wMjEgQzE5LjkyMiwzNy4wMzQgMjAuMDIzLDM3LjE1NiAyMC4wMDksMzcuMjkzIEwxOS45NSwzNy44ODIgTDEzLjE5OCw0MS44MDEgTDEyLjMyOCw0MS45MTkgTDUuNzcyLDQ1LjcwNCBDNS43NDEsNDUuNzIgMy43ODIsNDYuNzcyIDMuMTA2LDUwLjcyMiBDMy4wOTksNTAuNzgyIDIuMTk4LDU3LjgwOCAyLjIxMiw3MC40MjQgQzIuMjI2LDgyLjk2MyAyLjgwOSw4Ny40MiAzLjM3Myw5MS43MjkgQzMuNDY0LDkyLjQyIDQuMDYyLDkyLjg4MyA0LjY4Miw5My4xODEgQzQuNTY2LDkyLjk4NCA0LjQ4Niw5Mi43NzYgNC40NDYsOTIuNTcyIEMzLjY2NSw4OC41ODggMy4yOTEsODQuMzcgMy4yNzYsNzEuMTczIEMzLjI2Miw1OC41MiA0LjE2Nyw1MS40NjYgNC4xNzYsNTEuMzk2IEM0LjkwMSw0Ny4xNjUgNy4wMDgsNDYuMDU5IDcuMDk4LDQ2LjAxNCBDNy4wOTQsNDYuMDE1IDgxLjU0MiwzLjAzNCA4MS45NDQsMi44MDIgTDgxLjk3MiwyLjc4NSBDODIuODc2LDIuMjQ3IDgzLjY5MiwyLjA5NyA4NC4zMzIsMi4zNTIgQzg0Ljg4NywyLjU3MyA4NS4yODEsMy4wODUgODUuNTA0LDMuODcyIEM4Ny41MTgsMTEgODYuOTY0LDM2LjA5MSA4NS43ODUsNDMuODU1IEM4NS4yNzgsNDcuMTk2IDg0LjIxLDQ5LjM3IDgyLjYxLDUwLjMxNyBMNy4zMzUsOTMuODY5IEM2Ljk5OSw5NC4wNjMgNi42NTgsOTQuMTYxIDYuMzE3LDk0LjE2MSBMNi4zMTcsOTQuMTYxIFogTTYuMTcsOTMuNjU0IEM2LjQ2Myw5My42OSA2Ljc3NCw5My42MTcgNy4wODUsOTMuNDM3IEw4Mi4zNTgsNDkuODg2IEM4NC4xODEsNDguODA4IDg0Ljk2LDQ1Ljk3MSA4NS4yOTIsNDMuNzggQzg2LjQ2NiwzNi4wNDkgODcuMDIzLDExLjA4NSA4NS4wMjQsNC4wMDggQzg0Ljg0NiwzLjM3NyA4NC41NTEsMi45NzYgODQuMTQ4LDIuODE2IEM4My42NjQsMi42MjMgODIuOTgyLDIuNzY0IDgyLjIyNywzLjIxMyBMODIuMTkzLDMuMjM0IEM4MS43OTEsMy40NjYgNy4zMzUsNDYuNDUyIDcuMzM1LDQ2LjQ1MiBDNy4zMDQsNDYuNDY5IDUuMzQ2LDQ3LjUyMSA0LjY2OSw1MS40NzEgQzQuNjYyLDUxLjUzIDMuNzYxLDU4LjU1NiAzLjc3NSw3MS4xNzMgQzMuNzksODQuMzI4IDQuMTYxLDg4LjUyNCA0LjkzNiw5Mi40NzYgQzUuMDI2LDkyLjkzNyA1LjQxMiw5My40NTkgNS45NzMsOTMuNjE1IEM2LjA4Nyw5My42NCA2LjE1OCw5My42NTIgNi4xNjksOTMuNjU0IEw2LjE3LDkzLjY1NCBMNi4xNyw5My42NTQgWiIgaWQ9IkZpbGwtMTIiIGZpbGw9IiM0NTVBNjQiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNNy4zMTcsNjguOTgyIEM3LjgwNiw2OC43MDEgOC4yMDIsNjguOTI2IDguMjAyLDY5LjQ4NyBDOC4yMDIsNzAuMDQ3IDcuODA2LDcwLjczIDcuMzE3LDcxLjAxMiBDNi44MjksNzEuMjk0IDYuNDMzLDcxLjA2OSA2LjQzMyw3MC41MDggQzYuNDMzLDY5Ljk0OCA2LjgyOSw2OS4yNjUgNy4zMTcsNjguOTgyIiBpZD0iRmlsbC0xMyIgZmlsbD0iI0ZGRkZGRiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik02LjkyLDcxLjEzMyBDNi42MzEsNzEuMTMzIDYuNDMzLDcwLjkwNSA2LjQzMyw3MC41MDggQzYuNDMzLDY5Ljk0OCA2LjgyOSw2OS4yNjUgNy4zMTcsNjguOTgyIEM3LjQ2LDY4LjkgNy41OTUsNjguODYxIDcuNzE0LDY4Ljg2MSBDOC4wMDMsNjguODYxIDguMjAyLDY5LjA5IDguMjAyLDY5LjQ4NyBDOC4yMDIsNzAuMDQ3IDcuODA2LDcwLjczIDcuMzE3LDcxLjAxMiBDNy4xNzQsNzEuMDk0IDcuMDM5LDcxLjEzMyA2LjkyLDcxLjEzMyBNNy43MTQsNjguNjc0IEM3LjU1Nyw2OC42NzQgNy4zOTIsNjguNzIzIDcuMjI0LDY4LjgyMSBDNi42NzYsNjkuMTM4IDYuMjQ2LDY5Ljg3OSA2LjI0Niw3MC41MDggQzYuMjQ2LDcwLjk5NCA2LjUxNyw3MS4zMiA2LjkyLDcxLjMyIEM3LjA3OCw3MS4zMiA3LjI0Myw3MS4yNzEgNy40MTEsNzEuMTc0IEM3Ljk1OSw3MC44NTcgOC4zODksNzAuMTE3IDguMzg5LDY5LjQ4NyBDOC4zODksNjkuMDAxIDguMTE3LDY4LjY3NCA3LjcxNCw2OC42NzQiIGlkPSJGaWxsLTE0IiBmaWxsPSIjODA5N0EyIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTYuOTIsNzAuOTQ3IEM2LjY0OSw3MC45NDcgNi42MjEsNzAuNjQgNi42MjEsNzAuNTA4IEM2LjYyMSw3MC4wMTcgNi45ODIsNjkuMzkyIDcuNDExLDY5LjE0NSBDNy41MjEsNjkuMDgyIDcuNjI1LDY5LjA0OSA3LjcxNCw2OS4wNDkgQzcuOTg2LDY5LjA0OSA4LjAxNSw2OS4zNTUgOC4wMTUsNjkuNDg3IEM4LjAxNSw2OS45NzggNy42NTIsNzAuNjAzIDcuMjI0LDcwLjg1MSBDNy4xMTUsNzAuOTE0IDcuMDEsNzAuOTQ3IDYuOTIsNzAuOTQ3IE03LjcxNCw2OC44NjEgQzcuNTk1LDY4Ljg2MSA3LjQ2LDY4LjkgNy4zMTcsNjguOTgyIEM2LjgyOSw2OS4yNjUgNi40MzMsNjkuOTQ4IDYuNDMzLDcwLjUwOCBDNi40MzMsNzAuOTA1IDYuNjMxLDcxLjEzMyA2LjkyLDcxLjEzMyBDNy4wMzksNzEuMTMzIDcuMTc0LDcxLjA5NCA3LjMxNyw3MS4wMTIgQzcuODA2LDcwLjczIDguMjAyLDcwLjA0NyA4LjIwMiw2OS40ODcgQzguMjAyLDY5LjA5IDguMDAzLDY4Ljg2MSA3LjcxNCw2OC44NjEiIGlkPSJGaWxsLTE1IiBmaWxsPSIjODA5N0EyIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTcuNDQ0LDg1LjM1IEM3LjcwOCw4NS4xOTggNy45MjEsODUuMzE5IDcuOTIxLDg1LjYyMiBDNy45MjEsODUuOTI1IDcuNzA4LDg2LjI5MiA3LjQ0NCw4Ni40NDQgQzcuMTgxLDg2LjU5NyA2Ljk2Nyw4Ni40NzUgNi45NjcsODYuMTczIEM2Ljk2Nyw4NS44NzEgNy4xODEsODUuNTAyIDcuNDQ0LDg1LjM1IiBpZD0iRmlsbC0xNiIgZmlsbD0iI0ZGRkZGRiI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik03LjIzLDg2LjUxIEM3LjA3NCw4Ni41MSA2Ljk2Nyw4Ni4zODcgNi45NjcsODYuMTczIEM2Ljk2Nyw4NS44NzEgNy4xODEsODUuNTAyIDcuNDQ0LDg1LjM1IEM3LjUyMSw4NS4zMDUgNy41OTQsODUuMjg0IDcuNjU4LDg1LjI4NCBDNy44MTQsODUuMjg0IDcuOTIxLDg1LjQwOCA3LjkyMSw4NS42MjIgQzcuOTIxLDg1LjkyNSA3LjcwOCw4Ni4yOTIgNy40NDQsODYuNDQ0IEM3LjM2Nyw4Ni40ODkgNy4yOTQsODYuNTEgNy4yMyw4Ni41MSBNNy42NTgsODUuMDk4IEM3LjU1OCw4NS4wOTggNy40NTUsODUuMTI3IDcuMzUxLDg1LjE4OCBDNy4wMzEsODUuMzczIDYuNzgxLDg1LjgwNiA2Ljc4MSw4Ni4xNzMgQzYuNzgxLDg2LjQ4MiA2Ljk2Niw4Ni42OTcgNy4yMyw4Ni42OTcgQzcuMzMsODYuNjk3IDcuNDMzLDg2LjY2NiA3LjUzOCw4Ni42MDcgQzcuODU4LDg2LjQyMiA4LjEwOCw4NS45ODkgOC4xMDgsODUuNjIyIEM4LjEwOCw4NS4zMTMgNy45MjMsODUuMDk4IDcuNjU4LDg1LjA5OCIgaWQ9IkZpbGwtMTciIGZpbGw9IiM4MDk3QTIiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNNy4yMyw4Ni4zMjIgTDcuMTU0LDg2LjE3MyBDNy4xNTQsODUuOTM4IDcuMzMzLDg1LjYyOSA3LjUzOCw4NS41MTIgTDcuNjU4LDg1LjQ3MSBMNy43MzQsODUuNjIyIEM3LjczNCw4NS44NTYgNy41NTUsODYuMTY0IDcuMzUxLDg2LjI4MiBMNy4yMyw4Ni4zMjIgTTcuNjU4LDg1LjI4NCBDNy41OTQsODUuMjg0IDcuNTIxLDg1LjMwNSA3LjQ0NCw4NS4zNSBDNy4xODEsODUuNTAyIDYuOTY3LDg1Ljg3MSA2Ljk2Nyw4Ni4xNzMgQzYuOTY3LDg2LjM4NyA3LjA3NCw4Ni41MSA3LjIzLDg2LjUxIEM3LjI5NCw4Ni41MSA3LjM2Nyw4Ni40ODkgNy40NDQsODYuNDQ0IEM3LjcwOCw4Ni4yOTIgNy45MjEsODUuOTI1IDcuOTIxLDg1LjYyMiBDNy45MjEsODUuNDA4IDcuODE0LDg1LjI4NCA3LjY1OCw4NS4yODQiIGlkPSJGaWxsLTE4IiBmaWxsPSIjODA5N0EyIj48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTc3LjI3OCw3Ljc2OSBMNzcuMjc4LDUxLjQzNiBMMTAuMjA4LDkwLjE2IEwxMC4yMDgsNDYuNDkzIEw3Ny4yNzgsNy43NjkiIGlkPSJGaWxsLTE5IiBmaWxsPSIjNDU1QTY0Ij48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTEwLjA4Myw5MC4zNzUgTDEwLjA4Myw0Ni40MjEgTDEwLjE0Niw0Ni4zODUgTDc3LjQwMyw3LjU1NCBMNzcuNDAzLDUxLjUwOCBMNzcuMzQxLDUxLjU0NCBMMTAuMDgzLDkwLjM3NSBMMTAuMDgzLDkwLjM3NSBaIE0xMC4zMzMsNDYuNTY0IEwxMC4zMzMsODkuOTQ0IEw3Ny4xNTQsNTEuMzY1IEw3Ny4xNTQsNy45ODUgTDEwLjMzMyw0Ni41NjQgTDEwLjMzMyw0Ni41NjQgWiIgaWQ9IkZpbGwtMjAiIGZpbGw9IiM2MDdEOEIiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0xMjUuNzM3LDg4LjY0NyBMMTE4LjA5OCw5MS45ODEgTDExOC4wOTgsODQgTDEwNi42MzksODguNzEzIEwxMDYuNjM5LDk2Ljk4MiBMOTksMTAwLjMxNSBMMTEyLjM2OSwxMDMuOTYxIEwxMjUuNzM3LDg4LjY0NyIgaWQ9IkltcG9ydGVkLUxheWVycy1Db3B5LTIiIGZpbGw9IiM0NTVBNjQiIHNrZXRjaDp0eXBlPSJNU1NoYXBlR3JvdXAiPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+");
  },t.exports=r},{"./util.js":23}],18:[function(e,t,i){function r(e){this.kFilter=e,this.currentAccelMeasurement=new n,this.currentGyroMeasurement=new n,this.previousGyroMeasurement=new n,a.isIOS()?this.filterQ=new o.Quaternion(-1,0,0,1):this.filterQ=new o.Quaternion(1,0,0,1),this.previousFilterQ=new o.Quaternion,this.previousFilterQ.copy(this.filterQ),this.accelQ=new o.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new o.Vector3,this.measuredGravity=new o.Vector3,this.gyroIntegralQ=new o.Quaternion}var n=e("./sensor-sample.js"),o=e("../math-util.js"),a=e("../util.js");r.prototype.addAccelMeasurement=function(e,t){this.currentAccelMeasurement.set(e,t)},r.prototype.addGyroMeasurement=function(e,t){this.currentGyroMeasurement.set(e,t);var i=t-this.previousGyroMeasurement.timestampS;a.isTimestampDeltaValid(i)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},r.prototype.run_=function(){if(!this.isOrientationInitialized)return this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),void(this.isOrientationInitialized=!0);var e=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,t=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,e);this.gyroIntegralQ.multiply(t),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(t);var i=new o.Quaternion;i.copy(this.filterQ),i.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(i),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var r=new o.Quaternion;r.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),r.inverse(),a.isDebug()&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",o.radToDeg*a.getQuaternionAngle(r),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var n=new o.Quaternion;n.copy(this.filterQ),n.multiply(r),this.filterQ.slerp(n,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},r.prototype.getOrientation=function(){return this.filterQ},r.prototype.accelToQuaternion_=function(e){var t=new o.Vector3;t.copy(e),t.normalize();var i=new o.Quaternion;return i.setFromUnitVectors(new o.Vector3(0,0,-1),t),i.inverse(),i},r.prototype.gyroToQuaternionDelta_=function(e,t){var i=new o.Quaternion,r=new o.Vector3;return r.copy(e),r.normalize(),i.setFromAxisAngle(r,e.length()*t),i},t.exports=r},{"../math-util.js":15,"../util.js":23,"./sensor-sample.js":21}],19:[function(e,t,i){function r(){this.deviceId="webvr-polyfill:fused",this.deviceName="VR Position Device (webvr-polyfill:fused)",this.accelerometer=new s.Vector3,this.gyroscope=new s.Vector3,this.start(),this.filter=new n(WebVRConfig.K_FILTER),this.posePredictor=new o(WebVRConfig.PREDICTION_TIME_S),this.touchPanner=new a,this.filterToWorldQ=new s.Quaternion,c.isIOS()?this.filterToWorldQ.setFromAxisAngle(new s.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new s.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new s.Quaternion,this.worldToScreenQ=new s.Quaternion,this.originalPoseAdjustQ=new s.Quaternion,this.originalPoseAdjustQ.setFromAxisAngle(new s.Vector3(0,0,1),-window.orientation*Math.PI/180),this.setScreenTransform_(),c.isLandscapeMode()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new s.Quaternion,this.isFirefoxAndroid=c.isFirefoxAndroid(),this.isIOS=c.isIOS(),this.orientationOut_=new Float32Array(4)}var n=e("./complementary-filter.js"),o=e("./pose-predictor.js"),a=e("../touch-panner.js"),s=e("../math-util.js"),c=e("../util.js");r.prototype.getPosition=function(){return null},r.prototype.getOrientation=function(){var e=this.filter.getOrientation();this.predictedQ=this.posePredictor.getPrediction(e,this.gyroscope,this.previousTimestampS);var t=new s.Quaternion;return t.copy(this.filterToWorldQ),t.multiply(this.resetQ),WebVRConfig.TOUCH_PANNER_DISABLED||t.multiply(this.touchPanner.getOrientation()),t.multiply(this.predictedQ),t.multiply(this.worldToScreenQ),WebVRConfig.YAW_ONLY&&(t.x=0,t.z=0,t.normalize()),this.orientationOut_[0]=t.x,this.orientationOut_[1]=t.y,this.orientationOut_[2]=t.z,this.orientationOut_[3]=t.w,this.orientationOut_},r.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),c.isLandscapeMode()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ),WebVRConfig.TOUCH_PANNER_DISABLED||this.touchPanner.resetSensor()},r.prototype.onDeviceMotion_=function(e){this.updateDeviceMotion_(e)},r.prototype.updateDeviceMotion_=function(e){var t=e.accelerationIncludingGravity,i=e.rotationRate,r=e.timeStamp/1e3;this.isFirefoxAndroid&&(r/=1e3);var n=r-this.previousTimestampS;return n<=c.MIN_TIMESTEP||n>c.MAX_TIMESTEP?(console.warn("Invalid timestamps detected. Time step between successive gyroscope sensor samples is very small or not monotonic"),void(this.previousTimestampS=r)):(this.accelerometer.set(-t.x,-t.y,-t.z),this.gyroscope.set(i.alpha,i.beta,i.gamma),(this.isIOS||this.isFirefoxAndroid)&&this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addAccelMeasurement(this.accelerometer,r),this.filter.addGyroMeasurement(this.gyroscope,r),void(this.previousTimestampS=r))},r.prototype.onOrientationChange_=function(e){this.setScreenTransform_()},r.prototype.onMessage_=function(e){var t=e.data;if(t&&t.type){var i=t.type.toLowerCase();"devicemotion"===i&&this.updateDeviceMotion_(t.deviceMotionEvent)}},r.prototype.setScreenTransform_=function(){switch(this.worldToScreenQ.set(0,0,0,1),window.orientation){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new s.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new s.Vector3(0,0,1),Math.PI/2);break;case 180:}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},r.prototype.start=function(){this.onDeviceMotionCallback_=this.onDeviceMotion_.bind(this),this.onOrientationChangeCallback_=this.onOrientationChange_.bind(this),this.onMessageCallback_=this.onMessage_.bind(this),c.isIOS()&&c.isInsideCrossDomainIFrame()&&window.addEventListener("message",this.onMessageCallback_),window.addEventListener("orientationchange",this.onOrientationChangeCallback_),window.addEventListener("devicemotion",this.onDeviceMotionCallback_)},r.prototype.stop=function(){window.removeEventListener("devicemotion",this.onDeviceMotionCallback_),window.removeEventListener("orientationchange",this.onOrientationChangeCallback_),window.removeEventListener("message",this.onMessageCallback_)},t.exports=r},{"../math-util.js":15,"../touch-panner.js":22,"../util.js":23,"./complementary-filter.js":18,"./pose-predictor.js":20}],20:[function(e,t,i){function r(e){this.predictionTimeS=e,this.previousQ=new n.Quaternion,this.previousTimestampS=null,this.deltaQ=new n.Quaternion,this.outQ=new n.Quaternion}var n=e("../math-util"),o=e("../util");r.prototype.getPrediction=function(e,t,i){if(!this.previousTimestampS)return this.previousQ.copy(e),this.previousTimestampS=i,e;var r=new n.Vector3;r.copy(t),r.normalize();var a=t.length();if(a<20*n.degToRad)return o.isDebug()&&console.log("Moving slowly, at %s deg/s: no prediction",(n.radToDeg*a).toFixed(1)),this.outQ.copy(e),this.previousQ.copy(e),this.outQ;var s=(i-this.previousTimestampS,a*this.predictionTimeS);return this.deltaQ.setFromAxisAngle(r,s),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(e),this.previousTimestampS=i,this.outQ},t.exports=r},{"../math-util":15,"../util":23}],21:[function(e,t,i){function r(e,t){this.set(e,t)}r.prototype.set=function(e,t){this.sample=e,this.timestampS=t},r.prototype.copy=function(e){this.set(e.sample,e.timestampS)},t.exports=r},{}],22:[function(e,t,i){function r(){window.addEventListener("touchstart",this.onTouchStart_.bind(this)),window.addEventListener("touchmove",this.onTouchMove_.bind(this)),window.addEventListener("touchend",this.onTouchEnd_.bind(this)),this.isTouching=!1,this.rotateStart=new n.Vector2,this.rotateEnd=new n.Vector2,this.rotateDelta=new n.Vector2,this.theta=0,this.orientation=new n.Quaternion}var n=e("./math-util.js"),o=e("./util.js"),a=.5;r.prototype.getOrientation=function(){return this.orientation.setFromEulerXYZ(0,0,this.theta),this.orientation},r.prototype.resetSensor=function(){this.theta=0},r.prototype.onTouchStart_=function(e){1==e.touches.length&&(this.rotateStart.set(e.touches[0].pageX,e.touches[0].pageY),this.isTouching=!0)},r.prototype.onTouchMove_=function(e){if(this.isTouching){this.rotateEnd.set(e.touches[0].pageX,e.touches[0].pageY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart),this.rotateStart.copy(this.rotateEnd),o.isIOS()&&(this.rotateDelta.x*=-1);var t=document.body;this.theta+=2*Math.PI*this.rotateDelta.x/t.clientWidth*a}},r.prototype.onTouchEnd_=function(e){this.isTouching=!1},t.exports=r},{"./math-util.js":15,"./util.js":23}],23:[function(e,t,i){var r=e("object-assign"),n=window.Util||{};n.MIN_TIMESTEP=.001,n.MAX_TIMESTEP=1,n.base64=function(e,t){return"data:"+e+";base64,"+t},n.clamp=function(e,t,i){return Math.min(Math.max(t,e),i)},n.lerp=function(e,t,i){return e+(t-e)*i},n.isIOS=function(){var e=/iPad|iPhone|iPod/.test(navigator.platform);return function(){return e}}(),n.isWebViewAndroid=function(){var e=navigator.userAgent.indexOf("Version")!==-1&&navigator.userAgent.indexOf("Android")!==-1&&navigator.userAgent.indexOf("Chrome")!==-1;return function(){return e}}(),n.isSafari=function(){var e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return e}}(),n.isFirefoxAndroid=function(){var e=navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return e}}(),n.isLandscapeMode=function(){return 90==window.orientation||window.orientation==-90},n.isTimestampDeltaValid=function(e){return!isNaN(e)&&(!(e<=n.MIN_TIMESTEP)&&!(e>n.MAX_TIMESTEP))},n.getScreenWidth=function(){return Math.max(window.screen.width,window.screen.height)*window.devicePixelRatio},n.getScreenHeight=function(){return Math.min(window.screen.width,window.screen.height)*window.devicePixelRatio},n.requestFullscreen=function(e){if(n.isWebViewAndroid())return!1;if(e.requestFullscreen)e.requestFullscreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen();else if(e.mozRequestFullScreen)e.mozRequestFullScreen();else{if(!e.msRequestFullscreen)return!1;e.msRequestFullscreen()}return!0},n.exitFullscreen=function(){if(document.exitFullscreen)document.exitFullscreen();else if(document.webkitExitFullscreen)document.webkitExitFullscreen();else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else{if(!document.msExitFullscreen)return!1;document.msExitFullscreen()}return!0},n.getFullscreenElement=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},n.linkProgram=function(e,t,i,r){var n=e.createShader(e.VERTEX_SHADER);e.shaderSource(n,t),e.compileShader(n);var o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,i),e.compileShader(o);var a=e.createProgram();e.attachShader(a,n),e.attachShader(a,o);for(var s in r)e.bindAttribLocation(a,r[s],s);return e.linkProgram(a),e.deleteShader(n),e.deleteShader(o),a},n.getProgramUniforms=function(e,t){for(var i={},r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n="",o=0;o<r;o++){var a=e.getActiveUniform(t,o);n=a.name.replace("[0]",""),i[n]=e.getUniformLocation(t,n)}return i},n.orthoMatrix=function(e,t,i,r,n,o,a){var s=1/(t-i),c=1/(r-n),u=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+i)*s,e[13]=(n+r)*c,e[14]=(a+o)*u,e[15]=1,e},n.isMobile=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e},n.extend=r,n.safariCssSizeWorkaround=function(e){if(n.isIOS()){var t=e.style.width,i=e.style.height;e.style.width=parseInt(t)+1+"px",e.style.height=parseInt(i)+"px",setTimeout(function(){e.style.width=t,e.style.height=i},100)}window.Util=n,window.canvas=e},n.isDebug=function(){return n.getQueryParameter("debug")},n.getQueryParameter=function(e){var e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),t=new RegExp("[\\?&]"+e+"=([^&#]*)"),i=t.exec(location.search);return null===i?"":decodeURIComponent(i[1].replace(/\+/g," "))},n.frameDataFromPose=function(){function e(e,t,i,r){var n=Math.tan(t?t.upDegrees*o:a),s=Math.tan(t?t.downDegrees*o:a),c=Math.tan(t?t.leftDegrees*o:a),u=Math.tan(t?t.rightDegrees*o:a),l=2/(c+u),h=2/(n+s);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=h,e[6]=0,e[7]=0,e[8]=-((c-u)*l*.5),e[9]=(n-s)*h*.5,e[10]=r/(i-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*i/(i-r),e[15]=0,e}function t(e,t,i){var r=t[0],n=t[1],o=t[2],a=t[3],s=r+r,c=n+n,u=o+o,l=r*s,h=r*c,d=r*u,p=n*c,f=n*u,m=o*u,g=a*s,v=a*c,y=a*u;return e[0]=1-(p+m),e[1]=h+y,e[2]=d-v,e[3]=0,e[4]=h-y,e[5]=1-(l+m),e[6]=f+g,e[7]=0,e[8]=d+v,e[9]=f-g,e[10]=1-(l+p),e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function i(e,t,i){var r,n,o,a,s,c,u,l,h,d,p,f,m=i[0],g=i[1],v=i[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*v+t[12],e[13]=t[1]*m+t[5]*g+t[9]*v+t[13],e[14]=t[2]*m+t[6]*g+t[10]*v+t[14],e[15]=t[3]*m+t[7]*g+t[11]*v+t[15]):(r=t[0],n=t[1],o=t[2],a=t[3],s=t[4],c=t[5],u=t[6],l=t[7],h=t[8],d=t[9],p=t[10],f=t[11],e[0]=r,e[1]=n,e[2]=o,e[3]=a,e[4]=s,e[5]=c,e[6]=u,e[7]=l,e[8]=h,e[9]=d,e[10]=p,e[11]=f,e[12]=r*m+s*g+h*v+t[12],e[13]=n*m+c*g+d*v+t[13],e[14]=o*m+u*g+p*v+t[14],e[15]=a*m+l*g+f*v+t[15]),e}function r(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],a=t[4],s=t[5],c=t[6],u=t[7],l=t[8],h=t[9],d=t[10],p=t[11],f=t[12],m=t[13],g=t[14],v=t[15],y=i*s-r*a,M=i*c-n*a,A=i*u-o*a,w=r*c-n*s,x=r*u-o*s,E=n*u-o*c,b=l*m-h*f,T=l*g-d*f,L=l*v-p*f,N=h*g-d*m,D=h*v-p*m,S=d*v-p*g,I=y*S-M*D+A*N+w*L-x*T+E*b;return I?(I=1/I,e[0]=(s*S-c*D+u*N)*I,e[1]=(n*D-r*S-o*N)*I,e[2]=(m*E-g*x+v*w)*I,e[3]=(d*x-h*E-p*w)*I,e[4]=(c*L-a*S-u*T)*I,e[5]=(i*S-n*L+o*T)*I,e[6]=(g*A-f*E-v*M)*I,e[7]=(l*E-d*A+p*M)*I,e[8]=(a*D-s*L+u*b)*I,e[9]=(r*L-i*D-o*b)*I,e[10]=(f*x-m*A+v*y)*I,e[11]=(h*A-l*x-p*y)*I,e[12]=(s*T-a*N-c*b)*I,e[13]=(i*N-r*T+n*b)*I,e[14]=(m*M-f*w-g*y)*I,e[15]=(l*w-h*M+d*y)*I,e):null}function n(n,o,a,u,l){e(n,u?u.fieldOfView:null,l.depthNear,l.depthFar);var h=a.orientation||s,d=a.position||c;t(o,h,d),u&&i(o,o,u.offset),r(o,o)}var o=Math.PI/180,a=.25*Math.PI,s=new Float32Array([0,0,0,1]),c=new Float32Array([0,0,0]);return function(e,t,i){return!(!e||!t)&&(e.pose=t,e.timestamp=t.timestamp,n(e.leftProjectionMatrix,e.leftViewMatrix,t,i.getEyeParameters("left"),i),n(e.rightProjectionMatrix,e.rightViewMatrix,t,i.getEyeParameters("right"),i),!0)}}(),n.isInsideCrossDomainIFrame=function(){var e=window.self!==window.top,t=n.getDomainFromUrl(document.referrer),i=n.getDomainFromUrl(window.location.href);return e&&t!==i},n.getDomainFromUrl=function(e){var t;return t=e.indexOf("://")>-1?e.split("/")[2]:e.split("/")[0],t=t.split(":")[0]},t.exports=n},{"object-assign":2}],24:[function(e,t,i){function r(){try{this.selectedKey=localStorage.getItem(s)||a}catch(e){console.error("Failed to load viewer profile: %s",e)}this.dialog=this.createDialog_(n.Viewers),this.root=null}var n=e("./device-info.js"),o=e("eventemitter3"),a=(e("./util.js"),"CardboardV1"),s="WEBVR_CARDBOARD_VIEWER",c="webvr-polyfill-viewer-selector";r.prototype=new o,r.prototype.show=function(e){this.root=e,e.appendChild(this.dialog);var t=this.dialog.querySelector("#"+this.selectedKey);t.checked=!0,this.dialog.style.display="block"},r.prototype.hide=function(){this.root&&this.root.contains(this.dialog)&&this.root.removeChild(this.dialog),this.dialog.style.display="none"},r.prototype.getCurrentViewer=function(){return n.Viewers[this.selectedKey]},r.prototype.getSelectedKey_=function(){var e=this.dialog.querySelector("input[name=field]:checked");return e?e.id:null},r.prototype.onSave_=function(){if(this.selectedKey=this.getSelectedKey_(),!this.selectedKey||!n.Viewers[this.selectedKey])return void console.error("ViewerSelector.onSave_: this should never happen!");this.emit("change",n.Viewers[this.selectedKey]);try{localStorage.setItem(s,this.selectedKey)}catch(e){console.error("Failed to save viewer profile: %s",e)}this.hide()},r.prototype.createDialog_=function(e){var t=document.createElement("div");t.classList.add(c),t.style.display="none";var i=document.createElement("div"),r=i.style;r.position="fixed",r.left=0,r.top=0,r.width="100%",r.height="100%",r.background="rgba(0, 0, 0, 0.3)",i.addEventListener("click",this.hide.bind(this));var n=280,o=document.createElement("div"),r=o.style;r.boxSizing="border-box",r.position="fixed",r.top="24px",r.left="50%",r.marginLeft=-n/2+"px",r.width=n+"px",r.padding="24px",r.overflow="hidden",r.background="#fafafa",r.fontFamily="'Roboto', sans-serif",r.boxShadow="0px 5px 20px #666",o.appendChild(this.createH1_("Select your viewer"));for(var a in e)o.appendChild(this.createChoice_(a,e[a].label));return o.appendChild(this.createButton_("Save",this.onSave_.bind(this))),t.appendChild(i),t.appendChild(o),t},r.prototype.createH1_=function(e){var t=document.createElement("h1"),i=t.style;return i.color="black",i.fontSize="20px",i.fontWeight="bold",i.marginTop=0,i.marginBottom="24px",t.innerHTML=e,t},r.prototype.createChoice_=function(e,t){var i=document.createElement("div");i.style.marginTop="8px",i.style.color="black";var r=document.createElement("input");r.style.fontSize="30px",r.setAttribute("id",e),r.setAttribute("type","radio"),r.setAttribute("value",e),r.setAttribute("name","field");var n=document.createElement("label");return n.style.marginLeft="4px",n.setAttribute("for",e),n.innerHTML=t,i.appendChild(r),i.appendChild(n),i},r.prototype.createButton_=function(e,t){var i=document.createElement("button");i.innerHTML=e;var r=i.style;return r.float="right",r.textTransform="uppercase",r.color="#1094f7",r.fontSize="14px",r.letterSpacing=0,r.border=0,r.background="none",r.marginTop="16px",i.addEventListener("click",t),i},t.exports=r},{"./device-info.js":8,"./util.js":23,eventemitter3:1}],25:[function(e,t,i){function r(){var e=document.createElement("video");e.addEventListener("ended",function(){e.play()}),this.request=function(){e.paused&&(e.src=a.base64("video/mp4","AAAAGGZ0eXBpc29tAAAAAG1wNDFhdmMxAAAIA21vb3YAAABsbXZoZAAAAADSa9v60mvb+gABX5AAlw/gAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAdkdHJhawAAAFx0a2hkAAAAAdJr2/rSa9v6AAAAAQAAAAAAlw/gAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAQAAAAHAAAAAAAJGVkdHMAAAAcZWxzdAAAAAAAAAABAJcP4AAAAAAAAQAAAAAG3G1kaWEAAAAgbWRoZAAAAADSa9v60mvb+gAPQkAGjneAFccAAAAAAC1oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAAVmlkZW9IYW5kbGVyAAAABodtaW5mAAAAFHZtaGQAAAABAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAZHc3RibAAAAJdzdHNkAAAAAAAAAAEAAACHYXZjMQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAMABwASAAAAEgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAADFhdmNDAWQAC//hABlnZAALrNlfllw4QAAAAwBAAAADAKPFCmWAAQAFaOvssiwAAAAYc3R0cwAAAAAAAAABAAAAbgAPQkAAAAAUc3RzcwAAAAAAAAABAAAAAQAAA4BjdHRzAAAAAAAAAG4AAAABAD0JAAAAAAEAehIAAAAAAQA9CQAAAAABAAAAAAAAAAEAD0JAAAAAAQBMS0AAAAABAB6EgAAAAAEAAAAAAAAAAQAPQkAAAAABAExLQAAAAAEAHoSAAAAAAQAAAAAAAAABAA9CQAAAAAEATEtAAAAAAQAehIAAAAABAAAAAAAAAAEAD0JAAAAAAQBMS0AAAAABAB6EgAAAAAEAAAAAAAAAAQAPQkAAAAABAExLQAAAAAEAHoSAAAAAAQAAAAAAAAABAA9CQAAAAAEATEtAAAAAAQAehIAAAAABAAAAAAAAAAEAD0JAAAAAAQBMS0AAAAABAB6EgAAAAAEAAAAAAAAAAQAPQkAAAAABAExLQAAAAAEAHoSAAAAAAQAAAAAAAAABAA9CQAAAAAEATEtAAAAAAQAehIAAAAABAAAAAAAAAAEAD0JAAAAAAQBMS0AAAAABAB6EgAAAAAEAAAAAAAAAAQAPQkAAAAABAExLQAAAAAEAHoSAAAAAAQAAAAAAAAABAA9CQAAAAAEATEtAAAAAAQAehIAAAAABAAAAAAAAAAEAD0JAAAAAAQBMS0AAAAABAB6EgAAAAAEAAAAAAAAAAQAPQkAAAAABAExLQAAAAAEAHoSAAAAAAQAAAAAAAAABAA9CQAAAAAEATEtAAAAAAQAehIAAAAABAAAAAAAAAAEAD0JAAAAAAQBMS0AAAAABAB6EgAAAAAEAAAAAAAAAAQAPQkAAAAABAExLQAAAAAEAHoSAAAAAAQAAAAAAAAABAA9CQAAAAAEATEtAAAAAAQAehIAAAAABAAAAAAAAAAEAD0JAAAAAAQBMS0AAAAABAB6EgAAAAAEAAAAAAAAAAQAPQkAAAAABAExLQAAAAAEAHoSAAAAAAQAAAAAAAAABAA9CQAAAAAEATEtAAAAAAQAehIAAAAABAAAAAAAAAAEAD0JAAAAAAQBMS0AAAAABAB6EgAAAAAEAAAAAAAAAAQAPQkAAAAABAExLQAAAAAEAHoSAAAAAAQAAAAAAAAABAA9CQAAAAAEATEtAAAAAAQAehIAAAAABAAAAAAAAAAEAD0JAAAAAAQBMS0AAAAABAB6EgAAAAAEAAAAAAAAAAQAPQkAAAAABAExLQAAAAAEAHoSAAAAAAQAAAAAAAAABAA9CQAAAAAEALcbAAAAAHHN0c2MAAAAAAAAAAQAAAAEAAABuAAAAAQAAAcxzdHN6AAAAAAAAAAAAAABuAAADCQAAABgAAAAOAAAADgAAAAwAAAASAAAADgAAAAwAAAAMAAAAEgAAAA4AAAAMAAAADAAAABIAAAAOAAAADAAAAAwAAAASAAAADgAAAAwAAAAMAAAAEgAAAA4AAAAMAAAADAAAABIAAAAOAAAADAAAAAwAAAASAAAADgAAAAwAAAAMAAAAEgAAAA4AAAAMAAAADAAAABIAAAAOAAAADAAAAAwAAAASAAAADgAAAAwAAAAMAAAAEgAAAA4AAAAMAAAADAAAABIAAAAOAAAADAAAAAwAAAASAAAADgAAAAwAAAAMAAAAEgAAAA4AAAAMAAAADAAAABIAAAAOAAAADAAAAAwAAAASAAAADgAAAAwAAAAMAAAAEgAAAA4AAAAMAAAADAAAABIAAAAOAAAADAAAAAwAAAASAAAADgAAAAwAAAAMAAAAEgAAAA4AAAAMAAAADAAAABIAAAAOAAAADAAAAAwAAAASAAAADgAAAAwAAAAMAAAAEgAAAA4AAAAMAAAADAAAABIAAAAOAAAADAAAAAwAAAASAAAADgAAAAwAAAAMAAAAEgAAAA4AAAAMAAAADAAAABMAAAAUc3RjbwAAAAAAAAABAAAIKwAAACt1ZHRhAAAAI6llbmMAFwAAdmxjIDIuMi4xIHN0cmVhbSBvdXRwdXQAAAAId2lkZQAACRRtZGF0AAACrgX//6vcRem95tlIt5Ys2CDZI+7veDI2NCAtIGNvcmUgMTQyIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTMgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MzoweDEzIG1lPWhleCBzdWJtZT03IHBzeT0xIHBzeV9yZD0xLjAwOjAuMDAgbWl4ZWRfcmVmPTEgbWVfcmFuZ2U9MTYgY2hyb21hX21lPTEgdHJlbGxpcz0xIDh4OGRjdD0xIGNxbT0wIGRlYWR6b25lPTIxLDExIGZhc3RfcHNraXA9MSBjaHJvbWFfcXBfb2Zmc2V0PS0yIHRocmVhZHM9MTIgbG9va2FoZWFkX3RocmVhZHM9MSBzbGljZWRfdGhyZWFkcz0wIG5yPTAgZGVjaW1hdGU9MSBpbnRlcmxhY2VkPTAgYmx1cmF5X2NvbXBhdD0wIGNvbnN0cmFpbmVkX2ludHJhPTAgYmZyYW1lcz0zIGJfcHlyYW1pZD0yIGJfYWRhcHQ9MSBiX2JpYXM9MCBkaXJlY3Q9MSB3ZWlnaHRiPTEgb3Blbl9nb3A9MCB3ZWlnaHRwPTIga2V5aW50PTI1MCBrZXlpbnRfbWluPTEgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD00MCByYz1hYnIgbWJ0cmVlPTEgYml0cmF0ZT0xMDAgcmF0ZXRvbD0xLjAgcWNvbXA9MC42MCBxcG1pbj0xMCBxcG1heD01MSBxcHN0ZXA9NCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAU2WIhAAQ/8ltlOe+cTZuGkKg+aRtuivcDZ0pBsfsEi9p/i1yU9DxS2lq4dXTinViF1URBKXgnzKBd/Uh1bkhHtMrwrRcOJslD01UB+fyaL6ef+DBAAAAFEGaJGxBD5B+v+a+4QqF3MgBXz9MAAAACkGeQniH/+94r6EAAAAKAZ5hdEN/8QytwAAAAAgBnmNqQ3/EgQAAAA5BmmhJqEFomUwIIf/+4QAAAApBnoZFESw//76BAAAACAGepXRDf8SBAAAACAGep2pDf8SAAAAADkGarEmoQWyZTAgh//7gAAAACkGeykUVLD//voEAAAAIAZ7pdEN/xIAAAAAIAZ7rakN/xIAAAAAOQZrwSahBbJlMCCH//uEAAAAKQZ8ORRUsP/++gQAAAAgBny10Q3/EgQAAAAgBny9qQ3/EgAAAAA5BmzRJqEFsmUwIIf/+4AAAAApBn1JFFSw//76BAAAACAGfcXRDf8SAAAAACAGfc2pDf8SAAAAADkGbeEmoQWyZTAgh//7hAAAACkGflkUVLD//voAAAAAIAZ+1dEN/xIEAAAAIAZ+3akN/xIEAAAAOQZu8SahBbJlMCCH//uAAAAAKQZ/aRRUsP/++gQAAAAgBn/l0Q3/EgAAAAAgBn/tqQ3/EgQAAAA5Bm+BJqEFsmUwIIf/+4QAAAApBnh5FFSw//76AAAAACAGePXRDf8SAAAAACAGeP2pDf8SBAAAADkGaJEmoQWyZTAgh//7gAAAACkGeQkUVLD//voEAAAAIAZ5hdEN/xIAAAAAIAZ5jakN/xIEAAAAOQZpoSahBbJlMCCH//uEAAAAKQZ6GRRUsP/++gQAAAAgBnqV0Q3/EgQAAAAgBnqdqQ3/EgAAAAA5BmqxJqEFsmUwIIf/+4AAAAApBnspFFSw//76BAAAACAGe6XRDf8SAAAAACAGe62pDf8SAAAAADkGa8EmoQWyZTAgh//7hAAAACkGfDkUVLD//voEAAAAIAZ8tdEN/xIEAAAAIAZ8vakN/xIAAAAAOQZs0SahBbJlMCCH//uAAAAAKQZ9SRRUsP/++gQAAAAgBn3F0Q3/EgAAAAAgBn3NqQ3/EgAAAAA5Bm3hJqEFsmUwIIf/+4QAAAApBn5ZFFSw//76AAAAACAGftXRDf8SBAAAACAGft2pDf8SBAAAADkGbvEmoQWyZTAgh//7gAAAACkGf2kUVLD//voEAAAAIAZ/5dEN/xIAAAAAIAZ/7akN/xIEAAAAOQZvgSahBbJlMCCH//uEAAAAKQZ4eRRUsP/++gAAAAAgBnj10Q3/EgAAAAAgBnj9qQ3/EgQAAAA5BmiRJqEFsmUwIIf/+4AAAAApBnkJFFSw//76BAAAACAGeYXRDf8SAAAAACAGeY2pDf8SBAAAADkGaaEmoQWyZTAgh//7hAAAACkGehkUVLD//voEAAAAIAZ6ldEN/xIEAAAAIAZ6nakN/xIAAAAAOQZqsSahBbJlMCCH//uAAAAAKQZ7KRRUsP/++gQAAAAgBnul0Q3/EgAAAAAgBnutqQ3/EgAAAAA5BmvBJqEFsmUwIIf/+4QAAAApBnw5FFSw//76BAAAACAGfLXRDf8SBAAAACAGfL2pDf8SAAAAADkGbNEmoQWyZTAgh//7gAAAACkGfUkUVLD//voEAAAAIAZ9xdEN/xIAAAAAIAZ9zakN/xIAAAAAOQZt4SahBbJlMCCH//uEAAAAKQZ+WRRUsP/++gAAAAAgBn7V0Q3/EgQAAAAgBn7dqQ3/EgQAAAA5Bm7xJqEFsmUwIIf/+4AAAAApBn9pFFSw//76BAAAACAGf+XRDf8SAAAAACAGf+2pDf8SBAAAADkGb4EmoQWyZTAgh//7hAAAACkGeHkUVLD//voAAAAAIAZ49dEN/xIAAAAAIAZ4/akN/xIEAAAAOQZokSahBbJlMCCH//uAAAAAKQZ5CRRUsP/++gQAAAAgBnmF0Q3/EgAAAAAgBnmNqQ3/EgQAAAA5BmmhJqEFsmUwIIf/+4QAAAApBnoZFFSw//76BAAAACAGepXRDf8SBAAAACAGep2pDf8SAAAAADkGarEmoQWyZTAgh//7gAAAACkGeykUVLD//voEAAAAIAZ7pdEN/xIAAAAAIAZ7rakN/xIAAAAAPQZruSahBbJlMFEw3//7B"),e.play())},this.release=function(){e.pause(),e.src=""}}function n(){var e=null;this.request=function(){e||(e=setInterval(function(){window.location=window.location,setTimeout(window.stop,0)},3e4))},this.release=function(){e&&(clearInterval(e),e=null)}}function o(){var e=navigator.userAgent||navigator.vendor||window.opera;return e.match(/iPhone/i)||e.match(/iPod/i)?n:r}var a=e("./util.js");t.exports=o()},{"./util.js":23}],26:[function(e,t,i){function r(){this.displays=[],this.devices=[],this.devicesPopulated=!1,this.nativeWebVRAvailable=this.isWebVRAvailable(),this.nativeLegacyWebVRAvailable=this.isDeprecatedWebVRAvailable(),this.nativeGetVRDisplaysFunc=this.nativeWebVRAvailable?navigator.getVRDisplays:null,this.nativeLegacyWebVRAvailable||(this.enablePolyfill(),WebVRConfig.ENABLE_DEPRECATED_API&&this.enableDeprecatedPolyfill()),n()}function n(){"VRDisplay"in window&&!("VRFrameData"in window)&&(window.VRFrameData=u,"depthNear"in window.VRDisplay.prototype||(window.VRDisplay.prototype.depthNear=.01),"depthFar"in window.VRDisplay.prototype||(window.VRDisplay.prototype.depthFar=1e4),window.VRDisplay.prototype.getFrameData=function(e){return o.frameDataFromPose(e,this.getPose(),this)})}var o=e("./util.js"),a=e("./cardboard-vr-display.js"),s=e("./mouse-keyboard-vr-display.js"),c=e("./base.js").VRDisplay,u=e("./base.js").VRFrameData,l=e("./base.js").HMDVRDevice,h=e("./base.js").PositionSensorVRDevice,d=e("./display-wrappers.js").VRDisplayHMDDevice,p=e("./display-wrappers.js").VRDisplayPositionSensorDevice;r.prototype.isWebVRAvailable=function(){return"getVRDisplays"in navigator},r.prototype.isDeprecatedWebVRAvailable=function(){return"getVRDevices"in navigator||"mozGetVRDevices"in navigator},r.prototype.populateDevices=function(){if(!this.devicesPopulated){var e=null;this.isCardboardCompatible()&&(e=new a,this.displays.push(e),WebVRConfig.ENABLE_DEPRECATED_API&&(this.devices.push(new d(e)),this.devices.push(new p(e)))),this.isMobile()||WebVRConfig.MOUSE_KEYBOARD_CONTROLS_DISABLED||(e=new s,this.displays.push(e),WebVRConfig.ENABLE_DEPRECATED_API&&(this.devices.push(new d(e)),this.devices.push(new p(e)))),this.devicesPopulated=!0}},r.prototype.enablePolyfill=function(){navigator.getVRDisplays=this.getVRDisplays.bind(this),window.VRDisplay=c;var e=this;Object.defineProperty(navigator,"vrEnabled",{get:function(){return e.isCardboardCompatible()&&(e.isFullScreenAvailable()||o.isIOS())}}),!1 in window&&(window.VRFrameData=u)},r.prototype.enableDeprecatedPolyfill=function(){navigator.getVRDevices=this.getVRDevices.bind(this),window.HMDVRDevice=l,window.PositionSensorVRDevice=h},r.prototype.getVRDisplays=function(){this.populateDevices();var e=this.displays;return this.nativeWebVRAvailable?this.nativeGetVRDisplaysFunc.call(navigator).then(function(t){return WebVRConfig.ALWAYS_APPEND_POLYFILL_DISPLAY?t.concat(e):t.length>0?t:e}):new Promise(function(t,i){try{t(e)}catch(e){i(e)}})},r.prototype.getVRDevices=function(){console.warn("getVRDevices is deprecated. Please update your code to use getVRDisplays instead.");var e=this;return new Promise(function(t,i){try{if(!e.devicesPopulated){if(e.nativeWebVRAvailable)return navigator.getVRDisplays(function(i){for(var r=0;r<i.length;++r)e.devices.push(new d(i[r])),e.devices.push(new p(i[r]));e.devicesPopulated=!0,t(e.devices)},i);if(e.nativeLegacyWebVRAvailable)return(navigator.getVRDDevices||navigator.mozGetVRDevices)(function(i){for(var r=0;r<i.length;++r)i[r]instanceof l&&e.devices.push(i[r]),i[r]instanceof h&&e.devices.push(i[r]);e.devicesPopulated=!0,t(e.devices)},i)}e.populateDevices(),t(e.devices)}catch(e){i(e)}})},r.prototype.isMobile=function(){return/Android/i.test(navigator.userAgent)||/iPhone|iPad|iPod/i.test(navigator.userAgent)},r.prototype.isCardboardCompatible=function(){return this.isMobile()||WebVRConfig.FORCE_ENABLE_VR},r.prototype.isFullScreenAvailable=function(){return document.fullscreenEnabled||document.mozFullScreenEnabled||document.webkitFullscreenEnabled||!1},t.exports.WebVRPolyfill=r},{"./base.js":3,"./cardboard-vr-display.js":6,"./display-wrappers.js":9,"./mouse-keyboard-vr-display.js":16,"./util.js":23}]},{},[14])(14)})}).call(this,"undefined"!=typeof i?i:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],51:[function(e,t,i){function r(e,t,i,r){var n=e.indexOf(t,i);return n===-1||n>r?r:n}function n(e){return l.test(e)}function o(e,t,i,r,n){for(var o=[],a=i,s=i;s<r&&s<t.length;s++){var u=t.charAt(s),l=c.test(u);if(l||s===r-1){var h=l?s:s+1,d=e(t,a,h,n);o.push(d),a=s+1}}return o}function a(e,t,i,o,a,s){var c=[],l=a;for("nowrap"===s&&(l=Number.MAX_VALUE);i<o&&i<t.length;){for(var h=r(t,u,i,o);i<h&&n(t.charAt(i));)i++;var d=e(t,i,h,l),p=i+(d.end-d.start),f=p+u.length;if(p<h){for(;p>i&&!n(t.charAt(p));)p--;if(p===i)f>i+u.length&&f--,p=f;else for(f=p;p>i&&n(t.charAt(p-u.length));)p--}if(p>=i){var m=e(t,i,p,l);c.push(m)}i=f}return c}function s(e,t,i,r){var n=Math.min(r,i-t);return{start:t,end:t+n}}var c=/\n/,u="\n",l=/\s/;t.exports=function(e,i){var r=t.exports.lines(e,i);return r.map(function(t){return e.substring(t.start,t.end)}).join("\n")},t.exports.lines=function(e,t){if(t=t||{},0===t.width&&"nowrap"!==t.mode)return[];e=e||"";var i="number"==typeof t.width?t.width:Number.MAX_VALUE,r=Math.max(0,t.start||0),n="number"==typeof t.end?t.end:e.length,c=t.mode,u=t.measure||s;return"pre"===c?o(u,e,r,n,i):a(u,e,r,n,i,c)}},{}],52:[function(e,t,i){"use strict";function r(e,t){for(var i=0;i<e.length;i++)t(e[i])}function n(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function o(e,t,i){var r=e;return h(t)?(i=t,"string"==typeof e&&(r={uri:e})):r=p(t,{uri:e}),r.callback=i,r}function a(e,t,i){return t=o(e,t,i),s(t)}function s(e){function t(){4===l.readyState&&o()}function i(){var e=void 0;
  if(e=l.response?l.response:l.responseText||c(l),A)try{e=JSON.parse(e)}catch(e){}return e}function r(e){return clearTimeout(f),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,u(e,w)}function o(){if(!p){var t;clearTimeout(f),t=e.useXDR&&void 0===l.status?200:1223===l.status?204:l.status;var r=w,n=null;return 0!==t?(r={body:i(),statusCode:t,method:g,headers:{},url:m,rawRequest:l},l.getAllResponseHeaders&&(r.headers=d(l.getAllResponseHeaders()))):n=new Error("Internal XMLHttpRequest Error"),u(n,r,r.body)}}if("undefined"==typeof e.callback)throw new Error("callback argument missing");var s=!1,u=function(t,i,r){s||(s=!0,e.callback(t,i,r))},l=e.xhr||null;l||(l=e.cors||e.useXDR?new a.XDomainRequest:new a.XMLHttpRequest);var h,p,f,m=l.url=e.uri||e.url,g=l.method=e.method||"GET",v=e.body||e.data,y=l.headers=e.headers||{},M=!!e.sync,A=!1,w={body:void 0,headers:{},statusCode:0,method:g,url:m,rawRequest:l};if("json"in e&&e.json!==!1&&(A=!0,y.accept||y.Accept||(y.Accept="application/json"),"GET"!==g&&"HEAD"!==g&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),v=JSON.stringify(e.json===!0?v:e.json))),l.onreadystatechange=t,l.onload=o,l.onerror=r,l.onprogress=function(){},l.onabort=function(){p=!0},l.ontimeout=r,l.open(g,m,!M,e.username,e.password),M||(l.withCredentials=!!e.withCredentials),!M&&e.timeout>0&&(f=setTimeout(function(){if(!p){p=!0,l.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",r(e)}},e.timeout)),l.setRequestHeader)for(h in y)y.hasOwnProperty(h)&&l.setRequestHeader(h,y[h]);else if(e.headers&&!n(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(l.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(l),l.send(v||null),l}function c(e){if("document"===e.responseType)return e.responseXML;var t=204===e.status&&e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;return""!==e.responseType||t?null:e.responseXML}function u(){}var l=e("global/window"),h=e("is-function"),d=e("parse-headers"),p=e("xtend");t.exports=a,a.XMLHttpRequest=l.XMLHttpRequest||u,a.XDomainRequest="withCredentials"in new a.XMLHttpRequest?a.XMLHttpRequest:l.XDomainRequest,r(["get","put","post","patch","head","delete"],function(e){a["delete"===e?"del":e]=function(t,i,r){return i=o(t,i,r),i.method=e.toUpperCase(),s(i)}})},{"global/window":20,"is-function":24,"parse-headers":33,xtend:54}],53:[function(e,t,i){t.exports=function(){return"undefined"!=typeof window.DOMParser?function(e){var t=new window.DOMParser;return t.parseFromString(e,"application/xml")}:"undefined"!=typeof window.ActiveXObject&&new window.ActiveXObject("Microsoft.XMLDOM")?function(e){var t=new window.ActiveXObject("Microsoft.XMLDOM");return t.async="false",t.loadXML(e),t}:function(e){var t=document.createElement("div");return t.innerHTML=e,t}}()},{}],54:[function(e,t,i){function r(){for(var e={},t=0;t<arguments.length;t++){var i=arguments[t];for(var r in i)n.call(i,r)&&(e[r]=i[r])}return e}t.exports=r;var n=Object.prototype.hasOwnProperty},{}],55:[function(e,t,i){t.exports={name:"aframe",version:"0.5.0",description:"A web framework for building virtual reality experiences.",homepage:"https://aframe.io/",main:"dist/aframe-master.js",scripts:{browserify:"browserify src/index.js -s 'AFRAME' -p browserify-derequire",build:"mkdirp build/ && npm run browserify -- --debug -t [envify --INSPECTOR_VERSION dev] -o build/aframe.js",codecov:"codecov",dev:"npm run build && cross-env INSPECTOR_VERSION=dev node ./scripts/budo -t envify",dist:"node scripts/updateVersionLog.js && npm run dist:min && npm run dist:max","dist:max":"npm run browserify -s -- --debug | exorcist dist/aframe-master.js.map > dist/aframe-master.js","dist:min":"npm run browserify -s -- --debug -p [minifyify --map aframe-master.min.js.map --output dist/aframe-master.min.js.map] -o dist/aframe-master.min.js",docs:"markserv --dir docs --port 9001",ghpages:"ghpages -p gh-pages/",lint:"semistandard -v | snazzy",precommit:"npm run lint",preghpages:"npm run dist && rimraf gh-pages && mkdirp gh-pages && cp -r {.nojekyll,dist,lib,examples,index.html,style} gh-pages/. 2>/dev/null || : && git checkout dist/ && replace 'build/aframe-master.js' 'dist/aframe-master.min.js' gh-pages/ -r --silent",prerelease:"npm run dist && node scripts/release.js 0.4.0 0.5.0",start:"npm run dev",test:"karma start ./tests/karma.conf.js","test:docs":"node scripts/docsLint.js","test:firefox":"karma start ./tests/karma.conf.js --browsers Firefox","test:chrome":"karma start ./tests/karma.conf.js --browsers Chrome"},repository:"aframevr/aframe",license:"MIT",dependencies:{"browserify-css":"^0.8.2",debug:"^2.2.0","deep-assign":"^2.0.0","document-register-element":"dmarcos/document-register-element#8ccc532b7",envify:"^3.4.1","load-bmfont":"^1.2.3","object-assign":"^4.0.1",present:"0.0.6","promise-polyfill":"^3.1.0","style-attr":"^1.0.2",three:"^0.83.0","three-bmfont-text":"^2.1.0","tween.js":"^15.0.0","webvr-polyfill":"dmarcos/webvr-polyfill#a02a8089b"},devDependencies:{browserify:"^13.1.0","browserify-derequire":"^0.9.4","browserify-istanbul":"^2.0.0",budo:"^9.2.0",chai:"^3.5.0","chai-shallow-deep-equal":"^1.4.0",chalk:"^1.1.3",codecov:"^1.0.1","cross-env":"^3.1.3",exorcist:"^0.4.0",ghpages:"0.0.8","git-rev":"^0.2.1",glob:"^7.1.1",husky:"^0.11.7",istanbul:"^0.4.5",karma:"^1.3.0","karma-browserify":"^5.1.0","karma-chai-shallow-deep-equal":"0.0.4","karma-chrome-launcher":"^2.0.0","karma-coverage":"^1.1.1","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.0.0","karma-mocha":"^1.1.1","karma-mocha-reporter":"^2.1.0","karma-sinon-chai":"^1.2.4",lolex:"^1.5.1",markserv:"0.0.20",minifyify:"^7.3.3",mkdirp:"^0.5.1",mocha:"^3.0.2","mozilla-download":"^1.1.1",open:"0.0.5",replace:"^0.3.0",rimraf:"^2.5.4",semistandard:"^9.0.0",sinon:"^1.17.5","sinon-chai":"^2.8.0",snazzy:"^5.0.0","too-wordy":"ngokevin/too-wordy",uglifyjs:"^2.4.10","write-good":"^0.9.1"},link:!0,browserify:{transform:["browserify-css","envify"]},semistandard:{ignore:["build/**","dist/**","examples/**/shaders/*.js","**/vendor/**"]},keywords:["3d","aframe","cardboard","components","oculus","three","three.js","rift","vive","vr","web-components","webvr"],"browserify-css":{minify:!0},engines:{node:">= 4.6.0",npm:"^2.15.9"}}},{}],56:[function(e,t,i){var r=e("../core/component").registerComponent,n=e("../lib/three");t.exports.Component=r("blend-character-model",{schema:{type:"asset"},init:function(){this.model=null},update:function(){var e=this,t=this.el,i=this.data;i&&(this.remove(),this.model=new n.BlendCharacter,this.model.load(i,function(){t.setObject3D("mesh",e.model),t.emit("model-loaded",{format:"blend",model:e.model}),e.model.castShadow=!0,e.model.receiveShadow=!0,e.model.material.shading=n.FlatShading,e.model.geometry.computeBoundingBox()}))},remove:function(){this.model&&this.el.removeObject3D("mesh")}})},{"../core/component":100,"../lib/three":146}],57:[function(e,t,i){var r=e("../core/component").registerComponent,n=e("../lib/three"),o=e("../utils/"),a=o.bind,s=o.device.checkHasPositionalTracking;t.exports.Component=r("camera",{schema:{active:{default:!0},far:{default:1e4},fov:{default:80,min:0},near:{default:.005,min:0},userHeight:{default:0,min:0},zoom:{default:1,min:0}},init:function(){var e,t=this.el,i=t.sceneEl;this.savedPose=null,e=this.camera=new n.PerspectiveCamera,t.setObject3D("camera",e),this.onEnterVR=a(this.onEnterVR,this),this.onExitVR=a(this.onExitVR,this),i.addEventListener("enter-vr",this.onEnterVR),i.addEventListener("exit-vr",this.onExitVR)},update:function(e){var t=this.el,i=this.data,r=this.camera,n=this.system;this.addHeightOffset(e.userHeight),r.aspect=i.aspect||window.innerWidth/window.innerHeight,r.far=i.far,r.fov=i.fov,r.near=i.near,r.zoom=i.zoom,r.updateProjectionMatrix(),e&&e.active===i.active||(i.active&&n.activeCameraEl!==t?n.setActiveCamera(t):i.active||n.activeCameraEl!==t||n.disableActiveCamera())},remove:function(){var e=this.el.sceneEl;this.el.removeObject3D("camera"),e.removeEventListener("enter-vr",this.onEnterVR),e.removeEventListener("exit-vr",this.onExitVR)},onEnterVR:function(){this.saveCameraPose(),this.removeHeightOffset()},onExitVR:function(){this.restoreCameraPose()},addHeightOffset:function(e){var t,i=this.el,r=this.data.userHeight;e=e||0,t=i.getAttribute("position")||{x:0,y:0,z:0},i.setAttribute("position",{x:t.x,y:t.y-e+r,z:t.z})},removeHeightOffset:function(){var e,t,i=this.el,r=this.data.userHeight;t=this.hasPositionalTracking||s(),r&&t&&(e=i.getAttribute("position")||{x:0,y:0,z:0},i.setAttribute("position",{x:e.x,y:e.y-r,z:e.z}))},saveCameraPose:function(){var e=this.el,t=this.hasPositionalTracking||s();!this.savedPose&&t&&(this.savedPose={position:e.getAttribute("position"),rotation:e.getAttribute("rotation")})},restoreCameraPose:function(){var e=this.el,t=this.savedPose,i=this.hasPositionalTracking||s();t&&i&&(e.setAttribute("position",t.position),e.setAttribute("rotation",t.rotation),this.savedPose=null)}})},{"../core/component":100,"../lib/three":146,"../utils/":167}],58:[function(e,t,i){var r=e("../core/component").registerComponent,n=e("../lib/three");t.exports.Component=r("collada-model",{schema:{type:"asset"},init:function(){this.model=null,this.loader=new n.ColladaLoader,this.loader.options.convertUpAxis=!0},update:function(){var e=this,t=this.el,i=this.data;i&&(this.remove(),this.loader.load(i,function(i){e.model=i.scene,t.setObject3D("mesh",e.model),t.emit("model-loaded",{format:"collada",model:e.model})}))},remove:function(){this.model&&this.el.removeObject3D("mesh")}})},{"../core/component":100,"../lib/three":146}],59:[function(e,t,i){var r=e("../core/component").registerComponent,n=e("../utils/"),o=n.bind,a={CLICK:"click",FUSING:"fusing",MOUSEENTER:"mouseenter",MOUSEDOWN:"mousedown",MOUSELEAVE:"mouseleave",MOUSEUP:"mouseup"},s={FUSING:"cursor-fusing",HOVERING:"cursor-hovering",HOVERED:"cursor-hovered"};t.exports.Component=r("cursor",{dependencies:["raycaster"],schema:{fuse:{default:n.device.isMobile()},fuseTimeout:{default:1500,min:0}},init:function(){var e=this.el,t=e.sceneEl.canvas;return this.fuseTimeout=void 0,this.mouseDownEl=null,this.intersection=null,this.intersectedEl=null,t?(t.addEventListener("mousedown",o(this.onMouseDown,this)),t.addEventListener("mouseup",o(this.onMouseUp,this)),e.addEventListener("raycaster-intersection",o(this.onIntersection,this)),void e.addEventListener("raycaster-intersection-cleared",o(this.onIntersectionCleared,this))):void e.sceneEl.addEventListener("render-target-loaded",o(this.init,this))},onMouseDown:function(e){this.twoWayEmit(a.MOUSEDOWN),this.mouseDownEl=this.intersectedEl},onMouseUp:function(e){this.twoWayEmit(a.MOUSEUP),!this.data.fuse&&this.intersectedEl&&this.mouseDownEl===this.intersectedEl&&this.twoWayEmit(a.CLICK)},onIntersection:function(e){var t,i,r,n=this,o=this.el,c=this.data;if(t=e.detail.els[0]===o?1:0,r=e.detail.intersections[t],i=e.detail.els[t]){if(this.intersectedEl===i)return void(this.intersection=r);this.intersectedEl&&this.clearCurrentIntersection(),this.intersection=r,this.intersectedEl=i,o.addState(s.HOVERING),i.addState(s.HOVERED),n.twoWayEmit(a.MOUSEENTER),0!==c.fuseTimeout&&c.fuse&&(o.addState(s.FUSING),this.twoWayEmit(a.FUSING),this.fuseTimeout=setTimeout(function(){o.removeState(s.FUSING),n.twoWayEmit(a.CLICK)},c.fuseTimeout))}},onIntersectionCleared:function(e){var t=this.el,i=e.detail.el;t!==i&&i===this.intersectedEl&&this.clearCurrentIntersection()},clearCurrentIntersection:function(){var e=this.el;this.intersectedEl.removeState(s.HOVERED),e.removeState(s.HOVERING),e.removeState(s.FUSING),this.twoWayEmit(a.MOUSELEAVE),this.intersection=null,this.intersectedEl=null,clearTimeout(this.fuseTimeout)},twoWayEmit:function(e){var t=this.el,i=this.intersectedEl,r=this.intersection;t.emit(e,{intersectedEl:i,intersection:r}),i&&i.emit(e,{cursorEl:t,intersection:r})}})},{"../core/component":100,"../utils/":167}],60:[function(e,t,i){var r=e("../utils/debug"),n=e("../core/geometry").geometries,o=e("../core/geometry").geometryNames,a=e("../core/component").registerComponent,s=e("../lib/three"),c=new s.Geometry,u=r("components:geometry:warn");t.exports.Component=a("geometry",{schema:{buffer:{default:!0},mergeTo:{type:"selector"},primitive:{default:"box",oneOf:o},skipCache:{default:!1}},init:function(){this.geometry=null},update:function(e){var t=this.data,i=this.el.getOrCreateObject3D("mesh",s.Mesh),r=this.system;this.geometry&&(r.unuseGeometry(e),this.geometry=null),this.geometry=i.geometry=r.getOrCreateGeometry(t),t.mergeTo&&this.mergeTo(t.mergeTo)},mergeTo:function(e){var t,i=this.el,r=i.getObject3D("mesh");return e&&e.isEntity?e===i?void u("Source and target geometries cannot be the same for merge"):(t=e.getObject3D("mesh"))?t.geometry instanceof s.Geometry==!1||r.geometry instanceof s.Geometry==!1?void u("Geometry merge is only available for `THREE.Geometry` types. Check that both of the merging geometry and the target geometry have `buffer` set to false"):this.data.skipCache===!1?void u("Cached geometries are not allowed to merge. Set `skipCache` to true"):(r.parent.updateMatrixWorld(),t.geometry.merge(r.geometry,r.matrixWorld),i.emit("geometry-merged",{mergeTarget:e}),void i.parentNode.removeChild(i)):(t=e.getOrCreateObject3D("mesh",s.Mesh),void e.setAttribute("material",i.getAttribute("material"))):void u("There is not a valid entity to merge the geometry to")},remove:function(){this.system.unuseGeometry(this.data),this.el.getObject3D("mesh").geometry=c,this.geometry=null},updateSchema:function(e){var t=e.primitive,i=this.data&&this.data.primitive,r=n[t]&&n[t].schema;if(!r)throw new Error("Unknown geometry schema `"+t+"`");i&&i===t||this.extendSchema(r)}})},{"../core/component":100,"../core/geometry":101,"../lib/three":146,"../utils/debug":163}],61:[function(e,t,i){var r=e("../core/component").registerComponent,n=e("../lib/three");t.exports.Component=r("gltf-model",{schema:{type:"model"},init:function(){this.model=null,this.loader=new n.GLTFLoader},update:function(){var e=this,t=this.el,i=this.data;i&&(this.remove(),this.loader.load(i,function(i){e.model=i.scene,e.system.registerModel(e.model),t.setObject3D("mesh",e.model),t.emit("model-loaded",{format:"gltf",model:e.model})}))},remove:function(){this.model&&(this.el.removeObject3D("mesh"),this.system.unregisterModel(this.model))}})},{"../core/component":100,"../lib/three":146}],62:[function(e,t,i){var r=e("../core/component").registerComponent,n="https://cdn.aframe.io/controllers/oculus-hands/v2/leftHand.json",o="https://cdn.aframe.io/controllers/oculus-hands/v2/rightHand.json";t.exports.Component=r("hand-controls",{schema:{default:"left"},init:function(){var e=this;this.touchedButtons={},this.pressedButtons={},this.onGripDown=function(){e.handleButton("grip","down")},this.onGripUp=function(){e.handleButton("grip","up")},this.onTrackpadDown=function(){e.handleButton("trackpad","down")},this.onTrackpadUp=function(){e.handleButton("trackpad","up")},this.onTrackpadTouchStart=function(){e.handleButton("trackpad","touchstart")},this.onTrackpadTouchEnd=function(){e.handleButton("trackpad","touchend")},this.onTriggerDown=function(){e.handleButton("trigger","down")},this.onTriggerUp=function(){e.handleButton("trigger","up")},this.onTriggerTouchStart=function(){e.handleButton("trigger","touchstart")},this.onTriggerTouchEnd=function(){e.handleButton("trigger","touchend")},this.onGripTouchStart=function(){e.handleButton("grip","touchstart")},this.onGripTouchEnd=function(){e.handleButton("grip","touchend")},this.onThumbstickDown=function(){e.handleButton("thumbstick","down")},this.onThumbstickUp=function(){e.handleButton("thumbstick","up")},this.onAorXTouchStart=function(){e.handleButton("AorX","touchstart")},this.onAorXTouchEnd=function(){e.handleButton("AorX","touchend")},this.onBorYTouchStart=function(){e.handleButton("BorY","touchstart")},this.onBorYTouchEnd=function(){e.handleButton("BorY","touchend")},this.onSurfaceTouchStart=function(){e.handleButton("surface","touchstart")},this.onSurfaceTouchEnd=function(){e.handleButton("surface","touchend")}},play:function(){this.addEventListeners()},pause:function(){this.removeEventListeners()},addEventListeners:function(){var e=this.el;e.addEventListener("gripdown",this.onGripDown),e.addEventListener("gripup",this.onGripUp),e.addEventListener("trackpaddown",this.onTrackpadDown),e.addEventListener("trackpadup",this.onTrackpadUp),e.addEventListener("trackpadtouchstart",this.onTrackpadTouchStart),e.addEventListener("trackpadtouchend",this.onTrackpadTouchEnd),e.addEventListener("triggerdown",this.onTriggerDown),e.addEventListener("triggerup",this.onTriggerUp),e.addEventListener("triggertouchstart",this.onTriggerTouchStart),e.addEventListener("triggertouchend",this.onTriggerTouchEnd),e.addEventListener("griptouchstart",this.onGripTouchStart),e.addEventListener("griptouchend",this.onGripTouchEnd),e.addEventListener("thumbstickdown",this.onThumbstickDown),e.addEventListener("thumbstickup",this.onThumbstickUp),e.addEventListener("Atouchstart",this.onAorXTouchStart),e.addEventListener("Atouchend",this.onAorXTouchEnd),e.addEventListener("Btouchstart",this.onBorYTouchStart),e.addEventListener("Btouchend",this.onBorYTouchEnd),e.addEventListener("Xtouchstart",this.onAorXTouchStart),e.addEventListener("Xtouchend",this.onAorXTouchEnd),e.addEventListener("Ytouchstart",this.onBorYTouchStart),e.addEventListener("Ytouchend",this.onBorYTouchEnd),e.addEventListener("surfacetouchstart",this.onSurfaceTouchStart),e.addEventListener("surfacetouchend",this.onSurfaceTouchEnd)},removeEventListeners:function(){var e=this.el;e.removeEventListener("gripdown",this.onGripDown),e.removeEventListener("gripup",this.onGripUp),e.removeEventListener("trackpaddown",this.onTrackpadDown),e.removeEventListener("trackpadup",this.onTrackpadUp),e.removeEventListener("trackpadtouchstart",this.onTrackpadTouchStart),e.removeEventListener("trackpadtouchend",this.onTrackpadTouchEnd),e.removeEventListener("triggerdown",this.onTriggerDown),e.removeEventListener("triggerup",this.onTriggerUp),e.removeEventListener("triggertouchstart",this.onTriggerTouchStart),e.removeEventListener("triggertouchend",this.onTriggerTouchEnd),e.removeEventListener("griptouchstart",this.onGripTouchStart),e.removeEventListener("griptouchend",this.onGripTouchEnd),e.removeEventListener("thumbstickdown",this.onThumbstickDown),e.removeEventListener("thumbstickup",this.onThumbstickUp),e.removeEventListener("Atouchstart",this.onAorXTouchStart),e.removeEventListener("Atouchend",this.onAorXTouchEnd),e.removeEventListener("Btouchstart",this.onBorYTouchStart),e.removeEventListener("Btouchend",this.onBorYTouchEnd),e.removeEventListener("Xtouchstart",this.onAorXTouchStart),e.removeEventListener("Xtouchend",this.onAorXTouchEnd),e.removeEventListener("Ytouchstart",this.onBorYTouchStart),e.removeEventListener("Ytouchend",this.onBorYTouchEnd),e.removeEventListener("surfacetouchstart",this.onSurfaceTouchStart),e.removeEventListener("surfacetouchend",this.onSurfaceTouchEnd)},update:function(){var e,t=this.el,i=this.data,r={hand:i,model:!1,rotationOffset:"left"===i?90:-90};e="left"===i?"url("+n+")":"url("+o+")",t.setAttribute("vive-controls",r),t.setAttribute("oculus-touch-controls",r),t.setAttribute("blend-character-model",e)},handleButton:function(e,t){var i,r="down"===t,n="touchstart"===t;if(0===t.indexOf("touch")){if(n===this.touchedButtons[e])return;this.touchedButtons[e]=n}else{if(r===this.pressedButtons[e])return;this.pressedButtons[e]=r}i=this.gesture,this.gesture=this.determineGesture(),this.gesture!==i&&(this.animateGesture(this.gesture),this.emitGestureEvents(this.gesture,i))},isOculusTouchController:function(){var e=this.el.components["tracked-controls"],t=e&&e.controller&&e.controller.id;return t&&0===t.indexOf("Oculus Touch")},determineGesture:function(){var e,t=this.pressedButtons.grip,i=this.pressedButtons.surface||this.touchedButtons.surface,r=this.pressedButtons.trackpad||this.touchedButtons.trackpad,n=this.pressedButtons.trigger||this.touchedButtons.trigger,o=this.touchedButtons.AorX||this.touchedButtons.BorY,a=this.isOculusTouchController();return t?e=a?i||o||r?n?"fist":"pointing":n?"thumb":"pistol":"fist":n?e=a?"touch":"fist":!a&&r&&(e="pointing"),e},gestureAnimationMapping:{default:"Open",pointing:"Point",pistol:"Point + Thumb",fist:"Fist",touch:"Hold",thumb:"Thumb Up"},animateGesture:function(e){var t=this.isOculusTouchController();if(!e&&!t)return void this.playAnimation("Open",!0);var i=this.gestureAnimationMapping[e||"default"];this.playAnimation(i||"Open",!i&&t)},gestureEventMapping:{fist:"grip",touch:"point",thumb:"thumb",pointing:"pointing",pistol:"pistol"},gestureEventName:function(e,t){if(!e)return 0;var i=this.gestureEventMapping[e];return"grip"===i?i+(t?"close":"open"):"point"===i||"thumb"===i?i+(t?"up":"down"):"pointing"===i||"pistol"===i?i+(t?"start":"end"):0},emitGestureEvents:function(e,t){var i,r=this.el;t!==e&&(i=this.gestureEventName(t,!1),i&&r.emit(i),i=this.gestureEventName(e,!0),i&&r.emit(i))},playAnimation:function(e,t){var i,r=this.animationActive,n=1,o=this.el.getObject3D("mesh");o&&(t&&(n=-1),r&&o.play(r,0),i=o.mixer.clipAction(e),i.loop=2200,i.clampWhenFinished=!0,i.timeScale=n,o.play(e,1),this.animationActive=e)}})},{"../core/component":100}],63:[function(e,t,i){e("./blend-character-model"),e("./camera"),e("./collada-model"),e("./cursor"),e("./geometry"),e("./gltf-model"),e("./hand-controls"),e("./light"),e("./look-controls"),e("./material"),e("./obj-model"),e("./oculus-touch-controls"),e("./position"),e("./raycaster"),e("./rotation"),e("./scale"),e("./sound"),e("./text"),e("./tracked-controls"),e("./visible"),e("./vive-controls"),e("./wasd-controls"),e("./scene/auto-enter-vr"),e("./scene/canvas"),e("./scene/debug"),e("./scene/embedded"),e("./scene/inspector"),e("./scene/fog"),e("./scene/keyboard-shortcuts"),e("./scene/pool"),e("./scene/screenshot"),e("./scene/stats"),e("./scene/vr-mode-ui")},{"./blend-character-model":56,"./camera":57,"./collada-model":58,"./cursor":59,"./geometry":60,"./gltf-model":61,"./hand-controls":62,"./light":64,"./look-controls":65,"./material":66,"./obj-model":67,"./oculus-touch-controls":68,"./position":69,"./raycaster":70,"./rotation":71,"./scale":72,"./scene/auto-enter-vr":73,"./scene/canvas":74,"./scene/debug":75,"./scene/embedded":76,"./scene/fog":77,"./scene/inspector":78,"./scene/keyboard-shortcuts":79,"./scene/pool":80,"./scene/screenshot":81,"./scene/stats":82,"./scene/vr-mode-ui":83,"./sound":84,"./text":85,"./tracked-controls":86,"./visible":87,"./vive-controls":88,"./wasd-controls":89}],64:[function(e,t,i){var r=e("../utils/bind"),n=e("../utils").diff,o=e("../utils/debug"),a=e("../core/component").registerComponent,s=e("../lib/three"),c=s.Math.degToRad,u=o("components:light:warn");t.exports.Component=a("light",{schema:{angle:{default:60,if:{type:["spot"]}},color:{type:"color"},groundColor:{type:"color",if:{type:["hemisphere"]}},decay:{default:1,if:{type:["point","spot"]}},distance:{default:0,min:0,if:{type:["point","spot"]}},intensity:{default:1,min:0,if:{type:["ambient","directional","hemisphere","point","spot"]}},penumbra:{default:0,min:0,max:1,if:{type:["spot"]}},type:{default:"directional",oneOf:["ambient","directional","hemisphere","point","spot"]},target:{type:"selector",if:{type:["spot","directional"]}}},init:function(){var e=this.el;this.light=null,this.defaultTarget=null,this.system.registerLight(e)},update:function(e){var t=this.data,i=n(t,e),o=this.light,a=this;return!o||"type"in i?void this.setLight(this.data):void Object.keys(i).forEach(function(e){var i=t[e];switch(e){case"color":o.color.set(i);break;case"groundColor":o.groundColor.set(i);break;case"angle":o.angle=c(i);break;case"target":null===i?"spot"!==t.type&&"directional"!==t.type||(o.target=a.defaultTarget):i.hasLoaded?a.onSetTarget(i):i.addEventListener("loaded",r(a.onSetTarget,a,i));break;default:o[e]=i}})},setLight:function(e){var t=this.el,i=this.getLight(e);i&&(this.light&&t.removeObject3D("light"),this.light=i,this.light.el=t,t.setObject3D("light",this.light),"spot"!==e.type&&"directional"!==e.type&&"hemisphere"!==e.type||t.getObject3D("light").translateY(-1),"spot"===e.type&&(t.setObject3D("light-target",this.defaultTarget),t.getObject3D("light-target").position.set(0,0,-1)))},getLight:function(e){var t=e.angle,i=new s.Color(e.color).getHex(),n=e.decay,o=e.distance,a=new s.Color(e.groundColor).getHex(),l=e.intensity,h=e.type,d=e.target,p=null;switch(h.toLowerCase()){case"ambient":return new s.AmbientLight(i,l);case"directional":return p=new s.DirectionalLight(i,l),this.defaultTarget=p.target,d&&(d.hasLoaded?this.onSetTarget(d):d.addEventListener("loaded",r(this.onSetTarget,this,d))),p;case"hemisphere":return new s.HemisphereLight(i,a,l);case"point":return new s.PointLight(i,l,o,n);case"spot":return p=new s.SpotLight(i,l,o,c(t),e.penumbra,n),this.defaultTarget=p.target,d&&(d.hasLoaded?this.onSetTarget(d):d.addEventListener("loaded",r(this.onSetTarget,this,d))),p;default:u("%s is not a valid light type. Choose from ambient, directional, hemisphere, point, spot.",h)}},onSetTarget:function(e){this.light.target=e.object3D},remove:function(){this.el.removeObject3D("light")}})},{"../core/component":100,"../lib/three":146,"../utils":167,"../utils/bind":161,"../utils/debug":163}],65:[function(e,t,i){function r(e){return 0===e.x&&0===e.y&&0===e.z}var n=e("../core/component").registerComponent,o=e("../lib/three"),a=e("../utils/").device.isMobile(),s=e("../utils/bind"),c=Math.PI/2,u=o.Math.radToDeg;t.exports.Component=n("look-controls",{dependencies:["position","rotation"],schema:{enabled:{default:!0},hmdEnabled:{default:!0},reverseMouseDrag:{default:!1},standing:{default:!0}},init:function(){function e(){t.canvas.classList.add("a-grab-cursor")}var t=this.el.sceneEl;this.previousHMDPosition=new o.Vector3,this.hmdQuaternion=new o.Quaternion,this.hmdEuler=new o.Euler,this.setupMouseControls(),this.setupHMDControls(),this.bindMethods(),t.canvas?e():t.addEventListener("render-target-loaded",e)},update:function(e){var t=this.data,i=t.hmdEnabled;t.enabled&&(!i&&e&&i!==e.hmdEnabled&&(this.pitchObject.rotation.set(0,0,0),this.yawObject.rotation.set(0,0,0)),this.controls.standing=t.standing,this.controls.update(),this.updateOrientation(),this.updatePosition())},play:function(){this.addEventListeners()},pause:function(){this.removeEventListeners()},tick:function(e){this.update()},remove:function(){this.pause()},bindMethods:function(){this.onMouseDown=s(this.onMouseDown,this),this.onMouseMove=s(this.onMouseMove,this),this.releaseMouse=s(this.releaseMouse,this),this.onTouchStart=s(this.onTouchStart,this),this.onTouchMove=s(this.onTouchMove,this),this.onTouchEnd=s(this.onTouchEnd,this)},setupMouseControls:function(){this.mouseDown=!1,this.pitchObject=new o.Object3D,this.yawObject=new o.Object3D,this.yawObject.position.y=10,this.yawObject.add(this.pitchObject)},setupHMDControls:function(){this.dolly=new o.Object3D,this.euler=new o.Euler,this.controls=new o.VRControls(this.dolly),this.controls.userHeight=0},addEventListeners:function(){var e=this.el.sceneEl,t=e.canvas;return t?(t.addEventListener("mousedown",this.onMouseDown,!1),window.addEventListener("mousemove",this.onMouseMove,!1),window.addEventListener("mouseup",this.releaseMouse,!1),t.addEventListener("touchstart",this.onTouchStart),window.addEventListener("touchmove",this.onTouchMove),void window.addEventListener("touchend",this.onTouchEnd)):void e.addEventListener("render-target-loaded",s(this.addEventListeners,this))},removeEventListeners:function(){var e=this.el.sceneEl,t=e&&e.canvas;t&&(t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mouseup",this.releaseMouse),t.removeEventListener("mouseout",this.releaseMouse),t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("touchmove",this.onTouchMove),t.removeEventListener("touchend",this.onTouchEnd))},updateOrientation:function(){var e,t,i,n=this.hmdEuler,o=this.pitchObject,s=this.yawObject,c=this.calculateHMDQuaternion(),l=this.el.sceneEl;n.setFromQuaternion(c,"YXZ"),a?i={x:u(n.x)+u(o.rotation.x),y:u(n.y)+u(s.rotation.y),z:u(n.z)}:l.is("vr-mode")&&!r(n)&&this.data.hmdEnabled?i={x:u(n.x),y:u(n.y),z:u(n.z)}:(e=this.el.getAttribute("rotation"),t=this.calculateDeltaRotation(),i=this.data.reverseMouseDrag?{x:e.x-t.x,y:e.y-t.y,z:e.z}:{x:e.x+t.x,y:e.y+t.y,z:e.z}),this.el.setAttribute("rotation",i)},calculateDeltaRotation:function(){var e,t=u(this.pitchObject.rotation.x),i=u(this.yawObject.rotation.y);return this.previousRotationX=this.previousRotationX||t,this.previousRotationY=this.previousRotationY||i,e={x:t-this.previousRotationX,y:i-this.previousRotationY},this.previousRotationX=t,this.previousRotationY=i,e},calculateHMDQuaternion:function(){var e=this.hmdQuaternion;return e.copy(this.dolly.quaternion),e},updatePosition:function(){var e=new o.Vector3;return function(){var t,i=this.el,n=i.getAttribute("position"),o=this.previousHMDPosition,a=this.el.sceneEl;t=this.calculateHMDPosition(),e.copy(t).sub(o),a.is("vr-mode")&&!r(e)&&(o.copy(t),a.is("vr-mode")&&i.setAttribute("position",{x:n.x+e.x,y:n.y+e.y,z:n.z+e.z}))}}(),calculateHMDPosition:function(){var e=this.dolly,t=new o.Vector3;return e.updateMatrix(),t.setFromMatrixPosition(e.matrix),t},onMouseMove:function(e){var t=this.pitchObject,i=this.yawObject,r=this.previousMouseEvent;if(this.mouseDown&&this.data.enabled){var n=e.movementX||e.mozMovementX,o=e.movementY||e.mozMovementY;void 0!==n&&void 0!==o||(n=e.screenX-r.screenX,o=e.screenY-r.screenY),this.previousMouseEvent=e,i.rotation.y-=.002*n,t.rotation.x-=.002*o,t.rotation.x=Math.max(-c,Math.min(c,t.rotation.x))}},onMouseDown:function(e){this.mouseDown=!0,this.previousMouseEvent=e,document.body.classList.add("a-grabbing")},releaseMouse:function(){this.mouseDown=!1,document.body.classList.remove("a-grabbing")},onTouchStart:function(e){1===e.touches.length&&(this.touchStart={x:e.touches[0].pageX,y:e.touches[0].pageY},this.touchStarted=!0)},onTouchMove:function(e){var t,i=this.yawObject;this.touchStarted&&(t=2*Math.PI*(e.touches[0].pageX-this.touchStart.x)/this.el.sceneEl.canvas.clientWidth,i.rotation.y-=.5*t,this.touchStart={x:e.touches[0].pageX,y:e.touches[0].pageY})},onTouchEnd:function(){this.touchStarted=!1}})},{"../core/component":100,"../lib/three":146,"../utils/":167,"../utils/bind":161}],66:[function(e,t,i){function r(e){switch(e){case"back":return s.BackSide;case"double":return s.DoubleSide;default:return s.FrontSide}}function n(e,t){e.dispose(),t.unregisterMaterial(e)}var o=e("../utils/"),a=e("../core/component"),s=e("../lib/three"),c=e("../core/shader"),u=o.debug("components:material:error"),l=a.registerComponent,h=c.shaders,d=c.shaderNames;t.exports.Component=l("material",{schema:{depthTest:{default:!0},flatShading:{default:!1},opacity:{default:1,min:0,max:1},shader:{default:"standard",oneOf:d},side:{default:"front",oneOf:["front","back","double"]},transparent:{default:!1},visible:{default:!0},offset:{type:"vec2",default:{x:0,y:0}},repeat:{type:"vec2",default:{x:1,y:1}},npot:{default:!1}},init:function(){this.material=null},update:function(e){var t=this.data;this.shader&&t.shader===e.shader||this.updateShader(t.shader),this.shader.update(this.data),this.updateMaterial()},updateSchema:function(e){var t=e.shader,i=this.data&&this.data.shader,r=t||i,n=h[r]&&h[r].schema;n||u("Unknown shader schema "+r),i&&t===i||(this.extendSchema(n),this.updateBehavior())},updateBehavior:function(){var e=this.schema,t=this,i=this.el.sceneEl,r={},n=function(e,i){function n(t){r[t]=e}var o=Object.keys(r);o.forEach(n),t.shader.update(r)},o=Object.keys(e);this.tick=void 0,o.forEach(function(i){"time"===e[i].type&&(t.tick=n,r[i]=!0)}),i&&(this.tick?i.addBehavior(this):i.removeBehavior(this))},updateShader:function(e){var t,i=this.data,r=h[e]&&h[e].Shader;if(!r)throw new Error("Unknown shader "+e);t=this.shader=new r,
  t.el=this.el,t.init(i),this.setMaterial(t.material),this.updateSchema(i)},updateMaterial:function(){var e=this.data,t=this.material;t.side=r(e.side),t.opacity=e.opacity,t.transparent=e.transparent!==!1||e.opacity<1,t.depthTest=e.depthTest!==!1,t.shading=e.flatShading?s.FlatShading:s.SmoothShading,t.visible=e.visible},remove:function(){var e=new s.MeshBasicMaterial,t=this.material,i=this.el.getObject3D("mesh");i&&(i.material=e),n(t,this.system)},setMaterial:function(e){var t=this.el.getOrCreateObject3D("mesh",s.Mesh),i=this.system;this.material&&n(this.material,i),this.material=t.material=e,i.registerMaterial(e)}})},{"../core/component":100,"../core/shader":109,"../lib/three":146,"../utils/":167}],67:[function(e,t,i){var r=e("../utils/debug"),n=e("../core/component").registerComponent,o=e("../lib/three"),a=r("components:obj-model:warn");t.exports.Component=n("obj-model",{dependencies:["material"],schema:{mtl:{type:"model"},obj:{type:"model"}},init:function(){this.model=null,this.objLoader=new o.OBJLoader,this.mtlLoader=new o.MTLLoader(this.objLoader.manager),this.mtlLoader.crossOrigin=""},update:function(){var e=this.data;e.obj&&(this.remove(),this.loadObj(e.obj,e.mtl))},remove:function(){this.model&&this.el.removeObject3D("mesh")},loadObj:function(e,t){var i=this,r=this.el,n=this.mtlLoader,s=this.objLoader;return t?(r.hasAttribute("material")&&a("Material component properties are ignored when a .MTL is provided"),n.setTexturePath(t.substr(0,t.lastIndexOf("/")+1)),void n.load(t,function(t){t.preload(),s.setMaterials(t),s.load(e,function(e){i.model=e,r.setObject3D("mesh",e),r.emit("model-loaded",{format:"obj",model:e})})})):void s.load(e,function(e){var t=r.components.material;t&&e.traverse(function(e){e instanceof o.Mesh&&(e.material=t.material)}),i.model=e,r.setObject3D("mesh",e),r.emit("model-loaded",{format:"obj",model:e})})}})},{"../core/component":100,"../lib/three":146,"../utils/debug":163}],68:[function(e,t,i){var r=e("../core/component").registerComponent,n=e("../utils/bind"),o=e("../utils/tracked-controls").isControllerPresent,a="https://cdn.aframe.io/controllers/oculus/oculus-touch-controller-",s=a+"left.obj",c=a+"left.mtl",u=a+"right.obj",l=a+"right.mtl",h="Oculus Touch",d={x:0,y:-.015,z:.04},p=.001;t.exports.Component=r("oculus-touch-controls",{schema:{hand:{default:"left"},buttonColor:{type:"color",default:"#999"},buttonTouchColor:{type:"color",default:"#8AB"},buttonHighlightColor:{type:"color",default:"#2DF"},model:{default:!0},rotationOffset:{default:0}},mapping:{left:{axis0:"thumbstick",axis1:"thumbstick",button0:"thumbstick",button1:"trigger",button2:"grip",button3:"X",button4:"Y",button5:"surface"},right:{axis0:"thumbstick",axis1:"thumbstick",button0:"thumbstick",button1:"trigger",button2:"grip",button3:"A",button4:"B",button5:"surface"}},bindMethods:function(){this.onModelLoaded=n(this.onModelLoaded,this),this.onControllersUpdate=n(this.onControllersUpdate,this),this.checkIfControllerPresent=n(this.checkIfControllerPresent,this)},init:function(){var e=this;this.animationActive="pointing",this.onButtonChanged=n(this.onButtonChanged,this),this.onButtonDown=function(t){e.onButtonEvent(t.detail.id,"down")},this.onButtonUp=function(t){e.onButtonEvent(t.detail.id,"up")},this.onButtonTouchStart=function(t){e.onButtonEvent(t.detail.id,"touchstart")},this.onButtonTouchEnd=function(t){e.onButtonEvent(t.detail.id,"touchend")},this.controllerPresent=!1,this.everGotGamepadEvent=!1,this.lastControllerCheck=0,this.previousButtonValues={},this.bindMethods(),this.isControllerPresent=o},addEventListeners:function(){var e=this.el;e.addEventListener("buttonchanged",this.onButtonChanged),e.addEventListener("buttondown",this.onButtonDown),e.addEventListener("buttonup",this.onButtonUp),e.addEventListener("touchstart",this.onButtonTouchStart),e.addEventListener("touchend",this.onButtonTouchEnd),e.addEventListener("model-loaded",this.onModelLoaded),e.sceneEl.addEventListener("controllersupdated",this.onControllersUpdate,!1),window.addEventListener("gamepadconnected",this.checkIfControllerPresent,!1),window.addEventListener("gamepaddisconnected",this.checkIfControllerPresent,!1)},removeEventListeners:function(){var e=this.el;e.removeEventListener("buttonchanged",this.onButtonChanged),e.removeEventListener("buttondown",this.onButtonDown),e.removeEventListener("buttonup",this.onButtonUp),e.removeEventListener("touchstart",this.onButtonTouchStart),e.removeEventListener("touchend",this.onButtonTouchEnd),e.removeEventListener("model-loaded",this.onModelLoaded),e.sceneEl.removeEventListener("controllersupdated",this.onControllersUpdate,!1),window.removeEventListener("gamepadconnected",this.checkIfControllerPresent,!1),window.removeEventListener("gamepaddisconnected",this.checkIfControllerPresent,!1)},checkIfControllerPresent:function(){var e=this.data,t=this.isControllerPresent(this.el.sceneEl,h,{hand:e.hand});t!==this.controllerPresent&&(this.controllerPresent=t,t&&this.injectTrackedControls())},play:function(){this.checkIfControllerPresent(),this.addEventListeners()},pause:function(){this.removeEventListeners()},updateControllerModel:function(){var e,t;this.data.model&&("right"===this.data.hand?(e="url("+u+")",t="url("+l+")"):(e="url("+s+")",t="url("+c+")"),this.el.setAttribute("obj-model",{obj:e,mtl:t}))},injectTrackedControls:function(){var e=this.el,t=this.data,i="right"===t.hand;e.setAttribute("tracked-controls",{id:i?"Oculus Touch (Right)":"Oculus Touch (Left)",controller:0,rotationOffset:t.rotationOffset!==-999?t.rotationOffset:i?-90:90}),this.updateControllerModel()},onControllersUpdate:function(){this.everGotGamepadEvent||this.checkIfControllerPresent()},isEmulatedTouchEvent:function(e){return e&&e>=p},onButtonChanged:function(e){var t,i,r,n=this.mapping[this.data.hand]["button"+e.detail.id],o=this.buttonMeshes;"trigger"!==n&&"grip"!==n||(i=e.detail.state.value,t=this.isEmulatedTouchEvent(this.previousButtonValues[n]),this.previousButtonValues[n]=i,r=this.isEmulatedTouchEvent(i),r!==t&&(r?this.onButtonTouchStart:this.onButtonTouchEnd)(e),o&&("trigger"===n&&o.trigger&&(o.trigger.rotation.x=-i*(Math.PI/24)),"grip"===n&&o.grip&&(o.grip.rotation.y=("left"===this.data.hand?-1:1)*i*(Math.PI/60))))},onModelLoaded:function(e){var t,i=e.detail.model;if(this.data.model){var r="left"===this.data.hand;t=this.buttonMeshes={},t.grip=i.getObjectByName(r?"buttonHand_oculus-touch-controller-left.004":"buttonHand_oculus-touch-controller-right.005"),t.thumbstick=i.getObjectByName(r?"stick_oculus-touch-controller-left.007":"stick_oculus-touch-controller-right.004"),t.trigger=i.getObjectByName(r?"buttonTrigger_oculus-touch-controller-left.005":"buttonTrigger_oculus-touch-controller-right.006"),t.X=i.getObjectByName("buttonX_oculus-touch-controller-left.002"),t.A=i.getObjectByName("buttonA_oculus-touch-controller-right.002"),t.Y=i.getObjectByName("buttonY_oculus-touch-controller-left.001"),t.B=i.getObjectByName("buttonB_oculus-touch-controller-right.003"),i.position=d}},onButtonEvent:function(e,t){var i,r=this.mapping[this.data.hand]["button"+e];if(Array.isArray(r))for(i=0;i<r.length;i++)this.el.emit(r[i]+t);else this.el.emit(r+t);this.updateModel(r,t)},updateModel:function(e,t){var i;if(Array.isArray(e))for(i=0;i<e.length;i++)this.updateButtonModel(e[i],t);else this.updateButtonModel(e,t)},updateButtonModel:function(e,t){var i="up"===t||"touchend"===t?this.data.buttonColor:"touchstart"===t?this.data.buttonTouchColor:this.data.buttonHighlightColor,r=this.buttonMeshes;this.data.model&&r&&r[e]&&r[e].material.color.set(i)}})},{"../core/component":100,"../utils/bind":161,"../utils/tracked-controls":171}],69:[function(e,t,i){var r=e("../core/component").registerComponent;t.exports.Component=r("position",{schema:{type:"vec3"},update:function(){var e=this.el.object3D,t=this.data;e.position.set(t.x,t.y,t.z)}})},{"../core/component":100}],70:[function(e,t,i){var r=e("../core/component").registerComponent,n=e("../lib/three"),o=e("../utils/").bind,a=new n.Vector3;t.exports.Component=r("raycaster",{schema:{far:{default:1/0},interval:{default:100},near:{default:0},objects:{default:""},recursive:{default:!0}},init:function(){this.direction=new n.Vector3,this.intersectedEls=[],this.objects=null,this.prevCheckTime=void 0,this.raycaster=new n.Raycaster,this.updateOriginDirection(),this.refreshObjects=o(this.refreshObjects,this)},play:function(){this.el.sceneEl.addEventListener("child-attached",this.refreshObjects),this.el.sceneEl.addEventListener("child-detached",this.refreshObjects)},pause:function(){this.el.sceneEl.removeEventListener("child-attached",this.refreshObjects),this.el.sceneEl.removeEventListener("child-detached",this.refreshObjects)},update:function(){var e=this.data,t=this.raycaster;t.far=e.far,t.near=e.near,this.refreshObjects()},refreshObjects:function(){var e,t,i=this.data;if(i.objects)for(t=this.el.sceneEl.querySelectorAll(i.objects),this.objects=[],e=0;e<t.length;e++)this.objects.push(t[e].object3D);else this.objects=this.el.sceneEl.object3D.children},tick:function(e){var t,i,r,n=this.el,o=this.data,a=this.prevCheckTime;a&&e-a<o.interval||(this.prevCheckTime=e,r=this.intersectedEls.slice(),this.updateOriginDirection(),i=this.raycaster.intersectObjects(this.objects,o.recursive),i=i.filter(function(e){return!!e.object.el}),t=this.intersectedEls=i.map(function(e){return e.object.el}),i.forEach(function(e){var t=e.object.el;t.emit("raycaster-intersected",{el:n,intersection:e})}),i.length&&n.emit("raycaster-intersection",{els:t.slice(),intersections:i}),r.forEach(function(e){t.indexOf(e)===-1&&(n.emit("raycaster-intersection-cleared",{el:e}),e.emit("raycaster-intersected-cleared",{el:n}))}))},updateOriginDirection:function(){var e=new n.Quaternion,t=new n.Vector3;return function(){var i=this.el,r=i.object3D;r.updateMatrixWorld(),r.matrixWorld.decompose(t,e,a),this.direction.set(0,0,-1),this.direction.applyQuaternion(e),this.raycaster.set(t,this.direction)}}()})},{"../core/component":100,"../lib/three":146,"../utils/":167}],71:[function(e,t,i){var r=e("../lib/three").Math.degToRad,n=e("../core/component").registerComponent;t.exports.Component=n("rotation",{schema:{type:"vec3"},update:function(){var e=this.data,t=this.el.object3D;t.rotation.set(r(e.x),r(e.y),r(e.z)),t.rotation.order="YXZ"}})},{"../core/component":100,"../lib/three":146}],72:[function(e,t,i){var r=e("../core/component").registerComponent,n=1e-5;t.exports.Component=r("scale",{schema:{type:"vec3",default:{x:1,y:1,z:1}},update:function(){var e=this.data,t=this.el.object3D,i=0===e.x?n:e.x,r=0===e.y?n:e.y,o=0===e.z?n:e.z;t.scale.set(i,r,o)}})},{"../core/component":100}],73:[function(e,t,i){var r=e("../../core/component").registerComponent,n=e("../../utils");t.exports.Component=r("auto-enter-vr",{schema:{display:{type:"string",default:"GearVR"},enabled:{type:"boolean",default:!0}},init:function(){var e=this.el,t=this;this.enterVR=e.enterVR.bind(e),this.exitVR=e.exitVR.bind(e),this.shouldAutoEnterVR=this.shouldAutoEnterVR.bind(this),"false"!==n.getUrlParameter("auto-enter-vr")&&(window.addEventListener("vrdisplayactivate",function(){t.enterVR()},!1),window.addEventListener("vrdisplaydeactivate",function(){t.exitVR()},!1),setTimeout(function(){t.shouldAutoEnterVR()&&t.enterVR()},0))},update:function(){return this.shouldAutoEnterVR()?this.enterVR():this.exitVR()},shouldAutoEnterVR:function(){var e=this.el,t=this.data;if(!t.enabled)return!1;if(t.display&&"all"!==t.display){var i=e.effect&&e.effect.getVRDisplay&&e.effect.getVRDisplay();if(!i||!i.displayName||i.displayName.indexOf(t.display)<0)return!1}return!0}})},{"../../core/component":100,"../../utils":167}],74:[function(e,t,i){var r=e("../../utils/bind"),n=e("../../core/component").registerComponent;t.exports.Component=n("canvas",{init:function(){function e(){var e=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement;e||i.exitVR(),document.activeElement.blur(),document.body.focus()}var t,i=this.el;t=document.createElement("canvas"),t.classList.add("a-canvas"),t.dataset.aframeCanvas=!0,i.appendChild(t),document.addEventListener("fullscreenchange",e),document.addEventListener("mozfullscreenchange",e),document.addEventListener("webkitfullscreenchange",e),t.addEventListener("touchmove",function(e){e.preventDefault()}),i.canvas=t,i.emit("render-target-loaded",{target:t}),setTimeout(r(i.resize,i),0)}})},{"../../core/component":100,"../../utils/bind":161}],75:[function(e,t,i){var r=e("../../core/component").registerComponent;t.exports.Component=r("debug",{schema:{default:!0}})},{"../../core/component":100}],76:[function(e,t,i){var r=e("../../core/component").registerComponent;t.exports.Component=r("embedded",{dependencies:["vr-mode-ui"],schema:{default:!0},update:function(){var e=this.el,t=e.querySelector(".a-enter-vr");this.data===!0?(t&&t.classList.add("embedded"),e.removeFullScreenStyles()):(t&&t.classList.remove("embedded"),e.addFullScreenStyles())}})},{"../../core/component":100}],77:[function(e,t,i){function r(e){var t;return t="exponential"===e.type?new o.FogExp2(e.color,e.density):new o.Fog(e.color,e.near,e.far),t.name=e.type,t}var n=e("../../core/component").registerComponent,o=e("../../lib/three"),a=e("../../utils/debug"),s=a("components:fog:warn");t.exports.Component=n("fog",{schema:{color:{type:"color",default:"#000"},density:{default:25e-5},far:{default:1e3,min:0},near:{default:1,min:0},type:{default:"linear",oneOf:["linear","exponential"]}},update:function(){var e=this.data,t=this.el,i=this.el.object3D.fog;return t.isScene?i&&e.type===i.name?void Object.keys(this.schema).forEach(function(t){var r=e[t];"color"===t&&(r=new o.Color(r)),i[t]=r}):(t.object3D.fog=r(e),void t.systems.material.updateMaterials()):void s("Fog component can only be applied to <a-scene>")},remove:function(){var e=this.el.object3D.fog;e&&(e.far=0,e.near=.1)}})},{"../../core/component":100,"../../lib/three":146,"../../utils/debug":163}],78:[function(e,t,i){(function(i){function r(e){var t=e.split(".");return t[2]="x",t.join(".")}var n=e("../../constants").AFRAME_INJECTED,o=e("../../utils/bind"),a=e("../../../package"),s=e("../../core/component").registerComponent,c="https://aframe.io/aframe-inspector/dist/aframe-inspector.js",u="https://unpkg.com/aframe-inspector@"+r(a.version)+"/dist/aframe-inspector.min.js",l="dev"===i.env.INSPECTOR_VERSION?c:u,h="Loading Inspector";t.exports.Component=s("inspector",{schema:{url:{default:l}},init:function(){this.onKeydown=o(this.onKeydown,this),this.onMessage=o(this.onMessage,this),this.initOverlay(),window.addEventListener("keydown",this.onKeydown),window.addEventListener("message",this.onMessage)},initOverlay:function(){var e='<span class="dots"><span>.</span><span>.</span><span>.</span></span>';this.loadingMessageEl=document.createElement("div"),this.loadingMessageEl.classList.add("a-inspector-loader"),this.loadingMessageEl.innerHTML=h+e},remove:function(){this.removeEventListeners()},onKeydown:function(e){var t=73===e.keyCode&&e.ctrlKey&&e.altKey;this.data&&t&&this.injectInspector()},showLoader:function(){document.body.appendChild(this.loadingMessageEl)},hideLoader:function(){this.el.removeChild(this.loadingMessageEl)},onMessage:function(e){"INJECT_AFRAME_INSPECTOR"===e.data&&this.injectInspector()},injectInspector:function(){var e,t=this;AFRAME.INSPECTOR||AFRAME.inspectorInjected||(this.showLoader(),e=document.createElement("script"),e.src=this.data.url,e.setAttribute("data-name","aframe-inspector"),e.setAttribute(n,""),e.onload=function(){AFRAME.INSPECTOR.open(),t.hideLoader(),t.removeEventListeners()},document.head.appendChild(e),AFRAME.inspectorInjected=!0)},removeEventListeners:function(){window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("message",this.onMessage)}})}).call(this,e("_process"))},{"../../../package":55,"../../constants":91,"../../core/component":100,"../../utils/bind":161,_process:9}],79:[function(e,t,i){var r=e("../../core/component").registerComponent,n=e("../../utils/").shouldCaptureKeyEvent,o=e("../../lib/three"),a=new o.VRControls(new o.Object3D);t.exports.Component=r("keyboard-shortcuts",{schema:{enterVR:{default:!0},exitVR:{default:!0},resetSensor:{default:!0}},init:function(){var e=this,t=this.el;this.listener=window.addEventListener("keyup",function(i){n(i)&&(e.enterVREnabled&&70===i.keyCode&&t.enterVR(),e.enterVREnabled&&27===i.keyCode&&t.exitVR(),e.resetSensorEnabled&&90===i.keyCode&&a.resetSensor())},!1)},update:function(e){var t=this.data;this.enterVREnabled=t.enterVR,this.resetSensorEnabled=t.resetSensor},remove:function(){window.removeEventListener("keyup",this.listener)}})},{"../../core/component":100,"../../lib/three":146,"../../utils/":167}],80:[function(e,t,i){var r=e("../../utils/debug"),n=e("../../core/component").registerComponent,o=r("components:pool:warn");t.exports.Component=n("pool",{schema:{mixin:{default:""},size:{default:0},dynamic:{default:!1}},multiple:!0,init:function(){this.initPool()},initPool:function(){var e,t=this.data.mixin;if(t)for(this.availableEls=[],this.usedEls=[],e=0;e<this.data.size;++e)this.createEntity()},update:function(e){var t=this.data;e.mixin===t.mixin&&e.size===t.size||this.initPool()},createEntity:function(){var e=document.createElement("a-entity");e.play=this.wrapPlay(e.play),e.setAttribute("mixin",this.data.mixin),e.setAttribute("visible",!1),this.el.appendChild(e),this.availableEls.push(e)},wrapPlay:function(e){var t=this.usedEls;return function(){t.indexOf(this)!==-1&&e.call(this)}},requestEntity:function(){var e;if(0===this.availableEls.length){if(this.data.dynamic===!1)return void o("Requested entity from empty pool "+this.name);o("Requested entity from empty pool. This pool is dynamicand will resize automatically. You might want to increase its initial size"+this.name),this.createEntity()}return e=this.availableEls.shift(),this.usedEls.push(e),e.setAttribute("visible",!0),e},returnEntity:function(e){var t=this.usedEls.indexOf(e);return t===-1?void o("The returned entity was not previously pooled from "+this.name):(this.usedEls.splice(t,1),this.availableEls.push(e),e.setAttribute("visible",!1),void e.pause())}})},{"../../core/component":100,"../../utils/debug":163}],81:[function(e,t,i){var r=e("../../core/component").registerComponent,n=e("../../lib/three"),o=["attribute vec3 position;","attribute vec2 uv;","uniform mat4 projectionMatrix;","uniform mat4 modelViewMatrix;","varying vec2 vUv;","void main()  {","  vUv = vec2( 1.- uv.x, uv.y );","  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),a=["precision mediump float;","uniform samplerCube map;","varying vec2 vUv;","#define M_PI 3.141592653589793238462643383279","void main() {","  vec2 uv = vUv;","  float longitude = uv.x * 2. * M_PI - M_PI + M_PI / 2.;","  float latitude = uv.y * M_PI;","  vec3 dir = vec3(","    - sin( longitude ) * sin( latitude ),","    cos( latitude ),","    - cos( longitude ) * sin( latitude )","  );","  normalize( dir );","  gl_FragColor = vec4( textureCube( map, dir ).rgb, 1.0 );","}"].join("\n");t.exports.Component=r("screenshot",{schema:{width:{default:4096},height:{default:2048}},init:function(){function e(){var e=t.renderer.getContext();i.cubeMapSize=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),i.material=new n.RawShaderMaterial({uniforms:{map:{type:"t",value:null}},vertexShader:o,fragmentShader:a,side:n.DoubleSide}),i.quad=new n.Mesh(new n.PlaneBufferGeometry(1,1),i.material),i.quad.visible=!1,i.camera=new n.OrthographicCamera(-.5,.5,.5,-.5,-1e4,1e4),i.canvas=document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),t.camera&&t.camera.add(i.quad),i.onKeyDown=i.onKeyDown.bind(i),i.onCameraActive=i.onCameraActive.bind(i),t.addEventListener("camera-set-active",i.onCameraActive)}var t=this.el,i=this;t.renderer?e():t.addEventListener("render-target-loaded",e)},getRenderTarget:function(e,t){return new n.WebGLRenderTarget(e,t,{minFilter:n.LinearFilter,magFilter:n.LinearFilter,wrapS:n.ClampToEdgeWrapping,wrapT:n.ClampToEdgeWrapping,format:n.RGBAFormat,type:n.UnsignedByteType})},resize:function(e,t){this.quad.scale.set(e,t,1),this.camera.left=-1*e/2,this.camera.right=e/2,this.camera.top=t/2,this.camera.bottom=-1*t/2,this.camera.updateProjectionMatrix(),this.canvas.width=e,this.canvas.height=t},play:function(){window.addEventListener("keydown",this.onKeyDown)},onCameraActive:function(e){var t=this.quad.parent;t&&t.remove(this.quad),e.detail.cameraEl.getObject3D("camera").add(this.quad)},onKeyDown:function(e){var t=83===e.keyCode&&e.ctrlKey&&e.altKey;if(this.data&&t){var i=e.shiftKey?"equirectangular":"perspective";this.capture(i)}},setCapture:function(e){var t,i,r,o=this.el,a=o.renderer;return"perspective"===e?(this.quad.visible=!1,i=o.camera,t=a.getSize()):(i=this.camera,i.position.copy(o.camera.getWorldPosition()),i.rotation.copy(o.camera.getWorldRotation()),r=new n.CubeCamera(o.camera.near,o.camera.far,Math.min(this.cubeMapSize,2048)),r.position.copy(o.camera.getWorldPosition()),r.rotation.copy(o.camera.getWorldRotation()),r.updateCubeMap(o.renderer,o.object3D),this.quad.material.uniforms.map.value=r.renderTarget.texture,t={width:this.data.width,height:this.data.height},this.quad.visible=!0),{camera:i,size:t,projection:e}},capture:function(e){var t=this.setCapture(e);this.renderCapture(t.camera,t.size,t.projection),this.saveCapture()},getCanvas:function(e){var t=this.setCapture(e);return this.renderCapture(t.camera,t.size,t.projection),this.canvas},renderCapture:function(e,t,i){var r,n,o,a=this.el.renderer.autoClear,s=this.el,c=this.el.renderer;n=this.getRenderTarget(t.width,t.height),o=new Uint8Array(4*t.width*t.height),this.resize(t.width,t.height),c.autoClear=!0,c.render(s.object3D,e,n,!0),c.autoClear=a,c.readRenderTargetPixels(n,0,0,t.width,t.height,o),"perspective"===i&&(o=this.flipPixelsVertically(o,t.width,t.height)),r=new ImageData(new Uint8ClampedArray(o),t.width,t.height),this.quad.visible=!1,this.ctx.putImageData(r,0,0)},flipPixelsVertically:function(e,t,i){for(var r=e.slice(0),n=0;n<t;++n)for(var o=0;o<i;++o)r[4*n+o*t*4]=e[4*n+(i-o)*t*4],r[4*n+1+o*t*4]=e[4*n+1+(i-o)*t*4],r[4*n+2+o*t*4]=e[4*n+2+(i-o)*t*4],r[4*n+3+o*t*4]=e[4*n+3+(i-o)*t*4];return r},saveCapture:function(){this.canvas.toBlob(function(e){var t="screenshot-"+document.title.toLowerCase()+"-"+Date.now()+".png",i=document.createElement("a"),r=URL.createObjectURL(e);i.href=r,i.setAttribute("download",t),i.innerHTML="downloading...",i.style.display="none",document.body.appendChild(i),setTimeout(function(){i.click(),document.body.removeChild(i)},1)},"image/png")}})},{"../../core/component":100,"../../lib/three":146}],82:[function(e,t,i){function r(e){var t=new l(e.renderer),i=new s(e),r=e.isMobile?[]:[t,i];return new o({css:[],values:{fps:{caption:"fps",below:30}},groups:[{caption:"Framerate",values:["fps","raf"]}],plugins:r})}var n=e("../../core/component").registerComponent,o=e("../../../vendor/rStats"),a=e("../../utils");e("../../../vendor/rStats.extras"),e("../../lib/rStatsAframe");var s=window.aframeStats,c=a.bind,u="a-hidden",l=window.threeStats;t.exports.Component=n("stats",{schema:{default:!0},init:function(){var e=this.el;"false"!==a.getUrlParameter("stats")&&(this.stats=r(e),this.statsEl=document.querySelector(".rs-base"),this.hideBound=c(this.hide,this),this.showBound=c(this.show,this),e.addEventListener("enter-vr",this.hideBound),e.addEventListener("exit-vr",this.showBound))},update:function(){if(this.stats)return this.data?this.show():this.hide()},remove:function(){this.el.removeEventListener("enter-vr",this.hideBound),this.el.removeEventListener("exit-vr",this.showBound),this.statsEl&&this.statsEl.parentNode.removeChild(this.statsEl)},tick:function(){var e=this.stats;e&&(e("rAF").tick(),e("FPS").frame(),e().update())},hide:function(){this.statsEl.classList.add(u)},show:function(){this.statsEl.classList.remove(u)}})},{"../../../vendor/rStats":175,"../../../vendor/rStats.extras":174,"../../core/component":100,"../../lib/rStatsAframe":145,"../../utils":167}],83:[function(e,t,i){function r(e){var t,i;return i=document.createElement("div"),i.classList.add(u),i.setAttribute(a.AFRAME_INJECTED,""),t=document.createElement("button"),t.className=l,t.setAttribute(a.AFRAME_INJECTED,""),i.appendChild(t),t.addEventListener("click",e),i}function n(e){var t=document.createElement("div");t.className=d,t.classList.add(h),t.setAttribute(a.AFRAME_INJECTED,"");var i=document.createElement("button");return i.setAttribute(a.AFRAME_INJECTED,""),i.innerHTML="Exit VR",i.addEventListener("click",e),t.appendChild(i),t}var o=e("../../core/component").registerComponent,a=e("../../constants/"),s=e("../../utils/"),c=s.bind,u="a-enter-vr",l="a-enter-vr-button",h="a-hidden",d="a-orientation-modal";t.exports.Component=o("vr-mode-ui",{dependencies:["canvas"],schema:{enabled:{default:!0}},init:function(){var e=this,t=this.el;"false"!==s.getUrlParameter("ui")&&(this.enterVR=c(t.enterVR,t),this.exitVR=c(t.exitVR,t),this.insideLoader=!1,this.enterVREl=null,this.orientationModalEl=null,t.addEventListener("enter-vr",c(this.updateEnterVRInterface,this)),t.addEventListener("exit-vr",c(this.updateEnterVRInterface,this)),window.addEventListener("message",function(t){"loaderReady"===t.data.type&&(e.insideLoader=!0,e.remove())}),window.addEventListener("orientationchange",c(this.toggleOrientationModalIfNeeded,this)))},update:function(){var e=this.el;return!this.data.enabled||this.insideLoader||"false"===s.getUrlParameter("ui")?this.remove():void(this.enterVREl||this.orientationModalEl||(this.enterVREl=r(this.enterVR),e.appendChild(this.enterVREl),this.orientationModalEl=n(this.exitVR),e.appendChild(this.orientationModalEl),this.updateEnterVRInterface()))},remove:function(){[this.enterVREl,this.orientationModalEl].forEach(function(e){e&&e.parentNode.removeChild(e)})},updateEnterVRInterface:function(){this.toggleEnterVRButtonIfNeeded(),this.toggleOrientationModalIfNeeded()},toggleEnterVRButtonIfNeeded:function(){var e=this.el;this.enterVREl&&(e.is("vr-mode")?this.enterVREl.classList.add(h):this.enterVREl.classList.remove(h))},toggleOrientationModalIfNeeded:function(){var e=this.el,t=this.orientationModalEl;t&&e.isMobile&&(!s.device.isLandscape()&&e.is("vr-mode")?t.classList.remove(h):t.classList.add(h))}})},{"../../constants/":91,"../../core/component":100,"../../utils/":167}],84:[function(e,t,i){var r=e("../core/component").registerComponent,n=e("../utils/debug"),o=e("../utils/bind"),a=e("../lib/three"),s=n("components:sound:warn");t.exports.Component=r("sound",{schema:{autoplay:{default:!1},loop:{default:!1},on:{default:""},poolSize:{default:1},src:{type:"audio"},volume:{default:1}},multiple:!0,init:function(){this.listener=null,this.audioLoader=new a.AudioLoader,this.pool=new a.Group,this.playSound=o(this.playSound,this)},update:function(e){var t=this.data,i=t.src!==e.src;if(i){if(!t.src)return void s("Audio source was not specified with `src`");this.setupSound()}if(this.pool.children.forEach(function(e){e.autoplay=t.autoplay,e.setLoop(t.loop),e.setVolume(t.volume)}),t.on!==e.on&&this.updateEventListener(e.on),i){var r=this;this.audioLoader.load(t.src,function(e){r.pool.children.forEach(function(t){t.setBuffer(e)}),a.Cache.remove(t.src)})}},pause:function(){this.pauseSound(),this.removeEventListener()},play:function(){this.data.autoplay&&this.playSound(),this.updateEventListener()},remove:function(){this.removeEventListener(),this.el.removeObject3D(this.attrName);try{this.pool.children.forEach(function(e){e.disconnect()})}catch(e){s("Audio source not properly disconnected")}},updateEventListener:function(e){var t=this.el;e&&t.removeEventListener(e,this.playSound),t.addEventListener(this.data.on,this.playSound)},removeEventListener:function(){this.el.removeEventListener(this.data.on,this.playSound)},setupSound:function(){var e=this.el,t=e.sceneEl;this.pool.children.length>0&&(this.stopSound(),e.removeObject3D("sound"));var i=this.listener=t.audioListener||new a.AudioListener;t.audioListener=i,t.camera&&t.camera.add(i),t.addEventListener("camera-set-active",function(e){e.detail.cameraEl.getObject3D("camera").add(i)}),this.pool=new a.Group;for(var r=0;r<this.data.poolSize;r++){var n=new a.PositionalAudio(i);this.pool.add(n)}e.setObject3D(this.attrName,this.pool),this.pool.children.forEach(function(t){t.onEnded=function(){t.isPlaying=!1,e.emit("sound-ended",{index:r})}})},pauseSound:function(){this.pool.children.forEach(function(e){e.source&&e.source.buffer&&e.isPlaying&&e.pause&&e.pause()})},playSound:function(){var e=!1;this.pool.children.forEach(function(t){if(!t.isPlaying&&t.buffer&&!e)return t.play(),void(e=!0)}),e||s("All the sounds are playing. If you need to play more sounds simultaneously consider increasing the size of pool with the `poolSize` attribute.")},stopSound:function(){this.pool.children.forEach(function(e){e.source&&e.source.buffer&&e.stop()})}})},{"../core/component":100,"../lib/three":146,"../utils/bind":161,"../utils/debug":163}],85:[function(e,t,i){function r(e){switch(e){case"back":return y.BackSide;case"double":return y.DoubleSide;default:return y.FrontSide}}function n(e){return e=M.clone(e),void 0!==e.lineHeight&&(e.lineHeight=parseFloat(e.lineHeight),isFinite(e.lineHeight)||(e.lineHeight=void 0)),void 0!==e.width&&(e.width=parseFloat(e.width),isFinite(e.width)||(e.width=void 0)),e}function o(e,t){return new Promise(function(i,r){f(e,function(n,o){return n?(A("Error loading font",e),void r(n)):(e.indexOf("/Roboto-msdf.json")>=0&&(t=30),t&&o.chars.map(function(e){e.yoffset+=t}),void i(o))})})}function a(e){return new Promise(function(t,i){(new y.ImageLoader).load(e,function(e){t(e)},void 0,function(){A("Error loading font image",e),i(null)})})}function s(e,t,i){var r,n;return n=new w[t].Shader,n.el=e,n.init(i),n.update(i),r=n.material,r.transparent=i.transparent,{material:r,shader:n}}function c(e,t){e.side=t.side}function u(e,t,i){e.update(M.extend({},t,{font:i,width:l(t.wrapPixels,t.wrapCount,i.widthFactor),text:t.value.replace(/\\n/g,"\n").replace(/\\t/g,"\t"),lineHeight:t.lineHeight||i.common.lineHeight}))}function l(e,t,i){return e||(.5+t)*i}function h(e){var t=0,i=0,r=0;return e.chars.map(function(e){t+=e.xadvance,e.id>=48&&e.id<=57&&(r++,i+=e.xadvance)}),r?i/r:t/e.chars.length}function d(){var e=this.cache={};this.get=function(t,i){return t in e?e[t]:(e[t]=i(),e[t])}}var p=e("three-bmfont-text"),f=e("load-bmfont"),m=e("path"),g=e("../core/component").registerComponent,v=e("../core/shader"),y=e("../lib/three"),M=e("../utils/"),A=M.debug("components:text:error"),w=v.shaders,x=M.debug("components:text:warn"),E=1,b=16,T="https://cdn.aframe.io/fonts/",L={aileronsemibold:T+"Aileron-Semibold.fnt",dejavu:T+"DejaVu-sdf.fnt",exo2bold:T+"Exo2Bold.fnt",exo2semibold:T+"Exo2SemiBold.fnt",kelsonsans:T+"KelsonSans.fnt",monoid:T+"Monoid.fnt",mozillavr:T+"mozillavr.fnt",roboto:T+"Roboto-msdf.json",sourcecodepro:T+"SourceCodePro.fnt"},N=["roboto"],D="roboto";t.exports.FONTS=L;var S=new d,I={};t.exports.Component=g("text",{multiple:!0,schema:{align:{type:"string",default:"left",oneOf:["left","right","center"]},alphaTest:{default:.5},anchor:{default:"center",oneOf:["left","right","center","align"]},baseline:{default:"center",oneOf:["top","center","bottom"]},color:{type:"color",default:"#FFF"},font:{type:"string",default:D},fontImage:{type:"string"},height:{type:"number"},letterSpacing:{type:"number",default:0},lineHeight:{type:"number"},opacity:{type:"number",default:"1.0"},shader:{default:"sdf",oneOf:w},side:{default:"front",oneOf:["front","back","double"]},tabSize:{default:4},transparent:{default:!0},value:{type:"string"},whiteSpace:{default:"normal",oneOf:["normal","pre","nowrap"]},width:{type:"number"},wrapCount:{type:"number",default:40},wrapPixels:{type:"number"},yOffset:{type:"number",default:0},zOffset:{type:"number",default:.001}},init:function(){this.texture=new y.Texture,this.texture.anisotropy=b,this.geometry=p(),this.createOrUpdateMaterial(),this.mesh=new y.Mesh(this.geometry,this.material),this.el.setObject3D(this.attrName,this.mesh)},update:function(e){var t=n(this.data),i=this.currentFont;
  return this.createOrUpdateMaterial(),e.font!==t.font?void this.updateFont():void(i&&(u(this.geometry,t,i),this.updateLayout(t)))},remove:function(){this.geometry.dispose(),this.geometry=null,this.el.removeObject3D(this.attrName),this.material.dispose(),this.material=null,this.texture.dispose(),this.texture=null,this.shaderObject&&delete this.shaderObject},createOrUpdateMaterial:function(){var e,t,i,n,o=this.data,a=this.material;return n=o.shader,N.indexOf(o.font)!==-1||o.font.indexOf("-msdf.")>=0?n="msdf":o.font in L&&N.indexOf(o.font)===-1&&(n="sdf"),e=(this.shaderObject&&this.shaderObject.name)!==n,i={alphaTest:o.alphaTest,color:o.color,map:this.texture,opacity:o.opacity,side:r(o.side),transparent:o.transparent},e?(t=s(this.el,n,i),this.material=t.material,this.shaderObject=t.shader,c(this.material,i),void(this.mesh&&(this.mesh.material=this.material))):(this.shaderObject.update(i),a.transparent=i.transparent,void c(a,i))},updateFont:function(){var e,t=this.data,i=this.el,r=this.geometry,s=this;t.font||x("No font specified. Using the default font."),this.mesh.visible=!1,e=this.lookupFont(t.font||D)||t.font,S.get(e,function(){return o(e,t.yOffset)}).then(function(o){var c,l;if(1!==o.pages.length)throw new Error("Currently only single-page bitmap fonts are supported.");I[e]||(o.widthFactor=I[o]=h(o)),c=n(t),u(r,t,o),s.currentFont=o,s.updateLayout(c),l=t.fontImage||e.replace(/(\.fnt)|(\.json)/,".png")||m.dirname(t.font)+"/"+o.pages[0],S.get(l,function(){return a(l)}).then(function(e){s.mesh.visible=!0,s.texture.image=e,s.texture.needsUpdate=!0,i.emit("textfontset",{font:t.font,fontObj:o})}).catch(function(e){throw A(e),e})}).catch(function(e){throw A(e),e})},updateLayout:function(e){var t,i,r,n,o,a,s,c,u=this.el,h=this.geometry,d=u.getAttribute("geometry"),p=h.layout,f=this.mesh;if(d=u.getAttribute("geometry"),a=e.width||d&&d.width||E,n=l(e.wrapPixels,e.wrapCount,this.currentFont.widthFactor),o=a/n,r=o*(p.height+p.descender),d&&(d.width||u.setAttribute("geometry","width",a),d.height||u.setAttribute("geometry","height",r)),t="align"===e.anchor?e.align:e.anchor,"left"===t)s=0;else if("right"===t)s=-1*p.width;else{if("center"!==t)throw new TypeError("Invalid text.anchor property value",t);s=-1*p.width/2}if(i=e.baseline,"bottom"===i)c=0;else if("top"===i)c=-1*p.height+p.ascender;else{if("center"!==i)throw new TypeError("Invalid text.baseline property value",i);c=-1*p.height/2}f.position.x=s*o,f.position.y=c*o,f.position.z=e.zOffset,f.scale.set(o,-1*o,o),this.geometry.computeBoundingSphere()},lookupFont:function(e){return L[e]}})},{"../core/component":100,"../core/shader":109,"../lib/three":146,"../utils/":167,"load-bmfont":26,path:8,"three-bmfont-text":38}],86:[function(e,t,i){var r=e("../core/component").registerComponent,n=e("../lib/three");t.exports.Component=r("tracked-controls",{schema:{controller:{default:0},id:{type:"string",default:""},idPrefix:{type:"string",default:""},rotationOffset:{default:0}},init:function(){this.buttonStates={},this.previousAxis=[],this.previousControllerPosition=new n.Vector3},update:function(){function e(e){return i.idPrefix?0===e.id.indexOf(i.idPrefix):e.id===i.id}var t=this.system.controllers,i=this.data;t=t.filter(e),this.controller=t[i.controller]},tick:function(e,t){var i=this.el.getObject3D("mesh");i&&i.update&&i.update(t/1e3),this.updatePose(),this.updateButtons()},updatePose:function(){var e=new n.Euler,t=new n.Vector3,i=new n.Quaternion,r=new n.Vector3,o=new n.Object3D,a=new n.Matrix4;return e.order="YXZ",function(){var s,c,u,l,h=this.el,d=this.system.vrDisplay;if(this.update(),s=this.controller){c=s.pose,u=c.orientation||[0,0,0,1],l=c.position||[0,0,0],i.fromArray(u),o.quaternion.fromArray(u),o.position.fromArray(l),o.updateMatrix(),d&&d.stageParameters&&(a.fromArray(d.stageParameters.sittingToStandingTransform),o.applyMatrix(a)),e.setFromRotationMatrix(o.matrix),t.setFromMatrixPosition(o.matrix),h.setAttribute("rotation",{x:n.Math.radToDeg(e.x),y:n.Math.radToDeg(e.y),z:n.Math.radToDeg(e.z)+this.data.rotationOffset}),r.copy(t).sub(this.previousControllerPosition),this.previousControllerPosition.copy(t);var p=h.getAttribute("position");h.setAttribute("position",{x:p.x+r.x,y:p.y+r.y,z:p.z+r.z})}}}(),updateButtons:function(){var e,t,i=this.controller;if(this.controller){for(e=0;e<i.buttons.length;++e)t=i.buttons[e],this.handleButton(e,t);this.handleAxes(i.axes)}},handleAxes:function(e){var t,i=this.previousAxis,r=!1;for(t=0;t<e.length;++t)if(i[t]!==e[t]){r=!0;break}r&&(this.previousAxis=e.slice(),this.el.emit("axismove",{axis:this.previousAxis}))},handleButton:function(e,t){var i=!1;i=i||this.handlePress(e,t),i=i||this.handleTouch(e,t),i=i||this.handleValue(e,t),i&&this.el.emit("buttonchanged",{id:e,state:t})},handlePress:function(e,t){var i,r=this.buttonStates,n=r[e]=r[e]||{};return t.pressed!==n.pressed&&(i=t.pressed?"down":"up",this.el.emit("button"+i,{id:e}),n.pressed=t.pressed,!0)},handleTouch:function(e,t){var i,r=this.buttonStates,n=r[e]=r[e]||{};return t.touched!==n.touched&&(i=t.touched?"start":"end",n.touched=t.touched,this.el.emit("touch"+i,{id:e,state:n}),!0)},handleValue:function(e,t){var i=this.buttonStates,r=i[e]=i[e]||{};return t.value!==r.value&&(r.value=t.value,!0)}})},{"../core/component":100,"../lib/three":146}],87:[function(e,t,i){var r=e("../core/component").registerComponent;t.exports.Component=r("visible",{schema:{default:!0},update:function(){this.el.object3D.visible=this.data}})},{"../core/component":100}],88:[function(e,t,i){var r=e("../core/component").registerComponent,n=e("../utils/bind"),o=e("../utils/tracked-controls").isControllerPresent,a="https://cdn.aframe.io/controllers/vive/vr_controller_vive.obj",s="https://cdn.aframe.io/controllers/vive/vr_controller_vive.mtl",c="OpenVR ";t.exports.Component=r("vive-controls",{schema:{hand:{default:"left"},buttonColor:{type:"color",default:"#FAFAFA"},buttonHighlightColor:{type:"color",default:"#22D1EE"},model:{default:!0},rotationOffset:{default:0}},mapping:{axis0:"trackpad",axis1:"trackpad",button0:"trackpad",button1:"trigger",button2:"grip",button3:"menu",button4:"system"},bindMethods:function(){this.onModelLoaded=n(this.onModelLoaded,this),this.onControllersUpdate=n(this.onControllersUpdate,this),this.checkIfControllerPresent=n(this.checkIfControllerPresent,this),this.removeControllersUpdateListener=n(this.removeControllersUpdateListener,this),this.onGamepadConnected=n(this.onGamepadConnected,this),this.onGamepadDisconnected=n(this.onGamepadDisconnected,this)},init:function(){var e=this;this.animationActive="pointing",this.onButtonChanged=n(this.onButtonChanged,this),this.onButtonDown=function(t){e.onButtonEvent(t.detail.id,"down")},this.onButtonUp=function(t){e.onButtonEvent(t.detail.id,"up")},this.onButtonTouchStart=function(t){e.onButtonEvent(t.detail.id,"touchstart")},this.onButtonTouchEnd=function(t){e.onButtonEvent(t.detail.id,"touchend")},this.controllerPresent=!1,this.everGotGamepadEvent=!1,this.lastControllerCheck=0,this.bindMethods(),this.isControllerPresent=o},addEventListeners:function(){var e=this.el;e.addEventListener("buttonchanged",this.onButtonChanged),e.addEventListener("buttondown",this.onButtonDown),e.addEventListener("buttonup",this.onButtonUp),e.addEventListener("touchstart",this.onButtonTouchStart),e.addEventListener("touchend",this.onButtonTouchEnd),e.addEventListener("model-loaded",this.onModelLoaded)},removeEventListeners:function(){var e=this.el;e.removeEventListener("buttonchanged",this.onButtonChanged),e.removeEventListener("buttondown",this.onButtonDown),e.removeEventListener("buttonup",this.onButtonUp),e.removeEventListener("touchstart",this.onButtonTouchStart),e.removeEventListener("touchend",this.onButtonTouchEnd),e.removeEventListener("model-loaded",this.onModelLoaded)},checkIfControllerPresent:function(){var e=this.data,t="right"===e.hand?0:"left"===e.hand?1:2,i=this.isControllerPresent(this.el.sceneEl,c,{index:t});i!==this.controllerPresent&&(this.controllerPresent=i,i&&this.injectTrackedControls())},onGamepadConnected:function(e){this.checkIfControllerPresent()},onGamepadDisconnected:function(e){this.checkIfControllerPresent()},play:function(){this.checkIfControllerPresent(),window.addEventListener("gamepadconnected",this.onGamepadConnected,!1),window.addEventListener("gamepaddisconnected",this.onGamepadDisconnected,!1),this.addControllersUpdateListener(),this.addEventListeners()},pause:function(){window.removeEventListener("gamepadconnected",this.onGamepadConnected,!1),window.removeEventListener("gamepaddisconnected",this.onGamepadDisconnected,!1),this.removeControllersUpdateListener(),this.removeEventListeners()},injectTrackedControls:function(){var e=this.el,t=this.data,i="right"===t.hand?0:"left"===t.hand?1:2;e.setAttribute("tracked-controls",{idPrefix:c,controller:i,rotationOffset:t.rotationOffset}),this.data.model&&this.el.setAttribute("obj-model",{obj:a,mtl:s})},addControllersUpdateListener:function(){this.el.sceneEl.addEventListener("controllersupdated",this.onControllersUpdate,!1)},removeControllersUpdateListener:function(){this.el.sceneEl.removeEventListener("controllersupdated",this.onControllersUpdate,!1)},onControllersUpdate:function(){this.everGotGamepadEvent||this.checkIfControllerPresent()},onButtonChanged:function(e){var t,i=this.mapping["button"+e.detail.id],r=this.buttonMeshes;i&&r&&"trigger"===i&&(t=e.detail.state.value,r.trigger.rotation.x=-t*(Math.PI/12))},onModelLoaded:function(e){var t,i=e.detail.model;this.data.model&&(t=this.buttonMeshes={},t.grip={left:i.getObjectByName("leftgrip"),right:i.getObjectByName("rightgrip")},t.menu=i.getObjectByName("menubutton"),t.system=i.getObjectByName("systembutton"),t.trackpad=i.getObjectByName("touchpad"),t.trigger=i.getObjectByName("trigger"),i.position.set(0,-.015,.04))},onButtonEvent:function(e,t){var i,r=this.mapping["button"+e];if(Array.isArray(r))for(i=0;i<r.length;i++)this.el.emit(r[i]+t);else this.el.emit(r+t);this.updateModel(r,t)},updateModel:function(e,t){var i;if(this.data.model)if(Array.isArray(e))for(i=0;i<e.length;i++)this.updateButtonModel(e[i],t);else this.updateButtonModel(e,t)},updateButtonModel:function(e,t){var i="up"===t?this.data.buttonColor:this.data.buttonHighlightColor,r=this.buttonMeshes;if(r)return"grip"===e?(r.grip.left.material.color.set(i),void r.grip.right.material.color.set(i)):void r[e].material.color.set(i)}})},{"../core/component":100,"../utils/bind":161,"../utils/tracked-controls":171}],89:[function(e,t,i){var r=e("../constants").keyboardevent.KEYCODE_TO_CODE,n=e("../core/component").registerComponent,o=e("../lib/three"),a=e("../utils/"),s=a.bind,c=a.shouldCaptureKeyEvent,u=1e-5,l=.2;t.exports.Component=n("wasd-controls",{schema:{acceleration:{default:65},adAxis:{default:"x",oneOf:["x","y","z"]},adEnabled:{default:!0},adInverted:{default:!1},easing:{default:20},enabled:{default:!0},fly:{default:!1},wsAxis:{default:"z",oneOf:["x","y","z"]},wsEnabled:{default:!0},wsInverted:{default:!1}},init:function(){this.keys={},this.velocity=new o.Vector3,this.onBlur=s(this.onBlur,this),this.onFocus=s(this.onFocus,this),this.onKeyDown=s(this.onKeyDown,this),this.onKeyUp=s(this.onKeyUp,this),this.onVisibilityChange=s(this.onVisibilityChange,this),this.attachVisibilityEventListeners()},tick:function(e,t){var i,r,n=this.data,o=this.el,a=this.velocity;t/=1e3,this.updateVelocity(t),(a[n.adAxis]||a[n.wsAxis])&&(i=this.getMovementVector(t),r=o.getAttribute("position"),o.setAttribute("position",{x:r.x+i.x,y:r.y+i.y,z:r.z+i.z}))},remove:function(){this.removeKeyEventListeners(),this.removeVisibilityEventListeners()},play:function(){this.attachKeyEventListeners()},pause:function(){this.keys={},this.removeKeyEventListeners()},updateVelocity:function(e){var t,i,r,n,o,a=this.data,s=this.keys,c=this.velocity;return i=a.adAxis,n=a.wsAxis,e>l?(c[i]=0,void(c[n]=0)):(0!==c[i]&&(c[i]-=c[i]*a.easing*e),0!==c[n]&&(c[n]-=c[n]*a.easing*e),Math.abs(c[i])<u&&(c[i]=0),Math.abs(c[n])<u&&(c[n]=0),void(a.enabled&&(t=a.acceleration,a.adEnabled&&(r=a.adInverted?-1:1,(s.KeyA||s.ArrowLeft)&&(c[i]-=r*t*e),(s.KeyD||s.ArrowRight)&&(c[i]+=r*t*e)),a.wsEnabled&&(o=a.wsInverted?-1:1,(s.KeyW||s.ArrowUp)&&(c[n]-=o*t*e),(s.KeyS||s.ArrowDown)&&(c[n]+=o*t*e)))))},getMovementVector:function(){var e=new o.Vector3(0,0,0),t=new o.Euler(0,0,0,"YXZ");return function(i){var r=this.el.getAttribute("rotation"),n=this.velocity;return e.copy(n),e.multiplyScalar(i),r?(this.data.fly||(r.x=0),t.set(o.Math.degToRad(r.x),o.Math.degToRad(r.y),0),e.applyEuler(t),e):e}}(),attachVisibilityEventListeners:function(){window.addEventListener("blur",this.onBlur),window.addEventListener("focus",this.onFocus),document.addEventListener("visibilitychange",this.onVisibilityChange)},removeVisibilityEventListeners:function(){window.removeEventListener("blur",this.onBlur),window.removeEventListener("focus",this.onFocus),document.removeEventListener("visibilitychange",this.onVisibilityChange)},attachKeyEventListeners:function(){window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp)},removeKeyEventListeners:function(){window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp)},onBlur:function(){this.pause()},onFocus:function(){this.play()},onVisibilityChange:function(){document.hidden?this.onBlur():this.onFocus()},onKeyDown:function(e){var t;c(e)&&(t=e.code||r[e.keyCode],this.keys[t]=!0)},onKeyUp:function(e){var t;t=e.code||r[e.keyCode],this.keys[t]=!1}})},{"../constants":91,"../core/component":100,"../lib/three":146,"../utils/":167}],90:[function(e,t,i){var r=e("tween.js"),n={alternate:"alternate",alternateReverse:"alternate-reverse",normal:"normal",reverse:"reverse"},o={linear:r.Easing.Linear.None,ease:r.Easing.Cubic.InOut,"ease-in":r.Easing.Cubic.In,"ease-out":r.Easing.Cubic.Out,"ease-in-out":r.Easing.Cubic.InOut,"ease-cubic":r.Easing.Cubic.In,"ease-in-cubic":r.Easing.Cubic.In,"ease-out-cubic":r.Easing.Cubic.Out,"ease-in-out-cubic":r.Easing.Cubic.InOut,"ease-quad":r.Easing.Quadratic.InOut,"ease-in-quad":r.Easing.Quadratic.In,"ease-out-quad":r.Easing.Quadratic.Out,"ease-in-out-quad":r.Easing.Quadratic.InOut,"ease-quart":r.Easing.Quartic.InOut,"ease-in-quart":r.Easing.Quartic.In,"ease-out-quart":r.Easing.Quartic.Out,"ease-in-out-quart":r.Easing.Quartic.InOut,"ease-quint":r.Easing.Quintic.InOut,"ease-in-quint":r.Easing.Quintic.In,"ease-out-quint":r.Easing.Quintic.Out,"ease-in-out-quint":r.Easing.Quintic.InOut,"ease-sine":r.Easing.Sinusoidal.InOut,"ease-in-sine":r.Easing.Sinusoidal.In,"ease-out-sine":r.Easing.Sinusoidal.Out,"ease-in-out-sine":r.Easing.Sinusoidal.InOut,"ease-expo":r.Easing.Exponential.InOut,"ease-in-expo":r.Easing.Exponential.In,"ease-out-expo":r.Easing.Exponential.Out,"ease-in-out-expo":r.Easing.Exponential.InOut,"ease-circ":r.Easing.Circular.InOut,"ease-in-circ":r.Easing.Circular.In,"ease-out-circ":r.Easing.Circular.Out,"ease-in-out-circ":r.Easing.Circular.InOut,"ease-elastic":r.Easing.Elastic.InOut,"ease-in-elastic":r.Easing.Elastic.In,"ease-out-elastic":r.Easing.Elastic.Out,"ease-in-out-elastic":r.Easing.Elastic.InOut,"ease-back":r.Easing.Back.InOut,"ease-in-back":r.Easing.Back.In,"ease-out-back":r.Easing.Back.Out,"ease-in-out-back":r.Easing.Back.InOut,"ease-bounce":r.Easing.Bounce.InOut,"ease-in-bounce":r.Easing.Bounce.In,"ease-out-bounce":r.Easing.Bounce.Out,"ease-in-out-bounce":r.Easing.Bounce.InOut},a={backwards:"backwards",both:"both",forwards:"forwards",none:"none"},s={indefinite:"indefinite"},c={attribute:"rotation",begin:"",end:"",delay:0,dur:1e3,easing:"ease",direction:n.normal,fill:a.forwards,from:void 0,repeat:0,to:void 0};t.exports.defaults=c,t.exports.directions=n,t.exports.easingFunctions=o,t.exports.fills=a,t.exports.repeats=s},{"tween.js":49}],91:[function(e,t,i){t.exports={AFRAME_INJECTED:"aframe-injected",DEFAULT_CAMERA_HEIGHT:1.6,animation:e("./animation"),keyboardevent:e("./keyboardevent")}},{"./animation":90,"./keyboardevent":92}],92:[function(e,t,i){t.exports={KEYCODE_TO_CODE:{38:"ArrowUp",37:"ArrowLeft",40:"ArrowDown",39:"ArrowRight",87:"KeyW",65:"KeyA",83:"KeyS",68:"KeyD"}}},{}],93:[function(e,t,i){function r(e){return v.extend({},e)}function n(e,t,i,r,n){function s(){var t=E[0],i=E[1],r=e.components[t],n=r&&r.schema;return n&&n[i]&&"color"===n[i].type}function c(){w=E[0],A=E[1],y=e.components[w],y||(e.setAttribute(w,""),y=e.components[w]),v=y.schema,void 0===i?b[t]=M(e,t):b[t]=i,b[t]=p(b[t],v[A]),L[t]=p(r,v[A]),x=function(i){t in i&&e.setAttribute(w,A,i[t])}}function l(){b=i?d.parse(i):n,L=d.parse(r),x=function(i){e.setAttribute(t,i)}}function h(){void 0===i?b[t]=!1:b[t]=o(i),b[t]=a(b[t]),L[t]=a(o(r)),x=function(i){e.setAttribute(t,!!i[t])}}function f(){b=new g.Color(i),L=new g.Color(r),x=function(i){E.length>1&&e.setAttribute(E[0],E[1],u(i)),e.setAttribute(t,u(i))}}function m(){void 0===i?b[t]=parseFloat(e.getAttribute(t)):b[t]=parseFloat(i),L[t]=parseFloat(r),x=function(i){e.setAttribute(t,i[t])}}var v,y,A,w,x,E=t.split("."),b={},L={};return 2===E.length?s()?f():c():r&&T(r)?l():["true","false"].indexOf(r)!==-1?h():isNaN(r)?f():m(),{from:b,partialSetAttribute:x,to:L}}function o(e){return"true"===e}function a(e){return e?1:0}function s(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function c(e){return Math.floor(255*Math.min(Math.abs(e),1))}function u(e){return"#"+["r","g","b"].map(function(t){return s(c(e[t]))}).join("")}var l=e("./a-node"),h=e("../constants/animation"),d=e("../utils/").coordinates,p=e("./schema").parseProperty,f=e("./a-register-element").registerElement,m=e("tween.js"),g=e("../lib/three"),v=e("../utils/"),y=v.bind,M=v.entity.getComponentProperty,A=h.defaults,w=h.directions,x=h.easingFunctions,E=h.fills,b=h.repeats,T=d.isCoordinate;t.exports.AAnimation=f("a-animation",{prototype:Object.create(l.prototype,{createdCallback:{value:function(){this.bindMethods(),this.isRunning=!1,this.partialSetAttribute=function(){},this.tween=null}},attachedCallback:{value:function(){this.el=this.parentNode,this.handleMixinUpdate(),this.update(),this.load()}},attributeChangedCallback:{value:function(e,t,i){this.hasLoaded&&this.isRunning&&(this.stop(),this.handleMixinUpdate(),this.update())}},detachedCallback:{value:function(){this.isRunning&&this.stop()}},getTween:{value:function(){var e,t,i,o,a=this,s=a.data,c=a.el,u=s.attribute,l=parseInt(s.delay,10),h=M(c,u),d=a.getDirection(s.direction),p=x[s.easing],f=s.fill,g=s.repeat===b.indefinite?1/0:0,v=!1;return e=n(c,u,s.from||a.initialValue,s.to,h),t=e.from,i=e.to,a.partialSetAttribute=e.partialSetAttribute,void 0===a.count&&(a.count=g===1/0?0:parseInt(s.repeat,10)),isNaN(l)&&(l=0),a.initialValue=a.initialValue||r(h),g===1/0&&f===E.forwards&&[w.alternate,w.alternateReverse].indexOf(s.direction)!==-1&&(v=!0),d===w.reverse&&(o=i,i=r(t),t=r(o)),[E.backwards,E.both].indexOf(f)!==-1&&a.partialSetAttribute(t),new m.Tween(r(t)).to(i,s.dur).delay(l).easing(p).repeat(g).yoyo(v).onUpdate(function(){a.partialSetAttribute(this)}).onComplete(y(a.onCompleted,a))}},update:{value:function(){var e=this.data;"infinite"===e.repeat&&console.warn("Using 'infinite' as 'repeat' value is invalid.  Use 'indefinite' instead."),""===e.begin||isNaN(e.begin)||(console.warn("Using 'begin' to specify a delay is deprecated. Use 'delay' instead."),e.delay=e.begin,e.begin="");var t=e.begin,i=e.end;this.evt&&this.removeEventListeners(this.evt),this.evt={begin:t,end:i},this.addEventListeners(this.evt),""===t&&(this.stop(),this.start())},writable:window.debug},onCompleted:{value:function(){var e=this.data;return this.isRunning=!1,[E.backwards,E.none].indexOf(e.fill)!==-1&&this.partialSetAttribute(this.initialValue),0===this.count?(this.count=void 0,void this.emit("animationend")):(this.isRunning=!1,this.count--,void this.start())}},start:{value:function(){var e=this;return this.el.hasLoaded?void(!this.isRunning&&this.el.isPlaying&&(this.tween=this.getTween(),this.isRunning=!0,this.tween.start(),this.emit("animationstart"))):void this.el.addEventListener("loaded",function(){e.start()})},writable:!0},stop:{value:function(){var e=this.tween;e&&(e.stop(),this.isRunning=!1,[E.backwards,E.none].indexOf(this.data.fill)!==-1&&this.partialSetAttribute(this.initialValue),this.emit("animationstop"))},writable:!0},getDirection:{value:function(e){return e===w.alternate?(this.prevDirection=this.prevDirection===w.normal?w.reverse:w.normal,this.prevDirection):e===w.alternateReverse?(this.prevDirection=this.prevDirection===w.reverse?w.normal:w.reverse,this.prevDirection):e}},bindMethods:{value:function(){this.start=y(this.start,this),this.stop=y(this.stop,this),this.onStateAdded=y(this.onStateAdded,this),this.onStateRemoved=y(this.onStateRemoved,this)}},addEventListeners:{value:function(e){var t=this.el,i=this;v.splitString(e.begin).forEach(function(e){t.addEventListener(e,i.start)}),v.splitString(e.end).forEach(function(e){t.addEventListener(e,i.stop)}),""===e.begin&&t.addEventListener("play",this.start),t.addEventListener("pause",this.stop),t.addEventListener("stateadded",this.onStateAdded),t.addEventListener("stateremoved",this.onStateRemoved)}},removeEventListeners:{value:function(e){var t=this.el,i=this.start,r=this.stop;v.splitString(e.begin).forEach(function(e){t.removeEventListener(e,i)}),v.splitString(e.end).forEach(function(e){t.removeEventListener(e,r)}),t.removeEventListener("stateadded",this.onStateAdded),t.removeEventListener("stateremoved",this.onStateRemoved)}},onStateAdded:{value:function(e){e.detail.state===this.data.begin&&this.start()},writable:!0},onStateRemoved:{value:function(e){e.detail.state===this.data.begin&&this.stop()},writable:!0},handleMixinUpdate:{value:function(){var e,t,i,r={};i=document.querySelector("#"+this.getAttribute("mixin")),t=i?v.getElData(i,A):{},e=v.getElData(this,A),v.extend(r,A,t,e),this.data=r}}})}),t.exports.getAnimationValues=n},{"../constants/animation":90,"../lib/three":146,"../utils/":167,"./a-node":98,"./a-register-element":99,"./schema":108,"tween.js":49}],94:[function(e,t,i){function r(e){if(e.hasAttribute("autoplay")||"auto"===e.getAttribute("preload"))return new Promise(function(t,i){function r(){for(var i=0,r=0;r<e.buffered.length;r++)i+=e.buffered.end(r)-e.buffered.start(r);i>=e.duration&&t()}return 4===e.readyState?t():e.error?i():(e.addEventListener("loadeddata",r,!1),e.addEventListener("progress",r,!1),void e.addEventListener("error",i,!1))})}function n(e){var t=o(e);return"VIDEO"===t.tagName&&(t.setAttribute("playsinline",""),t.setAttribute("webkit-playsinline","")),t!==e&&(e.parentNode.appendChild(t),e.parentNode.removeChild(e)),t}function o(e){var t,i;if(e.hasAttribute("crossorigin"))return e;if(i=e.getAttribute("src"),null!==i){if(i.indexOf("://")===-1)return e;if(a(i)===window.location.host)return e}return p("Cross-origin element was requested without `crossorigin` set. A-Frame will re-request the asset with `crossorigin` attribute set.",i),e.crossOrigin="anonymous",t=e.cloneNode(!0)}function a(e){var t=e.indexOf("://")>-1?e.split("/")[2]:e.split("/")[0];return t.split(":")[0]}var s=e("./a-node"),c=e("../utils/bind"),u=e("../utils/debug"),l=e("./a-register-element").registerElement,h=e("../lib/three"),d=new h.FileLoader,p=u("core:a-assets:warn");t.exports=l("a-assets",{prototype:Object.create(s.prototype,{createdCallback:{value:function(){this.isAssets=!0,this.fileLoader=d,this.timeout=null}},attachedCallback:{value:function(){var e,t,i,o,a,s,u=this,l=[];if(!this.parentNode.isScene)throw new Error("<a-assets> must be a child of a <a-scene>.");for(a=this.querySelectorAll("img"),e=0;e<a.length;e++)o=n(a[e]),l.push(new Promise(function(e,t){o.onload=e,o.onerror=t}));for(i=this.querySelectorAll("audio, video"),e=0;e<i.length;e++)t=n(i[e]),l.push(r(t));Promise.all(l).then(c(this.load,this)),s=parseInt(this.getAttribute("timeout"),10)||3e3,this.timeout=setTimeout(function(){u.hasLoaded||(p("Asset loading timed out in ",s,"ms"),u.emit("timeout"),u.load())},s)}},detachedCallback:{value:function(){this.timeout&&clearTimeout(this.timeout)}},load:{value:function(){s.prototype.load.call(this,null,function(e){return e.isAssetItem&&e.hasAttribute("src")})}}})}),l("a-asset-item",{prototype:Object.create(s.prototype,{createdCallback:{value:function(){this.data=null,this.isAssetItem=!0}},attachedCallback:{value:function(){var e=this,t=this.getAttribute("src");d.load(t,function(i){h.Cache.files[t]=i,e.data=i,setTimeout(function(){s.prototype.load.call(e)})},function(t){e.emit("progress",{loadedBytes:t.loaded,totalBytes:t.total,xhr:t})},function(t){e.emit("error",{xhr:t})})}}})})},{"../lib/three":146,"../utils/bind":161,"../utils/debug":163,"./a-node":98,"./a-register-element":99}],95:[function(e,t,i){var r=e("../utils/debug"),n=e("./a-register-element").registerElement,o=r("core:cubemap:warn");t.exports=n("a-cubemap",{prototype:Object.create(HTMLElement.prototype,{attachedCallback:{value:function(){this.srcs=this.validate()},writable:window.debug},validate:{value:function(){var e,t=this.querySelectorAll("[src]"),i=[];if(6===t.length){for(e=0;e<t.length;e++)i.push(t[e].getAttribute("src"));return i}o("<a-cubemap> did not contain exactly six elements each with a `src` attribute.")},writable:window.debug}})})},{"../utils/debug":163,"./a-register-element":99}],96:[function(e,t,i){function r(e,t){return void 0!==e.defaultComponents[t]||(!(!e.components[t]||!e.components[t].attrValue)||o(t,e.mixinEls))}function n(e){var t=[];return e.mixinEls.forEach(function(e){function i(e){t.push(e)}Object.keys(e.componentCache).forEach(i)}),t}function o(e,t){var i,r=!1;for(i=0;i<t.length&&!(r=t[i].hasAttribute(e));++i);return r}function a(e,t){return t?t.constructor===Object?d.extend(t,d.styleParser.parse(e||{})):e||t:e}var s,c=e("./a-node"),u=e("./component").components,l=e("./a-register-element").registerElement,h=e("../lib/three"),d=e("../utils/"),p=d.bind,f=d.debug("core:a-entity:debug"),m=d.debug("core:a-entity:warn"),g="__",v=Object.create(c.prototype,{defaultComponents:{value:{position:"",rotation:"",scale:"",visible:""}},createdCallback:{value:function(){this.components={},this.isEntity=!0,this.isPlaying=!1,this.object3D=new h.Group,this.object3D.el=this,this.object3DMap={},this.parentEl=null,this.states=[]}},attributeChangedCallback:{value:function(e,t,i){var r=this.components[e];return r&&r.justInitialized&&""===i?void delete r.justInitialized:void((r||null!==i)&&this.setEntityAttribute(e,t,i))}},attachedCallback:{value:function(){var e,t=this.sceneEl,i=this;if(this.addToParent(),!this.isScene)return t?(e=t.querySelector("a-assets"),e&&!e.hasLoaded?void e.addEventListener("loaded",function(){i.load()}):void this.load()):void this.load()}},detachedCallback:{value:function(){this.parentEl&&(Object.keys(this.components).forEach(p(this.removeComponent,this)),this.isScene||(this.removeFromParent(),c.prototype.detachedCallback.call(this)))}},handleMixinUpdate:{value:function(e){return e?void this.updateComponent(e,this.getDOMAttribute(e)):void this.updateComponents()}},mapStateMixins:{value:function(e,t){var i,r=this.getAttribute("mixin");r&&(i=r.split(" "),i.forEach(function(i){var r=i+"-"+e;t(r)}),this.updateComponents())}},updateStateMixins:{value:function(e,t){var i=this;t=t||"";var r=e.split(" "),n=t?t.split(" "):[],o=n.filter(function(e){return r.indexOf(e)<0});o.forEach(function(e){var t=Array.prototype.forEach,r=document.querySelectorAll("[id^="+e+"-]");t.call(r,function(e){i.unregisterMixin(e.id)})}),this.states.forEach(function(e){r.forEach(function(t){var r=t+"-"+e;i.registerMixin(r)})})}},getObject3D:{value:function(e){return this.object3DMap[e]}},setObject3D:{value:function(e,t){var i,r=this;if(!(t instanceof h.Object3D))throw new Error("`Entity.setObject3D` was called with an object that was not an instance of THREE.Object3D.");i=this.getObject3D(e),i&&this.object3D.remove(i),t.el=this,t.children.length&&t.traverse(function(e){e.el=r}),this.object3D.add(t),this.object3DMap[e]=t,this.emit("object3dset",{object:t,type:e})}},removeObject3D:{value:function(e){var t=this.getObject3D(e);return t?(this.object3D.remove(t),delete this.object3DMap[e],void this.emit("object3dremove",{type:e})):void m("Tried to remove `Object3D` of type:",e,"which was not defined.")}},getOrCreateObject3D:{value:function(e,t){var i=this.getObject3D(e);return!i&&t&&(i=new t,this.setObject3D(e,i)),i}},add:{value:function(e){if(!e.object3D)throw new Error("Trying to add an element that doesn't have an `object3D`");this.object3D.add(e.object3D),this.emit("child-attached",{el:e})}},addToParent:{value:function(){var e=this.parentEl=this.parentNode;e&&e.add&&!this.attachedToParent&&(e.add(this),this.attachedToParent=!0)}},removeFromParent:{value:function(){var e=this.parentEl;this.parentEl.remove(this),this.attachedToParent=!1,this.parentEl=this.parentNode=null,e.emit("child-detached",{el:this})}},load:{value:function(){var e=this;this.hasLoaded||c.prototype.load.call(this,function(){e.updateComponents(),(e.isScene||e.parentEl.isPlaying)&&e.play()})},writable:window.debug},remove:{value:function(e){this.object3D.remove(e.object3D)}},getChildEntities:{value:function(){for(var e=this.children,t=[],i=0;i<e.length;i++){var r=e[i];r instanceof s&&t.push(r)}return t}},initComponent:{value:function(e,t,i){var n,o=e.split(g),a=o[1],s=o[0],c=r(this,e)||void 0!==t;if(u[s]&&(c||i)&&!(e in this.components)){if(this.initComponentDependencies(s),a&&!u[s].multiple)throw new Error("Trying to initialize multiple components of type `"+s+"`. There can only be one component of this type per entity.");n=this.components[e]=new u[s].Component(this,t,a),this.isPlaying&&n.play(),this.hasAttribute(e)||(n.justInitialized=!0,HTMLElement.prototype.setAttribute.call(this,e,"")),f("Component initialized: %s",e)}},writable:window.debug},initComponentDependencies:{value:function(e){var t,i=this,r=u[e];r&&(t=u[e].dependencies,t&&t.forEach(function(e){i.initComponent(e,HTMLElement.prototype.getAttribute.call(i,e)||void 0,!0)}))}},removeComponent:{value:function(e){var t,i,r;i=e in this.defaultComponents,r=o(e,this.mixinEls),i||r||(t=this.components[e],t.pause(),t.remove(),delete this.components[e],this.emit("componentremoved",{id:t.id,name:e}))}},updateComponents:{value:function(){function e(e){var t=e.split(g)[0];u[t]&&(r[e]=!0)}function t(e){var t=a(s.getDOMAttribute(e),o[e]);delete r[e],s.updateComponent(e,t)}var i,r={},o={},s=this;if(this.hasLoaded){for(n(this).forEach(e),this.getExtraComponents&&(o=this.getExtraComponents(),Object.keys(o).forEach(e)),i=0;i<this.attributes.length;++i)e(this.attributes[i].name);Object.keys(this.defaultComponents).forEach(t),Object.keys(r).forEach(t)}}},updateComponent:{value:function(e,t){var i=this.components[e],r=e in this.defaultComponents;return i?null!==t||r?void i.updateProperties(t):void this.removeComponent(e):void this.initComponent(e,t,!1)}},updateComponentProperty:{value:function(e,t,i){var r=this.components[e],n=r&&r.attrValue,o=n?d.extend({},n):{};o[t]=i,this.updateComponent(e,o)}},removeAttribute:{value:function(e,t){var i=this.components[e];if(!i||void 0!==t||(this.setEntityAttribute(e,void 0,null),!this.components[e]))return i&&void 0!==t?void i.resetProperty(t):void HTMLElement.prototype.removeAttribute.call(this,e)}},play:{value:function(){var e=this.components,t=Object.keys(e);!this.isPlaying&&this.hasLoaded&&(this.isPlaying=!0,t.forEach(function(t){e[t].play()}),this.getChildEntities().forEach(function(e){e.play()}),this.emit("play"))},writable:!0},pause:{value:function(){var e=this.components,t=Object.keys(e);this.isPlaying&&(this.isPlaying=!1,t.forEach(function(t){e[t].pause()}),this.getChildEntities().forEach(function(e){e.pause()}),this.emit("pause"))},writable:!0},setEntityAttribute:{value:function(e,t,i){return u[e]||this.components[e]?void this.updateComponent(e,i):"mixin"===e?void this.mixinUpdate(i,t):void 0}},mixinUpdate:{value:function(e,t){t=t||this.getAttribute("mixin"),this.updateStateMixins(e,t),this.updateComponents()}},setAttribute:{value:function(e,t,i){function r(e,t,i,r){e.updateComponentProperty(t,i,r)}function n(e,t,i){var r=e.components[t];r&&"object"==typeof i?e.updateComponent(t,d.extendDeep(d.extendDeep({},r.attrValue),i)):e.updateComponent(t,i);
  }function o(e,t,i){e.updateComponent(t,i)}function a(e,t,i){c.prototype.setAttribute.call(e,t,i),"mixin"===t&&e.mixinUpdate(i)}var s,l;return s=e.split(g)[0],u[s]?("string"==typeof t&&"undefined"!=typeof i?r(this,e,t,i):"object"==typeof t&&i===!0?o(this,e,t):n(this,e,t),l=this.sceneEl&&this.sceneEl.getAttribute("debug"),void(l&&this.components[e].flushToDOM())):void a(this,e,t)},writable:window.debug},flushToDOM:{value:function(e){var t,i,r=this.components,n=this.defaultComponents,o=this.children;if(Object.keys(r).forEach(function(e){r[e].flushToDOM(e in n)}),e)for(i=0;i<o.length;++i)t=o[i],t.flushToDOM&&t.flushToDOM(e)}},getAttribute:{value:function(e){var t=this.components[e];return t?t.getData():HTMLElement.prototype.getAttribute.call(this,e)},writable:window.debug},getComputedAttribute:{value:function(e){return m("`getComputedAttribute` is deprecated. Use `getAttribute` instead."),this.getAttribute(e)}},getDOMAttribute:{value:function(e){var t=this.components[e];return t?t.attrValue:HTMLElement.prototype.getAttribute.call(this,e)},writable:window.debug},addState:{value:function(e){this.is(e)||(this.states.push(e),this.mapStateMixins(e,p(this.registerMixin,this)),this.emit("stateadded",{state:e}))}},removeState:{value:function(e){var t=this.states.indexOf(e);t!==-1&&(this.states.splice(t,1),this.mapStateMixins(e,p(this.unregisterMixin,this)),this.emit("stateremoved",{state:e}))}},is:{value:function(e){return this.states.indexOf(e)!==-1}}});s=l("a-entity",{prototype:v}),t.exports=s},{"../lib/three":146,"../utils/":167,"./a-node":98,"./a-register-element":99,"./component":100}],97:[function(e,t,i){var r=e("./a-node"),n=e("./a-register-element").registerElement,o=e("./component").components,a="__";t.exports=n("a-mixin",{prototype:Object.create(r.prototype,{createdCallback:{value:function(){this.componentCache={},this.id=this.getAttribute("id")}},attributeChangedCallback:{value:function(e,t,i){this.cacheAttribute(e,i)}},attachedCallback:{value:function(){this.sceneEl=this.closestScene(),this.cacheAttributes(),this.updateEntities(),this.load()}},setAttribute:{value:function(e,t){this.cacheAttribute(e,t),HTMLElement.prototype.setAttribute.call(this,e,t)}},cacheAttribute:{value:function(e,t){var i=e.split(a)[0],r=o[i];r&&(void 0===t&&(t=HTMLElement.prototype.getAttribute.call(this,e)),this.componentCache[e]=r.parseAttrValueForCache(t))}},getAttribute:{value:function(e){return this.componentCache[e]||HTMLElement.prototype.getAttribute.call(this,e)}},cacheAttributes:{value:function(){var e,t,i=this.attributes;for(t=0;t<i.length;t++)e=i[t].name,this.cacheAttribute(e)}},updateEntities:{value:function(){if(this.sceneEl)for(var e=this.sceneEl.querySelectorAll("[mixin~="+this.id+"]"),t=0;t<e.length;t++){var i=e[t];i.hasLoaded&&(i.registerMixin(this.id),Object.keys(this.componentCache).forEach(function(e){i.updateComponent(e)}))}}}})})},{"./a-node":98,"./a-register-element":99,"./component":100}],98:[function(e,t,i){var r=e("./a-register-element").registerElement,n=e("../utils/"),o=n.bind,a=n.debug("core:a-node:warn");t.exports=r("a-node",{prototype:Object.create(HTMLElement.prototype,{createdCallback:{value:function(){this.hasLoaded=!1,this.isNode=!0,this.mixinEls=[],this.mixinObservers={}},writable:window.debug},attachedCallback:{value:function(){var e;this.sceneEl=this.closestScene(),this.sceneEl||a("You are attempting to attach <"+this.tagName+"> outside of an A-Frame scene. Append this element to `<a-scene>` instead."),this.hasLoaded=!1,this.emit("nodeready",{},!1),e=this.getAttribute("mixin"),e&&this.updateMixins(e)},writable:window.debug},attributeChangedCallback:{value:function(e,t,i){"mixin"===e&&this.updateMixins(i,t)}},closestScene:{value:function(){for(var e=this;e&&!e.isScene;)e=e.parentElement;return e}},closest:{value:function(e){for(var t=this.matches||this.mozMatchesSelector||this.msMatchesSelector||this.oMatchesSelector||this.webkitMatchesSelector,i=this;i&&!t.call(i,e);)i=i.parentElement;return i}},detachedCallback:{value:function(){this.hasLoaded=!1}},load:{value:function(e,t){var i,r,n=this;this.hasLoaded||(t=t||function(e){return e.isNode},i=this.getChildren(),r=i.filter(t).map(function(e){return new Promise(function(t){return e.hasLoaded?t():void e.addEventListener("loaded",t)})}),Promise.all(r).then(function(){n.hasLoaded=!0,e&&e(),n.emit("loaded",{},!1)}))},writable:!0},getChildren:{value:function(){return Array.prototype.slice.call(this.children,0)}},updateMixins:{value:function(e,t){var i=e?e.trim().split(/\s+/):[],r=t?t.trim().split(/\s+/):[],n=r.filter(function(e){return i.indexOf(e)<0});this.mixinEls=[],n.forEach(o(this.unregisterMixin,this)),i.forEach(o(this.registerMixin,this))}},registerMixin:{value:function(e){if(this.sceneEl){var t=this.sceneEl.querySelector("a-mixin#"+e);t&&(this.attachMixinListener(t),this.mixinEls.push(t))}}},setAttribute:{value:function(e,t){"mixin"===e&&this.updateMixins(t),HTMLElement.prototype.setAttribute.call(this,e,t)}},unregisterMixin:{value:function(e){var t,i,r=this.mixinEls;for(i=0;i<r.length;++i)if(t=r[i],e===t.id){r.splice(i,1);break}this.removeMixinListener(e)}},removeMixinListener:{value:function(e){var t=this.mixinObservers[e];t&&(t.disconnect(),this.mixinObservers[e]=null)}},attachMixinListener:{value:function(e){var t=this,i=e.id,r=this.mixinObservers[i];if(e&&!r){var n=new MutationObserver(function(e){var i=e[0].attributeName;t.handleMixinUpdate(i)}),o={attributes:!0};n.observe(e,o),this.mixinObservers[i]=n}}},handleMixinUpdate:{value:function(){}},emit:{value:function(e,t,i){var r=this;t=t||{},void 0===i&&(i=!0);var o={bubbles:!!i,detail:t};return e.split(" ").map(function(e){return n.fireEvent(r,e,o)})}},emitter:{value:function(e,t,i){var r=this;return function(){r.emit(e,t,i)}}}})})},{"../utils/":167,"./a-register-element":99}],99:[function(e,t,i){function r(e){h[e.toLowerCase()]=!0}function n(e){var t={},i=["attachedCallback","attributeChangedCallback","createdCallback"];return a(t,i,e,u.prototype),c(e,t),t}function o(e){var t={},i=["attachedCallback","attributeChangedCallback","createdCallback"],r=["attachedCallback","attributeChangedCallback","createdCallback","detachedCallback"];return a(t,i,e,u.prototype),a(t,r,e,l.prototype),c(e,t),t}function a(e,t,i,r){t.forEach(function(t){s(e,t,i,r)})}function s(e,t,i,r){var n=i[t],o=r[t];n&&o&&n!==o&&(e[t]={value:function(){return o.apply(this,arguments),n.apply(this,arguments)},writable:window.debug})}function c(e,t){var i=Object.getOwnPropertyNames(e);i.forEach(function(i){var r;t[i]||(r=Object.getOwnPropertyDescriptor(e,i),t[i]={value:e[i],writable:r.writable})})}e("document-register-element");var u,l,h=t.exports.knownTags={};t.exports.isNode=function(e){return e.tagName.toLowerCase()in h||e.isNode},t.exports.registerElement=function(e,t){var i=Object.getPrototypeOf(t.prototype),a=t,s=u&&i===u.prototype,c=l&&i===l.prototype;return(s||c)&&r(e),s&&(a=n(t.prototype),a={prototype:Object.create(i,a)}),c&&(a=o(t.prototype),a={prototype:Object.create(i,a)}),document.registerElement(e,a)},t.exports.wrapMethods=a,u=e("./a-node"),l=e("./a-entity")},{"./a-entity":96,"./a-node":98,"document-register-element":16}],100:[function(e,t,i){function r(e,t,i,r,o,a){function s(e){var t=e.getAttribute(i);t&&(c=n(c,t,h))}var c,u=void 0!==o&&null!==o,h=m(r),f=e.mixinEls;return h?c=r.default:(c={},Object.keys(r).forEach(function(e){var t=r[e].default;c[e]=t&&t.constructor===Object?l.extend({},t):t})),f.forEach(s),u?h?p(o,r):(c=n(c,o,h),d(c,r,void 0,t,a)):h?p(c,r):d(c,r,void 0,t,a)}function n(e,t,i){return i?t:l.extend(e,t)}function o(e){return function(){var t=this.el.sceneEl;this.isPlaying&&(e.call(this),this.isPlaying=!1,this.tick&&t.removeBehavior(this))}}function a(e){return function(){var t=this.el.sceneEl,i=this.el.isPlaying&&!this.isPlaying;this.initialized&&i&&(e.call(this),this.isPlaying=!0,this.tick&&t.addBehavior(this))}}var s=e("./schema"),c=e("./scene/scenes"),u=e("./system"),l=e("../utils/"),h=t.exports.components={},d=s.parseProperties,p=s.parseProperty,f=s.process,m=s.isSingleProperty,g=s.stringifyProperties,v=s.stringifyProperty,y=l.styleParser,M=l.debug("core:component:warn"),A=document.currentScript,w=new RegExp("[A-Z]+"),x=t.exports.Component=function(e,t,i){this.el=e,this.id=i,this.attrName=this.name+(i?"__"+i:""),this.updateProperties(t)};if(x.prototype={schema:{},init:function(){},update:function(e){},updateSchema:void 0,tick:void 0,play:function(){},pause:function(){},remove:function(){},parse:function(e,t){var i=this.schema;return m(i)?p(e,i):d(y.parse(e),i,!0,this.name,t)},stringify:function(e){var t=this.schema;return"string"==typeof e?e:m(t)?v(e,t):(e=g(e,t),y.stringify(e))},getData:function(){var e=this.data;return"object"!=typeof e?e:l.extend({},e)},updateCachedAttrValue:function(e){var t=m(this.schema),i=this.parseAttrValueForCache(e);this.attrValue=n({},i,t)},parseAttrValueForCache:function(e){var t;return"string"!=typeof e?e:(m(this.schema)?(t=this.schema.parse(e),"string"==typeof t&&(t=e)):t=y.parse(e),t)},flushToDOM:function(e){var t=e?this.data:this.attrValue;t&&HTMLElement.prototype.setAttribute.call(this.el,this.attrName,this.stringify(t))},updateProperties:function(e){var t=this.el,i=m(this.schema),o=n({},this.data,i);if(void 0!==e&&this.updateCachedAttrValue(e),t.hasLoaded)if(this.updateSchema&&this.updateSchema(r(t,this.name,this.attrName,this.schema,this.attrValue,!0)),this.data=r(t,this.name,this.attrName,this.schema,this.attrValue),this.initialized){if(l.deepEqual(o,this.data))return;this.update(o),t.emit("componentchanged",{id:this.id,name:this.name,newData:this.getData(),oldData:o},!1)}else this.init(),this.initialized=!0,this.update(o),t.isPlaying&&this.play(),t.emit("componentinitialized",{id:this.id,name:this.name,data:this.getData()},!1)},resetProperty:function(e){if(m(this.schema))this.attrValue=void 0;else{if(!(e in this.attrValue))return;delete this.attrValue[e]}this.updateProperties(this.attrValue)},extendSchema:function(e){var t=l.extend({},h[this.name].schema);l.extend(t,e),this.schema=f(t),this.el.emit("schemachanged",{component:this.name})}},window.debug)var E=t.exports.registrationOrderWarnings={};t.exports.registerComponent=function(e,t){var i,r={};if(document.currentScript&&document.currentScript!==A&&c.forEach(function(t){t.hasLoaded||document.currentScript.compareDocumentPosition(t)!==Node.DOCUMENT_POSITION_FOLLOWING&&(M("The component `"+e+"` was registered in a <script> tag after the scene. Component <script> tags in an HTML file should be declared *before* the scene such that the component is available to entities during scene initialization."),window.debug&&(E[e]=!0))}),w.test(e)===!0&&M("The component name `"+e+"` contains uppercase characters, but HTML will ignore the capitalization of attribute names. Change the name to be lowercase: `"+e.toLowerCase()+"`"),e.indexOf("__")!==-1)throw new Error("The component name `"+e+"` is not allowed. The sequence __ (double underscore) is reserved to specify an id for multiple components of the same type");if(Object.keys(t).forEach(function(e){r[e]={value:t[e],writable:!0}}),h[e])throw new Error("The component `"+e+"` has been already registered. Check that you are not loading two versions of the same component or two different components of the same name.");return i=function(e,t,i){x.call(this,e,t,i)},i.prototype=Object.create(x.prototype,r),i.prototype.name=e,i.prototype.constructor=i,i.prototype.system=u&&u.systems[e],i.prototype.play=a(i.prototype.play),i.prototype.pause=o(i.prototype.pause),h[e]={Component:i,dependencies:i.prototype.dependencies,isSingleProp:m(i.prototype.schema),multiple:i.prototype.multiple,parse:i.prototype.parse,parseAttrValueForCache:i.prototype.parseAttrValueForCache,schema:l.extend(f(i.prototype.schema)),stringify:i.prototype.stringify,type:i.prototype.type},i},t.exports.buildData=r},{"../utils/":167,"./scene/scenes":106,"./schema":108,"./system":110}],101:[function(e,t,i){var r=e("./schema"),n=r.process,o=t.exports.geometries={},a=t.exports.geometryNames=[],s=e("../lib/three"),c=t.exports.Geometry=function(){};c.prototype={schema:{},init:function(e){return this.geometry=new s.Geometry,this.geometry},update:function(e){}},t.exports.registerGeometry=function(e,t){var i,r={};if(Object.keys(t).forEach(function(e){r[e]={value:t[e],writable:!0}}),o[e])throw new Error("The geometry `"+e+"` has been already registered");return i=function(){c.call(this)},i.prototype=Object.create(c.prototype,r),i.prototype.name=e,i.prototype.constructor=i,o[e]={Geometry:i,schema:n(i.prototype.schema)},a.push(e),i}},{"../lib/three":146,"./schema":108}],102:[function(e,t,i){function r(e,t,i,r){return"type"in x?void A("Property type "+e+" is already registered."):void(x[e]={default:t,parse:i||s,stringify:r||c})}function n(e){function t(e){return e.trim()}return Array.isArray(e)?e:e&&"string"==typeof e?e.split(",").map(t):[]}function o(e){return e.join(", ")}function a(e){var t,i;return"string"!=typeof e?e:(i=e.match(/\url\((.+)\)/),i?i[1]:"#"===e.charAt(0)?(t=d(e))?"CANVAS"===t.tagName||"VIDEO"===t.tagName?t:t.getAttribute("src"):void w('"'+e+'" asset not found.'):e)}function s(e){return e}function c(e){return null===e?"null":e.toString()}function u(e){return"false"!==e&&e!==!1}function l(e){return parseInt(e,10)}function h(e){return parseFloat(e,10)}function d(e){return e?"string"!=typeof e?e:document.querySelector(e):null}function p(e){return e?"string"!=typeof e?e:Array.prototype.slice.call(document.querySelectorAll(e),0):null}function f(e){return e.getAttribute?"#"+e.getAttribute("id"):c(e)}function m(e){return e instanceof Array?e.map(function(e){return"#"+e.getAttribute("id")}).join(", "):c(e)}function g(e){return w("`src` property type is deprecated. Use `asset` instead."),a(e)}function v(e){return y.parse(e,this.default)}var y=e("../utils/coordinates"),M=e("debug"),A=M("core:propertyTypes:warn"),w=M("core:propertyTypes:warn"),x=t.exports.propertyTypes={};r("audio","",a),r("array",[],n,o),r("asset","",a),r("boolean",!1,u),r("color","#FFF",s,c),r("int",0,l),r("number",0,h),r("map","",a),r("model","",a),r("selector","",d,f),r("selectorAll","",p,m),r("src","",g),r("string","",s,c),r("time",0,l),r("vec2",{x:0,y:0},v,y.stringify),r("vec3",{x:0,y:0,z:0},v,y.stringify),r("vec4",{x:0,y:0,z:0,w:0},v,y.stringify),t.exports.registerPropertyType=r},{"../utils/coordinates":162,debug:11}],103:[function(e,t,i){function r(e,t){return t?{height:e.parentElement.offsetHeight,width:e.parentElement.offsetWidth}:{height:window.innerHeight,width:window.innerWidth}}function n(e){var t=e.requestFullscreen||e.webkitRequestFullscreen||e.mozRequestFullScreen||e.msRequestFullscreen;t.apply(e)}function o(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()}var a=e("./metaTags").inject,s=e("./wakelock"),c=e("../a-register-element"),u=e("./scenes"),l=e("../system").systems,h=e("../../lib/three"),d=e("tween.js"),p=e("../../utils/"),f=e("../a-entity"),m=e("../a-node"),g=e("./postMessage"),v=p.bind,y=p.device.isIOS(),M=p.device.isMobile(),A=c.registerElement,w=p.debug("core:a-scene:warn");t.exports=A("a-scene",{prototype:Object.create(f.prototype,{defaultComponents:{value:{canvas:"",inspector:"","keyboard-shortcuts":"",screenshot:"","vr-mode-ui":"","auto-enter-vr":""}},createdCallback:{value:function(){this.isIOS=y,this.isMobile=M,this.isScene=!0,this.object3D=new h.Scene,this.render=v(this.render,this),this.systems={},this.time=0,this.init()}},init:{value:function(){this.behaviors=[],this.hasLoaded=!1,this.isPlaying=!1,this.originalHTML=this.innerHTML,this.addEventListener("render-target-loaded",function(){this.setupRenderer(),this.resize()}),this.addFullScreenStyles(),g(this)},writable:!0},addFullScreenStyles:{value:function(){var e=document.documentElement;e.classList.add("a-html"),document.body.classList.add("a-body"),this.classList.add("fullscreen")}},removeFullScreenStyles:{value:function(){var e=document.documentElement;e.classList.remove("a-html"),document.body.classList.remove("a-body"),this.classList.remove("fullscreen")}},attachedCallback:{value:function(){var e=v(this.resize,this);a(this),s(this),this.initSystems(),window.addEventListener("load",e),window.addEventListener("resize",e),this.play(),u.push(this)},writable:window.debug},initSystems:{value:function(){Object.keys(l).forEach(v(this.initSystem,this))}},initSystem:{value:function(e){var t;this.systems[e]||(t=this.systems[e]=new l[e](this),t.init())}},detachedCallback:{value:function(){var e;window.cancelAnimationFrame(this.animationFrameID),this.animationFrameID=null,e=u.indexOf(this),u.splice(e,1)}},addBehavior:{value:function(e){var t=this.behaviors;t.indexOf(e)===-1&&t.push(e)}},checkHeadsetConnected:{value:p.device.checkHeadsetConnected,writable:window.debug},enterVR:{value:function(e){function t(){r.addState("vr-mode"),r.emit("enter-vr",e),r.isMobile&&screen.orientation&&screen.orientation.lock&&screen.orientation.lock("landscape"),r.addFullScreenStyles(),r.isMobile||r.checkHeadsetConnected()||n(r.canvas),r.resize()}function i(e){throw e&&e.message?new Error("Failed to enter VR mode (`requestPresent`): "+e.message):new Error("Failed to enter VR mode (`requestPresent`).")}var r=this;return this.is("vr-mode")?Promise.resolve("Already in VR."):this.checkHeadsetConnected()||this.isMobile?this.effect.requestPresent().then(t,i):(t(),Promise.resolve())}},exitVR:{value:function(){function e(){i.removeState("vr-mode"),i.isMobile&&screen.orientation&&screen.orientation.unlock&&screen.orientation.unlock(),i.hasAttribute("embedded")&&i.removeFullScreenStyles(),i.resize(),i.isIOS&&p.forceCanvasResizeSafariMobile(this.canvas),i.emit("exit-vr",{target:i})}function t(e){throw e&&e.message?new Error("Failed to exit VR mode (`exitPresent`): "+e.message):new Error("Failed to exit VR mode (`exitPresent`).")}var i=this;return this.is("vr-mode")?(o(),this.checkHeadsetConnected()||this.isMobile?this.effect.exitPresent().then(e,t):(e(),Promise.resolve())):Promise.resolve("Not in VR.")}},getAttribute:{value:function(e){var t=this.systems[e];return t?t.data:f.prototype.getAttribute.call(this,e)}},getComputedAttribute:{value:function(e){w("`getComputedAttribute` is deprecated. Use `getAttribute` instead."),this.getAttribute(e)}},getDOMAttribute:{value:function(e){var t=this.systems[e];return t?t.data:f.prototype.getDOMAttribute.call(this,e)}},setAttribute:{value:function(e,t,i){var r=this.systems[e];return r?void m.prototype.setAttribute.call(this,e,t):void f.prototype.setAttribute.call(this,e,t,i)}},removeBehavior:{value:function(e){var t=this.behaviors,i=t.indexOf(e);i!==-1&&t.splice(i,1)}},resize:{value:function(){var e,t=this.camera,i=this.canvas,n=this.getAttribute("embedded")&&!this.is("vr-mode");!t||!i||this.is("vr-mode")&&M||(e=r(i,n),t.aspect=e.width/e.height,t.updateProjectionMatrix(),this.renderer.setSize(e.width,e.height))},writable:window.debug},setupRenderer:{value:function(){var e=this.canvas,t="true"===this.getAttribute("antialias"),i=this.renderer=new h.WebGLRenderer({canvas:e,antialias:t||window.hasNativeWebVRImplementation,alpha:!0});i.setPixelRatio(window.devicePixelRatio),i.sortObjects=!1,this.effect=new h.VREffect(i)},writable:window.debug},play:{value:function(){var e=this;return this.renderStarted?void f.prototype.play.call(this):(this.addEventListener("loaded",function(){function e(e){e.renderStarted||(e.resize(),e.renderer&&(window.performance&&window.performance.mark("render-started"),e.render(0),e.renderStarted=!0,e.emit("renderstart")))}return f.prototype.play.call(this),this.camera?void e(this):void this.addEventListener("camera-set-active",function(){e(this)})}),void setTimeout(function(){f.prototype.load.call(e)}))}},reload:{value:function(e){function t(){i.isPlaying&&f.prototype.play.call(i)}var i=this;e&&this.pause(),this.innerHTML=this.originalHTML,this.init(),m.prototype.load.call(this,t)}},updateComponent:{value:function(e){e in l||f.prototype.updateComponent.apply(this,arguments)}},tick:{value:function(e,t){var i=this.systems;d.update(e),this.behaviors.forEach(function(i){i.el.isPlaying&&i.tick(e,t)}),Object.keys(i).forEach(function(r){i[r].tick&&i[r].tick(e,t)})}},render:{value:function(e){var t=this.effect,i=e-this.time;this.isPlaying&&this.tick(e,i),this.animationFrameID=t.requestAnimationFrame(this.render),t.render(this.object3D,this.camera),this.time=e},writable:!0}})})},{"../../lib/three":146,"../../utils/":167,"../a-entity":96,"../a-node":98,"../a-register-element":99,"../system":110,"./metaTags":104,"./postMessage":105,"./scenes":106,"./wakelock":107,"tween.js":49}],104:[function(e,t,i){function r(e){return{tagName:"meta",attributes:e,exists:function(){return document.querySelector('meta[name="'+e.name+'"]')}}}function n(e){return{tagName:"link",attributes:e,exists:function(){return document.querySelector('link[rel="'+e.rel+'"]')}}}function o(e){if(e&&e.tagName){var t=document.createElement(e.tagName);return t.setAttribute(a.AFRAME_INJECTED,""),s(t,e.attributes)}}var a=e("../../constants/"),s=e("../../utils").extend,c=t.exports.MOBILE_HEAD_TAGS=[r({name:"viewport",content:"width=device-width,initial-scale=1,maximum-scale=1,shrink-to-fit=no,user-scalable=no,minimal-ui"}),r({name:"mobile-web-app-capable",content:"yes"}),r({name:"theme-color",content:"black"})],u=[r({name:"apple-mobile-web-app-capable",content:"yes"}),r({name:"apple-mobile-web-app-status-bar-style",content:"black"}),n({rel:"apple-touch-icon",href:"https://aframe.io/images/aframe-logo-152.png"})];t.exports.inject=function(e){function t(e){e&&!e.exists()&&(i=o(e),i&&(n?n.parentNode.insertBefore(i,n):r.appendChild(i),a.push(i)))}var i,r=document.head,n=r.querySelector("script"),a=[];return c.forEach(t),e.isIOS&&u.forEach(t),a}},{"../../constants/":91,"../../utils":167}],105:[function(e,t,i){function r(e){var t=this;if(e.data)switch(e.data.type){case"vr":switch(e.data.data){case"enter":t.enterVR();break;case"exit":t.exitVR()}}}var n=e("../../utils/bind"),o=e("../../utils/").isIframed;t.exports=function(e){o()&&window.addEventListener("message",n(r,e))}},{"../../utils/":167,"../../utils/bind":161}],106:[function(e,t,i){t.exports=[]},{}],107:[function(e,t,i){var r=e("../../../vendor/wakelock/wakelock");t.exports=function(e){if(e.isMobile){var t=e.wakelock=new r;e.addEventListener("enter-vr",function(){t.request()}),e.addEventListener("exit-vr",function(){t.release()})}}},{"../../../vendor/wakelock/wakelock":177}],108:[function(e,t,i){function r(e){return"type"in e?"string"==typeof e.type:"default"in e}function n(e){var t,i=e.default,r=e.type;return e.type?"bool"===e.type?r="boolean":"float"===e.type&&(r="number"):r=void 0!==i&&["boolean","number"].indexOf(typeof i)!==-1?typeof i:Array.isArray(i)?"array":"string",t=c[r],t||u("Unknown property type: "+r),e.parse=e.parse||t.parse,e.stringify=e.stringify||t.stringify,e.type=r,"default"in e||(e.default=t.default),e}function o(e,t){return void 0!==e&&null!==e&&""!==e||(e=t.default),t.parse(e,t.default)}function a(e,t){return"object"!=typeof e?e:t&&null!==e?t.stringify(e):JSON.stringify(e)}var s=e("../utils/debug"),c=e("./propertyTypes").propertyTypes,u=s("core:schema:warn");t.exports.isSingleProperty=r,t.exports.process=function(e){return r(e)?n(e):(Object.keys(e).forEach(function(t){e[t]=n(e[t])}),e)},t.exports.processPropertyDefinition=n,t.exports.parseProperties=function(e,t,i,r,n){var a=Object.keys(i?e:t);return null===e||"object"!=typeof e?e:(Object.keys(e).forEach(function(e){t[e]||n||u("Unknown property `"+e+"` for component/system `"+r+"`.")}),a.forEach(function(i){var r=t[i],n=e[i];t[i]&&(e[i]=o(n,r))}),e)},t.exports.parseProperty=o,t.exports.stringifyProperties=function(e,t){var i={};return Object.keys(e).forEach(function(r){var n=t[r],o=e[r],s=o;"object"==typeof s&&(s=a(o,n),n||u("Unknown component property: "+r)),i[r]=s}),i},t.exports.stringifyProperty=a},{"../utils/debug":163,"./propertyTypes":102}],109:[function(e,t,i){var r=e("./schema"),n=r.process,o=t.exports.shaders={},a=t.exports.shaderNames=[],s=e("../lib/three"),c=e("../utils"),u={array:"v3",color:"v3",int:"i",number:"f",map:"t",time:"f",vec2:"v2",vec3:"v3",vec4:"v4"},l=t.exports.Shader=function(){};l.prototype={schema:{},vertexShader:"void main() {gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);}",fragmentShader:"void main() {gl_FragColor = vec4(1.0, 0.0, 1.0, 1.0);}",init:function(e){return this.attributes=this.initVariables(e,"attribute"),this.uniforms=this.initVariables(e,"uniform"),this.material=new(this.raw?s.RawShaderMaterial:s.ShaderMaterial)({uniforms:this.uniforms,vertexShader:this.vertexShader,fragmentShader:this.fragmentShader}),this.material},initVariables:function(e,t){var i={},r=this.schema;return Object.keys(r).forEach(function(e){if(r[e].is===t){var n=u[r[e].type];i[e]={type:n,value:void 0}}}),i},update:function(e){this.updateVariables(e,"attribute"),this.updateVariables(e,"uniform")},updateVariables:function(e,t){var i=this,r="uniform"===t?this.uniforms:this.attributes,n=this.schema;Object.keys(e).forEach(function(o){var a;if(n[o]&&n[o].is===t){if("map"===n[o].type){if(!r[o]||r[o].value===e[o])return;return a="_texture_"+o,i.el.addEventListener("materialtextureloaded",function(){r[o].value=i.material[a],r[o].needsUpdate=!0}),void c.material.updateMapMaterialFromData(a,o,i,e)}r[o].value=i.parseValue(n[o].type,e[o]),r[o].needsUpdate=!0}})},parseValue:function(e,t){var i;switch(e){case"vec2":return new s.Vector2(t.x,t.y);case"vec3":return new s.Vector3(t.x,t.y,t.z);case"vec4":return new s.Vector4(t.x,t.y,t.z,t.w);case"color":return i=new s.Color(t),new s.Vector3(i.r,i.g,i.b);default:return t}}},t.exports.registerShader=function(e,t){var i,r={};if(Object.keys(t).forEach(function(e){r[e]={value:t[e],writable:!0}}),o[e])throw new Error("The shader "+e+" has been already registered");return i=function(){l.call(this)},i.prototype=Object.create(l.prototype,r),i.prototype.name=e,i.prototype.constructor=i,o[e]={Shader:i,schema:n(i.prototype.schema)},a.push(e),i}},{"../lib/three":146,"../utils":167,"./schema":108}],110:[function(e,t,i){var r=e("./component"),n=e("./schema"),o=e("../utils/"),a=n.parseProperties,s=n.parseProperty,c=n.process,u=n.isSingleProperty,l=o.styleParser,h=t.exports.systems={},d=t.exports.System=function(e){var t,i=r&&r.components[this.name],n=this.schema;if(this.sceneEl=e,i&&(i.Component.prototype.system=this),Object.keys(n).length)return t=HTMLElement.prototype.getAttribute.call(e,this.name),u(n)?void(this.data=s(t,n)):void(this.data=a(l.parse(t)||{},n,!1,this.name))};d.prototype={schema:{},init:function(){},tick:void 0,play:function(){},pause:function(){}},t.exports.registerSystem=function(e,t){var i,r,n={},a=o.findAllScenes(document);if(Object.keys(t).forEach(function(e){n[e]={value:t[e],writable:!0}}),h[e])throw new Error("The system `"+e+"` has been already registered. Check that you are not loading two versions of the same system or two different systems of the same name.");for(r=function(e){d.call(this,e)},r.prototype=Object.create(d.prototype,n),r.prototype.name=e,r.prototype.constructor=r,r.prototype.schema=o.extend(c(r.prototype.schema)),h[e]=r,i=0;i<a.length;i++)a[i].initSystem(e)}},{"../utils/":167,"./component":100,"./schema":108}],111:[function(e,t,i){e("./pivot")},{"./pivot":112}],112:[function(e,t,i){var r=e("../../core/component").registerComponent,n=e("../../lib/three"),o=new n.Vector3,a=new n.Vector3;r("pivot",{dependencies:["position"],schema:{type:"vec3"},init:function(){var e=this.data,t=this.el,i=t.object3D.parent,r=t.object3D,s=new n.Group;o.copy(r.position),a.copy(r.rotation),i.remove(r),s.add(r),i.add(s),t.object3D=s,r.position.set(-1*e.x,-1*e.y,-1*e.z),s.position.set(e.x+o.x,e.y+o.y,e.z+o.z),s.rotation.copy(r.rotation),r.rotation.set(0,0,0)}})},{"../../core/component":100,"../../lib/three":146}],113:[function(e,t,i){function r(e){var t=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();"fog"===e&&(t="material-fog"),"visible"===e&&(t="material-visible"),s[t]="material."+e}var n=e("../../core/component").components,o=e("../../core/shader").shaders,a=e("../../utils/"),s={};Object.keys(n.material.schema).forEach(r),Object.keys(o.standard.schema).forEach(r),t.exports=function(){return{defaultComponents:{material:{}},mappings:a.extend({},s)}}},{"../../core/component":100,"../../core/shader":109,"../../utils/":167}],114:[function(e,t,i){e("./primitives/a-camera"),e("./primitives/a-collada-model"),e("./primitives/a-cursor"),e("./primitives/a-curvedimage"),e("./primitives/a-gltf-model"),e("./primitives/a-image"),e("./primitives/a-light"),e("./primitives/a-obj-model"),e("./primitives/a-sky"),e("./primitives/a-sound"),e("./primitives/a-text"),e("./primitives/a-video"),e("./primitives/a-videosphere"),e("./primitives/meshPrimitives")},{"./primitives/a-camera":116,"./primitives/a-collada-model":117,"./primitives/a-cursor":118,"./primitives/a-curvedimage":119,"./primitives/a-gltf-model":120,"./primitives/a-image":121,"./primitives/a-light":122,"./primitives/a-obj-model":123,"./primitives/a-sky":124,"./primitives/a-sound":125,"./primitives/a-text":126,"./primitives/a-video":127,"./primitives/a-videosphere":128,"./primitives/meshPrimitives":129}],115:[function(e,t,i){function r(e,t){var i=a[e].schema;Object.keys(i).map(function(i){var r=i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();void 0!==t[r]&&(r=e+"-"+i),t[r]=e+"."+i})}function n(e,i,n){n=n||{},Object.keys(i).map(function(e){r(e,n)}),t.exports.registerPrimitive(e,c.extendDeep({},null,{defaultComponents:i,mappings:n}))}var o=e("../../core/a-entity"),a=e("../../core/component").components,s=e("../../core/a-register-element").registerElement,c=e("../../utils/"),u=c.debug,l=c.entity.setComponentProperty,h=u("extras:primitives:debug"),d=u("extras:primitives:warn"),p=t.exports.primitives={};t.exports.registerPrimitive=function(e,t){e=e.toLowerCase(),h("Registering <%s>",e),t.defaultAttributes&&d("The 'defaultAttributes' object is deprecated. Use 'defaultComponents' instead.");var i=s(e,{prototype:Object.create(o.prototype,{defaultComponentsFromPrimitive:{value:t.defaultComponents||t.defaultAttributes||{}},deprecated:{value:t.deprecated||null},deprecatedMappings:{value:t.deprecatedMappings||{}},mappings:{value:t.mappings||{}},createdCallback:{value:function(){t.deprecated&&console.warn(t.deprecated),this.resolveMappingCollisions()}},resolveMappingCollisions:{value:function(){var e=this.mappings,t=this;Object.keys(e).forEach(function(i){var r;a[i]&&(r=e[i].replace(".","-"),e[r]=e[i],delete e[i],console.warn("The primitive "+t.tagName.toLowerCase()+" has a mapping collision. The attribute "+i+" has the same name as a registered component and has been renamed to "+r))})}},getExtraComponents:{value:function(){var e,t,i,r,n,o,a=this;for(t=c.clone(this.defaultComponentsFromPrimitive),n=this.getAttribute("mixin"),n&&(n=n.trim().split(" "),n.forEach(function(e){var i=a.sceneEl.querySelector("#"+e).componentCache;Object.keys(i).forEach(function(e){t[e]=c.extendDeep(t[e]||{},i[e])})})),i=0;i<this.attributes.length;i++)e=this.attributes[i],r=this.mappings[e.name],r&&(o=c.entity.getComponentPropertyPath(r),o.constructor===Array?t[o[0]][o[1]]=e.value:t[o]=e.value);return t}},attributeChangedCallback:{value:function(e,t,i){var r=this.mappings[e];e in this.deprecatedMappings&&console.warn(this.deprecatedMappings[e]),e&&r&&l(this,r,i)}}})});return p[e]=i,i},t.exports.definePrimitive=n},{"../../core/a-entity":96,"../../core/a-register-element":99,"../../core/component":100,"../../utils/":167}],116:[function(e,t,i){var r=e("../../../constants/").DEFAULT_CAMERA_HEIGHT,n=e("../primitives").registerPrimitive;n("a-camera",{defaultComponents:{camera:{userHeight:r},"look-controls":{},"wasd-controls":{}},mappings:{active:"camera.active",far:"camera.far",fov:"camera.fov","look-controls-enabled":"look-controls.enabled",near:"camera.near","wasd-controls-enabled":"wasd-controls.enabled","reverse-mouse-drag":"look-controls.reverseMouseDrag","user-height":"camera.userHeight",
  zoom:"camera.zoom"},deprecatedMappings:{"cursor-color":"a-camera[cursor-color] has been removed. Use a-cursor[color] instead.","cursor-maxdistance":"a-camera[cursor-maxdistance] has been removed. Use a-cursor[max-distance] instead.","cursor-offset":"a-camera[cursor-offset] has been removed. Use a-cursor[position] instead.","cursor-opacity":"a-camera[cursor-offset] has been removed. Use a-cursor[opacity] instead.","cursor-scale":"a-camera[cursor-scale] has been removed. Use a-cursor[scale] instead.","cursor-visible":"a-camera[cursor-visible] has been removed. Use a-cursor[visible] instead."}})},{"../../../constants/":91,"../primitives":115}],117:[function(e,t,i){var r=e("../primitives").registerPrimitive;r("a-collada-model",{mappings:{src:"collada-model"}})},{"../primitives":115}],118:[function(e,t,i){var r=e("../getMeshMixin"),n=e("../primitives").registerPrimitive,o=e("../../../utils/");n("a-cursor",o.extendDeep({},r(),{defaultComponents:{cursor:{},geometry:{primitive:"ring",radiusOuter:.016,radiusInner:.01,segmentsTheta:64},material:{color:"#000",shader:"flat",opacity:.8},position:{x:0,y:0,z:-1},raycaster:{far:1e3}},mappings:{far:"raycaster.far",fuse:"cursor.fuse",interval:"raycaster.interval",objects:"raycaster.objects","fuse-timeout":"cursor.fuseTimeout"}}))},{"../../../utils/":167,"../getMeshMixin":113,"../primitives":115}],119:[function(e,t,i){var r=e("../getMeshMixin"),n=e("../primitives").registerPrimitive,o=e("../../../utils/");n("a-curvedimage",o.extendDeep({},r(),{defaultComponents:{geometry:{height:1,primitive:"cylinder",radius:2,segmentsRadial:48,thetaLength:270,openEnded:!0,thetaStart:0},material:{color:"#FFF",shader:"flat",side:"double",transparent:!0,repeat:"-1 1"}},mappings:{height:"geometry.height","open-ended":"geometry.openEnded",radius:"geometry.radius",segments:"geometry.segmentsRadial",start:"geometry.thetaStart","theta-length":"geometry.thetaLength","theta-start":"geometry.thetaStart",width:"geometry.thetaLength"}}))},{"../../../utils/":167,"../getMeshMixin":113,"../primitives":115}],120:[function(e,t,i){var r=e("../primitives").registerPrimitive;r("a-gltf-model",{mappings:{src:"gltf-model"}})},{"../primitives":115}],121:[function(e,t,i){var r=e("../getMeshMixin"),n=e("../primitives").registerPrimitive,o=e("../../../utils/");n("a-image",o.extendDeep({},r(),{defaultComponents:{geometry:{primitive:"plane"},material:{color:"#FFF",shader:"flat",side:"double",transparent:!0}},mappings:{height:"geometry.height",width:"geometry.width"}}))},{"../../../utils/":167,"../getMeshMixin":113,"../primitives":115}],122:[function(e,t,i){var r=e("../primitives").registerPrimitive;r("a-light",{defaultComponents:{light:{}},mappings:{angle:"light.angle",color:"light.color","ground-color":"light.groundColor",decay:"light.decay",distance:"light.distance",intensity:"light.intensity",penumbra:"light.penumbra",type:"light.type",target:"light.target"}})},{"../primitives":115}],123:[function(e,t,i){var r=e("../getMeshMixin")(),n=e("../primitives").registerPrimitive,o=e("../../../utils/");n("a-obj-model",o.extendDeep({},r,{defaultComponents:{"obj-model":{}},mappings:{src:"obj-model.obj",mtl:"obj-model.mtl"}}))},{"../../../utils/":167,"../getMeshMixin":113,"../primitives":115}],124:[function(e,t,i){var r=e("../getMeshMixin"),n=e("../primitives").registerPrimitive,o=e("../../../utils/"),a=e("./meshPrimitives");n("a-sky",o.extendDeep({},r(),{defaultComponents:{geometry:{primitive:"sphere",radius:5e3,segmentsWidth:64,segmentsHeight:20},material:{color:"#FFF",shader:"flat"},scale:"-1 1 1"},mappings:o.extendDeep({},a["a-sphere"].prototype.mappings)}))},{"../../../utils/":167,"../getMeshMixin":113,"../primitives":115,"./meshPrimitives":129}],125:[function(e,t,i){var r=e("../primitives").registerPrimitive;r("a-sound",{defaultComponents:{sound:{}},mappings:{src:"sound.src",on:"sound.on",autoplay:"sound.autoplay",loop:"sound.loop",volume:"sound.volume"}})},{"../primitives":115}],126:[function(e,t,i){var r=e("../primitives").definePrimitive;r("a-text",{text:{anchor:"align",width:5}})},{"../primitives":115}],127:[function(e,t,i){var r=e("../getMeshMixin"),n=e("../primitives").registerPrimitive,o=e("../../../utils/");n("a-video",o.extendDeep({},r(),{defaultComponents:{geometry:{primitive:"plane"},material:{color:"#FFF",shader:"flat",side:"double",transparent:!0}},mappings:{height:"geometry.height",width:"geometry.width"}}))},{"../../../utils/":167,"../getMeshMixin":113,"../primitives":115}],128:[function(e,t,i){var r=e("../getMeshMixin"),n=e("../primitives").registerPrimitive,o=e("../../../utils/");n("a-videosphere",o.extendDeep({},r(),{defaultComponents:{geometry:{primitive:"sphere",radius:5e3,segmentsWidth:64,segmentsHeight:20},material:{color:"#FFF",shader:"flat"},scale:"-1 1 1"},mappings:{radius:"geometry.radius","segments-height":"geometry.segmentsHeight","segments-width":"geometry.segmentsWidth"}}))},{"../../../utils/":167,"../getMeshMixin":113,"../primitives":115}],129:[function(e,t,i){function r(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var n=e("../getMeshMixin"),o=e("../../../core/geometry").geometries,a=e("../../../core/geometry").geometryNames,s=e("../primitives").registerPrimitive,c=e("../../../utils/"),u=t.exports={};a.forEach(function(e){var t=o[e],i=r(e),a={};Object.keys(t.schema).forEach(function(e){a[r(e)]="geometry."+e});var l="a-"+i,h=s(l,c.extendDeep({},n(),{defaultComponents:{geometry:{primitive:e}},mappings:a}));u[l]=h})},{"../../../core/geometry":101,"../../../utils/":167,"../getMeshMixin":113,"../primitives":115}],130:[function(e,t,i){var r=e("../core/geometry").registerGeometry,n=e("../lib/three");r("box",{schema:{depth:{default:1,min:0},height:{default:1,min:0},width:{default:1,min:0},segmentsHeight:{default:1,min:1,max:20,type:"int"},segmentsWidth:{default:1,min:1,max:20,type:"int"},segmentsDepth:{default:1,min:1,max:20,type:"int"}},init:function(e){this.geometry=new n.BoxGeometry(e.width,e.height,e.depth)}})},{"../core/geometry":101,"../lib/three":146}],131:[function(e,t,i){var r=e("../core/geometry").registerGeometry,n=e("../lib/three"),o=n.Math.degToRad;r("circle",{schema:{radius:{default:1,min:0},segments:{default:32,min:3,type:"int"},thetaLength:{default:360,min:0},thetaStart:{default:0}},init:function(e){this.geometry=new n.CircleGeometry(e.radius,e.segments,o(e.thetaStart),o(e.thetaLength))}})},{"../core/geometry":101,"../lib/three":146}],132:[function(e,t,i){var r=e("../core/geometry").registerGeometry,n=e("../lib/three"),o=n.Math.degToRad;r("cone",{schema:{height:{default:1,min:0},openEnded:{default:!1},radiusBottom:{default:1,min:0},radiusTop:{default:.8,min:0},segmentsHeight:{default:18,min:1,type:"int"},segmentsRadial:{default:36,min:3,type:"int"},thetaLength:{default:360,min:0},thetaStart:{default:0}},init:function(e){this.geometry=new n.CylinderGeometry(e.radiusTop,e.radiusBottom,e.height,e.segmentsRadial,e.segmentsHeight,e.openEnded,o(e.thetaStart),o(e.thetaLength))}})},{"../core/geometry":101,"../lib/three":146}],133:[function(e,t,i){var r=e("../core/geometry").registerGeometry,n=e("../lib/three"),o=n.Math.degToRad;r("cylinder",{schema:{height:{default:1,min:0},openEnded:{default:!1},radius:{default:1,min:0},segmentsHeight:{default:18,min:1,type:"int"},segmentsRadial:{default:36,min:3,type:"int"},thetaLength:{default:360,min:0},thetaStart:{default:0}},init:function(e){this.geometry=new n.CylinderGeometry(e.radius,e.radius,e.height,e.segmentsRadial,e.segmentsHeight,e.openEnded,o(e.thetaStart),o(e.thetaLength))}})},{"../core/geometry":101,"../lib/three":146}],134:[function(e,t,i){var r=e("../core/geometry").registerGeometry,n=e("../lib/three");r("dodecahedron",{schema:{detail:{default:0,min:0,max:5,type:"int"},radius:{default:1,min:0}},init:function(e){this.geometry=new n.DodecahedronGeometry(e.radius,e.detail)}})},{"../core/geometry":101,"../lib/three":146}],135:[function(e,t,i){var r=e("../core/geometry").registerGeometry,n=e("../lib/three");r("icosahedron",{schema:{detail:{default:0,min:0,max:5,type:"int"},radius:{default:1,min:0}},init:function(e){this.geometry=new n.IcosahedronGeometry(e.radius,e.detail)}})},{"../core/geometry":101,"../lib/three":146}],136:[function(e,t,i){e("./box.js"),e("./circle.js"),e("./cone.js"),e("./cylinder.js"),e("./dodecahedron.js"),e("./icosahedron.js"),e("./octahedron.js"),e("./plane.js"),e("./ring.js"),e("./sphere.js"),e("./tetrahedron.js"),e("./torus.js"),e("./torusKnot.js")},{"./box.js":130,"./circle.js":131,"./cone.js":132,"./cylinder.js":133,"./dodecahedron.js":134,"./icosahedron.js":135,"./octahedron.js":137,"./plane.js":138,"./ring.js":139,"./sphere.js":140,"./tetrahedron.js":141,"./torus.js":142,"./torusKnot.js":143}],137:[function(e,t,i){var r=e("../core/geometry").registerGeometry,n=e("../lib/three");r("octahedron",{schema:{detail:{default:0,min:0,max:5,type:"int"},radius:{default:1,min:0}},init:function(e){this.geometry=new n.OctahedronGeometry(e.radius,e.detail)}})},{"../core/geometry":101,"../lib/three":146}],138:[function(e,t,i){var r=e("../core/geometry").registerGeometry,n=e("../lib/three");r("plane",{schema:{height:{default:1,min:0},width:{default:1,min:0},segmentsHeight:{default:1,min:1,max:20,type:"int"},segmentsWidth:{default:1,min:1,max:20,type:"int"}},init:function(e){this.geometry=new n.PlaneGeometry(e.width,e.height)}})},{"../core/geometry":101,"../lib/three":146}],139:[function(e,t,i){var r=e("../core/geometry").registerGeometry,n=e("../lib/three"),o=n.Math.degToRad;r("ring",{schema:{radiusInner:{default:.8,min:0},radiusOuter:{default:1.2,min:0},segmentsPhi:{default:10,min:1,type:"int"},segmentsTheta:{default:32,min:3,type:"int"},thetaLength:{default:360,min:0},thetaStart:{default:0}},init:function(e){this.geometry=new n.RingGeometry(e.radiusInner,e.radiusOuter,e.segmentsTheta,e.segmentsPhi,o(e.thetaStart),o(e.thetaLength))}})},{"../core/geometry":101,"../lib/three":146}],140:[function(e,t,i){var r=e("../core/geometry").registerGeometry,n=e("../lib/three"),o=n.Math.degToRad;r("sphere",{schema:{radius:{default:1,min:0},phiLength:{default:360},phiStart:{default:0,min:0},thetaLength:{default:180,min:0},thetaStart:{default:0},segmentsHeight:{default:18,min:2,type:"int"},segmentsWidth:{default:36,min:3,type:"int"}},init:function(e){this.geometry=new n.SphereGeometry(e.radius,e.segmentsWidth,e.segmentsHeight,o(e.phiStart),o(e.phiLength),o(e.thetaStart),o(e.thetaLength))}})},{"../core/geometry":101,"../lib/three":146}],141:[function(e,t,i){var r=e("../core/geometry").registerGeometry,n=e("../lib/three");r("tetrahedron",{schema:{detail:{default:0,min:0,max:5,type:"int"},radius:{default:1,min:0}},init:function(e){this.geometry=new n.TetrahedronGeometry(e.radius,e.detail)}})},{"../core/geometry":101,"../lib/three":146}],142:[function(e,t,i){var r=e("../core/geometry").registerGeometry,n=e("../lib/three"),o=n.Math.degToRad;r("torus",{schema:{arc:{default:360},radius:{default:1,min:0},radiusTubular:{default:.2,min:0},segmentsRadial:{default:36,min:2,type:"int"},segmentsTubular:{default:32,min:3,type:"int"}},init:function(e){this.geometry=new n.TorusGeometry(e.radius,2*e.radiusTubular,e.segmentsRadial,e.segmentsTubular,o(e.arc))}})},{"../core/geometry":101,"../lib/three":146}],143:[function(e,t,i){var r=e("../core/geometry").registerGeometry,n=e("../lib/three");r("torusKnot",{schema:{p:{default:2,min:1},q:{default:3,min:1},radius:{default:1,min:0},radiusTubular:{default:.2,min:0},segmentsRadial:{default:8,min:3,type:"int"},segmentsTubular:{default:100,min:3,type:"int"}},init:function(e){this.geometry=new n.TorusKnotGeometry(e.radius,2*e.radiusTubular,e.segmentsTubular,e.segmentsRadial,e.p,e.q)}})},{"../core/geometry":101,"../lib/three":146}],144:[function(e,t,i){var r=e("./utils/"),n=r.debug,o=n("A-Frame:warn");document.currentScript&&document.currentScript.parentNode!==document.head&&!window.debug&&o("Put the A-Frame <script> tag in the <head> of the HTML *before* the scene to ensure everything for A-Frame is properly registered before they are used from HTML."),window.Promise=window.Promise||e("promise-polyfill"),window.hasNativeWebVRImplementation=!!navigator.getVRDisplays||!!navigator.getVRDevices,window.WebVRConfig=window.WebVRConfig||{BUFFER_SCALE:1,CARDBOARD_UI_DISABLED:!0,ROTATE_INSTRUCTIONS_DISABLED:!0,TOUCH_PANNER_DISABLED:!0,MOUSE_KEYBOARD_CONTROLS_DISABLED:!0},r.device.isIOSOlderThan10(navigator.userAgent)&&(window.WebVRConfig.BUFFER_SCALE=1/window.devicePixelRatio),e("webvr-polyfill"),e("present"),e("./style/aframe.css"),e("./style/rStats.css");var a=e("./core/scene/a-scene"),s=e("./core/component").components,c=e("./core/component").registerComponent,u=e("./core/geometry").registerGeometry,l=e("./extras/primitives/primitives").registerPrimitive,h=e("./core/shader").registerShader,d=e("./core/system").registerSystem,p=e("./core/shader").shaders,f=e("./core/system").systems,m=window.THREE=e("./lib/three"),g=window.TWEEN=e("tween.js"),v=e("../package");e("./components/index"),e("./geometries/index"),e("./shaders/index"),e("./systems/index");var y=e("./core/a-node"),M=e("./core/a-entity");e("./core/a-animation"),e("./core/a-assets"),e("./core/a-cubemap"),e("./core/a-mixin"),e("./extras/components/"),e("./extras/primitives/"),console.log("A-Frame Version: 0.5.0 (Date 10-02-2017, Commit #bf8b8f9)"),console.log("three Version:",v.dependencies.three),console.log("WebVR Polyfill Version:",v.dependencies["webvr-polyfill"]),t.exports=window.AFRAME={AComponent:e("./core/component").Component,AEntity:M,ANode:y,AScene:a,components:s,geometries:e("./core/geometry").geometries,registerComponent:c,registerElement:e("./core/a-register-element").registerElement,registerGeometry:u,registerPrimitive:l,registerShader:h,registerSystem:d,primitives:{getMeshMixin:e("./extras/primitives/getMeshMixin"),primitives:e("./extras/primitives/primitives").primitives},scenes:e("./core/scene/scenes"),schema:e("./core/schema"),shaders:p,systems:f,THREE:m,TWEEN:g,utils:r,version:v.version}},{"../package":55,"./components/index":63,"./core/a-animation":93,"./core/a-assets":94,"./core/a-cubemap":95,"./core/a-entity":96,"./core/a-mixin":97,"./core/a-node":98,"./core/a-register-element":99,"./core/component":100,"./core/geometry":101,"./core/scene/a-scene":103,"./core/scene/scenes":106,"./core/schema":108,"./core/shader":109,"./core/system":110,"./extras/components/":111,"./extras/primitives/":114,"./extras/primitives/getMeshMixin":113,"./extras/primitives/primitives":115,"./geometries/index":136,"./lib/three":146,"./shaders/index":148,"./style/aframe.css":152,"./style/rStats.css":153,"./systems/index":157,"./utils/":167,present:34,"promise-polyfill":35,"tween.js":49,"webvr-polyfill":50}],145:[function(e,t,i){window.aframeStats=function(e){function t(){a("te").set(i()),window.performance.getEntriesByName&&a("lt").set(window.performance.getEntriesByName("render-started")[0].startTime.toFixed(0))}function i(){var e=s.querySelectorAll("*");return Array.prototype.slice.call(e).filter(function(e){return e.isEntity}),e.length}function r(){}function n(){}function o(e){a=e}var a=null,s=e,c={te:{caption:"Entities"},lt:{caption:"Load Time"}},u=[{caption:"A-Frame",values:["te","lt"]}];return{update:t,start:r,end:n,attach:o,values:c,groups:u,fractions:[]}},"object"==typeof t&&(t.exports={aframeStats:window.aframeStats})},{}],146:[function(e,t,r){(function(i){var r=i.THREE=e("three");r.TextureLoader&&(r.TextureLoader.prototype.crossOrigin="anonymous"),r.ImageLoader&&(r.ImageLoader.prototype.crossOrigin="anonymous"),r.Cache&&(r.Cache.enabled=!0),e("three/examples/js/loaders/GLTFLoader"),e("three/examples/js/loaders/OBJLoader"),e("three/examples/js/loaders/MTLLoader"),e("three/examples/js/BlendCharacter"),e("three/examples/js/loaders/ColladaLoader"),e("../../vendor/VRControls"),e("../../vendor/VREffect"),r.ColladaLoader.prototype.crossOrigin="anonymous",r.GLTFLoader.prototype.crossOrigin="anonymous",r.MTLLoader.prototype.crossOrigin="anonymous",r.OBJLoader.prototype.crossOrigin="anonymous",t.exports=r}).call(this,"undefined"!=typeof i?i:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../vendor/VRControls":172,"../../vendor/VREffect":173,three:42,"three/examples/js/BlendCharacter":43,"three/examples/js/loaders/ColladaLoader":44,"three/examples/js/loaders/GLTFLoader":45,"three/examples/js/loaders/MTLLoader":46,"three/examples/js/loaders/OBJLoader":47}],147:[function(e,t,i){function r(e){return{fog:e.fog,color:new o.Color(e.color),wireframe:e.wireframe,wireframeLinewidth:e.wireframeLinewidth}}var n=e("../core/shader").registerShader,o=e("../lib/three"),a=e("../utils/");t.exports.Shader=n("flat",{schema:{color:{type:"color"},fog:{default:!0},height:{default:256},offset:{type:"vec2",default:{x:0,y:0}},repeat:{type:"vec2",default:{x:1,y:1}},src:{type:"map"},width:{default:512},wireframe:{default:!1},wireframeLinewidth:{default:2}},init:function(e){this.textureSrc=null,this.material=new o.MeshBasicMaterial(r(e)),a.material.updateMap(this,e)},update:function(e){this.updateMaterial(e),a.material.updateMap(this,e)},updateMaterial:function(e){var t=this.material;e=r(e),Object.keys(e).forEach(function(i){t[i]=e[i]})}})},{"../core/shader":109,"../lib/three":146,"../utils/":167}],148:[function(e,t,i){e("./flat"),e("./standard"),e("./sdf"),e("./msdf")},{"./flat":147,"./msdf":149,"./sdf":150,"./standard":151}],149:[function(e,t,i){var r=e("../core/shader").registerShader;t.exports.Shader=r("msdf",{schema:{alphaTest:{type:"number",is:"uniform",default:.5},color:{type:"color",is:"uniform",default:"white"},map:{type:"map",is:"uniform"},opacity:{type:"number",is:"uniform",default:1}},raw:!0,vertexShader:["attribute vec2 uv;","attribute vec3 position;","uniform mat4 projectionMatrix;","uniform mat4 modelViewMatrix;","varying vec2 vUV;","void main(void) {","  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","  vUV = uv;","}"].join("\n"),fragmentShader:["#ifdef GL_OES_standard_derivatives","#extension GL_OES_standard_derivatives: enable","#endif","precision highp float;","#define BIG_ENOUGH 0.001","#define MODIFIED_ALPHATEST (0.02 * isBigEnough / BIG_ENOUGH)","#define ALL_SMOOTH 0.4","#define ALL_ROUGH 0.02","#define DISCARD_ALPHA (alphaTest / (2.2 - 1.2 * ratio))","uniform sampler2D map;","uniform vec3 color;","uniform float opacity;","uniform float alphaTest;","varying vec2 vUV;","float median(float r, float g, float b) {","  return max(min(r, g), min(max(r, g), b));","}","void main() {","  vec3 sample = 1.0 - texture2D(map, vUV).rgb;","  float sigDist = median(sample.r, sample.g, sample.b) - 0.5;","  float alpha = clamp(sigDist/fwidth(sigDist) + 0.5, 0.0, 1.0);","  float dscale = 0.353505;","  vec2 duv = dscale * (dFdx(vUV) + dFdy(vUV));","  float isBigEnough = max(abs(duv.x), abs(duv.y));","  if (isBigEnough > BIG_ENOUGH) {","    float ratio = BIG_ENOUGH / isBigEnough;","    alpha = ratio * alpha + (1.0 - ratio) * (sigDist + 0.5);","  }","  gl_FragColor = vec4(color.xyz, alpha * opacity);","  if (isBigEnough <= BIG_ENOUGH && gl_FragColor.a < alphaTest) { discard; return; }","  if (gl_FragColor.a < alphaTest * MODIFIED_ALPHATEST) { discard; return; }","}"].join("\n")})},{"../core/shader":109}],150:[function(e,t,i){var r=e("../core/shader").registerShader;t.exports.Shader=r("sdf",{schema:{alphaTest:{type:"number",is:"uniform",default:.5},color:{type:"color",is:"uniform",default:"white"},map:{type:"map",is:"uniform"},opacity:{type:"number",is:"uniform",default:1}},raw:!0,vertexShader:["attribute vec2 uv;","attribute vec3 position;","uniform mat4 projectionMatrix;","uniform mat4 modelViewMatrix;","varying vec2 vUV;","void main(void) {","  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","  vUV = uv;","}"].join("\n"),fragmentShader:["#ifdef GL_OES_standard_derivatives","#extension GL_OES_standard_derivatives: enable","#endif","precision highp float;","#define BIG_ENOUGH 0.001","#define MODIFIED_ALPHATEST (0.02 * isBigEnough / BIG_ENOUGH)","#define ALL_SMOOTH 0.4","#define ALL_ROUGH 0.02","#define DISCARD_ALPHA (alphaTest / (2.2 - 1.2 * ratio))","uniform sampler2D map;","uniform vec3 color;","uniform float opacity;","uniform float alphaTest;","varying vec2 vUV;","#ifdef GL_OES_standard_derivatives","float contour(float width, float value) {","  return smoothstep(0.5 - value, 0.5 + value, width);","}","#else","float aastep(float value, float afwidth) {","  return smoothstep(0.5 - afwidth, 0.5 + afwidth, value);","}","#endif","void main() {","#ifdef GL_OES_standard_derivatives","  vec2 uv = vUV;","  vec4 texColor = texture2D(map, uv);","  float dist = texColor.a;","  float width = fwidth(dist);","  float alpha = contour(dist, width);","  float dscale = 0.353505;","  vec2 duv = dscale * (dFdx(uv) + dFdy(uv));","  float isBigEnough = max(abs(duv.x), abs(duv.y));","  if (isBigEnough > BIG_ENOUGH) {","    float ratio = BIG_ENOUGH / isBigEnough;","    alpha = ratio * alpha + (1.0 - ratio) * dist;","  }","  else if (isBigEnough <= BIG_ENOUGH) {","    vec4 box = vec4 (uv - duv, uv + duv);","    alpha = (alpha + 0.5 * (","      contour(texture2D(map, box.xy).a, width)","      + contour(texture2D(map, box.zw).a, width)","      + contour(texture2D(map, box.xw).a, width)","      + contour(texture2D(map, box.zy).a, width)","    )) / 3.0;","  }","  if (isBigEnough <= BIG_ENOUGH && alpha < alphaTest) { discard; return; }","  if (alpha < alphaTest * MODIFIED_ALPHATEST) { discard; return; }","#else","  vec4 texColor = texture2D(map, vUV);","  float value = texColor.a;","  float afwidth = (1.0 / 32.0) * (1.4142135623730951 / (2.0 * gl_FragCoord.w));","  float alpha = aastep(value, afwidth);","  float ratio = (gl_FragCoord.w >= ALL_SMOOTH) ? 1.0 : (gl_FragCoord.w < ALL_ROUGH) ? 0.0 : (gl_FragCoord.w - ALL_ROUGH) / (ALL_SMOOTH - ALL_ROUGH);","  if (alpha < alphaTest) { if (ratio >= 1.0) { discard; return; } alpha = 0.0; }","  alpha = alpha * ratio + (1.0 - ratio) * value;","  if (ratio < 1.0)","    if (alpha <= DISCARD_ALPHA) { discard; return; }","#endif","  gl_FragColor = vec4(color, opacity * alpha);","}"].join("\n")})},{"../core/shader":109}],151:[function(e,t,i){function r(e){var t={color:new o.Color(e.color),fog:e.fog,metalness:e.metalness,roughness:e.roughness,wireframe:e.wireframe,wireframeLinewidth:e.wireframeLinewidth};return e.normalMap&&(t.normalScale=e.normalScale),e.ambientOcclusionMap&&(t.aoMapIntensity=e.ambientOcclusionMapIntensity),e.displacementMap&&(t.displacementScale=e.displacementScale,t.displacementBias=e.displacementBias),t}var n=e("../core/shader").registerShader,o=e("../lib/three"),a=e("../utils/"),s=new o.CubeTextureLoader,c={};t.exports.Shader=n("standard",{schema:{ambientOcclusionMap:{type:"map"},ambientOcclusionMapIntensity:{default:1},ambientOcclusionTextureOffset:{type:"vec2"},ambientOcclusionTextureRepeat:{type:"vec2",default:{x:1,y:1}},color:{type:"color"},displacementMap:{type:"map"},displacementScale:{default:1},displacementBias:{default:.5},displacementTextureOffset:{type:"vec2"},displacementTextureRepeat:{type:"vec2",default:{x:1,y:1}},envMap:{default:""},fog:{default:!0},height:{default:256},metalness:{default:0,min:0,max:1},normalMap:{type:"map"},normalScale:{type:"vec2",default:"1 1"},normalTextureOffset:{type:"vec2"},normalTextureRepeat:{type:"vec2",default:{x:1,y:1}},offset:{type:"vec2",default:{x:0,y:0}},repeat:{type:"vec2",default:{x:1,y:1}},roughness:{default:.5,min:0,max:1},sphericalEnvMap:{type:"map"},src:{type:"map"},width:{default:512},wireframe:{default:!1},wireframeLinewidth:{default:2}},init:function(e){this.material=new o.MeshStandardMaterial(r(e)),a.material.updateMap(this,e),e.normalMap&&a.material.updateDistortionMap("normal",this,e),e.displacementMap&&a.material.updateDistortionMap("displacement",this,e),e.ambientOcclusionMap&&a.material.updateDistortionMap("ambientOcclusion",this,e),this.updateEnvMap(e)},update:function(e){this.updateMaterial(e),a.material.updateMap(this,e),e.normalMap&&a.material.updateDistortionMap("normal",this,e),e.displacementMap&&a.material.updateDistortionMap("displacement",this,e),e.ambientOcclusionMap&&a.material.updateDistortionMap("ambientOcclusion",this,e),this.updateEnvMap(e)},updateMaterial:function(e){var t=this.material;e=r(e),Object.keys(e).forEach(function(i){t[i]=e[i]})},updateEnvMap:function(e){var t=this,i=this.material,r=e.envMap,n=e.sphericalEnvMap;return!r&&!n||this.isLoadingEnvMap?(i.envMap=null,void(i.needsUpdate=!0)):(this.isLoadingEnvMap=!0,n?void this.el.sceneEl.systems.material.loadTexture(n,{src:n},function(e){t.isLoadingEnvMap=!1,e.mapping=o.SphericalReflectionMapping,i.envMap=e,a.material.handleTextureEvents(t.el,e),i.needsUpdate=!0}):c[r]?void c[r].then(function(e){t.isLoadingEnvMap=!1,i.envMap=e,a.material.handleTextureEvents(t.el,e),i.needsUpdate=!0}):void(c[r]=new Promise(function(e){a.srcLoader.validateCubemapSrc(r,function(r){s.load(r,function(r){t.isLoadingEnvMap=!1,i.envMap=r,a.material.handleTextureEvents(t.el,r),e(r)})})})))}})},{"../core/shader":109,"../lib/three":146,"../utils/":167}],152:[function(e,t,i){var r=".a-html{bottom:0;left:0;position:fixed;right:0;top:0}.a-body{height:100%;margin:0;overflow:hidden;padding:0;width:100%}:-webkit-full-screen{background-color:transparent}.a-hidden{display:none!important}.a-canvas{height:100%;left:0;position:absolute;top:0;width:100%}.a-canvas.a-grab-cursor:hover{cursor:grab;cursor:-moz-grabbing;cursor:-webkit-grab}.a-canvas.a-grab-cursor:active,.a-grabbing{cursor:grabbing;cursor:-moz-grabbing;cursor:-webkit-grabbing}// Class is removed when doing <a-scene embedded>. a-scene.fullscreen .a-canvas{width:100%!important;height:100%!important;top:0!important;left:0!important;right:0!important;bottom:0!important;z-index:999999!important;position:fixed!important}.a-inspector-loader{background-color:#ed3160;position:fixed;left:3px;top:3px;padding:6px 10px;color:#fff;text-decoration:none;font-size:12px;font-family:Roboto,sans-serif;text-align:center;z-index:99999;width:174px}@keyframes dots-1{from{opacity:0}25%{opacity:1}}@keyframes dots-2{from{opacity:0}50%{opacity:1}}@keyframes dots-3{from{opacity:0}75%{opacity:1}}@-webkit-keyframes dots-1{from{opacity:0}25%{opacity:1}}@-webkit-keyframes dots-2{from{opacity:0}50%{opacity:1}}@-webkit-keyframes dots-3{from{opacity:0}75%{opacity:1}}.a-inspector-loader .dots span{animation:dots-1 2s infinite steps(1);-webkit-animation:dots-1 2s infinite steps(1)}.a-inspector-loader .dots span:first-child+span{animation-name:dots-2;-webkit-animation-name:dots-2}.a-inspector-loader .dots span:first-child+span+span{animation-name:dots-3;-webkit-animation-name:dots-3}a-scene{display:block;position:relative;height:100%;width:100%}a-assets,a-scene audio,a-scene img,a-scene video{display:none}.a-enter-vr-modal,.a-orientation-modal{font-family:Consolas,Andale Mono,Courier New,monospace}.a-enter-vr-modal a{border-bottom:1px solid #fff;padding:2px 0;text-decoration:none;transition:.1s color ease-in}.a-enter-vr-modal a:hover{background-color:#fff;color:#111;padding:2px 4px;position:relative;left:-4px}.a-enter-vr{font-family:sans-serif,monospace;font-size:13px;width:100%;font-weight:200;line-height:16px;height:10%;position:absolute;right:20px;bottom:20px}.a-enter-vr.embedded{right:5px;bottom:5px}.a-enter-vr-button,.a-enter-vr-modal,.a-enter-vr-modal a{color:#fff}.a-enter-vr-button{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20245.82%20141.73%22%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill%3A%23fff%3Bfill-rule%3Aevenodd%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Emask%3C%2Ftitle%3E%3Cpath%20class%3D%22a%22%20d%3D%22M175.56%2C111.37c-22.52%2C0-40.77-18.84-40.77-42.07S153%2C27.24%2C175.56%2C27.24s40.77%2C18.84%2C40.77%2C42.07S198.08%2C111.37%2C175.56%2C111.37ZM26.84%2C69.31c0-23.23%2C18.25-42.07%2C40.77-42.07s40.77%2C18.84%2C40.77%2C42.07-18.26%2C42.07-40.77%2C42.07S26.84%2C92.54%2C26.84%2C69.31ZM27.27%2C0C11.54%2C0%2C0%2C12.34%2C0%2C28.58V110.9c0%2C16.24%2C11.54%2C30.83%2C27.27%2C30.83H99.57c2.17%2C0%2C4.19-1.83%2C5.4-3.7L116.47%2C118a8%2C8%2C0%2C0%2C1%2C12.52-.18l11.51%2C20.34c1.2%2C1.86%2C3.22%2C3.61%2C5.39%2C3.61h72.29c15.74%2C0%2C27.63-14.6%2C27.63-30.83V28.58C245.82%2C12.34%2C233.93%2C0%2C218.19%2C0H27.27Z%22%2F%3E%3C%2Fsvg%3E) 50% 50%/70% 70% no-repeat rgba(0,0,0,.35);border:0;bottom:0;cursor:pointer;min-width:50px;min-height:30px;padding-right:5%;padding-top:4%;position:absolute;right:0;transition:background-color .05s ease;-webkit-transition:background-color .05s ease;z-index:9999}.a-enter-vr-button:active,.a-enter-vr-button:hover{background-color:#666}[data-a-enter-vr-no-webvr] .a-enter-vr-button{border-color:#666;opacity:.65}[data-a-enter-vr-no-webvr] .a-enter-vr-button:active,[data-a-enter-vr-no-webvr] .a-enter-vr-button:hover{background-color:rgba(0,0,0,.35);cursor:not-allowed}.a-enter-vr-modal{background-color:#666;border-radius:0;display:none;min-height:32px;margin-right:70px;padding:9px;width:280px;right:2%;position:absolute}.a-enter-vr-modal:after{border-bottom:10px solid transparent;border-left:10px solid #666;border-top:10px solid transparent;display:inline-block;content:'';position:absolute;right:-5px;top:5px;width:0;height:0}.a-enter-vr-modal a,.a-enter-vr-modal p{display:inline}.a-enter-vr-modal p{margin:0}.a-enter-vr-modal p:after{content:' '}[data-a-enter-vr-no-headset].a-enter-vr:hover .a-enter-vr-modal,[data-a-enter-vr-no-webvr].a-enter-vr:hover .a-enter-vr-modal{display:block}.a-orientation-modal{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20version%3D%221.1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%2090%2090%22%20enable-background%3D%22new%200%200%2090%2090%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%220%2C0%200%2C0%200%2C0%20%22%3E%3C/polygon%3E%3Cg%3E%3Cpath%20d%3D%22M71.545%2C48.145h-31.98V20.743c0-2.627-2.138-4.765-4.765-4.765H18.456c-2.628%2C0-4.767%2C2.138-4.767%2C4.765v42.789%20%20%20c0%2C2.628%2C2.138%2C4.766%2C4.767%2C4.766h5.535v0.959c0%2C2.628%2C2.138%2C4.765%2C4.766%2C4.765h42.788c2.628%2C0%2C4.766-2.137%2C4.766-4.765V52.914%20%20%20C76.311%2C50.284%2C74.173%2C48.145%2C71.545%2C48.145z%20M18.455%2C16.935h16.344c2.1%2C0%2C3.808%2C1.708%2C3.808%2C3.808v27.401H37.25V22.636%20%20%20c0-0.264-0.215-0.478-0.479-0.478H16.482c-0.264%2C0-0.479%2C0.214-0.479%2C0.478v36.585c0%2C0.264%2C0.215%2C0.478%2C0.479%2C0.478h7.507v7.644%20%20%20h-5.534c-2.101%2C0-3.81-1.709-3.81-3.81V20.743C14.645%2C18.643%2C16.354%2C16.935%2C18.455%2C16.935z%20M16.96%2C23.116h19.331v25.031h-7.535%20%20%20c-2.628%2C0-4.766%2C2.139-4.766%2C4.768v5.828h-7.03V23.116z%20M71.545%2C73.064H28.757c-2.101%2C0-3.81-1.708-3.81-3.808V52.914%20%20%20c0-2.102%2C1.709-3.812%2C3.81-3.812h42.788c2.1%2C0%2C3.809%2C1.71%2C3.809%2C3.812v16.343C75.354%2C71.356%2C73.645%2C73.064%2C71.545%2C73.064z%22%3E%3C/path%3E%3Cpath%20d%3D%22M28.919%2C58.424c-1.466%2C0-2.659%2C1.193-2.659%2C2.66c0%2C1.466%2C1.193%2C2.658%2C2.659%2C2.658c1.468%2C0%2C2.662-1.192%2C2.662-2.658%20%20%20C31.581%2C59.617%2C30.387%2C58.424%2C28.919%2C58.424z%20M28.919%2C62.786c-0.939%2C0-1.703-0.764-1.703-1.702c0-0.939%2C0.764-1.704%2C1.703-1.704%20%20%20c0.94%2C0%2C1.705%2C0.765%2C1.705%2C1.704C30.623%2C62.022%2C29.858%2C62.786%2C28.919%2C62.786z%22%3E%3C/path%3E%3Cpath%20d%3D%22M69.654%2C50.461H33.069c-0.264%2C0-0.479%2C0.215-0.479%2C0.479v20.288c0%2C0.264%2C0.215%2C0.478%2C0.479%2C0.478h36.585%20%20%20c0.263%2C0%2C0.477-0.214%2C0.477-0.478V50.939C70.131%2C50.676%2C69.917%2C50.461%2C69.654%2C50.461z%20M69.174%2C51.417V70.75H33.548V51.417H69.174z%22%3E%3C/path%3E%3Cpath%20d%3D%22M45.201%2C30.296c6.651%2C0%2C12.233%2C5.351%2C12.551%2C11.977l-3.033-2.638c-0.193-0.165-0.507-0.142-0.675%2C0.048%20%20%20c-0.174%2C0.198-0.153%2C0.501%2C0.045%2C0.676l3.883%2C3.375c0.09%2C0.075%2C0.198%2C0.115%2C0.312%2C0.115c0.141%2C0%2C0.273-0.061%2C0.362-0.166%20%20%20l3.371-3.877c0.173-0.2%2C0.151-0.502-0.047-0.675c-0.194-0.166-0.508-0.144-0.676%2C0.048l-2.592%2C2.979%20%20%20c-0.18-3.417-1.629-6.605-4.099-9.001c-2.538-2.461-5.877-3.817-9.404-3.817c-0.264%2C0-0.479%2C0.215-0.479%2C0.479%20%20%20C44.72%2C30.083%2C44.936%2C30.296%2C45.201%2C30.296z%22%3E%3C/path%3E%3C/g%3E%3C/svg%3E) center/50% 50% no-repeat rgba(244,244,244,1);bottom:0;font-size:14px;font-weight:600;left:0;line-height:20px;right:0;position:fixed;top:0;z-index:9999999}.a-orientation-modal:after{color:#666;content:\"Insert phone into Cardboard holder.\";display:block;position:absolute;text-align:center;top:70%;transform:translateY(-70%);width:100%}.a-orientation-modal button{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20version%3D%221.1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20100%20100%22%20enable-background%3D%22new%200%200%20100%20100%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23000000%22%20d%3D%22M55.209%2C50l17.803-17.803c1.416-1.416%2C1.416-3.713%2C0-5.129c-1.416-1.417-3.713-1.417-5.129%2C0L50.08%2C44.872%20%20L32.278%2C27.069c-1.416-1.417-3.714-1.417-5.129%2C0c-1.417%2C1.416-1.417%2C3.713%2C0%2C5.129L44.951%2C50L27.149%2C67.803%20%20c-1.417%2C1.416-1.417%2C3.713%2C0%2C5.129c0.708%2C0.708%2C1.636%2C1.062%2C2.564%2C1.062c0.928%2C0%2C1.856-0.354%2C2.564-1.062L50.08%2C55.13l17.803%2C17.802%20%20c0.708%2C0.708%2C1.637%2C1.062%2C2.564%2C1.062s1.856-0.354%2C2.564-1.062c1.416-1.416%2C1.416-3.713%2C0-5.129L55.209%2C50z%22%3E%3C/path%3E%3C/svg%3E) no-repeat;border:none;height:50px;text-indent:-9999px;width:50px}";
  e("browserify-css").createStyle(r,{href:"src/style/aframe.css"}),t.exports=r},{"browserify-css":3}],153:[function(e,t,i){var r=".rs-base{background-color:#333;color:#fafafa;border-radius:0;font:10px monospace;left:5px;line-height:1em;opacity:.85;overflow:hidden;padding:10px;position:fixed;top:5px;width:300px;z-index:10000}.rs-base div.hidden{display:none}.rs-base h1{color:#fff;cursor:pointer;font-size:1.4em;font-weight:300;margin:0 0 5px;padding:0}.rs-group{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column-reverse;flex-direction:column-reverse;margin-bottom:5px}.rs-group:last-child{margin-bottom:0}.rs-counter-base{align-items:center;display:-webkit-box;display:-webkit-flex;display:flex;height:10px;-webkit-justify-content:space-between;justify-content:space-between;margin:2px 0}.rs-counter-base.alarm{color:#b70000;text-shadow:0 0 0 #b70000,0 0 1px #fff,0 0 1px #fff,0 0 2px #fff,0 0 2px #fff,0 0 3px #fff,0 0 3px #fff,0 0 4px #fff,0 0 4px #fff}.rs-counter-id{font-weight:300;-webkit-box-ordinal-group:0;-webkit-order:0;order:0;width:54px}.rs-counter-value{font-weight:300;-webkit-box-ordinal-group:1;-webkit-order:1;order:1;text-align:right;width:35px}.rs-canvas{-webkit-box-ordinal-group:2;-webkit-order:2;order:2}@media (min-width:480px){.rs-base{left:20px;top:20px}}";e("browserify-css").createStyle(r,{href:"src/style/rStats.css"}),t.exports=r},{"browserify-css":3}],154:[function(e,t,i){function r(e){var t,i=e.camera;i&&(t=e.querySelector("["+s+"]"),t&&e.removeChild(t))}var n=e("../utils/bind"),o=e("../constants/"),a=e("../core/system").registerSystem,s="data-aframe-default-camera";t.exports.System=a("camera",{init:function(){this.activeCameraEl=null,this.sceneEl.addEventListener("loaded",n(this.setupDefaultCamera,this))},setupDefaultCamera:function(){var e,t=this.sceneEl;return t.camera?void t.emit("camera-ready",{cameraEl:t.camera.el}):(e=document.createElement("a-entity"),e.setAttribute("position","0 0 0"),e.setAttribute(s,""),e.setAttribute("camera",{active:!0,userHeight:o.DEFAULT_CAMERA_HEIGHT}),e.setAttribute("wasd-controls",""),e.setAttribute("look-controls",""),e.setAttribute(o.AFRAME_INJECTED,""),t.appendChild(e),t.addEventListener("enter-vr",this.removeDefaultOffset),t.addEventListener("exit-vr",this.addDefaultOffset),void t.emit("camera-ready",{cameraEl:e}))},disableActiveCamera:function(){var e=this.sceneEl.querySelectorAll("[camera]"),t=e[e.length-1];t.setAttribute("camera","active",!0)},setActiveCamera:function(e){var t,i,n,o,a=this.activeCameraEl,c=this.sceneEl;if(o=e.getObject3D("camera"),o&&e!==this.activeCameraEl){var u=c.querySelector("["+s+"]"),l=u&&u.querySelector("[camera]");for(e!==l&&r(c),this.activeCameraEl=e,this.activeCameraEl.play(),c.camera=o,a&&a.setAttribute("camera","active",!1),i=c.querySelectorAll("[camera]"),n=0;n<i.length;n++)t=i[n],e!==t&&(t.setAttribute("camera","active",!1),t.pause());c.emit("camera-set-active",{cameraEl:e})}}})},{"../constants/":91,"../core/system":110,"../utils/bind":161}],155:[function(e,t,i){function r(e){var t=e.primitive,i=s[t]&&s[t].Geometry,r=new i;if(!i)throw new Error("Unknown geometry `"+t+"`");return r.init(e),a(r.geometry,e.buffer)}function n(e,t){e[t]--}function o(e,t){e[t]=void 0===e[t]?1:e[t]+1}function a(e,t){var i;return t?(i=(new u.BufferGeometry).fromGeometry(e),i.metadata={type:e.type,parameters:e.parameters||{}},e.dispose(),i):e}var s=e("../core/geometry").geometries,c=e("../core/system").registerSystem,u=e("../lib/three");t.exports.System=c("geometry",{init:function(){this.cache={},this.cacheCount={}},clearCache:function(){this.cache={},this.cacheCount={}},getOrCreateGeometry:function(e){var t,i,n=this.cache;return e.skipCache||e.mergeTo?r(e):(i=this.hash(e),t=n[i],o(this.cacheCount,i),t?t:(t=r(e),n[i]=t,t))},unuseGeometry:function(e){var t,i,r=this.cache,o=this.cacheCount;e.skipCache||e.mergeTo||(i=this.hash(e),r[i]&&(n(o,i),o[i]>0||(t=r[i],t.dispose(),delete r[i],delete o[i])))},hash:function(e){return JSON.stringify(e)}})},{"../core/geometry":101,"../core/system":110,"../lib/three":146}],156:[function(e,t,i){var r=e("../core/system").registerSystem,n=e("../lib/three");t.exports.System=r("gltf-model",{init:function(){this.models=[]},tick:function(){var e=this.sceneEl;e.hasLoaded&&this.models.length&&n.GLTFLoader.Shaders.update(e.object3D,e.camera)},registerModel:function(e){this.models.push(e)},unregisterModel:function(e){var t=this.models,i=t.indexOf(e);i>=0&&t.splice(i,1)}})},{"../core/system":110,"../lib/three":146}],157:[function(e,t,i){e("./camera"),e("./geometry"),e("./gltf-model"),e("./light"),e("./material"),e("./tracked-controls")},{"./camera":154,"./geometry":155,"./gltf-model":156,"./light":158,"./material":159,"./tracked-controls":160}],158:[function(e,t,i){var r=e("../core/system").registerSystem,n=e("../utils/bind"),o=e("../constants/"),a="data-aframe-default-light";t.exports.System=r("light",{init:function(){this.defaultLights=!1,this.userDefinedLights=!1,this.sceneEl.addEventListener("loaded",n(this.setupDefaultLights,this))},registerLight:function(e){e.hasAttribute(a)||(this.removeDefaultLights(),this.userDefinedLights=!0)},removeDefaultLights:function(){var e,t=this.sceneEl;if(this.defaultLights){e=document.querySelectorAll("["+a+"]");for(var i=0;i<e.length;i++)t.removeChild(e[i]);this.defaultLights=!1}},setupDefaultLights:function(){var e,t,i=this.sceneEl;this.userDefinedLights||this.defaultLights||(e=document.createElement("a-entity"),t=document.createElement("a-entity"),e.setAttribute("light",{color:"#BBB",type:"ambient"}),e.setAttribute(a,""),e.setAttribute(o.AFRAME_INJECTED,""),i.appendChild(e),t.setAttribute("light",{color:"#FFF",intensity:.6}),t.setAttribute("position",{x:-.5,y:1,z:1}),t.setAttribute(a,""),t.setAttribute(o.AFRAME_INJECTED,""),i.appendChild(t),this.defaultLights=!0)}})},{"../constants/":91,"../core/system":110,"../utils/bind":161}],159:[function(e,t,i){function r(e,t){var i,r,n,o=t.getAttribute("id");if(o)return o;for(r="",n=e||{},i=0;i<t.attributes.length;i++)n[t.attributes[i].name]=t.attributes[i].value;return Object.keys(n).sort().forEach(function(e){r+=e+":"+n[e]+";"}),r}function n(e,t){function i(i,r){function n(e){o(e,t),e.needsUpdate=!0,i(e)}var a="string"!=typeof e;return a?void n(new u.Texture(e)):void p.load(e,n,function(){},function(e){d("`$s` could not be fetched (Error code: %s; Response: %s)",e.status,e.statusText)})}return new Promise(i)}function o(e,t){var i=t.offset||{x:0,y:0},r=t.repeat||{x:1,y:1},n=t.npot||!1;n&&(e.wrapS=u.ClampToEdgeWrapping,e.wrapT=u.ClampToEdgeWrapping,e.magFilter=u.LinearFilter,e.minFilter=u.LinearFilter),1===r.x&&1===r.y||(e.wrapS=u.RepeatWrapping,e.wrapT=u.RepeatWrapping,e.repeat.set(r.x,r.y)),0===i.x&&0===i.y||e.offset.set(i.x,i.y)}function a(e,t,i){var r=document.createElement("video");return r.width=t,r.height=i,r.setAttribute("webkit-playsinline",""),r.autoplay=!0,r.loop=!0,r.crossOrigin="anonymous",r.addEventListener("error",function(){f("`$s` is not a valid video",e)},!0),r.src=e,r}function s(e){return e.autoplay="false"!==e.getAttribute("autoplay"),e.controls="false"!==e.getAttribute("controls"),"false"===e.getAttribute("loop")&&e.removeAttribute("loop"),"false"===e.getAttribute("preload")&&(e.preload="none"),e.crossOrigin=e.crossOrigin||"anonymous",e.setAttribute("webkit-playsinline",""),e}var c=e("../core/system").registerSystem,u=e("../lib/three"),l=e("../utils/"),h=l.debug,d=h("components:texture:error"),p=new u.TextureLoader,f=h("components:texture:warn");t.exports.System=c("material",{init:function(){this.materials={},this.textureCache={}},clearTextureCache:function(){this.textureCache={}},loadTexture:function(e,t,i){function r(e){o.loadImage(e,t,i)}function n(e){o.loadVideo(e,t,i)}var o=this;return"CANVAS"===e.tagName?void this.loadCanvas(e,t,i):"VIDEO"===e.tagName?(e.hasAttribute("src")||e.hasAttribute("srcObject")||f("Video element was defined without `src` nor `srcObject` attributes."),void this.loadVideo(e,t,i)):void l.srcLoader.validateSrc(e,r,n)},loadImage:function(e,t,i){var r=this.hash(t),o=i,a=this.textureCache;return a[r]?void a[r].then(o):(a[r]=n(e,t),void a[r].then(o))},loadCanvas:function(e,t,i){e.readyState=2,e.HAVE_CURRENT_DATA=2,this.loadVideo(e,t,i)},loadVideo:function(e,t,i){function r(e){e.texture.needsUpdate=!0,i(e.texture,e.videoEl)}var n,c,l,h,d=this.textureCache;if("string"!=typeof e){if(l=e,n=this.hashVideo(t,l),d[n])return void d[n].then(r);s(l)}return l=l||a(e,t.width,t.height),n=this.hashVideo(t,l),d[n]?void d[n].then(r):(c=new u.VideoTexture(l),c.minFilter=u.LinearFilter,o(c,t),h={texture:c,videoEl:l},d[n]=Promise.resolve(h),void r(h))},hash:function(e){return JSON.stringify(e)},hashVideo:function(e,t){return r(e,t)},registerMaterial:function(e){this.materials[e.uuid]=e},unregisterMaterial:function(e){delete this.materials[e.uuid]},updateMaterials:function(e){var t=this.materials;Object.keys(t).forEach(function(e){t[e].needsUpdate=!0})}})},{"../core/system":110,"../lib/three":146,"../utils/":167}],160:[function(e,t,i){var r=e("../core/system").registerSystem,n=e("../utils/tracked-controls"),o=e("../utils");t.exports.System=r("tracked-controls",{init:function(){var e=this;this.controllers=[],this.lastControllersUpdate=0,this.tick=o.throttle(this.throttledTick,10,this),navigator.getVRDisplays&&navigator.getVRDisplays().then(function(t){t.length>0&&(e.vrDisplay=t[0])})},updateControllerList:function(){for(var e=this.controllers=[],t=n.getGamepadsByPrefix(""),i=0;i<t.length;i++){var r=t[i];r&&r.pose&&e.push(r)}},throttledTick:function(){this.updateControllerList(),this.sceneEl.emit("controllersupdated",{controllers:this.controllers})}})},{"../core/system":110,"../utils":167,"../utils/tracked-controls":171}],161:[function(e,t,i){t.exports=function(e,t){return function(i){return function(){var r=i.concat(Array.prototype.slice.call(arguments,0));return e.apply(t,r)}}(Array.prototype.slice.call(arguments,2))}},{}],162:[function(e,t,i){function r(e,t){var i,r={};return e&&"object"==typeof e?o({x:void 0!==e.x?e.x:t&&t.x,y:void 0!==e.y?e.y:t&&t.y,z:void 0!==e.z?e.z:t&&t.z,w:void 0!==e.w?e.w:t&&t.w}):"string"!=typeof e||null===e?"object"==typeof t?a({},t):t:(i=e.trim().replace(/\s+/g," ").split(" "),r.x=i[0]||t&&t.x,r.y=i[1]||t&&t.y,r.z=i[2]||t&&t.z,r.w=i[3]||t&&t.w,o(r))}function n(e){return"object"!=typeof e?e:[e.x,e.y,e.z,e.w].join(" ").trim()}function o(e){return Object.keys(e).forEach(function(t){return void 0===e[t]?void delete e[t]:void(e[t]=parseFloat(e[t],10))}),e}var a=e("object-assign"),s=/^\s*((-?\d*\.{0,1}\d+)\s+){2,3}(-?\d*\.{0,1}\d+)\s*$/;t.exports.regex=s,t.exports.parse=r,t.exports.stringify=n,t.exports.isCoordinate=function(e){return s.test(e)},t.exports.toVector3=function(e){return new THREE.Vector3(e.x,e.y,e.z)}},{"object-assign":28}],163:[function(e,t,i){(function(i){function r(e){var t=e.split(":");return t[t.length-1]}function n(e){var t=r(e),i=c.colors&&c.colors[t];return i||null}function o(){try{return window.localStorage}catch(e){}}var a=e("debug"),s=e("object-assign"),c={colors:{debug:"gray",error:"red",info:"gray",warn:"orange"}},u=function(e){var t=a(e);return t.color=n(e),t};s(u,a);var l=o();l&&(parseInt(l.logs,10)||"true"===l.logs)?u.enable("*"):u.enable("*:error,*:info,*:warn"),i.browser&&(window.logs=u),t.exports=u}).call(this,e("_process"))},{_process:9,debug:11,"object-assign":28}],164:[function(e,t,i){function r(){var e;return u.update(),e=c.quaternion,0!==e._x||0!==e._y||0!==e._z}function n(){var e=new s.Vector3;return function(){return!l()&&!a()&&(u.update(),c.updateMatrix(),e.setFromMatrixPosition(c.matrix),0!==e.x||0!==e.y||0!==e.z)}()}function o(){return/iPad|iPhone|iPod/.test(navigator.platform)}function a(){return/SamsungBrowser.+Mobile VR/i.test(navigator.userAgent)}var s=e("../lib/three"),c=new s.Object3D,u=new s.VRControls(c);t.exports.checkHeadsetConnected=r,t.exports.checkHasPositionalTracking=n;var l=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0),o()&&(e=!0),a()&&(e=!1)}(navigator.userAgent||navigator.vendor||window.opera),function(){return e}}();t.exports.isMobile=l,t.exports.isIOS=o,t.exports.isGearVR=a,t.exports.isLandscape=function(){return 90===window.orientation||window.orientation===-90},t.exports.isIOSOlderThan10=function(e){return/(iphone|ipod|ipad).*os.(7|8|9)/i.test(e)}},{"../lib/three":146}],165:[function(e,t,i){t.exports.getComponentPropertyPath=function(e,t){return t=t||".",e.indexOf(t)===-1?e:e.split(t)},t.exports.getComponentProperty=function(e,t,i){var r;return i=i||".",t.indexOf(i)!==-1?(r=t.split(i),e.getAttribute(r[0])[r[1]]):e.getAttribute(t)},t.exports.setComponentProperty=function(e,t,i,r){var n;return r=r||".",t.indexOf(r)!==-1?(n=t.split(r),void e.setAttribute(n[0],n[1],i)):void e.setAttribute(t,i)}},{}],166:[function(e,t,i){t.exports=function(e){var t=e.style.width,i=e.style.height;e.style.width=parseInt(t,10)+1+"px",e.style.height=parseInt(i,10)+1+"px",setTimeout(function(){e.style.width=t,e.style.height=i},200)}},{}],167:[function(e,t,i){function r(e,t){var i,n,o,a,s;if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return e===t;if(n=Object.keys(e),o=Object.keys(t),n.length!==o.length)return!1;for(i=0;i<n.length;++i)if(a=e[n[i]],s=t[n[i]],"object"==typeof a||"object"==typeof s||Array.isArray(a)&&Array.isArray(s)){if(!r(a,s))return!1}else if(a!==s)return!1;return!0}var n=e("./debug"),o=e("deep-assign"),a=e("./device"),s=e("object-assign"),c=n("utils:warn");t.exports.bind=e("./bind"),t.exports.coordinates=e("./coordinates"),t.exports.debug=n,t.exports.device=a,t.exports.entity=e("./entity"),t.exports.forceCanvasResizeSafariMobile=e("./forceCanvasResizeSafariMobile"),t.exports.material=e("./material"),t.exports.styleParser=e("./styleParser"),t.exports.trackedControls=e("./tracked-controls"),t.exports.checkHeadsetConnected=function(){return c("`utils.checkHeadsetConnected` has moved to `utils.device.checkHeadsetConnected`"),a.checkHeadsetConnected(arguments)},t.exports.isGearVR=function(){return c("`utils.isGearVR` has moved to `utils.device.isGearVR`"),a.isGearVR(arguments)},t.exports.isIOS=function(){return c("`utils.isIOS` has moved to `utils.device.isIOS`"),a.isIOS(arguments)},t.exports.isMobile=function(){return c("`utils.isMobile has moved to `utils.device.isMobile`"),a.isMobile(arguments)},t.exports.throttle=function(e,i,r){var n;return r&&(e=t.exports.bind(e,r)),function(){var t=Date.now(),r="undefined"==typeof n?i:t-n;("undefined"==typeof n||r>=i)&&(n=t,e.apply(null,arguments))}},t.exports.throttleTick=function(e,i,r){var n;return r&&(e=t.exports.bind(e,r)),function(t,r){var o="undefined"==typeof n?r:t-n;("undefined"==typeof n||o>=i)&&(n=t,e(t,o))}},t.exports.fireEvent=function(e,t,i){i=i||{},i.detail=i.detail||{},i.detail.target=i.detail.target||e;var r=new CustomEvent(t,i);e.dispatchEvent(r)},t.exports.extend=s,t.exports.extendDeep=o,t.exports.clone=function(e){return JSON.parse(JSON.stringify(e))},t.exports.deepEqual=r,t.exports.diff=function(e,t){var i={},n=Object.keys(e);return Object.keys(t).forEach(function(e){n.indexOf(e)===-1&&n.push(e)}),n.forEach(function(n){var o=e[n],a=t[n],s=o&&a&&o.constructor===Object&&a.constructor===Object;(s&&!r(o,a)||!s&&o!==a)&&(i[n]=a)}),i},t.exports.shouldCaptureKeyEvent=function(e){return!e.metaKey&&document.activeElement===document.body},t.exports.splitString=function(e,t){"undefined"==typeof t&&(t=" ");var i=new RegExp(t,"g");return e=(e||"").replace(i,t),e.split(t)},t.exports.getElData=function(e,t){function i(t){e.hasAttribute(t)&&(r[t]=e.getAttribute(t))}t=t||{};var r={};return Object.keys(t).forEach(i),r},t.exports.getUrlParameter=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)"),i=t.exec(location.search);return null===i?"":decodeURIComponent(i[1].replace(/\+/g," "))},t.exports.isIframed=function(){return window.top!==window.self},t.exports.findAllScenes=function(e){for(var t=[],i=e.getElementsByTagName("*"),r=0,n=i.length;r<n;r++)i[r].isScene&&t.push(i[r]);return t},t.exports.srcLoader=e("./src-loader")},{"./bind":161,"./coordinates":162,"./debug":163,"./device":164,"./entity":165,"./forceCanvasResizeSafariMobile":166,"./material":168,"./src-loader":169,"./styleParser":170,"./tracked-controls":171,"deep-assign":14,"object-assign":28}],168:[function(e,t,i){function r(e,t){t&&(e.emit("materialtextureloaded",{src:t.image,texture:t}),t.image&&"VIDEO"===t.image.tagName&&(t.image.addEventListener("loadeddata",function(){e.emit("materialvideoloadeddata",{src:t.image,texture:t})}),t.image.addEventListener("ended",function(){e.emit("materialvideoended",{src:t.image,texture:t})})))}var n=e("../lib/three");t.exports.updateMapMaterialFromData=function(e,t,i,o){function a(t){i[l]===u&&(c[e]=t,c.needsUpdate=!0,r(s,t))}var s=i.el,c=i.material,u=o[t],l="_texture_"+t;if(u){if(u===i[l])return;return i[l]=u,u instanceof n.Texture?void a(u):void s.sceneEl.systems.material.loadTexture(u,{src:u,repeat:o.repeat,offset:o.offset,npot:o.npot},a)}c[e]&&(i[l]=null,a(null))},t.exports.updateMap=function(e,i){return t.exports.updateMapMaterialFromData("map","src",e,i)},t.exports.updateDistortionMap=function(e,t,i){function n(e){s[o+"Map"]=e,s.needsUpdate=!0,r(a,e)}var o=e;"ambientOcclusion"===e&&(o="ao");var a=t.el,s=t.material,c=i[e+"Map"],u={};if(u.src=c,u.offset=i[e+"TextureOffset"],u.repeat=i[e+"TextureRepeat"],u.wrap=i[e+"TextureWrap"],c){if(c===t[e+"TextureSrc"])return;return t[e+"TextureSrc"]=c,void a.sceneEl.systems.material.loadTexture(c,u,n)}s.map&&n(null)},t.exports.handleTextureEvents=r},{"../lib/three":146}],169:[function(e,t,i){function r(e,t,i){a(e,function(r){return r?void t(e):void i(e)})}function n(e,t){function i(e){h.push(e),6===h.length&&t(h)}var n,a,c,l="",h=[];for(a=0;a<5;a++)l+="(url\\((?:[^\\)]+)\\),\\s*)";if(l+="(url\\((?:[^\\)]+)\\)\\s*)",c=e.match(new RegExp(l)))for(a=1;a<7;a++)r(o(c[a]),i);else if(n=s(e))return"A-CUBEMAP"===n.tagName&&n.srcs?t(n.srcs):void u('Selector "%s" does not point to <a-cubemap>',e)}function o(e){var t=e.match(/\url\((.+)\)/);if(t)return t[1]}function a(e,t){function i(){t(!0)}function r(){t(!1)}var n=new Image;n.addEventListener("load",i),n.addEventListener("error",r),n.src=e}function s(e){try{var t=document.querySelector(e);return t||u('No element was found matching the selector: "%s"',e),t}catch(t){return void u('"%s" is not a valid selector',e)}}var c=e("./debug"),u=c("utils:src-loader:warn");t.exports={parseUrl:o,validateSrc:r,validateCubemapSrc:n}},{"./debug":163}],170:[function(e,t,i){function r(e){function t(e){return e[1].toUpperCase()}return e.replace(/-([a-z])/g,t)}function n(e){var t=Object.keys(e),i={};return t.forEach(function(t){var n=r(t);i[n]=e[t]}),i}var o=e("style-attr");t.exports.parse=function(e){var t;return"string"!=typeof e?e:(t=o.parse(e),t[""]?e:n(t))},t.exports.stringify=function(e){return"string"==typeof e?e:o.stringify(e)},t.exports.toCamelCase=r,t.exports.transformKeysToCamelCase=n},{"style-attr":37}],171:[function(e,t,i){t.exports.getGamepadsByPrefix=function(e){var t,i=[],r=navigator.getGamepads&&navigator.getGamepads();if(!r)return i;for(var n=0;n<r.length;++n)t=r[n],t&&(e&&0!==t.id.indexOf(e)||i.push(t));return i},t.exports.isControllerPresent=function(e,t,i){var r,n,o,a=!1,s=0,c=e&&e.systems["tracked-controls"];if(!c)return a;if(o=c.controllers,o&&0!==o.length||(c.updateControllerList(),o=c.controllers),!o)return a;for(var u=0;u<o.length&&(r=o[u],n=!t||""===t||0===r.id.indexOf(t),a=n,a&&i.hand&&(a=r.hand===i.hand),a&&i.index&&(a=s===i.index),!a);++u)n&&s++;return a}},{}],172:[function(e,t,i){THREE.VRControls=function(e,t){function i(e){n=e,e.length>0?r=e[0]:t&&t("VR input not available.")}var r,n,o=this,a=new THREE.Matrix4,s=null;"VRFrameData"in window&&(s=new VRFrameData),navigator.getVRDisplays&&navigator.getVRDisplays().then(i).catch(function(){console.warn("THREE.VRControls: Unable to get VR Displays")}),this.scale=1,this.standing=!1,this.userHeight=1.6,this.getVRDisplay=function(){return r},this.setVRDisplay=function(e){r=e},this.getVRDisplays=function(){return console.warn("THREE.VRControls: getVRDisplays() is being deprecated."),n},this.getStandingMatrix=function(){return a},this.update=function(){if(r){var t;r.getFrameData?(r.getFrameData(s),t=s.pose):r.getPose&&(t=r.getPose()),null!==t.orientation&&e.quaternion.fromArray(t.orientation),null!==t.position?e.position.fromArray(t.position):e.position.set(0,0,0),this.standing&&(r.stageParameters?(e.updateMatrix(),a.fromArray(r.stageParameters.sittingToStandingTransform),e.applyMatrix(a)):e.position.setY(e.position.y+this.userHeight)),e.position.multiplyScalar(o.scale)}},this.resetPose=function(){r&&r.resetPose()},this.resetSensor=function(){console.warn("THREE.VRControls: .resetSensor() is now .resetPose()."),this.resetPose()},this.zeroSensor=function(){console.warn("THREE.VRControls: .zeroSensor() is now .resetPose()."),this.resetPose()},this.dispose=function(){r=null}}},{}],173:[function(e,t,i){THREE.VREffect=function(e,t){function i(e){c=e,e.length>0?s=e[0]:t&&t("HMD not available")}function r(){var t=f.isPresenting;if(f.isPresenting=void 0!==s&&s.isPresenting,f.isPresenting){var i=s.getEyeParameters("left"),r=i.renderWidth,n=i.renderHeight;t||(v=e.getPixelRatio(),m=e.getSize(),e.setPixelRatio(1),e.setSize(2*r,n,!1))}else t&&(e.setPixelRatio(v),e.setSize(m.width,m.height,g))}function n(e){var t=2/(e.leftTan+e.rightTan),i=(e.leftTan-e.rightTan)*t*.5,r=2/(e.upTan+e.downTan),n=(e.upTan-e.downTan)*r*.5;return{scale:[t,r],offset:[i,n]}}function o(e,t,i,r){t=void 0===t||t,i=void 0===i?.01:i,r=void 0===r?1e4:r;var o=t?-1:1,a=new THREE.Matrix4,s=a.elements,c=n(e);return s[0]=c.scale[0],s[1]=0,s[2]=c.offset[0]*o,s[3]=0,s[4]=0,s[5]=c.scale[1],s[6]=-c.offset[1]*o,s[7]=0,s[8]=0,s[9]=0,s[10]=r/(i-r)*-o,s[11]=r*i/(i-r),s[12]=0,s[13]=0,s[14]=o,s[15]=0,a.transpose(),a}function a(e,t,i,r){var n=Math.PI/180,a={upTan:Math.tan(e.upDegrees*n),downTan:Math.tan(e.downDegrees*n),leftTan:Math.tan(e.leftDegrees*n),rightTan:Math.tan(e.rightDegrees*n)};return o(a,t,i,r)}var s,c,u,l,h=new THREE.Vector3,d=new THREE.Vector3,p=null;"VRFrameData"in window&&(p=new window.VRFrameData),navigator.getVRDisplays&&navigator.getVRDisplays().then(i).catch(function(){console.warn("THREE.VREffect: Unable to get VR Displays")}),this.isPresenting=!1;var f=this,m=e.getSize(),g=!1,v=e.getPixelRatio();this.getVRDisplay=function(){return s},this.setVRDisplay=function(e){s=e},this.getVRDisplays=function(){return console.warn("THREE.VREffect: getVRDisplays() is being deprecated."),c},this.setSize=function(t,i,r){if(m={width:t,height:i},g=r,f.isPresenting){var n=s.getEyeParameters("left");e.setPixelRatio(1),e.setSize(2*n.renderWidth,n.renderHeight,!1)}else e.setPixelRatio(v),e.setSize(t,i,r)};var y=e.domElement,M=[0,0,.5,1],A=[.5,0,.5,1];window.addEventListener("vrdisplaypresentchange",r,!1),this.setFullScreen=function(e){return new Promise(function(t,i){return void 0===s?void i(new Error("No VR hardware found.")):f.isPresenting===e?void t():void t(e?s.requestPresent([{source:y}]):s.exitPresent())})},this.requestPresent=function(){return this.setFullScreen(!0)},this.exitPresent=function(){return this.setFullScreen(!1)},this.requestAnimationFrame=function(e){return void 0!==s?s.requestAnimationFrame(e):window.requestAnimationFrame(e)},this.cancelAnimationFrame=function(e){void 0!==s?s.cancelAnimationFrame(e):window.cancelAnimationFrame(e)},this.submitFrame=function(){void 0!==s&&f.isPresenting&&s.submitFrame()},this.autoSubmitFrame=!0;var w=new THREE.PerspectiveCamera;w.layers.enable(1);var x=new THREE.PerspectiveCamera;x.layers.enable(2),this.render=function(t,i,r,n){if(s&&f.isPresenting){var o=t.autoUpdate;o&&(t.updateMatrixWorld(),t.autoUpdate=!1);var c=s.getEyeParameters("left"),m=s.getEyeParameters("right");h.fromArray(c.offset),d.fromArray(m.offset),Array.isArray(t)&&(console.warn("THREE.VREffect.render() no longer supports arrays. Use object.layers instead."),t=t[0]);var g,v,y=e.getSize(),E=s.getLayers();if(E.length){var b=E[0];g=null!==b.leftBounds&&4===b.leftBounds.length?b.leftBounds:M,v=null!==b.rightBounds&&4===b.rightBounds.length?b.rightBounds:A}else g=M,v=A;return u={x:Math.round(y.width*g[0]),y:Math.round(y.height*g[1]),width:Math.round(y.width*g[2]),height:Math.round(y.height*g[3])},l={x:Math.round(y.width*v[0]),y:Math.round(y.height*v[1]),width:Math.round(y.width*v[2]),height:Math.round(y.height*v[3])},r?(e.setRenderTarget(r),r.scissorTest=!0):(e.setRenderTarget(null),e.setScissorTest(!0)),(e.autoClear||n)&&e.clear(),null===i.parent&&i.updateMatrixWorld(),i.matrixWorld.decompose(w.position,w.quaternion,w.scale),x.position.copy(w.position),x.quaternion.copy(w.quaternion),x.scale.copy(w.scale),w.translateOnAxis(h,w.scale.x),x.translateOnAxis(d,x.scale.x),s.getFrameData?(s.depthNear=i.near,s.depthFar=i.far,s.getFrameData(p),w.projectionMatrix.elements=p.leftProjectionMatrix,x.projectionMatrix.elements=p.rightProjectionMatrix):(w.projectionMatrix=a(c.fieldOfView,!0,i.near,i.far),x.projectionMatrix=a(m.fieldOfView,!0,i.near,i.far)),r?(r.viewport.set(u.x,u.y,u.width,u.height),r.scissor.set(u.x,u.y,u.width,u.height)):(e.setViewport(u.x,u.y,u.width,u.height),e.setScissor(u.x,u.y,u.width,u.height)),e.render(t,w,r,n),r?(r.viewport.set(l.x,l.y,l.width,l.height),r.scissor.set(l.x,l.y,l.width,l.height)):(e.setViewport(l.x,l.y,l.width,l.height),e.setScissor(l.x,l.y,l.width,l.height)),e.render(t,x,r,n),r?(r.viewport.set(0,0,y.width,y.height),r.scissor.set(0,0,y.width,y.height),r.scissorTest=!1,e.setRenderTarget(null)):(e.setViewport(0,0,y.width,y.height),e.setScissorTest(!1)),o&&(t.autoUpdate=!0),void(f.autoSubmitFrame&&f.submitFrame())}e.render(t,i,r,n)},this.dispose=function(){window.removeEventListener("vrdisplaypresentchange",r,!1)}}},{}],174:[function(e,t,i){window.glStats=function(){function e(e,t){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function t(){o("allcalls").set(a+s),o("drawElements").set(s),o("drawArrays").set(a),o("bindTexture").set(d),o("useProgram").set(c),o("glfaces").set(u),o("glvertices").set(l),o("glpoints").set(h)}function i(){a=0,s=0,c=0,u=0,l=0,h=0,d=0}function r(){}function n(e){o=e}var o=null,a=0,s=0,c=0,u=0,l=0,h=0,d=0;WebGLRenderingContext.prototype.drawArrays=e(WebGLRenderingContext.prototype.drawArrays,function(){a++,arguments[0]==this.POINTS?h+=arguments[2]:l+=arguments[2]}),WebGLRenderingContext.prototype.drawElements=e(WebGLRenderingContext.prototype.drawElements,function(){s++,u+=arguments[1]/3,l+=arguments[1]}),WebGLRenderingContext.prototype.useProgram=e(WebGLRenderingContext.prototype.useProgram,function(){c++}),WebGLRenderingContext.prototype.bindTexture=e(WebGLRenderingContext.prototype.bindTexture,function(){d++});var p={allcalls:{over:3e3,caption:"Calls (hook)"},drawelements:{caption:"drawElements (hook)"},drawarrays:{caption:"drawArrays (hook)"}},f=[{caption:"WebGL",values:["allcalls","drawelements","drawarrays","useprogram","bindtexture","glfaces","glvertices","glpoints"]}],m=[{base:"allcalls",steps:["drawelements","drawarrays"]}];return{update:t,start:i,end:r,attach:n,values:p,groups:f,fractions:m}},window.threeStats=function(e){function t(){o("renderer.info.memory.geometries").set(e.info.memory.geometries),o("renderer.info.programs").set(e.info.programs.length),o("renderer.info.memory.textures").set(e.info.memory.textures),o("renderer.info.render.calls").set(e.info.render.calls),o("renderer.info.render.faces").set(e.info.render.faces),o("renderer.info.render.points").set(e.info.render.points),o("renderer.info.render.vertices").set(e.info.render.vertices)}function i(){}function r(){}function n(e){o=e}var o=null,a={"renderer.info.memory.geometries":{caption:"Geometries"},"renderer.info.memory.textures":{caption:"Textures"},"renderer.info.programs":{caption:"Programs"},"renderer.info.render.calls":{caption:"Calls"},"renderer.info.render.faces":{caption:"Faces",over:1e3},"renderer.info.render.points":{caption:"Points"},"renderer.info.render.vertices":{caption:"Vertices"}},s=[{caption:"Three.js - Memory",values:["renderer.info.memory.geometries","renderer.info.programs","renderer.info.memory.textures"]},{caption:"Three.js - Render",values:["renderer.info.render.calls","renderer.info.render.faces","renderer.info.render.points","renderer.info.render.vertices"]}],c=[];return{update:t,start:i,end:r,attach:n,values:a,groups:s,fractions:c}},window.BrowserStats=function(){function e(e){var t=100,i=Math.floor(Math.log(e)/h);return Math.round(e*t/Math.pow(1024,i))/t}function t(){a=e(performance.memory.usedJSHeapSize),s=e(performance.memory.totalJSHeapSize),o("memory").set(a),o("total").set(s)}function i(){a=0}function r(){}function n(e){o=e}var o=null,a=0,s=0;window.performance&&!performance.memory&&(performance.memory={usedJSHeapSize:0,totalJSHeapSize:0}),0===performance.memory.totalJSHeapSize&&console.warn("totalJSHeapSize === 0... performance.memory is only available in Chrome .");var c={memory:{caption:"Used Memory",average:!0,avgMs:1e3,over:22},total:{caption:"Total Memory"}},u=[{caption:"Browser",values:["memory","total"]}],l=[{base:"total",steps:["memory"]}],h=Math.log(1024);return{update:t,start:i,end:r,attach:n,values:c,groups:u,fractions:l}},"object"==typeof t&&(t.exports={glStats:window.glStats,threeStats:window.threeStats,BrowserStats:window.BrowserStats})},{}],175:[function(e,t,i){"use strict";!function(){if("undefined"==typeof window.performance&&(window.performance={}),!window.performance.now){var e=Date.now();performance.timing&&performance.timing.navigationStart&&(e=performance.timing.navigationStart),window.performance.now=function(){return Date.now()-e}}window.performance.mark||(window.performance.mark=function(){}),window.performance.measure||(window.performance.measure=function(){})}(),window.rStats=function(e){function t(e,t){for(var i=Object.keys(e),r=0,n=i.length;r<n;r++)t(i[r])}function i(e){var t=document.createElement("link");t.href=e,t.rel="stylesheet",t.type="text/css",document.getElementsByTagName("head")[0].appendChild(t)}function r(e,t,i){function r(){a.width=v,a.height=g,a.style.width=a.width+"px",a.style.height=a.height+"px",
  a.className="rs-canvas",e.appendChild(a),s.fillStyle="#444444",s.fillRect(0,0,a.width,a.height)}function n(e,t){u+=.1*(e-u),c*=.99,u>c&&(c=u),s.drawImage(a,1,0,a.width-1,a.height,0,0,a.width-1,a.height),t?s.drawImage(p,a.width-1,a.height-u*a.height/c-g):s.drawImage(h,a.width-1,a.height-u*a.height/c-g)}var o=i||{},a=document.createElement("canvas"),s=a.getContext("2d"),c=0,u=0,l=o.color?o.color:"#666666",h=document.createElement("canvas"),d=h.getContext("2d");h.width=1,h.height=2*g,d.fillStyle="#444444",d.fillRect(0,0,1,2*g),d.fillStyle=l,d.fillRect(0,g,1,g),d.fillStyle="#ffffff",d.globalAlpha=.5,d.fillRect(0,g,1,1),d.globalAlpha=1;var p=document.createElement("canvas"),f=p.getContext("2d");return p.width=1,p.height=2*g,f.fillStyle="#444444",f.fillRect(0,0,1,2*g),f.fillStyle="#b70000",f.fillRect(0,g,1,g),f.globalAlpha=.5,f.fillStyle="#ffffff",f.fillRect(0,g,1,1),f.globalAlpha=1,r(),{draw:n}}function n(e,i){function r(){o.width=v,o.height=g*i,o.style.width=o.width+"px",o.style.height=o.height+"px",o.className="rs-canvas",e.appendChild(o),a.fillStyle="#444444",a.fillRect(0,0,o.width,o.height)}function n(e){a.drawImage(o,1,0,o.width-1,o.height,0,0,o.width-1,o.height);var i=0;t(e,function(t){var r=e[t]*o.height;a.fillStyle=l[t],a.fillRect(o.width-1,i,1,r),i+=r})}var o=document.createElement("canvas"),a=o.getContext("2d");return r(),{draw:n}}function o(e,t){function i(e){if(b&&b.average){v+=e,M++;var t=performance.now();t-y>=(b.avgMs||1e3)&&(g=v/M,v=0,y=t,M=0)}}function n(){h=performance.now(),u.userTimingAPI&&performance.mark(d+"-start"),L=!0}function o(){p=performance.now()-h,u.userTimingAPI&&(performance.mark(d+"-end"),L&&performance.measure(d,d+"-start",d+"-end")),i(p)}function a(){o(),n()}function s(){var e=b&&b.average?g:p;E.nodeValue=Math.round(100*e)/100;var t=b&&(b.below&&p<b.below||b.over&&p>b.over);T.draw(p,t),A.className=t?"rs-counter-base alarm":"rs-counter-base"}function c(){var e=performance.now(),t=e-h;f++,t>1e3&&(p=b&&b.interpolate===!1?f:1e3*f/t,f=0,h=e,i(p))}function l(e){p=e,i(p)}var h,d=e,p=0,f=0,g=0,v=0,y=performance.now(),M=0,A=document.createElement("div"),w=document.createElement("span"),x=document.createElement("div"),E=document.createTextNode(""),b=u?u.values[d.toLowerCase()]:null,T=new r(A,d,b),L=!1;return w.className="rs-counter-id",w.textContent=b&&b.caption?b.caption:d,x.className="rs-counter-value",x.appendChild(E),A.appendChild(w),A.appendChild(x),t?t.div.appendChild(A):m.appendChild(A),h=performance.now(),{set:l,start:n,tick:a,end:o,frame:c,value:function(){return p},draw:s}}function a(e){var i=e.toLowerCase();if(void 0===i&&(i="default"),y[i])return y[i];var r=null;u&&u.groups&&t(u.groups,function(e){var t=u.groups[parseInt(e,10)];r||t.values.indexOf(i.toLowerCase())===-1||(r=t)});var n=new o(i,r);return y[i]=n,n}function s(){if(u.plugins){u.values||(u.values={}),u.groups||(u.groups=[]),u.fractions||(u.fractions=[]);for(var e=0;e<u.plugins.length;e++)u.plugins[e].attach(a),t(u.plugins[e].values,function(t){u.values[t]=u.plugins[e].values[t]}),u.groups=u.groups.concat(u.plugins[e].groups),u.fractions=u.fractions.concat(u.plugins[e].fractions)}else u.plugins={};f=document.createElement("div"),f.className="rs-base",m=document.createElement("div"),m.className="rs-container",m.style.height="auto",f.appendChild(m),document.body.appendChild(f),u&&(u.groups&&t(u.groups,function(e){var t=u.groups[parseInt(e,10)],i=document.createElement("div");i.className="rs-group",t.div=i;var r=document.createElement("h1");r.textContent=t.caption,r.addEventListener("click",function(e){this.classList.toggle("hidden"),e.preventDefault()}.bind(i)),m.appendChild(r),m.appendChild(i)}),u.fractions&&t(u.fractions,function(e){var i=u.fractions[parseInt(e,10)],r=document.createElement("div");r.className="rs-fraction";var o=document.createElement("div");o.className="rs-legend";var a=0;t(u.fractions[e].steps,function(t){var i=document.createElement("p");i.textContent=u.fractions[e].steps[t],i.style.color=l[a],o.appendChild(i),a++}),r.appendChild(o),r.style.height=a*g+"px",i.div=r;var s=new n(r,a);i.graph=s,m.appendChild(r)}))}function c(){t(u.plugins,function(e){u.plugins[e].update()}),t(y,function(e){y[e].draw()}),u&&u.fractions&&t(u.fractions,function(e){var i=u.fractions[parseInt(e,10)],r=[],n=y[i.base.toLowerCase()];n&&(n=n.value(),t(u.fractions[e].steps,function(t){var i=u.fractions[e].steps[parseInt(t,10)].toLowerCase(),o=y[i];o&&r.push(o.value()/n)})),i.graph.draw(r)})}var u=e||{},l=u.colours||["#850700","#c74900","#fcb300","#284280","#4c7c0c"],h="https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700,300",d=(u.CSSPath?u.CSSPath:"")+"rStats.css",p=u.css||[h,d];p.forEach(function(e){i(e)}),u.values||(u.values={});var f,m,g=10,v=200,y={};return s(),function(e){return e?a(e):{element:f,update:c}}},"object"==typeof t&&(t.exports=window.rStats)},{}],176:[function(e,t,i){var r={};r.base64=function(e,t){return"data:"+e+";base64,"+t},r.isMobile=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e},r.isIOS=function(){return/(iPad|iPhone|iPod)/g.test(navigator.userAgent)},r.isIFrame=function(){try{return window.self!==window.top}catch(e){return!0}},r.appendQueryParameter=function(e,t,i){var r=e.indexOf("?")<0?"?":"&";return e+=r+t+"="+i},r.getQueryParameter=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)"),i=t.exec(location.search);return null===i?"":decodeURIComponent(i[1].replace(/\+/g," "))},r.isLandscapeMode=function(){return 90==window.orientation||window.orientation==-90},t.exports=r},{}],177:[function(e,t,i){function r(){var e=document.createElement("video");e.addEventListener("ended",function(){e.play()}),this.request=function(){e.paused&&(e.src=a.base64("video/webm","GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4ECQoWBAhhTgGcBAAAAAAAH4xFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsggfG7AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU2LjQwLjEwMVdBjUxhdmY1Ni40MC4xMDFzpJAGSJTMbsLpDt/ySkipgX1fRImIQO1MAAAAAAAWVK5rAQAAAAAAADuuAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDmDgQEj44OEO5rKAOABAAAAAAAABrCBsLqBkB9DtnUBAAAAAAAAo+eBAKOmgQAAgKJJg0IAAV4BHsAHBIODCoAACmH2MAAAZxgz4dPSTFi5JACjloED6ACmAECSnABMQAADYAAAWi0quoCjloEH0ACmAECSnABNwAADYAAAWi0quoCjloELuACmAECSnABNgAADYAAAWi0quoCjloEPoACmAECSnABNYAADYAAAWi0quoCjloETiACmAECSnABNIAADYAAAWi0quoAfQ7Z1AQAAAAAAAJTnghdwo5aBAAAApgBAkpwATOAAA2AAAFotKrqAo5aBA+gApgBAkpwATMAAA2AAAFotKrqAo5aBB9AApgBAkpwATIAAA2AAAFotKrqAo5aBC7gApgBAkpwATEAAA2AAAFotKrqAo5aBD6AApgDAkpwAQ2AAA2AAAFotKrqAo5aBE4gApgBAkpwATCAAA2AAAFotKrqAH0O2dQEAAAAAAACU54Iu4KOWgQAAAKYAQJKcAEvAAANgAABaLSq6gKOWgQPoAKYAQJKcAEtgAANgAABaLSq6gKOWgQfQAKYAQJKcAEsAAANgAABaLSq6gKOWgQu4AKYAQJKcAEqAAANgAABaLSq6gKOWgQ+gAKYAQJKcAEogAANgAABaLSq6gKOWgROIAKYAQJKcAEnAAANgAABaLSq6gB9DtnUBAAAAAAAAlOeCRlCjloEAAACmAECSnABJgAADYAAAWi0quoCjloED6ACmAECSnABJIAADYAAAWi0quoCjloEH0ACmAMCSnABDYAADYAAAWi0quoCjloELuACmAECSnABI4AADYAAAWi0quoCjloEPoACmAECSnABIoAADYAAAWi0quoCjloETiACmAECSnABIYAADYAAAWi0quoAfQ7Z1AQAAAAAAAJTngl3Ao5aBAAAApgBAkpwASCAAA2AAAFotKrqAo5aBA+gApgBAkpwASAAAA2AAAFotKrqAo5aBB9AApgBAkpwAR8AAA2AAAFotKrqAo5aBC7gApgBAkpwAR4AAA2AAAFotKrqAo5aBD6AApgBAkpwAR2AAA2AAAFotKrqAo5aBE4gApgBAkpwARyAAA2AAAFotKrqAH0O2dQEAAAAAAACU54J1MKOWgQAAAKYAwJKcAENgAANgAABaLSq6gKOWgQPoAKYAQJKcAEbgAANgAABaLSq6gKOWgQfQAKYAQJKcAEagAANgAABaLSq6gKOWgQu4AKYAQJKcAEaAAANgAABaLSq6gKOWgQ+gAKYAQJKcAEZAAANgAABaLSq6gKOWgROIAKYAQJKcAEYAAANgAABaLSq6gB9DtnUBAAAAAAAAlOeCjKCjloEAAACmAECSnABF4AADYAAAWi0quoCjloED6ACmAECSnABFwAADYAAAWi0quoCjloEH0ACmAECSnABFoAADYAAAWi0quoCjloELuACmAECSnABFgAADYAAAWi0quoCjloEPoACmAMCSnABDYAADYAAAWi0quoCjloETiACmAECSnABFYAADYAAAWi0quoAfQ7Z1AQAAAAAAAJTngqQQo5aBAAAApgBAkpwARUAAA2AAAFotKrqAo5aBA+gApgBAkpwARSAAA2AAAFotKrqAo5aBB9AApgBAkpwARQAAA2AAAFotKrqAo5aBC7gApgBAkpwARQAAA2AAAFotKrqAo5aBD6AApgBAkpwAROAAA2AAAFotKrqAo5aBE4gApgBAkpwARMAAA2AAAFotKrqAH0O2dQEAAAAAAACU54K7gKOWgQAAAKYAQJKcAESgAANgAABaLSq6gKOWgQPoAKYAQJKcAESAAANgAABaLSq6gKOWgQfQAKYAwJKcAENgAANgAABaLSq6gKOWgQu4AKYAQJKcAERgAANgAABaLSq6gKOWgQ+gAKYAQJKcAERAAANgAABaLSq6gKOWgROIAKYAQJKcAEQgAANgAABaLSq6gB9DtnUBAAAAAAAAlOeC0vCjloEAAACmAECSnABEIAADYAAAWi0quoCjloED6ACmAECSnABEAAADYAAAWi0quoCjloEH0ACmAECSnABD4AADYAAAWi0quoCjloELuACmAECSnABDwAADYAAAWi0quoCjloEPoACmAECSnABDoAADYAAAWi0quoCjloETiACmAECSnABDgAADYAAAWi0quoAcU7trAQAAAAAAABG7j7OBALeK94EB8YIBd/CBAw=="),e.play())},this.release=function(){e.pause(),e.src=""}}function n(){var e=null;this.request=function(){e||(e=setInterval(function(){window.location=window.location,setTimeout(window.stop,0)},3e4))},this.release=function(){e&&(clearInterval(e),e=null)}}function o(){var e=navigator.userAgent||navigator.vendor||window.opera;return e.match(/iPhone/i)||e.match(/iPod/i)?n:r}var a=e("./util.js");t.exports=o()},{"./util.js":176}]},{},[144])(144)})}).call(i,r(0),r(3).Buffer,r(8).setImmediate)},function(e,t,i){"use strict";function r(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function n(e){return 3*e.length/4-r(e)}function o(e){var t,i,n,o,a,s,c=e.length;a=r(e),s=new h(3*c/4-a),n=a>0?c-4:c;var u=0;for(t=0,i=0;t<n;t+=4,i+=3)o=l[e.charCodeAt(t)]<<18|l[e.charCodeAt(t+1)]<<12|l[e.charCodeAt(t+2)]<<6|l[e.charCodeAt(t+3)],s[u++]=o>>16&255,s[u++]=o>>8&255,s[u++]=255&o;return 2===a?(o=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,s[u++]=255&o):1===a&&(o=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,s[u++]=o>>8&255,s[u++]=255&o),s}function a(e){return u[e>>18&63]+u[e>>12&63]+u[e>>6&63]+u[63&e]}function s(e,t,i){for(var r,n=[],o=t;o<i;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],n.push(a(r));return n.join("")}function c(e){for(var t,i=e.length,r=i%3,n="",o=[],a=16383,c=0,l=i-r;c<l;c+=a)o.push(s(e,c,c+a>l?l:c+a));return 1===r?(t=e[i-1],n+=u[t>>2],n+=u[t<<4&63],n+="=="):2===r&&(t=(e[i-2]<<8)+e[i-1],n+=u[t>>10],n+=u[t>>4&63],n+=u[t<<2&63],n+="="),o.push(n),o.join("")}t.byteLength=n,t.toByteArray=o,t.fromByteArray=c;for(var u=[],l=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,f=d.length;p<f;++p)u[p]=d[p],l[d.charCodeAt(p)]=p;l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},function(e,t,i){"use strict";(function(e){function r(){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}}function n(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(e,t){if(n()<t)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=a.prototype):(null===e&&(e=new a(t)),e.length=t),e}function a(e,t,i){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(e,t,i);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return l(this,e)}return s(this,e,t,i)}function s(e,t,i,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?p(e,t,i,r):"string"==typeof t?h(e,t,i):f(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function u(e,t,i,r){return c(t),t<=0?o(e,t):void 0!==i?"string"==typeof r?o(e,t).fill(i,r):o(e,t).fill(i):o(e,t)}function l(e,t){if(c(t),e=o(e,t<0?0:0|m(t)),!a.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)e[i]=0;return e}function h(e,t,i){if("string"==typeof i&&""!==i||(i="utf8"),!a.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var r=0|v(t,i);e=o(e,r);var n=e.write(t,i);return n!==r&&(e=e.slice(0,n)),e}function d(e,t){var i=t.length<0?0:0|m(t.length);e=o(e,i);for(var r=0;r<i;r+=1)e[r]=255&t[r];return e}function p(e,t,i,r){if(t.byteLength,i<0||t.byteLength<i)throw new RangeError("'offset' is out of bounds");if(t.byteLength<i+(r||0))throw new RangeError("'length' is out of bounds");return t=void 0===i&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,i):new Uint8Array(t,i,r),a.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=a.prototype):e=d(e,t),e}function f(e,t){if(a.isBuffer(t)){var i=0|m(t.length);return e=o(e,i),0===e.length?e:(t.copy(e,0,0,i),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||Z(t.length)?o(e,0):d(e,t);if("Buffer"===t.type&&$(t.data))return d(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function m(e){if(e>=n())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n().toString(16)+" bytes");return 0|e}function g(e){return+e!=e&&(e=0),a.alloc(+e)}function v(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 i=e.length;if(0===i)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return Y(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return X(e).length;default:if(r)return Y(e).length;t=(""+t).toLowerCase(),r=!0}}function y(e,t,i){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if(i>>>=0,t>>>=0,i<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,i);case"utf8":case"utf-8":return S(this,t,i);case"ascii":return C(this,t,i);case"latin1":case"binary":return _(this,t,i);case"base64":return D(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,i);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function M(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function A(e,t,i,r,n){if(0===e.length)return-1;if("string"==typeof i?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=n?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(n)return-1;i=e.length-1}else if(i<0){if(!n)return-1;i=0}if("string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:w(e,t,i,r,n);if("number"==typeof t)return t&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):w(e,[t],i,r,n);throw new TypeError("val must be string, number or Buffer")}function w(e,t,i,r,n){function o(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}var a=1,s=e.length,c=t.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,i/=2}var u;if(n){var l=-1;for(u=i;u<s;u++)if(o(e,u)===o(t,l===-1?0:u-l)){if(l===-1&&(l=u),u-l+1===c)return l*a}else l!==-1&&(u-=u-l),l=-1}else for(i+c>s&&(i=s-c),u=i;u>=0;u--){for(var h=!0,d=0;d<c;d++)if(o(e,u+d)!==o(t,d)){h=!1;break}if(h)return u}return-1}function x(e,t,i,r){i=Number(i)||0;var n=e.length-i;r?(r=Number(r),r>n&&(r=n)):r=n;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[i+a]=s}return a}function E(e,t,i,r){return q(Y(t,e.length-i),e,i,r)}function b(e,t,i,r){return q(V(t),e,i,r)}function T(e,t,i,r){return b(e,t,i,r)}function L(e,t,i,r){return q(X(t),e,i,r)}function N(e,t,i,r){return q(W(t,e.length-i),e,i,r)}function D(e,t,i){return 0===t&&i===e.length?J.fromByteArray(e):J.fromByteArray(e.slice(t,i))}function S(e,t,i){i=Math.min(e.length,i);for(var r=[],n=t;n<i;){var o=e[n],a=null,s=o>239?4:o>223?3:o>191?2:1;if(n+s<=i){var c,u,l,h;switch(s){case 1:o<128&&(a=o);break;case 2:c=e[n+1],128===(192&c)&&(h=(31&o)<<6|63&c,h>127&&(a=h));break;case 3:c=e[n+1],u=e[n+2],128===(192&c)&&128===(192&u)&&(h=(15&o)<<12|(63&c)<<6|63&u,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:c=e[n+1],u=e[n+2],l=e[n+3],128===(192&c)&&128===(192&u)&&128===(192&l)&&(h=(15&o)<<18|(63&c)<<12|(63&u)<<6|63&l,h>65535&&h<1114112&&(a=h))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),n+=s}return I(r)}function I(e){var t=e.length;if(t<=ee)return String.fromCharCode.apply(String,e);for(var i="",r=0;r<t;)i+=String.fromCharCode.apply(String,e.slice(r,r+=ee));return i}function C(e,t,i){var r="";i=Math.min(e.length,i);for(var n=t;n<i;++n)r+=String.fromCharCode(127&e[n]);return r}function _(e,t,i){var r="";i=Math.min(e.length,i);for(var n=t;n<i;++n)r+=String.fromCharCode(e[n]);return r}function j(e,t,i){var r=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>r)&&(i=r);for(var n="",o=t;o<i;++o)n+=Q(e[o]);return n}function O(e,t,i){for(var r=e.slice(t,i),n="",o=0;o<r.length;o+=2)n+=String.fromCharCode(r[o]+256*r[o+1]);return n}function z(e,t,i){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,i,r,n,o){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<o)throw new RangeError('"value" argument is out of bounds');if(i+r>e.length)throw new RangeError("Index out of range")}function k(e,t,i,r){t<0&&(t=65535+t+1);for(var n=0,o=Math.min(e.length-i,2);n<o;++n)e[i+n]=(t&255<<8*(r?n:1-n))>>>8*(r?n:1-n)}function U(e,t,i,r){t<0&&(t=4294967295+t+1);for(var n=0,o=Math.min(e.length-i,4);n<o;++n)e[i+n]=t>>>8*(r?n:3-n)&255}function P(e,t,i,r,n,o){if(i+r>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function B(e,t,i,r,n){return n||P(e,t,i,4,3.4028234663852886e38,-3.4028234663852886e38),K.write(e,t,i,r,23,4),i+4}function F(e,t,i,r,n){return n||P(e,t,i,8,1.7976931348623157e308,-1.7976931348623157e308),K.write(e,t,i,r,52,8),i+8}function G(e){if(e=H(e).replace(te,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function H(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Q(e){return e<16?"0"+e.toString(16):e.toString(16)}function Y(e,t){t=t||1/0;for(var i,r=e.length,n=null,o=[],a=0;a<r;++a){if(i=e.charCodeAt(a),i>55295&&i<57344){if(!n){if(i>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}n=i;continue}if(i<56320){(t-=3)>-1&&o.push(239,191,189),n=i;continue}i=(n-55296<<10|i-56320)+65536}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=null,i<128){if((t-=1)<0)break;o.push(i)}else if(i<2048){if((t-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return o}function V(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}function W(e,t){for(var i,r,n,o=[],a=0;a<e.length&&!((t-=2)<0);++a)i=e.charCodeAt(a),r=i>>8,n=i%256,o.push(n),o.push(r);return o}function X(e){return J.toByteArray(G(e))}function q(e,t,i,r){for(var n=0;n<r&&!(n+i>=t.length||n>=e.length);++n)t[n+i]=e[n];return n}function Z(e){return e!==e}var J=i(2),K=i(4),$=i(5);t.Buffer=a,t.SlowBuffer=g,t.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:r(),t.kMaxLength=n(),a.poolSize=8192,a._augment=function(e){return e.__proto__=a.prototype,e},a.from=function(e,t,i){return s(null,e,t,i)},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,i){return u(null,e,t,i)},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 i=e.length,r=t.length,n=0,o=Math.min(i,r);n<o;++n)if(e[n]!==t[n]){i=e[n],r=t[n];break}return i<r?-1:r<i?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!$(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return a.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var r=a.allocUnsafe(t),n=0;for(i=0;i<e.length;++i){var o=e[i];if(!a.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,n),n+=o.length}return r},a.byteLength=v,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)M(this,t,t+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)M(this,t,t+3),M(this,t+1,t+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)M(this,t,t+7),M(this,t+1,t+6),M(this,t+2,t+5),M(this,t+3,t+4);return this},a.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?S(this,0,e):y.apply(this,arguments)},a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===a.compare(this,e)},a.prototype.inspect=function(){var e="",i=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(e+=" ... ")),"<Buffer "+e+">"},a.prototype.compare=function(e,t,i,r,n){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),t<0||i>e.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&t>=i)return 0;if(r>=n)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,r>>>=0,n>>>=0,this===e)return 0;for(var o=n-r,s=i-t,c=Math.min(o,s),u=this.slice(r,n),l=e.slice(t,i),h=0;h<c;++h)if(u[h]!==l[h]){o=u[h],s=l[h];break}return o<s?-1:s<o?1:0},a.prototype.includes=function(e,t,i){return this.indexOf(e,t,i)!==-1},a.prototype.indexOf=function(e,t,i){return A(this,e,t,i,!0)},a.prototype.lastIndexOf=function(e,t,i){return A(this,e,t,i,!1)},a.prototype.write=function(e,t,i,r){if(void 0===t)r="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)r=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(i)?(i|=0,void 0===r&&(r="utf8")):(r=i,i=void 0)}var n=this.length-t;if((void 0===i||i>n)&&(i=n),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return x(this,e,t,i);case"utf8":case"utf-8":return E(this,e,t,i);case"ascii":return b(this,e,t,i);case"latin1":case"binary":return T(this,e,t,i);case"base64":return L(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,e,t,i);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ee=4096;a.prototype.slice=function(e,t){var i=this.length;e=~~e,t=void 0===t?i:~~t,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<e&&(t=e);var r;if(a.TYPED_ARRAY_SUPPORT)r=this.subarray(e,t),r.__proto__=a.prototype;else{var n=t-e;r=new a(n,void 0);for(var o=0;o<n;++o)r[o]=this[o+e]}return r},a.prototype.readUIntLE=function(e,t,i){e|=0,t|=0,i||z(e,t,this.length);for(var r=this[e],n=1,o=0;++o<t&&(n*=256);)r+=this[e+o]*n;return r},a.prototype.readUIntBE=function(e,t,i){e|=0,t|=0,i||z(e,t,this.length);for(var r=this[e+--t],n=1;t>0&&(n*=256);)r+=this[e+--t]*n;return r},a.prototype.readUInt8=function(e,t){return t||z(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return t||z(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return t||z(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return t||z(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||z(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||z(e,t,this.length);for(var r=this[e],n=1,o=0;++o<t&&(n*=256);)r+=this[e+o]*n;return n*=128,r>=n&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||z(e,t,this.length);for(var r=t,n=1,o=this[e+--r];r>0&&(n*=256);)o+=this[e+--r]*n;return n*=128,o>=n&&(o-=Math.pow(2,8*t)),o},a.prototype.readInt8=function(e,t){return t||z(e,1,this.length),128&this[e]?(255-this[e]+1)*-1:this[e]},a.prototype.readInt16LE=function(e,t){t||z(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},a.prototype.readInt16BE=function(e,t){t||z(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},a.prototype.readInt32LE=function(e,t){return t||z(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||z(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||z(e,4,this.length),K.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return t||z(e,4,this.length),K.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return t||z(e,8,this.length),K.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return t||z(e,8,this.length),K.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,i,r){if(e=+e,t|=0,i|=0,!r){var n=Math.pow(2,8*i)-1;R(this,e,t,i,n,0)}var o=1,a=0;for(this[t]=255&e;++a<i&&(o*=256);)this[t+a]=e/o&255;return t+i},a.prototype.writeUIntBE=function(e,t,i,r){if(e=+e,t|=0,i|=0,!r){var n=Math.pow(2,8*i)-1;R(this,e,t,i,n,0)}var o=i-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+i},a.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||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,i){return e=+e,t|=0,i||R(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},a.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||R(this,e,t,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},a.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||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):U(this,e,t,!0),t+4},a.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||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):U(this,e,t,!1),t+4},a.prototype.writeIntLE=function(e,t,i,r){if(e=+e,t|=0,!r){var n=Math.pow(2,8*i-1);R(this,e,t,i,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o<i&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+i},a.prototype.writeIntBE=function(e,t,i,r){if(e=+e,t|=0,!r){var n=Math.pow(2,8*i-1);R(this,e,t,i,n-1,-n)}var o=i-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+i},a.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||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,i){return e=+e,t|=0,i||R(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},a.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||R(this,e,t,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},a.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||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):U(this,e,t,!0),t+4},a.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||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):U(this,e,t,!1),t+4},a.prototype.writeFloatLE=function(e,t,i){return B(this,e,t,!0,i)},a.prototype.writeFloatBE=function(e,t,i){return B(this,e,t,!1,i)},a.prototype.writeDoubleLE=function(e,t,i){return F(this,e,t,!0,i)},a.prototype.writeDoubleBE=function(e,t,i){return F(this,e,t,!1,i)},a.prototype.copy=function(e,t,i,r){if(i||(i=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<i&&(r=i),r===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-i&&(r=e.length-t+i);var n,o=r-i;if(this===e&&i<t&&t<r)for(n=o-1;n>=0;--n)e[n+t]=this[n+i];else if(o<1e3||!a.TYPED_ARRAY_SUPPORT)for(n=0;n<o;++n)e[n+t]=this[n+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+o),t);return o},a.prototype.fill=function(e,t,i,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,i=this.length):"string"==typeof i&&(r=i,i=this.length),1===e.length){var n=e.charCodeAt(0);n<256&&(e=n)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");
  if(i<=t)return this;t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0);var o;if("number"==typeof e)for(o=t;o<i;++o)this[o]=e;else{var s=a.isBuffer(e)?e:Y(new a(e,r).toString()),c=s.length;for(o=0;o<i-t;++o)this[o+t]=s[o%c]}return this};var te=/[^+\/0-9A-Za-z-_]/g}).call(t,i(0))},function(e,t){t.read=function(e,t,i,r,n){var o,a,s=8*n-r-1,c=(1<<s)-1,u=c>>1,l=-7,h=i?n-1:0,d=i?-1:1,p=e[t+h];for(h+=d,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+h],h+=d,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+e[t+h],h+=d,l-=8);if(0===o)o=1-u;else{if(o===c)return a?NaN:(p?-1:1)*(1/0);a+=Math.pow(2,r),o-=u}return(p?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,i,r,n,o){var a,s,c,u=8*o-n-1,l=(1<<u)-1,h=l>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),t+=a+h>=1?d/c:d*Math.pow(2,1-h),t*c>=2&&(a++,c/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(t*c-1)*Math.pow(2,n),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;e[i+p]=255&s,p+=f,s/=256,n-=8);for(a=a<<n|s,u+=n;u>0;e[i+p]=255&a,p+=f,a/=256,u-=8);e[i+p-f]|=128*m}},function(e,t){var i={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},function(e,t){function i(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function n(e){if(l===setTimeout)return setTimeout(e,0);if((l===i||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function o(e){if(h===clearTimeout)return clearTimeout(e);if((h===r||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(e);try{return h(e)}catch(t){try{return h.call(null,e)}catch(t){return h.call(this,e)}}}function a(){m&&p&&(m=!1,p.length?f=p.concat(f):g=-1,f.length&&s())}function s(){if(!m){var e=n(a);m=!0;for(var t=f.length;t;){for(p=f,f=[];++g<t;)p&&p[g].run();g=-1,t=f.length}p=null,m=!1,o(e)}}function c(e,t){this.fun=e,this.array=t}function u(){}var l,h,d=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:i}catch(e){l=i}try{h="function"==typeof clearTimeout?clearTimeout:r}catch(e){h=r}}();var p,f=[],m=!1,g=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];f.push(new c(e,t)),1!==f.length||m||n(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=u,d.addListener=u,d.once=u,d.off=u,d.removeListener=u,d.removeAllListeners=u,d.emit=u,d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(e,t,i){(function(e,t){!function(e,i){"use strict";function r(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),i=0;i<t.length;i++)t[i]=arguments[i+1];var r={callback:e,args:t};return m[f]=r,p(f),f++}function n(e){delete m[e]}function o(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(i,r)}}function a(e){if(g)setTimeout(a,0,e);else{var t=m[e];if(t){g=!0;try{o(t)}finally{n(e),g=!1}}}}function s(){p=function(e){t.nextTick(function(){a(e)})}}function c(){if(e.postMessage&&!e.importScripts){var t=!0,i=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=i,t}}function u(){var t="setImmediate$"+Math.random()+"$",i=function(i){i.source===e&&"string"==typeof i.data&&0===i.data.indexOf(t)&&a(+i.data.slice(t.length))};e.addEventListener?e.addEventListener("message",i,!1):e.attachEvent("onmessage",i),p=function(i){e.postMessage(t+i,"*")}}function l(){var e=new MessageChannel;e.port1.onmessage=function(e){var t=e.data;a(t)},p=function(t){e.port2.postMessage(t)}}function h(){var e=v.documentElement;p=function(t){var i=v.createElement("script");i.onreadystatechange=function(){a(t),i.onreadystatechange=null,e.removeChild(i),i=null},e.appendChild(i)}}function d(){p=function(e){setTimeout(a,0,e)}}if(!e.setImmediate){var p,f=1,m={},g=!1,v=e.document,y=Object.getPrototypeOf&&Object.getPrototypeOf(e);y=y&&y.setTimeout?y:e,"[object process]"==={}.toString.call(e.process)?s():c()?u():e.MessageChannel?l():v&&"onreadystatechange"in v.createElement("script")?h():d(),y.setImmediate=r,y.clearImmediate=n}}("undefined"==typeof self?"undefined"==typeof e?this:e:self)}).call(t,i(0),i(6))},function(e,t,i){function r(e,t){this._id=e,this._clearFn=t}var n=Function.prototype.apply;t.setTimeout=function(){return new r(n.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new r(n.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},i(7),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(1);i.n(r);console.log("Now go make something neat!??")}],[9]);