From 097107632a63355cbc0d703d306ccb2b395c801d Mon Sep 17 00:00:00 2001
From: David Cormack
Date: Sun, 6 Nov 2016 01:58:38 +0000
Subject: [PATCH 1/3] Added option to enable or disable console log output in
SteamVRInput during input device detection. Logging is now disabled by
default.
---
src/utilities/behaviors/SteamVRInput.es6.js | 16 ++++++++++------
src/utilities/behaviors/SteamVRInput.js | 16 ++++++++++------
2 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/src/utilities/behaviors/SteamVRInput.es6.js b/src/utilities/behaviors/SteamVRInput.es6.js
index ed847f61..34f896f3 100644
--- a/src/utilities/behaviors/SteamVRInput.es6.js
+++ b/src/utilities/behaviors/SteamVRInput.es6.js
@@ -1,14 +1,14 @@
'use strict';
// Returns a Promise that resovles static when a steamvr controller is found
-function getController(hand) {
+function getController(hand, config) {
const findGamepad = (resolve, reject) => {
const gamepad = altspace.getGamepads().find((g) => g.mapping === 'steamvr' && g.hand === hand);
if (gamepad) {
- console.log("SteamVR input device found", gamepad);
+ if(config.logging) console.log("SteamVR input device found", gamepad);
resolve(gamepad);
} else {
- console.log("SteamVR input device not found trying again in 500ms...");
+ if(config.logging) console.log("SteamVR input device not found trying again in 500ms...");
setTimeout(findGamepad, 500, resolve, reject);
}
};
@@ -21,6 +21,8 @@ function getController(hand) {
* to the ThreeJS scene and is required to use [SteamVRTrackedObject]{@link module:altspace/utilities/behaviors.SteamVRTrackedObject}
*
* @class SteamVRInput
+ * @param {Object} [config]
+ * @param {Boolean} [config.logging=false] Display console log output during SteamVR input device detection
* @memberof module:altspace/utilities/behaviors
*
* @prop {Gamepad} leftController the left SteamVR [Gamepad]{@link module:altspace~Gamepad} or undefined if one has not yet been found
@@ -32,13 +34,15 @@ function getController(hand) {
* @prop {Promise} firstControllerPromise a promise that resolves once any SteamVR input device is found
*/
class SteamVRInputBehavior {
- constructor() {
+ constructor(config) {
this.type = 'SteamVRInput';
+ this.config = config || {};
+ this.config.logging = this.config.logging || false;
}
awake() {
- this.leftControllerPromise = getController(SteamVRInputBehavior.LEFT_CONTROLLER);
- this.rightControllerPromise = getController(SteamVRInputBehavior.RIGHT_CONTROLLER);
+ this.leftControllerPromise = getController(SteamVRInputBehavior.LEFT_CONTROLLER, config);
+ this.rightControllerPromise = getController(SteamVRInputBehavior.RIGHT_CONTROLLER, config);
this.firstControllerPromise = Promise.race([
this.leftControllerPromise,
this.rightControllerPromise,
diff --git a/src/utilities/behaviors/SteamVRInput.js b/src/utilities/behaviors/SteamVRInput.js
index 803e44c0..eda39003 100644
--- a/src/utilities/behaviors/SteamVRInput.js
+++ b/src/utilities/behaviors/SteamVRInput.js
@@ -8,16 +8,16 @@ var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default
var _Promise = require('babel-runtime/core-js/promise')['default'];
-function getController(hand) {
+function getController(hand, config) {
var findGamepad = function findGamepad(resolve, reject) {
var gamepad = altspace.getGamepads().find(function (g) {
return g.mapping === 'steamvr' && g.hand === hand;
});
if (gamepad) {
- console.log("SteamVR input device found", gamepad);
+ if(config.logging) console.log("SteamVR input device found", gamepad);
resolve(gamepad);
} else {
- console.log("SteamVR input device not found trying again in 500ms...");
+ if(config.logging) console.log("SteamVR input device not found trying again in 500ms...");
setTimeout(findGamepad, 500, resolve, reject);
}
};
@@ -30,6 +30,8 @@ function getController(hand) {
* to the ThreeJS scene and is required to use [SteamVRTrackedObject]{@link module:altspace/utilities/behaviors.SteamVRTrackedObject}
*
* @class SteamVRInput
+ * @param {Object} [config]
+ * @param {Boolean} [config.logging=false] Display console log output during SteamVR input device detection
* @memberof module:altspace/utilities/behaviors
*
* @prop {Gamepad} leftController the left SteamVR [Gamepad]{@link module:altspace~Gamepad} or undefined if one has not yet been found
@@ -42,10 +44,12 @@ function getController(hand) {
*/
var SteamVRInputBehavior = (function () {
- function SteamVRInputBehavior() {
+ function SteamVRInputBehavior(config) {
_classCallCheck(this, SteamVRInputBehavior);
this.type = 'SteamVRInput';
+ this.config = config || {};
+ this.config.logging = this.config.logging || false;
}
_createClass(SteamVRInputBehavior, [{
@@ -53,8 +57,8 @@ var SteamVRInputBehavior = (function () {
value: function awake() {
var _this = this;
- this.leftControllerPromise = getController(SteamVRInputBehavior.LEFT_CONTROLLER);
- this.rightControllerPromise = getController(SteamVRInputBehavior.RIGHT_CONTROLLER);
+ this.leftControllerPromise = getController(SteamVRInputBehavior.LEFT_CONTROLLER, config);
+ this.rightControllerPromise = getController(SteamVRInputBehavior.RIGHT_CONTROLLER, config);
this.firstControllerPromise = _Promise.race([this.leftControllerPromise, this.rightControllerPromise]);
this.leftControllerPromise.then(function (controller) {
From 9f47ce20d4d9e0d458700db1bd0817ba510dfde8 Mon Sep 17 00:00:00 2001
From: David Cormack
Date: Sun, 6 Nov 2016 03:13:10 +0000
Subject: [PATCH 2/3] Corrected config reference.
---
src/utilities/behaviors/SteamVRInput.es6.js | 4 ++--
src/utilities/behaviors/SteamVRInput.js | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/utilities/behaviors/SteamVRInput.es6.js b/src/utilities/behaviors/SteamVRInput.es6.js
index 34f896f3..35ab293b 100644
--- a/src/utilities/behaviors/SteamVRInput.es6.js
+++ b/src/utilities/behaviors/SteamVRInput.es6.js
@@ -41,8 +41,8 @@ class SteamVRInputBehavior {
}
awake() {
- this.leftControllerPromise = getController(SteamVRInputBehavior.LEFT_CONTROLLER, config);
- this.rightControllerPromise = getController(SteamVRInputBehavior.RIGHT_CONTROLLER, config);
+ this.leftControllerPromise = getController(SteamVRInputBehavior.LEFT_CONTROLLER, this.config);
+ this.rightControllerPromise = getController(SteamVRInputBehavior.RIGHT_CONTROLLER, this.config);
this.firstControllerPromise = Promise.race([
this.leftControllerPromise,
this.rightControllerPromise,
diff --git a/src/utilities/behaviors/SteamVRInput.js b/src/utilities/behaviors/SteamVRInput.js
index eda39003..f83b3b3a 100644
--- a/src/utilities/behaviors/SteamVRInput.js
+++ b/src/utilities/behaviors/SteamVRInput.js
@@ -57,8 +57,8 @@ var SteamVRInputBehavior = (function () {
value: function awake() {
var _this = this;
- this.leftControllerPromise = getController(SteamVRInputBehavior.LEFT_CONTROLLER, config);
- this.rightControllerPromise = getController(SteamVRInputBehavior.RIGHT_CONTROLLER, config);
+ this.leftControllerPromise = getController(SteamVRInputBehavior.LEFT_CONTROLLER, this.config);
+ this.rightControllerPromise = getController(SteamVRInputBehavior.RIGHT_CONTROLLER, this.config);
this.firstControllerPromise = _Promise.race([this.leftControllerPromise, this.rightControllerPromise]);
this.leftControllerPromise.then(function (controller) {
From 57977eb470843e485964b6041867c465a4dfab01 Mon Sep 17 00:00:00 2001
From: Brian Peiris
Date: Sat, 5 Nov 2016 20:47:14 -0700
Subject: [PATCH 3/3] update steamvr example
---
examples/steamvr/bundle.js | 47 ++++++++++++++++++-----------------
examples/steamvr/package.json | 2 +-
2 files changed, 25 insertions(+), 24 deletions(-)
diff --git a/examples/steamvr/bundle.js b/examples/steamvr/bundle.js
index 30267a00..6de4f56c 100644
--- a/examples/steamvr/bundle.js
+++ b/examples/steamvr/bundle.js
@@ -1,24 +1,25 @@
-!function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="/",t(0)}([function(e,t,r){e.exports=r(4)},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,require,require,__WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,require,require;(function(global){!function(e,t){__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(2)],__WEBPACK_AMD_DEFINE_FACTORY__=t,__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof __WEBPACK_AMD_DEFINE_FACTORY__?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__,!(void 0!==__WEBPACK_AMD_DEFINE_RESULT__&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}(this,function(THREE){function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function getController(e){var t=function r(t,n){var i=altspace.getGamepads().find(function(t){return"steamvr"===t.mapping&&t.hand===e});i?(console.log("SteamVR input device found",i),t(i)):(console.log("SteamVR input device not found trying again in 500ms..."),setTimeout(r,500,t,n))};return new Promise(t)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}!function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return require(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[a]={exports:{}};t[a][0].call(h.exports,function(e){var r=t[a][1][e];return i(r?r:e)},h,h.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;ah))return!1;var f=a.get(e);if(f)return f==t;var p=!0;for(a.set(e,t);++s-1&&e%1==0&&C>=e}function b(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function x(e){return!!e&&"object"==typeof e}function w(e){return null==e?!1:v(e)?ue.test(ae.call(e)):x(e)&&(i(e)?ue:ne).test(e)}function _(e){return x(e)&&y(e.length)&&!!ie[ce.call(e)]}var S=e("lodash._stack"),M=e("lodash.keys"),E=e("lodash._root"),T=1,A=2,C=9007199254740991,L="[object Arguments]",k="[object Array]",F="[object Boolean]",P="[object Date]",R="[object Error]",D="[object Function]",O="[object GeneratorFunction]",U="[object Map]",B="[object Number]",j="[object Object]",$="[object Promise]",N="[object RegExp]",I="[object Set]",V="[object String]",G="[object Symbol]",z="[object WeakMap]",H="[object ArrayBuffer]",W="[object DataView]",X="[object Float32Array]",q="[object Float64Array]",K="[object Int8Array]",Y="[object Int16Array]",Q="[object Int32Array]",Z="[object Uint8Array]",J="[object Uint8ClampedArray]",ee="[object Uint16Array]",te="[object Uint32Array]",re=/[\\^$.*+?()[\]{}|]/g,ne=/^\[object .+?Constructor\]$/,ie={};ie[X]=ie[q]=ie[K]=ie[Y]=ie[Q]=ie[Z]=ie[J]=ie[ee]=ie[te]=!0,ie[L]=ie[k]=ie[H]=ie[F]=ie[W]=ie[P]=ie[R]=ie[D]=ie[U]=ie[B]=ie[j]=ie[N]=ie[I]=ie[V]=ie[z]=!1;var oe=Object.prototype,ae=Function.prototype.toString,se=oe.hasOwnProperty,ce=oe.toString,ue=RegExp("^"+ae.call(se).replace(re,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),he=E.Symbol,le=E.Uint8Array,fe=Object.getPrototypeOf,pe=p(E,"DataView"),de=p(E,"Map"),me=p(E,"Promise"),ge=p(E,"Set"),ve=p(E,"WeakMap"),ye=pe?pe+"":"",be=de?ae.call(de):"",xe=me?ae.call(me):"",we=ge?ae.call(ge):"",_e=ve?ae.call(ve):"",Se=he?he.prototype:void 0,Me=Se?Se.valueOf:void 0;(pe&&m(new pe(new ArrayBuffer(1)))!=W||de&&m(new de)!=U||me&&m(me.resolve())!=$||ge&&m(new ge)!=I||ve&&m(new ve)!=z)&&(m=function(e){var t=ce.call(e),r=t==j?e.constructor:null,n="function"==typeof r?ae.call(r):"";if(n)switch(n){case ye:return W;case be:return U;case xe:return $;case we:return I;case _e:return z}return t});var Ee=Array.isArray;t.exports=g},{"lodash._root":2,"lodash._stack":3,"lodash.keys":4}],2:[function(e,t,r){(function(e){function n(e){return e&&e.Object===Object?e:null}var i={"function":!0,object:!0},o=i[typeof r]&&r&&!r.nodeType?r:void 0,a=i[typeof t]&&t&&!t.nodeType?t:void 0,s=n(o&&a&&"object"==typeof e&&e),c=n(i[typeof self]&&self),u=n(i[typeof window]&&window),h=n(i[typeof this]&&this),l=s||u!==(h&&h.window)&&u||c||h||Function("return this")();t.exports=l}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(e,t,r){(function(e){function n(e){return e&&e.Object===Object?e:null}function i(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(r){}return t}function o(){}function a(e,t){return c(e,t)&&delete e[t]}function s(e,t){if(re){var r=e[t];return r===O?void 0:r}return Q.call(e,t)?e[t]:void 0}function c(e,t){return re?void 0!==e[t]:Q.call(e,t)}function u(e,t,r){e[t]=re&&void 0===r?O:r}function h(e){var t=-1,r=e?e.length:0;for(this.clear();++tr)return!1;var n=e.length-1;return r==n?e.pop():ee.call(e,r,1),!0}function S(e,t){var r=E(e,t);return 0>r?void 0:e[r][1]}function M(e,t){return E(e,t)>-1}function E(e,t){for(var r=e.length;r--;)if(k(e[r][0],t))return r;return-1}function T(e,t,r){var n=E(e,t);0>n?e.push([t,r]):e[n][1]=r}function A(e,t){var r=e[t];return R(r)?r:void 0}function C(e){var t=typeof e;return"number"==t||"boolean"==t||"string"==t&&"__proto__"!=e||null==e}function L(e){if(null!=e){try{return Y.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function k(e,t){return e===t||e!==e&&t!==t}function F(e){var t=P(e)?Z.call(e):"";return t==U||t==B}function P(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function R(e){if(!P(e))return!1;var t=F(e)||i(e)?J:$;return t.test(L(e))}var D=200,O="__lodash_hash_undefined__",U="[object Function]",B="[object GeneratorFunction]",j=/[\\^$.*+?()[\]{}|]/g,$=/^\[object .+?Constructor\]$/,N={"function":!0,object:!0},I=N[typeof r]&&r&&!r.nodeType?r:void 0,V=N[typeof t]&&t&&!t.nodeType?t:void 0,G=n(I&&V&&"object"==typeof e&&e),z=n(N[typeof self]&&self),H=n(N[typeof window]&&window),W=n(N[typeof this]&&this),X=G||H!==(W&&W.window)&&H||z||W||Function("return this")(),q=Array.prototype,K=Object.prototype,Y=Function.prototype.toString,Q=K.hasOwnProperty,Z=K.toString,J=RegExp("^"+Y.call(Q).replace(j,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ee=q.splice,te=A(X,"Map"),re=A(Object,"create");o.prototype=re?re(null):K,h.prototype.clear=l,h.prototype["delete"]=f,h.prototype.get=p,h.prototype.has=d,h.prototype.set=m,g.prototype.clear=v,g.prototype["delete"]=y,g.prototype.get=b,g.prototype.has=x,g.prototype.set=w,t.exports=g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,t,r){function n(e,t){for(var r=-1,n=Array(e);++r-1&&e%1==0&&t>e}function o(e,t){return A.call(e,t)||"object"==typeof e&&t in e&&null===c(e)}function a(e){return F(Object(e))}function s(e){return function(t){return null==t?void 0:t[e]}}function c(e){return k(Object(e))}function u(e){var t=e?e.length:void 0;return m(t)&&(R(e)||y(e)||l(e))?n(t,String):null}function h(e){var t=e&&e.constructor,r="function"==typeof t&&t.prototype||T;return e===r}function l(e){return p(e)&&A.call(e,"callee")&&(!L.call(e,"callee")||C.call(e)==w)}function f(e){return null!=e&&m(P(e))&&!d(e)}function p(e){return v(e)&&f(e)}function d(e){var t=g(e)?C.call(e):"";return t==_||t==S}function m(e){return"number"==typeof e&&e>-1&&e%1==0&&x>=e}function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){return!!e&&"object"==typeof e}function y(e){return"string"==typeof e||!R(e)&&v(e)&&C.call(e)==M}function b(e){var t=h(e);if(!t&&!f(e))return a(e);var r=u(e),n=!!r,s=r||[],c=s.length;for(var l in e)!o(e,l)||n&&("length"==l||i(l,c))||t&&"constructor"==l||s.push(l);return s}var x=9007199254740991,w="[object Arguments]",_="[object Function]",S="[object GeneratorFunction]",M="[object String]",E=/^(?:0|[1-9]\d*)$/,T=Object.prototype,A=T.hasOwnProperty,C=T.toString,L=T.propertyIsEnumerable,k=Object.getPrototypeOf,F=Object.keys,P=s("length"),R=Array.isArray;t.exports=b},{}],5:[function(e,t,r){window.altspace=window.altspace||{},window.altspace.utilities=window.altspace.utilities||{},window.altspace.utilities.behaviors=window.altspace.utilities.behaviors||{},window.altspace.utilities.behaviors.Object3DSync=function(t){function r(e,t){h=e,l=h.key(),d=h.child("batch"),f=h.child("data"),p=h.child("owner"),m=t}function n(){d.on("value",function(e){if(!g){var r=e.val();r&&(t.position&&c.position.set(r.position.x,r.position.y,r.position.z),t.rotation&&c.quaternion.set(r.quaternion.x,r.quaternion.y,r.quaternion.z,r.quaternion.w),t.scale&&c.scale.set(r.scale.x,r.scale.y,r.scale.z))}}),p.on("value",function(e){var t=e.val(),r=t===m.clientId&&!g;r&&c.dispatchEvent({type:"ownershipgained"});var n=t!==m.clientId&&g;n&&c.dispatchEvent({type:"ownershiplost"}),g=t===m.clientId})}function i(){if(g){var e={};if(t.world?(c.updateMatrixWorld(),c.matrixWorld.decompose(v,y,b)):(v=c.position,y=c.quaternion,b=c.scale),t.position&&(e.position={x:v.x,y:v.y,z:v.z}),t.rotation&&(e.quaternion={x:y.x,y:y.y,z:y.z,w:y.w}),t.scale&&(e.scale={x:b.x,y:b.y,z:b.z}),Object.keys(e).length>0){if(x(e,this.lastTransform))return;d.set(e),this.lastTransform=e}}}function o(e,t){c=e,u=t,n()}function a(e){}function s(){p.set(m.clientId)}t=t||{};var c,u,h,l,f,p,d,m,g=!1,v=new THREE.Vector3,y=new THREE.Quaternion,b=new THREE.Vector3,x=e("lodash.isequal"),w={awake:o,update:a,type:"Object3DSync",link:r,autoSend:i,takeOwnership:s};return Object.defineProperty(w,"dataRef",{get:function(){return f}}),Object.defineProperty(w,"isMine",{get:function(){return g}}),w}},{"lodash.isequal":1}]},{},[5]),/*!Please JS v0.4.2, Jordan Checkman 2014, Checkman.io, MIT License, Have fun.*/
-!function(e,t,r){__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_FACTORY__=r,__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof __WEBPACK_AMD_DEFINE_FACTORY__?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__,!(void 0!==__WEBPACK_AMD_DEFINE_RESULT__&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}("Please",this,function(){"use strict";function e(){function e(e,t,r){var n=Math.random;return r instanceof a&&(n=r.random),Math.floor(n()*(t-e+1))+e}function t(e,t,r){var n=Math.random;return r instanceof a&&(n=r.random),n()*(t-e)+e}function r(e,t,r){return Math.max(t,Math.min(e,r))}function n(e,t){var r;switch(e){case"hex":for(r=0;r=128?"dark":"light"}function o(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);return t}function a(e){function t(){n=(n+1)%256,i=(i+r[n])%256;var e=r[n];return r[n]=r[i],r[i]=e,r[(r[n]+r[i])%256]}for(var r=[],n=0,i=0,o=0;256>o;o++)r[o]=o;for(var a=0,s=0;256>a;a++){s=(s+r[a]+e.charCodeAt(a%e.length))%256;var c=r[a];r[a]=r[s],r[s]=c}this.random=function(){for(var e=0,r=0,n=1;8>e;e++)r+=t()*n,n*=256;return r/0x10000000000000000}}var s={},c={aliceblue:"F0F8FF",antiquewhite:"FAEBD7",aqua:"00FFFF",aquamarine:"7FFFD4",azure:"F0FFFF",beige:"F5F5DC",bisque:"FFE4C4",black:"000000",blanchedalmond:"FFEBCD",blue:"0000FF",blueviolet:"8A2BE2",brown:"A52A2A",burlywood:"DEB887",cadetblue:"5F9EA0",chartreuse:"7FFF00",chocolate:"D2691E",coral:"FF7F50",cornflowerblue:"6495ED",cornsilk:"FFF8DC",crimson:"DC143C",cyan:"00FFFF",darkblue:"00008B",darkcyan:"008B8B",darkgoldenrod:"B8860B",darkgray:"A9A9A9",darkgrey:"A9A9A9",darkgreen:"006400",darkkhaki:"BDB76B",darkmagenta:"8B008B",darkolivegreen:"556B2F",darkorange:"FF8C00",darkorchid:"9932CC",darkred:"8B0000",darksalmon:"E9967A",darkseagreen:"8FBC8F",darkslateblue:"483D8B",darkslategray:"2F4F4F",darkslategrey:"2F4F4F",darkturquoise:"00CED1",darkviolet:"9400D3",deeppink:"FF1493",deepskyblue:"00BFFF",dimgray:"696969",dimgrey:"696969",dodgerblue:"1E90FF",firebrick:"B22222",floralwhite:"FFFAF0",forestgreen:"228B22",fuchsia:"FF00FF",gainsboro:"DCDCDC",ghostwhite:"F8F8FF",gold:"FFD700",goldenrod:"DAA520",gray:"808080",grey:"808080",green:"008000",greenyellow:"ADFF2F",honeydew:"F0FFF0",hotpink:"FF69B4",indianred:"CD5C5C",indigo:"4B0082",ivory:"FFFFF0",khaki:"F0E68C",lavender:"E6E6FA",lavenderblush:"FFF0F5",lawngreen:"7CFC00",lemonchiffon:"FFFACD",lightblue:"ADD8E6",lightcoral:"F08080",lightcyan:"E0FFFF",lightgoldenrodyellow:"FAFAD2",lightgray:"D3D3D3",lightgrey:"D3D3D3",lightgreen:"90EE90",lightpink:"FFB6C1",lightsalmon:"FFA07A",lightseagreen:"20B2AA",lightskyblue:"87CEFA",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"B0C4DE",lightyellow:"FFFFE0",lime:"00FF00",limegreen:"32CD32",linen:"FAF0E6",magenta:"FF00FF",maroon:"800000",mediumaquamarine:"66CDAA",mediumblue:"0000CD",mediumorchid:"BA55D3",mediumpurple:"9370D8",mediumseagreen:"3CB371",mediumslateblue:"7B68EE",mediumspringgreen:"00FA9A",mediumturquoise:"48D1CC",mediumvioletred:"C71585",midnightblue:"191970",mintcream:"F5FFFA",mistyrose:"FFE4E1",moccasin:"FFE4B5",navajowhite:"FFDEAD",navy:"000080",oldlace:"FDF5E6",olive:"808000",olivedrab:"6B8E23",orange:"FFA500",orangered:"FF4500",orchid:"DA70D6",palegoldenrod:"EEE8AA",palegreen:"98FB98",paleturquoise:"AFEEEE",palevioletred:"D87093",papayawhip:"FFEFD5",peachpuff:"FFDAB9",peru:"CD853F",pink:"FFC0CB",plum:"DDA0DD",powderblue:"B0E0E6",purple:"800080",rebeccapurple:"663399",red:"FF0000",rosybrown:"BC8F8F",royalblue:"4169E1",saddlebrown:"8B4513",salmon:"FA8072",sandybrown:"F4A460",seagreen:"2E8B57",seashell:"FFF5EE",sienna:"A0522D",silver:"C0C0C0",skyblue:"87CEEB",slateblue:"6A5ACD",slategray:"708090",slategrey:"708090",snow:"FFFAFA",springgreen:"00FF7F",steelblue:"4682B4",tan:"D2B48C",teal:"008080",thistle:"D8BFD8",tomato:"FF6347",turquoise:"40E0D0",violet:"EE82EE",wheat:"F5DEB3",white:"FFFFFF",whitesmoke:"F5F5F5",yellow:"FFFF00",yellowgreen:"9ACD32"},u=.618033988749895,h={hue:null,saturation:null,value:null,base_color:"",greyscale:!1,grayscale:!1,golden:!0,full_random:!1,colors_returned:1,format:"hex",seed:null},l={scheme_type:"analogous",format:"hex"},f={golden:!1,format:"hex"};return s.NAME_to_HEX=function(e){return e=e.toLowerCase(),e in c?c[e]:void console.error("Color name not recognized.")},s.NAME_to_RGB=function(e){return s.HEX_to_RGB(s.NAME_to_HEX(e))},s.NAME_to_HSV=function(e){return s.HEX_to_HSV(s.NAME_to_HEX(e))},s.HEX_to_RGB=function(e){var t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(t,function(e,t,r,n){return t+t+r+r+n+n});var r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return r?{r:parseInt(r[1],16),g:parseInt(r[2],16),b:parseInt(r[3],16)}:null},s.RGB_to_HEX=function(e){return"#"+((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)},s.HSV_to_RGB=function(e){var t,r,n,i,o,a,s,c,u=e.h,h=e.s,l=e.v;if(0===h)return{r:l,g:l,b:l};switch(u/=60,i=Math.floor(u),o=u-i,a=l*(1-h),s=l*(1-h*o),c=l*(1-h*(1-o)),i){case 0:t=l,r=c,n=a;break;case 1:t=s,r=l,n=a;break;case 2:t=a,r=l,n=c;break;case 3:t=a,r=s,n=l;break;case 4:t=c,r=a,n=l;break;case 5:t=l,r=a,n=s}return{r:Math.floor(255*t),g:Math.floor(255*r),b:Math.floor(255*n)}},s.RGB_to_HSV=function(e){var t=e.r/255,r=e.g/255,n=e.b/255,i=0,o=0,a=0,s=Math.min(t,Math.min(r,n)),c=Math.max(t,Math.max(r,n));if(s===c)return a=s,{h:0,s:0,v:a};var u=t===s?r-n:n===s?t-r:n-t,h=t===s?3:n===s?1:5;return i=60*(h-u/(c-s)),o=(c-s)/c,a=c,{h:i,s:o,v:a}},s.HSV_to_HEX=function(e){return s.RGB_to_HEX(s.HSV_to_RGB(e))},s.HEX_to_HSV=function(e){return s.RGB_to_HSV(s.HEX_to_RGB(e))},s.make_scheme=function(e,t){function i(e){return{h:e.h,s:e.s,v:e.v}}var a,s,c,u,h,f=o(l);if(null!==t)for(var p in t)t.hasOwnProperty(p)&&(f[p]=t[p]);var d=[e];switch(f.scheme_type.toLowerCase()){case"monochromatic":case"mono":for(h=1;2>=h;h++)a=i(e),c=a.s+.1*h,c=r(c,0,1),u=a.v+.1*h,u=r(u,0,1),a.s=c,a.v=u,d.push(a);for(h=1;2>=h;h++)a=i(e),c=a.s-.1*h,c=r(c,0,1),u=a.v-.1*h,u=r(u,0,1),a.s=c,a.v=u,d.push(a);break;case"complementary":case"complement":case"comp":a=i(e),a.h=(a.h+180)%360,d.push(a);break;case"split-complementary":case"split-complement":case"split":a=i(e),a.h=(a.h+165)%360,d.push(a),a=i(e),a.h=Math.abs((a.h-165)%360),d.push(a);break;case"double-complementary":case"double-complement":case"double":a=i(e),a.h=(a.h+180)%360,d.push(a),a.h=(a.h+30)%360,s=i(a),d.push(a),a.h=(a.h+180)%360,d.push(s);break;case"analogous":case"ana":for(h=1;5>=h;h++)a=i(e),a.h=(a.h+20*h)%360,d.push(a);break;case"triadic":case"triad":case"tri":for(h=1;3>h;h++)a=i(e),a.h=(a.h+120*h)%360,d.push(a);break;default:console.error("Color scheme not recognized.")}return n(f.format.toLowerCase(),d),d},s.make_color=function(i){var c=[],l=o(h),f=null;if(null!==i)for(var p in i)i.hasOwnProperty(p)&&(l[p]=i[p]);var d=null;"string"==typeof l.seed&&(d=new a(l.seed)),l.base_color.length>0&&(f=l.base_color.match(/^#?([0-9a-f]{3})([0-9a-f]{3})?$/i)?s.HEX_to_HSV(l.base_color):s.NAME_to_HSV(l.base_color));for(var m=0;mc;c++)r[f[c]]=u[f[c]];for(;".."==l[0];)h.pop(),l.shift();r.path=("/"!=n.substring(0,1)?h.join("/"):"")+"/"+l.join("/")}i(r)},n=function(e){return e=e.replace(/\+/g," "),e=e.replace(/%([ef][0-9a-f])%([89ab][0-9a-f])%([89ab][0-9a-f])/gi,function(e,t,r,n){var i=parseInt(t,16)-224,o=parseInt(r,16)-128;if(0==i&&32>o)return e;var a=parseInt(n,16)-128,s=(i<<12)+(o<<6)+a;return s>65535?e:String.fromCharCode(s)}),e=e.replace(/%([cd][0-9a-f])%([89ab][0-9a-f])/gi,function(e,t,r){var n=parseInt(t,16)-192;if(2>n)return e;var i=parseInt(r,16)-128;return String.fromCharCode((n<<6)+i)}),e=e.replace(/%([0-7][0-9a-f])/gi,function(e,t){return String.fromCharCode(parseInt(t,16))})},i=function(e){var t=e.query;e.query=new function(e){for(var t,r=/([^=&]+)(=([^&]*))?/g;t=r.exec(e);){var i=decodeURIComponent(t[1].replace(/\+/g," ")),o=t[3]?n(t[3]):"";null!=this[i]?(this[i]instanceof Array||(this[i]=[this[i]]),this[i].push(o)):this[i]=o}this.clear=function(){for(i in this)this[i]instanceof Function||delete this[i]},this.toString=function(){var e="",t=encodeURIComponent;for(var r in this)if(!(this[r]instanceof Function))if(this[r]instanceof Array){var n=this[r].length;if(n)for(var i=0;n>i;i++)e+=e?"&":"",e+=t(r)+"="+t(this[r][i]);else e+=(e?"&":"")+t(r)+"="}else e+=e?"&":"",e+=t(r)+"="+t(this[r]);return e}}(t)};return function(e){this.toString=function(){return(this.protocol&&this.protocol+"://")+(this.user&&this.user+(this.pass&&":"+this.pass)+"@")+(this.host&&this.host)+(this.port&&":"+this.port)+(this.path&&this.path)+(this.query.toString()&&"?"+this.query)+(this.hash&&"#"+this.hash)},r(this,e)}}();/*! @license Firebase v2.2.9
+!function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="/",e(0)}([function(t,e,r){t.exports=r(4)},function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,require,require,require,require,__WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,require,require,require,require,require,require;(function(global){!function(t,e){__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__(2)],__WEBPACK_AMD_DEFINE_FACTORY__=e,__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof __WEBPACK_AMD_DEFINE_FACTORY__?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__,!(void 0!==__WEBPACK_AMD_DEFINE_RESULT__&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}(this,function(THREE){!function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var c="function"==typeof require&&require;if(!s&&c)return require(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[a]={exports:{}};e[a][0].call(h.exports,function(t){var r=e[a][1][t];return i(r?r:t)},h,h.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a-1}function E(t,e){for(var r=t.length;r--;)if(L(t[r][0],e))return r;return-1}function T(t,e,r){var n=E(t,e);n<0?t.push([e,r]):t[n][1]=r}function A(t,e){var r=t[e];return R(r)?r:void 0}function C(t){var e=typeof t;return"number"==e||"boolean"==e||"string"==e&&"__proto__"!=t||null==t}function L(t,e){return t===e||t!==t&&e!==e}function k(t){var e=F(t)?Z.call(t):"";return e==$||e==j}function F(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function P(t){return!!t&&"object"==typeof t}function R(t){return null!=t&&(k(t)?J.test(Y.call(t)):P(t)&&(i(t)?J:B).test(t))}var D=200,O="__lodash_hash_undefined__",$="[object Function]",j="[object GeneratorFunction]",U=/[\\^$.*+?()[\]{}|]/g,B=/^\[object .+?Constructor\]$/,N={function:!0,object:!0},I=N[typeof r]&&r&&!r.nodeType?r:void 0,V=N[typeof e]&&e&&!e.nodeType?e:void 0,G=n(I&&V&&"object"==typeof t&&t),z=n(N[typeof self]&&self),H=n(N[typeof window]&&window),W=n(N[typeof this]&&this),q=G||H!==(W&&W.window)&&H||z||W||Function("return this")(),X=Array.prototype,K=Object.prototype,Y=Function.prototype.toString,Q=K.hasOwnProperty,Z=K.toString,J=RegExp("^"+Y.call(Q).replace(U,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tt=X.splice,et=A(q,"Map"),rt=A(Object,"create");o.prototype=rt?rt(null):K,h.prototype.clear=l,h.prototype.delete=f,h.prototype.get=p,h.prototype.has=d,h.prototype.set=m,g.prototype.clear=v,g.prototype.delete=y,g.prototype.get=b,g.prototype.has=x,g.prototype.set=w,e.exports=g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(t,e,r){function n(t,e){for(var r=-1,n=t.length;++rh))return!1;var f=a.get(t);if(f)return f==e;var p=!0;for(a.set(t,e);++s-1&&t%1==0&&t<=C}function b(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function x(t){return!!t&&"object"==typeof t}function w(t){return null!=t&&(v(t)?ut.test(at.call(t)):x(t)&&(i(t)?ut:nt).test(t))}function _(t){return x(t)&&y(t.length)&&!!it[ct.call(t)]}var S=t("lodash._stack"),M=t("lodash.keys"),E=t("lodash._root"),T=1,A=2,C=9007199254740991,L="[object Arguments]",k="[object Array]",F="[object Boolean]",P="[object Date]",R="[object Error]",D="[object Function]",O="[object GeneratorFunction]",$="[object Map]",j="[object Number]",U="[object Object]",B="[object Promise]",N="[object RegExp]",I="[object Set]",V="[object String]",G="[object Symbol]",z="[object WeakMap]",H="[object ArrayBuffer]",W="[object DataView]",q="[object Float32Array]",X="[object Float64Array]",K="[object Int8Array]",Y="[object Int16Array]",Q="[object Int32Array]",Z="[object Uint8Array]",J="[object Uint8ClampedArray]",tt="[object Uint16Array]",et="[object Uint32Array]",rt=/[\\^$.*+?()[\]{}|]/g,nt=/^\[object .+?Constructor\]$/,it={};it[q]=it[X]=it[K]=it[Y]=it[Q]=it[Z]=it[J]=it[tt]=it[et]=!0,it[L]=it[k]=it[H]=it[F]=it[W]=it[P]=it[R]=it[D]=it[$]=it[j]=it[U]=it[N]=it[I]=it[V]=it[z]=!1;var ot=Object.prototype,at=Function.prototype.toString,st=ot.hasOwnProperty,ct=ot.toString,ut=RegExp("^"+at.call(st).replace(rt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ht=E.Symbol,lt=E.Uint8Array,ft=Object.getPrototypeOf,pt=p(E,"DataView"),dt=p(E,"Map"),mt=p(E,"Promise"),gt=p(E,"Set"),vt=p(E,"WeakMap"),yt=pt?pt+"":"",bt=dt?at.call(dt):"",xt=mt?at.call(mt):"",wt=gt?at.call(gt):"",_t=vt?at.call(vt):"",St=ht?ht.prototype:void 0,Mt=St?St.valueOf:void 0;(pt&&m(new pt(new ArrayBuffer(1)))!=W||dt&&m(new dt)!=$||mt&&m(mt.resolve())!=B||gt&&m(new gt)!=I||vt&&m(new vt)!=z)&&(m=function(t){var e=ct.call(t),r=e==U?t.constructor:null,n="function"==typeof r?at.call(r):"";if(n)switch(n){case yt:return W;case bt:return $;case xt:return B;case wt:return I;case _t:return z}return e});var Et=Array.isArray;e.exports=g},{"lodash._root":1,"lodash._stack":2,"lodash.keys":4}],4:[function(t,e,r){function n(t,e){for(var r=-1,n=Array(t);++r-1&&t%1==0&&t-1&&t%1==0&&t<=x}function g(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function v(t){return!!t&&"object"==typeof t}function y(t){return"string"==typeof t||!R(t)&&v(t)&&C.call(t)==M}function b(t){var e=h(t);if(!e&&!f(t))return a(t);var r=u(t),n=!!r,s=r||[],c=s.length;for(var l in t)!o(t,l)||n&&("length"==l||i(l,c))||e&&"constructor"==l||s.push(l);return s}var x=9007199254740991,w="[object Arguments]",_="[object Function]",S="[object GeneratorFunction]",M="[object String]",E=/^(?:0|[1-9]\d*)$/,T=Object.prototype,A=T.hasOwnProperty,C=T.toString,L=T.propertyIsEnumerable,k=Object.getPrototypeOf,F=Object.keys,P=s("length"),R=Array.isArray;e.exports=b},{}],5:[function(t,e,r){window.altspace=window.altspace||{},window.altspace.utilities=window.altspace.utilities||{},window.altspace.utilities.behaviors=window.altspace.utilities.behaviors||{},window.altspace.utilities.behaviors.Object3DSync=function(e){function r(t,e){h=t,l=h.key(),d=h.child("batch"),f=h.child("data"),p=h.child("owner"),m=e}function n(){d.on("value",function(t){if(!g){var r=t.val();r&&(e.position&&c.position.set(r.position.x,r.position.y,r.position.z),e.rotation&&c.quaternion.set(r.quaternion.x,r.quaternion.y,r.quaternion.z,r.quaternion.w),e.scale&&c.scale.set(r.scale.x,r.scale.y,r.scale.z))}}),p.on("value",function(t){var e=t.val(),r=e===m.clientId&&!g;r&&c.dispatchEvent({type:"ownershipgained"});var n=e!==m.clientId&&g;n&&c.dispatchEvent({type:"ownershiplost"}),g=e===m.clientId})}function i(){if(g){var t={};if(e.world?(c.updateMatrixWorld(),c.matrixWorld.decompose(v,y,b)):(v=c.position,y=c.quaternion,b=c.scale),e.position&&(t.position={x:v.x,y:v.y,z:v.z}),e.rotation&&(t.quaternion={x:y.x,y:y.y,z:y.z,w:y.w}),e.scale&&(t.scale={x:b.x,y:b.y,z:b.z}),Object.keys(t).length>0){if(x(t,this.lastTransform))return;d.set(t),this.lastTransform=t}}}function o(t,e){c=t,u=e,n()}function a(t){}function s(){p.set(m.clientId)}e=e||{};var c,u,h,l,f,p,d,m,g=!1,v=new THREE.Vector3,y=new THREE.Quaternion,b=new THREE.Vector3,x=t("lodash.isequal"),w={awake:o,update:a,type:"Object3DSync",link:r,autoSend:i,takeOwnership:s};return Object.defineProperty(w,"dataRef",{get:function(){return f}}),Object.defineProperty(w,"isMine",{get:function(){return g}}),w}},{"lodash.isequal":3}]},{},[5]),/*!Please JS v0.4.2, Jordan Checkman 2014, Checkman.io, MIT License, Have fun.*/
+!function(t,e,r){__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_FACTORY__=r,__WEBPACK_AMD_DEFINE_RESULT__="function"==typeof __WEBPACK_AMD_DEFINE_FACTORY__?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__,!(void 0!==__WEBPACK_AMD_DEFINE_RESULT__&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}("Please",this,function(){"use strict";function t(){function t(t,e,r){var n=Math.random;return r instanceof a&&(n=r.random),Math.floor(n()*(e-t+1))+t}function e(t,e,r){var n=Math.random;return r instanceof a&&(n=r.random),n()*(e-t)+t}function r(t,e,r){return Math.max(e,Math.min(t,r))}function n(t,e){var r;switch(t){case"hex":for(r=0;r=128?"dark":"light"}function o(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}function a(t){function e(){n=(n+1)%256,i=(i+r[n])%256;var t=r[n];return r[n]=r[i],r[i]=t,r[(r[n]+r[i])%256]}for(var r=[],n=0,i=0,o=0;256>o;o++)r[o]=o;for(var a=0,s=0;256>a;a++){s=(s+r[a]+t.charCodeAt(a%t.length))%256;var c=r[a];r[a]=r[s],r[s]=c}this.random=function(){for(var t=0,r=0,n=1;8>t;t++)r+=e()*n,n*=256;return r/0x10000000000000000}}var s={},c={aliceblue:"F0F8FF",antiquewhite:"FAEBD7",aqua:"00FFFF",aquamarine:"7FFFD4",azure:"F0FFFF",beige:"F5F5DC",bisque:"FFE4C4",black:"000000",blanchedalmond:"FFEBCD",blue:"0000FF",blueviolet:"8A2BE2",brown:"A52A2A",burlywood:"DEB887",cadetblue:"5F9EA0",chartreuse:"7FFF00",chocolate:"D2691E",coral:"FF7F50",cornflowerblue:"6495ED",cornsilk:"FFF8DC",crimson:"DC143C",cyan:"00FFFF",darkblue:"00008B",darkcyan:"008B8B",darkgoldenrod:"B8860B",darkgray:"A9A9A9",darkgrey:"A9A9A9",darkgreen:"006400",darkkhaki:"BDB76B",darkmagenta:"8B008B",darkolivegreen:"556B2F",darkorange:"FF8C00",darkorchid:"9932CC",darkred:"8B0000",darksalmon:"E9967A",darkseagreen:"8FBC8F",darkslateblue:"483D8B",darkslategray:"2F4F4F",darkslategrey:"2F4F4F",darkturquoise:"00CED1",darkviolet:"9400D3",deeppink:"FF1493",deepskyblue:"00BFFF",dimgray:"696969",dimgrey:"696969",dodgerblue:"1E90FF",firebrick:"B22222",floralwhite:"FFFAF0",forestgreen:"228B22",fuchsia:"FF00FF",gainsboro:"DCDCDC",ghostwhite:"F8F8FF",gold:"FFD700",goldenrod:"DAA520",gray:"808080",grey:"808080",green:"008000",greenyellow:"ADFF2F",honeydew:"F0FFF0",hotpink:"FF69B4",indianred:"CD5C5C",indigo:"4B0082",ivory:"FFFFF0",khaki:"F0E68C",lavender:"E6E6FA",lavenderblush:"FFF0F5",lawngreen:"7CFC00",lemonchiffon:"FFFACD",lightblue:"ADD8E6",lightcoral:"F08080",lightcyan:"E0FFFF",lightgoldenrodyellow:"FAFAD2",lightgray:"D3D3D3",lightgrey:"D3D3D3",lightgreen:"90EE90",lightpink:"FFB6C1",lightsalmon:"FFA07A",lightseagreen:"20B2AA",lightskyblue:"87CEFA",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"B0C4DE",lightyellow:"FFFFE0",lime:"00FF00",limegreen:"32CD32",linen:"FAF0E6",magenta:"FF00FF",maroon:"800000",mediumaquamarine:"66CDAA",mediumblue:"0000CD",mediumorchid:"BA55D3",mediumpurple:"9370D8",mediumseagreen:"3CB371",mediumslateblue:"7B68EE",mediumspringgreen:"00FA9A",mediumturquoise:"48D1CC",mediumvioletred:"C71585",midnightblue:"191970",mintcream:"F5FFFA",mistyrose:"FFE4E1",moccasin:"FFE4B5",navajowhite:"FFDEAD",navy:"000080",oldlace:"FDF5E6",olive:"808000",olivedrab:"6B8E23",orange:"FFA500",orangered:"FF4500",orchid:"DA70D6",palegoldenrod:"EEE8AA",palegreen:"98FB98",paleturquoise:"AFEEEE",palevioletred:"D87093",papayawhip:"FFEFD5",peachpuff:"FFDAB9",peru:"CD853F",pink:"FFC0CB",plum:"DDA0DD",powderblue:"B0E0E6",purple:"800080",rebeccapurple:"663399",red:"FF0000",rosybrown:"BC8F8F",royalblue:"4169E1",saddlebrown:"8B4513",salmon:"FA8072",sandybrown:"F4A460",seagreen:"2E8B57",seashell:"FFF5EE",sienna:"A0522D",silver:"C0C0C0",skyblue:"87CEEB",slateblue:"6A5ACD",slategray:"708090",slategrey:"708090",snow:"FFFAFA",springgreen:"00FF7F",steelblue:"4682B4",tan:"D2B48C",teal:"008080",thistle:"D8BFD8",tomato:"FF6347",turquoise:"40E0D0",violet:"EE82EE",wheat:"F5DEB3",white:"FFFFFF",whitesmoke:"F5F5F5",yellow:"FFFF00",yellowgreen:"9ACD32"},u=.618033988749895,h={hue:null,saturation:null,value:null,base_color:"",greyscale:!1,grayscale:!1,golden:!0,full_random:!1,colors_returned:1,format:"hex",seed:null},l={scheme_type:"analogous",format:"hex"},f={golden:!1,format:"hex"};return s.NAME_to_HEX=function(t){return t=t.toLowerCase(),t in c?c[t]:void console.error("Color name not recognized.")},s.NAME_to_RGB=function(t){return s.HEX_to_RGB(s.NAME_to_HEX(t))},s.NAME_to_HSV=function(t){return s.HEX_to_HSV(s.NAME_to_HEX(t))},s.HEX_to_RGB=function(t){var e=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;t=t.replace(e,function(t,e,r,n){return e+e+r+r+n+n});var r=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return r?{r:parseInt(r[1],16),g:parseInt(r[2],16),b:parseInt(r[3],16)}:null},s.RGB_to_HEX=function(t){return"#"+((1<<24)+(t.r<<16)+(t.g<<8)+t.b).toString(16).slice(1)},s.HSV_to_RGB=function(t){var e,r,n,i,o,a,s,c,u=t.h,h=t.s,l=t.v;if(0===h)return{r:l,g:l,b:l};switch(u/=60,i=Math.floor(u),o=u-i,a=l*(1-h),s=l*(1-h*o),c=l*(1-h*(1-o)),i){case 0:e=l,r=c,n=a;break;case 1:e=s,r=l,n=a;break;case 2:e=a,r=l,n=c;break;case 3:e=a,r=s,n=l;break;case 4:e=c,r=a,n=l;break;case 5:e=l,r=a,n=s}return{r:Math.floor(255*e),g:Math.floor(255*r),b:Math.floor(255*n)}},s.RGB_to_HSV=function(t){var e=t.r/255,r=t.g/255,n=t.b/255,i=0,o=0,a=0,s=Math.min(e,Math.min(r,n)),c=Math.max(e,Math.max(r,n));if(s===c)return a=s,{h:0,s:0,v:a};var u=e===s?r-n:n===s?e-r:n-e,h=e===s?3:n===s?1:5;return i=60*(h-u/(c-s)),o=(c-s)/c,a=c,{h:i,s:o,v:a}},s.HSV_to_HEX=function(t){return s.RGB_to_HEX(s.HSV_to_RGB(t))},s.HEX_to_HSV=function(t){return s.RGB_to_HSV(s.HEX_to_RGB(t))},s.make_scheme=function(t,e){function i(t){return{h:t.h,s:t.s,v:t.v}}var a,s,c,u,h,f=o(l);if(null!==e)for(var p in e)e.hasOwnProperty(p)&&(f[p]=e[p]);var d=[t];switch(f.scheme_type.toLowerCase()){case"monochromatic":case"mono":for(h=1;2>=h;h++)a=i(t),c=a.s+.1*h,c=r(c,0,1),u=a.v+.1*h,u=r(u,0,1),a.s=c,a.v=u,d.push(a);for(h=1;2>=h;h++)a=i(t),c=a.s-.1*h,c=r(c,0,1),u=a.v-.1*h,u=r(u,0,1),a.s=c,a.v=u,d.push(a);break;case"complementary":case"complement":case"comp":a=i(t),a.h=(a.h+180)%360,d.push(a);break;case"split-complementary":case"split-complement":case"split":a=i(t),a.h=(a.h+165)%360,d.push(a),a=i(t),a.h=Math.abs((a.h-165)%360),d.push(a);break;case"double-complementary":case"double-complement":case"double":a=i(t),a.h=(a.h+180)%360,d.push(a),a.h=(a.h+30)%360,s=i(a),d.push(a),a.h=(a.h+180)%360,d.push(s);break;case"analogous":case"ana":for(h=1;5>=h;h++)a=i(t),a.h=(a.h+20*h)%360,d.push(a);break;case"triadic":case"triad":case"tri":for(h=1;3>h;h++)a=i(t),a.h=(a.h+120*h)%360,d.push(a);break;default:console.error("Color scheme not recognized.")}return n(f.format.toLowerCase(),d),d},s.make_color=function(i){var c=[],l=o(h),f=null;if(null!==i)for(var p in i)i.hasOwnProperty(p)&&(l[p]=i[p]);var d=null;"string"==typeof l.seed&&(d=new a(l.seed)),l.base_color.length>0&&(f=l.base_color.match(/^#?([0-9a-f]{3})([0-9a-f]{3})?$/i)?s.HEX_to_HSV(l.base_color):s.NAME_to_HSV(l.base_color));for(var m=0;m65535?t:String.fromCharCode(s)}),t=t.replace(/%([cd][0-9a-f])%([89ab][0-9a-f])/gi,function(t,e,r){var n=parseInt(e,16)-192;if(n<2)return t;var i=parseInt(r,16)-128;return String.fromCharCode((n<<6)+i)}),t=t.replace(/%([0-7][0-9a-f])/gi,function(t,e){return String.fromCharCode(parseInt(e,16))})},i=function(t){var e=t.query;t.query=new function(t){for(var e,r=/([^=&]+)(=([^&]*))?/g;e=r.exec(t);){var i=decodeURIComponent(e[1].replace(/\+/g," ")),o=e[3]?n(e[3]):"";null!=this[i]?(this[i]instanceof Array||(this[i]=[this[i]]),this[i].push(o)):this[i]=o}this.clear=function(){for(i in this)this[i]instanceof Function||delete this[i]},this.toString=function(){var t="",e=encodeURIComponent;for(var r in this)if(!(this[r]instanceof Function))if(this[r]instanceof Array){var n=this[r].length;if(n)for(var i=0;io;o++)r.push(i),i=t[o],Ca(e,e.Sd?e.Sd.call(t,String(o),i):i,r),i=",";r.push("]");break}r.push("{"),n="";for(o in t)Object.prototype.hasOwnProperty.call(t,o)&&(i=t[o],"function"!=typeof i&&(r.push(n),Da(o,r),r.push(":"),Ca(e,e.Sd?e.Sd.call(t,o,i):i,r),n=","));r.push("}");break;case"function":break;default:throw Error("Unknown type: "+typeof t)}}function Da(e,t){t.push('"',e.replace(Fa,function(e){if(e in Ea)return Ea[e];var t=e.charCodeAt(0),r="\\u";return 16>t?r+="000":256>t?r+="00":4096>t&&(r+="0"),Ea[e]=r+t.toString(16)}),'"')}function Ga(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^la()).toString(36)}function Ka(){this.Wa=-1}function La(){this.Wa=-1,this.Wa=64,this.P=[],this.ne=[],this.Uf=[],this.Ld=[],this.Ld[0]=128;for(var e=1;ei;i++)n[i]=t.charCodeAt(r)<<24|t.charCodeAt(r+1)<<16|t.charCodeAt(r+2)<<8|t.charCodeAt(r+3),r+=4;else for(i=0;16>i;i++)n[i]=t[r]<<24|t[r+1]<<16|t[r+2]<<8|t[r+3],r+=4;for(i=16;80>i;i++){var o=n[i-3]^n[i-8]^n[i-14]^n[i-16];n[i]=4294967295&(o<<1|o>>>31)}t=e.P[0],r=e.P[1];for(var a,s=e.P[2],c=e.P[3],u=e.P[4],i=0;80>i;i++)40>i?20>i?(o=c^r&(s^c),a=1518500249):(o=r^s^c,a=1859775393):60>i?(o=r&s|c&(r|s),a=2400959708):(o=r^s^c,a=3395469782),o=(t<<5|t>>>27)+o+u+a+n[i]&4294967295,u=c,c=s,s=4294967295&(r<<30|r>>>2),r=t,t=o;e.P[0]=e.P[0]+t&4294967295,e.P[1]=e.P[1]+r&4294967295,e.P[2]=e.P[2]+s&4294967295,e.P[3]=e.P[3]+c&4294967295,e.P[4]=e.P[4]+u&4294967295}function Ta(e,t){var r=Ua(e,t,void 0);return 0>r?null:p(e)?e.charAt(r):e[r]}function Ua(e,t,r){for(var n=e.length,i=p(e)?e.split(""):e,o=0;n>o;o++)if(o in i&&t.call(r,i[o],o,e))return o;return-1}function Va(e,t){var r=Na(e,t);r>=0&&u.splice.call(e,r,1)}function Wa(e,t,r){return 2>=arguments.length?u.slice.call(e,t):u.slice.call(e,t,r)}function Xa(e,t){e.sort(t||Ya)}function Ya(e,t){return e>t?1:t>e?-1:0}function fb(e,t){if(!fa(e))throw Error("encodeByteArray takes an array as a parameter");gb();for(var r=t?db:cb,n=[],i=0;i>2,o=(3&o)<<4|s>>4,s=(15&s)<<2|u>>6,u=63&u;c||(u=64,a||(s=64)),n.push(r[h],r[o],r[s],r[u])}return n.join("")}function gb(){if(!cb){cb={},db={},eb={};for(var e=0;65>e;e++)cb[e]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e),db[e]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(e),eb[db[e]]=e,e>=62&&(eb["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e)]=e)}}function v(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function w(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}function ib(e,t){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t(r,e[r])}function jb(e){var t={};return ib(e,function(e,r){t[e]=r}),t}function kb(e){var t=[];return ib(e,function(e,r){ea(r)?Oa(r,function(r){t.push(encodeURIComponent(e)+"="+encodeURIComponent(r))}):t.push(encodeURIComponent(e)+"="+encodeURIComponent(r))}),t.length?"&"+t.join("&"):""}function lb(e){var t={};return e=e.replace(/^\?/,"").split("&"),Oa(e,function(e){e&&(e=e.split("="),t[e[0]]=e[1])}),t}function x(e,t,r,n){var i;if(t>n?i="at least "+t:n>r&&(i=0===r?"none":"no more than "+r),i)throw Error(e+" failed: Was called with "+n+(1===n?" argument.":" arguments.")+" Expects "+i+".")}function z(e,t,r){var n="";switch(t){case 1:n=r?"first":"First";break;case 2:n=r?"second":"Second";break;case 3:n=r?"third":"Third";break;case 4:n=r?"fourth":"Fourth";break;default:throw Error("errorPrefix called with argumentNumber > 4. Need to update it?")}return e=e+" failed: "+(n+" argument ")}function A(e,t,r,i){if((!i||n(r))&&!ha(r))throw Error(z(e,t,i)+"must be a valid function.")}function mb(e,t,r){if(n(r)&&(!ia(r)||null===r))throw Error(z(e,t,!0)+"must be a valid context object.")}function nb(e){return"undefined"!=typeof JSON&&n(JSON.parse)?JSON.parse(e):Aa(e)}function B(e){if("undefined"!=typeof JSON&&n(JSON.stringify))e=JSON.stringify(e);else{var t=[];Ca(new Ba,e,t),e=t.join("")}return e}function ob(){this.Wd=C}function pb(){}function rb(e,t,r){this.Rf=e,this.Ka=t,this.Kd=r}function vb(){this.ub=[]}function wb(e,t){for(var r=null,n=0;nr?n=n.left:r>0&&(i=n,n=n.right)}throw Error("Attempted to find predecessor key for a nonexistent key. What gives?")}function cc(e,t,r,n,i){for(this.Ud=i||null,this.Ge=n,this.Qa=[],i=1;!e.e();)if(i=t?r(e.key,t):1,n&&(i*=-1),0>i)e=this.Ge?e.left:e.right;else{if(0===i){this.Qa.push(e);break}this.Qa.push(e),e=this.Ge?e.right:e.left}}function J(e){if(0===e.Qa.length)return null;var t,r=e.Qa.pop();if(t=e.Ud?e.Ud(r.key,r.value):{key:r.key,value:r.value},e.Ge)for(r=r.left;!r.e();)e.Qa.push(r),r=r.right;else for(r=r.right;!r.e();)e.Qa.push(r),r=r.left;return t}function dc(e){if(0===e.Qa.length)return null;var t;return t=e.Qa,t=t[t.length-1],e.Ud?e.Ud(t.key,t.value):{key:t.key,value:t.value}}function ec(e,t,r,n,i){this.key=e,this.value=t,this.color=null!=r?r:!0,this.left=null!=n?n:ac,this.right=null!=i?i:ac}function fc(e){return e.left.e()?e:fc(e.left)}function hc(e){return e.left.e()?ac:(e.left.fa()||e.left.left.fa()||(e=ic(e)),e=e.X(null,null,null,hc(e.left),null),gc(e))}function gc(e){return e.right.fa()&&!e.left.fa()&&(e=lc(e)),e.left.fa()&&e.left.left.fa()&&(e=jc(e)),e.left.fa()&&e.right.fa()&&(e=kc(e)),e}function ic(e){return e=kc(e),e.right.left.fa()&&(e=e.X(null,null,null,null,jc(e.right)),e=lc(e),e=kc(e)),e}function lc(e){return e.right.X(null,null,e.color,e.X(null,null,!0,null,e.right.left),null)}function jc(e){return e.left.X(null,null,e.color,null,e.X(null,null,!0,e.left.right,null))}function kc(e){return e.X(null,null,!e.color,e.left.X(null,null,!e.left.color,null,null),e.right.X(null,null,!e.right.color,null,null))}function mc(){}function nc(e,t){return e&&"object"==typeof e?(K(".sv"in e,"Unexpected leaf node or priority contents"),t[e[".sv"]]):e}function oc(e,t){var r=new pc;return qc(e,new L(""),function(e,n){r.nc(e,rc(n,t))}),r}function rc(e,t){var r,n=e.B().H(),n=nc(n,t);if(e.L()){var i=nc(e.Ca(),t);return i!==e.Ca()||n!==e.B().H()?new sc(i,M(n)):e}return r=e,n!==e.B().H()&&(r=r.ga(new sc(n))),e.R(N,function(e,n){var i=rc(n,t);i!==n&&(r=r.O(e,i))}),r}function L(e,t){if(1==arguments.length){this.n=e.split("/");for(var r=0,n=0;n=e.n.length?null:e.n[e.Z]}function tc(e){return e.n.length-e.Z}function H(e){var t=e.Z;return t>4),64!=s&&(n.push(a<<4&240|s>>2),64!=c&&n.push(s<<6&192|c))}if(8192>n.length)t=String.fromCharCode.apply(null,n);else{for(e="",r=0;re.ac?e.update(e.Ld,56-e.ac):e.update(e.Ld,e.Wa-(e.ac-56));for(var n=e.Wa-1;n>=56;n--)e.ne[n]=255&r,r/=256;for(Ma(e,e.ne),n=r=0;5>n;n++)for(var i=24;i>=0;i-=8)t[r]=e.P[n]>>i&255,++r;return fb(t)}function Kc(e){for(var t="",r=0;r=0&&(a=e.substring(0,c-1),e=e.substring(c+2)),c=e.indexOf("/"),-1===c&&(c=e.length),t=e.substring(0,c),i="",e=e.substring(c).split("/"),c=0;c=0&&(o="https"===a||"wss"===a,s=t.substring(c+1),isFinite(s)&&(s=String(s)),s=p(s)?/^\s*-?0x/i.test(s)?parseInt(s,16):parseInt(s,10):NaN)}return{host:t,port:s,domain:r,Rg:n,lb:o,scheme:a,$c:i}}function Rc(e){return ga(e)&&(e!=e||e==Number.POSITIVE_INFINITY||e==Number.NEGATIVE_INFINITY)}function Sc(e){if("complete"===document.readyState)e();else{var t=!1,r=function(){document.body?t||(t=!0,e()):setTimeout(r,Math.floor(10))};document.addEventListener?(document.addEventListener("DOMContentLoaded",r,!1),window.addEventListener("load",r,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&r()}),window.attachEvent("onload",r))}}function Ub(e,t){if(e===t)return 0;if("[MIN_NAME]"===e||"[MAX_NAME]"===t)return-1;if("[MIN_NAME]"===t||"[MAX_NAME]"===e)return 1;var r=Tc(e),n=Tc(t);return null!==r?null!==n?0==r-n?e.length-t.length:r-n:-1:null!==n?1:t>e?-1:1}function Uc(e,t){if(t&&e in t)return t[e];throw Error("Missing required key ("+e+") in object: "+B(t))}function Vc(e){if("object"!=typeof e||null===e)return B(e);var t,r=[];for(t in e)r.push(t);r.sort(),t="{";for(var n=0;ne?r.push(e.substring(n,e.length)):r.push(e.substring(n,n+t));return r}function Xc(e,t){if(ea(e))for(var n=0;ne,e=Math.abs(e),e>=Math.pow(2,-1022)?(n=Math.min(Math.floor(Math.log(e)/Math.LN2),1023),r=n+1023,n=Math.round(e*Math.pow(2,52-n)-Math.pow(2,52))):(r=0,n=Math.round(e/Math.pow(2,-1074)))),i=[],e=52;e;--e)i.push(n%2?1:0),n=Math.floor(n/2);for(e=11;e;--e)i.push(r%2?1:0),r=Math.floor(r/2);for(i.push(t?1:0),i.reverse(),t=i.join(""),r="",e=0;64>e;e+=8)n=parseInt(t.substr(e,8),2).toString(16),1===n.length&&(n="0"+n),r+=n;return r.toLowerCase()}function Tc(e){return Zc.test(e)&&(e=Number(e),e>=-2147483648&&2147483647>=e)?e:null}function Db(e){try{e()}catch(t){setTimeout(function(){throw Q("Exception was thrown by user callback.",t.stack||""),t},Math.floor(0))}}function R(e,t){if(ha(e)){var r=Array.prototype.slice.call(arguments,1).slice();Db(function(){e.apply(null,r)})}}function Jc(e){for(var t=[],r=0,n=0;n=55296&&56319>=i&&(i-=55296,n++,K(ni?t[r++]=i:(2048>i?t[r++]=i>>6|192:(65536>i?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=63&i|128)}return t}function wc(e){for(var t=0,r=0;rn?t++:2048>n?t+=2:n>=55296&&56319>=n?(t+=4,r++):t+=3}return t}function $c(e){var t={},r={},n={},i="";try{var o=e.split("."),t=nb(Hc(o[0])||""),r=nb(Hc(o[1])||""),i=o[2],n=r.d||{};delete r.d}catch(a){}return{Xg:t,Bc:r,data:n,Og:i}}function ad(e){return e=$c(e).Bc,"object"==typeof e&&e.hasOwnProperty("iat")?w(e,"iat"):null}function bd(e){e=$c(e);var t=e.Bc;return!!e.Og&&!!t&&"object"==typeof t&&t.hasOwnProperty("iat")}function cd(e){this.V=e,this.g=e.o.g}function dd(e,t,r,n){var i=[],o=[];return Oa(t,function(t){"child_changed"===t.type&&e.g.Ad(t.Le,t.Ja)&&o.push(new D("child_moved",t.Ja,t.Xa))}),ed(e,i,"child_removed",t,n,r),ed(e,i,"child_added",t,n,r),ed(e,i,"child_moved",o,n,r),ed(e,i,"child_changed",t,n,r),ed(e,i,Fb,t,n,r),i}function ed(e,t,r,n,i,o){n=Pa(n,function(e){return e.type===r}),Xa(n,q(e.fg,e)),Oa(n,function(r){var n=fd(e,r,o);Oa(i,function(i){i.Kf(r.type)&&t.push(i.createEvent(n,e.V))})})}function fd(e,t,r){return"value"!==t.type&&"child_removed"!==t.type&&(t.Qd=r.rf(t.Xa,t.Ja,e.g)),t}function gd(){this.bb={}}function hd(e,t){var r=t.type,n=t.Xa;K("child_added"==r||"child_changed"==r||"child_removed"==r,"Only child changes supported for tracking"),K(".priority"!==n,"Only non-priority child changes can be tracked.");var i=w(e.bb,n);if(i){var o=i.type;if("child_added"==r&&"child_removed"==o)e.bb[n]=new D("child_changed",t.Ja,n,i.Ja);else if("child_removed"==r&&"child_added"==o)delete e.bb[n];else if("child_removed"==r&&"child_changed"==o)e.bb[n]=new D("child_removed",i.Le,n);else if("child_changed"==r&&"child_added"==o)e.bb[n]=new D("child_added",t.Ja,n);else{if("child_changed"!=r||"child_changed"!=o)throw Gc("Illegal combination of changes: "+t+" occurred after "+i);e.bb[n]=new D("child_changed",t.Ja,n,i.Le)}}else e.bb[n]=t}function id(e,t,r){this.Rb=e,this.qb=t,this.sb=r||null}function jd(e,t,r){this.ha=e,this.qb=t,this.sb=r}function kd(e){this.g=e}function ld(e){this.Ce=new kd(e.g),this.g=e.g;var t;e.ma?(t=md(e),t=e.g.Pc(nd(e),t)):t=e.g.Tc(),this.ed=t,e.pa?(t=od(e),e=e.g.Pc(pd(e),t)):e=e.g.Qc(),this.Gc=e}function qd(e){this.sa=new ld(e),this.g=e.g,K(e.ja,"Only valid if limit has been set"),this.ka=e.ka,this.Jb=!rd(e)}function sd(e,t,r,n,i,o){var a;if(e.Jb){var s=td(e.g);a=function(e,t){return s(t,e)}}else a=td(e.g);K(t.Eb()==e.ka,"");var c=new F(r,n),u=e.Jb?ud(t,e.g):vd(t,e.g),h=e.sa.matches(c);if(t.Da(r)){for(var l=t.J(r),u=i.ze(e.g,u,e.Jb);null!=u&&(u.name==r||t.Da(u.name));)u=i.ze(e.g,u,e.Jb);return i=null==u?1:a(u,c),h&&!n.e()&&i>=0?(null!=o&&hd(o,new D("child_changed",n,r,l)),t.O(r,n)):(null!=o&&hd(o,new D("child_removed",l,r)),t=t.O(r,C),null!=u&&e.sa.matches(u)?(null!=o&&hd(o,new D("child_added",u.S,u.name)),t.O(u.name,u.S)):t)}return n.e()?t:h&&0<=a(u,c)?(null!=o&&(hd(o,new D("child_removed",u.S,u.name)),hd(o,new D("child_added",n,r))),t.O(r,n).O(u.name,C)):t}function wd(e,t){this.ke=e,this.dg=t}function yd(e){this.U=e}function Hd(e,t,r,n,i,o){var a=t.Q;if(null!=n.tc(r))return t;var s;if(r.e())K(Ib(t.C()),"If change path is empty, we must have complete server data"),t.C().Ub?(i=ub(t),n=n.yc(i instanceof T?i:C)):n=n.za(ub(t)),o=e.U.xa(t.Q.j(),n,o);else{var c=E(r);if(".priority"==c)K(1==tc(r),"Can't have a priority with additional path components"),o=a.j(),s=t.C().j(),n=n.ld(r,o,s),o=null!=n?e.U.ga(o,n):a.j();else{var u=H(r);sb(a,c)?(s=t.C().j(),n=n.ld(r,a.j(),s),n=null!=n?a.j().J(c).K(u,n):a.j().J(c)):n=n.xc(c,t.C()),o=null!=n?e.U.K(a.j(),c,n,u,i,o):a.j()}}return Fd(t,o,a.ea||r.e(),e.U.Na())}function Ad(e,t,r,n,i,o,a,s){var c=t.C();if(a=a?e.U:e.U.Wb(),r.e())n=a.xa(c.j(),n,null);else if(a.Na()&&!c.Ub)n=c.j().K(r,n),n=a.xa(c.j(),n,null);else{var u=E(r);if(!Jb(c,r)&&1o.status){try{t=nb(o.responseText)}catch(r){Q("Failed to parse JSON response for "+i+": "+o.responseText)}n(null,t)}else 401!==o.status&&404!==o.status&&Q("Got unsuccessful REST response for "+i+" Status: "+o.status),n(o.status);n=null}},o.open("GET",i,!0),o.send()}function Be(e,t){this.value=e,this.children=t||Ce}function De(e){var t=Nd;return r(e,function(e,r){t=t.set(new L(r),e)}),t}function Ee(e,t,r){if(null!=e.value&&r(e.value))return{path:G,value:e.value};if(t.e())return null;var n=E(t);return e=e.children.get(n),null!==e?(t=Ee(e,H(t),r),null!=t?{path:new L(n).u(t.path),value:t.value}:null):null}function Fe(e,t){return Ee(e,t,function(){return!0})}function Md(e,t,r){if(t.e())return r;var n=E(t);return t=Md(e.children.get(n)||Nd,H(t),r),n=t.e()?e.children.remove(n):e.children.Oa(n,t),new Be(e.value,n)}function Ge(e,t){return He(e,G,t)}function He(e,t,r){var n={};return e.children.ia(function(e,i){n[e]=He(i,t.u(e),r)}),r(t,e.value,n)}function Ie(e,t,r){return Je(e,t,G,r)}function Je(e,t,r,n){var i=e.value?n(r,e.value):!1;return i?i:t.e()?null:(i=E(t),(e=e.children.get(i))?Je(e,H(t),r.u(i),n):null)}function Ke(e,t,r){var n=G;if(!t.e()){var i=!0;e.value&&(i=r(n,e.value)),!0===i&&(i=E(t),(e=e.children.get(i))&&Le(e,H(t),n.u(i),r))}}function Le(e,t,r,n){if(t.e())return e;e.value&&n(r,e.value);var i=E(t);return(e=e.children.get(i))?Le(e,H(t),r.u(i),n):Nd}function Kd(e,t){Me(e,G,t)}function Me(e,t,r){e.children.ia(function(e,n){Me(n,t.u(e),r)}),e.value&&r(t,e.value)}function Ne(e,t){e.children.ia(function(e,r){r.value&&t(e,r.value)})}function Oe(e,t,r){this.type=Ed,this.source=Pe,this.path=e,this.Qb=t,this.Vd=r}function Qe(e,t,r,n){this.xe=e,this.pf=t,this.Ib=r,this.bf=n,K(!n||t,"Tagged queries must be from server.")}function Se(e){this.W=e}function Ue(e,t,r){if(t.e())return new Se(new Be(r));var n=Fe(e.W,t);if(null!=n){var i=n.path,n=n.value;return t=O(i,t),n=n.K(t,r),new Se(e.W.set(i,n))}return e=Md(e.W,t,new Be(r)),new Se(e)}function Ve(e,t,r){var n=e;return ib(r,function(e,r){n=Ue(n,t.u(e),r)}),n}function We(e,t){var r=Fe(e.W,t);return null!=r?e.W.get(r.path).Y(O(r.path,t)):null}function Xe(e){var t=[],r=e.W.value;return null!=r?r.L()||r.R(N,function(e,r){t.push(new F(e,r))}):e.W.children.ia(function(e,r){null!=r.value&&t.push(new F(e,r.value))}),t}function Ye(e,t){if(t.e())return e;var r=We(e,t);return new Se(null!=r?new Be(r):e.W.subtree(t))}function Ze(e,t,r){if(null!=t.value)return r.K(e,t.value);var n=null;return t.children.ia(function(t,i){".priority"===t?(K(null!==i.value,"Priority writes must always be leaf nodes"),n=i.value):r=Ze(e.u(t),i,r)}),r.Y(e).e()||null===n||(r=r.K(e.u(".priority"),n)),r}function $e(){this.T=Te,this.na=[],this.Mc=-1}function af(e,t){for(var r=0;ra.Mc,"Stacking an older write on top of newer ones"),n(s)||(s=!0),a.na.push({path:t,Ga:r,kd:i,visible:s}),s&&(a.T=Ue(a.T,t,r)),a.Mc=i,o?mf(e,new Wb(Pe,t,r)):[]}function nf(e,t,r,n){var i=e.jb;return K(n>i.Mc,"Stacking an older merge on top of newer ones"),i.na.push({path:t,children:r,kd:n,visible:!0}),i.T=Ve(i.T,t,r),i.Mc=n,r=De(r),mf(e,new xe(Pe,t,r))}function of(e,t,r){r=r||!1;var n=af(e.jb,t);if(e.jb.Rd(t)){var i=Nd;return null!=n.Ga?i=i.set(G,!0):ib(n.children,function(e,t){i=i.set(new L(e),t)}),mf(e,new Oe(n.path,i,r))}return[]}function pf(e,t,r){return r=De(r),mf(e,new xe(Re,t,r))}function qf(e,t,r,n){if(n=rf(e,n),null!=n){var i=sf(n);return n=i.path,i=i.Ib,t=O(n,t),r=new Wb(new Qe(!1,!0,i,!0),t,r),tf(e,n,r)}return[]}function uf(e,t,r,n){if(n=rf(e,n)){var i=sf(n);return n=i.path,i=i.Ib,t=O(n,t),r=De(r),r=new xe(new Qe(!1,!0,i,!0),t,r),tf(e,n,r)}return[]}function yf(e){return Ge(e,function(e,t,n){if(t&&null!=gf(t))return[gf(t)];var i=[];return t&&(i=hf(t)),r(n,function(e){i=i.concat(e)}),i})}function Bf(e,t){for(var r=0;r10485760/3&&10485760=e}else if(-1=e;return!1}function tg(){var e,t=window.opener.frames;for(e=t.length-1;e>=0;e--)try{if(t[e].location.protocol===window.location.protocol&&t[e].location.host===window.location.host&&"__winchan_relay_frame"===t[e].name)return t[e]}catch(r){}return null}function ug(e,t,r){e.attachEvent?e.attachEvent("on"+t,r):e.addEventListener&&e.addEventListener(t,r,!1)}function vg(e,t,r){e.detachEvent?e.detachEvent("on"+t,r):e.removeEventListener&&e.removeEventListener(t,r,!1)}function wg(e){/^https?:\/\//.test(e)||(e=window.location.href);var t=/^(https?:\/\/[\-_a-zA-Z\.0-9:]+)/.exec(e);return t?t[1]:e}function xg(e){var t="";try{e=e.replace("#","");var r=lb(e);r&&v(r,"__firebase_request_key")&&(t=w(r,"__firebase_request_key"))}catch(n){}return t}function yg(){var e=Qc(kg);return e.scheme+"://"+e.host+"/v2"}function zg(e){return yg()+"/"+e+"/auth/channel"}function Ag(e){var t=this;if(this.Ac=e,this.de="*",sg(8)?this.Rc=this.zd=tg():(this.Rc=window.opener,this.zd=window),!t.Rc)throw"Unable to find relay frame";ug(this.zd,"message",q(this.ic,this)),ug(this.zd,"message",q(this.Bf,this));try{Bg(this,{a:"ready"})}catch(r){ug(this.Rc,"load",function(){Bg(t,{a:"ready"})})}ug(window,"unload",q(this.zg,this))}function Bg(e,t){t=B(t),sg(8)?e.Rc.doPost(t,e.de):e.Rc.postMessage(t,e.de)}function Cg(e){this.pc=Ga()+Ga()+Ga(),this.Ef=e}function Eg(e){var t=Error(w(Dg,e),e);return t.code=e,t}function Fg(e){var t;(t=!e.window_features)||(t=pg(),t=-1!==t.indexOf("Fennec/")||-1!==t.indexOf("Firefox/")&&-1!==t.indexOf("Android")),t&&(e.window_features=void 0),e.window_name||(e.window_name="_blank"),this.options=e}function Gg(e){e.method||(e.method="GET"),e.headers||(e.headers={}),e.headers.content_type||(e.headers.content_type="application/json"),e.headers.content_type=e.headers.content_type.toLowerCase(),this.options=e}function Hg(e){this.pc=Ga()+Ga()+Ga(),this.Ef=e}function Ig(e){e.callback_parameter||(e.callback_parameter="callback"),this.options=e,window.__firebase_auth_jsonp=window.__firebase_auth_jsonp||{}}function Jg(e,t,r){setTimeout(function(){try{var n=document.createElement("script");n.type="text/javascript",n.id=e,n.async=!0,n.src=t,n.onerror=function(){var t=document.getElementById(e);null!==t&&t.parentNode.removeChild(t),r&&r(Eg("NETWORK_ERROR"))};var i=document.getElementsByTagName("head");(i&&0!=i.length?i[0]:document.documentElement).appendChild(n)}catch(o){r&&r(Eg("NETWORK_ERROR"))}},0)}function Kg(e,t,r,n){Lf.call(this,["auth_status"]),this.F=e,this.ef=t,this.Tg=r,this.Me=n,this.sc=new og(e,[Cc,P]),this.nb=null,this.Te=!1,Lg(this)}function Lg(e){P.get("redirect_request_id")&&Mg(e);var t=e.sc.get();t&&t.token?(Ng(e,t),e.ef(t.token,function(r,n){Og(e,r,n,!1,t.token,t)},function(t,r){Pg(e,"resumeSession()",t,r)})):Ng(e,null)}function Qg(e,t,r,n,i,o){"firebaseio-demo.com"===e.F.domain&&Q("Firebase authentication is not supported on demo Firebases (*.firebaseio-demo.com). To secure your Firebase, create a production Firebase at https://www.firebase.com."),e.ef(t,function(o,a){Og(e,o,a,!0,t,r,n||{},i)},function(t,r){Pg(e,"auth()",t,r,o)})}function Rg(e,t){e.sc.clear(),Ng(e,null),e.Tg(function(e,r){if("ok"===e)R(t,null);else{var n=(e||"error").toUpperCase(),i=n;r&&(i+=": "+r),i=Error(i),i.code=n,R(t,i)}})}function Og(e,t,r,n,i,o,a,s){"ok"===t?(n&&(t=r.auth,o.auth=t,o.expires=r.expires,o.token=bd(i)?i:"",r=null,t&&v(t,"uid")?r=w(t,"uid"):v(o,"uid")&&(r=w(o,"uid")),o.uid=r,r="custom",t&&v(t,"provider")?r=w(t,"provider"):v(o,"provider")&&(r=w(o,"provider")),o.provider=r,e.sc.clear(),bd(i)&&(a=a||{},r=Cc,"sessionOnly"===a.remember&&(r=P),"none"!==a.remember&&e.sc.set(o,r)),Ng(e,o)),R(s,null,o)):(e.sc.clear(),Ng(e,null),o=e=(t||"error").toUpperCase(),r&&(o+=": "+r),o=Error(o),o.code=e,R(s,o))}function Pg(e,t,r,n,i){Q(t+" was canceled: "+n),e.sc.clear(),Ng(e,null),e=Error(n),e.code=r.toUpperCase(),R(i,e)}function Sg(e,t,r,n,i){Tg(e),r=new lg(n||{},{},r||{}),Ug(e,[Gg,Ig],"/auth/"+t,r,i)}function Vg(e,t,r,n){Tg(e);var i=[Fg,Hg];r=ng(r),"anonymous"===t||"password"===t?setTimeout(function(){R(n,Eg("TRANSPORT_UNAVAILABLE"))},0):(r.fe.window_features="menubar=yes,modal=yes,alwaysRaised=yeslocation=yes,resizable=yes,scrollbars=yes,status=yes,height=625,width=625,top="+("object"==typeof screen?.5*(screen.height-625):0)+",left="+("object"==typeof screen?.5*(screen.width-625):0),r.fe.relay_url=zg(e.F.Db),r.fe.requestWithCredential=q(e.qc,e),Ug(e,i,"/auth/"+t,r,n))}function Mg(e){var t=P.get("redirect_request_id");if(t){var r=P.get("redirect_client_options");P.remove("redirect_request_id"),P.remove("redirect_client_options");var n=[Gg,Ig],t={requestId:t,requestKey:xg(document.location.hash)},r=new lg(r,{},t);e.Te=!0;try{document.location.hash=document.location.hash.replace(/&__firebase_request_key=([a-zA-z0-9]*)/,"")}catch(i){}Ug(e,n,"/auth/session",r,function(){this.Te=!1}.bind(e))}}function Ug(e,t,r,n,i){Wg(e,t,r,n,function(t,r){!t&&r&&r.token&&r.uid?Qg(e,r.token,r,n.od,function(e,t){e?R(i,e):R(i,null,t)}):R(i,t||Eg("UNKNOWN_ERROR"))})}function Wg(e,t,r,n,i){t=Pa(t,function(e){return"function"==typeof e.isAvailable&&e.isAvailable()}),0===t.length?setTimeout(function(){R(i,Eg("TRANSPORT_UNAVAILABLE"))},0):(t=new(t.shift())(n.fe),n=jb(n.$a),n.v="js-"+hb,n.transport=t.Cc(),n.suppress_status_codes=!0,e=yg()+"/"+e.F.Db+r,t.open(e,n,function(e,t){if(e)R(i,e);else if(t&&t.error){var r=Error(t.error.message);r.code=t.error.code,r.details=t.error.details,R(i,r)}else R(i,null,t)}))}function Ng(e,t){var r=null!==e.nb||null!==t;e.nb=t,r&&e.ge("auth_status",t),e.Me(null!==t)}function Tg(e){var t=e.F;if("firebaseio.com"!==t.domain&&"firebaseio-demo.com"!==t.domain&&"auth.firebase.com"===kg)throw Error("This custom Firebase server ('"+e.F.domain+"') does not support delegated login.")}function Xg(e){this.ic=e,this.Nd=[],this.Sb=0,this.re=-1,this.Gb=null}function Yg(e,t,r){e.re=t,e.Gb=r,e.redocument.domain="'+document.domain+'";'),e=""+e+"";try{this.Ea.fb.open(),this.Ea.fb.write(e),this.Ea.fb.close()}catch(o){Cb("frame writing exception"),o.stack&&Cb(o.stack),Cb(o)}}function fh(e){if(e.me&&e.Xd&&e.Qe.count()<(0=e.ad[0].kf.length+30+r.length;){var i=e.ad.shift(),r=r+"&seg"+n+"="+i.Kg+"&ts"+n+"="+i.Sg+"&d"+n+"="+i.kf;n++}return gh(e,t+r,e.ue),!0}return!1}function gh(e,t,r){function n(){e.Qe.remove(r),fh(e)}e.Qe.add(r,1);var i=setTimeout(n,Math.floor(25e3));eh(e,t,function(){clearTimeout(i),n()})}function eh(e,t,r){setTimeout(function(){try{if(e.Xd){var n=e.Ea.fb.createElement("script");n.type="text/javascript",n.async=!0,n.src=t,n.onload=n.onreadystatechange=function(){var e=n.readyState;e&&"loaded"!==e&&"complete"!==e||(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),r())},n.onerror=function(){Cb("Long-poll script failed to load: "+t),e.Xd=!1,e.close()},e.Ea.fb.body.appendChild(n)}}catch(i){}},Math.floor(1))}function ih(e,t,r){this.se=e,this.f=Nc(this.se),this.frames=this.Kc=null,this.ob=this.pb=this.cf=0,this.Va=Qb(t),this.eb=(t.lb?"wss://":"ws://")+t.Pa+"/.ws?v=5","undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(this.eb+="&r=f"),t.host!==t.Pa&&(this.eb=this.eb+"&ns="+t.Db),r&&(this.eb=this.eb+"&s="+r)}function lh(e,t){if(e.frames.push(t),e.frames.length==e.cf){var r=e.frames.join("");e.frames=null,r=nb(r),e.xg(r)}}function kh(e){clearInterval(e.Kc),e.Kc=setInterval(function(){e.ua&&e.ua.send("0"),kh(e)},Math.floor(45e3))}function mh(e){nh(this,e)}function nh(e,t){var r=ih&&ih.isAvailable(),n=r&&!(Cc.wf||!0===Cc.get("previous_websocket_failure"));if(t.Ug&&(r||Q("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),n=!0),n)e.gd=[ih];else{var i=e.gd=[];Xc(oh,function(e,t){t&&t.isAvailable()&&i.push(t)})}}function ph(e){if(00&&(e.yd=setTimeout(function(){e.yd=null,e.Bb||(e.I&&102400=e.Mf?(e.f("Secondary connection is healthy."),e.Bb=!0,e.D.Ed(),e.D.start(),e.f("sending client ack on secondary"),e.D.send({t:"c",d:{t:"a",d:{}}}),e.f("Ending transmission on primary"),e.I.send({t:"c",d:{t:"n",d:{}}}),e.hd=e.D,wh(e)):(e.f("sending ping on secondary."),e.D.send({t:"c",d:{t:"p",d:{}}}))}function yh(e){e.Bb||(e.Se--,0>=e.Se&&(e.f("Primary connection is healthy."),e.Bb=!0,e.I.Ed()))}function vh(e,t){e.D=new t("c:"+e.id+":"+e.ff++,e.F,e.Zd),e.Mf=t.responsesRequiredToBeHealthy||0,e.D.open(sh(e,e.D),th(e,e.D)),setTimeout(function(){e.D&&(e.f("Timed out trying to upgrade."),e.D.close())},Math.floor(6e4))}function uh(e,t,r){e.f("Realtime connection established."),e.I=t,e.Ua=1,e.Wc&&(e.Wc(r),e.Wc=null),0===e.Se?(e.f("Primary connection is healthy."),e.Bb=!0):setTimeout(function(){zh(e)},Math.floor(5e3))}function zh(e){e.Bb||1!==e.Ua||(e.f("sending ping on primary."),Bh(e,{t:"c",d:{t:"p",d:{}}}))}function Bh(e,t){if(1!==e.Ua)throw"Connection is not connected";e.hd.send(t)}function xh(e){e.f("Shutting down all connections"),e.I&&(e.I.close(),e.I=null),e.D&&(e.D.close(),e.D=null),e.yd&&(clearTimeout(e.yd),e.yd=null)}function Ch(e,t,r,n){this.id=Dh++,this.f=Nc("p:"+this.id+":"),this.xf=this.Fe=!1,this.$={},this.qa=[],this.Yc=0,this.Vc=[],this.oa=!1,this.Za=1e3,this.Fd=3e5,this.Hb=t,this.Uc=r,this.Pe=n,this.F=e,this.tb=this.Aa=this.Ia=this.Xe=null,this.Ob=!1,this.Td={},this.Jg=0,this.nf=!0,this.Lc=this.He=null,Eh(this,0),Pf.vb().Fb("visible",this.Ag,this),-1===e.host.indexOf("fblocal")&&Of.vb().Fb("online",this.yg,this)}function Gh(e,t){var r=t.Gg,n=r.path.toString(),i=r.va();e.f("Listen on "+n+" for "+i);var o={p:n};t.tag&&(o.q=ce(r.o),o.t=t.tag),o.h=t.xd(),e.Fa("q",o,function(o){var a=o.d,s=o.s;if(a&&"object"==typeof a&&v(a,"w")){var c=w(a,"w");ea(c)&&0<=Na(c,"no_index")&&Q("Using an unspecified index. Consider adding "+('".indexOn": "'+r.o.g.toString()+'"')+" at "+r.path.toString()+" to your security rules for better performance")}(e.$[n]&&e.$[n][i])===t&&(e.f("listen response",o),"ok"!==s&&Hh(e,n,i),t.G&&t.G(s,a))})}function Ih(e){var t=e.Aa;e.oa&&t&&e.Fa("auth",{cred:t.gg},function(r){var n=r.s;r=r.d||"error","ok"!==n&&e.Aa===t&&delete e.Aa,t.of?"ok"!==n&&t.md&&t.md(n,r):(t.of=!0,t.zc&&t.zc(n,r))})}function Jh(e,t,r,n,i){r={p:r,d:n},e.f("onDisconnect "+t,r),e.Fa(t,r,function(e){i&&setTimeout(function(){i(e.s,e.d)},Math.floor(0))})}function Kh(e,t,r,i,o,a){i={p:r,d:i},n(a)&&(i.h=a),e.qa.push({action:t,Jf:i,G:o}),e.Yc++,t=e.qa.length-1,e.oa?Lh(e,t):e.f("Buffering put: "+r)}function Lh(e,t){var r=e.qa[t].action,n=e.qa[t].Jf,i=e.qa[t].G;e.qa[t].Hg=e.oa,e.Fa(r,n,function(n){e.f(r+" response",n),delete e.qa[t],e.Yc--,0===e.Yc&&(e.qa=[]),i&&i(n.s,n.d)})}function Eh(e,t){K(!e.Ia,"Scheduling a connect when we're already connected/ing?"),e.tb&&clearTimeout(e.tb),e.tb=setTimeout(function(){e.tb=null,Oh(e)},Math.floor(t))}function Oh(e){if(Ph(e)){e.f("Making a connection attempt"),e.He=(new Date).getTime(),e.Lc=null;var t=q(e.Id,e),r=q(e.Wc,e),n=q(e.Df,e),i=e.id+":"+Fh++;e.Ia=new qh(i,e.F,t,r,n,function(t){Q(t+" ("+e.F.toString()+")"),e.xf=!0})}}function Mh(e,t,r){r=r?Qa(r,function(e){return Vc(e)}).join("$"):"default",(e=Hh(e,t,r))&&e.G&&e.G("permission_denied")}function Hh(e,t,r){t=new L(t).toString();var i;return n(e.$[t])?(i=e.$[t][r],delete e.$[t][r],0===pa(e.$[t])&&delete e.$[t]):i=void 0,i}function Nh(e){Ih(e),r(e.$,function(t){r(t,function(t){Gh(e,t)})});for(var t=0;t.firebaseio.com instead"),r&&"undefined"!=r||Pc("Cannot parse Firebase url. Please use https://.firebaseio.com"),n.lb||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&Q("Insecure Firebase access from a secure page. Please use https in calls to new Firebase()."),r=new Dc(n.host,n.lb,r,"ws"===n.scheme||"wss"===n.scheme),n=new L(n.$c),i=n.toString();var o;if(!(o=!p(r.host)||0===r.host.length||!Tf(r.Db))&&(o=0!==i.length)&&(i&&(i=i.replace(/^\/*\.info(\/|$)/,"/")),o=!(p(i)&&0!==i.length&&!Rf.test(i))),o)throw Error(z("new Firebase",1,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".');if(t)if(t instanceof W)i=t;else{if(!p(t))throw Error("Expected a valid Firebase.Context for second argument to new Firebase()");i=W.vb(),r.Od=t}else i=W.vb();o=r.toString();var a=w(i.oc,o);a||(a=new Qh(r,i.Qf),i.oc[o]=a),r=a}Y.call(this,r,n,$d,!1)}function Mc(e,t){K(!t||!0===e||!1===e,"Can't turn on custom loggers persistently."),!0===e?("undefined"!=typeof console&&("function"==typeof console.log?Bb=q(console.log,console):"object"==typeof console.log&&(Bb=function(e){console.log(e)})),t&&P.set("logging_enabled",!0)):e?Bb=e:(Bb=null,P.remove("logging_enabled"))}var g,aa=this,la=Date.now||function(){return+new Date},ya="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),Ea={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\x0B":"\\u000b"},Fa=/\uffff/.test("")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,Ha;e:{var Ia=aa.navigator;if(Ia){var Ja=Ia.userAgent;if(Ja){Ha=Ja;break e}}Ha=""}ma(La,Ka),La.prototype.reset=function(){this.P[0]=1732584193,this.P[1]=4023233417,this.P[2]=2562383102,this.P[3]=271733878,this.P[4]=3285377520,this.ee=this.ac=0},La.prototype.update=function(e,t){if(null!=e){n(t)||(t=e.length);for(var r=t-this.Wa,i=0,o=this.ne,a=this.ac;t>i;){if(0==a)for(;r>=i;)Ma(this,e,i),i+=this.Wa;if(p(e)){for(;t>i;)if(o[a]=e.charCodeAt(i),++a,++i,a==this.Wa){Ma(this,o),a=0;break}}else for(;t>i;)if(o[a]=e[i],++a,++i,a==this.Wa){Ma(this,o),a=0;break}}this.ac=a,this.ee+=t}};var u=Array.prototype,Na=u.indexOf?function(e,t,r){return u.indexOf.call(e,t,r)}:function(e,t,r){if(r=null==r?0:0>r?Math.max(0,e.length+r):r,p(e))return p(t)&&1==t.length?e.indexOf(t,r):-1;for(;ro;o++)o in i&&t.call(r,i[o],o,e)},Pa=u.filter?function(e,t,r){return u.filter.call(e,t,r)}:function(e,t,r){for(var n=e.length,i=[],o=0,a=p(e)?e.split(""):e,s=0;n>s;s++)if(s in a){var c=a[s];t.call(r,c,s,e)&&(i[o++]=c)}return i},Qa=u.map?function(e,t,r){return u.map.call(e,t,r)}:function(e,t,r){for(var n=e.length,i=Array(n),o=p(e)?e.split(""):e,a=0;n>a;a++)a in o&&(i[a]=t.call(r,o[a],a,e));return i},Ra=u.reduce?function(e,t,r,n){for(var i=[],o=1,a=arguments.length;a>o;o++)i.push(arguments[o]);return n&&(i[0]=q(t,n)),u.reduce.apply(e,i)}:function(e,t,r,n){var i=r;return Oa(e,function(r,o){i=t.call(n,i,r,o,e)}),i},Sa=u.every?function(e,t,r){return u.every.call(e,t,r)}:function(e,t,r){for(var n=e.length,i=p(e)?e.split(""):e,o=0;n>o;o++)if(o in i&&!t.call(r,i[o],o,e))return!1;return!0},Za=-1!=Ha.indexOf("Opera")||-1!=Ha.indexOf("OPR"),$a=-1!=Ha.indexOf("Trident")||-1!=Ha.indexOf("MSIE"),ab=-1!=Ha.indexOf("Gecko")&&-1==Ha.toLowerCase().indexOf("webkit")&&!(-1!=Ha.indexOf("Trident")||-1!=Ha.indexOf("MSIE")),bb=-1!=Ha.toLowerCase().indexOf("webkit");!function(){var e,t="";return Za&&aa.opera?(t=aa.opera.version,ha(t)?t():t):(ab?e=/rv\:([^\);]+)(\)|;)/:$a?e=/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/:bb&&(e=/WebKit\/(\S+)/),e&&(t=(t=e.exec(Ha))?t[1]:""),$a&&(e=(e=aa.document)?e.documentMode:void 0,e>parseFloat(t))?String(e):t)}();var cb=null,db=null,eb=null,hb=hb||"2.2.9";ob.prototype.j=function(e){return this.Wd.Y(e)},ob.prototype.toString=function(){return this.Wd.toString()},pb.prototype.qf=function(){return null},pb.prototype.ze=function(){return null};var qb=new pb;rb.prototype.qf=function(e){var t=this.Ka.Q;return sb(t,e)?t.j().J(e):(t=null!=this.Kd?new tb(this.Kd,!0,!1):this.Ka.C(),this.Rf.xc(e,t))},rb.prototype.ze=function(e,t,r){var n=null!=this.Kd?this.Kd:ub(this.Ka);return e=this.Rf.oe(n,t,1,r,e),0===e.length?null:e[0]},xb.prototype.add=function(e){this.vd.push(e)},xb.prototype.Zb=function(){return this.ra};var Fb="value";Gb.prototype.Zb=function(){var e=this.$d.mc();return"value"===this.ud?e.path:e.parent().path},Gb.prototype.Ae=function(){return this.ud},Gb.prototype.Vb=function(){return this.ve.Vb(this)},Gb.prototype.toString=function(){return this.Zb().toString()+":"+this.ud+":"+B(this.$d.mf())},Hb.prototype.Zb=function(){return this.path},Hb.prototype.Ae=function(){return"cancel"},Hb.prototype.Vb=function(){return this.ve.Vb(this)},Hb.prototype.toString=function(){return this.path.toString()+":cancel"},tb.prototype.j=function(){return this.w},Kb.prototype.get=function(){var e=this.eg.get(),t=xa(e);if(this.Dd)for(var r in this.Dd)t[r]-=this.Dd[r];return this.Dd=e,t},Lb.prototype.If=function(){var e,t=this.fd.get(),r={},n=!1;for(e in t)0t?r=r.left:t>0&&(r=r.right)}return null},g.e=function(){return this.wa.e()},g.count=function(){return this.wa.count()},g.Sc=function(){return this.wa.Sc()},g.fc=function(){return this.wa.fc()},g.ia=function(e){return this.wa.ia(e)},g.Xb=function(e){return new cc(this.wa,null,this.La,!1,e)},g.Yb=function(e,t){return new cc(this.wa,e,this.La,!1,t)},g.$b=function(e,t){return new cc(this.wa,e,this.La,!0,t)},g.sf=function(e){return new cc(this.wa,null,this.La,!0,e)},g=ec.prototype,g.X=function(e,t,r,n,i){return new ec(null!=e?e:this.key,null!=t?t:this.value,null!=r?r:this.color,null!=n?n:this.left,null!=i?i:this.right)},g.count=function(){return this.left.count()+1+this.right.count()},g.e=function(){return!1},g.ia=function(e){return this.left.ia(e)||e(this.key,this.value)||this.right.ia(e)},g.Sc=function(){return fc(this).key},g.fc=function(){return this.right.e()?this.key:this.right.fc()},g.Oa=function(e,t,r){var n,i;return i=this,n=r(e,i.key),i=0>n?i.X(null,null,null,i.left.Oa(e,t,r),null):0===n?i.X(null,t,null,null,null):i.X(null,null,null,null,i.right.Oa(e,t,r)),gc(i)},g.remove=function(e,t){var r,n;if(r=this,0>t(e,r.key))r.left.e()||r.left.fa()||r.left.left.fa()||(r=ic(r)),r=r.X(null,null,null,r.left.remove(e,t),null);else{if(r.left.fa()&&(r=jc(r)),r.right.e()||r.right.fa()||r.right.left.fa()||(r=kc(r),r.left.left.fa()&&(r=jc(r),r=kc(r))),0===t(e,r.key)){if(r.right.e())return ac;n=fc(r.right),r=r.X(n.key,n.value,null,null,hc(r.right))}r=r.X(null,null,null,null,r.right.remove(e,t))}return gc(r)},g.fa=function(){return this.color},g=mc.prototype,g.X=function(){return this},g.Oa=function(e,t){return new ec(e,t,null)},g.remove=function(){return this},g.count=function(){return 0},g.e=function(){return!0},g.ia=function(){return!1},g.Sc=function(){return null},g.fc=function(){return null},g.fa=function(){return!1};var ac=new mc;g=L.prototype,g.toString=function(){for(var e="",t=this.Z;t=this.n.length)return null;for(var e=[],t=this.Z;t=this.n.length},g.ca=function(e){if(tc(this)!==tc(e))return!1;for(var t=this.Z,r=e.Z;t<=this.n.length;t++,r++)if(this.n[t]!==e.n[r])return!1;return!0},g.contains=function(e){var t=this.Z,r=e.Z;if(tc(this)>tc(e))return!1;for(;t"),e};var Fc=function(){var e=1;return function(){return e++}}(),Bb=null,Lc=!0,Zc=/^-?\d{1,10}$/;cd.prototype.fg=function(e,t){if(null==e.Xa||null==t.Xa)throw Gc("Should only compare child_ events.");return this.g.compare(new F(e.Xa,e.Ja),new F(t.Xa,t.Ja))},g=id.prototype,g.Kf=function(e){return"value"===e},g.createEvent=function(e,t){var r=t.o.g;return new Gb("value",this,new S(e.Ja,t.mc(),r))},g.Vb=function(e){var t=this.sb;if("cancel"===e.Ae()){K(this.qb,"Raising a cancel event on a listener with no cancel callback");var r=this.qb;return function(){r.call(t,e.error)}}var n=this.Rb;return function(){n.call(t,e.$d)}},g.gf=function(e,t){return this.qb?new Hb(this,e,t):null},g.matches=function(e){return e instanceof id?e.Rb&&this.Rb?e.Rb===this.Rb&&e.sb===this.sb:!0:!1},g.tf=function(){return null!==this.Rb},g=jd.prototype,g.Kf=function(e){return e="children_added"===e?"child_added":e,("children_removed"===e?"child_removed":e)in this.ha},g.gf=function(e,t){return this.qb?new Hb(this,e,t):null},g.createEvent=function(e,t){K(null!=e.Xa,"Child events should have a childName.");var r=t.mc().u(e.Xa);return new Gb(e.type,this,new S(e.Ja,r,t.o.g),e.Qd)},g.Vb=function(e){var t=this.sb;if("cancel"===e.Ae()){K(this.qb,"Raising a cancel event on a listener with no cancel callback");var r=this.qb;return function(){r.call(t,e.error)}}var n=this.ha[e.ud];return function(){n.call(t,e.$d,e.Qd)}},g.matches=function(e){if(e instanceof jd){if(!this.ha||!e.ha)return!0;if(this.sb===e.sb){var t=pa(e.ha);if(t===pa(this.ha)){if(1===t){var t=qa(e.ha),r=qa(this.ha);return!(r!==t||e.ha[t]&&this.ha[r]&&e.ha[t]!==this.ha[r])}return oa(this.ha,function(t,r){return e.ha[r]===t})}}}return!1},g.tf=function(){return null!==this.ha},g=kd.prototype,g.K=function(e,t,r,n,i,o){return K(e.Jc(this.g),"A node must be indexed if only a child is updated"),i=e.J(t),i.Y(n).ca(r.Y(n))&&i.e()==r.e()?e:(null!=o&&(r.e()?e.Da(t)?hd(o,new D("child_removed",i,t)):K(e.L(),"A child remove without an old child only makes sense on a leaf node"):i.e()?hd(o,new D("child_added",r,t)):hd(o,new D("child_changed",r,t,i))),e.L()&&r.e()?e:e.O(t,r).mb(this.g))},g.xa=function(e,t,r){return null!=r&&(e.L()||e.R(N,function(e,n){t.Da(e)||hd(r,new D("child_removed",n,e))}),t.L()||t.R(N,function(t,n){if(e.Da(t)){var i=e.J(t);i.ca(n)||hd(r,new D("child_changed",n,t,i))}else hd(r,new D("child_added",n,t))})),t.mb(this.g)},g.ga=function(e,t){return e.e()?C:e.ga(t)},g.Na=function(){return!1},g.Wb=function(){return this},g=ld.prototype,g.matches=function(e){return 0>=this.g.compare(this.ed,e)&&0>=this.g.compare(e,this.Gc)},g.K=function(e,t,r,n,i,o){return this.matches(new F(t,r))||(r=C),this.Ce.K(e,t,r,n,i,o)},g.xa=function(e,t,r){t.L()&&(t=C);var n=t.mb(this.g),n=n.ga(C),i=this;return t.R(N,function(e,t){i.matches(new F(e,t))||(n=n.O(e,C))}),this.Ce.xa(e,n,r)},g.ga=function(e){return e},g.Na=function(){return!0},g.Wb=function(){return this.Ce},g=qd.prototype,g.K=function(e,t,r,n,i,o){return this.sa.matches(new F(t,r))||(r=C),e.J(t).ca(r)?e:e.Eb()=this.g.compare(this.sa.ed,a):0>=this.g.compare(a,this.sa.Gc)))break;n=n.O(a.name,a.S),i++}}else{n=t.mb(this.g),n=n.ga(C);var s,c,u;if(this.Jb){t=n.sf(this.g),s=this.sa.Gc,c=this.sa.ed;var h=td(this.g);u=function(e,t){return h(t,e)}}else t=n.Xb(this.g),s=this.sa.ed,c=this.sa.Gc,u=td(this.g);for(var i=0,l=!1;0=u(s,a)&&(l=!0),(o=l&&i=u(a,c))?i++:n=n.O(a.name,C)}return this.sa.Wb().xa(e,n,r)},g.ga=function(e){return e},g.Na=function(){return!0},g.Wb=function(){return this.sa.Wb()},yd.prototype.ab=function(e,t,r,n){var i,o=new gd;if(t.type===Xb)t.source.xe?r=zd(this,e,t.path,t.Ga,r,n,o):(K(t.source.pf,"Unknown source."),i=t.source.bf,r=Ad(this,e,t.path,t.Ga,r,n,i,o));else if(t.type===Bd)t.source.xe?r=Cd(this,e,t.path,t.children,r,n,o):(K(t.source.pf,"Unknown source."),i=t.source.bf,r=Dd(this,e,t.path,t.children,r,n,i,o));else if(t.type===Ed)if(t.Vd)if(t=t.path,null!=r.tc(t))r=e;else{if(i=new rb(r,e,n),n=e.Q.j(),t.e()||".priority"===E(t))Ib(e.C())?t=r.za(ub(e)):(t=e.C().j(),K(t instanceof T,"serverChildren would be complete if leaf node"),t=r.yc(t)),t=this.U.xa(n,t,o);else{var a=E(t),s=r.xc(a,e.C());null==s&&sb(e.C(),a)&&(s=n.J(a)),t=null!=s?this.U.K(n,a,s,H(t),i,o):e.Q.j().Da(a)?this.U.K(n,a,C,H(t),i,o):n,t.e()&&Ib(e.C())&&(n=r.za(ub(e)),n.L()&&(t=this.U.xa(t,n,o)))}n=Ib(e.C())||null!=r.tc(G),r=Fd(e,t,n,this.U.Na())}else r=Gd(this,e,t.path,t.Qb,r,n,o);else{if(t.type!==Zb)throw Gc("Unknown operation type: "+t.type);n=t.path,t=e.C(),i=t.j(),a=t.ea||n.e(),r=Hd(this,new Id(e.Q,new tb(i,a,t.Ub)),n,r,qb,o)}return o=ra(o.bb),n=r,t=n.Q,t.ea&&(i=t.j().L()||t.j().e(),a=Jd(e),(0=0,"Unknown leaf type: "+t),K(i>=0,"Unknown leaf type: "+r),n===i?"object"===r?0:this.An){var o,a=[];for(o in t)a[o]=t[o];return a}return e&&!this.B().e()&&(t[".priority"]=this.B().H()),t},g.hash=function(){if(null===this.Cb){var e="";this.B().e()||(e+="priority:"+me(this.B().H())+":"),this.R(N,function(t,r){var n=r.hash();""!==n&&(e+=":"+t+":"+n)}),this.Cb=""===e?"":Ic(e)}return this.Cb},g.rf=function(e,t,r){return(r=oe(this,r))?(e=bc(r,new F(e,t)))?e.name:null:bc(this.m,e)},g.R=function(e,t){var r=oe(this,e);return r?r.ia(function(e){return t(e.name,e.S)}):this.m.ia(t)},g.Xb=function(e){return this.Yb(e.Tc(),e)},g.Yb=function(e,t){var r=oe(this,t);if(r)return r.Yb(e,function(e){return e});for(var r=this.m.Yb(e.name,Sb),n=dc(r);null!=n&&0>t.compare(n,e);)J(r),n=dc(r);return r},g.sf=function(e){return this.$b(e.Qc(),e)},g.$b=function(e,t){var r=oe(this,t);if(r)return r.$b(e,function(e){return e});for(var r=this.m.$b(e.name,Sb),n=dc(r);null!=n&&0e?-1:1});g=Be.prototype,g.e=function(){return null===this.value&&this.children.e()},g.subtree=function(e){if(e.e())return this;var t=this.children.get(E(e));return null!==t?t.subtree(H(e)):Nd},g.set=function(e,t){if(e.e())return new Be(t,this.children);var r=E(e),n=(this.children.get(r)||Nd).set(H(e),t),r=this.children.Oa(r,n);return new Be(this.value,r)},g.remove=function(e){if(e.e())return this.children.e()?Nd:new Be(null,this.children);var t=E(e),r=this.children.get(t);return r?(e=r.remove(H(e)),t=e.e()?this.children.remove(t):this.children.Oa(t,e),null===this.value&&t.e()?Nd:new Be(this.value,t)):this},g.get=function(e){if(e.e())return this.value;var t=this.children.get(E(e));return t?t.get(H(e)):null};var Nd=new Be(null);Be.prototype.toString=function(){var e={};return Kd(this,function(t,r){e[t.toString()]=r.toString()}),B(e)},Oe.prototype.Xc=function(e){return this.path.e()?null!=this.Qb.value?(K(this.Qb.children.e(),"affectedTree should not have overlapping affected paths."),this):(e=this.Qb.subtree(new L(e)),new Oe(G,e,this.Vd)):(K(E(this.path)===e,"operationForChild called for unrelated child."),new Oe(H(this.path),this.Qb,this.Vd))},Oe.prototype.toString=function(){return"Operation("+this.path+": "+this.source.toString()+" ack write revert="+this.Vd+" affectedTree="+this.Qb+")"};var Xb=0,Bd=1,Ed=2,Zb=3,Pe=new Qe(!0,!1,null,!1),Re=new Qe(!1,!0,null,!1);Qe.prototype.toString=function(){return this.xe?"user":this.bf?"server(queryID="+this.Ib+")":"server"};var Te=new Se(new Be(null));Se.prototype.Rd=function(e){return e.e()?Te:(e=Md(this.W,e,Nd),new Se(e))},Se.prototype.e=function(){return this.W.e()},Se.prototype.apply=function(e){return Ze(G,this.W,e)},g=$e.prototype,g.Rd=function(e){var t=Ua(this.na,function(t){return t.kd===e});K(t>=0,"removeWrite called with nonexistent writeId.");var n=this.na[t];this.na.splice(t,1);for(var i=n.visible,o=!1,a=this.na.length-1;i&&a>=0;){var s=this.na[a];s.visible&&(a>=t&&bf(s,n.path)?i=!1:n.path.contains(s.path)&&(o=!0)),a--}if(i){if(o)this.T=cf(this.na,df,G),this.Mc=0=0;o--)i[o]="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".charAt(r%64),r=Math.floor(r/64);if(K(0===r,"Cannot push at time == 0"),r=i.join(""),n){for(o=11;o>=0&&63===t[o];o--)t[o]=0;t[o]++}else for(o=0;12>o;o++)t[o]=Math.floor(64*Math.random());for(o=0;12>o;o++)r+="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".charAt(t[o]);return K(20===r.length,"nextPushId: Length should be 20."),
-r}}();ma(Of,Lf),Of.prototype.Be=function(e){return K("online"===e,"Unknown event type: "+e),[this.jc]},ca(Of),ma(Pf,Lf),Pf.prototype.Be=function(e){return K("visible"===e,"Unknown event type: "+e),[this.Ob]},ca(Pf);var Qf=/[\[\].#$\/\u0000-\u001F\u007F]/,Rf=/[\[\].#$\u0000-\u001F\u007F]/,Sf=/^[a-zA-Z][a-zA-Z._\-+]+$/;g=hg.prototype,g.add=function(e,t){this.set[e]=null!==t?t:!0},g.contains=function(e){return v(this.set,e)},g.get=function(e){return this.contains(e)?this.set[e]:void 0},g.remove=function(e){delete this.set[e]},g.clear=function(){this.set={}},g.e=function(){return wa(this.set)},g.count=function(){return pa(this.set)},g.keys=function(){var e=[];return r(this.set,function(t,r){e.push(r)}),e},pc.prototype.find=function(e){if(null!=this.A)return this.A.Y(e);if(e.e()||null==this.m)return null;var t=E(e);return e=H(e),this.m.contains(t)?this.m.get(t).find(e):null},pc.prototype.nc=function(e,t){if(e.e())this.A=t,this.m=null;else if(null!==this.A)this.A=this.A.K(e,t);else{null==this.m&&(this.m=new hg);var r=E(e);this.m.contains(r)||this.m.add(r,new pc),r=this.m.get(r),e=H(e),r.nc(e,t)}},pc.prototype.R=function(e){null!==this.m&&ig(this.m,function(t,r){e(t,r)})};var kg="auth.firebase.com",mg=["remember","redirectTo"];og.prototype.set=function(e,t){if(!t){if(!this.ce.length)throw Error("fb.login.SessionManager : No storage options available!");t=this.ce[0]}t.set(this.Re,e)},og.prototype.get=function(){var e=Qa(this.ce,q(this.og,this)),e=Pa(e,function(e){return null!==e});return Xa(e,function(e,t){return ad(t.token)-ad(e.token)}),0o.status){try{e=nb(o.responseText)}catch(t){}r(null,e)}else r(500<=o.status&&600>o.status?Eg("SERVER_ERROR"):Eg("NETWORK_ERROR"));r=null,vg(window,"beforeunload",n)}},"GET"===a)e+=(/\?/.test(e)?"":"?")+kb(t),i=null;else{var s=this.options.headers.content_type;"application/json"===s&&(i=B(t)),"application/x-www-form-urlencoded"===s&&(i=kb(t))}o.open(a,e,!0),e={"X-Requested-With":"XMLHttpRequest",Accept:"application/json;text/plain"},za(e,this.options.headers);for(var c in e)o.setRequestHeader(c,e[c]);o.send(i)},Gg.isAvailable=function(){var e;return(e=!!window.XMLHttpRequest)&&(e=pg(),e=!(e.match(/MSIE/)||e.match(/Trident/))||sg(10)),e},Gg.prototype.Cc=function(){return"json"},Hg.prototype.open=function(e,t,r){function n(){r&&(r(Eg("USER_CANCELLED")),r=null)}var i,o=this,a=Qc(kg);t.requestId=this.pc,t.redirectTo=a.scheme+"://"+a.host+"/blank/page.html",e+=/\?/.test(e)?"":"?",e+=kb(t),(i=window.open(e,"_blank","location=no"))&&ha(i.addEventListener)?(i.addEventListener("loadstart",function(e){var t;if(t=e&&e.url)e:{try{var s=document.createElement("a");s.href=e.url,t=s.host===a.host&&"/blank/page.html"===s.pathname;break e}catch(c){}t=!1}t&&(e=xg(e.url),i.removeEventListener("exit",n),i.close(),e=new lg(null,null,{requestId:o.pc,requestKey:e}),o.Ef.requestWithCredential("/auth/session",e,r),r=null)}),i.addEventListener("exit",n)):r(Eg("TRANSPORT_UNAVAILABLE"))},Hg.isAvailable=function(){return qg()},Hg.prototype.Cc=function(){return"redirect"},Ig.prototype.open=function(e,t,r){function n(){r&&(r(Eg("REQUEST_INTERRUPTED")),r=null)}function i(){setTimeout(function(){window.__firebase_auth_jsonp[o]=void 0,wa(window.__firebase_auth_jsonp)&&(window.__firebase_auth_jsonp=void 0);try{var e=document.getElementById(o);e&&e.parentNode.removeChild(e)}catch(t){}},1),vg(window,"beforeunload",n)}var o="fn"+(new Date).getTime()+Math.floor(99999*Math.random());t[this.options.callback_parameter]="__firebase_auth_jsonp."+o,e+=(/\?/.test(e)?"":"?")+kb(t),ug(window,"beforeunload",n),window.__firebase_auth_jsonp[o]=function(e){r&&(r(null,e),r=null),i()},Jg(o,e,r)},Ig.isAvailable=function(){return"undefined"!=typeof document&&null!=document.createElement},Ig.prototype.Cc=function(){return"json"},ma(Kg,Lf),g=Kg.prototype,g.ye=function(){return this.nb||null},g.te=function(e,t){Tg(this);var r=ng(e);r.$a._method="POST",this.qc("/users",r,function(e,r){e?R(t,e):R(t,e,r)})},g.Ue=function(e,t){var r=this;Tg(this);var n="/users/"+encodeURIComponent(e.email),i=ng(e);i.$a._method="DELETE",this.qc(n,i,function(e,n){!e&&n&&n.uid&&r.nb&&r.nb.uid&&r.nb.uid===n.uid&&Rg(r),R(t,e)})},g.qe=function(e,t){Tg(this);var r="/users/"+encodeURIComponent(e.email)+"/password",n=ng(e);n.$a._method="PUT",n.$a.password=e.newPassword,this.qc(r,n,function(e){R(t,e)})},g.pe=function(e,t){Tg(this);var r="/users/"+encodeURIComponent(e.oldEmail)+"/email",n=ng(e);n.$a._method="PUT",n.$a.email=e.newEmail,n.$a.password=e.password,this.qc(r,n,function(e){R(t,e)})},g.We=function(e,t){Tg(this);var r="/users/"+encodeURIComponent(e.email)+"/password",n=ng(e);n.$a._method="POST",this.qc(r,n,function(e){R(t,e)})},g.qc=function(e,t,r){Wg(this,[Gg,Ig],e,t,r)},g.Be=function(e){return K("auth_status"===e,'initial event must be of type "auth_status"'),this.Te?null:[this.nb]};var ah,bh;$g.prototype.open=function(e,t){this.hf=0,this.la=t,this.Af=new Xg(e),this.Ab=!1;var r=this;this.rb=setTimeout(function(){r.f("Timed out trying to connect."),r.hb(),r.rb=null},Math.floor(3e4)),Sc(function(){if(!r.Ab){r.Ta=new ch(function(e,t,n,i,o){if(dh(r,arguments),r.Ta)if(r.rb&&(clearTimeout(r.rb),r.rb=null),r.Hc=!0,"start"==e)r.id=t,r.Gf=n;else{if("close"!==e)throw Error("Unrecognized command received: "+e);t?(r.Ta.Xd=!1,Yg(r.Af,t,function(){r.hb()})):r.hb()}},function(e,t){dh(r,arguments),Zg(r.Af,e,t)},function(){r.hb()},r.jd);var e={start:"t"};e.ser=Math.floor(1e8*Math.random()),r.Ta.ie&&(e.cb=r.Ta.ie),e.v="5",r.Zd&&(e.s=r.Zd),"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(e.r="f"),e=r.jd(e),r.f("Connecting via long-poll to "+e),eh(r.Ta,e,function(){})}})},$g.prototype.start=function(){var e=this.Ta,t=this.Gf;for(e.sg=this.id,e.tg=t,e.me=!0;fh(e););e=this.id,t=this.Gf,this.gc=document.createElement("iframe");var r={dframe:"t"};r.id=e,r.pw=t,this.gc.src=this.jd(r),this.gc.style.display="none",document.body.appendChild(this.gc)},$g.isAvailable=function(){return ah||!bh&&"undefined"!=typeof document&&null!=document.createElement&&!("object"==typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))&&!("object"==typeof Windows&&"object"==typeof Windows.Vg)&&!0},g=$g.prototype,g.Ed=function(){},g.dd=function(){this.Ab=!0,this.Ta&&(this.Ta.close(),this.Ta=null),this.gc&&(document.body.removeChild(this.gc),this.gc=null),this.rb&&(clearTimeout(this.rb),this.rb=null)},g.hb=function(){this.Ab||(this.f("Longpoll is closing itself"),this.dd(),this.la&&(this.la(this.Hc),this.la=null))},g.close=function(){this.Ab||(this.f("Longpoll is being closed."),this.dd())},g.send=function(e){e=B(e),this.pb+=e.length,Nb(this.Va,"bytes_sent",e.length),e=Jc(e),e=fb(e,!0),e=Wc(e,1840);for(var t=0;t=e.length){var t=Number(e);if(!isNaN(t)){i.cf=t,i.frames=[],e=null;break e}}i.cf=1,i.frames=[]}null!==e&&lh(i,e)}},this.ua.onerror=function(e){i.f("WebSocket error. Closing connection."),(e=e.message||e.data)&&i.f(e),i.hb()}},ih.prototype.start=function(){},ih.isAvailable=function(){var e=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var t=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);t&&1parseFloat(t[1])&&(e=!0)}return!e&&null!==hh&&!jh},ih.responsesRequiredToBeHealthy=2,ih.healthyTimeout=3e4,g=ih.prototype,g.Ed=function(){Cc.remove("previous_websocket_failure")},g.send=function(e){kh(this),e=B(e),this.pb+=e.length,Nb(this.Va,"bytes_sent",e.length),e=Wc(e,16384),1i;i++)t+=" ";console.log(t+n)}}},g.$e=function(e){Nb(this.Va,e),this.Qg.Nf[e]=!0},g.f=function(e){var t="";this.Sa&&(t=this.Sa.id+":"),Cb(t,arguments)},W.prototype.zb=function(){for(var e in this.oc)this.oc[e].zb()},W.prototype.rc=function(){for(var e in this.oc)this.oc[e].rc()},W.prototype.we=function(){this.Qf=!0},ca(W),W.prototype.interrupt=W.prototype.zb,W.prototype.resume=W.prototype.rc,X.prototype.cancel=function(e){x("Firebase.onDisconnect().cancel",0,1,arguments.length),A("Firebase.onDisconnect().cancel",1,e,!0),this.bd.Jd(this.ra,e||null)},X.prototype.cancel=X.prototype.cancel,X.prototype.remove=function(e){x("Firebase.onDisconnect().remove",0,1,arguments.length),bg("Firebase.onDisconnect().remove",this.ra),A("Firebase.onDisconnect().remove",1,e,!0),Yh(this.bd,this.ra,null,e)},X.prototype.remove=X.prototype.remove,X.prototype.set=function(e,t){x("Firebase.onDisconnect().set",1,2,arguments.length),bg("Firebase.onDisconnect().set",this.ra),Vf("Firebase.onDisconnect().set",e,this.ra,!1),A("Firebase.onDisconnect().set",2,t,!0),Yh(this.bd,this.ra,e,t)},X.prototype.set=X.prototype.set,X.prototype.Kb=function(e,t,r){x("Firebase.onDisconnect().setWithPriority",2,3,arguments.length),bg("Firebase.onDisconnect().setWithPriority",this.ra),Vf("Firebase.onDisconnect().setWithPriority",e,this.ra,!1),Yf("Firebase.onDisconnect().setWithPriority",2,t),A("Firebase.onDisconnect().setWithPriority",3,r,!0),Zh(this.bd,this.ra,e,t,r)},X.prototype.setWithPriority=X.prototype.Kb,X.prototype.update=function(e,t){if(x("Firebase.onDisconnect().update",1,2,arguments.length),bg("Firebase.onDisconnect().update",this.ra),ea(e)){for(var r={},n=0;n=e)throw Error("Query.limit: First argument must be a positive integer.");if(this.o.ja)throw Error("Query.limit: Limit was already set (by another call to limit, limitToFirst, orlimitToLast.");var t=this.o.Ie(e);return li(t),new Y(this.k,this.path,t,this.kc)},g.Je=function(e){if(x("Query.limitToFirst",1,1,arguments.length),!ga(e)||Math.floor(e)!==e||0>=e)throw Error("Query.limitToFirst: First argument must be a positive integer.");if(this.o.ja)throw Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new Y(this.k,this.path,this.o.Je(e),this.kc)},g.Ke=function(e){if(x("Query.limitToLast",1,1,arguments.length),!ga(e)||Math.floor(e)!==e||0>=e)throw Error("Query.limitToLast: First argument must be a positive integer.");if(this.o.ja)throw Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new Y(this.k,this.path,this.o.Ke(e),this.kc)},g.Cg=function(e){if(x("Query.orderByChild",1,1,arguments.length),"$key"===e)throw Error('Query.orderByChild: "$key" is invalid. Use Query.orderByKey() instead.');if("$priority"===e)throw Error('Query.orderByChild: "$priority" is invalid. Use Query.orderByPriority() instead.');if("$value"===e)throw Error('Query.orderByChild: "$value" is invalid. Use Query.orderByValue() instead.');$f("Query.orderByChild",1,e,!1),mi(this,"Query.orderByChild");var t=be(this.o,new Sd(e));return ki(t),new Y(this.k,this.path,t,!0)},g.Dg=function(){x("Query.orderByKey",0,0,arguments.length),mi(this,"Query.orderByKey");var e=be(this.o,Od);return ki(e),new Y(this.k,this.path,e,!0)},g.Eg=function(){x("Query.orderByPriority",0,0,arguments.length),mi(this,"Query.orderByPriority");var e=be(this.o,N);return ki(e),new Y(this.k,this.path,e,!0)},g.Fg=function(){x("Query.orderByValue",0,0,arguments.length),mi(this,"Query.orderByValue");var e=be(this.o,Yd);return ki(e),new Y(this.k,this.path,e,!0)},g.ae=function(e,t){x("Query.startAt",0,2,arguments.length),Vf("Query.startAt",e,this.path,!0),$f("Query.startAt",2,t,!0);var r=this.o.ae(e,t);if(li(r),ki(r),this.o.ma)throw Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return n(e)||(t=e=null),new Y(this.k,this.path,r,this.kc)},g.td=function(e,t){x("Query.endAt",0,2,arguments.length),Vf("Query.endAt",e,this.path,!0),$f("Query.endAt",2,t,!0);var r=this.o.td(e,t);if(li(r),ki(r),this.o.pa)throw Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new Y(this.k,this.path,r,this.kc)},g.ig=function(e,t){if(x("Query.equalTo",1,2,arguments.length),Vf("Query.equalTo",e,this.path,!1),$f("Query.equalTo",2,t,!0),this.o.ma)throw Error("Query.equalTo: Starting point was already set (by another call to endAt or equalTo).");if(this.o.pa)throw Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.ae(e,t).td(e,t)},g.toString=function(){x("Query.toString",0,0,arguments.length);for(var e=this.path,t="",r=e.Z;r"+c.toUpperCase()+"
",t.appendChild(r),u){var n="VR mode does not support preview tiles. Stopping code execution.";throw console.log("ERROR: "+n),new Error(n)}if(!h){var o=document.createElement("span");o.className="altspace-vr-notice",o.innerHTML="View
",t.insertBefore(o,r);var s=document.createElement("span");s.className="altspace-vr-notice",s.innerHTML='in AltspaceVR
',t.appendChild(s);var n="Not in VR mode. Stopping code execution.";throw u&&console.log("ERROR: "+n),new Error(n)}}}function r(e){c=e}function n(){var e=document.querySelector("link[rel=canonical]"),t=e?e.href:window.location.href;return new s(t)}function i(){var e=n(),t=e.path.split("/"),r=t[t.length-1];return r}function o(){var e=n(),t=e.path.split("/"),r="team"==t[1],i=r?"team-"+t[2]:t[1];return i}var a=window.Please,s=window.Url,c="VR CodePen",u=window.name&&"pen-"===window.name.slice(0,4),h=!!window.altspace.inClient,l=!!location.href.match("codepen.io/");return{inTile:u,inVR:h,inCodePen:l,ensureInVR:t,setName:r,getPenId:i,getAuthorId:o,printDebugInfo:e}}(),window.altspace=window.altspace||{},window.altspace.utilities=window.altspace.utilities||{},altspace.utilities.Simulation=function(e){function t(){window.requestAnimationFrame(t),a.updateAllBehaviors&&a.updateAllBehaviors(),n.render(a,i)}function r(){function e(){n=altspace.getThreeJSRenderer(),i=new THREE.PerspectiveCamera,altspace.getThreeJSTrackingSkeleton(function(e){var t=e;t.getJoint("Eye").add(i)})}function t(){n=new THREE.WebGLRenderer({antialias:!0}),i=new THREE.PerspectiveCamera,i.position.z=500;var e=function(){i.aspect=window.innerWidth/window.innerHeight,i.updateProjectionMatrix(),n.setSize(window.innerWidth,window.innerHeight)};document.addEventListener("DOMContentLoaded",function(e){document.body.style.margin="0px",document.body.style.overflow="hidden",n.setClearColor("#035F72");var t=document.createElement("div");document.body.appendChild(t),t.appendChild(n.domElement)}),window.addEventListener("resize",e),e(),i.fov=45,i.near=1,i.far=2e3,a.add(i),a.add(new THREE.AmbientLight("white"));var t=altspace&&altspace.utilities&&altspace.utilities.shims&&altspace.utilities.shims.cursor;t&&altspace.utilities.shims.cursor.init(a,i)}altspace&&altspace.inClient?e():t()}e=e||{},void 0===e.auto&&(e.auto=!0);var n,i,o={},a=new THREE.Scene;return r(),e.auto&&window.requestAnimationFrame(t),Object.defineProperty(o,"scene",{get:function(){return a}}),Object.defineProperty(o,"renderer",{get:function(){return n}}),Object.defineProperty(o,"camera",{get:function(){return i},set:function(e){i=e}}),o},window.altspace=window.altspace||{},window.altspace.utilities=window.altspace.utilities||{},altspace.utilities.multiloader=function(){function e(){var e,t=[],r=[],n=[],i=0;return{objUrls:t,mtlUrls:r,objects:n,error:e,objectsLoaded:i}}function t(e){var t=e||{};o=t.TRACE||!1,t.crossOrigin&&(s=t.crossOrigin),t.baseUrl&&(a=t.baseUrl),"/"!==a.slice(-1)&&(a+="/"),i=new THREE.OBJMTLLoader,i.crossOrigin=s,o&&console.log("MultiLoader initialized with params",e)}function r(t,r){var s=t,c=Date.now();if(!s||!s instanceof e)throw new Error("MultiLoader.load expects first arg of type LoadRequest");if(!r||"function"!=typeof r)throw new Error("MultiLoader.load expects second arg of type function");if(!s.objUrls||!s.mtlUrls||s.objUrls.length!==s.mtlUrls.length)throw new Error("MultiLoader.load called with bad LoadRequest");var u=s.objUrls.length;o&&console.log("Loading models...");for(var h=0;u>h;h++){var l=function(e,t){var s=a+e.objUrls[t],h=a+e.mtlUrls[t];o&&console.log("Loading obj:"+s+", mtl:"+h),i.load(s,h,function(n){if(e.objects[t]=n,e.objectsLoaded++,e.objectsLoaded===u){var i=((Date.now()-c)/1e3).toFixed(2);o&&console.log("Loaded "+u+" models in "+i+" seconds"),r()}},n,function(){var t=xhr.target.responseURL||"";e.error="Error loading file "+t})};l(s,h)}}function n(e){if(e.lengthComputable&&e.target.responseURL){var t=e.loaded/e.total*100,r=e.target.responseURL.split("/").pop();o&&console.log("..."+r+" "+Math.round(t,2)+"% downloaded")}}var i,o,a="",s="";return{init:t,load:r,LoadRequest:e}}(),THREE.Scene.prototype.updateAllBehaviors=function(){var e=performance.now(),t=this.__lastNow||e,r=e-t,n=this,i=[];this.traverse(function(e){e.__behaviorList&&i.push(e)});for(var o=0,a=i.length;a>o;o++)object3d=i[o],object3d.updateBehaviors(r,n);this.__lastNow=e},THREE.Object3D.prototype.addBehavior=function(){this.__behaviorList=this.__behaviorList||[],Array.prototype.push.apply(this.__behaviorList,arguments)},THREE.Object3D.prototype.addBehaviors=function(){this.__behaviorList=this.__behaviorList||[],Array.prototype.push.apply(this.__behaviorList,arguments)},THREE.Object3D.prototype.removeBehavior=function(e){var t=this.__behaviorList.indexOf(e);if(-1!==t){this.__behaviorList.splice(t,1);try{e.dispose&&e.dispose.call(e,this)}catch(r){console.group(),(console.error||console.log).call(console,r.stack||r),console.log("[Behavior]"),console.log(e),console.log("[Object3D]"),console.log(this),console.groupEnd()}}},THREE.Object3D.prototype.removeAllBehaviors=function(){if(!this.__behaviorList||0===this.__behaviorList.length)return null;for(var e=0,t=this.__behaviorList.length;t>e;e++){var r=this.__behaviorList[e];try{r.dispose&&r.dispose.call(r,this)}catch(n){console.group(),(console.error||console.log).call(console,n.stack||n),console.log("[Behavior]"),console.log(r),console.log("[Object3D]"),console.log(this),console.groupEnd()}}},THREE.Object3D.prototype.getBehaviorByType=function(e){if(!this.__behaviorList||0===this.__behaviorList.length)return null;for(var t=0,r=this.__behaviorList.length;r>t;t++)if(this.__behaviorList[t].type===e)return this.__behaviorList[t]},THREE.Object3D.prototype.updateBehaviors=function(e,t){if(this.__behaviorList&&0!==this.__behaviorList.length){for(var r=[],n=this.__behaviorList.slice(),i=0,o=this.__behaviorList.length;o>i;i++){var a=this.__behaviorList[i];a.__isInitialized||r.push(a)}for(var i=0,o=r.length;o>i;i++){var a=r[i];try{a.awake&&a.awake.call(a,this,t)}catch(s){console.group(),(console.error||console.log).call(console,s.stack||s),console.log("[Behavior]"),console.log(a),console.log("[Object3D]"),console.log(this),console.groupEnd()}}for(var i=0,o=r.length;o>i;i++){var a=r[i];try{a.start&&a.start.call(a)}catch(s){console.group(),(console.error||console.log).call(console,s.stack||s),console.log("[Behavior]"),console.log(a),console.log("[Object3D]"),console.log(this),console.groupEnd()}a.__isInitialized=!0}for(var i=0,o=n.length;o>i;i++){var a=n[i];try{a.update&&a.update.call(a,e)}catch(s){console.group(),(console.error||console.log).call(console,s.stack||s),console.log("[Behavior]"),console.log(a),console.log("[Object3D]"),console.log(this),console.groupEnd()}}}},altspace=window.altspace||{},altspace.utilities=altspace.utilities||{},altspace.utilities.shims=altspace.utilities.shims||{},altspace.utilities.shims.cursor=function(){function e(e,i,o){if(!e||!e instanceof THREE.Scene)throw new TypeError("Requires THREE.Scene argument");if(!i||!i instanceof THREE.Camera)throw new TypeError("Requires THREE.Camera argument");a=e,s=i,p=o||{},c=p.renderer&&p.renderer.domElement||window,c.addEventListener("mousedown",t,!1),c.addEventListener("mouseup",r,!1),c.addEventListener("mousemove",n,!1)}function t(e){var t=o(e);if(t&&t.point){var r=i("cursordown",t);t.object.dispatchEvent(r)}}function r(e){var t=o(e),r=i("cursorup",t);t?t.object.dispatchEvent(r):a.dispatchEvent(r)}function n(e){var t=o(e),r=i("cursormove",t);a.dispatchEvent(r);var n=t?t.object:null;u!=n&&(u&&(r=i("cursorleave",t),u.dispatchEvent(r)),n&&(r=i("cursorenter",t),n.dispatchEvent(r)),u=n)}function i(e,t){return{type:e,bubbles:!0,target:t?t.object:null,ray:{origin:h.ray.origin.clone(),direction:h.ray.direction.clone()},point:t?t.point.clone():null}}function o(e){var t=new THREE.Vector2;t.x=e.offsetX/(c.width||c.innerWidth)*2-1,t.y=2*-(e.offsetY/(c.height||c.innerHeight))+1,h.setFromCamera(t,s);var r=h.intersectObjects(a.children,!0);return r.length>0?r[0]:null}var a,s,c,u,h=new THREE.Raycaster;return{init:e}}(),function(){function e(t){var r,n;if(t.bubbles&&(t.currentTarget=this,t.stopPropagation=function(){r=!0},t.stopImmediatePropagation=function(){n=!0}),this._listeners){var i=this._listeners,o=i[t.type];if(o){t.target=t.target||this;for(var a=[],s=o.length,c=0;s>c;c++)a[c]=o[c];for(var c=0;s>c;c++)if(a[c].call(this,t),n)return}}t.bubbles&&this.parent&&this.parent.dispatchEvent&&!r&&e.call(this.parent,t)}THREE&&(window.altspace&&window.altspace.inAltspace||(THREE.EventDispatcher.prototype.dispatchEvent=e,THREE.Object3D.prototype.dispatchEvent=e))}(),window.altspace=window.altspace||{},window.altspace.utilities=window.altspace.utilities||{},window.altspace.utilities.behaviors=window.altspace.utilities.behaviors||{},altspace.utilities.behaviors.Bob=function(e){function t(e){n=e,i=n.position.clone()}function r(t){var r=Math.floor(performance.now())+a;e.shouldMove&&(o.equals(n.position)||i.copy(n.position),n.position.y=i.y+3*Math.sin(r/800),n.position.x=i.x+5*Math.sin(r/500),o.copy(n.position)),e.shouldRotate&&(n.rotation.x=Math.sin(r/500)/15)}var n;e=e||{},void 0===e.shouldRotate&&(e.shouldRotate=!0),void 0===e.shouldMove&&(e.shouldMove=!0);var i,o=new THREE.Vector3,a=1e4*Math.random();return{awake:t,update:r}},window.altspace=window.altspace||{},window.altspace.utilities=window.altspace.utilities||{},window.altspace.utilities.behaviors=window.altspace.utilities.behaviors||{},altspace.utilities.behaviors.ButtonStateStyle=function(e){function t(e){l.set(h),l.multiplyScalar(e),l.r=THREE.Math.clamp(l.r,0,1),l.g=THREE.Math.clamp(l.g,0,1),l.b=THREE.Math.clamp(l.b,0,1),c.material.color=l}function r(){c.removeEventListener("cursorleave",r),t(1)}function n(){t(f),c.addEventListener("cursorleave",r)}function i(e){u.removeEventListener("cursorup",i),c.addEventListener("cursorenter",n),e.target===c?(t(f),c.addEventListener("cursorleave",r)):t(1)}function o(){u.addEventListener("cursorup",i),c.removeEventListener("cursorleave",r),c.removeEventListener("cursorenter",n),t(p)}function a(t,r){c=t,u=r,h=e.originalColor||c.material.color,c.addEventListener("cursorenter",n),c.addEventListener("cursordown",o)}function s(){c.removeEventListener("cursorenter",n),c.removeEventListener("cursorleave",r),c.removeEventListener("cursorup",i),c.removeEventListener("cursordown",o)}var c,u,h,l=new THREE.Color;e=e||{};var f=e.overBrightness||1.5,p=e.downBrightness||.5;return{awake:a,dispose:s,type:"ButtonStateStyle"}},window.altspace=window.altspace||{},window.altspace.utilities=window.altspace.utilities||{},window.altspace.utilities.behaviors=window.altspace.utilities.behaviors||{},altspace.utilities.behaviors.Drag=function(e){function t(e,t){c=e,u=t,h=c.getBehaviorByType("Object3DSync"),r(),u.add(l)}function r(){function e(){i.rotateY(Math.PI)}function t(){i.rotateX(Math.PI/2)}function r(){i.rotateY(Math.PI/2)}var n=1e4,i=new THREE.PlaneGeometry(n,n),o=f+p+d;if(3===o)throw new Error("Arbitrary dragging currently unsupported. Please lock at least one axis.");if(2!==o)throw 1===o?new Error("Single axis dragging currently unsupported."):new Error("Invalid axis configuration");f&&p?e():f&&d?t():p&&d&&r();var a=new THREE.MeshBasicMaterial({color:"purple"});a.side=THREE.DoubleSide,l=new THREE.Mesh(i,a),l.visible=!1,l.material.visible=!1}function n(e){e.updateMatrixWorld();var t=new THREE.Vector3;return t.setFromMatrixPosition(e.matrixWorld),t}function i(e){u.addEventListener("cursorup",a),u.addEventListener("cursormove",o),y.set(e.ray.origin,e.ray.direction);var t=y.intersectObject(c,!0)[0];if(t){var r=t.point.clone(),i=n(c).clone();v.copy(r).sub(i),l.position.copy(r),l.updateMatrixWorld()}}function o(t){h&&!h.isMine&&h.takeOwnership(),l.visible=!0,y.set(t.ray.origin,t.ray.direction);var r=y.intersectObject(l,!0)[0];if(l.visible=!1,r){var i=new THREE.Vector3;i.copy(r.point).sub(v),i.y=n(c).y,i.clamp(m,g),c.parent.updateMatrixWorld();var o=c.parent.worldToLocal(i);c.position.set(e.x?o.x:c.position.x,e.y?o.y:c.position.y,e.z?o.z:c.position.z)}}function a(){u.removeEventListener("cursorup",a),u.removeEventListener("cursormove",o)}function s(){c.addEventListener("cursordown",i)}e=e||{},void 0===e.space&&(e.space="world"),void 0===e.x&&(e.x=!1),void 0===e.y&&(e.y=!1),void 0===e.z&&(e.z=!1),void 0===e.cursorSnap&&(e.cursorSnap=!0);var c,u,h,l,f=!!e.x,p=!!e.y,d=!!e.z,m=new THREE.Vector3(void 0!==e.x.min?e.x.min:Number.NEGATIVE_INFINITY,void 0!==e.y.min?e.y.min:Number.NEGATIVE_INFINITY,void 0!==e.z.min?e.z.min:Number.NEGATIVE_INFINITY),g=new THREE.Vector3(void 0!==e.x.max?e.x.max:Number.POSITIVE_INFINITY,void 0!==e.y.max?e.y.max:Number.POSITIVE_INFINITY,void 0!==e.z.max?e.z.max:Number.POSITIVE_INFINITY),v=new THREE.Vector3,y=new THREE.Raycaster;return y.linePrecision=3,{awake:t,start:s}},window.altspace=window.altspace||{},window.altspace.utilities=window.altspace.utilities||{},window.altspace.utilities.behaviors=window.altspace.utilities.behaviors||{},altspace.utilities.behaviors.GamepadControls=function(e){function t(e,t){if(o=e,s=t,c=o.getBehaviorByType("Object3DSync"),u=o.clone(),a=r())console.log("Gamepad detected: "+a.id);else var i=setInterval(function(){a=r(),a&&(console.log("Gamepad connected: "+a.id),clearInterval(i))},500);s.addEventListener("cursordown",function(e){a&&!d&&(n(a),d=!0)})}function r(){if(altspace&&altspace.inClient?gamepads=altspace.getGamepads():gamepads=navigator.getGamepads(),gamepads.length>0)for(var e=0;et.buttons;i++)n[i]=!1;for(var i=0;i>t.axes;i++)r[i]=!1;e.position&&(r[0]=!0,r[1]=!0,n[10]=!0),e.rotation&&(r[2]=!0,r[3]=!0,n[11]=!0),e.scale&&(n[12]=!0,n[13]=!0),n[8]=!0,t.preventDefault(r,n)}function i(t){if(altspace&&altspace.inClient||!window.chrome||!a||(a=r()),a){var n=a.buttons[8].pressed;if(n)return c.isMine||c.takeOwnership(),o.position.copy(u.position),o.rotation.copy(u.rotation),void o.scale.copy(u.scale);if(e.position){var i=a.buttons[10].pressed;p&&!i&&(l=!l),p=i;var s=a.axes[0],d=a.axes[1],g=Math.abs(s)>m||Math.abs(d)>m;g&&!c.isMine&&c.takeOwnership();var v=200*(t/1e3);!l&&Math.abs(s)>m&&(o.position.x+=v*s),!l&&Math.abs(d)>m&&(o.position.z+=v*d),l&&Math.abs(s)>m&&(o.position.x+=v*s),l&&Math.abs(d)>m&&(o.position.y+=v*-d)}if(e.rotation){var y=a.buttons[11].pressed;f&&!y&&(h=!h),f=y;var b=a.axes[2],x=a.axes[3],w=Math.abs(b)>m||Math.abs(x)>m;w&&!c.isMine&&c.takeOwnership();var _=Math.PI*(t/1e3);!h&&Math.abs(b)>m&&(o.rotation.y+=_*b),!h&&Math.abs(x)>m&&(o.rotation.x+=_*x),h&&Math.abs(b)>m&&(o.rotation.z+=_*-b)}if(e.scale){var S=10*(t/1e3),M=a.buttons[12].pressed,E=a.buttons[13].pressed,T=a.buttons[12].pressed||a.buttons[13].pressed;T&&!c.isMine&&c.takeOwnership();var A=o.scale,C=new THREE.Vector3(1,1,1);C.multiplyScalar(S),M&&o.scale.add(C),E&&A.x>C.x&&A.y>C.y&&A.z>C.z&&o.scale.sub(C)}}}var o,a,s,c,u,h=!1,l=!1,f=!1,p=!1,d=!1,m=.2;return e=e||{},void 0===e.position&&(e.position=!0),void 0===e.rotation&&(e.rotation=!0),void 0===e.scale&&(e.scale=!0),{awake:t,update:i}},window.altspace=window.altspace||{},window.altspace.utilities=window.altspace.utilities||{},window.altspace.utilities.behaviors=window.altspace.utilities.behaviors||{},altspace.utilities.behaviors.HoverColor=function(e){function t(t,a){c=t,l=a,c.addEventListener("cursordown",r),l.addEventListener("cursorup",o),"cursorenter"===e.event&&(c.addEventListener("cursorenter",n),c.addEventListener("cursorleave",i))}function r(t){u=c,"cursordown"===e.event&&a(u)}function n(e){u&&u!==c||(h&&unsetcolor(h),h=c,a(c))}function i(e){h===c&&(h=null,s(c))}function o(t){"cursordown"===e.event&&u&&s(u),u=null}function a(t){t.material&&t.material.color&&(t.userData.origColor=t.material.color,t.material.color=e.color,t.material&&(t.material.needsUpdate=!0));for(var r=0;re;e++)m[e].autoSend()}function n(n,i){setInterval(r,d);var a=i;h=a.uuid,u.on("value",function(e){var t=e.val();t&&(masterClientKey=Object.keys(t)[0],l=t[masterClientKey])}),u.push(h).onDisconnect().remove(),e.child("initialized").once("value",function(e){var r=!e.val();e.ref().set(!0),t.ready&&t.ready(r)}),c.on("child_added",o.bind(this)),c.on("child_removed",s.bind(this))}function i(e,t,r){t=t||{};var n=c.push({syncType:e,initData:t},function(e){if(e)throw Error("Failed to save to Firebase",e)});r&&n.onDisconnect().remove();var i=g[n.key()];return i.getBehaviorByType("Object3DSync").takeOwnership(),i}function o(e){var t=e.val(),r=e.key(),n=f[t.syncType];if(!n)return void console.warn("No instantiator found for syncType: "+t.syncType);var i=n(t.initData,t.syncType);if(!i)return void console.error(t.syncType+".create must return an Object3D");g[r]=i,v[i.uuid]=r;var o=i.getBehaviorByType("Object3DSync");return o?(m.push(o),void o.link(e.ref(),this)):void console.error(t.syncType+" instantiator must return an Object3D with an Object3DSync behavior")}function a(e){var t=v[e.uuid];return t?(c.child(t).remove(function(e){e&&console.warn("Failed to remove from Firebase",e)}),void c.child(t).off()):void console.warn("Failed to find key for object3d to be destroyed",e)}function s(e){function t(e){e.removeAllBehaviors(),e.parent&&e.parent.remove(e),e.geometry&&e.geometry.dispose(),e.material&&(e.material.map&&e.material.map.dispose(),e.material.dispose())}var r=e.val(),n=e.key(),i=g[n];if(!i)return void console.warn("Failed to find object matching deleted key",n);var o=r.syncType;if(!o)return void console.warn("No syncType found for object being destroyed",i);var a=p[o],s=!a;a&&(s=a(i)),s&&t(i),delete g[n],delete v[i.uuid]}var c=e.child("scene"),u=e.child("clients");t=t||{};var h,l,f=t.instantiators||{},p=t.destroyers||{},d=100,m=[],g={},v={},y={awake:n,instantiate:i,destroy:a,type:"SceneSync"};return Object.defineProperty(y,"autoSendRateMS",{get:function(){return d}}),Object.defineProperty(y,"isMasterClient",{get:function(){return l===h}}),Object.defineProperty(y,"clientId",{get:function(){return h}}),Object.defineProperty(y,"clientsRef",{get:function(){return u}}),y},window.altspace=window.altspace||{},window.altspace.utilities=window.altspace.utilities||{},window.altspace.utilities.behaviors=window.altspace.utilities.behaviors||{},altspace.utilities.behaviors.Spin=function(e){function t(e){n=e}function r(t){n.rotation.y+=e.speed*t}e=e||{},void 0===e.speed&&(e.speed=1e-4);var n;return{awake:t,update:r}},window.altspace=window.altspace||{},window.altspace.utilities=window.altspace.utilities||{},window.altspace.utilities.behaviors=window.altspace.utilities.behaviors||{},altspace.utilities.behaviors.TouchpadRotate=function(e){function t(e,t){s=e,c=t,altspace.addEventListener("touchpadup",r),altspace.addEventListener("touchpaddown",n),altspace.addEventListener("touchpadmove",i)}function r(e){h=!1}function n(e){h=!0,u=s.rotation.clone()}function i(e){var t=e.displacementX-l;s.rotation.set(u.x,u.y+e.displacementX/300,u.z),p=(p*f+t/300)/(f+1),l=e.displacementX}function o(e){!h&&Math.abs(p)>.01&&(s.rotation.y+=p,p*=.97)}function a(){}e=e||{};var s,c,u,h=!1,l=0,f=5,p=0;return{awake:t,start:a,update:o}},function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var c="function"==typeof require&&require;if(!s&&c)return require(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[a]={exports:{}};e[a][0].call(h.exports,function(t){var r=e[a][1][t];return i(r?r:t)},h,h.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a2?u[2]:void 0,l=Math.min((void 0===h?a:i(h,a))-c,a-s),f=1;for(s>c&&c+l>s&&(f=-1,c+=l-1,s+=l-1);l-- >0;)c in r?r[s]=r[c]:delete r[s],s+=f,c+=f;return r}},{"./$.to-index":76,"./$.to-length":79,"./$.to-object":80}],6:[function(e,t,r){"use strict";var n=e("./$.to-object"),i=e("./$.to-index"),o=e("./$.to-length");t.exports=[].fill||function(e){for(var t=n(this),r=o(t.length),a=arguments,s=a.length,c=i(s>1?a[1]:void 0,r),u=s>2?a[2]:void 0,h=void 0===u?r:i(u,r);h>c;)t[c++]=e;return t}},{"./$.to-index":76,"./$.to-length":79,"./$.to-object":80}],7:[function(e,t,r){var n=e("./$.to-iobject"),i=e("./$.to-length"),o=e("./$.to-index");t.exports=function(e){return function(t,r,a){var s,c=n(t),u=i(c.length),h=o(a,u);if(e&&r!=r){for(;u>h;)if(s=c[h++],s!=s)return!0}else for(;u>h;h++)if((e||h in c)&&c[h]===r)return e||h;return!e&&-1}}},{"./$.to-index":76,"./$.to-iobject":78,"./$.to-length":79}],8:[function(e,t,r){var n=e("./$.ctx"),i=e("./$.iobject"),o=e("./$.to-object"),a=e("./$.to-length"),s=e("./$.array-species-create");t.exports=function(e){var t=1==e,r=2==e,c=3==e,u=4==e,h=6==e,l=5==e||h;return function(f,p,d){for(var m,g,v=o(f),y=i(v),b=n(p,d,3),x=a(y.length),w=0,_=t?s(f,x):r?s(f,0):void 0;x>w;w++)if((l||w in y)&&(m=y[w],g=b(m,w,v),e))if(t)_[w]=g;else if(g)switch(e){case 3:return!0;case 5:return m;case 6:return w;case 2:_.push(m)}else if(u)return!1;return h?-1:c||u?u:_}}},{"./$.array-species-create":9,"./$.ctx":17,"./$.iobject":34,"./$.to-length":79,"./$.to-object":80}],9:[function(e,t,r){var n=e("./$.is-object"),i=e("./$.is-array"),o=e("./$.wks")("species");t.exports=function(e,t){var r;return i(e)&&(r=e.constructor,"function"!=typeof r||r!==Array&&!i(r.prototype)||(r=void 0),n(r)&&(r=r[o],null===r&&(r=void 0))),new(void 0===r?Array:r)(t)}},{"./$.is-array":36,"./$.is-object":38,"./$.wks":83}],10:[function(e,t,r){var n=e("./$.cof"),i=e("./$.wks")("toStringTag"),o="Arguments"==n(function(){return arguments}());t.exports=function(e){var t,r,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=(t=Object(e))[i])?r:o?n(t):"Object"==(a=n(t))&&"function"==typeof t.callee?"Arguments":a}},{"./$.cof":11,"./$.wks":83}],11:[function(e,t,r){var n={}.toString;t.exports=function(e){return n.call(e).slice(8,-1)}},{}],12:[function(e,t,r){"use strict";var n=e("./$"),i=e("./$.hide"),o=e("./$.redefine-all"),a=e("./$.ctx"),s=e("./$.strict-new"),c=e("./$.defined"),u=e("./$.for-of"),h=e("./$.iter-define"),l=e("./$.iter-step"),f=e("./$.uid")("id"),p=e("./$.has"),d=e("./$.is-object"),m=e("./$.set-species"),g=e("./$.descriptors"),v=Object.isExtensible||d,y=g?"_s":"size",b=0,x=function(e,t){if(!d(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!p(e,f)){if(!v(e))return"F";if(!t)return"E";i(e,f,++b)}return"O"+e[f]},w=function(e,t){var r,n=x(t);if("F"!==n)return e._i[n];for(r=e._f;r;r=r.n)if(r.k==t)return r;
-};t.exports={getConstructor:function(e,t,r,i){var h=e(function(e,o){s(e,h,t),e._i=n.create(null),e._f=void 0,e._l=void 0,e[y]=0,void 0!=o&&u(o,r,e[i],e)});return o(h.prototype,{clear:function(){for(var e=this,t=e._i,r=e._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete t[r.i];e._f=e._l=void 0,e[y]=0},"delete":function(e){var t=this,r=w(t,e);if(r){var n=r.n,i=r.p;delete t._i[r.i],r.r=!0,i&&(i.n=n),n&&(n.p=i),t._f==r&&(t._f=n),t._l==r&&(t._l=i),t[y]--}return!!r},forEach:function(e){for(var t,r=a(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.n:this._f;)for(r(t.v,t.k,this);t&&t.r;)t=t.p},has:function(e){return!!w(this,e)}}),g&&n.setDesc(h.prototype,"size",{get:function(){return c(this[y])}}),h},def:function(e,t,r){var n,i,o=w(e,t);return o?o.v=r:(e._l=o={i:i=x(t,!0),k:t,v:r,p:n=e._l,n:void 0,r:!1},e._f||(e._f=o),n&&(n.n=o),e[y]++,"F"!==i&&(e._i[i]=o)),e},getEntry:w,setStrong:function(e,t,r){h(e,t,function(e,t){this._t=e,this._k=t,this._l=void 0},function(){for(var e=this,t=e._k,r=e._l;r&&r.r;)r=r.p;return e._t&&(e._l=r=r?r.n:e._t._f)?"keys"==t?l(0,r.k):"values"==t?l(0,r.v):l(0,[r.k,r.v]):(e._t=void 0,l(1))},r?"entries":"values",!r,!0),m(t)}}},{"./$":46,"./$.ctx":17,"./$.defined":18,"./$.descriptors":19,"./$.for-of":27,"./$.has":30,"./$.hide":31,"./$.is-object":38,"./$.iter-define":42,"./$.iter-step":44,"./$.redefine-all":60,"./$.set-species":65,"./$.strict-new":69,"./$.uid":82}],13:[function(e,t,r){var n=e("./$.for-of"),i=e("./$.classof");t.exports=function(e){return function(){if(i(this)!=e)throw TypeError(e+"#toJSON isn't generic");var t=[];return n(this,!1,t.push,t),t}}},{"./$.classof":10,"./$.for-of":27}],14:[function(e,t,r){"use strict";var n=e("./$.hide"),i=e("./$.redefine-all"),o=e("./$.an-object"),a=e("./$.is-object"),s=e("./$.strict-new"),c=e("./$.for-of"),u=e("./$.array-methods"),h=e("./$.has"),l=e("./$.uid")("weak"),f=Object.isExtensible||a,p=u(5),d=u(6),m=0,g=function(e){return e._l||(e._l=new v)},v=function(){this.a=[]},y=function(e,t){return p(e.a,function(e){return e[0]===t})};v.prototype={get:function(e){var t=y(this,e);return t?t[1]:void 0},has:function(e){return!!y(this,e)},set:function(e,t){var r=y(this,e);r?r[1]=t:this.a.push([e,t])},"delete":function(e){var t=d(this.a,function(t){return t[0]===e});return~t&&this.a.splice(t,1),!!~t}},t.exports={getConstructor:function(e,t,r,n){var o=e(function(e,i){s(e,o,t),e._i=m++,e._l=void 0,void 0!=i&&c(i,r,e[n],e)});return i(o.prototype,{"delete":function(e){return a(e)?f(e)?h(e,l)&&h(e[l],this._i)&&delete e[l][this._i]:g(this)["delete"](e):!1},has:function(e){return a(e)?f(e)?h(e,l)&&h(e[l],this._i):g(this).has(e):!1}}),o},def:function(e,t,r){return f(o(t))?(h(t,l)||n(t,l,{}),t[l][e._i]=r):g(e).set(t,r),e},frozenStore:g,WEAK:l}},{"./$.an-object":4,"./$.array-methods":8,"./$.for-of":27,"./$.has":30,"./$.hide":31,"./$.is-object":38,"./$.redefine-all":60,"./$.strict-new":69,"./$.uid":82}],15:[function(e,t,r){"use strict";var n=e("./$.global"),i=e("./$.export"),o=e("./$.redefine"),a=e("./$.redefine-all"),s=e("./$.for-of"),c=e("./$.strict-new"),u=e("./$.is-object"),h=e("./$.fails"),l=e("./$.iter-detect"),f=e("./$.set-to-string-tag");t.exports=function(e,t,r,p,d,m){var g=n[e],v=g,y=d?"set":"add",b=v&&v.prototype,x={},w=function(e){var t=b[e];o(b,e,"delete"==e?function(e){return m&&!u(e)?!1:t.call(this,0===e?0:e)}:"has"==e?function(e){return m&&!u(e)?!1:t.call(this,0===e?0:e)}:"get"==e?function(e){return m&&!u(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,r){return t.call(this,0===e?0:e,r),this})};if("function"==typeof v&&(m||b.forEach&&!h(function(){(new v).entries().next()}))){var _,S=new v,M=S[y](m?{}:-0,1)!=S,E=h(function(){S.has(1)}),T=l(function(e){new v(e)});T||(v=t(function(t,r){c(t,v,e);var n=new g;return void 0!=r&&s(r,d,n[y],n),n}),v.prototype=b,b.constructor=v),m||S.forEach(function(e,t){_=1/t===-(1/0)}),(E||_)&&(w("delete"),w("has"),d&&w("get")),(_||M)&&w(y),m&&b.clear&&delete b.clear}else v=p.getConstructor(t,e,d,y),a(v.prototype,r);return f(v,e),x[e]=v,i(i.G+i.W+i.F*(v!=g),x),m||p.setStrong(v,e,d),v}},{"./$.export":22,"./$.fails":24,"./$.for-of":27,"./$.global":29,"./$.is-object":38,"./$.iter-detect":43,"./$.redefine":61,"./$.redefine-all":60,"./$.set-to-string-tag":66,"./$.strict-new":69}],16:[function(e,t,r){var n=t.exports={version:"1.2.6"};"number"==typeof __e&&(__e=n)},{}],17:[function(e,t,r){var n=e("./$.a-function");t.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}},{"./$.a-function":2}],18:[function(e,t,r){t.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},{}],19:[function(e,t,r){t.exports=!e("./$.fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./$.fails":24}],20:[function(e,t,r){var n=e("./$.is-object"),i=e("./$.global").document,o=n(i)&&n(i.createElement);t.exports=function(e){return o?i.createElement(e):{}}},{"./$.global":29,"./$.is-object":38}],21:[function(e,t,r){var n=e("./$");t.exports=function(e){var t=n.getKeys(e),r=n.getSymbols;if(r)for(var i,o=r(e),a=n.isEnum,s=0;o.length>s;)a.call(e,i=o[s++])&&t.push(i);return t}},{"./$":46}],22:[function(e,t,r){var n=e("./$.global"),i=e("./$.core"),o=e("./$.hide"),a=e("./$.redefine"),s=e("./$.ctx"),c="prototype",u=function(e,t,r){var h,l,f,p,d=e&u.F,m=e&u.G,g=e&u.S,v=e&u.P,y=e&u.B,b=m?n:g?n[t]||(n[t]={}):(n[t]||{})[c],x=m?i:i[t]||(i[t]={}),w=x[c]||(x[c]={});m&&(r=t);for(h in r)l=!d&&b&&h in b,f=(l?b:r)[h],p=y&&l?s(f,n):v&&"function"==typeof f?s(Function.call,f):f,b&&!l&&a(b,h,f),x[h]!=f&&o(x,h,p),v&&w[h]!=f&&(w[h]=f)};n.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,t.exports=u},{"./$.core":16,"./$.ctx":17,"./$.global":29,"./$.hide":31,"./$.redefine":61}],23:[function(e,t,r){var n=e("./$.wks")("match");t.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,!"/./"[e](t)}catch(i){}}return!0}},{"./$.wks":83}],24:[function(e,t,r){t.exports=function(e){try{return!!e()}catch(t){return!0}}},{}],25:[function(e,t,r){"use strict";var n=e("./$.hide"),i=e("./$.redefine"),o=e("./$.fails"),a=e("./$.defined"),s=e("./$.wks");t.exports=function(e,t,r){var c=s(e),u=""[e];o(function(){var t={};return t[c]=function(){return 7},7!=""[e](t)})&&(i(String.prototype,e,r(a,c,u)),n(RegExp.prototype,c,2==t?function(e,t){return u.call(e,this,t)}:function(e){return u.call(e,this)}))}},{"./$.defined":18,"./$.fails":24,"./$.hide":31,"./$.redefine":61,"./$.wks":83}],26:[function(e,t,r){"use strict";var n=e("./$.an-object");t.exports=function(){var e=n(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},{"./$.an-object":4}],27:[function(e,t,r){var n=e("./$.ctx"),i=e("./$.iter-call"),o=e("./$.is-array-iter"),a=e("./$.an-object"),s=e("./$.to-length"),c=e("./core.get-iterator-method");t.exports=function(e,t,r,u){var h,l,f,p=c(e),d=n(r,u,t?2:1),m=0;if("function"!=typeof p)throw TypeError(e+" is not iterable!");if(o(p))for(h=s(e.length);h>m;m++)t?d(a(l=e[m])[0],l[1]):d(e[m]);else for(f=p.call(e);!(l=f.next()).done;)i(f,d,l.value,t)}},{"./$.an-object":4,"./$.ctx":17,"./$.is-array-iter":35,"./$.iter-call":40,"./$.to-length":79,"./core.get-iterator-method":84}],28:[function(e,t,r){var n=e("./$.to-iobject"),i=e("./$").getNames,o={}.toString,a="object"==typeof window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return i(e)}catch(t){return a.slice()}};t.exports.get=function(e){return a&&"[object Window]"==o.call(e)?s(e):i(n(e))}},{"./$":46,"./$.to-iobject":78}],29:[function(e,t,r){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},{}],30:[function(e,t,r){var n={}.hasOwnProperty;t.exports=function(e,t){return n.call(e,t)}},{}],31:[function(e,t,r){var n=e("./$"),i=e("./$.property-desc");t.exports=e("./$.descriptors")?function(e,t,r){return n.setDesc(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},{"./$":46,"./$.descriptors":19,"./$.property-desc":59}],32:[function(e,t,r){t.exports=e("./$.global").document&&document.documentElement},{"./$.global":29}],33:[function(e,t,r){t.exports=function(e,t,r){var n=void 0===r;switch(t.length){case 0:return n?e():e.call(r);case 1:return n?e(t[0]):e.call(r,t[0]);case 2:return n?e(t[0],t[1]):e.call(r,t[0],t[1]);case 3:return n?e(t[0],t[1],t[2]):e.call(r,t[0],t[1],t[2]);case 4:return n?e(t[0],t[1],t[2],t[3]):e.call(r,t[0],t[1],t[2],t[3])}return e.apply(r,t)}},{}],34:[function(e,t,r){var n=e("./$.cof");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},{"./$.cof":11}],35:[function(e,t,r){var n=e("./$.iterators"),i=e("./$.wks")("iterator"),o=Array.prototype;t.exports=function(e){return void 0!==e&&(n.Array===e||o[i]===e)}},{"./$.iterators":45,"./$.wks":83}],36:[function(e,t,r){var n=e("./$.cof");t.exports=Array.isArray||function(e){return"Array"==n(e)}},{"./$.cof":11}],37:[function(e,t,r){var n=e("./$.is-object"),i=Math.floor;t.exports=function(e){return!n(e)&&isFinite(e)&&i(e)===e}},{"./$.is-object":38}],38:[function(e,t,r){t.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},{}],39:[function(e,t,r){var n=e("./$.is-object"),i=e("./$.cof"),o=e("./$.wks")("match");t.exports=function(e){var t;return n(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==i(e))}},{"./$.cof":11,"./$.is-object":38,"./$.wks":83}],40:[function(e,t,r){var n=e("./$.an-object");t.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(o){var a=e["return"];throw void 0!==a&&n(a.call(e)),o}}},{"./$.an-object":4}],41:[function(e,t,r){"use strict";var n=e("./$"),i=e("./$.property-desc"),o=e("./$.set-to-string-tag"),a={};e("./$.hide")(a,e("./$.wks")("iterator"),function(){return this}),t.exports=function(e,t,r){e.prototype=n.create(a,{next:i(1,r)}),o(e,t+" Iterator")}},{"./$":46,"./$.hide":31,"./$.property-desc":59,"./$.set-to-string-tag":66,"./$.wks":83}],42:[function(e,t,r){"use strict";var n=e("./$.library"),i=e("./$.export"),o=e("./$.redefine"),a=e("./$.hide"),s=e("./$.has"),c=e("./$.iterators"),u=e("./$.iter-create"),h=e("./$.set-to-string-tag"),l=e("./$").getProto,f=e("./$.wks")("iterator"),p=!([].keys&&"next"in[].keys()),d="@@iterator",m="keys",g="values",v=function(){return this};t.exports=function(e,t,r,y,b,x,w){u(r,t,y);var _,S,M=function(e){if(!p&&e in C)return C[e];switch(e){case m:return function(){return new r(this,e)};case g:return function(){return new r(this,e)}}return function(){return new r(this,e)}},E=t+" Iterator",T=b==g,A=!1,C=e.prototype,L=C[f]||C[d]||b&&C[b],k=L||M(b);if(L){var F=l(k.call(new e));h(F,E,!0),!n&&s(C,d)&&a(F,f,v),T&&L.name!==g&&(A=!0,k=function(){return L.call(this)})}if(n&&!w||!p&&!A&&C[f]||a(C,f,k),c[t]=k,c[E]=v,b)if(_={values:T?k:M(g),keys:x?k:M(m),entries:T?M("entries"):k},w)for(S in _)S in C||o(C,S,_[S]);else i(i.P+i.F*(p||A),t,_);return _}},{"./$":46,"./$.export":22,"./$.has":30,"./$.hide":31,"./$.iter-create":41,"./$.iterators":45,"./$.library":48,"./$.redefine":61,"./$.set-to-string-tag":66,"./$.wks":83}],43:[function(e,t,r){var n=e("./$.wks")("iterator"),i=!1;try{var o=[7][n]();o["return"]=function(){i=!0},Array.from(o,function(){throw 2})}catch(a){}t.exports=function(e,t){if(!t&&!i)return!1;var r=!1;try{var o=[7],a=o[n]();a.next=function(){r=!0},o[n]=function(){return a},e(o)}catch(s){}return r}},{"./$.wks":83}],44:[function(e,t,r){t.exports=function(e,t){return{value:t,done:!!e}}},{}],45:[function(e,t,r){t.exports={}},{}],46:[function(e,t,r){var n=Object;t.exports={create:n.create,getProto:n.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:n.getOwnPropertyDescriptor,setDesc:n.defineProperty,setDescs:n.defineProperties,getKeys:n.keys,getNames:n.getOwnPropertyNames,getSymbols:n.getOwnPropertySymbols,each:[].forEach}},{}],47:[function(e,t,r){var n=e("./$"),i=e("./$.to-iobject");t.exports=function(e,t){for(var r,o=i(e),a=n.getKeys(o),s=a.length,c=0;s>c;)if(o[r=a[c++]]===t)return r}},{"./$":46,"./$.to-iobject":78}],48:[function(e,t,r){t.exports=!1},{}],49:[function(e,t,r){t.exports=Math.expm1||function(e){return 0==(e=+e)?e:e>-1e-6&&1e-6>e?e+e*e/2:Math.exp(e)-1}},{}],50:[function(e,t,r){t.exports=Math.log1p||function(e){return(e=+e)>-1e-8&&1e-8>e?e-e*e/2:Math.log(1+e)}},{}],51:[function(e,t,r){t.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:0>e?-1:1}},{}],52:[function(e,t,r){var n,i,o,a=e("./$.global"),s=e("./$.task").set,c=a.MutationObserver||a.WebKitMutationObserver,u=a.process,h=a.Promise,l="process"==e("./$.cof")(u),f=function(){var e,t,r;for(l&&(e=u.domain)&&(u.domain=null,e.exit());n;)t=n.domain,r=n.fn,t&&t.enter(),r(),t&&t.exit(),n=n.next;i=void 0,e&&e.enter()};if(l)o=function(){u.nextTick(f)};else if(c){var p=1,d=document.createTextNode("");new c(f).observe(d,{characterData:!0}),o=function(){d.data=p=-p}}else o=h&&h.resolve?function(){h.resolve().then(f)}:function(){s.call(a,f)};t.exports=function(e){var t={fn:e,next:void 0,domain:l&&u.domain};i&&(i.next=t),n||(n=t,o()),i=t}},{"./$.cof":11,"./$.global":29,"./$.task":75}],53:[function(e,t,r){var n=e("./$"),i=e("./$.to-object"),o=e("./$.iobject");t.exports=e("./$.fails")(function(){var e=Object.assign,t={},r={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach(function(e){r[e]=e}),7!=e({},t)[n]||Object.keys(e({},r)).join("")!=i})?function(e,t){for(var r=i(e),a=arguments,s=a.length,c=1,u=n.getKeys,h=n.getSymbols,l=n.isEnum;s>c;)for(var f,p=o(a[c++]),d=h?u(p).concat(h(p)):u(p),m=d.length,g=0;m>g;)l.call(p,f=d[g++])&&(r[f]=p[f]);return r}:Object.assign},{"./$":46,"./$.fails":24,"./$.iobject":34,"./$.to-object":80}],54:[function(e,t,r){var n=e("./$.export"),i=e("./$.core"),o=e("./$.fails");t.exports=function(e,t){var r=(i.Object||{})[e]||Object[e],a={};a[e]=t(r),n(n.S+n.F*o(function(){r(1)}),"Object",a)}},{"./$.core":16,"./$.export":22,"./$.fails":24}],55:[function(e,t,r){var n=e("./$"),i=e("./$.to-iobject"),o=n.isEnum;t.exports=function(e){return function(t){for(var r,a=i(t),s=n.getKeys(a),c=s.length,u=0,h=[];c>u;)o.call(a,r=s[u++])&&h.push(e?[r,a[r]]:a[r]);return h}}},{"./$":46,"./$.to-iobject":78}],56:[function(e,t,r){var n=e("./$"),i=e("./$.an-object"),o=e("./$.global").Reflect;t.exports=o&&o.ownKeys||function(e){var t=n.getNames(i(e)),r=n.getSymbols;return r?t.concat(r(e)):t}},{"./$":46,"./$.an-object":4,"./$.global":29}],57:[function(e,t,r){"use strict";var n=e("./$.path"),i=e("./$.invoke"),o=e("./$.a-function");t.exports=function(){for(var e=o(this),t=arguments.length,r=Array(t),a=0,s=n._,c=!1;t>a;)(r[a]=arguments[a++])===s&&(c=!0);return function(){var n,o=this,a=arguments,u=a.length,h=0,l=0;if(!c&&!u)return i(e,r,o);if(n=r.slice(),c)for(;t>h;h++)n[h]===s&&(n[h]=a[l++]);for(;u>l;)n.push(a[l++]);return i(e,n,o)}}},{"./$.a-function":2,"./$.invoke":33,"./$.path":58}],58:[function(e,t,r){t.exports=e("./$.global")},{"./$.global":29}],59:[function(e,t,r){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],60:[function(e,t,r){var n=e("./$.redefine");t.exports=function(e,t){for(var r in t)n(e,r,t[r]);return e}},{"./$.redefine":61}],61:[function(e,t,r){var n=e("./$.global"),i=e("./$.hide"),o=e("./$.uid")("src"),a="toString",s=Function[a],c=(""+s).split(a);e("./$.core").inspectSource=function(e){return s.call(e)},(t.exports=function(e,t,r,a){"function"==typeof r&&(r.hasOwnProperty(o)||i(r,o,e[t]?""+e[t]:c.join(String(t))),r.hasOwnProperty("name")||i(r,"name",t)),e===n?e[t]=r:(a||delete e[t],i(e,t,r))})(Function.prototype,a,function(){return"function"==typeof this&&this[o]||s.call(this)})},{"./$.core":16,"./$.global":29,"./$.hide":31,"./$.uid":82}],62:[function(e,t,r){t.exports=function(e,t){var r=t===Object(t)?function(e){return t[e]}:t;return function(t){return String(t).replace(e,r)}}},{}],63:[function(e,t,r){t.exports=Object.is||function(e,t){return e===t?0!==e||1/e===1/t:e!=e&&t!=t}},{}],64:[function(e,t,r){var n=e("./$").getDesc,i=e("./$.is-object"),o=e("./$.an-object"),a=function(e,t){if(o(e),!i(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,r,i){try{i=e("./$.ctx")(Function.call,n(Object.prototype,"__proto__").set,2),i(t,[]),r=!(t instanceof Array)}catch(o){r=!0}return function(e,t){return a(e,t),r?e.__proto__=t:i(e,t),e}}({},!1):void 0),check:a}},{"./$":46,"./$.an-object":4,"./$.ctx":17,"./$.is-object":38}],65:[function(e,t,r){"use strict";var n=e("./$.global"),i=e("./$"),o=e("./$.descriptors"),a=e("./$.wks")("species");t.exports=function(e){var t=n[e];o&&t&&!t[a]&&i.setDesc(t,a,{configurable:!0,get:function(){return this}})}},{"./$":46,"./$.descriptors":19,"./$.global":29,"./$.wks":83}],66:[function(e,t,r){var n=e("./$").setDesc,i=e("./$.has"),o=e("./$.wks")("toStringTag");t.exports=function(e,t,r){e&&!i(e=r?e:e.prototype,o)&&n(e,o,{configurable:!0,value:t})}},{"./$":46,"./$.has":30,"./$.wks":83}],67:[function(e,t,r){var n=e("./$.global"),i="__core-js_shared__",o=n[i]||(n[i]={});t.exports=function(e){return o[e]||(o[e]={})}},{"./$.global":29}],68:[function(e,t,r){var n=e("./$.an-object"),i=e("./$.a-function"),o=e("./$.wks")("species");t.exports=function(e,t){var r,a=n(e).constructor;return void 0===a||void 0==(r=n(a)[o])?t:i(r)}},{"./$.a-function":2,"./$.an-object":4,"./$.wks":83}],69:[function(e,t,r){t.exports=function(e,t,r){if(!(e instanceof t))throw TypeError(r+": use the 'new' operator!");return e}},{}],70:[function(e,t,r){var n=e("./$.to-integer"),i=e("./$.defined");t.exports=function(e){return function(t,r){var o,a,s=String(i(t)),c=n(r),u=s.length;return 0>c||c>=u?e?"":void 0:(o=s.charCodeAt(c),55296>o||o>56319||c+1===u||(a=s.charCodeAt(c+1))<56320||a>57343?e?s.charAt(c):o:e?s.slice(c,c+2):(o-55296<<10)+(a-56320)+65536)}}},{"./$.defined":18,"./$.to-integer":77}],71:[function(e,t,r){var n=e("./$.is-regexp"),i=e("./$.defined");t.exports=function(e,t,r){if(n(t))throw TypeError("String#"+r+" doesn't accept regex!");return String(i(e))}},{"./$.defined":18,"./$.is-regexp":39}],72:[function(e,t,r){var n=e("./$.to-length"),i=e("./$.string-repeat"),o=e("./$.defined");t.exports=function(e,t,r,a){var s=String(o(e)),c=s.length,u=void 0===r?" ":String(r),h=n(t);if(c>=h)return s;""==u&&(u=" ");var l=h-c,f=i.call(u,Math.ceil(l/u.length));return f.length>l&&(f=f.slice(0,l)),a?f+s:s+f}},{"./$.defined":18,"./$.string-repeat":73,"./$.to-length":79}],73:[function(e,t,r){"use strict";var n=e("./$.to-integer"),i=e("./$.defined");t.exports=function(e){var t=String(i(this)),r="",o=n(e);if(0>o||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(t+=t))1&o&&(r+=t);return r}},{"./$.defined":18,"./$.to-integer":77}],74:[function(e,t,r){var n=e("./$.export"),i=e("./$.defined"),o=e("./$.fails"),a=" \n\x0B\f\r \u2028\u2029\ufeff",s="["+a+"]",c="
",u=RegExp("^"+s+s+"*"),h=RegExp(s+s+"*$"),l=function(e,t){var r={};r[e]=t(f),n(n.P+n.F*o(function(){return!!a[e]()||c[e]()!=c}),"String",r)},f=l.trim=function(e,t){return e=String(i(e)),1&t&&(e=e.replace(u,"")),2&t&&(e=e.replace(h,"")),e};t.exports=l},{"./$.defined":18,"./$.export":22,"./$.fails":24}],75:[function(e,t,r){var n,i,o,a=e("./$.ctx"),s=e("./$.invoke"),c=e("./$.html"),u=e("./$.dom-create"),h=e("./$.global"),l=h.process,f=h.setImmediate,p=h.clearImmediate,d=h.MessageChannel,m=0,g={},v="onreadystatechange",y=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},b=function(e){y.call(e.data)};f&&p||(f=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return g[++m]=function(){s("function"==typeof e?e:Function(e),t)},n(m),m},p=function(e){delete g[e]},"process"==e("./$.cof")(l)?n=function(e){l.nextTick(a(y,e,1))}:d?(i=new d,o=i.port2,i.port1.onmessage=b,n=a(o.postMessage,o,1)):h.addEventListener&&"function"==typeof postMessage&&!h.importScripts?(n=function(e){h.postMessage(e+"","*")},h.addEventListener("message",b,!1)):n=v in u("script")?function(e){c.appendChild(u("script"))[v]=function(){c.removeChild(this),y.call(e)}}:function(e){setTimeout(a(y,e,1),0)}),t.exports={set:f,clear:p}},{"./$.cof":11,"./$.ctx":17,"./$.dom-create":20,"./$.global":29,"./$.html":32,"./$.invoke":33}],76:[function(e,t,r){var n=e("./$.to-integer"),i=Math.max,o=Math.min;t.exports=function(e,t){return e=n(e),0>e?i(e+t,0):o(e,t)}},{"./$.to-integer":77}],77:[function(e,t,r){var n=Math.ceil,i=Math.floor;t.exports=function(e){return isNaN(e=+e)?0:(e>0?i:n)(e)}},{}],78:[function(e,t,r){var n=e("./$.iobject"),i=e("./$.defined");t.exports=function(e){return n(i(e))}},{"./$.defined":18,"./$.iobject":34}],79:[function(e,t,r){var n=e("./$.to-integer"),i=Math.min;t.exports=function(e){return e>0?i(n(e),9007199254740991):0}},{"./$.to-integer":77}],80:[function(e,t,r){var n=e("./$.defined");t.exports=function(e){return Object(n(e))}},{"./$.defined":18}],81:[function(e,t,r){var n=e("./$.is-object");t.exports=function(e,t){if(!n(e))return e;var r,i;if(t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;if("function"==typeof(r=e.valueOf)&&!n(i=r.call(e)))return i;if(!t&&"function"==typeof(r=e.toString)&&!n(i=r.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},{"./$.is-object":38}],82:[function(e,t,r){var n=0,i=Math.random();t.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+i).toString(36))}},{}],83:[function(e,t,r){var n=e("./$.shared")("wks"),i=e("./$.uid"),o=e("./$.global").Symbol;t.exports=function(e){return n[e]||(n[e]=o&&o[e]||(o||i)("Symbol."+e))}},{"./$.global":29,"./$.shared":67,"./$.uid":82}],84:[function(e,t,r){var n=e("./$.classof"),i=e("./$.wks")("iterator"),o=e("./$.iterators");t.exports=e("./$.core").getIteratorMethod=function(e){return void 0!=e?e[i]||e["@@iterator"]||o[n(e)]:void 0}},{"./$.classof":10,"./$.core":16,"./$.iterators":45,"./$.wks":83}],85:[function(e,t,r){"use strict";var n,i=e("./$"),o=e("./$.export"),a=e("./$.descriptors"),s=e("./$.property-desc"),c=e("./$.html"),u=e("./$.dom-create"),h=e("./$.has"),l=e("./$.cof"),f=e("./$.invoke"),p=e("./$.fails"),d=e("./$.an-object"),m=e("./$.a-function"),g=e("./$.is-object"),v=e("./$.to-object"),y=e("./$.to-iobject"),b=e("./$.to-integer"),x=e("./$.to-index"),w=e("./$.to-length"),_=e("./$.iobject"),S=e("./$.uid")("__proto__"),M=e("./$.array-methods"),E=e("./$.array-includes")(!1),T=Object.prototype,A=Array.prototype,C=A.slice,L=A.join,k=i.setDesc,F=i.getDesc,P=i.setDescs,R={};a||(n=!p(function(){return 7!=k(u("div"),"a",{get:function(){return 7}}).a}),i.setDesc=function(e,t,r){if(n)try{return k(e,t,r)}catch(i){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(d(e)[t]=r.value),e},i.getDesc=function(e,t){if(n)try{return F(e,t)}catch(r){}return h(e,t)?s(!T.propertyIsEnumerable.call(e,t),e[t]):void 0},i.setDescs=P=function(e,t){d(e);for(var r,n=i.getKeys(t),o=n.length,a=0;o>a;)i.setDesc(e,r=n[a++],t[r]);return e}),o(o.S+o.F*!a,"Object",{getOwnPropertyDescriptor:i.getDesc,defineProperty:i.setDesc,defineProperties:P});var D="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),O=D.concat("length","prototype"),U=D.length,B=function(){var e,t=u("iframe"),r=U,n=">";for(t.style.display="none",c.appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("o;)h(i,n=e[o++])&&(~E(a,n)||a.push(n));return a}},$=function(){};o(o.S,"Object",{getPrototypeOf:i.getProto=i.getProto||function(e){return e=v(e),h(e,S)?e[S]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?T:null},getOwnPropertyNames:i.getNames=i.getNames||j(O,O.length,!0),create:i.create=i.create||function(e,t){var r;return null!==e?($.prototype=d(e),r=new $,$.prototype=null,r[S]=e):r=B(),void 0===t?r:P(r,t)},keys:i.getKeys=i.getKeys||j(D,U,!1)});var N=function(e,t,r){if(!(t in R)){for(var n=[],i=0;t>i;i++)n[i]="a["+i+"]";R[t]=Function("F,a","return new F("+n.join(",")+")")}return R[t](e,r)};o(o.P,"Function",{bind:function(e){var t=m(this),r=C.call(arguments,1),n=function(){var i=r.concat(C.call(arguments));return this instanceof n?N(t,i.length,i):f(t,i,e)};return g(t.prototype)&&(n.prototype=t.prototype),n}}),o(o.P+o.F*p(function(){c&&C.call(c)}),"Array",{slice:function(e,t){var r=w(this.length),n=l(this);if(t=void 0===t?r:t,"Array"==n)return C.call(this,e,t);for(var i=x(e,r),o=x(t,r),a=w(o-i),s=Array(a),c=0;a>c;c++)s[c]="String"==n?this.charAt(i+c):this[i+c];return s}}),o(o.P+o.F*(_!=Object),"Array",{join:function(e){return L.call(_(this),void 0===e?",":e)}}),o(o.S,"Array",{isArray:e("./$.is-array")});var I=function(e){return function(t,r){m(t);var n=_(this),i=w(n.length),o=e?i-1:0,a=e?-1:1;if(arguments.length<2)for(;;){if(o in n){r=n[o],o+=a;break}if(o+=a,e?0>o:o>=i)throw TypeError("Reduce of empty array with no initial value")}for(;e?o>=0:i>o;o+=a)o in n&&(r=t(r,n[o],o,this));return r}},V=function(e){return function(t){return e(this,t,arguments[1])}};o(o.P,"Array",{forEach:i.each=i.each||V(M(0)),map:V(M(1)),filter:V(M(2)),some:V(M(3)),every:V(M(4)),reduce:I(!1),reduceRight:I(!0),indexOf:V(E),lastIndexOf:function(e,t){var r=y(this),n=w(r.length),i=n-1;for(arguments.length>1&&(i=Math.min(i,b(t))),0>i&&(i=w(n+i));i>=0;i--)if(i in r&&r[i]===e)return i;return-1}}),o(o.S,"Date",{now:function(){return+new Date}});var G=function(e){return e>9?e:"0"+e};o(o.P+o.F*(p(function(){return"0385-07-25T07:06:39.999Z"!=new Date(-5e13-1).toISOString()})||!p(function(){new Date(NaN).toISOString()})),"Date",{toISOString:function(){if(!isFinite(this))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),r=e.getUTCMilliseconds(),n=0>t?"-":t>9999?"+":"";return n+("00000"+Math.abs(t)).slice(n?-6:-4)+"-"+G(e.getUTCMonth()+1)+"-"+G(e.getUTCDate())+"T"+G(e.getUTCHours())+":"+G(e.getUTCMinutes())+":"+G(e.getUTCSeconds())+"."+(r>99?r:"0"+G(r))+"Z"}})},{"./$":46,"./$.a-function":2,"./$.an-object":4,"./$.array-includes":7,"./$.array-methods":8,"./$.cof":11,"./$.descriptors":19,"./$.dom-create":20,"./$.export":22,"./$.fails":24,"./$.has":30,"./$.html":32,"./$.invoke":33,"./$.iobject":34,"./$.is-array":36,"./$.is-object":38,"./$.property-desc":59,"./$.to-index":76,"./$.to-integer":77,"./$.to-iobject":78,"./$.to-length":79,"./$.to-object":80,"./$.uid":82}],86:[function(e,t,r){var n=e("./$.export");n(n.P,"Array",{copyWithin:e("./$.array-copy-within")}),e("./$.add-to-unscopables")("copyWithin")},{"./$.add-to-unscopables":3,"./$.array-copy-within":5,"./$.export":22}],87:[function(e,t,r){var n=e("./$.export");n(n.P,"Array",{fill:e("./$.array-fill")}),e("./$.add-to-unscopables")("fill")},{"./$.add-to-unscopables":3,"./$.array-fill":6,"./$.export":22}],88:[function(e,t,r){"use strict";var n=e("./$.export"),i=e("./$.array-methods")(6),o="findIndex",a=!0;o in[]&&Array(1)[o](function(){a=!1}),n(n.P+n.F*a,"Array",{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),e("./$.add-to-unscopables")(o)},{"./$.add-to-unscopables":3,"./$.array-methods":8,"./$.export":22}],89:[function(e,t,r){"use strict";var n=e("./$.export"),i=e("./$.array-methods")(5),o="find",a=!0;o in[]&&Array(1)[o](function(){a=!1}),n(n.P+n.F*a,"Array",{find:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),e("./$.add-to-unscopables")(o)},{"./$.add-to-unscopables":3,"./$.array-methods":8,"./$.export":22}],90:[function(e,t,r){"use strict";var n=e("./$.ctx"),i=e("./$.export"),o=e("./$.to-object"),a=e("./$.iter-call"),s=e("./$.is-array-iter"),c=e("./$.to-length"),u=e("./core.get-iterator-method");i(i.S+i.F*!e("./$.iter-detect")(function(e){Array.from(e)}),"Array",{from:function(e){var t,r,i,h,l=o(e),f="function"==typeof this?this:Array,p=arguments,d=p.length,m=d>1?p[1]:void 0,g=void 0!==m,v=0,y=u(l);if(g&&(m=n(m,d>2?p[2]:void 0,2)),void 0==y||f==Array&&s(y))for(t=c(l.length),r=new f(t);t>v;v++)r[v]=g?m(l[v],v):l[v];else for(h=y.call(l),r=new f;!(i=h.next()).done;v++)r[v]=g?a(h,m,[i.value,v],!0):i.value;return r.length=v,r}})},{"./$.ctx":17,"./$.export":22,"./$.is-array-iter":35,"./$.iter-call":40,"./$.iter-detect":43,"./$.to-length":79,"./$.to-object":80,"./core.get-iterator-method":84}],91:[function(e,t,r){"use strict";var n=e("./$.add-to-unscopables"),i=e("./$.iter-step"),o=e("./$.iterators"),a=e("./$.to-iobject");t.exports=e("./$.iter-define")(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,r=this._i++;return!e||r>=e.length?(this._t=void 0,i(1)):"keys"==t?i(0,r):"values"==t?i(0,e[r]):i(0,[r,e[r]])},"values"),o.Arguments=o.Array,n("keys"),n("values"),n("entries")},{"./$.add-to-unscopables":3,"./$.iter-define":42,"./$.iter-step":44,"./$.iterators":45,"./$.to-iobject":78}],92:[function(e,t,r){"use strict";var n=e("./$.export");n(n.S+n.F*e("./$.fails")(function(){function e(){}return!(Array.of.call(e)instanceof e)}),"Array",{of:function(){for(var e=0,t=arguments,r=t.length,n=new("function"==typeof this?this:Array)(r);r>e;)n[e]=t[e++];return n.length=r,n}})},{"./$.export":22,"./$.fails":24}],93:[function(e,t,r){e("./$.set-species")("Array")},{"./$.set-species":65}],94:[function(e,t,r){"use strict";var n=e("./$"),i=e("./$.is-object"),o=e("./$.wks")("hasInstance"),a=Function.prototype;o in a||n.setDesc(a,o,{value:function(e){if("function"!=typeof this||!i(e))return!1;if(!i(this.prototype))return e instanceof this;for(;e=n.getProto(e);)if(this.prototype===e)return!0;return!1}})},{"./$":46,"./$.is-object":38,"./$.wks":83}],95:[function(e,t,r){var n=e("./$").setDesc,i=e("./$.property-desc"),o=e("./$.has"),a=Function.prototype,s=/^\s*function ([^ (]*)/,c="name";c in a||e("./$.descriptors")&&n(a,c,{configurable:!0,get:function(){var e=(""+this).match(s),t=e?e[1]:"";return o(this,c)||n(this,c,i(5,t)),t}})},{"./$":46,"./$.descriptors":19,"./$.has":30,"./$.property-desc":59}],96:[function(e,t,r){"use strict";var n=e("./$.collection-strong");e("./$.collection")("Map",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=n.getEntry(this,e);return t&&t.v},set:function(e,t){return n.def(this,0===e?0:e,t)}},n,!0)},{"./$.collection":15,"./$.collection-strong":12}],97:[function(e,t,r){var n=e("./$.export"),i=e("./$.math-log1p"),o=Math.sqrt,a=Math.acosh;n(n.S+n.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))),"Math",{acosh:function(e){return(e=+e)<1?NaN:e>94906265.62425156?Math.log(e)+Math.LN2:i(e-1+o(e-1)*o(e+1))}})},{"./$.export":22,"./$.math-log1p":50}],98:[function(e,t,r){function n(e){return isFinite(e=+e)&&0!=e?0>e?-n(-e):Math.log(e+Math.sqrt(e*e+1)):e}var i=e("./$.export");i(i.S,"Math",{asinh:n})},{"./$.export":22}],99:[function(e,t,r){var n=e("./$.export");n(n.S,"Math",{atanh:function(e){return 0==(e=+e)?e:Math.log((1+e)/(1-e))/2}})},{"./$.export":22}],100:[function(e,t,r){var n=e("./$.export"),i=e("./$.math-sign");n(n.S,"Math",{cbrt:function(e){return i(e=+e)*Math.pow(Math.abs(e),1/3)}})},{"./$.export":22,"./$.math-sign":51}],101:[function(e,t,r){var n=e("./$.export");n(n.S,"Math",{clz32:function(e){return(e>>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}})},{"./$.export":22}],102:[function(e,t,r){var n=e("./$.export"),i=Math.exp;n(n.S,"Math",{cosh:function(e){return(i(e=+e)+i(-e))/2}})},{"./$.export":22}],103:[function(e,t,r){var n=e("./$.export");n(n.S,"Math",{expm1:e("./$.math-expm1")})},{"./$.export":22,"./$.math-expm1":49}],104:[function(e,t,r){var n=e("./$.export"),i=e("./$.math-sign"),o=Math.pow,a=o(2,-52),s=o(2,-23),c=o(2,127)*(2-s),u=o(2,-126),h=function(e){return e+1/a-1/a};n(n.S,"Math",{fround:function(e){var t,r,n=Math.abs(e),o=i(e);return u>n?o*h(n/u/s)*u*s:(t=(1+s/a)*n,r=t-(t-n),r>c||r!=r?o*(1/0):o*r)}})},{"./$.export":22,
-"./$.math-sign":51}],105:[function(e,t,r){var n=e("./$.export"),i=Math.abs;n(n.S,"Math",{hypot:function(e,t){for(var r,n,o=0,a=0,s=arguments,c=s.length,u=0;c>a;)r=i(s[a++]),r>u?(n=u/r,o=o*n*n+1,u=r):r>0?(n=r/u,o+=n*n):o+=r;return u===1/0?1/0:u*Math.sqrt(o)}})},{"./$.export":22}],106:[function(e,t,r){var n=e("./$.export"),i=Math.imul;n(n.S+n.F*e("./$.fails")(function(){return-5!=i(4294967295,5)||2!=i.length}),"Math",{imul:function(e,t){var r=65535,n=+e,i=+t,o=r&n,a=r&i;return 0|o*a+((r&n>>>16)*a+o*(r&i>>>16)<<16>>>0)}})},{"./$.export":22,"./$.fails":24}],107:[function(e,t,r){var n=e("./$.export");n(n.S,"Math",{log10:function(e){return Math.log(e)/Math.LN10}})},{"./$.export":22}],108:[function(e,t,r){var n=e("./$.export");n(n.S,"Math",{log1p:e("./$.math-log1p")})},{"./$.export":22,"./$.math-log1p":50}],109:[function(e,t,r){var n=e("./$.export");n(n.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},{"./$.export":22}],110:[function(e,t,r){var n=e("./$.export");n(n.S,"Math",{sign:e("./$.math-sign")})},{"./$.export":22,"./$.math-sign":51}],111:[function(e,t,r){var n=e("./$.export"),i=e("./$.math-expm1"),o=Math.exp;n(n.S+n.F*e("./$.fails")(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(e){return Math.abs(e=+e)<1?(i(e)-i(-e))/2:(o(e-1)-o(-e-1))*(Math.E/2)}})},{"./$.export":22,"./$.fails":24,"./$.math-expm1":49}],112:[function(e,t,r){var n=e("./$.export"),i=e("./$.math-expm1"),o=Math.exp;n(n.S,"Math",{tanh:function(e){var t=i(e=+e),r=i(-e);return t==1/0?1:r==1/0?-1:(t-r)/(o(e)+o(-e))}})},{"./$.export":22,"./$.math-expm1":49}],113:[function(e,t,r){var n=e("./$.export");n(n.S,"Math",{trunc:function(e){return(e>0?Math.floor:Math.ceil)(e)}})},{"./$.export":22}],114:[function(e,t,r){"use strict";var n=e("./$"),i=e("./$.global"),o=e("./$.has"),a=e("./$.cof"),s=e("./$.to-primitive"),c=e("./$.fails"),u=e("./$.string-trim").trim,h="Number",l=i[h],f=l,p=l.prototype,d=a(n.create(p))==h,m="trim"in String.prototype,g=function(e){var t=s(e,!1);if("string"==typeof t&&t.length>2){t=m?t.trim():u(t,3);var r,n,i,o=t.charCodeAt(0);if(43===o||45===o){if(r=t.charCodeAt(2),88===r||120===r)return NaN}else if(48===o){switch(t.charCodeAt(1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+t}for(var a,c=t.slice(2),h=0,l=c.length;l>h;h++)if(a=c.charCodeAt(h),48>a||a>i)return NaN;return parseInt(c,n)}}return+t};l(" 0o1")&&l("0b1")&&!l("+0x1")||(l=function(e){var t=arguments.length<1?0:e,r=this;return r instanceof l&&(d?c(function(){p.valueOf.call(r)}):a(r)!=h)?new f(g(t)):g(t)},n.each.call(e("./$.descriptors")?n.getNames(f):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),function(e){o(f,e)&&!o(l,e)&&n.setDesc(l,e,n.getDesc(f,e))}),l.prototype=p,p.constructor=l,e("./$.redefine")(i,h,l))},{"./$":46,"./$.cof":11,"./$.descriptors":19,"./$.fails":24,"./$.global":29,"./$.has":30,"./$.redefine":61,"./$.string-trim":74,"./$.to-primitive":81}],115:[function(e,t,r){var n=e("./$.export");n(n.S,"Number",{EPSILON:Math.pow(2,-52)})},{"./$.export":22}],116:[function(e,t,r){var n=e("./$.export"),i=e("./$.global").isFinite;n(n.S,"Number",{isFinite:function(e){return"number"==typeof e&&i(e)}})},{"./$.export":22,"./$.global":29}],117:[function(e,t,r){var n=e("./$.export");n(n.S,"Number",{isInteger:e("./$.is-integer")})},{"./$.export":22,"./$.is-integer":37}],118:[function(e,t,r){var n=e("./$.export");n(n.S,"Number",{isNaN:function(e){return e!=e}})},{"./$.export":22}],119:[function(e,t,r){var n=e("./$.export"),i=e("./$.is-integer"),o=Math.abs;n(n.S,"Number",{isSafeInteger:function(e){return i(e)&&o(e)<=9007199254740991}})},{"./$.export":22,"./$.is-integer":37}],120:[function(e,t,r){var n=e("./$.export");n(n.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},{"./$.export":22}],121:[function(e,t,r){var n=e("./$.export");n(n.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},{"./$.export":22}],122:[function(e,t,r){var n=e("./$.export");n(n.S,"Number",{parseFloat:parseFloat})},{"./$.export":22}],123:[function(e,t,r){var n=e("./$.export");n(n.S,"Number",{parseInt:parseInt})},{"./$.export":22}],124:[function(e,t,r){var n=e("./$.export");n(n.S+n.F,"Object",{assign:e("./$.object-assign")})},{"./$.export":22,"./$.object-assign":53}],125:[function(e,t,r){var n=e("./$.is-object");e("./$.object-sap")("freeze",function(e){return function(t){return e&&n(t)?e(t):t}})},{"./$.is-object":38,"./$.object-sap":54}],126:[function(e,t,r){var n=e("./$.to-iobject");e("./$.object-sap")("getOwnPropertyDescriptor",function(e){return function(t,r){return e(n(t),r)}})},{"./$.object-sap":54,"./$.to-iobject":78}],127:[function(e,t,r){e("./$.object-sap")("getOwnPropertyNames",function(){return e("./$.get-names").get})},{"./$.get-names":28,"./$.object-sap":54}],128:[function(e,t,r){var n=e("./$.to-object");e("./$.object-sap")("getPrototypeOf",function(e){return function(t){return e(n(t))}})},{"./$.object-sap":54,"./$.to-object":80}],129:[function(e,t,r){var n=e("./$.is-object");e("./$.object-sap")("isExtensible",function(e){return function(t){return n(t)?e?e(t):!0:!1}})},{"./$.is-object":38,"./$.object-sap":54}],130:[function(e,t,r){var n=e("./$.is-object");e("./$.object-sap")("isFrozen",function(e){return function(t){return n(t)?e?e(t):!1:!0}})},{"./$.is-object":38,"./$.object-sap":54}],131:[function(e,t,r){var n=e("./$.is-object");e("./$.object-sap")("isSealed",function(e){return function(t){return n(t)?e?e(t):!1:!0}})},{"./$.is-object":38,"./$.object-sap":54}],132:[function(e,t,r){var n=e("./$.export");n(n.S,"Object",{is:e("./$.same-value")})},{"./$.export":22,"./$.same-value":63}],133:[function(e,t,r){var n=e("./$.to-object");e("./$.object-sap")("keys",function(e){return function(t){return e(n(t))}})},{"./$.object-sap":54,"./$.to-object":80}],134:[function(e,t,r){var n=e("./$.is-object");e("./$.object-sap")("preventExtensions",function(e){return function(t){return e&&n(t)?e(t):t}})},{"./$.is-object":38,"./$.object-sap":54}],135:[function(e,t,r){var n=e("./$.is-object");e("./$.object-sap")("seal",function(e){return function(t){return e&&n(t)?e(t):t}})},{"./$.is-object":38,"./$.object-sap":54}],136:[function(e,t,r){var n=e("./$.export");n(n.S,"Object",{setPrototypeOf:e("./$.set-proto").set})},{"./$.export":22,"./$.set-proto":64}],137:[function(e,t,r){"use strict";var n=e("./$.classof"),i={};i[e("./$.wks")("toStringTag")]="z",i+""!="[object z]"&&e("./$.redefine")(Object.prototype,"toString",function(){return"[object "+n(this)+"]"},!0)},{"./$.classof":10,"./$.redefine":61,"./$.wks":83}],138:[function(e,t,r){"use strict";var n,i=e("./$"),o=e("./$.library"),a=e("./$.global"),s=e("./$.ctx"),c=e("./$.classof"),u=e("./$.export"),h=e("./$.is-object"),l=e("./$.an-object"),f=e("./$.a-function"),p=e("./$.strict-new"),d=e("./$.for-of"),m=e("./$.set-proto").set,g=e("./$.same-value"),v=e("./$.wks")("species"),y=e("./$.species-constructor"),b=e("./$.microtask"),x="Promise",w=a.process,_="process"==c(w),S=a[x],M=function(e){var t=new S(function(){});return e&&(t.constructor=Object),S.resolve(t)===t},E=function(){function t(e){var r=new S(e);return m(r,t.prototype),r}var r=!1;try{if(r=S&&S.resolve&&M(),m(t,S),t.prototype=i.create(S.prototype,{constructor:{value:t}}),t.resolve(5).then(function(){})instanceof t||(r=!1),r&&e("./$.descriptors")){var n=!1;S.resolve(i.setDesc({},"then",{get:function(){n=!0}})),r=n}}catch(o){r=!1}return r}(),T=function(e,t){return o&&e===S&&t===n?!0:g(e,t)},A=function(e){var t=l(e)[v];return void 0!=t?t:e},C=function(e){var t;return h(e)&&"function"==typeof(t=e.then)?t:!1},L=function(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n}),this.resolve=f(t),this.reject=f(r)},k=function(e){try{e()}catch(t){return{error:t}}},F=function(e,t){if(!e.n){e.n=!0;var r=e.c;b(function(){for(var n=e.v,i=1==e.s,o=0,s=function(t){var r,o,a=i?t.ok:t.fail,s=t.resolve,c=t.reject;try{a?(i||(e.h=!0),r=a===!0?n:a(n),r===t.promise?c(TypeError("Promise-chain cycle")):(o=C(r))?o.call(r,s,c):s(r)):c(n)}catch(u){c(u)}};r.length>o;)s(r[o++]);r.length=0,e.n=!1,t&&setTimeout(function(){var t,r,i=e.p;P(i)&&(_?w.emit("unhandledRejection",n,i):(t=a.onunhandledrejection)?t({promise:i,reason:n}):(r=a.console)&&r.error&&r.error("Unhandled promise rejection",n)),e.a=void 0},1)})}},P=function(e){var t,r=e._d,n=r.a||r.c,i=0;if(r.h)return!1;for(;n.length>i;)if(t=n[i++],t.fail||!P(t.promise))return!1;return!0},R=function(e){var t=this;t.d||(t.d=!0,t=t.r||t,t.v=e,t.s=2,t.a=t.c.slice(),F(t,!0))},D=function(e){var t,r=this;if(!r.d){r.d=!0,r=r.r||r;try{if(r.p===e)throw TypeError("Promise can't be resolved itself");(t=C(e))?b(function(){var n={r:r,d:!1};try{t.call(e,s(D,n,1),s(R,n,1))}catch(i){R.call(n,i)}}):(r.v=e,r.s=1,F(r,!1))}catch(n){R.call({r:r,d:!1},n)}}};E||(S=function(e){f(e);var t=this._d={p:p(this,S,x),c:[],a:void 0,s:0,d:!1,v:void 0,h:!1,n:!1};try{e(s(D,t,1),s(R,t,1))}catch(r){R.call(t,r)}},e("./$.redefine-all")(S.prototype,{then:function(e,t){var r=new L(y(this,S)),n=r.promise,i=this._d;return r.ok="function"==typeof e?e:!0,r.fail="function"==typeof t&&t,i.c.push(r),i.a&&i.a.push(r),i.s&&F(i,!1),n},"catch":function(e){return this.then(void 0,e)}})),u(u.G+u.W+u.F*!E,{Promise:S}),e("./$.set-to-string-tag")(S,x),e("./$.set-species")(x),n=e("./$.core")[x],u(u.S+u.F*!E,x,{reject:function(e){var t=new L(this),r=t.reject;return r(e),t.promise}}),u(u.S+u.F*(!E||M(!0)),x,{resolve:function(e){if(e instanceof S&&T(e.constructor,this))return e;var t=new L(this),r=t.resolve;return r(e),t.promise}}),u(u.S+u.F*!(E&&e("./$.iter-detect")(function(e){S.all(e)["catch"](function(){})})),x,{all:function(e){var t=A(this),r=new L(t),n=r.resolve,o=r.reject,a=[],s=k(function(){d(e,!1,a.push,a);var r=a.length,s=Array(r);r?i.each.call(a,function(e,i){var a=!1;t.resolve(e).then(function(e){a||(a=!0,s[i]=e,--r||n(s))},o)}):n(s)});return s&&o(s.error),r.promise},race:function(e){var t=A(this),r=new L(t),n=r.reject,i=k(function(){d(e,!1,function(e){t.resolve(e).then(r.resolve,n)})});return i&&n(i.error),r.promise}})},{"./$":46,"./$.a-function":2,"./$.an-object":4,"./$.classof":10,"./$.core":16,"./$.ctx":17,"./$.descriptors":19,"./$.export":22,"./$.for-of":27,"./$.global":29,"./$.is-object":38,"./$.iter-detect":43,"./$.library":48,"./$.microtask":52,"./$.redefine-all":60,"./$.same-value":63,"./$.set-proto":64,"./$.set-species":65,"./$.set-to-string-tag":66,"./$.species-constructor":68,"./$.strict-new":69,"./$.wks":83}],139:[function(e,t,r){var n=e("./$.export"),i=Function.apply;n(n.S,"Reflect",{apply:function(e,t,r){return i.call(e,t,r)}})},{"./$.export":22}],140:[function(e,t,r){var n=e("./$"),i=e("./$.export"),o=e("./$.a-function"),a=e("./$.an-object"),s=e("./$.is-object"),c=Function.bind||e("./$.core").Function.prototype.bind;i(i.S+i.F*e("./$.fails")(function(){function e(){}return!(Reflect.construct(function(){},[],e)instanceof e)}),"Reflect",{construct:function(e,t){o(e);var r=arguments.length<3?e:o(arguments[2]);if(e==r){if(void 0!=t)switch(a(t).length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var i=[null];return i.push.apply(i,t),new(c.apply(e,i))}var u=r.prototype,h=n.create(s(u)?u:Object.prototype),l=Function.apply.call(e,h,t);return s(l)?l:h}})},{"./$":46,"./$.a-function":2,"./$.an-object":4,"./$.core":16,"./$.export":22,"./$.fails":24,"./$.is-object":38}],141:[function(e,t,r){var n=e("./$"),i=e("./$.export"),o=e("./$.an-object");i(i.S+i.F*e("./$.fails")(function(){Reflect.defineProperty(n.setDesc({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(e,t,r){o(e);try{return n.setDesc(e,t,r),!0}catch(i){return!1}}})},{"./$":46,"./$.an-object":4,"./$.export":22,"./$.fails":24}],142:[function(e,t,r){var n=e("./$.export"),i=e("./$").getDesc,o=e("./$.an-object");n(n.S,"Reflect",{deleteProperty:function(e,t){var r=i(o(e),t);return r&&!r.configurable?!1:delete e[t]}})},{"./$":46,"./$.an-object":4,"./$.export":22}],143:[function(e,t,r){"use strict";var n=e("./$.export"),i=e("./$.an-object"),o=function(e){this._t=i(e),this._i=0;var t,r=this._k=[];for(t in e)r.push(t)};e("./$.iter-create")(o,"Object",function(){var e,t=this,r=t._k;do if(t._i>=r.length)return{value:void 0,done:!0};while(!((e=r[t._i++])in t._t));return{value:e,done:!1}}),n(n.S,"Reflect",{enumerate:function(e){return new o(e)}})},{"./$.an-object":4,"./$.export":22,"./$.iter-create":41}],144:[function(e,t,r){var n=e("./$"),i=e("./$.export"),o=e("./$.an-object");i(i.S,"Reflect",{getOwnPropertyDescriptor:function(e,t){return n.getDesc(o(e),t)}})},{"./$":46,"./$.an-object":4,"./$.export":22}],145:[function(e,t,r){var n=e("./$.export"),i=e("./$").getProto,o=e("./$.an-object");n(n.S,"Reflect",{getPrototypeOf:function(e){return i(o(e))}})},{"./$":46,"./$.an-object":4,"./$.export":22}],146:[function(e,t,r){function n(e,t){var r,a,u=arguments.length<3?e:arguments[2];return c(e)===u?e[t]:(r=i.getDesc(e,t))?o(r,"value")?r.value:void 0!==r.get?r.get.call(u):void 0:s(a=i.getProto(e))?n(a,t,u):void 0}var i=e("./$"),o=e("./$.has"),a=e("./$.export"),s=e("./$.is-object"),c=e("./$.an-object");a(a.S,"Reflect",{get:n})},{"./$":46,"./$.an-object":4,"./$.export":22,"./$.has":30,"./$.is-object":38}],147:[function(e,t,r){var n=e("./$.export");n(n.S,"Reflect",{has:function(e,t){return t in e}})},{"./$.export":22}],148:[function(e,t,r){var n=e("./$.export"),i=e("./$.an-object"),o=Object.isExtensible;n(n.S,"Reflect",{isExtensible:function(e){return i(e),o?o(e):!0}})},{"./$.an-object":4,"./$.export":22}],149:[function(e,t,r){var n=e("./$.export");n(n.S,"Reflect",{ownKeys:e("./$.own-keys")})},{"./$.export":22,"./$.own-keys":56}],150:[function(e,t,r){var n=e("./$.export"),i=e("./$.an-object"),o=Object.preventExtensions;n(n.S,"Reflect",{preventExtensions:function(e){i(e);try{return o&&o(e),!0}catch(t){return!1}}})},{"./$.an-object":4,"./$.export":22}],151:[function(e,t,r){var n=e("./$.export"),i=e("./$.set-proto");i&&n(n.S,"Reflect",{setPrototypeOf:function(e,t){i.check(e,t);try{return i.set(e,t),!0}catch(r){return!1}}})},{"./$.export":22,"./$.set-proto":64}],152:[function(e,t,r){function n(e,t,r){var a,h,l=arguments.length<4?e:arguments[3],f=i.getDesc(c(e),t);if(!f){if(u(h=i.getProto(e)))return n(h,t,r,l);f=s(0)}return o(f,"value")?f.writable!==!1&&u(l)?(a=i.getDesc(l,t)||s(0),a.value=r,i.setDesc(l,t,a),!0):!1:void 0===f.set?!1:(f.set.call(l,r),!0)}var i=e("./$"),o=e("./$.has"),a=e("./$.export"),s=e("./$.property-desc"),c=e("./$.an-object"),u=e("./$.is-object");a(a.S,"Reflect",{set:n})},{"./$":46,"./$.an-object":4,"./$.export":22,"./$.has":30,"./$.is-object":38,"./$.property-desc":59}],153:[function(e,t,r){var n=e("./$"),i=e("./$.global"),o=e("./$.is-regexp"),a=e("./$.flags"),s=i.RegExp,c=s,u=s.prototype,h=/a/g,l=/a/g,f=new s(h)!==h;!e("./$.descriptors")||f&&!e("./$.fails")(function(){return l[e("./$.wks")("match")]=!1,s(h)!=h||s(l)==l||"/a/i"!=s(h,"i")})||(s=function(e,t){var r=o(e),n=void 0===t;return this instanceof s||!r||e.constructor!==s||!n?f?new c(r&&!n?e.source:e,t):c((r=e instanceof s)?e.source:e,r&&n?a.call(e):t):e},n.each.call(n.getNames(c),function(e){e in s||n.setDesc(s,e,{configurable:!0,get:function(){return c[e]},set:function(t){c[e]=t}})}),u.constructor=s,s.prototype=u,e("./$.redefine")(i,"RegExp",s)),e("./$.set-species")("RegExp")},{"./$":46,"./$.descriptors":19,"./$.fails":24,"./$.flags":26,"./$.global":29,"./$.is-regexp":39,"./$.redefine":61,"./$.set-species":65,"./$.wks":83}],154:[function(e,t,r){var n=e("./$");e("./$.descriptors")&&"g"!=/./g.flags&&n.setDesc(RegExp.prototype,"flags",{configurable:!0,get:e("./$.flags")})},{"./$":46,"./$.descriptors":19,"./$.flags":26}],155:[function(e,t,r){e("./$.fix-re-wks")("match",1,function(e,t){return function(r){"use strict";var n=e(this),i=void 0==r?void 0:r[t];return void 0!==i?i.call(r,n):new RegExp(r)[t](String(n))}})},{"./$.fix-re-wks":25}],156:[function(e,t,r){e("./$.fix-re-wks")("replace",2,function(e,t,r){return function(n,i){"use strict";var o=e(this),a=void 0==n?void 0:n[t];return void 0!==a?a.call(n,o,i):r.call(String(o),n,i)}})},{"./$.fix-re-wks":25}],157:[function(e,t,r){e("./$.fix-re-wks")("search",1,function(e,t){return function(r){"use strict";var n=e(this),i=void 0==r?void 0:r[t];return void 0!==i?i.call(r,n):new RegExp(r)[t](String(n))}})},{"./$.fix-re-wks":25}],158:[function(e,t,r){e("./$.fix-re-wks")("split",2,function(e,t,r){return function(n,i){"use strict";var o=e(this),a=void 0==n?void 0:n[t];return void 0!==a?a.call(n,o,i):r.call(String(o),n,i)}})},{"./$.fix-re-wks":25}],159:[function(e,t,r){"use strict";var n=e("./$.collection-strong");e("./$.collection")("Set",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return n.def(this,e=0===e?0:e,e)}},n)},{"./$.collection":15,"./$.collection-strong":12}],160:[function(e,t,r){"use strict";var n=e("./$.export"),i=e("./$.string-at")(!1);n(n.P,"String",{codePointAt:function(e){return i(this,e)}})},{"./$.export":22,"./$.string-at":70}],161:[function(e,t,r){"use strict";var n=e("./$.export"),i=e("./$.to-length"),o=e("./$.string-context"),a="endsWith",s=""[a];n(n.P+n.F*e("./$.fails-is-regexp")(a),"String",{endsWith:function(e){var t=o(this,e,a),r=arguments,n=r.length>1?r[1]:void 0,c=i(t.length),u=void 0===n?c:Math.min(i(n),c),h=String(e);return s?s.call(t,h,u):t.slice(u-h.length,u)===h}})},{"./$.export":22,"./$.fails-is-regexp":23,"./$.string-context":71,"./$.to-length":79}],162:[function(e,t,r){var n=e("./$.export"),i=e("./$.to-index"),o=String.fromCharCode,a=String.fromCodePoint;n(n.S+n.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(e){for(var t,r=[],n=arguments,a=n.length,s=0;a>s;){if(t=+n[s++],i(t,1114111)!==t)throw RangeError(t+" is not a valid code point");r.push(65536>t?o(t):o(((t-=65536)>>10)+55296,t%1024+56320))}return r.join("")}})},{"./$.export":22,"./$.to-index":76}],163:[function(e,t,r){"use strict";var n=e("./$.export"),i=e("./$.string-context"),o="includes";n(n.P+n.F*e("./$.fails-is-regexp")(o),"String",{includes:function(e){return!!~i(this,e,o).indexOf(e,arguments.length>1?arguments[1]:void 0)}})},{"./$.export":22,"./$.fails-is-regexp":23,"./$.string-context":71}],164:[function(e,t,r){"use strict";var n=e("./$.string-at")(!0);e("./$.iter-define")(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=n(t,r),this._i+=e.length,{value:e,done:!1})})},{"./$.iter-define":42,"./$.string-at":70}],165:[function(e,t,r){var n=e("./$.export"),i=e("./$.to-iobject"),o=e("./$.to-length");n(n.S,"String",{raw:function(e){for(var t=i(e.raw),r=o(t.length),n=arguments,a=n.length,s=[],c=0;r>c;)s.push(String(t[c++])),a>c&&s.push(String(n[c]));return s.join("")}})},{"./$.export":22,"./$.to-iobject":78,"./$.to-length":79}],166:[function(e,t,r){var n=e("./$.export");n(n.P,"String",{repeat:e("./$.string-repeat")})},{"./$.export":22,"./$.string-repeat":73}],167:[function(e,t,r){"use strict";var n=e("./$.export"),i=e("./$.to-length"),o=e("./$.string-context"),a="startsWith",s=""[a];n(n.P+n.F*e("./$.fails-is-regexp")(a),"String",{startsWith:function(e){var t=o(this,e,a),r=arguments,n=i(Math.min(r.length>1?r[1]:void 0,t.length)),c=String(e);return s?s.call(t,c,n):t.slice(n,n+c.length)===c}})},{"./$.export":22,"./$.fails-is-regexp":23,"./$.string-context":71,"./$.to-length":79}],168:[function(e,t,r){"use strict";e("./$.string-trim")("trim",function(e){return function(){return e(this,3)}})},{"./$.string-trim":74}],169:[function(e,t,r){"use strict";var n=e("./$"),i=e("./$.global"),o=e("./$.has"),a=e("./$.descriptors"),s=e("./$.export"),c=e("./$.redefine"),u=e("./$.fails"),h=e("./$.shared"),l=e("./$.set-to-string-tag"),f=e("./$.uid"),p=e("./$.wks"),d=e("./$.keyof"),m=e("./$.get-names"),g=e("./$.enum-keys"),v=e("./$.is-array"),y=e("./$.an-object"),b=e("./$.to-iobject"),x=e("./$.property-desc"),w=n.getDesc,_=n.setDesc,S=n.create,M=m.get,E=i.Symbol,T=i.JSON,A=T&&T.stringify,C=!1,L=p("_hidden"),k=n.isEnum,F=h("symbol-registry"),P=h("symbols"),R="function"==typeof E,D=Object.prototype,O=a&&u(function(){return 7!=S(_({},"a",{get:function(){return _(this,"a",{value:7}).a}})).a})?function(e,t,r){var n=w(D,t);n&&delete D[t],_(e,t,r),n&&e!==D&&_(D,t,n)}:_,U=function(e){var t=P[e]=S(E.prototype);return t._k=e,a&&C&&O(D,e,{configurable:!0,set:function(t){o(this,L)&&o(this[L],e)&&(this[L][e]=!1),O(this,e,x(1,t))}}),t},B=function(e){return"symbol"==typeof e},j=function(e,t,r){return r&&o(P,t)?(r.enumerable?(o(e,L)&&e[L][t]&&(e[L][t]=!1),r=S(r,{enumerable:x(0,!1)})):(o(e,L)||_(e,L,x(1,{})),e[L][t]=!0),O(e,t,r)):_(e,t,r)},$=function(e,t){y(e);for(var r,n=g(t=b(t)),i=0,o=n.length;o>i;)j(e,r=n[i++],t[r]);return e},N=function(e,t){return void 0===t?S(e):$(S(e),t)},I=function(e){var t=k.call(this,e);return t||!o(this,e)||!o(P,e)||o(this,L)&&this[L][e]?t:!0},V=function(e,t){var r=w(e=b(e),t);return!r||!o(P,t)||o(e,L)&&e[L][t]||(r.enumerable=!0),r},G=function(e){for(var t,r=M(b(e)),n=[],i=0;r.length>i;)o(P,t=r[i++])||t==L||n.push(t);return n},z=function(e){for(var t,r=M(b(e)),n=[],i=0;r.length>i;)o(P,t=r[i++])&&n.push(P[t]);return n},H=function(e){if(void 0!==e&&!B(e)){for(var t,r,n=[e],i=1,o=arguments;o.length>i;)n.push(o[i++]);return t=n[1],"function"==typeof t&&(r=t),!r&&v(t)||(t=function(e,t){return r&&(t=r.call(this,e,t)),B(t)?void 0:t}),n[1]=t,A.apply(T,n)}},W=u(function(){var e=E();return"[null]"!=A([e])||"{}"!=A({a:e})||"{}"!=A(Object(e))});R||(E=function(){if(B(this))throw TypeError("Symbol is not a constructor");return U(f(arguments.length>0?arguments[0]:void 0))},c(E.prototype,"toString",function(){return this._k}),B=function(e){return e instanceof E},n.create=N,n.isEnum=I,n.getDesc=V,n.setDesc=j,n.setDescs=$,n.getNames=m.get=G,n.getSymbols=z,a&&!e("./$.library")&&c(D,"propertyIsEnumerable",I,!0));var X={"for":function(e){return o(F,e+="")?F[e]:F[e]=E(e)},keyFor:function(e){return d(F,e)},useSetter:function(){C=!0},useSimple:function(){C=!1}};n.each.call("hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),function(e){var t=p(e);X[e]=R?t:U(t)}),C=!0,s(s.G+s.W,{Symbol:E}),s(s.S,"Symbol",X),s(s.S+s.F*!R,"Object",{create:N,defineProperty:j,defineProperties:$,getOwnPropertyDescriptor:V,getOwnPropertyNames:G,getOwnPropertySymbols:z}),T&&s(s.S+s.F*(!R||W),"JSON",{stringify:H}),l(E,"Symbol"),l(Math,"Math",!0),l(i.JSON,"JSON",!0)},{"./$":46,"./$.an-object":4,"./$.descriptors":19,"./$.enum-keys":21,"./$.export":22,"./$.fails":24,"./$.get-names":28,"./$.global":29,"./$.has":30,"./$.is-array":36,"./$.keyof":47,"./$.library":48,"./$.property-desc":59,"./$.redefine":61,"./$.set-to-string-tag":66,"./$.shared":67,"./$.to-iobject":78,"./$.uid":82,"./$.wks":83}],170:[function(e,t,r){"use strict";var n=e("./$"),i=e("./$.redefine"),o=e("./$.collection-weak"),a=e("./$.is-object"),s=e("./$.has"),c=o.frozenStore,u=o.WEAK,h=Object.isExtensible||a,l={},f=e("./$.collection")("WeakMap",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){if(a(e)){if(!h(e))return c(this).get(e);if(s(e,u))return e[u][this._i]}},set:function(e,t){return o.def(this,e,t)}},o,!0,!0);7!=(new f).set((Object.freeze||Object)(l),7).get(l)&&n.each.call(["delete","has","get","set"],function(e){var t=f.prototype,r=t[e];i(t,e,function(t,n){if(a(t)&&!h(t)){var i=c(this)[e](t,n);return"set"==e?this:i}return r.call(this,t,n)})})},{"./$":46,"./$.collection":15,"./$.collection-weak":14,"./$.has":30,"./$.is-object":38,"./$.redefine":61}],171:[function(e,t,r){"use strict";var n=e("./$.collection-weak");e("./$.collection")("WeakSet",function(e){return function(){return e(this,arguments.length>0?arguments[0]:void 0)}},{add:function(e){return n.def(this,e,!0)}},n,!1,!0)},{"./$.collection":15,"./$.collection-weak":14}],172:[function(e,t,r){"use strict";var n=e("./$.export"),i=e("./$.array-includes")(!0);n(n.P,"Array",{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),e("./$.add-to-unscopables")("includes")},{"./$.add-to-unscopables":3,"./$.array-includes":7,"./$.export":22}],173:[function(e,t,r){var n=e("./$.export");n(n.P,"Map",{toJSON:e("./$.collection-to-json")("Map")})},{"./$.collection-to-json":13,"./$.export":22}],174:[function(e,t,r){var n=e("./$.export"),i=e("./$.object-to-array")(!0);n(n.S,"Object",{entries:function(e){return i(e)}})},{"./$.export":22,"./$.object-to-array":55}],175:[function(e,t,r){var n=e("./$"),i=e("./$.export"),o=e("./$.own-keys"),a=e("./$.to-iobject"),s=e("./$.property-desc");i(i.S,"Object",{getOwnPropertyDescriptors:function(e){for(var t,r,i=a(e),c=n.setDesc,u=n.getDesc,h=o(i),l={},f=0;h.length>f;)r=u(i,t=h[f++]),t in l?c(l,t,s(0,r)):l[t]=r;return l}})},{"./$":46,"./$.export":22,"./$.own-keys":56,"./$.property-desc":59,"./$.to-iobject":78}],176:[function(e,t,r){var n=e("./$.export"),i=e("./$.object-to-array")(!1);n(n.S,"Object",{values:function(e){return i(e)}})},{"./$.export":22,"./$.object-to-array":55}],177:[function(e,t,r){var n=e("./$.export"),i=e("./$.replacer")(/[\\^$*+?.()|[\]{}]/g,"\\$&");n(n.S,"RegExp",{escape:function(e){return i(e)}})},{"./$.export":22,"./$.replacer":62}],178:[function(e,t,r){var n=e("./$.export");n(n.P,"Set",{toJSON:e("./$.collection-to-json")("Set")})},{"./$.collection-to-json":13,"./$.export":22}],179:[function(e,t,r){"use strict";var n=e("./$.export"),i=e("./$.string-at")(!0);n(n.P,"String",{at:function(e){return i(this,e)}})},{"./$.export":22,"./$.string-at":70}],180:[function(e,t,r){"use strict";var n=e("./$.export"),i=e("./$.string-pad");n(n.P,"String",{padLeft:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!0)}})},{"./$.export":22,"./$.string-pad":72}],181:[function(e,t,r){"use strict";var n=e("./$.export"),i=e("./$.string-pad");n(n.P,"String",{padRight:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0,!1)}})},{"./$.export":22,"./$.string-pad":72}],182:[function(e,t,r){"use strict";e("./$.string-trim")("trimLeft",function(e){return function(){return e(this,1)}})},{"./$.string-trim":74}],183:[function(e,t,r){"use strict";e("./$.string-trim")("trimRight",function(e){return function(){return e(this,2)}})},{"./$.string-trim":74}],184:[function(e,t,r){var n=e("./$"),i=e("./$.export"),o=e("./$.ctx"),a=e("./$.core").Array||Array,s={},c=function(e,t){n.each.call(e.split(","),function(e){void 0==t&&e in a?s[e]=a[e]:e in[]&&(s[e]=o(Function.call,[][e],t))})};c("pop,reverse,shift,keys,values,entries",1),c("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3),c("join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill"),i(i.S,"Array",s)},{"./$":46,"./$.core":16,"./$.ctx":17,"./$.export":22}],185:[function(e,t,r){e("./es6.array.iterator");var n=e("./$.global"),i=e("./$.hide"),o=e("./$.iterators"),a=e("./$.wks")("iterator"),s=n.NodeList,c=n.HTMLCollection,u=s&&s.prototype,h=c&&c.prototype,l=o.NodeList=o.HTMLCollection=o.Array;u&&!u[a]&&i(u,a,l),h&&!h[a]&&i(h,a,l)},{"./$.global":29,"./$.hide":31,"./$.iterators":45,"./$.wks":83,"./es6.array.iterator":91}],186:[function(e,t,r){var n=e("./$.export"),i=e("./$.task");n(n.G+n.B,{setImmediate:i.set,clearImmediate:i.clear})},{"./$.export":22,"./$.task":75}],187:[function(e,t,r){var n=e("./$.global"),i=e("./$.export"),o=e("./$.invoke"),a=e("./$.partial"),s=n.navigator,c=!!s&&/MSIE .\./.test(s.userAgent),u=function(e){return c?function(t,r){return e(o(a,[].slice.call(arguments,2),"function"==typeof t?t:Function(t)),r)}:e};i(i.G+i.B+i.F*c,{setTimeout:u(n.setTimeout),setInterval:u(n.setInterval)})},{"./$.export":22,"./$.global":29,"./$.invoke":33,"./$.partial":57}],188:[function(e,t,r){e("./modules/es5"),e("./modules/es6.symbol"),e("./modules/es6.object.assign"),e("./modules/es6.object.is"),e("./modules/es6.object.set-prototype-of"),e("./modules/es6.object.to-string"),e("./modules/es6.object.freeze"),e("./modules/es6.object.seal"),e("./modules/es6.object.prevent-extensions"),e("./modules/es6.object.is-frozen"),e("./modules/es6.object.is-sealed"),e("./modules/es6.object.is-extensible"),e("./modules/es6.object.get-own-property-descriptor"),e("./modules/es6.object.get-prototype-of"),e("./modules/es6.object.keys"),e("./modules/es6.object.get-own-property-names"),e("./modules/es6.function.name"),e("./modules/es6.function.has-instance"),e("./modules/es6.number.constructor"),e("./modules/es6.number.epsilon"),e("./modules/es6.number.is-finite"),e("./modules/es6.number.is-integer"),e("./modules/es6.number.is-nan"),e("./modules/es6.number.is-safe-integer"),e("./modules/es6.number.max-safe-integer"),e("./modules/es6.number.min-safe-integer"),e("./modules/es6.number.parse-float"),e("./modules/es6.number.parse-int"),e("./modules/es6.math.acosh"),e("./modules/es6.math.asinh"),e("./modules/es6.math.atanh"),e("./modules/es6.math.cbrt"),e("./modules/es6.math.clz32"),e("./modules/es6.math.cosh"),e("./modules/es6.math.expm1"),e("./modules/es6.math.fround"),e("./modules/es6.math.hypot"),e("./modules/es6.math.imul"),e("./modules/es6.math.log10"),e("./modules/es6.math.log1p"),e("./modules/es6.math.log2"),e("./modules/es6.math.sign"),e("./modules/es6.math.sinh"),e("./modules/es6.math.tanh"),e("./modules/es6.math.trunc"),e("./modules/es6.string.from-code-point"),e("./modules/es6.string.raw"),e("./modules/es6.string.trim"),e("./modules/es6.string.iterator"),e("./modules/es6.string.code-point-at"),e("./modules/es6.string.ends-with"),e("./modules/es6.string.includes"),e("./modules/es6.string.repeat"),e("./modules/es6.string.starts-with"),e("./modules/es6.array.from"),e("./modules/es6.array.of"),e("./modules/es6.array.iterator"),e("./modules/es6.array.species"),e("./modules/es6.array.copy-within"),e("./modules/es6.array.fill"),e("./modules/es6.array.find"),e("./modules/es6.array.find-index"),e("./modules/es6.regexp.constructor"),e("./modules/es6.regexp.flags"),e("./modules/es6.regexp.match"),e("./modules/es6.regexp.replace"),e("./modules/es6.regexp.search"),e("./modules/es6.regexp.split"),e("./modules/es6.promise"),e("./modules/es6.map"),e("./modules/es6.set"),e("./modules/es6.weak-map"),e("./modules/es6.weak-set"),e("./modules/es6.reflect.apply"),e("./modules/es6.reflect.construct"),e("./modules/es6.reflect.define-property"),e("./modules/es6.reflect.delete-property"),e("./modules/es6.reflect.enumerate"),e("./modules/es6.reflect.get"),e("./modules/es6.reflect.get-own-property-descriptor"),e("./modules/es6.reflect.get-prototype-of"),e("./modules/es6.reflect.has"),e("./modules/es6.reflect.is-extensible"),e("./modules/es6.reflect.own-keys"),e("./modules/es6.reflect.prevent-extensions"),e("./modules/es6.reflect.set"),e("./modules/es6.reflect.set-prototype-of"),e("./modules/es7.array.includes"),e("./modules/es7.string.at"),e("./modules/es7.string.pad-left"),e("./modules/es7.string.pad-right"),e("./modules/es7.string.trim-left"),e("./modules/es7.string.trim-right"),e("./modules/es7.regexp.escape"),e("./modules/es7.object.get-own-property-descriptors"),e("./modules/es7.object.values"),e("./modules/es7.object.entries"),e("./modules/es7.map.to-json"),e("./modules/es7.set.to-json"),e("./modules/js.array.statics"),e("./modules/web.timers"),e("./modules/web.immediate"),e("./modules/web.dom.iterable"),t.exports=e("./modules/$.core")},{"./modules/$.core":16,"./modules/es5":85,"./modules/es6.array.copy-within":86,"./modules/es6.array.fill":87,"./modules/es6.array.find":89,"./modules/es6.array.find-index":88,"./modules/es6.array.from":90,"./modules/es6.array.iterator":91,"./modules/es6.array.of":92,"./modules/es6.array.species":93,"./modules/es6.function.has-instance":94,"./modules/es6.function.name":95,"./modules/es6.map":96,"./modules/es6.math.acosh":97,"./modules/es6.math.asinh":98,"./modules/es6.math.atanh":99,"./modules/es6.math.cbrt":100,"./modules/es6.math.clz32":101,"./modules/es6.math.cosh":102,"./modules/es6.math.expm1":103,"./modules/es6.math.fround":104,
-"./modules/es6.math.hypot":105,"./modules/es6.math.imul":106,"./modules/es6.math.log10":107,"./modules/es6.math.log1p":108,"./modules/es6.math.log2":109,"./modules/es6.math.sign":110,"./modules/es6.math.sinh":111,"./modules/es6.math.tanh":112,"./modules/es6.math.trunc":113,"./modules/es6.number.constructor":114,"./modules/es6.number.epsilon":115,"./modules/es6.number.is-finite":116,"./modules/es6.number.is-integer":117,"./modules/es6.number.is-nan":118,"./modules/es6.number.is-safe-integer":119,"./modules/es6.number.max-safe-integer":120,"./modules/es6.number.min-safe-integer":121,"./modules/es6.number.parse-float":122,"./modules/es6.number.parse-int":123,"./modules/es6.object.assign":124,"./modules/es6.object.freeze":125,"./modules/es6.object.get-own-property-descriptor":126,"./modules/es6.object.get-own-property-names":127,"./modules/es6.object.get-prototype-of":128,"./modules/es6.object.is":132,"./modules/es6.object.is-extensible":129,"./modules/es6.object.is-frozen":130,"./modules/es6.object.is-sealed":131,"./modules/es6.object.keys":133,"./modules/es6.object.prevent-extensions":134,"./modules/es6.object.seal":135,"./modules/es6.object.set-prototype-of":136,"./modules/es6.object.to-string":137,"./modules/es6.promise":138,"./modules/es6.reflect.apply":139,"./modules/es6.reflect.construct":140,"./modules/es6.reflect.define-property":141,"./modules/es6.reflect.delete-property":142,"./modules/es6.reflect.enumerate":143,"./modules/es6.reflect.get":146,"./modules/es6.reflect.get-own-property-descriptor":144,"./modules/es6.reflect.get-prototype-of":145,"./modules/es6.reflect.has":147,"./modules/es6.reflect.is-extensible":148,"./modules/es6.reflect.own-keys":149,"./modules/es6.reflect.prevent-extensions":150,"./modules/es6.reflect.set":152,"./modules/es6.reflect.set-prototype-of":151,"./modules/es6.regexp.constructor":153,"./modules/es6.regexp.flags":154,"./modules/es6.regexp.match":155,"./modules/es6.regexp.replace":156,"./modules/es6.regexp.search":157,"./modules/es6.regexp.split":158,"./modules/es6.set":159,"./modules/es6.string.code-point-at":160,"./modules/es6.string.ends-with":161,"./modules/es6.string.from-code-point":162,"./modules/es6.string.includes":163,"./modules/es6.string.iterator":164,"./modules/es6.string.raw":165,"./modules/es6.string.repeat":166,"./modules/es6.string.starts-with":167,"./modules/es6.string.trim":168,"./modules/es6.symbol":169,"./modules/es6.weak-map":170,"./modules/es6.weak-set":171,"./modules/es7.array.includes":172,"./modules/es7.map.to-json":173,"./modules/es7.object.entries":174,"./modules/es7.object.get-own-property-descriptors":175,"./modules/es7.object.values":176,"./modules/es7.regexp.escape":177,"./modules/es7.set.to-json":178,"./modules/es7.string.at":179,"./modules/es7.string.pad-left":180,"./modules/es7.string.pad-right":181,"./modules/es7.string.trim-left":182,"./modules/es7.string.trim-right":183,"./modules/js.array.statics":184,"./modules/web.dom.iterable":185,"./modules/web.immediate":186,"./modules/web.timers":187}],189:[function(e,t,r){(function(e,r){!function(r){"use strict";function n(e,t,r,n){var i=Object.create((t||o).prototype),a=new d(n||[]);return i._invoke=l(e,r,a),i}function i(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(n){return{type:"throw",arg:n}}}function o(){}function a(){}function s(){}function c(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function u(e){this.arg=e}function h(t){function r(e,r){var n=t[e](r),i=n.value;return i instanceof u?Promise.resolve(i.arg).then(o,a):Promise.resolve(i).then(function(e){return n.value=e,n})}function n(e,t){function n(){return r(e,t)}return i=i?i.then(n,n):new Promise(function(e){e(n())})}"object"==typeof e&&e.domain&&(r=e.domain.bind(r));var i,o=r.bind(t,"next"),a=r.bind(t,"throw");r.bind(t,"return");this._invoke=n}function l(e,t,r){var n=_;return function(o,a){if(n===M)throw new Error("Generator is already running");if(n===E){if("throw"===o)throw a;return g()}for(;;){var s=r.delegate;if(s){if("return"===o||"throw"===o&&s.iterator[o]===v){r.delegate=null;var c=s.iterator["return"];if(c){var u=i(c,s.iterator,a);if("throw"===u.type){o="throw",a=u.arg;continue}}if("return"===o)continue}var u=i(s.iterator[o],s.iterator,a);if("throw"===u.type){r.delegate=null,o="throw",a=u.arg;continue}o="next",a=v;var h=u.arg;if(!h.done)return n=S,h;r[s.resultName]=h.value,r.next=s.nextLoc,r.delegate=null}if("next"===o)n===S?r.sent=a:r.sent=v;else if("throw"===o){if(n===_)throw n=E,a;r.dispatchException(a)&&(o="next",a=v)}else"return"===o&&r.abrupt("return",a);n=M;var u=i(e,t,r);if("normal"===u.type){n=r.done?E:S;var h={value:u.arg,done:r.done};if(u.arg!==T)return h;r.delegate&&"next"===o&&(a=v)}else"throw"===u.type&&(n=E,o="throw",a=u.arg)}}}function f(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function p(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function d(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(f,this),this.reset(!0)}function m(e){if(e){var t=e[b];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function i(){for(;++r=0;--n){var i=this.tryEntries[n],o=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var a=y.call(i,"catchLoc"),s=y.call(i,"finallyLoc");if(a&&s){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&y.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),p(r),T}},"catch":function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;p(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:m(e),resultName:t,nextLoc:r},T}}}("object"==typeof r?r:"object"==typeof window?window:"object"==typeof self?self:this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:258}],190:[function(e,t,r){t.exports=e("./lib/polyfill")},{"./lib/polyfill":1}],191:[function(e,t,r){t.exports={"default":e("core-js/library/fn/array/from"),__esModule:!0}},{"core-js/library/fn/array/from":197}],192:[function(e,t,r){t.exports={"default":e("core-js/library/fn/map"),__esModule:!0}},{"core-js/library/fn/map":198}],193:[function(e,t,r){t.exports={"default":e("core-js/library/fn/object/define-property"),__esModule:!0}},{"core-js/library/fn/object/define-property":199}],194:[function(e,t,r){t.exports={"default":e("core-js/library/fn/symbol"),__esModule:!0}},{"core-js/library/fn/symbol":200}],195:[function(e,t,r){"use strict";r["default"]=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},r.__esModule=!0},{}],196:[function(e,t,r){"use strict";var n=e("babel-runtime/core-js/object/define-property")["default"];r["default"]=function(){function e(e,t){for(var r=0;r1)for(var r=1;re?-1:e>0?1:+e}),void 0===Function.prototype.name&&void 0!==Object.defineProperty&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]}}),a.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2},a.CullFaceNone=0,a.CullFaceBack=1,a.CullFaceFront=2,a.CullFaceFrontBack=3,a.FrontFaceDirectionCW=0,a.FrontFaceDirectionCCW=1,a.BasicShadowMap=0,a.PCFShadowMap=1,a.PCFSoftShadowMap=2,a.FrontSide=0,a.BackSide=1,a.DoubleSide=2,a.FlatShading=1,a.SmoothShading=2,a.NoColors=0,a.FaceColors=1,a.VertexColors=2,a.NoBlending=0,a.NormalBlending=1,a.AdditiveBlending=2,a.SubtractiveBlending=3,a.MultiplyBlending=4,a.CustomBlending=5,a.AddEquation=100,a.SubtractEquation=101,a.ReverseSubtractEquation=102,a.MinEquation=103,a.MaxEquation=104,a.ZeroFactor=200,a.OneFactor=201,a.SrcColorFactor=202,a.OneMinusSrcColorFactor=203,a.SrcAlphaFactor=204,a.OneMinusSrcAlphaFactor=205,a.DstAlphaFactor=206,a.OneMinusDstAlphaFactor=207,a.DstColorFactor=208,a.OneMinusDstColorFactor=209,a.SrcAlphaSaturateFactor=210,a.NeverDepth=0,a.AlwaysDepth=1,a.LessDepth=2,a.LessEqualDepth=3,a.EqualDepth=4,a.GreaterEqualDepth=5,a.GreaterDepth=6,a.NotEqualDepth=7,a.MultiplyOperation=0,a.MixOperation=1,a.AddOperation=2,a.UVMapping=300,a.CubeReflectionMapping=301,a.CubeRefractionMapping=302,a.EquirectangularReflectionMapping=303,a.EquirectangularRefractionMapping=304,a.SphericalReflectionMapping=305,a.RepeatWrapping=1e3,a.ClampToEdgeWrapping=1001,a.MirroredRepeatWrapping=1002,a.NearestFilter=1003,a.NearestMipMapNearestFilter=1004,a.NearestMipMapLinearFilter=1005,a.LinearFilter=1006,a.LinearMipMapNearestFilter=1007,a.LinearMipMapLinearFilter=1008,a.UnsignedByteType=1009,a.ByteType=1010,a.ShortType=1011,a.UnsignedShortType=1012,a.IntType=1013,a.UnsignedIntType=1014,a.FloatType=1015,a.HalfFloatType=1025,a.UnsignedShort4444Type=1016,a.UnsignedShort5551Type=1017,a.UnsignedShort565Type=1018,a.AlphaFormat=1019,a.RGBFormat=1020,a.RGBAFormat=1021,a.LuminanceFormat=1022,a.LuminanceAlphaFormat=1023,a.RGBEFormat=a.RGBAFormat,a.RGB_S3TC_DXT1_Format=2001,a.RGBA_S3TC_DXT1_Format=2002,a.RGBA_S3TC_DXT3_Format=2003,a.RGBA_S3TC_DXT5_Format=2004,a.RGB_PVRTC_4BPPV1_Format=2100,a.RGB_PVRTC_2BPPV1_Format=2101,a.RGBA_PVRTC_4BPPV1_Format=2102,a.RGBA_PVRTC_2BPPV1_Format=2103,a.LoopOnce=2200,a.LoopRepeat=2201,a.LoopPingPong=2202,a.Projector=function(){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(e,t){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}},a.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElement("canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}},a.Color=function(e){return 3===arguments.length?this.fromArray(arguments):this.set(e)},a.Color.prototype={constructor:a.Color,r:1,g:1,b:1,set:function(e){return e instanceof a.Color?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(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,r){return this.r=e,this.g=t,this.b=r,this},setHSL:function(){function e(e,t,r){return 0>r&&(r+=1),r>1&&(r-=1),1/6>r?e+6*(t-e)*r:.5>r?t:2/3>r?e+6*(t-e)*(2/3-r):e}return function(t,r,n){if(t=a.Math.euclideanModulo(t,1),r=a.Math.clamp(r,0,1),n=a.Math.clamp(n,0,1),0===r)this.r=this.g=this.b=n;else{var i=.5>=n?n*(1+r):n+r-n*r,o=2*n-i;this.r=e(o,i,t+1/3),this.g=e(o,i,t),this.b=e(o,i,t-1/3)}return this}}(),setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var r;if(r=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var n,i=r[1],o=r[2];switch(i){case"rgb":case"rgba":if(n=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,t(n[5]),this;if(n=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,t(n[5]),this;break;case"hsl":case"hsla":if(n=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var s=parseFloat(n[1])/360,c=parseInt(n[2],10)/100,u=parseInt(n[3],10)/100;return t(n[5]),this.setHSL(s,c,u)}}}else if(r=/^\#([A-Fa-f0-9]+)$/.exec(e)){var h=r[1],l=h.length;if(3===l)return this.r=parseInt(h.charAt(0)+h.charAt(0),16)/255,this.g=parseInt(h.charAt(1)+h.charAt(1),16)/255,this.b=parseInt(h.charAt(2)+h.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(h.charAt(0)+h.charAt(1),16)/255,this.g=parseInt(h.charAt(2)+h.charAt(3),16)/255,this.b=parseInt(h.charAt(4)+h.charAt(5),16)/255,this}if(e&&e.length>0){var h=a.ColorKeywords[e];void 0!==h?this.setHex(h):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 r=t>0?1/t:1;return this.r=Math.pow(e.r,r),this.g=Math.pow(e.g,r),this.b=Math.pow(e.b,r),this},convertGammaToLinear:function(){var e=this.r,t=this.g,r=this.b;return this.r=e*e,this.g=t*t,this.b=r*r,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){var t,r,n=e||{h:0,s:0,l:0},i=this.r,o=this.g,a=this.b,s=Math.max(i,o,a),c=Math.min(i,o,a),u=(c+s)/2;if(c===s)t=0,r=0;else{var h=s-c;switch(r=.5>=u?h/(s+c):h/(2-s-c),s){case i:t=(o-a)/h+(a>o?6:0);break;case o:t=(a-i)/h+2;break;case a:t=(i-o)/h+4}t/=6}return n.h=t,n.s=r,n.l=u,n},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,r){var n=this.getHSL();return n.h+=e,n.s+=t,n.l+=r,this.setHSL(n.h,n.s,n.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},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}},a.ColorKeywords={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},a.Quaternion=function(e,t,r,n){this._x=e||0,this._y=t||0,this._z=r||0,this._w=void 0!==n?n:1},a.Quaternion.prototype={constructor:a.Quaternion,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,r,n){return this._x=e,this._y=t,this._z=r,this._w=n,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if(e instanceof a.Euler==!1)throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var r=Math.cos(e._x/2),n=Math.cos(e._y/2),i=Math.cos(e._z/2),o=Math.sin(e._x/2),s=Math.sin(e._y/2),c=Math.sin(e._z/2),u=e.order;return"XYZ"===u?(this._x=o*n*i+r*s*c,this._y=r*s*i-o*n*c,this._z=r*n*c+o*s*i,this._w=r*n*i-o*s*c):"YXZ"===u?(this._x=o*n*i+r*s*c,this._y=r*s*i-o*n*c,this._z=r*n*c-o*s*i,this._w=r*n*i+o*s*c):"ZXY"===u?(this._x=o*n*i-r*s*c,this._y=r*s*i+o*n*c,this._z=r*n*c+o*s*i,this._w=r*n*i-o*s*c):"ZYX"===u?(this._x=o*n*i-r*s*c,this._y=r*s*i+o*n*c,this._z=r*n*c-o*s*i,this._w=r*n*i+o*s*c):"YZX"===u?(this._x=o*n*i+r*s*c,this._y=r*s*i+o*n*c,this._z=r*n*c-o*s*i,this._w=r*n*i-o*s*c):"XZY"===u&&(this._x=o*n*i-r*s*c,this._y=r*s*i-o*n*c,this._z=r*n*c+o*s*i,this._w=r*n*i+o*s*c),t!==!1&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var r=t/2,n=Math.sin(r);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(r),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t,r=e.elements,n=r[0],i=r[4],o=r[8],a=r[1],s=r[5],c=r[9],u=r[2],h=r[6],l=r[10],f=n+s+l;return f>0?(t=.5/Math.sqrt(f+1),this._w=.25/t,this._x=(h-c)*t,this._y=(o-u)*t,this._z=(a-i)*t):n>s&&n>l?(t=2*Math.sqrt(1+n-s-l),this._w=(h-c)/t,this._x=.25*t,this._y=(i+a)/t,this._z=(o+u)/t):s>l?(t=2*Math.sqrt(1+s-n-l),this._w=(o-u)/t,this._x=(i+a)/t,this._y=.25*t,this._z=(c+h)/t):(t=2*Math.sqrt(1+l-n-s),this._w=(a-i)/t,this._x=(o+u)/t,this._y=(c+h)/t,this._z=.25*t),this.onChangeCallback(),this},setFromUnitVectors:function(){var e,t,r=1e-6;return function(n,i){return void 0===e&&(e=new a.Vector3),t=n.dot(i)+1,r>t?(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,i),this._x=e.x,this._y=e.y,this._z=e.z,this._w=t,this.normalize(),this}}(),inverse:function(){return this.conjugate().normalize(),this},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)},multiplyQuaternions:function(e,t){var r=e._x,n=e._y,i=e._z,o=e._w,a=t._x,s=t._y,c=t._z,u=t._w;return this._x=r*u+o*a+n*c-i*s,this._y=n*u+o*s+i*a-r*c,this._z=i*u+o*c+r*s-n*a,this._w=o*u-r*a-n*s-i*c,this.onChangeCallback(),this},multiplyVector3:function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var r=this._x,n=this._y,i=this._z,o=this._w,a=o*e._w+r*e._x+n*e._y+i*e._z;if(0>a?(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=r,this._y=n,this._z=i,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*(r+this._x),this._y=.5*(n+this._y),this._z=.5*(i+this._z),this;var u=Math.sin((1-t)*s)/c,h=Math.sin(t*s)/c;return this._w=o*u+this._w*h,this._x=r*u+this._x*h,this._y=n*u+this._y*h,this._z=i*u+this._z*h,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(){}},a.Quaternion.slerp=function(e,t,r,n){return r.copy(e).slerp(t,n)},a.Vector2=function(e,t){this.x=e||0,this.y=t||0},a.Vector2.prototype={constructor:a.Vector2,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},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)}},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 a.Vector2,t=new a.Vector2),e.set(r,r),t.set(n,n),this.clamp(e,t)}}(),clampLength:function(e,t){var r=this.length();return this.multiplyScalar(Math.max(e,Math.min(t,r))/r),this},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())},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,r=this.y-e.y;return t*t+r*r},setLength:function(e){return this.multiplyScalar(e/this.length())},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,r){return this.subVectors(t,e).multiplyScalar(r).add(e),this},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,r){return void 0===r&&(r=0),t=t*e.itemSize+r,this.x=e.array[t],this.y=e.array[t+1],this},rotateAround:function(e,t){var r=Math.cos(t),n=Math.sin(t),i=this.x-e.x,o=this.y-e.y;return this.x=i*r-o*n+e.x,this.y=i*n+o*r+e.y,this}},a.Vector3=function(e,t,r){this.x=e||0,this.y=t||0,this.z=r||0},a.Vector3.prototype={constructor:a.Vector3,set:function(e,t,r){return this.x=e,this.y=t,this.z=r,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)}},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 instanceof a.Euler==!1&&console.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order."),void 0===e&&(e=new a.Quaternion),this.applyQuaternion(e.setFromEuler(t)),this}}(),applyAxisAngle:function(){var e;return function(t,r){return void 0===e&&(e=new a.Quaternion),this.applyQuaternion(e.setFromAxisAngle(t,r)),this}}(),applyMatrix3:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6]*n,this.y=i[1]*t+i[4]*r+i[7]*n,this.z=i[2]*t+i[5]*r+i[8]*n,this},applyMatrix4:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[4]*r+i[8]*n+i[12],this.y=i[1]*t+i[5]*r+i[9]*n+i[13],this.z=i[2]*t+i[6]*r+i[10]*n+i[14],this},applyProjection:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements,o=1/(i[3]*t+i[7]*r+i[11]*n+i[15]);return this.x=(i[0]*t+i[4]*r+i[8]*n+i[12])*o,this.y=(i[1]*t+i[5]*r+i[9]*n+i[13])*o,this.z=(i[2]*t+i[6]*r+i[10]*n+i[14])*o,this},applyQuaternion:function(e){var t=this.x,r=this.y,n=this.z,i=e.x,o=e.y,a=e.z,s=e.w,c=s*t+o*n-a*r,u=s*r+a*t-i*n,h=s*n+i*r-o*t,l=-i*t-o*r-a*n;return this.x=c*s+l*-i+u*-a-h*-o,this.y=u*s+l*-o+h*-i-c*-a,this.z=h*s+l*-a+c*-o-u*-i,this},project:function(){var e;return function(t){return void 0===e&&(e=new a.Matrix4),e.multiplyMatrices(t.projectionMatrix,e.getInverse(t.matrixWorld)),this.applyProjection(e)}}(),unproject:function(){var e;return function(t){return void 0===e&&(e=new a.Matrix4),e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyProjection(e)}}(),transformDirection:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[4]*r+i[8]*n,this.y=i[1]*t+i[5]*r+i[9]*n,this.z=i[2]*t+i[6]*r+i[10]*n,this.normalize(),this},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(r,n){return void 0===e&&(e=new a.Vector3,t=new a.Vector3),e.set(r,r,r),t.set(n,n,n),this.clamp(e,t)}}(),clampLength:function(e,t){var r=this.length();return this.multiplyScalar(Math.max(e,Math.min(t,r))/r),this},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(e){return this.multiplyScalar(e/this.length())},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,r){return this.subVectors(t,e).multiplyScalar(r).add(e),this},cross:function(e,t){if(void 0!==t)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t);var r=this.x,n=this.y,i=this.z;return this.x=n*e.z-i*e.y,this.y=i*e.x-r*e.z,this.z=r*e.y-n*e.x,this},crossVectors:function(e,t){var r=e.x,n=e.y,i=e.z,o=t.x,a=t.y,s=t.z;return this.x=n*s-i*a,this.y=i*o-r*s,this.z=r*a-n*o,this},projectOnVector:function(){var e,t;return function(r){return void 0===e&&(e=new a.Vector3),e.copy(r).normalize(),t=this.dot(e),this.copy(e).multiplyScalar(t)}}(),projectOnPlane:function(){var e;return function(t){return void 0===e&&(e=new a.Vector3),e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e;return function(t){return void 0===e&&(e=new a.Vector3),this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(e){var t=this.dot(e)/(this.length()*e.length());return Math.acos(a.Math.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,r=this.y-e.y,n=this.z-e.z;return t*t+r*r+n*n},setEulerFromRotationMatrix:function(e,t){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(e,t){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(e,t)},setFromMatrixPosition:function(e){return this.x=e.elements[12],this.y=e.elements[13],this.z=e.elements[14],this},setFromMatrixScale:function(e){var t=this.set(e.elements[0],e.elements[1],e.elements[2]).length(),r=this.set(e.elements[4],e.elements[5],e.elements[6]).length(),n=this.set(e.elements[8],e.elements[9],e.elements[10]).length();return this.x=t,this.y=r,this.z=n,this},setFromMatrixColumn:function(e,t){var r=4*e,n=t.elements;return this.x=n[r],this.y=n[r+1],this.z=n[r+2],this},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,r){return void 0===r&&(r=0),t=t*e.itemSize+r,this.x=e.array[t],this.y=e.array[t+1],this.z=e.array[t+2],this}},a.Vector4=function(e,t,r,n){this.x=e||0,this.y=t||0,this.z=r||0,this.w=void 0!==n?n:1},a.Vector4.prototype={constructor:a.Vector4,set:function(e,t,r,n){return this.x=e,this.y=t,this.z=r,this.w=n,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)}},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,r=this.y,n=this.z,i=this.w,o=e.elements;return this.x=o[0]*t+o[4]*r+o[8]*n+o[12]*i,this.y=o[1]*t+o[5]*r+o[9]*n+o[13]*i,this.z=o[2]*t+o[6]*r+o[10]*n+o[14]*i,this.w=o[3]*t+o[7]*r+o[11]*n+o[15]*i,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return 1e-4>t?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,r,n,i,o=.01,a=.1,s=e.elements,c=s[0],u=s[4],h=s[8],l=s[1],f=s[5],p=s[9],d=s[2],m=s[6],g=s[10];if(Math.abs(u-l)y&&v>b?o>v?(r=0,n=.707106781,i=.707106781):(r=Math.sqrt(v),n=x/r,i=w/r):y>b?o>y?(r=.707106781,n=0,i=.707106781):(n=Math.sqrt(y),r=x/n,i=_/n):o>b?(r=.707106781,n=.707106781,i=0):(i=Math.sqrt(b),r=w/i,n=_/i),this.set(r,n,i,t),this}var S=Math.sqrt((m-p)*(m-p)+(h-d)*(h-d)+(l-u)*(l-u));return Math.abs(S)<.001&&(S=1),this.x=(m-p)/S,this.y=(h-d)/S,this.z=(l-u)/S,this.w=Math.acos((c+f+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(r,n){return void 0===e&&(e=new a.Vector4,t=new a.Vector4),e.set(r,r,r,r),t.set(n,n,n,n),this.clamp(e,t)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},setLength:function(e){return this.multiplyScalar(e/this.length())},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,r){return this.subVectors(t,e).multiplyScalar(r).add(e),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},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,r){return void 0===r&&(r=0),t=t*e.itemSize+r,this.x=e.array[t],this.y=e.array[t+1],this.z=e.array[t+2],this.w=e.array[t+3],this}},a.Euler=function(e,t,r,n){this._x=e||0,this._y=t||0,this._z=r||0,this._order=n||a.Euler.DefaultOrder},a.Euler.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],a.Euler.DefaultOrder="XYZ",a.Euler.prototype={constructor:a.Euler,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,r,n){return this._x=e,this._y=t,this._z=r,this._order=n||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,r){var n=a.Math.clamp,i=e.elements,o=i[0],s=i[4],c=i[8],u=i[1],h=i[5],l=i[9],f=i[2],p=i[6],d=i[10];return t=t||this._order,"XYZ"===t?(this._y=Math.asin(n(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(p,h),this._z=0)):"YXZ"===t?(this._x=Math.asin(-n(l,-1,1)),Math.abs(l)<.99999?(this._y=Math.atan2(c,d),this._z=Math.atan2(u,h)):(this._y=Math.atan2(-f,o),this._z=0)):"ZXY"===t?(this._x=Math.asin(n(p,-1,1)),Math.abs(p)<.99999?(this._y=Math.atan2(-f,d),this._z=Math.atan2(-s,h)):(this._y=0,this._z=Math.atan2(u,o))):"ZYX"===t?(this._y=Math.asin(-n(f,-1,1)),Math.abs(f)<.99999?(this._x=Math.atan2(p,d),this._z=Math.atan2(u,o)):(this._x=0,this._z=Math.atan2(-s,h))):"YZX"===t?(this._z=Math.asin(n(u,-1,1)),Math.abs(u)<.99999?(this._x=Math.atan2(-l,h),this._y=Math.atan2(-f,o)):(this._x=0,this._y=Math.atan2(c,d))):"XZY"===t?(this._z=Math.asin(-n(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(p,h),this._y=Math.atan2(c,o)):(this._x=Math.atan2(-l,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,r!==!1&&this.onChangeCallback(),this},setFromQuaternion:function(){var e;return function(t,r,n){return void 0===e&&(e=new a.Matrix4),e.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e,r,n),this}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(){var e=new a.Quaternion;return function(t){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 a.Vector3(this._x,this._y,this._z)},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}},a.Line3=function(e,t){this.start=void 0!==e?e:new a.Vector3,this.end=void 0!==t?t:new a.Vector3},a.Line3.prototype={constructor:a.Line3,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},center:function(e){var t=e||new a.Vector3;return t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){var t=e||new a.Vector3;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 r=t||new a.Vector3;return this.delta(r).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(){var e=new a.Vector3,t=new a.Vector3;return function(r,n){e.subVectors(r,this.start),t.subVectors(this.end,this.start);var i=t.dot(t),o=t.dot(e),s=o/i;return n&&(s=a.Math.clamp(s,0,1)),s}}(),closestPointToPoint:function(e,t,r){var n=this.closestPointToPointParameter(e,t),i=r||new a.Vector3;return this.delta(i).multiplyScalar(n).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)}},a.Box2=function(e,t){this.min=void 0!==e?e:new a.Vector2(1/0,1/0),this.max=void 0!==t?t:new a.Vector2(-(1/0),-(1/0))},a.Box2.prototype={constructor:a.Box2,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,r=e.length;r>t;t++)this.expandByPoint(e[t]);return this;
-},setFromCenterAndSize:function(){var e=new a.Vector2;return function(t,r){var n=e.copy(r).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-(1/0),this},empty:function(){return this.max.xthis.max.x||e.ythis.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 a.Vector2;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))},isIntersectionBox:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)},clampPoint:function(e,t){var r=t||new a.Vector2;return r.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new a.Vector2;return function(t){var r=e.copy(t).clamp(this.min,this.max);return r.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)}},a.Box3=function(e,t){this.min=void 0!==e?e:new a.Vector3(1/0,1/0,1/0),this.max=void 0!==t?t:new a.Vector3(-(1/0),-(1/0),-(1/0))},a.Box3.prototype={constructor:a.Box3,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,r=e.length;r>t;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new a.Vector3;return function(t,r){var n=e.copy(r).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}}(),setFromObject:function(){var e=new a.Vector3;return function(t){var r=this;return t.updateMatrixWorld(!0),this.makeEmpty(),t.traverse(function(t){var n=t.geometry;if(void 0!==n)if(n instanceof a.Geometry)for(var i=n.vertices,o=0,s=i.length;s>o;o++)e.copy(i[o]),e.applyMatrix4(t.matrixWorld),r.expandByPoint(e);else if(n instanceof a.BufferGeometry&&void 0!==n.attributes.position)for(var c=n.attributes.position.array,o=0,s=c.length;s>o;o+=3)e.set(c[o],c[o+1],c[o+2]),e.applyMatrix4(t.matrixWorld),r.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},empty:function(){return this.max.xthis.max.x||e.ythis.max.y||e.zthis.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 r=t||new a.Vector3;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),(e.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)},clampPoint:function(e,t){var r=t||new a.Vector3;return r.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new a.Vector3;return function(t){var r=e.copy(t).clamp(this.min,this.max);return r.sub(t).length()}}(),getBoundingSphere:function(){var e=new a.Vector3;return function(t){var r=t||new a.Sphere;return r.center=this.center(),r.radius=.5*this.size(e).length(),r}}(),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},applyMatrix4:function(){var e=[new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3];return function(t){return 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.makeEmpty(),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)}},a.Matrix3=function(){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.")},a.Matrix3.prototype={constructor:a.Matrix3,set:function(e,t,r,n,i,o,a,s,c){var u=this.elements;return u[0]=e,u[3]=t,u[6]=r,u[1]=n,u[4]=i,u[7]=o,u[2]=a,u[5]=s,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},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)},applyToVector3Array:function(){var e;return function(t,r,n){void 0===e&&(e=new a.Vector3),void 0===r&&(r=0),void 0===n&&(n=t.length);for(var i=0,o=r;n>i;i+=3,o+=3)e.fromArray(t,o),e.applyMatrix3(this),e.toArray(t,o);return t}}(),applyToBuffer:function(){var e;return function(t,r,n){void 0===e&&(e=new a.Vector3),void 0===r&&(r=0),void 0===n&&(n=t.length/t.itemSize);for(var i=0,o=r;n>i;i++,o++)e.x=t.getX(o),e.y=t.getY(o),e.z=t.getZ(o),e.applyMatrix3(this),t.setXYZ(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],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],s=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-r*i*u+r*a*s+n*i*c-n*o*s},getInverse:function(e,t){var r=e.elements,n=this.elements;n[0]=r[10]*r[5]-r[6]*r[9],n[1]=-r[10]*r[1]+r[2]*r[9],n[2]=r[6]*r[1]-r[2]*r[5],n[3]=-r[10]*r[4]+r[6]*r[8],n[4]=r[10]*r[0]-r[2]*r[8],n[5]=-r[6]*r[0]+r[2]*r[4],n[6]=r[9]*r[4]-r[5]*r[8],n[7]=-r[9]*r[0]+r[1]*r[8],n[8]=r[5]*r[0]-r[1]*r[4];var i=r[0]*n[0]+r[1]*n[3]+r[2]*n[6];if(0===i){var o="Matrix3.getInverse(): can't invert matrix, determinant is 0";if(t)throw new Error(o);return console.warn(o),this.identity(),this}return this.multiplyScalar(1/i),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},flattenToArrayOffset:function(e,t){var r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e},getNormalMatrix:function(e){return this.getInverse(e).transpose(),this},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){return this.elements.set(e),this},toArray:function(){var e=this.elements;return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]}},a.Matrix4=function(){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.")},a.Matrix4.prototype={constructor:a.Matrix4,set:function(e,t,r,n,i,o,a,s,c,u,h,l,f,p,d,m){var g=this.elements;return g[0]=e,g[4]=t,g[8]=r,g[12]=n,g[1]=i,g[5]=o,g[9]=a,g[13]=s,g[2]=c,g[6]=u,g[10]=h,g[14]=l,g[3]=f,g[7]=p,g[11]=d,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 a.Matrix4).fromArray(this.elements)},copy:function(e){return this.elements.set(e.elements),this},extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},copyPosition:function(e){var t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this},extractBasis:function(e,t,r){var n=this.elements;return e.set(n[0],n[1],n[2]),t.set(n[4],n[5],n[6]),r.set(n[8],n[9],n[10]),this},makeBasis:function(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this},extractRotation:function(){var e;return function(t){void 0===e&&(e=new a.Vector3);var r=this.elements,n=t.elements,i=1/e.set(n[0],n[1],n[2]).length(),o=1/e.set(n[4],n[5],n[6]).length(),s=1/e.set(n[8],n[9],n[10]).length();return r[0]=n[0]*i,r[1]=n[1]*i,r[2]=n[2]*i,r[4]=n[4]*o,r[5]=n[5]*o,r[6]=n[6]*o,r[8]=n[8]*s,r[9]=n[9]*s,r[10]=n[10]*s,this}}(),makeRotationFromEuler:function(e){e instanceof a.Euler==!1&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,r=e.x,n=e.y,i=e.z,o=Math.cos(r),s=Math.sin(r),c=Math.cos(n),u=Math.sin(n),h=Math.cos(i),l=Math.sin(i);if("XYZ"===e.order){var f=o*h,p=o*l,d=s*h,m=s*l;t[0]=c*h,t[4]=-c*l,t[8]=u,t[1]=p+d*u,t[5]=f-m*u,t[9]=-s*c,t[2]=m-f*u,t[6]=d+p*u,t[10]=o*c}else if("YXZ"===e.order){var g=c*h,v=c*l,y=u*h,b=u*l;t[0]=g+b*s,t[4]=y*s-v,t[8]=o*u,t[1]=o*l,t[5]=o*h,t[9]=-s,t[2]=v*s-y,t[6]=b+g*s,t[10]=o*c}else if("ZXY"===e.order){var g=c*h,v=c*l,y=u*h,b=u*l;t[0]=g-b*s,t[4]=-o*l,t[8]=y+v*s,t[1]=v+y*s,t[5]=o*h,t[9]=b-g*s,t[2]=-o*u,t[6]=s,t[10]=o*c}else if("ZYX"===e.order){var f=o*h,p=o*l,d=s*h,m=s*l;t[0]=c*h,t[4]=d*u-p,t[8]=f*u+m,t[1]=c*l,t[5]=m*u+f,t[9]=p*u-d,t[2]=-u,t[6]=s*c,t[10]=o*c}else if("YZX"===e.order){var x=o*c,w=o*u,_=s*c,S=s*u;t[0]=c*h,t[4]=S-x*l,t[8]=_*l+w,t[1]=l,t[5]=o*h,t[9]=-s*h,t[2]=-u*h,t[6]=w*l+_,t[10]=x-S*l}else if("XZY"===e.order){var x=o*c,w=o*u,_=s*c,S=s*u;t[0]=c*h,t[4]=-l,t[8]=u*h,t[1]=x*l+S,t[5]=o*h,t[9]=w*l-_,t[2]=_*l-w,t[6]=s*h,t[10]=S*l+x}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},makeRotationFromQuaternion:function(e){var t=this.elements,r=e.x,n=e.y,i=e.z,o=e.w,a=r+r,s=n+n,c=i+i,u=r*a,h=r*s,l=r*c,f=n*s,p=n*c,d=i*c,m=o*a,g=o*s,v=o*c;return t[0]=1-(f+d),t[4]=h-v,t[8]=l+g,t[1]=h+v,t[5]=1-(u+d),t[9]=p-m,t[2]=l-g,t[6]=p+m,t[10]=1-(u+f),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},lookAt:function(){var e,t,r;return function(n,i,o){void 0===e&&(e=new a.Vector3),void 0===t&&(t=new a.Vector3),void 0===r&&(r=new a.Vector3);var s=this.elements;return r.subVectors(n,i).normalize(),0===r.lengthSq()&&(r.z=1),e.crossVectors(o,r).normalize(),0===e.lengthSq()&&(r.x+=1e-4,e.crossVectors(o,r).normalize()),t.crossVectors(r,e),s[0]=e.x,s[4]=t.x,s[8]=r.x,s[1]=e.y,s[5]=t.y,s[9]=r.y,s[2]=e.z,s[6]=t.z,s[10]=r.z,this}}(),multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},multiplyMatrices:function(e,t){var r=e.elements,n=t.elements,i=this.elements,o=r[0],a=r[4],s=r[8],c=r[12],u=r[1],h=r[5],l=r[9],f=r[13],p=r[2],d=r[6],m=r[10],g=r[14],v=r[3],y=r[7],b=r[11],x=r[15],w=n[0],_=n[4],S=n[8],M=n[12],E=n[1],T=n[5],A=n[9],C=n[13],L=n[2],k=n[6],F=n[10],P=n[14],R=n[3],D=n[7],O=n[11],U=n[15];return i[0]=o*w+a*E+s*L+c*R,i[4]=o*_+a*T+s*k+c*D,i[8]=o*S+a*A+s*F+c*O,i[12]=o*M+a*C+s*P+c*U,i[1]=u*w+h*E+l*L+f*R,i[5]=u*_+h*T+l*k+f*D,i[9]=u*S+h*A+l*F+f*O,i[13]=u*M+h*C+l*P+f*U,i[2]=p*w+d*E+m*L+g*R,i[6]=p*_+d*T+m*k+g*D,i[10]=p*S+d*A+m*F+g*O,i[14]=p*M+d*C+m*P+g*U,i[3]=v*w+y*E+b*L+x*R,i[7]=v*_+y*T+b*k+x*D,i[11]=v*S+y*A+b*F+x*O,i[15]=v*M+y*C+b*P+x*U,this},multiplyToArray:function(e,t,r){var n=this.elements;return this.multiplyMatrices(e,t),r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],r[4]=n[4],r[5]=n[5],r[6]=n[6],r[7]=n[7],r[8]=n[8],r[9]=n[9],r[10]=n[10],r[11]=n[11],r[12]=n[12],r[13]=n[13],r[14]=n[14],r[15]=n[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},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)},applyToVector3Array:function(){var e;return function(t,r,n){void 0===e&&(e=new a.Vector3),void 0===r&&(r=0),void 0===n&&(n=t.length);for(var i=0,o=r;n>i;i+=3,o+=3)e.fromArray(t,o),e.applyMatrix4(this),e.toArray(t,o);return t}}(),applyToBuffer:function(){var e;return function(t,r,n){void 0===e&&(e=new a.Vector3),void 0===r&&(r=0),void 0===n&&(n=t.length/t.itemSize);for(var i=0,o=r;n>i;i++,o++)e.x=t.getX(o),e.y=t.getY(o),e.z=t.getZ(o),e.applyMatrix4(this),t.setXYZ(e.x,e.y,e.z);return t}}(),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)},determinant:function(){var e=this.elements,t=e[0],r=e[4],n=e[8],i=e[12],o=e[1],a=e[5],s=e[9],c=e[13],u=e[2],h=e[6],l=e[10],f=e[14],p=e[3],d=e[7],m=e[11],g=e[15];return p*(+i*s*h-n*c*h-i*a*l+r*c*l+n*a*f-r*s*f)+d*(+t*s*f-t*c*l+i*o*l-n*o*f+n*c*u-i*s*u)+m*(+t*c*h-t*a*f-i*o*h+r*o*f+i*a*u-r*c*u)+g*(-n*a*u-t*s*h+t*a*l+n*o*h-r*o*l+r*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},flattenToArrayOffset:function(e,t){var r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e},getPosition:function(){var e;return function(){void 0===e&&(e=new a.Vector3),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var t=this.elements;return e.set(t[12],t[13],t[14])}}(),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 r=this.elements,n=e.elements,i=n[0],o=n[4],a=n[8],s=n[12],c=n[1],u=n[5],h=n[9],l=n[13],f=n[2],p=n[6],d=n[10],m=n[14],g=n[3],v=n[7],y=n[11],b=n[15];r[0]=h*m*v-l*d*v+l*p*y-u*m*y-h*p*b+u*d*b,r[4]=s*d*v-a*m*v-s*p*y+o*m*y+a*p*b-o*d*b,r[8]=a*l*v-s*h*v+s*u*y-o*l*y-a*u*b+o*h*b,r[12]=s*h*p-a*l*p-s*u*d+o*l*d+a*u*m-o*h*m,r[1]=l*d*g-h*m*g-l*f*y+c*m*y+h*f*b-c*d*b,r[5]=a*m*g-s*d*g+s*f*y-i*m*y-a*f*b+i*d*b,r[9]=s*h*g-a*l*g-s*c*y+i*l*y+a*c*b-i*h*b,r[13]=a*l*f-s*h*f+s*c*d-i*l*d-a*c*m+i*h*m,r[2]=u*m*g-l*p*g+l*f*v-c*m*v-u*f*b+c*p*b,r[6]=s*p*g-o*m*g-s*f*v+i*m*v+o*f*b-i*p*b,r[10]=o*l*g-s*u*g+s*c*v-i*l*v-o*c*b+i*u*b,r[14]=s*u*f-o*l*f-s*c*p+i*l*p+o*c*m-i*u*m,r[3]=h*p*g-u*d*g-h*f*v+c*d*v+u*f*y-c*p*y,r[7]=o*d*g-a*p*g+a*f*v-i*d*v-o*f*y+i*p*y,r[11]=a*u*g-o*h*g-a*c*v+i*h*v+o*c*y-i*u*y,r[15]=o*h*f-a*u*f+a*c*p-i*h*p-o*c*d+i*u*d;var x=i*r[0]+c*r[4]+f*r[8]+g*r[12];if(0===x){var w="THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";if(t)throw new Error(w);return console.warn(w),this.identity(),this}return this.multiplyScalar(1/x),this},translate:function(e){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(e){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(e){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(e){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(e,t){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},scale:function(e){var t=this.elements,r=e.x,n=e.y,i=e.z;return t[0]*=r,t[4]*=n,t[8]*=i,t[1]*=r,t[5]*=n,t[9]*=i,t[2]*=r,t[6]*=n,t[10]*=i,t[3]*=r,t[7]*=n,t[11]*=i,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,r,n))},makeTranslation:function(e,t,r){return this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var r=Math.cos(t),n=Math.sin(t),i=1-r,o=e.x,a=e.y,s=e.z,c=i*o,u=i*a;return this.set(c*o+r,c*a-n*s,c*s+n*a,0,c*a+n*s,u*a+r,u*s-n*o,0,c*s-n*a,u*s+n*o,i*s*s+r,0,0,0,0,1),this},makeScale:function(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this},compose:function(e,t,r){return this.makeRotationFromQuaternion(t),this.scale(r),this.setPosition(e),this},decompose:function(){var e,t;return function(r,n,i){void 0===e&&(e=new a.Vector3),void 0===t&&(t=new a.Matrix4);var o=this.elements,s=e.set(o[0],o[1],o[2]).length(),c=e.set(o[4],o[5],o[6]).length(),u=e.set(o[8],o[9],o[10]).length(),h=this.determinant();0>h&&(s=-s),r.x=o[12],r.y=o[13],r.z=o[14],t.elements.set(this.elements);var l=1/s,f=1/c,p=1/u;return t.elements[0]*=l,t.elements[1]*=l,t.elements[2]*=l,t.elements[4]*=f,t.elements[5]*=f,t.elements[6]*=f,t.elements[8]*=p,t.elements[9]*=p,t.elements[10]*=p,n.setFromRotationMatrix(t),i.x=s,i.y=c,i.z=u,this}}(),makeFrustum:function(e,t,r,n,i,o){var a=this.elements,s=2*i/(t-e),c=2*i/(n-r),u=(t+e)/(t-e),h=(n+r)/(n-r),l=-(o+i)/(o-i),f=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=c,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=l,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makePerspective:function(e,t,r,n){var i=r*Math.tan(a.Math.degToRad(.5*e)),o=-i,s=o*t,c=i*t;return this.makeFrustum(s,c,o,i,r,n)},makeOrthographic:function(e,t,r,n,i,o){var a=this.elements,s=t-e,c=r-n,u=o-i,h=(t+e)/s,l=(r+n)/c,f=(o+i)/u;return a[0]=2/s,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2/c,a[9]=0,a[13]=-l,a[2]=0,a[6]=0,a[10]=-2/u,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(e){for(var t=this.elements,r=e.elements,n=0;16>n;n++)if(t[n]!==r[n])return!1;return!0},fromArray:function(e){return this.elements.set(e),this},toArray:function(){var e=this.elements;return[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]]}},a.Ray=function(e,t){this.origin=void 0!==e?e:new a.Vector3,this.direction=void 0!==t?t:new a.Vector3},a.Ray.prototype={constructor:a.Ray,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 r=t||new a.Vector3;return r.copy(this.direction).multiplyScalar(e).add(this.origin)},recast:function(){var e=new a.Vector3;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(e,t){var r=t||new a.Vector3;r.subVectors(e,this.origin);var n=r.dot(this.direction);return 0>n?r.copy(this.origin):r.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(){var e=new a.Vector3;return function(t){var r=e.subVectors(t,this.origin).dot(this.direction);return 0>r?this.origin.distanceToSquared(t):(e.copy(this.direction).multiplyScalar(r).add(this.origin),e.distanceToSquared(t))}}(),distanceSqToSegment:function(){var e=new a.Vector3,t=new a.Vector3,r=new a.Vector3;return function(n,i,o,a){e.copy(n).add(i).multiplyScalar(.5),t.copy(i).sub(n).normalize(),r.copy(this.origin).sub(e);var s,c,u,h,l=.5*n.distanceTo(i),f=-this.direction.dot(t),p=r.dot(this.direction),d=-r.dot(t),m=r.lengthSq(),g=Math.abs(1-f*f);if(g>0)if(s=f*d-p,c=f*p-d,h=l*g,s>=0)if(c>=-h)if(h>=c){var v=1/g;s*=v,c*=v,u=s*(s+f*c+2*p)+c*(f*s+c+2*d)+m}else c=l,s=Math.max(0,-(f*c+p)),u=-s*s+c*(c+2*d)+m;else c=-l,s=Math.max(0,-(f*c+p)),u=-s*s+c*(c+2*d)+m;else-h>=c?(s=Math.max(0,-(-f*l+p)),c=s>0?-l:Math.min(Math.max(-l,-d),l),u=-s*s+c*(c+2*d)+m):h>=c?(s=0,c=Math.min(Math.max(-l,-d),l),u=c*(c+2*d)+m):(s=Math.max(0,-(f*l+p)),c=s>0?l:Math.min(Math.max(-l,-d),l),u=-s*s+c*(c+2*d)+m);else c=f>0?-l:l,s=Math.max(0,-(f*c+p)),u=-s*s+c*(c+2*d)+m;return o&&o.copy(this.direction).multiplyScalar(s).add(this.origin),a&&a.copy(t).multiplyScalar(c).add(e),u}}(),isIntersectionSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},intersectSphere:function(){var e=new a.Vector3;return function(t,r){e.subVectors(t.center,this.origin);var n=e.dot(this.direction),i=e.dot(e)-n*n,o=t.radius*t.radius;if(i>o)return null;var a=Math.sqrt(o-i),s=n-a,c=n+a;return 0>s&&0>c?null:0>s?this.at(c,r):this.at(s,r)}}(),isIntersectionPlane:function(e){var t=e.distanceToPoint(this.origin);if(0===t)return!0;var r=e.normal.dot(this.direction);return 0>r*t},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null},intersectPlane:function(e,t){var r=this.distanceToPlane(e);return null===r?null:this.at(r,t)},isIntersectionBox:function(){var e=new a.Vector3;return function(t){return null!==this.intersectBox(t,e)}}(),intersectBox:function(e,t){var r,n,i,o,a,s,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,l=this.origin;return c>=0?(r=(e.min.x-l.x)*c,n=(e.max.x-l.x)*c):(r=(e.max.x-l.x)*c,n=(e.min.x-l.x)*c),u>=0?(i=(e.min.y-l.y)*u,o=(e.max.y-l.y)*u):(i=(e.max.y-l.y)*u,o=(e.min.y-l.y)*u),r>o||i>n?null:((i>r||r!==r)&&(r=i),(n>o||n!==n)&&(n=o),h>=0?(a=(e.min.z-l.z)*h,s=(e.max.z-l.z)*h):(a=(e.max.z-l.z)*h,s=(e.min.z-l.z)*h),r>s||a>n?null:((a>r||r!==r)&&(r=a),(n>s||n!==n)&&(n=s),0>n?null:this.at(r>=0?r:n,t)))},intersectTriangle:function(){var e=new a.Vector3,t=new a.Vector3,r=new a.Vector3,n=new a.Vector3;return function(i,o,a,s,c){t.subVectors(o,i),r.subVectors(a,i),n.crossVectors(t,r);var u,h=this.direction.dot(n);if(h>0){if(s)return null;u=1}else{if(!(0>h))return null;u=-1,h=-h}e.subVectors(this.origin,i);var l=u*this.direction.dot(r.crossVectors(e,r));if(0>l)return null;var f=u*this.direction.dot(t.cross(e));if(0>f)return null;if(l+f>h)return null;var p=-u*e.dot(n);return 0>p?null:this.at(p/h,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)}},a.Sphere=function(e,t){this.center=void 0!==e?e:new a.Vector3,this.radius=void 0!==t?t:0},a.Sphere.prototype={constructor:a.Sphere,set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(){var e=new a.Box3;return function(t,r){var n=this.center;void 0!==r?n.copy(r):e.setFromPoints(t).center(n);for(var i=0,o=0,a=t.length;a>o;o++)i=Math.max(i,n.distanceToSquared(t[o]));return this.radius=Math.sqrt(i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},clampPoint:function(e,t){var r=this.center.distanceToSquared(e),n=t||new a.Vector3;return n.copy(e),r>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n},getBoundingBox:function(e){var t=e||new a.Box3;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}},a.Frustum=function(e,t,r,n,i,o){this.planes=[void 0!==e?e:new a.Plane,void 0!==t?t:new a.Plane,void 0!==r?r:new a.Plane,void 0!==n?n:new a.Plane,void 0!==i?i:new a.Plane,void 0!==o?o:new a.Plane]},a.Frustum.prototype={constructor:a.Frustum,set:function(e,t,r,n,i,o){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(r),a[3].copy(n),a[4].copy(i),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,r=0;6>r;r++)t[r].copy(e.planes[r]);return this},setFromMatrix:function(e){var t=this.planes,r=e.elements,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],c=r[5],u=r[6],h=r[7],l=r[8],f=r[9],p=r[10],d=r[11],m=r[12],g=r[13],v=r[14],y=r[15];return t[0].setComponents(a-n,h-s,d-l,y-m).normalize(),t[1].setComponents(a+n,h+s,d+l,y+m).normalize(),t[2].setComponents(a+i,h+c,d+f,y+g).normalize(),t[3].setComponents(a-i,h-c,d-f,y-g).normalize(),t[4].setComponents(a-o,h-u,d-p,y-v).normalize(),t[5].setComponents(a+o,h+u,d+p,y+v).normalize(),this},intersectsObject:function(){var e=new a.Sphere;return function(t){var r=t.geometry;return null===r.boundingSphere&&r.computeBoundingSphere(),e.copy(r.boundingSphere),e.applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSphere:function(e){for(var t=this.planes,r=e.center,n=-e.radius,i=0;6>i;i++){var o=t[i].distanceToPoint(r);if(n>o)return!1}return!0},intersectsBox:function(){var e=new a.Vector3,t=new a.Vector3;return function(r){for(var n=this.planes,i=0;6>i;i++){var o=n[i];e.x=o.normal.x>0?r.min.x:r.max.x,t.x=o.normal.x>0?r.max.x:r.min.x,e.y=o.normal.y>0?r.min.y:r.max.y,t.y=o.normal.y>0?r.max.y:r.min.y,e.z=o.normal.z>0?r.min.z:r.max.z,t.z=o.normal.z>0?r.max.z:r.min.z;var a=o.distanceToPoint(e),s=o.distanceToPoint(t);if(0>a&&0>s)return!1}return!0}}(),containsPoint:function(e){for(var t=this.planes,r=0;6>r;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}},a.Plane=function(e,t){this.normal=void 0!==e?e:new a.Vector3(1,0,0),this.constant=void 0!==t?t:0},a.Plane.prototype={constructor:a.Plane,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,r,n){return this.normal.set(e,t,r),this.constant=n,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new a.Vector3,t=new a.Vector3;return function(r,n,i){var o=e.subVectors(i,n).cross(t.subVectors(r,n)).normalize();return this.setFromNormalAndCoplanarPoint(o,r),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 r=this.distanceToPoint(e),n=t||new a.Vector3;return n.copy(this.normal).multiplyScalar(r)},isIntersectionLine:function(e){var t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return 0>t&&r>0||0>r&&t>0},intersectLine:function(){var e=new a.Vector3;return function(t,r){var n=r||new a.Vector3,i=t.delta(e),o=this.normal.dot(i);if(0!==o){var s=-(t.start.dot(this.normal)+this.constant)/o;if(!(0>s||s>1))return n.copy(i).multiplyScalar(s).add(t.start)}else if(0===this.distanceToPoint(t.start))return n.copy(t.start)}}(),coplanarPoint:function(e){var t=e||new a.Vector3;return t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var e=new a.Vector3,t=new a.Vector3,r=new a.Matrix3;return function(n,i){var o=i||r.getNormalMatrix(n),a=e.copy(this.normal).applyMatrix3(o),s=this.coplanarPoint(t);return s.applyMatrix4(n),this.setFromNormalAndCoplanarPoint(a,s),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}},a.Math={generateUUID:function(){var e,t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),r=new Array(36),n=0;return function(){for(var i=0;36>i;i++)8===i||13===i||18===i||23===i?r[i]="-":14===i?r[i]="4":(2>=n&&(n=33554432+16777216*Math.random()|0),e=15&n,n>>=4,r[i]=t[19===i?3&e|8:e]);return r.join("")}}(),clamp:function(e,t,r){return Math.max(t,Math.min(r,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,r,n,i){return n+(e-t)*(i-n)/(r-t)},smoothstep:function(e,t,r){return t>=e?0:e>=r?1:(e=(e-t)/(r-t),e*e*(3-2*e))},smootherstep:function(e,t,r){return t>=e?0:e>=r?1:(e=(e-t)/(r-t),e*e*e*(e*(6*e-15)+10))},random16:function(){return(65280*Math.random()+255*Math.random())/65535},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(){var e=Math.PI/180;return function(t){return t*e}}(),radToDeg:function(){var e=180/Math.PI;return function(t){return t*e}}(),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}},a.Spline=function(e){function t(e,t,r,n,i,o,a){var s=.5*(r-e),c=.5*(n-t);return(2*(t-r)+s+c)*a+(-3*(t-r)-2*s-c)*o+s*i+t}this.points=e;var r,n,i,o,s,c,u,h,l,f=[],p={x:0,y:0,z:0};this.initFromArray=function(e){this.points=[];for(var t=0;tthis.points.length-2?this.points.length-1:n+1,f[3]=n>this.points.length-3?this.points.length-1:n+2,c=this.points[f[0]],u=this.points[f[1]],h=this.points[f[2]],l=this.points[f[3]],o=i*i,s=i*o,p.x=t(c.x,u.x,h.x,l.x,i,o,s),p.y=t(c.y,u.y,h.y,l.y,i,o,s),p.z=t(c.z,u.z,h.z,l.z,i,o,s),p},this.getControlPointsArray=function(){
-var e,t,r=this.points.length,n=[];for(e=0;r>e;e++)t=this.points[e],n[e]=[t.x,t.y,t.z];return n},this.getLength=function(e){var t,r,n,i,o=0,s=0,c=0,u=new a.Vector3,h=new a.Vector3,l=[],f=0;for(l[0]=0,e||(e=100),n=this.points.length*e,u.copy(this.points[0]),t=1;n>t;t++)r=t/n,i=this.getPoint(r),h.copy(i),f+=h.distanceTo(u),u.copy(i),o=(this.points.length-1)*r,s=Math.floor(o),s!==c&&(l[s]=f,c=s);return l[l.length]=f,{chunks:l,total:f}},this.reparametrizeByArcLength=function(e){var t,r,n,i,o,s,c,u,h=[],l=new a.Vector3,f=this.getLength();for(h.push(l.copy(this.points[0]).clone()),t=1;tr;r++)n=i+r*(1/c)*(o-i),u=this.getPoint(n),h.push(l.copy(u).clone());h.push(l.copy(this.points[t]).clone())}this.points=h}},a.Triangle=function(e,t,r){this.a=void 0!==e?e:new a.Vector3,this.b=void 0!==t?t:new a.Vector3,this.c=void 0!==r?r:new a.Vector3},a.Triangle.normal=function(){var e=new a.Vector3;return function(t,r,n,i){var o=i||new a.Vector3;o.subVectors(n,r),e.subVectors(t,r),o.cross(e);var s=o.lengthSq();return s>0?o.multiplyScalar(1/Math.sqrt(s)):o.set(0,0,0)}}(),a.Triangle.barycoordFromPoint=function(){var e=new a.Vector3,t=new a.Vector3,r=new a.Vector3;return function(n,i,o,s,c){e.subVectors(s,i),t.subVectors(o,i),r.subVectors(n,i);var u=e.dot(e),h=e.dot(t),l=e.dot(r),f=t.dot(t),p=t.dot(r),d=u*f-h*h,m=c||new a.Vector3;if(0===d)return m.set(-2,-1,-1);var g=1/d,v=(f*l-h*p)*g,y=(u*p-h*l)*g;return m.set(1-v-y,y,v)}}(),a.Triangle.containsPoint=function(){var e=new a.Vector3;return function(t,r,n,i){var o=a.Triangle.barycoordFromPoint(t,r,n,i,e);return o.x>=0&&o.y>=0&&o.x+o.y<=1}}(),a.Triangle.prototype={constructor:a.Triangle,set:function(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this},setFromPointsAndIndices:function(e,t,r,n){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[n]),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 a.Vector3,t=new a.Vector3;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 a.Vector3;return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(e){return a.Triangle.normal(this.a,this.b,this.c,e)},plane:function(e){var t=e||new a.Plane;return t.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(e,t){return a.Triangle.barycoordFromPoint(e,this.a,this.b,this.c,t)},containsPoint:function(e){return a.Triangle.containsPoint(e,this.a,this.b,this.c)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}},a.Channels=function(){this.mask=1},a.Channels.prototype={constructor:a.Channels,set:function(e){this.mask=1<o;o++)n[o]=r[o];for(var o=0;i>o;o++)n[o].call(this,e)}}}},function(e){function t(e,t){return e.distance-t.distance}function r(e,t,n,i){if(e.visible!==!1&&(e.raycast(t,n),i===!0))for(var o=e.children,a=0,s=o.length;s>a;a++)r(o[a],t,n,!0)}e.Raycaster=function(t,r,n,i){this.ray=new e.Ray(t,r),this.near=n||0,this.far=i||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}}})},e.Raycaster.prototype={constructor:e.Raycaster,linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(t,r){r instanceof e.PerspectiveCamera?(this.ray.origin.setFromMatrixPosition(r.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(r).sub(this.ray.origin).normalize()):r instanceof e.OrthographicCamera?(this.ray.origin.set(t.x,t.y,-1).unproject(r),this.ray.direction.set(0,0,-1).transformDirection(r.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,n){var i=[];return r(e,this,i,n),i.sort(t),i},intersectObjects:function(e,n){var i=[];if(Array.isArray(e)===!1)return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var o=0,a=e.length;a>o;o++)r(e[o],this,i,n);return i.sort(t),i}}}(a),a.Object3D=function(){function e(){i.setFromEuler(n,!1)}function t(){n.setFromQuaternion(i,void 0,!1)}Object.defineProperty(this,"id",{value:a.Object3DIdCount++}),this.uuid=a.Math.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.channels=new a.Channels,this.children=[],this.up=a.Object3D.DefaultUp.clone();var r=new a.Vector3,n=new a.Euler,i=new a.Quaternion,o=new a.Vector3(1,1,1);n.onChange(e),i.onChange(t),Object.defineProperties(this,{position:{enumerable:!0,value:r},rotation:{enumerable:!0,value:n},quaternion:{enumerable:!0,value:i},scale:{enumerable:!0,value:o},modelViewMatrix:{value:new a.Matrix4},normalMatrix:{value:new a.Matrix3}}),this.rotationAutoUpdate=!0,this.matrix=new a.Matrix4,this.matrixWorld=new a.Matrix4,this.matrixAutoUpdate=a.Object3D.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}},a.Object3D.DefaultUp=new a.Vector3(0,1,0),a.Object3D.DefaultMatrixAutoUpdate=!0,a.Object3D.prototype={constructor:a.Object3D,get eulerOrder(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set eulerOrder(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e},get useQuaternion(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set useQuaternion(e){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set renderDepth(e){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},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 a.Quaternion;return function(t,r){return e.setFromAxisAngle(t,r),this.quaternion.multiply(e),this}}(),rotateX:function(){var e=new a.Vector3(1,0,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateY:function(){var e=new a.Vector3(0,1,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateZ:function(){var e=new a.Vector3(0,0,1);return function(t){return this.rotateOnAxis(e,t)}}(),translateOnAxis:function(){var e=new a.Vector3;return function(t,r){return e.copy(t).applyQuaternion(this.quaternion),this.position.add(e.multiplyScalar(r)),this}}(),translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},translateX:function(){var e=new a.Vector3(1,0,0);return function(t){return this.translateOnAxis(e,t)}}(),translateY:function(){var e=new a.Vector3(0,1,0);return function(t){return this.translateOnAxis(e,t)}}(),translateZ:function(){var e=new a.Vector3(0,0,1);return function(t){return this.translateOnAxis(e,t)}}(),localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var e=new a.Matrix4;return function(t){return t.applyMatrix4(e.getInverse(this.matrixWorld))}}(),lookAt:function(){var e=new a.Matrix4;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;t1)for(var t=0;tr;r++){var i=this.children[r],o=i.getObjectByProperty(e,t);if(void 0!==o)return o}},getWorldPosition:function(e){var t=e||new a.Vector3;return this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var e=new a.Vector3,t=new a.Vector3;return function(r){var n=r||new a.Quaternion;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,n,t),n}}(),getWorldRotation:function(){var e=new a.Quaternion;return function(t){var r=t||new a.Euler;return this.getWorldQuaternion(e),r.setFromQuaternion(e,this.rotation.order,!1)}}(),getWorldScale:function(){var e=new a.Vector3,t=new a.Quaternion;return function(r){var n=r||new a.Vector3;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,t,n),n}}(),getWorldDirection:function(){var e=new a.Quaternion;return function(t){var r=t||new a.Vector3;return this.getWorldQuaternion(e),r.set(0,0,1).applyQuaternion(e)}}(),raycast:function(){},traverse:function(e){e(this);for(var t=this.children,r=0,n=t.length;n>r;r++)t[r].traverse(e)},traverseVisible:function(e){if(this.visible!==!1){e(this);for(var t=this.children,r=0,n=t.length;n>r;r++)t[r].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=0,r=this.children.length;r>t;t++)this.children[t].updateMatrixWorld(e)},toJSON:function(e){function t(e){var t=[];for(var r in e){var n=e[r];delete n.metadata,t.push(n)}return t}var r=void 0===e,n={};r&&(e={geometries:{},materials:{},textures:{},images:{}},n.metadata={version:4.4,type:"Object",generator:"Object3D.toJSON"});var i={};if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),i.matrix=this.matrix.toArray(),void 0!==this.geometry&&(void 0===e.geometries[this.geometry.uuid]&&(e.geometries[this.geometry.uuid]=this.geometry.toJSON(e)),i.geometry=this.geometry.uuid),void 0!==this.material&&(void 0===e.materials[this.material.uuid]&&(e.materials[this.material.uuid]=this.material.toJSON(e)),i.material=this.material.uuid),this.children.length>0){i.children=[];for(var o=0;o0&&(n.geometries=a),s.length>0&&(n.materials=s),c.length>0&&(n.textures=c),u.length>0&&(n.images=u)}return n.object=i,n},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.rotationAutoUpdate=e.rotationAutoUpdate,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,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 r=0;rt;t++)this.vertexNormals[t]=e.vertexNormals[t].clone();for(var t=0,r=e.vertexColors.length;r>t;t++)this.vertexColors[t]=e.vertexColors[t].clone();return this}},a.Face4=function(e,t,r,n,i,o,s){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new a.Face3(e,t,r,i,o,s)},a.BufferAttribute=function(e,t){this.uuid=a.Math.generateUUID(),this.array=e,this.itemSize=t,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0},a.BufferAttribute.prototype={constructor:a.BufferAttribute,get length(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),this.array.length},get count(){return this.array.length/this.itemSize},set needsUpdate(e){e===!0&&this.version++},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.dynamic=e.dynamic,this},copyAt:function(e,t,r){e*=this.itemSize,r*=t.itemSize;for(var n=0,i=this.itemSize;i>n;n++)this.array[e+n]=t.array[r+n];return this},copyArray:function(e){return this.array.set(e),this},copyColorsArray:function(e){for(var t=this.array,r=0,n=0,i=e.length;i>n;n++){var o=e[n];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",n),o=new a.Color),t[r++]=o.r,t[r++]=o.g,t[r++]=o.b}return this},copyIndicesArray:function(e){for(var t=this.array,r=0,n=0,i=e.length;i>n;n++){var o=e[n];t[r++]=o.a,t[r++]=o.b,t[r++]=o.c}return this},copyVector2sArray:function(e){for(var t=this.array,r=0,n=0,i=e.length;i>n;n++){var o=e[n];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",n),o=new a.Vector2),t[r++]=o.x,t[r++]=o.y}return this},copyVector3sArray:function(e){for(var t=this.array,r=0,n=0,i=e.length;i>n;n++){var o=e[n];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",n),o=new a.Vector3),t[r++]=o.x,t[r++]=o.y,t[r++]=o.z}return this},copyVector4sArray:function(e){for(var t=this.array,r=0,n=0,i=e.length;i>n;n++){var o=e[n];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",n),o=new a.Vector4),t[r++]=o.x,t[r++]=o.y,t[r++]=o.z,t[r++]=o.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,r){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=r,this},setXYZ:function(e,t,r,n){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=n,this},setXYZW:function(e,t,r,n,i){return e*=this.itemSize,this.array[e+0]=t,this.array[e+1]=r,this.array[e+2]=n,this.array[e+3]=i,this},clone:function(){return(new this.constructor).copy(this)}},a.Int8Attribute=function(e,t){return new a.BufferAttribute(new Int8Array(e),t)},a.Uint8Attribute=function(e,t){return new a.BufferAttribute(new Uint8Array(e),t)},a.Uint8ClampedAttribute=function(e,t){return new a.BufferAttribute(new Uint8ClampedArray(e),t)},a.Int16Attribute=function(e,t){return new a.BufferAttribute(new Int16Array(e),t)},a.Uint16Attribute=function(e,t){return new a.BufferAttribute(new Uint16Array(e),t)},a.Int32Attribute=function(e,t){return new a.BufferAttribute(new Int32Array(e),t)},a.Uint32Attribute=function(e,t){return new a.BufferAttribute(new Uint32Array(e),t)},a.Float32Attribute=function(e,t){return new a.BufferAttribute(new Float32Array(e),t)},a.Float64Attribute=function(e,t){return new a.BufferAttribute(new Float64Array(e),t)},a.DynamicBufferAttribute=function(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new a.BufferAttribute(e,t).setDynamic(!0)},a.InstancedBufferAttribute=function(e,t,r){a.BufferAttribute.call(this,e,t),this.meshPerAttribute=r||1},a.InstancedBufferAttribute.prototype=Object.create(a.BufferAttribute.prototype),a.InstancedBufferAttribute.prototype.constructor=a.InstancedBufferAttribute,a.InstancedBufferAttribute.prototype.copy=function(e){return a.BufferAttribute.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},a.InterleavedBuffer=function(e,t){this.uuid=a.Math.generateUUID(),this.array=e,this.stride=t,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0},a.InterleavedBuffer.prototype={constructor:a.InterleavedBuffer,get length(){return this.array.length},get count(){return this.array.length/this.stride},set needsUpdate(e){e===!0&&this.version++},setDynamic:function(e){return this.dynamic=e,this},copy:function(e){this.array=new e.array.constructor(e.array),this.stride=e.stride,this.dynamic=e.dynamic},copyAt:function(e,t,r){e*=this.stride,r*=t.stride;for(var n=0,i=this.stride;i>n;n++)this.array[e+n]=t.array[r+n];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)}},a.InstancedInterleavedBuffer=function(e,t,r){a.InterleavedBuffer.call(this,e,t),this.meshPerAttribute=r||1},a.InstancedInterleavedBuffer.prototype=Object.create(a.InterleavedBuffer.prototype),a.InstancedInterleavedBuffer.prototype.constructor=a.InstancedInterleavedBuffer,a.InstancedInterleavedBuffer.prototype.copy=function(e){return a.InterleavedBuffer.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},a.InterleavedBufferAttribute=function(e,t,r){this.uuid=a.Math.generateUUID(),this.data=e,this.itemSize=t,this.offset=r},a.InterleavedBufferAttribute.prototype={constructor:a.InterleavedBufferAttribute,get length(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),this.array.length},get count(){return this.data.array.length/this.data.stride},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,r){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=r,this},setXYZ:function(e,t,r,n){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=n,this},setXYZW:function(e,t,r,n,i){return e=e*this.data.stride+this.offset,this.data.array[e+0]=t,this.data.array[e+1]=r,this.data.array[e+2]=n,this.data.array[e+3]=i,this}},a.Geometry=function(){Object.defineProperty(this,"id",{value:a.GeometryIdCount++}),this.uuid=a.Math.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.verticesNeedUpdate=!1,this.elementsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1},a.Geometry.prototype={constructor:a.Geometry,applyMatrix:function(e){for(var t=(new a.Matrix3).getNormalMatrix(e),r=0,n=this.vertices.length;n>r;r++){var i=this.vertices[r];i.applyMatrix4(e)}for(var r=0,n=this.faces.length;n>r;r++){var o=this.faces[r];o.normal.applyMatrix3(t).normalize();for(var s=0,c=o.vertexNormals.length;c>s;s++)o.vertexNormals[s].applyMatrix3(t).normalize()}null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0},rotateX:function(){var e;return function(t){return void 0===e&&(e=new a.Matrix4),e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e;return function(t){return void 0===e&&(e=new a.Matrix4),e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e;return function(t){return void 0===e&&(e=new a.Matrix4),e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e;return function(t,r,n){return void 0===e&&(e=new a.Matrix4),e.makeTranslation(t,r,n),this.applyMatrix(e),this}}(),scale:function(){var e;return function(t,r,n){return void 0===e&&(e=new a.Matrix4),e.makeScale(t,r,n),this.applyMatrix(e),this}}(),lookAt:function(){var e;return function(t){void 0===e&&(e=new a.Object3D),e.lookAt(t),e.updateMatrix(),this.applyMatrix(e.matrix)}}(),fromBufferGeometry:function(e){function t(e,t,n){var i=void 0!==s?[l[e].clone(),l[t].clone(),l[n].clone()]:[],o=void 0!==c?[r.colors[e].clone(),r.colors[t].clone(),r.colors[n].clone()]:[],d=new a.Face3(e,t,n,i,o);r.faces.push(d),void 0!==u&&r.faceVertexUvs[0].push([f[e].clone(),f[t].clone(),f[n].clone()]),void 0!==h&&r.faceVertexUvs[1].push([p[e].clone(),p[t].clone(),p[n].clone()])}var r=this,n=null!==e.index?e.index.array:void 0,i=e.attributes,o=i.position.array,s=void 0!==i.normal?i.normal.array:void 0,c=void 0!==i.color?i.color.array:void 0,u=void 0!==i.uv?i.uv.array:void 0,h=void 0!==i.uv2?i.uv2.array:void 0;void 0!==h&&(this.faceVertexUvs[1]=[]);for(var l=[],f=[],p=[],d=0,m=0,g=0;d0)for(var d=0;dm;m+=3)t(n[m],n[m+1],n[m+2]);else for(var d=0;dr;r++){var i=this.faces[r],o=this.vertices[i.a],s=this.vertices[i.b],c=this.vertices[i.c];e.subVectors(c,s),t.subVectors(o,s),e.cross(t),e.normalize(),i.normal.copy(e)}},computeVertexNormals:function(e){var t,r,n,i,o,s;for(s=new Array(this.vertices.length),t=0,r=this.vertices.length;r>t;t++)s[t]=new a.Vector3;if(e){var c,u,h,l=new a.Vector3,f=new a.Vector3;for(n=0,i=this.faces.length;i>n;n++)o=this.faces[n],c=this.vertices[o.a],u=this.vertices[o.b],h=this.vertices[o.c],l.subVectors(h,u),f.subVectors(c,u),l.cross(f),s[o.a].add(l),s[o.b].add(l),s[o.c].add(l)}else for(n=0,i=this.faces.length;i>n;n++)o=this.faces[n],s[o.a].add(o.normal),s[o.b].add(o.normal),s[o.c].add(o.normal);for(t=0,r=this.vertices.length;r>t;t++)s[t].normalize();for(n=0,i=this.faces.length;i>n;n++){o=this.faces[n];var p=o.vertexNormals;3===p.length?(p[0].copy(s[o.a]),p[1].copy(s[o.b]),p[2].copy(s[o.c])):(p[0]=s[o.a].clone(),p[1]=s[o.b].clone(),p[2]=s[o.c].clone())}},computeMorphNormals:function(){var e,t,r,n,i;for(r=0,n=this.faces.length;n>r;r++)for(i=this.faces[r],i.__originalFaceNormal?i.__originalFaceNormal.copy(i.normal):i.__originalFaceNormal=i.normal.clone(),i.__originalVertexNormals||(i.__originalVertexNormals=[]),e=0,t=i.vertexNormals.length;t>e;e++)i.__originalVertexNormals[e]?i.__originalVertexNormals[e].copy(i.vertexNormals[e]):i.__originalVertexNormals[e]=i.vertexNormals[e].clone();var o=new a.Geometry;for(o.faces=this.faces,e=0,t=this.morphTargets.length;t>e;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var s,c,u=this.morphNormals[e].faceNormals,h=this.morphNormals[e].vertexNormals;for(r=0,n=this.faces.length;n>r;r++)s=new a.Vector3,c={a:new a.Vector3,b:new a.Vector3,c:new a.Vector3},u.push(s),h.push(c)}var l=this.morphNormals[e];o.vertices=this.morphTargets[e].vertices,o.computeFaceNormals(),o.computeVertexNormals();var s,c;for(r=0,n=this.faces.length;n>r;r++)i=this.faces[r],s=l.faceNormals[r],c=l.vertexNormals[r],s.copy(i.normal),c.a.copy(i.vertexNormals[0]),c.b.copy(i.vertexNormals[1]),c.c.copy(i.vertexNormals[2])}for(r=0,n=this.faces.length;n>r;r++)i=this.faces[r],i.normal=i.__originalFaceNormal,i.vertexNormals=i.__originalVertexNormals},computeTangents:function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){for(var e=0,t=this.vertices,r=0,n=t.length;n>r;r++)r>0&&(e+=t[r].distanceTo(t[r-1])),this.lineDistances[r]=e},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new a.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new a.Sphere),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,r){if(e instanceof a.Geometry==!1)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e);var n,i=this.vertices.length,o=this.vertices,s=e.vertices,c=this.faces,u=e.faces,h=this.faceVertexUvs[0],l=e.faceVertexUvs[0];void 0===r&&(r=0),void 0!==t&&(n=(new a.Matrix3).getNormalMatrix(t));for(var f=0,p=s.length;p>f;f++){var d=s[f],m=d.clone();void 0!==t&&m.applyMatrix4(t),o.push(m)}for(f=0,p=u.length;p>f;f++){var g,v,y,b=u[f],x=b.vertexNormals,w=b.vertexColors;g=new a.Face3(b.a+i,b.b+i,b.c+i),g.normal.copy(b.normal),void 0!==n&&g.normal.applyMatrix3(n).normalize();for(var _=0,S=x.length;S>_;_++)v=x[_].clone(),void 0!==n&&v.applyMatrix3(n).normalize(),g.vertexNormals.push(v);g.color.copy(b.color);for(var _=0,S=w.length;S>_;_++)y=w[_],g.vertexColors.push(y.clone());g.materialIndex=b.materialIndex+r,c.push(g)}for(f=0,p=l.length;p>f;f++){var M=l[f],E=[];if(void 0!==M){for(var _=0,S=M.length;S>_;_++)E.push(M[_].clone());h.push(E)}}},mergeMesh:function(e){return e instanceof a.Mesh==!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,r,n,i,o,a,s,c={},u=[],h=[],l=4,f=Math.pow(10,l);for(r=0,n=this.vertices.length;n>r;r++)e=this.vertices[r],t=Math.round(e.x*f)+"_"+Math.round(e.y*f)+"_"+Math.round(e.z*f),void 0===c[t]?(c[t]=r,u.push(this.vertices[r]),h[r]=u.length-1):h[r]=h[c[t]];var p=[];for(r=0,n=this.faces.length;n>r;r++){i=this.faces[r],i.a=h[i.a],i.b=h[i.b],i.c=h[i.c],o=[i.a,i.b,i.c];for(var d=-1,m=0;3>m;m++)if(o[m]===o[(m+1)%3]){d=m,p.push(r);break}}for(r=p.length-1;r>=0;r--){var g=p[r];for(this.faces.splice(g,1),a=0,s=this.faceVertexUvs.length;s>a;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,r=t.length,n=0;r>n;n++)t[n]._id=n;t.sort(e);var i,o,a=this.faceVertexUvs[0],s=this.faceVertexUvs[1];a&&a.length===r&&(i=[]),s&&s.length===r&&(o=[]);for(var n=0;r>n;n++){var c=t[n]._id;i&&i.push(a[c]),o&&o.push(s[c])}i&&(this.faceVertexUvs[0]=i),o&&(this.faceVertexUvs[1]=o)},toJSON:function(){function e(e,t,r){return r?e|1<0,_=v.vertexNormals.length>0,S=1!==v.color.r||1!==v.color.g||1!==v.color.b,M=v.vertexColors.length>0,E=0;if(E=e(E,0,0),E=e(E,1,y),E=e(E,2,b),E=e(E,3,x),E=e(E,4,w),E=e(E,5,_),E=e(E,6,S),E=e(E,7,M),h.push(E),h.push(v.a,v.b,v.c),x){var T=this.faceVertexUvs[0][c];h.push(n(T[0]),n(T[1]),n(T[2]))}if(w&&h.push(t(v.normal)),_){var A=v.vertexNormals;h.push(t(A[0]),t(A[1]),t(A[2]))}if(S&&h.push(r(v.color)),
-M){var C=v.vertexColors;h.push(r(C[0]),r(C[1]),r(C[2]))}}return i.data={},i.data.vertices=s,i.data.normals=l,p.length>0&&(i.data.colors=p),m.length>0&&(i.data.uvs=[m]),i.data.faces=h,i},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.vertices=[],this.faces=[],this.faceVertexUvs=[[]];for(var t=e.vertices,r=0,n=t.length;n>r;r++)this.vertices.push(t[r].clone());for(var i=e.faces,r=0,n=i.length;n>r;r++)this.faces.push(i[r].clone());for(var r=0,n=e.faceVertexUvs.length;n>r;r++){var o=e.faceVertexUvs[r];void 0===this.faceVertexUvs[r]&&(this.faceVertexUvs[r]=[]);for(var a=0,s=o.length;s>a;a++){for(var c=o[a],u=[],h=0,l=c.length;l>h;h++){var f=c[h];u.push(f.clone())}this.faceVertexUvs[r].push(u)}}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}},a.EventDispatcher.prototype.apply(a.Geometry.prototype),a.GeometryIdCount=0,a.DirectGeometry=function(){Object.defineProperty(this,"id",{value:a.GeometryIdCount++}),this.uuid=a.Math.generateUUID(),this.name="",this.type="DirectGeometry",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},a.DirectGeometry.prototype={constructor:a.DirectGeometry,computeBoundingBox:a.Geometry.prototype.computeBoundingBox,computeBoundingSphere:a.Geometry.prototype.computeBoundingSphere,computeFaceNormals:function(){console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")},computeVertexNormals:function(){console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")},computeGroups:function(e){for(var t,r,n=[],i=e.faces,o=0;o0,o=n[1]&&n[1].length>0,s=e.morphTargets,c=s.length;if(c>0){for(var u=[],h=0;c>h;h++)u[h]=[];this.morphTargets.position=u}var l=e.morphNormals,f=l.length;if(f>0){for(var p=[],h=0;f>h;h++)p[h]=[];this.morphTargets.normal=p}for(var d=e.skinIndices,m=e.skinWeights,g=d.length===r.length,v=m.length===r.length,h=0;hM;M++){var E=s[M].vertices;u[M].push(E[y.a],E[y.b],E[y.c])}for(var M=0;f>M;M++){var T=l[M].vertexNormals[h];p[M].push(T.a,T.b,T.c)}g&&this.skinIndices.push(d[y.a],d[y.b],d[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},dispose:function(){this.dispatchEvent({type:"dispose"})}},a.EventDispatcher.prototype.apply(a.DirectGeometry.prototype),a.BufferGeometry=function(){Object.defineProperty(this,"id",{value:a.GeometryIdCount++}),this.uuid=a.Math.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}},a.BufferGeometry.prototype={constructor:a.BufferGeometry,addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},getIndex:function(){return this.index},setIndex:function(e){this.index=e},addAttribute:function(e,t){return t instanceof a.BufferAttribute==!1&&t instanceof a.InterleavedBufferAttribute==!1?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),void this.addAttribute(e,new a.BufferAttribute(arguments[1],arguments[2]))):"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),void this.setIndex(t)):void(this.attributes[e]=t)},getAttribute:function(e){return this.attributes[e]},removeAttribute:function(e){delete this.attributes[e]},get drawcalls(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups},get offsets(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups},addDrawCall:function(e,t,r){void 0!==r&&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()},addGroup:function(e,t,r){this.groups.push({start:e,count:t,materialIndex:void 0!==r?r: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 r=this.attributes.normal;if(void 0!==r){var n=(new a.Matrix3).getNormalMatrix(e);n.applyToVector3Array(r.array),r.needsUpdate=!0}null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere()},rotateX:function(){var e;return function(t){return void 0===e&&(e=new a.Matrix4),e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e;return function(t){return void 0===e&&(e=new a.Matrix4),e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e;return function(t){return void 0===e&&(e=new a.Matrix4),e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e;return function(t,r,n){return void 0===e&&(e=new a.Matrix4),e.makeTranslation(t,r,n),this.applyMatrix(e),this}}(),scale:function(){var e;return function(t,r,n){return void 0===e&&(e=new a.Matrix4),e.makeScale(t,r,n),this.applyMatrix(e),this}}(),lookAt:function(){var e;return function(t){void 0===e&&(e=new a.Object3D),e.lookAt(t),e.updateMatrix(),this.applyMatrix(e.matrix)}}(),center:function(){this.computeBoundingBox();var e=this.boundingBox.center().negate();return this.translate(e.x,e.y,e.z),e},setFromObject:function(e){var t=e.geometry;if(e instanceof a.Points||e instanceof a.Line){var r=new a.Float32Attribute(3*t.vertices.length,3),n=new a.Float32Attribute(3*t.colors.length,3);if(this.addAttribute("position",r.copyVector3sArray(t.vertices)),this.addAttribute("color",n.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var i=new a.Float32Attribute(t.lineDistances.length,1);this.addAttribute("lineDistance",i.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e instanceof a.Mesh&&t instanceof a.Geometry&&this.fromGeometry(t);return this},updateFromObject:function(e){var t=e.geometry;if(e instanceof a.Mesh){var r=t.__directGeometry;if(void 0===r)return this.fromGeometry(t);r.verticesNeedUpdate=t.verticesNeedUpdate,r.normalsNeedUpdate=t.normalsNeedUpdate,r.colorsNeedUpdate=t.colorsNeedUpdate,r.uvsNeedUpdate=t.uvsNeedUpdate,r.groupsNeedUpdate=t.groupsNeedUpdate,t.verticesNeedUpdate=!1,t.normalsNeedUpdate=!1,t.colorsNeedUpdate=!1,t.uvsNeedUpdate=!1,t.groupsNeedUpdate=!1,t=r}if(t.verticesNeedUpdate===!0){var n=this.attributes.position;void 0!==n&&(n.copyVector3sArray(t.vertices),n.needsUpdate=!0),t.verticesNeedUpdate=!1}if(t.normalsNeedUpdate===!0){var n=this.attributes.normal;void 0!==n&&(n.copyVector3sArray(t.normals),n.needsUpdate=!0),t.normalsNeedUpdate=!1}if(t.colorsNeedUpdate===!0){var n=this.attributes.color;void 0!==n&&(n.copyColorsArray(t.colors),n.needsUpdate=!0),t.colorsNeedUpdate=!1}if(t.uvsNeedUpdate){var n=this.attributes.uv;void 0!==n&&(n.copyVector2sArray(t.uvs),n.needsUpdate=!0),t.uvsNeedUpdate=!1}if(t.lineDistancesNeedUpdate){var n=this.attributes.lineDistance;void 0!==n&&(n.copyArray(t.lineDistances),n.needsUpdate=!0),t.lineDistancesNeedUpdate=!1}return t.groupsNeedUpdate&&(t.computeGroups(e.geometry),this.groups=t.groups,t.groupsNeedUpdate=!1),this},fromGeometry:function(e){return e.__directGeometry=(new a.DirectGeometry).fromGeometry(e),this.fromDirectGeometry(e.__directGeometry)},fromDirectGeometry:function(e){var t=new Float32Array(3*e.vertices.length);if(this.addAttribute("position",new a.BufferAttribute(t,3).copyVector3sArray(e.vertices)),e.normals.length>0){var r=new Float32Array(3*e.normals.length);this.addAttribute("normal",new a.BufferAttribute(r,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var n=new Float32Array(3*e.colors.length);this.addAttribute("color",new a.BufferAttribute(n,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var i=new Float32Array(2*e.uvs.length);this.addAttribute("uv",new a.BufferAttribute(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var o=new Float32Array(2*e.uvs2.length);this.addAttribute("uv2",new a.BufferAttribute(o,2).copyVector2sArray(e.uvs2))}if(e.indices.length>0){var s=e.vertices.length>65535?Uint32Array:Uint16Array,c=new s(3*e.indices.length);this.setIndex(new a.BufferAttribute(c,1).copyIndicesArray(e.indices))}this.groups=e.groups;for(var u in e.morphTargets){for(var h=[],l=e.morphTargets[u],f=0,p=l.length;p>f;f++){var d=l[f],m=new a.Float32Attribute(3*d.length,3);h.push(m.copyVector3sArray(d))}this.morphAttributes[u]=h}if(e.skinIndices.length>0){var g=new a.Float32Attribute(4*e.skinIndices.length,4);this.addAttribute("skinIndex",g.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var v=new a.Float32Attribute(4*e.skinWeights.length,4);this.addAttribute("skinWeight",v.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){var e=new a.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new a.Box3);var t=this.attributes.position.array;if(t){var r=this.boundingBox;r.makeEmpty();for(var n=0,i=t.length;i>n;n+=3)e.fromArray(t,n),r.expandByPoint(e)}void 0!==t&&0!==t.length||(this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0)),(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 a.Box3,t=new a.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new a.Sphere);var r=this.attributes.position.array;if(r){e.makeEmpty();for(var n=this.boundingSphere.center,i=0,o=r.length;o>i;i+=3)t.fromArray(r,i),e.expandByPoint(t);e.center(n);for(var s=0,i=0,o=r.length;o>i;i+=3)t.fromArray(r,i),s=Math.max(s,n.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(s),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,r=this.groups;if(t.position){var n=t.position.array;if(void 0===t.normal)this.addAttribute("normal",new a.BufferAttribute(new Float32Array(n.length),3));else for(var i=t.normal.array,o=0,s=i.length;s>o;o++)i[o]=0;var c,u,h,i=t.normal.array,l=new a.Vector3,f=new a.Vector3,p=new a.Vector3,d=new a.Vector3,m=new a.Vector3;if(e){var g=e.array;0===r.length&&this.addGroup(0,g.length);for(var v=0,y=r.length;y>v;++v)for(var b=r[v],x=b.start,w=b.count,o=x,s=x+w;s>o;o+=3)c=3*g[o+0],u=3*g[o+1],h=3*g[o+2],l.fromArray(n,c),f.fromArray(n,u),p.fromArray(n,h),d.subVectors(p,f),m.subVectors(l,f),d.cross(m),i[c]+=d.x,i[c+1]+=d.y,i[c+2]+=d.z,i[u]+=d.x,i[u+1]+=d.y,i[u+2]+=d.z,i[h]+=d.x,i[h+1]+=d.y,i[h+2]+=d.z}else for(var o=0,s=n.length;s>o;o+=9)l.fromArray(n,o),f.fromArray(n,o+3),p.fromArray(n,o+6),d.subVectors(p,f),m.subVectors(l,f),d.cross(m),i[o]=d.x,i[o+1]=d.y,i[o+2]=d.z,i[o+3]=d.x,i[o+4]=d.y,i[o+5]=d.z,i[o+6]=d.x,i[o+7]=d.y,i[o+8]=d.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(e){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},merge:function(e,t){if(e instanceof a.BufferGeometry==!1)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);void 0===t&&(t=0);var r=this.attributes;for(var n in r)if(void 0!==e.attributes[n])for(var i=r[n],o=i.array,s=e.attributes[n],c=s.array,u=s.itemSize,h=0,l=u*t;ho;o+=3)e=i[o],t=i[o+1],r=i[o+2],n=1/Math.sqrt(e*e+t*t+r*r),i[o]*=n,i[o+1]*=n,i[o+2]*=n},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 r in t)void 0!==t[r]&&(e[r]=t[r]);return e}e.data={attributes:{}};var n=this.index;if(null!==n){var i=Array.prototype.slice.call(n.array);e.data.index={type:n.array.constructor.name,array:i}}var o=this.attributes;for(var r in o){var a=o[r],i=Array.prototype.slice.call(a.array);e.data.attributes[r]={itemSize:a.itemSize,type:a.array.constructor.name,array:i}}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 this.constructor).copy(this)},copy:function(e){var t=e.index;null!==t&&this.setIndex(t.clone());var r=e.attributes;for(var n in r){var i=r[n];this.addAttribute(n,i.clone())}for(var o=e.groups,a=0,s=o.length;s>a;a++){var c=o[a];this.addGroup(c.start,c.count)}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}},a.EventDispatcher.prototype.apply(a.BufferGeometry.prototype),a.BufferGeometry.MaxIndex=65535,a.InstancedBufferGeometry=function(){a.BufferGeometry.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0},a.InstancedBufferGeometry.prototype=Object.create(a.BufferGeometry.prototype),a.InstancedBufferGeometry.prototype.constructor=a.InstancedBufferGeometry,a.InstancedBufferGeometry.prototype.addGroup=function(e,t,r){this.groups.push({start:e,count:t,instances:r})},a.InstancedBufferGeometry.prototype.copy=function(e){var t=e.index;null!==t&&this.setIndex(t.clone());var r=e.attributes;for(var n in r){var i=r[n];this.addAttribute(n,i.clone())}for(var o=e.groups,a=0,s=o.length;s>a;a++){var c=o[a];this.addGroup(c.start,c.count,c.instances)}return this},a.EventDispatcher.prototype.apply(a.InstancedBufferGeometry.prototype),a.AnimationAction=function(e,t,r,n,i){if(void 0===e)throw new Error("clip is null");this.clip=e,this.localRoot=null,this.startTime=t||0,this.timeScale=r||1,this.weight=n||1,this.loop=i||a.LoopRepeat,this.loopCount=0,this.enabled=!0,this.actionTime=-this.startTime,this.clipTime=0,this.propertyBindings=[]},a.AnimationAction.prototype={constructor:a.AnimationAction,setLocalRoot:function(e){return this.localRoot=e,this},updateTime:function(e){var t=this.clipTime,r=this.loopCount,n=(this.actionTime,this.clip.duration);if(this.actionTime=this.actionTime+e,this.loop===a.LoopOnce)return this.loopCount=0,this.clipTime=Math.min(Math.max(this.actionTime,0),n),this.clipTime!==t&&(this.clipTime===n?this.mixer.dispatchEvent({type:"finished",action:this,direction:1}):0===this.clipTime&&this.mixer.dispatchEvent({type:"finished",action:this,direction:-1})),this.clipTime;this.loopCount=Math.floor(this.actionTime/n);var i=this.actionTime-this.loopCount*n;return i%=n,this.loop==a.LoopPingPong&&1===Math.abs(this.loopCount%2)&&(i=n-i),this.clipTime=i,this.loopCount!==r&&this.mixer.dispatchEvent({type:"loop",action:this,loopDelta:this.loopCount-this.loopCount}),this.clipTime},syncWith:function(e){return this.actionTime=e.actionTime,this.timeScale=e.timeScale,this},warpToDuration:function(e){return this.timeScale=this.clip.duration/e,this},init:function(e){return this.clipTime=e-this.startTime,this},update:function(e){this.updateTime(e);var t=this.clip.getAt(this.clipTime);return t},getTimeScaleAt:function(e){return this.timeScale.getAt?this.timeScale.getAt(e):this.timeScale},getWeightAt:function(e){return this.weight.getAt?this.weight.getAt(e):this.weight}},a.AnimationClip=function(e,t,r){if(this.name=e,this.tracks=r,this.duration=void 0!==t?t:-1,this.duration<0)for(var n=0;no;o++){var s=[];s.push({time:(o+n-1)%n,value:0}),s.push({time:o,value:1}),s.push({time:(o+1)%n,value:0}),s.sort(a.KeyframeTrack.keyComparer),0===s[0].time&&s.push({time:n,value:s[0].value}),i.push(new a.NumberKeyframeTrack(".morphTargetInfluences["+t[o].name+"]",s).scale(1/r))}return new a.AnimationClip(e,-1,i)},a.AnimationClip.findByName=function(e,t){for(var r=0;ri;i++){var s=e[i],c=s.name.match(n);if(c&&c.length>1){var u=c[1],h=r[u];h||(r[u]=h=[]),h.push(s)}}var l=[];for(var u in r)l.push(a.AnimationClip.CreateFromMorphTargetSequence(u,r[u],t));return l},a.AnimationClip.parse=function(e){for(var t=[],r=0;r0?new n(e,o):null},i=[],o=e.name||"default",s=e.length||-1,c=e.fps||30,u=e.hierarchy||[],h=0;hr?e:t},lerp_boolean_immediate:function(e,t,r){return e},lerp_string:function(e,t,r){return.5>r?e:t},lerp_string_immediate:function(e,t,r){return e},getLerpFunc:function(e,t){if(void 0===e||null===e)throw new Error("examplarValue is null");var r=typeof e;switch(r){case"object":if(e.lerp)return a.AnimationUtils.lerp_object;if(e.slerp)return a.AnimationUtils.slerp_object;break;case"number":return a.AnimationUtils.lerp_number;case"boolean":return t?a.AnimationUtils.lerp_boolean:a.AnimationUtils.lerp_boolean_immediate;case"string":return t?a.AnimationUtils.lerp_string:a.AnimationUtils.lerp_string_immediate}}},a.KeyframeTrack=function(e,t){if(void 0===e)throw new Error("track name is undefined");if(void 0===t||0===t.length)throw new Error("no keys in track named "+e);this.name=e,this.keys=t,this.lastIndex=0,this.validate(),this.optimize()},a.KeyframeTrack.prototype={constructor:a.KeyframeTrack,getAt:function(e){for(;this.lastIndex=this.keys[this.lastIndex].time;)this.lastIndex++;for(;this.lastIndex>0&&e=this.keys.length)return this.setResult(this.keys[this.keys.length-1].value),this.result;if(0===this.lastIndex)return this.setResult(this.keys[0].value),this.result;var t=this.keys[this.lastIndex-1];if(this.setResult(t.value),t.constantToNext)return this.result;var r=this.keys[this.lastIndex],n=(e-t.time)/(r.time-t.time);return this.result=this.lerpValues(this.result,r.value,n),this.result},shift:function(e){if(0!==e)for(var t=0;t0&&this.keys[n]>=t;n++)i++;return r+i>0&&(this.keys=this.keys.splice(r,this.keys.length-i-r)),this},validate:function(){var e=null;if(0===this.keys.length)return void console.error(" track is empty, no keys",this);for(var t=0;tr.time)return void console.error(" key.time is less than previous key time, out of order keys",this,t,r,e);e=r}return this},optimize:function(){var e=[],t=this.keys[0];e.push(t);for(var r=(a.AnimationUtils.getEqualsFunc(t.value),1);r0&&(null===this.cumulativeValue&&(this.cumulativeValue=a.AnimationUtils.clone(e)),this.cumulativeWeight=t);else{var r=t/(this.cumulativeWeight+t);this.cumulativeValue=this.lerpValue(this.cumulativeValue,e,r),this.cumulativeWeight+=t}},unbind:function(){this.isBound&&(this.setValue(this.originalValue),this.setValue=null,this.getValue=null,this.lerpValue=null,this.equalsValue=null,this.triggerDirty=null,this.isBound=!1)},bind:function(){if(!this.isBound){var e=this.node;if(!e)return void console.error(" trying to update node for track: "+this.trackName+" but it wasn't found.");if(this.objectName){if("materials"===this.objectName){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}else if("bones"===this.objectName){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 t=0;t0){if(this.cumulativeWeight<1){var e=1-this.cumulativeWeight,t=e/(this.cumulativeWeight+e);this.cumulativeValue=this.lerpValue(this.cumulativeValue,this.originalValue,t)}var r=this.setValue(this.cumulativeValue);r&&this.triggerDirty&&this.triggerDirty(),this.cumulativeValue=null,this.cumulativeWeight=0}}},a.PropertyBinding.parseTrackName=function(e){var t=/^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_. ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/,r=t.exec(e);if(!r)throw new Error("cannot parse trackName at all: "+e);r.index===t.lastIndex&&t.lastIndex++;var n={directoryName:r[1],nodeName:r[3],objectName:r[5],objectIndex:r[7],propertyName:r[9],propertyIndex:r[11]};if(null===n.propertyName||0===n.propertyName.length)throw new Error("can not parse propertyName from trackName: "+e);return n},a.PropertyBinding.findNode=function(e,t){function r(e){for(var r=0;rr?e:t},a.StringKeyframeTrack.prototype.compareValues=function(e,t){return e===t},a.StringKeyframeTrack.prototype.clone=function(){for(var e=[],t=0;tr?e:t},a.BooleanKeyframeTrack.prototype.compareValues=function(e,t){return e===t},a.BooleanKeyframeTrack.prototype.clone=function(){for(var e=[],t=0;tr;r+=2){var i=t[r],o=t[r+1];if(i.test(e))return o}return null}},a.XHRLoader=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager},a.XHRLoader.prototype={constructor:a.XHRLoader,load:function(e,t,r,n){var i=this,o=a.Cache.get(e);if(void 0!==o)return t&&setTimeout(function(){t(o)},0),o;var s=new XMLHttpRequest;return s.open("GET",e,!0),s.addEventListener("load",function(r){var n=r.target.response;a.Cache.add(e,n),t&&t(n),i.manager.itemEnd(e)},!1),void 0!==r&&s.addEventListener("progress",function(e){r(e)},!1),s.addEventListener("error",function(t){n&&n(t),i.manager.itemError(e)},!1),void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),void 0!==this.responseType&&(s.responseType=this.responseType),void 0!==this.withCredentials&&(s.withCredentials=this.withCredentials),s.send(null),i.manager.itemStart(e),s},setResponseType:function(e){this.responseType=e},setCrossOrigin:function(e){this.crossOrigin=e},setWithCredentials:function(e){this.withCredentials=e}},a.ImageLoader=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager},a.ImageLoader.prototype={constructor:a.ImageLoader,load:function(e,t,r,n){var i=this,o=a.Cache.get(e);if(void 0!==o)return i.manager.itemStart(e),t?setTimeout(function(){t(o),i.manager.itemEnd(e)},0):i.manager.itemEnd(e),o;var s=document.createElement("img");return s.addEventListener("load",function(r){a.Cache.add(e,this),t&&t(this),i.manager.itemEnd(e)},!1),void 0!==r&&s.addEventListener("progress",function(e){r(e)},!1),s.addEventListener("error",function(t){n&&n(t),i.manager.itemError(e)},!1),void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),i.manager.itemStart(e),s.src=e,s},setCrossOrigin:function(e){this.crossOrigin=e}},a.JSONLoader=function(e){"boolean"==typeof e&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),e=void 0),this.manager=void 0!==e?e:a.DefaultLoadingManager,this.withCredentials=!1},a.JSONLoader.prototype={constructor:a.JSONLoader,get statusDomElement(){return void 0===this._statusDomElement&&(this._statusDomElement=document.createElement("div")),console.warn("THREE.JSONLoader: .statusDomElement has been removed."),this._statusDomElement},load:function(e,t,r,n){var i=this,o=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:a.Loader.prototype.extractUrlBase(e),s=new a.XHRLoader(this.manager);s.setCrossOrigin(this.crossOrigin),s.setWithCredentials(this.withCredentials),s.load(e,function(r){var n=JSON.parse(r),a=n.metadata;if(void 0!==a){if("object"===a.type)return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.ObjectLoader instead.");if("scene"===a.type)return void console.error("THREE.JSONLoader: "+e+" should be loaded with THREE.SceneLoader instead.")}var s=i.parse(n,o);t(s.geometry,s.materials)})},setCrossOrigin:function(e){this.crossOrigin=e},setTexturePath:function(e){this.texturePath=e},parse:function(e,t){function r(t){function r(e,t){return e&1<n;n++)s.faceVertexUvs[n]=[]}for(c=0,u=R.length;u>c;)_=new a.Vector3,_.x=R[c++]*t,_.y=R[c++]*t,_.z=R[c++]*t,s.vertices.push(_);for(c=0,u=P.length;u>c;)if(d=P[c++],m=r(d,0),g=r(d,1),v=r(d,3),y=r(d,4),b=r(d,5),x=r(d,6),w=r(d,7),m){if(M=new a.Face3,M.a=P[c],M.b=P[c+1],M.c=P[c+3],E=new a.Face3,E.a=P[c+1],E.b=P[c+2],E.c=P[c+3],c+=4,g&&(p=P[c++],M.materialIndex=p,E.materialIndex=p),o=s.faces.length,v)for(n=0;U>n;n++)for(C=e.uvs[n],s.faceVertexUvs[n][o]=[],s.faceVertexUvs[n][o+1]=[],i=0;4>i;i++)f=P[c++],k=C[2*f],F=C[2*f+1],L=new a.Vector2(k,F),2!==i&&s.faceVertexUvs[n][o].push(L),0!==i&&s.faceVertexUvs[n][o+1].push(L);if(y&&(l=3*P[c++],M.normal.set(D[l++],D[l++],D[l]),E.normal.copy(M.normal)),b)for(n=0;4>n;n++)l=3*P[c++],A=new a.Vector3(D[l++],D[l++],D[l]),2!==n&&M.vertexNormals.push(A),0!==n&&E.vertexNormals.push(A);if(x&&(h=P[c++],T=O[h],M.color.setHex(T),E.color.setHex(T)),w)for(n=0;4>n;n++)h=P[c++],T=O[h],2!==n&&M.vertexColors.push(new a.Color(T)),0!==n&&E.vertexColors.push(new a.Color(T));s.faces.push(M),s.faces.push(E)}else{if(S=new a.Face3,S.a=P[c++],S.b=P[c++],S.c=P[c++],g&&(p=P[c++],S.materialIndex=p),o=s.faces.length,v)for(n=0;U>n;n++)for(C=e.uvs[n],s.faceVertexUvs[n][o]=[],i=0;3>i;i++)f=P[c++],k=C[2*f],F=C[2*f+1],L=new a.Vector2(k,F),s.faceVertexUvs[n][o].push(L);if(y&&(l=3*P[c++],S.normal.set(D[l++],D[l++],D[l])),b)for(n=0;3>n;n++)l=3*P[c++],A=new a.Vector3(D[l++],D[l++],D[l]),S.vertexNormals.push(A);if(x&&(h=P[c++],S.color.setHex(O[h])),w)for(n=0;3>n;n++)h=P[c++],S.vertexColors.push(new a.Color(O[h]));s.faces.push(S)}}function n(){var t=void 0!==e.influencesPerVertex?e.influencesPerVertex:2;if(e.skinWeights)for(var r=0,n=e.skinWeights.length;n>r;r+=t){var i=e.skinWeights[r],o=t>1?e.skinWeights[r+1]:0,c=t>2?e.skinWeights[r+2]:0,u=t>3?e.skinWeights[r+3]:0;s.skinWeights.push(new a.Vector4(i,o,c,u))}if(e.skinIndices)for(var r=0,n=e.skinIndices.length;n>r;r+=t){var h=e.skinIndices[r],l=t>1?e.skinIndices[r+1]:0,f=t>2?e.skinIndices[r+2]:0,p=t>3?e.skinIndices[r+3]:0;s.skinIndices.push(new a.Vector4(h,l,f,p))}s.bones=e.bones,s.bones&&s.bones.length>0&&(s.skinWeights.length!==s.skinIndices.length||s.skinIndices.length!==s.vertices.length)&&console.warn("When skinning, number of vertices ("+s.vertices.length+"), skinIndices ("+s.skinIndices.length+"), and skinWeights ("+s.skinWeights.length+") should match.")}function i(t){if(void 0!==e.morphTargets)for(var r=0,n=e.morphTargets.length;n>r;r++){s.morphTargets[r]={},s.morphTargets[r].name=e.morphTargets[r].name,s.morphTargets[r].vertices=[];for(var i=s.morphTargets[r].vertices,o=e.morphTargets[r].vertices,c=0,u=o.length;u>c;c+=3){var h=new a.Vector3;h.x=o[c]*t,h.y=o[c+1]*t,h.z=o[c+2]*t,i.push(h)}}if(void 0!==e.morphColors&&e.morphColors.length>0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');for(var l=s.faces,f=e.morphColors[0].colors,r=0,n=l.length;n>r;r++)l[r].color.fromArray(f,3*r)}}function o(){var t=[],r=[];void 0!==e.animation&&r.push(e.animation),void 0!==e.animations&&(e.animations.length?r=r.concat(e.animations):r.push(e.animations));for(var n=0;n0&&(s.animations=t)}var s=new a.Geometry,c=void 0!==e.scale?1/e.scale:1;if(r(c),n(),i(c),o(),s.computeFaceNormals(),s.computeBoundingSphere(),void 0===e.materials||0===e.materials.length)return{geometry:s};var u=a.Loader.prototype.initMaterials(e.materials,t,this.crossOrigin);return{geometry:s,materials:u}}},a.LoadingManager=function(e,t,r){var n=this,i=!1,o=0,a=0;this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=r,this.itemStart=function(e){a++,i===!1&&void 0!==n.onStart&&n.onStart(e,o,a),i=!0},this.itemEnd=function(e){o++,void 0!==n.onProgress&&n.onProgress(e,o,a),o===a&&(i=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(e){void 0!==n.onError&&n.onError(e)}},a.DefaultLoadingManager=new a.LoadingManager,a.BufferGeometryLoader=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager},a.BufferGeometryLoader.prototype={constructor:a.BufferGeometryLoader,load:function(e,t,r,n){var i=this,o=new a.XHRLoader(i.manager);o.setCrossOrigin(this.crossOrigin),o.load(e,function(e){t(i.parse(JSON.parse(e)))},r,n)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e){var t=new a.BufferGeometry,r=e.data.index;if(void 0!==r){var n=new o[r.type](r.array);t.setIndex(new a.BufferAttribute(n,1))}var i=e.data.attributes;for(var s in i){var c=i[s],n=new o[c.type](c.array);t.addAttribute(s,new a.BufferAttribute(n,c.itemSize))}var u=e.data.groups||e.data.drawcalls||e.data.offsets;if(void 0!==u)for(var h=0,l=u.length;h!==l;++h){var f=u[h];t.addGroup(f.start,f.count)}var p=e.data.boundingSphere;if(void 0!==p){var d=new a.Vector3;void 0!==p.center&&d.fromArray(p.center),t.boundingSphere=new a.Sphere(d,p.radius)}return t}},a.MaterialLoader=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.textures={}},a.MaterialLoader.prototype={constructor:a.MaterialLoader,load:function(e,t,r,n){var i=this,o=new a.XHRLoader(i.manager);o.setCrossOrigin(this.crossOrigin),o.load(e,function(e){t(i.parse(JSON.parse(e)))},r,n)},setCrossOrigin:function(e){this.crossOrigin=e},setTextures:function(e){this.textures=e},getTexture:function(e){var t=this.textures;return void 0===t[e]&&console.warn("THREE.MaterialLoader: Undefined texture",e),t[e]},parse:function(e){var t=new a[e.type];if(t.uuid=e.uuid,void 0!==e.name&&(t.name=e.name),void 0!==e.color&&t.color.setHex(e.color),void 0!==e.emissive&&t.emissive.setHex(e.emissive),void 0!==e.specular&&t.specular.setHex(e.specular),void 0!==e.shininess&&(t.shininess=e.shininess),void 0!==e.uniforms&&(t.uniforms=e.uniforms),void 0!==e.vertexShader&&(t.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(t.fragmentShader=e.fragmentShader),void 0!==e.vertexColors&&(t.vertexColors=e.vertexColors),void 0!==e.shading&&(t.shading=e.shading),void 0!==e.blending&&(t.blending=e.blending),void 0!==e.side&&(t.side=e.side),void 0!==e.opacity&&(t.opacity=e.opacity),void 0!==e.transparent&&(t.transparent=e.transparent),void 0!==e.alphaTest&&(t.alphaTest=e.alphaTest),void 0!==e.depthTest&&(t.depthTest=e.depthTest),void 0!==e.depthWrite&&(t.depthWrite=e.depthWrite),void 0!==e.wireframe&&(t.wireframe=e.wireframe),void 0!==e.wireframeLinewidth&&(t.wireframeLinewidth=e.wireframeLinewidth),void 0!==e.size&&(t.size=e.size),void 0!==e.sizeAttenuation&&(t.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(t.map=this.getTexture(e.map)),void 0!==e.alphaMap&&(t.alphaMap=this.getTexture(e.alphaMap),t.transparent=!0),void 0!==e.bumpMap&&(t.bumpMap=this.getTexture(e.bumpMap)),void 0!==e.bumpScale&&(t.bumpScale=e.bumpScale),void 0!==e.normalMap&&(t.normalMap=this.getTexture(e.normalMap)),e.normalScale&&(t.normalScale=new a.Vector2(e.normalScale,e.normalScale)),void 0!==e.displacementMap&&(t.displacementMap=this.getTexture(e.displacementMap)),void 0!==e.displacementScale&&(t.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(t.displacementBias=e.displacementBias),void 0!==e.specularMap&&(t.specularMap=this.getTexture(e.specularMap)),void 0!==e.envMap&&(t.envMap=this.getTexture(e.envMap),t.combine=a.MultiplyOperation),e.reflectivity&&(t.reflectivity=e.reflectivity),void 0!==e.lightMap&&(t.lightMap=this.getTexture(e.lightMap)),void 0!==e.lightMapIntensity&&(t.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(t.aoMap=this.getTexture(e.aoMap)),void 0!==e.aoMapIntensity&&(t.aoMapIntensity=e.aoMapIntensity),void 0!==e.materials)for(var r=0,n=e.materials.length;n>r;r++)t.materials.push(this.parse(e.materials[r]));return t}},a.ObjectLoader=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.texturePath=""},a.ObjectLoader.prototype={constructor:a.ObjectLoader,load:function(e,t,r,n){""===this.texturePath&&(this.texturePath=e.substring(0,e.lastIndexOf("/")+1));var i=this,o=new a.XHRLoader(i.manager);o.setCrossOrigin(this.crossOrigin),o.load(e,function(e){i.parse(JSON.parse(e),t)},r,n)},setTexturePath:function(e){this.texturePath=e},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){var r=this.parseGeometries(e.geometries),n=this.parseImages(e.images,function(){void 0!==t&&t(a)}),i=this.parseTextures(e.textures,n),o=this.parseMaterials(e.materials,i),a=this.parseObject(e.object,r,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 r=new a.JSONLoader,n=new a.BufferGeometryLoader,i=0,o=e.length;o>i;i++){var s,c=e[i];switch(c.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new a[c.type](c.width,c.height,c.widthSegments,c.heightSegments);break;case"BoxGeometry":case"CubeGeometry":s=new a.BoxGeometry(c.width,c.height,c.depth,c.widthSegments,c.heightSegments,c.depthSegments);break;case"CircleBufferGeometry":s=new a.CircleBufferGeometry(c.radius,c.segments,c.thetaStart,c.thetaLength);break;case"CircleGeometry":s=new a.CircleGeometry(c.radius,c.segments,c.thetaStart,c.thetaLength);break;case"CylinderGeometry":s=new a.CylinderGeometry(c.radiusTop,c.radiusBottom,c.height,c.radialSegments,c.heightSegments,c.openEnded,c.thetaStart,c.thetaLength);break;case"SphereGeometry":s=new a.SphereGeometry(c.radius,c.widthSegments,c.heightSegments,c.phiStart,c.phiLength,c.thetaStart,c.thetaLength);break;case"SphereBufferGeometry":s=new a.SphereBufferGeometry(c.radius,c.widthSegments,c.heightSegments,c.phiStart,c.phiLength,c.thetaStart,c.thetaLength);break;case"DodecahedronGeometry":s=new a.DodecahedronGeometry(c.radius,c.detail);break;case"IcosahedronGeometry":s=new a.IcosahedronGeometry(c.radius,c.detail);break;case"OctahedronGeometry":s=new a.OctahedronGeometry(c.radius,c.detail);break;case"TetrahedronGeometry":s=new a.TetrahedronGeometry(c.radius,c.detail);break;case"RingGeometry":s=new a.RingGeometry(c.innerRadius,c.outerRadius,c.thetaSegments,c.phiSegments,c.thetaStart,c.thetaLength);break;case"TorusGeometry":s=new a.TorusGeometry(c.radius,c.tube,c.radialSegments,c.tubularSegments,c.arc);break;case"TorusKnotGeometry":s=new a.TorusKnotGeometry(c.radius,c.tube,c.radialSegments,c.tubularSegments,c.p,c.q,c.heightScale);break;case"BufferGeometry":s=n.parse(c);break;case"Geometry":s=r.parse(c.data,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+c.type+'"');continue}s.uuid=c.uuid,void 0!==c.name&&(s.name=c.name),t[c.uuid]=s}return t},parseMaterials:function(e,t){var r={};if(void 0!==e){var n=new a.MaterialLoader;n.setTextures(t);for(var i=0,o=e.length;o>i;i++){var s=n.parse(e[i]);r[s.uuid]=s}}return r},parseAnimations:function(e){for(var t=[],r=0;r0){var o=new a.LoadingManager(t),s=new a.ImageLoader(o);s.setCrossOrigin(this.crossOrigin);for(var c=0,u=e.length;u>c;c++){var h=e[c],l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url)?h.url:n.texturePath+h.url;i[h.uuid]=r(l)}}return i},parseTextures:function(e,t){
-function r(e){return"number"==typeof e?e:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",e),a[e])}var n={};if(void 0!==e)for(var i=0,o=e.length;o>i;i++){var s=e[i];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 a.Texture(t[s.image]);c.needsUpdate=!0,c.uuid=s.uuid,void 0!==s.name&&(c.name=s.name),void 0!==s.mapping&&(c.mapping=r(s.mapping)),void 0!==s.offset&&(c.offset=new a.Vector2(s.offset[0],s.offset[1])),void 0!==s.repeat&&(c.repeat=new a.Vector2(s.repeat[0],s.repeat[1])),void 0!==s.minFilter&&(c.minFilter=r(s.minFilter)),void 0!==s.magFilter&&(c.magFilter=r(s.magFilter)),void 0!==s.anisotropy&&(c.anisotropy=s.anisotropy),Array.isArray(s.wrap)&&(c.wrapS=r(s.wrap[0]),c.wrapT=r(s.wrap[1])),n[s.uuid]=c}return n},parseObject:function(){var e=new a.Matrix4;return function(t,r,n){function i(e){return void 0===r[e]&&console.warn("THREE.ObjectLoader: Undefined geometry",e),r[e]}function o(e){return void 0!==e?(void 0===n[e]&&console.warn("THREE.ObjectLoader: Undefined material",e),n[e]):void 0}var s;switch(t.type){case"Scene":s=new a.Scene;break;case"PerspectiveCamera":s=new a.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);break;case"OrthographicCamera":s=new a.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);break;case"AmbientLight":s=new a.AmbientLight(t.color);break;case"DirectionalLight":s=new a.DirectionalLight(t.color,t.intensity);break;case"PointLight":s=new a.PointLight(t.color,t.intensity,t.distance,t.decay);break;case"SpotLight":s=new a.SpotLight(t.color,t.intensity,t.distance,t.angle,t.exponent,t.decay);break;case"HemisphereLight":s=new a.HemisphereLight(t.color,t.groundColor,t.intensity);break;case"Mesh":s=new a.Mesh(i(t.geometry),o(t.material));break;case"LOD":s=new a.LOD;break;case"Line":s=new a.Line(i(t.geometry),o(t.material),t.mode);break;case"PointCloud":case"Points":s=new a.Points(i(t.geometry),o(t.material));break;case"Sprite":s=new a.Sprite(o(t.material));break;case"Group":s=new a.Group;break;default:s=new a.Object3D}if(s.uuid=t.uuid,void 0!==t.name&&(s.name=t.name),void 0!==t.matrix?(e.fromArray(t.matrix),e.decompose(s.position,s.quaternion,s.scale)):(void 0!==t.position&&s.position.fromArray(t.position),void 0!==t.rotation&&s.rotation.fromArray(t.rotation),void 0!==t.scale&&s.scale.fromArray(t.scale)),void 0!==t.castShadow&&(s.castShadow=t.castShadow),void 0!==t.receiveShadow&&(s.receiveShadow=t.receiveShadow),void 0!==t.visible&&(s.visible=t.visible),void 0!==t.userData&&(s.userData=t.userData),void 0!==t.children)for(var c in t.children)s.add(this.parseObject(t.children[c],r,n));if("LOD"===t.type)for(var u=t.levels,h=0;hl;++l)h(l);else c.load(e,function(e){var r=i._parser(e,!0);if(r.isCubemap)for(var n=r.mipmaps.length/r.mipmapCount,c=0;n>c;c++){o[c]={mipmaps:[]};for(var u=0;u0&&(t.alphaTest=this.alphaTest),this.wireframe===!0&&(t.wireframe=this.wireframe),this.wireframeLinewidth>1&&(t.wireframeLinewidth=this.wireframeLinewidth),t},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.side=e.side,this.opacity=e.opacity,this.transparent=e.transparent,this.blending=e.blending,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.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.alphaTest=e.alphaTest,this.overdraw=e.overdraw,this.visible=e.visible,this},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})},get wrapAround(){console.warn("THREE."+this.type+": .wrapAround has been removed.")},set wrapAround(e){console.warn("THREE."+this.type+": .wrapAround has been removed.")},get wrapRGB(){return console.warn("THREE."+this.type+": .wrapRGB has been removed."),new a.Color}},a.EventDispatcher.prototype.apply(a.Material.prototype),a.MaterialIdCount=0,a.LineBasicMaterial=function(e){a.Material.call(this),this.type="LineBasicMaterial",this.color=new a.Color(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.vertexColors=a.NoColors,this.fog=!0,this.setValues(e)},a.LineBasicMaterial.prototype=Object.create(a.Material.prototype),a.LineBasicMaterial.prototype.constructor=a.LineBasicMaterial,a.LineBasicMaterial.prototype.copy=function(e){return a.Material.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.vertexColors=e.vertexColors,this.fog=e.fog,this},a.LineDashedMaterial=function(e){a.Material.call(this),this.type="LineDashedMaterial",this.color=new a.Color(16777215),this.linewidth=1,this.scale=1,this.dashSize=3,this.gapSize=1,this.vertexColors=!1,this.fog=!0,this.setValues(e)},a.LineDashedMaterial.prototype=Object.create(a.Material.prototype),a.LineDashedMaterial.prototype.constructor=a.LineDashedMaterial,a.LineDashedMaterial.prototype.copy=function(e){return a.Material.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.vertexColors=e.vertexColors,this.fog=e.fog,this},a.MeshBasicMaterial=function(e){a.Material.call(this),this.type="MeshBasicMaterial",this.color=new a.Color(16777215),this.map=null,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=a.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=a.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=a.NoColors,this.skinning=!1,this.morphTargets=!1,this.setValues(e)},a.MeshBasicMaterial.prototype=Object.create(a.Material.prototype),a.MeshBasicMaterial.prototype.constructor=a.MeshBasicMaterial,a.MeshBasicMaterial.prototype.copy=function(e){return a.Material.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,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.fog=e.fog,this.shading=e.shading,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.vertexColors=e.vertexColors,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this},a.MeshLambertMaterial=function(e){a.Material.call(this),this.type="MeshLambertMaterial",this.color=new a.Color(16777215),this.emissive=new a.Color(0),this.map=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=a.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=a.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)},a.MeshLambertMaterial.prototype=Object.create(a.Material.prototype),a.MeshLambertMaterial.prototype.constructor=a.MeshLambertMaterial,a.MeshLambertMaterial.prototype.copy=function(e){return a.Material.prototype.copy.call(this,e),this.color.copy(e.color),this.emissive.copy(e.emissive),this.map=e.map,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.fog=e.fog,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.vertexColors=e.vertexColors,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},a.MeshPhongMaterial=function(e){a.Material.call(this),this.type="MeshPhongMaterial",this.color=new a.Color(16777215),this.emissive=new a.Color(0),this.specular=new a.Color(1118481),this.shininess=30,this.metal=!1,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new a.Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=a.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=a.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=a.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)},a.MeshPhongMaterial.prototype=Object.create(a.Material.prototype),a.MeshPhongMaterial.prototype.constructor=a.MeshPhongMaterial,a.MeshPhongMaterial.prototype.copy=function(e){return a.Material.prototype.copy.call(this,e),this.color.copy(e.color),this.emissive.copy(e.emissive),this.specular.copy(e.specular),this.shininess=e.shininess,this.metal=e.metal,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissiveMap=e.emissiveMap,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.fog=e.fog,this.shading=e.shading,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.vertexColors=e.vertexColors,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},a.MeshDepthMaterial=function(e){a.Material.call(this),this.type="MeshDepthMaterial",this.morphTargets=!1,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)},a.MeshDepthMaterial.prototype=Object.create(a.Material.prototype),a.MeshDepthMaterial.prototype.constructor=a.MeshDepthMaterial,a.MeshDepthMaterial.prototype.copy=function(e){return a.Material.prototype.copy.call(this,e),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},a.MeshNormalMaterial=function(e){a.Material.call(this,e),this.type="MeshNormalMaterial",this.wireframe=!1,this.wireframeLinewidth=1,this.morphTargets=!1,this.setValues(e)},a.MeshNormalMaterial.prototype=Object.create(a.Material.prototype),a.MeshNormalMaterial.prototype.constructor=a.MeshNormalMaterial,a.MeshNormalMaterial.prototype.copy=function(e){return a.Material.prototype.copy.call(this,e),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},a.MultiMaterial=function(e){this.uuid=a.Math.generateUUID(),this.type="MultiMaterial",this.materials=e instanceof Array?e:[],this.visible=!0},a.MultiMaterial.prototype={constructor:a.MultiMaterial,toJSON:function(){for(var e={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},t=0,r=this.materials.length;r>t;t++)e.materials.push(this.materials[t].toJSON());return e.visible=this.visible,e},clone:function(){for(var e=new this.constructor,t=0;t2048||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 r={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};if(void 0!==this.image){var n=this.image;void 0===n.uuid&&(n.uuid=a.Math.generateUUID()),void 0===e.images[n.uuid]&&(e.images[n.uuid]={uuid:n.uuid,url:t(n)}),r.image=n.uuid}return e.textures[this.uuid]=r,r},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(e){if(this.mapping===a.UVMapping){if(e.multiply(this.repeat),e.add(this.offset),e.x<0||e.x>1)switch(this.wrapS){case a.RepeatWrapping:e.x=e.x-Math.floor(e.x);break;case a.ClampToEdgeWrapping:e.x=e.x<0?0:1;break;case a.MirroredRepeatWrapping: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 a.RepeatWrapping:e.y=e.y-Math.floor(e.y);break;case a.ClampToEdgeWrapping:e.y=e.y<0?0:1;break;case a.MirroredRepeatWrapping: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)}}},a.EventDispatcher.prototype.apply(a.Texture.prototype),a.TextureIdCount=0,a.CanvasTexture=function(e,t,r,n,i,o,s,c,u){a.Texture.call(this,e,t,r,n,i,o,s,c,u),this.needsUpdate=!0},a.CanvasTexture.prototype=Object.create(a.Texture.prototype),a.CanvasTexture.prototype.constructor=a.CanvasTexture,a.CubeTexture=function(e,t,r,n,i,o,s,c,u){t=void 0!==t?t:a.CubeReflectionMapping,a.Texture.call(this,e,t,r,n,i,o,s,c,u),this.images=e,this.flipY=!1},a.CubeTexture.prototype=Object.create(a.Texture.prototype),a.CubeTexture.prototype.constructor=a.CubeTexture,a.CubeTexture.prototype.copy=function(e){return a.Texture.prototype.copy.call(this,e),this.images=e.images,this},a.CompressedTexture=function(e,t,r,n,i,o,s,c,u,h,l){a.Texture.call(this,null,o,s,c,u,h,n,i,l),this.image={width:t,height:r},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1},a.CompressedTexture.prototype=Object.create(a.Texture.prototype),a.CompressedTexture.prototype.constructor=a.CompressedTexture,a.DataTexture=function(e,t,r,n,i,o,s,c,u,h,l){a.Texture.call(this,null,o,s,c,u,h,n,i,l),this.image={data:e,width:t,height:r},this.magFilter=void 0!==u?u:a.NearestFilter,this.minFilter=void 0!==h?h:a.NearestFilter,this.flipY=!1,this.generateMipmaps=!1},a.DataTexture.prototype=Object.create(a.Texture.prototype),a.DataTexture.prototype.constructor=a.DataTexture,a.VideoTexture=function(e,t,r,n,i,o,s,c,u){function h(){requestAnimationFrame(h),e.readyState===e.HAVE_ENOUGH_DATA&&(l.needsUpdate=!0)}a.Texture.call(this,e,t,r,n,i,o,s,c,u),this.generateMipmaps=!1;var l=this;h()},a.VideoTexture.prototype=Object.create(a.Texture.prototype),a.VideoTexture.prototype.constructor=a.VideoTexture,a.Group=function(){a.Object3D.call(this),this.type="Group"},a.Group.prototype=Object.create(a.Object3D.prototype),a.Group.prototype.constructor=a.Group,a.Points=function(e,t){a.Object3D.call(this),this.type="Points",this.geometry=void 0!==e?e:new a.Geometry,this.material=void 0!==t?t:new a.PointsMaterial({color:16777215*Math.random()})},a.Points.prototype=Object.create(a.Object3D.prototype),a.Points.prototype.constructor=a.Points,a.Points.prototype.raycast=function(){var e=new a.Matrix4,t=new a.Ray;return function(r,n){function i(e,i){var a=t.distanceSqToPoint(e);if(h>a){var s=t.closestPointToPoint(e);s.applyMatrix4(o.matrixWorld);var c=r.ray.origin.distanceTo(s);if(cr.far)return;n.push({distance:c,distanceToRay:Math.sqrt(a),point:s.clone(),index:i,face:null,object:o})}}var o=this,s=o.geometry,c=r.params.Points.threshold;if(e.getInverse(this.matrixWorld),t.copy(r.ray).applyMatrix4(e),null===s.boundingBox||t.isIntersectionBox(s.boundingBox)!==!1){var u=c/((this.scale.x+this.scale.y+this.scale.z)/3),h=u*u,l=new a.Vector3;if(s instanceof a.BufferGeometry){var f=s.index,p=s.attributes,d=p.position.array;if(null!==f)for(var m=f.array,g=0,v=m.length;v>g;g++){var y=m[g];l.fromArray(d,3*y),i(l,y)}else for(var g=0,b=d.length/3;b>g;g++)l.fromArray(d,3*g),i(l,g)}else for(var x=s.vertices,g=0,b=x.length;b>g;g++)i(x[g],g)}}}(),a.Points.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)},a.PointCloud=function(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new a.Points(e,t)},a.ParticleSystem=function(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new a.Points(e,t)},a.Line=function(e,t,r){return 1===r?(console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new a.LineSegments(e,t)):(a.Object3D.call(this),this.type="Line",this.geometry=void 0!==e?e:new a.Geometry,void(this.material=void 0!==t?t:new a.LineBasicMaterial({color:16777215*Math.random()})))},a.Line.prototype=Object.create(a.Object3D.prototype),a.Line.prototype.constructor=a.Line,a.Line.prototype.raycast=function(){var e=new a.Matrix4,t=new a.Ray,r=new a.Sphere;return function(n,i){var o=n.linePrecision,s=o*o,c=this.geometry;if(null===c.boundingSphere&&c.computeBoundingSphere(),r.copy(c.boundingSphere),r.applyMatrix4(this.matrixWorld),n.ray.isIntersectionSphere(r)!==!1){e.getInverse(this.matrixWorld),t.copy(n.ray).applyMatrix4(e);var u=new a.Vector3,h=new a.Vector3,l=new a.Vector3,f=new a.Vector3,p=this instanceof a.LineSegments?2:1;if(c instanceof a.BufferGeometry){var d=c.index,m=c.attributes;if(null!==d)for(var g=d.array,v=m.position.array,y=0,b=g.length-1;b>y;y+=p){var x=g[y],w=g[y+1];u.fromArray(v,3*x),h.fromArray(v,3*w);var _=t.distanceSqToSegment(u,h,f,l);if(!(_>s)){f.applyMatrix4(this.matrixWorld);var S=n.ray.origin.distanceTo(f);Sn.far||i.push({distance:S,point:l.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else for(var v=m.position.array,y=0,b=v.length/3-1;b>y;y+=p){u.fromArray(v,3*y),h.fromArray(v,3*y+3);var _=t.distanceSqToSegment(u,h,f,l);if(!(_>s)){f.applyMatrix4(this.matrixWorld);var S=n.ray.origin.distanceTo(f);Sn.far||i.push({distance:S,point:l.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}else if(c instanceof a.Geometry)for(var M=c.vertices,E=M.length,y=0;E-1>y;y+=p){var _=t.distanceSqToSegment(M[y],M[y+1],f,l);if(!(_>s)){f.applyMatrix4(this.matrixWorld);var S=n.ray.origin.distanceTo(f);Sn.far||i.push({distance:S,point:l.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}}}(),a.Line.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)},a.LineStrip=0,a.LinePieces=1,a.LineSegments=function(e,t){a.Line.call(this,e,t),this.type="LineSegments"},a.LineSegments.prototype=Object.create(a.Line.prototype),a.LineSegments.prototype.constructor=a.LineSegments,a.Mesh=function(e,t){a.Object3D.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new a.Geometry,this.material=void 0!==t?t:new a.MeshBasicMaterial({color:16777215*Math.random()}),this.updateMorphTargets()},a.Mesh.prototype=Object.create(a.Object3D.prototype),a.Mesh.prototype.constructor=a.Mesh,a.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&this.geometry.morphTargets.length>0){this.morphTargetBase=-1,this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var e=0,t=this.geometry.morphTargets.length;t>e;e++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[e].name]=e}},a.Mesh.prototype.getMorphTargetIndexByName=function(e){return void 0!==this.morphTargetDictionary[e]?this.morphTargetDictionary[e]:(console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+e+" does not exist. Returning 0."),0)},a.Mesh.prototype.raycast=function(){function e(e,t,r,n,i,o,s){return a.Triangle.barycoordFromPoint(e,t,r,n,g),i.multiplyScalar(g.x),o.multiplyScalar(g.y),s.multiplyScalar(g.z),i.add(o).add(s),i.clone()}function t(e,t,r,n,i,o,s){var c,u=e.material;if(c=u.side===a.BackSide?r.intersectTriangle(o,i,n,!0,s):r.intersectTriangle(n,i,o,u.side!==a.DoubleSide,s),null===c)return null;y.copy(s),y.applyMatrix4(e.matrixWorld);var h=t.ray.origin.distanceTo(y);return ht.far?null:{distance:h,point:y.clone(),object:e}}function r(r,n,i,o,h,l,f,g){s.fromArray(o,3*l),c.fromArray(o,3*f),u.fromArray(o,3*g);var y=t(r,n,i,s,c,u,v);return y&&(h&&(p.fromArray(h,2*l),d.fromArray(h,2*f),m.fromArray(h,2*g),y.uv=e(v,s,c,u,p,d,m)),y.face=new a.Face3(l,f,g,a.Triangle.normal(s,c,u)),y.faceIndex=l),y}var n=new a.Matrix4,i=new a.Ray,o=new a.Sphere,s=new a.Vector3,c=new a.Vector3,u=new a.Vector3,h=new a.Vector3,l=new a.Vector3,f=new a.Vector3,p=new a.Vector2,d=new a.Vector2,m=new a.Vector2,g=new a.Vector3,v=new a.Vector3,y=new a.Vector3;return function(g,y){var b=this.geometry,x=this.material;if(void 0!==x){null===b.boundingSphere&&b.computeBoundingSphere();var w=this.matrixWorld;if(o.copy(b.boundingSphere),
-o.applyMatrix4(w),g.ray.isIntersectionSphere(o)!==!1&&(n.getInverse(w),i.copy(g.ray).applyMatrix4(n),null===b.boundingBox||i.isIntersectionBox(b.boundingBox)!==!1)){var _,S;if(b instanceof a.BufferGeometry){var M,E,T,A=b.index,C=b.attributes,L=C.position.array;if(void 0!==C.uv&&(_=C.uv.array),null!==A)for(var k=A.array,F=0,P=k.length;P>F;F+=3)M=k[F],E=k[F+1],T=k[F+2],S=r(this,g,i,L,_,M,E,T),S&&(S.faceIndex=Math.floor(F/3),y.push(S));else for(var F=0,P=L.length;P>F;F+=9)M=F/3,E=M+1,T=M+2,S=r(this,g,i,L,_,M,E,T),S&&(S.index=M,y.push(S))}else if(b instanceof a.Geometry){var R,D,O,U=x instanceof a.MeshFaceMaterial,B=U===!0?x.materials:null,j=b.vertices,$=b.faces,N=b.faceVertexUvs[0];N.length>0&&(_=N);for(var I=0,V=$.length;V>I;I++){var G=$[I],z=U===!0?B[G.materialIndex]:x;if(void 0!==z){if(R=j[G.a],D=j[G.b],O=j[G.c],z.morphTargets===!0){var H=b.morphTargets,W=this.morphTargetInfluences;s.set(0,0,0),c.set(0,0,0),u.set(0,0,0);for(var X=0,q=H.length;q>X;X++){var K=W[X];if(0!==K){var Y=H[X].vertices;s.addScaledVector(h.subVectors(Y[G.a],R),K),c.addScaledVector(l.subVectors(Y[G.b],D),K),u.addScaledVector(f.subVectors(Y[G.c],O),K)}}s.add(R),c.add(D),u.add(O),R=s,D=c,O=u}if(S=t(this,g,i,R,D,O,v)){if(_){var Q=_[I];p.copy(Q[0]),d.copy(Q[1]),m.copy(Q[2]),S.uv=e(v,R,D,O,p,d,m)}S.face=G,S.faceIndex=I,y.push(S)}}}}}}}}(),a.Mesh.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)},a.Bone=function(e){a.Object3D.call(this),this.type="Bone",this.skin=e},a.Bone.prototype=Object.create(a.Object3D.prototype),a.Bone.prototype.constructor=a.Bone,a.Bone.prototype.copy=function(e){return a.Object3D.prototype.copy.call(this,e),this.skin=e.skin,this},a.Skeleton=function(e,t,r){if(this.useVertexTexture=void 0!==r?r:!0,this.identityMatrix=new a.Matrix4,e=e||[],this.bones=e.slice(0),this.useVertexTexture){var n=Math.sqrt(4*this.bones.length);n=a.Math.nextPowerOfTwo(Math.ceil(n)),n=Math.max(n,4),this.boneTextureWidth=n,this.boneTextureHeight=n,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new a.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,a.RGBAFormat,a.FloatType)}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 i=0,o=this.bones.length;o>i;i++)this.boneInverses.push(new a.Matrix4)}},a.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var e=0,t=this.bones.length;t>e;e++){var r=new a.Matrix4;this.bones[e]&&r.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(r)}},a.Skeleton.prototype.pose=function(){for(var e,t=0,r=this.bones.length;r>t;t++)e=this.bones[t],e&&e.matrixWorld.getInverse(this.boneInverses[t]);for(var t=0,r=this.bones.length;r>t;t++)e=this.bones[t],e&&(e.parent?(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))},a.Skeleton.prototype.update=function(){var e=new a.Matrix4;return function(){for(var t=0,r=this.bones.length;r>t;t++){var n=this.bones[t]?this.bones[t].matrixWorld:this.identityMatrix;e.multiplyMatrices(n,this.boneInverses[t]),e.flattenToArrayOffset(this.boneMatrices,16*t)}this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)}}(),a.Skeleton.prototype.clone=function(){return new a.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)},a.SkinnedMesh=function(e,t,r){a.Mesh.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new a.Matrix4,this.bindMatrixInverse=new a.Matrix4;var n=[];if(this.geometry&&void 0!==this.geometry.bones){for(var i,o,s=0,c=this.geometry.bones.length;c>s;++s)o=this.geometry.bones[s],i=new a.Bone(this),n.push(i),i.name=o.name,i.position.fromArray(o.pos),i.quaternion.fromArray(o.rotq),void 0!==o.scl&&i.scale.fromArray(o.scl);for(var s=0,c=this.geometry.bones.length;c>s;++s)o=this.geometry.bones[s],-1!==o.parent&&null!==o.parent?n[o.parent].add(n[s]):this.add(n[s])}this.normalizeSkinWeights(),this.updateMatrixWorld(!0),this.bind(new a.Skeleton(n,void 0,r),this.matrixWorld)},a.SkinnedMesh.prototype=Object.create(a.Mesh.prototype),a.SkinnedMesh.prototype.constructor=a.SkinnedMesh,a.SkinnedMesh.prototype.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)},a.SkinnedMesh.prototype.pose=function(){this.skeleton.pose()},a.SkinnedMesh.prototype.normalizeSkinWeights=function(){if(this.geometry instanceof a.Geometry)for(var e=0;er&&!(e1){e.setFromMatrixPosition(r.matrixWorld),t.setFromMatrixPosition(this.matrixWorld);var i=e.distanceTo(t);n[0].object.visible=!0;for(var o=1,a=n.length;a>o&&i>=n[o].distance;o++)n[o-1].object.visible=!1,n[o].object.visible=!0;for(;a>o;o++)n[o].object.visible=!1}}}(),a.LOD.prototype.copy=function(e){a.Object3D.prototype.copy.call(this,e,!1);for(var t=e.levels,r=0,n=t.length;n>r;r++){var i=t[r];this.addLevel(i.object.clone(),i.distance)}return this},a.LOD.prototype.toJSON=function(e){var t=a.Object3D.prototype.toJSON.call(this,e);t.object.levels=[];for(var r=this.levels,n=0,i=r.length;i>n;n++){var o=r[n];t.object.levels.push({object:o.object.uuid,distance:o.distance})}return t},a.Sprite=function(){var e=new Uint16Array([0,1,2,0,2,3]),t=new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0]),r=new Float32Array([0,0,1,0,1,1,0,1]),n=new a.BufferGeometry;return n.setIndex(new a.BufferAttribute(e,1)),n.addAttribute("position",new a.BufferAttribute(t,3)),n.addAttribute("uv",new a.BufferAttribute(r,2)),function(e){a.Object3D.call(this),this.type="Sprite",this.geometry=n,this.material=void 0!==e?e:new a.SpriteMaterial}}(),a.Sprite.prototype=Object.create(a.Object3D.prototype),a.Sprite.prototype.constructor=a.Sprite,a.Sprite.prototype.raycast=function(){var e=new a.Vector3;return function(t,r){e.setFromMatrixPosition(this.matrixWorld);var n=t.ray.distanceSqToPoint(e),i=this.scale.x*this.scale.y;n>i||r.push({distance:Math.sqrt(n),point:this.position,face:null,object:this})}}(),a.Sprite.prototype.clone=function(){return new this.constructor(this.material).copy(this)},a.Particle=a.Sprite,a.LensFlare=function(e,t,r,n,i){a.Object3D.call(this),this.lensFlares=[],this.positionScreen=new a.Vector3,this.customUpdateCallback=void 0,void 0!==e&&this.add(e,t,r,n,i)},a.LensFlare.prototype=Object.create(a.Object3D.prototype),a.LensFlare.prototype.constructor=a.LensFlare,a.LensFlare.prototype.add=function(e,t,r,n,i,o){void 0===t&&(t=-1),void 0===r&&(r=0),void 0===o&&(o=1),void 0===i&&(i=new a.Color(16777215)),void 0===n&&(n=a.NormalBlending),r=Math.min(r,Math.max(0,r)),this.lensFlares.push({texture:e,size:t,distance:r,x:0,y:0,z:0,scale:1,rotation:0,opacity:o,color:i,blending:n})},a.LensFlare.prototype.updateLensFlares=function(){var e,t,r=this.lensFlares.length,n=2*-this.positionScreen.x,i=2*-this.positionScreen.y;for(e=0;r>e;e++)t=this.lensFlares[e],t.x=this.positionScreen.x+n*t.distance,t.y=this.positionScreen.y+i*t.distance,t.wantedRotation=t.x*Math.PI*.25,t.rotation+=.25*(t.wantedRotation-t.rotation)},a.LensFlare.prototype.copy=function(e){a.Object3D.prototype.copy.call(this,e),this.positionScreen.copy(e.positionScreen),this.customUpdateCallback=e.customUpdateCallback;for(var t=0,r=e.lensFlares.length;r>t;t++)this.lensFlares.push(e.lensFlares[t]);return this},a.Scene=function(){a.Object3D.call(this),this.type="Scene",this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0},a.Scene.prototype=Object.create(a.Object3D.prototype),a.Scene.prototype.constructor=a.Scene,a.Scene.prototype.copy=function(e){return a.Object3D.prototype.copy.call(this,e),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},a.Fog=function(e,t,r){this.name="",this.color=new a.Color(e),this.near=void 0!==t?t:1,this.far=void 0!==r?r:1e3},a.Fog.prototype.clone=function(){return new a.Fog(this.color.getHex(),this.near,this.far)},a.FogExp2=function(e,t){this.name="",this.color=new a.Color(e),this.density=void 0!==t?t:25e-5},a.FogExp2.prototype.clone=function(){return new a.FogExp2(this.color.getHex(),this.density)},a.ShaderChunk={},a.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n\n diffuseColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n",a.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n\n uniform sampler2D alphaMap;\n\n#endif\n",a.ShaderChunk.alphatest_fragment="#ifdef ALPHATEST\n\n if ( diffuseColor.a < ALPHATEST ) discard;\n\n#endif\n",a.ShaderChunk.aomap_fragment="#ifdef USE_AOMAP\n\n totalAmbientLight *= ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\n#endif\n",a.ShaderChunk.aomap_pars_fragment="#ifdef USE_AOMAP\n\n uniform sampler2D aoMap;\n uniform float aoMapIntensity;\n\n#endif",a.ShaderChunk.begin_vertex="\nvec3 transformed = vec3( position );\n",a.ShaderChunk.beginnormal_vertex="\nvec3 objectNormal = vec3( normal );\n",a.ShaderChunk.bumpmap_pars_fragment="#ifdef USE_BUMPMAP\n\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n\n\n\n vec2 dHdxy_fwd() {\n\n vec2 dSTdx = dFdx( vUv );\n vec2 dSTdy = dFdy( vUv );\n\n float Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\n return vec2( dBx, dBy );\n\n }\n\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\n vec3 vSigmaX = dFdx( surf_pos );\n vec3 vSigmaY = dFdy( surf_pos );\n vec3 vN = surf_norm;\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n\n float fDet = dot( vSigmaX, R1 );\n\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n\n }\n\n#endif\n",a.ShaderChunk.color_fragment="#ifdef USE_COLOR\n\n diffuseColor.rgb *= vColor;\n\n#endif",a.ShaderChunk.color_pars_fragment="#ifdef USE_COLOR\n\n varying vec3 vColor;\n\n#endif\n",a.ShaderChunk.color_pars_vertex="#ifdef USE_COLOR\n\n varying vec3 vColor;\n\n#endif",a.ShaderChunk.color_vertex="#ifdef USE_COLOR\n\n vColor.xyz = color.xyz;\n\n#endif",a.ShaderChunk.common="#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\n\nvec3 transformDirection( in vec3 normal, in mat4 matrix ) {\n\n return normalize( ( matrix * vec4( normal, 0.0 ) ).xyz );\n\n}\n\nvec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {\n\n return normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );\n\n}\n\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n float distance = dot( planeNormal, point - pointOnPlane );\n\n return - distance * planeNormal + point;\n\n}\n\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n return sign( dot( point - pointOnPlane, planeNormal ) );\n\n}\n\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\n return lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n\n}\n\nfloat calcLightAttenuation( float lightDistance, float cutoffDistance, float decayExponent ) {\n\n if ( decayExponent > 0.0 ) {\n\n return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\n }\n\n return 1.0;\n\n}\n\nvec3 F_Schlick( in vec3 specularColor, in float dotLH ) {\n\n\n float fresnel = exp2( ( -5.55437 * dotLH - 6.98316 ) * dotLH );\n\n return ( 1.0 - specularColor ) * fresnel + specularColor;\n\n}\n\nfloat G_BlinnPhong_Implicit( /* in float dotNL, in float dotNV */ ) {\n\n\n return 0.25;\n\n}\n\nfloat D_BlinnPhong( in float shininess, in float dotNH ) {\n\n\n return ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n\n}\n\nvec3 BRDF_BlinnPhong( in vec3 specularColor, in float shininess, in vec3 normal, in vec3 lightDir, in vec3 viewDir ) {\n\n vec3 halfDir = normalize( lightDir + viewDir );\n\n float dotNH = saturate( dot( normal, halfDir ) );\n float dotLH = saturate( dot( lightDir, halfDir ) );\n\n vec3 F = F_Schlick( specularColor, dotLH );\n\n float G = G_BlinnPhong_Implicit( /* dotNL, dotNV */ );\n\n float D = D_BlinnPhong( shininess, dotNH );\n\n return F * G * D;\n\n}\n\nvec3 inputToLinear( in vec3 a ) {\n\n #ifdef GAMMA_INPUT\n\n return pow( a, vec3( float( GAMMA_FACTOR ) ) );\n\n #else\n\n return a;\n\n #endif\n\n}\n\nvec3 linearToOutput( in vec3 a ) {\n\n #ifdef GAMMA_OUTPUT\n\n return pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );\n\n #else\n\n return a;\n\n #endif\n\n}\n",a.ShaderChunk.defaultnormal_vertex="#ifdef FLIP_SIDED\n\n objectNormal = -objectNormal;\n\n#endif\n\nvec3 transformedNormal = normalMatrix * objectNormal;\n",a.ShaderChunk.displacementmap_vertex="#ifdef USE_DISPLACEMENTMAP\n\n transformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n\n#endif\n",a.ShaderChunk.displacementmap_pars_vertex="#ifdef USE_DISPLACEMENTMAP\n\n uniform sampler2D displacementMap;\n uniform float displacementScale;\n uniform float displacementBias;\n\n#endif\n",a.ShaderChunk.emissivemap_fragment="#ifdef USE_EMISSIVEMAP\n\n vec4 emissiveColor = texture2D( emissiveMap, vUv );\n\n emissiveColor.rgb = inputToLinear( emissiveColor.rgb );\n\n totalEmissiveLight *= emissiveColor.rgb;\n\n#endif\n",a.ShaderChunk.emissivemap_pars_fragment="#ifdef USE_EMISSIVEMAP\n\n uniform sampler2D emissiveMap;\n\n#endif\n",a.ShaderChunk.envmap_fragment="#ifdef USE_ENVMAP\n\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\n vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n #ifdef ENVMAP_MODE_REFLECTION\n\n vec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\n #else\n\n vec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\n #endif\n\n #else\n\n vec3 reflectVec = vReflect;\n\n #endif\n\n #ifdef DOUBLE_SIDED\n float flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n #else\n float flipNormal = 1.0;\n #endif\n\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n #elif defined( ENVMAP_TYPE_EQUIREC )\n vec2 sampleUV;\n sampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n sampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n vec4 envColor = texture2D( envMap, sampleUV );\n\n #elif defined( ENVMAP_TYPE_SPHERE )\n vec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n vec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n #endif\n\n envColor.xyz = inputToLinear( envColor.xyz );\n\n #ifdef ENVMAP_BLENDING_MULTIPLY\n\n outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n #elif defined( ENVMAP_BLENDING_MIX )\n\n outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n #elif defined( ENVMAP_BLENDING_ADD )\n\n outgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n #endif\n\n#endif\n",a.ShaderChunk.envmap_pars_fragment="#ifdef USE_ENVMAP\n\n uniform float reflectivity;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n uniform float flipEnvMap;\n\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n uniform float refractionRatio;\n\n #else\n\n varying vec3 vReflect;\n\n #endif\n\n#endif\n",a.ShaderChunk.envmap_pars_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n varying vec3 vReflect;\n\n uniform float refractionRatio;\n\n#endif\n",a.ShaderChunk.envmap_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n vec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\n #ifdef ENVMAP_MODE_REFLECTION\n\n vReflect = reflect( cameraToVertex, worldNormal );\n\n #else\n\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n #endif\n\n#endif\n",a.ShaderChunk.fog_fragment="#ifdef USE_FOG\n\n #ifdef USE_LOGDEPTHBUF_EXT\n\n float depth = gl_FragDepthEXT / gl_FragCoord.w;\n\n #else\n\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n\n #endif\n\n #ifdef FOG_EXP2\n\n float fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\n #else\n\n float fogFactor = smoothstep( fogNear, fogFar, depth );\n\n #endif\n \n outgoingLight = mix( outgoingLight, fogColor, fogFactor );\n\n#endif",a.ShaderChunk.fog_pars_fragment="#ifdef USE_FOG\n\n uniform vec3 fogColor;\n\n #ifdef FOG_EXP2\n\n uniform float fogDensity;\n\n #else\n\n uniform float fogNear;\n uniform float fogFar;\n #endif\n\n#endif",a.ShaderChunk.hemilight_fragment="#if MAX_HEMI_LIGHTS > 0\n\n for ( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n vec3 lightDir = hemisphereLightDirection[ i ];\n\n float dotProduct = dot( normal, lightDir );\n\n float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\n vec3 lightColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n totalAmbientLight += lightColor;\n\n }\n\n#endif\n\n",a.ShaderChunk.lightmap_fragment="#ifdef USE_LIGHTMAP\n\n totalAmbientLight += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\n#endif\n",a.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n\n uniform sampler2D lightMap;\n uniform float lightMapIntensity;\n\n#endif",a.ShaderChunk.lights_lambert_pars_vertex="#if MAX_DIR_LIGHTS > 0\n\n uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n uniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n uniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n uniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n uniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n uniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n uniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n uniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n",a.ShaderChunk.lights_lambert_vertex="vLightFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\n vLightBack = vec3( 0.0 );\n\n#endif\n\nvec3 normal = normalize( transformedNormal );\n\n#if MAX_POINT_LIGHTS > 0\n\n for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n vec3 lightColor = pointLightColor[ i ];\n\n vec3 lVector = pointLightPosition[ i ] - mvPosition.xyz;\n vec3 lightDir = normalize( lVector );\n\n\n float attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n\n float dotProduct = dot( normal, lightDir );\n\n vLightFront += lightColor * attenuation * saturate( dotProduct );\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += lightColor * attenuation * saturate( - dotProduct );\n\n #endif\n\n }\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n for ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n vec3 lightColor = spotLightColor[ i ];\n\n vec3 lightPosition = spotLightPosition[ i ];\n vec3 lVector = lightPosition - mvPosition.xyz;\n vec3 lightDir = normalize( lVector );\n\n float spotEffect = dot( spotLightDirection[ i ], lightDir );\n\n if ( spotEffect > spotLightAngleCos[ i ] ) {\n\n spotEffect = saturate( pow( saturate( spotEffect ), spotLightExponent[ i ] ) );\n\n\n float attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n attenuation *= spotEffect;\n\n\n float dotProduct = dot( normal, lightDir );\n\n vLightFront += lightColor * attenuation * saturate( dotProduct );\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += lightColor * attenuation * saturate( - dotProduct );\n\n #endif\n\n }\n\n }\n\n#endif\n\n#if MAX_DIR_LIGHTS > 0\n\n for ( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n vec3 lightColor = directionalLightColor[ i ];\n\n vec3 lightDir = directionalLightDirection[ i ];\n\n\n float dotProduct = dot( normal, lightDir );\n\n vLightFront += lightColor * saturate( dotProduct );\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += lightColor * saturate( - dotProduct );\n\n #endif\n\n }\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n for ( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n vec3 lightDir = hemisphereLightDirection[ i ];\n\n\n float dotProduct = dot( normal, lightDir );\n\n float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\n vLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n #ifdef DOUBLE_SIDED\n\n float hemiDiffuseWeightBack = - 0.5 * dotProduct + 0.5;\n\n vLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );\n\n #endif\n\n }\n\n#endif\n",a.ShaderChunk.lights_phong_fragment="vec3 viewDir = normalize( vViewPosition );\n\nvec3 totalDiffuseLight = vec3( 0.0 );\nvec3 totalSpecularLight = vec3( 0.0 );\n\n#if MAX_POINT_LIGHTS > 0\n\n for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n vec3 lightColor = pointLightColor[ i ];\n\n vec3 lightPosition = pointLightPosition[ i ];\n vec3 lVector = lightPosition + vViewPosition.xyz;\n vec3 lightDir = normalize( lVector );\n\n\n float attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n\n float cosineTerm = saturate( dot( normal, lightDir ) );\n\n totalDiffuseLight += lightColor * attenuation * cosineTerm;\n\n\n vec3 brdf = BRDF_BlinnPhong( specular, shininess, normal, lightDir, viewDir );\n\n totalSpecularLight += brdf * specularStrength * lightColor * attenuation * cosineTerm;\n\n\n }\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n for ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n vec3 lightColor = spotLightColor[ i ];\n\n vec3 lightPosition = spotLightPosition[ i ];\n vec3 lVector = lightPosition + vViewPosition.xyz;\n vec3 lightDir = normalize( lVector );\n\n float spotEffect = dot( spotLightDirection[ i ], lightDir );\n\n if ( spotEffect > spotLightAngleCos[ i ] ) {\n\n spotEffect = saturate( pow( saturate( spotEffect ), spotLightExponent[ i ] ) );\n\n\n float attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n attenuation *= spotEffect;\n\n\n float cosineTerm = saturate( dot( normal, lightDir ) );\n\n totalDiffuseLight += lightColor * attenuation * cosineTerm;\n\n\n vec3 brdf = BRDF_BlinnPhong( specular, shininess, normal, lightDir, viewDir );\n\n totalSpecularLight += brdf * specularStrength * lightColor * attenuation * cosineTerm;\n\n }\n\n }\n\n#endif\n\n#if MAX_DIR_LIGHTS > 0\n\n for ( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n vec3 lightColor = directionalLightColor[ i ];\n\n vec3 lightDir = directionalLightDirection[ i ];\n\n\n float cosineTerm = saturate( dot( normal, lightDir ) );\n\n totalDiffuseLight += lightColor * cosineTerm;\n\n\n vec3 brdf = BRDF_BlinnPhong( specular, shininess, normal, lightDir, viewDir );\n\n totalSpecularLight += brdf * specularStrength * lightColor * cosineTerm;\n\n }\n\n#endif\n",a.ShaderChunk.lights_phong_pars_fragment="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n uniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\n uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n uniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n uniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n uniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n uniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n uniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n uniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0 || defined( USE_ENVMAP )\n\n varying vec3 vWorldPosition;\n\n#endif\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n varying vec3 vNormal;\n\n#endif\n",a.ShaderChunk.lights_phong_pars_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_ENVMAP )\n\n varying vec3 vWorldPosition;\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\n#endif\n",a.ShaderChunk.lights_phong_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_ENVMAP )\n\n vWorldPosition = worldPosition.xyz;\n\n#endif\n",a.ShaderChunk.linear_to_gamma_fragment="\n outgoingLight = linearToOutput( outgoingLight );\n",a.ShaderChunk.logdepthbuf_fragment="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\n gl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n\n#endif",a.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n\n uniform float logDepthBufFC;\n\n #ifdef USE_LOGDEPTHBUF_EXT\n\n varying float vFragDepth;\n\n #endif\n\n#endif\n",a.ShaderChunk.logdepthbuf_pars_vertex="#ifdef USE_LOGDEPTHBUF\n\n #ifdef USE_LOGDEPTHBUF_EXT\n\n varying float vFragDepth;\n\n #endif\n\n uniform float logDepthBufFC;\n\n#endif",a.ShaderChunk.logdepthbuf_vertex="#ifdef USE_LOGDEPTHBUF\n\n gl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\n #ifdef USE_LOGDEPTHBUF_EXT\n\n vFragDepth = 1.0 + gl_Position.w;\n\n#else\n\n gl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\n #endif\n\n#endif",a.ShaderChunk.map_fragment="#ifdef USE_MAP\n\n vec4 texelColor = texture2D( map, vUv );\n\n texelColor.xyz = inputToLinear( texelColor.xyz );\n\n diffuseColor *= texelColor;\n\n#endif\n",a.ShaderChunk.map_pars_fragment="#ifdef USE_MAP\n\n uniform sampler2D map;\n\n#endif",a.ShaderChunk.map_particle_fragment="#ifdef USE_MAP\n\n diffuseColor *= texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\n#endif\n",a.ShaderChunk.map_particle_pars_fragment="#ifdef USE_MAP\n\n uniform vec4 offsetRepeat;\n uniform sampler2D map;\n\n#endif\n",a.ShaderChunk.morphnormal_vertex="#ifdef USE_MORPHNORMALS\n\n objectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n objectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n objectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n objectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n\n#endif\n",a.ShaderChunk.morphtarget_pars_vertex="#ifdef USE_MORPHTARGETS\n\n #ifndef USE_MORPHNORMALS\n\n uniform float morphTargetInfluences[ 8 ];\n\n #else\n\n uniform float morphTargetInfluences[ 4 ];\n\n #endif\n\n#endif",a.ShaderChunk.morphtarget_vertex="#ifdef USE_MORPHTARGETS\n\n transformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n transformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n transformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n transformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\n #ifndef USE_MORPHNORMALS\n\n transformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n transformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n transformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n transformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\n #endif\n\n#endif\n",a.ShaderChunk.normal_phong_fragment="#ifndef FLAT_SHADED\n\n vec3 normal = normalize( vNormal );\n\n #ifdef DOUBLE_SIDED\n\n normal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\n #endif\n\n#else\n\n vec3 fdx = dFdx( vViewPosition );\n vec3 fdy = dFdy( vViewPosition );\n vec3 normal = normalize( cross( fdx, fdy ) );\n\n#endif\n\n#ifdef USE_NORMALMAP\n\n normal = perturbNormal2Arb( -vViewPosition, normal );\n\n#elif defined( USE_BUMPMAP )\n\n normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n\n",a.ShaderChunk.normalmap_pars_fragment="#ifdef USE_NORMALMAP\n\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n\n\n vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( vUv.st );\n vec2 st1 = dFdy( vUv.st );\n\n vec3 S = normalize( q0 * st1.t - q1 * st0.t );\n vec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n vec3 N = normalize( surf_norm );\n\n vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n mapN.xy = normalScale * mapN.xy;\n mat3 tsn = mat3( S, T, N );\n return normalize( tsn * mapN );\n\n }\n\n#endif\n",a.ShaderChunk.project_vertex="#ifdef USE_SKINNING\n\n vec4 mvPosition = modelViewMatrix * skinned;\n\n#else\n\n vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n\n#endif\n\ngl_Position = projectionMatrix * mvPosition;\n",a.ShaderChunk.shadowmap_fragment="#ifdef USE_SHADOWMAP\n\n for ( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n float texelSizeY = 1.0 / shadowMapSize[ i ].y;\n\n float shadow = 0.0;\n\n#if defined( POINT_LIGHT_SHADOWS )\n\n bool isPointLight = shadowDarkness[ i ] < 0.0;\n\n if ( isPointLight ) {\n\n float realShadowDarkness = abs( shadowDarkness[ i ] );\n\n vec3 lightToPosition = vShadowCoord[ i ].xyz;\n\n #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n vec3 bd3D = normalize( lightToPosition );\n float dp = length( lightToPosition );\n\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D, texelSizeY ) ), shadowBias[ i ], shadow );\n\n\n #if defined( SHADOWMAP_TYPE_PCF )\n const float Dr = 1.25;\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n const float Dr = 2.25;\n #endif\n\n float os = Dr * 2.0 * texelSizeY;\n\n const vec3 Gsd = vec3( - 1, 0, 1 );\n\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zzz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zxz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xxz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xzz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zzx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zxx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xxx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xzx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zzy * os, texelSizeY ) ), shadowBias[ i ], shadow );\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zxy * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xxy * os, texelSizeY ) ), shadowBias[ i ], shadow );\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xzy * os, texelSizeY ) ), shadowBias[ i ], shadow );\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zyz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xyz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zyx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xyx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.yzz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.yxz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.yxx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.yzx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\n shadow *= realShadowDarkness * ( 1.0 / 21.0 );\n\n #else \n vec3 bd3D = normalize( lightToPosition );\n float dp = length( lightToPosition );\n\n adjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D, texelSizeY ) ), shadowBias[ i ], shadow );\n\n shadow *= realShadowDarkness;\n\n #endif\n\n } else {\n\n#endif \n float texelSizeX = 1.0 / shadowMapSize[ i ].x;\n\n vec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\n\n\n bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n bool inFrustum = all( inFrustumVec );\n\n bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n bool frustumTest = all( frustumTestVec );\n\n if ( frustumTest ) {\n\n #if defined( SHADOWMAP_TYPE_PCF )\n\n\n /*\n for ( float y = -1.25; y <= 1.25; y += 1.25 )\n for ( float x = -1.25; x <= 1.25; x += 1.25 ) {\n vec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\n float fDepth = unpackDepth( rgbaDepth );\n if ( fDepth < shadowCoord.z )\n shadow += 1.0;\n }\n shadow /= 9.0;\n */\n\n shadowCoord.z += shadowBias[ i ];\n\n const float ShadowDelta = 1.0 / 9.0;\n\n float xPixelOffset = texelSizeX;\n float yPixelOffset = texelSizeY;\n\n float dx0 = - 1.25 * xPixelOffset;\n float dy0 = - 1.25 * yPixelOffset;\n float dx1 = 1.25 * xPixelOffset;\n float dy1 = 1.25 * yPixelOffset;\n\n float fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n if ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n shadow *= shadowDarkness[ i ];\n\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\n shadowCoord.z += shadowBias[ i ];\n\n float xPixelOffset = texelSizeX;\n float yPixelOffset = texelSizeY;\n\n float dx0 = - 1.0 * xPixelOffset;\n float dy0 = - 1.0 * yPixelOffset;\n float dx1 = 1.0 * xPixelOffset;\n float dy1 = 1.0 * yPixelOffset;\n\n mat3 shadowKernel;\n mat3 depthKernel;\n\n depthKernel[ 0 ][ 0 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n depthKernel[ 0 ][ 1 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n depthKernel[ 0 ][ 2 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n depthKernel[ 1 ][ 0 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n depthKernel[ 1 ][ 1 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n depthKernel[ 1 ][ 2 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n depthKernel[ 2 ][ 0 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n depthKernel[ 2 ][ 1 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n depthKernel[ 2 ][ 2 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\n vec3 shadowZ = vec3( shadowCoord.z );\n shadowKernel[ 0 ] = vec3( lessThan( depthKernel[ 0 ], shadowZ ) );\n shadowKernel[ 0 ] *= vec3( 0.25 );\n\n shadowKernel[ 1 ] = vec3( lessThan( depthKernel[ 1 ], shadowZ ) );\n shadowKernel[ 1 ] *= vec3( 0.25 );\n\n shadowKernel[ 2 ] = vec3( lessThan( depthKernel[ 2 ], shadowZ ) );\n shadowKernel[ 2 ] *= vec3( 0.25 );\n\n vec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[ i ].xy );\n\n shadowKernel[ 0 ] = mix( shadowKernel[ 1 ], shadowKernel[ 0 ], fractionalCoord.x );\n shadowKernel[ 1 ] = mix( shadowKernel[ 2 ], shadowKernel[ 1 ], fractionalCoord.x );\n\n vec4 shadowValues;\n shadowValues.x = mix( shadowKernel[ 0 ][ 1 ], shadowKernel[ 0 ][ 0 ], fractionalCoord.y );\n shadowValues.y = mix( shadowKernel[ 0 ][ 2 ], shadowKernel[ 0 ][ 1 ], fractionalCoord.y );\n shadowValues.z = mix( shadowKernel[ 1 ][ 1 ], shadowKernel[ 1 ][ 0 ], fractionalCoord.y );\n shadowValues.w = mix( shadowKernel[ 1 ][ 2 ], shadowKernel[ 1 ][ 1 ], fractionalCoord.y );\n\n shadow = dot( shadowValues, vec4( 1.0 ) ) * shadowDarkness[ i ];\n\n #else \n shadowCoord.z += shadowBias[ i ];\n\n vec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\n float fDepth = unpackDepth( rgbaDepth );\n\n if ( fDepth < shadowCoord.z )\n shadow = shadowDarkness[ i ];\n\n #endif\n\n }\n\n#ifdef SHADOWMAP_DEBUG\n\n if ( inFrustum ) {\n\n if ( i == 0 ) {\n\n outgoingLight *= vec3( 1.0, 0.5, 0.0 );\n\n } else if ( i == 1 ) {\n\n outgoingLight *= vec3( 0.0, 1.0, 0.8 );\n\n } else {\n\n outgoingLight *= vec3( 0.0, 0.5, 1.0 );\n\n }\n\n }\n\n#endif\n\n#if defined( POINT_LIGHT_SHADOWS )\n\n }\n\n#endif\n\n shadowMask = shadowMask * vec3( 1.0 - shadow );\n\n }\n\n#endif\n",
-a.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\n uniform sampler2D shadowMap[ MAX_SHADOWS ];\n uniform vec2 shadowMapSize[ MAX_SHADOWS ];\n\n uniform float shadowDarkness[ MAX_SHADOWS ];\n uniform float shadowBias[ MAX_SHADOWS ];\n\n varying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n float unpackDepth( const in vec4 rgba_depth ) {\n\n const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n float depth = dot( rgba_depth, bit_shift );\n return depth;\n\n }\n\n #if defined(POINT_LIGHT_SHADOWS)\n\n\n void adjustShadowValue1K( const float testDepth, const vec4 textureData, const float bias, inout float shadowValue ) {\n\n const vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n if ( testDepth >= dot( textureData, bitSh ) * 1000.0 + bias )\n shadowValue += 1.0;\n\n }\n\n\n vec2 cubeToUV( vec3 v, float texelSizeY ) {\n\n\n vec3 absV = abs( v );\n\n\n float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n absV *= scaleToCube;\n\n\n v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\n\n\n vec2 planar = v.xy;\n\n float almostATexel = 1.5 * texelSizeY;\n float almostOne = 1.0 - almostATexel;\n\n if ( absV.z >= almostOne ) {\n\n if ( v.z > 0.0 )\n planar.x = 4.0 - v.x;\n\n } else if ( absV.x >= almostOne ) {\n\n float signX = sign( v.x );\n planar.x = v.z * signX + 2.0 * signX;\n\n } else if ( absV.y >= almostOne ) {\n\n float signY = sign( v.y );\n planar.x = v.x + 2.0 * signY + 2.0;\n planar.y = v.z * signY - 2.0;\n\n }\n\n\n return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\n }\n\n #endif\n\n#endif\n",a.ShaderChunk.shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n\n uniform float shadowDarkness[ MAX_SHADOWS ];\n uniform mat4 shadowMatrix[ MAX_SHADOWS ];\n varying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n#endif",a.ShaderChunk.shadowmap_vertex="#ifdef USE_SHADOWMAP\n\n for ( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n vShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n\n }\n\n#endif",a.ShaderChunk.skinbase_vertex="#ifdef USE_SKINNING\n\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n\n#endif",a.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n\n #ifdef BONE_TEXTURE\n\n uniform sampler2D boneTexture;\n uniform int boneTextureWidth;\n uniform int boneTextureHeight;\n\n mat4 getBoneMatrix( const in float i ) {\n\n float j = i * 4.0;\n float x = mod( j, float( boneTextureWidth ) );\n float y = floor( j / float( boneTextureWidth ) );\n\n float dx = 1.0 / float( boneTextureWidth );\n float dy = 1.0 / float( boneTextureHeight );\n\n y = dy * ( y + 0.5 );\n\n vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n mat4 bone = mat4( v1, v2, v3, v4 );\n\n return bone;\n\n }\n\n #else\n\n uniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\n mat4 getBoneMatrix( const in float i ) {\n\n mat4 bone = boneGlobalMatrices[ int(i) ];\n return bone;\n\n }\n\n #endif\n\n#endif\n",a.ShaderChunk.skinning_vertex="#ifdef USE_SKINNING\n\n vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n skinned = bindMatrixInverse * skinned;\n\n#endif\n",a.ShaderChunk.skinnormal_vertex="#ifdef USE_SKINNING\n\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\n objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\n#endif\n",a.ShaderChunk.specularmap_fragment="float specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n vec4 texelSpecular = texture2D( specularMap, vUv );\n specularStrength = texelSpecular.r;\n\n#else\n\n specularStrength = 1.0;\n\n#endif",a.ShaderChunk.specularmap_pars_fragment="#ifdef USE_SPECULARMAP\n\n uniform sampler2D specularMap;\n\n#endif",a.ShaderChunk.uv2_pars_fragment="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n varying vec2 vUv2;\n\n#endif",a.ShaderChunk.uv2_pars_vertex="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n attribute vec2 uv2;\n varying vec2 vUv2;\n\n#endif",a.ShaderChunk.uv2_vertex="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n vUv2 = uv2;\n\n#endif",a.ShaderChunk.uv_pars_fragment="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP )\n\n varying vec2 vUv;\n\n#endif",a.ShaderChunk.uv_pars_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP )\n\n varying vec2 vUv;\n uniform vec4 offsetRepeat;\n\n#endif\n",a.ShaderChunk.uv_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP )\n\n vUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n\n#endif",a.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\n #ifdef USE_SKINNING\n\n vec4 worldPosition = modelMatrix * skinned;\n\n #else\n\n vec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\n #endif\n\n#endif\n",a.UniformsUtils={merge:function(e){for(var t={},r=0;r dashSize ) {"," discard;"," }"," vec3 outgoingLight = vec3( 0.0 );"," vec4 diffuseColor = vec4( diffuse, opacity );",a.ShaderChunk.logdepthbuf_fragment,a.ShaderChunk.color_fragment," outgoingLight = diffuseColor.rgb;",a.ShaderChunk.fog_fragment," gl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2e3},opacity:{type:"f",value:1}},vertexShader:[a.ShaderChunk.common,a.ShaderChunk.morphtarget_pars_vertex,a.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",a.ShaderChunk.begin_vertex,a.ShaderChunk.morphtarget_vertex,a.ShaderChunk.project_vertex,a.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float mNear;","uniform float mFar;","uniform float opacity;",a.ShaderChunk.common,a.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",a.ShaderChunk.logdepthbuf_fragment," #ifdef USE_LOGDEPTHBUF_EXT"," float depth = gl_FragDepthEXT / gl_FragCoord.w;"," #else"," float depth = gl_FragCoord.z / gl_FragCoord.w;"," #endif"," float color = 1.0 - smoothstep( mNear, mFar, depth );"," gl_FragColor = vec4( vec3( color ), opacity );","}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",a.ShaderChunk.common,a.ShaderChunk.morphtarget_pars_vertex,a.ShaderChunk.logdepthbuf_pars_vertex,"void main() {"," vNormal = normalize( normalMatrix * normal );",a.ShaderChunk.begin_vertex,a.ShaderChunk.morphtarget_vertex,a.ShaderChunk.project_vertex,a.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;","varying vec3 vNormal;",a.ShaderChunk.common,a.ShaderChunk.logdepthbuf_pars_fragment,"void main() {"," gl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",a.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",a.ShaderChunk.common,a.ShaderChunk.logdepthbuf_pars_vertex,"void main() {"," vWorldPosition = transformDirection( position, modelMatrix );"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",a.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","uniform float tFlip;","varying vec3 vWorldPosition;",a.ShaderChunk.common,a.ShaderChunk.logdepthbuf_pars_fragment,"void main() {"," gl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",a.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",a.ShaderChunk.common,a.ShaderChunk.logdepthbuf_pars_vertex,"void main() {"," vWorldPosition = transformDirection( position, modelMatrix );"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",a.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","uniform float tFlip;","varying vec3 vWorldPosition;",a.ShaderChunk.common,a.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","vec3 direction = normalize( vWorldPosition );","vec2 sampleUV;","sampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );","sampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","gl_FragColor = texture2D( tEquirect, sampleUV );",a.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[a.ShaderChunk.common,a.ShaderChunk.morphtarget_pars_vertex,a.ShaderChunk.skinning_pars_vertex,a.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",a.ShaderChunk.skinbase_vertex,a.ShaderChunk.begin_vertex,a.ShaderChunk.morphtarget_vertex,a.ShaderChunk.skinning_vertex,a.ShaderChunk.project_vertex,a.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[a.ShaderChunk.common,a.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {"," const vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );"," const vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );"," vec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );"," res -= res.xxyz * bit_mask;"," return res;","}","void main() {",a.ShaderChunk.logdepthbuf_fragment," #ifdef USE_LOGDEPTHBUF_EXT"," gl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );"," #else"," gl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );"," #endif","}"].join("\n")},distanceRGBA:{uniforms:{lightPos:{type:"v3",value:new a.Vector3(0,0,0)}},vertexShader:["varying vec4 vWorldPosition;",a.ShaderChunk.common,a.ShaderChunk.morphtarget_pars_vertex,a.ShaderChunk.skinning_pars_vertex,"void main() {",a.ShaderChunk.skinbase_vertex,a.ShaderChunk.begin_vertex,a.ShaderChunk.morphtarget_vertex,a.ShaderChunk.skinning_vertex,a.ShaderChunk.project_vertex,a.ShaderChunk.worldpos_vertex,"vWorldPosition = worldPosition;","}"].join("\n"),fragmentShader:["uniform vec3 lightPos;","varying vec4 vWorldPosition;",a.ShaderChunk.common,"vec4 pack1K ( float depth ) {"," depth /= 1000.0;"," const vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );"," const vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );"," vec4 res = fract( depth * bitSh );"," res -= res.xxyz * bitMsk;"," return res; ","}","float unpack1K ( vec4 color ) {"," const vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );"," return dot( color, bitSh ) * 1000.0;","}","void main () {"," gl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );","}"].join("\n")}},a.WebGLRenderer=function(e){function t(e,t,r,n){ae===!0&&(e*=n,t*=n,r*=n),$e.clearColor(e,t,r,n)}function r(){ze.init(),$e.viewport(Ee,Te,Ae,Ce),t(ce.r,ce.g,ce.b,ue)}function n(){be=null,Se=null,_e="",we=-1,Oe=!0,ze.reset()}function i(e){e.preventDefault(),n(),r(),He.clear()}function o(e){var t=e.target;t.removeEventListener("dispose",o),u(t),Be.textures--}function s(e){var t=e.target;t.removeEventListener("dispose",s),h(t),Be.textures--}function c(e){var t=e.target;t.removeEventListener("dispose",c),l(t)}function u(e){var t=He.get(e);if(e.image&&t.__image__webglTextureCube)$e.deleteTexture(t.__image__webglTextureCube);else{if(void 0===t.__webglInit)return;$e.deleteTexture(t.__webglTexture)}He["delete"](e)}function h(e){var t=He.get(e),r=He.get(e.texture);if(e&&void 0!==r.__webglTexture){if($e.deleteTexture(r.__webglTexture),e instanceof a.WebGLRenderTargetCube)for(var n=0;6>n;n++)$e.deleteFramebuffer(t.__webglFramebuffer[n]),$e.deleteRenderbuffer(t.__webglRenderbuffer[n]);else $e.deleteFramebuffer(t.__webglFramebuffer),$e.deleteRenderbuffer(t.__webglRenderbuffer);He["delete"](e.texture),He["delete"](e)}}function l(e){f(e),He["delete"](e)}function f(e){var t=He.get(e).program;e.program=void 0,void 0!==t&&Xe.releaseProgram(t)}function p(e,t,r,n){var i;if(r instanceof a.InstancedBufferGeometry&&(i=Ve.get("ANGLE_instanced_arrays"),null===i))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");void 0===n&&(n=0),ze.initAttributes();var o=r.attributes,s=t.getAttributes(),c=e.defaultAttributeValues;for(var u in s){var h=s[u];if(h>=0){var l=o[u];if(void 0!==l){var f=l.itemSize,p=We.getAttributeBuffer(l);if(l instanceof a.InterleavedBufferAttribute){var d=l.data,m=d.stride,g=l.offset;d instanceof a.InstancedInterleavedBuffer?(ze.enableAttributeAndDivisor(h,d.meshPerAttribute,i),void 0===r.maxInstancedCount&&(r.maxInstancedCount=d.meshPerAttribute*d.count)):ze.enableAttribute(h),$e.bindBuffer($e.ARRAY_BUFFER,p),$e.vertexAttribPointer(h,f,$e.FLOAT,!1,m*d.array.BYTES_PER_ELEMENT,(n*m+g)*d.array.BYTES_PER_ELEMENT)}else l instanceof a.InstancedBufferAttribute?(ze.enableAttributeAndDivisor(h,l.meshPerAttribute,i),void 0===r.maxInstancedCount&&(r.maxInstancedCount=l.meshPerAttribute*l.count)):ze.enableAttribute(h),$e.bindBuffer($e.ARRAY_BUFFER,p),$e.vertexAttribPointer(h,f,$e.FLOAT,!1,0,n*f*4)}else if(void 0!==c){var v=c[u];if(void 0!==v)switch(v.length){case 2:$e.vertexAttrib2fv(h,v);break;case 3:$e.vertexAttrib3fv(h,v);break;case 4:$e.vertexAttrib4fv(h,v);break;default:$e.vertexAttrib1fv(h,v)}}}}ze.disableUnusedAttributes()}function d(e,t){return t[0]-e[0]}function m(e,t){return e.object.renderOrder!==t.object.renderOrder?e.object.renderOrder-t.object.renderOrder: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 g(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 v(e,t,r,n,i){var o,a;r.transparent?(o=pe,a=++de):(o=le,a=++fe);var s=o[a];void 0!==s?(s.id=e.id,s.object=e,s.geometry=t,s.material=r,s.z=Re.z,s.group=i):(s={id:e.id,object:e,geometry:t,material:r,z:Re.z,group:i},o.push(s))}function y(e,t){if(e.visible!==!1){if(0!==(e.channels.mask&t.channels.mask))if(e instanceof a.Light)he.push(e);else if(e instanceof a.Sprite)ge.push(e);else if(e instanceof a.LensFlare)ve.push(e);else if(e instanceof a.ImmediateRenderObject)ye.sortObjects===!0&&(Re.setFromMatrixPosition(e.matrixWorld),Re.applyProjection(Pe)),v(e,null,e.material,Re.z,null);else if((e instanceof a.Mesh||e instanceof a.Line||e instanceof a.Points)&&(e instanceof a.SkinnedMesh&&e.skeleton.update(),e.frustumCulled===!1||Fe.intersectsObject(e)===!0)){var r=e.material;if(r.visible===!0){ye.sortObjects===!0&&(Re.setFromMatrixPosition(e.matrixWorld),Re.applyProjection(Pe));var n=We.update(e);if(r instanceof a.MeshFaceMaterial)for(var i=n.groups,o=r.materials,s=0,c=i.length;c>s;s++){var u=i[s],h=o[u.materialIndex];h.visible===!0&&v(e,n,h,Re.z,u)}else v(e,n,r,Re.z,null)}}for(var l=e.children,s=0,c=l.length;c>s;s++)y(l[s],t)}}function b(e,t,r,n,i){for(var o=0,s=e.length;s>o;o++){var c=e[o],u=c.object,h=c.geometry,l=void 0===i?c.material:i,f=c.group;if(u.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,u.matrixWorld),u.normalMatrix.getNormalMatrix(u.modelViewMatrix),u instanceof a.ImmediateRenderObject){w(l);var p=S(t,r,n,l,u);_e="",u.render(function(e){ye.renderBufferImmediate(e,p,l)})}else ye.renderBufferDirect(t,r,n,h,l,u,f)}}function x(e,t,r,n){var i=He.get(e),o=Xe.getParameters(e,t,r,n),s=Xe.getProgramCode(e,o),u=i.program,h=!0;if(void 0===u)e.addEventListener("dispose",c);else if(u.code!==s)f(e);else{if(void 0!==o.shaderID)return;h=!1}if(h){if(o.shaderID){var l=a.ShaderLib[o.shaderID];i.__webglShader={name:e.type,uniforms:a.UniformsUtils.clone(l.uniforms),vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}}else i.__webglShader={name:e.type,uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};e.__webglShader=i.__webglShader,u=Xe.acquireProgram(e,o,s),i.program=u,e.program=u}var p=u.getAttributes();if(e.morphTargets){e.numSupportedMorphTargets=0;for(var d=0;d=0&&e.numSupportedMorphTargets++}if(e.morphNormals)for(e.numSupportedMorphNormals=0,d=0;d=0&&e.numSupportedMorphNormals++;i.uniformsList=[];var m=i.program.getUniforms();for(var g in i.__webglShader.uniforms){var v=m[g];v&&i.uniformsList.push([i.__webglShader.uniforms[g],v])}}function w(e){_(e),e.transparent===!0?ze.setBlending(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha):ze.setBlending(a.NoBlending),ze.setDepthFunc(e.depthFunc),ze.setDepthTest(e.depthTest),ze.setDepthWrite(e.depthWrite),ze.setColorWrite(e.colorWrite),ze.setPolygonOffset(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits)}function _(e){e.side!==a.DoubleSide?ze.enable($e.CULL_FACE):ze.disable($e.CULL_FACE),ze.setFlipSided(e.side===a.BackSide)}function S(e,t,r,n,i){Me=0;var o=He.get(n);!n.needsUpdate&&o.program||(x(n,t,r,i),n.needsUpdate=!1);var s=!1,c=!1,u=!1,h=o.program,l=h.getUniforms(),f=o.__webglShader.uniforms;if(h.id!==be&&($e.useProgram(h.program),be=h.id,s=!0,c=!0,u=!0),n.id!==we&&(-1===we&&(u=!0),we=n.id,c=!0),(s||e!==Se)&&($e.uniformMatrix4fv(l.projectionMatrix,!1,e.projectionMatrix.elements),Ge.logarithmicDepthBuffer&&$e.uniform1f(l.logDepthBufFC,2/(Math.log(e.far+1)/Math.LN2)),e!==Se&&(Se=e),(n instanceof a.ShaderMaterial||n instanceof a.MeshPhongMaterial||n.envMap)&&void 0!==l.cameraPosition&&(Re.setFromMatrixPosition(e.matrixWorld),$e.uniform3f(l.cameraPosition,Re.x,Re.y,Re.z)),(n instanceof a.MeshPhongMaterial||n instanceof a.MeshLambertMaterial||n instanceof a.MeshBasicMaterial||n instanceof a.ShaderMaterial||n.skinning)&&void 0!==l.viewMatrix&&$e.uniformMatrix4fv(l.viewMatrix,!1,e.matrixWorldInverse.elements)),n.skinning)if(i.bindMatrix&&void 0!==l.bindMatrix&&$e.uniformMatrix4fv(l.bindMatrix,!1,i.bindMatrix.elements),
-i.bindMatrixInverse&&void 0!==l.bindMatrixInverse&&$e.uniformMatrix4fv(l.bindMatrixInverse,!1,i.bindMatrixInverse.elements),Ge.floatVertexTextures&&i.skeleton&&i.skeleton.useVertexTexture){if(void 0!==l.boneTexture){var p=D();$e.uniform1i(l.boneTexture,p),ye.setTexture(i.skeleton.boneTexture,p)}void 0!==l.boneTextureWidth&&$e.uniform1i(l.boneTextureWidth,i.skeleton.boneTextureWidth),void 0!==l.boneTextureHeight&&$e.uniform1i(l.boneTextureHeight,i.skeleton.boneTextureHeight)}else i.skeleton&&i.skeleton.boneMatrices&&void 0!==l.boneGlobalMatrices&&$e.uniformMatrix4fv(l.boneGlobalMatrices,!1,i.skeleton.boneMatrices);return c&&(r&&n.fog&&C(f,r),(n instanceof a.MeshPhongMaterial||n instanceof a.MeshLambertMaterial||n.lights)&&(Oe&&(u=!0,B(t,e),Oe=!1),u?(k(f,Ue),F(f,!0)):F(f,!1)),(n instanceof a.MeshBasicMaterial||n instanceof a.MeshLambertMaterial||n instanceof a.MeshPhongMaterial)&&M(f,n),n instanceof a.LineBasicMaterial?E(f,n):n instanceof a.LineDashedMaterial?(E(f,n),T(f,n)):n instanceof a.PointsMaterial?A(f,n):n instanceof a.MeshPhongMaterial?L(f,n):n instanceof a.MeshDepthMaterial?(f.mNear.value=e.near,f.mFar.value=e.far,f.opacity.value=n.opacity):n instanceof a.MeshNormalMaterial&&(f.opacity.value=n.opacity),i.receiveShadow&&!n._shadowPass&&P(f,t,e),O(o.uniformsList)),R(l,i),void 0!==l.modelMatrix&&$e.uniformMatrix4fv(l.modelMatrix,!1,i.matrixWorld.elements),h}function M(e,t){e.opacity.value=t.opacity,e.diffuse.value=t.color,t.emissive&&(e.emissive.value=t.emissive),e.map.value=t.map,e.specularMap.value=t.specularMap,e.alphaMap.value=t.alphaMap,t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity);var r;if(t.map?r=t.map:t.specularMap?r=t.specularMap:t.displacementMap?r=t.displacementMap:t.normalMap?r=t.normalMap:t.bumpMap?r=t.bumpMap:t.alphaMap?r=t.alphaMap:t.emissiveMap&&(r=t.emissiveMap),void 0!==r){r instanceof a.WebGLRenderTarget&&(r=r.texture);var n=r.offset,i=r.repeat;e.offsetRepeat.value.set(n.x,n.y,i.x,i.y)}e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap instanceof a.WebGLRenderTargetCube?1:-1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio}function E(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity}function T(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function A(e,t){if(e.psColor.value=t.color,e.opacity.value=t.opacity,e.size.value=t.size,e.scale.value=Q.height/2,e.map.value=t.map,null!==t.map){var r=t.map.offset,n=t.map.repeat;e.offsetRepeat.value.set(r.x,r.y,n.x,n.y)}}function C(e,t){e.fogColor.value=t.color,t instanceof a.Fog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t instanceof a.FogExp2&&(e.fogDensity.value=t.density)}function L(e,t){e.specular.value=t.specular,e.shininess.value=Math.max(t.shininess,1e-4),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),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 k(e,t){e.ambientLightColor.value=t.ambient,e.directionalLightColor.value=t.directional.colors,e.directionalLightDirection.value=t.directional.positions,e.pointLightColor.value=t.point.colors,e.pointLightPosition.value=t.point.positions,e.pointLightDistance.value=t.point.distances,e.pointLightDecay.value=t.point.decays,e.spotLightColor.value=t.spot.colors,e.spotLightPosition.value=t.spot.positions,e.spotLightDistance.value=t.spot.distances,e.spotLightDirection.value=t.spot.directions,e.spotLightAngleCos.value=t.spot.anglesCos,e.spotLightExponent.value=t.spot.exponents,e.spotLightDecay.value=t.spot.decays,e.hemisphereLightSkyColor.value=t.hemi.skyColors,e.hemisphereLightGroundColor.value=t.hemi.groundColors,e.hemisphereLightDirection.value=t.hemi.positions}function F(e,t){e.ambientLightColor.needsUpdate=t,e.directionalLightColor.needsUpdate=t,e.directionalLightDirection.needsUpdate=t,e.pointLightColor.needsUpdate=t,e.pointLightPosition.needsUpdate=t,e.pointLightDistance.needsUpdate=t,e.pointLightDecay.needsUpdate=t,e.spotLightColor.needsUpdate=t,e.spotLightPosition.needsUpdate=t,e.spotLightDistance.needsUpdate=t,e.spotLightDirection.needsUpdate=t,e.spotLightAngleCos.needsUpdate=t,e.spotLightExponent.needsUpdate=t,e.spotLightDecay.needsUpdate=t,e.hemisphereLightSkyColor.needsUpdate=t,e.hemisphereLightGroundColor.needsUpdate=t,e.hemisphereLightDirection.needsUpdate=t}function P(e,t,r){if(e.shadowMatrix)for(var n=0,i=0,o=t.length;o>i;i++){var s=t[i];if(s.castShadow===!0&&(s instanceof a.PointLight||s instanceof a.SpotLight||s instanceof a.DirectionalLight)){var c=s.shadow;s instanceof a.PointLight?(Re.setFromMatrixPosition(s.matrixWorld).negate(),c.matrix.identity().setPosition(Re),e.shadowDarkness.value[n]=-c.darkness):e.shadowDarkness.value[n]=c.darkness,e.shadowMatrix.value[n]=c.matrix,e.shadowMap.value[n]=c.map,e.shadowMapSize.value[n]=c.mapSize,e.shadowBias.value[n]=c.bias,n++}}}function R(e,t){$e.uniformMatrix4fv(e.modelViewMatrix,!1,t.modelViewMatrix.elements),e.normalMatrix&&$e.uniformMatrix3fv(e.normalMatrix,!1,t.normalMatrix.elements)}function D(){var e=Me;return e>=Ge.maxTextures&&console.warn("WebGLRenderer: trying to use "+e+" texture units while this GPU supports only "+Ge.maxTextures),Me+=1,e}function O(e){for(var t,r,n=0,i=e.length;i>n;n++){var o=e[n][0];if(o.needsUpdate!==!1){var s=o.type,c=o.value,u=e[n][1];switch(s){case"1i":$e.uniform1i(u,c);break;case"1f":$e.uniform1f(u,c);break;case"2f":$e.uniform2f(u,c[0],c[1]);break;case"3f":$e.uniform3f(u,c[0],c[1],c[2]);break;case"4f":$e.uniform4f(u,c[0],c[1],c[2],c[3]);break;case"1iv":$e.uniform1iv(u,c);break;case"3iv":$e.uniform3iv(u,c);break;case"1fv":$e.uniform1fv(u,c);break;case"2fv":$e.uniform2fv(u,c);break;case"3fv":$e.uniform3fv(u,c);break;case"4fv":$e.uniform4fv(u,c);break;case"Matrix3fv":$e.uniformMatrix3fv(u,!1,c);break;case"Matrix4fv":$e.uniformMatrix4fv(u,!1,c);break;case"i":$e.uniform1i(u,c);break;case"f":$e.uniform1f(u,c);break;case"v2":$e.uniform2f(u,c.x,c.y);break;case"v3":$e.uniform3f(u,c.x,c.y,c.z);break;case"v4":$e.uniform4f(u,c.x,c.y,c.z,c.w);break;case"c":$e.uniform3f(u,c.r,c.g,c.b);break;case"iv1":$e.uniform1iv(u,c);break;case"iv":$e.uniform3iv(u,c);break;case"fv1":$e.uniform1fv(u,c);break;case"fv":$e.uniform3fv(u,c);break;case"v2v":void 0===o._array&&(o._array=new Float32Array(2*c.length));for(var h=0,l=0,f=c.length;f>h;h++,l+=2)o._array[l+0]=c[h].x,o._array[l+1]=c[h].y;$e.uniform2fv(u,o._array);break;case"v3v":void 0===o._array&&(o._array=new Float32Array(3*c.length));for(var h=0,p=0,f=c.length;f>h;h++,p+=3)o._array[p+0]=c[h].x,o._array[p+1]=c[h].y,o._array[p+2]=c[h].z;$e.uniform3fv(u,o._array);break;case"v4v":void 0===o._array&&(o._array=new Float32Array(4*c.length));for(var h=0,d=0,f=c.length;f>h;h++,d+=4)o._array[d+0]=c[h].x,o._array[d+1]=c[h].y,o._array[d+2]=c[h].z,o._array[d+3]=c[h].w;$e.uniform4fv(u,o._array);break;case"m3":$e.uniformMatrix3fv(u,!1,c.elements);break;case"m3v":void 0===o._array&&(o._array=new Float32Array(9*c.length));for(var h=0,f=c.length;f>h;h++)c[h].flattenToArrayOffset(o._array,9*h);$e.uniformMatrix3fv(u,!1,o._array);break;case"m4":$e.uniformMatrix4fv(u,!1,c.elements);break;case"m4v":void 0===o._array&&(o._array=new Float32Array(16*c.length));for(var h=0,f=c.length;f>h;h++)c[h].flattenToArrayOffset(o._array,16*h);$e.uniformMatrix4fv(u,!1,o._array);break;case"t":if(t=c,r=D(),$e.uniform1i(u,r),!t)continue;t instanceof a.CubeTexture||Array.isArray(t.image)&&6===t.image.length?z(t,r):t instanceof a.WebGLRenderTargetCube?H(t.texture,r):t instanceof a.WebGLRenderTarget?ye.setTexture(t.texture,r):ye.setTexture(t,r);break;case"tv":void 0===o._array&&(o._array=[]);for(var h=0,f=o.value.length;f>h;h++)o._array[h]=D();$e.uniform1iv(u,o._array);for(var h=0,f=o.value.length;f>h;h++)t=o.value[h],r=o._array[h],t&&(t instanceof a.CubeTexture||t.image instanceof Array&&6===t.image.length?z(t,r):t instanceof a.WebGLRenderTarget?ye.setTexture(t.texture,r):t instanceof a.WebGLRenderTargetCube?H(t.texture,r):ye.setTexture(t,r));break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+s)}}}}function U(e,t,r,n){e[t+0]=r.r*n,e[t+1]=r.g*n,e[t+2]=r.b*n}function B(e,t){var r,n,i,o,s,c,u,h,l=0,f=0,p=0,d=Ue,m=t.matrixWorldInverse,g=d.directional.colors,v=d.directional.positions,y=d.point.colors,b=d.point.positions,x=d.point.distances,w=d.point.decays,_=d.spot.colors,S=d.spot.positions,M=d.spot.distances,E=d.spot.directions,T=d.spot.anglesCos,A=d.spot.exponents,C=d.spot.decays,L=d.hemi.skyColors,k=d.hemi.groundColors,F=d.hemi.positions,P=0,R=0,D=0,O=0,B=0,j=0,$=0,N=0,I=0,V=0,G=0,z=0;for(r=0,n=e.length;n>r;r++)if(i=e[r],o=i.color,u=i.intensity,h=i.distance,i instanceof a.AmbientLight){if(!i.visible)continue;l+=o.r,f+=o.g,p+=o.b}else if(i instanceof a.DirectionalLight){if(B+=1,!i.visible)continue;De.setFromMatrixPosition(i.matrixWorld),Re.setFromMatrixPosition(i.target.matrixWorld),De.sub(Re),De.transformDirection(m),I=3*P,v[I+0]=De.x,v[I+1]=De.y,v[I+2]=De.z,U(g,I,o,u),P+=1}else if(i instanceof a.PointLight){if(j+=1,!i.visible)continue;V=3*R,U(y,V,o,u),Re.setFromMatrixPosition(i.matrixWorld),Re.applyMatrix4(m),b[V+0]=Re.x,b[V+1]=Re.y,b[V+2]=Re.z,x[R]=h,w[R]=0===i.distance?0:i.decay,R+=1}else if(i instanceof a.SpotLight){if($+=1,!i.visible)continue;G=3*D,U(_,G,o,u),De.setFromMatrixPosition(i.matrixWorld),Re.copy(De).applyMatrix4(m),S[G+0]=Re.x,S[G+1]=Re.y,S[G+2]=Re.z,M[D]=h,Re.setFromMatrixPosition(i.target.matrixWorld),De.sub(Re),De.transformDirection(m),E[G+0]=De.x,E[G+1]=De.y,E[G+2]=De.z,T[D]=Math.cos(i.angle),A[D]=i.exponent,C[D]=0===i.distance?0:i.decay,D+=1}else if(i instanceof a.HemisphereLight){if(N+=1,!i.visible)continue;De.setFromMatrixPosition(i.matrixWorld),De.transformDirection(m),z=3*O,F[z+0]=De.x,F[z+1]=De.y,F[z+2]=De.z,s=i.color,c=i.groundColor,U(L,z,s,u),U(k,z,c,u),O+=1}for(r=3*P,n=Math.max(g.length,3*B);n>r;r++)g[r]=0;for(r=3*R,n=Math.max(y.length,3*j);n>r;r++)y[r]=0;for(r=3*D,n=Math.max(_.length,3*$);n>r;r++)_[r]=0;for(r=3*O,n=Math.max(L.length,3*N);n>r;r++)L[r]=0;for(r=3*O,n=Math.max(k.length,3*N);n>r;r++)k[r]=0;d.directional.length=P,d.point.length=R,d.spot.length=D,d.hemi.length=O,d.ambient[0]=l,d.ambient[1]=f,d.ambient[2]=p}function j(e,t,r){var n;if(r?($e.texParameteri(e,$e.TEXTURE_WRAP_S,Y(t.wrapS)),$e.texParameteri(e,$e.TEXTURE_WRAP_T,Y(t.wrapT)),$e.texParameteri(e,$e.TEXTURE_MAG_FILTER,Y(t.magFilter)),$e.texParameteri(e,$e.TEXTURE_MIN_FILTER,Y(t.minFilter))):($e.texParameteri(e,$e.TEXTURE_WRAP_S,$e.CLAMP_TO_EDGE),$e.texParameteri(e,$e.TEXTURE_WRAP_T,$e.CLAMP_TO_EDGE),t.wrapS===a.ClampToEdgeWrapping&&t.wrapT===a.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",t),$e.texParameteri(e,$e.TEXTURE_MAG_FILTER,K(t.magFilter)),$e.texParameteri(e,$e.TEXTURE_MIN_FILTER,K(t.minFilter)),t.minFilter!==a.NearestFilter&&t.minFilter!==a.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",t)),n=Ve.get("EXT_texture_filter_anisotropic")){if(t.type===a.FloatType&&null===Ve.get("OES_texture_float_linear"))return;if(t.type===a.HalfFloatType&&null===Ve.get("OES_texture_half_float_linear"))return;(t.anisotropy>1||He.get(t).__currentAnisotropy)&&($e.texParameterf(e,n.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,ye.getMaxAnisotropy())),He.get(t).__currentAnisotropy=t.anisotropy)}}function $(e,t,r){void 0===e.__webglInit&&(e.__webglInit=!0,t.addEventListener("dispose",o),e.__webglTexture=$e.createTexture(),Be.textures++),ze.activeTexture($e.TEXTURE0+r),ze.bindTexture($e.TEXTURE_2D,e.__webglTexture),$e.pixelStorei($e.UNPACK_FLIP_Y_WEBGL,t.flipY),$e.pixelStorei($e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),$e.pixelStorei($e.UNPACK_ALIGNMENT,t.unpackAlignment),t.image=N(t.image,Ge.maxTextureSize),V(t)&&I(t.image)===!1&&(t.image=G(t.image));var n=t.image,i=I(n),s=Y(t.format),c=Y(t.type);j($e.TEXTURE_2D,t,i);var u,h=t.mipmaps;if(t instanceof a.DataTexture)if(h.length>0&&i){for(var l=0,f=h.length;f>l;l++)u=h[l],ze.texImage2D($e.TEXTURE_2D,l,s,u.width,u.height,0,s,c,u.data);t.generateMipmaps=!1}else ze.texImage2D($e.TEXTURE_2D,0,s,n.width,n.height,0,s,c,n.data);else if(t instanceof a.CompressedTexture)for(var l=0,f=h.length;f>l;l++)u=h[l],t.format!==a.RGBAFormat&&t.format!==a.RGBFormat?ze.getCompressedTextureFormats().indexOf(s)>-1?ze.compressedTexImage2D($e.TEXTURE_2D,l,s,u.width,u.height,0,u.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ze.texImage2D($e.TEXTURE_2D,l,s,u.width,u.height,0,s,c,u.data);else if(h.length>0&&i){for(var l=0,f=h.length;f>l;l++)u=h[l],ze.texImage2D($e.TEXTURE_2D,l,s,s,c,u);t.generateMipmaps=!1}else ze.texImage2D($e.TEXTURE_2D,0,s,s,c,t.image);t.generateMipmaps&&i&&$e.generateMipmap($e.TEXTURE_2D),e.__version=t.version,t.onUpdate&&t.onUpdate(t)}function N(e,t){if(e.width>t||e.height>t){var r=t/Math.max(e.width,e.height),n=document.createElement("canvas");n.width=Math.floor(e.width*r),n.height=Math.floor(e.height*r);var i=n.getContext("2d");return i.drawImage(e,0,0,e.width,e.height,0,0,n.width,n.height),console.warn("THREE.WebGLRenderer: image is too big ("+e.width+"x"+e.height+"). Resized to "+n.width+"x"+n.height,e),n}return e}function I(e){return a.Math.isPowerOfTwo(e.width)&&a.Math.isPowerOfTwo(e.height)}function V(e){return e.wrapS!==a.ClampToEdgeWrapping||e.wrapT!==a.ClampToEdgeWrapping?!0:e.minFilter!==a.NearestFilter&&e.minFilter!==a.LinearFilter}function G(e){if(e instanceof HTMLImageElement||e instanceof HTMLCanvasElement){var t=document.createElement("canvas");t.width=a.Math.nearestPowerOfTwo(e.width),t.height=a.Math.nearestPowerOfTwo(e.height);var r=t.getContext("2d");return r.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 z(e,t){var r=He.get(e);if(6===e.image.length)if(e.version>0&&r.__version!==e.version){r.__image__webglTextureCube||(e.addEventListener("dispose",o),r.__image__webglTextureCube=$e.createTexture(),Be.textures++),ze.activeTexture($e.TEXTURE0+t),ze.bindTexture($e.TEXTURE_CUBE_MAP,r.__image__webglTextureCube),$e.pixelStorei($e.UNPACK_FLIP_Y_WEBGL,e.flipY);for(var n=e instanceof a.CompressedTexture,i=e.image[0]instanceof a.DataTexture,s=[],c=0;6>c;c++)!ye.autoScaleCubemaps||n||i?s[c]=i?e.image[c].image:e.image[c]:s[c]=N(e.image[c],Ge.maxCubemapSize);var u=s[0],h=I(u),l=Y(e.format),f=Y(e.type);j($e.TEXTURE_CUBE_MAP,e,h);for(var c=0;6>c;c++)if(n)for(var p,d=s[c].mipmaps,m=0,g=d.length;g>m;m++)p=d[m],e.format!==a.RGBAFormat&&e.format!==a.RGBFormat?ze.getCompressedTextureFormats().indexOf(l)>-1?ze.compressedTexImage2D($e.TEXTURE_CUBE_MAP_POSITIVE_X+c,m,l,p.width,p.height,0,p.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):ze.texImage2D($e.TEXTURE_CUBE_MAP_POSITIVE_X+c,m,l,p.width,p.height,0,l,f,p.data);else i?ze.texImage2D($e.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,l,s[c].width,s[c].height,0,l,f,s[c].data):ze.texImage2D($e.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,l,l,f,s[c]);e.generateMipmaps&&h&&$e.generateMipmap($e.TEXTURE_CUBE_MAP),r.__version=e.version,e.onUpdate&&e.onUpdate(e)}else ze.activeTexture($e.TEXTURE0+t),ze.bindTexture($e.TEXTURE_CUBE_MAP,r.__image__webglTextureCube)}function H(e,t){ze.activeTexture($e.TEXTURE0+t),ze.bindTexture($e.TEXTURE_CUBE_MAP,He.get(e).__webglTexture)}function W(e,t,r){$e.bindFramebuffer($e.FRAMEBUFFER,e),$e.framebufferTexture2D($e.FRAMEBUFFER,$e.COLOR_ATTACHMENT0,r,He.get(t.texture).__webglTexture,0)}function X(e,t){$e.bindRenderbuffer($e.RENDERBUFFER,e),t.depthBuffer&&!t.stencilBuffer?($e.renderbufferStorage($e.RENDERBUFFER,$e.DEPTH_COMPONENT16,t.width,t.height),$e.framebufferRenderbuffer($e.FRAMEBUFFER,$e.DEPTH_ATTACHMENT,$e.RENDERBUFFER,e)):t.depthBuffer&&t.stencilBuffer?($e.renderbufferStorage($e.RENDERBUFFER,$e.DEPTH_STENCIL,t.width,t.height),$e.framebufferRenderbuffer($e.FRAMEBUFFER,$e.DEPTH_STENCIL_ATTACHMENT,$e.RENDERBUFFER,e)):$e.renderbufferStorage($e.RENDERBUFFER,$e.RGBA4,t.width,t.height)}function q(e){var t=e instanceof a.WebGLRenderTargetCube?$e.TEXTURE_CUBE_MAP:$e.TEXTURE_2D,r=He.get(e.texture).__webglTexture;ze.bindTexture(t,r),$e.generateMipmap(t),ze.bindTexture(t,null)}function K(e){return e===a.NearestFilter||e===a.NearestMipMapNearestFilter||e===a.NearestMipMapLinearFilter?$e.NEAREST:$e.LINEAR}function Y(e){var t;if(e===a.RepeatWrapping)return $e.REPEAT;if(e===a.ClampToEdgeWrapping)return $e.CLAMP_TO_EDGE;if(e===a.MirroredRepeatWrapping)return $e.MIRRORED_REPEAT;if(e===a.NearestFilter)return $e.NEAREST;if(e===a.NearestMipMapNearestFilter)return $e.NEAREST_MIPMAP_NEAREST;if(e===a.NearestMipMapLinearFilter)return $e.NEAREST_MIPMAP_LINEAR;if(e===a.LinearFilter)return $e.LINEAR;if(e===a.LinearMipMapNearestFilter)return $e.LINEAR_MIPMAP_NEAREST;if(e===a.LinearMipMapLinearFilter)return $e.LINEAR_MIPMAP_LINEAR;if(e===a.UnsignedByteType)return $e.UNSIGNED_BYTE;if(e===a.UnsignedShort4444Type)return $e.UNSIGNED_SHORT_4_4_4_4;if(e===a.UnsignedShort5551Type)return $e.UNSIGNED_SHORT_5_5_5_1;if(e===a.UnsignedShort565Type)return $e.UNSIGNED_SHORT_5_6_5;if(e===a.ByteType)return $e.BYTE;if(e===a.ShortType)return $e.SHORT;if(e===a.UnsignedShortType)return $e.UNSIGNED_SHORT;if(e===a.IntType)return $e.INT;if(e===a.UnsignedIntType)return $e.UNSIGNED_INT;if(e===a.FloatType)return $e.FLOAT;if(t=Ve.get("OES_texture_half_float"),null!==t&&e===a.HalfFloatType)return t.HALF_FLOAT_OES;if(e===a.AlphaFormat)return $e.ALPHA;if(e===a.RGBFormat)return $e.RGB;if(e===a.RGBAFormat)return $e.RGBA;if(e===a.LuminanceFormat)return $e.LUMINANCE;if(e===a.LuminanceAlphaFormat)return $e.LUMINANCE_ALPHA;if(e===a.AddEquation)return $e.FUNC_ADD;if(e===a.SubtractEquation)return $e.FUNC_SUBTRACT;if(e===a.ReverseSubtractEquation)return $e.FUNC_REVERSE_SUBTRACT;if(e===a.ZeroFactor)return $e.ZERO;if(e===a.OneFactor)return $e.ONE;if(e===a.SrcColorFactor)return $e.SRC_COLOR;if(e===a.OneMinusSrcColorFactor)return $e.ONE_MINUS_SRC_COLOR;if(e===a.SrcAlphaFactor)return $e.SRC_ALPHA;if(e===a.OneMinusSrcAlphaFactor)return $e.ONE_MINUS_SRC_ALPHA;if(e===a.DstAlphaFactor)return $e.DST_ALPHA;if(e===a.OneMinusDstAlphaFactor)return $e.ONE_MINUS_DST_ALPHA;if(e===a.DstColorFactor)return $e.DST_COLOR;if(e===a.OneMinusDstColorFactor)return $e.ONE_MINUS_DST_COLOR;if(e===a.SrcAlphaSaturateFactor)return $e.SRC_ALPHA_SATURATE;if(t=Ve.get("WEBGL_compressed_texture_s3tc"),null!==t){if(e===a.RGB_S3TC_DXT1_Format)return t.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===a.RGBA_S3TC_DXT1_Format)return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===a.RGBA_S3TC_DXT3_Format)return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===a.RGBA_S3TC_DXT5_Format)return t.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t=Ve.get("WEBGL_compressed_texture_pvrtc"),null!==t){if(e===a.RGB_PVRTC_4BPPV1_Format)return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===a.RGB_PVRTC_2BPPV1_Format)return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===a.RGBA_PVRTC_4BPPV1_Format)return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===a.RGBA_PVRTC_2BPPV1_Format)return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t=Ve.get("EXT_blend_minmax"),null!==t){if(e===a.MinEquation)return t.MIN_EXT;if(e===a.MaxEquation)return t.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",a.REVISION),e=e||{};var Q=void 0!==e.canvas?e.canvas:document.createElement("canvas"),Z=void 0!==e.context?e.context:null,J=Q.width,ee=Q.height,te=1,re=void 0!==e.alpha?e.alpha:!1,ne=void 0!==e.depth?e.depth:!0,ie=void 0!==e.stencil?e.stencil:!0,oe=void 0!==e.antialias?e.antialias:!1,ae=void 0!==e.premultipliedAlpha?e.premultipliedAlpha:!0,se=void 0!==e.preserveDrawingBuffer?e.preserveDrawingBuffer:!1,ce=new a.Color(0),ue=0,he=[],le=[],fe=-1,pe=[],de=-1,me=new Float32Array(8),ge=[],ve=[];this.domElement=Q,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.maxMorphTargets=8,this.maxMorphNormals=4,this.autoScaleCubemaps=!0;var ye=this,be=null,xe=null,we=-1,_e="",Se=null,Me=0,Ee=0,Te=0,Ae=Q.width,Ce=Q.height,Le=0,ke=0,Fe=new a.Frustum,Pe=new a.Matrix4,Re=new a.Vector3,De=new a.Vector3,Oe=!0,Ue={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},Be={geometries:0,textures:0},je={calls:0,vertices:0,faces:0,points:0};this.info={render:je,memory:Be,programs:null};var $e;try{var Ne={alpha:re,depth:ne,stencil:ie,antialias:oe,premultipliedAlpha:ae,preserveDrawingBuffer:se};if($e=Z||Q.getContext("webgl",Ne)||Q.getContext("experimental-webgl",Ne),null===$e)throw null!==Q.getContext("webgl")?"Error creating WebGL context with your selected attributes.":"Error creating WebGL context.";Q.addEventListener("webglcontextlost",i,!1)}catch(Ie){console.error("THREE.WebGLRenderer: "+Ie)}var Ve=new a.WebGLExtensions($e);Ve.get("OES_texture_float"),Ve.get("OES_texture_float_linear"),Ve.get("OES_texture_half_float"),Ve.get("OES_texture_half_float_linear"),Ve.get("OES_standard_derivatives"),Ve.get("ANGLE_instanced_arrays"),Ve.get("OES_element_index_uint")&&(a.BufferGeometry.MaxIndex=4294967296);var Ge=new a.WebGLCapabilities($e,Ve,e),ze=new a.WebGLState($e,Ve,Y),He=new a.WebGLProperties,We=new a.WebGLObjects($e,He,this.info),Xe=new a.WebGLPrograms(this,Ge);this.info.programs=Xe.programs;var qe=new a.WebGLBufferRenderer($e,Ve,je),Ke=new a.WebGLIndexedBufferRenderer($e,Ve,je);r(),this.context=$e,this.capabilities=Ge,this.extensions=Ve,this.state=ze;var Ye=new a.WebGLShadowMap(this,he,We);this.shadowMap=Ye;var Qe=new a.SpritePlugin(this,ge),Ze=new a.LensFlarePlugin(this,ve);this.getContext=function(){return $e},this.getContextAttributes=function(){return $e.getContextAttributes()},this.forceContextLoss=function(){Ve.get("WEBGL_lose_context").loseContext()},this.getMaxAnisotropy=function(){var e;return function(){if(void 0!==e)return e;var t=Ve.get("EXT_texture_filter_anisotropic");return e=null!==t?$e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}(),this.getPrecision=function(){return Ge.precision},this.getPixelRatio=function(){return te},this.setPixelRatio=function(e){void 0!==e&&(te=e)},this.getSize=function(){return{width:J,height:ee}},this.setSize=function(e,t,r){J=e,ee=t,Q.width=e*te,Q.height=t*te,r!==!1&&(Q.style.width=e+"px",Q.style.height=t+"px"),this.setViewport(0,0,e,t)},this.setViewport=function(e,t,r,n){Ee=e*te,Te=t*te,Ae=r*te,Ce=n*te,$e.viewport(Ee,Te,Ae,Ce)},this.getViewport=function(e){e.x=Ee/te,e.y=Te/te,e.z=Ae/te,e.w=Ce/te},this.setScissor=function(e,t,r,n){$e.scissor(e*te,t*te,r*te,n*te)},this.enableScissorTest=function(e){ze.setScissorTest(e)},this.getClearColor=function(){return ce},this.setClearColor=function(e,r){ce.set(e),ue=void 0!==r?r:1,t(ce.r,ce.g,ce.b,ue)},this.getClearAlpha=function(){return ue},this.setClearAlpha=function(e){ue=e,t(ce.r,ce.g,ce.b,ue)},this.clear=function(e,t,r){var n=0;(void 0===e||e)&&(n|=$e.COLOR_BUFFER_BIT),(void 0===t||t)&&(n|=$e.DEPTH_BUFFER_BIT),(void 0===r||r)&&(n|=$e.STENCIL_BUFFER_BIT),$e.clear(n)},this.clearColor=function(){$e.clear($e.COLOR_BUFFER_BIT)},this.clearDepth=function(){$e.clear($e.DEPTH_BUFFER_BIT)},this.clearStencil=function(){$e.clear($e.STENCIL_BUFFER_BIT)},this.clearTarget=function(e,t,r,n){this.setRenderTarget(e),this.clear(t,r,n)},this.resetGLState=n,this.dispose=function(){Q.removeEventListener("webglcontextlost",i,!1)},this.renderBufferImmediate=function(e,t,r){ze.initAttributes();var n=He.get(e);e.hasPositions&&!n.position&&(n.position=$e.createBuffer()),e.hasNormals&&!n.normal&&(n.normal=$e.createBuffer()),e.hasUvs&&!n.uv&&(n.uv=$e.createBuffer()),e.hasColors&&!n.color&&(n.color=$e.createBuffer());var i=t.getAttributes();if(e.hasPositions&&($e.bindBuffer($e.ARRAY_BUFFER,n.position),$e.bufferData($e.ARRAY_BUFFER,e.positionArray,$e.DYNAMIC_DRAW),ze.enableAttribute(i.position),$e.vertexAttribPointer(i.position,3,$e.FLOAT,!1,0,0)),e.hasNormals){if($e.bindBuffer($e.ARRAY_BUFFER,n.normal),"MeshPhongMaterial"!==r.type&&r.shading===a.FlatShading)for(var o=0,s=3*e.count;s>o;o+=9){var c=e.normalArray,u=(c[o+0]+c[o+3]+c[o+6])/3,h=(c[o+1]+c[o+4]+c[o+7])/3,l=(c[o+2]+c[o+5]+c[o+8])/3;c[o+0]=u,c[o+1]=h,c[o+2]=l,c[o+3]=u,c[o+4]=h,c[o+5]=l,c[o+6]=u,c[o+7]=h,c[o+8]=l}$e.bufferData($e.ARRAY_BUFFER,e.normalArray,$e.DYNAMIC_DRAW),ze.enableAttribute(i.normal),$e.vertexAttribPointer(i.normal,3,$e.FLOAT,!1,0,0)}e.hasUvs&&r.map&&($e.bindBuffer($e.ARRAY_BUFFER,n.uv),$e.bufferData($e.ARRAY_BUFFER,e.uvArray,$e.DYNAMIC_DRAW),ze.enableAttribute(i.uv),$e.vertexAttribPointer(i.uv,2,$e.FLOAT,!1,0,0)),e.hasColors&&r.vertexColors!==a.NoColors&&($e.bindBuffer($e.ARRAY_BUFFER,n.color),$e.bufferData($e.ARRAY_BUFFER,e.colorArray,$e.DYNAMIC_DRAW),ze.enableAttribute(i.color),$e.vertexAttribPointer(i.color,3,$e.FLOAT,!1,0,0)),ze.disableUnusedAttributes(),$e.drawArrays($e.TRIANGLES,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,r,n,i,o,s){w(i);var c=S(e,t,r,i,o),u=!1,h=n.id+"_"+c.id+"_"+i.wireframe;h!==_e&&(_e=h,u=!0);var l=o.morphTargetInfluences;if(void 0!==l){for(var f=[],m=0,g=l.length;g>m;m++){var v=l[m];f.push([v,m])}f.sort(d),f.length>8&&(f.length=8);for(var y=n.morphAttributes,m=0,g=f.length;g>m;m++){var v=f[m];if(me[m]=v[0],0!==v[0]){var b=v[1];i.morphTargets===!0&&y.position&&n.addAttribute("morphTarget"+m,y.position[b]),i.morphNormals===!0&&y.normal&&n.addAttribute("morphNormal"+m,y.normal[b])}else i.morphTargets===!0&&n.removeAttribute("morphTarget"+m),i.morphNormals===!0&&n.removeAttribute("morphNormal"+m)}var x=c.getUniforms();null!==x.morphTargetInfluences&&$e.uniform1fv(x.morphTargetInfluences,me),u=!0}var b=n.index,_=n.attributes.position;i.wireframe===!0&&(b=We.getWireframeAttribute(n));var M;null!==b?(M=Ke,M.setIndex(b)):M=qe,u&&(p(i,c,n),null!==b&&$e.bindBuffer($e.ELEMENT_ARRAY_BUFFER,We.getAttributeBuffer(b)));var E=0,T=1/0;null!==b?T=b.count:void 0!==_&&(T=_.count);var A=n.drawRange.start,C=n.drawRange.count,L=null!==s?s.start:0,k=null!==s?s.count:1/0,F=Math.max(E,A,L),P=Math.min(E+T,A+C,L+k)-1,R=Math.max(0,P-F+1);if(o instanceof a.Mesh)i.wireframe===!0?(ze.setLineWidth(i.wireframeLinewidth*te),M.setMode($e.LINES)):M.setMode($e.TRIANGLES),n instanceof a.InstancedBufferGeometry&&n.maxInstancedCount>0?M.renderInstances(n):M.render(F,R);else if(o instanceof a.Line){var D=i.linewidth;void 0===D&&(D=1),ze.setLineWidth(D*te),o instanceof a.LineSegments?M.setMode($e.LINES):M.setMode($e.LINE_STRIP),M.render(F,R)}else o instanceof a.Points&&(M.setMode($e.POINTS),M.render(F,R))},this.render=function(e,t,r,n){if(t instanceof a.Camera==!1)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");var i=e.fog;if(_e="",we=-1,Se=null,Oe=!0,e.autoUpdate===!0&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),t.matrixWorldInverse.getInverse(t.matrixWorld),Pe.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),Fe.setFromMatrix(Pe),he.length=0,fe=-1,de=-1,ge.length=0,ve.length=0,y(e,t),le.length=fe+1,pe.length=de+1,ye.sortObjects===!0&&(le.sort(m),pe.sort(g)),Ye.render(e),je.calls=0,je.vertices=0,je.faces=0,je.points=0,this.setRenderTarget(r),(this.autoClear||n)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),e.overrideMaterial){var o=e.overrideMaterial;b(le,t,he,i,o),b(pe,t,he,i,o)}else ze.setBlending(a.NoBlending),b(le,t,he,i),b(pe,t,he,i);if(Qe.render(e,t),Ze.render(e,t,Le,ke),r){var s=r.texture,c=I(r);s.generateMipmaps&&c&&s.minFilter!==a.NearestFilter&&s.minFilter!==a.LinearFilter&&q(r)}ze.setDepthTest(!0),ze.setDepthWrite(!0),ze.setColorWrite(!0)},this.setFaceCulling=function(e,t){e===a.CullFaceNone?ze.disable($e.CULL_FACE):(t===a.FrontFaceDirectionCW?$e.frontFace($e.CW):$e.frontFace($e.CCW),e===a.CullFaceBack?$e.cullFace($e.BACK):e===a.CullFaceFront?$e.cullFace($e.FRONT):$e.cullFace($e.FRONT_AND_BACK),ze.enable($e.CULL_FACE))},this.setTexture=function(e,t){var r=He.get(e);if(e.version>0&&r.__version!==e.version){var n=e.image;return void 0===n?void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",e):n.complete===!1?void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",e):void $(r,e,t)}ze.activeTexture($e.TEXTURE0+t),ze.bindTexture($e.TEXTURE_2D,r.__webglTexture)},this.setRenderTarget=function(e){var t=e instanceof a.WebGLRenderTargetCube;if(e&&void 0===He.get(e).__webglFramebuffer){var r=He.get(e),n=He.get(e.texture);void 0===e.depthBuffer&&(e.depthBuffer=!0),void 0===e.stencilBuffer&&(e.stencilBuffer=!0),e.addEventListener("dispose",s),n.__webglTexture=$e.createTexture(),Be.textures++;var i=I(e),o=Y(e.texture.format),c=Y(e.texture.type);if(t){r.__webglFramebuffer=[],r.__webglRenderbuffer=[],ze.bindTexture($e.TEXTURE_CUBE_MAP,n.__webglTexture),j($e.TEXTURE_CUBE_MAP,e.texture,i);for(var u=0;6>u;u++)r.__webglFramebuffer[u]=$e.createFramebuffer(),r.__webglRenderbuffer[u]=$e.createRenderbuffer(),ze.texImage2D($e.TEXTURE_CUBE_MAP_POSITIVE_X+u,0,o,e.width,e.height,0,o,c,null),W(r.__webglFramebuffer[u],e,$e.TEXTURE_CUBE_MAP_POSITIVE_X+u),X(r.__webglRenderbuffer[u],e);e.texture.generateMipmaps&&i&&$e.generateMipmap($e.TEXTURE_CUBE_MAP)}else r.__webglFramebuffer=$e.createFramebuffer(),e.shareDepthFrom?r.__webglRenderbuffer=e.shareDepthFrom.__webglRenderbuffer:r.__webglRenderbuffer=$e.createRenderbuffer(),ze.bindTexture($e.TEXTURE_2D,n.__webglTexture),j($e.TEXTURE_2D,e.texture,i),ze.texImage2D($e.TEXTURE_2D,0,o,e.width,e.height,0,o,c,null),W(r.__webglFramebuffer,e,$e.TEXTURE_2D),e.shareDepthFrom?e.depthBuffer&&!e.stencilBuffer?$e.framebufferRenderbuffer($e.FRAMEBUFFER,$e.DEPTH_ATTACHMENT,$e.RENDERBUFFER,r.__webglRenderbuffer):e.depthBuffer&&e.stencilBuffer&&$e.framebufferRenderbuffer($e.FRAMEBUFFER,$e.DEPTH_STENCIL_ATTACHMENT,$e.RENDERBUFFER,r.__webglRenderbuffer):X(r.__webglRenderbuffer,e),e.texture.generateMipmaps&&i&&$e.generateMipmap($e.TEXTURE_2D);t?ze.bindTexture($e.TEXTURE_CUBE_MAP,null):ze.bindTexture($e.TEXTURE_2D,null),$e.bindRenderbuffer($e.RENDERBUFFER,null),$e.bindFramebuffer($e.FRAMEBUFFER,null)}var h,l,f,p,d;if(e){var r=He.get(e);h=t?r.__webglFramebuffer[e.activeCubeFace]:r.__webglFramebuffer,l=e.width,f=e.height,p=0,d=0}else h=null,l=Ae,f=Ce,p=Ee,d=Te;if(h!==xe&&($e.bindFramebuffer($e.FRAMEBUFFER,h),$e.viewport(p,d,l,f),xe=h),t){var n=He.get(e.texture);$e.framebufferTexture2D($e.FRAMEBUFFER,$e.COLOR_ATTACHMENT0,$e.TEXTURE_CUBE_MAP_POSITIVE_X+e.activeCubeFace,n.__webglTexture,0)}Le=l,ke=f},this.readRenderTargetPixels=function(e,t,r,n,i,o){if(e instanceof a.WebGLRenderTarget==!1)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");var s=He.get(e).__webglFramebuffer;if(s){var c=!1;s!==xe&&($e.bindFramebuffer($e.FRAMEBUFFER,s),c=!0);try{var u=e.texture;if(u.format!==a.RGBAFormat&&Y(u.format)!==$e.getParameter($e.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(u.type===a.UnsignedByteType||Y(u.type)===$e.getParameter($e.IMPLEMENTATION_COLOR_READ_TYPE)||u.type===a.FloatType&&Ve.get("WEBGL_color_buffer_float")||u.type===a.HalfFloatType&&Ve.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");$e.checkFramebufferStatus($e.FRAMEBUFFER)===$e.FRAMEBUFFER_COMPLETE?$e.readPixels(t,r,n,i,Y(u.format),Y(u.type),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.");
-}finally{c&&$e.bindFramebuffer($e.FRAMEBUFFER,xe)}}},this.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),Ve.get("OES_texture_float")},this.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),Ve.get("OES_texture_half_float")},this.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),Ve.get("OES_standard_derivatives")},this.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),Ve.get("WEBGL_compressed_texture_s3tc")},this.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),Ve.get("WEBGL_compressed_texture_pvrtc")},this.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),Ve.get("EXT_blend_minmax")},this.supportsVertexTextures=function(){return Ge.vertexTextures},this.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),Ve.get("ANGLE_instanced_arrays")},this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},this.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},this.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},Object.defineProperties(this,{shadowMapEnabled:{get:function(){return Ye.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),Ye.enabled=e}},shadowMapType:{get:function(){return Ye.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),Ye.type=e}},shadowMapCullFace:{get:function(){return Ye.cullFace},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),Ye.cullFace=e}},shadowMapDebug:{get:function(){return Ye.debug},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug."),Ye.debug=e}}})},a.WebGLRenderTarget=function(e,t,r){this.uuid=a.Math.generateUUID(),this.width=e,this.height=t,r=r||{},void 0===r.minFilter&&(r.minFilter=a.LinearFilter),this.texture=new a.Texture(void 0,void 0,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy),this.depthBuffer=void 0!==r.depthBuffer?r.depthBuffer:!0,this.stencilBuffer=void 0!==r.stencilBuffer?r.stencilBuffer:!0,this.shareDepthFrom=void 0!==r.shareDepthFrom?r.shareDepthFrom:null},a.WebGLRenderTarget.prototype={constructor:a.WebGLRenderTarget,get wrapS(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set wrapS(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e},get wrapT(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set wrapT(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e},get magFilter(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set magFilter(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e},get minFilter(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set minFilter(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e},get anisotropy(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set anisotropy(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e},get offset(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set offset(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e},get repeat(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set repeat(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e},get format(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set format(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e},get type(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set type(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e},get generateMipmaps(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set generateMipmaps(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e},setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.dispose())},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.shareDepthFrom=e.shareDepthFrom,this},dispose:function(){this.dispatchEvent({type:"dispose"})}},a.EventDispatcher.prototype.apply(a.WebGLRenderTarget.prototype),a.WebGLRenderTargetCube=function(e,t,r){a.WebGLRenderTarget.call(this,e,t,r),this.activeCubeFace=0},a.WebGLRenderTargetCube.prototype=Object.create(a.WebGLRenderTarget.prototype),a.WebGLRenderTargetCube.prototype.constructor=a.WebGLRenderTargetCube,a.WebGLBufferRenderer=function(e,t,r){function n(e){s=e}function i(t,n){e.drawArrays(s,t,n),r.calls++,r.vertices+=n,s===e.TRIANGLES&&(r.faces+=n/3)}function o(e){var r=t.get("ANGLE_instanced_arrays");if(null===r)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");var n=e.attributes.position;n instanceof a.InterleavedBufferAttribute?r.drawArraysInstancedANGLE(s,0,n.data.count,e.maxInstancedCount):r.drawArraysInstancedANGLE(s,0,n.count,e.maxInstancedCount)}var s;this.setMode=n,this.render=i,this.renderInstances=o},a.WebGLIndexedBufferRenderer=function(e,t,r){function n(e){s=e}function i(r){r.array instanceof Uint32Array&&t.get("OES_element_index_uint")?(c=e.UNSIGNED_INT,u=4):(c=e.UNSIGNED_SHORT,u=2)}function o(t,n){e.drawElements(s,n,c,t*u),r.calls++,r.vertices+=n,s===e.TRIANGLES&&(r.faces+=n/3)}function a(e){var r=t.get("ANGLE_instanced_arrays");if(null===r)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");var n=e.index;r.drawElementsInstancedANGLE(s,n.array.length,c,0,e.maxInstancedCount)}var s,c,u;this.setMode=n,this.setIndex=i,this.render=o,this.renderInstances=a},a.WebGLExtensions=function(e){var t={};this.get=function(r){if(void 0!==t[r])return t[r];var n;switch(r){case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(r)}return null===n&&console.warn("THREE.WebGLRenderer: "+r+" extension not supported."),t[r]=n,n}},a.WebGLCapabilities=function(e,t,r){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"}this.getMaxPrecision=n,this.precision=void 0!==r.precision?r.precision:"highp",this.logarithmicDepthBuffer=void 0!==r.logarithmicDepthBuffer?r.logarithmicDepthBuffer:!1,this.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.maxVertexTextures=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxCubemapSize=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),this.maxAttributes=e.getParameter(e.MAX_VERTEX_ATTRIBS),this.maxVertexUniforms=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),this.maxVaryings=e.getParameter(e.MAX_VARYING_VECTORS),this.maxFragmentUniforms=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),this.vertexTextures=this.maxVertexTextures>0,this.floatFragmentTextures=!!t.get("OES_texture_float"),this.floatVertexTextures=this.vertexTextures&&this.floatFragmentTextures;var i=n(this.precision);i!==this.precision&&(console.warn("THREE.WebGLRenderer:",this.precision,"not supported, using",i,"instead."),this.precision=i),this.logarithmicDepthBuffer&&(this.logarithmicDepthBuffer=!!t.get("EXT_frag_depth"))},a.WebGLGeometries=function(e,t,r){function n(e){var t=e.geometry;if(void 0!==h[t.id])return h[t.id];t.addEventListener("dispose",i);var n;return t instanceof a.BufferGeometry?n=t:t instanceof a.Geometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=(new a.BufferGeometry).setFromObject(e)),n=t._bufferGeometry),h[t.id]=n,r.memory.geometries++,n}function i(e){var n=e.target,o=h[n.id];c(o.attributes),n.removeEventListener("dispose",i),delete h[n.id];var a=t.get(n);a.wireframe&&s(a.wireframe),r.memory.geometries--}function o(e){return e instanceof a.InterleavedBufferAttribute?t.get(e.data).__webglBuffer:t.get(e).__webglBuffer}function s(t){var r=o(t);void 0!==r&&(e.deleteBuffer(r),u(t))}function c(e){for(var t in e)s(e[t])}function u(e){e instanceof a.InterleavedBufferAttribute?t["delete"](e.data):t["delete"](e)}var h={};this.get=n},a.WebGLObjects=function(e,t,r){function n(t){var r=l.get(t);t.geometry instanceof a.Geometry&&r.updateFromObject(t);var n=r.index,o=r.attributes;null!==n&&i(n,e.ELEMENT_ARRAY_BUFFER);for(var s in o)i(o[s],e.ARRAY_BUFFER);var c=r.morphAttributes;for(var s in c)for(var u=c[s],h=0,f=u.length;f>h;h++)i(u[h],e.ARRAY_BUFFER);return r}function i(e,r){var n=e instanceof a.InterleavedBufferAttribute?e.data:e,i=t.get(n);void 0===i.__webglBuffer?o(i,n,r):i.version!==n.version&&s(i,n,r)}function o(t,r,n){t.__webglBuffer=e.createBuffer(),e.bindBuffer(n,t.__webglBuffer);var i=r.dynamic?e.DYNAMIC_DRAW:e.STATIC_DRAW;e.bufferData(n,r.array,i),t.version=r.version}function s(t,r,n){e.bindBuffer(n,t.__webglBuffer),r.dynamic===!1||-1===r.updateRange.count?e.bufferSubData(n,0,r.array):0===r.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(n,r.updateRange.offset*r.array.BYTES_PER_ELEMENT,r.array.subarray(r.updateRange.offset,r.updateRange.offset+r.updateRange.count)),r.updateRange.count=0),t.version=r.version}function c(e){return e instanceof a.InterleavedBufferAttribute?t.get(e.data).__webglBuffer:t.get(e).__webglBuffer}function u(r){var n=t.get(r);if(void 0!==n.wireframe)return n.wireframe;var o=[],s=r.index,c=r.attributes,u=c.position;if(null!==s)for(var l={},f=s.array,p=0,d=f.length;d>p;p+=3){var m=f[p+0],g=f[p+1],v=f[p+2];h(l,m,g)&&o.push(m,g),h(l,g,v)&&o.push(g,v),h(l,v,m)&&o.push(v,m)}else for(var f=c.position.array,p=0,d=f.length/3-1;d>p;p+=3){var m=p+0,g=p+1,v=p+2;o.push(m,g,g,v,v,m)}var y=u.count>65535?Uint32Array:Uint16Array,b=new a.BufferAttribute(new y(o),1);return i(b,e.ELEMENT_ARRAY_BUFFER),n.wireframe=b,b}function h(e,t,r){if(t>r){var n=t;t=r,r=n}var i=e[t];return void 0===i?(e[t]=[r],!0):-1===i.indexOf(r)?(i.push(r),!0):!1}var l=new a.WebGLGeometries(e,t,r);this.getAttributeBuffer=c,this.getWireframeAttribute=u,this.update=n},a.WebGLProgram=function(){function e(e){var t=[];for(var r in e){var n=e[r];n!==!1&&t.push("#define "+r+" "+n)}return t.join("\n")}function t(e,t,r){for(var n={},i=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),o=0;i>o;o++){var a=e.getActiveUniform(t,o),s=a.name,c=e.getUniformLocation(t,s),u=s.lastIndexOf("[0]");-1!==u&&u===s.length-3&&(n[s.substr(0,u)]=c),n[s]=c}return n}function r(e,t,r){for(var n={},i=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),o=0;i>o;o++){var a=e.getActiveAttrib(t,o),s=a.name;n[s]=e.getAttribLocation(t,s)}return n}function n(e){return""!==e}var i=0;return function(o,s,c,u){var h=o.context,l=c.defines,f=c.__webglShader.vertexShader,p=c.__webglShader.fragmentShader,d="SHADOWMAP_TYPE_BASIC";u.shadowMapType===a.PCFShadowMap?d="SHADOWMAP_TYPE_PCF":u.shadowMapType===a.PCFSoftShadowMap&&(d="SHADOWMAP_TYPE_PCF_SOFT");var m="ENVMAP_TYPE_CUBE",g="ENVMAP_MODE_REFLECTION",v="ENVMAP_BLENDING_MULTIPLY";if(u.envMap){switch(c.envMap.mapping){case a.CubeReflectionMapping:case a.CubeRefractionMapping:m="ENVMAP_TYPE_CUBE";break;case a.EquirectangularReflectionMapping:case a.EquirectangularRefractionMapping:m="ENVMAP_TYPE_EQUIREC";break;case a.SphericalReflectionMapping:m="ENVMAP_TYPE_SPHERE"}switch(c.envMap.mapping){case a.CubeRefractionMapping:case a.EquirectangularRefractionMapping:g="ENVMAP_MODE_REFRACTION"}switch(c.combine){case a.MultiplyOperation:v="ENVMAP_BLENDING_MULTIPLY";break;case a.MixOperation:v="ENVMAP_BLENDING_MIX";break;case a.AddOperation:v="ENVMAP_BLENDING_ADD"}}var y,b,x=o.gammaFactor>0?o.gammaFactor:1,w=e(l),_=h.createProgram();c instanceof a.RawShaderMaterial?(y="",b=""):(y=["precision "+u.precision+" float;","precision "+u.precision+" int;","#define SHADER_NAME "+c.__webglShader.name,w,u.supportsVertexTextures?"#define VERTEX_TEXTURES":"",o.gammaInput?"#define GAMMA_INPUT":"",o.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+x,"#define MAX_DIR_LIGHTS "+u.maxDirLights,"#define MAX_POINT_LIGHTS "+u.maxPointLights,"#define MAX_SPOT_LIGHTS "+u.maxSpotLights,"#define MAX_HEMI_LIGHTS "+u.maxHemiLights,"#define MAX_SHADOWS "+u.maxShadows,"#define MAX_BONES "+u.maxBones,u.map?"#define USE_MAP":"",u.envMap?"#define USE_ENVMAP":"",u.envMap?"#define "+g:"",u.lightMap?"#define USE_LIGHTMAP":"",u.aoMap?"#define USE_AOMAP":"",u.emissiveMap?"#define USE_EMISSIVEMAP":"",u.bumpMap?"#define USE_BUMPMAP":"",u.normalMap?"#define USE_NORMALMAP":"",u.displacementMap&&u.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",u.specularMap?"#define USE_SPECULARMAP":"",u.alphaMap?"#define USE_ALPHAMAP":"",u.vertexColors?"#define USE_COLOR":"",u.flatShading?"#define FLAT_SHADED":"",u.skinning?"#define USE_SKINNING":"",u.useVertexTexture?"#define BONE_TEXTURE":"",u.morphTargets?"#define USE_MORPHTARGETS":"",u.morphNormals&&u.flatShading===!1?"#define USE_MORPHNORMALS":"",u.doubleSided?"#define DOUBLE_SIDED":"",u.flipSided?"#define FLIP_SIDED":"",u.shadowMapEnabled?"#define USE_SHADOWMAP":"",u.shadowMapEnabled?"#define "+d:"",u.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",u.pointLightShadows>0?"#define POINT_LIGHT_SHADOWS":"",u.sizeAttenuation?"#define USE_SIZEATTENUATION":"",u.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",u.logarithmicDepthBuffer&&o.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"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif","\n"].filter(n).join("\n"),b=[u.bumpMap||u.normalMap||u.flatShading||c.derivatives?"#extension GL_OES_standard_derivatives : enable":"",u.logarithmicDepthBuffer&&o.extensions.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"","precision "+u.precision+" float;","precision "+u.precision+" int;","#define SHADER_NAME "+c.__webglShader.name,w,"#define MAX_DIR_LIGHTS "+u.maxDirLights,"#define MAX_POINT_LIGHTS "+u.maxPointLights,"#define MAX_SPOT_LIGHTS "+u.maxSpotLights,"#define MAX_HEMI_LIGHTS "+u.maxHemiLights,"#define MAX_SHADOWS "+u.maxShadows,u.alphaTest?"#define ALPHATEST "+u.alphaTest:"",o.gammaInput?"#define GAMMA_INPUT":"",o.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+x,u.useFog&&u.fog?"#define USE_FOG":"",u.useFog&&u.fogExp?"#define FOG_EXP2":"",u.map?"#define USE_MAP":"",u.envMap?"#define USE_ENVMAP":"",u.envMap?"#define "+m:"",u.envMap?"#define "+g:"",u.envMap?"#define "+v:"",u.lightMap?"#define USE_LIGHTMAP":"",u.aoMap?"#define USE_AOMAP":"",u.emissiveMap?"#define USE_EMISSIVEMAP":"",u.bumpMap?"#define USE_BUMPMAP":"",u.normalMap?"#define USE_NORMALMAP":"",u.specularMap?"#define USE_SPECULARMAP":"",u.alphaMap?"#define USE_ALPHAMAP":"",u.vertexColors?"#define USE_COLOR":"",u.flatShading?"#define FLAT_SHADED":"",u.metal?"#define METAL":"",u.doubleSided?"#define DOUBLE_SIDED":"",u.flipSided?"#define FLIP_SIDED":"",u.shadowMapEnabled?"#define USE_SHADOWMAP":"",u.shadowMapEnabled?"#define "+d:"",u.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",u.pointLightShadows>0?"#define POINT_LIGHT_SHADOWS":"",u.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",u.logarithmicDepthBuffer&&o.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","\n"].filter(n).join("\n"));var S=y+f,M=b+p,E=a.WebGLShader(h,h.VERTEX_SHADER,S),T=a.WebGLShader(h,h.FRAGMENT_SHADER,M);h.attachShader(_,E),h.attachShader(_,T),void 0!==c.index0AttributeName?h.bindAttribLocation(_,0,c.index0AttributeName):u.morphTargets===!0&&h.bindAttribLocation(_,0,"position"),h.linkProgram(_);var A=h.getProgramInfoLog(_),C=h.getShaderInfoLog(E),L=h.getShaderInfoLog(T),k=!0,F=!0;h.getProgramParameter(_,h.LINK_STATUS)===!1?(k=!1,console.error("THREE.WebGLProgram: shader error: ",h.getError(),"gl.VALIDATE_STATUS",h.getProgramParameter(_,h.VALIDATE_STATUS),"gl.getProgramInfoLog",A,C,L)):""!==A?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",A):""!==C&&""!==L||(F=!1),F&&(this.diagnostics={runnable:k,material:c,programLog:A,vertexShader:{log:C,prefix:y},fragmentShader:{log:L,prefix:b}}),h.deleteShader(E),h.deleteShader(T);var P;this.getUniforms=function(){return void 0===P&&(P=t(h,_)),P};var R;return this.getAttributes=function(){return void 0===R&&(R=r(h,_)),R},this.destroy=function(){h.deleteProgram(_),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=i++,this.code=s,this.usedTimes=1,this.program=_,this.vertexShader=E,this.fragmentShader=T,this}}(),a.WebGLPrograms=function(e,t){function r(e){if(t.floatVertexTextures&&e&&e.skeleton&&e.skeleton.useVertexTexture)return 1024;var r=t.maxVertexUniforms,n=Math.floor((r-20)/4),i=n;return void 0!==e&&e instanceof a.SkinnedMesh&&(i=Math.min(e.skeleton.bones.length,i),io;o++){var c=e[o];c.visible!==!1&&(c instanceof a.DirectionalLight&&t++,c instanceof a.PointLight&&r++,c instanceof a.SpotLight&&n++,c instanceof a.HemisphereLight&&i++)}return{directional:t,point:r,spot:n,hemi:i}}function i(e){for(var t=0,r=0,n=0,i=e.length;i>n;n++){var o=e[n];o.castShadow&&((o instanceof a.SpotLight||o instanceof a.DirectionalLight)&&t++,o instanceof a.PointLight&&(t++,r++))}return{maxShadows:t,pointLightShadows:r}}var o=[],s={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"},c=["precision","supportsVertexTextures","map","envMap","envMapMode","lightMap","aoMap","emissiveMap","bumpMap","normalMap","displacementMap","specularMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","maxDirLights","maxPointLights","maxSpotLights","maxHemiLights","maxShadows","shadowMapEnabled","pointLightShadows","shadowMapType","shadowMapDebug","alphaTest","metal","doubleSided","flipSided"];this.getParameters=function(o,c,u,h){var l=s[o.type],f=n(c),p=i(c),d=r(h),m=e.getPrecision();null!==o.precision&&(m=t.getMaxPrecision(o.precision),m!==o.precision&&console.warn("THREE.WebGLRenderer.initMaterial:",o.precision,"not supported, using",m,"instead."));var g={shaderID:l,precision:m,supportsVertexTextures:t.vertexTextures,map:!!o.map,envMap:!!o.envMap,envMapMode:o.envMap&&o.envMap.mapping,lightMap:!!o.lightMap,aoMap:!!o.aoMap,emissiveMap:!!o.emissiveMap,bumpMap:!!o.bumpMap,normalMap:!!o.normalMap,displacementMap:!!o.displacementMap,specularMap:!!o.specularMap,alphaMap:!!o.alphaMap,combine:o.combine,vertexColors:o.vertexColors,fog:u,useFog:o.fog,fogExp:u instanceof a.FogExp2,flatShading:o.shading===a.FlatShading,sizeAttenuation:o.sizeAttenuation,logarithmicDepthBuffer:t.logarithmicDepthBuffer,skinning:o.skinning,maxBones:d,useVertexTexture:t.floatVertexTextures&&h&&h.skeleton&&h.skeleton.useVertexTexture,morphTargets:o.morphTargets,morphNormals:o.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,maxDirLights:f.directional,maxPointLights:f.point,maxSpotLights:f.spot,maxHemiLights:f.hemi,maxShadows:p.maxShadows,pointLightShadows:p.pointLightShadows,shadowMapEnabled:e.shadowMap.enabled&&h.receiveShadow&&p.maxShadows>0,shadowMapType:e.shadowMap.type,shadowMapDebug:e.shadowMap.debug,alphaTest:o.alphaTest,metal:o.metal,doubleSided:o.side===a.DoubleSide,flipSided:o.side===a.BackSide};return g},this.getProgramCode=function(e,t){var r=[];if(t.shaderID?r.push(t.shaderID):(r.push(e.fragmentShader),r.push(e.vertexShader)),void 0!==e.defines)for(var n in e.defines)r.push(n),r.push(e.defines[n]);for(var i=0;is;s++){var u=o[s];if(u.code===n){i=u,++i.usedTimes;break}}return void 0===i&&(i=new a.WebGLProgram(e,n,t,r),o.push(i)),i},this.releaseProgram=function(e){if(0===--e.usedTimes){var t=o.indexOf(e);o[t]=o[o.length-1],o.pop(),e.destroy()}},this.programs=o},a.WebGLProperties=function(){var e={};this.get=function(t){var r=t.uuid,n=e[r];return void 0===n&&(n={},e[r]=n),n},this["delete"]=function(t){delete e[t.uuid]},this.clear=function(){e={}}},a.WebGLShader=function(){function e(e){for(var t=e.split("\n"),r=0;r0&&t.morphTargets,h=e instanceof a.SkinnedMesh&&t.skinning,l=0;u&&(l|=p),h&&(l|=d),o=s[l]}return o.visible=t.visible,o.wireframe=t.wireframe,o.wireframeLinewidth=t.wireframeLinewidth,r&&void 0!==o.uniforms.lightPos&&o.uniforms.lightPos.value.copy(n),o}function i(e,t){if(e.visible!==!1){if((e instanceof a.Mesh||e instanceof a.Line||e instanceof a.Points)&&e.castShadow&&(e.frustumCulled===!1||c.intersectsObject(e)===!0)){var r=e.material;r.visible===!0&&(e.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,e.matrixWorld),f.push(e))}for(var n=e.children,o=0,s=n.length;s>o;o++)i(n[o],t)}}for(var o=e.context,s=e.state,c=new a.Frustum,u=new a.Matrix4,h=(new a.Vector3,new a.Vector3,new a.Vector3),l=new a.Vector3,f=[],p=1,d=2,m=(p|d)+1,g=new Array(m),v=new Array(m),y=[new a.Vector3(1,0,0),new a.Vector3(-1,0,0),new a.Vector3(0,0,1),new a.Vector3(0,0,-1),new a.Vector3(0,1,0),new a.Vector3(0,-1,0)],b=[new a.Vector3(0,1,0),new a.Vector3(0,1,0),new a.Vector3(0,1,0),new a.Vector3(0,1,0),new a.Vector3(0,0,1),new a.Vector3(0,0,-1)],x=[new a.Vector4,new a.Vector4,new a.Vector4,new a.Vector4,new a.Vector4,new a.Vector4],w=new a.Vector4,_=a.ShaderLib.depthRGBA,S=a.UniformsUtils.clone(_.uniforms),M=a.ShaderLib.distanceRGBA,E=a.UniformsUtils.clone(M.uniforms),T=0;T!==m;++T){var A=0!==(T&p),C=0!==(T&d),L=new a.ShaderMaterial({uniforms:S,vertexShader:_.vertexShader,fragmentShader:_.fragmentShader,morphTargets:A,skinning:C});L._shadowPass=!0,g[T]=L;var k=new a.ShaderMaterial({uniforms:E,vertexShader:M.vertexShader,fragmentShader:M.fragmentShader,morphTargets:A,skinning:C});k._shadowPass=!0,v[T]=k}var F=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=a.PCFShadowMap,this.cullFace=a.CullFaceFront,this.render=function(p){var d,m;if(F.enabled!==!1&&(F.autoUpdate!==!1||F.needsUpdate!==!1)){o.clearColor(1,1,1,1),s.disable(o.BLEND),s.enable(o.CULL_FACE),o.frontFace(o.CCW),o.cullFace(F.cullFace===a.CullFaceFront?o.FRONT:o.BACK),s.setDepthTest(!0),e.getViewport(w);for(var g=0,v=t.length;v>g;g++){var _=t[g];if(_.castShadow===!0){var S=_.shadow,M=S.camera,E=S.mapSize;if(_ instanceof a.PointLight){d=6,m=!0;var T=E.x/4,A=E.y/2;x[0].set(2*T,A,T,A),x[1].set(0,A,T,A),x[2].set(3*T,A,T,A),x[3].set(T,A,T,A),x[4].set(3*T,0,T,A),x[5].set(T,0,T,A)}else d=1,m=!1;if(null===S.map){var C=a.LinearFilter;F.type===a.PCFSoftShadowMap&&(C=a.NearestFilter);var L={minFilter:C,magFilter:C,format:a.RGBAFormat};S.map=new a.WebGLRenderTarget(E.x,E.y,L),S.matrix=new a.Matrix4,_ instanceof a.SpotLight&&(M.aspect=E.x/E.y),M.updateProjectionMatrix()}var k=S.map,P=S.matrix;l.setFromMatrixPosition(_.matrixWorld),M.position.copy(l),e.setRenderTarget(k),e.clear();for(var R=0;d>R;R++){if(m){h.copy(M.position),h.add(y[R]),M.up.copy(b[R]),M.lookAt(h);var D=x[R];e.setViewport(D.x,D.y,D.z,D.w)}else h.setFromMatrixPosition(_.target.matrixWorld),M.lookAt(h);M.updateMatrixWorld(),M.matrixWorldInverse.getInverse(M.matrixWorld),P.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),P.multiply(M.projectionMatrix),P.multiply(M.matrixWorldInverse),u.multiplyMatrices(M.projectionMatrix,M.matrixWorldInverse),c.setFromMatrix(u),f.length=0,i(p,M);for(var O=0,U=f.length;U>O;O++){var B=f[O],j=r.update(B),$=B.material;if($ instanceof a.MeshFaceMaterial)for(var N=j.groups,I=$.materials,V=0,G=N.length;G>V;V++){var z=N[V],H=I[z.materialIndex];if(H.visible===!0){var W=n(B,H,m,l);e.renderBufferDirect(M,t,null,j,W,B,z)}}else{var W=n(B,$,m,l);e.renderBufferDirect(M,t,null,j,W,B,null)}}}e.resetGLState()}}e.setViewport(w.x,w.y,w.z,w.w);var X=e.getClearColor(),q=e.getClearAlpha();e.setClearColor(X,q),s.enable(o.BLEND),F.cullFace===a.CullFaceFront&&o.cullFace(o.BACK),e.resetGLState(),F.needsUpdate=!1}}},a.WebGLState=function(e,t,r){var n=this,i=new Uint8Array(16),o=new Uint8Array(16),s=new Uint8Array(16),c={},u=null,h=null,l=null,f=null,p=null,d=null,m=null,g=null,v=null,y=null,b=null,x=null,w=null,_=null,S=null,M=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),E=void 0,T={};this.init=function(){e.clearColor(0,0,0,1),e.clearDepth(1),e.clearStencil(0),this.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.frontFace(e.CCW),e.cullFace(e.BACK),this.enable(e.CULL_FACE),this.enable(e.BLEND),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA)},this.initAttributes=function(){for(var e=0,t=i.length;t>e;e++)i[e]=0},this.enableAttribute=function(r){if(i[r]=1,0===o[r]&&(e.enableVertexAttribArray(r),o[r]=1),0!==s[r]){var n=t.get("ANGLE_instanced_arrays");n.vertexAttribDivisorANGLE(r,0),s[r]=0}},this.enableAttributeAndDivisor=function(t,r,n){i[t]=1,0===o[t]&&(e.enableVertexAttribArray(t),o[t]=1),s[t]!==r&&(n.vertexAttribDivisorANGLE(t,r),s[t]=r)},this.disableUnusedAttributes=function(){for(var t=0,r=o.length;r>t;t++)o[t]!==i[t]&&(e.disableVertexAttribArray(t),o[t]=0)},this.enable=function(t){c[t]!==!0&&(e.enable(t),c[t]=!0)},this.disable=function(t){c[t]!==!1&&(e.disable(t),c[t]=!1)},this.getCompressedTextureFormats=function(){if(null===u&&(u=[],t.get("WEBGL_compressed_texture_pvrtc")||t.get("WEBGL_compressed_texture_s3tc")))for(var r=e.getParameter(e.COMPRESSED_TEXTURE_FORMATS),n=0;n0;var r;r=h?{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")}:{vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uv;","vec2 pos = position;","if ( renderType == 2 ) {","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:["precision mediump float;","uniform lowp int renderType;","uniform sampler2D map;","uniform sampler2D occlusionMap;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","void main() {","if ( renderType == 0 ) {","gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );","} else if ( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;","visibility = ( 1.0 - visibility / 4.0 );","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * visibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join("\n")},s=n(r),c={vertex:p.getAttribLocation(s,"position"),uv:p.getAttribLocation(s,"uv")},u={renderType:p.getUniformLocation(s,"renderType"),map:p.getUniformLocation(s,"map"),occlusionMap:p.getUniformLocation(s,"occlusionMap"),opacity:p.getUniformLocation(s,"opacity"),color:p.getUniformLocation(s,"color"),scale:p.getUniformLocation(s,"scale"),rotation:p.getUniformLocation(s,"rotation"),screenPosition:p.getUniformLocation(s,"screenPosition")}}function n(t){var r=p.createProgram(),n=p.createShader(p.FRAGMENT_SHADER),i=p.createShader(p.VERTEX_SHADER),o="precision "+e.getPrecision()+" float;\n";return p.shaderSource(n,o+t.fragmentShader),p.shaderSource(i,o+t.vertexShader),p.compileShader(n),p.compileShader(i),p.attachShader(r,n),p.attachShader(r,i),p.linkProgram(r),r}var i,o,s,c,u,h,l,f,p=e.context,d=e.state;this.render=function(n,m,g,v){if(0!==t.length){var y=new a.Vector3,b=v/g,x=.5*g,w=.5*v,_=16/v,S=new a.Vector2(_*b,_),M=new a.Vector3(1,1,0),E=new a.Vector2(1,1);void 0===s&&r(),p.useProgram(s),d.initAttributes(),d.enableAttribute(c.vertex),d.enableAttribute(c.uv),d.disableUnusedAttributes(),p.uniform1i(u.occlusionMap,0),p.uniform1i(u.map,1),p.bindBuffer(p.ARRAY_BUFFER,i),p.vertexAttribPointer(c.vertex,2,p.FLOAT,!1,16,0),p.vertexAttribPointer(c.uv,2,p.FLOAT,!1,16,8),p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,o),d.disable(p.CULL_FACE),p.depthMask(!1);for(var T=0,A=t.length;A>T;T++){_=16/v,S.set(_*b,_);var C=t[T];if(y.set(C.matrixWorld.elements[12],C.matrixWorld.elements[13],C.matrixWorld.elements[14]),y.applyMatrix4(m.matrixWorldInverse),y.applyProjection(m.projectionMatrix),M.copy(y),E.x=M.x*x+x,E.y=M.y*w+w,h||E.x>0&&E.x0&&E.yL;L++){var F=C.lensFlares[L];F.opacity>.001&&F.scale>.001&&(M.x=F.x,M.y=F.y,M.z=F.z,_=F.size*F.scale/v,S.x=_*b,S.y=_,p.uniform3f(u.screenPosition,M.x,M.y,M.z),p.uniform2f(u.scale,S.x,S.y),p.uniform1f(u.rotation,F.rotation),p.uniform1f(u.opacity,F.opacity),p.uniform3f(u.color,F.color.r,F.color.g,F.color.b),d.setBlending(F.blending,F.blendEquation,F.blendSrc,F.blendDst),e.setTexture(F.texture,1),p.drawElements(p.TRIANGLES,6,p.UNSIGNED_SHORT,0))}}}d.enable(p.CULL_FACE),d.enable(p.DEPTH_TEST),p.depthMask(!0),e.resetGLState()}}},a.SpritePlugin=function(e,t){function r(){var e=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),t=new Uint16Array([0,1,2,0,2,3]);o=f.createBuffer(),s=f.createBuffer(),f.bindBuffer(f.ARRAY_BUFFER,o),f.bufferData(f.ARRAY_BUFFER,e,f.STATIC_DRAW),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,s),f.bufferData(f.ELEMENT_ARRAY_BUFFER,t,f.STATIC_DRAW),c=n(),u={position:f.getAttribLocation(c,"position"),uv:f.getAttribLocation(c,"uv")},h={uvOffset:f.getUniformLocation(c,"uvOffset"),uvScale:f.getUniformLocation(c,"uvScale"),rotation:f.getUniformLocation(c,"rotation"),scale:f.getUniformLocation(c,"scale"),color:f.getUniformLocation(c,"color"),map:f.getUniformLocation(c,"map"),opacity:f.getUniformLocation(c,"opacity"),modelViewMatrix:f.getUniformLocation(c,"modelViewMatrix"),projectionMatrix:f.getUniformLocation(c,"projectionMatrix"),fogType:f.getUniformLocation(c,"fogType"),fogDensity:f.getUniformLocation(c,"fogDensity"),fogNear:f.getUniformLocation(c,"fogNear"),fogFar:f.getUniformLocation(c,"fogFar"),fogColor:f.getUniformLocation(c,"fogColor"),alphaTest:f.getUniformLocation(c,"alphaTest")};var r=document.createElement("canvas");r.width=8,r.height=8;var i=r.getContext("2d");i.fillStyle="white",i.fillRect(0,0,8,8),l=new a.Texture(r),l.needsUpdate=!0}function n(){var t=f.createProgram(),r=f.createShader(f.VERTEX_SHADER),n=f.createShader(f.FRAGMENT_SHADER);return f.shaderSource(r,["precision "+e.getPrecision()+" float;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uvOffset + uv * uvScale;","vec2 alignedPosition = position * scale;","vec2 rotatedPosition;","rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","vec4 finalPosition;","finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","finalPosition.xy += rotatedPosition;","finalPosition = projectionMatrix * finalPosition;","gl_Position = finalPosition;","}"].join("\n")),f.shaderSource(n,["precision "+e.getPrecision()+" float;","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","void main() {","vec4 texture = texture2D( map, vUV );","if ( texture.a < alphaTest ) discard;","gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","if ( fogType > 0 ) {","float depth = gl_FragCoord.z / gl_FragCoord.w;","float fogFactor = 0.0;","if ( fogType == 1 ) {","fogFactor = smoothstep( fogNear, fogFar, depth );","} else {","const float LOG2 = 1.442695;","fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );","fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","}","gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}","}"].join("\n")),f.compileShader(r),f.compileShader(n),f.attachShader(t,r),f.attachShader(t,n),f.linkProgram(t),t}function i(e,t){return e.z!==t.z?t.z-e.z:t.id-e.id}var o,s,c,u,h,l,f=e.context,p=e.state,d=new a.Vector3,m=new a.Quaternion,g=new a.Vector3;this.render=function(n,v){if(0!==t.length){void 0===c&&r(),f.useProgram(c),p.initAttributes(),p.enableAttribute(u.position),p.enableAttribute(u.uv),p.disableUnusedAttributes(),p.disable(f.CULL_FACE),p.enable(f.BLEND),f.bindBuffer(f.ARRAY_BUFFER,o),f.vertexAttribPointer(u.position,2,f.FLOAT,!1,16,0),f.vertexAttribPointer(u.uv,2,f.FLOAT,!1,16,8),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,s),f.uniformMatrix4fv(h.projectionMatrix,!1,v.projectionMatrix.elements),p.activeTexture(f.TEXTURE0),f.uniform1i(h.map,0);var y=0,b=0,x=n.fog;x?(f.uniform3f(h.fogColor,x.color.r,x.color.g,x.color.b),x instanceof a.Fog?(f.uniform1f(h.fogNear,x.near),f.uniform1f(h.fogFar,x.far),f.uniform1i(h.fogType,1),y=1,b=1):x instanceof a.FogExp2&&(f.uniform1f(h.fogDensity,x.density),f.uniform1i(h.fogType,2),y=2,b=2)):(f.uniform1i(h.fogType,0),y=0,b=0);for(var w=0,_=t.length;_>w;w++){var S=t[w];S.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse,S.matrixWorld),S.z=-S.modelViewMatrix.elements[14]}t.sort(i);for(var M=[],w=0,_=t.length;_>w;w++){var S=t[w],E=S.material;f.uniform1f(h.alphaTest,E.alphaTest),f.uniformMatrix4fv(h.modelViewMatrix,!1,S.modelViewMatrix.elements),S.matrixWorld.decompose(d,m,g),M[0]=g.x,M[1]=g.y;var T=0;n.fog&&E.fog&&(T=b),y!==T&&(f.uniform1i(h.fogType,T),y=T),null!==E.map?(f.uniform2f(h.uvOffset,E.map.offset.x,E.map.offset.y),f.uniform2f(h.uvScale,E.map.repeat.x,E.map.repeat.y)):(f.uniform2f(h.uvOffset,0,0),f.uniform2f(h.uvScale,1,1)),f.uniform1f(h.opacity,E.opacity),f.uniform3f(h.color,E.color.r,E.color.g,E.color.b),f.uniform1f(h.rotation,E.rotation),f.uniform2fv(h.scale,M),p.setBlending(E.blending,E.blendEquation,E.blendSrc,E.blendDst),p.setDepthTest(E.depthTest),p.setDepthWrite(E.depthWrite),E.map&&E.map.image&&E.map.image.width?e.setTexture(E.map,0):e.setTexture(l,0),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0)}p.enable(f.CULL_FACE),e.resetGLState()}}},a.CurveUtils={tangentQuadraticBezier:function(e,t,r,n){return 2*(1-e)*(r-t)+2*e*(n-r)},tangentCubicBezier:function(e,t,r,n,i){return-3*t*(1-e)*(1-e)+3*r*(1-e)*(1-e)-6*e*r*(1-e)+6*e*n*(1-e)-3*e*e*n+3*e*e*i},tangentSpline:function(e,t,r,n,i){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,r,n,i){var o=.5*(r-e),a=.5*(n-t),s=i*i,c=i*s;return(2*t-2*r+o+a)*c+(-3*t+3*r-2*o-a)*s+o*i+t}},a.GeometryUtils={merge:function(e,t,r){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var n;t instanceof a.Mesh&&(t.matrixAutoUpdate&&t.updateMatrix(),n=t.matrix,t=t.geometry),e.merge(t,n,r)},center:function(e){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}},a.ImageUtils={crossOrigin:void 0,loadTexture:function(e,t,r,n){console.warn("THREE.ImageUtils.loadTexture is being deprecated. Use THREE.TextureLoader() instead.");var i=new a.TextureLoader;i.setCrossOrigin(this.crossOrigin);var o=i.load(e,r,void 0,n);return t&&(o.mapping=t),o},loadTextureCube:function(e,t,r,n){console.warn("THREE.ImageUtils.loadTextureCube is being deprecated. Use THREE.CubeTextureLoader() instead.");var i=new a.CubeTextureLoader;i.setCrossOrigin(this.crossOrigin);var o=i.load(e,r,void 0,n);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.")}},a.SceneUtils={createMultiMaterialObject:function(e,t){for(var r=new a.Group,n=0,i=t.length;i>n;n++)r.add(new a.Mesh(e,t[n]));return r},detach:function(e,t,r){e.applyMatrix(t.matrixWorld),t.remove(e),r.add(e)},attach:function(e,t,r){var n=new a.Matrix4;n.getInverse(r.matrixWorld),e.applyMatrix(n),t.remove(e),r.add(e)}},a.ShapeUtils={area:function(e){for(var t=e.length,r=0,n=t-1,i=0;t>i;n=i++)r+=e[n].x*e[i].y-e[i].x*e[n].y;return.5*r},triangulate:function(){function e(e,t,r,n,i,o){var a,s,c,u,h,l,f,p,d;if(s=e[o[t]].x,c=e[o[t]].y,u=e[o[r]].x,h=e[o[r]].y,l=e[o[n]].x,f=e[o[n]].y,Number.EPSILON>(u-s)*(f-c)-(h-c)*(l-s))return!1;var m,g,v,y,b,x,w,_,S,M,E,T,A,C,L;for(m=l-u,g=f-h,v=s-l,y=c-f,b=u-s,x=h-c,a=0;i>a;a++)if(p=e[o[a]].x,d=e[o[a]].y,!(p===s&&d===c||p===u&&d===h||p===l&&d===f)&&(w=p-s,_=d-c,S=p-u,M=d-h,E=p-l,T=d-f,L=m*M-g*S,A=b*_-x*w,C=v*T-y*E,L>=-Number.EPSILON&&C>=-Number.EPSILON&&A>=-Number.EPSILON))return!1;return!0}return function(t,r){var n=t.length;if(3>n)return null;var i,o,s,c=[],u=[],h=[];if(a.ShapeUtils.area(t)>0)for(o=0;n>o;o++)u[o]=o;else for(o=0;n>o;o++)u[o]=n-1-o;var l=n,f=2*l;for(o=l-1;l>2;){if(f--<=0)return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),r?h:c;if(i=o,i>=l&&(i=0),o=i+1,o>=l&&(o=0),s=o+1,s>=l&&(s=0),e(t,i,o,s,l,u)){var p,d,m,g,v;for(p=u[i],d=u[o],m=u[s],c.push([t[p],t[d],t[m]]),h.push([u[i],u[o],u[s]]),g=o,v=o+1;l>v;g++,v++)u[g]=u[v];l--,f=2*l}}return r?h:c}}(),triangulateShape:function(e,t){function r(e,t,r){return e.x!==t.x?e.xNumber.EPSILON){var d;if(f>0){if(0>p||p>f)return[];if(d=u*h-c*l,0>d||d>f)return[]}else{if(p>0||f>p)return[];if(d=u*h-c*l,d>0||f>d)return[]}if(0===d)return!o||0!==p&&p!==f?[e]:[];if(d===f)return!o||0!==p&&p!==f?[t]:[];if(0===p)return[n];if(p===f)return[i];var m=d/f;return[{x:e.x+m*a,y:e.y+m*s}]}if(0!==p||u*h!==c*l)return[];var g=0===a&&0===s,v=0===c&&0===u;if(g&&v)return e.x!==n.x||e.y!==n.y?[]:[e];if(g)return r(n,i,e)?[e]:[];if(v)return r(e,t,n)?[n]:[];var y,b,x,w,_,S,M,E;return 0!==a?(e.x=x?M>w?[]:w===M?o?[]:[_]:E>=w?[_,b]:[_,S]:x>E?[]:x===E?o?[]:[y]:E>=w?[y,b]:[y,S]}function i(e,t,r,n){var i=t.x-e.x,o=t.y-e.y,a=r.x-e.x,s=r.y-e.y,c=n.x-e.x,u=n.y-e.y,h=i*s-o*a,l=i*u-o*c;if(Math.abs(h)>Number.EPSILON){var f=c*s-u*a;return h>0?l>=0&&f>=0:l>=0||f>=0}return l>0}function o(e,t){function r(e,t){var r=y.length-1,n=e-1;0>n&&(n=r);var o=e+1;o>r&&(o=0);var a=i(y[e],y[n],y[o],s[t]);if(!a)return!1;var c=s.length-1,u=t-1;0>u&&(u=c);var h=t+1;return h>c&&(h=0),a=i(s[t],s[u],s[h],y[e]),!!a}function o(e,t){var r,i,o;for(r=0;r0)return!0;return!1}function a(e,r){var i,o,a,s,c;for(i=0;i0)return!0;return!1}for(var s,c,u,h,l,f,p,d,m,g,v,y=e.concat(),b=[],x=[],w=0,_=t.length;_>w;w++)b.push(w);for(var S=0,M=2*b.length;b.length>0;){if(M--,0>M){console.log("Infinite Loop! Holes left:"+b.length+", Probably Hole outside Shape!");break}for(u=S;u=0)break;x[p]=!0}if(c>=0)break}}return y}for(var s,c,u,h,l,f,p={},d=e.concat(),m=0,g=t.length;g>m;m++)Array.prototype.push.apply(d,t[m]);for(s=0,c=d.length;c>s;s++)l=d[s].x+":"+d[s].y,void 0!==p[l]&&console.warn("THREE.Shape: Duplicate point",l),p[l]=s;var v=o(e,t),y=a.ShapeUtils.triangulate(v,!1);for(s=0,c=y.length;c>s;s++)for(h=y[s],u=0;3>u;u++)l=h[u].x+":"+h[u].y,f=p[l],void 0!==f&&(h[u]=f);return y.concat()},isClockWise:function(e){return a.ShapeUtils.area(e)<0},b2:function(){function e(e,t){var r=1-e;return r*r*t}function t(e,t){return 2*(1-e)*e*t}function r(e,t){return e*e*t}return function(n,i,o,a){return e(n,i)+t(n,o)+r(n,a)}}(),b3:function(){function e(e,t){var r=1-e;return r*r*r*t}function t(e,t){var r=1-e;return 3*r*r*e*t}function r(e,t){var r=1-e;return 3*r*e*e*t}function n(e,t){return e*e*e*t}return function(i,o,a,s,c){return e(i,o)+t(i,a)+r(i,s)+n(i,c)}}()},a.Audio=function(e){a.Object3D.call(this),this.type="Audio",this.context=e.context,this.source=this.context.createBufferSource(),this.source.onended=this.onEnded.bind(this),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.panner=this.context.createPanner(),this.panner.connect(this.gain),this.autoplay=!1,this.startTime=0,this.playbackRate=1,this.isPlaying=!1},a.Audio.prototype=Object.create(a.Object3D.prototype),a.Audio.prototype.constructor=a.Audio,a.Audio.prototype.load=function(e){var t=this,r=new XMLHttpRequest;return r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(e){t.context.decodeAudioData(this.response,function(e){t.source.buffer=e,t.autoplay&&t.play()})},r.send(),this},a.Audio.prototype.play=function(){if(this.isPlaying===!0)return void console.warn("THREE.Audio: Audio is already playing.");var e=this.context.createBufferSource();e.buffer=this.source.buffer,e.loop=this.source.loop,e.onended=this.source.onended,e.start(0,this.startTime),e.playbackRate.value=this.playbackRate,this.isPlaying=!0,this.source=e,this.connect()},a.Audio.prototype.pause=function(){this.source.stop(),this.startTime=this.context.currentTime},a.Audio.prototype.stop=function(){this.source.stop(),this.startTime=0},a.Audio.prototype.connect=function(){void 0!==this.filter?(this.source.connect(this.filter),this.filter.connect(this.panner)):this.source.connect(this.panner)},a.Audio.prototype.disconnect=function(){void 0!==this.filter?(this.source.disconnect(this.filter),this.filter.disconnect(this.panner)):this.source.disconnect(this.panner)},a.Audio.prototype.setFilter=function(e){this.isPlaying===!0?(this.disconnect(),this.filter=e,this.connect()):this.filter=e},a.Audio.prototype.getFilter=function(){return this.filter},a.Audio.prototype.setPlaybackRate=function(e){this.playbackRate=e,this.isPlaying===!0&&(this.source.playbackRate.value=this.playbackRate)},a.Audio.prototype.getPlaybackRate=function(){return this.playbackRate},a.Audio.prototype.onEnded=function(){this.isPlaying=!1},a.Audio.prototype.setLoop=function(e){this.source.loop=e},a.Audio.prototype.getLoop=function(){return this.source.loop},a.Audio.prototype.setRefDistance=function(e){this.panner.refDistance=e},a.Audio.prototype.getRefDistance=function(){return this.panner.refDistance},a.Audio.prototype.setRolloffFactor=function(e){this.panner.rolloffFactor=e},a.Audio.prototype.getRolloffFactor=function(){return this.panner.rolloffFactor},a.Audio.prototype.setVolume=function(e){this.gain.gain.value=e},a.Audio.prototype.getVolume=function(){return this.gain.gain.value},a.Audio.prototype.updateMatrixWorld=function(){var e=new a.Vector3;return function(t){a.Object3D.prototype.updateMatrixWorld.call(this,t),e.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(e.x,e.y,e.z)}}(),a.AudioListener=function(){a.Object3D.call(this),this.type="AudioListener",this.context=new(window.AudioContext||window.webkitAudioContext)},a.AudioListener.prototype=Object.create(a.Object3D.prototype),a.AudioListener.prototype.constructor=a.AudioListener,a.AudioListener.prototype.updateMatrixWorld=function(){var e=new a.Vector3,t=new a.Quaternion,r=new a.Vector3,n=new a.Vector3;return function(i){a.Object3D.prototype.updateMatrixWorld.call(this,i);var o=this.context.listener,s=this.up;this.matrixWorld.decompose(e,t,r),n.set(0,0,-1).applyQuaternion(t),o.setPosition(e.x,e.y,e.z),o.setOrientation(n.x,n.y,n.z,s.x,s.y,s.z)}}(),a.Curve=function(){},a.Curve.prototype={constructor:a.Curve,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);var t,r=[];for(t=0;e>=t;t++)r.push(this.getPoint(t/e));return r},getSpacedPoints:function(e){e||(e=5);var t,r=[];for(t=0;e>=t;t++)r.push(this.getPointAt(t/e));return r},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,r,n=[],i=this.getPoint(0),o=0;for(n.push(0),r=1;e>=r;r++)t=this.getPoint(r/e),o+=t.distanceTo(i),n.push(o),i=t;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var r,n=this.getLengths(),i=0,o=n.length;r=t?t:e*n[o-1];for(var a,s=0,c=o-1;c>=s;)if(i=Math.floor(s+(c-s)/2),a=n[i]-r,0>a)s=i+1;else{if(!(a>0)){c=i;break}c=i-1}if(i=c,n[i]===r){var u=i/(o-1);return u}var h=n[i],l=n[i+1],f=l-h,p=(r-h)/f,u=(i+p)/(o-1);return u},getTangent:function(e){var t=1e-4,r=e-t,n=e+t;0>r&&(r=0),n>1&&(n=1);var i=this.getPoint(r),o=this.getPoint(n),a=o.clone().sub(i);return a.normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)}},a.Curve.Utils=a.CurveUtils,a.Curve.create=function(e,t){return e.prototype=Object.create(a.Curve.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},a.CurvePath=function(){this.curves=[],this.autoClose=!1},a.CurvePath.prototype=Object.create(a.Curve.prototype),a.CurvePath.prototype.constructor=a.CurvePath,a.CurvePath.prototype.add=function(e){this.curves.push(e)},a.CurvePath.prototype.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 a.LineCurve(t,e))},a.CurvePath.prototype.getPoint=function(e){for(var t=e*this.getLength(),r=this.getCurveLengths(),n=0;n=t){var i=r[n]-t,o=this.curves[n],a=1-i/o.getLength();return o.getPointAt(a)}n++}return null},a.CurvePath.prototype.getLength=function(){var e=this.getCurveLengths();return e[e.length-1]},a.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,r=0,n=this.curves.length;n>r;r++)t+=this.curves[r].getLength(),e.push(t);return this.cacheLengths=e,e},a.CurvePath.prototype.createPointsGeometry=function(e){var t=this.getPoints(e,!0);return this.createGeometry(t)},a.CurvePath.prototype.createSpacedPointsGeometry=function(e){var t=this.getSpacedPoints(e,!0);return this.createGeometry(t)},a.CurvePath.prototype.createGeometry=function(e){for(var t=new a.Geometry,r=0,n=e.length;n>r;r++){var i=e[r];t.vertices.push(new a.Vector3(i.x,i.y,i.z||0))}return t},a.Path=function(e){a.CurvePath.call(this),this.actions=[],e&&this.fromPoints(e)},a.Path.prototype=Object.create(a.CurvePath.prototype),a.Path.prototype.constructor=a.Path,a.Path.prototype.fromPoints=function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,r=e.length;r>t;t++)this.lineTo(e[t].x,e[t].y)},a.Path.prototype.moveTo=function(e,t){this.actions.push({action:"moveTo",args:[e,t]})},a.Path.prototype.lineTo=function(e,t){var r=this.actions[this.actions.length-1].args,n=r[r.length-2],i=r[r.length-1],o=new a.LineCurve(new a.Vector2(n,i),new a.Vector2(e,t));this.curves.push(o),this.actions.push({action:"lineTo",args:[e,t]})},a.Path.prototype.quadraticCurveTo=function(e,t,r,n){var i=this.actions[this.actions.length-1].args,o=i[i.length-2],s=i[i.length-1],c=new a.QuadraticBezierCurve(new a.Vector2(o,s),new a.Vector2(e,t),new a.Vector2(r,n));this.curves.push(c),this.actions.push({action:"quadraticCurveTo",args:[e,t,r,n]})},a.Path.prototype.bezierCurveTo=function(e,t,r,n,i,o){var s=this.actions[this.actions.length-1].args,c=s[s.length-2],u=s[s.length-1],h=new a.CubicBezierCurve(new a.Vector2(c,u),new a.Vector2(e,t),new a.Vector2(r,n),new a.Vector2(i,o));this.curves.push(h),this.actions.push({action:"bezierCurveTo",args:[e,t,r,n,i,o]})},a.Path.prototype.splineThru=function(e){var t=Array.prototype.slice.call(arguments),r=this.actions[this.actions.length-1].args,n=r[r.length-2],i=r[r.length-1],o=[new a.Vector2(n,i)];Array.prototype.push.apply(o,e);var s=new a.SplineCurve(o);this.curves.push(s),this.actions.push({action:"splineThru",args:t})},a.Path.prototype.arc=function(e,t,r,n,i,o){var a=this.actions[this.actions.length-1].args,s=a[a.length-2],c=a[a.length-1];this.absarc(e+s,t+c,r,n,i,o)},a.Path.prototype.absarc=function(e,t,r,n,i,o){this.absellipse(e,t,r,r,n,i,o)},a.Path.prototype.ellipse=function(e,t,r,n,i,o,a,s){var c=this.actions[this.actions.length-1].args,u=c[c.length-2],h=c[c.length-1];this.absellipse(e+u,t+h,r,n,i,o,a,s)},a.Path.prototype.absellipse=function(e,t,r,n,i,o,s,c){var u=[e,t,r,n,i,o,s,c||0],h=new a.EllipseCurve(e,t,r,n,i,o,s,c);this.curves.push(h);var l=h.getPoint(1);u.push(l.x),u.push(l.y),this.actions.push({action:"ellipse",args:u})},a.Path.prototype.getSpacedPoints=function(e,t){e||(e=40);for(var r=[],n=0;e>n;n++)r.push(this.getPoint(n/e));return r},a.Path.prototype.getPoints=function(e,t){e=e||12;for(var r,n,i,o,s,c,u,h,l,f,p,d=a.ShapeUtils.b2,m=a.ShapeUtils.b3,g=[],v=0,y=this.actions.length;y>v;v++){var b=this.actions[v],x=b.action,w=b.args;switch(x){case"moveTo":g.push(new a.Vector2(w[0],w[1]));break;case"lineTo":g.push(new a.Vector2(w[0],w[1]));break;case"quadraticCurveTo":r=w[2],n=w[3],s=w[0],c=w[1],g.length>0?(l=g[g.length-1],u=l.x,h=l.y):(l=this.actions[v-1].args,u=l[l.length-2],h=l[l.length-1]);for(var _=1;e>=_;_++){var S=_/e;f=d(S,u,s,r),p=d(S,h,c,n),g.push(new a.Vector2(f,p))}break;case"bezierCurveTo":r=w[4],n=w[5],s=w[0],c=w[1],i=w[2],o=w[3],g.length>0?(l=g[g.length-1],u=l.x,h=l.y):(l=this.actions[v-1].args,u=l[l.length-2],h=l[l.length-1]);for(var _=1;e>=_;_++){var S=_/e;f=m(S,u,s,i,r),p=m(S,h,c,o,n),g.push(new a.Vector2(f,p))}break;case"splineThru":l=this.actions[v-1].args;var M=new a.Vector2(l[l.length-2],l[l.length-1]),E=[M],T=e*w[0].length;E=E.concat(w[0]);for(var A=new a.SplineCurve(E),_=1;T>=_;_++)g.push(A.getPointAt(_/T));break;case"arc":for(var C,L=w[0],k=w[1],F=w[2],P=w[3],R=w[4],D=!!w[5],O=R-P,U=2*e,_=1;U>=_;_++){var S=_/U;D||(S=1-S),C=P+S*O,f=L+F*Math.cos(C),p=k+F*Math.sin(C),g.push(new a.Vector2(f,p))}break;case"ellipse":var C,B,j,L=w[0],k=w[1],$=w[2],N=w[3],P=w[4],R=w[5],D=!!w[6],I=w[7],O=R-P,U=2*e;0!==I&&(B=Math.cos(I),j=Math.sin(I));for(var _=1;U>=_;_++){var S=_/U;if(D||(S=1-S),C=P+S*O,f=L+$*Math.cos(C),p=k+N*Math.sin(C),0!==I){var V=f,G=p;f=(V-L)*B-(G-k)*j+L,p=(V-L)*j+(G-k)*B+k}g.push(new a.Vector2(f,p))}}}var z=g[g.length-1];return Math.abs(z.x-g[0].x)n;n++){var o=e[n],s=o.args,c=o.action;"moveTo"===c&&0!==r.actions.length&&(t.push(r),r=new a.Path),r[c].apply(r,s)}return 0!==r.actions.length&&t.push(r),t}function n(e){for(var t=[],r=0,n=e.length;n>r;r++){var i=e[r],o=new a.Shape;o.actions=i.actions,o.curves=i.curves,t.push(o)}return t}function i(e,t){for(var r=t.length,n=!1,i=r-1,o=0;r>o;i=o++){var a=t[i],s=t[o],c=s.x-a.x,u=s.y-a.y;if(Math.abs(u)>Number.EPSILON){if(0>u&&(a=t[o],c=-c,s=t[i],u=-u),e.ys.y)continue;if(e.y===a.y){if(e.x===a.x)return!0}else{var h=u*(e.x-a.x)-c*(e.y-a.y);if(0===h)return!0;if(0>h)continue;n=!n}}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 n}var o=a.ShapeUtils.isClockWise,s=r(this.actions);if(0===s.length)return[];if(t===!0)return n(s);var c,u,h,l=[];if(1===s.length)return u=s[0],h=new a.Shape,h.actions=u.actions,h.curves=u.curves,l.push(h),l;var f=!o(s[0].getPoints());f=e?!f:f;var p,d=[],m=[],g=[],v=0;m[v]=void 0,g[v]=[];for(var y=0,b=s.length;b>y;y++)u=s[y],p=u.getPoints(),c=o(p),c=e?!c:c,c?(!f&&m[v]&&v++,m[v]={s:new a.Shape,p:p},m[v].s.actions=u.actions,m[v].s.curves=u.curves,f&&v++,g[v]=[]):g[v].push({h:u,p:p[0]});if(!m[0])return n(s);if(m.length>1){for(var x=!1,w=[],_=0,S=m.length;S>_;_++)d[_]=[];for(var _=0,S=m.length;S>_;_++)for(var M=g[_],E=0;E0&&(x||(g=d))}for(var L,y=0,k=m.length;k>y;y++){h=m[y].s,l.push(h),L=g[y];for(var F=0,P=L.length;P>F;F++)h.holes.push(L[F].h)}return l},a.Shape=function(){a.Path.apply(this,arguments),this.holes=[]},a.Shape.prototype=Object.create(a.Path.prototype),a.Shape.prototype.constructor=a.Shape,a.Shape.prototype.extrude=function(e){return new a.ExtrudeGeometry(this,e)},a.Shape.prototype.makeGeometry=function(e){return new a.ShapeGeometry(this,e)},a.Shape.prototype.getPointsHoles=function(e){for(var t=[],r=0,n=this.holes.length;n>r;r++)t[r]=this.holes[r].getPoints(e);return t},a.Shape.prototype.extractAllPoints=function(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}},a.Shape.prototype.extractPoints=function(e){return this.extractAllPoints(e)},a.Shape.Utils=a.ShapeUtils,a.LineCurve=function(e,t){
-this.v1=e,this.v2=t},a.LineCurve.prototype=Object.create(a.Curve.prototype),a.LineCurve.prototype.constructor=a.LineCurve,a.LineCurve.prototype.getPoint=function(e){var t=this.v2.clone().sub(this.v1);return t.multiplyScalar(e).add(this.v1),t},a.LineCurve.prototype.getPointAt=function(e){return this.getPoint(e)},a.LineCurve.prototype.getTangent=function(e){var t=this.v2.clone().sub(this.v1);return t.normalize()},a.QuadraticBezierCurve=function(e,t,r){this.v0=e,this.v1=t,this.v2=r},a.QuadraticBezierCurve.prototype=Object.create(a.Curve.prototype),a.QuadraticBezierCurve.prototype.constructor=a.QuadraticBezierCurve,a.QuadraticBezierCurve.prototype.getPoint=function(e){var t=a.ShapeUtils.b2;return new a.Vector2(t(e,this.v0.x,this.v1.x,this.v2.x),t(e,this.v0.y,this.v1.y,this.v2.y))},a.QuadraticBezierCurve.prototype.getTangent=function(e){var t=a.CurveUtils.tangentQuadraticBezier;return new a.Vector2(t(e,this.v0.x,this.v1.x,this.v2.x),t(e,this.v0.y,this.v1.y,this.v2.y)).normalize()},a.CubicBezierCurve=function(e,t,r,n){this.v0=e,this.v1=t,this.v2=r,this.v3=n},a.CubicBezierCurve.prototype=Object.create(a.Curve.prototype),a.CubicBezierCurve.prototype.constructor=a.CubicBezierCurve,a.CubicBezierCurve.prototype.getPoint=function(e){var t=a.ShapeUtils.b3;return new a.Vector2(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))},a.CubicBezierCurve.prototype.getTangent=function(e){var t=a.CurveUtils.tangentCubicBezier;return new a.Vector2(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()},a.SplineCurve=function(e){this.points=void 0==e?[]:e},a.SplineCurve.prototype=Object.create(a.Curve.prototype),a.SplineCurve.prototype.constructor=a.SplineCurve,a.SplineCurve.prototype.getPoint=function(e){var t=this.points,r=(t.length-1)*e,n=Math.floor(r),i=r-n,o=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],h=a.CurveUtils.interpolate;return new a.Vector2(h(o.x,s.x,c.x,u.x,i),h(o.y,s.y,c.y,u.y,i))},a.EllipseCurve=function(e,t,r,n,i,o,a,s){this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=n,this.aStartAngle=i,this.aEndAngle=o,this.aClockwise=a,this.aRotation=s||0},a.EllipseCurve.prototype=Object.create(a.Curve.prototype),a.EllipseCurve.prototype.constructor=a.EllipseCurve,a.EllipseCurve.prototype.getPoint=function(e){var t=this.aEndAngle-this.aStartAngle;0>t&&(t+=2*Math.PI),t>2*Math.PI&&(t-=2*Math.PI);var r;r=this.aClockwise===!0?this.aEndAngle+(1-e)*(2*Math.PI-t):this.aStartAngle+e*t;var n=this.aX+this.xRadius*Math.cos(r),i=this.aY+this.yRadius*Math.sin(r);if(0!==this.aRotation){var o=Math.cos(this.aRotation),s=Math.sin(this.aRotation),c=n,u=i;n=(c-this.aX)*o-(u-this.aY)*s+this.aX,i=(c-this.aX)*s+(u-this.aY)*o+this.aY}return new a.Vector2(n,i)},a.ArcCurve=function(e,t,r,n,i,o){a.EllipseCurve.call(this,e,t,r,r,n,i,o)},a.ArcCurve.prototype=Object.create(a.EllipseCurve.prototype),a.ArcCurve.prototype.constructor=a.ArcCurve,a.LineCurve3=a.Curve.create(function(e,t){this.v1=e,this.v2=t},function(e){var t=new a.Vector3;return t.subVectors(this.v2,this.v1),t.multiplyScalar(e),t.add(this.v1),t}),a.QuadraticBezierCurve3=a.Curve.create(function(e,t,r){this.v0=e,this.v1=t,this.v2=r},function(e){var t=a.ShapeUtils.b2;return new a.Vector3(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))}),a.CubicBezierCurve3=a.Curve.create(function(e,t,r,n){this.v0=e,this.v1=t,this.v2=r,this.v3=n},function(e){var t=a.ShapeUtils.b3;return new a.Vector3(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))}),a.SplineCurve3=a.Curve.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,r=(t.length-1)*e,n=Math.floor(r),i=r-n,o=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],h=a.CurveUtils.interpolate;return new a.Vector3(h(o.x,s.x,c.x,u.x,i),h(o.y,s.y,c.y,u.y,i),h(o.z,s.z,c.z,u.z,i))}),a.CatmullRomCurve3=function(){function e(){}var t=new a.Vector3,r=new e,n=new e,i=new e;return e.prototype.init=function(e,t,r,n){this.c0=e,this.c1=r,this.c2=-3*e+3*t-2*r-n,this.c3=2*e-2*t+r+n},e.prototype.initNonuniformCatmullRom=function(e,t,r,n,i,o,a){var s=(t-e)/i-(r-e)/(i+o)+(r-t)/o,c=(r-t)/o-(n-t)/(o+a)+(n-r)/a;s*=o,c*=o,this.init(t,r,s,c)},e.prototype.initCatmullRom=function(e,t,r,n,i){this.init(t,r,i*(r-e),i*(n-t))},e.prototype.calc=function(e){var t=e*e,r=t*e;return this.c0+this.c1*e+this.c2*t+this.c3*r},a.Curve.create(function(e){this.points=e||[]},function(e){var o,s,c,u,h=this.points;u=h.length,2>u&&console.log("duh, you need at least 2 points"),o=(u-1)*e,s=Math.floor(o),c=o-s,0===c&&s===u-1&&(s=u-2,c=1);var l,f,p,d;if(0===s?(t.subVectors(h[0],h[1]).add(h[0]),l=t):l=h[s-1],f=h[s],p=h[s+1],u>s+2?d=h[s+2]:(t.subVectors(h[u-1],h[u-2]).add(h[u-2]),d=t),void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var m="chordal"===this.type?.5:.25,g=Math.pow(l.distanceToSquared(f),m),v=Math.pow(f.distanceToSquared(p),m),y=Math.pow(p.distanceToSquared(d),m);1e-4>v&&(v=1),1e-4>g&&(g=v),1e-4>y&&(y=v),r.initNonuniformCatmullRom(l.x,f.x,p.x,d.x,g,v,y),n.initNonuniformCatmullRom(l.y,f.y,p.y,d.y,g,v,y),i.initNonuniformCatmullRom(l.z,f.z,p.z,d.z,g,v,y)}else if("catmullrom"===this.type){var b=void 0!==this.tension?this.tension:.5;r.initCatmullRom(l.x,f.x,p.x,d.x,b),n.initCatmullRom(l.y,f.y,p.y,d.y,b),i.initCatmullRom(l.z,f.z,p.z,d.z,b)}var x=new a.Vector3(r.calc(c),n.calc(c),i.calc(c));return x})}(),a.ClosedSplineCurve3=a.Curve.create(function(e){this.points=void 0==e?[]:e},function(e){var t=this.points,r=(t.length-0)*e,n=Math.floor(r),i=r-n;n+=n>0?0:(Math.floor(Math.abs(n)/t.length)+1)*t.length;var o=t[(n-1)%t.length],s=t[n%t.length],c=t[(n+1)%t.length],u=t[(n+2)%t.length],h=a.CurveUtils.interpolate;return new a.Vector3(h(o.x,s.x,c.x,u.x,i),h(o.y,s.y,c.y,u.y,i),h(o.z,s.z,c.z,u.z,i))}),a.BoxGeometry=function(e,t,r,n,i,o){function s(e,t,r,n,i,o,s,u){var h,l,f,p=c.widthSegments,d=c.heightSegments,m=i/2,g=o/2,v=c.vertices.length;"x"===e&&"y"===t||"y"===e&&"x"===t?h="z":"x"===e&&"z"===t||"z"===e&&"x"===t?(h="y",d=c.depthSegments):("z"===e&&"y"===t||"y"===e&&"z"===t)&&(h="x",p=c.depthSegments);var y=p+1,b=d+1,x=i/p,w=o/d,_=new a.Vector3;for(_[h]=s>0?1:-1,f=0;b>f;f++)for(l=0;y>l;l++){var S=new a.Vector3;S[e]=(l*x-m)*r,S[t]=(f*w-g)*n,S[h]=s,c.vertices.push(S)}for(f=0;d>f;f++)for(l=0;p>l;l++){var M=l+y*f,E=l+y*(f+1),T=l+1+y*(f+1),A=l+1+y*f,C=new a.Vector2(l/p,1-f/d),L=new a.Vector2(l/p,1-(f+1)/d),k=new a.Vector2((l+1)/p,1-(f+1)/d),F=new a.Vector2((l+1)/p,1-f/d),P=new a.Face3(M+v,E+v,A+v);P.normal.copy(_),P.vertexNormals.push(_.clone(),_.clone(),_.clone()),P.materialIndex=u,c.faces.push(P),c.faceVertexUvs[0].push([C,L,F]),P=new a.Face3(E+v,T+v,A+v),P.normal.copy(_),P.vertexNormals.push(_.clone(),_.clone(),_.clone()),P.materialIndex=u,c.faces.push(P),c.faceVertexUvs[0].push([L.clone(),k,F.clone()])}}a.Geometry.call(this),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:r,widthSegments:n,heightSegments:i,depthSegments:o},this.widthSegments=n||1,this.heightSegments=i||1,this.depthSegments=o||1;var c=this,u=e/2,h=t/2,l=r/2;s("z","y",-1,-1,r,t,u,0),s("z","y",1,-1,r,t,-u,1),s("x","z",1,1,e,r,h,2),s("x","z",1,-1,e,r,-h,3),s("x","y",1,-1,e,t,l,4),s("x","y",-1,-1,e,t,-l,5),this.mergeVertices()},a.BoxGeometry.prototype=Object.create(a.Geometry.prototype),a.BoxGeometry.prototype.constructor=a.BoxGeometry,a.BoxGeometry.prototype.clone=function(){var e=this.parameters;return new a.BoxGeometry(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)},a.CubeGeometry=a.BoxGeometry,a.CircleGeometry=function(e,t,r,n){a.Geometry.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:r,thetaLength:n},this.fromBufferGeometry(new a.CircleBufferGeometry(e,t,r,n))},a.CircleGeometry.prototype=Object.create(a.Geometry.prototype),a.CircleGeometry.prototype.constructor=a.CircleGeometry,a.CircleGeometry.prototype.clone=function(){var e=this.parameters;return new a.CircleGeometry(e.radius,e.segments,e.thetaStart,e.thetaLength)},a.CircleBufferGeometry=function(e,t,r,n){a.BufferGeometry.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:r,thetaLength:n},e=e||50,t=void 0!==t?Math.max(3,t):8,r=void 0!==r?r:0,n=void 0!==n?n:2*Math.PI;var i=t+2,o=new Float32Array(3*i),s=new Float32Array(3*i),c=new Float32Array(2*i);s[2]=1,c[0]=.5,c[1]=.5;for(var u=0,h=3,l=2;t>=u;u++,h+=3,l+=2){var f=r+u/t*n;o[h]=e*Math.cos(f),o[h+1]=e*Math.sin(f),s[h+2]=1,c[l]=(o[h]/e+1)/2,c[l+1]=(o[h+1]/e+1)/2}for(var p=[],h=1;t>=h;h++)p.push(h,h+1,0);this.setIndex(new a.BufferAttribute(new Uint16Array(p),1)),this.addAttribute("position",new a.BufferAttribute(o,3)),this.addAttribute("normal",new a.BufferAttribute(s,3)),this.addAttribute("uv",new a.BufferAttribute(c,2)),this.boundingSphere=new a.Sphere(new a.Vector3,e)},a.CircleBufferGeometry.prototype=Object.create(a.BufferGeometry.prototype),a.CircleBufferGeometry.prototype.constructor=a.CircleBufferGeometry,a.CircleBufferGeometry.prototype.clone=function(){var e=this.parameters;return new a.CircleBufferGeometry(e.radius,e.segments,e.thetaStart,e.thetaLength)},a.CylinderGeometry=function(e,t,r,n,i,o,s,c){a.Geometry.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:r,radialSegments:n,heightSegments:i,openEnded:o,thetaStart:s,thetaLength:c},e=void 0!==e?e:20,t=void 0!==t?t:20,r=void 0!==r?r:100,n=n||8,i=i||1,o=void 0!==o?o:!1,s=void 0!==s?s:0,c=void 0!==c?c:2*Math.PI;var u,h,l=r/2,f=[],p=[];for(h=0;i>=h;h++){var d=[],m=[],g=h/i,v=g*(t-e)+e;for(u=0;n>=u;u++){var y=u/n,b=new a.Vector3;b.x=v*Math.sin(y*c+s),b.y=-g*r+l,b.z=v*Math.cos(y*c+s),this.vertices.push(b),d.push(this.vertices.length-1),m.push(new a.Vector2(y,1-g))}f.push(d),p.push(m)}var x,w,_=(t-e)/r;for(u=0;n>u;u++)for(0!==e?(x=this.vertices[f[0][u]].clone(),w=this.vertices[f[0][u+1]].clone()):(x=this.vertices[f[1][u]].clone(),w=this.vertices[f[1][u+1]].clone()),x.setY(Math.sqrt(x.x*x.x+x.z*x.z)*_).normalize(),w.setY(Math.sqrt(w.x*w.x+w.z*w.z)*_).normalize(),h=0;i>h;h++){var S=f[h][u],M=f[h+1][u],E=f[h+1][u+1],T=f[h][u+1],A=x.clone(),C=x.clone(),L=w.clone(),k=w.clone(),F=p[h][u].clone(),P=p[h+1][u].clone(),R=p[h+1][u+1].clone(),D=p[h][u+1].clone();this.faces.push(new a.Face3(S,M,T,[A,C,k])),this.faceVertexUvs[0].push([F,P,D]),this.faces.push(new a.Face3(M,E,T,[C.clone(),L,k.clone()])),this.faceVertexUvs[0].push([P.clone(),R,D.clone()])}if(o===!1&&e>0)for(this.vertices.push(new a.Vector3(0,l,0)),u=0;n>u;u++){var S=f[0][u],M=f[0][u+1],E=this.vertices.length-1,A=new a.Vector3(0,1,0),C=new a.Vector3(0,1,0),L=new a.Vector3(0,1,0),F=p[0][u].clone(),P=p[0][u+1].clone(),R=new a.Vector2(P.x,0);this.faces.push(new a.Face3(S,M,E,[A,C,L],void 0,1)),this.faceVertexUvs[0].push([F,P,R])}if(o===!1&&t>0)for(this.vertices.push(new a.Vector3(0,-l,0)),u=0;n>u;u++){var S=f[i][u+1],M=f[i][u],E=this.vertices.length-1,A=new a.Vector3(0,-1,0),C=new a.Vector3(0,-1,0),L=new a.Vector3(0,-1,0),F=p[i][u+1].clone(),P=p[i][u].clone(),R=new a.Vector2(P.x,1);this.faces.push(new a.Face3(S,M,E,[A,C,L],void 0,2)),this.faceVertexUvs[0].push([F,P,R])}this.computeFaceNormals()},a.CylinderGeometry.prototype=Object.create(a.Geometry.prototype),a.CylinderGeometry.prototype.constructor=a.CylinderGeometry,a.CylinderGeometry.prototype.clone=function(){var e=this.parameters;return new a.CylinderGeometry(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)},a.EdgesGeometry=function(e,t){function r(e,t){return e-t}a.BufferGeometry.call(this),t=void 0!==t?t:1;var n,i=Math.cos(a.Math.degToRad(t)),o=[0,0],s={},c=["a","b","c"];e instanceof a.BufferGeometry?(n=new a.Geometry,n.fromBufferGeometry(e)):n=e.clone(),n.mergeVertices(),n.computeFaceNormals();for(var u=n.vertices,h=n.faces,l=0,f=h.length;f>l;l++)for(var p=h[l],d=0;3>d;d++){o[0]=p[c[d]],o[1]=p[c[(d+1)%3]],o.sort(r);var m=o.toString();void 0===s[m]?s[m]={vert1:o[0],vert2:o[1],face1:l,face2:void 0}:s[m].face2=l}var g=[];for(var m in s){var v=s[m];if(void 0===v.face2||h[v.face1].normal.dot(h[v.face2].normal)<=i){var y=u[v.vert1];g.push(y.x),g.push(y.y),g.push(y.z),y=u[v.vert2],g.push(y.x),g.push(y.y),g.push(y.z)}}this.addAttribute("position",new a.BufferAttribute(new Float32Array(g),3))},a.EdgesGeometry.prototype=Object.create(a.BufferGeometry.prototype),a.EdgesGeometry.prototype.constructor=a.EdgesGeometry,a.ExtrudeGeometry=function(e,t){return"undefined"==typeof e?void(e=[]):(a.Geometry.call(this),this.type="ExtrudeGeometry",e=Array.isArray(e)?e:[e],this.addShapeList(e,t),void this.computeFaceNormals())},a.ExtrudeGeometry.prototype=Object.create(a.Geometry.prototype),a.ExtrudeGeometry.prototype.constructor=a.ExtrudeGeometry,a.ExtrudeGeometry.prototype.addShapeList=function(e,t){for(var r=e.length,n=0;r>n;n++){var i=e[n];this.addShape(i,t)}},a.ExtrudeGeometry.prototype.addShape=function(e,t){function r(e,t,r){return t||console.error("THREE.ExtrudeGeometry: vec does not exist"),t.clone().multiplyScalar(r).add(e)}function n(e,t,r){var n,i,o=1,s=e.x-t.x,c=e.y-t.y,u=r.x-e.x,h=r.y-e.y,l=s*s+c*c,f=s*h-c*u;if(Math.abs(f)>Number.EPSILON){var p=Math.sqrt(l),d=Math.sqrt(u*u+h*h),m=t.x-c/p,g=t.y+s/p,v=r.x-h/d,y=r.y+u/d,b=((v-m)*h-(y-g)*u)/(s*h-c*u);n=m+s*b-e.x,i=g+c*b-e.y;var x=n*n+i*i;if(2>=x)return new a.Vector2(n,i);o=Math.sqrt(x/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(h)&&(w=!0),w?(n=-c,i=s,o=Math.sqrt(l)):(n=s,i=c,o=Math.sqrt(l/2))}return new a.Vector2(n/o,i/o)}function i(){if(x){var e=0,t=G*e;for(W=0;z>W;W++)V=O[W],u(V[2]+t,V[1]+t,V[0]+t);for(e=_+2*b,t=G*e,W=0;z>W;W++)V=O[W],u(V[0]+t,V[1]+t,V[2]+t)}else{for(W=0;z>W;W++)V=O[W],u(V[2],V[1],V[0]);for(W=0;z>W;W++)V=O[W],u(V[0]+G*_,V[1]+G*_,V[2]+G*_)}}function o(){var e=0;for(s(U,e),e+=U.length,A=0,C=R.length;C>A;A++)T=R[A],s(T,e),e+=T.length}function s(e,t){var r,n;for(W=e.length;--W>=0;){r=W,n=W-1,0>n&&(n=e.length-1);var i=0,o=_+2*b;for(i=0;o>i;i++){var a=G*i,s=G*(i+1),c=t+r+a,u=t+n+a,l=t+n+s,f=t+r+s;h(c,u,l,f,e,i,o,r,n)}}}function c(e,t,r){L.vertices.push(new a.Vector3(e,t,r))}function u(e,t,r){e+=k,t+=k,r+=k,L.faces.push(new a.Face3(e,t,r,null,null,0));var n=E.generateTopUV(L,e,t,r);L.faceVertexUvs[0].push(n)}function h(e,t,r,n,i,o,s,c,u){e+=k,t+=k,r+=k,n+=k,L.faces.push(new a.Face3(e,t,n,null,null,1)),L.faces.push(new a.Face3(t,r,n,null,null,1));var h=E.generateSideWallUV(L,e,t,r,n);L.faceVertexUvs[0].push([h[0],h[1],h[3]]),L.faceVertexUvs[0].push([h[1],h[2],h[3]])}var l,f,p,d,m,g=void 0!==t.amount?t.amount:100,v=void 0!==t.bevelThickness?t.bevelThickness:6,y=void 0!==t.bevelSize?t.bevelSize:v-2,b=void 0!==t.bevelSegments?t.bevelSegments:3,x=void 0!==t.bevelEnabled?t.bevelEnabled:!0,w=void 0!==t.curveSegments?t.curveSegments:12,_=void 0!==t.steps?t.steps:1,S=t.extrudePath,M=!1,E=void 0!==t.UVGenerator?t.UVGenerator:a.ExtrudeGeometry.WorldUVGenerator;S&&(l=S.getSpacedPoints(_),M=!0,x=!1,f=void 0!==t.frames?t.frames:new a.TubeGeometry.FrenetFrames(S,_,!1),p=new a.Vector3,d=new a.Vector3,m=new a.Vector3),x||(b=0,v=0,y=0);var T,A,C,L=this,k=this.vertices.length,F=e.extractPoints(w),P=F.shape,R=F.holes,D=!a.ShapeUtils.isClockWise(P);if(D){for(P=P.reverse(),A=0,C=R.length;C>A;A++)T=R[A],a.ShapeUtils.isClockWise(T)&&(R[A]=T.reverse());D=!1}var O=a.ShapeUtils.triangulateShape(P,R),U=P;for(A=0,C=R.length;C>A;A++)T=R[A],P=P.concat(T);for(var B,j,$,N,I,V,G=P.length,z=O.length,H=[],W=0,X=U.length,q=X-1,K=W+1;X>W;W++,q++,K++)q===X&&(q=0),K===X&&(K=0),H[W]=n(U[W],U[q],U[K]);var Y,Q=[],Z=H.concat();for(A=0,C=R.length;C>A;A++){for(T=R[A],Y=[],W=0,X=T.length,q=X-1,K=W+1;X>W;W++,q++,K++)q===X&&(q=0),K===X&&(K=0),Y[W]=n(T[W],T[q],T[K]);Q.push(Y),Z=Z.concat(Y)}for(B=0;b>B;B++){for($=B/b,N=v*(1-$),j=y*Math.sin($*Math.PI/2),W=0,X=U.length;X>W;W++)I=r(U[W],H[W],j),c(I.x,I.y,-N);for(A=0,C=R.length;C>A;A++)for(T=R[A],Y=Q[A],W=0,X=T.length;X>W;W++)I=r(T[W],Y[W],j),c(I.x,I.y,-N)}for(j=y,W=0;G>W;W++)I=x?r(P[W],Z[W],j):P[W],M?(d.copy(f.normals[0]).multiplyScalar(I.x),p.copy(f.binormals[0]).multiplyScalar(I.y),m.copy(l[0]).add(d).add(p),c(m.x,m.y,m.z)):c(I.x,I.y,0);var J;for(J=1;_>=J;J++)for(W=0;G>W;W++)I=x?r(P[W],Z[W],j):P[W],M?(d.copy(f.normals[J]).multiplyScalar(I.x),p.copy(f.binormals[J]).multiplyScalar(I.y),m.copy(l[J]).add(d).add(p),c(m.x,m.y,m.z)):c(I.x,I.y,g/_*J);for(B=b-1;B>=0;B--){for($=B/b,N=v*(1-$),j=y*Math.sin($*Math.PI/2),W=0,X=U.length;X>W;W++)I=r(U[W],H[W],j),c(I.x,I.y,g+N);for(A=0,C=R.length;C>A;A++)for(T=R[A],Y=Q[A],W=0,X=T.length;X>W;W++)I=r(T[W],Y[W],j),M?c(I.x,I.y+l[_-1].y,l[_-1].x+N):c(I.x,I.y,g+N)}i(),o()},a.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(e,t,r,n){var i=e.vertices,o=i[t],s=i[r],c=i[n];return[new a.Vector2(o.x,o.y),new a.Vector2(s.x,s.y),new a.Vector2(c.x,c.y)]},generateSideWallUV:function(e,t,r,n,i){var o=e.vertices,s=o[t],c=o[r],u=o[n],h=o[i];return Math.abs(s.y-c.y)<.01?[new a.Vector2(s.x,1-s.z),new a.Vector2(c.x,1-c.z),new a.Vector2(u.x,1-u.z),new a.Vector2(h.x,1-h.z)]:[new a.Vector2(s.y,1-s.z),new a.Vector2(c.y,1-c.z),new a.Vector2(u.y,1-u.z),new a.Vector2(h.y,1-h.z)]}},a.ShapeGeometry=function(e,t){a.Geometry.call(this),this.type="ShapeGeometry",Array.isArray(e)===!1&&(e=[e]),this.addShapeList(e,t),this.computeFaceNormals()},a.ShapeGeometry.prototype=Object.create(a.Geometry.prototype),a.ShapeGeometry.prototype.constructor=a.ShapeGeometry,a.ShapeGeometry.prototype.addShapeList=function(e,t){for(var r=0,n=e.length;n>r;r++)this.addShape(e[r],t);return this},a.ShapeGeometry.prototype.addShape=function(e,t){void 0===t&&(t={});var r,n,i,o=void 0!==t.curveSegments?t.curveSegments:12,s=t.material,c=void 0===t.UVGenerator?a.ExtrudeGeometry.WorldUVGenerator:t.UVGenerator,u=this.vertices.length,h=e.extractPoints(o),l=h.shape,f=h.holes,p=!a.ShapeUtils.isClockWise(l);if(p){for(l=l.reverse(),r=0,n=f.length;n>r;r++)i=f[r],a.ShapeUtils.isClockWise(i)&&(f[r]=i.reverse());p=!1}var d=a.ShapeUtils.triangulateShape(l,f);for(r=0,n=f.length;n>r;r++)i=f[r],l=l.concat(i);var m,g,v=l.length,y=d.length;for(r=0;v>r;r++)m=l[r],this.vertices.push(new a.Vector3(m.x,m.y,0));for(r=0;y>r;r++){g=d[r];var b=g[0]+u,x=g[1]+u,w=g[2]+u;this.faces.push(new a.Face3(b,x,w,null,null,s)),this.faceVertexUvs[0].push(c.generateTopUV(this,b,x,w))}},a.LatheGeometry=function(e,t,r,n){a.Geometry.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:r,phiLength:n},t=t||12,r=r||0,n=n||2*Math.PI;for(var i=1/(e.length-1),o=1/t,s=0,c=t;c>=s;s++)for(var u=r+s*o*n,h=Math.cos(u),l=Math.sin(u),f=0,p=e.length;p>f;f++){var d=e[f],m=new a.Vector3;m.x=h*d.x-l*d.y,m.y=l*d.x+h*d.y,m.z=d.z,this.vertices.push(m)}for(var g=e.length,s=0,c=t;c>s;s++)for(var f=0,p=e.length-1;p>f;f++){var v=f+g*s,y=v,b=v+g,h=v+1+g,x=v+1,w=s*o,_=f*i,S=w+o,M=_+i;this.faces.push(new a.Face3(y,b,x)),this.faceVertexUvs[0].push([new a.Vector2(w,_),new a.Vector2(S,_),new a.Vector2(w,M)]),this.faces.push(new a.Face3(b,h,x)),this.faceVertexUvs[0].push([new a.Vector2(S,_),new a.Vector2(S,M),new a.Vector2(w,M)])}this.mergeVertices(),this.computeFaceNormals(),this.computeVertexNormals()},a.LatheGeometry.prototype=Object.create(a.Geometry.prototype),a.LatheGeometry.prototype.constructor=a.LatheGeometry,a.PlaneGeometry=function(e,t,r,n){a.Geometry.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:r,heightSegments:n},this.fromBufferGeometry(new a.PlaneBufferGeometry(e,t,r,n))},a.PlaneGeometry.prototype=Object.create(a.Geometry.prototype),a.PlaneGeometry.prototype.constructor=a.PlaneGeometry,a.PlaneGeometry.prototype.clone=function(){var e=this.parameters;return new a.PlaneGeometry(e.width,e.height,e.widthSegments,e.heightSegments)},a.PlaneBufferGeometry=function(e,t,r,n){a.BufferGeometry.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:r,heightSegments:n};for(var i=e/2,o=t/2,s=Math.floor(r)||1,c=Math.floor(n)||1,u=s+1,h=c+1,l=e/s,f=t/c,p=new Float32Array(u*h*3),d=new Float32Array(u*h*3),m=new Float32Array(u*h*2),g=0,v=0,y=0;h>y;y++)for(var b=y*f-o,x=0;u>x;x++){var w=x*l-i;p[g]=w,p[g+1]=-b,d[g+2]=1,m[v]=x/s,m[v+1]=1-y/c,g+=3,v+=2}g=0;for(var _=new(p.length/3>65535?Uint32Array:Uint16Array)(s*c*6),y=0;c>y;y++)for(var x=0;s>x;x++){var S=x+u*y,M=x+u*(y+1),E=x+1+u*(y+1),T=x+1+u*y;_[g]=S,_[g+1]=M,_[g+2]=T,_[g+3]=M,_[g+4]=E,_[g+5]=T,g+=6}this.setIndex(new a.BufferAttribute(_,1)),this.addAttribute("position",new a.BufferAttribute(p,3)),this.addAttribute("normal",new a.BufferAttribute(d,3)),this.addAttribute("uv",new a.BufferAttribute(m,2))},a.PlaneBufferGeometry.prototype=Object.create(a.BufferGeometry.prototype),a.PlaneBufferGeometry.prototype.constructor=a.PlaneBufferGeometry,a.PlaneBufferGeometry.prototype.clone=function(){var e=this.parameters;return new a.PlaneBufferGeometry(e.width,e.height,e.widthSegments,e.heightSegments)},a.RingGeometry=function(e,t,r,n,i,o){a.Geometry.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:r,phiSegments:n,thetaStart:i,thetaLength:o},e=e||0,t=t||50,i=void 0!==i?i:0,o=void 0!==o?o:2*Math.PI,r=void 0!==r?Math.max(3,r):8,n=void 0!==n?Math.max(1,n):8;var s,c,u=[],h=e,l=(t-e)/n;for(s=0;n+1>s;s++){for(c=0;r+1>c;c++){var f=new a.Vector3,p=i+c/r*o;f.x=h*Math.cos(p),f.y=h*Math.sin(p),this.vertices.push(f),u.push(new a.Vector2((f.x/t+1)/2,(f.y/t+1)/2))}h+=l}var d=new a.Vector3(0,0,1);for(s=0;n>s;s++){var m=s*(r+1);for(c=0;r>c;c++){var p=c+m,g=p,v=p+r+1,y=p+r+2;this.faces.push(new a.Face3(g,v,y,[d.clone(),d.clone(),d.clone()])),this.faceVertexUvs[0].push([u[g].clone(),u[v].clone(),u[y].clone()]),g=p,v=p+r+2,y=p+1,this.faces.push(new a.Face3(g,v,y,[d.clone(),d.clone(),d.clone()])),this.faceVertexUvs[0].push([u[g].clone(),u[v].clone(),u[y].clone()])}}this.computeFaceNormals(),this.boundingSphere=new a.Sphere(new a.Vector3,h)},a.RingGeometry.prototype=Object.create(a.Geometry.prototype),a.RingGeometry.prototype.constructor=a.RingGeometry,a.RingGeometry.prototype.clone=function(){var e=this.parameters;return new a.RingGeometry(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)},a.SphereGeometry=function(e,t,r,n,i,o,s){a.Geometry.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:r,phiStart:n,phiLength:i,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new a.SphereBufferGeometry(e,t,r,n,i,o,s))},a.SphereGeometry.prototype=Object.create(a.Geometry.prototype),a.SphereGeometry.prototype.constructor=a.SphereGeometry,a.SphereGeometry.prototype.clone=function(){var e=this.parameters;return new a.SphereGeometry(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)},a.SphereBufferGeometry=function(e,t,r,n,i,o,s){a.BufferGeometry.call(this),this.type="SphereBufferGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:r,phiStart:n,phiLength:i,thetaStart:o,thetaLength:s},e=e||50,t=Math.max(3,Math.floor(t)||8),r=Math.max(2,Math.floor(r)||6),n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI,o=void 0!==o?o:0,s=void 0!==s?s:Math.PI;for(var c=o+s,u=(t+1)*(r+1),h=new a.BufferAttribute(new Float32Array(3*u),3),l=new a.BufferAttribute(new Float32Array(3*u),3),f=new a.BufferAttribute(new Float32Array(2*u),2),p=0,d=[],m=new a.Vector3,g=0;r>=g;g++){for(var v=[],y=g/r,b=0;t>=b;b++){var x=b/t,w=-e*Math.cos(n+x*i)*Math.sin(o+y*s),_=e*Math.cos(o+y*s),S=e*Math.sin(n+x*i)*Math.sin(o+y*s);m.set(w,_,S).normalize(),h.setXYZ(p,w,_,S),l.setXYZ(p,m.x,m.y,m.z),f.setXY(p,x,1-y),v.push(p),p++}d.push(v)}for(var M=[],g=0;r>g;g++)for(var b=0;t>b;b++){var E=d[g][b+1],T=d[g][b],A=d[g+1][b],C=d[g+1][b+1];(0!==g||o>0)&&M.push(E,T,C),(g!==r-1||c65535?a.Uint32Attribute:a.Uint16Attribute)(M,1)),this.addAttribute("position",h),this.addAttribute("normal",l),this.addAttribute("uv",f),this.boundingSphere=new a.Sphere(new a.Vector3,e)},a.SphereBufferGeometry.prototype=Object.create(a.BufferGeometry.prototype),a.SphereBufferGeometry.prototype.constructor=a.SphereBufferGeometry,a.SphereBufferGeometry.prototype.clone=function(){var e=this.parameters;return new a.SphereBufferGeometry(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)},a.TorusGeometry=function(e,t,r,n,i){a.Geometry.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:r,tubularSegments:n,arc:i},e=e||100,t=t||40,r=r||8,n=n||6,i=i||2*Math.PI;for(var o=new a.Vector3,s=[],c=[],u=0;r>=u;u++)for(var h=0;n>=h;h++){var l=h/n*i,f=u/r*Math.PI*2;o.x=e*Math.cos(l),o.y=e*Math.sin(l);var p=new a.Vector3;p.x=(e+t*Math.cos(f))*Math.cos(l),p.y=(e+t*Math.cos(f))*Math.sin(l),p.z=t*Math.sin(f),this.vertices.push(p),s.push(new a.Vector2(h/n,u/r)),c.push(p.clone().sub(o).normalize())}for(var u=1;r>=u;u++)for(var h=1;n>=h;h++){var d=(n+1)*u+h-1,m=(n+1)*(u-1)+h-1,g=(n+1)*(u-1)+h,v=(n+1)*u+h,y=new a.Face3(d,m,v,[c[d].clone(),c[m].clone(),c[v].clone()]);this.faces.push(y),this.faceVertexUvs[0].push([s[d].clone(),s[m].clone(),s[v].clone()]),y=new a.Face3(m,g,v,[c[m].clone(),c[g].clone(),c[v].clone()]),this.faces.push(y),this.faceVertexUvs[0].push([s[m].clone(),s[g].clone(),s[v].clone()])}this.computeFaceNormals()},a.TorusGeometry.prototype=Object.create(a.Geometry.prototype),a.TorusGeometry.prototype.constructor=a.TorusGeometry,a.TorusGeometry.prototype.clone=function(){var e=this.parameters;return new a.TorusGeometry(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)},a.TorusKnotGeometry=function(e,t,r,n,i,o,s){function c(e,t,r,n,i){var o=Math.cos(e),s=Math.sin(e),c=t/r*e,u=Math.cos(c),h=n*(2+u)*.5*o,l=n*(2+u)*s*.5,f=i*n*Math.sin(c)*.5;return new a.Vector3(h,l,f)}a.Geometry.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,radialSegments:r,tubularSegments:n,p:i,q:o,heightScale:s},e=e||100,t=t||40,r=r||64,n=n||8,i=i||2,o=o||3,s=s||1;for(var u=new Array(r),h=new a.Vector3,l=new a.Vector3,f=new a.Vector3,p=0;r>p;++p){u[p]=new Array(n);var d=p/r*2*i*Math.PI,m=c(d,o,i,e,s),g=c(d+.01,o,i,e,s);h.subVectors(g,m),l.addVectors(g,m),f.crossVectors(h,l),l.crossVectors(f,h),f.normalize(),l.normalize();for(var v=0;n>v;++v){var y=v/n*2*Math.PI,b=-t*Math.cos(y),x=t*Math.sin(y),w=new a.Vector3;w.x=m.x+b*l.x+x*f.x,w.y=m.y+b*l.y+x*f.y,w.z=m.z+b*l.z+x*f.z,u[p][v]=this.vertices.push(w)-1}}for(var p=0;r>p;++p)for(var v=0;n>v;++v){var _=(p+1)%r,S=(v+1)%n,M=u[p][v],E=u[_][v],T=u[_][S],A=u[p][S],C=new a.Vector2(p/r,v/n),L=new a.Vector2((p+1)/r,v/n),k=new a.Vector2((p+1)/r,(v+1)/n),F=new a.Vector2(p/r,(v+1)/n);this.faces.push(new a.Face3(M,E,A)),this.faceVertexUvs[0].push([C,L,F]),this.faces.push(new a.Face3(E,T,A)),this.faceVertexUvs[0].push([L.clone(),k,F.clone()])}this.computeFaceNormals(),this.computeVertexNormals()},a.TorusKnotGeometry.prototype=Object.create(a.Geometry.prototype),a.TorusKnotGeometry.prototype.constructor=a.TorusKnotGeometry,a.TorusKnotGeometry.prototype.clone=function(){var e=this.parameters;return new a.TorusKnotGeometry(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.p,e.q,e.heightScale)},a.TubeGeometry=function(e,t,r,n,i,o){function s(e,t,r){return k.vertices.push(new a.Vector3(e,t,r))-1}a.Geometry.call(this),this.type="TubeGeometry",this.parameters={path:e,segments:t,radius:r,radialSegments:n,closed:i,taper:o},t=t||64,r=r||1,n=n||8,i=i||!1,o=o||a.TubeGeometry.NoTaper;var c,u,h,l,f,p,d,m,g,v,y,b,x,w,_,S,M,E,T,A,C,L=[],k=this,F=t+1,P=new a.Vector3,R=new a.TubeGeometry.FrenetFrames(e,t,i),D=R.tangents,O=R.normals,U=R.binormals;for(this.tangents=D,this.normals=O,this.binormals=U,v=0;F>v;v++)for(L[v]=[],l=v/(F-1),g=e.getPointAt(l),c=D[v],u=O[v],h=U[v],p=r*o(l),y=0;n>y;y++)f=y/n*2*Math.PI,d=-p*Math.cos(f),m=p*Math.sin(f),P.copy(g),P.x+=d*u.x+m*h.x,P.y+=d*u.y+m*h.y,P.z+=d*u.z+m*h.z,L[v][y]=s(P.x,P.y,P.z);for(v=0;t>v;v++)for(y=0;n>y;y++)b=i?(v+1)%t:v+1,x=(y+1)%n,w=L[v][y],_=L[b][y],S=L[b][x],M=L[v][x],E=new a.Vector2(v/t,y/n),T=new a.Vector2((v+1)/t,y/n),A=new a.Vector2((v+1)/t,(y+1)/n),C=new a.Vector2(v/t,(y+1)/n),this.faces.push(new a.Face3(w,_,M)),this.faceVertexUvs[0].push([E,T,C]),this.faces.push(new a.Face3(_,S,M)),this.faceVertexUvs[0].push([T.clone(),A,C.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},a.TubeGeometry.prototype=Object.create(a.Geometry.prototype),a.TubeGeometry.prototype.constructor=a.TubeGeometry,a.TubeGeometry.prototype.clone=function(){return new this.constructor(this.parameters.path,this.parameters.segments,this.parameters.radius,this.parameters.radialSegments,this.parameters.closed,this.parameters.taper)},a.TubeGeometry.NoTaper=function(e){return 1},a.TubeGeometry.SinusoidalTaper=function(e){return Math.sin(Math.PI*e)},a.TubeGeometry.FrenetFrames=function(e,t,r){function n(){d[0]=new a.Vector3,m[0]=new a.Vector3,o=Number.MAX_VALUE,s=Math.abs(p[0].x),c=Math.abs(p[0].y),u=Math.abs(p[0].z),o>=s&&(o=s,f.set(1,0,0)),o>=c&&(o=c,f.set(0,1,0)),o>=u&&f.set(0,0,1),g.crossVectors(p[0],f).normalize(),d[0].crossVectors(p[0],g),m[0].crossVectors(p[0],d[0])}var i,o,s,c,u,h,l,f=new a.Vector3,p=[],d=[],m=[],g=new a.Vector3,v=new a.Matrix4,y=t+1;for(this.tangents=p,this.normals=d,this.binormals=m,h=0;y>h;h++)l=h/(y-1),p[h]=e.getTangentAt(l),p[h].normalize();for(n(),h=1;y>h;h++)d[h]=d[h-1].clone(),m[h]=m[h-1].clone(),g.crossVectors(p[h-1],p[h]),g.length()>Number.EPSILON&&(g.normalize(),i=Math.acos(a.Math.clamp(p[h-1].dot(p[h]),-1,1)),d[h].applyMatrix4(v.makeRotationAxis(g,i))),m[h].crossVectors(p[h],d[h]);if(r)for(i=Math.acos(a.Math.clamp(d[0].dot(d[y-1]),-1,1)),i/=y-1,p[0].dot(g.crossVectors(d[0],d[y-1]))>0&&(i=-i),h=1;y>h;h++)d[h].applyMatrix4(v.makeRotationAxis(p[h],i*h)),m[h].crossVectors(p[h],d[h])},a.PolyhedronGeometry=function(e,t,r,n){function i(e){var t=e.normalize().clone();t.index=l.vertices.push(t)-1;var r=c(e)/2/Math.PI+.5,n=u(e)/Math.PI+.5;return t.uv=new a.Vector2(r,1-n),t}function o(e,t,r,n){var i=new a.Face3(e.index,t.index,r.index,[e.clone(),t.clone(),r.clone()],void 0,n);l.faces.push(i),x.copy(e).add(t).add(r).divideScalar(3);var o=c(x);l.faceVertexUvs[0].push([h(e.uv,e,o),h(t.uv,t,o),h(r.uv,r,o)])}function s(e,t){for(var r=Math.pow(2,t),n=i(l.vertices[e.a]),a=i(l.vertices[e.b]),s=i(l.vertices[e.c]),c=[],u=e.materialIndex,h=0;r>=h;h++){c[h]=[];for(var f=i(n.clone().lerp(s,h/r)),p=i(a.clone().lerp(s,h/r)),d=r-h,m=0;d>=m;m++)0===m&&h===r?c[h][m]=f:c[h][m]=i(f.clone().lerp(p,m/d))}for(var h=0;r>h;h++)for(var m=0;2*(r-h)-1>m;m++){var g=Math.floor(m/2);m%2===0?o(c[h][g+1],c[h+1][g],c[h][g],u):o(c[h][g+1],c[h+1][g+1],c[h+1][g],u)}}function c(e){return Math.atan2(e.z,-e.x)}function u(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}function h(e,t,r){return 0>r&&1===e.x&&(e=new a.Vector2(e.x-1,e.y)),0===t.x&&0===t.z&&(e=new a.Vector2(r/2/Math.PI+.5,e.y)),e.clone()}a.Geometry.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:r,detail:n},r=r||1,n=n||0;for(var l=this,f=0,p=e.length;p>f;f+=3)i(new a.Vector3(e[f],e[f+1],e[f+2]));for(var d=this.vertices,m=[],f=0,g=0,p=t.length;p>f;f+=3,g++){var v=d[t[f]],y=d[t[f+1]],b=d[t[f+2]];m[g]=new a.Face3(v.index,y.index,b.index,[v.clone(),y.clone(),b.clone()],void 0,g)}for(var x=new a.Vector3,f=0,p=m.length;p>f;f++)s(m[f],n);for(var f=0,p=this.faceVertexUvs[0].length;p>f;f++){var w=this.faceVertexUvs[0][f],_=w[0].x,S=w[1].x,M=w[2].x,E=Math.max(_,S,M),T=Math.min(_,S,M);E>.9&&.1>T&&(.2>_&&(w[0].x+=1),.2>S&&(w[1].x+=1),.2>M&&(w[2].x+=1))}for(var f=0,p=this.vertices.length;p>f;f++)this.vertices[f].multiplyScalar(r);this.mergeVertices(),this.computeFaceNormals(),this.boundingSphere=new a.Sphere(new a.Vector3,r)},a.PolyhedronGeometry.prototype=Object.create(a.Geometry.prototype),a.PolyhedronGeometry.prototype.constructor=a.PolyhedronGeometry,a.PolyhedronGeometry.prototype.clone=function(){var e=this.parameters;return new a.PolyhedronGeometry(e.vertices,e.indices,e.radius,e.detail);
-},a.DodecahedronGeometry=function(e,t){var r=(1+Math.sqrt(5))/2,n=1/r,i=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-r,0,-n,r,0,n,-r,0,n,r,-n,-r,0,-n,r,0,n,-r,0,n,r,0,-r,0,-n,r,0,-n,-r,0,n,r,0,n],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];a.PolyhedronGeometry.call(this,i,o,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}},a.DodecahedronGeometry.prototype=Object.create(a.PolyhedronGeometry.prototype),a.DodecahedronGeometry.prototype.constructor=a.DodecahedronGeometry,a.DodecahedronGeometry.prototype.clone=function(){var e=this.parameters;return new a.DodecahedronGeometry(e.radius,e.detail)},a.IcosahedronGeometry=function(e,t){var r=(1+Math.sqrt(5))/2,n=[-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1],i=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];a.PolyhedronGeometry.call(this,n,i,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}},a.IcosahedronGeometry.prototype=Object.create(a.PolyhedronGeometry.prototype),a.IcosahedronGeometry.prototype.constructor=a.IcosahedronGeometry,a.IcosahedronGeometry.prototype.clone=function(){var e=this.parameters;return new a.IcosahedronGeometry(e.radius,e.detail)},a.OctahedronGeometry=function(e,t){var r=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],n=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];a.PolyhedronGeometry.call(this,r,n,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}},a.OctahedronGeometry.prototype=Object.create(a.PolyhedronGeometry.prototype),a.OctahedronGeometry.prototype.constructor=a.OctahedronGeometry,a.OctahedronGeometry.prototype.clone=function(){var e=this.parameters;return new a.OctahedronGeometry(e.radius,e.detail)},a.TetrahedronGeometry=function(e,t){var r=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],n=[2,1,0,0,3,2,1,3,0,2,3,1];a.PolyhedronGeometry.call(this,r,n,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}},a.TetrahedronGeometry.prototype=Object.create(a.PolyhedronGeometry.prototype),a.TetrahedronGeometry.prototype.constructor=a.TetrahedronGeometry,a.TetrahedronGeometry.prototype.clone=function(){var e=this.parameters;return new a.TetrahedronGeometry(e.radius,e.detail)},a.ParametricGeometry=function(e,t,r){a.Geometry.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:r};var n,i,o,s,c,u=this.vertices,h=this.faces,l=this.faceVertexUvs[0],f=t+1;for(n=0;r>=n;n++)for(c=n/r,i=0;t>=i;i++)s=i/t,o=e(s,c),u.push(o);var p,d,m,g,v,y,b,x;for(n=0;r>n;n++)for(i=0;t>i;i++)p=n*f+i,d=n*f+i+1,m=(n+1)*f+i+1,g=(n+1)*f+i,v=new a.Vector2(i/t,n/r),y=new a.Vector2((i+1)/t,n/r),b=new a.Vector2((i+1)/t,(n+1)/r),x=new a.Vector2(i/t,(n+1)/r),h.push(new a.Face3(p,d,g)),l.push([v,y,x]),h.push(new a.Face3(d,m,g)),l.push([y.clone(),b,x.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},a.ParametricGeometry.prototype=Object.create(a.Geometry.prototype),a.ParametricGeometry.prototype.constructor=a.ParametricGeometry,a.WireframeGeometry=function(e){function t(e,t){return e-t}a.BufferGeometry.call(this);var r=[0,0],n={},i=["a","b","c"];if(e instanceof a.Geometry){for(var o=e.vertices,s=e.faces,c=0,u=new Uint32Array(6*s.length),h=0,l=s.length;l>h;h++)for(var f=s[h],p=0;3>p;p++){r[0]=f[i[p]],r[1]=f[i[(p+1)%3]],r.sort(t);var d=r.toString();void 0===n[d]&&(u[2*c]=r[0],u[2*c+1]=r[1],n[d]=!0,c++)}for(var m=new Float32Array(2*c*3),h=0,l=c;l>h;h++)for(var p=0;2>p;p++){var g=o[u[2*h+p]],v=6*h+3*p;m[v+0]=g.x,m[v+1]=g.y,m[v+2]=g.z}this.addAttribute("position",new a.BufferAttribute(m,3))}else if(e instanceof a.BufferGeometry)if(null!==e.index){var y=e.index.array,o=e.attributes.position,b=e.drawcalls,c=0;0===b.length&&e.addGroup(0,y.length);for(var u=new Uint32Array(2*y.length),x=0,w=b.length;w>x;++x)for(var _=b[x],S=_.start,M=_.count,h=S,E=S+M;E>h;h+=3)for(var p=0;3>p;p++){r[0]=y[h+p],r[1]=y[h+(p+1)%3],r.sort(t);var d=r.toString();void 0===n[d]&&(u[2*c]=r[0],u[2*c+1]=r[1],n[d]=!0,c++)}for(var m=new Float32Array(2*c*3),h=0,l=c;l>h;h++)for(var p=0;2>p;p++){var v=6*h+3*p,T=u[2*h+p];m[v+0]=o.getX(T),m[v+1]=o.getY(T),m[v+2]=o.getZ(T)}this.addAttribute("position",new a.BufferAttribute(m,3))}else{for(var o=e.attributes.position.array,c=o.length/3,A=c/3,m=new Float32Array(2*c*3),h=0,l=A;l>h;h++)for(var p=0;3>p;p++){var v=18*h+6*p,C=9*h+3*p;m[v+0]=o[C],m[v+1]=o[C+1],m[v+2]=o[C+2];var T=9*h+3*((p+1)%3);m[v+3]=o[T],m[v+4]=o[T+1],m[v+5]=o[T+2]}this.addAttribute("position",new a.BufferAttribute(m,3))}},a.WireframeGeometry.prototype=Object.create(a.BufferGeometry.prototype),a.WireframeGeometry.prototype.constructor=a.WireframeGeometry,a.AxisHelper=function(e){e=e||1;var t=new Float32Array([0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e]),r=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]),n=new a.BufferGeometry;n.addAttribute("position",new a.BufferAttribute(t,3)),n.addAttribute("color",new a.BufferAttribute(r,3));var i=new a.LineBasicMaterial({vertexColors:a.VertexColors});a.LineSegments.call(this,n,i)},a.AxisHelper.prototype=Object.create(a.LineSegments.prototype),a.AxisHelper.prototype.constructor=a.AxisHelper,a.ArrowHelper=function(){var e=new a.Geometry;e.vertices.push(new a.Vector3(0,0,0),new a.Vector3(0,1,0));var t=new a.CylinderGeometry(0,.5,1,5,1);return t.translate(0,-.5,0),function(r,n,i,o,s,c){a.Object3D.call(this),void 0===o&&(o=16776960),void 0===i&&(i=1),void 0===s&&(s=.2*i),void 0===c&&(c=.2*s),this.position.copy(n),i>s&&(this.line=new a.Line(e,new a.LineBasicMaterial({color:o})),this.line.matrixAutoUpdate=!1,this.add(this.line)),this.cone=new a.Mesh(t,new a.MeshBasicMaterial({color:o})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(r),this.setLength(i,s,c)}}(),a.ArrowHelper.prototype=Object.create(a.Object3D.prototype),a.ArrowHelper.prototype.constructor=a.ArrowHelper,a.ArrowHelper.prototype.setDirection=function(){var e,t=new a.Vector3;return function(r){r.y>.99999?this.quaternion.set(0,0,0,1):r.y<-.99999?this.quaternion.set(1,0,0,0):(t.set(r.z,0,-r.x).normalize(),e=Math.acos(r.y),this.quaternion.setFromAxisAngle(t,e))}}(),a.ArrowHelper.prototype.setLength=function(e,t,r){void 0===t&&(t=.2*e),void 0===r&&(r=.2*t),e>t&&(this.line.scale.set(1,e-t,1),this.line.updateMatrix()),this.cone.scale.set(r,t,r),this.cone.position.y=e,this.cone.updateMatrix()},a.ArrowHelper.prototype.setColor=function(e){void 0!==this.line&&this.line.material.color.set(e),this.cone.material.color.set(e)},a.BoxHelper=function(e){var t=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),n=new a.BufferGeometry;n.setIndex(new a.BufferAttribute(t,1)),n.addAttribute("position",new a.BufferAttribute(r,3)),a.LineSegments.call(this,n,new a.LineBasicMaterial({color:16776960})),void 0!==e&&this.update(e)},a.BoxHelper.prototype=Object.create(a.LineSegments.prototype),a.BoxHelper.prototype.constructor=a.BoxHelper,a.BoxHelper.prototype.update=function(){var e=new a.Box3;return function(t){if(e.setFromObject(t),!e.empty()){var r=e.min,n=e.max,i=this.geometry.attributes.position,o=i.array;o[0]=n.x,o[1]=n.y,o[2]=n.z,o[3]=r.x,o[4]=n.y,o[5]=n.z,o[6]=r.x,o[7]=r.y,o[8]=n.z,o[9]=n.x,o[10]=r.y,o[11]=n.z,o[12]=n.x,o[13]=n.y,o[14]=r.z,o[15]=r.x,o[16]=n.y,o[17]=r.z,o[18]=r.x,o[19]=r.y,o[20]=r.z,o[21]=n.x,o[22]=r.y,o[23]=r.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),a.BoundingBoxHelper=function(e,t){var r=void 0!==t?t:8947848;this.object=e,this.box=new a.Box3,a.Mesh.call(this,new a.BoxGeometry(1,1,1),new a.MeshBasicMaterial({color:r,wireframe:!0}))},a.BoundingBoxHelper.prototype=Object.create(a.Mesh.prototype),a.BoundingBoxHelper.prototype.constructor=a.BoundingBoxHelper,a.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object),this.box.size(this.scale),this.box.center(this.position)},a.CameraHelper=function(e){function t(e,t,n){r(e,n),r(t,n)}function r(e,t){n.vertices.push(new a.Vector3),n.colors.push(new a.Color(t)),void 0===o[e]&&(o[e]=[]),o[e].push(n.vertices.length-1)}var n=new a.Geometry,i=new a.LineBasicMaterial({color:16777215,vertexColors:a.FaceColors}),o={},s=16755200,c=16711680,u=43775,h=16777215,l=3355443;t("n1","n2",s),t("n2","n4",s),t("n4","n3",s),t("n3","n1",s),t("f1","f2",s),t("f2","f4",s),t("f4","f3",s),t("f3","f1",s),t("n1","f1",s),t("n2","f2",s),t("n3","f3",s),t("n4","f4",s),t("p","n1",c),t("p","n2",c),t("p","n3",c),t("p","n4",c),t("u1","u2",u),t("u2","u3",u),t("u3","u1",u),t("c","t",h),t("p","c",l),t("cn1","cn2",l),t("cn3","cn4",l),t("cf1","cf2",l),t("cf3","cf4",l),a.LineSegments.call(this,n,i),this.camera=e,this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()},a.CameraHelper.prototype=Object.create(a.LineSegments.prototype),a.CameraHelper.prototype.constructor=a.CameraHelper,a.CameraHelper.prototype.update=function(){function e(e,o,a,s){n.set(o,a,s).unproject(i);var c=r[e];if(void 0!==c)for(var u=0,h=c.length;h>u;u++)t.vertices[c[u]].copy(n)}var t,r,n=new a.Vector3,i=new a.Camera;return function(){t=this.geometry,r=this.pointMap;var n=1,o=1;i.projectionMatrix.copy(this.camera.projectionMatrix),e("c",0,0,-1),e("t",0,0,1),e("n1",-n,-o,-1),e("n2",n,-o,-1),e("n3",-n,o,-1),e("n4",n,o,-1),e("f1",-n,-o,1),e("f2",n,-o,1),e("f3",-n,o,1),e("f4",n,o,1),e("u1",.7*n,1.1*o,-1),e("u2",.7*-n,1.1*o,-1),e("u3",0,2*o,-1),e("cf1",-n,0,1),e("cf2",n,0,1),e("cf3",0,-o,1),e("cf4",0,o,1),e("cn1",-n,0,-1),e("cn2",n,0,-1),e("cn3",0,-o,-1),e("cn4",0,o,-1),t.verticesNeedUpdate=!0}}(),a.DirectionalLightHelper=function(e,t){a.Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,t=t||1;var r=new a.Geometry;r.vertices.push(new a.Vector3(-t,t,0),new a.Vector3(t,t,0),new a.Vector3(t,-t,0),new a.Vector3(-t,-t,0),new a.Vector3(-t,t,0));var n=new a.LineBasicMaterial({fog:!1});n.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.lightPlane=new a.Line(r,n),this.add(this.lightPlane),r=new a.Geometry,r.vertices.push(new a.Vector3,new a.Vector3),n=new a.LineBasicMaterial({fog:!1}),n.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine=new a.Line(r,n),this.add(this.targetLine),this.update()},a.DirectionalLightHelper.prototype=Object.create(a.Object3D.prototype),a.DirectionalLightHelper.prototype.constructor=a.DirectionalLightHelper,a.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},a.DirectionalLightHelper.prototype.update=function(){var e=new a.Vector3,t=new a.Vector3,r=new a.Vector3;return function(){e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),r.subVectors(t,e),this.lightPlane.lookAt(r),this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine.geometry.vertices[1].copy(r),this.targetLine.geometry.verticesNeedUpdate=!0,this.targetLine.material.color.copy(this.lightPlane.material.color)}}(),a.EdgesHelper=function(e,t,r){var n=void 0!==t?t:16777215;a.LineSegments.call(this,new a.EdgesGeometry(e.geometry,r),new a.LineBasicMaterial({color:n})),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1},a.EdgesHelper.prototype=Object.create(a.LineSegments.prototype),a.EdgesHelper.prototype.constructor=a.EdgesHelper,a.FaceNormalsHelper=function(e,t,r,n){this.object=e,this.size=void 0!==t?t:1;var i=void 0!==r?r:16776960,o=void 0!==n?n:1,s=0,c=this.object.geometry;c instanceof a.Geometry?s=c.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var u=new a.BufferGeometry,h=new a.Float32Attribute(2*s*3,3);u.addAttribute("position",h),a.LineSegments.call(this,u,new a.LineBasicMaterial({color:i,linewidth:o})),this.matrixAutoUpdate=!1,this.update()},a.FaceNormalsHelper.prototype=Object.create(a.LineSegments.prototype),a.FaceNormalsHelper.prototype.constructor=a.FaceNormalsHelper,a.FaceNormalsHelper.prototype.update=function(){var e=new a.Vector3,t=new a.Vector3,r=new a.Matrix3;return function(){this.object.updateMatrixWorld(!0),r.getNormalMatrix(this.object.matrixWorld);for(var n=this.object.matrixWorld,i=this.geometry.attributes.position,o=this.object.geometry,a=o.vertices,s=o.faces,c=0,u=0,h=s.length;h>u;u++){var l=s[u],f=l.normal;e.copy(a[l.a]).add(a[l.b]).add(a[l.c]).divideScalar(3).applyMatrix4(n),t.copy(f).applyMatrix3(r).normalize().multiplyScalar(this.size).add(e),i.setXYZ(c,e.x,e.y,e.z),c+=1,i.setXYZ(c,t.x,t.y,t.z),c+=1}return i.needsUpdate=!0,this}}(),a.GridHelper=function(e,t){var r=new a.Geometry,n=new a.LineBasicMaterial({vertexColors:a.VertexColors});this.color1=new a.Color(4473924),this.color2=new a.Color(8947848);for(var i=-e;e>=i;i+=t){r.vertices.push(new a.Vector3(-e,0,i),new a.Vector3(e,0,i),new a.Vector3(i,0,-e),new a.Vector3(i,0,e));var o=0===i?this.color1:this.color2;r.colors.push(o,o,o,o)}a.LineSegments.call(this,r,n)},a.GridHelper.prototype=Object.create(a.LineSegments.prototype),a.GridHelper.prototype.constructor=a.GridHelper,a.GridHelper.prototype.setColors=function(e,t){this.color1.set(e),this.color2.set(t),this.geometry.colorsNeedUpdate=!0},a.HemisphereLightHelper=function(e,t){a.Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.colors=[new a.Color,new a.Color];var r=new a.SphereGeometry(t,4,2);r.rotateX(-Math.PI/2);for(var n=0,i=8;i>n;n++)r.faces[n].color=this.colors[4>n?0:1];var o=new a.MeshBasicMaterial({vertexColors:a.FaceColors,wireframe:!0});this.lightSphere=new a.Mesh(r,o),this.add(this.lightSphere),this.update()},a.HemisphereLightHelper.prototype=Object.create(a.Object3D.prototype),a.HemisphereLightHelper.prototype.constructor=a.HemisphereLightHelper,a.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose(),this.lightSphere.material.dispose()},a.HemisphereLightHelper.prototype.update=function(){var e=new a.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),this.lightSphere.geometry.colorsNeedUpdate=!0}}(),a.PointLightHelper=function(e,t){this.light=e,this.light.updateMatrixWorld();var r=new a.SphereGeometry(t,4,2),n=new a.MeshBasicMaterial({wireframe:!0,fog:!1});n.color.copy(this.light.color).multiplyScalar(this.light.intensity),a.Mesh.call(this,r,n),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1},a.PointLightHelper.prototype=Object.create(a.Mesh.prototype),a.PointLightHelper.prototype.constructor=a.PointLightHelper,a.PointLightHelper.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},a.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},a.SkeletonHelper=function(e){this.bones=this.getBoneList(e);for(var t=new a.Geometry,r=0;rl;l++)for(var p=u[l],d=0,m=p.vertexNormals.length;m>d;d++){var g=c[p[n[d]]],v=p.vertexNormals[d];e.copy(g).applyMatrix4(i),t.copy(v).applyMatrix3(r).normalize().multiplyScalar(this.size).add(e),o.setXYZ(h,e.x,e.y,e.z),h+=1,o.setXYZ(h,t.x,t.y,t.z),h+=1}else if(s instanceof a.BufferGeometry)for(var y=s.attributes.position,b=s.attributes.normal,h=0,d=0,m=y.count;m>d;d++)e.set(y.getX(d),y.getY(d),y.getZ(d)).applyMatrix4(i),t.set(b.getX(d),b.getY(d),b.getZ(d)),t.applyMatrix3(r).normalize().multiplyScalar(this.size).add(e),o.setXYZ(h,e.x,e.y,e.z),h+=1,o.setXYZ(h,t.x,t.y,t.z),h+=1;return o.needsUpdate=!0,this}}(),a.WireframeHelper=function(e,t){var r=void 0!==t?t:16777215;a.LineSegments.call(this,new a.WireframeGeometry(e.geometry),new a.LineBasicMaterial({color:r})),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1},a.WireframeHelper.prototype=Object.create(a.LineSegments.prototype),a.WireframeHelper.prototype.constructor=a.WireframeHelper,a.ImmediateRenderObject=function(e){a.Object3D.call(this),this.material=e,this.render=function(e){}},a.ImmediateRenderObject.prototype=Object.create(a.Object3D.prototype),a.ImmediateRenderObject.prototype.constructor=a.ImmediateRenderObject,a.MorphBlendMesh=function(e,t){a.Mesh.call(this,e,t),this.animationsMap={},this.animationsList=[];var r=this.geometry.morphTargets.length,n="__default",i=0,o=r-1,s=r/1;this.createAnimation(n,i,o,s),this.setAnimationWeight(n,1)},a.MorphBlendMesh.prototype=Object.create(a.Mesh.prototype),a.MorphBlendMesh.prototype.constructor=a.MorphBlendMesh,a.MorphBlendMesh.prototype.createAnimation=function(e,t,r,n){var i={start:t,end:r,length:r-t+1,fps:n,duration:(r-t)/n,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[e]=i,this.animationsList.push(i)},a.MorphBlendMesh.prototype.autoCreateAnimations=function(e){for(var t,r=/([a-z]+)_?(\d+)/,n={},i=this.geometry,o=0,a=i.morphTargets.length;a>o;o++){var s=i.morphTargets[o],c=s.name.match(r);if(c&&c.length>1){var u=c[1];n[u]||(n[u]={start:1/0,end:-(1/0)});var h=n[u];oh.end&&(h.end=o),t||(t=u)}}for(var u in n){var h=n[u];this.createAnimation(u,h.start,h.end,e)}this.firstAnimation=t},a.MorphBlendMesh.prototype.setAnimationDirectionForward=function(e){var t=this.animationsMap[e];t&&(t.direction=1,t.directionBackwards=!1)},a.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(e){var t=this.animationsMap[e];t&&(t.direction=-1,t.directionBackwards=!0)},a.MorphBlendMesh.prototype.setAnimationFPS=function(e,t){var r=this.animationsMap[e];r&&(r.fps=t,r.duration=(r.end-r.start)/r.fps)},a.MorphBlendMesh.prototype.setAnimationDuration=function(e,t){var r=this.animationsMap[e];r&&(r.duration=t,r.fps=(r.end-r.start)/r.duration)},a.MorphBlendMesh.prototype.setAnimationWeight=function(e,t){var r=this.animationsMap[e];r&&(r.weight=t)},a.MorphBlendMesh.prototype.setAnimationTime=function(e,t){var r=this.animationsMap[e];r&&(r.time=t)},a.MorphBlendMesh.prototype.getAnimationTime=function(e){var t=0,r=this.animationsMap[e];return r&&(t=r.time),t},a.MorphBlendMesh.prototype.getAnimationDuration=function(e){var t=-1,r=this.animationsMap[e];return r&&(t=r.duration),t},a.MorphBlendMesh.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()")},a.MorphBlendMesh.prototype.stopAnimation=function(e){var t=this.animationsMap[e];t&&(t.active=!1)},a.MorphBlendMesh.prototype.update=function(e){for(var t=0,r=this.animationsList.length;r>t;t++){var n=this.animationsList[t];if(n.active){var i=n.duration/n.length;n.time+=n.direction*e,n.mirroredLoop?(n.time>n.duration||n.time<0)&&(n.direction*=-1,n.time>n.duration&&(n.time=n.duration,n.directionBackwards=!0),n.time<0&&(n.time=0,n.directionBackwards=!1)):(n.time=n.time%n.duration,n.time<0&&(n.time+=n.duration));var o=n.start+a.Math.clamp(Math.floor(n.time/i),0,n.length-1),s=n.weight;o!==n.currentFrame&&(this.morphTargetInfluences[n.lastFrame]=0,this.morphTargetInfluences[n.currentFrame]=1*s,this.morphTargetInfluences[o]=0,n.lastFrame=n.currentFrame,n.currentFrame=o);var c=n.time%i/i;n.directionBackwards&&(c=1-c),n.currentFrame!==n.lastFrame?(this.morphTargetInfluences[n.currentFrame]=c*s,this.morphTargetInfluences[n.lastFrame]=(1-c)*s):this.morphTargetInfluences[n.currentFrame]=s}}},"undefined"!=typeof e&&e.exports&&(t=e.exports=a),t.THREE=a},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;re?r+="000":256>e?r+="00":4096>e&&(r+="0"),Ea[t]=r+e.toString(16)}),'"')}function Ga(){return Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^la()).toString(36)}function Ka(){this.Wa=-1}function La(){this.Wa=-1,this.Wa=64,this.P=[],this.ne=[],this.Uf=[],this.Ld=[],this.Ld[0]=128;for(var t=1;ti;i++)n[i]=e.charCodeAt(r)<<24|e.charCodeAt(r+1)<<16|e.charCodeAt(r+2)<<8|e.charCodeAt(r+3),r+=4;else for(i=0;16>i;i++)n[i]=e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3],r+=4;for(i=16;80>i;i++){var o=n[i-3]^n[i-8]^n[i-14]^n[i-16];n[i]=4294967295&(o<<1|o>>>31)}e=t.P[0],r=t.P[1];for(var a,s=t.P[2],c=t.P[3],u=t.P[4],i=0;80>i;i++)40>i?20>i?(o=c^r&(s^c),a=1518500249):(o=r^s^c,a=1859775393):60>i?(o=r&s|c&(r|s),a=2400959708):(o=r^s^c,a=3395469782),o=(e<<5|e>>>27)+o+u+a+n[i]&4294967295,u=c,c=s,s=4294967295&(r<<30|r>>>2),r=e,e=o;t.P[0]=t.P[0]+e&4294967295,t.P[1]=t.P[1]+r&4294967295,t.P[2]=t.P[2]+s&4294967295,t.P[3]=t.P[3]+c&4294967295,t.P[4]=t.P[4]+u&4294967295}function Ta(t,e){var r=Ua(t,e,void 0);return 0>r?null:p(t)?t.charAt(r):t[r]}function Ua(t,e,r){for(var n=t.length,i=p(t)?t.split(""):t,o=0;o=arguments.length?u.slice.call(t,e):u.slice.call(t,e,r)}function Xa(t,e){t.sort(e||Ya)}function Ya(t,e){return t>e?1:t>2,o=(3&o)<<4|s>>4,s=(15&s)<<2|u>>6,u=63&u;c||(u=64,a||(s=64)),n.push(r[h],r[o],r[s],r[u])}return n.join("")}function gb(){if(!cb){cb={},db={},eb={};for(var t=0;65>t;t++)cb[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(t),db[t]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.".charAt(t),eb[db[t]]=t,62<=t&&(eb["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(t)]=t)}}function v(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function w(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]}function ib(t,e){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e(r,t[r])}function jb(t){var e={};return ib(t,function(t,r){e[t]=r}),e}function kb(t){var e=[];return ib(t,function(t,r){ea(r)?Oa(r,function(r){e.push(encodeURIComponent(t)+"="+encodeURIComponent(r))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(r))}),e.length?"&"+e.join("&"):""}function lb(t){var e={};return t=t.replace(/^\?/,"").split("&"),Oa(t,function(t){t&&(t=t.split("="),e[t[0]]=t[1])}),e}function x(t,e,r,n){var i;if(nr&&(i=0===r?"none":"no more than "+r),i)throw Error(t+" failed: Was called with "+n+(1===n?" argument.":" arguments.")+" Expects "+i+".")}function z(t,e,r){var n="";switch(e){case 1:n=r?"first":"First";break;case 2:n=r?"second":"Second";break;case 3:n=r?"third":"Third";break;case 4:n=r?"fourth":"Fourth";break;default:throw Error("errorPrefix called with argumentNumber > 4. Need to update it?")}return t=t+" failed: "+(n+" argument ")}function A(t,e,r,i){if((!i||n(r))&&!ha(r))throw Error(z(t,e,i)+"must be a valid function.")}function mb(t,e,r){if(n(r)&&(!ia(r)||null===r))throw Error(z(t,e,!0)+"must be a valid context object.")}function nb(t){return"undefined"!=typeof JSON&&n(JSON.parse)?JSON.parse(t):Aa(t)}function B(t){if("undefined"!=typeof JSON&&n(JSON.stringify))t=JSON.stringify(t);else{var e=[];Ca(new Ba,t,e),t=e.join("")}return t}function ob(){this.Wd=C}function pb(){}function rb(t,e,r){this.Rf=t,this.Ka=e,this.Kd=r}function vb(){this.ub=[]}function wb(t,e){for(var r=null,n=0;nr?n=n.left:0i)t=this.Ge?t.left:t.right;else{if(0===i){this.Qa.push(t);break}this.Qa.push(t),t=this.Ge?t.right:t.left}}function J(t){if(0===t.Qa.length)return null;var e,r=t.Qa.pop();if(e=t.Ud?t.Ud(r.key,r.value):{key:r.key,value:r.value},t.Ge)for(r=r.left;!r.e();)t.Qa.push(r),r=r.right;else for(r=r.right;!r.e();)t.Qa.push(r),r=r.left;return e}function dc(t){if(0===t.Qa.length)return null;var e;return e=t.Qa,e=e[e.length-1],t.Ud?t.Ud(e.key,e.value):{key:e.key,value:e.value}}function ec(t,e,r,n,i){this.key=t,this.value=e,this.color=null==r||r,this.left=null!=n?n:ac,this.right=null!=i?i:ac}function fc(t){return t.left.e()?t:fc(t.left)}function hc(t){return t.left.e()?ac:(t.left.fa()||t.left.left.fa()||(t=ic(t)),t=t.X(null,null,null,hc(t.left),null),gc(t))}function gc(t){return t.right.fa()&&!t.left.fa()&&(t=lc(t)),t.left.fa()&&t.left.left.fa()&&(t=jc(t)),t.left.fa()&&t.right.fa()&&(t=kc(t)),t}function ic(t){return t=kc(t),t.right.left.fa()&&(t=t.X(null,null,null,null,jc(t.right)),t=lc(t),t=kc(t)),t}function lc(t){return t.right.X(null,null,t.color,t.X(null,null,!0,null,t.right.left),null)}function jc(t){return t.left.X(null,null,t.color,null,t.X(null,null,!0,t.left.right,null))}function kc(t){return t.X(null,null,!t.color,t.left.X(null,null,!t.left.color,null,null),t.right.X(null,null,!t.right.color,null,null))}function mc(){}function nc(t,e){return t&&"object"==typeof t?(K(".sv"in t,"Unexpected leaf node or priority contents"),e[t[".sv"]]):t}function oc(t,e){var r=new pc;return qc(t,new L(""),function(t,n){r.nc(t,rc(n,e))}),r}function rc(t,e){var r,n=t.B().H(),n=nc(n,e);if(t.L()){var i=nc(t.Ca(),e);return i!==t.Ca()||n!==t.B().H()?new sc(i,M(n)):t}return r=t,n!==t.B().H()&&(r=r.ga(new sc(n))),t.R(N,function(t,n){var i=rc(n,e);i!==n&&(r=r.O(t,i))}),r}function L(t,e){if(1==arguments.length){this.n=t.split("/");for(var r=0,n=0;n=t.n.length?null:t.n[t.Z]}function tc(t){return t.n.length-t.Z}function H(t){var e=t.Z;return e>4),64!=s&&(n.push(a<<4&240|s>>2),64!=c&&n.push(s<<6&192|c))}if(8192>n.length)e=String.fromCharCode.apply(null,n);else{for(t="",r=0;rt.ac?t.update(t.Ld,56-t.ac):t.update(t.Ld,t.Wa-(t.ac-56));for(var n=t.Wa-1;56<=n;n--)t.ne[n]=255&r,r/=256;for(Ma(t,t.ne),n=r=0;5>n;n++)for(var i=24;0<=i;i-=8)e[r]=t.P[n]>>i&255,++r;return fb(e)}function Kc(t){for(var e="",r=0;rt?r.push(t.substring(n,t.length)):r.push(t.substring(n,n+e));return r}function Xc(t,e){if(ea(t))for(var n=0;nt,t=Math.abs(t),t>=Math.pow(2,-1022)?(n=Math.min(Math.floor(Math.log(t)/Math.LN2),1023),r=n+1023,n=Math.round(t*Math.pow(2,52-n)-Math.pow(2,52))):(r=0,n=Math.round(t/Math.pow(2,-1074)))),i=[],t=52;t;--t)i.push(n%2?1:0),n=Math.floor(n/2);for(t=11;t;--t)i.push(r%2?1:0),r=Math.floor(r/2);for(i.push(e?1:0),i.reverse(),e=i.join(""),r="",t=0;64>t;t+=8)n=parseInt(e.substr(t,8),2).toString(16),1===n.length&&(n="0"+n),r+=n;return r.toLowerCase()}function Tc(t){return Zc.test(t)&&(t=Number(t),-2147483648<=t&&2147483647>=t)?t:null}function Db(t){try{t()}catch(t){setTimeout(function(){throw Q("Exception was thrown by user callback.",t.stack||""),t},Math.floor(0))}}function R(t,e){if(ha(t)){var r=Array.prototype.slice.call(arguments,1).slice();Db(function(){t.apply(null,r)})}}function Jc(t){for(var e=[],r=0,n=0;n=i&&(i-=55296,n++,K(ni?e[r++]=i:(2048>i?e[r++]=i>>6|192:(65536>i?e[r++]=i>>12|224:(e[r++]=i>>18|240,e[r++]=i>>12&63|128),e[r++]=i>>6&63|128),e[r++]=63&i|128)}return e}function wc(t){for(var e=0,r=0;rn?e++:2048>n?e+=2:55296<=n&&56319>=n?(e+=4,r++):e+=3}return e}function $c(t){var e={},r={},n={},i="";try{var o=t.split("."),e=nb(Hc(o[0])||""),r=nb(Hc(o[1])||""),i=o[2],n=r.d||{};delete r.d}catch(t){}return{Xg:e,Bc:r,data:n,Og:i}}function ad(t){return t=$c(t).Bc,"object"==typeof t&&t.hasOwnProperty("iat")?w(t,"iat"):null}function bd(t){t=$c(t);var e=t.Bc;return!!t.Og&&!!e&&"object"==typeof e&&e.hasOwnProperty("iat")}function cd(t){this.V=t,this.g=t.o.g}function dd(t,e,r,n){var i=[],o=[];return Oa(e,function(e){"child_changed"===e.type&&t.g.Ad(e.Le,e.Ja)&&o.push(new D("child_moved",e.Ja,e.Xa))}),ed(t,i,"child_removed",e,n,r),ed(t,i,"child_added",e,n,r),ed(t,i,"child_moved",o,n,r),ed(t,i,"child_changed",e,n,r),ed(t,i,Fb,e,n,r),i}function ed(t,e,r,n,i,o){n=Pa(n,function(t){return t.type===r}),Xa(n,q(t.fg,t)),Oa(n,function(r){var n=fd(t,r,o);Oa(i,function(i){i.Kf(r.type)&&e.push(i.createEvent(n,t.V))})})}function fd(t,e,r){return"value"!==e.type&&"child_removed"!==e.type&&(e.Qd=r.rf(e.Xa,e.Ja,t.g)),e}function gd(){this.bb={}}function hd(t,e){var r=e.type,n=e.Xa;K("child_added"==r||"child_changed"==r||"child_removed"==r,"Only child changes supported for tracking"),K(".priority"!==n,"Only non-priority child changes can be tracked.");var i=w(t.bb,n);if(i){var o=i.type;if("child_added"==r&&"child_removed"==o)t.bb[n]=new D("child_changed",e.Ja,n,i.Ja);else if("child_removed"==r&&"child_added"==o)delete t.bb[n];else if("child_removed"==r&&"child_changed"==o)t.bb[n]=new D("child_removed",i.Le,n);else if("child_changed"==r&&"child_added"==o)t.bb[n]=new D("child_added",e.Ja,n);else{if("child_changed"!=r||"child_changed"!=o)throw Gc("Illegal combination of changes: "+e+" occurred after "+i);t.bb[n]=new D("child_changed",e.Ja,n,i.Le)}}else t.bb[n]=e}function id(t,e,r){this.Rb=t,this.qb=e,this.sb=r||null}function jd(t,e,r){this.ha=t,this.qb=e,this.sb=r}function kd(t){this.g=t}function ld(t){this.Ce=new kd(t.g),this.g=t.g;var e;t.ma?(e=md(t),e=t.g.Pc(nd(t),e)):e=t.g.Tc(),this.ed=e,t.pa?(e=od(t),t=t.g.Pc(pd(t),e)):t=t.g.Qc(),this.Gc=t}function qd(t){this.sa=new ld(t),this.g=t.g,K(t.ja,"Only valid if limit has been set"),this.ka=t.ka,this.Jb=!rd(t)}function sd(t,e,r,n,i,o){var a;if(t.Jb){var s=td(t.g);a=function(t,e){return s(e,t)}}else a=td(t.g);K(e.Eb()==t.ka,"");var c=new F(r,n),u=t.Jb?ud(e,t.g):vd(e,t.g),h=t.sa.matches(c);if(e.Da(r)){for(var l=e.J(r),u=i.ze(t.g,u,t.Jb);null!=u&&(u.name==r||e.Da(u.name));)u=i.ze(t.g,u,t.Jb);return i=null==u?1:a(u,c),h&&!n.e()&&0<=i?(null!=o&&hd(o,new D("child_changed",n,r,l)),e.O(r,n)):(null!=o&&hd(o,new D("child_removed",l,r)),e=e.O(r,C),null!=u&&t.sa.matches(u)?(null!=o&&hd(o,new D("child_added",u.S,u.name)),e.O(u.name,u.S)):e)}return n.e()?e:h&&0<=a(u,c)?(null!=o&&(hd(o,new D("child_removed",u.S,u.name)),hd(o,new D("child_added",n,r))),e.O(r,n).O(u.name,C)):e}function wd(t,e){this.ke=t,this.dg=e}function yd(t){this.U=t}function Hd(t,e,r,n,i,o){var a=e.Q;if(null!=n.tc(r))return e;var s;if(r.e())K(Ib(e.C()),"If change path is empty, we must have complete server data"),e.C().Ub?(i=ub(e),n=n.yc(i instanceof T?i:C)):n=n.za(ub(e)),o=t.U.xa(e.Q.j(),n,o);else{var c=E(r);if(".priority"==c)K(1==tc(r),"Can't have a priority with additional path components"),o=a.j(),s=e.C().j(),n=n.ld(r,o,s),o=null!=n?t.U.ga(o,n):a.j();else{var u=H(r);sb(a,c)?(s=e.C().j(),n=n.ld(r,a.j(),s),n=null!=n?a.j().J(c).K(u,n):a.j().J(c)):n=n.xc(c,e.C()),o=null!=n?t.U.K(a.j(),c,n,u,i,o):a.j()}}return Fd(e,o,a.ea||r.e(),t.U.Na())}function Ad(t,e,r,n,i,o,a,s){var c=e.C();if(a=a?t.U:t.U.Wb(),r.e())n=a.xa(c.j(),n,null);else if(a.Na()&&!c.Ub)n=c.j().K(r,n),n=a.xa(c.j(),n,null);else{var u=E(r);if(!Jb(c,r)&&1o.status){try{e=nb(o.responseText)}catch(t){Q("Failed to parse JSON response for "+i+": "+o.responseText)}n(null,e)}else 401!==o.status&&404!==o.status&&Q("Got unsuccessful REST response for "+i+" Status: "+o.status),n(o.status);n=null}},o.open("GET",i,!0),o.send()}function Be(t,e){this.value=t,this.children=e||Ce}function De(t){var e=Nd;return r(t,function(t,r){e=e.set(new L(r),t)}),e}function Ee(t,e,r){if(null!=t.value&&r(t.value))return{path:G,value:t.value};if(e.e())return null;var n=E(e);return t=t.children.get(n),null!==t?(e=Ee(t,H(e),r),null!=e?{path:new L(n).u(e.path),value:e.value}:null):null}function Fe(t,e){return Ee(t,e,function(){return!0})}function Md(t,e,r){if(e.e())return r;var n=E(e);return e=Md(t.children.get(n)||Nd,H(e),r),n=e.e()?t.children.remove(n):t.children.Oa(n,e),new Be(t.value,n)}function Ge(t,e){return He(t,G,e)}function He(t,e,r){var n={};return t.children.ia(function(t,i){n[t]=He(i,e.u(t),r)}),r(e,t.value,n)}function Ie(t,e,r){return Je(t,e,G,r)}function Je(t,e,r,n){var i=!!t.value&&n(r,t.value);return i?i:e.e()?null:(i=E(e),(t=t.children.get(i))?Je(t,H(e),r.u(i),n):null)}function Ke(t,e,r){var n=G;if(!e.e()){var i=!0;t.value&&(i=r(n,t.value)),!0===i&&(i=E(e),(t=t.children.get(i))&&Le(t,H(e),n.u(i),r))}}function Le(t,e,r,n){if(e.e())return t;t.value&&n(r,t.value);var i=E(e);return(t=t.children.get(i))?Le(t,H(e),r.u(i),n):Nd}function Kd(t,e){Me(t,G,e)}function Me(t,e,r){t.children.ia(function(t,n){Me(n,e.u(t),r)}),t.value&&r(e,t.value)}function Ne(t,e){t.children.ia(function(t,r){r.value&&e(t,r.value)})}function Oe(t,e,r){this.type=Ed,this.source=Pe,this.path=t,this.Qb=e,this.Vd=r}function Qe(t,e,r,n){this.xe=t,this.pf=e,this.Ib=r,this.bf=n,K(!n||e,"Tagged queries must be from server.")}function Se(t){this.W=t}function Ue(t,e,r){if(e.e())return new Se(new Be(r));var n=Fe(t.W,e);if(null!=n){var i=n.path,n=n.value;return e=O(i,e),n=n.K(e,r),new Se(t.W.set(i,n))}return t=Md(t.W,e,new Be(r)),new Se(t)}function Ve(t,e,r){var n=t;return ib(r,function(t,r){n=Ue(n,e.u(t),r)}),n}function We(t,e){var r=Fe(t.W,e);return null!=r?t.W.get(r.path).Y(O(r.path,e)):null}function Xe(t){var e=[],r=t.W.value;return null!=r?r.L()||r.R(N,function(t,r){e.push(new F(t,r))}):t.W.children.ia(function(t,r){null!=r.value&&e.push(new F(t,r.value))}),e}function Ye(t,e){if(e.e())return t;var r=We(t,e);return new Se(null!=r?new Be(r):t.W.subtree(e))}function Ze(t,e,r){if(null!=e.value)return r.K(t,e.value);var n=null;return e.children.ia(function(e,i){".priority"===e?(K(null!==i.value,"Priority writes must always be leaf nodes"),n=i.value):r=Ze(t.u(e),i,r)}),r.Y(t).e()||null===n||(r=r.K(t.u(".priority"),n)),r}function $e(){this.T=Te,this.na=[],this.Mc=-1}function af(t,e){for(var r=0;ra.Mc,"Stacking an older write on top of newer ones"),n(s)||(s=!0),a.na.push({path:e,Ga:r,kd:i,visible:s}),s&&(a.T=Ue(a.T,e,r)),a.Mc=i,o?mf(t,new Wb(Pe,e,r)):[]}function nf(t,e,r,n){var i=t.jb;return K(n>i.Mc,"Stacking an older merge on top of newer ones"),i.na.push({path:e,children:r,kd:n,visible:!0}),i.T=Ve(i.T,e,r),i.Mc=n,r=De(r),mf(t,new xe(Pe,e,r))}function of(t,e,r){r=r||!1;var n=af(t.jb,e);if(t.jb.Rd(e)){var i=Nd;return null!=n.Ga?i=i.set(G,!0):ib(n.children,function(t,e){i=i.set(new L(t),e)}),mf(t,new Oe(n.path,i,r))}return[]}function pf(t,e,r){return r=De(r),mf(t,new xe(Re,e,r))}function qf(t,e,r,n){if(n=rf(t,n),null!=n){var i=sf(n);return n=i.path,i=i.Ib,e=O(n,e),r=new Wb(new Qe(!1,!0,i,!0),e,r),tf(t,n,r)}return[]}function uf(t,e,r,n){if(n=rf(t,n)){var i=sf(n);return n=i.path,i=i.Ib,e=O(n,e),r=De(r),r=new xe(new Qe(!1,!0,i,!0),e,r),tf(t,n,r)}return[]}function yf(t){return Ge(t,function(t,e,n){if(e&&null!=gf(e))return[gf(e)];var i=[];return e&&(i=hf(e)),r(n,function(t){i=i.concat(t)}),i})}function Bf(t,e){for(var r=0;r10485760/3&&10485760=t}else if(-1=t;return!1}function tg(){var t,e=window.opener.frames;for(t=e.length-1;0<=t;t--)try{if(e[t].location.protocol===window.location.protocol&&e[t].location.host===window.location.host&&"__winchan_relay_frame"===e[t].name)return e[t]}catch(t){}return null}function ug(t,e,r){t.attachEvent?t.attachEvent("on"+e,r):t.addEventListener&&t.addEventListener(e,r,!1)}function vg(t,e,r){t.detachEvent?t.detachEvent("on"+e,r):t.removeEventListener&&t.removeEventListener(e,r,!1)}function wg(t){/^https?:\/\//.test(t)||(t=window.location.href);var e=/^(https?:\/\/[\-_a-zA-Z\.0-9:]+)/.exec(t);return e?e[1]:t}function xg(t){var e="";try{t=t.replace("#","");var r=lb(t);r&&v(r,"__firebase_request_key")&&(e=w(r,"__firebase_request_key"))}catch(t){}return e}function yg(){var t=Qc(kg);return t.scheme+"://"+t.host+"/v2"}function zg(t){return yg()+"/"+t+"/auth/channel"}function Ag(t){var e=this;if(this.Ac=t,this.de="*",sg(8)?this.Rc=this.zd=tg():(this.Rc=window.opener,this.zd=window),!e.Rc)throw"Unable to find relay frame";ug(this.zd,"message",q(this.ic,this)),ug(this.zd,"message",q(this.Bf,this));try{Bg(this,{a:"ready"})}catch(t){ug(this.Rc,"load",function(){Bg(e,{a:"ready"})})}ug(window,"unload",q(this.zg,this))}function Bg(t,e){e=B(e),sg(8)?t.Rc.doPost(e,t.de):t.Rc.postMessage(e,t.de)}function Cg(t){this.pc=Ga()+Ga()+Ga(),this.Ef=t}function Eg(t){var e=Error(w(Dg,t),t);return e.code=t,e}function Fg(t){var e;(e=!t.window_features)||(e=pg(),e=-1!==e.indexOf("Fennec/")||-1!==e.indexOf("Firefox/")&&-1!==e.indexOf("Android")),e&&(t.window_features=void 0),t.window_name||(t.window_name="_blank"),this.options=t}function Gg(t){t.method||(t.method="GET"),t.headers||(t.headers={}),t.headers.content_type||(t.headers.content_type="application/json"),t.headers.content_type=t.headers.content_type.toLowerCase(),this.options=t}function Hg(t){this.pc=Ga()+Ga()+Ga(),this.Ef=t}function Ig(t){t.callback_parameter||(t.callback_parameter="callback"),this.options=t,window.__firebase_auth_jsonp=window.__firebase_auth_jsonp||{}}function Jg(t,e,r){setTimeout(function(){try{var n=document.createElement("script");n.type="text/javascript",n.id=t,n.async=!0,n.src=e,n.onerror=function(){var e=document.getElementById(t);null!==e&&e.parentNode.removeChild(e),r&&r(Eg("NETWORK_ERROR"))};var i=document.getElementsByTagName("head");(i&&0!=i.length?i[0]:document.documentElement).appendChild(n)}catch(t){r&&r(Eg("NETWORK_ERROR"))}},0)}function Kg(t,e,r,n){Lf.call(this,["auth_status"]),this.F=t,this.ef=e,this.Tg=r,this.Me=n,this.sc=new og(t,[Cc,P]),this.nb=null,this.Te=!1,Lg(this)}function Lg(t){P.get("redirect_request_id")&&Mg(t);var e=t.sc.get();e&&e.token?(Ng(t,e),t.ef(e.token,function(r,n){Og(t,r,n,!1,e.token,e)},function(e,r){Pg(t,"resumeSession()",e,r)})):Ng(t,null)}function Qg(t,e,r,n,i,o){"firebaseio-demo.com"===t.F.domain&&Q("Firebase authentication is not supported on demo Firebases (*.firebaseio-demo.com). To secure your Firebase, create a production Firebase at https://www.firebase.com."),t.ef(e,function(o,a){Og(t,o,a,!0,e,r,n||{},i)},function(e,r){Pg(t,"auth()",e,r,o)})}function Rg(t,e){t.sc.clear(),Ng(t,null),t.Tg(function(t,r){if("ok"===t)R(e,null);else{var n=(t||"error").toUpperCase(),i=n;r&&(i+=": "+r),i=Error(i),i.code=n,R(e,i)}})}function Og(t,e,r,n,i,o,a,s){"ok"===e?(n&&(e=r.auth,o.auth=e,o.expires=r.expires,o.token=bd(i)?i:"",r=null,e&&v(e,"uid")?r=w(e,"uid"):v(o,"uid")&&(r=w(o,"uid")),o.uid=r,r="custom",e&&v(e,"provider")?r=w(e,"provider"):v(o,"provider")&&(r=w(o,"provider")),o.provider=r,t.sc.clear(),bd(i)&&(a=a||{},r=Cc,"sessionOnly"===a.remember&&(r=P),"none"!==a.remember&&t.sc.set(o,r)),Ng(t,o)),R(s,null,o)):(t.sc.clear(),Ng(t,null),o=t=(e||"error").toUpperCase(),r&&(o+=": "+r),o=Error(o),o.code=t,R(s,o))}function Pg(t,e,r,n,i){Q(e+" was canceled: "+n),t.sc.clear(),Ng(t,null),t=Error(n),t.code=r.toUpperCase(),R(i,t)}function Sg(t,e,r,n,i){Tg(t),r=new lg(n||{},{},r||{}),Ug(t,[Gg,Ig],"/auth/"+e,r,i)}function Vg(t,e,r,n){Tg(t);var i=[Fg,Hg];r=ng(r),"anonymous"===e||"password"===e?setTimeout(function(){R(n,Eg("TRANSPORT_UNAVAILABLE"))},0):(r.fe.window_features="menubar=yes,modal=yes,alwaysRaised=yeslocation=yes,resizable=yes,scrollbars=yes,status=yes,height=625,width=625,top="+("object"==typeof screen?.5*(screen.height-625):0)+",left="+("object"==typeof screen?.5*(screen.width-625):0),r.fe.relay_url=zg(t.F.Db),r.fe.requestWithCredential=q(t.qc,t),Ug(t,i,"/auth/"+e,r,n))}function Mg(t){var e=P.get("redirect_request_id");if(e){var r=P.get("redirect_client_options");P.remove("redirect_request_id"),P.remove("redirect_client_options");var n=[Gg,Ig],e={requestId:e,requestKey:xg(document.location.hash)},r=new lg(r,{},e);t.Te=!0;try{document.location.hash=document.location.hash.replace(/&__firebase_request_key=([a-zA-z0-9]*)/,"")}catch(t){}Ug(t,n,"/auth/session",r,function(){this.Te=!1}.bind(t))}}function Ug(t,e,r,n,i){Wg(t,e,r,n,function(e,r){!e&&r&&r.token&&r.uid?Qg(t,r.token,r,n.od,function(t,e){t?R(i,t):R(i,null,e)}):R(i,e||Eg("UNKNOWN_ERROR"))})}function Wg(t,e,r,n,i){e=Pa(e,function(t){return"function"==typeof t.isAvailable&&t.isAvailable()}),0===e.length?setTimeout(function(){R(i,Eg("TRANSPORT_UNAVAILABLE"))},0):(e=new(e.shift())(n.fe),n=jb(n.$a),n.v="js-"+hb,n.transport=e.Cc(),n.suppress_status_codes=!0,t=yg()+"/"+t.F.Db+r,e.open(t,n,function(t,e){if(t)R(i,t);else if(e&&e.error){var r=Error(e.error.message);r.code=e.error.code,r.details=e.error.details,R(i,r)}else R(i,null,e)}))}function Ng(t,e){var r=null!==t.nb||null!==e;t.nb=e,r&&t.ge("auth_status",e),t.Me(null!==e)}function Tg(t){var e=t.F;if("firebaseio.com"!==e.domain&&"firebaseio-demo.com"!==e.domain&&"auth.firebase.com"===kg)throw Error("This custom Firebase server ('"+t.F.domain+"') does not support delegated login.")}function Xg(t){this.ic=t,this.Nd=[],this.Sb=0,this.re=-1,this.Gb=null}function Yg(t,e,r){t.re=e,t.Gb=r,t.redocument.domain="'+document.domain+'";'),t=""+t+"";try{this.Ea.fb.open(),this.Ea.fb.write(t),this.Ea.fb.close()}catch(t){Cb("frame writing exception"),t.stack&&Cb(t.stack),Cb(t)}}function fh(t){if(t.me&&t.Xd&&t.Qe.count()<(0=t.ad[0].kf.length+30+r.length;){var i=t.ad.shift(),r=r+"&seg"+n+"="+i.Kg+"&ts"+n+"="+i.Sg+"&d"+n+"="+i.kf;n++}return gh(t,e+r,t.ue),!0}return!1}function gh(t,e,r){function n(){t.Qe.remove(r),fh(t)}t.Qe.add(r,1);var i=setTimeout(n,Math.floor(25e3));eh(t,e,function(){clearTimeout(i),n()})}function eh(t,e,r){setTimeout(function(){try{if(t.Xd){var n=t.Ea.fb.createElement("script");n.type="text/javascript",n.async=!0,n.src=e,n.onload=n.onreadystatechange=function(){var t=n.readyState;t&&"loaded"!==t&&"complete"!==t||(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),r())},n.onerror=function(){Cb("Long-poll script failed to load: "+e),t.Xd=!1,t.close()},t.Ea.fb.body.appendChild(n)}}catch(t){}},Math.floor(1))}function ih(t,e,r){this.se=t,this.f=Nc(this.se),this.frames=this.Kc=null,this.ob=this.pb=this.cf=0,this.Va=Qb(e),this.eb=(e.lb?"wss://":"ws://")+e.Pa+"/.ws?v=5","undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(this.eb+="&r=f"),e.host!==e.Pa&&(this.eb=this.eb+"&ns="+e.Db),r&&(this.eb=this.eb+"&s="+r)}function lh(t,e){if(t.frames.push(e),t.frames.length==t.cf){var r=t.frames.join("");t.frames=null,r=nb(r),t.xg(r)}}function kh(t){clearInterval(t.Kc),t.Kc=setInterval(function(){t.ua&&t.ua.send("0"),kh(t)},Math.floor(45e3))}function mh(t){nh(this,t)}function nh(t,e){var r=ih&&ih.isAvailable(),n=r&&!(Cc.wf||!0===Cc.get("previous_websocket_failure"));if(e.Ug&&(r||Q("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),n=!0),n)t.gd=[ih];else{var i=t.gd=[];Xc(oh,function(t,e){e&&e.isAvailable()&&i.push(e)})}}function ph(t){if(0=t.Mf?(t.f("Secondary connection is healthy."),t.Bb=!0,t.D.Ed(),t.D.start(),t.f("sending client ack on secondary"),t.D.send({t:"c",d:{t:"a",d:{}}}),t.f("Ending transmission on primary"),t.I.send({t:"c",d:{t:"n",d:{}}}),t.hd=t.D,wh(t)):(t.f("sending ping on secondary."),t.D.send({t:"c",d:{t:"p",d:{}}}))}function yh(t){t.Bb||(t.Se--,0>=t.Se&&(t.f("Primary connection is healthy."),t.Bb=!0,t.I.Ed()))}function vh(t,e){t.D=new e("c:"+t.id+":"+t.ff++,t.F,t.Zd),t.Mf=e.responsesRequiredToBeHealthy||0,t.D.open(sh(t,t.D),th(t,t.D)),setTimeout(function(){t.D&&(t.f("Timed out trying to upgrade."),t.D.close())},Math.floor(6e4))}function uh(t,e,r){t.f("Realtime connection established."),t.I=e,t.Ua=1,t.Wc&&(t.Wc(r),t.Wc=null),0===t.Se?(t.f("Primary connection is healthy."),t.Bb=!0):setTimeout(function(){zh(t)},Math.floor(5e3))}function zh(t){t.Bb||1!==t.Ua||(t.f("sending ping on primary."),Bh(t,{t:"c",d:{t:"p",d:{}}}))}function Bh(t,e){if(1!==t.Ua)throw"Connection is not connected";t.hd.send(e)}function xh(t){t.f("Shutting down all connections"),t.I&&(t.I.close(),t.I=null),t.D&&(t.D.close(),t.D=null),t.yd&&(clearTimeout(t.yd),t.yd=null)}function Ch(t,e,r,n){this.id=Dh++,this.f=Nc("p:"+this.id+":"),this.xf=this.Fe=!1,this.$={},this.qa=[],this.Yc=0,this.Vc=[],this.oa=!1,this.Za=1e3,this.Fd=3e5,this.Hb=e,this.Uc=r,this.Pe=n,this.F=t,this.tb=this.Aa=this.Ia=this.Xe=null,this.Ob=!1,this.Td={},this.Jg=0,this.nf=!0,this.Lc=this.He=null,Eh(this,0),Pf.vb().Fb("visible",this.Ag,this),-1===t.host.indexOf("fblocal")&&Of.vb().Fb("online",this.yg,this)}function Gh(t,e){var r=e.Gg,n=r.path.toString(),i=r.va();t.f("Listen on "+n+" for "+i);var o={p:n};e.tag&&(o.q=ce(r.o),o.t=e.tag),o.h=e.xd(),t.Fa("q",o,function(o){var a=o.d,s=o.s;if(a&&"object"==typeof a&&v(a,"w")){var c=w(a,"w");ea(c)&&0<=Na(c,"no_index")&&Q("Using an unspecified index. Consider adding "+('".indexOn": "'+r.o.g.toString()+'"')+" at "+r.path.toString()+" to your security rules for better performance")}(t.$[n]&&t.$[n][i])===e&&(t.f("listen response",o),"ok"!==s&&Hh(t,n,i),e.G&&e.G(s,a))})}function Ih(t){var e=t.Aa;t.oa&&e&&t.Fa("auth",{cred:e.gg},function(r){var n=r.s;r=r.d||"error","ok"!==n&&t.Aa===e&&delete t.Aa,e.of?"ok"!==n&&e.md&&e.md(n,r):(e.of=!0,e.zc&&e.zc(n,r))})}function Jh(t,e,r,n,i){r={p:r,d:n},t.f("onDisconnect "+e,r),t.Fa(e,r,function(t){i&&setTimeout(function(){i(t.s,t.d)},Math.floor(0))})}function Kh(t,e,r,i,o,a){i={p:r,d:i},n(a)&&(i.h=a),t.qa.push({action:e,Jf:i,G:o}),t.Yc++,e=t.qa.length-1,t.oa?Lh(t,e):t.f("Buffering put: "+r)}function Lh(t,e){var r=t.qa[e].action,n=t.qa[e].Jf,i=t.qa[e].G;t.qa[e].Hg=t.oa,t.Fa(r,n,function(n){t.f(r+" response",n),delete t.qa[e],t.Yc--,0===t.Yc&&(t.qa=[]),i&&i(n.s,n.d)})}function Eh(t,e){K(!t.Ia,"Scheduling a connect when we're already connected/ing?"),t.tb&&clearTimeout(t.tb),t.tb=setTimeout(function(){t.tb=null,Oh(t)},Math.floor(e))}function Oh(t){if(Ph(t)){t.f("Making a connection attempt"),t.He=(new Date).getTime(),t.Lc=null;var e=q(t.Id,t),r=q(t.Wc,t),n=q(t.Df,t),i=t.id+":"+Fh++;t.Ia=new qh(i,t.F,e,r,n,function(e){Q(e+" ("+t.F.toString()+")"),t.xf=!0})}}function Mh(t,e,r){r=r?Qa(r,function(t){return Vc(t)}).join("$"):"default",(t=Hh(t,e,r))&&t.G&&t.G("permission_denied")}function Hh(t,e,r){e=new L(e).toString();var i;return n(t.$[e])?(i=t.$[e][r],delete t.$[e][r],0===pa(t.$[e])&&delete t.$[e]):i=void 0,i}function Nh(t){Ih(t),r(t.$,function(e){r(e,function(e){Gh(t,e)})});for(var e=0;e.firebaseio.com instead"),r&&"undefined"!=r||Pc("Cannot parse Firebase url. Please use https://.firebaseio.com"),n.lb||"undefined"!=typeof window&&window.location&&window.location.protocol&&-1!==window.location.protocol.indexOf("https:")&&Q("Insecure Firebase access from a secure page. Please use https in calls to new Firebase()."),r=new Dc(n.host,n.lb,r,"ws"===n.scheme||"wss"===n.scheme),n=new L(n.$c),i=n.toString();var o;if(!(o=!p(r.host)||0===r.host.length||!Tf(r.Db))&&(o=0!==i.length)&&(i&&(i=i.replace(/^\/*\.info(\/|$)/,"/")),o=!(p(i)&&0!==i.length&&!Rf.test(i))),o)throw Error(z("new Firebase",1,!1)+'must be a valid firebase URL and the path can\'t contain ".", "#", "$", "[", or "]".');if(e)if(e instanceof W)i=e;else{if(!p(e))throw Error("Expected a valid Firebase.Context for second argument to new Firebase()");i=W.vb(),r.Od=e}else i=W.vb();o=r.toString();var a=w(i.oc,o);a||(a=new Qh(r,i.Qf),i.oc[o]=a),r=a}Y.call(this,r,n,$d,!1)}function Mc(t,e){K(!e||!0===t||!1===t,"Can't turn on custom loggers persistently."),!0===t?("undefined"!=typeof console&&("function"==typeof console.log?Bb=q(console.log,console):"object"==typeof console.log&&(Bb=function(t){console.log(t)})),e&&P.set("logging_enabled",!0)):t?Bb=t:(Bb=null,P.remove("logging_enabled"))}var g,aa=this,la=Date.now||function(){return+new Date},ya="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),Ea={'"':'\\"',"\\":"\\\\","/":"\\/","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\u000b"},Fa=/\uffff/.test("")?/[\\\"\x00-\x1f\x7f-\uffff]/g:/[\\\"\x00-\x1f\x7f-\xff]/g,Ha;t:{var Ia=aa.navigator;if(Ia){var Ja=Ia.userAgent;if(Ja){Ha=Ja;break t}}Ha=""}ma(La,Ka),La.prototype.reset=function(){this.P[0]=1732584193,this.P[1]=4023233417,this.P[2]=2562383102,this.P[3]=271733878,this.P[4]=3285377520,this.ee=this.ac=0},La.prototype.update=function(t,e){if(null!=t){n(e)||(e=t.length);for(var r=e-this.Wa,i=0,o=this.ne,a=this.ac;ir?Math.max(0,t.length+r):r,p(t))return p(e)&&1==e.length?t.indexOf(e,r):-1;for(;rparseFloat(e))?String(t):e)}();var cb=null,db=null,eb=null,hb=hb||"2.2.9";ob.prototype.j=function(t){return this.Wd.Y(t)},ob.prototype.toString=function(){return this.Wd.toString()},pb.prototype.qf=function(){return null},pb.prototype.ze=function(){return null};var qb=new pb;rb.prototype.qf=function(t){var e=this.Ka.Q;return sb(e,t)?e.j().J(t):(e=null!=this.Kd?new tb(this.Kd,!0,!1):this.Ka.C(),this.Rf.xc(t,e))},rb.prototype.ze=function(t,e,r){var n=null!=this.Kd?this.Kd:ub(this.Ka);return t=this.Rf.oe(n,e,1,r,t),0===t.length?null:t[0]},xb.prototype.add=function(t){this.vd.push(t)},xb.prototype.Zb=function(){return this.ra};var Fb="value";Gb.prototype.Zb=function(){var t=this.$d.mc();return"value"===this.ud?t.path:t.parent().path},Gb.prototype.Ae=function(){return this.ud},Gb.prototype.Vb=function(){return this.ve.Vb(this)},Gb.prototype.toString=function(){return this.Zb().toString()+":"+this.ud+":"+B(this.$d.mf())},Hb.prototype.Zb=function(){return this.path},Hb.prototype.Ae=function(){return"cancel"},Hb.prototype.Vb=function(){return this.ve.Vb(this)},Hb.prototype.toString=function(){return this.path.toString()+":cancel"},tb.prototype.j=function(){return this.w},Kb.prototype.get=function(){var t=this.eg.get(),e=xa(t);if(this.Dd)for(var r in this.Dd)e[r]-=this.Dd[r];return this.Dd=t,e},Lb.prototype.If=function(){var t,e=this.fd.get(),r={},n=!1;for(t in e)0e?r=r.left:0n?i.X(null,null,null,i.left.Oa(t,e,r),null):0===n?i.X(null,e,null,null,null):i.X(null,null,null,null,i.right.Oa(t,e,r)),gc(i)},g.remove=function(t,e){var r,n;if(r=this,0>e(t,r.key))r.left.e()||r.left.fa()||r.left.left.fa()||(r=ic(r)),r=r.X(null,null,null,r.left.remove(t,e),null);else{if(r.left.fa()&&(r=jc(r)),r.right.e()||r.right.fa()||r.right.left.fa()||(r=kc(r),r.left.left.fa()&&(r=jc(r),r=kc(r))),0===e(t,r.key)){if(r.right.e())return ac;n=fc(r.right),r=r.X(n.key,n.value,null,null,hc(r.right))}r=r.X(null,null,null,null,r.right.remove(t,e))}return gc(r)},g.fa=function(){return this.color},g=mc.prototype,g.X=function(){return this},g.Oa=function(t,e){return new ec(t,e,null)},g.remove=function(){return this},g.count=function(){return 0},g.e=function(){return!0},g.ia=function(){return!1},g.Sc=function(){return null},g.fc=function(){return null},g.fa=function(){return!1};var ac=new mc;g=L.prototype,g.toString=function(){for(var t="",e=this.Z;e=this.n.length)return null;for(var t=[],e=this.Z;e=this.n.length},g.ca=function(t){if(tc(this)!==tc(t))return!1;for(var e=this.Z,r=t.Z;e<=this.n.length;e++,r++)if(this.n[e]!==t.n[r])return!1;return!0},g.contains=function(t){var e=this.Z,r=t.Z;if(tc(this)>tc(t))return!1;for(;e"),t};var Fc=function(){var t=1;return function(){return t++}}(),Bb=null,Lc=!0,Zc=/^-?\d{1,10}$/;cd.prototype.fg=function(t,e){if(null==t.Xa||null==e.Xa)throw Gc("Should only compare child_ events.");return this.g.compare(new F(t.Xa,t.Ja),new F(e.Xa,e.Ja))},g=id.prototype,g.Kf=function(t){return"value"===t},g.createEvent=function(t,e){var r=e.o.g;return new Gb("value",this,new S(t.Ja,e.mc(),r))},g.Vb=function(t){var e=this.sb;if("cancel"===t.Ae()){K(this.qb,"Raising a cancel event on a listener with no cancel callback");var r=this.qb;return function(){r.call(e,t.error)}}var n=this.Rb;return function(){n.call(e,t.$d)}},g.gf=function(t,e){return this.qb?new Hb(this,t,e):null},g.matches=function(t){return t instanceof id&&(!t.Rb||!this.Rb||t.Rb===this.Rb&&t.sb===this.sb)},g.tf=function(){return null!==this.Rb},g=jd.prototype,g.Kf=function(t){return t="children_added"===t?"child_added":t,("children_removed"===t?"child_removed":t)in this.ha},g.gf=function(t,e){return this.qb?new Hb(this,t,e):null},g.createEvent=function(t,e){K(null!=t.Xa,"Child events should have a childName.");var r=e.mc().u(t.Xa);return new Gb(t.type,this,new S(t.Ja,r,e.o.g),t.Qd)},g.Vb=function(t){var e=this.sb;if("cancel"===t.Ae()){K(this.qb,"Raising a cancel event on a listener with no cancel callback");var r=this.qb;return function(){r.call(e,t.error)}}var n=this.ha[t.ud];return function(){n.call(e,t.$d,t.Qd)}},g.matches=function(t){if(t instanceof jd){if(!this.ha||!t.ha)return!0;if(this.sb===t.sb){var e=pa(t.ha);if(e===pa(this.ha)){if(1===e){var e=qa(t.ha),r=qa(this.ha);return!(r!==e||t.ha[e]&&this.ha[r]&&t.ha[e]!==this.ha[r])}return oa(this.ha,function(e,r){return t.ha[r]===e})}}}return!1},g.tf=function(){return null!==this.ha},g=kd.prototype,g.K=function(t,e,r,n,i,o){return K(t.Jc(this.g),"A node must be indexed if only a child is updated"),i=t.J(e),i.Y(n).ca(r.Y(n))&&i.e()==r.e()?t:(null!=o&&(r.e()?t.Da(e)?hd(o,new D("child_removed",i,e)):K(t.L(),"A child remove without an old child only makes sense on a leaf node"):i.e()?hd(o,new D("child_added",r,e)):hd(o,new D("child_changed",r,e,i))),t.L()&&r.e()?t:t.O(e,r).mb(this.g))},g.xa=function(t,e,r){return null!=r&&(t.L()||t.R(N,function(t,n){e.Da(t)||hd(r,new D("child_removed",n,t))}),e.L()||e.R(N,function(e,n){if(t.Da(e)){var i=t.J(e);i.ca(n)||hd(r,new D("child_changed",n,e,i))}else hd(r,new D("child_added",n,e))})),e.mb(this.g)},g.ga=function(t,e){return t.e()?C:t.ga(e)},g.Na=function(){return!1},g.Wb=function(){return this},g=ld.prototype,g.matches=function(t){return 0>=this.g.compare(this.ed,t)&&0>=this.g.compare(t,this.Gc)},g.K=function(t,e,r,n,i,o){return this.matches(new F(e,r))||(r=C),this.Ce.K(t,e,r,n,i,o)},g.xa=function(t,e,r){e.L()&&(e=C);var n=e.mb(this.g),n=n.ga(C),i=this;return e.R(N,function(t,e){i.matches(new F(t,e))||(n=n.O(t,C))}),this.Ce.xa(t,n,r)},g.ga=function(t){return t},g.Na=function(){return!0},g.Wb=function(){return this.Ce},g=qd.prototype,g.K=function(t,e,r,n,i,o){return this.sa.matches(new F(e,r))||(r=C),t.J(e).ca(r)?t:t.Eb()=this.g.compare(this.sa.ed,a):0>=this.g.compare(a,this.sa.Gc)))break;n=n.O(a.name,a.S),i++}}else{n=e.mb(this.g),n=n.ga(C);var s,c,u;if(this.Jb){e=n.sf(this.g),s=this.sa.Gc,c=this.sa.ed;var h=td(this.g);u=function(t,e){return h(e,t)}}else e=n.Xb(this.g),s=this.sa.ed,c=this.sa.Gc,u=td(this.g);for(var i=0,l=!1;0=u(s,a)&&(l=!0),(o=l&&i=u(a,c))?i++:n=n.O(a.name,C)}return this.sa.Wb().xa(t,n,r)},g.ga=function(t){return t},g.Na=function(){return!0},g.Wb=function(){return this.sa.Wb()},yd.prototype.ab=function(t,e,r,n){var i,o=new gd;if(e.type===Xb)e.source.xe?r=zd(this,t,e.path,e.Ga,r,n,o):(K(e.source.pf,"Unknown source."),i=e.source.bf,r=Ad(this,t,e.path,e.Ga,r,n,i,o));else if(e.type===Bd)e.source.xe?r=Cd(this,t,e.path,e.children,r,n,o):(K(e.source.pf,"Unknown source."),i=e.source.bf,r=Dd(this,t,e.path,e.children,r,n,i,o));else if(e.type===Ed)if(e.Vd)if(e=e.path,null!=r.tc(e))r=t;else{if(i=new rb(r,t,n),n=t.Q.j(),e.e()||".priority"===E(e))Ib(t.C())?e=r.za(ub(t)):(e=t.C().j(),K(e instanceof T,"serverChildren would be complete if leaf node"),e=r.yc(e)),e=this.U.xa(n,e,o);else{var a=E(e),s=r.xc(a,t.C());null==s&&sb(t.C(),a)&&(s=n.J(a)),e=null!=s?this.U.K(n,a,s,H(e),i,o):t.Q.j().Da(a)?this.U.K(n,a,C,H(e),i,o):n,e.e()&&Ib(t.C())&&(n=r.za(ub(t)),n.L()&&(e=this.U.xa(e,n,o)))}n=Ib(t.C())||null!=r.tc(G),r=Fd(t,e,n,this.U.Na())}else r=Gd(this,t,e.path,e.Qb,r,n,o);else{if(e.type!==Zb)throw Gc("Unknown operation type: "+e.type);n=e.path,e=t.C(),i=e.j(),a=e.ea||n.e(),r=Hd(this,new Id(t.Q,new tb(i,a,e.Ub)),n,r,qb,o)}return o=ra(o.bb),n=r,e=n.Q,e.ea&&(i=e.j().L()||e.j().e(),a=Jd(t),(0e.compare(n,t);)J(r),n=dc(r);return r},g.sf=function(t){return this.$b(t.Qc(),t)},g.$b=function(t,e){var r=oe(this,e);if(r)return r.$b(t,function(t){return t});for(var r=this.m.$b(t.name,Sb),n=dc(r);null!=n&&0=e&&bf(s,n.path)?i=!1:n.path.contains(s.path)&&(o=!0)),a--}if(i){if(o)this.T=cf(this.na,df,G),this.Mc=0o;o++)e[o]=Math.floor(64*Math.random());for(o=0;12>o;o++)r+="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".charAt(e[o]);return K(20===r.length,"nextPushId: Length should be 20."),
+r}}();ma(Of,Lf),Of.prototype.Be=function(t){return K("online"===t,"Unknown event type: "+t),[this.jc]},ca(Of),ma(Pf,Lf),Pf.prototype.Be=function(t){return K("visible"===t,"Unknown event type: "+t),[this.Ob]},ca(Pf);var Qf=/[\[\].#$\/\u0000-\u001F\u007F]/,Rf=/[\[\].#$\u0000-\u001F\u007F]/,Sf=/^[a-zA-Z][a-zA-Z._\-+]+$/;g=hg.prototype,g.add=function(t,e){this.set[t]=null===e||e},g.contains=function(t){return v(this.set,t)},g.get=function(t){return this.contains(t)?this.set[t]:void 0},g.remove=function(t){delete this.set[t]},g.clear=function(){this.set={}},g.e=function(){return wa(this.set)},g.count=function(){return pa(this.set)},g.keys=function(){var t=[];return r(this.set,function(e,r){t.push(r)}),t},pc.prototype.find=function(t){if(null!=this.A)return this.A.Y(t);if(t.e()||null==this.m)return null;var e=E(t);return t=H(t),this.m.contains(e)?this.m.get(e).find(t):null},pc.prototype.nc=function(t,e){if(t.e())this.A=e,this.m=null;else if(null!==this.A)this.A=this.A.K(t,e);else{null==this.m&&(this.m=new hg);var r=E(t);this.m.contains(r)||this.m.add(r,new pc),r=this.m.get(r),t=H(t),r.nc(t,e)}},pc.prototype.R=function(t){null!==this.m&&ig(this.m,function(e,r){t(e,r)})};var kg="auth.firebase.com",mg=["remember","redirectTo"];og.prototype.set=function(t,e){if(!e){if(!this.ce.length)throw Error("fb.login.SessionManager : No storage options available!");e=this.ce[0]}e.set(this.Re,t)},og.prototype.get=function(){var t=Qa(this.ce,q(this.og,this)),t=Pa(t,function(t){return null!==t});return Xa(t,function(t,e){return ad(e.token)-ad(t.token)}),0o.status){try{t=nb(o.responseText)}catch(t){}r(null,t)}else r(500<=o.status&&600>o.status?Eg("SERVER_ERROR"):Eg("NETWORK_ERROR"));r=null,vg(window,"beforeunload",n)}},"GET"===a)t+=(/\?/.test(t)?"":"?")+kb(e),i=null;else{var s=this.options.headers.content_type;"application/json"===s&&(i=B(e)),"application/x-www-form-urlencoded"===s&&(i=kb(e))}o.open(a,t,!0),t={"X-Requested-With":"XMLHttpRequest",Accept:"application/json;text/plain"},za(t,this.options.headers);for(var c in t)o.setRequestHeader(c,t[c]);o.send(i)},Gg.isAvailable=function(){var t;return(t=!!window.XMLHttpRequest)&&(t=pg(),t=!(t.match(/MSIE/)||t.match(/Trident/))||sg(10)),t},Gg.prototype.Cc=function(){return"json"},Hg.prototype.open=function(t,e,r){function n(){r&&(r(Eg("USER_CANCELLED")),r=null)}var i,o=this,a=Qc(kg);e.requestId=this.pc,e.redirectTo=a.scheme+"://"+a.host+"/blank/page.html",t+=/\?/.test(t)?"":"?",t+=kb(e),(i=window.open(t,"_blank","location=no"))&&ha(i.addEventListener)?(i.addEventListener("loadstart",function(t){var e;if(e=t&&t.url)t:{try{var s=document.createElement("a");s.href=t.url,e=s.host===a.host&&"/blank/page.html"===s.pathname;break t}catch(t){}e=!1}e&&(t=xg(t.url),i.removeEventListener("exit",n),i.close(),t=new lg(null,null,{requestId:o.pc,requestKey:t}),o.Ef.requestWithCredential("/auth/session",t,r),r=null)}),i.addEventListener("exit",n)):r(Eg("TRANSPORT_UNAVAILABLE"))},Hg.isAvailable=function(){return qg()},Hg.prototype.Cc=function(){return"redirect"},Ig.prototype.open=function(t,e,r){function n(){r&&(r(Eg("REQUEST_INTERRUPTED")),r=null)}function i(){setTimeout(function(){window.__firebase_auth_jsonp[o]=void 0,wa(window.__firebase_auth_jsonp)&&(window.__firebase_auth_jsonp=void 0);try{var t=document.getElementById(o);t&&t.parentNode.removeChild(t)}catch(t){}},1),vg(window,"beforeunload",n)}var o="fn"+(new Date).getTime()+Math.floor(99999*Math.random());e[this.options.callback_parameter]="__firebase_auth_jsonp."+o,t+=(/\?/.test(t)?"":"?")+kb(e),ug(window,"beforeunload",n),window.__firebase_auth_jsonp[o]=function(t){r&&(r(null,t),r=null),i()},Jg(o,t,r)},Ig.isAvailable=function(){return"undefined"!=typeof document&&null!=document.createElement},Ig.prototype.Cc=function(){return"json"},ma(Kg,Lf),g=Kg.prototype,g.ye=function(){return this.nb||null},g.te=function(t,e){Tg(this);var r=ng(t);r.$a._method="POST",this.qc("/users",r,function(t,r){t?R(e,t):R(e,t,r)})},g.Ue=function(t,e){var r=this;Tg(this);var n="/users/"+encodeURIComponent(t.email),i=ng(t);i.$a._method="DELETE",this.qc(n,i,function(t,n){!t&&n&&n.uid&&r.nb&&r.nb.uid&&r.nb.uid===n.uid&&Rg(r),R(e,t)})},g.qe=function(t,e){Tg(this);var r="/users/"+encodeURIComponent(t.email)+"/password",n=ng(t);n.$a._method="PUT",n.$a.password=t.newPassword,this.qc(r,n,function(t){R(e,t)})},g.pe=function(t,e){Tg(this);var r="/users/"+encodeURIComponent(t.oldEmail)+"/email",n=ng(t);n.$a._method="PUT",n.$a.email=t.newEmail,n.$a.password=t.password,this.qc(r,n,function(t){R(e,t)})},g.We=function(t,e){Tg(this);var r="/users/"+encodeURIComponent(t.email)+"/password",n=ng(t);n.$a._method="POST",this.qc(r,n,function(t){R(e,t)})},g.qc=function(t,e,r){Wg(this,[Gg,Ig],t,e,r)},g.Be=function(t){return K("auth_status"===t,'initial event must be of type "auth_status"'),this.Te?null:[this.nb]};var ah,bh;$g.prototype.open=function(t,e){this.hf=0,this.la=e,this.Af=new Xg(t),this.Ab=!1;var r=this;this.rb=setTimeout(function(){r.f("Timed out trying to connect."),r.hb(),r.rb=null},Math.floor(3e4)),Sc(function(){if(!r.Ab){r.Ta=new ch(function(t,e,n,i,o){if(dh(r,arguments),r.Ta)if(r.rb&&(clearTimeout(r.rb),r.rb=null),r.Hc=!0,"start"==t)r.id=e,r.Gf=n;else{if("close"!==t)throw Error("Unrecognized command received: "+t);e?(r.Ta.Xd=!1,Yg(r.Af,e,function(){r.hb()})):r.hb()}},function(t,e){dh(r,arguments),Zg(r.Af,t,e)},function(){r.hb()},r.jd);var t={start:"t"};t.ser=Math.floor(1e8*Math.random()),r.Ta.ie&&(t.cb=r.Ta.ie),t.v="5",r.Zd&&(t.s=r.Zd),"undefined"!=typeof location&&location.href&&-1!==location.href.indexOf("firebaseio.com")&&(t.r="f"),t=r.jd(t),r.f("Connecting via long-poll to "+t),eh(r.Ta,t,function(){})}})},$g.prototype.start=function(){var t=this.Ta,e=this.Gf;for(t.sg=this.id,t.tg=e,t.me=!0;fh(t););t=this.id,e=this.Gf,this.gc=document.createElement("iframe");var r={dframe:"t"};r.id=t,r.pw=e,this.gc.src=this.jd(r),this.gc.style.display="none",document.body.appendChild(this.gc)},$g.isAvailable=function(){return ah||!bh&&"undefined"!=typeof document&&null!=document.createElement&&!("object"==typeof window&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))&&!("object"==typeof Windows&&"object"==typeof Windows.Vg)&&!0},g=$g.prototype,g.Ed=function(){},g.dd=function(){this.Ab=!0,this.Ta&&(this.Ta.close(),this.Ta=null),this.gc&&(document.body.removeChild(this.gc),this.gc=null),this.rb&&(clearTimeout(this.rb),this.rb=null)},g.hb=function(){this.Ab||(this.f("Longpoll is closing itself"),this.dd(),this.la&&(this.la(this.Hc),this.la=null))},g.close=function(){this.Ab||(this.f("Longpoll is being closed."),this.dd())},g.send=function(t){t=B(t),this.pb+=t.length,Nb(this.Va,"bytes_sent",t.length),t=Jc(t),t=fb(t,!0),t=Wc(t,1840);for(var e=0;e=t.length){var e=Number(t);if(!isNaN(e)){n.cf=e,n.frames=[],t=null;break t}}n.cf=1,n.frames=[]}null!==t&&lh(n,t)}},this.ua.onerror=function(t){n.f("WebSocket error. Closing connection."),(t=t.message||t.data)&&n.f(t),n.hb()}},ih.prototype.start=function(){},ih.isAvailable=function(){var t=!1;if("undefined"!=typeof navigator&&navigator.userAgent){var e=navigator.userAgent.match(/Android ([0-9]{0,}\.[0-9]{0,})/);e&&1parseFloat(e[1])&&(t=!0)}return!t&&null!==hh&&!jh},ih.responsesRequiredToBeHealthy=2,ih.healthyTimeout=3e4,g=ih.prototype,g.Ed=function(){Cc.remove("previous_websocket_failure")},g.send=function(t){kh(this),t=B(t),this.pb+=t.length,Nb(this.Va,"bytes_sent",t.length),t=Wc(t,16384),1=t)throw Error("Query.limit: First argument must be a positive integer.");if(this.o.ja)throw Error("Query.limit: Limit was already set (by another call to limit, limitToFirst, orlimitToLast.");var e=this.o.Ie(t);return li(e),new Y(this.k,this.path,e,this.kc)},g.Je=function(t){if(x("Query.limitToFirst",1,1,arguments.length),!ga(t)||Math.floor(t)!==t||0>=t)throw Error("Query.limitToFirst: First argument must be a positive integer.");if(this.o.ja)throw Error("Query.limitToFirst: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new Y(this.k,this.path,this.o.Je(t),this.kc)},g.Ke=function(t){if(x("Query.limitToLast",1,1,arguments.length),!ga(t)||Math.floor(t)!==t||0>=t)throw Error("Query.limitToLast: First argument must be a positive integer.");if(this.o.ja)throw Error("Query.limitToLast: Limit was already set (by another call to limit, limitToFirst, or limitToLast).");return new Y(this.k,this.path,this.o.Ke(t),this.kc)},g.Cg=function(t){if(x("Query.orderByChild",1,1,arguments.length),"$key"===t)throw Error('Query.orderByChild: "$key" is invalid. Use Query.orderByKey() instead.');if("$priority"===t)throw Error('Query.orderByChild: "$priority" is invalid. Use Query.orderByPriority() instead.');if("$value"===t)throw Error('Query.orderByChild: "$value" is invalid. Use Query.orderByValue() instead.');$f("Query.orderByChild",1,t,!1),mi(this,"Query.orderByChild");var e=be(this.o,new Sd(t));return ki(e),new Y(this.k,this.path,e,!0)},g.Dg=function(){x("Query.orderByKey",0,0,arguments.length),mi(this,"Query.orderByKey");var t=be(this.o,Od);return ki(t),new Y(this.k,this.path,t,!0)},g.Eg=function(){x("Query.orderByPriority",0,0,arguments.length),mi(this,"Query.orderByPriority");var t=be(this.o,N);return ki(t),new Y(this.k,this.path,t,!0)},g.Fg=function(){x("Query.orderByValue",0,0,arguments.length),mi(this,"Query.orderByValue");var t=be(this.o,Yd);return ki(t),new Y(this.k,this.path,t,!0)},g.ae=function(t,e){x("Query.startAt",0,2,arguments.length),Vf("Query.startAt",t,this.path,!0),$f("Query.startAt",2,e,!0);var r=this.o.ae(t,e);if(li(r),ki(r),this.o.ma)throw Error("Query.startAt: Starting point was already set (by another call to startAt or equalTo).");return n(t)||(e=t=null),new Y(this.k,this.path,r,this.kc)},g.td=function(t,e){x("Query.endAt",0,2,arguments.length),Vf("Query.endAt",t,this.path,!0),$f("Query.endAt",2,e,!0);var r=this.o.td(t,e);if(li(r),ki(r),this.o.pa)throw Error("Query.endAt: Ending point was already set (by another call to endAt or equalTo).");return new Y(this.k,this.path,r,this.kc)},g.ig=function(t,e){if(x("Query.equalTo",1,2,arguments.length),Vf("Query.equalTo",t,this.path,!1),$f("Query.equalTo",2,e,!0),this.o.ma)throw Error("Query.equalTo: Starting point was already set (by another call to endAt or equalTo).");if(this.o.pa)throw Error("Query.equalTo: Ending point was already set (by another call to endAt or equalTo).");return this.ae(t,e).td(t,e)},g.toString=function(){x("Query.toString",0,0,arguments.length);for(var t=this.path,e="",r=t.Z;r"+c.toUpperCase()+"",e.appendChild(r),u){var n="VR mode does not support preview tiles. Stopping code execution.";throw console.log("ERROR: "+n),new Error(n)}if(!h){var o=document.createElement("span");o.className="altspace-vr-notice",o.innerHTML="View
",e.insertBefore(o,r);var s=document.createElement("span");s.className="altspace-vr-notice",s.innerHTML='in AltspaceVR
',e.appendChild(s);var n="Not in VR mode. Stopping code execution.";throw u&&console.log("ERROR: "+n),new Error(n)}}}function r(t){c=t}function n(){var t=document.querySelector("link[rel=canonical]"),e=t?t.href:window.location.href;return new s(e)}function i(){var t=n(),e=t.path.split("/"),r=e[e.length-1];return r}function o(){var t=n(),e=t.path.split("/"),r="team"==e[1],i=r?"team-"+e[2]:e[1];return i}var a=window.Please,s=window.Url,c="VR CodePen",u=window.name&&"pen-"===window.name.slice(0,4),h=!!window.altspace.inClient,l=!!location.href.match("codepen.io/");return{inTile:u,inVR:h,inCodePen:l,ensureInVR:e,setName:r,getPenId:i,getAuthorId:o,printDebugInfo:t}}(),window.altspace=window.altspace||{},window.altspace.utilities=window.altspace.utilities||{},altspace.utilities.Simulation=function(t){function e(){window.requestAnimationFrame(e),a.updateAllBehaviors&&a.updateAllBehaviors(),n.render(a,i)}function r(){function t(){n=altspace.getThreeJSRenderer(),i=new THREE.PerspectiveCamera}function e(){n=new THREE.WebGLRenderer({antialias:!0}),i=new THREE.PerspectiveCamera,i.position.z=500;var t=function(){i.aspect=window.innerWidth/window.innerHeight,i.updateProjectionMatrix(),n.setSize(window.innerWidth,window.innerHeight)};document.addEventListener("DOMContentLoaded",function(t){document.body.style.margin="0px",document.body.style.overflow="hidden",n.setClearColor("#035F72");var e=document.createElement("div");document.body.appendChild(e),e.appendChild(n.domElement)}),window.addEventListener("resize",t),t(),i.fov=45,i.near=1,i.far=2e3,a.add(i),a.add(new THREE.AmbientLight("white"));var e=altspace&&altspace.utilities&&altspace.utilities.shims&&altspace.utilities.shims.cursor;e&&altspace.utilities.shims.cursor.init(a,i)}altspace&&altspace.inClient?t():e()}t=t||{},void 0===t.auto&&(t.auto=!0);var n,i,o={},a=new THREE.Scene;return r(),t.auto&&window.requestAnimationFrame(e),Object.defineProperty(o,"scene",{get:function(){return a}}),Object.defineProperty(o,"renderer",{get:function(){return n}}),Object.defineProperty(o,"camera",{get:function(){return i},set:function(t){i=t}}),o},window.altspace=window.altspace||{},window.altspace.utilities=window.altspace.utilities||{},altspace.utilities.multiloader=function(){function t(){var t,e=[],r=[],n=[],i=0;return{objUrls:e,mtlUrls:r,objects:n,error:t,objectsLoaded:i}}function e(t){var e=t||{};o=e.TRACE||!1,e.crossOrigin&&(s=e.crossOrigin),e.baseUrl&&(a=e.baseUrl),"/"!==a.slice(-1)&&(a+="/"),i=new altspace.utilities.shims.OBJMTLLoader,i.crossOrigin=s,o&&console.log("MultiLoader initialized with params",t)}function r(e,r){var s=e,c=Date.now();if(!s||!s instanceof t)throw new Error("MultiLoader.load expects first arg of type LoadRequest");if(!r||"function"!=typeof r)throw new Error("MultiLoader.load expects second arg of type function");if(!s.objUrls||!s.mtlUrls||s.objUrls.length!==s.mtlUrls.length)throw new Error("MultiLoader.load called with bad LoadRequest");var u=s.objUrls.length;o&&console.log("Loading models...");for(var h=0;h0?r[0]:null}var a,s,c,u,h=new THREE.Raycaster;return{init:t}}(),function(){function t(e){var r,n;if(e.bubbles&&(e.currentTarget=this,e.stopPropagation=function(){r=!0},e.stopImmediatePropagation=function(){n=!0}),this._listeners){var i=this._listeners,o=i[e.type];if(o){e.target=e.target||this;for(var a=[],s=o.length,c=0;c0)for(var t=0;te.buttons;i++)n[i]=!1;for(var i=0;i>e.axes;i++)r[i]=!1;t.position&&(r[0]=!0,r[1]=!0,n[10]=!0),t.rotation&&(r[2]=!0,r[3]=!0,n[11]=!0),t.scale&&(n[12]=!0,n[13]=!0),n[8]=!0,e.preventDefault(r,n)}function i(e){if(altspace&&altspace.inClient||!window.chrome||!a||(a=r()),a){var n=a.buttons[8].pressed;if(n)return c.isMine||c.takeOwnership(),o.position.copy(u.position),o.rotation.copy(u.rotation),void o.scale.copy(u.scale);if(t.position){var i=a.buttons[10].pressed;p&&!i&&(l=!l),p=i;var s=a.axes[0],d=a.axes[1],g=Math.abs(s)>m||Math.abs(d)>m;g&&!c.isMine&&c.takeOwnership();var v=200*(e/1e3);!l&&Math.abs(s)>m&&(o.position.x+=v*s),!l&&Math.abs(d)>m&&(o.position.z+=v*d),l&&Math.abs(s)>m&&(o.position.x+=v*s),l&&Math.abs(d)>m&&(o.position.y+=v*-d)}if(t.rotation){var y=a.buttons[11].pressed;f&&!y&&(h=!h),f=y;var b=a.axes[2],x=a.axes[3],w=Math.abs(b)>m||Math.abs(x)>m;w&&!c.isMine&&c.takeOwnership();var _=Math.PI*(e/1e3);!h&&Math.abs(b)>m&&(o.rotation.y+=_*b),!h&&Math.abs(x)>m&&(o.rotation.x+=_*x),h&&Math.abs(b)>m&&(o.rotation.z+=_*-b)}if(t.scale){var S=10*(e/1e3),M=a.buttons[12].pressed,E=a.buttons[13].pressed,T=a.buttons[12].pressed||a.buttons[13].pressed;T&&!c.isMine&&c.takeOwnership();var A=o.scale,C=new THREE.Vector3(1,1,1);C.multiplyScalar(S),M&&o.scale.add(C),E&&A.x>C.x&&A.y>C.y&&A.z>C.z&&o.scale.sub(C)}}}var o,a,s,c,u,h=!1,l=!1,f=!1,p=!1,d=!1,m=.2;return t=t||{},void 0===t.position&&(t.position=!0),void 0===t.rotation&&(t.rotation=!0),void 0===t.scale&&(t.scale=!0),{awake:e,update:i}},window.altspace=window.altspace||{},window.altspace.utilities=window.altspace.utilities||{},window.altspace.utilities.behaviors=window.altspace.utilities.behaviors||{},altspace.utilities.behaviors.HoverColor=function(t){function e(e,a){c=e,l=a,c.addEventListener("cursordown",r),l.addEventListener("cursorup",o),"cursorenter"===t.event&&(c.addEventListener("cursorenter",n),c.addEventListener("cursorleave",i))}function r(e){u=c,"cursordown"===t.event&&a(u)}function n(t){u&&u!==c||(h&&unsetcolor(h),h=c,a(c))}function i(t){h===c&&(h=null,s(c))}function o(e){"cursordown"===t.event&&u&&s(u),u=null}function a(e){e.material&&e.material.color&&(e.userData.origColor=e.material.color,e.material.color=t.color,e.material&&(e.material.needsUpdate=!0));for(var r=0;r.01&&(s.rotation.y+=p,p*=.97)}function a(){}t=t||{};var s,c,u,h=!1,l=0,f=5,p=0;return{awake:e,start:a,update:o}},function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var c="function"==typeof require&&require;if(!s&&c)return require(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[a]={exports:{}};e[a][0].call(h.exports,function(t){var r=e[a][1][t];return i(r?r:t)},h,h.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a1?arguments[1]:void 0,3);e=e?e.n:this._f;)for(r(e.v,e.k,this);e&&e.r;)e=e.p},has:function(t){return!!w(this,t)}}),g&&n.setDesc(h.prototype,"size",{get:function(){return c(this[y])}}),h},def:function(t,e,r){var n,i,o=w(t,e);return o?o.v=r:(t._l=o={i:i=x(e,!0),k:e,v:r,p:n=t._l,n:void 0,r:!1},t._f||(t._f=o),n&&(n.n=o),t[y]++,"F"!==i&&(t._i[i]=o)),t},getEntry:w,setStrong:function(t,e,r){h(t,e,function(t,e){this._t=t,this._k=e,this._l=void 0},function(){for(var t=this,e=t._k,r=t._l;r&&r.r;)r=r.p;return t._t&&(t._l=r=r?r.n:t._t._f)?"keys"==e?l(0,r.k):"values"==e?l(0,r.v):l(0,[r.k,r.v]):(t._t=void 0,l(1))},r?"entries":"values",!r,!0),m(e)}}},{"./$":44,"./$.ctx":23,"./$.defined":24,"./$.descriptors":25,"./$.for-of":29,"./$.has":32,"./$.hide":33,"./$.is-object":37,"./$.iter-define":40,"./$.iter-step":42,"./$.redefine-all":48,"./$.set-species":50,"./$.strict-new":53,"./$.uid":59}],20:[function(t,e,r){var n=t("./$.for-of"),i=t("./$.classof");e.exports=function(t){return function(){if(i(this)!=t)throw TypeError(t+"#toJSON isn't generic");var e=[];return n(this,!1,e.push,e),e}}},{"./$.classof":17,"./$.for-of":29}],21:[function(t,e,r){"use strict";var n=t("./$"),i=t("./$.global"),o=t("./$.export"),a=t("./$.fails"),s=t("./$.hide"),c=t("./$.redefine-all"),u=t("./$.for-of"),h=t("./$.strict-new"),l=t("./$.is-object"),f=t("./$.set-to-string-tag"),p=t("./$.descriptors");e.exports=function(t,e,r,d,m,g){var v=i[t],y=v,b=m?"set":"add",x=y&&y.prototype,w={};return p&&"function"==typeof y&&(g||x.forEach&&!a(function(){(new y).entries().next()}))?(y=e(function(e,r){h(e,y,t),e._c=new v,void 0!=r&&u(r,m,e[b],e)}),n.each.call("add,clear,delete,forEach,get,has,set,keys,values,entries".split(","),function(t){var e="add"==t||"set"==t;t in x&&(!g||"clear"!=t)&&s(y.prototype,t,function(r,n){if(!e&&g&&!l(r))return"get"==t&&void 0;var i=this._c[t](0===r?0:r,n);return e?this:i})}),"size"in x&&n.setDesc(y.prototype,"size",{get:function(){return this._c.size}})):(y=d.getConstructor(e,t,m,b),c(y.prototype,r)),f(y,t),w[t]=y,o(o.G+o.W+o.F,w),g||d.setStrong(y,t,m),y}},{"./$":44,"./$.descriptors":25,"./$.export":27,"./$.fails":28,"./$.for-of":29,"./$.global":31,"./$.hide":33,"./$.is-object":37,"./$.redefine-all":48,"./$.set-to-string-tag":51,"./$.strict-new":53}],22:[function(t,e,r){var n=e.exports={version:"1.2.6"};"number"==typeof __e&&(__e=n)},{}],23:[function(t,e,r){var n=t("./$.a-function");e.exports=function(t,e,r){if(n(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,i){return t.call(e,r,n,i)}}return function(){return t.apply(e,arguments)}}},{"./$.a-function":14}],24:[function(t,e,r){e.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},{}],25:[function(t,e,r){e.exports=!t("./$.fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./$.fails":28}],26:[function(t,e,r){var n=t("./$");e.exports=function(t){var e=n.getKeys(t),r=n.getSymbols;if(r)for(var i,o=r(t),a=n.isEnum,s=0;o.length>s;)a.call(t,i=o[s++])&&e.push(i);return e}},{"./$":44}],27:[function(t,e,r){var n=t("./$.global"),i=t("./$.core"),o=t("./$.ctx"),a="prototype",s=function(t,e,r){var c,u,h,l=t&s.F,f=t&s.G,p=t&s.S,d=t&s.P,m=t&s.B,g=t&s.W,v=f?i:i[e]||(i[e]={}),y=f?n:p?n[e]:(n[e]||{})[a];f&&(r=e);for(c in r)u=!l&&y&&c in y,u&&c in v||(h=u?y[c]:r[c],v[c]=f&&"function"!=typeof y[c]?r[c]:m&&u?o(h,n):g&&y[c]==h?function(t){var e=function(e){return this instanceof t?new t(e):t(e)};return e[a]=t[a],e}(h):d&&"function"==typeof h?o(Function.call,h):h,d&&((v[a]||(v[a]={}))[c]=h))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,e.exports=s},{"./$.core":22,"./$.ctx":23,"./$.global":31}],28:[function(t,e,r){e.exports=function(t){try{return!!t()}catch(t){return!0}}},{}],29:[function(t,e,r){var n=t("./$.ctx"),i=t("./$.iter-call"),o=t("./$.is-array-iter"),a=t("./$.an-object"),s=t("./$.to-length"),c=t("./core.get-iterator-method");e.exports=function(t,e,r,u){var h,l,f,p=c(t),d=n(r,u,e?2:1),m=0;if("function"!=typeof p)throw TypeError(t+" is not iterable!");if(o(p))for(h=s(t.length);h>m;m++)e?d(a(l=t[m])[0],l[1]):d(t[m]);else for(f=p.call(t);!(l=f.next()).done;)i(f,d,l.value,e)}},{"./$.an-object":16,"./$.ctx":23,"./$.is-array-iter":35,"./$.iter-call":38,"./$.to-length":57,"./core.get-iterator-method":61}],30:[function(t,e,r){var n=t("./$.to-iobject"),i=t("./$").getNames,o={}.toString,a="object"==typeof window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(t){try{return i(t)}catch(t){return a.slice()}};e.exports.get=function(t){return a&&"[object Window]"==o.call(t)?s(t):i(n(t))}},{"./$":44,"./$.to-iobject":56}],31:[function(t,e,r){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},{}],32:[function(t,e,r){var n={}.hasOwnProperty;e.exports=function(t,e){return n.call(t,e)}},{}],33:[function(t,e,r){var n=t("./$"),i=t("./$.property-desc");e.exports=t("./$.descriptors")?function(t,e,r){return n.setDesc(t,e,i(1,r))}:function(t,e,r){return t[e]=r,t}},{"./$":44,"./$.descriptors":25,"./$.property-desc":47}],34:[function(t,e,r){var n=t("./$.cof");e.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},{"./$.cof":18}],35:[function(t,e,r){var n=t("./$.iterators"),i=t("./$.wks")("iterator"),o=Array.prototype;e.exports=function(t){return void 0!==t&&(n.Array===t||o[i]===t)}},{"./$.iterators":43,"./$.wks":60}],36:[function(t,e,r){var n=t("./$.cof");e.exports=Array.isArray||function(t){return"Array"==n(t)}},{"./$.cof":18}],37:[function(t,e,r){e.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},{}],38:[function(t,e,r){var n=t("./$.an-object");e.exports=function(t,e,r,i){try{return i?e(n(r)[0],r[1]):e(r)}catch(e){var o=t.return;throw void 0!==o&&n(o.call(t)),e}}},{"./$.an-object":16}],39:[function(t,e,r){"use strict";var n=t("./$"),i=t("./$.property-desc"),o=t("./$.set-to-string-tag"),a={};t("./$.hide")(a,t("./$.wks")("iterator"),function(){return this}),e.exports=function(t,e,r){t.prototype=n.create(a,{next:i(1,r)}),o(t,e+" Iterator")}},{"./$":44,"./$.hide":33,"./$.property-desc":47,"./$.set-to-string-tag":51,"./$.wks":60}],40:[function(t,e,r){"use strict";var n=t("./$.library"),i=t("./$.export"),o=t("./$.redefine"),a=t("./$.hide"),s=t("./$.has"),c=t("./$.iterators"),u=t("./$.iter-create"),h=t("./$.set-to-string-tag"),l=t("./$").getProto,f=t("./$.wks")("iterator"),p=!([].keys&&"next"in[].keys()),d="@@iterator",m="keys",g="values",v=function(){return this};e.exports=function(t,e,r,y,b,x,w){u(r,e,y);var _,S,M=function(t){if(!p&&t in C)return C[t];switch(t){case m:return function(){return new r(this,t)};case g:return function(){return new r(this,t)}}return function(){return new r(this,t)}},E=e+" Iterator",T=b==g,A=!1,C=t.prototype,L=C[f]||C[d]||b&&C[b],k=L||M(b);if(L){var F=l(k.call(new t));h(F,E,!0),!n&&s(C,d)&&a(F,f,v),T&&L.name!==g&&(A=!0,k=function(){return L.call(this)})}if(n&&!w||!p&&!A&&C[f]||a(C,f,k),c[e]=k,c[E]=v,b)if(_={values:T?k:M(g),keys:x?k:M(m),entries:T?M("entries"):k},w)for(S in _)S in C||o(C,S,_[S]);else i(i.P+i.F*(p||A),e,_);return _}},{"./$":44,"./$.export":27,"./$.has":32,"./$.hide":33,"./$.iter-create":39,"./$.iterators":43,"./$.library":46,"./$.redefine":49,"./$.set-to-string-tag":51,"./$.wks":60}],41:[function(t,e,r){var n=t("./$.wks")("iterator"),i=!1;try{var o=[7][n]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}e.exports=function(t,e){if(!e&&!i)return!1;var r=!1;try{var o=[7],a=o[n]();a.next=function(){r=!0},o[n]=function(){return a},t(o)}catch(t){}return r}},{"./$.wks":60}],42:[function(t,e,r){e.exports=function(t,e){return{value:e,done:!!t}}},{}],43:[function(t,e,r){e.exports={}},{}],44:[function(t,e,r){var n=Object;e.exports={create:n.create,getProto:n.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:n.getOwnPropertyDescriptor,setDesc:n.defineProperty,setDescs:n.defineProperties,getKeys:n.keys,getNames:n.getOwnPropertyNames,getSymbols:n.getOwnPropertySymbols,each:[].forEach}},{}],45:[function(t,e,r){var n=t("./$"),i=t("./$.to-iobject");e.exports=function(t,e){for(var r,o=i(t),a=n.getKeys(o),s=a.length,c=0;s>c;)if(o[r=a[c++]]===e)return r}},{"./$":44,"./$.to-iobject":56}],46:[function(t,e,r){e.exports=!0},{}],47:[function(t,e,r){e.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},{}],48:[function(t,e,r){var n=t("./$.redefine");e.exports=function(t,e){for(var r in e)n(t,r,e[r]);return t}},{"./$.redefine":49}],49:[function(t,e,r){e.exports=t("./$.hide")},{"./$.hide":33}],50:[function(t,e,r){"use strict";var n=t("./$.core"),i=t("./$"),o=t("./$.descriptors"),a=t("./$.wks")("species");e.exports=function(t){var e=n[t];o&&e&&!e[a]&&i.setDesc(e,a,{configurable:!0,get:function(){return this}})}},{"./$":44,"./$.core":22,"./$.descriptors":25,"./$.wks":60}],51:[function(t,e,r){var n=t("./$").setDesc,i=t("./$.has"),o=t("./$.wks")("toStringTag");e.exports=function(t,e,r){t&&!i(t=r?t:t.prototype,o)&&n(t,o,{configurable:!0,value:e})}},{"./$":44,"./$.has":32,"./$.wks":60}],52:[function(t,e,r){var n=t("./$.global"),i="__core-js_shared__",o=n[i]||(n[i]={});e.exports=function(t){return o[t]||(o[t]={})}},{"./$.global":31}],53:[function(t,e,r){e.exports=function(t,e,r){if(!(t instanceof e))throw TypeError(r+": use the 'new' operator!");return t}},{}],54:[function(t,e,r){var n=t("./$.to-integer"),i=t("./$.defined");e.exports=function(t){return function(e,r){var o,a,s=String(i(e)),c=n(r),u=s.length;return c<0||c>=u?t?"":void 0:(o=s.charCodeAt(c),o<55296||o>56319||c+1===u||(a=s.charCodeAt(c+1))<56320||a>57343?t?s.charAt(c):o:t?s.slice(c,c+2):(o-55296<<10)+(a-56320)+65536)}}},{"./$.defined":24,"./$.to-integer":55}],55:[function(t,e,r){var n=Math.ceil,i=Math.floor;e.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},{}],56:[function(t,e,r){var n=t("./$.iobject"),i=t("./$.defined");e.exports=function(t){return n(i(t))}},{"./$.defined":24,"./$.iobject":34}],57:[function(t,e,r){var n=t("./$.to-integer"),i=Math.min;e.exports=function(t){return t>0?i(n(t),9007199254740991):0}},{"./$.to-integer":55}],58:[function(t,e,r){var n=t("./$.defined");e.exports=function(t){return Object(n(t))}},{"./$.defined":24}],59:[function(t,e,r){var n=0,i=Math.random();e.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+i).toString(36))}},{}],60:[function(t,e,r){var n=t("./$.shared")("wks"),i=t("./$.uid"),o=t("./$.global").Symbol;e.exports=function(t){return n[t]||(n[t]=o&&o[t]||(o||i)("Symbol."+t))}},{"./$.global":31,"./$.shared":52,"./$.uid":59}],61:[function(t,e,r){var n=t("./$.classof"),i=t("./$.wks")("iterator"),o=t("./$.iterators");e.exports=t("./$.core").getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[n(t)]}},{"./$.classof":17,"./$.core":22,"./$.iterators":43,"./$.wks":60}],62:[function(t,e,r){"use strict";var n=t("./$.ctx"),i=t("./$.export"),o=t("./$.to-object"),a=t("./$.iter-call"),s=t("./$.is-array-iter"),c=t("./$.to-length"),u=t("./core.get-iterator-method");i(i.S+i.F*!t("./$.iter-detect")(function(t){Array.from(t)}),"Array",{from:function(t){var e,r,i,h,l=o(t),f="function"==typeof this?this:Array,p=arguments,d=p.length,m=d>1?p[1]:void 0,g=void 0!==m,v=0,y=u(l);if(g&&(m=n(m,d>2?p[2]:void 0,2)),void 0==y||f==Array&&s(y))for(e=c(l.length),r=new f(e);e>v;v++)r[v]=g?m(l[v],v):l[v];else for(h=y.call(l),r=new f;!(i=h.next()).done;v++)r[v]=g?a(h,m,[i.value,v],!0):i.value;return r.length=v,r}})},{"./$.ctx":23,"./$.export":27,"./$.is-array-iter":35,"./$.iter-call":38,"./$.iter-detect":41,"./$.to-length":57,"./$.to-object":58,"./core.get-iterator-method":61}],63:[function(t,e,r){"use strict";var n=t("./$.add-to-unscopables"),i=t("./$.iter-step"),o=t("./$.iterators"),a=t("./$.to-iobject");e.exports=t("./$.iter-define")(Array,"Array",function(t,e){this._t=a(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,i(1)):"keys"==e?i(0,r):"values"==e?i(0,t[r]):i(0,[r,t[r]])},"values"),o.Arguments=o.Array,n("keys"),n("values"),n("entries")},{"./$.add-to-unscopables":15,"./$.iter-define":40,"./$.iter-step":42,"./$.iterators":43,"./$.to-iobject":56}],64:[function(t,e,r){"use strict";var n=t("./$.collection-strong");t("./$.collection")("Map",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function(t){var e=n.getEntry(this,t);return e&&e.v},set:function(t,e){return n.def(this,0===t?0:t,e)}},n,!0)},{"./$.collection":21,"./$.collection-strong":19}],65:[function(t,e,r){},{}],66:[function(t,e,r){"use strict";var n=t("./$.string-at")(!0);t("./$.iter-define")(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,r=this._i;return r>=e.length?{value:void 0,done:!0}:(t=n(e,r),this._i+=t.length,{value:t,done:!1})})},{"./$.iter-define":40,"./$.string-at":54}],67:[function(t,e,r){"use strict";var n=t("./$"),i=t("./$.global"),o=t("./$.has"),a=t("./$.descriptors"),s=t("./$.export"),c=t("./$.redefine"),u=t("./$.fails"),h=t("./$.shared"),l=t("./$.set-to-string-tag"),f=t("./$.uid"),p=t("./$.wks"),d=t("./$.keyof"),m=t("./$.get-names"),g=t("./$.enum-keys"),v=t("./$.is-array"),y=t("./$.an-object"),b=t("./$.to-iobject"),x=t("./$.property-desc"),w=n.getDesc,_=n.setDesc,S=n.create,M=m.get,E=i.Symbol,T=i.JSON,A=T&&T.stringify,C=!1,L=p("_hidden"),k=n.isEnum,F=h("symbol-registry"),P=h("symbols"),R="function"==typeof E,D=Object.prototype,O=a&&u(function(){return 7!=S(_({},"a",{get:function(){return _(this,"a",{value:7}).a}})).a})?function(t,e,r){var n=w(D,e);n&&delete D[e],_(t,e,r),n&&t!==D&&_(D,e,n)}:_,$=function(t){var e=P[t]=S(E.prototype);return e._k=t,a&&C&&O(D,t,{configurable:!0,set:function(e){o(this,L)&&o(this[L],t)&&(this[L][t]=!1),O(this,t,x(1,e))}}),e},j=function(t){return"symbol"==typeof t},U=function(t,e,r){return r&&o(P,e)?(r.enumerable?(o(t,L)&&t[L][e]&&(t[L][e]=!1),r=S(r,{enumerable:x(0,!1)})):(o(t,L)||_(t,L,x(1,{})),t[L][e]=!0),O(t,e,r)):_(t,e,r)},B=function(t,e){y(t);for(var r,n=g(e=b(e)),i=0,o=n.length;o>i;)U(t,r=n[i++],e[r]);return t},N=function(t,e){return void 0===e?S(t):B(S(t),e)},I=function(t){var e=k.call(this,t);return!(e||!o(this,t)||!o(P,t)||o(this,L)&&this[L][t])||e},V=function(t,e){var r=w(t=b(t),e);return!r||!o(P,e)||o(t,L)&&t[L][e]||(r.enumerable=!0),r},G=function(t){for(var e,r=M(b(t)),n=[],i=0;r.length>i;)o(P,e=r[i++])||e==L||n.push(e);return n},z=function(t){for(var e,r=M(b(t)),n=[],i=0;r.length>i;)o(P,e=r[i++])&&n.push(P[e]);return n},H=function(t){if(void 0!==t&&!j(t)){for(var e,r,n=[t],i=1,o=arguments;o.length>i;)n.push(o[i++]);return e=n[1],"function"==typeof e&&(r=e),!r&&v(e)||(e=function(t,e){if(r&&(e=r.call(this,t,e)),!j(e))return e}),n[1]=e,A.apply(T,n)}},W=u(function(){var t=E();return"[null]"!=A([t])||"{}"!=A({a:t})||"{}"!=A(Object(t))});R||(E=function(){if(j(this))throw TypeError("Symbol is not a constructor");return $(f(arguments.length>0?arguments[0]:void 0))},c(E.prototype,"toString",function(){return this._k}),j=function(t){return t instanceof E},n.create=N,n.isEnum=I,n.getDesc=V,n.setDesc=U,n.setDescs=B,n.getNames=m.get=G,n.getSymbols=z,a&&!t("./$.library")&&c(D,"propertyIsEnumerable",I,!0));var q={for:function(t){return o(F,t+="")?F[t]:F[t]=E(t)},keyFor:function(t){return d(F,t)},useSetter:function(){C=!0},useSimple:function(){C=!1}};n.each.call("hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),function(t){var e=p(t);q[t]=R?e:$(e)}),C=!0,s(s.G+s.W,{Symbol:E}),s(s.S,"Symbol",q),s(s.S+s.F*!R,"Object",{create:N,defineProperty:U,defineProperties:B,getOwnPropertyDescriptor:V,getOwnPropertyNames:G,getOwnPropertySymbols:z}),T&&s(s.S+s.F*(!R||W),"JSON",{stringify:H}),l(E,"Symbol"),l(Math,"Math",!0),l(i.JSON,"JSON",!0)},{"./$":44,"./$.an-object":16,"./$.descriptors":25,"./$.enum-keys":26,"./$.export":27,"./$.fails":28,"./$.get-names":30,"./$.global":31,"./$.has":32,"./$.is-array":36,"./$.keyof":45,"./$.library":46,"./$.property-desc":47,"./$.redefine":49,"./$.set-to-string-tag":51,"./$.shared":52,"./$.to-iobject":56,"./$.uid":59,"./$.wks":60}],68:[function(t,e,r){var n=t("./$.export");n(n.P,"Map",{toJSON:t("./$.collection-to-json")("Map")})},{"./$.collection-to-json":20,"./$.export":27}],69:[function(t,e,r){t("./es6.array.iterator");var n=t("./$.iterators");n.NodeList=n.HTMLCollection=n.Array},{"./$.iterators":43,"./es6.array.iterator":63}],70:[function(t,e,r){arguments[4][14][0].apply(r,arguments)},{dup:14}],71:[function(t,e,r){var n=t("./$.wks")("unscopables"),i=Array.prototype;void 0==i[n]&&t("./$.hide")(i,n,{}),e.exports=function(t){i[n][t]=!0}},{"./$.hide":99,"./$.wks":151}],72:[function(t,e,r){arguments[4][16][0].apply(r,arguments)},{"./$.is-object":106,dup:16}],73:[function(t,e,r){"use strict";var n=t("./$.to-object"),i=t("./$.to-index"),o=t("./$.to-length");e.exports=[].copyWithin||function(t,e){var r=n(this),a=o(r.length),s=i(t,a),c=i(e,a),u=arguments,h=u.length>2?u[2]:void 0,l=Math.min((void 0===h?a:i(h,a))-c,a-s),f=1;for(c0;)c in r?r[s]=r[c]:delete r[s],s+=f,c+=f;return r}},{"./$.to-index":144,"./$.to-length":147,"./$.to-object":148}],74:[function(t,e,r){"use strict";var n=t("./$.to-object"),i=t("./$.to-index"),o=t("./$.to-length");e.exports=[].fill||function(t){for(var e=n(this),r=o(e.length),a=arguments,s=a.length,c=i(s>1?a[1]:void 0,r),u=s>2?a[2]:void 0,h=void 0===u?r:i(u,r);h>c;)e[c++]=t;return e}},{"./$.to-index":144,"./$.to-length":147,"./$.to-object":148}],75:[function(t,e,r){var n=t("./$.to-iobject"),i=t("./$.to-length"),o=t("./$.to-index");e.exports=function(t){return function(e,r,a){var s,c=n(e),u=i(c.length),h=o(a,u);if(t&&r!=r){for(;u>h;)if(s=c[h++],s!=s)return!0}else for(;u>h;h++)if((t||h in c)&&c[h]===r)return t||h;return!t&&-1}}},{"./$.to-index":144,"./$.to-iobject":146,"./$.to-length":147}],76:[function(t,e,r){var n=t("./$.ctx"),i=t("./$.iobject"),o=t("./$.to-object"),a=t("./$.to-length"),s=t("./$.array-species-create");e.exports=function(t){var e=1==t,r=2==t,c=3==t,u=4==t,h=6==t,l=5==t||h;return function(f,p,d){for(var m,g,v=o(f),y=i(v),b=n(p,d,3),x=a(y.length),w=0,_=e?s(f,x):r?s(f,0):void 0;x>w;w++)if((l||w in y)&&(m=y[w],g=b(m,w,v),t))if(e)_[w]=g;else if(g)switch(t){case 3:return!0;case 5:return m;case 6:return w;case 2:_.push(m)}else if(u)return!1;return h?-1:c||u?u:_}}},{"./$.array-species-create":77,"./$.ctx":85,"./$.iobject":102,"./$.to-length":147,"./$.to-object":148}],77:[function(t,e,r){var n=t("./$.is-object"),i=t("./$.is-array"),o=t("./$.wks")("species");e.exports=function(t,e){var r;return i(t)&&(r=t.constructor,"function"!=typeof r||r!==Array&&!i(r.prototype)||(r=void 0),n(r)&&(r=r[o],null===r&&(r=void 0))),new(void 0===r?Array:r)(e)}},{"./$.is-array":104,"./$.is-object":106,"./$.wks":151}],78:[function(t,e,r){arguments[4][17][0].apply(r,arguments)},{"./$.cof":79,"./$.wks":151,dup:17}],79:[function(t,e,r){arguments[4][18][0].apply(r,arguments)},{dup:18}],80:[function(t,e,r){arguments[4][19][0].apply(r,arguments)},{"./$":114,"./$.ctx":85,"./$.defined":86,"./$.descriptors":87,"./$.for-of":95,"./$.has":98,"./$.hide":99,"./$.is-object":106,"./$.iter-define":110,"./$.iter-step":112,"./$.redefine-all":128,"./$.set-species":133,"./$.strict-new":137,"./$.uid":150,dup:19}],81:[function(t,e,r){arguments[4][20][0].apply(r,arguments)},{"./$.classof":78,"./$.for-of":95,dup:20}],82:[function(t,e,r){"use strict";var n=t("./$.hide"),i=t("./$.redefine-all"),o=t("./$.an-object"),a=t("./$.is-object"),s=t("./$.strict-new"),c=t("./$.for-of"),u=t("./$.array-methods"),h=t("./$.has"),l=t("./$.uid")("weak"),f=Object.isExtensible||a,p=u(5),d=u(6),m=0,g=function(t){return t._l||(t._l=new v)},v=function(){this.a=[]},y=function(t,e){return p(t.a,function(t){return t[0]===e})};v.prototype={get:function(t){var e=y(this,t);if(e)return e[1]},has:function(t){return!!y(this,t)},set:function(t,e){var r=y(this,t);r?r[1]=e:this.a.push([t,e])},delete:function(t){var e=d(this.a,function(e){return e[0]===t});return~e&&this.a.splice(e,1),!!~e}},e.exports={getConstructor:function(t,e,r,n){var o=t(function(t,i){s(t,o,e),t._i=m++,t._l=void 0,void 0!=i&&c(i,r,t[n],t)});return i(o.prototype,{delete:function(t){return!!a(t)&&(f(t)?h(t,l)&&h(t[l],this._i)&&delete t[l][this._i]:g(this).delete(t))},has:function(t){return!!a(t)&&(f(t)?h(t,l)&&h(t[l],this._i):g(this).has(t))}}),o},def:function(t,e,r){return f(o(e))?(h(e,l)||n(e,l,{}),e[l][t._i]=r):g(t).set(e,r),t},frozenStore:g,WEAK:l}},{"./$.an-object":72,"./$.array-methods":76,"./$.for-of":95,"./$.has":98,"./$.hide":99,"./$.is-object":106,"./$.redefine-all":128,"./$.strict-new":137,"./$.uid":150}],83:[function(t,e,r){"use strict";var n=t("./$.global"),i=t("./$.export"),o=t("./$.redefine"),a=t("./$.redefine-all"),s=t("./$.for-of"),c=t("./$.strict-new"),u=t("./$.is-object"),h=t("./$.fails"),l=t("./$.iter-detect"),f=t("./$.set-to-string-tag");e.exports=function(t,e,r,p,d,m){var g=n[t],v=g,y=d?"set":"add",b=v&&v.prototype,x={},w=function(t){var e=b[t];o(b,t,"delete"==t?function(t){return!(m&&!u(t))&&e.call(this,0===t?0:t)}:"has"==t?function(t){return!(m&&!u(t))&&e.call(this,0===t?0:t)}:"get"==t?function(t){return m&&!u(t)?void 0:e.call(this,0===t?0:t)}:"add"==t?function(t){return e.call(this,0===t?0:t),this}:function(t,r){return e.call(this,0===t?0:t,r),this})};if("function"==typeof v&&(m||b.forEach&&!h(function(){(new v).entries().next()}))){var _,S=new v,M=S[y](m?{}:-0,1)!=S,E=h(function(){S.has(1)}),T=l(function(t){new v(t)});T||(v=e(function(e,r){c(e,v,t);var n=new g;return void 0!=r&&s(r,d,n[y],n),n}),v.prototype=b,b.constructor=v),m||S.forEach(function(t,e){_=1/e===-(1/0)}),(E||_)&&(w("delete"),w("has"),d&&w("get")),(_||M)&&w(y),m&&b.clear&&delete b.clear}else v=p.getConstructor(e,t,d,y),a(v.prototype,r);return f(v,t),x[t]=v,i(i.G+i.W+i.F*(v!=g),x),m||p.setStrong(v,t,d),v}},{"./$.export":90,"./$.fails":92,"./$.for-of":95,"./$.global":97,"./$.is-object":106,"./$.iter-detect":111,"./$.redefine":129,"./$.redefine-all":128,"./$.set-to-string-tag":134,"./$.strict-new":137}],84:[function(t,e,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],85:[function(t,e,r){arguments[4][23][0].apply(r,arguments)},{"./$.a-function":70,dup:23}],86:[function(t,e,r){arguments[4][24][0].apply(r,arguments)},{dup:24}],87:[function(t,e,r){arguments[4][25][0].apply(r,arguments)},{"./$.fails":92,dup:25}],88:[function(t,e,r){var n=t("./$.is-object"),i=t("./$.global").document,o=n(i)&&n(i.createElement);e.exports=function(t){return o?i.createElement(t):{}}},{"./$.global":97,"./$.is-object":106}],89:[function(t,e,r){arguments[4][26][0].apply(r,arguments)},{"./$":114,dup:26}],90:[function(t,e,r){var n=t("./$.global"),i=t("./$.core"),o=t("./$.hide"),a=t("./$.redefine"),s=t("./$.ctx"),c="prototype",u=function(t,e,r){var h,l,f,p,d=t&u.F,m=t&u.G,g=t&u.S,v=t&u.P,y=t&u.B,b=m?n:g?n[e]||(n[e]={}):(n[e]||{})[c],x=m?i:i[e]||(i[e]={}),w=x[c]||(x[c]={});m&&(r=e);for(h in r)l=!d&&b&&h in b,f=(l?b:r)[h],p=y&&l?s(f,n):v&&"function"==typeof f?s(Function.call,f):f,b&&!l&&a(b,h,f),x[h]!=f&&o(x,h,p),v&&w[h]!=f&&(w[h]=f)};n.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,e.exports=u},{"./$.core":84,"./$.ctx":85,"./$.global":97,"./$.hide":99,"./$.redefine":129}],91:[function(t,e,r){var n=t("./$.wks")("match");e.exports=function(t){var e=/./;try{"/./"[t](e)}catch(r){try{return e[n]=!1,!"/./"[t](e)}catch(t){}}return!0}},{"./$.wks":151}],92:[function(t,e,r){arguments[4][28][0].apply(r,arguments)},{dup:28}],93:[function(t,e,r){"use strict";var n=t("./$.hide"),i=t("./$.redefine"),o=t("./$.fails"),a=t("./$.defined"),s=t("./$.wks");e.exports=function(t,e,r){var c=s(t),u=""[t];o(function(){var e={};return e[c]=function(){return 7},7!=""[t](e)})&&(i(String.prototype,t,r(a,c,u)),n(RegExp.prototype,c,2==e?function(t,e){return u.call(t,this,e)}:function(t){return u.call(t,this)}))}},{"./$.defined":86,"./$.fails":92,"./$.hide":99,"./$.redefine":129,"./$.wks":151}],94:[function(t,e,r){"use strict";var n=t("./$.an-object");e.exports=function(){var t=n(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},{"./$.an-object":72}],95:[function(t,e,r){arguments[4][29][0].apply(r,arguments)},{"./$.an-object":72,"./$.ctx":85,"./$.is-array-iter":103,"./$.iter-call":108,"./$.to-length":147,"./core.get-iterator-method":152,dup:29}],96:[function(t,e,r){arguments[4][30][0].apply(r,arguments)},{"./$":114,"./$.to-iobject":146,dup:30}],97:[function(t,e,r){arguments[4][31][0].apply(r,arguments)},{dup:31}],98:[function(t,e,r){arguments[4][32][0].apply(r,arguments)},{dup:32}],99:[function(t,e,r){arguments[4][33][0].apply(r,arguments)},{"./$":114,"./$.descriptors":87,"./$.property-desc":127,dup:33}],100:[function(t,e,r){e.exports=t("./$.global").document&&document.documentElement},{"./$.global":97}],101:[function(t,e,r){e.exports=function(t,e,r){var n=void 0===r;switch(e.length){case 0:return n?t():t.call(r);case 1:return n?t(e[0]):t.call(r,e[0]);case 2:return n?t(e[0],e[1]):t.call(r,e[0],e[1]);case 3:return n?t(e[0],e[1],e[2]):t.call(r,e[0],e[1],e[2]);case 4:return n?t(e[0],e[1],e[2],e[3]):t.call(r,e[0],e[1],e[2],e[3])}return t.apply(r,e)}},{}],102:[function(t,e,r){arguments[4][34][0].apply(r,arguments)},{"./$.cof":79,dup:34}],103:[function(t,e,r){arguments[4][35][0].apply(r,arguments)},{"./$.iterators":113,"./$.wks":151,dup:35}],104:[function(t,e,r){arguments[4][36][0].apply(r,arguments)},{"./$.cof":79,dup:36}],105:[function(t,e,r){var n=t("./$.is-object"),i=Math.floor;e.exports=function(t){return!n(t)&&isFinite(t)&&i(t)===t}},{"./$.is-object":106}],106:[function(t,e,r){arguments[4][37][0].apply(r,arguments)},{dup:37}],107:[function(t,e,r){var n=t("./$.is-object"),i=t("./$.cof"),o=t("./$.wks")("match");e.exports=function(t){var e;return n(t)&&(void 0!==(e=t[o])?!!e:"RegExp"==i(t))}},{"./$.cof":79,"./$.is-object":106,"./$.wks":151}],108:[function(t,e,r){arguments[4][38][0].apply(r,arguments)},{"./$.an-object":72,dup:38}],109:[function(t,e,r){arguments[4][39][0].apply(r,arguments)},{"./$":114,"./$.hide":99,"./$.property-desc":127,"./$.set-to-string-tag":134,"./$.wks":151,dup:39}],110:[function(t,e,r){arguments[4][40][0].apply(r,arguments)},{"./$":114,"./$.export":90,"./$.has":98,"./$.hide":99,"./$.iter-create":109,"./$.iterators":113,"./$.library":116,"./$.redefine":129,"./$.set-to-string-tag":134,"./$.wks":151,dup:40}],111:[function(t,e,r){arguments[4][41][0].apply(r,arguments)},{"./$.wks":151,dup:41}],112:[function(t,e,r){arguments[4][42][0].apply(r,arguments)},{dup:42}],113:[function(t,e,r){arguments[4][43][0].apply(r,arguments)},{dup:43}],114:[function(t,e,r){arguments[4][44][0].apply(r,arguments)},{dup:44}],115:[function(t,e,r){arguments[4][45][0].apply(r,arguments)},{"./$":114,"./$.to-iobject":146,dup:45}],116:[function(t,e,r){e.exports=!1},{}],117:[function(t,e,r){e.exports=Math.expm1||function(t){return 0==(t=+t)?t:t>-1e-6&&t<1e-6?t+t*t/2:Math.exp(t)-1}},{}],118:[function(t,e,r){e.exports=Math.log1p||function(t){return(t=+t)>-1e-8&&t<1e-8?t-t*t/2:Math.log(1+t)}},{}],119:[function(t,e,r){e.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},{}],120:[function(t,e,r){var n,i,o,a=t("./$.global"),s=t("./$.task").set,c=a.MutationObserver||a.WebKitMutationObserver,u=a.process,h=a.Promise,l="process"==t("./$.cof")(u),f=function(){var t,e,r;for(l&&(t=u.domain)&&(u.domain=null,t.exit());n;)e=n.domain,r=n.fn,e&&e.enter(),r(),e&&e.exit(),n=n.next;i=void 0,t&&t.enter()};if(l)o=function(){u.nextTick(f)};else if(c){var p=1,d=document.createTextNode("");new c(f).observe(d,{characterData:!0}),o=function(){d.data=p=-p}}else o=h&&h.resolve?function(){h.resolve().then(f)}:function(){s.call(a,f)};e.exports=function(t){var e={fn:t,next:void 0,domain:l&&u.domain};i&&(i.next=e),n||(n=e,o()),i=e}},{"./$.cof":79,"./$.global":97,"./$.task":143}],121:[function(t,e,r){var n=t("./$"),i=t("./$.to-object"),o=t("./$.iobject");e.exports=t("./$.fails")(function(){var t=Object.assign,e={},r={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach(function(t){r[t]=t}),7!=t({},e)[n]||Object.keys(t({},r)).join("")!=i})?function(t,e){for(var r=i(t),a=arguments,s=a.length,c=1,u=n.getKeys,h=n.getSymbols,l=n.isEnum;s>c;)for(var f,p=o(a[c++]),d=h?u(p).concat(h(p)):u(p),m=d.length,g=0;m>g;)l.call(p,f=d[g++])&&(r[f]=p[f]);return r}:Object.assign},{"./$":114,"./$.fails":92,"./$.iobject":102,"./$.to-object":148}],122:[function(t,e,r){var n=t("./$.export"),i=t("./$.core"),o=t("./$.fails");e.exports=function(t,e){var r=(i.Object||{})[t]||Object[t],a={};a[t]=e(r),n(n.S+n.F*o(function(){r(1)}),"Object",a)}},{"./$.core":84,"./$.export":90,"./$.fails":92}],123:[function(t,e,r){var n=t("./$"),i=t("./$.to-iobject"),o=n.isEnum;e.exports=function(t){return function(e){for(var r,a=i(e),s=n.getKeys(a),c=s.length,u=0,h=[];c>u;)o.call(a,r=s[u++])&&h.push(t?[r,a[r]]:a[r]);return h}}},{"./$":114,"./$.to-iobject":146}],124:[function(t,e,r){var n=t("./$"),i=t("./$.an-object"),o=t("./$.global").Reflect;e.exports=o&&o.ownKeys||function(t){var e=n.getNames(i(t)),r=n.getSymbols;return r?e.concat(r(t)):e}},{"./$":114,"./$.an-object":72,"./$.global":97}],125:[function(t,e,r){"use strict";var n=t("./$.path"),i=t("./$.invoke"),o=t("./$.a-function");e.exports=function(){for(var t=o(this),e=arguments.length,r=Array(e),a=0,s=n._,c=!1;e>a;)(r[a]=arguments[a++])===s&&(c=!0);return function(){var n,o=this,a=arguments,u=a.length,h=0,l=0;if(!c&&!u)return i(t,r,o);if(n=r.slice(),c)for(;e>h;h++)n[h]===s&&(n[h]=a[l++]);for(;u>l;)n.push(a[l++]);return i(t,n,o)}}},{"./$.a-function":70,"./$.invoke":101,"./$.path":126}],126:[function(t,e,r){e.exports=t("./$.global")},{"./$.global":97}],127:[function(t,e,r){arguments[4][47][0].apply(r,arguments)},{dup:47}],128:[function(t,e,r){arguments[4][48][0].apply(r,arguments)},{"./$.redefine":129,dup:48}],129:[function(t,e,r){var n=t("./$.global"),i=t("./$.hide"),o=t("./$.uid")("src"),a="toString",s=Function[a],c=(""+s).split(a);t("./$.core").inspectSource=function(t){return s.call(t)},(e.exports=function(t,e,r,a){"function"==typeof r&&(r.hasOwnProperty(o)||i(r,o,t[e]?""+t[e]:c.join(String(e))),r.hasOwnProperty("name")||i(r,"name",e)),t===n?t[e]=r:(a||delete t[e],i(t,e,r))})(Function.prototype,a,function(){return"function"==typeof this&&this[o]||s.call(this)})},{"./$.core":84,"./$.global":97,"./$.hide":99,"./$.uid":150}],130:[function(t,e,r){e.exports=function(t,e){var r=e===Object(e)?function(t){return e[t]}:e;return function(e){return String(e).replace(t,r)}}},{}],131:[function(t,e,r){e.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}},{}],132:[function(t,e,r){var n=t("./$").getDesc,i=t("./$.is-object"),o=t("./$.an-object"),a=function(t,e){if(o(t),!i(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,r,i){try{i=t("./$.ctx")(Function.call,n(Object.prototype,"__proto__").set,2),i(e,[]),r=!(e instanceof Array)}catch(t){r=!0}return function(t,e){return a(t,e),r?t.__proto__=e:i(t,e),t}}({},!1):void 0),check:a}},{"./$":114,"./$.an-object":72,"./$.ctx":85,"./$.is-object":106}],133:[function(t,e,r){"use strict";var n=t("./$.global"),i=t("./$"),o=t("./$.descriptors"),a=t("./$.wks")("species");e.exports=function(t){var e=n[t];o&&e&&!e[a]&&i.setDesc(e,a,{configurable:!0,get:function(){return this}})}},{"./$":114,"./$.descriptors":87,"./$.global":97,"./$.wks":151}],134:[function(t,e,r){arguments[4][51][0].apply(r,arguments)},{"./$":114,"./$.has":98,"./$.wks":151,dup:51}],135:[function(t,e,r){arguments[4][52][0].apply(r,arguments)},{"./$.global":97,dup:52}],136:[function(t,e,r){var n=t("./$.an-object"),i=t("./$.a-function"),o=t("./$.wks")("species");
+e.exports=function(t,e){var r,a=n(t).constructor;return void 0===a||void 0==(r=n(a)[o])?e:i(r)}},{"./$.a-function":70,"./$.an-object":72,"./$.wks":151}],137:[function(t,e,r){arguments[4][53][0].apply(r,arguments)},{dup:53}],138:[function(t,e,r){arguments[4][54][0].apply(r,arguments)},{"./$.defined":86,"./$.to-integer":145,dup:54}],139:[function(t,e,r){var n=t("./$.is-regexp"),i=t("./$.defined");e.exports=function(t,e,r){if(n(e))throw TypeError("String#"+r+" doesn't accept regex!");return String(i(t))}},{"./$.defined":86,"./$.is-regexp":107}],140:[function(t,e,r){var n=t("./$.to-length"),i=t("./$.string-repeat"),o=t("./$.defined");e.exports=function(t,e,r,a){var s=String(o(t)),c=s.length,u=void 0===r?" ":String(r),h=n(e);if(h<=c)return s;""==u&&(u=" ");var l=h-c,f=i.call(u,Math.ceil(l/u.length));return f.length>l&&(f=f.slice(0,l)),a?f+s:s+f}},{"./$.defined":86,"./$.string-repeat":141,"./$.to-length":147}],141:[function(t,e,r){"use strict";var n=t("./$.to-integer"),i=t("./$.defined");e.exports=function(t){var e=String(i(this)),r="",o=n(t);if(o<0||o==1/0)throw RangeError("Count can't be negative");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(r+=e);return r}},{"./$.defined":86,"./$.to-integer":145}],142:[function(t,e,r){var n=t("./$.export"),i=t("./$.defined"),o=t("./$.fails"),a="\t\n\v\f\r \u2028\u2029\ufeff",s="["+a+"]",c="
",u=RegExp("^"+s+s+"*"),h=RegExp(s+s+"*$"),l=function(t,e){var r={};r[t]=e(f),n(n.P+n.F*o(function(){return!!a[t]()||c[t]()!=c}),"String",r)},f=l.trim=function(t,e){return t=String(i(t)),1&e&&(t=t.replace(u,"")),2&e&&(t=t.replace(h,"")),t};e.exports=l},{"./$.defined":86,"./$.export":90,"./$.fails":92}],143:[function(t,e,r){var n,i,o,a=t("./$.ctx"),s=t("./$.invoke"),c=t("./$.html"),u=t("./$.dom-create"),h=t("./$.global"),l=h.process,f=h.setImmediate,p=h.clearImmediate,d=h.MessageChannel,m=0,g={},v="onreadystatechange",y=function(){var t=+this;if(g.hasOwnProperty(t)){var e=g[t];delete g[t],e()}},b=function(t){y.call(t.data)};f&&p||(f=function(t){for(var e=[],r=1;arguments.length>r;)e.push(arguments[r++]);return g[++m]=function(){s("function"==typeof t?t:Function(t),e)},n(m),m},p=function(t){delete g[t]},"process"==t("./$.cof")(l)?n=function(t){l.nextTick(a(y,t,1))}:d?(i=new d,o=i.port2,i.port1.onmessage=b,n=a(o.postMessage,o,1)):h.addEventListener&&"function"==typeof postMessage&&!h.importScripts?(n=function(t){h.postMessage(t+"","*")},h.addEventListener("message",b,!1)):n=v in u("script")?function(t){c.appendChild(u("script"))[v]=function(){c.removeChild(this),y.call(t)}}:function(t){setTimeout(a(y,t,1),0)}),e.exports={set:f,clear:p}},{"./$.cof":79,"./$.ctx":85,"./$.dom-create":88,"./$.global":97,"./$.html":100,"./$.invoke":101}],144:[function(t,e,r){var n=t("./$.to-integer"),i=Math.max,o=Math.min;e.exports=function(t,e){return t=n(t),t<0?i(t+e,0):o(t,e)}},{"./$.to-integer":145}],145:[function(t,e,r){arguments[4][55][0].apply(r,arguments)},{dup:55}],146:[function(t,e,r){arguments[4][56][0].apply(r,arguments)},{"./$.defined":86,"./$.iobject":102,dup:56}],147:[function(t,e,r){arguments[4][57][0].apply(r,arguments)},{"./$.to-integer":145,dup:57}],148:[function(t,e,r){arguments[4][58][0].apply(r,arguments)},{"./$.defined":86,dup:58}],149:[function(t,e,r){var n=t("./$.is-object");e.exports=function(t,e){if(!n(t))return t;var r,i;if(e&&"function"==typeof(r=t.toString)&&!n(i=r.call(t)))return i;if("function"==typeof(r=t.valueOf)&&!n(i=r.call(t)))return i;if(!e&&"function"==typeof(r=t.toString)&&!n(i=r.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},{"./$.is-object":106}],150:[function(t,e,r){arguments[4][59][0].apply(r,arguments)},{dup:59}],151:[function(t,e,r){arguments[4][60][0].apply(r,arguments)},{"./$.global":97,"./$.shared":135,"./$.uid":150,dup:60}],152:[function(t,e,r){arguments[4][61][0].apply(r,arguments)},{"./$.classof":78,"./$.core":84,"./$.iterators":113,"./$.wks":151,dup:61}],153:[function(t,e,r){"use strict";var n,i=t("./$"),o=t("./$.export"),a=t("./$.descriptors"),s=t("./$.property-desc"),c=t("./$.html"),u=t("./$.dom-create"),h=t("./$.has"),l=t("./$.cof"),f=t("./$.invoke"),p=t("./$.fails"),d=t("./$.an-object"),m=t("./$.a-function"),g=t("./$.is-object"),v=t("./$.to-object"),y=t("./$.to-iobject"),b=t("./$.to-integer"),x=t("./$.to-index"),w=t("./$.to-length"),_=t("./$.iobject"),S=t("./$.uid")("__proto__"),M=t("./$.array-methods"),E=t("./$.array-includes")(!1),T=Object.prototype,A=Array.prototype,C=A.slice,L=A.join,k=i.setDesc,F=i.getDesc,P=i.setDescs,R={};a||(n=!p(function(){return 7!=k(u("div"),"a",{get:function(){return 7}}).a}),i.setDesc=function(t,e,r){if(n)try{return k(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(d(t)[e]=r.value),t},i.getDesc=function(t,e){if(n)try{return F(t,e)}catch(t){}if(h(t,e))return s(!T.propertyIsEnumerable.call(t,e),t[e])},i.setDescs=P=function(t,e){d(t);for(var r,n=i.getKeys(e),o=n.length,a=0;o>a;)i.setDesc(t,r=n[a++],e[r]);return t}),o(o.S+o.F*!a,"Object",{getOwnPropertyDescriptor:i.getDesc,defineProperty:i.setDesc,defineProperties:P});var D="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),O=D.concat("length","prototype"),$=D.length,j=function(){var t,e=u("iframe"),r=$,n=">";for(e.style.display="none",c.appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("o;)h(i,n=t[o++])&&(~E(a,n)||a.push(n));return a}},B=function(){};o(o.S,"Object",{getPrototypeOf:i.getProto=i.getProto||function(t){return t=v(t),h(t,S)?t[S]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?T:null},getOwnPropertyNames:i.getNames=i.getNames||U(O,O.length,!0),create:i.create=i.create||function(t,e){var r;return null!==t?(B.prototype=d(t),r=new B,B.prototype=null,r[S]=t):r=j(),void 0===e?r:P(r,e)},keys:i.getKeys=i.getKeys||U(D,$,!1)});var N=function(t,e,r){if(!(e in R)){for(var n=[],i=0;i=0:i>o;o+=a)o in n&&(r=e(r,n[o],o,this));return r}},V=function(t){return function(e){return t(this,e,arguments[1])}};o(o.P,"Array",{forEach:i.each=i.each||V(M(0)),map:V(M(1)),filter:V(M(2)),some:V(M(3)),every:V(M(4)),reduce:I(!1),reduceRight:I(!0),indexOf:V(E),lastIndexOf:function(t,e){var r=y(this),n=w(r.length),i=n-1;for(arguments.length>1&&(i=Math.min(i,b(e))),i<0&&(i=w(n+i));i>=0;i--)if(i in r&&r[i]===t)return i;return-1}}),o(o.S,"Date",{now:function(){return+new Date}});var G=function(t){return t>9?t:"0"+t};o(o.P+o.F*(p(function(){return"0385-07-25T07:06:39.999Z"!=new Date(-5e13-1).toISOString()})||!p(function(){new Date(NaN).toISOString()})),"Date",{toISOString:function(){if(!isFinite(this))throw RangeError("Invalid time value");var t=this,e=t.getUTCFullYear(),r=t.getUTCMilliseconds(),n=e<0?"-":e>9999?"+":"";return n+("00000"+Math.abs(e)).slice(n?-6:-4)+"-"+G(t.getUTCMonth()+1)+"-"+G(t.getUTCDate())+"T"+G(t.getUTCHours())+":"+G(t.getUTCMinutes())+":"+G(t.getUTCSeconds())+"."+(r>99?r:"0"+G(r))+"Z"}})},{"./$":114,"./$.a-function":70,"./$.an-object":72,"./$.array-includes":75,"./$.array-methods":76,"./$.cof":79,"./$.descriptors":87,"./$.dom-create":88,"./$.export":90,"./$.fails":92,"./$.has":98,"./$.html":100,"./$.invoke":101,"./$.iobject":102,"./$.is-array":104,"./$.is-object":106,"./$.property-desc":127,"./$.to-index":144,"./$.to-integer":145,"./$.to-iobject":146,"./$.to-length":147,"./$.to-object":148,"./$.uid":150}],154:[function(t,e,r){var n=t("./$.export");n(n.P,"Array",{copyWithin:t("./$.array-copy-within")}),t("./$.add-to-unscopables")("copyWithin")},{"./$.add-to-unscopables":71,"./$.array-copy-within":73,"./$.export":90}],155:[function(t,e,r){var n=t("./$.export");n(n.P,"Array",{fill:t("./$.array-fill")}),t("./$.add-to-unscopables")("fill")},{"./$.add-to-unscopables":71,"./$.array-fill":74,"./$.export":90}],156:[function(t,e,r){"use strict";var n=t("./$.export"),i=t("./$.array-methods")(6),o="findIndex",a=!0;o in[]&&Array(1)[o](function(){a=!1}),n(n.P+n.F*a,"Array",{findIndex:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),t("./$.add-to-unscopables")(o)},{"./$.add-to-unscopables":71,"./$.array-methods":76,"./$.export":90}],157:[function(t,e,r){"use strict";var n=t("./$.export"),i=t("./$.array-methods")(5),o="find",a=!0;o in[]&&Array(1)[o](function(){a=!1}),n(n.P+n.F*a,"Array",{find:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),t("./$.add-to-unscopables")(o)},{"./$.add-to-unscopables":71,"./$.array-methods":76,"./$.export":90}],158:[function(t,e,r){arguments[4][62][0].apply(r,arguments)},{"./$.ctx":85,"./$.export":90,"./$.is-array-iter":103,"./$.iter-call":108,"./$.iter-detect":111,"./$.to-length":147,"./$.to-object":148,"./core.get-iterator-method":152,dup:62}],159:[function(t,e,r){arguments[4][63][0].apply(r,arguments)},{"./$.add-to-unscopables":71,"./$.iter-define":110,"./$.iter-step":112,"./$.iterators":113,"./$.to-iobject":146,dup:63}],160:[function(t,e,r){"use strict";var n=t("./$.export");n(n.S+n.F*t("./$.fails")(function(){function t(){}return!(Array.of.call(t)instanceof t)}),"Array",{of:function(){for(var t=0,e=arguments,r=e.length,n=new("function"==typeof this?this:Array)(r);r>t;)n[t]=e[t++];return n.length=r,n}})},{"./$.export":90,"./$.fails":92}],161:[function(t,e,r){t("./$.set-species")("Array")},{"./$.set-species":133}],162:[function(t,e,r){"use strict";var n=t("./$"),i=t("./$.is-object"),o=t("./$.wks")("hasInstance"),a=Function.prototype;o in a||n.setDesc(a,o,{value:function(t){if("function"!=typeof this||!i(t))return!1;if(!i(this.prototype))return t instanceof this;for(;t=n.getProto(t);)if(this.prototype===t)return!0;return!1}})},{"./$":114,"./$.is-object":106,"./$.wks":151}],163:[function(t,e,r){var n=t("./$").setDesc,i=t("./$.property-desc"),o=t("./$.has"),a=Function.prototype,s=/^\s*function ([^ (]*)/,c="name";c in a||t("./$.descriptors")&&n(a,c,{configurable:!0,get:function(){var t=(""+this).match(s),e=t?t[1]:"";return o(this,c)||n(this,c,i(5,e)),e}})},{"./$":114,"./$.descriptors":87,"./$.has":98,"./$.property-desc":127}],164:[function(t,e,r){arguments[4][64][0].apply(r,arguments)},{"./$.collection":83,"./$.collection-strong":80,dup:64}],165:[function(t,e,r){var n=t("./$.export"),i=t("./$.math-log1p"),o=Math.sqrt,a=Math.acosh;n(n.S+n.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:i(t-1+o(t-1)*o(t+1))}})},{"./$.export":90,"./$.math-log1p":118}],166:[function(t,e,r){function n(t){return isFinite(t=+t)&&0!=t?t<0?-n(-t):Math.log(t+Math.sqrt(t*t+1)):t}var i=t("./$.export");i(i.S,"Math",{asinh:n})},{"./$.export":90}],167:[function(t,e,r){var n=t("./$.export");n(n.S,"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},{"./$.export":90}],168:[function(t,e,r){var n=t("./$.export"),i=t("./$.math-sign");n(n.S,"Math",{cbrt:function(t){return i(t=+t)*Math.pow(Math.abs(t),1/3)}})},{"./$.export":90,"./$.math-sign":119}],169:[function(t,e,r){var n=t("./$.export");n(n.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},{"./$.export":90}],170:[function(t,e,r){var n=t("./$.export"),i=Math.exp;n(n.S,"Math",{cosh:function(t){return(i(t=+t)+i(-t))/2}})},{"./$.export":90}],171:[function(t,e,r){var n=t("./$.export");n(n.S,"Math",{expm1:t("./$.math-expm1")})},{"./$.export":90,"./$.math-expm1":117}],172:[function(t,e,r){var n=t("./$.export"),i=t("./$.math-sign"),o=Math.pow,a=o(2,-52),s=o(2,-23),c=o(2,127)*(2-s),u=o(2,-126),h=function(t){return t+1/a-1/a};n(n.S,"Math",{fround:function(t){var e,r,n=Math.abs(t),o=i(t);return nc||r!=r?o*(1/0):o*r)}})},{"./$.export":90,"./$.math-sign":119}],173:[function(t,e,r){var n=t("./$.export"),i=Math.abs;n(n.S,"Math",{hypot:function(t,e){for(var r,n,o=0,a=0,s=arguments,c=s.length,u=0;a0?(n=r/u,o+=n*n):o+=r;return u===1/0?1/0:u*Math.sqrt(o)}})},{"./$.export":90}],174:[function(t,e,r){var n=t("./$.export"),i=Math.imul;n(n.S+n.F*t("./$.fails")(function(){return i(4294967295,5)!=-5||2!=i.length}),"Math",{imul:function(t,e){var r=65535,n=+t,i=+e,o=r&n,a=r&i;return 0|o*a+((r&n>>>16)*a+o*(r&i>>>16)<<16>>>0)}})},{"./$.export":90,"./$.fails":92}],175:[function(t,e,r){var n=t("./$.export");n(n.S,"Math",{log10:function(t){return Math.log(t)/Math.LN10}})},{"./$.export":90}],176:[function(t,e,r){var n=t("./$.export");n(n.S,"Math",{log1p:t("./$.math-log1p")})},{"./$.export":90,"./$.math-log1p":118}],177:[function(t,e,r){var n=t("./$.export");n(n.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},{"./$.export":90}],178:[function(t,e,r){var n=t("./$.export");n(n.S,"Math",{sign:t("./$.math-sign")})},{"./$.export":90,"./$.math-sign":119}],179:[function(t,e,r){var n=t("./$.export"),i=t("./$.math-expm1"),o=Math.exp;n(n.S+n.F*t("./$.fails")(function(){return!Math.sinh(-2e-17)!=-2e-17}),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},{"./$.export":90,"./$.fails":92,"./$.math-expm1":117}],180:[function(t,e,r){var n=t("./$.export"),i=t("./$.math-expm1"),o=Math.exp;n(n.S,"Math",{tanh:function(t){var e=i(t=+t),r=i(-t);return e==1/0?1:r==1/0?-1:(e-r)/(o(t)+o(-t))}})},{"./$.export":90,"./$.math-expm1":117}],181:[function(t,e,r){var n=t("./$.export");n(n.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},{"./$.export":90}],182:[function(t,e,r){"use strict";var n=t("./$"),i=t("./$.global"),o=t("./$.has"),a=t("./$.cof"),s=t("./$.to-primitive"),c=t("./$.fails"),u=t("./$.string-trim").trim,h="Number",l=i[h],f=l,p=l.prototype,d=a(n.create(p))==h,m="trim"in String.prototype,g=function(t){var e=s(t,!1);if("string"==typeof e&&e.length>2){e=m?e.trim():u(e,3);var r,n,i,o=e.charCodeAt(0);if(43===o||45===o){if(r=e.charCodeAt(2),88===r||120===r)return NaN}else if(48===o){switch(e.charCodeAt(1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+e}for(var a,c=e.slice(2),h=0,l=c.length;hi)return NaN;return parseInt(c,n)}}return+e};l(" 0o1")&&l("0b1")&&!l("+0x1")||(l=function(t){var e=arguments.length<1?0:t,r=this;return r instanceof l&&(d?c(function(){p.valueOf.call(r)}):a(r)!=h)?new f(g(e)):g(e)},n.each.call(t("./$.descriptors")?n.getNames(f):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),function(t){o(f,t)&&!o(l,t)&&n.setDesc(l,t,n.getDesc(f,t))}),l.prototype=p,p.constructor=l,t("./$.redefine")(i,h,l))},{"./$":114,"./$.cof":79,"./$.descriptors":87,"./$.fails":92,"./$.global":97,"./$.has":98,"./$.redefine":129,"./$.string-trim":142,"./$.to-primitive":149}],183:[function(t,e,r){var n=t("./$.export");n(n.S,"Number",{EPSILON:Math.pow(2,-52)})},{"./$.export":90}],184:[function(t,e,r){var n=t("./$.export"),i=t("./$.global").isFinite;n(n.S,"Number",{isFinite:function(t){return"number"==typeof t&&i(t)}})},{"./$.export":90,"./$.global":97}],185:[function(t,e,r){var n=t("./$.export");n(n.S,"Number",{isInteger:t("./$.is-integer")})},{"./$.export":90,"./$.is-integer":105}],186:[function(t,e,r){var n=t("./$.export");n(n.S,"Number",{isNaN:function(t){return t!=t}})},{"./$.export":90}],187:[function(t,e,r){var n=t("./$.export"),i=t("./$.is-integer"),o=Math.abs;n(n.S,"Number",{isSafeInteger:function(t){return i(t)&&o(t)<=9007199254740991}})},{"./$.export":90,"./$.is-integer":105}],188:[function(t,e,r){var n=t("./$.export");n(n.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},{"./$.export":90}],189:[function(t,e,r){var n=t("./$.export");n(n.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},{"./$.export":90}],190:[function(t,e,r){var n=t("./$.export");n(n.S,"Number",{parseFloat:parseFloat})},{"./$.export":90}],191:[function(t,e,r){var n=t("./$.export");n(n.S,"Number",{parseInt:parseInt})},{"./$.export":90}],192:[function(t,e,r){var n=t("./$.export");n(n.S+n.F,"Object",{assign:t("./$.object-assign")})},{"./$.export":90,"./$.object-assign":121}],193:[function(t,e,r){var n=t("./$.is-object");t("./$.object-sap")("freeze",function(t){return function(e){return t&&n(e)?t(e):e}})},{"./$.is-object":106,"./$.object-sap":122}],194:[function(t,e,r){var n=t("./$.to-iobject");t("./$.object-sap")("getOwnPropertyDescriptor",function(t){return function(e,r){return t(n(e),r)}})},{"./$.object-sap":122,"./$.to-iobject":146}],195:[function(t,e,r){t("./$.object-sap")("getOwnPropertyNames",function(){return t("./$.get-names").get})},{"./$.get-names":96,"./$.object-sap":122}],196:[function(t,e,r){var n=t("./$.to-object");t("./$.object-sap")("getPrototypeOf",function(t){return function(e){return t(n(e))}})},{"./$.object-sap":122,"./$.to-object":148}],197:[function(t,e,r){var n=t("./$.is-object");t("./$.object-sap")("isExtensible",function(t){return function(e){return!!n(e)&&(!t||t(e))}})},{"./$.is-object":106,"./$.object-sap":122}],198:[function(t,e,r){var n=t("./$.is-object");t("./$.object-sap")("isFrozen",function(t){return function(e){return!n(e)||!!t&&t(e)}})},{"./$.is-object":106,"./$.object-sap":122}],199:[function(t,e,r){var n=t("./$.is-object");t("./$.object-sap")("isSealed",function(t){return function(e){return!n(e)||!!t&&t(e)}})},{"./$.is-object":106,"./$.object-sap":122}],200:[function(t,e,r){var n=t("./$.export");n(n.S,"Object",{is:t("./$.same-value")})},{"./$.export":90,"./$.same-value":131}],201:[function(t,e,r){var n=t("./$.to-object");t("./$.object-sap")("keys",function(t){return function(e){return t(n(e))}})},{"./$.object-sap":122,"./$.to-object":148}],202:[function(t,e,r){var n=t("./$.is-object");t("./$.object-sap")("preventExtensions",function(t){return function(e){return t&&n(e)?t(e):e}})},{"./$.is-object":106,"./$.object-sap":122}],203:[function(t,e,r){var n=t("./$.is-object");t("./$.object-sap")("seal",function(t){return function(e){return t&&n(e)?t(e):e}})},{"./$.is-object":106,"./$.object-sap":122}],204:[function(t,e,r){var n=t("./$.export");n(n.S,"Object",{setPrototypeOf:t("./$.set-proto").set})},{"./$.export":90,"./$.set-proto":132}],205:[function(t,e,r){"use strict";var n=t("./$.classof"),i={};i[t("./$.wks")("toStringTag")]="z",i+""!="[object z]"&&t("./$.redefine")(Object.prototype,"toString",function(){return"[object "+n(this)+"]"},!0)},{"./$.classof":78,"./$.redefine":129,"./$.wks":151}],206:[function(t,e,r){"use strict";var n,i=t("./$"),o=t("./$.library"),a=t("./$.global"),s=t("./$.ctx"),c=t("./$.classof"),u=t("./$.export"),h=t("./$.is-object"),l=t("./$.an-object"),f=t("./$.a-function"),p=t("./$.strict-new"),d=t("./$.for-of"),m=t("./$.set-proto").set,g=t("./$.same-value"),v=t("./$.wks")("species"),y=t("./$.species-constructor"),b=t("./$.microtask"),x="Promise",w=a.process,_="process"==c(w),S=a[x],M=function(t){var e=new S(function(){});return t&&(e.constructor=Object),S.resolve(e)===e},E=function(){function e(t){var r=new S(t);return m(r,e.prototype),r}var r=!1;try{if(r=S&&S.resolve&&M(),m(e,S),e.prototype=i.create(S.prototype,{constructor:{value:e}}),e.resolve(5).then(function(){})instanceof e||(r=!1),r&&t("./$.descriptors")){var n=!1;S.resolve(i.setDesc({},"then",{get:function(){n=!0}})),r=n}}catch(t){r=!1}return r}(),T=function(t,e){return!(!o||t!==S||e!==n)||g(t,e)},A=function(t){var e=l(t)[v];return void 0!=e?e:t},C=function(t){var e;return!(!h(t)||"function"!=typeof(e=t.then))&&e},L=function(t){var e,r;this.promise=new t(function(t,n){if(void 0!==e||void 0!==r)throw TypeError("Bad Promise constructor");e=t,r=n}),this.resolve=f(e),this.reject=f(r)},k=function(t){try{t()}catch(t){return{error:t}}},F=function(t,e){if(!t.n){t.n=!0;var r=t.c;b(function(){for(var n=t.v,i=1==t.s,o=0,s=function(e){var r,o,a=i?e.ok:e.fail,s=e.resolve,c=e.reject;try{a?(i||(t.h=!0),r=a===!0?n:a(n),r===e.promise?c(TypeError("Promise-chain cycle")):(o=C(r))?o.call(r,s,c):s(r)):c(n)}catch(t){c(t)}};r.length>o;)s(r[o++]);r.length=0,t.n=!1,e&&setTimeout(function(){var e,r,i=t.p;P(i)&&(_?w.emit("unhandledRejection",n,i):(e=a.onunhandledrejection)?e({promise:i,reason:n}):(r=a.console)&&r.error&&r.error("Unhandled promise rejection",n)),t.a=void 0},1)})}},P=function(t){var e,r=t._d,n=r.a||r.c,i=0;if(r.h)return!1;for(;n.length>i;)if(e=n[i++],e.fail||!P(e.promise))return!1;return!0},R=function(t){var e=this;e.d||(e.d=!0,e=e.r||e,e.v=t,e.s=2,e.a=e.c.slice(),F(e,!0))},D=function(t){var e,r=this;if(!r.d){r.d=!0,r=r.r||r;try{if(r.p===t)throw TypeError("Promise can't be resolved itself");(e=C(t))?b(function(){var n={r:r,d:!1};try{e.call(t,s(D,n,1),s(R,n,1))}catch(t){R.call(n,t)}}):(r.v=t,r.s=1,F(r,!1))}catch(t){R.call({r:r,d:!1},t)}}};E||(S=function(t){f(t);var e=this._d={p:p(this,S,x),c:[],a:void 0,s:0,d:!1,v:void 0,h:!1,n:!1};try{t(s(D,e,1),s(R,e,1))}catch(t){R.call(e,t)}},t("./$.redefine-all")(S.prototype,{then:function(t,e){var r=new L(y(this,S)),n=r.promise,i=this._d;return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,i.c.push(r),i.a&&i.a.push(r),i.s&&F(i,!1),n},catch:function(t){return this.then(void 0,t)}})),u(u.G+u.W+u.F*!E,{Promise:S}),t("./$.set-to-string-tag")(S,x),t("./$.set-species")(x),n=t("./$.core")[x],u(u.S+u.F*!E,x,{reject:function(t){var e=new L(this),r=e.reject;return r(t),e.promise}}),u(u.S+u.F*(!E||M(!0)),x,{resolve:function(t){if(t instanceof S&&T(t.constructor,this))return t;var e=new L(this),r=e.resolve;return r(t),e.promise}}),u(u.S+u.F*!(E&&t("./$.iter-detect")(function(t){S.all(t).catch(function(){})})),x,{all:function(t){var e=A(this),r=new L(e),n=r.resolve,o=r.reject,a=[],s=k(function(){d(t,!1,a.push,a);var r=a.length,s=Array(r);r?i.each.call(a,function(t,i){var a=!1;e.resolve(t).then(function(t){a||(a=!0,s[i]=t,--r||n(s))},o)}):n(s)});return s&&o(s.error),r.promise},race:function(t){var e=A(this),r=new L(e),n=r.reject,i=k(function(){d(t,!1,function(t){e.resolve(t).then(r.resolve,n)})});return i&&n(i.error),r.promise}})},{"./$":114,"./$.a-function":70,"./$.an-object":72,"./$.classof":78,"./$.core":84,"./$.ctx":85,"./$.descriptors":87,"./$.export":90,"./$.for-of":95,"./$.global":97,"./$.is-object":106,"./$.iter-detect":111,"./$.library":116,"./$.microtask":120,"./$.redefine-all":128,"./$.same-value":131,"./$.set-proto":132,"./$.set-species":133,"./$.set-to-string-tag":134,"./$.species-constructor":136,"./$.strict-new":137,"./$.wks":151}],207:[function(t,e,r){var n=t("./$.export"),i=Function.apply;n(n.S,"Reflect",{apply:function(t,e,r){return i.call(t,e,r)}})},{"./$.export":90}],208:[function(t,e,r){var n=t("./$"),i=t("./$.export"),o=t("./$.a-function"),a=t("./$.an-object"),s=t("./$.is-object"),c=Function.bind||t("./$.core").Function.prototype.bind;i(i.S+i.F*t("./$.fails")(function(){function t(){}return!(Reflect.construct(function(){},[],t)instanceof t)}),"Reflect",{construct:function(t,e){o(t);var r=arguments.length<3?t:o(arguments[2]);if(t==r){if(void 0!=e)switch(a(e).length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var i=[null];return i.push.apply(i,e),new(c.apply(t,i))}var u=r.prototype,h=n.create(s(u)?u:Object.prototype),l=Function.apply.call(t,h,e);return s(l)?l:h}})},{"./$":114,"./$.a-function":70,"./$.an-object":72,"./$.core":84,"./$.export":90,"./$.fails":92,"./$.is-object":106}],209:[function(t,e,r){var n=t("./$"),i=t("./$.export"),o=t("./$.an-object");i(i.S+i.F*t("./$.fails")(function(){Reflect.defineProperty(n.setDesc({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(t,e,r){o(t);try{return n.setDesc(t,e,r),!0}catch(t){return!1}}})},{"./$":114,"./$.an-object":72,"./$.export":90,"./$.fails":92}],210:[function(t,e,r){var n=t("./$.export"),i=t("./$").getDesc,o=t("./$.an-object");n(n.S,"Reflect",{deleteProperty:function(t,e){var r=i(o(t),e);return!(r&&!r.configurable)&&delete t[e]}})},{"./$":114,"./$.an-object":72,"./$.export":90}],211:[function(t,e,r){"use strict";var n=t("./$.export"),i=t("./$.an-object"),o=function(t){this._t=i(t),this._i=0;var e,r=this._k=[];for(e in t)r.push(e)};t("./$.iter-create")(o,"Object",function(){var t,e=this,r=e._k;do if(e._i>=r.length)return{value:void 0,done:!0};while(!((t=r[e._i++])in e._t));return{value:t,done:!1}}),n(n.S,"Reflect",{enumerate:function(t){return new o(t)}})},{"./$.an-object":72,"./$.export":90,"./$.iter-create":109}],212:[function(t,e,r){var n=t("./$"),i=t("./$.export"),o=t("./$.an-object");i(i.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return n.getDesc(o(t),e)}})},{"./$":114,"./$.an-object":72,"./$.export":90}],213:[function(t,e,r){var n=t("./$.export"),i=t("./$").getProto,o=t("./$.an-object");n(n.S,"Reflect",{getPrototypeOf:function(t){return i(o(t))}})},{"./$":114,"./$.an-object":72,"./$.export":90}],214:[function(t,e,r){function n(t,e){var r,a,u=arguments.length<3?t:arguments[2];return c(t)===u?t[e]:(r=i.getDesc(t,e))?o(r,"value")?r.value:void 0!==r.get?r.get.call(u):void 0:s(a=i.getProto(t))?n(a,e,u):void 0}var i=t("./$"),o=t("./$.has"),a=t("./$.export"),s=t("./$.is-object"),c=t("./$.an-object");a(a.S,"Reflect",{get:n})},{"./$":114,"./$.an-object":72,"./$.export":90,"./$.has":98,"./$.is-object":106}],215:[function(t,e,r){var n=t("./$.export");n(n.S,"Reflect",{has:function(t,e){return e in t}})},{"./$.export":90}],216:[function(t,e,r){var n=t("./$.export"),i=t("./$.an-object"),o=Object.isExtensible;n(n.S,"Reflect",{isExtensible:function(t){return i(t),!o||o(t)}})},{"./$.an-object":72,"./$.export":90}],217:[function(t,e,r){var n=t("./$.export");n(n.S,"Reflect",{ownKeys:t("./$.own-keys")})},{"./$.export":90,"./$.own-keys":124}],218:[function(t,e,r){var n=t("./$.export"),i=t("./$.an-object"),o=Object.preventExtensions;n(n.S,"Reflect",{preventExtensions:function(t){i(t);try{return o&&o(t),!0}catch(t){return!1}}})},{"./$.an-object":72,"./$.export":90}],219:[function(t,e,r){var n=t("./$.export"),i=t("./$.set-proto");i&&n(n.S,"Reflect",{setPrototypeOf:function(t,e){i.check(t,e);try{return i.set(t,e),!0}catch(t){return!1}}})},{"./$.export":90,"./$.set-proto":132}],220:[function(t,e,r){function n(t,e,r){var a,h,l=arguments.length<4?t:arguments[3],f=i.getDesc(c(t),e);if(!f){if(u(h=i.getProto(t)))return n(h,e,r,l);f=s(0)}return o(f,"value")?!(f.writable===!1||!u(l))&&(a=i.getDesc(l,e)||s(0),a.value=r,i.setDesc(l,e,a),!0):void 0!==f.set&&(f.set.call(l,r),!0)}var i=t("./$"),o=t("./$.has"),a=t("./$.export"),s=t("./$.property-desc"),c=t("./$.an-object"),u=t("./$.is-object");a(a.S,"Reflect",{set:n})},{"./$":114,"./$.an-object":72,"./$.export":90,"./$.has":98,"./$.is-object":106,"./$.property-desc":127}],221:[function(t,e,r){var n=t("./$"),i=t("./$.global"),o=t("./$.is-regexp"),a=t("./$.flags"),s=i.RegExp,c=s,u=s.prototype,h=/a/g,l=/a/g,f=new s(h)!==h;!t("./$.descriptors")||f&&!t("./$.fails")(function(){return l[t("./$.wks")("match")]=!1,s(h)!=h||s(l)==l||"/a/i"!=s(h,"i")})||(s=function(t,e){var r=o(t),n=void 0===e;return this instanceof s||!r||t.constructor!==s||!n?f?new c(r&&!n?t.source:t,e):c((r=t instanceof s)?t.source:t,r&&n?a.call(t):e):t},n.each.call(n.getNames(c),function(t){t in s||n.setDesc(s,t,{configurable:!0,get:function(){return c[t]},set:function(e){c[t]=e}})}),u.constructor=s,s.prototype=u,t("./$.redefine")(i,"RegExp",s)),t("./$.set-species")("RegExp")},{"./$":114,"./$.descriptors":87,"./$.fails":92,"./$.flags":94,"./$.global":97,"./$.is-regexp":107,"./$.redefine":129,"./$.set-species":133,"./$.wks":151}],222:[function(t,e,r){var n=t("./$");t("./$.descriptors")&&"g"!=/./g.flags&&n.setDesc(RegExp.prototype,"flags",{configurable:!0,get:t("./$.flags")})},{"./$":114,"./$.descriptors":87,"./$.flags":94}],223:[function(t,e,r){t("./$.fix-re-wks")("match",1,function(t,e){return function(r){"use strict";var n=t(this),i=void 0==r?void 0:r[e];return void 0!==i?i.call(r,n):new RegExp(r)[e](String(n))}})},{"./$.fix-re-wks":93}],224:[function(t,e,r){t("./$.fix-re-wks")("replace",2,function(t,e,r){return function(n,i){"use strict";var o=t(this),a=void 0==n?void 0:n[e];return void 0!==a?a.call(n,o,i):r.call(String(o),n,i)}})},{"./$.fix-re-wks":93}],225:[function(t,e,r){t("./$.fix-re-wks")("search",1,function(t,e){return function(r){"use strict";var n=t(this),i=void 0==r?void 0:r[e];return void 0!==i?i.call(r,n):new RegExp(r)[e](String(n))}})},{"./$.fix-re-wks":93}],226:[function(t,e,r){t("./$.fix-re-wks")("split",2,function(t,e,r){return function(n,i){"use strict";var o=t(this),a=void 0==n?void 0:n[e];return void 0!==a?a.call(n,o,i):r.call(String(o),n,i)}})},{"./$.fix-re-wks":93}],227:[function(t,e,r){"use strict";var n=t("./$.collection-strong");t("./$.collection")("Set",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return n.def(this,t=0===t?0:t,t)}},n)},{"./$.collection":83,"./$.collection-strong":80}],228:[function(t,e,r){"use strict";var n=t("./$.export"),i=t("./$.string-at")(!1);n(n.P,"String",{codePointAt:function(t){return i(this,t)}})},{"./$.export":90,"./$.string-at":138}],229:[function(t,e,r){"use strict";var n=t("./$.export"),i=t("./$.to-length"),o=t("./$.string-context"),a="endsWith",s=""[a];n(n.P+n.F*t("./$.fails-is-regexp")(a),"String",{endsWith:function(t){var e=o(this,t,a),r=arguments,n=r.length>1?r[1]:void 0,c=i(e.length),u=void 0===n?c:Math.min(i(n),c),h=String(t);return s?s.call(e,h,u):e.slice(u-h.length,u)===h}})},{"./$.export":90,"./$.fails-is-regexp":91,"./$.string-context":139,"./$.to-length":147}],230:[function(t,e,r){var n=t("./$.export"),i=t("./$.to-index"),o=String.fromCharCode,a=String.fromCodePoint;n(n.S+n.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(t){for(var e,r=[],n=arguments,a=n.length,s=0;a>s;){if(e=+n[s++],i(e,1114111)!==e)throw RangeError(e+" is not a valid code point");r.push(e<65536?o(e):o(((e-=65536)>>10)+55296,e%1024+56320))}return r.join("")}})},{"./$.export":90,"./$.to-index":144}],231:[function(t,e,r){"use strict";var n=t("./$.export"),i=t("./$.string-context"),o="includes";n(n.P+n.F*t("./$.fails-is-regexp")(o),"String",{includes:function(t){return!!~i(this,t,o).indexOf(t,arguments.length>1?arguments[1]:void 0)}})},{"./$.export":90,"./$.fails-is-regexp":91,"./$.string-context":139}],232:[function(t,e,r){arguments[4][66][0].apply(r,arguments)},{"./$.iter-define":110,"./$.string-at":138,dup:66}],233:[function(t,e,r){var n=t("./$.export"),i=t("./$.to-iobject"),o=t("./$.to-length");n(n.S,"String",{raw:function(t){for(var e=i(t.raw),r=o(e.length),n=arguments,a=n.length,s=[],c=0;r>c;)s.push(String(e[c++])),c1?r[1]:void 0,e.length)),c=String(t);
+return s?s.call(e,c,n):e.slice(n,n+c.length)===c}})},{"./$.export":90,"./$.fails-is-regexp":91,"./$.string-context":139,"./$.to-length":147}],236:[function(t,e,r){"use strict";t("./$.string-trim")("trim",function(t){return function(){return t(this,3)}})},{"./$.string-trim":142}],237:[function(t,e,r){arguments[4][67][0].apply(r,arguments)},{"./$":114,"./$.an-object":72,"./$.descriptors":87,"./$.enum-keys":89,"./$.export":90,"./$.fails":92,"./$.get-names":96,"./$.global":97,"./$.has":98,"./$.is-array":104,"./$.keyof":115,"./$.library":116,"./$.property-desc":127,"./$.redefine":129,"./$.set-to-string-tag":134,"./$.shared":135,"./$.to-iobject":146,"./$.uid":150,"./$.wks":151,dup:67}],238:[function(t,e,r){"use strict";var n=t("./$"),i=t("./$.redefine"),o=t("./$.collection-weak"),a=t("./$.is-object"),s=t("./$.has"),c=o.frozenStore,u=o.WEAK,h=Object.isExtensible||a,l={},f=t("./$.collection")("WeakMap",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function(t){if(a(t)){if(!h(t))return c(this).get(t);if(s(t,u))return t[u][this._i]}},set:function(t,e){return o.def(this,t,e)}},o,!0,!0);7!=(new f).set((Object.freeze||Object)(l),7).get(l)&&n.each.call(["delete","has","get","set"],function(t){var e=f.prototype,r=e[t];i(e,t,function(e,n){if(a(e)&&!h(e)){var i=c(this)[t](e,n);return"set"==t?this:i}return r.call(this,e,n)})})},{"./$":114,"./$.collection":83,"./$.collection-weak":82,"./$.has":98,"./$.is-object":106,"./$.redefine":129}],239:[function(t,e,r){"use strict";var n=t("./$.collection-weak");t("./$.collection")("WeakSet",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return n.def(this,t,!0)}},n,!1,!0)},{"./$.collection":83,"./$.collection-weak":82}],240:[function(t,e,r){"use strict";var n=t("./$.export"),i=t("./$.array-includes")(!0);n(n.P,"Array",{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),t("./$.add-to-unscopables")("includes")},{"./$.add-to-unscopables":71,"./$.array-includes":75,"./$.export":90}],241:[function(t,e,r){arguments[4][68][0].apply(r,arguments)},{"./$.collection-to-json":81,"./$.export":90,dup:68}],242:[function(t,e,r){var n=t("./$.export"),i=t("./$.object-to-array")(!0);n(n.S,"Object",{entries:function(t){return i(t)}})},{"./$.export":90,"./$.object-to-array":123}],243:[function(t,e,r){var n=t("./$"),i=t("./$.export"),o=t("./$.own-keys"),a=t("./$.to-iobject"),s=t("./$.property-desc");i(i.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,r,i=a(t),c=n.setDesc,u=n.getDesc,h=o(i),l={},f=0;h.length>f;)r=u(i,e=h[f++]),e in l?c(l,e,s(0,r)):l[e]=r;return l}})},{"./$":114,"./$.export":90,"./$.own-keys":124,"./$.property-desc":127,"./$.to-iobject":146}],244:[function(t,e,r){var n=t("./$.export"),i=t("./$.object-to-array")(!1);n(n.S,"Object",{values:function(t){return i(t)}})},{"./$.export":90,"./$.object-to-array":123}],245:[function(t,e,r){var n=t("./$.export"),i=t("./$.replacer")(/[\\^$*+?.()|[\]{}]/g,"\\$&");n(n.S,"RegExp",{escape:function(t){return i(t)}})},{"./$.export":90,"./$.replacer":130}],246:[function(t,e,r){var n=t("./$.export");n(n.P,"Set",{toJSON:t("./$.collection-to-json")("Set")})},{"./$.collection-to-json":81,"./$.export":90}],247:[function(t,e,r){"use strict";var n=t("./$.export"),i=t("./$.string-at")(!0);n(n.P,"String",{at:function(t){return i(this,t)}})},{"./$.export":90,"./$.string-at":138}],248:[function(t,e,r){"use strict";var n=t("./$.export"),i=t("./$.string-pad");n(n.P,"String",{padLeft:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},{"./$.export":90,"./$.string-pad":140}],249:[function(t,e,r){"use strict";var n=t("./$.export"),i=t("./$.string-pad");n(n.P,"String",{padRight:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0,!1)}})},{"./$.export":90,"./$.string-pad":140}],250:[function(t,e,r){"use strict";t("./$.string-trim")("trimLeft",function(t){return function(){return t(this,1)}})},{"./$.string-trim":142}],251:[function(t,e,r){"use strict";t("./$.string-trim")("trimRight",function(t){return function(){return t(this,2)}})},{"./$.string-trim":142}],252:[function(t,e,r){var n=t("./$"),i=t("./$.export"),o=t("./$.ctx"),a=t("./$.core").Array||Array,s={},c=function(t,e){n.each.call(t.split(","),function(t){void 0==e&&t in a?s[t]=a[t]:t in[]&&(s[t]=o(Function.call,[][t],e))})};c("pop,reverse,shift,keys,values,entries",1),c("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3),c("join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill"),i(i.S,"Array",s)},{"./$":114,"./$.core":84,"./$.ctx":85,"./$.export":90}],253:[function(t,e,r){t("./es6.array.iterator");var n=t("./$.global"),i=t("./$.hide"),o=t("./$.iterators"),a=t("./$.wks")("iterator"),s=n.NodeList,c=n.HTMLCollection,u=s&&s.prototype,h=c&&c.prototype,l=o.NodeList=o.HTMLCollection=o.Array;u&&!u[a]&&i(u,a,l),h&&!h[a]&&i(h,a,l)},{"./$.global":97,"./$.hide":99,"./$.iterators":113,"./$.wks":151,"./es6.array.iterator":159}],254:[function(t,e,r){var n=t("./$.export"),i=t("./$.task");n(n.G+n.B,{setImmediate:i.set,clearImmediate:i.clear})},{"./$.export":90,"./$.task":143}],255:[function(t,e,r){var n=t("./$.global"),i=t("./$.export"),o=t("./$.invoke"),a=t("./$.partial"),s=n.navigator,c=!!s&&/MSIE .\./.test(s.userAgent),u=function(t){return c?function(e,r){return t(o(a,[].slice.call(arguments,2),"function"==typeof e?e:Function(e)),r)}:t};i(i.G+i.B+i.F*c,{setTimeout:u(n.setTimeout),setInterval:u(n.setInterval)})},{"./$.export":90,"./$.global":97,"./$.invoke":101,"./$.partial":125}],256:[function(t,e,r){t("./modules/es5"),t("./modules/es6.symbol"),t("./modules/es6.object.assign"),t("./modules/es6.object.is"),t("./modules/es6.object.set-prototype-of"),t("./modules/es6.object.to-string"),t("./modules/es6.object.freeze"),t("./modules/es6.object.seal"),t("./modules/es6.object.prevent-extensions"),t("./modules/es6.object.is-frozen"),t("./modules/es6.object.is-sealed"),t("./modules/es6.object.is-extensible"),t("./modules/es6.object.get-own-property-descriptor"),t("./modules/es6.object.get-prototype-of"),t("./modules/es6.object.keys"),t("./modules/es6.object.get-own-property-names"),t("./modules/es6.function.name"),t("./modules/es6.function.has-instance"),t("./modules/es6.number.constructor"),t("./modules/es6.number.epsilon"),t("./modules/es6.number.is-finite"),t("./modules/es6.number.is-integer"),t("./modules/es6.number.is-nan"),t("./modules/es6.number.is-safe-integer"),t("./modules/es6.number.max-safe-integer"),t("./modules/es6.number.min-safe-integer"),t("./modules/es6.number.parse-float"),t("./modules/es6.number.parse-int"),t("./modules/es6.math.acosh"),t("./modules/es6.math.asinh"),t("./modules/es6.math.atanh"),t("./modules/es6.math.cbrt"),t("./modules/es6.math.clz32"),t("./modules/es6.math.cosh"),t("./modules/es6.math.expm1"),t("./modules/es6.math.fround"),t("./modules/es6.math.hypot"),t("./modules/es6.math.imul"),t("./modules/es6.math.log10"),t("./modules/es6.math.log1p"),t("./modules/es6.math.log2"),t("./modules/es6.math.sign"),t("./modules/es6.math.sinh"),t("./modules/es6.math.tanh"),t("./modules/es6.math.trunc"),t("./modules/es6.string.from-code-point"),t("./modules/es6.string.raw"),t("./modules/es6.string.trim"),t("./modules/es6.string.iterator"),t("./modules/es6.string.code-point-at"),t("./modules/es6.string.ends-with"),t("./modules/es6.string.includes"),t("./modules/es6.string.repeat"),t("./modules/es6.string.starts-with"),t("./modules/es6.array.from"),t("./modules/es6.array.of"),t("./modules/es6.array.iterator"),t("./modules/es6.array.species"),t("./modules/es6.array.copy-within"),t("./modules/es6.array.fill"),t("./modules/es6.array.find"),t("./modules/es6.array.find-index"),t("./modules/es6.regexp.constructor"),t("./modules/es6.regexp.flags"),t("./modules/es6.regexp.match"),t("./modules/es6.regexp.replace"),t("./modules/es6.regexp.search"),t("./modules/es6.regexp.split"),t("./modules/es6.promise"),t("./modules/es6.map"),t("./modules/es6.set"),t("./modules/es6.weak-map"),t("./modules/es6.weak-set"),t("./modules/es6.reflect.apply"),t("./modules/es6.reflect.construct"),t("./modules/es6.reflect.define-property"),t("./modules/es6.reflect.delete-property"),t("./modules/es6.reflect.enumerate"),t("./modules/es6.reflect.get"),t("./modules/es6.reflect.get-own-property-descriptor"),t("./modules/es6.reflect.get-prototype-of"),t("./modules/es6.reflect.has"),t("./modules/es6.reflect.is-extensible"),t("./modules/es6.reflect.own-keys"),t("./modules/es6.reflect.prevent-extensions"),t("./modules/es6.reflect.set"),t("./modules/es6.reflect.set-prototype-of"),t("./modules/es7.array.includes"),t("./modules/es7.string.at"),t("./modules/es7.string.pad-left"),t("./modules/es7.string.pad-right"),t("./modules/es7.string.trim-left"),t("./modules/es7.string.trim-right"),t("./modules/es7.regexp.escape"),t("./modules/es7.object.get-own-property-descriptors"),t("./modules/es7.object.values"),t("./modules/es7.object.entries"),t("./modules/es7.map.to-json"),t("./modules/es7.set.to-json"),t("./modules/js.array.statics"),t("./modules/web.timers"),t("./modules/web.immediate"),t("./modules/web.dom.iterable"),e.exports=t("./modules/$.core")},{"./modules/$.core":84,"./modules/es5":153,"./modules/es6.array.copy-within":154,"./modules/es6.array.fill":155,"./modules/es6.array.find":157,"./modules/es6.array.find-index":156,"./modules/es6.array.from":158,"./modules/es6.array.iterator":159,"./modules/es6.array.of":160,"./modules/es6.array.species":161,"./modules/es6.function.has-instance":162,"./modules/es6.function.name":163,"./modules/es6.map":164,"./modules/es6.math.acosh":165,"./modules/es6.math.asinh":166,"./modules/es6.math.atanh":167,"./modules/es6.math.cbrt":168,"./modules/es6.math.clz32":169,"./modules/es6.math.cosh":170,"./modules/es6.math.expm1":171,"./modules/es6.math.fround":172,"./modules/es6.math.hypot":173,"./modules/es6.math.imul":174,"./modules/es6.math.log10":175,"./modules/es6.math.log1p":176,"./modules/es6.math.log2":177,"./modules/es6.math.sign":178,"./modules/es6.math.sinh":179,"./modules/es6.math.tanh":180,"./modules/es6.math.trunc":181,"./modules/es6.number.constructor":182,"./modules/es6.number.epsilon":183,"./modules/es6.number.is-finite":184,"./modules/es6.number.is-integer":185,"./modules/es6.number.is-nan":186,"./modules/es6.number.is-safe-integer":187,"./modules/es6.number.max-safe-integer":188,"./modules/es6.number.min-safe-integer":189,"./modules/es6.number.parse-float":190,"./modules/es6.number.parse-int":191,"./modules/es6.object.assign":192,"./modules/es6.object.freeze":193,"./modules/es6.object.get-own-property-descriptor":194,"./modules/es6.object.get-own-property-names":195,"./modules/es6.object.get-prototype-of":196,"./modules/es6.object.is":200,"./modules/es6.object.is-extensible":197,"./modules/es6.object.is-frozen":198,"./modules/es6.object.is-sealed":199,"./modules/es6.object.keys":201,"./modules/es6.object.prevent-extensions":202,"./modules/es6.object.seal":203,"./modules/es6.object.set-prototype-of":204,"./modules/es6.object.to-string":205,"./modules/es6.promise":206,"./modules/es6.reflect.apply":207,"./modules/es6.reflect.construct":208,"./modules/es6.reflect.define-property":209,"./modules/es6.reflect.delete-property":210,"./modules/es6.reflect.enumerate":211,"./modules/es6.reflect.get":214,"./modules/es6.reflect.get-own-property-descriptor":212,"./modules/es6.reflect.get-prototype-of":213,"./modules/es6.reflect.has":215,"./modules/es6.reflect.is-extensible":216,"./modules/es6.reflect.own-keys":217,"./modules/es6.reflect.prevent-extensions":218,"./modules/es6.reflect.set":220,"./modules/es6.reflect.set-prototype-of":219,"./modules/es6.regexp.constructor":221,"./modules/es6.regexp.flags":222,"./modules/es6.regexp.match":223,"./modules/es6.regexp.replace":224,"./modules/es6.regexp.search":225,"./modules/es6.regexp.split":226,"./modules/es6.set":227,"./modules/es6.string.code-point-at":228,"./modules/es6.string.ends-with":229,"./modules/es6.string.from-code-point":230,"./modules/es6.string.includes":231,"./modules/es6.string.iterator":232,"./modules/es6.string.raw":233,"./modules/es6.string.repeat":234,"./modules/es6.string.starts-with":235,"./modules/es6.string.trim":236,"./modules/es6.symbol":237,"./modules/es6.weak-map":238,"./modules/es6.weak-set":239,"./modules/es7.array.includes":240,"./modules/es7.map.to-json":241,"./modules/es7.object.entries":242,"./modules/es7.object.get-own-property-descriptors":243,"./modules/es7.object.values":244,"./modules/es7.regexp.escape":245,"./modules/es7.set.to-json":246,"./modules/es7.string.at":247,"./modules/es7.string.pad-left":248,"./modules/es7.string.pad-right":249,"./modules/es7.string.trim-left":250,"./modules/es7.string.trim-right":251,"./modules/js.array.statics":252,"./modules/web.dom.iterable":253,"./modules/web.immediate":254,"./modules/web.timers":255}],257:[function(t,e,r){function n(){h=!1,s.length?u=s.concat(u):l=-1,u.length&&i()}function i(){if(!h){var t=setTimeout(n);h=!0;for(var e=u.length;e;){for(s=u,u=[];++l1)for(var r=1;r=0;--n){var i=this.tryEntries[n],o=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=y.call(i,"catchLoc"),s=y.call(i,"finallyLoc");if(a&&s){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&y.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),p(r),T}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;p(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:m(t),resultName:e,nextLoc:r},T}}}("object"==typeof r?r:"object"==typeof window?window:"object"==typeof self?self:this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:257}],259:[function(t,e,r){"use strict";var n=t("babel-runtime/helpers/create-class").default,i=t("babel-runtime/helpers/class-call-check").default,o=t("babel-runtime/core-js/symbol").default,a=t("babel-runtime/core-js/map").default,s=t("babel-runtime/core-js/array/from").default;window.altspace||(window.altspace={}),window.altspace.utilities||(window.altspace.utilities={}),window.altspace.utilities.behaviors||(window.altspace.utilities.behaviors={}),t("babel/polyfill");var c=o("containerMax"),u=o("containerMin"),h=o("object3D"),l=o("boundingBox"),f=o("origMatrix"),p=o("origMatrixAutoUpdate"),d=o("parent"),m=o("enclosure"),g=new a,v=function(){function t(e){var r=e.my,n=void 0===r?{}:r,o=e.at;i(this,t),this.my=n,this.at=o}return n(t,[{key:"getAxisSettings",value:function(t,e,r,n){e=e||"center",e=/(\w+)([-+].+)?/.exec(e);var i=e[1],o=e[2],a=parseFloat(o)||0;return o&&o.endsWith("%")?a=a/100*(n[t]-r[t]):o&&o.endsWith("m")&&(console.log(a,this[m]),a*=this[m].pixelsPerMeter,console.log(a)),{position:i,offset:a}}},{key:"getAnchorOffset",value:function(t,e){var r=this[l].max,n=this[l].min,i=this.getAxisSettings(t,e,n,r),o=i.position,a=i.offset;if("max"===o)return-r[t]+a;if("min"===o)return-n[t]+a;if("center"===o)return a;throw new Error(e+" is an invalid layout position for "+t)}},{key:"doLayout",value:function(){var t=this;s("xyz").forEach(function(e){var r=t.getAxisSettings(e,t.at[e],t[u],t[c]),n=r.position,i=r.offset,o=t.getAnchorOffset(e,t.my[e]);if("max"===n)t[h].position[e]=t[c][e]+i+o;else if("min"===n)t[h].position[e]=t[u][e]+i+o;else{if("center"!==n)throw new Error(t.at[e]+" is an invalid layout position for "+e);t[h].position[e]=i+o}}),this[d]&&(this[d].matrix=this[f],this[d].updateMatrixWorld(!0),this[d].matrixAutoUpdate=this[p])}},{key:"awake",value:function(t){var e=this;this[h]=t,this[l]=(new THREE.Box3).setFromObject(this[h]),altspace.getEnclosure().then(function(t){if(e[m]=t,e[h].parent instanceof THREE.Scene){var r=e[m].innerWidth/2,n=e[m].innerHeight/2,i=e[m].innerDepth/2;e[c]=new THREE.Vector3(r,n,i),e[u]=new THREE.Vector3(-r,-n,-i),e.doLayout()}else{var o=e[h].getWorldScale();e[l].min.divide(o),e[l].max.divide(o),e[d]=e[h].parent,e[f]=e[d].matrix.clone(),e[p]=e[d].matrixAutoUpdate,e[d].matrixAutoUpdate=!1,e[d].matrix.identity();var a=void 0;g.has(e[d].uuid)?a=g.get(e[d].uuid):(e[d].remove(e[h]),a=(new THREE.Box3).setFromObject(e[d]),e[d].add(e[h]),g.set(e[d].uuid,a)),e[c]=a.max,e[u]=a.min,e.doLayout()}})}}]),t}();window.altspace.utilities.behaviors.Layout=v},{"babel-runtime/core-js/array/from":3,"babel-runtime/core-js/map":4,"babel-runtime/core-js/symbol":6,"babel-runtime/helpers/class-call-check":7,"babel-runtime/helpers/create-class":8,"babel/polyfill":9}]},{},[259]),function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var c="function"==typeof require&&require;if(!s&&c)return require(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[a]={exports:{}};e[a][0].call(h.exports,function(t){var r=e[a][1][t];return i(r?r:t)},h,h.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;am;m++)e?d(a(l=t[m])[0],l[1]):d(t[m]);else for(f=p.call(t);!(l=f.next()).done;)i(f,d,l.value,e)}},{"./$.an-object":9,"./$.ctx":13,"./$.is-array-iter":26,"./$.iter-call":28,"./$.to-length":51,"./core.get-iterator-method":54}],20:[function(t,e,r){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},{}],21:[function(t,e,r){var n={}.hasOwnProperty;e.exports=function(t,e){return n.call(t,e)}},{}],22:[function(t,e,r){var n=t("./$"),i=t("./$.property-desc");e.exports=t("./$.descriptors")?function(t,e,r){return n.setDesc(t,e,i(1,r))}:function(t,e,r){return t[e]=r,t}},{"./$":34,"./$.descriptors":15,"./$.property-desc":37}],23:[function(t,e,r){e.exports=t("./$.global").document&&document.documentElement},{"./$.global":20}],24:[function(t,e,r){e.exports=function(t,e,r){var n=void 0===r;switch(e.length){case 0:return n?t():t.call(r);case 1:return n?t(e[0]):t.call(r,e[0]);case 2:return n?t(e[0],e[1]):t.call(r,e[0],e[1]);case 3:return n?t(e[0],e[1],e[2]):t.call(r,e[0],e[1],e[2]);case 4:return n?t(e[0],e[1],e[2],e[3]):t.call(r,e[0],e[1],e[2],e[3])}return t.apply(r,e)}},{}],25:[function(t,e,r){var n=t("./$.cof");e.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},{"./$.cof":11}],26:[function(t,e,r){var n=t("./$.iterators"),i=t("./$.wks")("iterator"),o=Array.prototype;e.exports=function(t){return void 0!==t&&(n.Array===t||o[i]===t)}},{"./$.iterators":33,"./$.wks":53}],27:[function(t,e,r){e.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},{}],28:[function(t,e,r){var n=t("./$.an-object");e.exports=function(t,e,r,i){try{return i?e(n(r)[0],r[1]):e(r)}catch(e){var o=t.return;throw void 0!==o&&n(o.call(t)),e}}},{"./$.an-object":9}],29:[function(t,e,r){"use strict";var n=t("./$"),i=t("./$.property-desc"),o=t("./$.set-to-string-tag"),a={};t("./$.hide")(a,t("./$.wks")("iterator"),function(){return this}),e.exports=function(t,e,r){t.prototype=n.create(a,{next:i(1,r)}),o(t,e+" Iterator")}},{"./$":34,"./$.hide":22,"./$.property-desc":37,"./$.set-to-string-tag":43,"./$.wks":53}],30:[function(t,e,r){"use strict";var n=t("./$.library"),i=t("./$.export"),o=t("./$.redefine"),a=t("./$.hide"),s=t("./$.has"),c=t("./$.iterators"),u=t("./$.iter-create"),h=t("./$.set-to-string-tag"),l=t("./$").getProto,f=t("./$.wks")("iterator"),p=!([].keys&&"next"in[].keys()),d="@@iterator",m="keys",g="values",v=function(){return this};e.exports=function(t,e,r,y,b,x,w){u(r,e,y);var _,S,M=function(t){if(!p&&t in C)return C[t];switch(t){case m:return function(){return new r(this,t)};case g:return function(){return new r(this,t)}}return function(){return new r(this,t)}},E=e+" Iterator",T=b==g,A=!1,C=t.prototype,L=C[f]||C[d]||b&&C[b],k=L||M(b);if(L){var F=l(k.call(new t));h(F,E,!0),!n&&s(C,d)&&a(F,f,v),T&&L.name!==g&&(A=!0,k=function(){return L.call(this)})}if(n&&!w||!p&&!A&&C[f]||a(C,f,k),c[e]=k,c[E]=v,b)if(_={values:T?k:M(g),keys:x?k:M(m),entries:T?M("entries"):k},w)for(S in _)S in C||o(C,S,_[S]);else i(i.P+i.F*(p||A),e,_);return _}},{"./$":34,"./$.export":17,"./$.has":21,"./$.hide":22,"./$.iter-create":29,"./$.iterators":33,"./$.library":35,"./$.redefine":39,"./$.set-to-string-tag":43,"./$.wks":53}],31:[function(t,e,r){var n=t("./$.wks")("iterator"),i=!1;try{var o=[7][n]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(t){}e.exports=function(t,e){if(!e&&!i)return!1;var r=!1;try{var o=[7],a=o[n]();a.next=function(){r=!0},o[n]=function(){return a},t(o)}catch(t){}return r}},{"./$.wks":53}],32:[function(t,e,r){e.exports=function(t,e){return{value:e,done:!!t}}},{}],33:[function(t,e,r){e.exports={}},{}],34:[function(t,e,r){var n=Object;e.exports={create:n.create,getProto:n.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:n.getOwnPropertyDescriptor,setDesc:n.defineProperty,setDescs:n.defineProperties,getKeys:n.keys,getNames:n.getOwnPropertyNames,getSymbols:n.getOwnPropertySymbols,each:[].forEach}},{}],35:[function(t,e,r){e.exports=!0},{}],36:[function(t,e,r){var n,i,o,a=t("./$.global"),s=t("./$.task").set,c=a.MutationObserver||a.WebKitMutationObserver,u=a.process,h=a.Promise,l="process"==t("./$.cof")(u),f=function(){var t,e,r;for(l&&(t=u.domain)&&(u.domain=null,t.exit());n;)e=n.domain,r=n.fn,e&&e.enter(),r(),e&&e.exit(),n=n.next;i=void 0,t&&t.enter()};if(l)o=function(){u.nextTick(f)};else if(c){var p=1,d=document.createTextNode("");new c(f).observe(d,{characterData:!0}),o=function(){d.data=p=-p}}else o=h&&h.resolve?function(){h.resolve().then(f)}:function(){s.call(a,f)};e.exports=function(t){var e={fn:t,next:void 0,domain:l&&u.domain};i&&(i.next=e),n||(n=e,o()),i=e}},{"./$.cof":11,"./$.global":20,"./$.task":48}],37:[function(t,e,r){e.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},{}],38:[function(t,e,r){var n=t("./$.redefine");e.exports=function(t,e){for(var r in e)n(t,r,e[r]);return t}},{"./$.redefine":39}],39:[function(t,e,r){e.exports=t("./$.hide")},{"./$.hide":22}],40:[function(t,e,r){e.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}},{}],41:[function(t,e,r){var n=t("./$").getDesc,i=t("./$.is-object"),o=t("./$.an-object"),a=function(t,e){if(o(t),!i(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,r,i){try{i=t("./$.ctx")(Function.call,n(Object.prototype,"__proto__").set,2),
+i(e,[]),r=!(e instanceof Array)}catch(t){r=!0}return function(t,e){return a(t,e),r?t.__proto__=e:i(t,e),t}}({},!1):void 0),check:a}},{"./$":34,"./$.an-object":9,"./$.ctx":13,"./$.is-object":27}],42:[function(t,e,r){"use strict";var n=t("./$.core"),i=t("./$"),o=t("./$.descriptors"),a=t("./$.wks")("species");e.exports=function(t){var e=n[t];o&&e&&!e[a]&&i.setDesc(e,a,{configurable:!0,get:function(){return this}})}},{"./$":34,"./$.core":12,"./$.descriptors":15,"./$.wks":53}],43:[function(t,e,r){var n=t("./$").setDesc,i=t("./$.has"),o=t("./$.wks")("toStringTag");e.exports=function(t,e,r){t&&!i(t=r?t:t.prototype,o)&&n(t,o,{configurable:!0,value:e})}},{"./$":34,"./$.has":21,"./$.wks":53}],44:[function(t,e,r){var n=t("./$.global"),i="__core-js_shared__",o=n[i]||(n[i]={});e.exports=function(t){return o[t]||(o[t]={})}},{"./$.global":20}],45:[function(t,e,r){var n=t("./$.an-object"),i=t("./$.a-function"),o=t("./$.wks")("species");e.exports=function(t,e){var r,a=n(t).constructor;return void 0===a||void 0==(r=n(a)[o])?e:i(r)}},{"./$.a-function":7,"./$.an-object":9,"./$.wks":53}],46:[function(t,e,r){e.exports=function(t,e,r){if(!(t instanceof e))throw TypeError(r+": use the 'new' operator!");return t}},{}],47:[function(t,e,r){var n=t("./$.to-integer"),i=t("./$.defined");e.exports=function(t){return function(e,r){var o,a,s=String(i(e)),c=n(r),u=s.length;return c<0||c>=u?t?"":void 0:(o=s.charCodeAt(c),o<55296||o>56319||c+1===u||(a=s.charCodeAt(c+1))<56320||a>57343?t?s.charAt(c):o:t?s.slice(c,c+2):(o-55296<<10)+(a-56320)+65536)}}},{"./$.defined":14,"./$.to-integer":49}],48:[function(t,e,r){var n,i,o,a=t("./$.ctx"),s=t("./$.invoke"),c=t("./$.html"),u=t("./$.dom-create"),h=t("./$.global"),l=h.process,f=h.setImmediate,p=h.clearImmediate,d=h.MessageChannel,m=0,g={},v="onreadystatechange",y=function(){var t=+this;if(g.hasOwnProperty(t)){var e=g[t];delete g[t],e()}},b=function(t){y.call(t.data)};f&&p||(f=function(t){for(var e=[],r=1;arguments.length>r;)e.push(arguments[r++]);return g[++m]=function(){s("function"==typeof t?t:Function(t),e)},n(m),m},p=function(t){delete g[t]},"process"==t("./$.cof")(l)?n=function(t){l.nextTick(a(y,t,1))}:d?(i=new d,o=i.port2,i.port1.onmessage=b,n=a(o.postMessage,o,1)):h.addEventListener&&"function"==typeof postMessage&&!h.importScripts?(n=function(t){h.postMessage(t+"","*")},h.addEventListener("message",b,!1)):n=v in u("script")?function(t){c.appendChild(u("script"))[v]=function(){c.removeChild(this),y.call(t)}}:function(t){setTimeout(a(y,t,1),0)}),e.exports={set:f,clear:p}},{"./$.cof":11,"./$.ctx":13,"./$.dom-create":16,"./$.global":20,"./$.html":23,"./$.invoke":24}],49:[function(t,e,r){var n=Math.ceil,i=Math.floor;e.exports=function(t){return isNaN(t=+t)?0:(t>0?i:n)(t)}},{}],50:[function(t,e,r){var n=t("./$.iobject"),i=t("./$.defined");e.exports=function(t){return n(i(t))}},{"./$.defined":14,"./$.iobject":25}],51:[function(t,e,r){var n=t("./$.to-integer"),i=Math.min;e.exports=function(t){return t>0?i(n(t),9007199254740991):0}},{"./$.to-integer":49}],52:[function(t,e,r){var n=0,i=Math.random();e.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+i).toString(36))}},{}],53:[function(t,e,r){var n=t("./$.shared")("wks"),i=t("./$.uid"),o=t("./$.global").Symbol;e.exports=function(t){return n[t]||(n[t]=o&&o[t]||(o||i)("Symbol."+t))}},{"./$.global":20,"./$.shared":44,"./$.uid":52}],54:[function(t,e,r){var n=t("./$.classof"),i=t("./$.wks")("iterator"),o=t("./$.iterators");e.exports=t("./$.core").getIteratorMethod=function(t){if(void 0!=t)return t[i]||t["@@iterator"]||o[n(t)]}},{"./$.classof":10,"./$.core":12,"./$.iterators":33,"./$.wks":53}],55:[function(t,e,r){"use strict";var n=t("./$.add-to-unscopables"),i=t("./$.iter-step"),o=t("./$.iterators"),a=t("./$.to-iobject");e.exports=t("./$.iter-define")(Array,"Array",function(t,e){this._t=a(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,i(1)):"keys"==e?i(0,r):"values"==e?i(0,t[r]):i(0,[r,t[r]])},"values"),o.Arguments=o.Array,n("keys"),n("values"),n("entries")},{"./$.add-to-unscopables":8,"./$.iter-define":30,"./$.iter-step":32,"./$.iterators":33,"./$.to-iobject":50}],56:[function(t,e,r){},{}],57:[function(t,e,r){"use strict";var n,i=t("./$"),o=t("./$.library"),a=t("./$.global"),s=t("./$.ctx"),c=t("./$.classof"),u=t("./$.export"),h=t("./$.is-object"),l=t("./$.an-object"),f=t("./$.a-function"),p=t("./$.strict-new"),d=t("./$.for-of"),m=t("./$.set-proto").set,g=t("./$.same-value"),v=t("./$.wks")("species"),y=t("./$.species-constructor"),b=t("./$.microtask"),x="Promise",w=a.process,_="process"==c(w),S=a[x],M=function(t){var e=new S(function(){});return t&&(e.constructor=Object),S.resolve(e)===e},E=function(){function e(t){var r=new S(t);return m(r,e.prototype),r}var r=!1;try{if(r=S&&S.resolve&&M(),m(e,S),e.prototype=i.create(S.prototype,{constructor:{value:e}}),e.resolve(5).then(function(){})instanceof e||(r=!1),r&&t("./$.descriptors")){var n=!1;S.resolve(i.setDesc({},"then",{get:function(){n=!0}})),r=n}}catch(t){r=!1}return r}(),T=function(t,e){return!(!o||t!==S||e!==n)||g(t,e)},A=function(t){var e=l(t)[v];return void 0!=e?e:t},C=function(t){var e;return!(!h(t)||"function"!=typeof(e=t.then))&&e},L=function(t){var e,r;this.promise=new t(function(t,n){if(void 0!==e||void 0!==r)throw TypeError("Bad Promise constructor");e=t,r=n}),this.resolve=f(e),this.reject=f(r)},k=function(t){try{t()}catch(t){return{error:t}}},F=function(t,e){if(!t.n){t.n=!0;var r=t.c;b(function(){for(var n=t.v,i=1==t.s,o=0,s=function(e){var r,o,a=i?e.ok:e.fail,s=e.resolve,c=e.reject;try{a?(i||(t.h=!0),r=a===!0?n:a(n),r===e.promise?c(TypeError("Promise-chain cycle")):(o=C(r))?o.call(r,s,c):s(r)):c(n)}catch(t){c(t)}};r.length>o;)s(r[o++]);r.length=0,t.n=!1,e&&setTimeout(function(){var e,r,i=t.p;P(i)&&(_?w.emit("unhandledRejection",n,i):(e=a.onunhandledrejection)?e({promise:i,reason:n}):(r=a.console)&&r.error&&r.error("Unhandled promise rejection",n)),t.a=void 0},1)})}},P=function(t){var e,r=t._d,n=r.a||r.c,i=0;if(r.h)return!1;for(;n.length>i;)if(e=n[i++],e.fail||!P(e.promise))return!1;return!0},R=function(t){var e=this;e.d||(e.d=!0,e=e.r||e,e.v=t,e.s=2,e.a=e.c.slice(),F(e,!0))},D=function(t){var e,r=this;if(!r.d){r.d=!0,r=r.r||r;try{if(r.p===t)throw TypeError("Promise can't be resolved itself");(e=C(t))?b(function(){var n={r:r,d:!1};try{e.call(t,s(D,n,1),s(R,n,1))}catch(t){R.call(n,t)}}):(r.v=t,r.s=1,F(r,!1))}catch(t){R.call({r:r,d:!1},t)}}};E||(S=function(t){f(t);var e=this._d={p:p(this,S,x),c:[],a:void 0,s:0,d:!1,v:void 0,h:!1,n:!1};try{t(s(D,e,1),s(R,e,1))}catch(t){R.call(e,t)}},t("./$.redefine-all")(S.prototype,{then:function(t,e){var r=new L(y(this,S)),n=r.promise,i=this._d;return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,i.c.push(r),i.a&&i.a.push(r),i.s&&F(i,!1),n},catch:function(t){return this.then(void 0,t)}})),u(u.G+u.W+u.F*!E,{Promise:S}),t("./$.set-to-string-tag")(S,x),t("./$.set-species")(x),n=t("./$.core")[x],u(u.S+u.F*!E,x,{reject:function(t){var e=new L(this),r=e.reject;return r(t),e.promise}}),u(u.S+u.F*(!E||M(!0)),x,{resolve:function(t){if(t instanceof S&&T(t.constructor,this))return t;var e=new L(this),r=e.resolve;return r(t),e.promise}}),u(u.S+u.F*!(E&&t("./$.iter-detect")(function(t){S.all(t).catch(function(){})})),x,{all:function(t){var e=A(this),r=new L(e),n=r.resolve,o=r.reject,a=[],s=k(function(){d(t,!1,a.push,a);var r=a.length,s=Array(r);r?i.each.call(a,function(t,i){var a=!1;e.resolve(t).then(function(t){a||(a=!0,s[i]=t,--r||n(s))},o)}):n(s)});return s&&o(s.error),r.promise},race:function(t){var e=A(this),r=new L(e),n=r.reject,i=k(function(){d(t,!1,function(t){e.resolve(t).then(r.resolve,n)})});return i&&n(i.error),r.promise}})},{"./$":34,"./$.a-function":7,"./$.an-object":9,"./$.classof":10,"./$.core":12,"./$.ctx":13,"./$.descriptors":15,"./$.export":17,"./$.for-of":19,"./$.global":20,"./$.is-object":27,"./$.iter-detect":31,"./$.library":35,"./$.microtask":36,"./$.redefine-all":38,"./$.same-value":40,"./$.set-proto":41,"./$.set-species":42,"./$.set-to-string-tag":43,"./$.species-constructor":45,"./$.strict-new":46,"./$.wks":53}],58:[function(t,e,r){"use strict";var n=t("./$.string-at")(!0);t("./$.iter-define")(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,r=this._i;return r>=e.length?{value:void 0,done:!0}:(t=n(e,r),this._i+=t.length,{value:t,done:!1})})},{"./$.iter-define":30,"./$.string-at":47}],59:[function(t,e,r){t("./es6.array.iterator");var n=t("./$.iterators");n.NodeList=n.HTMLCollection=n.Array},{"./$.iterators":33,"./es6.array.iterator":55}],60:[function(t,e,r){"use strict";function n(t,e){var r=function r(n,i){var o=altspace.getGamepads().find(function(e){return"steamvr"===e.mapping&&e.hand===t});o?(e.logging&&console.log("SteamVR input device found",o),n(o)):(e.logging&&console.log("SteamVR input device not found trying again in 500ms..."),setTimeout(r,500,n,i))};return new a(r)}var i=t("babel-runtime/helpers/create-class").default,o=t("babel-runtime/helpers/class-call-check").default,a=t("babel-runtime/core-js/promise").default,s=function(){function t(e){o(this,t),this.type="SteamVRInput",this.config=e||{},this.config.logging=this.config.logging||!1}return i(t,[{key:"awake",value:function(){var e=this;this.leftControllerPromise=n(t.LEFT_CONTROLLER,this.config),this.rightControllerPromise=n(t.RIGHT_CONTROLLER,this.config),this.firstControllerPromise=a.race([this.leftControllerPromise,this.rightControllerPromise]),this.leftControllerPromise.then(function(t){e.leftController=t}),this.rightControllerPromise.then(function(t){e.rightController=t}),this.firstControllerPromise.then(function(r){e.firstController=r;var n=r.axes.map(function(){return!1}),i=r.buttons.map(function(){return!1});i[t.BUTTON_TRIGGER]=!0,i[t.BUTTON_TOUCHPAD]=!0,r.preventDefault(n,i)})}}]),t}();s.BUTTON_TRIGGER=0,s.BUTTON_GRIP=1,s.BUTTON_TOUCHPAD=2,s.BUTTON_DPAD_UP=3,s.BUTTON_DPAD_RIGHT=4,s.BUTTON_DPAD_DOWN=5,s.BUTTON_DPAD_LEFT=6,s.AXIS_TOUCHPAD_X=0,s.AXIS_TOUCHPAD_Y=1,s.FIRST_CONTROLLER="first",s.LEFT_CONTROLLER="left",s.RIGHT_CONTROLLER="right",window.altspace.utilities.behaviors.SteamVRInput=s},{"babel-runtime/core-js/promise":2,"babel-runtime/helpers/class-call-check":3,"babel-runtime/helpers/create-class":4}]},{},[60]),function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var c="function"==typeof require&&require;if(!s&&c)return require(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[a]={exports:{}};e[a][0].call(h.exports,function(t){var r=e[a][1][t];return i(r?r:t)},h,h.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a0?1:+t}),void 0===Function.prototype.name&&void 0!==Object.defineProperty&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]}}),a.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2},a.CullFaceNone=0,a.CullFaceBack=1,a.CullFaceFront=2,a.CullFaceFrontBack=3,a.FrontFaceDirectionCW=0,a.FrontFaceDirectionCCW=1,a.BasicShadowMap=0,a.PCFShadowMap=1,a.PCFSoftShadowMap=2,a.FrontSide=0,a.BackSide=1,a.DoubleSide=2,a.FlatShading=1,a.SmoothShading=2,a.NoColors=0,a.FaceColors=1,a.VertexColors=2,a.NoBlending=0,a.NormalBlending=1,a.AdditiveBlending=2,a.SubtractiveBlending=3,a.MultiplyBlending=4,a.CustomBlending=5,a.AddEquation=100,a.SubtractEquation=101,a.ReverseSubtractEquation=102,a.MinEquation=103,a.MaxEquation=104,a.ZeroFactor=200,a.OneFactor=201,a.SrcColorFactor=202,a.OneMinusSrcColorFactor=203,a.SrcAlphaFactor=204,a.OneMinusSrcAlphaFactor=205,a.DstAlphaFactor=206,a.OneMinusDstAlphaFactor=207,a.DstColorFactor=208,a.OneMinusDstColorFactor=209,a.SrcAlphaSaturateFactor=210,a.NeverDepth=0,a.AlwaysDepth=1,a.LessDepth=2,a.LessEqualDepth=3,a.EqualDepth=4,a.GreaterEqualDepth=5,a.GreaterDepth=6,a.NotEqualDepth=7,a.MultiplyOperation=0,a.MixOperation=1,a.AddOperation=2,a.UVMapping=300,a.CubeReflectionMapping=301,a.CubeRefractionMapping=302,a.EquirectangularReflectionMapping=303,a.EquirectangularRefractionMapping=304,a.SphericalReflectionMapping=305,a.RepeatWrapping=1e3,a.ClampToEdgeWrapping=1001,a.MirroredRepeatWrapping=1002,a.NearestFilter=1003,a.NearestMipMapNearestFilter=1004,a.NearestMipMapLinearFilter=1005,a.LinearFilter=1006,a.LinearMipMapNearestFilter=1007,a.LinearMipMapLinearFilter=1008,a.UnsignedByteType=1009,a.ByteType=1010,a.ShortType=1011,a.UnsignedShortType=1012,a.IntType=1013,a.UnsignedIntType=1014,a.FloatType=1015,a.HalfFloatType=1025,a.UnsignedShort4444Type=1016,a.UnsignedShort5551Type=1017,a.UnsignedShort565Type=1018,a.AlphaFormat=1019,a.RGBFormat=1020,a.RGBAFormat=1021,a.LuminanceFormat=1022,a.LuminanceAlphaFormat=1023,a.RGBEFormat=a.RGBAFormat,a.RGB_S3TC_DXT1_Format=2001,a.RGBA_S3TC_DXT1_Format=2002,a.RGBA_S3TC_DXT3_Format=2003,a.RGBA_S3TC_DXT5_Format=2004,a.RGB_PVRTC_4BPPV1_Format=2100,a.RGB_PVRTC_2BPPV1_Format=2101,a.RGBA_PVRTC_4BPPV1_Format=2102,a.RGBA_PVRTC_2BPPV1_Format=2103,a.LoopOnce=2200,a.LoopRepeat=2201,a.LoopPingPong=2202,a.Projector=function(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(t,e){console.warn("THREE.Projector: .projectVector() is now vector.project()."),t.project(e)},this.unprojectVector=function(t,e){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),t.unproject(e)},this.pickingRay=function(t,e){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}},a.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElement("canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}},a.Color=function(t){return 3===arguments.length?this.fromArray(arguments):this.set(t)},a.Color.prototype={constructor:a.Color,r:1,g:1,b:1,set:function(t){return t instanceof a.Color?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,r){return this.r=t,this.g=e,this.b=r,this},setHSL:function(){function t(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+6*(e-t)*(2/3-r):t}return function(e,r,n){if(e=a.Math.euclideanModulo(e,1),r=a.Math.clamp(r,0,1),n=a.Math.clamp(n,0,1),0===r)this.r=this.g=this.b=n;else{var i=n<=.5?n*(1+r):n+r-n*r,o=2*n-i;this.r=t(o,i,e+1/3),this.g=t(o,i,e),this.b=t(o,i,e-1/3)}return this}}(),setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}var r;if(r=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var n,i=r[1],o=r[2];switch(i){case"rgb":case"rgba":if(n=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,e(n[5]),this;if(n=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,e(n[5]),this;break;case"hsl":case"hsla":if(n=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var s=parseFloat(n[1])/360,c=parseInt(n[2],10)/100,u=parseInt(n[3],10)/100;return e(n[5]),this.setHSL(s,c,u)}}}else if(r=/^\#([A-Fa-f0-9]+)$/.exec(t)){var h=r[1],l=h.length;if(3===l)return this.r=parseInt(h.charAt(0)+h.charAt(0),16)/255,this.g=parseInt(h.charAt(1)+h.charAt(1),16)/255,this.b=parseInt(h.charAt(2)+h.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(h.charAt(0)+h.charAt(1),16)/255,this.g=parseInt(h.charAt(2)+h.charAt(3),16)/255,this.b=parseInt(h.charAt(4)+h.charAt(5),16)/255,this}if(t&&t.length>0){var h=a.ColorKeywords[t];void 0!==h?this.setHex(h):console.warn("THREE.Color: Unknown color "+t)}return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var r=e>0?1/e:1;return this.r=Math.pow(t.r,r),this.g=Math.pow(t.g,r),this.b=Math.pow(t.b,r),this},convertGammaToLinear:function(){var t=this.r,e=this.g,r=this.b;return this.r=t*t,this.g=e*e,this.b=r*r,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){var e,r,n=t||{h:0,s:0,l:0},i=this.r,o=this.g,a=this.b,s=Math.max(i,o,a),c=Math.min(i,o,a),u=(c+s)/2;if(c===s)e=0,r=0;else{var h=s-c;switch(r=u<=.5?h/(s+c):h/(2-s-c),s){case i:e=(o-a)/h+(o0?(e=.5/Math.sqrt(f+1),this._w=.25/e,this._x=(h-c)*e,this._y=(o-u)*e,this._z=(a-i)*e):n>s&&n>l?(e=2*Math.sqrt(1+n-s-l),this._w=(h-c)/e,this._x=.25*e,this._y=(i+a)/e,this._z=(o+u)/e):s>l?(e=2*Math.sqrt(1+s-n-l),this._w=(o-u)/e,this._x=(i+a)/e,this._y=.25*e,this._z=(c+h)/e):(e=2*Math.sqrt(1+l-n-s),this._w=(a-i)/e,this._x=(o+u)/e,this._y=(c+h)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:function(){var t,e,r=1e-6;return function(n,i){return void 0===t&&(t=new a.Vector3),e=n.dot(i)+1,eMath.abs(n.z)?t.set(-n.y,n.x,0):t.set(0,-n.z,n.y)):t.crossVectors(n,i),this._x=t.x,this._y=t.y,this._z=t.z,this._w=e,this.normalize(),this}}(),inverse:function(){return this.conjugate().normalize(),this},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},multiplyQuaternions:function(t,e){var r=t._x,n=t._y,i=t._z,o=t._w,a=e._x,s=e._y,c=e._z,u=e._w;return this._x=r*u+o*a+n*c-i*s,this._y=n*u+o*s+i*a-r*c,this._z=i*u+o*c+r*s-n*a,this._w=o*u-r*a-n*s-i*c,this.onChangeCallback(),this},multiplyVector3:function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var r=this._x,n=this._y,i=this._z,o=this._w,a=o*t._w+r*t._x+n*t._y+i*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=r,this._y=n,this._z=i,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*(r+this._x),this._y=.5*(n+this._y),this._z=.5*(i+this._z),this;var u=Math.sin((1-e)*s)/c,h=Math.sin(e*s)/c;return this._w=o*u+this._w*h,this._x=r*u+this._x*h,this._y=n*u+this._y*h,this._z=i*u+this._z*h,this.onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}},a.Quaternion.slerp=function(t,e,r,n){return r.copy(t).slerp(e,n)},a.Vector2=function(t,e){this.x=t||0,this.y=e||0},a.Vector2.prototype={constructor:a.Vector2,get width(){return this.x},set width(t){this.x=t},get height(){return this.y},set height(t){this.y=t},set:function(t,e){return this.x=t,this.y=e,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(){var t,e;return function(r,n){return void 0===t&&(t=new a.Vector2,e=new a.Vector2),t.set(r,r),e.set(n,n),this.clamp(t,e)}}(),clampLength:function(t,e){var r=this.length();return this.multiplyScalar(Math.max(t,Math.min(e,r))/r),this},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(t){return this.x*t.x+this.y*t.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())},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,r=this.y-t.y;return e*e+r*r},setLength:function(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,
+this},lerpVectors:function(t,e,r){return this.subVectors(e,t).multiplyScalar(r).add(t),this},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromAttribute:function(t,e,r){return void 0===r&&(r=0),e=e*t.itemSize+r,this.x=t.array[e],this.y=t.array[e+1],this},rotateAround:function(t,e){var r=Math.cos(e),n=Math.sin(e),i=this.x-t.x,o=this.y-t.y;return this.x=i*r-o*n+t.x,this.y=i*n+o*r+t.y,this}},a.Vector3=function(t,e,r){this.x=t||0,this.y=e||0,this.z=r||0},a.Vector3.prototype={constructor:a.Vector3,set:function(t,e,r){return this.x=t,this.y=e,this.z=r,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(){var t;return function(e){return e instanceof a.Euler==!1&&console.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order."),void 0===t&&(t=new a.Quaternion),this.applyQuaternion(t.setFromEuler(e)),this}}(),applyAxisAngle:function(){var t;return function(e,r){return void 0===t&&(t=new a.Quaternion),this.applyQuaternion(t.setFromAxisAngle(e,r)),this}}(),applyMatrix3:function(t){var e=this.x,r=this.y,n=this.z,i=t.elements;return this.x=i[0]*e+i[3]*r+i[6]*n,this.y=i[1]*e+i[4]*r+i[7]*n,this.z=i[2]*e+i[5]*r+i[8]*n,this},applyMatrix4:function(t){var e=this.x,r=this.y,n=this.z,i=t.elements;return this.x=i[0]*e+i[4]*r+i[8]*n+i[12],this.y=i[1]*e+i[5]*r+i[9]*n+i[13],this.z=i[2]*e+i[6]*r+i[10]*n+i[14],this},applyProjection:function(t){var e=this.x,r=this.y,n=this.z,i=t.elements,o=1/(i[3]*e+i[7]*r+i[11]*n+i[15]);return this.x=(i[0]*e+i[4]*r+i[8]*n+i[12])*o,this.y=(i[1]*e+i[5]*r+i[9]*n+i[13])*o,this.z=(i[2]*e+i[6]*r+i[10]*n+i[14])*o,this},applyQuaternion:function(t){var e=this.x,r=this.y,n=this.z,i=t.x,o=t.y,a=t.z,s=t.w,c=s*e+o*n-a*r,u=s*r+a*e-i*n,h=s*n+i*r-o*e,l=-i*e-o*r-a*n;return this.x=c*s+l*-i+u*-a-h*-o,this.y=u*s+l*-o+h*-i-c*-a,this.z=h*s+l*-a+c*-o-u*-i,this},project:function(){var t;return function(e){return void 0===t&&(t=new a.Matrix4),t.multiplyMatrices(e.projectionMatrix,t.getInverse(e.matrixWorld)),this.applyProjection(t)}}(),unproject:function(){var t;return function(e){return void 0===t&&(t=new a.Matrix4),t.multiplyMatrices(e.matrixWorld,t.getInverse(e.projectionMatrix)),this.applyProjection(t)}}(),transformDirection:function(t){var e=this.x,r=this.y,n=this.z,i=t.elements;return this.x=i[0]*e+i[4]*r+i[8]*n,this.y=i[1]*e+i[5]*r+i[9]*n,this.z=i[2]*e+i[6]*r+i[10]*n,this.normalize(),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(){var t,e;return function(r,n){return void 0===t&&(t=new a.Vector3,e=new a.Vector3),t.set(r,r,r),e.set(n,n,n),this.clamp(t,e)}}(),clampLength:function(t,e){var r=this.length();return this.multiplyScalar(Math.max(t,Math.min(e,r))/r),this},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(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,r){return this.subVectors(e,t).multiplyScalar(r).add(t),this},cross:function(t,e){if(void 0!==e)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e);var r=this.x,n=this.y,i=this.z;return this.x=n*t.z-i*t.y,this.y=i*t.x-r*t.z,this.z=r*t.y-n*t.x,this},crossVectors:function(t,e){var r=t.x,n=t.y,i=t.z,o=e.x,a=e.y,s=e.z;return this.x=n*s-i*a,this.y=i*o-r*s,this.z=r*a-n*o,this},projectOnVector:function(){var t,e;return function(r){return void 0===t&&(t=new a.Vector3),t.copy(r).normalize(),e=this.dot(t),this.copy(t).multiplyScalar(e)}}(),projectOnPlane:function(){var t;return function(e){return void 0===t&&(t=new a.Vector3),t.copy(this).projectOnVector(e),this.sub(t)}}(),reflect:function(){var t;return function(e){return void 0===t&&(t=new a.Vector3),this.sub(t.copy(e).multiplyScalar(2*this.dot(e)))}}(),angleTo:function(t){var e=this.dot(t)/(this.length()*t.length());return Math.acos(a.Math.clamp(e,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,r=this.y-t.y,n=this.z-t.z;return e*e+r*r+n*n},setEulerFromRotationMatrix:function(t,e){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(t,e){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},setFromMatrixPosition:function(t){return this.x=t.elements[12],this.y=t.elements[13],this.z=t.elements[14],this},setFromMatrixScale:function(t){var e=this.set(t.elements[0],t.elements[1],t.elements[2]).length(),r=this.set(t.elements[4],t.elements[5],t.elements[6]).length(),n=this.set(t.elements[8],t.elements[9],t.elements[10]).length();return this.x=e,this.y=r,this.z=n,this},setFromMatrixColumn:function(t,e){var r=4*t,n=e.elements;return this.x=n[r],this.y=n[r+1],this.z=n[r+2],this},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromAttribute:function(t,e,r){return void 0===r&&(r=0),e=e*t.itemSize+r,this.x=t.array[e],this.y=t.array[e+1],this.z=t.array[e+2],this}},a.Vector4=function(t,e,r,n){this.x=t||0,this.y=e||0,this.z=r||0,this.w=void 0!==n?n:1},a.Vector4.prototype={constructor:a.Vector4,set:function(t,e,r,n){return this.x=t,this.y=e,this.z=r,this.w=n,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t,this.w*=t):(this.x=0,this.y=0,this.z=0,this.w=0),this},applyMatrix4:function(t){var e=this.x,r=this.y,n=this.z,i=this.w,o=t.elements;return this.x=o[0]*e+o[4]*r+o[8]*n+o[12]*i,this.y=o[1]*e+o[5]*r+o[9]*n+o[13]*i,this.z=o[2]*e+o[6]*r+o[10]*n+o[14]*i,this.w=o[3]*e+o[7]*r+o[11]*n+o[15]*i,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,r,n,i,o=.01,a=.1,s=t.elements,c=s[0],u=s[4],h=s[8],l=s[1],f=s[5],p=s[9],d=s[2],m=s[6],g=s[10];if(Math.abs(u-l)y&&v>b?vb?ythis.max.x||t.ythis.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){var r=e||new a.Vector2;return r.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)},clampPoint:function(t,e){var r=e||new a.Vector2;return r.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new a.Vector2;return function(e){var r=t.copy(e).clamp(this.min,this.max);return r.sub(e).length()}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},a.Box3=function(t,e){this.min=void 0!==t?t:new a.Vector3(1/0,1/0,1/0),this.max=void 0!==e?e:new a.Vector3(-(1/0),-(1/0),-(1/0))},a.Box3.prototype={constructor:a.Box3,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,r=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){var r=e||new a.Vector3;return r.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)},clampPoint:function(t,e){var r=e||new a.Vector3;return r.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new a.Vector3;return function(e){var r=t.copy(e).clamp(this.min,this.max);return r.sub(e).length()}}(),getBoundingSphere:function(){var t=new a.Vector3;return function(e){var r=e||new a.Sphere;return r.center=this.center(),r.radius=.5*this.size(t).length(),r}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(){var t=[new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3,new a.Vector3];return function(e){return t[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),t[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),t[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),t[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),t[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),t[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),t[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),t[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.makeEmpty(),this.setFromPoints(t),this}}(),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},a.Matrix3=function(){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.")},a.Matrix3.prototype={constructor:a.Matrix3,set:function(t,e,r,n,i,o,a,s,c){var u=this.elements;return u[0]=t,u[3]=e,u[6]=r,u[1]=n,u[4]=i,u[7]=o,u[2]=a,u[5]=s,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(t){var e=t.elements;return this.set(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8]),this},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(t){return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(t)},applyToVector3Array:function(){var t;return function(e,r,n){void 0===t&&(t=new a.Vector3),void 0===r&&(r=0),void 0===n&&(n=e.length);for(var i=0,o=r;i0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")},a.Matrix4.prototype={constructor:a.Matrix4,set:function(t,e,r,n,i,o,a,s,c,u,h,l,f,p,d,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=r,g[12]=n,g[1]=i,g[5]=o,g[9]=a,g[13]=s,g[2]=c,g[6]=u,g[10]=h,g[14]=l,g[3]=f,g[7]=p,g[11]=d,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 a.Matrix4).fromArray(this.elements)},copy:function(t){return this.elements.set(t.elements),this},extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},copyPosition:function(t){var e=this.elements,r=t.elements;return e[12]=r[12],e[13]=r[13],e[14]=r[14],this},extractBasis:function(t,e,r){var n=this.elements;return t.set(n[0],n[1],n[2]),e.set(n[4],n[5],n[6]),r.set(n[8],n[9],n[10]),this},makeBasis:function(t,e,r){return this.set(t.x,e.x,r.x,0,t.y,e.y,r.y,0,t.z,e.z,r.z,0,0,0,0,1),this},extractRotation:function(){var t;return function(e){void 0===t&&(t=new a.Vector3);var r=this.elements,n=e.elements,i=1/t.set(n[0],n[1],n[2]).length(),o=1/t.set(n[4],n[5],n[6]).length(),s=1/t.set(n[8],n[9],n[10]).length();return r[0]=n[0]*i,r[1]=n[1]*i,r[2]=n[2]*i,r[4]=n[4]*o,r[5]=n[5]*o,r[6]=n[6]*o,r[8]=n[8]*s,r[9]=n[9]*s,r[10]=n[10]*s,this}}(),makeRotationFromEuler:function(t){t instanceof a.Euler==!1&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,r=t.x,n=t.y,i=t.z,o=Math.cos(r),s=Math.sin(r),c=Math.cos(n),u=Math.sin(n),h=Math.cos(i),l=Math.sin(i);if("XYZ"===t.order){var f=o*h,p=o*l,d=s*h,m=s*l;e[0]=c*h,e[4]=-c*l,e[8]=u,e[1]=p+d*u,e[5]=f-m*u,e[9]=-s*c,e[2]=m-f*u,e[6]=d+p*u,e[10]=o*c}else if("YXZ"===t.order){var g=c*h,v=c*l,y=u*h,b=u*l;e[0]=g+b*s,e[4]=y*s-v,e[8]=o*u,e[1]=o*l,e[5]=o*h,e[9]=-s,e[2]=v*s-y,e[6]=b+g*s,e[10]=o*c}else if("ZXY"===t.order){var g=c*h,v=c*l,y=u*h,b=u*l;e[0]=g-b*s,e[4]=-o*l,e[8]=y+v*s,e[1]=v+y*s,e[5]=o*h,e[9]=b-g*s,e[2]=-o*u,e[6]=s,e[10]=o*c}else if("ZYX"===t.order){var f=o*h,p=o*l,d=s*h,m=s*l;e[0]=c*h,e[4]=d*u-p,e[8]=f*u+m,e[1]=c*l,e[5]=m*u+f,e[9]=p*u-d,e[2]=-u,e[6]=s*c,e[10]=o*c}else if("YZX"===t.order){var x=o*c,w=o*u,_=s*c,S=s*u;e[0]=c*h,e[4]=S-x*l,e[8]=_*l+w,e[1]=l,e[5]=o*h,e[9]=-s*h,e[2]=-u*h,e[6]=w*l+_,e[10]=x-S*l}else if("XZY"===t.order){var x=o*c,w=o*u,_=s*c,S=s*u;e[0]=c*h,e[4]=-l,e[8]=u*h,e[1]=x*l+S,e[5]=o*h,e[9]=w*l-_,e[2]=_*l-w,e[6]=s*h,e[10]=S*l+x}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},makeRotationFromQuaternion:function(t){var e=this.elements,r=t.x,n=t.y,i=t.z,o=t.w,a=r+r,s=n+n,c=i+i,u=r*a,h=r*s,l=r*c,f=n*s,p=n*c,d=i*c,m=o*a,g=o*s,v=o*c;return e[0]=1-(f+d),e[4]=h-v,e[8]=l+g,e[1]=h+v,e[5]=1-(u+d),e[9]=p-m,e[2]=l-g,e[6]=p+m,e[10]=1-(u+f),e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},lookAt:function(){var t,e,r;return function(n,i,o){void 0===t&&(t=new a.Vector3),void 0===e&&(e=new a.Vector3),void 0===r&&(r=new a.Vector3);var s=this.elements;return r.subVectors(n,i).normalize(),0===r.lengthSq()&&(r.z=1),t.crossVectors(o,r).normalize(),0===t.lengthSq()&&(r.x+=1e-4,t.crossVectors(o,r).normalize()),e.crossVectors(r,t),s[0]=t.x,s[4]=e.x,s[8]=r.x,s[1]=t.y,s[5]=e.y,s[9]=r.y,s[2]=t.z,s[6]=e.z,s[10]=r.z,this}}(),multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},multiplyMatrices:function(t,e){var r=t.elements,n=e.elements,i=this.elements,o=r[0],a=r[4],s=r[8],c=r[12],u=r[1],h=r[5],l=r[9],f=r[13],p=r[2],d=r[6],m=r[10],g=r[14],v=r[3],y=r[7],b=r[11],x=r[15],w=n[0],_=n[4],S=n[8],M=n[12],E=n[1],T=n[5],A=n[9],C=n[13],L=n[2],k=n[6],F=n[10],P=n[14],R=n[3],D=n[7],O=n[11],$=n[15];
+return i[0]=o*w+a*E+s*L+c*R,i[4]=o*_+a*T+s*k+c*D,i[8]=o*S+a*A+s*F+c*O,i[12]=o*M+a*C+s*P+c*$,i[1]=u*w+h*E+l*L+f*R,i[5]=u*_+h*T+l*k+f*D,i[9]=u*S+h*A+l*F+f*O,i[13]=u*M+h*C+l*P+f*$,i[2]=p*w+d*E+m*L+g*R,i[6]=p*_+d*T+m*k+g*D,i[10]=p*S+d*A+m*F+g*O,i[14]=p*M+d*C+m*P+g*$,i[3]=v*w+y*E+b*L+x*R,i[7]=v*_+y*T+b*k+x*D,i[11]=v*S+y*A+b*F+x*O,i[15]=v*M+y*C+b*P+x*$,this},multiplyToArray:function(t,e,r){var n=this.elements;return this.multiplyMatrices(t,e),r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],r[4]=n[4],r[5]=n[5],r[6]=n[6],r[7]=n[7],r[8]=n[8],r[9]=n[9],r[10]=n[10],r[11]=n[11],r[12]=n[12],r[13]=n[13],r[14]=n[14],r[15]=n[15],this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),t.applyProjection(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(t){return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(t)},applyToVector3Array:function(){var t;return function(e,r,n){void 0===t&&(t=new a.Vector3),void 0===r&&(r=0),void 0===n&&(n=e.length);for(var i=0,o=r;i0)if(s=f*d-p,c=f*p-d,h=l*g,s>=0)if(c>=-h)if(c<=h){var v=1/g;s*=v,c*=v,u=s*(s+f*c+2*p)+c*(f*s+c+2*d)+m}else c=l,s=Math.max(0,-(f*c+p)),u=-s*s+c*(c+2*d)+m;else c=-l,s=Math.max(0,-(f*c+p)),u=-s*s+c*(c+2*d)+m;else c<=-h?(s=Math.max(0,-(-f*l+p)),c=s>0?-l:Math.min(Math.max(-l,-d),l),u=-s*s+c*(c+2*d)+m):c<=h?(s=0,c=Math.min(Math.max(-l,-d),l),u=c*(c+2*d)+m):(s=Math.max(0,-(f*l+p)),c=s>0?l:Math.min(Math.max(-l,-d),l),u=-s*s+c*(c+2*d)+m);else c=f>0?-l:l,s=Math.max(0,-(f*c+p)),u=-s*s+c*(c+2*d)+m;return o&&o.copy(this.direction).multiplyScalar(s).add(this.origin),a&&a.copy(e).multiplyScalar(c).add(t),u}}(),isIntersectionSphere:function(t){return this.distanceToPoint(t.center)<=t.radius},intersectSphere:function(){var t=new a.Vector3;return function(e,r){t.subVectors(e.center,this.origin);var n=t.dot(this.direction),i=t.dot(t)-n*n,o=e.radius*e.radius;if(i>o)return null;var a=Math.sqrt(o-i),s=n-a,c=n+a;return s<0&&c<0?null:s<0?this.at(c,r):this.at(s,r)}}(),isIntersectionPlane:function(t){var e=t.distanceToPoint(this.origin);if(0===e)return!0;var r=t.normal.dot(this.direction);return r*e<0},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var r=-(this.origin.dot(t.normal)+t.constant)/e;return r>=0?r:null},intersectPlane:function(t,e){var r=this.distanceToPlane(t);return null===r?null:this.at(r,e)},isIntersectionBox:function(){var t=new a.Vector3;return function(e){return null!==this.intersectBox(e,t)}}(),intersectBox:function(t,e){var r,n,i,o,a,s,c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,l=this.origin;return c>=0?(r=(t.min.x-l.x)*c,n=(t.max.x-l.x)*c):(r=(t.max.x-l.x)*c,n=(t.min.x-l.x)*c),u>=0?(i=(t.min.y-l.y)*u,o=(t.max.y-l.y)*u):(i=(t.max.y-l.y)*u,o=(t.min.y-l.y)*u),r>o||i>n?null:((i>r||r!==r)&&(r=i),(o=0?(a=(t.min.z-l.z)*h,s=(t.max.z-l.z)*h):(a=(t.max.z-l.z)*h,s=(t.min.z-l.z)*h),r>s||a>n?null:((a>r||r!==r)&&(r=a),(s=0?r:n,e)))},intersectTriangle:function(){var t=new a.Vector3,e=new a.Vector3,r=new a.Vector3,n=new a.Vector3;return function(i,o,a,s,c){e.subVectors(o,i),r.subVectors(a,i),n.crossVectors(e,r);var u,h=this.direction.dot(n);if(h>0){if(s)return null;u=1}else{if(!(h<0))return null;u=-1,h=-h}t.subVectors(this.origin,i);var l=u*this.direction.dot(r.crossVectors(t,r));if(l<0)return null;var f=u*this.direction.dot(e.cross(t));if(f<0)return null;if(l+f>h)return null;var p=-u*t.dot(n);return p<0?null:this.at(p/h,c)}}(),applyMatrix4:function(t){return this.direction.add(this.origin).applyMatrix4(t),this.origin.applyMatrix4(t),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}},a.Sphere=function(t,e){this.center=void 0!==t?t:new a.Vector3,this.radius=void 0!==e?e:0},a.Sphere.prototype={constructor:a.Sphere,set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(){var t=new a.Box3;return function(e,r){var n=this.center;void 0!==r?n.copy(r):t.setFromPoints(e).center(n);for(var i=0,o=0,a=e.length;othis.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n},getBoundingBox:function(t){var e=t||new a.Box3;return e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}},a.Frustum=function(t,e,r,n,i,o){this.planes=[void 0!==t?t:new a.Plane,void 0!==e?e:new a.Plane,void 0!==r?r:new a.Plane,void 0!==n?n:new a.Plane,void 0!==i?i:new a.Plane,void 0!==o?o:new a.Plane]},a.Frustum.prototype={constructor:a.Frustum,set:function(t,e,r,n,i,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(r),a[3].copy(n),a[4].copy(i),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,r=0;r<6;r++)e[r].copy(t.planes[r]);return this},setFromMatrix:function(t){var e=this.planes,r=t.elements,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],c=r[5],u=r[6],h=r[7],l=r[8],f=r[9],p=r[10],d=r[11],m=r[12],g=r[13],v=r[14],y=r[15];return e[0].setComponents(a-n,h-s,d-l,y-m).normalize(),e[1].setComponents(a+n,h+s,d+l,y+m).normalize(),e[2].setComponents(a+i,h+c,d+f,y+g).normalize(),e[3].setComponents(a-i,h-c,d-f,y-g).normalize(),e[4].setComponents(a-o,h-u,d-p,y-v).normalize(),e[5].setComponents(a+o,h+u,d+p,y+v).normalize(),this},intersectsObject:function(){var t=new a.Sphere;return function(e){var r=e.geometry;return null===r.boundingSphere&&r.computeBoundingSphere(),t.copy(r.boundingSphere),t.applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSphere:function(t){for(var e=this.planes,r=t.center,n=-t.radius,i=0;i<6;i++){var o=e[i].distanceToPoint(r);if(o0?r.min.x:r.max.x,e.x=o.normal.x>0?r.max.x:r.min.x,t.y=o.normal.y>0?r.min.y:r.max.y,e.y=o.normal.y>0?r.max.y:r.min.y,t.z=o.normal.z>0?r.min.z:r.max.z,e.z=o.normal.z>0?r.max.z:r.min.z;var a=o.distanceToPoint(t),s=o.distanceToPoint(e);if(a<0&&s<0)return!1}return!0}}(),containsPoint:function(t){for(var e=this.planes,r=0;r<6;r++)if(e[r].distanceToPoint(t)<0)return!1;return!0}},a.Plane=function(t,e){this.normal=void 0!==t?t:new a.Vector3(1,0,0),this.constant=void 0!==e?e:0},a.Plane.prototype={constructor:a.Plane,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,r,n){return this.normal.set(t,e,r),this.constant=n,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(){var t=new a.Vector3,e=new a.Vector3;return function(r,n,i){var o=t.subVectors(i,n).cross(e.subVectors(r,n)).normalize();return this.setFromNormalAndCoplanarPoint(o,r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return this.orthoPoint(t,e).sub(t).negate()},orthoPoint:function(t,e){var r=this.distanceToPoint(t),n=e||new a.Vector3;return n.copy(this.normal).multiplyScalar(r)},isIntersectionLine:function(t){var e=this.distanceToPoint(t.start),r=this.distanceToPoint(t.end);return e<0&&r>0||r<0&&e>0},intersectLine:function(){var t=new a.Vector3;return function(e,r){var n=r||new a.Vector3,i=e.delta(t),o=this.normal.dot(i);if(0!==o){var s=-(e.start.dot(this.normal)+this.constant)/o;if(!(s<0||s>1))return n.copy(i).multiplyScalar(s).add(e.start)}else if(0===this.distanceToPoint(e.start))return n.copy(e.start)}}(),coplanarPoint:function(t){var e=t||new a.Vector3;return e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new a.Vector3,e=new a.Vector3,r=new a.Matrix3;return function(n,i){var o=i||r.getNormalMatrix(n),a=t.copy(this.normal).applyMatrix3(o),s=this.coplanarPoint(e);return s.applyMatrix4(n),this.setFromNormalAndCoplanarPoint(a,s),this}}(),translate:function(t){return this.constant=this.constant-t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}},a.Math={generateUUID:function(){var t,e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),r=new Array(36),n=0;return function(){for(var i=0;i<36;i++)8===i||13===i||18===i||23===i?r[i]="-":14===i?r[i]="4":(n<=2&&(n=33554432+16777216*Math.random()|0),t=15&n,n>>=4,r[i]=e[19===i?3&t|8:t]);return r.join("")}}(),clamp:function(t,e,r){return Math.max(e,Math.min(r,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,r,n,i){return n+(t-e)*(i-n)/(r-e)},smoothstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e),t*t*(3-2*t))},smootherstep:function(t,e,r){return t<=e?0:t>=r?1:(t=(t-e)/(r-e),t*t*t*(t*(6*t-15)+10))},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(){var t=Math.PI/180;return function(e){return e*t}}(),radToDeg:function(){var t=180/Math.PI;return function(e){return e*t}}(),isPowerOfTwo:function(t){return 0===(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t++,t}},a.Spline=function(t){function e(t,e,r,n,i,o,a){var s=.5*(r-t),c=.5*(n-e);return(2*(e-r)+s+c)*a+(-3*(e-r)-2*s-c)*o+s*i+e}this.points=t;var r,n,i,o,s,c,u,h,l,f=[],p={x:0,y:0,z:0};this.initFromArray=function(t){this.points=[];for(var e=0;ethis.points.length-2?this.points.length-1:n+1,f[3]=n>this.points.length-3?this.points.length-1:n+2,c=this.points[f[0]],u=this.points[f[1]],h=this.points[f[2]],l=this.points[f[3]],o=i*i,s=i*o,p.x=e(c.x,u.x,h.x,l.x,i,o,s),p.y=e(c.y,u.y,h.y,l.y,i,o,s),p.z=e(c.z,u.z,h.z,l.z,i,o,s),p},this.getControlPointsArray=function(){var t,e,r=this.points.length,n=[];for(t=0;t0?o.multiplyScalar(1/Math.sqrt(s)):o.set(0,0,0)}}(),a.Triangle.barycoordFromPoint=function(){var t=new a.Vector3,e=new a.Vector3,r=new a.Vector3;return function(n,i,o,s,c){t.subVectors(s,i),e.subVectors(o,i),r.subVectors(n,i);var u=t.dot(t),h=t.dot(e),l=t.dot(r),f=e.dot(e),p=e.dot(r),d=u*f-h*h,m=c||new a.Vector3;if(0===d)return m.set(-2,-1,-1);var g=1/d,v=(f*l-h*p)*g,y=(u*p-h*l)*g;return m.set(1-v-y,y,v)}}(),a.Triangle.containsPoint=function(){var t=new a.Vector3;return function(e,r,n,i){var o=a.Triangle.barycoordFromPoint(e,r,n,i,t);return o.x>=0&&o.y>=0&&o.x+o.y<=1}}(),a.Triangle.prototype={constructor:a.Triangle,set:function(t,e,r){return this.a.copy(t),this.b.copy(e),this.c.copy(r),this},setFromPointsAndIndices:function(t,e,r,n){return this.a.copy(t[e]),this.b.copy(t[r]),this.c.copy(t[n]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},area:function(){var t=new a.Vector3,e=new a.Vector3;return function(){return t.subVectors(this.c,this.b),e.subVectors(this.a,this.b),.5*t.cross(e).length()}}(),midpoint:function(t){var e=t||new a.Vector3;return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(t){return a.Triangle.normal(this.a,this.b,this.c,t)},plane:function(t){var e=t||new a.Plane;return e.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(t,e){return a.Triangle.barycoordFromPoint(t,this.a,this.b,this.c,e)},containsPoint:function(t){return a.Triangle.containsPoint(t,this.a,this.b,this.c)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},a.Channels=function(){this.mask=1},a.Channels.prototype={constructor:a.Channels,set:function(t){this.mask=1<1){for(var e=0;e1)for(var e=0;e0){i.children=[];for(var o=0;o0&&(n.geometries=a),s.length>0&&(n.materials=s),c.length>0&&(n.textures=c),u.length>0&&(n.images=u)}return n.object=i,n},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.rotationAutoUpdate=t.rotationAutoUpdate,this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),e===!0)for(var r=0;r0)for(var d=0;d0&&(t+=e[r].distanceTo(e[r-1])),this.lineDistances[r]=t},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new a.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new a.Sphere),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,r){if(t instanceof a.Geometry==!1)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t);var n,i=this.vertices.length,o=this.vertices,s=t.vertices,c=this.faces,u=t.faces,h=this.faceVertexUvs[0],l=t.faceVertexUvs[0];void 0===r&&(r=0),void 0!==e&&(n=(new a.Matrix3).getNormalMatrix(e));for(var f=0,p=s.length;f=0;r--){var g=p[r];for(this.faces.splice(g,1),a=0,s=this.faceVertexUvs.length;a0,_=v.vertexNormals.length>0,S=1!==v.color.r||1!==v.color.g||1!==v.color.b,M=v.vertexColors.length>0,E=0;if(E=t(E,0,0),E=t(E,1,y),E=t(E,2,b),E=t(E,3,x),E=t(E,4,w),E=t(E,5,_),E=t(E,6,S),E=t(E,7,M),h.push(E),h.push(v.a,v.b,v.c),x){var T=this.faceVertexUvs[0][c];h.push(n(T[0]),n(T[1]),n(T[2]))}if(w&&h.push(e(v.normal)),_){var A=v.vertexNormals;h.push(e(A[0]),e(A[1]),e(A[2]))}if(S&&h.push(r(v.color)),M){var C=v.vertexColors;h.push(r(C[0]),r(C[1]),r(C[2]))}}return i.data={},i.data.vertices=s,i.data.normals=l,p.length>0&&(i.data.colors=p),m.length>0&&(i.data.uvs=[m]),i.data.faces=h,i},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.vertices=[],this.faces=[],this.faceVertexUvs=[[]];for(var e=t.vertices,r=0,n=e.length;r0,o=n[1]&&n[1].length>0,s=t.morphTargets,c=s.length;if(c>0){for(var u=[],h=0;h0){for(var p=[],h=0;h0){var r=new Float32Array(3*t.normals.length);this.addAttribute("normal",new a.BufferAttribute(r,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var n=new Float32Array(3*t.colors.length);this.addAttribute("color",new a.BufferAttribute(n,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var i=new Float32Array(2*t.uvs.length);this.addAttribute("uv",new a.BufferAttribute(i,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var o=new Float32Array(2*t.uvs2.length);this.addAttribute("uv2",new a.BufferAttribute(o,2).copyVector2sArray(t.uvs2))}if(t.indices.length>0){var s=t.vertices.length>65535?Uint32Array:Uint16Array,c=new s(3*t.indices.length);this.setIndex(new a.BufferAttribute(c,1).copyIndicesArray(t.indices))}this.groups=t.groups;for(var u in t.morphTargets){for(var h=[],l=t.morphTargets[u],f=0,p=l.length;f0){var g=new a.Float32Attribute(4*t.skinIndices.length,4);this.addAttribute("skinIndex",g.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var v=new a.Float32Attribute(4*t.skinWeights.length,4);this.addAttribute("skinWeight",v.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){var t=new a.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new a.Box3);var e=this.attributes.position.array;if(e){var r=this.boundingBox;r.makeEmpty();for(var n=0,i=e.length;n0&&(t.data.groups=JSON.parse(JSON.stringify(s)));var c=this.boundingSphere;return null!==c&&(t.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),t},clone:function(){return(new this.constructor).copy(this)},copy:function(t){var e=t.index;null!==e&&this.setIndex(e.clone());var r=t.attributes;for(var n in r){var i=r[n];this.addAttribute(n,i.clone())}for(var o=t.groups,a=0,s=o.length;a1){var u=c[1],h=r[u];h||(r[u]=h=[]),h.push(s)}}var l=[];for(var u in r)l.push(a.AnimationClip.CreateFromMorphTargetSequence(u,r[u],e));return l},a.AnimationClip.parse=function(t){for(var e=[],r=0;r0?new n(t,o):null},i=[],o=t.name||"default",s=t.length||-1,c=t.fps||30,u=t.hierarchy||[],h=0;h=this.keys[this.lastIndex].time;)this.lastIndex++;for(;this.lastIndex>0&&t=this.keys.length)return this.setResult(this.keys[this.keys.length-1].value),this.result;if(0===this.lastIndex)return this.setResult(this.keys[0].value),this.result;var e=this.keys[this.lastIndex-1];if(this.setResult(e.value),e.constantToNext)return this.result;var r=this.keys[this.lastIndex],n=(t-e.time)/(r.time-e.time);return this.result=this.lerpValues(this.result,r.value,n),this.result},shift:function(t){if(0!==t)for(var e=0;e0&&this.keys[n]>=e;n++)i++;return r+i>0&&(this.keys=this.keys.splice(r,this.keys.length-i-r)),this},validate:function(){var t=null;if(0===this.keys.length)return void console.error(" track is empty, no keys",this);for(var e=0;er.time)return void console.error(" key.time is less than previous key time, out of order keys",this,e,r,t);t=r}return this},optimize:function(){var t=[],e=this.keys[0];t.push(e);for(var r=(a.AnimationUtils.getEqualsFunc(e.value),1);r0&&(null===this.cumulativeValue&&(this.cumulativeValue=a.AnimationUtils.clone(t)),this.cumulativeWeight=e);else{var r=e/(this.cumulativeWeight+e);this.cumulativeValue=this.lerpValue(this.cumulativeValue,t,r),this.cumulativeWeight+=e}},unbind:function(){this.isBound&&(this.setValue(this.originalValue),this.setValue=null,this.getValue=null,this.lerpValue=null,this.equalsValue=null,this.triggerDirty=null,this.isBound=!1)},bind:function(){if(!this.isBound){var t=this.node;if(!t)return void console.error(" trying to update node for track: "+this.trackName+" but it wasn't found.");if(this.objectName){if("materials"===this.objectName){if(!t.material)return void console.error(" can not bind to material as node does not have a material",this);if(!t.material.materials)return void console.error(" can not bind to material.materials as node.material does not have a materials array",this);t=t.material.materials}else if("bones"===this.objectName){if(!t.skeleton)return void console.error(" can not bind to bones as node does not have a skeleton",this);t=t.skeleton.bones;for(var e=0;e0){if(this.cumulativeWeight<1){var t=1-this.cumulativeWeight,e=t/(this.cumulativeWeight+t);this.cumulativeValue=this.lerpValue(this.cumulativeValue,this.originalValue,e)}var r=this.setValue(this.cumulativeValue);r&&this.triggerDirty&&this.triggerDirty(),this.cumulativeValue=null,this.cumulativeWeight=0}}},a.PropertyBinding.parseTrackName=function(t){var e=/^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_. ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/,r=e.exec(t);if(!r)throw new Error("cannot parse trackName at all: "+t);r.index===e.lastIndex&&e.lastIndex++;var n={directoryName:r[1],nodeName:r[3],objectName:r[5],objectIndex:r[7],propertyName:r[9],propertyIndex:r[11]};if(null===n.propertyName||0===n.propertyName.length)throw new Error("can not parse propertyName from trackName: "+t);return n},a.PropertyBinding.findNode=function(t,e){function r(t){for(var r=0;r1?t.skinWeights[r+1]:0,c=e>2?t.skinWeights[r+2]:0,u=e>3?t.skinWeights[r+3]:0;s.skinWeights.push(new a.Vector4(i,o,c,u))}if(t.skinIndices)for(var r=0,n=t.skinIndices.length;r1?t.skinIndices[r+1]:0,f=e>2?t.skinIndices[r+2]:0,p=e>3?t.skinIndices[r+3]:0;s.skinIndices.push(new a.Vector4(h,l,f,p))}s.bones=t.bones,s.bones&&s.bones.length>0&&(s.skinWeights.length!==s.skinIndices.length||s.skinIndices.length!==s.vertices.length)&&console.warn("When skinning, number of vertices ("+s.vertices.length+"), skinIndices ("+s.skinIndices.length+"), and skinWeights ("+s.skinWeights.length+") should match.")}function i(e){if(void 0!==t.morphTargets)for(var r=0,n=t.morphTargets.length;r0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');for(var l=s.faces,f=t.morphColors[0].colors,r=0,n=l.length;r0&&(s.animations=e)}var s=new a.Geometry,c=void 0!==t.scale?1/t.scale:1;if(r(c),n(),i(c),o(),s.computeFaceNormals(),s.computeBoundingSphere(),void 0===t.materials||0===t.materials.length)return{geometry:s};var u=a.Loader.prototype.initMaterials(t.materials,e,this.crossOrigin);return{geometry:s,materials:u}}},a.LoadingManager=function(t,e,r){var n=this,i=!1,o=0,a=0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=r,this.itemStart=function(t){a++,i===!1&&void 0!==n.onStart&&n.onStart(t,o,a),i=!0},this.itemEnd=function(t){o++,void 0!==n.onProgress&&n.onProgress(t,o,a),o===a&&(i=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(t){void 0!==n.onError&&n.onError(t)}},a.DefaultLoadingManager=new a.LoadingManager,a.BufferGeometryLoader=function(t){this.manager=void 0!==t?t:a.DefaultLoadingManager},a.BufferGeometryLoader.prototype={constructor:a.BufferGeometryLoader,load:function(t,e,r,n){var i=this,o=new a.XHRLoader(i.manager);o.setCrossOrigin(this.crossOrigin),o.load(t,function(t){e(i.parse(JSON.parse(t)))},r,n)},setCrossOrigin:function(t){this.crossOrigin=t},parse:function(t){var e=new a.BufferGeometry,r=t.data.index;if(void 0!==r){var n=new o[r.type](r.array);e.setIndex(new a.BufferAttribute(n,1))}var i=t.data.attributes;for(var s in i){var c=i[s],n=new o[c.type](c.array);e.addAttribute(s,new a.BufferAttribute(n,c.itemSize))}var u=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==u)for(var h=0,l=u.length;h!==l;++h){var f=u[h];e.addGroup(f.start,f.count)}var p=t.data.boundingSphere;if(void 0!==p){var d=new a.Vector3;void 0!==p.center&&d.fromArray(p.center),e.boundingSphere=new a.Sphere(d,p.radius)}return e}},a.MaterialLoader=function(t){this.manager=void 0!==t?t:a.DefaultLoadingManager,this.textures={}},a.MaterialLoader.prototype={constructor:a.MaterialLoader,load:function(t,e,r,n){var i=this,o=new a.XHRLoader(i.manager);o.setCrossOrigin(this.crossOrigin),o.load(t,function(t){e(i.parse(JSON.parse(t)))},r,n)},setCrossOrigin:function(t){this.crossOrigin=t},setTextures:function(t){this.textures=t},getTexture:function(t){var e=this.textures;return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]},parse:function(t){var e=new a[t.type];if(e.uuid=t.uuid,void 0!==t.name&&(e.name=t.name),void 0!==t.color&&e.color.setHex(t.color),void 0!==t.emissive&&e.emissive.setHex(t.emissive),void 0!==t.specular&&e.specular.setHex(t.specular),void 0!==t.shininess&&(e.shininess=t.shininess),void 0!==t.uniforms&&(e.uniforms=t.uniforms),void 0!==t.vertexShader&&(e.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(e.fragmentShader=t.fragmentShader),void 0!==t.vertexColors&&(e.vertexColors=t.vertexColors),void 0!==t.shading&&(e.shading=t.shading),void 0!==t.blending&&(e.blending=t.blending),void 0!==t.side&&(e.side=t.side),void 0!==t.opacity&&(e.opacity=t.opacity),void 0!==t.transparent&&(e.transparent=t.transparent),void 0!==t.alphaTest&&(e.alphaTest=t.alphaTest),void 0!==t.depthTest&&(e.depthTest=t.depthTest),void 0!==t.depthWrite&&(e.depthWrite=t.depthWrite),void 0!==t.wireframe&&(e.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(e.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.size&&(e.size=t.size),void 0!==t.sizeAttenuation&&(e.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(e.map=this.getTexture(t.map)),void 0!==t.alphaMap&&(e.alphaMap=this.getTexture(t.alphaMap),e.transparent=!0),void 0!==t.bumpMap&&(e.bumpMap=this.getTexture(t.bumpMap)),void 0!==t.bumpScale&&(e.bumpScale=t.bumpScale),void 0!==t.normalMap&&(e.normalMap=this.getTexture(t.normalMap)),t.normalScale&&(e.normalScale=new a.Vector2(t.normalScale,t.normalScale)),void 0!==t.displacementMap&&(e.displacementMap=this.getTexture(t.displacementMap)),void 0!==t.displacementScale&&(e.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(e.displacementBias=t.displacementBias),void 0!==t.specularMap&&(e.specularMap=this.getTexture(t.specularMap)),void 0!==t.envMap&&(e.envMap=this.getTexture(t.envMap),e.combine=a.MultiplyOperation),t.reflectivity&&(e.reflectivity=t.reflectivity),void 0!==t.lightMap&&(e.lightMap=this.getTexture(t.lightMap)),void 0!==t.lightMapIntensity&&(e.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(e.aoMap=this.getTexture(t.aoMap)),void 0!==t.aoMapIntensity&&(e.aoMapIntensity=t.aoMapIntensity),void 0!==t.materials)for(var r=0,n=t.materials.length;r0){var o=new a.LoadingManager(e),s=new a.ImageLoader(o);s.setCrossOrigin(this.crossOrigin);for(var c=0,u=t.length;c0&&(e.alphaTest=this.alphaTest),this.wireframe===!0&&(e.wireframe=this.wireframe),this.wireframeLinewidth>1&&(e.wireframeLinewidth=this.wireframeLinewidth),e},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.side=t.side,this.opacity=t.opacity,this.transparent=t.transparent,this.blending=t.blending,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.alphaTest=t.alphaTest,this.overdraw=t.overdraw,this.visible=t.visible,this},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})},get wrapAround(){console.warn("THREE."+this.type+": .wrapAround has been removed.")},set wrapAround(t){console.warn("THREE."+this.type+": .wrapAround has been removed.")},get wrapRGB(){return console.warn("THREE."+this.type+": .wrapRGB has been removed."),new a.Color}},a.EventDispatcher.prototype.apply(a.Material.prototype),a.MaterialIdCount=0,a.LineBasicMaterial=function(t){a.Material.call(this),this.type="LineBasicMaterial",this.color=new a.Color(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.vertexColors=a.NoColors,this.fog=!0,this.setValues(t)},a.LineBasicMaterial.prototype=Object.create(a.Material.prototype),a.LineBasicMaterial.prototype.constructor=a.LineBasicMaterial,a.LineBasicMaterial.prototype.copy=function(t){return a.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.vertexColors=t.vertexColors,this.fog=t.fog,this},a.LineDashedMaterial=function(t){a.Material.call(this),this.type="LineDashedMaterial",this.color=new a.Color(16777215),this.linewidth=1,this.scale=1,this.dashSize=3,this.gapSize=1,this.vertexColors=!1,this.fog=!0,this.setValues(t)},a.LineDashedMaterial.prototype=Object.create(a.Material.prototype),a.LineDashedMaterial.prototype.constructor=a.LineDashedMaterial,a.LineDashedMaterial.prototype.copy=function(t){return a.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this.vertexColors=t.vertexColors,this.fog=t.fog,this},a.MeshBasicMaterial=function(t){a.Material.call(this),this.type="MeshBasicMaterial",this.color=new a.Color(16777215),this.map=null,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=a.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=a.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=a.NoColors,this.skinning=!1,this.morphTargets=!1,this.setValues(t)},a.MeshBasicMaterial.prototype=Object.create(a.Material.prototype),a.MeshBasicMaterial.prototype.constructor=a.MeshBasicMaterial,a.MeshBasicMaterial.prototype.copy=function(t){return a.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.fog=t.fog,this.shading=t.shading,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,
+this.wireframeLinejoin=t.wireframeLinejoin,this.vertexColors=t.vertexColors,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this},a.MeshLambertMaterial=function(t){a.Material.call(this),this.type="MeshLambertMaterial",this.color=new a.Color(16777215),this.emissive=new a.Color(0),this.map=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=a.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=a.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)},a.MeshLambertMaterial.prototype=Object.create(a.Material.prototype),a.MeshLambertMaterial.prototype.constructor=a.MeshLambertMaterial,a.MeshLambertMaterial.prototype.copy=function(t){return a.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.emissive.copy(t.emissive),this.map=t.map,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.fog=t.fog,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.vertexColors=t.vertexColors,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},a.MeshPhongMaterial=function(t){a.Material.call(this),this.type="MeshPhongMaterial",this.color=new a.Color(16777215),this.emissive=new a.Color(0),this.specular=new a.Color(1118481),this.shininess=30,this.metal=!1,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new a.Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=a.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=a.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=a.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)},a.MeshPhongMaterial.prototype=Object.create(a.Material.prototype),a.MeshPhongMaterial.prototype.constructor=a.MeshPhongMaterial,a.MeshPhongMaterial.prototype.copy=function(t){return a.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.emissive.copy(t.emissive),this.specular.copy(t.specular),this.shininess=t.shininess,this.metal=t.metal,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissiveMap=t.emissiveMap,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.fog=t.fog,this.shading=t.shading,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.vertexColors=t.vertexColors,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},a.MeshDepthMaterial=function(t){a.Material.call(this),this.type="MeshDepthMaterial",this.morphTargets=!1,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)},a.MeshDepthMaterial.prototype=Object.create(a.Material.prototype),a.MeshDepthMaterial.prototype.constructor=a.MeshDepthMaterial,a.MeshDepthMaterial.prototype.copy=function(t){return a.Material.prototype.copy.call(this,t),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},a.MeshNormalMaterial=function(t){a.Material.call(this,t),this.type="MeshNormalMaterial",this.wireframe=!1,this.wireframeLinewidth=1,this.morphTargets=!1,this.setValues(t)},a.MeshNormalMaterial.prototype=Object.create(a.Material.prototype),a.MeshNormalMaterial.prototype.constructor=a.MeshNormalMaterial,a.MeshNormalMaterial.prototype.copy=function(t){return a.Material.prototype.copy.call(this,t),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},a.MultiMaterial=function(t){this.uuid=a.Math.generateUUID(),this.type="MultiMaterial",this.materials=t instanceof Array?t:[],this.visible=!0},a.MultiMaterial.prototype={constructor:a.MultiMaterial,toJSON:function(){for(var t={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},e=0,r=this.materials.length;e2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}if(void 0!==t.textures[this.uuid])return t.textures[this.uuid];var r={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};if(void 0!==this.image){var n=this.image;void 0===n.uuid&&(n.uuid=a.Math.generateUUID()),void 0===t.images[n.uuid]&&(t.images[n.uuid]={uuid:n.uuid,url:e(n)}),r.image=n.uuid}return t.textures[this.uuid]=r,r},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(this.mapping===a.UVMapping){if(t.multiply(this.repeat),t.add(this.offset),t.x<0||t.x>1)switch(this.wrapS){case a.RepeatWrapping:t.x=t.x-Math.floor(t.x);break;case a.ClampToEdgeWrapping:t.x=t.x<0?0:1;break;case a.MirroredRepeatWrapping:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case a.RepeatWrapping:t.y=t.y-Math.floor(t.y);break;case a.ClampToEdgeWrapping:t.y=t.y<0?0:1;break;case a.MirroredRepeatWrapping:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}this.flipY&&(t.y=1-t.y)}}};a.EventDispatcher.prototype.apply(a.Texture.prototype);a.TextureIdCount=0,a.CanvasTexture=function(t,e,r,n,i,o,s,c,u){a.Texture.call(this,t,e,r,n,i,o,s,c,u),this.needsUpdate=!0},a.CanvasTexture.prototype=Object.create(a.Texture.prototype),a.CanvasTexture.prototype.constructor=a.CanvasTexture,a.CubeTexture=function(t,e,r,n,i,o,s,c,u){e=void 0!==e?e:a.CubeReflectionMapping,a.Texture.call(this,t,e,r,n,i,o,s,c,u),this.images=t,this.flipY=!1},a.CubeTexture.prototype=Object.create(a.Texture.prototype),a.CubeTexture.prototype.constructor=a.CubeTexture,a.CubeTexture.prototype.copy=function(t){return a.Texture.prototype.copy.call(this,t),this.images=t.images,this},a.CompressedTexture=function(t,e,r,n,i,o,s,c,u,h,l){a.Texture.call(this,null,o,s,c,u,h,n,i,l),this.image={width:e,height:r},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1},a.CompressedTexture.prototype=Object.create(a.Texture.prototype),a.CompressedTexture.prototype.constructor=a.CompressedTexture,a.DataTexture=function(t,e,r,n,i,o,s,c,u,h,l){a.Texture.call(this,null,o,s,c,u,h,n,i,l),this.image={data:t,width:e,height:r},this.magFilter=void 0!==u?u:a.NearestFilter,this.minFilter=void 0!==h?h:a.NearestFilter,this.flipY=!1,this.generateMipmaps=!1},a.DataTexture.prototype=Object.create(a.Texture.prototype),a.DataTexture.prototype.constructor=a.DataTexture,a.VideoTexture=function(t,e,r,n,i,o,s,c,u){function h(){requestAnimationFrame(h),t.readyState===t.HAVE_ENOUGH_DATA&&(l.needsUpdate=!0)}a.Texture.call(this,t,e,r,n,i,o,s,c,u),this.generateMipmaps=!1;var l=this;h()},a.VideoTexture.prototype=Object.create(a.Texture.prototype),a.VideoTexture.prototype.constructor=a.VideoTexture,a.Group=function(){a.Object3D.call(this),this.type="Group"},a.Group.prototype=Object.create(a.Object3D.prototype),a.Group.prototype.constructor=a.Group,a.Points=function(t,e){a.Object3D.call(this),this.type="Points",this.geometry=void 0!==t?t:new a.Geometry,this.material=void 0!==e?e:new a.PointsMaterial({color:16777215*Math.random()})},a.Points.prototype=Object.create(a.Object3D.prototype),a.Points.prototype.constructor=a.Points,a.Points.prototype.raycast=function(){var t=new a.Matrix4,e=new a.Ray;return function(r,n){function i(t,i){var a=e.distanceSqToPoint(t);if(ar.far)return;n.push({distance:c,distanceToRay:Math.sqrt(a),point:s.clone(),index:i,face:null,object:o})}}var o=this,s=o.geometry,c=r.params.Points.threshold;if(t.getInverse(this.matrixWorld),e.copy(r.ray).applyMatrix4(t),null===s.boundingBox||e.isIntersectionBox(s.boundingBox)!==!1){var u=c/((this.scale.x+this.scale.y+this.scale.z)/3),h=u*u,l=new a.Vector3;if(s instanceof a.BufferGeometry){var f=s.index,p=s.attributes,d=p.position.array;if(null!==f)for(var m=f.array,g=0,v=m.length;gs)){f.applyMatrix4(this.matrixWorld);var S=n.ray.origin.distanceTo(f);Sn.far||i.push({distance:S,point:l.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else for(var v=m.position.array,y=0,b=v.length/3-1;ys)){f.applyMatrix4(this.matrixWorld);var S=n.ray.origin.distanceTo(f);Sn.far||i.push({distance:S,point:l.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}else if(c instanceof a.Geometry)for(var M=c.vertices,E=M.length,y=0;ys)){f.applyMatrix4(this.matrixWorld);var S=n.ray.origin.distanceTo(f);Sn.far||i.push({distance:S,point:l.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}}}(),a.Line.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)},a.LineStrip=0,a.LinePieces=1,a.LineSegments=function(t,e){a.Line.call(this,t,e),this.type="LineSegments"},a.LineSegments.prototype=Object.create(a.Line.prototype),a.LineSegments.prototype.constructor=a.LineSegments,a.Mesh=function(t,e){a.Object3D.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new a.Geometry,this.material=void 0!==e?e:new a.MeshBasicMaterial({color:16777215*Math.random()}),this.updateMorphTargets()},a.Mesh.prototype=Object.create(a.Object3D.prototype),a.Mesh.prototype.constructor=a.Mesh,a.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&this.geometry.morphTargets.length>0){this.morphTargetBase=-1,this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var t=0,e=this.geometry.morphTargets.length;te.far?null:{distance:h,point:y.clone(),object:t}}function r(r,n,i,o,h,l,f,g){s.fromArray(o,3*l),c.fromArray(o,3*f),u.fromArray(o,3*g);var y=e(r,n,i,s,c,u,v);return y&&(h&&(p.fromArray(h,2*l),d.fromArray(h,2*f),m.fromArray(h,2*g),y.uv=t(v,s,c,u,p,d,m)),y.face=new a.Face3(l,f,g,a.Triangle.normal(s,c,u)),y.faceIndex=l),y}var n=new a.Matrix4,i=new a.Ray,o=new a.Sphere,s=new a.Vector3,c=new a.Vector3,u=new a.Vector3,h=new a.Vector3,l=new a.Vector3,f=new a.Vector3,p=new a.Vector2,d=new a.Vector2,m=new a.Vector2,g=new a.Vector3,v=new a.Vector3,y=new a.Vector3;return function(g,y){var b=this.geometry,x=this.material;if(void 0!==x){null===b.boundingSphere&&b.computeBoundingSphere();var w=this.matrixWorld;if(o.copy(b.boundingSphere),o.applyMatrix4(w),g.ray.isIntersectionSphere(o)!==!1&&(n.getInverse(w),i.copy(g.ray).applyMatrix4(n),null===b.boundingBox||i.isIntersectionBox(b.boundingBox)!==!1)){var _,S;if(b instanceof a.BufferGeometry){var M,E,T,A=b.index,C=b.attributes,L=C.position.array;if(void 0!==C.uv&&(_=C.uv.array),null!==A)for(var k=A.array,F=0,P=k.length;F0&&(_=N);for(var I=0,V=B.length;I1){t.setFromMatrixPosition(r.matrixWorld),e.setFromMatrixPosition(this.matrixWorld);var i=t.distanceTo(e);n[0].object.visible=!0;for(var o=1,a=n.length;o=n[o].distance;o++)n[o-1].object.visible=!1,n[o].object.visible=!0;for(;oi||r.push({distance:Math.sqrt(n),point:this.position,face:null,object:this})}}(),a.Sprite.prototype.clone=function(){return new this.constructor(this.material).copy(this)},a.Particle=a.Sprite,a.LensFlare=function(t,e,r,n,i){a.Object3D.call(this),this.lensFlares=[],this.positionScreen=new a.Vector3,this.customUpdateCallback=void 0,void 0!==t&&this.add(t,e,r,n,i)},a.LensFlare.prototype=Object.create(a.Object3D.prototype),a.LensFlare.prototype.constructor=a.LensFlare,a.LensFlare.prototype.add=function(t,e,r,n,i,o){void 0===e&&(e=-1),void 0===r&&(r=0),void 0===o&&(o=1),void 0===i&&(i=new a.Color(16777215)),void 0===n&&(n=a.NormalBlending),r=Math.min(r,Math.max(0,r)),this.lensFlares.push({texture:t,size:e,distance:r,x:0,y:0,z:0,scale:1,rotation:0,opacity:o,color:i,blending:n})},a.LensFlare.prototype.updateLensFlares=function(){var t,e,r=this.lensFlares.length,n=2*-this.positionScreen.x,i=2*-this.positionScreen.y;for(t=0;t 0.0 ) {\n\n\t return pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\n\t}\n\n\treturn 1.0;\n\n}\n\nvec3 F_Schlick( in vec3 specularColor, in float dotLH ) {\n\n\n\tfloat fresnel = exp2( ( -5.55437 * dotLH - 6.98316 ) * dotLH );\n\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n\n}\n\nfloat G_BlinnPhong_Implicit( /* in float dotNL, in float dotNV */ ) {\n\n\n\treturn 0.25;\n\n}\n\nfloat D_BlinnPhong( in float shininess, in float dotNH ) {\n\n\n\treturn ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n\n}\n\nvec3 BRDF_BlinnPhong( in vec3 specularColor, in float shininess, in vec3 normal, in vec3 lightDir, in vec3 viewDir ) {\n\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( lightDir, halfDir ) );\n\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\n\tfloat G = G_BlinnPhong_Implicit( /* dotNL, dotNV */ );\n\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\n\treturn F * G * D;\n\n}\n\nvec3 inputToLinear( in vec3 a ) {\n\n\t#ifdef GAMMA_INPUT\n\n\t\treturn pow( a, vec3( float( GAMMA_FACTOR ) ) );\n\n\t#else\n\n\t\treturn a;\n\n\t#endif\n\n}\n\nvec3 linearToOutput( in vec3 a ) {\n\n\t#ifdef GAMMA_OUTPUT\n\n\t\treturn pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );\n\n\t#else\n\n\t\treturn a;\n\n\t#endif\n\n}\n",
+a.ShaderChunk.defaultnormal_vertex="#ifdef FLIP_SIDED\n\n\tobjectNormal = -objectNormal;\n\n#endif\n\nvec3 transformedNormal = normalMatrix * objectNormal;\n",a.ShaderChunk.displacementmap_vertex="#ifdef USE_DISPLACEMENTMAP\n\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n\n#endif\n",a.ShaderChunk.displacementmap_pars_vertex="#ifdef USE_DISPLACEMENTMAP\n\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n\n#endif\n",a.ShaderChunk.emissivemap_fragment="#ifdef USE_EMISSIVEMAP\n\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\n\temissiveColor.rgb = inputToLinear( emissiveColor.rgb );\n\n\ttotalEmissiveLight *= emissiveColor.rgb;\n\n#endif\n",a.ShaderChunk.emissivemap_pars_fragment="#ifdef USE_EMISSIVEMAP\n\n\tuniform sampler2D emissiveMap;\n\n#endif\n",a.ShaderChunk.envmap_fragment="#ifdef USE_ENVMAP\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\n\t\t#else\n\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#else\n\n\t\tvec3 reflectVec = vReflect;\n\n\t#endif\n\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\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\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#endif\n\n\tenvColor.xyz = inputToLinear( envColor.xyz );\n\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n\t#endif\n\n#endif\n",a.ShaderChunk.envmap_pars_fragment="#ifdef USE_ENVMAP\n\n\tuniform float reflectivity;\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\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\tuniform float refractionRatio;\n\n\t#else\n\n\t\tvarying vec3 vReflect;\n\n\t#endif\n\n#endif\n",a.ShaderChunk.envmap_pars_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n\tvarying vec3 vReflect;\n\n\tuniform float refractionRatio;\n\n#endif\n",a.ShaderChunk.envmap_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\n\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t#else\n\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t#endif\n\n#endif\n",a.ShaderChunk.fog_fragment="#ifdef USE_FOG\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\n\t#else\n\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\n\t#endif\n\n\t#ifdef FOG_EXP2\n\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\n\t#else\n\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\n\t#endif\n\t\n\toutgoingLight = mix( outgoingLight, fogColor, fogFactor );\n\n#endif",a.ShaderChunk.fog_pars_fragment="#ifdef USE_FOG\n\n\tuniform vec3 fogColor;\n\n\t#ifdef FOG_EXP2\n\n\t\tuniform float fogDensity;\n\n\t#else\n\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n\n#endif",a.ShaderChunk.hemilight_fragment="#if MAX_HEMI_LIGHTS > 0\n\n\tfor ( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec3 lightDir = hemisphereLightDirection[ i ];\n\n\t\tfloat dotProduct = dot( normal, lightDir );\n\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\n\t\tvec3 lightColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\ttotalAmbientLight += lightColor;\n\n\t}\n\n#endif\n\n",a.ShaderChunk.lightmap_fragment="#ifdef USE_LIGHTMAP\n\n\ttotalAmbientLight += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\n#endif\n",a.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n\n#endif",a.ShaderChunk.lights_lambert_pars_vertex="#if MAX_DIR_LIGHTS > 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n",a.ShaderChunk.lights_lambert_vertex="vLightFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack = vec3( 0.0 );\n\n#endif\n\nvec3 normal = normalize( transformedNormal );\n\n#if MAX_POINT_LIGHTS > 0\n\n\tfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec3 lightColor = pointLightColor[ i ];\n\n\t\tvec3 lVector = pointLightPosition[ i ] - mvPosition.xyz;\n\t\tvec3 lightDir = normalize( lVector );\n\n\n\t\tfloat attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n\n\t\tfloat dotProduct = dot( normal, lightDir );\n\n\t\tvLightFront += lightColor * attenuation * saturate( dotProduct );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += lightColor * attenuation * saturate( - dotProduct );\n\n\t\t#endif\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec3 lightColor = spotLightColor[ i ];\n\n\t\tvec3 lightPosition = spotLightPosition[ i ];\n\t\tvec3 lVector = lightPosition - mvPosition.xyz;\n\t\tvec3 lightDir = normalize( lVector );\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], lightDir );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = saturate( pow( saturate( spotEffect ), spotLightExponent[ i ] ) );\n\n\n\t\t\tfloat attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n\t\t\tattenuation *= spotEffect;\n\n\n\t\t\tfloat dotProduct = dot( normal, lightDir );\n\n\t\t\tvLightFront += lightColor * attenuation * saturate( dotProduct );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvLightBack += lightColor * attenuation * saturate( - dotProduct );\n\n\t\t\t#endif\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_DIR_LIGHTS > 0\n\n\tfor ( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\t\tvec3 lightColor = directionalLightColor[ i ];\n\n\t\tvec3 lightDir = directionalLightDirection[ i ];\n\n\n\t\tfloat dotProduct = dot( normal, lightDir );\n\n\t\tvLightFront += lightColor * saturate( dotProduct );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += lightColor * saturate( - dotProduct );\n\n\t\t#endif\n\n\t}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tfor ( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec3 lightDir = hemisphereLightDirection[ i ];\n\n\n\t\tfloat dotProduct = dot( normal, lightDir );\n\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\n\t\tvLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tfloat hemiDiffuseWeightBack = - 0.5 * dotProduct + 0.5;\n\n\t\t\tvLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );\n\n\t\t#endif\n\n\t}\n\n#endif\n",a.ShaderChunk.lights_phong_fragment="vec3 viewDir = normalize( vViewPosition );\n\nvec3 totalDiffuseLight = vec3( 0.0 );\nvec3 totalSpecularLight = vec3( 0.0 );\n\n#if MAX_POINT_LIGHTS > 0\n\n\tfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec3 lightColor = pointLightColor[ i ];\n\n\t\tvec3 lightPosition = pointLightPosition[ i ];\n\t\tvec3 lVector = lightPosition + vViewPosition.xyz;\n\t\tvec3 lightDir = normalize( lVector );\n\n\n\t\tfloat attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n\n\t\tfloat cosineTerm = saturate( dot( normal, lightDir ) );\n\n\t\ttotalDiffuseLight += lightColor * attenuation * cosineTerm;\n\n\n\t\tvec3 brdf = BRDF_BlinnPhong( specular, shininess, normal, lightDir, viewDir );\n\n\t\ttotalSpecularLight += brdf * specularStrength * lightColor * attenuation * cosineTerm;\n\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec3 lightColor = spotLightColor[ i ];\n\n\t\tvec3 lightPosition = spotLightPosition[ i ];\n\t\tvec3 lVector = lightPosition + vViewPosition.xyz;\n\t\tvec3 lightDir = normalize( lVector );\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], lightDir );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = saturate( pow( saturate( spotEffect ), spotLightExponent[ i ] ) );\n\n\n\t\t\tfloat attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n\t\t\tattenuation *= spotEffect;\n\n\n\t\t\tfloat cosineTerm = saturate( dot( normal, lightDir ) );\n\n\t\t\ttotalDiffuseLight += lightColor * attenuation * cosineTerm;\n\n\n\t\t\tvec3 brdf = BRDF_BlinnPhong( specular, shininess, normal, lightDir, viewDir );\n\n\t\t\ttotalSpecularLight += brdf * specularStrength * lightColor * attenuation * cosineTerm;\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_DIR_LIGHTS > 0\n\n\tfor ( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\t\tvec3 lightColor = directionalLightColor[ i ];\n\n\t\tvec3 lightDir = directionalLightDirection[ i ];\n\n\n\t\tfloat cosineTerm = saturate( dot( normal, lightDir ) );\n\n\t\ttotalDiffuseLight += lightColor * cosineTerm;\n\n\n\t\tvec3 brdf = BRDF_BlinnPhong( specular, shininess, normal, lightDir, viewDir );\n\n\t\ttotalSpecularLight += brdf * specularStrength * lightColor * cosineTerm;\n\n\t}\n\n#endif\n",a.ShaderChunk.lights_phong_pars_fragment="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0 || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n",a.ShaderChunk.lights_phong_pars_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\n#endif\n",a.ShaderChunk.lights_phong_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_ENVMAP )\n\n\tvWorldPosition = worldPosition.xyz;\n\n#endif\n",a.ShaderChunk.linear_to_gamma_fragment="\n\toutgoingLight = linearToOutput( outgoingLight );\n",a.ShaderChunk.logdepthbuf_fragment="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n\n#endif",a.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n\n\tuniform float logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n#endif\n",a.ShaderChunk.logdepthbuf_pars_vertex="#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n\tuniform float logDepthBufFC;\n\n#endif",a.ShaderChunk.logdepthbuf_vertex="#ifdef USE_LOGDEPTHBUF\n\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\n#else\n\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\n\t#endif\n\n#endif",a.ShaderChunk.map_fragment="#ifdef USE_MAP\n\n\tvec4 texelColor = texture2D( map, vUv );\n\n\ttexelColor.xyz = inputToLinear( texelColor.xyz );\n\n\tdiffuseColor *= texelColor;\n\n#endif\n",a.ShaderChunk.map_pars_fragment="#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif",a.ShaderChunk.map_particle_fragment="#ifdef USE_MAP\n\n\tdiffuseColor *= texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\n#endif\n",a.ShaderChunk.map_particle_pars_fragment="#ifdef USE_MAP\n\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n\n#endif\n",a.ShaderChunk.morphnormal_vertex="#ifdef USE_MORPHNORMALS\n\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\n#endif\n",a.ShaderChunk.morphtarget_pars_vertex="#ifdef USE_MORPHTARGETS\n\n\t#ifndef USE_MORPHNORMALS\n\n\tuniform float morphTargetInfluences[ 8 ];\n\n\t#else\n\n\tuniform float morphTargetInfluences[ 4 ];\n\n\t#endif\n\n#endif",a.ShaderChunk.morphtarget_vertex="#ifdef USE_MORPHTARGETS\n\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\n\t#ifndef USE_MORPHNORMALS\n\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\n\t#endif\n\n#endif\n",a.ShaderChunk.normal_phong_fragment="#ifndef FLAT_SHADED\n\n\tvec3 normal = normalize( vNormal );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\n\t#endif\n\n#else\n\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n\n#endif\n\n#ifdef USE_NORMALMAP\n\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\n#elif defined( USE_BUMPMAP )\n\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n\n",a.ShaderChunk.normalmap_pars_fragment="#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\n\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\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\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\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\n\t}\n\n#endif\n",a.ShaderChunk.project_vertex="#ifdef USE_SKINNING\n\n\tvec4 mvPosition = modelViewMatrix * skinned;\n\n#else\n\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n\n#endif\n\ngl_Position = projectionMatrix * mvPosition;\n",a.ShaderChunk.shadowmap_fragment="#ifdef USE_SHADOWMAP\n\n\tfor ( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\tfloat texelSizeY = 1.0 / shadowMapSize[ i ].y;\n\n\t\tfloat shadow = 0.0;\n\n#if defined( POINT_LIGHT_SHADOWS )\n\n\t\tbool isPointLight = shadowDarkness[ i ] < 0.0;\n\n\t\tif ( isPointLight ) {\n\n\t\t\tfloat realShadowDarkness = abs( shadowDarkness[ i ] );\n\n\t\t\tvec3 lightToPosition = vShadowCoord[ i ].xyz;\n\n\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tfloat dp = length( lightToPosition );\n\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D, texelSizeY ) ), shadowBias[ i ], shadow );\n\n\n\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tconst float Dr = 1.25;\n\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tconst float Dr = 2.25;\n\t#endif\n\n\t\t\tfloat os = Dr * 2.0 * texelSizeY;\n\n\t\t\tconst vec3 Gsd = vec3( - 1, 0, 1 );\n\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zzz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zxz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xxz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xzz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zzx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zxx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xxx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xzx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zzy * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zxy * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xxy * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xzy * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zyz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xyz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.zyx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.xyx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.yzz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.yxz * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.yxx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D + Gsd.yzx * os, texelSizeY ) ), shadowBias[ i ], shadow );\n\n\t\t\tshadow *= realShadowDarkness * ( 1.0 / 21.0 );\n\n\t#else \n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tfloat dp = length( lightToPosition );\n\n\t\t\tadjustShadowValue1K( dp, texture2D( shadowMap[ i ], cubeToUV( bd3D, texelSizeY ) ), shadowBias[ i ], shadow );\n\n\t\t\tshadow *= realShadowDarkness;\n\n\t#endif\n\n\t\t} else {\n\n#endif \n\t\t\tfloat texelSizeX = 1.0 / shadowMapSize[ i ].x;\n\n\t\t\tvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\n\n\n\t\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\t\tbool inFrustum = all( inFrustumVec );\n\n\t\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n\t\t\tbool frustumTest = all( frustumTestVec );\n\n\t\t\tif ( frustumTest ) {\n\n\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\n\t\t\t\t/*\n\t\t\t\t\tfor ( float y = -1.25; y <= 1.25; y += 1.25 )\n\t\t\t\t\t\tfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\n\t\t\t\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\n\t\t\t\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\t\t\t\t\t\t\tif ( fDepth < shadowCoord.z )\n\t\t\t\t\t\t\t\tshadow += 1.0;\n\t\t\t\t\t}\n\t\t\t\t\tshadow /= 9.0;\n\t\t\t\t*/\n\n\t\t\t\tshadowCoord.z += shadowBias[ i ];\n\n\t\t\t\tconst float ShadowDelta = 1.0 / 9.0;\n\n\t\t\t\tfloat xPixelOffset = texelSizeX;\n\t\t\t\tfloat yPixelOffset = texelSizeY;\n\n\t\t\t\tfloat dx0 = - 1.25 * xPixelOffset;\n\t\t\t\tfloat dy0 = - 1.25 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.25 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.25 * yPixelOffset;\n\n\t\t\t\tfloat fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += ShadowDelta;\n\n\t\t\t\tshadow *= shadowDarkness[ i ];\n\n\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\n\t\t\t\tshadowCoord.z += shadowBias[ i ];\n\n\t\t\t\tfloat xPixelOffset = texelSizeX;\n\t\t\t\tfloat yPixelOffset = texelSizeY;\n\n\t\t\t\tfloat dx0 = - 1.0 * xPixelOffset;\n\t\t\t\tfloat dy0 = - 1.0 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.0 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.0 * yPixelOffset;\n\n\t\t\t\tmat3 shadowKernel;\n\t\t\t\tmat3 depthKernel;\n\n\t\t\t\tdepthKernel[ 0 ][ 0 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tdepthKernel[ 0 ][ 1 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tdepthKernel[ 0 ][ 2 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tdepthKernel[ 1 ][ 0 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tdepthKernel[ 1 ][ 1 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tdepthKernel[ 1 ][ 2 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tdepthKernel[ 2 ][ 0 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tdepthKernel[ 2 ][ 1 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tdepthKernel[ 2 ][ 2 ] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\n\t\t\t\tvec3 shadowZ = vec3( shadowCoord.z );\n\t\t\t\tshadowKernel[ 0 ] = vec3( lessThan( depthKernel[ 0 ], shadowZ ) );\n\t\t\t\tshadowKernel[ 0 ] *= vec3( 0.25 );\n\n\t\t\t\tshadowKernel[ 1 ] = vec3( lessThan( depthKernel[ 1 ], shadowZ ) );\n\t\t\t\tshadowKernel[ 1 ] *= vec3( 0.25 );\n\n\t\t\t\tshadowKernel[ 2 ] = vec3( lessThan( depthKernel[ 2 ], shadowZ ) );\n\t\t\t\tshadowKernel[ 2 ] *= vec3( 0.25 );\n\n\t\t\t\tvec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[ i ].xy );\n\n\t\t\t\tshadowKernel[ 0 ] = mix( shadowKernel[ 1 ], shadowKernel[ 0 ], fractionalCoord.x );\n\t\t\t\tshadowKernel[ 1 ] = mix( shadowKernel[ 2 ], shadowKernel[ 1 ], fractionalCoord.x );\n\n\t\t\t\tvec4 shadowValues;\n\t\t\t\tshadowValues.x = mix( shadowKernel[ 0 ][ 1 ], shadowKernel[ 0 ][ 0 ], fractionalCoord.y );\n\t\t\t\tshadowValues.y = mix( shadowKernel[ 0 ][ 2 ], shadowKernel[ 0 ][ 1 ], fractionalCoord.y );\n\t\t\t\tshadowValues.z = mix( shadowKernel[ 1 ][ 1 ], shadowKernel[ 1 ][ 0 ], fractionalCoord.y );\n\t\t\t\tshadowValues.w = mix( shadowKernel[ 1 ][ 2 ], shadowKernel[ 1 ][ 1 ], fractionalCoord.y );\n\n\t\t\t\tshadow = dot( shadowValues, vec4( 1.0 ) ) * shadowDarkness[ i ];\n\n\t#else \n\t\t\t\tshadowCoord.z += shadowBias[ i ];\n\n\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\n\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\tif ( fDepth < shadowCoord.z )\n\t\t\t\t\tshadow = shadowDarkness[ i ];\n\n\t#endif\n\n\t\t\t}\n\n#ifdef SHADOWMAP_DEBUG\n\n\t\t\tif ( inFrustum ) {\n\n\t\t\t\tif ( i == 0 ) {\n\n\t\t\t\t\toutgoingLight *= vec3( 1.0, 0.5, 0.0 );\n\n\t\t\t\t} else if ( i == 1 ) {\n\n\t\t\t\t\toutgoingLight *= vec3( 0.0, 1.0, 0.8 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\toutgoingLight *= vec3( 0.0, 0.5, 1.0 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n#endif\n\n#if defined( POINT_LIGHT_SHADOWS )\n\n\t\t}\n\n#endif\n\n\t\tshadowMask = shadowMask * vec3( 1.0 - shadow );\n\n\t}\n\n#endif\n",a.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\n\tuniform sampler2D shadowMap[ MAX_SHADOWS ];\n\tuniform vec2 shadowMapSize[ MAX_SHADOWS ];\n\n\tuniform float shadowDarkness[ MAX_SHADOWS ];\n\tuniform float shadowBias[ MAX_SHADOWS ];\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\tfloat depth = dot( rgba_depth, bit_shift );\n\t\treturn depth;\n\n\t}\n\n\t#if defined(POINT_LIGHT_SHADOWS)\n\n\n\t\tvoid adjustShadowValue1K( const float testDepth, const vec4 textureData, const float bias, inout float shadowValue ) {\n\n\t\t\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\t\tif ( testDepth >= dot( textureData, bitSh ) * 1000.0 + bias )\n\t\t\t\tshadowValue += 1.0;\n\n\t\t}\n\n\n\t\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\n\n\t\t\tvec3 absV = abs( v );\n\n\n\t\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\t\tabsV *= scaleToCube;\n\n\n\t\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\n\n\n\t\t\tvec2 planar = v.xy;\n\n\t\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\t\tfloat almostOne = 1.0 - almostATexel;\n\n\t\t\tif ( absV.z >= almostOne ) {\n\n\t\t\t\tif ( v.z > 0.0 )\n\t\t\t\t\tplanar.x = 4.0 - v.x;\n\n\t\t\t} else if ( absV.x >= almostOne ) {\n\n\t\t\t\tfloat signX = sign( v.x );\n\t\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\n\t\t\t} else if ( absV.y >= almostOne ) {\n\n\t\t\t\tfloat signY = sign( v.y );\n\t\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\t\tplanar.y = v.z * signY - 2.0;\n\n\t\t\t}\n\n\n\t\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\n\t\t}\n\n\t#endif\n\n#endif\n",a.ShaderChunk.shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n\n\tuniform float shadowDarkness[ MAX_SHADOWS ];\n\tuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n#endif",a.ShaderChunk.shadowmap_vertex="#ifdef USE_SHADOWMAP\n\n\tfor ( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\t\tvShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n\n\t}\n\n#endif",a.ShaderChunk.skinbase_vertex="#ifdef USE_SKINNING\n\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n\n#endif",a.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\n\t\t\ty = dy * ( y + 0.5 );\n\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n",a.ShaderChunk.skinning_vertex="#ifdef USE_SKINNING\n\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n\n#endif\n",a.ShaderChunk.skinnormal_vertex="#ifdef USE_SKINNING\n\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\n#endif\n",a.ShaderChunk.specularmap_fragment="float specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n\n#else\n\n\tspecularStrength = 1.0;\n\n#endif",
+a.ShaderChunk.specularmap_pars_fragment="#ifdef USE_SPECULARMAP\n\n\tuniform sampler2D specularMap;\n\n#endif",a.ShaderChunk.uv2_pars_fragment="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tvarying vec2 vUv2;\n\n#endif",a.ShaderChunk.uv2_pars_vertex="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\n#endif",a.ShaderChunk.uv2_vertex="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\n\tvUv2 = uv2;\n\n#endif",a.ShaderChunk.uv_pars_fragment="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP )\n\n\tvarying vec2 vUv;\n\n#endif",a.ShaderChunk.uv_pars_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP )\n\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n\n#endif\n",a.ShaderChunk.uv_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP )\n\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n\n#endif",a.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\n\t#ifdef USE_SKINNING\n\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\n\t#else\n\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\n\t#endif\n\n#endif\n",a.UniformsUtils={merge:function(t){for(var e={},r=0;r dashSize ) {","\t\tdiscard;","\t}","\tvec3 outgoingLight = vec3( 0.0 );","\tvec4 diffuseColor = vec4( diffuse, opacity );",a.ShaderChunk.logdepthbuf_fragment,a.ShaderChunk.color_fragment,"\toutgoingLight = diffuseColor.rgb;",a.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2e3},opacity:{type:"f",value:1}},vertexShader:[a.ShaderChunk.common,a.ShaderChunk.morphtarget_pars_vertex,a.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",a.ShaderChunk.begin_vertex,a.ShaderChunk.morphtarget_vertex,a.ShaderChunk.project_vertex,a.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float mNear;","uniform float mFar;","uniform float opacity;",a.ShaderChunk.common,a.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",a.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT","\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;","\t#else","\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;","\t#endif","\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );","\tgl_FragColor = vec4( vec3( color ), opacity );","}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",a.ShaderChunk.common,a.ShaderChunk.morphtarget_pars_vertex,a.ShaderChunk.logdepthbuf_pars_vertex,"void main() {","\tvNormal = normalize( normalMatrix * normal );",a.ShaderChunk.begin_vertex,a.ShaderChunk.morphtarget_vertex,a.ShaderChunk.project_vertex,a.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;","varying vec3 vNormal;",a.ShaderChunk.common,a.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",a.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",a.ShaderChunk.common,a.ShaderChunk.logdepthbuf_pars_vertex,"void main() {","\tvWorldPosition = transformDirection( position, modelMatrix );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",a.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","uniform float tFlip;","varying vec3 vWorldPosition;",a.ShaderChunk.common,a.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",a.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",a.ShaderChunk.common,a.ShaderChunk.logdepthbuf_pars_vertex,"void main() {","\tvWorldPosition = transformDirection( position, modelMatrix );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",a.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","uniform float tFlip;","varying vec3 vWorldPosition;",a.ShaderChunk.common,a.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","vec3 direction = normalize( vWorldPosition );","vec2 sampleUV;","sampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );","sampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;","gl_FragColor = texture2D( tEquirect, sampleUV );",a.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[a.ShaderChunk.common,a.ShaderChunk.morphtarget_pars_vertex,a.ShaderChunk.skinning_pars_vertex,a.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",a.ShaderChunk.skinbase_vertex,a.ShaderChunk.begin_vertex,a.ShaderChunk.morphtarget_vertex,a.ShaderChunk.skinning_vertex,a.ShaderChunk.project_vertex,a.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[a.ShaderChunk.common,a.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {","\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );","\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );","\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );","\tres -= res.xxyz * bit_mask;","\treturn res;","}","void main() {",a.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT","\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );","\t#else","\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );","\t#endif","}"].join("\n")},distanceRGBA:{uniforms:{lightPos:{type:"v3",value:new a.Vector3(0,0,0)}},vertexShader:["varying vec4 vWorldPosition;",a.ShaderChunk.common,a.ShaderChunk.morphtarget_pars_vertex,a.ShaderChunk.skinning_pars_vertex,"void main() {",a.ShaderChunk.skinbase_vertex,a.ShaderChunk.begin_vertex,a.ShaderChunk.morphtarget_vertex,a.ShaderChunk.skinning_vertex,a.ShaderChunk.project_vertex,a.ShaderChunk.worldpos_vertex,"vWorldPosition = worldPosition;","}"].join("\n"),fragmentShader:["uniform vec3 lightPos;","varying vec4 vWorldPosition;",a.ShaderChunk.common,"vec4 pack1K ( float depth ) {"," depth /= 1000.0;"," const vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );","\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );","\tvec4 res = fract( depth * bitSh );","\tres -= res.xxyz * bitMsk;","\treturn res; ","}","float unpack1K ( vec4 color ) {","\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );","\treturn dot( color, bitSh ) * 1000.0;","}","void main () {","\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );","}"].join("\n")}},a.WebGLRenderer=function(t){function e(t,e,r,n){at===!0&&(t*=n,e*=n,r*=n),Bt.clearColor(t,e,r,n)}function r(){Gt.init(),Bt.viewport(Et,Tt,At,Ct),e(ct.r,ct.g,ct.b,ut)}function n(){bt=null,St=null,_t="",wt=-1,Ot=!0,Gt.reset()}function i(t){t.preventDefault(),n(),r(),zt.clear()}function o(t){var e=t.target;e.removeEventListener("dispose",o),u(e),jt.textures--}function s(t){var e=t.target;e.removeEventListener("dispose",s),h(e),jt.textures--}function c(t){var e=t.target;e.removeEventListener("dispose",c),l(e)}function u(t){var e=zt.get(t);if(t.image&&e.__image__webglTextureCube)Bt.deleteTexture(e.__image__webglTextureCube);else{if(void 0===e.__webglInit)return;Bt.deleteTexture(e.__webglTexture)}zt.delete(t)}function h(t){var e=zt.get(t),r=zt.get(t.texture);if(t&&void 0!==r.__webglTexture){if(Bt.deleteTexture(r.__webglTexture),t instanceof a.WebGLRenderTargetCube)for(var n=0;n<6;n++)Bt.deleteFramebuffer(e.__webglFramebuffer[n]),Bt.deleteRenderbuffer(e.__webglRenderbuffer[n]);else Bt.deleteFramebuffer(e.__webglFramebuffer),Bt.deleteRenderbuffer(e.__webglRenderbuffer);zt.delete(t.texture),zt.delete(t)}}function l(t){f(t),zt.delete(t)}function f(t){var e=zt.get(t).program;t.program=void 0,void 0!==e&&Wt.releaseProgram(e)}function p(t,e,r,n){var i;if(r instanceof a.InstancedBufferGeometry&&(i=It.get("ANGLE_instanced_arrays"),null===i))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");void 0===n&&(n=0),Gt.initAttributes();var o=r.attributes,s=e.getAttributes(),c=t.defaultAttributeValues;for(var u in s){var h=s[u];if(h>=0){var l=o[u];if(void 0!==l){var f=l.itemSize,p=Ht.getAttributeBuffer(l);if(l instanceof a.InterleavedBufferAttribute){var d=l.data,m=d.stride,g=l.offset;d instanceof a.InstancedInterleavedBuffer?(Gt.enableAttributeAndDivisor(h,d.meshPerAttribute,i),void 0===r.maxInstancedCount&&(r.maxInstancedCount=d.meshPerAttribute*d.count)):Gt.enableAttribute(h),Bt.bindBuffer(Bt.ARRAY_BUFFER,p),Bt.vertexAttribPointer(h,f,Bt.FLOAT,!1,m*d.array.BYTES_PER_ELEMENT,(n*m+g)*d.array.BYTES_PER_ELEMENT)}else l instanceof a.InstancedBufferAttribute?(Gt.enableAttributeAndDivisor(h,l.meshPerAttribute,i),void 0===r.maxInstancedCount&&(r.maxInstancedCount=l.meshPerAttribute*l.count)):Gt.enableAttribute(h),Bt.bindBuffer(Bt.ARRAY_BUFFER,p),Bt.vertexAttribPointer(h,f,Bt.FLOAT,!1,0,n*f*4)}else if(void 0!==c){var v=c[u];if(void 0!==v)switch(v.length){case 2:Bt.vertexAttrib2fv(h,v);break;case 3:Bt.vertexAttrib3fv(h,v);break;case 4:Bt.vertexAttrib4fv(h,v);break;default:Bt.vertexAttrib1fv(h,v)}}}}Gt.disableUnusedAttributes()}function d(t,e){return e[0]-t[0]}function m(t,e){return t.object.renderOrder!==e.object.renderOrder?t.object.renderOrder-e.object.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function g(t,e){return t.object.renderOrder!==e.object.renderOrder?t.object.renderOrder-e.object.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function v(t,e,r,n,i){var o,a;r.transparent?(o=pt,a=++dt):(o=lt,a=++ft);var s=o[a];void 0!==s?(s.id=t.id,s.object=t,s.geometry=e,s.material=r,s.z=Rt.z,s.group=i):(s={id:t.id,object:t,geometry:e,material:r,z:Rt.z,group:i},o.push(s))}function y(t,e){if(t.visible!==!1){if(0!==(t.channels.mask&e.channels.mask))if(t instanceof a.Light)ht.push(t);else if(t instanceof a.Sprite)gt.push(t);else if(t instanceof a.LensFlare)vt.push(t);else if(t instanceof a.ImmediateRenderObject)yt.sortObjects===!0&&(Rt.setFromMatrixPosition(t.matrixWorld),Rt.applyProjection(Pt)),v(t,null,t.material,Rt.z,null);else if((t instanceof a.Mesh||t instanceof a.Line||t instanceof a.Points)&&(t instanceof a.SkinnedMesh&&t.skeleton.update(),t.frustumCulled===!1||Ft.intersectsObject(t)===!0)){var r=t.material;if(r.visible===!0){yt.sortObjects===!0&&(Rt.setFromMatrixPosition(t.matrixWorld),Rt.applyProjection(Pt));var n=Ht.update(t);if(r instanceof a.MeshFaceMaterial)for(var i=n.groups,o=r.materials,s=0,c=i.length;s=0&&t.numSupportedMorphTargets++}if(t.morphNormals)for(t.numSupportedMorphNormals=0,d=0;d=0&&t.numSupportedMorphNormals++;i.uniformsList=[];var m=i.program.getUniforms();for(var g in i.__webglShader.uniforms){var v=m[g];v&&i.uniformsList.push([i.__webglShader.uniforms[g],v])}}function w(t){_(t),t.transparent===!0?Gt.setBlending(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha):Gt.setBlending(a.NoBlending),Gt.setDepthFunc(t.depthFunc),Gt.setDepthTest(t.depthTest),Gt.setDepthWrite(t.depthWrite),Gt.setColorWrite(t.colorWrite),Gt.setPolygonOffset(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)}function _(t){t.side!==a.DoubleSide?Gt.enable(Bt.CULL_FACE):Gt.disable(Bt.CULL_FACE),Gt.setFlipSided(t.side===a.BackSide)}function S(t,e,r,n,i){Mt=0;var o=zt.get(n);!n.needsUpdate&&o.program||(x(n,e,r,i),n.needsUpdate=!1);var s=!1,c=!1,u=!1,h=o.program,l=h.getUniforms(),f=o.__webglShader.uniforms;if(h.id!==bt&&(Bt.useProgram(h.program),bt=h.id,s=!0,c=!0,u=!0),n.id!==wt&&(wt===-1&&(u=!0),wt=n.id,c=!0),(s||t!==St)&&(Bt.uniformMatrix4fv(l.projectionMatrix,!1,t.projectionMatrix.elements),Vt.logarithmicDepthBuffer&&Bt.uniform1f(l.logDepthBufFC,2/(Math.log(t.far+1)/Math.LN2)),t!==St&&(St=t),(n instanceof a.ShaderMaterial||n instanceof a.MeshPhongMaterial||n.envMap)&&void 0!==l.cameraPosition&&(Rt.setFromMatrixPosition(t.matrixWorld),Bt.uniform3f(l.cameraPosition,Rt.x,Rt.y,Rt.z)),(n instanceof a.MeshPhongMaterial||n instanceof a.MeshLambertMaterial||n instanceof a.MeshBasicMaterial||n instanceof a.ShaderMaterial||n.skinning)&&void 0!==l.viewMatrix&&Bt.uniformMatrix4fv(l.viewMatrix,!1,t.matrixWorldInverse.elements)),n.skinning)if(i.bindMatrix&&void 0!==l.bindMatrix&&Bt.uniformMatrix4fv(l.bindMatrix,!1,i.bindMatrix.elements),i.bindMatrixInverse&&void 0!==l.bindMatrixInverse&&Bt.uniformMatrix4fv(l.bindMatrixInverse,!1,i.bindMatrixInverse.elements),Vt.floatVertexTextures&&i.skeleton&&i.skeleton.useVertexTexture){if(void 0!==l.boneTexture){var p=D();Bt.uniform1i(l.boneTexture,p),yt.setTexture(i.skeleton.boneTexture,p)}void 0!==l.boneTextureWidth&&Bt.uniform1i(l.boneTextureWidth,i.skeleton.boneTextureWidth),void 0!==l.boneTextureHeight&&Bt.uniform1i(l.boneTextureHeight,i.skeleton.boneTextureHeight)}else i.skeleton&&i.skeleton.boneMatrices&&void 0!==l.boneGlobalMatrices&&Bt.uniformMatrix4fv(l.boneGlobalMatrices,!1,i.skeleton.boneMatrices);return c&&(r&&n.fog&&C(f,r),(n instanceof a.MeshPhongMaterial||n instanceof a.MeshLambertMaterial||n.lights)&&(Ot&&(u=!0,j(e,t),Ot=!1),u?(k(f,$t),F(f,!0)):F(f,!1)),(n instanceof a.MeshBasicMaterial||n instanceof a.MeshLambertMaterial||n instanceof a.MeshPhongMaterial)&&M(f,n),n instanceof a.LineBasicMaterial?E(f,n):n instanceof a.LineDashedMaterial?(E(f,n),T(f,n)):n instanceof a.PointsMaterial?A(f,n):n instanceof a.MeshPhongMaterial?L(f,n):n instanceof a.MeshDepthMaterial?(f.mNear.value=t.near,f.mFar.value=t.far,f.opacity.value=n.opacity):n instanceof a.MeshNormalMaterial&&(f.opacity.value=n.opacity),i.receiveShadow&&!n._shadowPass&&P(f,e,t),O(o.uniformsList)),R(l,i),void 0!==l.modelMatrix&&Bt.uniformMatrix4fv(l.modelMatrix,!1,i.matrixWorld.elements),h}function M(t,e){t.opacity.value=e.opacity,t.diffuse.value=e.color,e.emissive&&(t.emissive.value=e.emissive),t.map.value=e.map,t.specularMap.value=e.specularMap,t.alphaMap.value=e.alphaMap,e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity);var r;if(e.map?r=e.map:e.specularMap?r=e.specularMap:e.displacementMap?r=e.displacementMap:e.normalMap?r=e.normalMap:e.bumpMap?r=e.bumpMap:e.alphaMap?r=e.alphaMap:e.emissiveMap&&(r=e.emissiveMap),void 0!==r){r instanceof a.WebGLRenderTarget&&(r=r.texture);var n=r.offset,i=r.repeat;t.offsetRepeat.value.set(n.x,n.y,i.x,i.y)}t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap instanceof a.WebGLRenderTargetCube?1:-1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio}function E(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity}function T(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}function A(t,e){if(t.psColor.value=e.color,t.opacity.value=e.opacity,t.size.value=e.size,t.scale.value=Q.height/2,t.map.value=e.map,null!==e.map){var r=e.map.offset,n=e.map.repeat;t.offsetRepeat.value.set(r.x,r.y,n.x,n.y)}}function C(t,e){t.fogColor.value=e.color,e instanceof a.Fog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e instanceof a.FogExp2&&(t.fogDensity.value=e.density)}function L(t,e){t.specular.value=e.specular,t.shininess.value=Math.max(e.shininess,1e-4),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function k(t,e){t.ambientLightColor.value=e.ambient,t.directionalLightColor.value=e.directional.colors,t.directionalLightDirection.value=e.directional.positions,t.pointLightColor.value=e.point.colors,t.pointLightPosition.value=e.point.positions,t.pointLightDistance.value=e.point.distances,t.pointLightDecay.value=e.point.decays,t.spotLightColor.value=e.spot.colors,t.spotLightPosition.value=e.spot.positions,t.spotLightDistance.value=e.spot.distances,t.spotLightDirection.value=e.spot.directions,t.spotLightAngleCos.value=e.spot.anglesCos,t.spotLightExponent.value=e.spot.exponents,t.spotLightDecay.value=e.spot.decays,t.hemisphereLightSkyColor.value=e.hemi.skyColors,t.hemisphereLightGroundColor.value=e.hemi.groundColors,t.hemisphereLightDirection.value=e.hemi.positions}function F(t,e){t.ambientLightColor.needsUpdate=e,t.directionalLightColor.needsUpdate=e,t.directionalLightDirection.needsUpdate=e,t.pointLightColor.needsUpdate=e,t.pointLightPosition.needsUpdate=e,t.pointLightDistance.needsUpdate=e,t.pointLightDecay.needsUpdate=e,t.spotLightColor.needsUpdate=e,t.spotLightPosition.needsUpdate=e,
+t.spotLightDistance.needsUpdate=e,t.spotLightDirection.needsUpdate=e,t.spotLightAngleCos.needsUpdate=e,t.spotLightExponent.needsUpdate=e,t.spotLightDecay.needsUpdate=e,t.hemisphereLightSkyColor.needsUpdate=e,t.hemisphereLightGroundColor.needsUpdate=e,t.hemisphereLightDirection.needsUpdate=e}function P(t,e,r){if(t.shadowMatrix)for(var n=0,i=0,o=e.length;i=Vt.maxTextures&&console.warn("WebGLRenderer: trying to use "+t+" texture units while this GPU supports only "+Vt.maxTextures),Mt+=1,t}function O(t){for(var e,r,n=0,i=t.length;n1||zt.get(e).__currentAnisotropy)&&(Bt.texParameterf(t,n.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(e.anisotropy,yt.getMaxAnisotropy())),zt.get(e).__currentAnisotropy=e.anisotropy)}}function B(t,e,r){void 0===t.__webglInit&&(t.__webglInit=!0,e.addEventListener("dispose",o),t.__webglTexture=Bt.createTexture(),jt.textures++),Gt.activeTexture(Bt.TEXTURE0+r),Gt.bindTexture(Bt.TEXTURE_2D,t.__webglTexture),Bt.pixelStorei(Bt.UNPACK_FLIP_Y_WEBGL,e.flipY),Bt.pixelStorei(Bt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),Bt.pixelStorei(Bt.UNPACK_ALIGNMENT,e.unpackAlignment),e.image=N(e.image,Vt.maxTextureSize),V(e)&&I(e.image)===!1&&(e.image=G(e.image));var n=e.image,i=I(n),s=Y(e.format),c=Y(e.type);U(Bt.TEXTURE_2D,e,i);var u,h=e.mipmaps;if(e instanceof a.DataTexture)if(h.length>0&&i){for(var l=0,f=h.length;l-1?Gt.compressedTexImage2D(Bt.TEXTURE_2D,l,s,u.width,u.height,0,u.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Gt.texImage2D(Bt.TEXTURE_2D,l,s,u.width,u.height,0,s,c,u.data);else if(h.length>0&&i){for(var l=0,f=h.length;le||t.height>e){var r=e/Math.max(t.width,t.height),n=document.createElement("canvas");n.width=Math.floor(t.width*r),n.height=Math.floor(t.height*r);var i=n.getContext("2d");return i.drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height),console.warn("THREE.WebGLRenderer: image is too big ("+t.width+"x"+t.height+"). Resized to "+n.width+"x"+n.height,t),n}return t}function I(t){return a.Math.isPowerOfTwo(t.width)&&a.Math.isPowerOfTwo(t.height)}function V(t){return t.wrapS!==a.ClampToEdgeWrapping||t.wrapT!==a.ClampToEdgeWrapping||t.minFilter!==a.NearestFilter&&t.minFilter!==a.LinearFilter}function G(t){if(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement){var e=document.createElement("canvas");e.width=a.Math.nearestPowerOfTwo(t.width),e.height=a.Math.nearestPowerOfTwo(t.height);var r=e.getContext("2d");return r.drawImage(t,0,0,e.width,e.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+t.width+"x"+t.height+"). Resized to "+e.width+"x"+e.height,t),e}return t}function z(t,e){var r=zt.get(t);if(6===t.image.length)if(t.version>0&&r.__version!==t.version){r.__image__webglTextureCube||(t.addEventListener("dispose",o),r.__image__webglTextureCube=Bt.createTexture(),jt.textures++),Gt.activeTexture(Bt.TEXTURE0+e),Gt.bindTexture(Bt.TEXTURE_CUBE_MAP,r.__image__webglTextureCube),Bt.pixelStorei(Bt.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var n=t instanceof a.CompressedTexture,i=t.image[0]instanceof a.DataTexture,s=[],c=0;c<6;c++)!yt.autoScaleCubemaps||n||i?s[c]=i?t.image[c].image:t.image[c]:s[c]=N(t.image[c],Vt.maxCubemapSize);var u=s[0],h=I(u),l=Y(t.format),f=Y(t.type);U(Bt.TEXTURE_CUBE_MAP,t,h);for(var c=0;c<6;c++)if(n)for(var p,d=s[c].mipmaps,m=0,g=d.length;m-1?Gt.compressedTexImage2D(Bt.TEXTURE_CUBE_MAP_POSITIVE_X+c,m,l,p.width,p.height,0,p.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):Gt.texImage2D(Bt.TEXTURE_CUBE_MAP_POSITIVE_X+c,m,l,p.width,p.height,0,l,f,p.data);else i?Gt.texImage2D(Bt.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,l,s[c].width,s[c].height,0,l,f,s[c].data):Gt.texImage2D(Bt.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,l,l,f,s[c]);t.generateMipmaps&&h&&Bt.generateMipmap(Bt.TEXTURE_CUBE_MAP),r.__version=t.version,t.onUpdate&&t.onUpdate(t)}else Gt.activeTexture(Bt.TEXTURE0+e),Gt.bindTexture(Bt.TEXTURE_CUBE_MAP,r.__image__webglTextureCube)}function H(t,e){Gt.activeTexture(Bt.TEXTURE0+e),Gt.bindTexture(Bt.TEXTURE_CUBE_MAP,zt.get(t).__webglTexture)}function W(t,e,r){Bt.bindFramebuffer(Bt.FRAMEBUFFER,t),Bt.framebufferTexture2D(Bt.FRAMEBUFFER,Bt.COLOR_ATTACHMENT0,r,zt.get(e.texture).__webglTexture,0)}function q(t,e){Bt.bindRenderbuffer(Bt.RENDERBUFFER,t),e.depthBuffer&&!e.stencilBuffer?(Bt.renderbufferStorage(Bt.RENDERBUFFER,Bt.DEPTH_COMPONENT16,e.width,e.height),Bt.framebufferRenderbuffer(Bt.FRAMEBUFFER,Bt.DEPTH_ATTACHMENT,Bt.RENDERBUFFER,t)):e.depthBuffer&&e.stencilBuffer?(Bt.renderbufferStorage(Bt.RENDERBUFFER,Bt.DEPTH_STENCIL,e.width,e.height),Bt.framebufferRenderbuffer(Bt.FRAMEBUFFER,Bt.DEPTH_STENCIL_ATTACHMENT,Bt.RENDERBUFFER,t)):Bt.renderbufferStorage(Bt.RENDERBUFFER,Bt.RGBA4,e.width,e.height)}function X(t){var e=t instanceof a.WebGLRenderTargetCube?Bt.TEXTURE_CUBE_MAP:Bt.TEXTURE_2D,r=zt.get(t.texture).__webglTexture;Gt.bindTexture(e,r),Bt.generateMipmap(e),Gt.bindTexture(e,null)}function K(t){return t===a.NearestFilter||t===a.NearestMipMapNearestFilter||t===a.NearestMipMapLinearFilter?Bt.NEAREST:Bt.LINEAR}function Y(t){var e;if(t===a.RepeatWrapping)return Bt.REPEAT;if(t===a.ClampToEdgeWrapping)return Bt.CLAMP_TO_EDGE;if(t===a.MirroredRepeatWrapping)return Bt.MIRRORED_REPEAT;if(t===a.NearestFilter)return Bt.NEAREST;if(t===a.NearestMipMapNearestFilter)return Bt.NEAREST_MIPMAP_NEAREST;if(t===a.NearestMipMapLinearFilter)return Bt.NEAREST_MIPMAP_LINEAR;if(t===a.LinearFilter)return Bt.LINEAR;if(t===a.LinearMipMapNearestFilter)return Bt.LINEAR_MIPMAP_NEAREST;if(t===a.LinearMipMapLinearFilter)return Bt.LINEAR_MIPMAP_LINEAR;if(t===a.UnsignedByteType)return Bt.UNSIGNED_BYTE;if(t===a.UnsignedShort4444Type)return Bt.UNSIGNED_SHORT_4_4_4_4;if(t===a.UnsignedShort5551Type)return Bt.UNSIGNED_SHORT_5_5_5_1;if(t===a.UnsignedShort565Type)return Bt.UNSIGNED_SHORT_5_6_5;if(t===a.ByteType)return Bt.BYTE;if(t===a.ShortType)return Bt.SHORT;if(t===a.UnsignedShortType)return Bt.UNSIGNED_SHORT;if(t===a.IntType)return Bt.INT;if(t===a.UnsignedIntType)return Bt.UNSIGNED_INT;if(t===a.FloatType)return Bt.FLOAT;if(e=It.get("OES_texture_half_float"),null!==e&&t===a.HalfFloatType)return e.HALF_FLOAT_OES;if(t===a.AlphaFormat)return Bt.ALPHA;if(t===a.RGBFormat)return Bt.RGB;if(t===a.RGBAFormat)return Bt.RGBA;if(t===a.LuminanceFormat)return Bt.LUMINANCE;if(t===a.LuminanceAlphaFormat)return Bt.LUMINANCE_ALPHA;if(t===a.AddEquation)return Bt.FUNC_ADD;if(t===a.SubtractEquation)return Bt.FUNC_SUBTRACT;if(t===a.ReverseSubtractEquation)return Bt.FUNC_REVERSE_SUBTRACT;if(t===a.ZeroFactor)return Bt.ZERO;if(t===a.OneFactor)return Bt.ONE;if(t===a.SrcColorFactor)return Bt.SRC_COLOR;if(t===a.OneMinusSrcColorFactor)return Bt.ONE_MINUS_SRC_COLOR;if(t===a.SrcAlphaFactor)return Bt.SRC_ALPHA;if(t===a.OneMinusSrcAlphaFactor)return Bt.ONE_MINUS_SRC_ALPHA;if(t===a.DstAlphaFactor)return Bt.DST_ALPHA;if(t===a.OneMinusDstAlphaFactor)return Bt.ONE_MINUS_DST_ALPHA;if(t===a.DstColorFactor)return Bt.DST_COLOR;if(t===a.OneMinusDstColorFactor)return Bt.ONE_MINUS_DST_COLOR;if(t===a.SrcAlphaSaturateFactor)return Bt.SRC_ALPHA_SATURATE;if(e=It.get("WEBGL_compressed_texture_s3tc"),null!==e){if(t===a.RGB_S3TC_DXT1_Format)return e.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===a.RGBA_S3TC_DXT1_Format)return e.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===a.RGBA_S3TC_DXT3_Format)return e.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===a.RGBA_S3TC_DXT5_Format)return e.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e=It.get("WEBGL_compressed_texture_pvrtc"),null!==e){if(t===a.RGB_PVRTC_4BPPV1_Format)return e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===a.RGB_PVRTC_2BPPV1_Format)return e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===a.RGBA_PVRTC_4BPPV1_Format)return e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===a.RGBA_PVRTC_2BPPV1_Format)return e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e=It.get("EXT_blend_minmax"),null!==e){if(t===a.MinEquation)return e.MIN_EXT;if(t===a.MaxEquation)return e.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",a.REVISION),t=t||{};var Q=void 0!==t.canvas?t.canvas:document.createElement("canvas"),Z=void 0!==t.context?t.context:null,J=Q.width,tt=Q.height,et=1,rt=void 0!==t.alpha&&t.alpha,nt=void 0===t.depth||t.depth,it=void 0===t.stencil||t.stencil,ot=void 0!==t.antialias&&t.antialias,at=void 0===t.premultipliedAlpha||t.premultipliedAlpha,st=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,ct=new a.Color(0),ut=0,ht=[],lt=[],ft=-1,pt=[],dt=-1,mt=new Float32Array(8),gt=[],vt=[];this.domElement=Q,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.maxMorphTargets=8,this.maxMorphNormals=4,this.autoScaleCubemaps=!0;var yt=this,bt=null,xt=null,wt=-1,_t="",St=null,Mt=0,Et=0,Tt=0,At=Q.width,Ct=Q.height,Lt=0,kt=0,Ft=new a.Frustum,Pt=new a.Matrix4,Rt=new a.Vector3,Dt=new a.Vector3,Ot=!0,$t={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}},jt={geometries:0,textures:0},Ut={calls:0,vertices:0,faces:0,points:0};this.info={render:Ut,memory:jt,programs:null};var Bt;try{var Nt={alpha:rt,depth:nt,stencil:it,antialias:ot,premultipliedAlpha:at,preserveDrawingBuffer:st};if(Bt=Z||Q.getContext("webgl",Nt)||Q.getContext("experimental-webgl",Nt),null===Bt)throw null!==Q.getContext("webgl")?"Error creating WebGL context with your selected attributes.":"Error creating WebGL context.";Q.addEventListener("webglcontextlost",i,!1)}catch(t){console.error("THREE.WebGLRenderer: "+t)}var It=new a.WebGLExtensions(Bt);It.get("OES_texture_float"),It.get("OES_texture_float_linear"),It.get("OES_texture_half_float"),It.get("OES_texture_half_float_linear"),It.get("OES_standard_derivatives"),It.get("ANGLE_instanced_arrays"),It.get("OES_element_index_uint")&&(a.BufferGeometry.MaxIndex=4294967296);var Vt=new a.WebGLCapabilities(Bt,It,t),Gt=new a.WebGLState(Bt,It,Y),zt=new a.WebGLProperties,Ht=new a.WebGLObjects(Bt,zt,this.info),Wt=new a.WebGLPrograms(this,Vt);this.info.programs=Wt.programs;var qt=new a.WebGLBufferRenderer(Bt,It,Ut),Xt=new a.WebGLIndexedBufferRenderer(Bt,It,Ut);r(),this.context=Bt,this.capabilities=Vt,this.extensions=It,this.state=Gt;var Kt=new a.WebGLShadowMap(this,ht,Ht);this.shadowMap=Kt;var Yt=new a.SpritePlugin(this,gt),Qt=new a.LensFlarePlugin(this,vt);this.getContext=function(){return Bt},this.getContextAttributes=function(){return Bt.getContextAttributes()},this.forceContextLoss=function(){It.get("WEBGL_lose_context").loseContext()},this.getMaxAnisotropy=function(){var t;return function(){if(void 0!==t)return t;var e=It.get("EXT_texture_filter_anisotropic");return t=null!==e?Bt.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}(),this.getPrecision=function(){return Vt.precision},this.getPixelRatio=function(){return et},this.setPixelRatio=function(t){void 0!==t&&(et=t)},this.getSize=function(){return{width:J,height:tt}},this.setSize=function(t,e,r){J=t,tt=e,Q.width=t*et,Q.height=e*et,r!==!1&&(Q.style.width=t+"px",Q.style.height=e+"px"),this.setViewport(0,0,t,e)},this.setViewport=function(t,e,r,n){Et=t*et,Tt=e*et,At=r*et,Ct=n*et,Bt.viewport(Et,Tt,At,Ct)},this.getViewport=function(t){t.x=Et/et,t.y=Tt/et,t.z=At/et,t.w=Ct/et},this.setScissor=function(t,e,r,n){Bt.scissor(t*et,e*et,r*et,n*et)},this.enableScissorTest=function(t){Gt.setScissorTest(t)},this.getClearColor=function(){return ct},this.setClearColor=function(t,r){ct.set(t),ut=void 0!==r?r:1,e(ct.r,ct.g,ct.b,ut)},this.getClearAlpha=function(){return ut},this.setClearAlpha=function(t){ut=t,e(ct.r,ct.g,ct.b,ut)},this.clear=function(t,e,r){var n=0;(void 0===t||t)&&(n|=Bt.COLOR_BUFFER_BIT),(void 0===e||e)&&(n|=Bt.DEPTH_BUFFER_BIT),(void 0===r||r)&&(n|=Bt.STENCIL_BUFFER_BIT),Bt.clear(n)},this.clearColor=function(){Bt.clear(Bt.COLOR_BUFFER_BIT)},this.clearDepth=function(){Bt.clear(Bt.DEPTH_BUFFER_BIT)},this.clearStencil=function(){Bt.clear(Bt.STENCIL_BUFFER_BIT)},this.clearTarget=function(t,e,r,n){this.setRenderTarget(t),this.clear(e,r,n)},this.resetGLState=n,this.dispose=function(){Q.removeEventListener("webglcontextlost",i,!1)},this.renderBufferImmediate=function(t,e,r){Gt.initAttributes();var n=zt.get(t);t.hasPositions&&!n.position&&(n.position=Bt.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=Bt.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=Bt.createBuffer()),t.hasColors&&!n.color&&(n.color=Bt.createBuffer());var i=e.getAttributes();if(t.hasPositions&&(Bt.bindBuffer(Bt.ARRAY_BUFFER,n.position),Bt.bufferData(Bt.ARRAY_BUFFER,t.positionArray,Bt.DYNAMIC_DRAW),Gt.enableAttribute(i.position),Bt.vertexAttribPointer(i.position,3,Bt.FLOAT,!1,0,0)),t.hasNormals){if(Bt.bindBuffer(Bt.ARRAY_BUFFER,n.normal),"MeshPhongMaterial"!==r.type&&r.shading===a.FlatShading)for(var o=0,s=3*t.count;o8&&(f.length=8);for(var y=n.morphAttributes,m=0,g=f.length;m0?M.renderInstances(n):M.render(F,R);else if(o instanceof a.Line){var D=i.linewidth;void 0===D&&(D=1),Gt.setLineWidth(D*et),o instanceof a.LineSegments?M.setMode(Bt.LINES):M.setMode(Bt.LINE_STRIP),M.render(F,R)}else o instanceof a.Points&&(M.setMode(Bt.POINTS),M.render(F,R))},this.render=function(t,e,r,n){if(e instanceof a.Camera==!1)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");var i=t.fog;if(_t="",wt=-1,St=null,Ot=!0,t.autoUpdate===!0&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),e.matrixWorldInverse.getInverse(e.matrixWorld),Pt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),Ft.setFromMatrix(Pt),ht.length=0,ft=-1,dt=-1,gt.length=0,vt.length=0,y(t,e),lt.length=ft+1,pt.length=dt+1,yt.sortObjects===!0&&(lt.sort(m),pt.sort(g)),Kt.render(t),Ut.calls=0,Ut.vertices=0,Ut.faces=0,Ut.points=0,this.setRenderTarget(r),(this.autoClear||n)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),t.overrideMaterial){var o=t.overrideMaterial;b(lt,e,ht,i,o),b(pt,e,ht,i,o)}else Gt.setBlending(a.NoBlending),b(lt,e,ht,i),b(pt,e,ht,i);if(Yt.render(t,e),Qt.render(t,e,Lt,kt),r){var s=r.texture,c=I(r);s.generateMipmaps&&c&&s.minFilter!==a.NearestFilter&&s.minFilter!==a.LinearFilter&&X(r)}Gt.setDepthTest(!0),Gt.setDepthWrite(!0),Gt.setColorWrite(!0)},this.setFaceCulling=function(t,e){t===a.CullFaceNone?Gt.disable(Bt.CULL_FACE):(e===a.FrontFaceDirectionCW?Bt.frontFace(Bt.CW):Bt.frontFace(Bt.CCW),t===a.CullFaceBack?Bt.cullFace(Bt.BACK):t===a.CullFaceFront?Bt.cullFace(Bt.FRONT):Bt.cullFace(Bt.FRONT_AND_BACK),Gt.enable(Bt.CULL_FACE))},this.setTexture=function(t,e){var r=zt.get(t);if(t.version>0&&r.__version!==t.version){var n=t.image;return void 0===n?void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",t):n.complete===!1?void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",t):void B(r,t,e)}Gt.activeTexture(Bt.TEXTURE0+e),Gt.bindTexture(Bt.TEXTURE_2D,r.__webglTexture)},this.setRenderTarget=function(t){var e=t instanceof a.WebGLRenderTargetCube;if(t&&void 0===zt.get(t).__webglFramebuffer){var r=zt.get(t),n=zt.get(t.texture);void 0===t.depthBuffer&&(t.depthBuffer=!0),void 0===t.stencilBuffer&&(t.stencilBuffer=!0),t.addEventListener("dispose",s),n.__webglTexture=Bt.createTexture(),jt.textures++;var i=I(t),o=Y(t.texture.format),c=Y(t.texture.type);if(e){r.__webglFramebuffer=[],r.__webglRenderbuffer=[],Gt.bindTexture(Bt.TEXTURE_CUBE_MAP,n.__webglTexture),U(Bt.TEXTURE_CUBE_MAP,t.texture,i);for(var u=0;u<6;u++)r.__webglFramebuffer[u]=Bt.createFramebuffer(),r.__webglRenderbuffer[u]=Bt.createRenderbuffer(),Gt.texImage2D(Bt.TEXTURE_CUBE_MAP_POSITIVE_X+u,0,o,t.width,t.height,0,o,c,null),W(r.__webglFramebuffer[u],t,Bt.TEXTURE_CUBE_MAP_POSITIVE_X+u),q(r.__webglRenderbuffer[u],t);t.texture.generateMipmaps&&i&&Bt.generateMipmap(Bt.TEXTURE_CUBE_MAP)}else r.__webglFramebuffer=Bt.createFramebuffer(),t.shareDepthFrom?r.__webglRenderbuffer=t.shareDepthFrom.__webglRenderbuffer:r.__webglRenderbuffer=Bt.createRenderbuffer(),Gt.bindTexture(Bt.TEXTURE_2D,n.__webglTexture),U(Bt.TEXTURE_2D,t.texture,i),Gt.texImage2D(Bt.TEXTURE_2D,0,o,t.width,t.height,0,o,c,null),W(r.__webglFramebuffer,t,Bt.TEXTURE_2D),t.shareDepthFrom?t.depthBuffer&&!t.stencilBuffer?Bt.framebufferRenderbuffer(Bt.FRAMEBUFFER,Bt.DEPTH_ATTACHMENT,Bt.RENDERBUFFER,r.__webglRenderbuffer):t.depthBuffer&&t.stencilBuffer&&Bt.framebufferRenderbuffer(Bt.FRAMEBUFFER,Bt.DEPTH_STENCIL_ATTACHMENT,Bt.RENDERBUFFER,r.__webglRenderbuffer):q(r.__webglRenderbuffer,t),t.texture.generateMipmaps&&i&&Bt.generateMipmap(Bt.TEXTURE_2D);e?Gt.bindTexture(Bt.TEXTURE_CUBE_MAP,null):Gt.bindTexture(Bt.TEXTURE_2D,null),Bt.bindRenderbuffer(Bt.RENDERBUFFER,null),Bt.bindFramebuffer(Bt.FRAMEBUFFER,null)}var h,l,f,p,d;if(t){var r=zt.get(t);h=e?r.__webglFramebuffer[t.activeCubeFace]:r.__webglFramebuffer,l=t.width,f=t.height,p=0,d=0}else h=null,l=At,f=Ct,p=Et,d=Tt;if(h!==xt&&(Bt.bindFramebuffer(Bt.FRAMEBUFFER,h),Bt.viewport(p,d,l,f),xt=h),e){var n=zt.get(t.texture);Bt.framebufferTexture2D(Bt.FRAMEBUFFER,Bt.COLOR_ATTACHMENT0,Bt.TEXTURE_CUBE_MAP_POSITIVE_X+t.activeCubeFace,n.__webglTexture,0)}Lt=l,kt=f},this.readRenderTargetPixels=function(t,e,r,n,i,o){if(t instanceof a.WebGLRenderTarget==!1)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");var s=zt.get(t).__webglFramebuffer;if(s){var c=!1;s!==xt&&(Bt.bindFramebuffer(Bt.FRAMEBUFFER,s),c=!0);try{var u=t.texture;if(u.format!==a.RGBAFormat&&Y(u.format)!==Bt.getParameter(Bt.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(u.type===a.UnsignedByteType||Y(u.type)===Bt.getParameter(Bt.IMPLEMENTATION_COLOR_READ_TYPE)||u.type===a.FloatType&&It.get("WEBGL_color_buffer_float")||u.type===a.HalfFloatType&&It.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");Bt.checkFramebufferStatus(Bt.FRAMEBUFFER)===Bt.FRAMEBUFFER_COMPLETE?Bt.readPixels(e,r,n,i,Y(u.format),Y(u.type),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{c&&Bt.bindFramebuffer(Bt.FRAMEBUFFER,xt)}}},this.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),It.get("OES_texture_float")},this.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),It.get("OES_texture_half_float")},this.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),It.get("OES_standard_derivatives")},this.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),It.get("WEBGL_compressed_texture_s3tc")},this.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),It.get("WEBGL_compressed_texture_pvrtc")},this.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),It.get("EXT_blend_minmax")},this.supportsVertexTextures=function(){return Vt.vertexTextures},this.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),It.get("ANGLE_instanced_arrays")},this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},this.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},this.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},Object.defineProperties(this,{shadowMapEnabled:{get:function(){return Kt.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),Kt.enabled=t}},shadowMapType:{get:function(){return Kt.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),Kt.type=t}},shadowMapCullFace:{get:function(){return Kt.cullFace},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),Kt.cullFace=t}},shadowMapDebug:{get:function(){return Kt.debug},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapDebug is now .shadowMap.debug."),Kt.debug=t}}})},a.WebGLRenderTarget=function(t,e,r){this.uuid=a.Math.generateUUID(),this.width=t,this.height=e,r=r||{},void 0===r.minFilter&&(r.minFilter=a.LinearFilter),this.texture=new a.Texture(void 0,void 0,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy),this.depthBuffer=void 0===r.depthBuffer||r.depthBuffer,this.stencilBuffer=void 0===r.stencilBuffer||r.stencilBuffer,this.shareDepthFrom=void 0!==r.shareDepthFrom?r.shareDepthFrom:null},a.WebGLRenderTarget.prototype={constructor:a.WebGLRenderTarget,get wrapS(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set wrapS(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t},get wrapT(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set wrapT(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t},get magFilter(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set magFilter(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t},get minFilter(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set minFilter(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t},get anisotropy(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set anisotropy(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
+this.texture.anisotropy=t},get offset(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set offset(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t},get repeat(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set repeat(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t},get format(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set format(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t},get type(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set type(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t},get generateMipmaps(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set generateMipmaps(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t},setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose())},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.shareDepthFrom=t.shareDepthFrom,this},dispose:function(){this.dispatchEvent({type:"dispose"})}},a.EventDispatcher.prototype.apply(a.WebGLRenderTarget.prototype),a.WebGLRenderTargetCube=function(t,e,r){a.WebGLRenderTarget.call(this,t,e,r),this.activeCubeFace=0},a.WebGLRenderTargetCube.prototype=Object.create(a.WebGLRenderTarget.prototype),a.WebGLRenderTargetCube.prototype.constructor=a.WebGLRenderTargetCube,a.WebGLBufferRenderer=function(t,e,r){function n(t){s=t}function i(e,n){t.drawArrays(s,e,n),r.calls++,r.vertices+=n,s===t.TRIANGLES&&(r.faces+=n/3)}function o(t){var r=e.get("ANGLE_instanced_arrays");if(null===r)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");var n=t.attributes.position;n instanceof a.InterleavedBufferAttribute?r.drawArraysInstancedANGLE(s,0,n.data.count,t.maxInstancedCount):r.drawArraysInstancedANGLE(s,0,n.count,t.maxInstancedCount)}var s;this.setMode=n,this.render=i,this.renderInstances=o},a.WebGLIndexedBufferRenderer=function(t,e,r){function n(t){s=t}function i(r){r.array instanceof Uint32Array&&e.get("OES_element_index_uint")?(c=t.UNSIGNED_INT,u=4):(c=t.UNSIGNED_SHORT,u=2)}function o(e,n){t.drawElements(s,n,c,e*u),r.calls++,r.vertices+=n,s===t.TRIANGLES&&(r.faces+=n/3)}function a(t){var r=e.get("ANGLE_instanced_arrays");if(null===r)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");var n=t.index;r.drawElementsInstancedANGLE(s,n.array.length,c,0,t.maxInstancedCount)}var s,c,u;this.setMode=n,this.setIndex=i,this.render=o,this.renderInstances=a},a.WebGLExtensions=function(t){var e={};this.get=function(r){if(void 0!==e[r])return e[r];var n;switch(r){case"EXT_texture_filter_anisotropic":n=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=t.getExtension(r)}return null===n&&console.warn("THREE.WebGLRenderer: "+r+" extension not supported."),e[r]=n,n}},a.WebGLCapabilities=function(t,e,r){function n(e){if("highp"===e){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}this.getMaxPrecision=n,this.precision=void 0!==r.precision?r.precision:"highp",this.logarithmicDepthBuffer=void 0!==r.logarithmicDepthBuffer&&r.logarithmicDepthBuffer,this.maxTextures=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),this.maxVertexTextures=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),this.maxCubemapSize=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),this.maxAttributes=t.getParameter(t.MAX_VERTEX_ATTRIBS),this.maxVertexUniforms=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),this.maxVaryings=t.getParameter(t.MAX_VARYING_VECTORS),this.maxFragmentUniforms=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),this.vertexTextures=this.maxVertexTextures>0,this.floatFragmentTextures=!!e.get("OES_texture_float"),this.floatVertexTextures=this.vertexTextures&&this.floatFragmentTextures;var i=n(this.precision);i!==this.precision&&(console.warn("THREE.WebGLRenderer:",this.precision,"not supported, using",i,"instead."),this.precision=i),this.logarithmicDepthBuffer&&(this.logarithmicDepthBuffer=!!e.get("EXT_frag_depth"))},a.WebGLGeometries=function(t,e,r){function n(t){var e=t.geometry;if(void 0!==h[e.id])return h[e.id];e.addEventListener("dispose",i);var n;return e instanceof a.BufferGeometry?n=e:e instanceof a.Geometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new a.BufferGeometry).setFromObject(t)),n=e._bufferGeometry),h[e.id]=n,r.memory.geometries++,n}function i(t){var n=t.target,o=h[n.id];c(o.attributes),n.removeEventListener("dispose",i),delete h[n.id];var a=e.get(n);a.wireframe&&s(a.wireframe),r.memory.geometries--}function o(t){return t instanceof a.InterleavedBufferAttribute?e.get(t.data).__webglBuffer:e.get(t).__webglBuffer}function s(e){var r=o(e);void 0!==r&&(t.deleteBuffer(r),u(e))}function c(t){for(var e in t)s(t[e])}function u(t){t instanceof a.InterleavedBufferAttribute?e.delete(t.data):e.delete(t)}var h={};this.get=n},a.WebGLObjects=function(t,e,r){function n(e){var r=l.get(e);e.geometry instanceof a.Geometry&&r.updateFromObject(e);var n=r.index,o=r.attributes;null!==n&&i(n,t.ELEMENT_ARRAY_BUFFER);for(var s in o)i(o[s],t.ARRAY_BUFFER);var c=r.morphAttributes;for(var s in c)for(var u=c[s],h=0,f=u.length;h65535?Uint32Array:Uint16Array,b=new a.BufferAttribute(new y(o),1);return i(b,t.ELEMENT_ARRAY_BUFFER),n.wireframe=b,b}function h(t,e,r){if(e>r){var n=e;e=r,r=n}var i=t[e];return void 0===i?(t[e]=[r],!0):i.indexOf(r)===-1&&(i.push(r),!0)}var l=new a.WebGLGeometries(t,e,r);this.getAttributeBuffer=c,this.getWireframeAttribute=u,this.update=n},a.WebGLProgram=function(){function t(t){var e=[];for(var r in t){var n=t[r];n!==!1&&e.push("#define "+r+" "+n)}return e.join("\n")}function e(t,e,r){for(var n={},i=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),o=0;o0?o.gammaFactor:1,w=t(l),_=h.createProgram();c instanceof a.RawShaderMaterial?(y="",b=""):(y=["precision "+u.precision+" float;","precision "+u.precision+" int;","#define SHADER_NAME "+c.__webglShader.name,w,u.supportsVertexTextures?"#define VERTEX_TEXTURES":"",o.gammaInput?"#define GAMMA_INPUT":"",o.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+x,"#define MAX_DIR_LIGHTS "+u.maxDirLights,"#define MAX_POINT_LIGHTS "+u.maxPointLights,"#define MAX_SPOT_LIGHTS "+u.maxSpotLights,"#define MAX_HEMI_LIGHTS "+u.maxHemiLights,"#define MAX_SHADOWS "+u.maxShadows,"#define MAX_BONES "+u.maxBones,u.map?"#define USE_MAP":"",u.envMap?"#define USE_ENVMAP":"",u.envMap?"#define "+g:"",u.lightMap?"#define USE_LIGHTMAP":"",u.aoMap?"#define USE_AOMAP":"",u.emissiveMap?"#define USE_EMISSIVEMAP":"",u.bumpMap?"#define USE_BUMPMAP":"",u.normalMap?"#define USE_NORMALMAP":"",u.displacementMap&&u.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",u.specularMap?"#define USE_SPECULARMAP":"",u.alphaMap?"#define USE_ALPHAMAP":"",u.vertexColors?"#define USE_COLOR":"",u.flatShading?"#define FLAT_SHADED":"",u.skinning?"#define USE_SKINNING":"",u.useVertexTexture?"#define BONE_TEXTURE":"",u.morphTargets?"#define USE_MORPHTARGETS":"",u.morphNormals&&u.flatShading===!1?"#define USE_MORPHNORMALS":"",u.doubleSided?"#define DOUBLE_SIDED":"",u.flipSided?"#define FLIP_SIDED":"",u.shadowMapEnabled?"#define USE_SHADOWMAP":"",u.shadowMapEnabled?"#define "+d:"",u.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",u.pointLightShadows>0?"#define POINT_LIGHT_SHADOWS":"",u.sizeAttenuation?"#define USE_SIZEATTENUATION":"",u.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",u.logarithmicDepthBuffer&&o.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(n).join("\n"),b=[u.bumpMap||u.normalMap||u.flatShading||c.derivatives?"#extension GL_OES_standard_derivatives : enable":"",u.logarithmicDepthBuffer&&o.extensions.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"","precision "+u.precision+" float;","precision "+u.precision+" int;","#define SHADER_NAME "+c.__webglShader.name,w,"#define MAX_DIR_LIGHTS "+u.maxDirLights,"#define MAX_POINT_LIGHTS "+u.maxPointLights,"#define MAX_SPOT_LIGHTS "+u.maxSpotLights,"#define MAX_HEMI_LIGHTS "+u.maxHemiLights,"#define MAX_SHADOWS "+u.maxShadows,u.alphaTest?"#define ALPHATEST "+u.alphaTest:"",o.gammaInput?"#define GAMMA_INPUT":"",o.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+x,u.useFog&&u.fog?"#define USE_FOG":"",u.useFog&&u.fogExp?"#define FOG_EXP2":"",u.map?"#define USE_MAP":"",u.envMap?"#define USE_ENVMAP":"",u.envMap?"#define "+m:"",u.envMap?"#define "+g:"",u.envMap?"#define "+v:"",u.lightMap?"#define USE_LIGHTMAP":"",u.aoMap?"#define USE_AOMAP":"",u.emissiveMap?"#define USE_EMISSIVEMAP":"",u.bumpMap?"#define USE_BUMPMAP":"",u.normalMap?"#define USE_NORMALMAP":"",u.specularMap?"#define USE_SPECULARMAP":"",u.alphaMap?"#define USE_ALPHAMAP":"",u.vertexColors?"#define USE_COLOR":"",u.flatShading?"#define FLAT_SHADED":"",u.metal?"#define METAL":"",u.doubleSided?"#define DOUBLE_SIDED":"",u.flipSided?"#define FLIP_SIDED":"",u.shadowMapEnabled?"#define USE_SHADOWMAP":"",u.shadowMapEnabled?"#define "+d:"",u.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",u.pointLightShadows>0?"#define POINT_LIGHT_SHADOWS":"",u.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",u.logarithmicDepthBuffer&&o.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","\n"].filter(n).join("\n"));var S=y+f,M=b+p,E=a.WebGLShader(h,h.VERTEX_SHADER,S),T=a.WebGLShader(h,h.FRAGMENT_SHADER,M);h.attachShader(_,E),h.attachShader(_,T),void 0!==c.index0AttributeName?h.bindAttribLocation(_,0,c.index0AttributeName):u.morphTargets===!0&&h.bindAttribLocation(_,0,"position"),h.linkProgram(_);var A=h.getProgramInfoLog(_),C=h.getShaderInfoLog(E),L=h.getShaderInfoLog(T),k=!0,F=!0;h.getProgramParameter(_,h.LINK_STATUS)===!1?(k=!1,console.error("THREE.WebGLProgram: shader error: ",h.getError(),"gl.VALIDATE_STATUS",h.getProgramParameter(_,h.VALIDATE_STATUS),"gl.getProgramInfoLog",A,C,L)):""!==A?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",A):""!==C&&""!==L||(F=!1),F&&(this.diagnostics={runnable:k,material:c,programLog:A,vertexShader:{log:C,prefix:y},fragmentShader:{log:L,prefix:b}}),h.deleteShader(E),h.deleteShader(T);var P;this.getUniforms=function(){return void 0===P&&(P=e(h,_)),P};var R;return this.getAttributes=function(){return void 0===R&&(R=r(h,_)),R},this.destroy=function(){h.deleteProgram(_),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=i++,this.code=s,this.usedTimes=1,this.program=_,this.vertexShader=E,this.fragmentShader=T,this}}(),a.WebGLPrograms=function(t,e){function r(t){if(e.floatVertexTextures&&t&&t.skeleton&&t.skeleton.useVertexTexture)return 1024;var r=e.maxVertexUniforms,n=Math.floor((r-20)/4),i=n;return void 0!==t&&t instanceof a.SkinnedMesh&&(i=Math.min(t.skeleton.bones.length,i),i0,shadowMapType:t.shadowMap.type,shadowMapDebug:t.shadowMap.debug,alphaTest:o.alphaTest,metal:o.metal,doubleSided:o.side===a.DoubleSide,flipSided:o.side===a.BackSide};return g},this.getProgramCode=function(t,e){var r=[];if(e.shaderID?r.push(e.shaderID):(r.push(t.fragmentShader),r.push(t.vertexShader)),void 0!==t.defines)for(var n in t.defines)r.push(n),r.push(t.defines[n]);for(var i=0;i0&&e.morphTargets,h=t instanceof a.SkinnedMesh&&e.skinning,l=0;u&&(l|=p),h&&(l|=d),o=s[l]}return o.visible=e.visible,o.wireframe=e.wireframe,o.wireframeLinewidth=e.wireframeLinewidth,r&&void 0!==o.uniforms.lightPos&&o.uniforms.lightPos.value.copy(n),o}function i(t,e){if(t.visible!==!1){if((t instanceof a.Mesh||t instanceof a.Line||t instanceof a.Points)&&t.castShadow&&(t.frustumCulled===!1||c.intersectsObject(t)===!0)){var r=t.material;r.visible===!0&&(t.modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,t.matrixWorld),f.push(t))}for(var n=t.children,o=0,s=n.length;o0;var r;r=h?{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")}:{vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uv;","vec2 pos = position;","if ( renderType == 2 ) {","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:["precision mediump float;","uniform lowp int renderType;","uniform sampler2D map;","uniform sampler2D occlusionMap;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","void main() {","if ( renderType == 0 ) {","gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );","} else if ( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;","visibility = ( 1.0 - visibility / 4.0 );","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * visibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join("\n")
+},s=n(r),c={vertex:p.getAttribLocation(s,"position"),uv:p.getAttribLocation(s,"uv")},u={renderType:p.getUniformLocation(s,"renderType"),map:p.getUniformLocation(s,"map"),occlusionMap:p.getUniformLocation(s,"occlusionMap"),opacity:p.getUniformLocation(s,"opacity"),color:p.getUniformLocation(s,"color"),scale:p.getUniformLocation(s,"scale"),rotation:p.getUniformLocation(s,"rotation"),screenPosition:p.getUniformLocation(s,"screenPosition")}}function n(e){var r=p.createProgram(),n=p.createShader(p.FRAGMENT_SHADER),i=p.createShader(p.VERTEX_SHADER),o="precision "+t.getPrecision()+" float;\n";return p.shaderSource(n,o+e.fragmentShader),p.shaderSource(i,o+e.vertexShader),p.compileShader(n),p.compileShader(i),p.attachShader(r,n),p.attachShader(r,i),p.linkProgram(r),r}var i,o,s,c,u,h,l,f,p=t.context,d=t.state;this.render=function(n,m,g,v){if(0!==e.length){var y=new a.Vector3,b=v/g,x=.5*g,w=.5*v,_=16/v,S=new a.Vector2(_*b,_),M=new a.Vector3(1,1,0),E=new a.Vector2(1,1);void 0===s&&r(),p.useProgram(s),d.initAttributes(),d.enableAttribute(c.vertex),d.enableAttribute(c.uv),d.disableUnusedAttributes(),p.uniform1i(u.occlusionMap,0),p.uniform1i(u.map,1),p.bindBuffer(p.ARRAY_BUFFER,i),p.vertexAttribPointer(c.vertex,2,p.FLOAT,!1,16,0),p.vertexAttribPointer(c.uv,2,p.FLOAT,!1,16,8),p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,o),d.disable(p.CULL_FACE),p.depthMask(!1);for(var T=0,A=e.length;T0&&E.x0&&E.y.001&&F.scale>.001&&(M.x=F.x,M.y=F.y,M.z=F.z,_=F.size*F.scale/v,S.x=_*b,S.y=_,p.uniform3f(u.screenPosition,M.x,M.y,M.z),p.uniform2f(u.scale,S.x,S.y),p.uniform1f(u.rotation,F.rotation),p.uniform1f(u.opacity,F.opacity),p.uniform3f(u.color,F.color.r,F.color.g,F.color.b),d.setBlending(F.blending,F.blendEquation,F.blendSrc,F.blendDst),t.setTexture(F.texture,1),p.drawElements(p.TRIANGLES,6,p.UNSIGNED_SHORT,0))}}}d.enable(p.CULL_FACE),d.enable(p.DEPTH_TEST),p.depthMask(!0),t.resetGLState()}}},a.SpritePlugin=function(t,e){function r(){var t=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),e=new Uint16Array([0,1,2,0,2,3]);o=f.createBuffer(),s=f.createBuffer(),f.bindBuffer(f.ARRAY_BUFFER,o),f.bufferData(f.ARRAY_BUFFER,t,f.STATIC_DRAW),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,s),f.bufferData(f.ELEMENT_ARRAY_BUFFER,e,f.STATIC_DRAW),c=n(),u={position:f.getAttribLocation(c,"position"),uv:f.getAttribLocation(c,"uv")},h={uvOffset:f.getUniformLocation(c,"uvOffset"),uvScale:f.getUniformLocation(c,"uvScale"),rotation:f.getUniformLocation(c,"rotation"),scale:f.getUniformLocation(c,"scale"),color:f.getUniformLocation(c,"color"),map:f.getUniformLocation(c,"map"),opacity:f.getUniformLocation(c,"opacity"),modelViewMatrix:f.getUniformLocation(c,"modelViewMatrix"),projectionMatrix:f.getUniformLocation(c,"projectionMatrix"),fogType:f.getUniformLocation(c,"fogType"),fogDensity:f.getUniformLocation(c,"fogDensity"),fogNear:f.getUniformLocation(c,"fogNear"),fogFar:f.getUniformLocation(c,"fogFar"),fogColor:f.getUniformLocation(c,"fogColor"),alphaTest:f.getUniformLocation(c,"alphaTest")};var r=document.createElement("canvas");r.width=8,r.height=8;var i=r.getContext("2d");i.fillStyle="white",i.fillRect(0,0,8,8),l=new a.Texture(r),l.needsUpdate=!0}function n(){var e=f.createProgram(),r=f.createShader(f.VERTEX_SHADER),n=f.createShader(f.FRAGMENT_SHADER);return f.shaderSource(r,["precision "+t.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(n,["precision "+t.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(r),f.compileShader(n),f.attachShader(e,r),f.attachShader(e,n),f.linkProgram(e),e}function i(t,e){return t.z!==e.z?e.z-t.z:e.id-t.id}var o,s,c,u,h,l,f=t.context,p=t.state,d=new a.Vector3,m=new a.Quaternion,g=new a.Vector3;this.render=function(n,v){if(0!==e.length){void 0===c&&r(),f.useProgram(c),p.initAttributes(),p.enableAttribute(u.position),p.enableAttribute(u.uv),p.disableUnusedAttributes(),p.disable(f.CULL_FACE),p.enable(f.BLEND),f.bindBuffer(f.ARRAY_BUFFER,o),f.vertexAttribPointer(u.position,2,f.FLOAT,!1,16,0),f.vertexAttribPointer(u.uv,2,f.FLOAT,!1,16,8),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,s),f.uniformMatrix4fv(h.projectionMatrix,!1,v.projectionMatrix.elements),p.activeTexture(f.TEXTURE0),f.uniform1i(h.map,0);var y=0,b=0,x=n.fog;x?(f.uniform3f(h.fogColor,x.color.r,x.color.g,x.color.b),x instanceof a.Fog?(f.uniform1f(h.fogNear,x.near),f.uniform1f(h.fogFar,x.far),f.uniform1i(h.fogType,1),y=1,b=1):x instanceof a.FogExp2&&(f.uniform1f(h.fogDensity,x.density),f.uniform1i(h.fogType,2),y=2,b=2)):(f.uniform1i(h.fogType,0),y=0,b=0);for(var w=0,_=e.length;w<_;w++){var S=e[w];S.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse,S.matrixWorld),S.z=-S.modelViewMatrix.elements[14]}e.sort(i);for(var M=[],w=0,_=e.length;w<_;w++){var S=e[w],E=S.material;f.uniform1f(h.alphaTest,E.alphaTest),f.uniformMatrix4fv(h.modelViewMatrix,!1,S.modelViewMatrix.elements),S.matrixWorld.decompose(d,m,g),M[0]=g.x,M[1]=g.y;var T=0;n.fog&&E.fog&&(T=b),y!==T&&(f.uniform1i(h.fogType,T),y=T),null!==E.map?(f.uniform2f(h.uvOffset,E.map.offset.x,E.map.offset.y),f.uniform2f(h.uvScale,E.map.repeat.x,E.map.repeat.y)):(f.uniform2f(h.uvOffset,0,0),f.uniform2f(h.uvScale,1,1)),f.uniform1f(h.opacity,E.opacity),f.uniform3f(h.color,E.color.r,E.color.g,E.color.b),f.uniform1f(h.rotation,E.rotation),f.uniform2fv(h.scale,M),p.setBlending(E.blending,E.blendEquation,E.blendSrc,E.blendDst),p.setDepthTest(E.depthTest),p.setDepthWrite(E.depthWrite),E.map&&E.map.image&&E.map.image.width?t.setTexture(E.map,0):t.setTexture(l,0),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0)}p.enable(f.CULL_FACE),t.resetGLState()}}},a.CurveUtils={tangentQuadraticBezier:function(t,e,r,n){return 2*(1-t)*(r-e)+2*t*(n-r)},tangentCubicBezier:function(t,e,r,n,i){return-3*e*(1-t)*(1-t)+3*r*(1-t)*(1-t)-6*t*r*(1-t)+6*t*n*(1-t)-3*t*t*n+3*t*t*i},tangentSpline:function(t,e,r,n,i){var o=6*t*t-6*t,a=3*t*t-4*t+1,s=-6*t*t+6*t,c=3*t*t-2*t;return o+a+s+c},interpolate:function(t,e,r,n,i){var o=.5*(r-t),a=.5*(n-e),s=i*i,c=i*s;return(2*e-2*r+o+a)*c+(-3*e+3*r-2*o-a)*s+o*i+e}},a.GeometryUtils={merge:function(t,e,r){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var n;e instanceof a.Mesh&&(e.matrixAutoUpdate&&e.updateMatrix(),n=e.matrix,e=e.geometry),t.merge(e,n,r)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}},a.ImageUtils={crossOrigin:void 0,loadTexture:function(t,e,r,n){console.warn("THREE.ImageUtils.loadTexture is being deprecated. Use THREE.TextureLoader() instead.");var i=new a.TextureLoader;i.setCrossOrigin(this.crossOrigin);var o=i.load(t,r,void 0,n);return e&&(o.mapping=e),o},loadTextureCube:function(t,e,r,n){console.warn("THREE.ImageUtils.loadTextureCube is being deprecated. Use THREE.CubeTextureLoader() instead.");var i=new a.CubeTextureLoader;i.setCrossOrigin(this.crossOrigin);var o=i.load(t,r,void 0,n);return e&&(o.mapping=e),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.")}},a.SceneUtils={createMultiMaterialObject:function(t,e){for(var r=new a.Group,n=0,i=e.length;n(u-s)*(f-c)-(h-c)*(l-s))return!1;var m,g,v,y,b,x,w,_,S,M,E,T,A,C,L;for(m=l-u,g=f-h,v=s-l,y=c-f,b=u-s,x=h-c,a=0;a=-Number.EPSILON&&C>=-Number.EPSILON&&A>=-Number.EPSILON))return!1;return!0}return function(e,r){var n=e.length;if(n<3)return null;var i,o,s,c=[],u=[],h=[];if(a.ShapeUtils.area(e)>0)for(o=0;o2;){if(f--<=0)return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),r?h:c;if(i=o,l<=i&&(i=0),o=i+1,l<=o&&(o=0),s=o+1,l<=s&&(s=0),t(e,i,o,s,l,u)){var p,d,m,g,v;for(p=u[i],d=u[o],m=u[s],c.push([e[p],e[d],e[m]]),h.push([u[i],u[o],u[s]]),g=o,v=o+1;vNumber.EPSILON){var d;if(f>0){if(p<0||p>f)return[];if(d=u*h-c*l,d<0||d>f)return[]}else{if(p>0||p0||dE?[]:x===E?o?[]:[y]:w<=E?[y,b]:[y,S]}function i(t,e,r,n){var i=e.x-t.x,o=e.y-t.y,a=r.x-t.x,s=r.y-t.y,c=n.x-t.x,u=n.y-t.y,h=i*s-o*a,l=i*u-o*c;if(Math.abs(h)>Number.EPSILON){var f=c*s-u*a;return h>0?l>=0&&f>=0:l>=0||f>=0}return l>0}function o(t,e){function r(t,e){var r=y.length-1,n=t-1;n<0&&(n=r);var o=t+1;o>r&&(o=0);var a=i(y[t],y[n],y[o],s[e]);if(!a)return!1;var c=s.length-1,u=e-1;u<0&&(u=c);var h=e+1;return h>c&&(h=0),a=i(s[e],s[u],s[h],y[t]),!!a}function o(t,e){var r,i,o;for(r=0;r0)return!0;return!1}function a(t,r){var i,o,a,s,c;for(i=0;i0)return!0;return!1}for(var s,c,u,h,l,f,p,d,m,g,v,y=t.concat(),b=[],x=[],w=0,_=e.length;w<_;w++)b.push(w);for(var S=0,M=2*b.length;b.length>0;){if(M--,M<0){console.log("Infinite Loop! Holes left:"+b.length+", Probably Hole outside Shape!");break}for(u=S;u=0)break;x[p]=!0}if(c>=0)break}}return y}for(var s,c,u,h,l,f,p={},d=t.concat(),m=0,g=e.length;m0)){c=i;break}c=i-1}if(i=c,n[i]===r){var u=i/(o-1);return u}var h=n[i],l=n[i+1],f=l-h,p=(r-h)/f,u=(i+p)/(o-1);return u},getTangent:function(t){var e=1e-4,r=t-e,n=t+e;r<0&&(r=0),n>1&&(n=1);var i=this.getPoint(r),o=this.getPoint(n),a=o.clone().sub(i);return a.normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)}},a.Curve.Utils=a.CurveUtils,a.Curve.create=function(t,e){return t.prototype=Object.create(a.Curve.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},a.CurvePath=function(){this.curves=[],this.autoClose=!1},a.CurvePath.prototype=Object.create(a.Curve.prototype),a.CurvePath.prototype.constructor=a.CurvePath,a.CurvePath.prototype.add=function(t){this.curves.push(t)},a.CurvePath.prototype.closePath=function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new a.LineCurve(e,t))},a.CurvePath.prototype.getPoint=function(t){for(var e=t*this.getLength(),r=this.getCurveLengths(),n=0;n=e){var i=r[n]-e,o=this.curves[n],a=1-i/o.getLength();return o.getPointAt(a)}n++}return null},a.CurvePath.prototype.getLength=function(){var t=this.getCurveLengths();return t[t.length-1]},a.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,r=0,n=this.curves.length;r0?(l=g[g.length-1],u=l.x,h=l.y):(l=this.actions[v-1].args,u=l[l.length-2],h=l[l.length-1]);for(var _=1;_<=t;_++){var S=_/t;f=d(S,u,s,r),p=d(S,h,c,n),g.push(new a.Vector2(f,p))}break;case"bezierCurveTo":r=w[4],n=w[5],s=w[0],c=w[1],i=w[2],o=w[3],g.length>0?(l=g[g.length-1],u=l.x,h=l.y):(l=this.actions[v-1].args,u=l[l.length-2],h=l[l.length-1]);for(var _=1;_<=t;_++){var S=_/t;f=m(S,u,s,i,r),p=m(S,h,c,o,n),g.push(new a.Vector2(f,p))}break;case"splineThru":l=this.actions[v-1].args;var M=new a.Vector2(l[l.length-2],l[l.length-1]),E=[M],T=t*w[0].length;E=E.concat(w[0]);for(var A=new a.SplineCurve(E),_=1;_<=T;_++)g.push(A.getPointAt(_/T));break;case"arc":for(var C,L=w[0],k=w[1],F=w[2],P=w[3],R=w[4],D=!!w[5],O=R-P,$=2*t,_=1;_<=$;_++){var S=_/$;D||(S=1-S),C=P+S*O,f=L+F*Math.cos(C),p=k+F*Math.sin(C),g.push(new a.Vector2(f,p))}break;case"ellipse":var C,j,U,L=w[0],k=w[1],B=w[2],N=w[3],P=w[4],R=w[5],D=!!w[6],I=w[7],O=R-P,$=2*t;0!==I&&(j=Math.cos(I),U=Math.sin(I));for(var _=1;_<=$;_++){var S=_/$;if(D||(S=1-S),C=P+S*O,f=L+B*Math.cos(C),p=k+N*Math.sin(C),0!==I){var V=f,G=p;f=(V-L)*j-(G-k)*U+L,p=(V-L)*U+(G-k)*j+k}g.push(new a.Vector2(f,p))}}}var z=g[g.length-1];return Math.abs(z.x-g[0].x)Number.EPSILON){if(u<0&&(a=e[o],c=-c,s=e[i],u=-u),t.ys.y)continue;if(t.y===a.y){if(t.x===a.x)return!0}else{var h=u*(t.x-a.x)-c*(t.y-a.y);if(0===h)return!0;if(h<0)continue;n=!n}}else{if(t.y!==a.y)continue;if(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x)return!0}}return n}var o=a.ShapeUtils.isClockWise,s=r(this.actions);if(0===s.length)return[];if(e===!0)return n(s);var c,u,h,l=[];if(1===s.length)return u=s[0],h=new a.Shape,h.actions=u.actions,h.curves=u.curves,l.push(h),l;var f=!o(s[0].getPoints());f=t?!f:f;var p,d=[],m=[],g=[],v=0;m[v]=void 0,g[v]=[];for(var y=0,b=s.length;y1){for(var x=!1,w=[],_=0,S=m.length;_0&&(x||(g=d))}for(var L,y=0,k=m.length;ye.length-2?e.length-1:n+1],u=e[n>e.length-3?e.length-1:n+2],h=a.CurveUtils.interpolate;return new a.Vector2(h(o.x,s.x,c.x,u.x,i),h(o.y,s.y,c.y,u.y,i))},a.EllipseCurve=function(t,e,r,n,i,o,a,s){this.aX=t,this.aY=e,this.xRadius=r,this.yRadius=n,this.aStartAngle=i,this.aEndAngle=o,this.aClockwise=a,this.aRotation=s||0},a.EllipseCurve.prototype=Object.create(a.Curve.prototype),a.EllipseCurve.prototype.constructor=a.EllipseCurve,a.EllipseCurve.prototype.getPoint=function(t){var e=this.aEndAngle-this.aStartAngle;e<0&&(e+=2*Math.PI),e>2*Math.PI&&(e-=2*Math.PI);var r;r=this.aClockwise===!0?this.aEndAngle+(1-t)*(2*Math.PI-e):this.aStartAngle+t*e;var n=this.aX+this.xRadius*Math.cos(r),i=this.aY+this.yRadius*Math.sin(r);if(0!==this.aRotation){var o=Math.cos(this.aRotation),s=Math.sin(this.aRotation),c=n,u=i;n=(c-this.aX)*o-(u-this.aY)*s+this.aX,i=(c-this.aX)*s+(u-this.aY)*o+this.aY}return new a.Vector2(n,i)},a.ArcCurve=function(t,e,r,n,i,o){a.EllipseCurve.call(this,t,e,r,r,n,i,o)},a.ArcCurve.prototype=Object.create(a.EllipseCurve.prototype),a.ArcCurve.prototype.constructor=a.ArcCurve,a.LineCurve3=a.Curve.create(function(t,e){this.v1=t,this.v2=e},function(t){var e=new a.Vector3;return e.subVectors(this.v2,this.v1),e.multiplyScalar(t),e.add(this.v1),e}),a.QuadraticBezierCurve3=a.Curve.create(function(t,e,r){this.v0=t,this.v1=e,this.v2=r},function(t){var e=a.ShapeUtils.b2;return new a.Vector3(e(t,this.v0.x,this.v1.x,this.v2.x),e(t,this.v0.y,this.v1.y,this.v2.y),e(t,this.v0.z,this.v1.z,this.v2.z))}),a.CubicBezierCurve3=a.Curve.create(function(t,e,r,n){this.v0=t,this.v1=e,this.v2=r,this.v3=n},function(t){var e=a.ShapeUtils.b3;return new a.Vector3(e(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y),e(t,this.v0.z,this.v1.z,this.v2.z,this.v3.z))}),a.SplineCurve3=a.Curve.create(function(t){console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),this.points=void 0==t?[]:t},function(t){var e=this.points,r=(e.length-1)*t,n=Math.floor(r),i=r-n,o=e[0==n?n:n-1],s=e[n],c=e[n>e.length-2?e.length-1:n+1],u=e[n>e.length-3?e.length-1:n+2],h=a.CurveUtils.interpolate;return new a.Vector3(h(o.x,s.x,c.x,u.x,i),h(o.y,s.y,c.y,u.y,i),h(o.z,s.z,c.z,u.z,i))}),a.CatmullRomCurve3=function(){function t(){}var e=new a.Vector3,r=new t,n=new t,i=new t;return t.prototype.init=function(t,e,r,n){this.c0=t,this.c1=r,this.c2=-3*t+3*e-2*r-n,this.c3=2*t-2*e+r+n},t.prototype.initNonuniformCatmullRom=function(t,e,r,n,i,o,a){var s=(e-t)/i-(r-t)/(i+o)+(r-e)/o,c=(r-e)/o-(n-e)/(o+a)+(n-r)/a;s*=o,c*=o,this.init(e,r,s,c)},t.prototype.initCatmullRom=function(t,e,r,n,i){this.init(e,r,i*(r-t),i*(n-e))},t.prototype.calc=function(t){var e=t*t,r=e*t;return this.c0+this.c1*t+this.c2*e+this.c3*r},a.Curve.create(function(t){this.points=t||[]},function(t){var o,s,c,u,h=this.points;
+u=h.length,u<2&&console.log("duh, you need at least 2 points"),o=(u-1)*t,s=Math.floor(o),c=o-s,0===c&&s===u-1&&(s=u-2,c=1);var l,f,p,d;if(0===s?(e.subVectors(h[0],h[1]).add(h[0]),l=e):l=h[s-1],f=h[s],p=h[s+1],s+20?0:(Math.floor(Math.abs(n)/e.length)+1)*e.length;var o=e[(n-1)%e.length],s=e[n%e.length],c=e[(n+1)%e.length],u=e[(n+2)%e.length],h=a.CurveUtils.interpolate;return new a.Vector3(h(o.x,s.x,c.x,u.x,i),h(o.y,s.y,c.y,u.y,i),h(o.z,s.z,c.z,u.z,i))}),a.BoxGeometry=function(t,e,r,n,i,o){function s(t,e,r,n,i,o,s,u){var h,l,f,p=c.widthSegments,d=c.heightSegments,m=i/2,g=o/2,v=c.vertices.length;"x"===t&&"y"===e||"y"===t&&"x"===e?h="z":"x"===t&&"z"===e||"z"===t&&"x"===e?(h="y",d=c.depthSegments):("z"===t&&"y"===e||"y"===t&&"z"===e)&&(h="x",p=c.depthSegments);var y=p+1,b=d+1,x=i/p,w=o/d,_=new a.Vector3;for(_[h]=s>0?1:-1,f=0;f0)for(this.vertices.push(new a.Vector3(0,l,0)),u=0;u0)for(this.vertices.push(new a.Vector3(0,-l,0)),u=0;uNumber.EPSILON){var p=Math.sqrt(l),d=Math.sqrt(u*u+h*h),m=e.x-c/p,g=e.y+s/p,v=r.x-h/d,y=r.y+u/d,b=((v-m)*h-(y-g)*u)/(s*h-c*u);n=m+s*b-t.x,i=g+c*b-t.y;var x=n*n+i*i;if(x<=2)return new a.Vector2(n,i);o=Math.sqrt(x/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(h)&&(w=!0),w?(n=-c,i=s,o=Math.sqrt(l)):(n=s,i=c,o=Math.sqrt(l/2))}return new a.Vector2(n/o,i/o)}function i(){if(x){var t=0,e=G*t;for(W=0;W=0;){r=W,n=W-1,n<0&&(n=t.length-1);var i=0,o=_+2*b;for(i=0;i=0;j--){for(B=j/b,N=v*(1-B),U=y*Math.sin(B*Math.PI/2),W=0,q=$.length;W65535?Uint32Array:Uint16Array)(s*c*6),y=0;y0)&&M.push(E,T,C),(g!==r-1||c65535?a.Uint32Attribute:a.Uint16Attribute)(M,1)),this.addAttribute("position",h),this.addAttribute("normal",l),this.addAttribute("uv",f),this.boundingSphere=new a.Sphere(new a.Vector3,t)},a.SphereBufferGeometry.prototype=Object.create(a.BufferGeometry.prototype),a.SphereBufferGeometry.prototype.constructor=a.SphereBufferGeometry,a.SphereBufferGeometry.prototype.clone=function(){var t=this.parameters;return new a.SphereBufferGeometry(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)},a.TorusGeometry=function(t,e,r,n,i){a.Geometry.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:r,tubularSegments:n,arc:i},t=t||100,e=e||40,r=r||8,n=n||6,i=i||2*Math.PI;for(var o=new a.Vector3,s=[],c=[],u=0;u<=r;u++)for(var h=0;h<=n;h++){var l=h/n*i,f=u/r*Math.PI*2;o.x=t*Math.cos(l),o.y=t*Math.sin(l);var p=new a.Vector3;p.x=(t+e*Math.cos(f))*Math.cos(l),p.y=(t+e*Math.cos(f))*Math.sin(l),p.z=e*Math.sin(f),this.vertices.push(p),s.push(new a.Vector2(h/n,u/r)),c.push(p.clone().sub(o).normalize())}for(var u=1;u<=r;u++)for(var h=1;h<=n;h++){var d=(n+1)*u+h-1,m=(n+1)*(u-1)+h-1,g=(n+1)*(u-1)+h,v=(n+1)*u+h,y=new a.Face3(d,m,v,[c[d].clone(),c[m].clone(),c[v].clone()]);this.faces.push(y),this.faceVertexUvs[0].push([s[d].clone(),s[m].clone(),s[v].clone()]),y=new a.Face3(m,g,v,[c[m].clone(),c[g].clone(),c[v].clone()]),this.faces.push(y),this.faceVertexUvs[0].push([s[m].clone(),s[g].clone(),s[v].clone()])}this.computeFaceNormals()},a.TorusGeometry.prototype=Object.create(a.Geometry.prototype),a.TorusGeometry.prototype.constructor=a.TorusGeometry,a.TorusGeometry.prototype.clone=function(){var t=this.parameters;return new a.TorusGeometry(t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc)},a.TorusKnotGeometry=function(t,e,r,n,i,o,s){function c(t,e,r,n,i){var o=Math.cos(t),s=Math.sin(t),c=e/r*t,u=Math.cos(c),h=n*(2+u)*.5*o,l=n*(2+u)*s*.5,f=i*n*Math.sin(c)*.5;return new a.Vector3(h,l,f)}a.Geometry.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,radialSegments:r,tubularSegments:n,p:i,q:o,heightScale:s},t=t||100,e=e||40,r=r||64,n=n||8,i=i||2,o=o||3,s=s||1;for(var u=new Array(r),h=new a.Vector3,l=new a.Vector3,f=new a.Vector3,p=0;pNumber.EPSILON&&(g.normalize(),i=Math.acos(a.Math.clamp(p[h-1].dot(p[h]),-1,1)),d[h].applyMatrix4(v.makeRotationAxis(g,i))),m[h].crossVectors(p[h],d[h]);if(r)for(i=Math.acos(a.Math.clamp(d[0].dot(d[y-1]),-1,1)),i/=y-1,p[0].dot(g.crossVectors(d[0],d[y-1]))>0&&(i=-i),h=1;h.9&&T<.1&&(_<.2&&(w[0].x+=1),S<.2&&(w[1].x+=1),M<.2&&(w[2].x+=1))}for(var f=0,p=this.vertices.length;f.99999?this.quaternion.set(0,0,0,1):r.y<-.99999?this.quaternion.set(1,0,0,0):(e.set(r.z,0,-r.x).normalize(),t=Math.acos(r.y),this.quaternion.setFromAxisAngle(e,t))}}(),a.ArrowHelper.prototype.setLength=function(t,e,r){void 0===e&&(e=.2*t),void 0===r&&(r=.2*e),e1){var u=c[1];n[u]||(n[u]={start:1/0,end:-(1/0)});var h=n[u];oh.end&&(h.end=o),e||(e=u)}}for(var u in n){var h=n[u];this.createAnimation(u,h.start,h.end,t)}this.firstAnimation=e},a.MorphBlendMesh.prototype.setAnimationDirectionForward=function(t){var e=this.animationsMap[t];e&&(e.direction=1,e.directionBackwards=!1)},a.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(t){var e=this.animationsMap[t];e&&(e.direction=-1,e.directionBackwards=!0)},a.MorphBlendMesh.prototype.setAnimationFPS=function(t,e){var r=this.animationsMap[t];r&&(r.fps=e,r.duration=(r.end-r.start)/r.fps)},a.MorphBlendMesh.prototype.setAnimationDuration=function(t,e){var r=this.animationsMap[t];r&&(r.duration=e,r.fps=(r.end-r.start)/r.duration)},a.MorphBlendMesh.prototype.setAnimationWeight=function(t,e){var r=this.animationsMap[t];r&&(r.weight=e)},a.MorphBlendMesh.prototype.setAnimationTime=function(t,e){var r=this.animationsMap[t];r&&(r.time=e)},a.MorphBlendMesh.prototype.getAnimationTime=function(t){var e=0,r=this.animationsMap[t];return r&&(e=r.time),e},a.MorphBlendMesh.prototype.getAnimationDuration=function(t){var e=-1,r=this.animationsMap[t];return r&&(e=r.duration),e},a.MorphBlendMesh.prototype.playAnimation=function(t){var e=this.animationsMap[t];e?(e.time=0,e.active=!0):console.warn("THREE.MorphBlendMesh: animation["+t+"] undefined in .playAnimation()")},a.MorphBlendMesh.prototype.stopAnimation=function(t){var e=this.animationsMap[t];e&&(e.active=!1)},a.MorphBlendMesh.prototype.update=function(t){for(var e=0,r=this.animationsList.length;en.duration||n.time<0)&&(n.direction*=-1,n.time>n.duration&&(n.time=n.duration,n.directionBackwards=!0),n.time<0&&(n.time=0,n.directionBackwards=!1)):(n.time=n.time%n.duration,n.time<0&&(n.time+=n.duration));var o=n.start+a.Math.clamp(Math.floor(n.time/i),0,n.length-1),s=n.weight;o!==n.currentFrame&&(this.morphTargetInfluences[n.lastFrame]=0,this.morphTargetInfluences[n.currentFrame]=1*s,this.morphTargetInfluences[o]=0,n.lastFrame=n.currentFrame,n.currentFrame=o);var c=n.time%i/i;n.directionBackwards&&(c=1-c),n.currentFrame!==n.lastFrame?(this.morphTargetInfluences[n.currentFrame]=c*s,this.morphTargetInfluences[n.lastFrame]=(1-c)*s):this.morphTargetInfluences[n.currentFrame]=s}}},"undefined"!=typeof t&&t.exports&&(e=t.exports=a),e.THREE=a},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var r=0;r