Skip to content

Instantly share code, notes, and snippets.

@fenilgandhi
Created November 4, 2016 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fenilgandhi/67114a73645d1719b3ba95f4767e2a6b to your computer and use it in GitHub Desktop.
Save fenilgandhi/67114a73645d1719b3ba95f4767e2a6b to your computer and use it in GitHub Desktop.
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.AFRAME = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
"use strict";module.exports={createLink:function(e,t){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("link");n.href=e,n.rel="stylesheet";for(var d in t)if(t.hasOwnProperty(d)){var r=t[d];n.setAttribute("data-"+d,r)}a.appendChild(n)},createStyle:function(e,t){var a=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css";for(var d in t)if(t.hasOwnProperty(d)){var r=t[d];n.setAttribute("data-"+d,r)}n.sheet?(n.innerHTML=e,n.sheet.cssText=e,a.appendChild(n)):n.styleSheet?(a.appendChild(n),n.styleSheet.cssText=e):(n.appendChild(document.createTextNode(e)),a.appendChild(n))}};
},{}],2:[function(_dereq_,module,exports){
function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(r){try{return cachedSetTimeout.call(null,e,0)}catch(r){return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);try{return cachedClearTimeout(e)}catch(r){try{return cachedClearTimeout.call(null,e)}catch(r){return cachedClearTimeout.call(this,e)}}}function cleanUpNextTick(){draining&&currentQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var r=queue.length;r;){for(currentQueue=queue,queue=[];++queueIndex<r;)currentQueue&&currentQueue[queueIndex].run();queueIndex=-1,r=queue.length}currentQueue=null,draining=!1,runClearTimeout(e)}}function Item(e,r){this.fun=e,this.array=r}function noop(){}var process=module.exports={},cachedSetTimeout,cachedClearTimeout;!function(){try{cachedSetTimeout=setTimeout}catch(e){cachedSetTimeout=function(){throw new Error("setTimeout is not defined")}}try{cachedClearTimeout=clearTimeout}catch(e){cachedClearTimeout=function(){throw new Error("clearTimeout is not defined")}}}();var queue=[],draining=!1,currentQueue,queueIndex=-1;process.nextTick=function(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var u=1;u<arguments.length;u++)r[u-1]=arguments[u];queue.push(new Item(e,r)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};
},{}],3:[function(_dereq_,module,exports){
function useColors(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function formatArgs(){var o=arguments,e=this.useColors;if(o[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+o[0]+(e?"%c ":" ")+"+"+exports.humanize(this.diff),!e)return o;var r="color: "+this.color;o=[o[0],r,"color: inherit"].concat(Array.prototype.slice.call(o,1));var t=0,s=0;return o[0].replace(/%[a-z%]/g,function(o){"%%"!==o&&(t++,"%c"===o&&(s=t))}),o.splice(s,0,r),o}function log(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(o){try{null==o?exports.storage.removeItem("debug"):exports.storage.debug=o}catch(o){}}function load(){var o;try{o=exports.storage.debug}catch(o){}return o}function localstorage(){try{return window.localStorage}catch(o){}}exports=module.exports=_dereq_("./debug"),exports.log=log,exports.formatArgs=formatArgs,exports.save=save,exports.load=load,exports.useColors=useColors,exports.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:localstorage(),exports.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],exports.formatters.j=function(o){return JSON.stringify(o)},exports.enable(load());
},{"./debug":4}],4:[function(_dereq_,module,exports){
function selectColor(){return exports.colors[prevColor++%exports.colors.length]}function debug(e){function r(){}function o(){var e=o,r=+new Date,s=r-(prevTime||r);e.diff=s,e.prev=prevTime,e.curr=r,prevTime=r,null==e.useColors&&(e.useColors=exports.useColors()),null==e.color&&e.useColors&&(e.color=selectColor());var t=Array.prototype.slice.call(arguments);t[0]=exports.coerce(t[0]),"string"!=typeof t[0]&&(t=["%o"].concat(t));var n=0;t[0]=t[0].replace(/%([a-z%])/g,function(r,o){if("%%"===r)return r;n++;var s=exports.formatters[o];if("function"==typeof s){var p=t[n];r=s.call(e,p),t.splice(n,1),n--}return r}),"function"==typeof exports.formatArgs&&(t=exports.formatArgs.apply(e,t));var p=o.log||exports.log||console.log.bind(console);p.apply(e,t)}r.enabled=!1,o.enabled=!0;var s=exports.enabled(e)?o:r;return s.namespace=e,s}function enable(e){exports.save(e);for(var r=(e||"").split(/[\s,]+/),o=r.length,s=0;s<o;s++)r[s]&&(e=r[s].replace(/\*/g,".*?"),"-"===e[0]?exports.skips.push(new RegExp("^"+e.substr(1)+"$")):exports.names.push(new RegExp("^"+e+"$")))}function disable(){exports.enable("")}function enabled(e){var r,o;for(r=0,o=exports.skips.length;r<o;r++)if(exports.skips[r].test(e))return!1;for(r=0,o=exports.names.length;r<o;r++)if(exports.names[r].test(e))return!0;return!1}function coerce(e){return e instanceof Error?e.stack||e.message:e}exports=module.exports=debug,exports.coerce=coerce,exports.disable=disable,exports.enable=enable,exports.enabled=enabled,exports.humanize=_dereq_("ms"),exports.names=[],exports.skips=[],exports.formatters={};var prevColor=0,prevTime;
},{"ms":5}],5:[function(_dereq_,module,exports){
function parse(e){if(e=""+e,!(e.length>1e4)){var a=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(a){var r=parseFloat(a[1]),c=(a[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return r*y;case"days":case"day":case"d":return r*d;case"hours":case"hour":case"hrs":case"hr":case"h":return r*h;case"minutes":case"minute":case"mins":case"min":case"m":return r*m;case"seconds":case"second":case"secs":case"sec":case"s":return r*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}}}function short(e){return e>=d?Math.round(e/d)+"d":e>=h?Math.round(e/h)+"h":e>=m?Math.round(e/m)+"m":e>=s?Math.round(e/s)+"s":e+"ms"}function long(e){return plural(e,d,"day")||plural(e,h,"hour")||plural(e,m,"minute")||plural(e,s,"second")||e+" ms"}function plural(s,e,a){if(!(s<e))return s<1.5*e?Math.floor(s/e)+" "+a:Math.ceil(s/e)+" "+a+"s"}var s=1e3,m=60*s,h=60*m,d=24*h,y=365.25*d;module.exports=function(s,e){return e=e||{},"string"==typeof s?parse(s):e.long?long(s):short(s)};
},{}],6:[function(_dereq_,module,exports){
"use strict";function toObject(r){if(null===r||void 0===r)throw new TypeError("Sources cannot be null or undefined");return Object(r)}function assignKey(r,e,n){var t=e[n];if(void 0!==t&&null!==t){if(hasOwnProperty.call(r,n)&&(void 0===r[n]||null===r[n]))throw new TypeError("Cannot convert undefined or null to object ("+n+")");hasOwnProperty.call(r,n)&&isObj(t)?r[n]=assign(Object(r[n]),e[n]):r[n]=t}}function assign(r,e){if(r===e)return r;e=Object(e);for(var n in e)hasOwnProperty.call(e,n)&&assignKey(r,e,n);if(Object.getOwnPropertySymbols)for(var t=Object.getOwnPropertySymbols(e),o=0;o<t.length;o++)propIsEnumerable.call(e,t[o])&&assignKey(r,e,t[o]);return r}var isObj=_dereq_("is-obj"),hasOwnProperty=Object.prototype.hasOwnProperty,propIsEnumerable=Object.prototype.propertyIsEnumerable;module.exports=function(r){r=toObject(r);for(var e=1;e<arguments.length;e++)assign(r,arguments[e]);return r};
},{"is-obj":7}],7:[function(_dereq_,module,exports){
"use strict";module.exports=function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)};
},{}],8:[function(_dereq_,module,exports){
!function(t,r,n,a){"use strict";function l(e,t){for(var r=0,n=e.length;r<n;r++)m(e[r],t)}function i(e){for(var t,r=0,n=e.length;r<n;r++)t=e[r],y(t,H[u(t)])}function o(e){return function(t){ae(t)&&(m(t,e),l(t.querySelectorAll(x),e))}}function u(e){var t=oe.call(e,"is"),r=e.nodeName.toUpperCase(),n=G.call(U,t?k+t.toUpperCase():_+r);return t&&-1<n&&!c(r,t)?-1:n}function c(e,t){return-1<x.indexOf(e+'[is="'+t+'"]')}function s(e){var t=e.currentTarget,r=e.attrChange,n=e.attrName,a=e.target;me&&(!a||a===t)&&t.attributeChangedCallback&&"style"!==n&&e.prevValue!==e.newValue&&t.attributeChangedCallback(n,r===e[F]?null:e.prevValue,r===e[I]?null:e.newValue)}function d(e){var t=o(e);return function(e){g.push(t,e.target)}}function f(e){be&&(be=!1,e.currentTarget.removeEventListener(P,f)),l((e.target||r).querySelectorAll(x),e.detail===T?T:L),ne&&p()}function h(e,t){var r=this;ue.call(r,e,t),C.call(r,{target:r})}function v(e,t){ee(e,t),O?O.observe(e,de):(pe&&(e.setAttribute=h,e[w]=E(e),e.addEventListener(R,C)),e.addEventListener(D,s)),e.createdCallback&&me&&(e.created=!0,e.createdCallback(),e.created=!1)}function p(){for(var e,t=0,r=le.length;t<r;t++)e=le[t],Z.contains(e)||(r--,le.splice(t--,1),m(e,T))}function b(e){throw new Error("A "+e+" type is already registered")}function m(e,t){var r,n=u(e);-1<n&&(N(e,H[n]),n=0,t!==L||e[L]?t===T&&!e[T]&&(e[L]=!1,e[T]=!0,n=1):(e[T]=!1,e[L]=!0,n=1,ne&&G.call(le,e)<0&&le.push(e)),n&&(r=e[t+"Callback"])&&r.call(e))}if(!(a in r)){var g,C,A,E,O,N,y,w="__"+a+(1e5*Math.random()>>0),L="attached",T="detached",M="extends",F="ADDITION",V="MODIFICATION",I="REMOVAL",D="DOMAttrModified",P="DOMContentLoaded",R="DOMSubtreeModified",_="<",k="=",q=/^[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+$/,S=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],U=[],H=[],x="",Z=r.documentElement,G=U.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},j=n.prototype,z=j.hasOwnProperty,K=j.isPrototypeOf,W=n.defineProperty,X=n.getOwnPropertyDescriptor,Y=n.getOwnPropertyNames,$=n.getPrototypeOf,B=n.setPrototypeOf,J=!!n.__proto__,Q=n.create||function e(t){return t?(e.prototype=t,new e):this},ee=B||(J?function(e,t){return e.__proto__=t,e}:Y&&X?function(){function e(e,t){for(var r,n=Y(t),a=0,l=n.length;a<l;a++)r=n[a],z.call(e,r)||W(e,r,X(t,r))}return function(t,r){do e(t,r);while((r=$(r))&&!K.call(r,t));return t}}():function(e,t){for(var r in t)e[r]=t[r];return e}),te=t.MutationObserver||t.WebKitMutationObserver,re=(t.HTMLElement||t.Element||t.Node).prototype,ne=!K.call(re,Z),ae=ne?function(e){return 1===e.nodeType}:function(e){return K.call(re,e)},le=ne&&[],ie=re.cloneNode,oe=re.getAttribute,ue=re.setAttribute,ce=re.removeAttribute,se=r.createElement,de=te&&{attributes:!0,characterData:!0,attributeOldValue:!0},fe=te||function(e){pe=!1,Z.removeEventListener(D,fe)},he=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,10)},ve=!1,pe=!0,be=!0,me=!0;B||J?(N=function(e,t){K.call(t,e)||v(e,t)},y=v):(N=function(e,t){e[w]||(e[w]=n(!0),v(e,t))},y=N),ne?(pe=!1,function(){var t=X(re,"addEventListener"),r=t.value,n=function(e){var t=new CustomEvent(D,{bubbles:!0});t.attrName=e,t.prevValue=oe.call(this,e),t.newValue=null,t[I]=t.attrChange=2,ce.call(this,e),this.dispatchEvent(t)},a=function(t,r){var n=this.hasAttribute(t),a=n&&oe.call(this,t);e=new CustomEvent(D,{bubbles:!0}),ue.call(this,t,r),e.attrName=t,e.prevValue=n?a:null,e.newValue=r,n?e[V]=e.attrChange=1:e[F]=e.attrChange=0,this.dispatchEvent(e)},l=function(e){var t,r=e.currentTarget,n=r[w],a=e.propertyName;n.hasOwnProperty(a)&&(n=n[a],t=new CustomEvent(D,{bubbles:!0}),t.attrName=n.name,t.prevValue=n.value||null,t.newValue=n.value=r[a]||null,null==t.prevValue?t[F]=t.attrChange=0:t[V]=t.attrChange=1,r.dispatchEvent(t))};t.value=function(e,t,i){e===D&&this.attributeChangedCallback&&this.setAttribute!==a&&(this[w]={className:{name:"class",value:this.className}},this.setAttribute=a,this.removeAttribute=n,r.call(this,"propertychange",l)),r.call(this,e,t,i)},W(re,"addEventListener",t)}()):te||(Z.addEventListener(D,fe),Z.setAttribute(w,1),Z.removeAttribute(w),pe&&(C=function(e){var t,r,n,a=this;if(a===e.target){t=a[w],a[w]=r=E(a);for(n in r){if(!(n in t))return A(0,a,n,t[n],r[n],F);if(r[n]!==t[n])return A(1,a,n,t[n],r[n],V)}for(n in t)if(!(n in r))return A(2,a,n,t[n],r[n],I)}},A=function(e,t,r,n,a,l){var i={attrChange:e,currentTarget:t,attrName:r,prevValue:n,newValue:a};i[l]=e,s(i)},E=function(e){for(var t,r,n={},a=e.attributes,l=0,i=a.length;l<i;l++)t=a[l],r=t.name,"setAttribute"!==r&&(n[r]=t.value);return n})),r[a]=function(e,t){if(n=e.toUpperCase(),ve||(ve=!0,te?(O=function(e,t){function r(e,t){for(var r=0,n=e.length;r<n;t(e[r++]));}return new te(function(n){for(var a,l,i,o=0,u=n.length;o<u;o++)a=n[o],"childList"===a.type?(r(a.addedNodes,e),r(a.removedNodes,t)):(l=a.target,me&&l.attributeChangedCallback&&"style"!==a.attributeName&&(i=oe.call(l,a.attributeName),i!==a.oldValue&&l.attributeChangedCallback(a.attributeName,a.oldValue,i)))})}(o(L),o(T)),O.observe(r,{childList:!0,subtree:!0})):(g=[],he(function e(){for(;g.length;)g.shift().call(null,g.shift());he(e)}),r.addEventListener("DOMNodeInserted",d(L)),r.addEventListener("DOMNodeRemoved",d(T))),r.addEventListener(P,f),r.addEventListener("readystatechange",f),r.createElement=function(e,t){var n=se.apply(r,arguments),a=""+e,l=G.call(U,(t?k:_)+(t||a).toUpperCase()),i=-1<l;return t&&(n.setAttribute("is",t=t.toLowerCase()),i&&(i=c(a.toUpperCase(),t))),me=!r.createElement.innerHTMLHelper,i&&y(n,H[l]),n},re.cloneNode=function(e){var t=ie.call(this,!!e),r=u(t);return-1<r&&y(t,H[r]),e&&i(t.querySelectorAll(x)),t}),-2<G.call(U,k+n)+G.call(U,_+n)&&b(e),!q.test(n)||-1<G.call(S,n))throw new Error("The type "+e+" is invalid");var n,a,s=function(){return v?r.createElement(p,n):r.createElement(p)},h=t||j,v=z.call(h,M),p=v?t[M].toUpperCase():n;return v&&-1<G.call(U,_+p)&&b(p),a=U.push((v?k:_)+n)-1,x=x.concat(x.length?",":"",v?p+'[is="'+e.toLowerCase()+'"]':p),s.prototype=H[a]=z.call(h,"prototype")?h.prototype:Q(re),l(r.querySelectorAll(x),L),s}}}(window,document,Object,"registerElement");
},{}],9:[function(_dereq_,module,exports){
"use strict";function toObject(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var hasOwnProperty=Object.prototype.hasOwnProperty,propIsEnumerable=Object.prototype.propertyIsEnumerable;module.exports=Object.assign||function(e,r){for(var t,o,n=toObject(e),l=1;l<arguments.length;l++){t=Object(arguments[l]);for(var c in t)hasOwnProperty.call(t,c)&&(n[c]=t[c]);if(Object.getOwnPropertySymbols){o=Object.getOwnPropertySymbols(t);for(var p=0;p<o.length;p++)propIsEnumerable.call(t,o[p])&&(n[o[p]]=t[o[p]])}}return n};
},{}],10:[function(_dereq_,module,exports){
(function (global){
var performance=global.performance||{},present=function(){for(var e=["now","webkitNow","msNow","mozNow","oNow"];e.length;){var n=e.shift();if(n in performance)return performance[n].bind(performance)}var r=Date.now||function(){return(new Date).getTime()},o=(performance.timing||{}).navigationStart||r();return function(){return r()-o}}();present.performanceNow=performance.now,present.noConflict=function(){performance.now=present.performanceNow},present.conflict=function(){performance.now=present},present.conflict(),module.exports=present;
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],11:[function(_dereq_,module,exports){
!function(t){function e(t,e){return function(){t.apply(e,arguments)}}function n(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],f(t,e(r,this),e(i,this))}function o(t){var e=this;return null===this._state?void this._deferreds.push(t):void l(function(){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return void(e._state?t.resolve:t.reject)(e._value);var o;try{o=n(e._value)}catch(e){return void t.reject(e)}t.resolve(o)})}function r(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void f(e(n,t),e(r,this),e(i,this))}this._state=!0,this._value=t,u.call(this)}catch(t){i.call(this,t)}}function i(t){this._state=!1,this._value=t,u.call(this)}function u(){for(var t=0,e=this._deferreds.length;t<e;t++)o.call(this,this._deferreds[t]);this._deferreds=null}function c(t,e,n,o){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=o}function f(t,e,n){var o=!1;try{t(function(t){o||(o=!0,e(t))},function(t){o||(o=!0,n(t))})}catch(t){if(o)return;o=!0,n(t)}}var s=setTimeout,l="function"==typeof setImmediate&&setImmediate||function(t){s(t,1)},h=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};n.prototype.catch=function(t){return this.then(null,t)},n.prototype.then=function(t,e){var r=this;return new n(function(n,i){o.call(r,new c(t,e,n,i))})},n.all=function(){var t=Array.prototype.slice.call(1===arguments.length&&h(arguments[0])?arguments[0]:arguments);return new n(function(e,n){function o(i,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var c=u.then;if("function"==typeof c)return void c.call(u,function(t){o(i,t)},n)}t[i]=u,0===--r&&e(t)}catch(t){n(t)}}if(0===t.length)return e([]);for(var r=t.length,i=0;i<t.length;i++)o(i,t[i])})},n.resolve=function(t){return t&&"object"==typeof t&&t.constructor===n?t:new n(function(e){e(t)})},n.reject=function(t){return new n(function(e,n){n(t)})},n.race=function(t){return new n(function(e,n){for(var o=0,r=t.length;o<r;o++)t[o].then(e,n)})},n._setImmediateFn=function(t){l=t},"undefined"!=typeof module&&module.exports?module.exports=n:t.Promise||(t.Promise=n)}(this);
},{}],12:[function(_dereq_,module,exports){
function parse(r){var n=function(r){return r.trim()},e={};return getKeyValueChunks(r).map(n).filter(Boolean).forEach(function(r){var n=r.indexOf(":"),t=r.substr(0,n).trim(),i=r.substr(n+1).trim();e[t]=i}),e}function getKeyValueChunks(r){for(var n,e=[],t=0,i=";",u=/url\([^\)]+$/,s="";t<r.length;)n=r.indexOf(i,t),n===-1&&(n=r.length),s+=r.substring(t,n),u.test(s)?(s+=";",t=n+1):(e.push(s),s="",t=n+1);return e}function stringify(r){return Object.keys(r).map(function(n){return n+":"+r[n]}).join(";")}function normalize(r){return stringify(parse(r))}module.exports.parse=parse,module.exports.stringify=stringify,module.exports.normalize=normalize;
},{}],13:[function(_dereq_,module,exports){
THREE.BlendCharacter=function(){this.weightSchedule=[],this.warpSchedule=[],this.load=function(t,e){var i=this,n=new THREE.ObjectLoader;n.load(t,function(n){if(n.traverse(function(t){t instanceof THREE.SkinnedMesh&&(i.skinnedMesh=t)}),THREE.SkinnedMesh.call(i,i.skinnedMesh.geometry,i.skinnedMesh.material),void 0==i.skinnedMesh)return void console.log("unable to find skinned mesh in "+t);i.material.skinning=!0,i.mixer=new THREE.AnimationMixer(i),i.mixer=i.mixer;for(var s=0;s<i.geometry.animations.length;++s)i.mixer.clipAction(i.geometry.animations[s]);void 0!==e&&e()})},this.update=function(t){this.mixer.update(t)},this.play=function(t,e){return this.mixer.clipAction(t).setEffectiveWeight(e).play()},this.crossfade=function(t,e,i){this.mixer.stopAllAction();var n=this.play(t,1),s=this.play(e,1);n.crossFadeTo(s,i,!1)},this.warp=function(t,e,i){this.mixer.stopAllAction();var n=this.play(t,1),s=this.play(e,1);n.crossFadeTo(s,i,!0)},this.applyWeight=function(t,e){this.mixer.clipAction(t).setEffectiveWeight(e)},this.getWeight=function(t){return this.mixer.clipAction(t).getEffectiveWeight()},this.pauseAll=function(){this.mixer.timeScale=0},this.unPauseAll=function(){this.mixer.timeScale=1},this.stopAll=function(){this.mixer.stopAllAction()},this.showModel=function(t){this.visible=t}},THREE.BlendCharacter.prototype=Object.create(THREE.SkinnedMesh.prototype),THREE.BlendCharacter.prototype.constructor=THREE.BlendCharacter,THREE.BlendCharacter.prototype.getForward=function(){var t=new THREE.Vector3;return function(){return t.set(-this.matrix.elements[8],-this.matrix.elements[9],-this.matrix.elements[10]),t}};
},{}],14:[function(_dereq_,module,exports){
THREE.ColladaLoader=function(){function e(e,i,s,r){var a=0;if(document.implementation&&document.implementation.createDocument){var n=new XMLHttpRequest;n.onreadystatechange=function(){4===n.readyState?0===n.status||200===n.status?n.response?(Xe=i,t(n.response,void 0,e)):r?r({type:"error",url:e}):console.error("ColladaLoader: Empty or non-existing file ("+e+")"):r?r({type:"error",url:e}):console.error("ColladaLoader: Couldn't load \""+e+'" ('+n.status+")"):3===n.readyState&&s&&(0===a&&(a=n.getResponseHeader("Content-Length")),s({total:a,loaded:n.responseText.length}))},n.open("GET",e,!0),n.send(null)}else alert("Don't know how to parse XML!")}function t(e,t,i){if(qe=(new DOMParser).parseFromString(e,"text/xml"),t=t||Xe,void 0!==i){var h=i.split("/");h.pop(),Oe=(h.length<1?".":h.join("/"))+"/"}s(),we(),Ye=r("library_images image",R,"image"),Be=r("library_materials material",U,"material"),De=r("library_effects effect",Q,"effect"),Fe=r("library_geometries geometry",q,"geometry"),Ue=r("library_cameras camera",se,"camera"),Pe=r("library_lights light",ae,"light"),ze=r("library_controllers controller",_,"controller"),Ze=r("library_animations animation",K,"animation"),He=r("library_visual_scenes visual_scene",j,"visual_scene"),Me=r("library_kinematics_models kinematics_model",oe,"kinematics_model"),Se=[],Ie=[],_e=a(),Ve=new THREE.Group;for(var l=0;l<_e.nodes.length;l++)Ve.add(v(_e.nodes[l]));Ve.scale.multiplyScalar(We),o(),Ae=n(),g();var c={scene:Ve,morphs:Se,skins:Ie,animations:Ce,kinematics:je,dae:{images:Ye,materials:Be,cameras:Ue,lights:Pe,effects:De,geometries:Fe,controllers:ze,animations:Ze,visualScenes:He,visualScene:_e,scene:_e,kinematicsModels:Me,kinematicsModel:Ae}};return t&&t(c),c}function i(e){Ge=e}function s(){var e=qe.querySelectorAll("asset"),t=e[0];if(t&&t.childNodes)for(var i=0;i<t.childNodes.length;i++){var s=t.childNodes[i];switch(s.nodeName){case"unit":var r=s.getAttribute("meter");r&&(We=parseFloat(r));break;case"up_axis":Qe=s.textContent.charAt(0)}}}function r(e,t,i){for(var s=qe.querySelectorAll(e),r={},a=0,n=s.length,o=0;o<n;o++){var h=s[o],l=(new t).parse(h);l.id&&0!==l.id.length||(l.id=i+a++),r[l.id]=l}return r}function a(){var e=qe.querySelectorAll("scene instance_visual_scene")[0];if(e){var t=e.getAttribute("url").replace(/^#/,"");return He[t.length>0?t:"visual_scene0"]}return null}function n(){var e=qe.querySelectorAll("instance_kinematics_model")[0];if(e){var t=e.getAttribute("url").replace(/^#/,"");return Me[t.length>0?t:"kinematics_model0"]}return null}function o(){Ce=[],h(Ve)}function h(e){var t=_e.getChildById(e.colladaId,!0),i=null;if(t&&t.keys){i={fps:60,hierarchy:[{node:t,keys:t.keys,sids:t.sids}],node:e,name:"animation_"+e.name,length:0},Ce.push(i);for(var s=0,r=t.keys.length;s<r;s++)i.length=Math.max(i.length,t.keys[s].time)}else i={hierarchy:[{keys:[],sids:[]}]};for(var s=0,r=e.children.length;s<r;s++)for(var a=h(e.children[s]),n=0,o=a.hierarchy.length;n<o;n++)i.hierarchy.push({keys:[],sids:[]});return i}function l(){var e,t=1e6,i=-t,s=0;for(var r in Ze){var a=Ze[r];e=e||a.id;for(var n=0;n<a.sampler.length;n++){var o=a.sampler[n];o.create(),t=Math.min(t,o.startTime),i=Math.max(i,o.endTime),s=Math.max(s,o.input.length)}}return{start:t,end:i,frames:s,ID:e}}function c(e,t){var i=t instanceof O?ze[t.url]:t;if(!i||!i.morph)return void console.log("could not find morph controller!");for(var s=i.morph,r=0;r<s.targets.length;r++){var a=s.targets[r],n=Fe[a];if(n.mesh&&n.mesh.primitives&&n.mesh.primitives.length){var o=n.mesh.primitives[0].geometry;o.vertices.length===e.vertices.length&&e.morphTargets.push({name:"target_1",vertices:o.vertices})}}e.morphTargets.push({name:"target_Z",vertices:e.vertices})}function d(e,t,i,s){if(e.world=e.world||new THREE.Matrix4,e.localworld=e.localworld||new THREE.Matrix4,e.world.copy(e.matrix),e.localworld.copy(e.matrix),e.channels&&e.channels.length){var r=e.channels[0],a=r.sampler.output[i];a instanceof THREE.Matrix4&&(e.world.copy(a),e.localworld.copy(a),0===i&&e.matrix.copy(a))}s&&e.world.multiplyMatrices(s,e.world),t.push(e);for(var n=0;n<e.nodes.length;n++)d(e.nodes[n],t,i,e.world)}function p(e,t){for(var i=0;i<e.length;i++){var s=e[i],r=-1;if("JOINT"==s.type){for(var a=0;a<t.joints.length;a++)if(s.sid===t.joints[a]){r=a;break}if(r>=0){var n=t.invBindMatrices[r];s.invBindMatrix=n,s.skinningMatrix=new THREE.Matrix4,s.skinningMatrix.multiplyMatrices(s.world,n),s.animatrix=new THREE.Matrix4,s.animatrix.copy(s.localworld),s.weights=[];for(var a=0;a<t.weights.length;a++)for(var o=0;o<t.weights[a].length;o++){var h=t.weights[a][o];h.joint===r&&s.weights.push(h)}}else console.warn("ColladaLoader: Could not find joint '"+s.sid+"'."),s.skinningMatrix=new THREE.Matrix4,s.weights=[]}}}function u(e){var t=[],i=function(e,t,s){var r={};r.name=t.sid,r.parent=e,r.matrix=t.matrix;var a=[new THREE.Vector3,new THREE.Quaternion,new THREE.Vector3];r.matrix.decompose(a[0],a[1],a[2]),r.pos=[a[0].x,a[0].y,a[0].z],r.scl=[a[2].x,a[2].y,a[2].z],r.rotq=[a[1].x,a[1].y,a[1].z,a[1].w],s.push(r);for(var n in t.nodes)i(t.sid,t.nodes[n],s)};return i(-1,e,t),t}function f(e,t,i){var s=[];d(t,s,-1),p(s,i.skin);for(var r=new THREE.Vector3,a=[],n=0;n<e.vertices.length;n++)a.push(new THREE.Vector3);for(n=0;n<s.length;n++)if("JOINT"==s[n].type)for(var o=0;o<s[n].weights.length;o++){var h=s[n].weights[o],l=h.index,c=h.weight,u=e.vertices[l],f=a[l];r.x=u.x,r.y=u.y,r.z=u.z,r.applyMatrix4(s[n].skinningMatrix),f.x+=r.x*c,f.y+=r.y*c,f.z+=r.z*c}for(var n=0;n<e.vertices.length;n++)e.vertices[n]=a[n]}function m(e,t,i){var s=ze[t.url];if(i=void 0!==i?i:40,!s||!s.skin)return void console.log("ColladaLoader: Could not find skin controller.");if(!t.skeleton||!t.skeleton.length)return void console.log("ColladaLoader: Could not find the skeleton for the skin. ");for(var r=l(),a=_e.getChildById(t.skeleton[0],!0)||_e.getChildBySid(t.skeleton[0],!0),n=u(a),o=s.skin.joints,h=[],c=0;c<o.length;c++)for(var m=0;m<n.length;m++)n[m].name===o[c]&&(h[c]=n[m]);for(var c=0;c<h.length;c++)for(var m=0;m<h.length;m++)h[c].parent===h[m].name&&(h[c].parent=m);var c,m,g;new THREE.Vector3;for(c=0;c<e.vertices.length;c++)e.vertices[c].applyMatrix4(s.skin.bindShapeMatrix);for(var v=[],y=[],b=s.skin.weights,c=0;c<b.length;c++){var w=new THREE.Vector4(b[c][0]?b[c][0].joint:0,b[c][1]?b[c][1].joint:0,b[c][2]?b[c][2].joint:0,b[c][3]?b[c][3].joint:0),g=new THREE.Vector4(b[c][0]?b[c][0].weight:0,b[c][1]?b[c][1].weight:0,b[c][2]?b[c][2].weight:0,b[c][3]?b[c][3].weight:0);v.push(w),y.push(g)}e.skinIndices=v,e.skinWeights=y,e.bones=h;for(var x={name:r.ID,fps:30,length:r.frames/30,hierarchy:[]},m=0;m<h.length;m++)x.hierarchy.push({parent:h[m].parent,name:h[m].name,keys:[]});for(console.log("ColladaLoader:",r.ID+" has "+h.length+" bones."),f(e,a,s),i=0;i<r.frames;i++){var N=[];d(a,N,i),p(N,s.skin);for(var c=0;c<N.length;c++)for(var m=0;m<x.hierarchy.length;m++)if(x.hierarchy[m].name===N[c].sid){var k={};k.time=i/30,k.matrix=N[c].animatrix,0===i&&(N[c].matrix=k.matrix);var T=[new THREE.Vector3,new THREE.Quaternion,new THREE.Vector3];k.matrix.decompose(T[0],T[1],T[2]),k.pos=[T[0].x,T[0].y,T[0].z],k.scl=[T[2].x,T[2].y,T[2].z],k.rot=T[1],x.hierarchy[m].keys.push(k)}e.animation=x}}function g(){if(Ae&&0===Ae.joints.length)return void(je=void 0);var e={},t=function(t,i){var s=i.getAttribute("id"),r=_e.getChildById(s,!0),a=Ae.joints[t];Ve.traverse(function(i){i.colladaId==s&&(e[t]={node:i,transforms:r.transforms,joint:a,position:a.zeroPosition})})};je={joints:Ae&&Ae.joints,getJointValue:function(t){var i=e[t];return i?i.position:void console.log("getJointValue: joint "+t+" doesn't exist")},setJointValue:function(t,i){var r=e[t];if(r){var a=r.joint;if(i>a.limits.max||i<a.limits.min)console.log("setJointValue: joint "+t+" value "+i+" outside of limits (min: "+a.limits.min+", max: "+a.limits.max+")");else if(a.static)console.log("setJointValue: joint "+t+" is static");else{var n=r.node,o=a.axis,h=r.transforms,l=new THREE.Matrix4;for(s=0;s<h.length;s++){var c=h[s];if(c.sid&&c.sid.indexOf("joint"+t)!==-1)switch(a.type){case"revolute":l.multiply(d.makeRotationAxis(o,THREE.Math.degToRad(i)));break;case"prismatic":l.multiply(d.makeTranslation(o.x*i,o.y*i,o.z*i));break;default:console.warn("setJointValue: unknown joint type: "+a.type)}else{var d=new THREE.Matrix4;switch(c.type){case"matrix":l.multiply(c.obj);break;case"translate":l.multiply(d.makeTranslation(c.obj.x,c.obj.y,c.obj.z));break;case"rotate":l.multiply(d.makeRotationAxis(c.obj,c.angle))}}}var p=l.elements,u=Array.prototype.slice.call(p),f=[u[0],u[4],u[8],u[12],u[1],u[5],u[9],u[13],u[2],u[6],u[10],u[14],u[3],u[7],u[11],u[15]];n.matrix.set.apply(n.matrix,f),n.matrix.decompose(n.position,n.quaternion,n.scale)}}else console.log("setJointValue: joint "+t+" doesn't exist")}};var i=qe.querySelector("scene instance_kinematics_scene");if(i)for(var s=0;s<i.childNodes.length;s++){var r=i.childNodes[s];if(1==r.nodeType)switch(r.nodeName){case"bind_joint_axis":var a=r.getAttribute("target").split("/").pop(),n=r.querySelector("axis param").textContent,o=parseInt(n.split("joint").pop().split(".")[0]),h=qe.querySelector('[sid="'+a+'"]');if(h){var l=h.parentElement;t(o,l)}}}}function v(e,t){var i,s,r,a,n=new THREE.Object3D,o=!1;for(r=0;r<e.controllers.length;r++){var h=ze[e.controllers[r].url];switch(h.type){case"skin":if(Fe[h.skin.source]){var l=new I;l.url=h.skin.source,l.instance_material=e.controllers[r].instance_material,e.geometries.push(l),o=!0,i=e.controllers[r]}else if(ze[h.skin.source]){var d=ze[h.skin.source];if(s=d,d.morph&&Fe[d.morph.source]){var l=new I;l.url=d.morph.source,l.instance_material=e.controllers[r].instance_material,e.geometries.push(l)}}break;case"morph":if(Fe[h.morph.source]){var l=new I;l.url=h.morph.source,l.instance_material=e.controllers[r].instance_material,e.geometries.push(l),s=e.controllers[r]}console.log("ColladaLoader: Morph-controller partially supported.")}}var p={};for(r=0;r<e.geometries.length;r++){var u,f=e.geometries[r],g=f.instance_material,y=Fe[f.url],b={},w=[],x=0;if(y){if(!y.mesh||!y.mesh.primitives)continue;if(0===n.name.length&&(n.name=y.id),g)for(a=0;a<g.length;a++){var N=g[a],k=Be[N.target],T=k.instance_effect.url,E=De[T].shader,R=E.material;if(y.doubleSided){if(!(N.symbol in p)){var _=R.clone();_.side=THREE.DoubleSide,p[N.symbol]=_}R=p[N.symbol]}R.opacity=R.opacity?R.opacity:1,b[N.symbol]=x,w.push(R),u=R,u.name=null===k.name||""===k.name?k.id:k.name,x++}var A,C=u||new THREE.MeshLambertMaterial({color:14540253,side:y.doubleSided?THREE.DoubleSide:THREE.FrontSide}),j=y.mesh.geometry3js;if(x>1)for(C=new THREE.MultiMaterial(w),a=0;a<j.faces.length;a++){var H=j.faces[a];H.materialIndex=b[H.daeMaterial]}void 0!==i?(m(j,i),j.morphTargets.length>0?(C.morphTargets=!0,C.skinning=!1):(C.morphTargets=!1,C.skinning=!0),A=new THREE.SkinnedMesh(j,C,(!1)),A.name="skin_"+Ie.length,Ie.push(A)):void 0!==s?(c(j,s),C.morphTargets=!0,A=new THREE.Mesh(j,C),A.name="morph_"+Se.length,Se.push(A)):A=j.isLineStrip===!0?new THREE.Line(j):new THREE.Mesh(j,C),n.add(A)}}for(r=0;r<e.cameras.length;r++){var M=e.cameras[r],O=Ue[M.url],S=new THREE.PerspectiveCamera(O.yfov,parseFloat(O.aspect_ratio),parseFloat(O.znear),parseFloat(O.zfar));n.add(S)}for(r=0;r<e.lights.length;r++){var q=null,V=e.lights[r],X=Pe[V.url];if(X&&X.technique){var L=X.color.getHex(),Y=X.intensity,Z=X.distance,z=X.falloff_angle;switch(X.technique){case"directional":q=new THREE.DirectionalLight(L,Y,Z),q.position.set(0,0,1);break;case"point":q=new THREE.PointLight(L,Y,Z);break;case"spot":q=new THREE.SpotLight(L,Y,Z,z),q.position.set(0,0,1);break;case"ambient":q=new THREE.AmbientLight(L)}}q&&n.add(q)}if(n.name=e.name||e.id||"",n.colladaId=e.id||"",n.layer=e.layer||"",n.matrix=e.matrix,n.matrix.decompose(n.position,n.quaternion,n.scale),Je.centerGeometry&&n.geometry){var F=n.geometry.center();F.multiply(n.scale),F.applyQuaternion(n.quaternion),n.position.sub(F)}for(r=0;r<e.nodes.length;r++)n.add(v(e.nodes[r],e));return n}function y(e){for(var t=qe.querySelectorAll("library_nodes node"),i=0;i<t.length;i++){var s=t[i].attributes.getNamedItem("id");if(s&&s.value===e)return t[i]}}function b(e){var t=[],i=1e6,s=-1e6;for(var r in Ze)for(var a=Ze[r],n=0;n<a.channel.length;n++){var o=a.channel[n],h=a.sampler[n],r=o.target.split("/")[0];r==e.id&&(h.create(),o.sampler=h,i=Math.min(i,h.startTime),s=Math.max(s,h.endTime),t.push(o))}return t.length&&(e.startTime=i,e.endTime=s),t}function w(e){if(e.channels&&e.channels.length){for(var t=[],i=[],s=0,r=e.channels.length;s<r;s++){var a,n=e.channels[s],o=n.fullSid,h=n.sampler,l=h.input,c=e.getTransformBySid(n.sid);if(n.arrIndices){a=[];for(var d=0,p=n.arrIndices.length;d<p;d++)a[d]=Ee(n.arrIndices[d])}else a=Re(n.member);if(c){i.indexOf(o)===-1&&i.push(o);for(var d=0,p=l.length;d<p;d++){var u=l[d],f=h.getData(c.type,d,a),m=x(t,u);if(!m){m=new ie(u);var g=N(t,u);t.splice(g===-1?t.length:g,0,m)}m.addTarget(o,c,a,f)}}else console.log('Could not find transform "'+n.sid+'" in node '+e.id)}for(var s=0;s<i.length;s++)for(var v=i[s],d=0;d<t.length;d++){var m=t[d];m.hasTarget(v)||k(t,m,d,v)}e.keys=t,e.sids=i}}function x(e,t){for(var i=null,s=0,r=e.length;s<r&&null===i;s++){var a=e[s];if(a.time===t)i=a;else if(a.time>t)break}return i}function N(e,t){for(var i=-1,s=0,r=e.length;s<r&&i===-1;s++){var a=e[s];a.time>=t&&(i=s)}return i}function k(e,t,i,s){var r=E(e,s,i?i-1:0),a=T(e,s,i+1);if(r&&a){var n,o=(t.time-r.time)/(a.time-r.time),h=r.getTarget(s),l=a.getTarget(s).data,c=h.data;if("matrix"===h.type)n=c;else if(c.length){n=[];for(var d=0;d<c.length;++d)n[d]=c[d]+(l[d]-c[d])*o}else n=c+(l-c)*o;t.addTarget(s,h.transform,h.member,n)}}function T(e,t,i){for(;i<e.length;i++){var s=e[i];if(s.hasTarget(t))return s}return null}function E(e,t,i){for(i=i>=0?i:i+e.length;i>=0;i--){var s=e[i];if(s.hasTarget(t))return s}return null}function R(){this.id="",this.init_from=""}function _(){this.id="",this.name="",this.type="",this.skin=null,this.morph=null}function A(){this.method=null,this.source=null,this.targets=null,this.weights=null}function C(){this.source="",this.bindShapeMatrix=null,this.invBindMatrices=[],this.joints=[],this.weights=[]}function j(){this.id="",this.name="",this.nodes=[],this.scene=new THREE.Group}function H(){this.id="",this.name="",this.sid="",this.nodes=[],this.controllers=[],this.transforms=[],this.geometries=[],this.channels=[],this.matrix=new THREE.Matrix4}function M(){this.sid="",this.type="",this.data=[],this.obj=null}function O(){this.url="",this.skeleton=[],this.instance_material=[]}function S(){this.symbol="",this.target=""}function I(){this.url="",this.instance_material=[]}function q(){this.id="",this.mesh=null}function V(e){this.geometry=e.id,this.primitives=[],this.vertices=null,this.geometry3js=null}function X(){this.material="",this.count=0,this.inputs=[],this.vcount=null,this.p=[],this.geometry=new THREE.Geometry}function L(){X.call(this),this.vcount=[]}function Y(){X.call(this),this.vcount=1}function Z(){X.call(this),this.vcount=3}function z(){this.source="",this.count=0,this.stride=0,this.params=[]}function F(){this.input={}}function B(){this.semantic="",this.offset=0,this.source="",this.set=0}function D(e){this.id=e,this.type=null}function U(){this.id="",this.name="",this.instance_effect=null}function P(){this.color=new THREE.Color,this.color.setRGB(Math.random(),Math.random(),Math.random()),this.color.a=1,this.texture=null,this.texcoord=null,this.texOpts=null}function G(e,t){this.type=e,this.effect=t,this.material=null}function J(e){this.effect=e,this.init_from=null,this.format=null}function W(e){this.effect=e,this.source=null,this.wrap_s=null,this.wrap_t=null,this.minfilter=null,this.magfilter=null,this.mipfilter=null}function Q(){this.id="",this.name="",this.shader=null,this.surface={},this.sampler={}}function $(){this.url=""}function K(){this.id="",this.name="",this.source={},this.sampler=[],this.channel=[]}function ee(e){this.animation=e,this.source="",this.target="",this.fullSid=null,this.sid=null,this.dotSyntax=null,this.arrSyntax=null,this.arrIndices=null,this.member=null}function te(e){this.id="",this.animation=e,this.inputs=[],this.input=null,this.output=null,this.strideOut=null,this.interpolation=null,this.startTime=null,this.endTime=null,this.duration=0}function ie(e){this.targets=[],this.time=e}function se(){this.id="",this.name="",this.technique=""}function re(){this.url=""}function ae(){this.id="",this.name="",this.technique=""}function ne(){this.url=""}function oe(){this.id="",this.name="",this.joints=[],this.links=[]}function he(){this.sid="",this.name="",this.axis=new THREE.Vector3,this.limits={min:0,max:0},this.type="",this.static=!1,this.zeroPosition=0,this.middlePosition=0}function le(){this.sid="",this.name="",this.transforms=[],this.attachments=[]}function ce(){this.joint="",this.transforms=[],this.links=[]}function de(e){var t=e.getAttribute("id");return void 0!=Le[t]?Le[t]:(Le[t]=new D(t).parse(e),Le[t])}function pe(e){for(var t=me(e),i=[],s=0,r=t.length;s<r;s++)i.push("true"===t[s]||"1"===t[s]);return i}function ue(e){for(var t=me(e),i=[],s=0,r=t.length;s<r;s++)i.push(parseFloat(t[s]));return i}function fe(e){for(var t=me(e),i=[],s=0,r=t.length;s<r;s++)i.push(parseInt(t[s],10));return i}function me(e){return e.length>0?ge(e).split(/\s+/):[]}function ge(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")}function ve(e,t,i){return e.hasAttribute(t)?parseInt(e.getAttribute(t),10):i}function ye(e,t){var i=new THREE.ImageLoader;i.load(t,function(t){e.image=t,e.needsUpdate=!0})}function be(e,t){e.doubleSided=!1;var i=t.querySelectorAll("extra double_sided")[0];i&&i&&1===parseInt(i.textContent,10)&&(e.doubleSided=!0)}function we(){if(Je.convertUpAxis!==!0||Qe===Je.upAxis)$e=null;else switch(Qe){case"X":$e="Y"===Je.upAxis?"XtoY":"XtoZ";break;case"Y":$e="X"===Je.upAxis?"YtoX":"YtoZ";break;case"Z":$e="X"===Je.upAxis?"ZtoX":"ZtoY"}}function xe(e,t){if(Je.convertUpAxis===!0&&Qe!==Je.upAxis)switch($e){case"XtoY":var i=e[0];e[0]=t*e[1],e[1]=i;break;case"XtoZ":var i=e[2];e[2]=e[1],e[1]=e[0],e[0]=i;break;case"YtoX":var i=e[0];e[0]=e[1],e[1]=t*i;break;case"YtoZ":var i=e[1];e[1]=t*e[2],e[2]=i;break;case"ZtoX":var i=e[0];e[0]=e[1],e[1]=e[2],e[2]=i;break;case"ZtoY":var i=e[1];e[1]=e[2],e[2]=t*i}}function Ne(e,t){if(Je.convertUpAxis!==!0||Qe===Je.upAxis)return t;switch(e){case"X":t="XtoY"===$e?t*-1:t;break;case"Y":t="YtoZ"===$e||"YtoX"===$e?t*-1:t;break;case"Z":t="ZtoY"===$e?t*-1:t}return t}function ke(e,t){var i=[e[t],e[t+1],e[t+2]];return xe(i,-1),new THREE.Vector3(i[0],i[1],i[2])}function Te(e){if(Je.convertUpAxis){var t=[e[0],e[4],e[8]];xe(t,-1),e[0]=t[0],e[4]=t[1],e[8]=t[2],t=[e[1],e[5],e[9]],xe(t,-1),e[1]=t[0],e[5]=t[1],e[9]=t[2],t=[e[2],e[6],e[10]],xe(t,-1),e[2]=t[0],e[6]=t[1],e[10]=t[2],t=[e[0],e[1],e[2]],xe(t,-1),e[0]=t[0],e[1]=t[1],e[2]=t[2],t=[e[4],e[5],e[6]],xe(t,-1),e[4]=t[0],e[5]=t[1],e[6]=t[2],t=[e[8],e[9],e[10]],xe(t,-1),e[8]=t[0],e[9]=t[1],e[10]=t[2],t=[e[3],e[7],e[11]],xe(t,-1),e[3]=t[0],e[7]=t[1],e[11]=t[2]}return(new THREE.Matrix4).set(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function Ee(e){if(e>-1&&e<3){var t=["X","Y","Z"],i={X:0,Y:1,Z:2};e=Re(t[e]),e=i[e]}return e}function Re(e){if(Je.convertUpAxis)switch(e){case"X":switch($e){case"XtoY":case"XtoZ":case"YtoX":e="Y";break;case"ZtoX":e="Z"}break;case"Y":switch($e){case"XtoY":case"YtoX":case"ZtoX":e="X";break;case"XtoZ":case"YtoZ":case"ZtoY":e="Z"}break;case"Z":switch($e){case"XtoZ":e="X";break;case"YtoZ":case"ZtoX":case"ZtoY":e="Y"}}return e}var _e,Ae,Ce,je,He,Me,Oe,Se,Ie,qe=null,Ve=null,Xe=null,Le={},Ye={},Ze={},ze={},Fe={},Be={},De={},Ue={},Pe={},Ge=THREE.SmoothShading,Je={centerGeometry:!1,convertUpAxis:!1,subdivideFaces:!0,upAxis:"Y",defaultEnvMap:null},We=1,Qe="Y",$e=null;return R.prototype.parse=function(e){this.id=e.getAttribute("id");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];"init_from"===i.nodeName&&(this.init_from=i.textContent)}return this},_.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),this.type="none";for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"skin":this.skin=(new C).parse(i),this.type=i.nodeName;break;case"morph":this.morph=(new A).parse(i),this.type=i.nodeName}}return this},A.prototype.parse=function(e){var t,i={},s=[];for(this.method=e.getAttribute("method"),this.source=e.getAttribute("source").replace(/^#/,""),t=0;t<e.childNodes.length;t++){var r=e.childNodes[t];if(1==r.nodeType)switch(r.nodeName){case"source":var a=(new D).parse(r);i[a.id]=a;break;case"targets":s=this.parseInputs(r);break;default:console.log(r.nodeName)}}for(t=0;t<s.length;t++){var n=s[t],a=i[n.source];switch(n.semantic){case"MORPH_TARGET":this.targets=a.read();break;case"MORPH_WEIGHT":this.weights=a.read()}}return this},A.prototype.parseInputs=function(e){for(var t=[],i=0;i<e.childNodes.length;i++){var s=e.childNodes[i];if(1==s.nodeType)switch(s.nodeName){case"input":t.push((new B).parse(s))}}return t},C.prototype.parse=function(e){var t,i,s={};this.source=e.getAttribute("source").replace(/^#/,""),this.invBindMatrices=[],this.joints=[],this.weights=[];for(var r=0;r<e.childNodes.length;r++){var a=e.childNodes[r];if(1==a.nodeType)switch(a.nodeName){case"bind_shape_matrix":var n=ue(a.textContent);this.bindShapeMatrix=Te(n);break;case"source":var o=(new D).parse(a);s[o.id]=o;break;case"joints":t=a;break;case"vertex_weights":i=a;break;default:console.log(a.nodeName)}}return this.parseJoints(t,s),this.parseWeights(i,s),this},C.prototype.parseJoints=function(e,t){for(var i=0;i<e.childNodes.length;i++){var s=e.childNodes[i];if(1==s.nodeType)switch(s.nodeName){case"input":var r=(new B).parse(s),a=t[r.source];"JOINT"===r.semantic?this.joints=a.read():"INV_BIND_MATRIX"===r.semantic&&(this.invBindMatrices=a.read())}}},C.prototype.parseWeights=function(e,t){for(var i,s,r=[],a=0;a<e.childNodes.length;a++){var n=e.childNodes[a];if(1==n.nodeType)switch(n.nodeName){case"input":r.push((new B).parse(n));break;case"v":i=fe(n.textContent);break;case"vcount":s=fe(n.textContent)}}for(var o=0,a=0;a<s.length;a++){for(var h=s[a],l=[],c=0;c<h;c++){for(var d={},p=0;p<r.length;p++){var u=r[p],f=i[o+u.offset];switch(u.semantic){case"JOINT":d.joint=f;break;case"WEIGHT":d.weight=t[u.source].data[f]}}l.push(d),o+=r.length}for(var c=0;c<l.length;c++)l[c].index=a;this.weights.push(l)}},j.prototype.getChildById=function(e,t){for(var i=0;i<this.nodes.length;i++){var s=this.nodes[i].getChildById(e,t);if(s)return s}return null},j.prototype.getChildBySid=function(e,t){for(var i=0;i<this.nodes.length;i++){var s=this.nodes[i].getChildBySid(e,t);if(s)return s}return null},j.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),this.nodes=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"node":this.nodes.push((new H).parse(i))}}return this},H.prototype.getChannelForTransform=function(e){for(var t=0;t<this.channels.length;t++){var i,s,r=this.channels[t],a=r.target.split("/"),n=(a.shift(),a.shift()),o=n.indexOf(".")>=0,h=n.indexOf("(")>=0;if(o)a=n.split("."),n=a.shift(),s=a.shift();else if(h){i=n.split("("),n=i.shift();for(var l=0;l<i.length;l++)i[l]=parseInt(i[l].replace(/\)/,""))}if(n===e)return r.info={sid:n,dotSyntax:o,arrSyntax:h,arrIndices:i},r}return null},H.prototype.getChildById=function(e,t){if(this.id===e)return this;if(t)for(var i=0;i<this.nodes.length;i++){var s=this.nodes[i].getChildById(e,t);if(s)return s}return null},H.prototype.getChildBySid=function(e,t){if(this.sid===e)return this;if(t)for(var i=0;i<this.nodes.length;i++){var s=this.nodes[i].getChildBySid(e,t);if(s)return s}return null},H.prototype.getTransformBySid=function(e){for(var t=0;t<this.transforms.length;t++)if(this.transforms[t].sid===e)return this.transforms[t];return null},H.prototype.parse=function(e){var t;this.id=e.getAttribute("id"),this.sid=e.getAttribute("sid"),this.name=e.getAttribute("name"),this.type=e.getAttribute("type"),this.layer=e.getAttribute("layer"),this.type="JOINT"===this.type?this.type:"NODE",this.nodes=[],this.transforms=[],this.geometries=[],this.cameras=[],this.lights=[],this.controllers=[],this.matrix=new THREE.Matrix4;for(var i=0;i<e.childNodes.length;i++){var s=e.childNodes[i];if(1==s.nodeType)switch(s.nodeName){case"node":this.nodes.push((new H).parse(s));break;case"instance_camera":this.cameras.push((new re).parse(s));break;case"instance_controller":this.controllers.push((new O).parse(s));break;case"instance_geometry":this.geometries.push((new I).parse(s));break;case"instance_light":this.lights.push((new ne).parse(s));break;case"instance_node":t=s.getAttribute("url").replace(/^#/,"");var r=y(t);r&&this.nodes.push((new H).parse(r));break;case"rotate":case"translate":case"scale":case"matrix":case"lookat":case"skew":this.transforms.push((new M).parse(s));break;case"extra":break;default:console.log(s.nodeName)}}return this.channels=b(this),w(this),this.updateMatrix(),this},H.prototype.updateMatrix=function(){this.matrix.identity();for(var e=0;e<this.transforms.length;e++)this.transforms[e].apply(this.matrix)},M.prototype.parse=function(e){return this.sid=e.getAttribute("sid"),this.type=e.nodeName,this.data=ue(e.textContent),this.convert(),this},M.prototype.convert=function(){switch(this.type){case"matrix":this.obj=Te(this.data);break;case"rotate":this.angle=THREE.Math.degToRad(this.data[3]);case"translate":xe(this.data,-1),this.obj=new THREE.Vector3(this.data[0],this.data[1],this.data[2]);break;case"scale":xe(this.data,1),this.obj=new THREE.Vector3(this.data[0],this.data[1],this.data[2]);break;default:console.log("Can not convert Transform of type "+this.type)}},M.prototype.apply=function(){var e=new THREE.Matrix4;return function(t){switch(this.type){case"matrix":t.multiply(this.obj);break;case"translate":t.multiply(e.makeTranslation(this.obj.x,this.obj.y,this.obj.z));break;case"rotate":t.multiply(e.makeRotationAxis(this.obj,this.angle));break;case"scale":t.scale(this.obj)}}}(),M.prototype.update=function(e,t){var i=["X","Y","Z","ANGLE"];switch(this.type){case"matrix":if(t)if(1===t.length)switch(t[0]){case 0:this.obj.n11=e[0],this.obj.n21=e[1],this.obj.n31=e[2],this.obj.n41=e[3];break;case 1:this.obj.n12=e[0],this.obj.n22=e[1],this.obj.n32=e[2],this.obj.n42=e[3];break;case 2:this.obj.n13=e[0],this.obj.n23=e[1],this.obj.n33=e[2],this.obj.n43=e[3];break;case 3:this.obj.n14=e[0],this.obj.n24=e[1],this.obj.n34=e[2],this.obj.n44=e[3]}else if(2===t.length){var s="n"+(t[0]+1)+(t[1]+1);this.obj[s]=e}else console.log("Incorrect addressing of matrix in transform.");else this.obj.copy(e);break;case"translate":case"scale":switch("[object Array]"===Object.prototype.toString.call(t)&&(t=i[t[0]]),t){case"X":this.obj.x=e;break;case"Y":this.obj.y=e;break;case"Z":this.obj.z=e;break;default:this.obj.x=e[0],this.obj.y=e[1],this.obj.z=e[2]}break;case"rotate":switch("[object Array]"===Object.prototype.toString.call(t)&&(t=i[t[0]]),t){case"X":this.obj.x=e;break;case"Y":this.obj.y=e;break;case"Z":this.obj.z=e;break;case"ANGLE":this.angle=THREE.Math.degToRad(e);break;default:this.obj.x=e[0],this.obj.y=e[1],this.obj.z=e[2],this.angle=THREE.Math.degToRad(e[3])}}},O.prototype.parse=function(e){this.url=e.getAttribute("url").replace(/^#/,""),this.skeleton=[],this.instance_material=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1===i.nodeType)switch(i.nodeName){case"skeleton":this.skeleton.push(i.textContent.replace(/^#/,""));break;case"bind_material":for(var s=i.querySelectorAll("instance_material"),r=0;r<s.length;r++){var a=s[r];this.instance_material.push((new S).parse(a))}break;case"extra":}}return this},S.prototype.parse=function(e){return this.symbol=e.getAttribute("symbol"),this.target=e.getAttribute("target").replace(/^#/,""),this},I.prototype.parse=function(e){this.url=e.getAttribute("url").replace(/^#/,""),this.instance_material=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType&&"bind_material"===i.nodeName){for(var s=i.querySelectorAll("instance_material"),r=0;r<s.length;r++){var a=s[r];this.instance_material.push((new S).parse(a))}break}}return this},q.prototype.parse=function(e){this.id=e.getAttribute("id"),be(this,e);for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"mesh":this.mesh=new V(this).parse(i);break;case"extra":}}return this},V.prototype.parse=function(e){this.primitives=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"source":de(i);break;case"vertices":this.vertices=(new F).parse(i);break;case"linestrips":this.primitives.push((new Y).parse(i));break;case"triangles":this.primitives.push((new Z).parse(i));break;case"polygons":this.primitives.push((new X).parse(i));break;case"polylist":this.primitives.push((new L).parse(i))}}if(this.geometry3js=new THREE.Geometry,null===this.vertices)return this;for(var s=Le[this.vertices.input.POSITION.source].data,t=0;t<s.length;t+=3)this.geometry3js.vertices.push(ke(s,t).clone());for(var t=0;t<this.primitives.length;t++){var r=this.primitives[t];r.setVertices(this.vertices),this.handlePrimitive(r,this.geometry3js)}return this.geometry3js.calcNormals&&(this.geometry3js.computeVertexNormals(),delete this.geometry3js.calcNormals),this},V.prototype.handlePrimitive=function(e,t){if(e instanceof Y)return void(t.isLineStrip=!0);var i,s,r,a,n,o,h,l=e.p,c=e.inputs,d=0,p=3,u=0,f=[];for(i=0;i<c.length;i++){r=c[i];var m=r.offset+1;switch(u=u<m?m:u,r.semantic){case"TEXCOORD":f.push(r.set)}}for(var g=0;g<l.length;++g)for(var v=l[g],y=0;y<v.length;){var b=[],w=[],x=null,N=[];for(p=e.vcount?e.vcount.length?e.vcount[d++]:e.vcount:v.length/u,i=0;i<p;i++)for(s=0;s<c.length;s++)switch(r=c[s],o=Le[r.source],a=v[y+i*u+r.offset],h=o.accessor.params.length,n=a*h,r.semantic){case"VERTEX":b.push(a);break;case"NORMAL":w.push(ke(o.data,n));break;case"TEXCOORD":x=x||{},void 0===x[r.set]&&(x[r.set]=[]),x[r.set].push(new THREE.Vector2(o.data[n],o.data[n+1]));break;case"COLOR":N.push((new THREE.Color).setRGB(o.data[n],o.data[n+1],o.data[n+2]))}if(0===w.length)if(r=this.vertices.input.NORMAL){o=Le[r.source],h=o.accessor.params.length;for(var k=0,T=b.length;k<T;k++)w.push(ke(o.data,b[k]*h))}else t.calcNormals=!0;if(!x&&(x={},r=this.vertices.input.TEXCOORD)){f.push(r.set),o=Le[r.source],h=o.accessor.params.length;for(var k=0,T=b.length;k<T;k++)n=b[k]*h,void 0===x[r.set]&&(x[r.set]=[]),x[r.set].push(new THREE.Vector2(o.data[n],1-o.data[n+1]))}if(0===N.length&&(r=this.vertices.input.COLOR)){o=Le[r.source],h=o.accessor.params.length;for(var k=0,T=b.length;k<T;k++)n=b[k]*h,N.push((new THREE.Color).setRGB(o.data[n],o.data[n+1],o.data[n+2]))}var E,R,_=null,A=[];if(3===p)A.push(new THREE.Face3(b[0],b[1],b[2],w,N.length?N:new THREE.Color));else if(4===p)A.push(new THREE.Face3(b[0],b[1],b[3],w.length?[w[0].clone(),w[1].clone(),w[3].clone()]:[],N.length?[N[0],N[1],N[3]]:new THREE.Color)),A.push(new THREE.Face3(b[1],b[2],b[3],w.length?[w[1].clone(),w[2].clone(),w[3].clone()]:[],N.length?[N[1],N[2],N[3]]:new THREE.Color));else if(p>4&&Je.subdivideFaces){var C=N.length?N:new THREE.Color;for(s=1;s<p-1;)A.push(new THREE.Face3(b[0],b[s],b[s+1],w.length?[w[0].clone(),w[s++].clone(),w[s].clone()]:[],C))}if(A.length)for(var k=0,T=A.length;k<T;k++)for(_=A[k],_.daeMaterial=e.material,t.faces.push(_),s=0;s<f.length;s++)E=x[f[s]],R=p>4?[E[0],E[k+1],E[k+2]]:4===p?0===k?[E[0],E[1],E[3]]:[E[1].clone(),E[2],E[3].clone()]:[E[0],E[1],E[2]],void 0===t.faceVertexUvs[s]&&(t.faceVertexUvs[s]=[]),t.faceVertexUvs[s].push(R);else console.log("dropped face with vcount "+p+" for geometry with id: "+t.id);y+=u*p}},X.prototype.setVertices=function(e){for(var t=0;t<this.inputs.length;t++)this.inputs[t].source===e.id&&(this.inputs[t].source=e.input.POSITION.source)},X.prototype.parse=function(e){this.material=e.getAttribute("material"),this.count=ve(e,"count",0);for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"input":this.inputs.push((new B).parse(e.childNodes[t]));break;case"vcount":
this.vcount=fe(i.textContent);break;case"p":this.p.push(fe(i.textContent));break;case"ph":console.warn("polygon holes not yet supported!")}}return this},L.prototype=Object.create(X.prototype),L.prototype.constructor=L,Y.prototype=Object.create(X.prototype),Y.prototype.constructor=Y,Z.prototype=Object.create(X.prototype),Z.prototype.constructor=Z,z.prototype.parse=function(e){this.params=[],this.source=e.getAttribute("source"),this.count=ve(e,"count",0),this.stride=ve(e,"stride",0);for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if("param"===i.nodeName){var s={};s.name=i.getAttribute("name"),s.type=i.getAttribute("type"),this.params.push(s)}}return this},F.prototype.parse=function(e){this.id=e.getAttribute("id");for(var t=0;t<e.childNodes.length;t++)if("input"===e.childNodes[t].nodeName){var i=(new B).parse(e.childNodes[t]);this.input[i.semantic]=i}return this},B.prototype.parse=function(e){return this.semantic=e.getAttribute("semantic"),this.source=e.getAttribute("source").replace(/^#/,""),this.set=ve(e,"set",-1),this.offset=ve(e,"offset",0),"TEXCOORD"===this.semantic&&this.set<0&&(this.set=0),this},D.prototype.parse=function(e){this.id=e.getAttribute("id");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"bool_array":this.data=pe(i.textContent),this.type=i.nodeName;break;case"float_array":this.data=ue(i.textContent),this.type=i.nodeName;break;case"int_array":this.data=fe(i.textContent),this.type=i.nodeName;break;case"IDREF_array":case"Name_array":this.data=me(i.textContent),this.type=i.nodeName;break;case"technique_common":for(var s=0;s<i.childNodes.length;s++)if("accessor"===i.childNodes[s].nodeName){this.accessor=(new z).parse(i.childNodes[s]);break}}}return this},D.prototype.read=function(){var e=[],t=this.accessor.params[0];switch(t.type){case"IDREF":case"Name":case"name":case"float":return this.data;case"float4x4":for(var i=0;i<this.data.length;i+=16){var s=this.data.slice(i,i+16),r=Te(s);e.push(r)}break;default:console.log("ColladaLoader: Source: Read dont know how to read "+t.type+".")}return e},U.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name");for(var t=0;t<e.childNodes.length;t++)if("instance_effect"===e.childNodes[t].nodeName){this.instance_effect=(new $).parse(e.childNodes[t]);break}return this},P.prototype.isColor=function(){return null===this.texture},P.prototype.isTexture=function(){return null!=this.texture},P.prototype.parse=function(e){"transparent"===e.nodeName&&(this.opaque=e.getAttribute("opaque"));for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"color":var s=ue(i.textContent);this.color=new THREE.Color,this.color.setRGB(s[0],s[1],s[2]),this.color.a=s[3];break;case"texture":this.texture=i.getAttribute("texture"),this.texcoord=i.getAttribute("texcoord"),this.texOpts={offsetU:0,offsetV:0,repeatU:1,repeatV:1,wrapU:1,wrapV:1},this.parseTexture(i)}}return this},P.prototype.parseTexture=function(e){if(!e.childNodes)return this;e.childNodes[1]&&"extra"===e.childNodes[1].nodeName&&(e=e.childNodes[1],e.childNodes[1]&&"technique"===e.childNodes[1].nodeName&&(e=e.childNodes[1]));for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"offsetU":case"offsetV":case"repeatU":case"repeatV":this.texOpts[i.nodeName]=parseFloat(i.textContent);break;case"wrapU":case"wrapV":"TRUE"===i.textContent.toUpperCase()?this.texOpts[i.nodeName]=1:this.texOpts[i.nodeName]=parseInt(i.textContent);break;default:this.texOpts[i.nodeName]=i.textContent}}return this},G.prototype.parse=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"emission":case"diffuse":case"specular":case"transparent":this[i.nodeName]=(new P).parse(i);break;case"bump":var s=i.getAttribute("bumptype");s?"heightfield"===s.toLowerCase()?this.bump=(new P).parse(i):"normalmap"===s.toLowerCase()?this.normal=(new P).parse(i):(console.error("Shader.prototype.parse: Invalid value for attribute 'bumptype' ("+s+") - valid bumptypes are 'HEIGHTFIELD' and 'NORMALMAP' - defaulting to 'HEIGHTFIELD'"),this.bump=(new P).parse(i)):(console.warn("Shader.prototype.parse: Attribute 'bumptype' missing from bump node - defaulting to 'HEIGHTFIELD'"),this.bump=(new P).parse(i));break;case"shininess":case"reflectivity":case"index_of_refraction":case"transparency":var r=i.querySelectorAll("float");r.length>0&&(this[i.nodeName]=parseFloat(r[0].textContent))}}return this.create(),this},G.prototype.create=function(){var e={},t=!1;if(void 0!==this.transparency&&void 0!==this.transparent){var i=(this.transparent,(this.transparent.color.r+this.transparent.color.g+this.transparent.color.b)/3*this.transparency);i>0&&(t=!0,e.transparent=!0,e.opacity=1-i)}var s={diffuse:"map",ambient:"lightMap",specular:"specularMap",emission:"emissionMap",bump:"bumpMap",normal:"normalMap"};for(var r in this)switch(r){case"ambient":case"emission":case"diffuse":case"specular":case"bump":case"normal":var a=this[r];if(a instanceof P)if(a.isTexture()){var n=a.texture,o=this.effect.sampler[n];if(void 0!==o&&void 0!==o.source){var h=this.effect.surface[o.source];if(void 0!==h){var l=Ye[h.init_from];if(l){var c,d=Oe+l.init_from,p=THREE.Loader.Handlers.get(d);null!==p?c=p.load(d):(c=new THREE.Texture,ye(c,d)),c.wrapS=a.texOpts.wrapU?THREE.RepeatWrapping:THREE.ClampToEdgeWrapping,c.wrapT=a.texOpts.wrapV?THREE.RepeatWrapping:THREE.ClampToEdgeWrapping,c.offset.x=a.texOpts.offsetU,c.offset.y=a.texOpts.offsetV,c.repeat.x=a.texOpts.repeatU,c.repeat.y=a.texOpts.repeatV,e[s[r]]=c,"emission"===r&&(e.emissive=16777215)}}}}else"diffuse"!==r&&t||("emission"===r?e.emissive=a.color.getHex():e[r]=a.color.getHex());break;case"shininess":e[r]=this[r];break;case"reflectivity":e[r]=this[r],e[r]>0&&(e.envMap=Je.defaultEnvMap),e.combine=THREE.MixOperation;break;case"index_of_refraction":e.refractionRatio=this[r],1!==this[r]&&(e.envMap=Je.defaultEnvMap);break;case"transparency":}switch(e.shading=Ge,e.side=this.effect.doubleSided?THREE.DoubleSide:THREE.FrontSide,void 0!==e.diffuse&&(e.color=e.diffuse,delete e.diffuse),this.type){case"constant":void 0!=e.emissive&&(e.color=e.emissive),this.material=new THREE.MeshBasicMaterial(e);break;case"phong":case"blinn":this.material=new THREE.MeshPhongMaterial(e);break;case"lambert":default:this.material=new THREE.MeshLambertMaterial(e)}return this.material},J.prototype.parse=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"init_from":this.init_from=i.textContent;break;case"format":this.format=i.textContent;break;default:console.log("unhandled Surface prop: "+i.nodeName)}}return this},W.prototype.parse=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"source":this.source=i.textContent;break;case"minfilter":this.minfilter=i.textContent;break;case"magfilter":this.magfilter=i.textContent;break;case"mipfilter":this.mipfilter=i.textContent;break;case"wrap_s":this.wrap_s=i.textContent;break;case"wrap_t":this.wrap_t=i.textContent;break;default:console.log("unhandled Sampler2D prop: "+i.nodeName)}}return this},Q.prototype.create=function(){if(null===this.shader)return null},Q.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),be(this,e),this.shader=null;for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"profile_COMMON":this.parseTechnique(this.parseProfileCOMMON(i))}}return this},Q.prototype.parseNewparam=function(e){for(var t=e.getAttribute("sid"),i=0;i<e.childNodes.length;i++){var s=e.childNodes[i];if(1==s.nodeType)switch(s.nodeName){case"surface":this.surface[t]=new J(this).parse(s);break;case"sampler2D":this.sampler[t]=new W(this).parse(s);break;case"extra":break;default:console.log(s.nodeName)}}},Q.prototype.parseProfileCOMMON=function(e){for(var t,i=0;i<e.childNodes.length;i++){var s=e.childNodes[i];if(1==s.nodeType)switch(s.nodeName){case"profile_COMMON":this.parseProfileCOMMON(s);break;case"technique":t=s;break;case"newparam":this.parseNewparam(s);break;case"image":var r=(new R).parse(s);Ye[r.id]=r;break;case"extra":break;default:console.log(s.nodeName)}}return t},Q.prototype.parseTechnique=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"constant":case"lambert":case"blinn":case"phong":this.shader=new G(i.nodeName,this).parse(i);break;case"extra":this.parseExtra(i)}}},Q.prototype.parseExtra=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"technique":this.parseExtraTechnique(i)}}},Q.prototype.parseExtraTechnique=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"bump":this.shader.parse(e)}}},$.prototype.parse=function(e){return this.url=e.getAttribute("url").replace(/^#/,""),this},K.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),this.source={};for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"animation":var s=(new K).parse(i);for(var r in s.source)this.source[r]=s.source[r];for(var a=0;a<s.channel.length;a++)this.channel.push(s.channel[a]),this.sampler.push(s.sampler[a]);break;case"source":var r=(new D).parse(i);this.source[r.id]=r;break;case"sampler":this.sampler.push(new te(this).parse(i));break;case"channel":this.channel.push(new ee(this).parse(i))}}return this},ee.prototype.parse=function(e){this.source=e.getAttribute("source").replace(/^#/,""),this.target=e.getAttribute("target");var t=this.target.split("/"),i=(t.shift(),t.shift()),s=i.indexOf(".")>=0,r=i.indexOf("(")>=0;if(s)t=i.split("."),this.sid=t.shift(),this.member=t.shift();else if(r){var a=i.split("(");this.sid=a.shift();for(var n=0;n<a.length;n++)a[n]=parseInt(a[n].replace(/\)/,""));this.arrIndices=a}else this.sid=i;return this.fullSid=i,this.dotSyntax=s,this.arrSyntax=r,this},te.prototype.parse=function(e){this.id=e.getAttribute("id"),this.inputs=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"input":this.inputs.push((new B).parse(i))}}return this},te.prototype.create=function(){for(var e=0;e<this.inputs.length;e++){var t=this.inputs[e],i=this.animation.source[t.source];switch(t.semantic){case"INPUT":this.input=i.read();break;case"OUTPUT":this.output=i.read(),this.strideOut=i.accessor.stride;break;case"INTERPOLATION":this.interpolation=i.read();break;case"IN_TANGENT":break;case"OUT_TANGENT":break;default:console.log(t.semantic)}}if(this.startTime=0,this.endTime=0,this.duration=0,this.input.length){this.startTime=1e8,this.endTime=-1e8;for(var e=0;e<this.input.length;e++)this.startTime=Math.min(this.startTime,this.input[e]),this.endTime=Math.max(this.endTime,this.input[e]);this.duration=this.endTime-this.startTime}},te.prototype.getData=function(e,t,i){var s;if("matrix"===e&&16===this.strideOut)s=this.output[t];else if(this.strideOut>1){s=[],t*=this.strideOut;for(var r=0;r<this.strideOut;++r)s[r]=this.output[t+r];if(3===this.strideOut)switch(e){case"rotate":case"translate":xe(s,-1);break;case"scale":xe(s,1)}else 4===this.strideOut&&"matrix"===e&&xe(s,-1)}else s=this.output[t],i&&"translate"===e&&(s=Ne(i,s));return s},ie.prototype.addTarget=function(e,t,i,s){this.targets.push({sid:e,member:i,transform:t,data:s})},ie.prototype.apply=function(e){for(var t=0;t<this.targets.length;++t){var i=this.targets[t];e&&i.sid!==e||i.transform.update(i.data,i.member)}},ie.prototype.getTarget=function(e){for(var t=0;t<this.targets.length;++t)if(this.targets[t].sid===e)return this.targets[t];return null},ie.prototype.hasTarget=function(e){for(var t=0;t<this.targets.length;++t)if(this.targets[t].sid===e)return!0;return!1},ie.prototype.interpolate=function(e,t){for(var i=0,s=this.targets.length;i<s;i++){var r,a=this.targets[i],n=e.getTarget(a.sid);if("matrix"!==a.transform.type&&n){var o=(t-this.time)/(e.time-this.time),h=n.data,l=a.data;if(o<0&&(o=0),o>1&&(o=1),l.length){r=[];for(var c=0;c<l.length;++c)r[c]=l[c]+(h[c]-l[c])*o}else r=l+(h-l)*o}else r=a.data;a.transform.update(r,a.member)}},se.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"optics":this.parseOptics(i)}}return this},se.prototype.parseOptics=function(e){for(var t=0;t<e.childNodes.length;t++)if("technique_common"===e.childNodes[t].nodeName)for(var i=e.childNodes[t],s=0;s<i.childNodes.length;s++)if(this.technique=i.childNodes[s].nodeName,"perspective"===this.technique)for(var r=i.childNodes[s],a=0;a<r.childNodes.length;a++){var n=r.childNodes[a];switch(n.nodeName){case"yfov":this.yfov=n.textContent;break;case"xfov":this.xfov=n.textContent;break;case"znear":this.znear=n.textContent;break;case"zfar":this.zfar=n.textContent;break;case"aspect_ratio":this.aspect_ratio=n.textContent}}else if("orthographic"===this.technique)for(var o=i.childNodes[s],a=0;a<o.childNodes.length;a++){var n=o.childNodes[a];switch(n.nodeName){case"xmag":this.xmag=n.textContent;break;case"ymag":this.ymag=n.textContent;break;case"znear":this.znear=n.textContent;break;case"zfar":this.zfar=n.textContent;break;case"aspect_ratio":this.aspect_ratio=n.textContent}}return this},re.prototype.parse=function(e){return this.url=e.getAttribute("url").replace(/^#/,""),this},ae.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"technique_common":this.parseCommon(i);break;case"technique":this.parseTechnique(i)}}return this},ae.prototype.parseCommon=function(e){for(var t=0;t<e.childNodes.length;t++)switch(e.childNodes[t].nodeName){case"directional":case"point":case"spot":case"ambient":this.technique=e.childNodes[t].nodeName;for(var i=e.childNodes[t],s=0;s<i.childNodes.length;s++){var r=i.childNodes[s];switch(r.nodeName){case"color":var a=ue(r.textContent);this.color=new THREE.Color(0),this.color.setRGB(a[0],a[1],a[2]),this.color.a=a[3];break;case"falloff_angle":this.falloff_angle=parseFloat(r.textContent);break;case"quadratic_attenuation":var n=parseFloat(r.textContent);this.distance=n?Math.sqrt(1/n):0}}}return this},ae.prototype.parseTechnique=function(e){this.profile=e.getAttribute("profile");for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];switch(i.nodeName){case"intensity":this.intensity=parseFloat(i.textContent)}}return this},ne.prototype.parse=function(e){return this.url=e.getAttribute("url").replace(/^#/,""),this},oe.prototype.parse=function(e){this.id=e.getAttribute("id"),this.name=e.getAttribute("name"),this.joints=[],this.links=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"technique_common":this.parseCommon(i)}}return this},oe.prototype.parseCommon=function(e){for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(e.childNodes[t].nodeName){case"joint":this.joints.push((new he).parse(i));break;case"link":this.links.push((new le).parse(i))}}return this},he.prototype.parse=function(e){this.sid=e.getAttribute("sid"),this.name=e.getAttribute("name"),this.axis=new THREE.Vector3,this.limits={min:0,max:0},this.type="",this.static=!1,this.zeroPosition=0,this.middlePosition=0;var t=e.querySelector("axis"),i=ue(t.textContent);this.axis=ke(i,0);var s=e.querySelector("limits min")?parseFloat(e.querySelector("limits min").textContent):-360,r=e.querySelector("limits max")?parseFloat(e.querySelector("limits max").textContent):360;this.limits={min:s,max:r};for(var a=["prismatic","revolute"],n=0;n<a.length;n++){var o=a[n],h=e.querySelector(o);h&&(this.type=o)}return this.limits.min>=this.limits.max&&(this.static=!0),this.middlePosition=(this.limits.min+this.limits.max)/2,this},le.prototype.parse=function(e){this.sid=e.getAttribute("sid"),this.name=e.getAttribute("name"),this.transforms=[],this.attachments=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"attachment_full":this.attachments.push((new ce).parse(i));break;case"rotate":case"translate":case"matrix":this.transforms.push((new M).parse(i))}}return this},ce.prototype.parse=function(e){this.joint=e.getAttribute("joint").split("/").pop(),this.links=[];for(var t=0;t<e.childNodes.length;t++){var i=e.childNodes[t];if(1==i.nodeType)switch(i.nodeName){case"link":this.links.push((new le).parse(i));break;case"rotate":case"translate":case"matrix":this.transforms.push((new M).parse(i))}}return this},{load:e,parse:t,setPreferredShading:i,applySkin:m,geometries:Fe,options:Je}};
},{}],15:[function(_dereq_,module,exports){
THREE.MTLLoader=function(a){this.manager=void 0!==a?a:THREE.DefaultLoadingManager},THREE.MTLLoader.prototype={constructor:THREE.MTLLoader,load:function(a,t,r,s){var i=this,e=new THREE.XHRLoader(this.manager);e.setPath(this.path),e.load(a,function(a){t(i.parse(a))},r,s)},setPath:function(a){this.path=a},setBaseUrl:function(a){this.baseUrl=a},setCrossOrigin:function(a){this.crossOrigin=a},setMaterialOptions:function(a){this.materialOptions=a},parse:function(a){for(var t=a.split("\n"),r={},s=/\s+/,i={},e=0;e<t.length;e++){var o=t[e];if(o=o.trim(),0!==o.length&&"#"!==o.charAt(0)){var n=o.indexOf(" "),h=n>=0?o.substring(0,n):o;h=h.toLowerCase();var p=n>=0?o.substring(n+1):"";if(p=p.trim(),"newmtl"===h)r={name:p},i[p]=r;else if(r)if("ka"===h||"kd"===h||"ks"===h){var l=p.split(s,3);r[h]=[parseFloat(l[0]),parseFloat(l[1]),parseFloat(l[2])]}else r[h]=p}}var c=new THREE.MTLLoader.MaterialCreator(this.baseUrl,this.materialOptions);return c.setCrossOrigin(this.crossOrigin),c.setManager(this.manager),c.setMaterials(i),c}},THREE.MTLLoader.MaterialCreator=function(a,t){this.baseUrl=a,this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.side=this.options&&this.options.side?this.options.side:THREE.FrontSide,this.wrap=this.options&&this.options.wrap?this.options.wrap:THREE.RepeatWrapping},THREE.MTLLoader.MaterialCreator.prototype={constructor:THREE.MTLLoader.MaterialCreator,setCrossOrigin:function(a){this.crossOrigin=a},setManager:function(a){this.manager=a},setMaterials:function(a){this.materialsInfo=this.convert(a),this.materials={},this.materialsArray=[],this.nameLookup={}},convert:function(a){if(!this.options)return a;var t={};for(var r in a){var s=a[r],i={};t[r]=i;for(var e in s){var o=!0,n=s[e],h=e.toLowerCase();switch(h){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(n=[n[0]/255,n[1]/255,n[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===n[0]&&0===n[1]&&0===n[1]&&(o=!1)}o&&(i[h]=n)}}return t},preload:function(){for(var a in this.materialsInfo)this.create(a)},getIndex:function(a){return this.nameLookup[a]},getAsArray:function(){var a=0;for(var t in this.materialsInfo)this.materialsArray[a]=this.create(t),this.nameLookup[t]=a,a++;return this.materialsArray},create:function(a){return void 0===this.materials[a]&&this.createMaterial_(a),this.materials[a]},createMaterial_:function(a){var t=this.materialsInfo[a],r={name:a,side:this.side};for(var s in t){var i=t[s];if(""!==i)switch(s.toLowerCase()){case"kd":r.color=(new THREE.Color).fromArray(i);break;case"ks":r.specular=(new THREE.Color).fromArray(i);break;case"map_kd":r.map=this.loadTexture(this.baseUrl+i),r.map.wrapS=this.wrap,r.map.wrapT=this.wrap;break;case"ns":r.shininess=parseFloat(i);break;case"d":i<1&&(r.opacity=i,r.transparent=!0);break;case"Tr":i>0&&(r.opacity=1-i,r.transparent=!0);break;case"map_bump":case"bump":if(r.bumpMap)break;r.bumpMap=this.loadTexture(this.baseUrl+i),r.bumpMap.wrapS=this.wrap,r.bumpMap.wrapT=this.wrap}}return this.materials[a]=new THREE.MeshPhongMaterial(r),this.materials[a]},loadTexture:function(a,t,r,s,i){var e,o=THREE.Loader.Handlers.get(a),n=void 0!==this.manager?this.manager:THREE.DefaultLoadingManager;return null===o&&(o=new THREE.TextureLoader(n)),o.setCrossOrigin&&o.setCrossOrigin(this.crossOrigin),e=o.load(a,r,s,i),void 0!==t&&(e.mapping=t),e}},THREE.EventDispatcher.prototype.apply(THREE.MTLLoader.prototype);
},{}],16:[function(_dereq_,module,exports){
THREE.OBJLoader=function(e){this.manager=void 0!==e?e:THREE.DefaultLoadingManager,this.materials=null,this.regexp={vertex_pattern:/^v\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,normal_pattern:/^vn\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,uv_pattern:/^vt\s+([\d|\.|\+|\-|e|E]+)\s+([\d|\.|\+|\-|e|E]+)/,face_vertex:/^f\s+(-?\d+)\s+(-?\d+)\s+(-?\d+)(?:\s+(-?\d+))?/,face_vertex_uv:/^f\s+(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)(?:\s+(-?\d+)\/(-?\d+))?/,face_vertex_uv_normal:/^f\s+(-?\d+)\/(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\/(-?\d+)\s+(-?\d+)\/(-?\d+)\/(-?\d+)(?:\s+(-?\d+)\/(-?\d+)\/(-?\d+))?/,face_vertex_normal:/^f\s+(-?\d+)\/\/(-?\d+)\s+(-?\d+)\/\/(-?\d+)\s+(-?\d+)\/\/(-?\d+)(?:\s+(-?\d+)\/\/(-?\d+))?/,object_pattern:/^[og]\s*(.+)?/,smoothing_pattern:/^s\s+(\d+|on|off)/,material_library_pattern:/^mtllib /,material_use_pattern:/^usemtl /}},THREE.OBJLoader.prototype={constructor:THREE.OBJLoader,load:function(e,t,r,a){var s=this,i=new THREE.XHRLoader(s.manager);i.setPath(this.path),i.load(e,function(e){t(s.parse(e))},r,a)},setPath:function(e){this.path=e},setMaterials:function(e){this.materials=e},_createParserState:function(){var e={objects:[],object:{},vertices:[],normals:[],uvs:[],materialLibraries:[],startObject:function(e,t){return this.object&&this.object.fromDeclaration===!1?(this.object.name=e,void(this.object.fromDeclaration=t!==!1)):(this.object={name:e||"",geometry:{vertices:[],normals:[],uvs:[]},material:{name:"",smooth:!0},fromDeclaration:t!==!1},void this.objects.push(this.object))},parseVertexIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseNormalIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseUVIndex:function(e,t){var r=parseInt(e,10);return 2*(r>=0?r-1:r+t/2)},addVertex:function(e,t,r){var a=this.vertices,s=this.object.geometry.vertices;s.push(a[e+0]),s.push(a[e+1]),s.push(a[e+2]),s.push(a[t+0]),s.push(a[t+1]),s.push(a[t+2]),s.push(a[r+0]),s.push(a[r+1]),s.push(a[r+2])},addVertexLine:function(e){var t=this.vertices,r=this.object.geometry.vertices;r.push(t[e+0]),r.push(t[e+1]),r.push(t[e+2])},addNormal:function(e,t,r){var a=this.normals,s=this.object.geometry.normals;s.push(a[e+0]),s.push(a[e+1]),s.push(a[e+2]),s.push(a[t+0]),s.push(a[t+1]),s.push(a[t+2]),s.push(a[r+0]),s.push(a[r+1]),s.push(a[r+2])},addUV:function(e,t,r){var a=this.uvs,s=this.object.geometry.uvs;s.push(a[e+0]),s.push(a[e+1]),s.push(a[t+0]),s.push(a[t+1]),s.push(a[r+0]),s.push(a[r+1])},addUVLine:function(e){var t=this.uvs,r=this.object.geometry.uvs;r.push(t[e+0]),r.push(t[e+1])},addFace:function(e,t,r,a,s,i,n,o,d,h,l,u){var p,c=this.vertices.length,m=this.parseVertexIndex(e,c),v=this.parseVertexIndex(t,c),f=this.parseVertexIndex(r,c);if(void 0===a?this.addVertex(m,v,f):(p=this.parseVertexIndex(a,c),this.addVertex(m,v,p),this.addVertex(v,f,p)),void 0!==s){var x=this.uvs.length;m=this.parseUVIndex(s,x),v=this.parseUVIndex(i,x),f=this.parseUVIndex(n,x),void 0===a?this.addUV(m,v,f):(p=this.parseUVIndex(o,x),this.addUV(m,v,p),this.addUV(v,f,p))}if(void 0!==d){var g=this.normals.length;m=this.parseNormalIndex(d,g),v=d===h?m:this.parseNormalIndex(h,g),f=d===l?m:this.parseNormalIndex(l,g),void 0===a?this.addNormal(m,v,f):(p=this.parseNormalIndex(u,g),this.addNormal(m,v,p),this.addNormal(v,f,p))}},addLineGeometry:function(e,t){this.object.geometry.type="Line";for(var r=this.vertices.length,a=this.uvs.length,s=0,i=e.length;s<i;s++)this.addVertexLine(this.parseVertexIndex(e[s],r));for(var n=0,i=t.length;n<i;n++)this.addUVLine(this.parseUVIndex(t[n],a))}};return e.startObject("",!1),e},parse:function(e){console.time("OBJLoader");var t=this._createParserState();e.indexOf("\r\n")!==-1&&(e=e.replace("\r\n","\n"));for(var r=e.split("\n"),a="",s="",i="",n=0,o=[],d="function"==typeof"".trimLeft,h=0,l=r.length;h<l;h++)if(a=r[h],a=d?a.trimLeft():a.trim(),n=a.length,0!==n&&(s=a.charAt(0),"#"!==s))if("v"===s)if(i=a.charAt(1)," "===i&&null!==(o=this.regexp.vertex_pattern.exec(a)))t.vertices.push(parseFloat(o[1]),parseFloat(o[2]),parseFloat(o[3]));else if("n"===i&&null!==(o=this.regexp.normal_pattern.exec(a)))t.normals.push(parseFloat(o[1]),parseFloat(o[2]),parseFloat(o[3]));else{if("t"!==i||null===(o=this.regexp.uv_pattern.exec(a)))throw new Error("Unexpected vertex/normal/uv line: '"+a+"'");t.uvs.push(parseFloat(o[1]),parseFloat(o[2]))}else if("f"===s)if(null!==(o=this.regexp.face_vertex_uv_normal.exec(a)))t.addFace(o[1],o[4],o[7],o[10],o[2],o[5],o[8],o[11],o[3],o[6],o[9],o[12]);else if(null!==(o=this.regexp.face_vertex_uv.exec(a)))t.addFace(o[1],o[3],o[5],o[7],o[2],o[4],o[6],o[8]);else if(null!==(o=this.regexp.face_vertex_normal.exec(a)))t.addFace(o[1],o[3],o[5],o[7],void 0,void 0,void 0,void 0,o[2],o[4],o[6],o[8]);else{if(null===(o=this.regexp.face_vertex.exec(a)))throw new Error("Unexpected face line: '"+a+"'");t.addFace(o[1],o[2],o[3],o[4])}else if("l"===s){var u=a.substring(1).trim().split(" "),p=[],c=[];if(a.indexOf("/")===-1)p=u;else for(var m=0,v=u.length;m<v;m++){var f=u[m].split("/");""!==f[0]&&p.push(f[0]),""!==f[1]&&c.push(f[1])}t.addLineGeometry(p,c)}else if(null!==(o=this.regexp.object_pattern.exec(a))){var x=o[0].substr(1).trim();t.startObject(x)}else if(this.regexp.material_use_pattern.test(a))t.object.material.name=a.substring(7).trim();else if(this.regexp.material_library_pattern.test(a))t.materialLibraries.push(a.substring(7).trim());else{if(null===(o=this.regexp.smoothing_pattern.exec(a))){if("\0"===a)continue;throw new Error("Unexpected line: '"+a+"'")}var g=o[1].trim().toLowerCase();t.object.material.smooth="1"===g||"on"===g}var E=new THREE.Group;E.materialLibraries=[].concat(t.materialLibraries);for(var h=0,l=t.objects.length;h<l;h++){var b=t.objects[h],_=b.geometry,L="Line"===_.type;if(0!==_.vertices.length){var V=new THREE.BufferGeometry;V.addAttribute("position",new THREE.BufferAttribute(new Float32Array(_.vertices),3)),_.normals.length>0?V.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(_.normals),3)):V.computeVertexNormals(),_.uvs.length>0&&V.addAttribute("uv",new THREE.BufferAttribute(new Float32Array(_.uvs),2));var j;if(null!==this.materials&&(j=this.materials.create(b.material.name),L&&j&&!(j instanceof THREE.LineBasicMaterial))){var w=new THREE.LineBasicMaterial;w.copy(j),j=w}j||(j=L?new THREE.LineBasicMaterial:new THREE.MeshPhongMaterial,j.name=b.material.name),j.shading=b.material.smooth?THREE.SmoothShading:THREE.FlatShading;var y=L?new THREE.Line(V,j):new THREE.Mesh(V,j);y.name=b.name,E.add(y)}}return console.timeEnd("OBJLoader"),E}};
},{}],17:[function(_dereq_,module,exports){
var self=self||{},THREE={REVISION:"76"};"function"==typeof define&&define.amd?define("three",THREE):"undefined"!=typeof exports&&"undefined"!=typeof module&&(module.exports=THREE),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?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]}}),void 0===Object.assign&&Object.defineProperty(Object,"assign",{writable:!0,configurable:!0,value:function(t){"use strict";if(void 0===t||null===t)throw new TypeError("Cannot convert first argument to object");for(var e=Object(t),r=1,i=arguments.length;r!==i;++r){var n=arguments[r];if(void 0!==n&&null!==n){n=Object(n);for(var a=Object.keys(n),o=0,s=a.length;o!==s;++o){var c=a[o],h=Object.getOwnPropertyDescriptor(n,c);void 0!==h&&h.enumerable&&(e[c]=n[c])}}}return e}}),THREE.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2},THREE.CullFaceNone=0,THREE.CullFaceBack=1,THREE.CullFaceFront=2,THREE.CullFaceFrontBack=3,THREE.FrontFaceDirectionCW=0,THREE.FrontFaceDirectionCCW=1,THREE.BasicShadowMap=0,THREE.PCFShadowMap=1,THREE.PCFSoftShadowMap=2,THREE.FrontSide=0,THREE.BackSide=1,THREE.DoubleSide=2,THREE.FlatShading=1,THREE.SmoothShading=2,THREE.NoColors=0,THREE.FaceColors=1,THREE.VertexColors=2,THREE.NoBlending=0,THREE.NormalBlending=1,THREE.AdditiveBlending=2,THREE.SubtractiveBlending=3,THREE.MultiplyBlending=4,THREE.CustomBlending=5,THREE.AddEquation=100,THREE.SubtractEquation=101,THREE.ReverseSubtractEquation=102,THREE.MinEquation=103,THREE.MaxEquation=104,THREE.ZeroFactor=200,THREE.OneFactor=201,THREE.SrcColorFactor=202,THREE.OneMinusSrcColorFactor=203,THREE.SrcAlphaFactor=204,THREE.OneMinusSrcAlphaFactor=205,THREE.DstAlphaFactor=206,THREE.OneMinusDstAlphaFactor=207,THREE.DstColorFactor=208,THREE.OneMinusDstColorFactor=209,THREE.SrcAlphaSaturateFactor=210,THREE.NeverDepth=0,THREE.AlwaysDepth=1,THREE.LessDepth=2,THREE.LessEqualDepth=3,THREE.EqualDepth=4,THREE.GreaterEqualDepth=5,THREE.GreaterDepth=6,THREE.NotEqualDepth=7,THREE.MultiplyOperation=0,THREE.MixOperation=1,THREE.AddOperation=2,THREE.NoToneMapping=0,THREE.LinearToneMapping=1,THREE.ReinhardToneMapping=2,THREE.Uncharted2ToneMapping=3,THREE.CineonToneMapping=4,THREE.UVMapping=300,THREE.CubeReflectionMapping=301,THREE.CubeRefractionMapping=302,THREE.EquirectangularReflectionMapping=303,THREE.EquirectangularRefractionMapping=304,THREE.SphericalReflectionMapping=305,THREE.CubeUVReflectionMapping=306,THREE.CubeUVRefractionMapping=307,THREE.RepeatWrapping=1e3,THREE.ClampToEdgeWrapping=1001,THREE.MirroredRepeatWrapping=1002,THREE.NearestFilter=1003,THREE.NearestMipMapNearestFilter=1004,THREE.NearestMipMapLinearFilter=1005,THREE.LinearFilter=1006,THREE.LinearMipMapNearestFilter=1007,THREE.LinearMipMapLinearFilter=1008,THREE.UnsignedByteType=1009,THREE.ByteType=1010,THREE.ShortType=1011,THREE.UnsignedShortType=1012,THREE.IntType=1013,THREE.UnsignedIntType=1014,THREE.FloatType=1015,THREE.HalfFloatType=1025,THREE.UnsignedShort4444Type=1016,THREE.UnsignedShort5551Type=1017,THREE.UnsignedShort565Type=1018,THREE.AlphaFormat=1019,THREE.RGBFormat=1020,THREE.RGBAFormat=1021,THREE.LuminanceFormat=1022,THREE.LuminanceAlphaFormat=1023,THREE.RGBEFormat=THREE.RGBAFormat,THREE.DepthFormat=1026,THREE.RGB_S3TC_DXT1_Format=2001,THREE.RGBA_S3TC_DXT1_Format=2002,THREE.RGBA_S3TC_DXT3_Format=2003,THREE.RGBA_S3TC_DXT5_Format=2004,THREE.RGB_PVRTC_4BPPV1_Format=2100,THREE.RGB_PVRTC_2BPPV1_Format=2101,THREE.RGBA_PVRTC_4BPPV1_Format=2102,THREE.RGBA_PVRTC_2BPPV1_Format=2103,THREE.RGB_ETC1_Format=2151,THREE.LoopOnce=2200,THREE.LoopRepeat=2201,THREE.LoopPingPong=2202,THREE.InterpolateDiscrete=2300,THREE.InterpolateLinear=2301,THREE.InterpolateSmooth=2302,THREE.ZeroCurvatureEnding=2400,THREE.ZeroSlopeEnding=2401,THREE.WrapAroundEnding=2402,THREE.TrianglesDrawMode=0,THREE.TriangleStripDrawMode=1,THREE.TriangleFanDrawMode=2,THREE.LinearEncoding=3e3,THREE.sRGBEncoding=3001,THREE.GammaEncoding=3007,THREE.RGBEEncoding=3002,THREE.LogLuvEncoding=3003,THREE.RGBM7Encoding=3004,THREE.RGBM16Encoding=3005,THREE.RGBDEncoding=3006,THREE.BasicDepthPacking=3200,THREE.RGBADepthPacking=3201,THREE.Color=function(t){return 3===arguments.length?this.fromArray(arguments):this.set(t)},THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,set:function(t){return t instanceof THREE.Color?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){this.r=t,this.g=t,this.b=t},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,i){if(e=THREE.Math.euclideanModulo(e,1),r=THREE.Math.clamp(r,0,1),i=THREE.Math.clamp(i,0,1),0===r)this.r=this.g=this.b=i;else{var n=i<=.5?i*(1+r):i+r-i*r,a=2*i-n;this.r=t(a,n,e+1/3),this.g=t(a,n,e),this.b=t(a,n,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 i,n=r[1],a=r[2];switch(n){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,e(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,e(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(i[1])/360,s=parseInt(i[2],10)/100,c=parseInt(i[3],10)/100;return e(i[5]),this.setHSL(o,s,c)}}}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=THREE.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,i=t||{h:0,s:0,l:0},n=this.r,a=this.g,o=this.b,s=Math.max(n,a,o),c=Math.min(n,a,o),h=(c+s)/2;if(c===s)e=0,r=0;else{var l=s-c;switch(r=h<=.5?l/(s+c):l/(2-s-c),s){case n:e=(a-o)/l+(a<o?6:0);break;case a:e=(o-n)/l+2;break;case o:e=(n-a)/l+4}e/=6}return i.h=e,i.s=r,i.l=h,i},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,e,r){var i=this.getHSL();return i.h+=t,i.s+=e,i.l+=r,this.setHSL(i.h,i.s,i.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}},THREE.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},THREE.Quaternion=function(t,e,r,i){this._x=t||0,this._y=e||0,this._z=r||0,this._w=void 0!==i?i:1},THREE.Quaternion.prototype={constructor:THREE.Quaternion,get x(){return this._x},set x(t){this._x=t,this.onChangeCallback()},get y(){return this._y},set y(t){this._y=t,this.onChangeCallback()},get z(){return this._z},set z(t){this._z=t,this.onChangeCallback()},get w(){return this._w},set w(t){this._w=t,this.onChangeCallback()},set:function(t,e,r,i){return this._x=t,this._y=e,this._z=r,this._w=i,this.onChangeCallback(),this},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=t.w,this.onChangeCallback(),this},setFromEuler:function(t,e){if(t instanceof THREE.Euler==!1)throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var r=Math.cos(t._x/2),i=Math.cos(t._y/2),n=Math.cos(t._z/2),a=Math.sin(t._x/2),o=Math.sin(t._y/2),s=Math.sin(t._z/2),c=t.order;return"XYZ"===c?(this._x=a*i*n+r*o*s,this._y=r*o*n-a*i*s,this._z=r*i*s+a*o*n,this._w=r*i*n-a*o*s):"YXZ"===c?(this._x=a*i*n+r*o*s,this._y=r*o*n-a*i*s,this._z=r*i*s-a*o*n,this._w=r*i*n+a*o*s):"ZXY"===c?(this._x=a*i*n-r*o*s,this._y=r*o*n+a*i*s,this._z=r*i*s+a*o*n,this._w=r*i*n-a*o*s):"ZYX"===c?(this._x=a*i*n-r*o*s,this._y=r*o*n+a*i*s,this._z=r*i*s-a*o*n,this._w=r*i*n+a*o*s):"YZX"===c?(this._x=a*i*n+r*o*s,this._y=r*o*n+a*i*s,this._z=r*i*s-a*o*n,this._w=r*i*n-a*o*s):"XZY"===c&&(this._x=a*i*n-r*o*s,this._y=r*o*n-a*i*s,this._z=r*i*s+a*o*n,this._w=r*i*n+a*o*s),e!==!1&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var r=e/2,i=Math.sin(r);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(r),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e,r=t.elements,i=r[0],n=r[4],a=r[8],o=r[1],s=r[5],c=r[9],h=r[2],l=r[6],u=r[10],p=i+s+u;return p>0?(e=.5/Math.sqrt(p+1),this._w=.25/e,this._x=(l-c)*e,this._y=(a-h)*e,this._z=(o-n)*e):i>s&&i>u?(e=2*Math.sqrt(1+i-s-u),this._w=(l-c)/e,this._x=.25*e,this._y=(n+o)/e,this._z=(a+h)/e):s>u?(e=2*Math.sqrt(1+s-i-u),this._w=(a-h)/e,this._x=(n+o)/e,this._y=.25*e,this._z=(c+l)/e):(e=2*Math.sqrt(1+u-i-s),this._w=(o-n)/e,this._x=(a+h)/e,this._y=(c+l)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:function(){var t,e,r=1e-6;return function(i,n){return void 0===t&&(t=new THREE.Vector3),e=i.dot(n)+1,e<r?(e=0,Math.abs(i.x)>Math.abs(i.z)?t.set(-i.y,i.x,0):t.set(0,-i.z,i.y)):t.crossVectors(i,n),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,i=t._y,n=t._z,a=t._w,o=e._x,s=e._y,c=e._z,h=e._w;return this._x=r*h+a*o+i*c-n*s,this._y=i*h+a*s+n*o-r*c,this._z=n*h+a*c+r*s-i*o,this._w=a*h-r*o-i*s-n*c,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var r=this._x,i=this._y,n=this._z,a=this._w,o=a*t._w+r*t._x+i*t._y+n*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=a,this._x=r,this._y=i,this._z=n,this;var s=Math.sqrt(1-o*o);if(Math.abs(s)<.001)return this._w=.5*(a+this._w),this._x=.5*(r+this._x),this._y=.5*(i+this._y),this._z=.5*(n+this._z),this;var c=Math.atan2(s,o),h=Math.sin((1-e)*c)/s,l=Math.sin(e*c)/s;return this._w=a*h+this._w*l,this._x=r*h+this._x*l,this._y=i*h+this._y*l,this._z=n*h+this._z*l,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(){}},Object.assign(THREE.Quaternion,{slerp:function(t,e,r,i){return r.copy(t).slerp(e,i)},slerpFlat:function(t,e,r,i,n,a,o){var s=r[i+0],c=r[i+1],h=r[i+2],l=r[i+3],u=n[a+0],p=n[a+1],d=n[a+2],E=n[a+3];if(l!==E||s!==u||c!==p||h!==d){var f=1-o,m=s*u+c*p+h*d+l*E,g=m>=0?1:-1,v=1-m*m;if(v>Number.EPSILON){var T=Math.sqrt(v),y=Math.atan2(T,m*g);f=Math.sin(f*y)/T,o=Math.sin(o*y)/T}var R=o*g;if(s=s*f+u*R,c=c*f+p*R,h=h*f+d*R,l=l*f+E*R,f===1-o){var H=1/Math.sqrt(s*s+c*c+h*h+l*l);s*=H,c*=H,h*=H,l*=H}}t[e]=s,t[e+1]=c,t[e+2]=h,t[e+3]=l}}),THREE.Vector2=function(t,e){this.x=t||0,this.y=e||0},THREE.Vector2.prototype={constructor:THREE.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},setScalar:function(t){return this.x=t,this.y=t,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,i){return void 0===t&&(t=new THREE.Vector2,e=new THREE.Vector2),t.set(r,r),e.set(i,i),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())},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},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),i=Math.sin(e),n=this.x-t.x,a=this.y-t.y;return this.x=n*r-a*i+t.x,this.y=n*i+a*r+t.y,this}},THREE.Vector3=function(t,e,r){this.x=t||0,this.y=e||0,this.z=r||0},THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(t,e,r){return this.x=t,this.y=e,this.z=r,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,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 THREE.Euler==!1&&console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),void 0===t&&(t=new THREE.Quaternion),this.applyQuaternion(t.setFromEuler(e)),this}}(),applyAxisAngle:function(){var t;return function(e,r){return void 0===t&&(t=new THREE.Quaternion),this.applyQuaternion(t.setFromAxisAngle(e,r)),this}}(),applyMatrix3:function(t){var e=this.x,r=this.y,i=this.z,n=t.elements;return this.x=n[0]*e+n[3]*r+n[6]*i,this.y=n[1]*e+n[4]*r+n[7]*i,this.z=n[2]*e+n[5]*r+n[8]*i,this},applyMatrix4:function(t){var e=this.x,r=this.y,i=this.z,n=t.elements;return this.x=n[0]*e+n[4]*r+n[8]*i+n[12],this.y=n[1]*e+n[5]*r+n[9]*i+n[13],this.z=n[2]*e+n[6]*r+n[10]*i+n[14],this},applyProjection:function(t){var e=this.x,r=this.y,i=this.z,n=t.elements,a=1/(n[3]*e+n[7]*r+n[11]*i+n[15]);return this.x=(n[0]*e+n[4]*r+n[8]*i+n[12])*a,this.y=(n[1]*e+n[5]*r+n[9]*i+n[13])*a,this.z=(n[2]*e+n[6]*r+n[10]*i+n[14])*a,this},applyQuaternion:function(t){var e=this.x,r=this.y,i=this.z,n=t.x,a=t.y,o=t.z,s=t.w,c=s*e+a*i-o*r,h=s*r+o*e-n*i,l=s*i+n*r-a*e,u=-n*e-a*r-o*i;return this.x=c*s+u*-n+h*-o-l*-a,this.y=h*s+u*-a+l*-n-c*-o,this.z=l*s+u*-o+c*-a-h*-n,this},project:function(){var t;return function(e){return void 0===t&&(t=new THREE.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 THREE.Matrix4),t.multiplyMatrices(e.matrixWorld,t.getInverse(e.projectionMatrix)),this.applyProjection(t)}}(),transformDirection:function(t){var e=this.x,r=this.y,i=this.z,n=t.elements;return this.x=n[0]*e+n[4]*r+n[8]*i,this.y=n[1]*e+n[5]*r+n[9]*i,this.z=n[2]*e+n[6]*r+n[10]*i,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,i){return void 0===t&&(t=new THREE.Vector3,e=new THREE.Vector3),t.set(r,r,r),e.set(i,i,i),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,i=this.y,n=this.z;return this.x=i*t.z-n*t.y,this.y=n*t.x-r*t.z,this.z=r*t.y-i*t.x,this},crossVectors:function(t,e){var r=t.x,i=t.y,n=t.z,a=e.x,o=e.y,s=e.z;return this.x=i*s-n*o,this.y=n*a-r*s,this.z=r*o-i*a,this},projectOnVector:function(){var t,e;return function(r){return void 0===t&&(t=new THREE.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 THREE.Vector3),t.copy(this).projectOnVector(e),this.sub(t)}}(),reflect:function(){var t;return function(e){return void 0===t&&(t=new THREE.Vector3),this.sub(t.copy(e).multiplyScalar(2*this.dot(e)))}}(),angleTo:function(t){var e=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos(THREE.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,i=this.z-t.z;return e*e+r*r+i*i},setFromSpherical:function(t){var e=Math.sin(t.phi)*t.radius;return this.x=e*Math.sin(t.theta),this.y=Math.cos(t.phi)*t.radius,this.z=e*Math.cos(t.theta),this},setFromMatrixPosition:function(t){return this.setFromMatrixColumn(t,3)},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),r=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=r,this.z=i,this},setFromMatrixColumn:function(t,e){return"number"==typeof t&&(console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),t=arguments[1],e=arguments[0]),this.fromArray(t.elements,4*e)},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}},THREE.Vector4=function(t,e,r,i){this.x=t||0,this.y=e||0,this.z=r||0,this.w=void 0!==i?i:1},THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(t,e,r,i){return this.x=t,this.y=e,this.z=r,this.w=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,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,i=this.z,n=this.w,a=t.elements;return this.x=a[0]*e+a[4]*r+a[8]*i+a[12]*n,this.y=a[1]*e+a[5]*r+a[9]*i+a[13]*n,this.z=a[2]*e+a[6]*r+a[10]*i+a[14]*n,this.w=a[3]*e+a[7]*r+a[11]*i+a[15]*n,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,i,n,a=.01,o=.1,s=t.elements,c=s[0],h=s[4],l=s[8],u=s[1],p=s[5],d=s[9],E=s[2],f=s[6],m=s[10];if(Math.abs(h-u)<a&&Math.abs(l-E)<a&&Math.abs(d-f)<a){if(Math.abs(h+u)<o&&Math.abs(l+E)<o&&Math.abs(d+f)<o&&Math.abs(c+p+m-3)<o)return this.set(1,0,0,0),this;e=Math.PI;var g=(c+1)/2,v=(p+1)/2,T=(m+1)/2,y=(h+u)/4,R=(l+E)/4,H=(d+f)/4;return g>v&&g>T?g<a?(r=0,i=.707106781,n=.707106781):(r=Math.sqrt(g),i=y/r,n=R/r):v>T?v<a?(r=.707106781,i=0,n=.707106781):(i=Math.sqrt(v),r=y/i,n=H/i):T<a?(r=.707106781,i=.707106781,n=0):(n=Math.sqrt(T),r=R/n,i=H/n),this.set(r,i,n,e),this}var x=Math.sqrt((f-d)*(f-d)+(l-E)*(l-E)+(u-h)*(u-h));return Math.abs(x)<.001&&(x=1),this.x=(f-d)/x,this.y=(l-E)/x,this.z=(u-h)/x,this.w=Math.acos((c+p+m-1)/2),this},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.w=Math.min(this.w,t.w),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.w=Math.max(this.w,t.w),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.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(){var t,e;return function(r,i){return void 0===t&&(t=new THREE.Vector4,e=new THREE.Vector4),t.set(r,r,r,r),e.set(i,i,i,i),this.clamp(t,e)}}(),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(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)},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(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.w+=(t.w-this.w)*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&&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},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},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.w=t.array[e+3],this}},THREE.Euler=function(t,e,r,i){this._x=t||0,this._y=e||0,this._z=r||0,this._order=i||THREE.Euler.DefaultOrder},THREE.Euler.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],THREE.Euler.DefaultOrder="XYZ",THREE.Euler.prototype={constructor:THREE.Euler,get x(){return this._x},set x(t){this._x=t,this.onChangeCallback()},get y(){return this._y},set y(t){this._y=t,this.onChangeCallback()},get z(){return this._z},set z(t){this._z=t,this.onChangeCallback()},get order(){return this._order},set order(t){this._order=t,this.onChangeCallback()},set:function(t,e,r,i){return this._x=t,this._y=e,this._z=r,this._order=i||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this.onChangeCallback(),this},setFromRotationMatrix:function(t,e,r){var i=THREE.Math.clamp,n=t.elements,a=n[0],o=n[4],s=n[8],c=n[1],h=n[5],l=n[9],u=n[2],p=n[6],d=n[10];return e=e||this._order,"XYZ"===e?(this._y=Math.asin(i(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(p,h),this._z=0)):"YXZ"===e?(this._x=Math.asin(-i(l,-1,1)),Math.abs(l)<.99999?(this._y=Math.atan2(s,d),this._z=Math.atan2(c,h)):(this._y=Math.atan2(-u,a),this._z=0)):"ZXY"===e?(this._x=Math.asin(i(p,-1,1)),Math.abs(p)<.99999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-o,h)):(this._y=0,this._z=Math.atan2(c,a))):"ZYX"===e?(this._y=Math.asin(-i(u,-1,1)),Math.abs(u)<.99999?(this._x=Math.atan2(p,d),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-o,h))):"YZX"===e?(this._z=Math.asin(i(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-l,h),this._y=Math.atan2(-u,a)):(this._x=0,this._y=Math.atan2(s,d))):"XZY"===e?(this._z=Math.asin(-i(o,-1,1)),Math.abs(o)<.99999?(this._x=Math.atan2(p,h),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-l,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,r!==!1&&this.onChangeCallback(),this},setFromQuaternion:function(){var t;return function(e,r,i){return void 0===t&&(t=new THREE.Matrix4),t.makeRotationFromQuaternion(e),this.setFromRotationMatrix(t,r,i),this}}(),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(){var t=new THREE.Quaternion;return function(e){t.setFromEuler(this),this.setFromQuaternion(t,e)}}(),equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this.onChangeCallback(),this},toArray: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._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new THREE.Vector3(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}},THREE.Line3=function(t,e){this.start=void 0!==t?t:new THREE.Vector3,this.end=void 0!==e?e:new THREE.Vector3},THREE.Line3.prototype={constructor:THREE.Line3,set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},center:function(t){var e=t||new THREE.Vector3;return e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){var e=t||new THREE.Vector3;return e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){var r=e||new THREE.Vector3;return this.delta(r).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(){var t=new THREE.Vector3,e=new THREE.Vector3;return function(r,i){t.subVectors(r,this.start),e.subVectors(this.end,this.start);var n=e.dot(e),a=e.dot(t),o=a/n;return i&&(o=THREE.Math.clamp(o,0,1)),o}}(),closestPointToPoint:function(t,e,r){var i=this.closestPointToPointParameter(t,e),n=r||new THREE.Vector3;return this.delta(n).multiplyScalar(i).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}},THREE.Box2=function(t,e){this.min=void 0!==t?t:new THREE.Vector2((+(1/0)),(+(1/0))),this.max=void 0!==e?e:new THREE.Vector2((-(1/0)),(-(1/0)))},THREE.Box2.prototype={constructor:THREE.Box2,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;e<r;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new THREE.Vector2;return function(e,r){var i=t.copy(r).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=+(1/0),this.max.x=this.max.y=-(1/0),this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},center:function(t){var e=t||new THREE.Vector2;return e.addVectors(this.min,this.max).multiplyScalar(.5)},size:function(t){var e=t||new THREE.Vector2;return e.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.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 THREE.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))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){var r=e||new THREE.Vector2;return r.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new THREE.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)}},THREE.Box3=function(t,e){this.min=void 0!==t?t:new THREE.Vector3((+(1/0)),(+(1/0)),(+(1/0))),this.max=void 0!==e?e:new THREE.Vector3((-(1/0)),(-(1/0)),(-(1/0)))},THREE.Box3.prototype={constructor:THREE.Box3,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=+(1/0),r=+(1/0),i=+(1/0),n=-(1/0),a=-(1/0),o=-(1/0),s=0,c=t.length;s<c;s+=3){var h=t[s],l=t[s+1],u=t[s+2];h<e&&(e=h),l<r&&(r=l),u<i&&(i=u),h>n&&(n=h),l>a&&(a=l),u>o&&(o=u)}this.min.set(e,r,i),this.max.set(n,a,o)},setFromPoints:function(t){this.makeEmpty();for(var e=0,r=t.length;e<r;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new THREE.Vector3;return function(e,r){var i=t.copy(r).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}}(),setFromObject:function(){var t=new THREE.Vector3;return function(e){var r=this;return e.updateMatrixWorld(!0),this.makeEmpty(),e.traverse(function(e){var i=e.geometry;if(void 0!==i)if(i instanceof THREE.Geometry)for(var n=i.vertices,a=0,o=n.length;a<o;a++)t.copy(n[a]),t.applyMatrix4(e.matrixWorld),r.expandByPoint(t);else if(i instanceof THREE.BufferGeometry&&void 0!==i.attributes.position)for(var s=i.attributes.position.array,a=0,o=s.length;a<o;a+=3)t.fromArray(s,a),t.applyMatrix4(e.matrixWorld),r.expandByPoint(t)}),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=+(1/0),this.max.x=this.max.y=this.max.z=-(1/0),this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},center:function(t){var e=t||new THREE.Vector3;return e.addVectors(this.min,this.max).multiplyScalar(.5)},size:function(t){var e=t||new THREE.Vector3;return e.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.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 THREE.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))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:function(){var t;return function(e){return void 0===t&&(t=new THREE.Vector3),this.clampPoint(e.center,t),t.distanceToSquared(e.center)<=e.radius*e.radius}}(),intersectsPlane:function(t){var e,r;return t.normal.x>0?(e=t.normal.x*this.min.x,r=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,r=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,r+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,r+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,r+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,r+=t.normal.z*this.min.z),e<=t.constant&&r>=t.constant},clampPoint:function(t,e){var r=e||new THREE.Vector3;return r.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new THREE.Vector3;return function(e){var r=t.copy(e).clamp(this.min,this.max);return r.sub(e).length()}}(),getBoundingSphere:function(){var t=new THREE.Vector3;return function(e){var r=e||new THREE.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.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(){var t=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(e){return this.isEmpty()?this:(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.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)}},THREE.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.")},THREE.Matrix3.prototype={constructor:THREE.Matrix3,set:function(t,e,r,i,n,a,o,s,c){var h=this.elements;return h[0]=t,h[1]=i,h[2]=o,h[3]=e,h[4]=n,h[5]=s,h[6]=r,h[7]=a,h[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},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToVector3Array:function(){var t;return function(e,r,i){void 0===t&&(t=new THREE.Vector3),void 0===r&&(r=0),void 0===i&&(i=e.length);for(var n=0,a=r;n<i;n+=3,a+=3)t.fromArray(e,a),t.applyMatrix3(this),t.toArray(e,a);return e}}(),applyToBuffer:function(){var t;return function(e,r,i){void 0===t&&(t=new THREE.Vector3),void 0===r&&(r=0),void 0===i&&(i=e.length/e.itemSize);for(var n=0,a=r;n<i;n++,a++)t.x=e.getX(a),t.y=e.getY(a),t.z=e.getZ(a),t.applyMatrix3(this),e.setXYZ(t.x,t.y,t.z);return e}}(),multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],r=t[1],i=t[2],n=t[3],a=t[4],o=t[5],s=t[6],c=t[7],h=t[8];return e*a*h-e*o*c-r*n*h+r*o*s+i*n*c-i*a*s},getInverse:function(t,e){t instanceof THREE.Matrix4&&console.error("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");var r=t.elements,i=this.elements,n=r[0],a=r[1],o=r[2],s=r[3],c=r[4],h=r[5],l=r[6],u=r[7],p=r[8],d=p*c-h*u,E=h*l-p*s,f=u*s-c*l,m=n*d+a*E+o*f;if(0===m){var g="THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";if(e)throw new Error(g);return console.warn(g),this.identity()}return i[0]=d,i[1]=o*u-p*a,i[2]=h*a-o*c,i[3]=E,i[4]=p*n-o*l,i[5]=o*s-h*n,i[6]=f,i[7]=a*l-u*n,i[8]=c*n-a*s,this.multiplyScalar(1/m)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset is deprecated - just use .toArray instead."),this.toArray(t,e)},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},fromArray:function(t){return this.elements.set(t),this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t}},THREE.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.")},THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(t,e,r,i,n,a,o,s,c,h,l,u,p,d,E,f){var m=this.elements;return m[0]=t,m[4]=e,m[8]=r,m[12]=i,m[1]=n,m[5]=a,m[9]=o,m[13]=s,m[2]=c,m[6]=h,m[10]=l,m[14]=u,m[3]=p,m[7]=d,m[11]=E,m[15]=f,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 THREE.Matrix4).fromArray(this.elements)},copy:function(t){return this.elements.set(t.elements),this},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){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),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 THREE.Vector3);var r=this.elements,i=e.elements,n=1/t.setFromMatrixColumn(e,0).length(),a=1/t.setFromMatrixColumn(e,1).length(),o=1/t.setFromMatrixColumn(e,2).length();return r[0]=i[0]*n,r[1]=i[1]*n,r[2]=i[2]*n,r[4]=i[4]*a,r[5]=i[5]*a,r[6]=i[6]*a,r[8]=i[8]*o,r[9]=i[9]*o,r[10]=i[10]*o,this}}(),makeRotationFromEuler:function(t){t instanceof THREE.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,i=t.y,n=t.z,a=Math.cos(r),o=Math.sin(r),s=Math.cos(i),c=Math.sin(i),h=Math.cos(n),l=Math.sin(n);if("XYZ"===t.order){var u=a*h,p=a*l,d=o*h,E=o*l;e[0]=s*h,e[4]=-s*l,e[8]=c,e[1]=p+d*c,e[5]=u-E*c,e[9]=-o*s,e[2]=E-u*c,e[6]=d+p*c,e[10]=a*s}else if("YXZ"===t.order){var f=s*h,m=s*l,g=c*h,v=c*l;e[0]=f+v*o,e[4]=g*o-m,e[8]=a*c,e[1]=a*l,e[5]=a*h,e[9]=-o,e[2]=m*o-g,e[6]=v+f*o,e[10]=a*s}else if("ZXY"===t.order){var f=s*h,m=s*l,g=c*h,v=c*l;e[0]=f-v*o,e[4]=-a*l,e[8]=g+m*o,e[1]=m+g*o,e[5]=a*h,e[9]=v-f*o,e[2]=-a*c,e[6]=o,e[10]=a*s}else if("ZYX"===t.order){var u=a*h,p=a*l,d=o*h,E=o*l;e[0]=s*h,e[4]=d*c-p,e[8]=u*c+E,e[1]=s*l,e[5]=E*c+u,e[9]=p*c-d,e[2]=-c,e[6]=o*s,e[10]=a*s}else if("YZX"===t.order){var T=a*s,y=a*c,R=o*s,H=o*c;e[0]=s*h,e[4]=H-T*l,e[8]=R*l+y,e[1]=l,e[5]=a*h,e[9]=-o*h,e[2]=-c*h,e[6]=y*l+R,e[10]=T-H*l}else if("XZY"===t.order){var T=a*s,y=a*c,R=o*s,H=o*c;e[0]=s*h,e[4]=-l,e[8]=c*h,e[1]=T*l+H,e[5]=a*h,e[9]=y*l-R,e[2]=R*l-y,e[6]=o*h,e[10]=H*l+T}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){var e=this.elements,r=t.x,i=t.y,n=t.z,a=t.w,o=r+r,s=i+i,c=n+n,h=r*o,l=r*s,u=r*c,p=i*s,d=i*c,E=n*c,f=a*o,m=a*s,g=a*c;return e[0]=1-(p+E),e[4]=l-g,e[8]=u+m,e[1]=l+g,e[5]=1-(h+E),e[9]=d-f,e[2]=u-m,e[6]=d+f,e[10]=1-(h+p),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(i,n,a){void 0===t&&(t=new THREE.Vector3),void 0===e&&(e=new THREE.Vector3),void 0===r&&(r=new THREE.Vector3);var o=this.elements;return r.subVectors(i,n).normalize(),0===r.lengthSq()&&(r.z=1),t.crossVectors(a,r).normalize(),0===t.lengthSq()&&(r.x+=1e-4,t.crossVectors(a,r).normalize()),e.crossVectors(r,t),o[0]=t.x,o[4]=e.x,o[8]=r.x,o[1]=t.y,o[5]=e.y,o[9]=r.y,o[2]=t.z,o[6]=e.z,o[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)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var r=t.elements,i=e.elements,n=this.elements,a=r[0],o=r[4],s=r[8],c=r[12],h=r[1],l=r[5],u=r[9],p=r[13],d=r[2],E=r[6],f=r[10],m=r[14],g=r[3],v=r[7],T=r[11],y=r[15],R=i[0],H=i[4],x=i[8],b=i[12],_=i[1],M=i[5],w=i[9],S=i[13],L=i[2],A=i[6],C=i[10],P=i[14],B=i[3],D=i[7],I=i[11],U=i[15];return n[0]=a*R+o*_+s*L+c*B,n[4]=a*H+o*M+s*A+c*D,n[8]=a*x+o*w+s*C+c*I,n[12]=a*b+o*S+s*P+c*U,n[1]=h*R+l*_+u*L+p*B,n[5]=h*H+l*M+u*A+p*D,n[9]=h*x+l*w+u*C+p*I,n[13]=h*b+l*S+u*P+p*U,n[2]=d*R+E*_+f*L+m*B,n[6]=d*H+E*M+f*A+m*D,n[10]=d*x+E*w+f*C+m*I,n[14]=d*b+E*S+f*P+m*U,n[3]=g*R+v*_+T*L+y*B,n[7]=g*H+v*M+T*A+y*D,n[11]=g*x+v*w+T*C+y*I,n[15]=g*b+v*S+T*P+y*U,this},multiplyToArray:function(t,e,r){var i=this.elements;return this.multiplyMatrices(t,e),r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7],r[8]=i[8],r[9]=i[9],r[10]=i[10],r[11]=i[11],r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[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},applyToVector3Array:function(){var t;return function(e,r,i){void 0===t&&(t=new THREE.Vector3),void 0===r&&(r=0),void 0===i&&(i=e.length);for(var n=0,a=r;n<i;n+=3,a+=3)t.fromArray(e,a),t.applyMatrix4(this),t.toArray(e,a);return e}}(),applyToBuffer:function(){var t;return function(e,r,i){void 0===t&&(t=new THREE.Vector3),void 0===r&&(r=0),void 0===i&&(i=e.length/e.itemSize);for(var n=0,a=r;n<i;n++,a++)t.x=e.getX(a),t.y=e.getY(a),t.z=e.getZ(a),t.applyMatrix4(this),e.setXYZ(t.x,t.y,t.z);return e}}(),determinant:function(){var t=this.elements,e=t[0],r=t[4],i=t[8],n=t[12],a=t[1],o=t[5],s=t[9],c=t[13],h=t[2],l=t[6],u=t[10],p=t[14],d=t[3],E=t[7],f=t[11],m=t[15];return d*(+n*s*l-i*c*l-n*o*u+r*c*u+i*o*p-r*s*p)+E*(+e*s*p-e*c*u+n*a*u-i*a*p+i*c*h-n*s*h)+f*(+e*c*l-e*o*p-n*a*l+r*a*p+n*o*h-r*c*h)+m*(-i*o*h-e*s*l+e*o*u+i*a*l-r*a*u+r*s*h)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset is deprecated - just use .toArray instead."),this.toArray(t,e)},getPosition:function(){var t;return function(){return void 0===t&&(t=new THREE.Vector3),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),t.setFromMatrixColumn(this,3)}}(),setPosition:function(t){var e=this.elements;return e[12]=t.x,e[13]=t.y,e[14]=t.z,this},getInverse:function(t,e){var r=this.elements,i=t.elements,n=i[0],a=i[1],o=i[2],s=i[3],c=i[4],h=i[5],l=i[6],u=i[7],p=i[8],d=i[9],E=i[10],f=i[11],m=i[12],g=i[13],v=i[14],T=i[15],y=d*v*u-g*E*u+g*l*f-h*v*f-d*l*T+h*E*T,R=m*E*u-p*v*u-m*l*f+c*v*f+p*l*T-c*E*T,H=p*g*u-m*d*u+m*h*f-c*g*f-p*h*T+c*d*T,x=m*d*l-p*g*l-m*h*E+c*g*E+p*h*v-c*d*v,b=n*y+a*R+o*H+s*x;if(0===b){var _="THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";if(e)throw new Error(_);return console.warn(_),this.identity()}return r[0]=y,r[1]=g*E*s-d*v*s-g*o*f+a*v*f+d*o*T-a*E*T,r[2]=h*v*s-g*l*s+g*o*u-a*v*u-h*o*T+a*l*T,r[3]=d*l*s-h*E*s-d*o*u+a*E*u+h*o*f-a*l*f,r[4]=R,r[5]=p*v*s-m*E*s+m*o*f-n*v*f-p*o*T+n*E*T,r[6]=m*l*s-c*v*s-m*o*u+n*v*u+c*o*T-n*l*T,r[7]=c*E*s-p*l*s+p*o*u-n*E*u-c*o*f+n*l*f,r[8]=H,r[9]=m*d*s-p*g*s-m*a*f+n*g*f+p*a*T-n*d*T,r[10]=c*g*s-m*h*s+m*a*u-n*g*u-c*a*T+n*h*T,r[11]=p*h*s-c*d*s-p*a*u+n*d*u+c*a*f-n*h*f,r[12]=x,r[13]=p*g*o-m*d*o+m*a*E-n*g*E-p*a*v+n*d*v,r[14]=m*h*o-c*g*o-m*a*l+n*g*l+c*a*v-n*h*v,r[15]=c*d*o-p*h*o+p*a*l-n*d*l-c*a*E+n*h*E,this.multiplyScalar(1/b)},scale:function(t){var e=this.elements,r=t.x,i=t.y,n=t.z;return e[0]*=r,e[4]*=i,e[8]*=n,e[1]*=r,e[5]*=i,e[9]*=n,e[2]*=r,e[6]*=i,e[10]*=n,e[3]*=r,e[7]*=i,e[11]*=n,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],r=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,r,i))},makeTranslation:function(t,e,r){return this.set(1,0,0,t,0,1,0,e,0,0,1,r,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),r=Math.sin(t);return this.set(1,0,0,0,0,e,-r,0,0,r,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),r=Math.sin(t);return this.set(e,0,r,0,0,1,0,0,-r,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),r=Math.sin(t);return this.set(e,-r,0,0,r,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var r=Math.cos(e),i=Math.sin(e),n=1-r,a=t.x,o=t.y,s=t.z,c=n*a,h=n*o;return this.set(c*a+r,c*o-i*s,c*s+i*o,0,c*o+i*s,h*o+r,h*s-i*a,0,c*s-i*o,h*s+i*a,n*s*s+r,0,0,0,0,1),this},makeScale:function(t,e,r){return this.set(t,0,0,0,0,e,0,0,0,0,r,0,0,0,0,1),this},compose:function(t,e,r){return this.makeRotationFromQuaternion(e),this.scale(r),this.setPosition(t),this},decompose:function(){var t,e;return function(r,i,n){void 0===t&&(t=new THREE.Vector3),void 0===e&&(e=new THREE.Matrix4);var a=this.elements,o=t.set(a[0],a[1],a[2]).length(),s=t.set(a[4],a[5],a[6]).length(),c=t.set(a[8],a[9],a[10]).length(),h=this.determinant();h<0&&(o=-o),r.x=a[12],r.y=a[13],r.z=a[14],e.elements.set(this.elements);var l=1/o,u=1/s,p=1/c;return e.elements[0]*=l,e.elements[1]*=l,e.elements[2]*=l,e.elements[4]*=u,e.elements[5]*=u,e.elements[6]*=u,e.elements[8]*=p,e.elements[9]*=p,e.elements[10]*=p,i.setFromRotationMatrix(e),n.x=o,n.y=s,n.z=c,this}}(),makeFrustum:function(t,e,r,i,n,a){var o=this.elements,s=2*n/(e-t),c=2*n/(i-r),h=(e+t)/(e-t),l=(i+r)/(i-r),u=-(a+n)/(a-n),p=-2*a*n/(a-n);return o[0]=s,o[4]=0,o[8]=h,o[12]=0,o[1]=0,o[5]=c,o[9]=l,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=p,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makePerspective:function(t,e,r,i){var n=r*Math.tan(THREE.Math.DEG2RAD*t*.5),a=-n,o=a*e,s=n*e;return this.makeFrustum(o,s,a,n,r,i)},makeOrthographic:function(t,e,r,i,n,a){var o=this.elements,s=1/(e-t),c=1/(r-i),h=1/(a-n),l=(e+t)*s,u=(r+i)*c,p=(a+n)*h;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-l,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*h,o[14]=-p,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(t){for(var e=this.elements,r=t.elements,i=0;i<16;i++)if(e[i]!==r[i])return!1;return!0},fromArray:function(t){return this.elements.set(t),this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var r=this.elements;return t[e]=r[0],t[e+1]=r[1],t[e+2]=r[2],t[e+3]=r[3],t[e+4]=r[4],t[e+5]=r[5],t[e+6]=r[6],t[e+7]=r[7],t[e+8]=r[8],t[e+9]=r[9],t[e+10]=r[10],t[e+11]=r[11],t[e+12]=r[12],t[e+13]=r[13],t[e+14]=r[14],t[e+15]=r[15],t}},THREE.Ray=function(t,e){this.origin=void 0!==t?t:new THREE.Vector3,this.direction=void 0!==e?e:new THREE.Vector3},THREE.Ray.prototype={constructor:THREE.Ray,set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){var r=e||new THREE.Vector3;return r.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){this.direction.copy(t).sub(this.origin).normalize()},recast:function(){var t=new THREE.Vector3;return function(e){return this.origin.copy(this.at(e,t)),this}}(),closestPointToPoint:function(t,e){var r=e||new THREE.Vector3;r.subVectors(t,this.origin);var i=r.dot(this.direction);return i<0?r.copy(this.origin):r.copy(this.direction).multiplyScalar(i).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(){var t=new THREE.Vector3;return function(e){var r=t.subVectors(e,this.origin).dot(this.direction);return r<0?this.origin.distanceToSquared(e):(t.copy(this.direction).multiplyScalar(r).add(this.origin),t.distanceToSquared(e))}}(),distanceSqToSegment:function(){var t=new THREE.Vector3,e=new THREE.Vector3,r=new THREE.Vector3;return function(i,n,a,o){t.copy(i).add(n).multiplyScalar(.5),e.copy(n).sub(i).normalize(),r.copy(this.origin).sub(t);var s,c,h,l,u=.5*i.distanceTo(n),p=-this.direction.dot(e),d=r.dot(this.direction),E=-r.dot(e),f=r.lengthSq(),m=Math.abs(1-p*p);if(m>0)if(s=p*E-d,c=p*d-E,l=u*m,s>=0)if(c>=-l)if(c<=l){var g=1/m;s*=g,c*=g,h=s*(s+p*c+2*d)+c*(p*s+c+2*E)+f}else c=u,s=Math.max(0,-(p*c+d)),h=-s*s+c*(c+2*E)+f;else c=-u,s=Math.max(0,-(p*c+d)),h=-s*s+c*(c+2*E)+f;else c<=-l?(s=Math.max(0,-(-p*u+d)),c=s>0?-u:Math.min(Math.max(-u,-E),u),h=-s*s+c*(c+2*E)+f):c<=l?(s=0,c=Math.min(Math.max(-u,-E),u),h=c*(c+2*E)+f):(s=Math.max(0,-(p*u+d)),c=s>0?u:Math.min(Math.max(-u,-E),u),h=-s*s+c*(c+2*E)+f);else c=p>0?-u:u,s=Math.max(0,-(p*c+d)),h=-s*s+c*(c+2*E)+f;return a&&a.copy(this.direction).multiplyScalar(s).add(this.origin),o&&o.copy(e).multiplyScalar(c).add(t),h}}(),intersectSphere:function(){var t=new THREE.Vector3;return function(e,r){t.subVectors(e.center,this.origin);var i=t.dot(this.direction),n=t.dot(t)-i*i,a=e.radius*e.radius;if(n>a)return null;var o=Math.sqrt(a-n),s=i-o,c=i+o;return s<0&&c<0?null:s<0?this.at(c,r):this.at(s,r)}}(),intersectsSphere:function(t){return this.distanceToPoint(t.center)<=t.radius},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)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);if(0===e)return!0;var r=t.normal.dot(this.direction);return r*e<0},intersectBox:function(t,e){var r,i,n,a,o,s,c=1/this.direction.x,h=1/this.direction.y,l=1/this.direction.z,u=this.origin;return c>=0?(r=(t.min.x-u.x)*c,i=(t.max.x-u.x)*c):(r=(t.max.x-u.x)*c,i=(t.min.x-u.x)*c),h>=0?(n=(t.min.y-u.y)*h,a=(t.max.y-u.y)*h):(n=(t.max.y-u.y)*h,a=(t.min.y-u.y)*h),r>a||n>i?null:((n>r||r!==r)&&(r=n),(a<i||i!==i)&&(i=a),l>=0?(o=(t.min.z-u.z)*l,s=(t.max.z-u.z)*l):(o=(t.max.z-u.z)*l,s=(t.min.z-u.z)*l),r>s||o>i?null:((o>r||r!==r)&&(r=o),(s<i||i!==i)&&(i=s),i<0?null:this.at(r>=0?r:i,e)))},intersectsBox:function(){var t=new THREE.Vector3;return function(e){return null!==this.intersectBox(e,t)}}(),intersectTriangle:function(){var t=new THREE.Vector3,e=new THREE.Vector3,r=new THREE.Vector3,i=new THREE.Vector3;return function(n,a,o,s,c){e.subVectors(a,n),r.subVectors(o,n),i.crossVectors(e,r);var h,l=this.direction.dot(i);if(l>0){if(s)return null;h=1}else{if(!(l<0))return null;h=-1,l=-l}t.subVectors(this.origin,n);var u=h*this.direction.dot(r.crossVectors(t,r));if(u<0)return null;var p=h*this.direction.dot(e.cross(t));if(p<0)return null;if(u+p>l)return null;var d=-h*t.dot(i);return d<0?null:this.at(d/l,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)}},THREE.Sphere=function(t,e){this.center=void 0!==t?t:new THREE.Vector3,this.radius=void 0!==e?e:0},THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(){var t=new THREE.Box3;return function(e,r){var i=this.center;void 0!==r?i.copy(r):t.setFromPoints(e).center(i);for(var n=0,a=0,o=e.length;a<o;a++)n=Math.max(n,i.distanceToSquared(e[a]));return this.radius=Math.sqrt(n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(this.center.dot(t.normal)-t.constant)<=this.radius},clampPoint:function(t,e){var r=this.center.distanceToSquared(t),i=e||new THREE.Vector3;
return i.copy(t),r>this.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i},getBoundingBox:function(t){var e=t||new THREE.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}},THREE.Frustum=function(t,e,r,i,n,a){this.planes=[void 0!==t?t:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==r?r:new THREE.Plane,void 0!==i?i:new THREE.Plane,void 0!==n?n:new THREE.Plane,void 0!==a?a:new THREE.Plane]},THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(t,e,r,i,n,a){var o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(r),o[3].copy(i),o[4].copy(n),o[5].copy(a),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,i=r[0],n=r[1],a=r[2],o=r[3],s=r[4],c=r[5],h=r[6],l=r[7],u=r[8],p=r[9],d=r[10],E=r[11],f=r[12],m=r[13],g=r[14],v=r[15];return e[0].setComponents(o-i,l-s,E-u,v-f).normalize(),e[1].setComponents(o+i,l+s,E+u,v+f).normalize(),e[2].setComponents(o+n,l+c,E+p,v+m).normalize(),e[3].setComponents(o-n,l-c,E-p,v-m).normalize(),e[4].setComponents(o-a,l-h,E-d,v-g).normalize(),e[5].setComponents(o+a,l+h,E+d,v+g).normalize(),this},intersectsObject:function(){var t=new THREE.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,i=-t.radius,n=0;n<6;n++){var a=e[n].distanceToPoint(r);if(a<i)return!1}return!0},intersectsBox:function(){var t=new THREE.Vector3,e=new THREE.Vector3;return function(r){for(var i=this.planes,n=0;n<6;n++){var a=i[n];t.x=a.normal.x>0?r.min.x:r.max.x,e.x=a.normal.x>0?r.max.x:r.min.x,t.y=a.normal.y>0?r.min.y:r.max.y,e.y=a.normal.y>0?r.max.y:r.min.y,t.z=a.normal.z>0?r.min.z:r.max.z,e.z=a.normal.z>0?r.max.z:r.min.z;var o=a.distanceToPoint(t),s=a.distanceToPoint(e);if(o<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}},THREE.Plane=function(t,e){this.normal=void 0!==t?t:new THREE.Vector3(1,0,0),this.constant=void 0!==e?e:0},THREE.Plane.prototype={constructor:THREE.Plane,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,r,i){return this.normal.set(t,e,r),this.constant=i,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(){var t=new THREE.Vector3,e=new THREE.Vector3;return function(r,i,n){var a=t.subVectors(n,i).cross(e.subVectors(r,i)).normalize();return this.setFromNormalAndCoplanarPoint(a,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),i=e||new THREE.Vector3;return i.copy(this.normal).multiplyScalar(r)},intersectLine:function(){var t=new THREE.Vector3;return function(e,r){var i=r||new THREE.Vector3,n=e.delta(t),a=this.normal.dot(n);if(0!==a){var o=-(e.start.dot(this.normal)+this.constant)/a;if(!(o<0||o>1))return i.copy(n).multiplyScalar(o).add(e.start)}else if(0===this.distanceToPoint(e.start))return i.copy(e.start)}}(),intersectsLine:function(t){var e=this.distanceToPoint(t.start),r=this.distanceToPoint(t.end);return e<0&&r>0||r<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){var e=t||new THREE.Vector3;return e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new THREE.Vector3,e=new THREE.Matrix3;return function(r,i){var n=this.coplanarPoint(t).applyMatrix4(r),a=i||e.getNormalMatrix(r),o=this.normal.applyMatrix3(a).normalize();return this.constant=-n.dot(o),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}},THREE.Spherical=function(t,e,r){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==r?r:0,this},THREE.Spherical.prototype={constructor:THREE.Spherical,set:function(t,e,r){this.radius=t,this.phi=e,this.theta=r},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius.copy(t.radius),this.phi.copy(t.phi),this.theta.copy(t.theta),this},makeSafe:function(){var t=1e-6;this.phi=Math.max(t,Math.min(Math.PI-t,this.phi))},setFromVector3:function(t){return this.radius=t.length(),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t.x,t.z),this.phi=Math.acos(THREE.Math.clamp(t.y/this.radius,-1,1))),this}},THREE.Math={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){var t,e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),r=new Array(36),i=0;return function(){for(var n=0;n<36;n++)8===n||13===n||18===n||23===n?r[n]="-":14===n?r[n]="4":(i<=2&&(i=33554432+16777216*Math.random()|0),t=15&i,i>>=4,r[n]=e[19===n?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,i,n){return i+(t-e)*(n-i)/(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 console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),Math.random()},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(t){return t*THREE.Math.DEG2RAD},radToDeg:function(t){return t*THREE.Math.RAD2DEG},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}},THREE.Spline=function(t){function e(t,e,r,i,n,a,o){var s=.5*(r-t),c=.5*(i-e);return(2*(e-r)+s+c)*o+(-3*(e-r)-2*s-c)*a+s*n+e}this.points=t;var r,i,n,a,o,s,c,h,l,u=[],p={x:0,y:0,z:0};this.initFromArray=function(t){this.points=[];for(var e=0;e<t.length;e++)this.points[e]={x:t[e][0],y:t[e][1],z:t[e][2]}},this.getPoint=function(t){return r=(this.points.length-1)*t,i=Math.floor(r),n=r-i,u[0]=0===i?i:i-1,u[1]=i,u[2]=i>this.points.length-2?this.points.length-1:i+1,u[3]=i>this.points.length-3?this.points.length-1:i+2,s=this.points[u[0]],c=this.points[u[1]],h=this.points[u[2]],l=this.points[u[3]],a=n*n,o=n*a,p.x=e(s.x,c.x,h.x,l.x,n,a,o),p.y=e(s.y,c.y,h.y,l.y,n,a,o),p.z=e(s.z,c.z,h.z,l.z,n,a,o),p},this.getControlPointsArray=function(){var t,e,r=this.points.length,i=[];for(t=0;t<r;t++)e=this.points[t],i[t]=[e.x,e.y,e.z];return i},this.getLength=function(t){var e,r,i,n,a=0,o=0,s=0,c=new THREE.Vector3,h=new THREE.Vector3,l=[],u=0;for(l[0]=0,t||(t=100),i=this.points.length*t,c.copy(this.points[0]),e=1;e<i;e++)r=e/i,n=this.getPoint(r),h.copy(n),u+=h.distanceTo(c),c.copy(n),a=(this.points.length-1)*r,o=Math.floor(a),o!==s&&(l[o]=u,s=o);return l[l.length]=u,{chunks:l,total:u}},this.reparametrizeByArcLength=function(t){var e,r,i,n,a,o,s,c,h=[],l=new THREE.Vector3,u=this.getLength();for(h.push(l.copy(this.points[0]).clone()),e=1;e<this.points.length;e++){for(o=u.chunks[e]-u.chunks[e-1],s=Math.ceil(t*o/u.total),n=(e-1)/(this.points.length-1),a=e/(this.points.length-1),r=1;r<s-1;r++)i=n+r*(1/s)*(a-n),c=this.getPoint(i),h.push(l.copy(c).clone());h.push(l.copy(this.points[e]).clone())}this.points=h}},THREE.Triangle=function(t,e,r){this.a=void 0!==t?t:new THREE.Vector3,this.b=void 0!==e?e:new THREE.Vector3,this.c=void 0!==r?r:new THREE.Vector3},THREE.Triangle.normal=function(){var t=new THREE.Vector3;return function(e,r,i,n){var a=n||new THREE.Vector3;a.subVectors(i,r),t.subVectors(e,r),a.cross(t);var o=a.lengthSq();return o>0?a.multiplyScalar(1/Math.sqrt(o)):a.set(0,0,0)}}(),THREE.Triangle.barycoordFromPoint=function(){var t=new THREE.Vector3,e=new THREE.Vector3,r=new THREE.Vector3;return function(i,n,a,o,s){t.subVectors(o,n),e.subVectors(a,n),r.subVectors(i,n);var c=t.dot(t),h=t.dot(e),l=t.dot(r),u=e.dot(e),p=e.dot(r),d=c*u-h*h,E=s||new THREE.Vector3;if(0===d)return E.set(-2,-1,-1);var f=1/d,m=(u*l-h*p)*f,g=(c*p-h*l)*f;return E.set(1-m-g,g,m)}}(),THREE.Triangle.containsPoint=function(){var t=new THREE.Vector3;return function(e,r,i,n){var a=THREE.Triangle.barycoordFromPoint(e,r,i,n,t);return a.x>=0&&a.y>=0&&a.x+a.y<=1}}(),THREE.Triangle.prototype={constructor:THREE.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,i){return this.a.copy(t[e]),this.b.copy(t[r]),this.c.copy(t[i]),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 THREE.Vector3,e=new THREE.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 THREE.Vector3;return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(t){return THREE.Triangle.normal(this.a,this.b,this.c,t)},plane:function(t){var e=t||new THREE.Plane;return e.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(t,e){return THREE.Triangle.barycoordFromPoint(t,this.a,this.b,this.c,e)},containsPoint:function(t){return THREE.Triangle.containsPoint(t,this.a,this.b,this.c)},closestPointToPoint:function(){var t,e,r,i;return function(n,a){void 0===t&&(t=new THREE.Plane,e=[new THREE.Line3,new THREE.Line3,new THREE.Line3],r=new THREE.Vector3,i=new THREE.Vector3);var o=a||new THREE.Vector3,s=1/0;if(t.setFromCoplanarPoints(this.a,this.b,this.c),t.projectPoint(n,r),this.containsPoint(r)===!0)o.copy(r);else{e[0].set(this.a,this.b),e[1].set(this.b,this.c),e[2].set(this.c,this.a);for(var c=0;c<e.length;c++){e[c].closestPointToPoint(r,!0,i);var h=r.distanceToSquared(i);h<s&&(s=h,o.copy(i))}}return o}}(),equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},THREE.Interpolant=function(t,e,r,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new e.constructor(r),this.sampleValues=e,this.valueSize=r},THREE.Interpolant.prototype={constructor:THREE.Interpolant,evaluate:function(t){var e=this.parameterPositions,r=this._cachedIndex,i=e[r],n=e[r-1];t:{e:{var a;r:{i:if(!(t<i)){for(var o=r+2;;){if(void 0===i){if(t<n)break i;return r=e.length,this._cachedIndex=r,this.afterEnd_(r-1,t,n)}if(r===o)break;if(n=i,i=e[++r],t<i)break e}a=e.length;break r}{if(t>=n)break t;var s=e[1];t<s&&(r=2,n=s);for(var o=r-2;;){if(void 0===n)return this._cachedIndex=0,this.beforeStart_(0,t,i);if(r===o)break;if(i=n,n=e[--r-1],t>=n)break e}a=r,r=0}}for(;r<a;){var c=r+a>>>1;t<e[c]?a=c:r=c+1}if(i=e[r],n=e[r-1],void 0===n)return this._cachedIndex=0,this.beforeStart_(0,t,i);if(void 0===i)return r=e.length,this._cachedIndex=r,this.afterEnd_(r-1,n,t)}this._cachedIndex=r,this.intervalChanged_(r,n,i)}return this.interpolate_(r,n,t,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,r=this.sampleValues,i=this.valueSize,n=t*i,a=0;a!==i;++a)e[a]=r[n+a];return e},interpolate_:function(t,e,r,i){throw new Error("call to abstract method")},intervalChanged_:function(t,e,r){}},Object.assign(THREE.Interpolant.prototype,{beforeStart_:THREE.Interpolant.prototype.copySampleValue_,afterEnd_:THREE.Interpolant.prototype.copySampleValue_}),THREE.CubicInterpolant=function(t,e,r,i){THREE.Interpolant.call(this,t,e,r,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0},THREE.CubicInterpolant.prototype=Object.assign(Object.create(THREE.Interpolant.prototype),{constructor:THREE.CubicInterpolant,DefaultSettings_:{endingStart:THREE.ZeroCurvatureEnding,endingEnd:THREE.ZeroCurvatureEnding},intervalChanged_:function(t,e,r){var i=this.parameterPositions,n=t-2,a=t+1,o=i[n],s=i[a];if(void 0===o)switch(this.getSettings_().endingStart){case THREE.ZeroSlopeEnding:n=t,o=2*e-r;break;case THREE.WrapAroundEnding:n=i.length-2,o=e+i[n]-i[n+1];break;default:n=t,o=r}if(void 0===s)switch(this.getSettings_().endingEnd){case THREE.ZeroSlopeEnding:a=t,s=2*r-e;break;case THREE.WrapAroundEnding:a=1,s=r+i[1]-i[0];break;default:a=t-1,s=e}var c=.5*(r-e),h=this.valueSize;this._weightPrev=c/(e-o),this._weightNext=c/(s-r),this._offsetPrev=n*h,this._offsetNext=a*h},interpolate_:function(t,e,r,i){for(var n=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,c=s-o,h=this._offsetPrev,l=this._offsetNext,u=this._weightPrev,p=this._weightNext,d=(r-e)/(i-e),E=d*d,f=E*d,m=-u*f+2*u*E-u*d,g=(1+u)*f+(-1.5-2*u)*E+(-.5+u)*d+1,v=(-1-p)*f+(1.5+p)*E+.5*d,T=p*f-p*E,y=0;y!==o;++y)n[y]=m*a[h+y]+g*a[c+y]+v*a[s+y]+T*a[l+y];return n}}),THREE.DiscreteInterpolant=function(t,e,r,i){THREE.Interpolant.call(this,t,e,r,i)},THREE.DiscreteInterpolant.prototype=Object.assign(Object.create(THREE.Interpolant.prototype),{constructor:THREE.DiscreteInterpolant,interpolate_:function(t,e,r,i){return this.copySampleValue_(t-1)}}),THREE.LinearInterpolant=function(t,e,r,i){THREE.Interpolant.call(this,t,e,r,i)},THREE.LinearInterpolant.prototype=Object.assign(Object.create(THREE.Interpolant.prototype),{constructor:THREE.LinearInterpolant,interpolate_:function(t,e,r,i){for(var n=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,c=s-o,h=(r-e)/(i-e),l=1-h,u=0;u!==o;++u)n[u]=a[c+u]*l+a[s+u]*h;return n}}),THREE.QuaternionLinearInterpolant=function(t,e,r,i){THREE.Interpolant.call(this,t,e,r,i)},THREE.QuaternionLinearInterpolant.prototype=Object.assign(Object.create(THREE.Interpolant.prototype),{constructor:THREE.QuaternionLinearInterpolant,interpolate_:function(t,e,r,i){for(var n=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=t*o,c=(r-e)/(i-e),h=s+o;s!==h;s+=4)THREE.Quaternion.slerpFlat(n,0,a,s-o,a,s,c);return n}}),THREE.Clock=function(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1},THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.startTime=(performance||Date).now(),this.oldTime=this.startTime,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t=0;if(this.autoStart&&!this.running&&this.start(),this.running){var e=(performance||Date).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}},THREE.EventDispatcher=function(){},THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(t){t.addEventListener=THREE.EventDispatcher.prototype.addEventListener,t.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener,t.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener,t.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var r=this._listeners;void 0===r[t]&&(r[t]=[]),r[t].indexOf(e)===-1&&r[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var r=this._listeners;return void 0!==r[t]&&r[t].indexOf(e)!==-1},removeEventListener:function(t,e){if(void 0!==this._listeners){var r=this._listeners,i=r[t];if(void 0!==i){var n=i.indexOf(e);n!==-1&&i.splice(n,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners,r=e[t.type];if(void 0!==r){t.target=this;for(var i=[],n=r.length,a=0;a<n;a++)i[a]=r[a];for(var a=0;a<n;a++)i[a].call(this,t)}}}},THREE.Layers=function(){this.mask=1},THREE.Layers.prototype={constructor:THREE.Layers,set:function(t){this.mask=1<<t},enable:function(t){this.mask|=1<<t},toggle:function(t){this.mask^=1<<t},disable:function(t){this.mask&=~(1<<t)},test:function(t){return 0!==(this.mask&t.mask)}},function(t){function e(t,e){return t.distance-e.distance}function r(t,e,i,n){if(t.visible!==!1&&(t.raycast(e,i),n===!0))for(var a=t.children,o=0,s=a.length;o<s;o++)r(a[o],e,i,!0)}t.Raycaster=function(e,r,i,n){this.ray=new t.Ray(e,r),this.near=i||0,this.far=n||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})},t.Raycaster.prototype={constructor:t.Raycaster,linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(e,r){r instanceof t.PerspectiveCamera?(this.ray.origin.setFromMatrixPosition(r.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(r).sub(this.ray.origin).normalize()):r instanceof t.OrthographicCamera?(this.ray.origin.set(e.x,e.y,-1).unproject(r),this.ray.direction.set(0,0,-1).transformDirection(r.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,i){var n=[];return r(t,this,n,i),n.sort(e),n},intersectObjects:function(t,i){var n=[];if(Array.isArray(t)===!1)return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),n;for(var a=0,o=t.length;a<o;a++)r(t[a],this,n,i);return n.sort(e),n}}}(THREE),THREE.Object3D=function(){function t(){n.setFromEuler(i,!1)}function e(){i.setFromQuaternion(n,void 0,!1)}Object.defineProperty(this,"id",{value:THREE.Object3DIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=THREE.Object3D.DefaultUp.clone();var r=new THREE.Vector3,i=new THREE.Euler,n=new THREE.Quaternion,a=new THREE.Vector3(1,1,1);i.onChange(t),n.onChange(e),Object.defineProperties(this,{position:{enumerable:!0,value:r},rotation:{enumerable:!0,value:i},quaternion:{enumerable:!0,value:n},scale:{enumerable:!0,value:a},modelViewMatrix:{value:new THREE.Matrix4},normalMatrix:{value:new THREE.Matrix3}}),this.rotationAutoUpdate=!0,this.matrix=new THREE.Matrix4,this.matrixWorld=new THREE.Matrix4,this.matrixAutoUpdate=THREE.Object3D.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new THREE.Layers,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}},THREE.Object3D.DefaultUp=new THREE.Vector3(0,1,0),THREE.Object3D.DefaultMatrixAutoUpdate=!0,THREE.Object3D.prototype={constructor:THREE.Object3D,applyMatrix:function(t){this.matrix.multiplyMatrices(t,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(){var t=new THREE.Quaternion;return function(e,r){return t.setFromAxisAngle(e,r),this.quaternion.multiply(t),this}}(),rotateX:function(){var t=new THREE.Vector3(1,0,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateY:function(){var t=new THREE.Vector3(0,1,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateZ:function(){var t=new THREE.Vector3(0,0,1);return function(e){return this.rotateOnAxis(t,e)}}(),translateOnAxis:function(){var t=new THREE.Vector3;return function(e,r){return t.copy(e).applyQuaternion(this.quaternion),this.position.add(t.multiplyScalar(r)),this}}(),translateX:function(){var t=new THREE.Vector3(1,0,0);return function(e){return this.translateOnAxis(t,e)}}(),translateY:function(){var t=new THREE.Vector3(0,1,0);return function(e){return this.translateOnAxis(t,e)}}(),translateZ:function(){var t=new THREE.Vector3(0,0,1);return function(e){return this.translateOnAxis(t,e)}}(),localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var t=new THREE.Matrix4;return function(e){return e.applyMatrix4(t.getInverse(this.matrixWorld))}}(),lookAt:function(){var t=new THREE.Matrix4;return function(e){t.lookAt(e,this.position,this.up),this.quaternion.setFromRotationMatrix(t)}}(),add:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t instanceof THREE.Object3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,t.dispatchEvent({type:"added"}),this.children.push(t)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},remove:function(t){if(arguments.length>1)for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);var r=this.children.indexOf(t);r!==-1&&(t.parent=null,t.dispatchEvent({type:"removed"}),this.children.splice(r,1))},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var r=0,i=this.children.length;r<i;r++){var n=this.children[r],a=n.getObjectByProperty(t,e);if(void 0!==a)return a}},getWorldPosition:function(t){var e=t||new THREE.Vector3;return this.updateMatrixWorld(!0),e.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var t=new THREE.Vector3,e=new THREE.Vector3;return function(r){var i=r||new THREE.Quaternion;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,i,e),i}}(),getWorldRotation:function(){var t=new THREE.Quaternion;return function(e){var r=e||new THREE.Euler;return this.getWorldQuaternion(t),r.setFromQuaternion(t,this.rotation.order,!1)}}(),getWorldScale:function(){var t=new THREE.Vector3,e=new THREE.Quaternion;return function(r){var i=r||new THREE.Vector3;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,e,i),i}}(),getWorldDirection:function(){var t=new THREE.Quaternion;return function(e){var r=e||new THREE.Vector3;return this.getWorldQuaternion(t),r.set(0,0,1).applyQuaternion(t)}}(),raycast:function(){},traverse:function(t){t(this);for(var e=this.children,r=0,i=e.length;r<i;r++)e[r].traverse(t)},traverseVisible:function(t){if(this.visible!==!1){t(this);for(var e=this.children,r=0,i=e.length;r<i;r++)e[r].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate===!0&&this.updateMatrix(),this.matrixWorldNeedsUpdate!==!0&&t!==!0||(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(var e=0,r=this.children.length;e<r;e++)this.children[e].updateMatrixWorld(t)},toJSON:function(t){function e(t){var e=[];for(var r in t){var i=t[r];delete i.metadata,e.push(i)}return e}var r=void 0===t||""===t,i={};r&&(t={geometries:{},materials:{},textures:{},images:{}},i.metadata={version:4.4,type:"Object",generator:"Object3D.toJSON"});var n={};if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),this.castShadow===!0&&(n.castShadow=!0),this.receiveShadow===!0&&(n.receiveShadow=!0),this.visible===!1&&(n.visible=!1),n.matrix=this.matrix.toArray(),void 0!==this.geometry&&(void 0===t.geometries[this.geometry.uuid]&&(t.geometries[this.geometry.uuid]=this.geometry.toJSON(t)),n.geometry=this.geometry.uuid),void 0!==this.material&&(void 0===t.materials[this.material.uuid]&&(t.materials[this.material.uuid]=this.material.toJSON(t)),n.material=this.material.uuid),this.children.length>0){n.children=[];for(var a=0;a<this.children.length;a++)n.children.push(this.children[a].toJSON(t).object)}if(r){var o=e(t.geometries),s=e(t.materials),c=e(t.textures),h=e(t.images);o.length>0&&(i.geometries=o),s.length>0&&(i.materials=s),c.length>0&&(i.textures=c),h.length>0&&(i.images=h)}return i.object=n,i},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;r<t.children.length;r++){var i=t.children[r];this.add(i.clone())}return this}},THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype),THREE.Object3DIdCount=0,THREE.Face3=function(t,e,r,i,n,a){this.a=t,this.b=e,this.c=r,this.normal=i instanceof THREE.Vector3?i:new THREE.Vector3,this.vertexNormals=Array.isArray(i)?i:[],this.color=n instanceof THREE.Color?n:new THREE.Color,this.vertexColors=Array.isArray(n)?n:[],this.materialIndex=void 0!==a?a:0},THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,r=t.vertexNormals.length;e<r;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(var e=0,r=t.vertexColors.length;e<r;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}},THREE.BufferAttribute=function(t,e,r){this.uuid=THREE.Math.generateUUID(),this.array=t,this.itemSize=e,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0,this.normalized=r===!0},THREE.BufferAttribute.prototype={constructor:THREE.BufferAttribute,get count(){return this.array.length/this.itemSize},set needsUpdate(t){t===!0&&this.version++},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.dynamic=t.dynamic,this},copyAt:function(t,e,r){t*=this.itemSize,r*=e.itemSize;for(var i=0,n=this.itemSize;i<n;i++)this.array[t+i]=e.array[r+i];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,r=0,i=0,n=t.length;i<n;i++){var a=t[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),a=new THREE.Color),e[r++]=a.r,e[r++]=a.g,e[r++]=a.b}return this},copyIndicesArray:function(t){for(var e=this.array,r=0,i=0,n=t.length;i<n;i++){var a=t[i];e[r++]=a.a,e[r++]=a.b,e[r++]=a.c}return this},copyVector2sArray:function(t){for(var e=this.array,r=0,i=0,n=t.length;i<n;i++){var a=t[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),a=new THREE.Vector2),e[r++]=a.x,e[r++]=a.y}return this},copyVector3sArray:function(t){for(var e=this.array,r=0,i=0,n=t.length;i<n;i++){var a=t[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),a=new THREE.Vector3),e[r++]=a.x,e[r++]=a.y,e[r++]=a.z}return this},copyVector4sArray:function(t){for(var e=this.array,r=0,i=0,n=t.length;i<n;i++){var a=t[i];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),a=new THREE.Vector4),e[r++]=a.x,e[r++]=a.y,e[r++]=a.z,e[r++]=a.w}return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=r,this},setXYZ:function(t,e,r,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=r,this.array[t+2]=i,this},setXYZW:function(t,e,r,i,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=r,this.array[t+2]=i,this.array[t+3]=n,this},clone:function(){return(new this.constructor).copy(this)}},THREE.Int8Attribute=function(t,e){return new THREE.BufferAttribute(new Int8Array(t),e)},THREE.Uint8Attribute=function(t,e){return new THREE.BufferAttribute(new Uint8Array(t),e)};THREE.Uint8ClampedAttribute=function(t,e){return new THREE.BufferAttribute(new Uint8ClampedArray(t),e)};THREE.Int16Attribute=function(t,e){return new THREE.BufferAttribute(new Int16Array(t),e)},THREE.Uint16Attribute=function(t,e){return new THREE.BufferAttribute(new Uint16Array(t),e)},THREE.Int32Attribute=function(t,e){return new THREE.BufferAttribute(new Int32Array(t),e)},THREE.Uint32Attribute=function(t,e){return new THREE.BufferAttribute(new Uint32Array(t),e)},THREE.Float32Attribute=function(t,e){return new THREE.BufferAttribute(new Float32Array(t),e)},THREE.Float64Attribute=function(t,e){return new THREE.BufferAttribute(new Float64Array(t),e)},THREE.DynamicBufferAttribute=function(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new THREE.BufferAttribute(t,e).setDynamic(!0)},THREE.InstancedBufferAttribute=function(t,e,r){THREE.BufferAttribute.call(this,t,e),this.meshPerAttribute=r||1},THREE.InstancedBufferAttribute.prototype=Object.create(THREE.BufferAttribute.prototype),THREE.InstancedBufferAttribute.prototype.constructor=THREE.InstancedBufferAttribute,THREE.InstancedBufferAttribute.prototype.copy=function(t){return THREE.BufferAttribute.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},THREE.InterleavedBuffer=function(t,e){this.uuid=THREE.Math.generateUUID(),this.array=t,this.stride=e,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0},THREE.InterleavedBuffer.prototype={constructor:THREE.InterleavedBuffer,get length(){return this.array.length},get count(){return this.array.length/this.stride},set needsUpdate(t){t===!0&&this.version++},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.stride=t.stride,this.dynamic=t.dynamic,this},copyAt:function(t,e,r){t*=this.stride,r*=e.stride;for(var i=0,n=this.stride;i<n;i++)this.array[t+i]=e.array[r+i];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)}},THREE.InstancedInterleavedBuffer=function(t,e,r){THREE.InterleavedBuffer.call(this,t,e),this.meshPerAttribute=r||1},THREE.InstancedInterleavedBuffer.prototype=Object.create(THREE.InterleavedBuffer.prototype),THREE.InstancedInterleavedBuffer.prototype.constructor=THREE.InstancedInterleavedBuffer,THREE.InstancedInterleavedBuffer.prototype.copy=function(t){return THREE.InterleavedBuffer.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},THREE.InterleavedBufferAttribute=function(t,e,r){this.uuid=THREE.Math.generateUUID(),this.data=t,
this.itemSize=e,this.offset=r},THREE.InterleavedBufferAttribute.prototype={constructor:THREE.InterleavedBufferAttribute,get length(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),this.array.length},get count(){return this.data.count},setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=r,this},setXYZ:function(t,e,r,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=r,this.data.array[t+2]=i,this},setXYZW:function(t,e,r,i,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=r,this.data.array[t+2]=i,this.data.array[t+3]=n,this}},THREE.Geometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++}),this.uuid=THREE.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},THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(t){for(var e=(new THREE.Matrix3).getNormalMatrix(t),r=0,i=this.vertices.length;r<i;r++){var n=this.vertices[r];n.applyMatrix4(t)}for(var r=0,i=this.faces.length;r<i;r++){var a=this.faces[r];a.normal.applyMatrix3(e).normalize();for(var o=0,s=a.vertexNormals.length;o<s;o++)a.vertexNormals[o].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var t;return function(e){return void 0===t&&(t=new THREE.Matrix4),t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t;return function(e){return void 0===t&&(t=new THREE.Matrix4),t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t;return function(e){return void 0===t&&(t=new THREE.Matrix4),t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t;return function(e,r,i){return void 0===t&&(t=new THREE.Matrix4),t.makeTranslation(e,r,i),this.applyMatrix(t),this}}(),scale:function(){var t;return function(e,r,i){return void 0===t&&(t=new THREE.Matrix4),t.makeScale(e,r,i),this.applyMatrix(t),this}}(),lookAt:function(){var t;return function(e){void 0===t&&(t=new THREE.Object3D),t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),fromBufferGeometry:function(t){function e(t,e,i,n){var a=void 0!==o?[l[t].clone(),l[e].clone(),l[i].clone()]:[],d=void 0!==s?[r.colors[t].clone(),r.colors[e].clone(),r.colors[i].clone()]:[],E=new THREE.Face3(t,e,i,a,d,n);r.faces.push(E),void 0!==c&&r.faceVertexUvs[0].push([u[t].clone(),u[e].clone(),u[i].clone()]),void 0!==h&&r.faceVertexUvs[1].push([p[t].clone(),p[e].clone(),p[i].clone()])}var r=this,i=null!==t.index?t.index.array:void 0,n=t.attributes,a=n.position.array,o=void 0!==n.normal?n.normal.array:void 0,s=void 0!==n.color?n.color.array:void 0,c=void 0!==n.uv?n.uv.array:void 0,h=void 0!==n.uv2?n.uv2.array:void 0;void 0!==h&&(this.faceVertexUvs[1]=[]);for(var l=[],u=[],p=[],d=0,E=0;d<a.length;d+=3,E+=2)r.vertices.push(new THREE.Vector3(a[d],a[d+1],a[d+2])),void 0!==o&&l.push(new THREE.Vector3(o[d],o[d+1],o[d+2])),void 0!==s&&r.colors.push(new THREE.Color(s[d],s[d+1],s[d+2])),void 0!==c&&u.push(new THREE.Vector2(c[E],c[E+1])),void 0!==h&&p.push(new THREE.Vector2(h[E],h[E+1]));if(void 0!==i){var f=t.groups;if(f.length>0)for(var d=0;d<f.length;d++)for(var m=f[d],g=m.start,v=m.count,E=g,T=g+v;E<T;E+=3)e(i[E],i[E+1],i[E+2],m.materialIndex);else for(var d=0;d<i.length;d+=3)e(i[d],i[d+1],i[d+2])}else for(var d=0;d<a.length/3;d+=3)e(d,d+1,d+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var t=this.boundingBox.center().negate();return this.translate(t.x,t.y,t.z),t},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,r=0===e?1:1/e,i=new THREE.Matrix4;return i.set(r,0,0,-r*t.x,0,r,0,-r*t.y,0,0,r,-r*t.z,0,0,0,1),this.applyMatrix(i),this},computeFaceNormals:function(){for(var t=new THREE.Vector3,e=new THREE.Vector3,r=0,i=this.faces.length;r<i;r++){var n=this.faces[r],a=this.vertices[n.a],o=this.vertices[n.b],s=this.vertices[n.c];t.subVectors(s,o),e.subVectors(a,o),t.cross(e),t.normalize(),n.normal.copy(t)}},computeVertexNormals:function(t){void 0===t&&(t=!0);var e,r,i,n,a,o;for(o=new Array(this.vertices.length),e=0,r=this.vertices.length;e<r;e++)o[e]=new THREE.Vector3;if(t){var s,c,h,l=new THREE.Vector3,u=new THREE.Vector3;for(i=0,n=this.faces.length;i<n;i++)a=this.faces[i],s=this.vertices[a.a],c=this.vertices[a.b],h=this.vertices[a.c],l.subVectors(h,c),u.subVectors(s,c),l.cross(u),o[a.a].add(l),o[a.b].add(l),o[a.c].add(l)}else for(i=0,n=this.faces.length;i<n;i++)a=this.faces[i],o[a.a].add(a.normal),o[a.b].add(a.normal),o[a.c].add(a.normal);for(e=0,r=this.vertices.length;e<r;e++)o[e].normalize();for(i=0,n=this.faces.length;i<n;i++){a=this.faces[i];var p=a.vertexNormals;3===p.length?(p[0].copy(o[a.a]),p[1].copy(o[a.b]),p[2].copy(o[a.c])):(p[0]=o[a.a].clone(),p[1]=o[a.b].clone(),p[2]=o[a.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,r,i,n;for(r=0,i=this.faces.length;r<i;r++)for(n=this.faces[r],n.__originalFaceNormal?n.__originalFaceNormal.copy(n.normal):n.__originalFaceNormal=n.normal.clone(),n.__originalVertexNormals||(n.__originalVertexNormals=[]),t=0,e=n.vertexNormals.length;t<e;t++)n.__originalVertexNormals[t]?n.__originalVertexNormals[t].copy(n.vertexNormals[t]):n.__originalVertexNormals[t]=n.vertexNormals[t].clone();var a=new THREE.Geometry;for(a.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];var o,s,c=this.morphNormals[t].faceNormals,h=this.morphNormals[t].vertexNormals;for(r=0,i=this.faces.length;r<i;r++)o=new THREE.Vector3,s={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},c.push(o),h.push(s)}var l=this.morphNormals[t];a.vertices=this.morphTargets[t].vertices,a.computeFaceNormals(),a.computeVertexNormals();var o,s;for(r=0,i=this.faces.length;r<i;r++)n=this.faces[r],o=l.faceNormals[r],s=l.vertexNormals[r],o.copy(n.normal),s.a.copy(n.vertexNormals[0]),s.b.copy(n.vertexNormals[1]),s.c.copy(n.vertexNormals[2])}for(r=0,i=this.faces.length;r<i;r++)n=this.faces[r],n.normal=n.__originalFaceNormal,n.vertexNormals=n.__originalVertexNormals},computeTangents:function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){for(var t=0,e=this.vertices,r=0,i=e.length;r<i;r++)r>0&&(t+=e[r].distanceTo(e[r-1])),this.lineDistances[r]=t},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,r){if(t instanceof THREE.Geometry==!1)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t);var i,n=this.vertices.length,a=this.vertices,o=t.vertices,s=this.faces,c=t.faces,h=this.faceVertexUvs[0],l=t.faceVertexUvs[0];void 0===r&&(r=0),void 0!==e&&(i=(new THREE.Matrix3).getNormalMatrix(e));for(var u=0,p=o.length;u<p;u++){var d=o[u],E=d.clone();void 0!==e&&E.applyMatrix4(e),a.push(E)}for(u=0,p=c.length;u<p;u++){var f,m,g,v=c[u],T=v.vertexNormals,y=v.vertexColors;f=new THREE.Face3(v.a+n,v.b+n,v.c+n),f.normal.copy(v.normal),void 0!==i&&f.normal.applyMatrix3(i).normalize();for(var R=0,H=T.length;R<H;R++)m=T[R].clone(),void 0!==i&&m.applyMatrix3(i).normalize(),f.vertexNormals.push(m);f.color.copy(v.color);for(var R=0,H=y.length;R<H;R++)g=y[R],f.vertexColors.push(g.clone());f.materialIndex=v.materialIndex+r,s.push(f)}for(u=0,p=l.length;u<p;u++){var x=l[u],b=[];if(void 0!==x){for(var R=0,H=x.length;R<H;R++)b.push(x[R].clone());h.push(b)}}},mergeMesh:function(t){return t instanceof THREE.Mesh==!1?void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t):(t.matrixAutoUpdate&&t.updateMatrix(),void this.merge(t.geometry,t.matrix))},mergeVertices:function(){var t,e,r,i,n,a,o,s,c={},h=[],l=[],u=4,p=Math.pow(10,u);for(r=0,i=this.vertices.length;r<i;r++)t=this.vertices[r],e=Math.round(t.x*p)+"_"+Math.round(t.y*p)+"_"+Math.round(t.z*p),void 0===c[e]?(c[e]=r,h.push(this.vertices[r]),l[r]=h.length-1):l[r]=l[c[e]];var d=[];for(r=0,i=this.faces.length;r<i;r++){n=this.faces[r],n.a=l[n.a],n.b=l[n.b],n.c=l[n.c],a=[n.a,n.b,n.c];for(var E=-1,f=0;f<3;f++)if(a[f]===a[(f+1)%3]){E=f,d.push(r);break}}for(r=d.length-1;r>=0;r--){var m=d[r];for(this.faces.splice(m,1),o=0,s=this.faceVertexUvs.length;o<s;o++)this.faceVertexUvs[o].splice(m,1)}var g=this.vertices.length-h.length;return this.vertices=h,g},sortFacesByMaterialIndex:function(){function t(t,e){return t.materialIndex-e.materialIndex}for(var e=this.faces,r=e.length,i=0;i<r;i++)e[i]._id=i;e.sort(t);var n,a,o=this.faceVertexUvs[0],s=this.faceVertexUvs[1];o&&o.length===r&&(n=[]),s&&s.length===r&&(a=[]);for(var i=0;i<r;i++){var c=e[i]._id;n&&n.push(o[c]),a&&a.push(s[c])}n&&(this.faceVertexUvs[0]=n),a&&(this.faceVertexUvs[1]=a)},toJSON:function(){function t(t,e,r){return r?t|1<<e:t&~(1<<e)}function e(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==p[e]?p[e]:(p[e]=u.length/3,u.push(t.x,t.y,t.z),p[e])}function r(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==E[e]?E[e]:(E[e]=d.length,d.push(t.getHex()),E[e])}function i(t){var e=t.x.toString()+t.y.toString();return void 0!==m[e]?m[e]:(m[e]=f.length/2,f.push(t.x,t.y),m[e])}var n={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),void 0!==this.parameters){var a=this.parameters;for(var o in a)void 0!==a[o]&&(n[o]=a[o]);return n}for(var s=[],c=0;c<this.vertices.length;c++){var h=this.vertices[c];s.push(h.x,h.y,h.z)}for(var l=[],u=[],p={},d=[],E={},f=[],m={},c=0;c<this.faces.length;c++){var g=this.faces[c],v=!0,T=!1,y=void 0!==this.faceVertexUvs[0][c],R=g.normal.length()>0,H=g.vertexNormals.length>0,x=1!==g.color.r||1!==g.color.g||1!==g.color.b,b=g.vertexColors.length>0,_=0;if(_=t(_,0,0),_=t(_,1,v),_=t(_,2,T),_=t(_,3,y),_=t(_,4,R),_=t(_,5,H),_=t(_,6,x),_=t(_,7,b),l.push(_),l.push(g.a,g.b,g.c),l.push(g.materialIndex),y){var M=this.faceVertexUvs[0][c];l.push(i(M[0]),i(M[1]),i(M[2]))}if(R&&l.push(e(g.normal)),H){var w=g.vertexNormals;l.push(e(w[0]),e(w[1]),e(w[2]))}if(x&&l.push(r(g.color)),b){var S=g.vertexColors;l.push(r(S[0]),r(S[1]),r(S[2]))}}return n.data={},n.data.vertices=s,n.data.normals=u,d.length>0&&(n.data.colors=d),f.length>0&&(n.data.uvs=[f]),n.data.faces=l,n},clone:function(){return(new THREE.Geometry).copy(this)},copy:function(t){this.vertices=[],this.faces=[],this.faceVertexUvs=[[]];for(var e=t.vertices,r=0,i=e.length;r<i;r++)this.vertices.push(e[r].clone());for(var n=t.faces,r=0,i=n.length;r<i;r++)this.faces.push(n[r].clone());for(var r=0,i=t.faceVertexUvs.length;r<i;r++){var a=t.faceVertexUvs[r];void 0===this.faceVertexUvs[r]&&(this.faceVertexUvs[r]=[]);for(var o=0,s=a.length;o<s;o++){for(var c=a[o],h=[],l=0,u=c.length;l<u;l++){var p=c[l];h.push(p.clone())}this.faceVertexUvs[r].push(h)}}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype),THREE.GeometryIdCount=0,THREE.DirectGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++}),this.uuid=THREE.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},THREE.DirectGeometry.prototype={constructor:THREE.DirectGeometry,computeBoundingBox:THREE.Geometry.prototype.computeBoundingBox,computeBoundingSphere:THREE.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(t){for(var e,r,i=[],n=t.faces,a=0;a<n.length;a++){var o=n[a];o.materialIndex!==r&&(r=o.materialIndex,void 0!==e&&(e.count=3*a-e.start,i.push(e)),e={start:3*a,materialIndex:r})}void 0!==e&&(e.count=3*a-e.start,i.push(e)),this.groups=i},fromGeometry:function(t){var e,r=t.faces,i=t.vertices,n=t.faceVertexUvs,a=n[0]&&n[0].length>0,o=n[1]&&n[1].length>0,s=t.morphTargets,c=s.length;if(c>0){e=[];for(var h=0;h<c;h++)e[h]=[];this.morphTargets.position=e}var l,u=t.morphNormals,p=u.length;if(p>0){l=[];for(var h=0;h<p;h++)l[h]=[];this.morphTargets.normal=l}for(var d=t.skinIndices,E=t.skinWeights,f=d.length===i.length,m=E.length===i.length,h=0;h<r.length;h++){var g=r[h];this.vertices.push(i[g.a],i[g.b],i[g.c]);var v=g.vertexNormals;if(3===v.length)this.normals.push(v[0],v[1],v[2]);else{var T=g.normal;this.normals.push(T,T,T)}var y=g.vertexColors;if(3===y.length)this.colors.push(y[0],y[1],y[2]);else{var R=g.color;this.colors.push(R,R,R)}if(a===!0){var H=n[0][h];void 0!==H?this.uvs.push(H[0],H[1],H[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",h),this.uvs.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2))}if(o===!0){var H=n[1][h];void 0!==H?this.uvs2.push(H[0],H[1],H[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",h),this.uvs2.push(new THREE.Vector2,new THREE.Vector2,new THREE.Vector2))}for(var x=0;x<c;x++){var b=s[x].vertices;e[x].push(b[g.a],b[g.b],b[g.c])}for(var x=0;x<p;x++){var _=u[x].vertexNormals[h];l[x].push(_.a,_.b,_.c)}f&&this.skinIndices.push(d[g.a],d[g.b],d[g.c]),m&&this.skinWeights.push(E[g.a],E[g.b],E[g.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.DirectGeometry.prototype),THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++}),this.uuid=THREE.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}},THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,getIndex:function(){return this.index},setIndex:function(t){this.index=t},addAttribute:function(t,e){return e instanceof THREE.BufferAttribute==!1&&e instanceof THREE.InterleavedBufferAttribute==!1?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),void this.addAttribute(t,new THREE.BufferAttribute(arguments[1],arguments[2]))):"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),void this.setIndex(e)):(this.attributes[t]=e,this)},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,r){this.groups.push({start:t,count:e,materialIndex:void 0!==r?r:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToVector3Array(e.array),e.needsUpdate=!0);var r=this.attributes.normal;if(void 0!==r){var i=(new THREE.Matrix3).getNormalMatrix(t);i.applyToVector3Array(r.array),r.needsUpdate=!0}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var t;return function(e){return void 0===t&&(t=new THREE.Matrix4),t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t;return function(e){return void 0===t&&(t=new THREE.Matrix4),t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t;return function(e){return void 0===t&&(t=new THREE.Matrix4),t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t;return function(e,r,i){return void 0===t&&(t=new THREE.Matrix4),t.makeTranslation(e,r,i),this.applyMatrix(t),this}}(),scale:function(){var t;return function(e,r,i){return void 0===t&&(t=new THREE.Matrix4),t.makeScale(e,r,i),this.applyMatrix(t),this}}(),lookAt:function(){var t;return function(e){void 0===t&&(t=new THREE.Object3D),t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),center:function(){this.computeBoundingBox();var t=this.boundingBox.center().negate();return this.translate(t.x,t.y,t.z),t},setFromObject:function(t){var e=t.geometry;if(t instanceof THREE.Points||t instanceof THREE.Line){var r=new THREE.Float32Attribute(3*e.vertices.length,3),i=new THREE.Float32Attribute(3*e.colors.length,3);if(this.addAttribute("position",r.copyVector3sArray(e.vertices)),this.addAttribute("color",i.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var n=new THREE.Float32Attribute(e.lineDistances.length,1);this.addAttribute("lineDistance",n.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t instanceof THREE.Mesh&&e instanceof THREE.Geometry&&this.fromGeometry(e);return this},updateFromObject:function(t){var e=t.geometry;if(t instanceof THREE.Mesh){var r=e.__directGeometry;if(void 0===r)return this.fromGeometry(e);r.verticesNeedUpdate=e.verticesNeedUpdate,r.normalsNeedUpdate=e.normalsNeedUpdate,r.colorsNeedUpdate=e.colorsNeedUpdate,r.uvsNeedUpdate=e.uvsNeedUpdate,r.groupsNeedUpdate=e.groupsNeedUpdate,e.verticesNeedUpdate=!1,e.normalsNeedUpdate=!1,e.colorsNeedUpdate=!1,e.uvsNeedUpdate=!1,e.groupsNeedUpdate=!1,e=r}if(e.verticesNeedUpdate===!0){var i=this.attributes.position;void 0!==i&&(i.copyVector3sArray(e.vertices),i.needsUpdate=!0),e.verticesNeedUpdate=!1}if(e.normalsNeedUpdate===!0){var i=this.attributes.normal;void 0!==i&&(i.copyVector3sArray(e.normals),i.needsUpdate=!0),e.normalsNeedUpdate=!1}if(e.colorsNeedUpdate===!0){var i=this.attributes.color;void 0!==i&&(i.copyColorsArray(e.colors),i.needsUpdate=!0),e.colorsNeedUpdate=!1}if(e.uvsNeedUpdate){var i=this.attributes.uv;void 0!==i&&(i.copyVector2sArray(e.uvs),i.needsUpdate=!0),e.uvsNeedUpdate=!1}if(e.lineDistancesNeedUpdate){var i=this.attributes.lineDistance;void 0!==i&&(i.copyArray(e.lineDistances),i.needsUpdate=!0),e.lineDistancesNeedUpdate=!1}return e.groupsNeedUpdate&&(e.computeGroups(t.geometry),this.groups=e.groups,e.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new THREE.DirectGeometry).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.addAttribute("position",new THREE.BufferAttribute(e,3).copyVector3sArray(t.vertices)),t.normals.length>0){var r=new Float32Array(3*t.normals.length);this.addAttribute("normal",new THREE.BufferAttribute(r,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var i=new Float32Array(3*t.colors.length);this.addAttribute("color",new THREE.BufferAttribute(i,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var n=new Float32Array(2*t.uvs.length);this.addAttribute("uv",new THREE.BufferAttribute(n,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var a=new Float32Array(2*t.uvs2.length);this.addAttribute("uv2",new THREE.BufferAttribute(a,2).copyVector2sArray(t.uvs2))}if(t.indices.length>0){var o=t.vertices.length>65535?Uint32Array:Uint16Array,s=new o(3*t.indices.length);this.setIndex(new THREE.BufferAttribute(s,1).copyIndicesArray(t.indices))}this.groups=t.groups;for(var c in t.morphTargets){for(var h=[],l=t.morphTargets[c],u=0,p=l.length;u<p;u++){var d=l[u],E=new THREE.Float32Attribute(3*d.length,3);h.push(E.copyVector3sArray(d))}this.morphAttributes[c]=h}if(t.skinIndices.length>0){var f=new THREE.Float32Attribute(4*t.skinIndices.length,4);this.addAttribute("skinIndex",f.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var m=new THREE.Float32Attribute(4*t.skinWeights.length,4);this.addAttribute("skinWeight",m.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var t=this.attributes.position.array;void 0!==t?this.boundingBox.setFromArray(t):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var t=new THREE.Box3,e=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var r=this.attributes.position.array;if(r){var i=this.boundingSphere.center;t.setFromArray(r),t.center(i);for(var n=0,a=0,o=r.length;a<o;a+=3)e.fromArray(r,a),n=Math.max(n,i.distanceToSquared(e));this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes,r=this.groups;if(e.position){var i=e.position.array;if(void 0===e.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(i.length),3));else for(var n=e.normal.array,a=0,o=n.length;a<o;a++)n[a]=0;var s,c,h,l=e.normal.array,u=new THREE.Vector3,p=new THREE.Vector3,d=new THREE.Vector3,E=new THREE.Vector3,f=new THREE.Vector3;if(t){var m=t.array;0===r.length&&this.addGroup(0,m.length);for(var g=0,v=r.length;g<v;++g)for(var T=r[g],y=T.start,R=T.count,a=y,o=y+R;a<o;a+=3)s=3*m[a+0],c=3*m[a+1],h=3*m[a+2],u.fromArray(i,s),p.fromArray(i,c),d.fromArray(i,h),E.subVectors(d,p),f.subVectors(u,p),E.cross(f),l[s]+=E.x,l[s+1]+=E.y,l[s+2]+=E.z,l[c]+=E.x,l[c+1]+=E.y,l[c+2]+=E.z,l[h]+=E.x,l[h+1]+=E.y,l[h+2]+=E.z}else for(var a=0,o=i.length;a<o;a+=9)u.fromArray(i,a),p.fromArray(i,a+3),d.fromArray(i,a+6),E.subVectors(d,p),f.subVectors(u,p),E.cross(f),l[a]=E.x,l[a+1]=E.y,l[a+2]=E.z,l[a+3]=E.x,l[a+4]=E.y,l[a+5]=E.z,l[a+6]=E.x,l[a+7]=E.y,l[a+8]=E.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(t instanceof THREE.BufferGeometry==!1)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t);void 0===e&&(e=0);var r=this.attributes;for(var i in r)if(void 0!==t.attributes[i])for(var n=r[i],a=n.array,o=t.attributes[i],s=o.array,c=o.itemSize,h=0,l=c*e;h<s.length;h++,l++)a[l]=s[h];return this},normalizeNormals:function(){for(var t,e,r,i,n=this.attributes.normal.array,a=0,o=n.length;a<o;a+=3)t=n[a],e=n[a+1],r=n[a+2],i=1/Math.sqrt(t*t+e*e+r*r),n[a]*=i,n[a+1]*=i,n[a+2]*=i},toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t=new THREE.BufferGeometry,e=this.index.array,r=this.attributes;for(var i in r){for(var n=r[i],a=n.array,o=n.itemSize,s=new a.constructor(e.length*o),c=0,h=0,l=0,u=e.length;l<u;l++){c=e[l]*o;for(var p=0;p<o;p++)s[h++]=a[c++]}t.addAttribute(i,new THREE.BufferAttribute(s,o))}return t},toJSON:function(){var t={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e=this.parameters;for(var r in e)void 0!==e[r]&&(t[r]=e[r]);return t}t.data={attributes:{}};var i=this.index;if(null!==i){var n=Array.prototype.slice.call(i.array);t.data.index={type:i.array.constructor.name,array:n}}var a=this.attributes;for(var r in a){var o=a[r],n=Array.prototype.slice.call(o.array);t.data.attributes[r]={itemSize:o.itemSize,type:o.array.constructor.name,array:n,normalized:o.normalized}}var s=this.groups;s.length>0&&(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 THREE.BufferGeometry).copy(this)},copy:function(t){var e=t.index;null!==e&&this.setIndex(e.clone());var r=t.attributes;for(var i in r){var n=r[i];this.addAttribute(i,n.clone())}for(var a=t.groups,o=0,s=a.length;o<s;o++){var c=a[o];this.addGroup(c.start,c.count,c.materialIndex)}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype),THREE.BufferGeometry.MaxIndex=65535,THREE.InstancedBufferGeometry=function(){THREE.BufferGeometry.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0},THREE.InstancedBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.InstancedBufferGeometry.prototype.constructor=THREE.InstancedBufferGeometry,THREE.InstancedBufferGeometry.prototype.addGroup=function(t,e,r){this.groups.push({start:t,count:e,instances:r})},THREE.InstancedBufferGeometry.prototype.copy=function(t){var e=t.index;null!==e&&this.setIndex(e.clone());var r=t.attributes;for(var i in r){var n=r[i];this.addAttribute(i,n.clone())}for(var a=t.groups,o=0,s=a.length;o<s;o++){var c=a[o];this.addGroup(c.start,c.count,c.instances)}return this},THREE.EventDispatcher.prototype.apply(THREE.InstancedBufferGeometry.prototype),THREE.Uniform=function(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t,this.dynamic=!1},THREE.Uniform.prototype={constructor:THREE.Uniform,onUpdate:function(t){return this.dynamic=!0,this.onUpdateCallback=t,this}},THREE.AnimationClip=function(t,e,r){this.name=t||THREE.Math.generateUUID(),this.tracks=r,this.duration=void 0!==e?e:-1,this.duration<0&&this.resetDuration(),this.trim(),this.optimize()},THREE.AnimationClip.prototype={constructor:THREE.AnimationClip,resetDuration:function(){for(var t=this.tracks,e=0,r=0,i=t.length;r!==i;++r){var n=this.tracks[r];e=Math.max(e,n.times[n.times.length-1])}this.duration=e},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}},Object.assign(THREE.AnimationClip,{parse:function(t){for(var e=[],r=t.tracks,i=1/(t.fps||1),n=0,a=r.length;n!==a;++n)e.push(THREE.KeyframeTrack.parse(r[n]).scale(i));return new THREE.AnimationClip(t.name,t.duration,e)},toJSON:function(t){for(var e=[],r=t.tracks,i={name:t.name,duration:t.duration,tracks:e},n=0,a=r.length;n!==a;++n)e.push(THREE.KeyframeTrack.toJSON(r[n]));return i},CreateFromMorphTargetSequence:function(t,e,r,i){for(var n=e.length,a=[],o=0;o<n;o++){var s=[],c=[];s.push((o+n-1)%n,o,(o+1)%n),c.push(0,1,0);var h=THREE.AnimationUtils.getKeyframeOrder(s);s=THREE.AnimationUtils.sortedArray(s,1,h),c=THREE.AnimationUtils.sortedArray(c,1,h),i||0!==s[0]||(s.push(n),c.push(c[0])),a.push(new THREE.NumberKeyframeTrack(".morphTargetInfluences["+e[o].name+"]",s,c).scale(1/r))}return new THREE.AnimationClip(t,(-1),a)},findByName:function(t,e){for(var r=0;r<t.length;r++)if(t[r].name===e)return t[r];return null},CreateClipsFromMorphTargetSequences:function(t,e,r){for(var i={},n=/^([\w-]*?)([\d]+)$/,a=0,o=t.length;a<o;a++){var s=t[a],c=s.name.match(n);if(c&&c.length>1){var h=c[1],l=i[h];l||(i[h]=l=[]),l.push(s)}}var u=[];for(var h in i)u.push(THREE.AnimationClip.CreateFromMorphTargetSequence(h,i[h],e,r));return u},parseAnimation:function(t,e,r){if(!t)return console.error(" no animation in JSONLoader data"),null;for(var i=function(t,e,r,i,n){if(0!==r.length){var a=[],o=[];THREE.AnimationUtils.flattenJSON(r,a,o,i),0!==a.length&&n.push(new t(e,a,o))}},n=[],a=t.name||"default",o=t.length||-1,s=t.fps||30,c=t.hierarchy||[],h=0;h<c.length;h++){var l=c[h].keys;if(l&&0!=l.length)if(l[0].morphTargets){for(var u={},p=0;p<l.length;p++)if(l[p].morphTargets)for(var d=0;d<l[p].morphTargets.length;d++)u[l[p].morphTargets[d]]=-1;for(var E in u){for(var f=[],m=[],d=0;d!==l[p].morphTargets.length;++d){var g=l[p];f.push(g.time),m.push(g.morphTarget===E?1:0)}n.push(new THREE.NumberKeyframeTrack(".morphTargetInfluence["+E+"]",f,m))}o=u.length*(s||1)}else{var v=".bones["+e[h].name+"]";i(THREE.VectorKeyframeTrack,v+".position",l,"pos",n),i(THREE.QuaternionKeyframeTrack,v+".quaternion",l,"rot",n),i(THREE.VectorKeyframeTrack,v+".scale",l,"scl",n)}}if(0===n.length)return null;var T=new THREE.AnimationClip(a,o,n);return T}}),THREE.AnimationMixer=function(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1},THREE.AnimationMixer.prototype={constructor:THREE.AnimationMixer,clipAction:function(t,e){var r,i=e||this._root,n=i.uuid,a="string"==typeof t?t:t.name,o=t!==a?t:null,s=this._actionsByClip[a];if(void 0!==s){var c=s.actionByRoot[n];if(void 0!==c)return c;if(r=s.knownActions[0],o=r._clip,t!==a&&t!==o)throw new Error("Different clips with the same name detected!")}if(null===o)return null;var h=new THREE.AnimationMixer._Action(this,o,e);return this._bindAction(h,r),this._addInactiveAction(h,a,n),h},existingAction:function(t,e){var r=e||this._root,i=r.uuid,n="string"==typeof t?t:t.name,a=this._actionsByClip[n];return void 0!==a?a.actionByRoot[i]||null:null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,r=this._bindings,i=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var n=0;n!==e;++n)t[n].reset();for(var n=0;n!==i;++n)r[n].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,r=this._nActiveActions,i=this.time+=t,n=Math.sign(t),a=this._accuIndex^=1,o=0;o!==r;++o){var s=e[o];s.enabled&&s._update(i,t,n,a)}for(var c=this._bindings,h=this._nActiveBindings,o=0;o!==h;++o)c[o].apply(a);return this},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,r=t.name,i=this._actionsByClip,n=i[r];if(void 0!==n){for(var a=n.knownActions,o=0,s=a.length;o!==s;++o){var c=a[o];this._deactivateAction(c);var h=c._cacheIndex,l=e[e.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,l._cacheIndex=h,e[h]=l,e.pop(),this._removeInactiveBindingsForAction(c)}delete i[r]}},uncacheRoot:function(t){var e=t.uuid,r=this._actionsByClip;for(var i in r){var n=r[i].actionByRoot,a=n[e];void 0!==a&&(this._deactivateAction(a),this._removeInactiveAction(a));
}var o=this._bindingsByRootAndName,s=o[e];if(void 0!==s)for(var c in s){var h=s[c];h.restoreOriginalState(),this._removeInactiveBinding(h)}},uncacheAction:function(t,e){var r=this.existingAction(t,e);null!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}},THREE.EventDispatcher.prototype.apply(THREE.AnimationMixer.prototype),THREE.AnimationMixer._Action=function(t,e,r){this._mixer=t,this._clip=e,this._localRoot=r||null;for(var i=e.tracks,n=i.length,a=new Array(n),o={endingStart:THREE.ZeroCurvatureEnding,endingEnd:THREE.ZeroCurvatureEnding},s=0;s!==n;++s){var c=i[s].createInterpolant(null);a[s]=c,c.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(n),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=THREE.LoopRepeat,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0},THREE.AnimationMixer._Action.prototype={constructor:THREE.AnimationMixer._Action,play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){this._startTime;return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,r){this._mixer;if(t.fadeOut(e),this.fadeIn(e),r){var i=this._clip.duration,n=t._clip.duration,a=n/i,o=i/n;t.warp(1,a,e),this.warp(o,1,e)}return this},crossFadeTo:function(t,e,r){return t.crossFadeFrom(this,e,r)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._currentTimeScale,0,t)},warp:function(t,e,r){var i=this._mixer,n=i.time,a=this._timeScaleInterpolant,o=this.timeScale;null===a&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);var s=a.parameterPositions,c=a.sampleValues;return s[0]=n,s[1]=n+r,c[0]=t/o,c[1]=e/o,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,r,i){var n=this._startTime;if(null!==n){var a=(t-n)*r;if(a<0||0===r)return;this._startTime=null,e=r*a}e*=this._updateTimeScale(t);var o=this._updateTime(e),s=this._updateWeight(t);if(s>0)for(var c=this._interpolants,h=this._propertyBindings,l=0,u=c.length;l!==u;++l)c[l].evaluate(o),h[l].accumulate(i,s)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var r=this._weightInterpolant;if(null!==r){var i=r.evaluate(t)[0];e*=i,t>r.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var r=this._timeScaleInterpolant;if(null!==r){var i=r.evaluate(t)[0];e*=i,t>r.parameterPositions[1]&&(this.stopWarping(),0===e?this.pause=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t;if(0===t)return e;var r=this._clip.duration,i=this.loop,n=this._loopCount,a=!1;switch(i){case THREE.LoopOnce:if(n===-1&&(this.loopCount=0,this._setEndings(!0,!0,!1)),e>=r)e=r;else{if(!(e<0))break;e=0}this.clampWhenFinished?this.pause=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1});break;case THREE.LoopPingPong:a=!0;case THREE.LoopRepeat:if(n===-1&&(t>0?(n=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),e>=r||e<0){var o=Math.floor(e/r);e-=r*o,n+=Math.abs(o);var s=this.repetitions-n;if(s<0){this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?r:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});break}if(0===s){var c=t<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}if(i===THREE.LoopPingPong&&1===(1&n))return this.time=e,r-e}return this.time=e,e},_setEndings:function(t,e,r){var i=this._interpolantSettings;r?(i.endingStart=THREE.ZeroSlopeEnding,i.endingEnd=THREE.ZeroSlopeEnding):(t?i.endingStart=this.zeroSlopeAtStart?THREE.ZeroSlopeEnding:THREE.ZeroCurvatureEnding:i.endingStart=THREE.WrapAroundEnding,e?i.endingEnd=this.zeroSlopeAtEnd?THREE.ZeroSlopeEnding:THREE.ZeroCurvatureEnding:i.endingEnd=THREE.WrapAroundEnding)},_scheduleFading:function(t,e,r){var i=this._mixer,n=i.time,a=this._weightInterpolant;null===a&&(a=i._lendControlInterpolant(),this._weightInterpolant=a);var o=a.parameterPositions,s=a.sampleValues;return o[0]=n,s[0]=e,o[1]=n+t,s[1]=r,this}},Object.assign(THREE.AnimationMixer.prototype,{_bindAction:function(t,e){var r=t._localRoot||this._root,i=t._clip.tracks,n=i.length,a=t._propertyBindings,o=t._interpolants,s=r.uuid,c=this._bindingsByRootAndName,h=c[s];void 0===h&&(h={},c[s]=h);for(var l=0;l!==n;++l){var u=i[l],p=u.name,d=h[p];if(void 0!==d)a[l]=d;else{if(d=a[l],void 0!==d){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var E=e&&e._propertyBindings[l].binding.parsedPath;d=new THREE.PropertyMixer(THREE.PropertyBinding.create(r,p,E),u.ValueTypeName,u.getValueSize()),++d.referenceCount,this._addInactiveBinding(d,s,p),a[l]=d}o[l].resultBuffer=d.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,r=t._clip.name,i=this._actionsByClip[r];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,r,e)}for(var n=t._propertyBindings,a=0,o=n.length;a!==o;++a){var s=n[a];0===s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,r=0,i=e.length;r!==i;++r){var n=e[r];0===--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,r){var i=this._actions,n=this._actionsByClip,a=n[e];if(void 0===a)a={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,n[e]=a;else{var o=a.knownActions;t._byClipCacheIndex=o.length,o.push(t)}t._cacheIndex=i.length,i.push(t),a.actionByRoot[r]=t},_removeInactiveAction:function(t){var e=this._actions,r=e[e.length-1],i=t._cacheIndex;r._cacheIndex=i,e[i]=r,e.pop(),t._cacheIndex=null;var n=t._clip.name,a=this._actionsByClip,o=a[n],s=o.knownActions,c=s[s.length-1],h=t._byClipCacheIndex;c._byClipCacheIndex=h,s[h]=c,s.pop(),t._byClipCacheIndex=null;var l=o.actionByRoot,u=(e._localRoot||this._root).uuid;delete l[u],0===s.length&&delete a[n],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,r=0,i=e.length;r!==i;++r){var n=e[r];0===--n.referenceCount&&this._removeInactiveBinding(n)}},_lendAction:function(t){var e=this._actions,r=t._cacheIndex,i=this._nActiveActions++,n=e[i];t._cacheIndex=i,e[i]=t,n._cacheIndex=r,e[r]=n},_takeBackAction:function(t){var e=this._actions,r=t._cacheIndex,i=--this._nActiveActions,n=e[i];t._cacheIndex=i,e[i]=t,n._cacheIndex=r,e[r]=n},_addInactiveBinding:function(t,e,r){var i=this._bindingsByRootAndName,n=i[e],a=this._bindings;void 0===n&&(n={},i[e]=n),n[r]=t,t._cacheIndex=a.length,a.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,r=t.binding,i=r.rootNode.uuid,n=r.path,a=this._bindingsByRootAndName,o=a[i],s=e[e.length-1],c=t._cacheIndex;s._cacheIndex=c,e[c]=s,e.pop(),delete o[n];t:{for(var h in o)break t;delete a[i]}},_lendBinding:function(t){var e=this._bindings,r=t._cacheIndex,i=this._nActiveBindings++,n=e[i];t._cacheIndex=i,e[i]=t,n._cacheIndex=r,e[r]=n},_takeBackBinding:function(t){var e=this._bindings,r=t._cacheIndex,i=--this._nActiveBindings,n=e[i];t._cacheIndex=i,e[i]=t,n._cacheIndex=r,e[r]=n},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,r=t[e];return void 0===r&&(r=new THREE.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),r.__cacheIndex=e,t[e]=r),r},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,r=t.__cacheIndex,i=--this._nActiveControlInterpolants,n=e[i];t.__cacheIndex=i,e[i]=t,n.__cacheIndex=r,e[r]=n},_controlInterpolantsResultBuffer:new Float32Array(1)}),THREE.AnimationObjectGroup=function(t){this.uuid=THREE.Math.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var r=0,i=arguments.length;r!==i;++r)e[arguments[r].uuid]=r;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}},THREE.AnimationObjectGroup.prototype={constructor:THREE.AnimationObjectGroup,add:function(t){for(var e=this._objects,r=e.length,i=this.nCachedObjects_,n=this._indicesByUUID,a=this._paths,o=this._parsedPaths,s=this._bindings,c=s.length,h=0,l=arguments.length;h!==l;++h){var u=arguments[h],p=u.uuid,d=n[p];if(void 0===d){d=r++,n[p]=d,e.push(u);for(var E=0,f=c;E!==f;++E)s[E].push(new THREE.PropertyBinding(u,a[E],o[E]))}else if(d<i){var m=e[d],g=--i,v=e[g];n[v.uuid]=d,e[d]=v,n[p]=g,e[g]=u;for(var E=0,f=c;E!==f;++E){var T=s[E],y=T[g],R=T[d];T[d]=y,void 0===R&&(R=new THREE.PropertyBinding(u,a[E],o[E])),T[g]=R}}else e[d]!==m&&console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")}this.nCachedObjects_=i},remove:function(t){for(var e=this._objects,r=(e.length,this.nCachedObjects_),i=this._indicesByUUID,n=this._bindings,a=n.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o],h=c.uuid,l=i[h];if(void 0!==l&&l>=r){var u=r++,p=e[u];i[p.uuid]=l,e[l]=p,i[h]=u,e[u]=c;for(var d=0,E=a;d!==E;++d){var f=n[d],m=f[u],g=f[l];f[l]=m,f[u]=g}}}this.nCachedObjects_=r},uncache:function(t){for(var e=this._objects,r=e.length,i=this.nCachedObjects_,n=this._indicesByUUID,a=this._bindings,o=a.length,s=0,c=arguments.length;s!==c;++s){var h=arguments[s],l=h.uuid,u=n[l];if(void 0!==u)if(delete n[l],u<i){var p=--i,d=e[p],E=--r,f=e[E];n[d.uuid]=u,e[u]=d,n[f.uuid]=p,e[p]=f,e.pop();for(var m=0,g=o;m!==g;++m){var v=a[m],T=v[p],y=v[E];v[u]=T,v[p]=y,v.pop()}}else{var E=--r,f=e[E];n[f.uuid]=u,e[u]=f,e.pop();for(var m=0,g=o;m!==g;++m){var v=a[m];v[u]=v[E],v.pop()}}}this.nCachedObjects_=i},subscribe_:function(t,e){var r=this._bindingsIndicesByPath,i=r[t],n=this._bindings;if(void 0!==i)return n[i];var a=this._paths,o=this._parsedPaths,s=this._objects,c=s.length,h=this.nCachedObjects_,l=new Array(c);i=n.length,r[t]=i,a.push(t),o.push(e),n.push(l);for(var u=h,p=s.length;u!==p;++u){var d=s[u];l[u]=new THREE.PropertyBinding(d,t,e)}return l},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,r=e[t];if(void 0!==r){var i=this._paths,n=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o],c=t[o];e[c]=r,a[r]=s,a.pop(),n[r]=n[o],n.pop(),i[r]=i[o],i.pop()}}},THREE.AnimationUtils={arraySlice:function(t,e,r){return THREE.AnimationUtils.isTypedArray(t)?new t.constructor(t.subarray(e,r)):t.slice(e,r)},convertArray:function(t,e,r){return!t||!r&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){function e(e,r){return t[e]-t[r]}for(var r=t.length,i=new Array(r),n=0;n!==r;++n)i[n]=n;return i.sort(e),i},sortedArray:function(t,e,r){for(var i=t.length,n=new t.constructor(i),a=0,o=0;o!==i;++a)for(var s=r[a]*e,c=0;c!==e;++c)n[o++]=t[s+c];return n},flattenJSON:function(t,e,r,i){for(var n=1,a=t[0];void 0!==a&&void 0===a[i];)a=t[n++];if(void 0!==a){var o=a[i];if(void 0!==o)if(Array.isArray(o)){do o=a[i],void 0!==o&&(e.push(a.time),r.push.apply(r,o)),a=t[n++];while(void 0!==a)}else if(void 0!==o.toArray){do o=a[i],void 0!==o&&(e.push(a.time),o.toArray(r,r.length)),a=t[n++];while(void 0!==a)}else do o=a[i],void 0!==o&&(e.push(a.time),r.push(o)),a=t[n++];while(void 0!==a)}}},THREE.KeyframeTrack=function(t,e,r,i){if(void 0===t)throw new Error("track name is undefined");if(void 0===e||0===e.length)throw new Error("no keyframes in track named "+t);this.name=t,this.times=THREE.AnimationUtils.convertArray(e,this.TimeBufferType),this.values=THREE.AnimationUtils.convertArray(r,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation),this.validate(),this.optimize()},THREE.KeyframeTrack.prototype={constructor:THREE.KeyframeTrack,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:THREE.InterpolateLinear,InterpolantFactoryMethodDiscrete:function(t){return new THREE.DiscreteInterpolant(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new THREE.LinearInterpolant(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new THREE.CubicInterpolant(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e=void 0;switch(t){case THREE.InterpolateDiscrete:e=this.InterpolantFactoryMethodDiscrete;break;case THREE.InterpolateLinear:e=this.InterpolantFactoryMethodLinear;break;case THREE.InterpolateSmooth:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){var r="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(r);this.setInterpolation(this.DefaultInterpolation)}return void console.warn(r)}this.createInterpolant=e},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return THREE.InterpolateDiscrete;case this.InterpolantFactoryMethodLinear:return THREE.InterpolateLinear;case this.InterpolantFactoryMethodSmooth:return THREE.InterpolateSmooth}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,r=0,i=e.length;r!==i;++r)e[r]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,r=0,i=e.length;r!==i;++r)e[r]*=t;return this},trim:function(t,e){for(var r=this.times,i=r.length,n=0,a=i-1;n!==i&&r[n]<t;)++n;for(;a!==-1&&r[a]>e;)--a;if(++a,0!==n||a!==i){n>=a&&(a=Math.max(a,1),n=a-1);var o=this.getValueSize();this.times=THREE.AnimationUtils.arraySlice(r,n,a),this.values=THREE.AnimationUtils.arraySlice(this.values,n*o,a*o)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!==0&&(console.error("invalid value size in track",this),t=!1);var r=this.times,i=this.values,n=r.length;0===n&&(console.error("track is empty",this),t=!1);for(var a=null,o=0;o!==n;o++){var s=r[o];if("number"==typeof s&&isNaN(s)){console.error("time is not a valid number",this,o,s),t=!1;break}if(null!==a&&a>s){console.error("out of order keys",this,o,s,a),t=!1;break}a=s}if(void 0!==i&&THREE.AnimationUtils.isTypedArray(i))for(var o=0,c=i.length;o!==c;++o){var h=i[o];if(isNaN(h)){console.error("value is not a valid number",this,o,h),t=!1;break}}return t},optimize:function(){for(var t=this.times,e=this.values,r=this.getValueSize(),i=1,n=1,a=t.length-1;n<=a;++n){var o=!1,s=t[n],c=t[n+1];if(s!==c&&(1!==n||s!==s[0]))for(var h=n*r,l=h-r,u=h+r,p=0;p!==r;++p){var d=e[h+p];if(d!==e[l+p]||d!==e[u+p]){o=!0;break}}if(o){if(n!==i){t[i]=t[n];for(var E=n*r,f=i*r,p=0;p!==r;++p)e[f+p]=e[E+p]}++i}}return i!==t.length&&(this.times=THREE.AnimationUtils.arraySlice(t,0,i),this.values=THREE.AnimationUtils.arraySlice(e,0,i*r)),this}},Object.assign(THREE.KeyframeTrack,{parse:function(t){if(void 0===t.type)throw new Error("track type undefined, can not parse");var e=THREE.KeyframeTrack._getTrackTypeForValueTypeName(t.type);if(void 0===t.times){console.warn("legacy JSON format detected, converting");var r=[],i=[];THREE.AnimationUtils.flattenJSON(t.keys,r,i,"value"),t.times=r,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)},toJSON:function(t){var e,r=t.constructor;if(void 0!==r.toJSON)e=r.toJSON(t);else{e={name:t.name,times:THREE.AnimationUtils.convertArray(t.times,Array),values:THREE.AnimationUtils.convertArray(t.values,Array)};var i=t.getInterpolation();i!==t.DefaultInterpolation&&(e.interpolation=i)}return e.type=t.ValueTypeName,e},_getTrackTypeForValueTypeName:function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return THREE.NumberKeyframeTrack;case"vector":case"vector2":case"vector3":case"vector4":return THREE.VectorKeyframeTrack;case"color":return THREE.ColorKeyframeTrack;case"quaternion":return THREE.QuaternionKeyframeTrack;case"bool":case"boolean":return THREE.BooleanKeyframeTrack;case"string":return THREE.StringKeyframeTrack}throw new Error("Unsupported typeName: "+t)}}),THREE.PropertyBinding=function(t,e,r){this.path=e,this.parsedPath=r||THREE.PropertyBinding.parseTrackName(e),this.node=THREE.PropertyBinding.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t},THREE.PropertyBinding.prototype={constructor:THREE.PropertyBinding,getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,r=e.objectName,i=e.propertyName,n=e.propertyIndex;if(t||(t=THREE.PropertyBinding.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error(" trying to update node for track: "+this.path+" but it wasn't found.");if(r){var a=e.objectIndex;switch(r){case"materials":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;break;case"bones":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 o=0;o<t.length;o++)if(t[o].name===a){a=o;break}break;default:if(void 0===t[r])return void console.error(" can not bind to objectName of node, undefined",this);t=t[r]}if(void 0!==a){if(void 0===t[a])return void console.error(" trying to bind to objectIndex of objectName, but is undefined:",this,t);t=t[a]}}var s=t[i];if(!s){var c=e.nodeName;return void console.error(" trying to update property for track: "+c+"."+i+" but it wasn't found.",t)}var h=this.Versioning.None;void 0!==t.needsUpdate?(h=this.Versioning.NeedsUpdate,this.targetObject=t):void 0!==t.matrixWorldNeedsUpdate&&(h=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=t);var l=this.BindingType.Direct;if(void 0!==n){if("morphTargetInfluences"===i){if(!t.geometry)return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry",this);if(!t.geometry.morphTargets)return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets",this);for(var o=0;o<this.node.geometry.morphTargets.length;o++)if(t.geometry.morphTargets[o].name===n){n=o;break}}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=n}else void 0!==s.fromArray&&void 0!==s.toArray?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):void 0!==s.length?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=i;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][h]},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}},Object.assign(THREE.PropertyBinding.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},_getValue_unbound:THREE.PropertyBinding.prototype.getValue,_setValue_unbound:THREE.PropertyBinding.prototype.setValue,BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var r=this.resolvedProperty,i=0,n=r.length;i!==n;++i)t[e++]=r[i]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.node[this.propertyName]=t[e]},function(t,e){this.node[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.node[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var r=this.resolvedProperty,i=0,n=r.length;i!==n;++i)r[i]=t[e++]},function(t,e){for(var r=this.resolvedProperty,i=0,n=r.length;i!==n;++i)r[i]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var r=this.resolvedProperty,i=0,n=r.length;i!==n;++i)r[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]]}),THREE.PropertyBinding.Composite=function(t,e,r){var i=r||THREE.PropertyBinding.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)},THREE.PropertyBinding.Composite.prototype={constructor:THREE.PropertyBinding.Composite,getValue:function(t,e){this.bind();var r=this._targetGroup.nCachedObjects_,i=this._bindings[r];void 0!==i&&i.getValue(t,e)},setValue:function(t,e){for(var r=this._bindings,i=this._targetGroup.nCachedObjects_,n=r.length;i!==n;++i)r[i].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,r=t.length;e!==r;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,r=t.length;e!==r;++e)t[e].unbind()}},THREE.PropertyBinding.create=function(t,e,r){return t instanceof THREE.AnimationObjectGroup?new THREE.PropertyBinding.Composite(t,e,r):new THREE.PropertyBinding(t,e,r)},THREE.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 i={nodeName:r[3],objectName:r[5],objectIndex:r[7],propertyName:r[9],propertyIndex:r[11]};if(null===i.propertyName||0===i.propertyName.length)throw new Error("can not parse propertyName from trackName: "+t);return i},THREE.PropertyBinding.findNode=function(t,e){if(!e||""===e||"root"===e||"."===e||e===-1||e===t.name||e===t.uuid)return t;if(t.skeleton){var r=function(t){for(var r=0;r<t.bones.length;r++){var i=t.bones[r];if(i.name===e)return i}return null},i=r(t.skeleton);if(i)return i}if(t.children){var n=function(t){for(var r=0;r<t.length;r++){var i=t[r];if(i.name===e||i.uuid===e)return i;var a=n(i.children);if(a)return a}return null},a=n(t.children);if(a)return a}return null},THREE.PropertyMixer=function(t,e,r){this.binding=t,this.valueSize=r;var i,n=Float64Array;switch(e){case"quaternion":i=this._slerp;break;case"string":case"bool":n=Array,i=this._select;break;default:i=this._lerp}this.buffer=new n(4*r),this._mixBufferRegion=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0},THREE.PropertyMixer.prototype={constructor:THREE.PropertyMixer,accumulate:function(t,e){var r=this.buffer,i=this.valueSize,n=t*i+i,a=this.cumulativeWeight;if(0===a){for(var o=0;o!==i;++o)r[n+o]=r[o];a=e}else{a+=e;var s=e/a;this._mixBufferRegion(r,n,0,s,i)}this.cumulativeWeight=a},apply:function(t){var e=this.valueSize,r=this.buffer,i=t*e+e,n=this.cumulativeWeight,a=this.binding;if(this.cumulativeWeight=0,n<1){var o=3*e;this._mixBufferRegion(r,i,o,1-n,e)}for(var s=e,c=e+e;s!==c;++s)if(r[s]!==r[s+e]){a.setValue(r,i);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,r=this.valueSize,i=3*r;t.getValue(e,i);for(var n=r,a=i;n!==a;++n)e[n]=e[i+n%r];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_select:function(t,e,r,i,n){if(i>=.5)for(var a=0;a!==n;++a)t[e+a]=t[r+a]},_slerp:function(t,e,r,i,n){THREE.Quaternion.slerpFlat(t,e,t,e,t,r,i)},_lerp:function(t,e,r,i,n){for(var a=1-i,o=0;o!==n;++o){var s=e+o;t[s]=t[s]*a+t[r+o]*i}}},THREE.BooleanKeyframeTrack=function(t,e,r){THREE.KeyframeTrack.call(this,t,e,r)},THREE.BooleanKeyframeTrack.prototype=Object.assign(Object.create(THREE.KeyframeTrack.prototype),{constructor:THREE.BooleanKeyframeTrack,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:THREE.InterpolateDiscrete,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),THREE.ColorKeyframeTrack=function(t,e,r,i){THREE.KeyframeTrack.call(this,t,e,r,i)},THREE.ColorKeyframeTrack.prototype=Object.assign(Object.create(THREE.KeyframeTrack.prototype),{constructor:THREE.ColorKeyframeTrack,ValueTypeName:"color"}),THREE.NumberKeyframeTrack=function(t,e,r,i){THREE.KeyframeTrack.call(this,t,e,r,i)},THREE.NumberKeyframeTrack.prototype=Object.assign(Object.create(THREE.KeyframeTrack.prototype),{constructor:THREE.NumberKeyframeTrack,ValueTypeName:"number"}),THREE.QuaternionKeyframeTrack=function(t,e,r,i){THREE.KeyframeTrack.call(this,t,e,r,i)},THREE.QuaternionKeyframeTrack.prototype=Object.assign(Object.create(THREE.KeyframeTrack.prototype),{constructor:THREE.QuaternionKeyframeTrack,ValueTypeName:"quaternion",DefaultInterpolation:THREE.InterpolateLinear,InterpolantFactoryMethodLinear:function(t){return new THREE.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),THREE.StringKeyframeTrack=function(t,e,r,i){THREE.KeyframeTrack.call(this,t,e,r,i)},THREE.StringKeyframeTrack.prototype=Object.assign(Object.create(THREE.KeyframeTrack.prototype),{constructor:THREE.StringKeyframeTrack,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:THREE.InterpolateDiscrete,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),THREE.VectorKeyframeTrack=function(t,e,r,i){THREE.KeyframeTrack.call(this,t,e,r,i)},THREE.VectorKeyframeTrack.prototype=Object.assign(Object.create(THREE.KeyframeTrack.prototype),{constructor:THREE.VectorKeyframeTrack,ValueTypeName:"vector"}),THREE.Audio=function(t){THREE.Object3D.call(this),this.type="Audio",this.context=t.context,this.source=this.context.createBufferSource(),this.source.onended=this.onEnded.bind(this),this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.startTime=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filter=null},THREE.Audio.prototype=Object.create(THREE.Object3D.prototype),THREE.Audio.prototype.constructor=THREE.Audio,THREE.Audio.prototype.getOutput=function(){return this.gain},THREE.Audio.prototype.setNodeSource=function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},THREE.Audio.prototype.setBuffer=function(t){var e=this;return e.source.buffer=t,e.sourceType="buffer",e.autoplay&&e.play(),this},THREE.Audio.prototype.play=function(){if(this.isPlaying===!0)return void console.warn("THREE.Audio: Audio is already playing.");if(this.hasPlaybackControl===!1)return void console.warn("THREE.Audio: this Audio has no playback control.");var t=this.context.createBufferSource();t.buffer=this.source.buffer,t.loop=this.source.loop,t.onended=this.source.onended,t.start(0,this.startTime),t.playbackRate.value=this.playbackRate,this.isPlaying=!0,this.source=t,this.connect()},THREE.Audio.prototype.pause=function(){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),void(this.startTime=this.context.currentTime))},THREE.Audio.prototype.stop=function(){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),void(this.startTime=0))},THREE.Audio.prototype.connect=function(){null!==this.filter?(this.source.connect(this.filter),this.filter.connect(this.getOutput())):this.source.connect(this.getOutput())},THREE.Audio.prototype.disconnect=function(){null!==this.filter?(this.source.disconnect(this.filter),this.filter.disconnect(this.getOutput())):this.source.disconnect(this.getOutput())},THREE.Audio.prototype.getFilter=function(){return this.filter},THREE.Audio.prototype.setFilter=function(t){void 0===t&&(t=null),this.isPlaying===!0?(this.disconnect(),this.filter=t,this.connect()):this.filter=t},THREE.Audio.prototype.setPlaybackRate=function(t){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):(this.playbackRate=t,void(this.isPlaying===!0&&(this.source.playbackRate.value=this.playbackRate)))},THREE.Audio.prototype.getPlaybackRate=function(){return this.playbackRate},THREE.Audio.prototype.onEnded=function(){this.isPlaying=!1},THREE.Audio.prototype.setLoop=function(t){return this.hasPlaybackControl===!1?void console.warn("THREE.Audio: this Audio has no playback control."):void(this.source.loop=t)},THREE.Audio.prototype.getLoop=function(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.source.loop},THREE.Audio.prototype.setVolume=function(t){this.gain.gain.value=t},THREE.Audio.prototype.getVolume=function(){return this.gain.gain.value},THREE.AudioAnalyser=function(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)},THREE.AudioAnalyser.prototype={constructor:THREE.AudioAnalyser,getData:function(){return this.analyser.getByteFrequencyData(this.data),this.data}},Object.defineProperty(THREE,"AudioContext",{get:function(){var t;
return function(){return void 0===t&&(t=new(window.AudioContext||window.webkitAudioContext)),t}}()}),THREE.PositionalAudio=function(t){THREE.Audio.call(this,t),this.panner=this.context.createPanner(),this.panner.connect(this.gain)},THREE.PositionalAudio.prototype=Object.create(THREE.Audio.prototype),THREE.PositionalAudio.prototype.constructor=THREE.PositionalAudio,THREE.PositionalAudio.prototype.getOutput=function(){return this.panner},THREE.PositionalAudio.prototype.setRefDistance=function(t){this.panner.refDistance=t},THREE.PositionalAudio.prototype.getRefDistance=function(){return this.panner.refDistance},THREE.PositionalAudio.prototype.setRolloffFactor=function(t){this.panner.rolloffFactor=t},THREE.PositionalAudio.prototype.getRolloffFactor=function(){return this.panner.rolloffFactor},THREE.PositionalAudio.prototype.setDistanceModel=function(t){this.panner.distanceModel=t},THREE.PositionalAudio.prototype.getDistanceModel=function(){return this.panner.distanceModel},THREE.PositionalAudio.prototype.setMaxDistance=function(t){this.panner.maxDistance=t},THREE.PositionalAudio.prototype.getMaxDistance=function(){return this.panner.maxDistance},THREE.PositionalAudio.prototype.updateMatrixWorld=function(){var t=new THREE.Vector3;return function(e){THREE.Object3D.prototype.updateMatrixWorld.call(this,e),t.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(t.x,t.y,t.z)}}(),THREE.AudioListener=function(){THREE.Object3D.call(this),this.type="AudioListener",this.context=THREE.AudioContext,this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null},THREE.AudioListener.prototype=Object.create(THREE.Object3D.prototype),THREE.AudioListener.prototype.constructor=THREE.AudioListener,THREE.AudioListener.prototype.getInput=function(){return this.gain},THREE.AudioListener.prototype.removeFilter=function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},THREE.AudioListener.prototype.setFilter=function(t){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination)},THREE.AudioListener.prototype.getFilter=function(){return this.filter},THREE.AudioListener.prototype.setMasterVolume=function(t){this.gain.gain.value=t},THREE.AudioListener.prototype.getMasterVolume=function(){return this.gain.gain.value},THREE.AudioListener.prototype.updateMatrixWorld=function(){var t=new THREE.Vector3,e=new THREE.Quaternion,r=new THREE.Vector3,i=new THREE.Vector3;return function(n){THREE.Object3D.prototype.updateMatrixWorld.call(this,n);var a=this.context.listener,o=this.up;this.matrixWorld.decompose(t,e,r),i.set(0,0,-1).applyQuaternion(e),a.setPosition(t.x,t.y,t.z),a.setOrientation(i.x,i.y,i.z,o.x,o.y,o.z)}}(),THREE.Camera=function(){THREE.Object3D.call(this),this.type="Camera",this.matrixWorldInverse=new THREE.Matrix4,this.projectionMatrix=new THREE.Matrix4},THREE.Camera.prototype=Object.create(THREE.Object3D.prototype),THREE.Camera.prototype.constructor=THREE.Camera,THREE.Camera.prototype.getWorldDirection=function(){var t=new THREE.Quaternion;return function(e){var r=e||new THREE.Vector3;return this.getWorldQuaternion(t),r.set(0,0,-1).applyQuaternion(t)}}(),THREE.Camera.prototype.lookAt=function(){var t=new THREE.Matrix4;return function(e){t.lookAt(this.position,e,this.up),this.quaternion.setFromRotationMatrix(t)}}(),THREE.Camera.prototype.clone=function(){return(new this.constructor).copy(this)},THREE.Camera.prototype.copy=function(t){return THREE.Object3D.prototype.copy.call(this,t),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this},THREE.CubeCamera=function(t,e,r){THREE.Object3D.call(this),this.type="CubeCamera";var i=90,n=1,a=new THREE.PerspectiveCamera(i,n,t,e);a.up.set(0,-1,0),a.lookAt(new THREE.Vector3(1,0,0)),this.add(a);var o=new THREE.PerspectiveCamera(i,n,t,e);o.up.set(0,-1,0),o.lookAt(new THREE.Vector3((-1),0,0)),this.add(o);var s=new THREE.PerspectiveCamera(i,n,t,e);s.up.set(0,0,1),s.lookAt(new THREE.Vector3(0,1,0)),this.add(s);var c=new THREE.PerspectiveCamera(i,n,t,e);c.up.set(0,0,-1),c.lookAt(new THREE.Vector3(0,(-1),0)),this.add(c);var h=new THREE.PerspectiveCamera(i,n,t,e);h.up.set(0,-1,0),h.lookAt(new THREE.Vector3(0,0,1)),this.add(h);var l=new THREE.PerspectiveCamera(i,n,t,e);l.up.set(0,-1,0),l.lookAt(new THREE.Vector3(0,0,(-1))),this.add(l);var u={format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter};this.renderTarget=new THREE.WebGLRenderTargetCube(r,r,u),this.updateCubeMap=function(t,e){null===this.parent&&this.updateMatrixWorld();var r=this.renderTarget,i=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,r.activeCubeFace=0,t.render(e,a,r),r.activeCubeFace=1,t.render(e,o,r),r.activeCubeFace=2,t.render(e,s,r),r.activeCubeFace=3,t.render(e,c,r),r.activeCubeFace=4,t.render(e,h,r),r.texture.generateMipmaps=i,r.activeCubeFace=5,t.render(e,l,r),t.setRenderTarget(null)}},THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype),THREE.CubeCamera.prototype.constructor=THREE.CubeCamera,THREE.OrthographicCamera=function(t,e,r,i,n,a){THREE.Camera.call(this),this.type="OrthographicCamera",this.zoom=1,this.left=t,this.right=e,this.top=r,this.bottom=i,this.near=void 0!==n?n:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()},THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype),THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera,THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,i=(this.top+this.bottom)/2;this.projectionMatrix.makeOrthographic(r-t,r+t,i+e,i-e,this.near,this.far)},THREE.OrthographicCamera.prototype.copy=function(t){return THREE.Camera.prototype.copy.call(this,t),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this},THREE.OrthographicCamera.prototype.toJSON=function(t){var e=THREE.Object3D.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,e},THREE.PerspectiveCamera=function(t,e,r,i){THREE.Camera.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==r?r:.1,this.far=void 0!==i?i:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype),THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera,THREE.PerspectiveCamera.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},THREE.PerspectiveCamera.prototype.setFocalLength=function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*THREE.Math.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype.getFocalLength=function(){var t=Math.tan(.5*THREE.Math.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},THREE.PerspectiveCamera.prototype.getEffectiveFOV=function(){return 2*THREE.Math.RAD2DEG*Math.atan(Math.tan(.5*THREE.Math.DEG2RAD*this.fov)/this.zoom)},THREE.PerspectiveCamera.prototype.getFilmWidth=function(){return this.filmGauge*Math.min(this.aspect,1)},THREE.PerspectiveCamera.prototype.getFilmHeight=function(){return this.filmGauge/Math.max(this.aspect,1)},THREE.PerspectiveCamera.prototype.setViewOffset=function(t,e,r,i,n,a){this.aspect=t/e,this.view={fullWidth:t,fullHeight:e,offsetX:r,offsetY:i,width:n,height:a},this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){var t=this.near,e=t*Math.tan(.5*THREE.Math.DEG2RAD*this.fov)/this.zoom,r=2*e,i=this.aspect*r,n=-.5*i,a=this.view;if(null!==a){var o=a.fullWidth,s=a.fullHeight;n+=a.offsetX*i/o,e-=a.offsetY*r/s,i*=a.width/o,r*=a.height/s}var c=this.filmOffset;0!==c&&(n+=t*c/this.getFilmWidth()),this.projectionMatrix.makeFrustum(n,n+i,e-r,e,t,this.far)},THREE.PerspectiveCamera.prototype.copy=function(t){return THREE.Camera.prototype.copy.call(this,t),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},THREE.PerspectiveCamera.prototype.toJSON=function(t){var e=THREE.Object3D.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e},THREE.StereoCamera=function(){this.type="StereoCamera",this.aspect=1,this.cameraL=new THREE.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new THREE.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1},THREE.StereoCamera.prototype={constructor:THREE.StereoCamera,update:function(){var t,e,r,i,n,a=new THREE.Matrix4,o=new THREE.Matrix4;return function(s){var c=t!==s.focus||e!==s.fov||r!==s.aspect*this.aspect||i!==s.near||n!==s.far;if(c){t=s.focus,e=s.fov,r=s.aspect*this.aspect,i=s.near,n=s.far;var h,l,u=s.projectionMatrix.clone(),p=.032,d=p*i/t,E=i*Math.tan(THREE.Math.DEG2RAD*e*.5);o.elements[12]=-p,a.elements[12]=p,h=-E*r+d,l=E*r+d,u.elements[0]=2*i/(l-h),u.elements[8]=(l+h)/(l-h),this.cameraL.projectionMatrix.copy(u),h=-E*r-d,l=E*r-d,u.elements[0]=2*i/(l-h),u.elements[8]=(l+h)/(l-h),this.cameraR.projectionMatrix.copy(u)}this.cameraL.matrixWorld.copy(s.matrixWorld).multiply(o),this.cameraR.matrixWorld.copy(s.matrixWorld).multiply(a)}}()},THREE.Light=function(t,e){THREE.Object3D.call(this),this.type="Light",this.color=new THREE.Color(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0},THREE.Light.prototype=Object.create(THREE.Object3D.prototype),THREE.Light.prototype.constructor=THREE.Light,THREE.Light.prototype.copy=function(t){return THREE.Object3D.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},THREE.Light.prototype.toJSON=function(t){var e=THREE.Object3D.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),e},THREE.LightShadow=function(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new THREE.Vector2(512,512),this.map=null,this.matrix=new THREE.Matrix4},THREE.LightShadow.prototype={constructor:THREE.LightShadow,copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)}},THREE.AmbientLight=function(t,e){THREE.Light.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0},THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype),THREE.AmbientLight.prototype.constructor=THREE.AmbientLight,THREE.DirectionalLight=function(t,e){THREE.Light.call(this,t,e),this.type="DirectionalLight",this.position.set(0,1,0),this.updateMatrix(),this.target=new THREE.Object3D,this.shadow=new THREE.DirectionalLightShadow},THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype),THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight,THREE.DirectionalLight.prototype.copy=function(t){return THREE.Light.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this},THREE.DirectionalLightShadow=function(t){THREE.LightShadow.call(this,new THREE.OrthographicCamera((-5),5,5,(-5),.5,500))},THREE.DirectionalLightShadow.prototype=Object.create(THREE.LightShadow.prototype),THREE.DirectionalLightShadow.prototype.constructor=THREE.DirectionalLightShadow,THREE.HemisphereLight=function(t,e,r){THREE.Light.call(this,t,r),this.type="HemisphereLight",this.castShadow=void 0,this.position.set(0,1,0),this.updateMatrix(),this.groundColor=new THREE.Color(e)},THREE.HemisphereLight.prototype=Object.create(THREE.Light.prototype),THREE.HemisphereLight.prototype.constructor=THREE.HemisphereLight,THREE.HemisphereLight.prototype.copy=function(t){return THREE.Light.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this},THREE.PointLight=function(t,e,r,i){THREE.Light.call(this,t,e),this.type="PointLight",this.distance=void 0!==r?r:0,this.decay=void 0!==i?i:1,this.shadow=new THREE.LightShadow(new THREE.PerspectiveCamera(90,1,.5,500))},THREE.PointLight.prototype=Object.create(THREE.Light.prototype),THREE.PointLight.prototype.constructor=THREE.PointLight,Object.defineProperty(THREE.PointLight.prototype,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),THREE.PointLight.prototype.copy=function(t){return THREE.Light.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this},THREE.SpotLight=function(t,e,r,i,n,a){THREE.Light.call(this,t,e),this.type="SpotLight",this.position.set(0,1,0),this.updateMatrix(),this.target=new THREE.Object3D,this.distance=void 0!==r?r:0,this.angle=void 0!==i?i:Math.PI/3,this.penumbra=void 0!==n?n:0,this.decay=void 0!==a?a:1,this.shadow=new THREE.SpotLightShadow},THREE.SpotLight.prototype=Object.create(THREE.Light.prototype),THREE.SpotLight.prototype.constructor=THREE.SpotLight,Object.defineProperty(THREE.SpotLight.prototype,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),THREE.SpotLight.prototype.copy=function(t){return THREE.Light.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this},THREE.SpotLightShadow=function(){THREE.LightShadow.call(this,new THREE.PerspectiveCamera(50,1,.5,500))},THREE.SpotLightShadow.prototype=Object.create(THREE.LightShadow.prototype),THREE.SpotLightShadow.prototype.constructor=THREE.SpotLightShadow,THREE.SpotLightShadow.prototype.update=function(t){var e=2*THREE.Math.RAD2DEG*t.angle,r=this.mapSize.width/this.mapSize.height,i=t.distance||500,n=this.camera;e===n.fov&&r===n.aspect&&i===n.far||(n.fov=e,n.aspect=r,n.far=i,n.updateProjectionMatrix())},THREE.AudioLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.AudioLoader.prototype={constructor:THREE.AudioLoader,load:function(t,e,r,i){var n=new THREE.XHRLoader(this.manager);n.setResponseType("arraybuffer"),n.load(t,function(t){var r=THREE.AudioContext;r.decodeAudioData(t,function(t){e(t)})},r,i)}},THREE.Cache={enabled:!1,files:{},add:function(t,e){this.enabled!==!1&&(this.files[t]=e)},get:function(t){if(this.enabled!==!1)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}},THREE.Loader=function(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}},THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:void 0,extractUrlBase:function(t){var e=t.split("/");return 1===e.length?"./":(e.pop(),e.join("/")+"/")},initMaterials:function(t,e,r){for(var i=[],n=0;n<t.length;++n)i[n]=this.createMaterial(t[n],e,r);return i},createMaterial:function(){var t,e,r;return function(i,n,a){function o(t,r,i,o,c){var h,l=n+t,u=THREE.Loader.Handlers.get(l);null!==u?h=u.load(l):(e.setCrossOrigin(a),h=e.load(l)),void 0!==r&&(h.repeat.fromArray(r),1!==r[0]&&(h.wrapS=THREE.RepeatWrapping),1!==r[1]&&(h.wrapT=THREE.RepeatWrapping)),void 0!==i&&h.offset.fromArray(i),void 0!==o&&("repeat"===o[0]&&(h.wrapS=THREE.RepeatWrapping),"mirror"===o[0]&&(h.wrapS=THREE.MirroredRepeatWrapping),"repeat"===o[1]&&(h.wrapT=THREE.RepeatWrapping),"mirror"===o[1]&&(h.wrapT=THREE.MirroredRepeatWrapping)),void 0!==c&&(h.anisotropy=c);var p=THREE.Math.generateUUID();return s[p]=h,p}void 0===t&&(t=new THREE.Color),void 0===e&&(e=new THREE.TextureLoader),void 0===r&&(r=new THREE.MaterialLoader);var s={},c={uuid:THREE.Math.generateUUID(),type:"MeshLambertMaterial"};for(var h in i){var l=i[h];switch(h){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":c.name=l;break;case"blending":c.blending=THREE[l];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",h,"is no longer supported.");break;case"colorDiffuse":c.color=t.fromArray(l).getHex();break;case"colorSpecular":c.specular=t.fromArray(l).getHex();break;case"colorEmissive":c.emissive=t.fromArray(l).getHex();break;case"specularCoef":c.shininess=l;break;case"shading":"basic"===l.toLowerCase()&&(c.type="MeshBasicMaterial"),"phong"===l.toLowerCase()&&(c.type="MeshPhongMaterial");break;case"mapDiffuse":c.map=o(l,i.mapDiffuseRepeat,i.mapDiffuseOffset,i.mapDiffuseWrap,i.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapLight":c.lightMap=o(l,i.mapLightRepeat,i.mapLightOffset,i.mapLightWrap,i.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":c.aoMap=o(l,i.mapAORepeat,i.mapAOOffset,i.mapAOWrap,i.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":c.bumpMap=o(l,i.mapBumpRepeat,i.mapBumpOffset,i.mapBumpWrap,i.mapBumpAnisotropy);break;case"mapBumpScale":c.bumpScale=l;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":c.normalMap=o(l,i.mapNormalRepeat,i.mapNormalOffset,i.mapNormalWrap,i.mapNormalAnisotropy);break;case"mapNormalFactor":c.normalScale=[l,l];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":c.specularMap=o(l,i.mapSpecularRepeat,i.mapSpecularOffset,i.mapSpecularWrap,i.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapAlpha":c.alphaMap=o(l,i.mapAlphaRepeat,i.mapAlphaOffset,i.mapAlphaWrap,i.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":c.side=THREE.BackSide;break;case"doubleSided":c.side=THREE.DoubleSide;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),c.opacity=l;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":c[h]=l;break;case"vertexColors":l===!0&&(c.vertexColors=THREE.VertexColors),"face"===l&&(c.vertexColors=THREE.FaceColors);break;default:console.error("THREE.Loader.createMaterial: Unsupported",h,l)}}return"MeshBasicMaterial"===c.type&&delete c.emissive,"MeshPhongMaterial"!==c.type&&delete c.specular,c.opacity<1&&(c.transparent=!0),r.setTextures(s),r.parse(c)}}()},THREE.Loader.Handlers={handlers:[],add:function(t,e){this.handlers.push(t,e)},get:function(t){for(var e=this.handlers,r=0,i=e.length;r<i;r+=2){var n=e[r],a=e[r+1];if(n.test(t))return a}return null}},THREE.XHRLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.XHRLoader.prototype={constructor:THREE.XHRLoader,load:function(t,e,r,i){void 0!==this.path&&(t=this.path+t);var n=this,a=THREE.Cache.get(t);if(void 0!==a)return e&&setTimeout(function(){e(a)},0),a;var o=new XMLHttpRequest;return o.overrideMimeType("text/plain"),o.open("GET",t,!0),o.addEventListener("load",function(r){var a=r.target.response;THREE.Cache.add(t,a),200===this.status?(e&&e(a),n.manager.itemEnd(t)):0===this.status?(console.warn("THREE.XHRLoader: HTTP Status 0 received."),e&&e(a),n.manager.itemEnd(t)):(i&&i(r),n.manager.itemError(t))},!1),void 0!==r&&o.addEventListener("progress",function(t){r(t)},!1),o.addEventListener("error",function(e){i&&i(e),n.manager.itemError(t)},!1),void 0!==this.responseType&&(o.responseType=this.responseType),void 0!==this.withCredentials&&(o.withCredentials=this.withCredentials),o.send(null),n.manager.itemStart(t),o},setPath:function(t){this.path=t},setResponseType:function(t){this.responseType=t},setWithCredentials:function(t){this.withCredentials=t}},THREE.FontLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.FontLoader.prototype={constructor:THREE.FontLoader,load:function(t,e,r,i){var n=new THREE.XHRLoader(this.manager);n.load(t,function(t){e(new THREE.Font(JSON.parse(t.substring(65,t.length-2))))},r,i)}},THREE.ImageLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(t,e,r,i){void 0!==this.path&&(t=this.path+t);var n=this,a=THREE.Cache.get(t);if(void 0!==a)return n.manager.itemStart(t),e?setTimeout(function(){e(a),n.manager.itemEnd(t)},0):n.manager.itemEnd(t),a;var o=document.createElement("img");return o.addEventListener("load",function(r){THREE.Cache.add(t,this),e&&e(this),n.manager.itemEnd(t)},!1),void 0!==r&&o.addEventListener("progress",function(t){r(t)},!1),o.addEventListener("error",function(e){i&&i(e),n.manager.itemError(t)},!1),void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),n.manager.itemStart(t),o.src=t,o},setCrossOrigin:function(t){this.crossOrigin=t},setPath:function(t){this.path=t}},THREE.JSONLoader=function(t){"boolean"==typeof t&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),t=void 0),this.manager=void 0!==t?t:THREE.DefaultLoadingManager,this.withCredentials=!1};THREE.JSONLoader.prototype={constructor:THREE.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(t,e,r,i){var n=this,a=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:THREE.Loader.prototype.extractUrlBase(t),o=new THREE.XHRLoader(this.manager);o.setWithCredentials(this.withCredentials),o.load(t,function(r){var i=JSON.parse(r),o=i.metadata;if(void 0!==o){var s=o.type;if(void 0!==s){if("object"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+t+" should be loaded with THREE.ObjectLoader instead.");if("scene"===s.toLowerCase())return void console.error("THREE.JSONLoader: "+t+" should be loaded with THREE.SceneLoader instead.")}}var c=n.parse(i,a);e(c.geometry,c.materials)},r,i)},setTexturePath:function(t){this.texturePath=t},parse:function(t,e){function r(e){function r(t,e){return t&1<<e}var i,n,a,s,c,h,l,u,p,d,E,f,m,g,v,T,y,R,H,x,b,_,M,w,S,L,A,C=t.faces,P=t.vertices,B=t.normals,D=t.colors,I=0;if(void 0!==t.uvs){for(i=0;i<t.uvs.length;i++)t.uvs[i].length&&I++;for(i=0;i<I;i++)o.faceVertexUvs[i]=[]}for(s=0,c=P.length;s<c;)R=new THREE.Vector3,R.x=P[s++]*e,R.y=P[s++]*e,R.z=P[s++]*e,o.vertices.push(R);for(s=0,c=C.length;s<c;)if(d=C[s++],E=r(d,0),f=r(d,1),m=r(d,3),g=r(d,4),v=r(d,5),T=r(d,6),y=r(d,7),E){if(x=new THREE.Face3,x.a=C[s],x.b=C[s+1],x.c=C[s+3],b=new THREE.Face3,b.a=C[s+1],b.b=C[s+2],b.c=C[s+3],s+=4,f&&(p=C[s++],x.materialIndex=p,b.materialIndex=p),a=o.faces.length,m)for(i=0;i<I;i++)for(w=t.uvs[i],o.faceVertexUvs[i][a]=[],o.faceVertexUvs[i][a+1]=[],n=0;n<4;n++)u=C[s++],L=w[2*u],A=w[2*u+1],S=new THREE.Vector2(L,A),2!==n&&o.faceVertexUvs[i][a].push(S),0!==n&&o.faceVertexUvs[i][a+1].push(S);if(g&&(l=3*C[s++],x.normal.set(B[l++],B[l++],B[l]),b.normal.copy(x.normal)),v)for(i=0;i<4;i++)l=3*C[s++],M=new THREE.Vector3(B[l++],B[l++],B[l]),2!==i&&x.vertexNormals.push(M),0!==i&&b.vertexNormals.push(M);if(T&&(h=C[s++],_=D[h],x.color.setHex(_),b.color.setHex(_)),y)for(i=0;i<4;i++)h=C[s++],_=D[h],2!==i&&x.vertexColors.push(new THREE.Color(_)),0!==i&&b.vertexColors.push(new THREE.Color(_));o.faces.push(x),o.faces.push(b)}else{if(H=new THREE.Face3,H.a=C[s++],H.b=C[s++],H.c=C[s++],f&&(p=C[s++],H.materialIndex=p),a=o.faces.length,m)for(i=0;i<I;i++)for(w=t.uvs[i],o.faceVertexUvs[i][a]=[],n=0;n<3;n++)u=C[s++],L=w[2*u],A=w[2*u+1],S=new THREE.Vector2(L,A),o.faceVertexUvs[i][a].push(S);if(g&&(l=3*C[s++],H.normal.set(B[l++],B[l++],B[l])),v)for(i=0;i<3;i++)l=3*C[s++],M=new THREE.Vector3(B[l++],B[l++],B[l]),H.vertexNormals.push(M);if(T&&(h=C[s++],H.color.setHex(D[h])),y)for(i=0;i<3;i++)h=C[s++],H.vertexColors.push(new THREE.Color(D[h]));o.faces.push(H)}}function i(){var e=void 0!==t.influencesPerVertex?t.influencesPerVertex:2;if(t.skinWeights)for(var r=0,i=t.skinWeights.length;r<i;r+=e){var n=t.skinWeights[r],a=e>1?t.skinWeights[r+1]:0,s=e>2?t.skinWeights[r+2]:0,c=e>3?t.skinWeights[r+3]:0;o.skinWeights.push(new THREE.Vector4(n,a,s,c))}if(t.skinIndices)for(var r=0,i=t.skinIndices.length;r<i;r+=e){var h=t.skinIndices[r],l=e>1?t.skinIndices[r+1]:0,u=e>2?t.skinIndices[r+2]:0,p=e>3?t.skinIndices[r+3]:0;o.skinIndices.push(new THREE.Vector4(h,l,u,p))}o.bones=t.bones,o.bones&&o.bones.length>0&&(o.skinWeights.length!==o.skinIndices.length||o.skinIndices.length!==o.vertices.length)&&console.warn("When skinning, number of vertices ("+o.vertices.length+"), skinIndices ("+o.skinIndices.length+"), and skinWeights ("+o.skinWeights.length+") should match.")}function n(e){if(void 0!==t.morphTargets)for(var r=0,i=t.morphTargets.length;r<i;r++){o.morphTargets[r]={},o.morphTargets[r].name=t.morphTargets[r].name,o.morphTargets[r].vertices=[];for(var n=o.morphTargets[r].vertices,a=t.morphTargets[r].vertices,s=0,c=a.length;s<c;s+=3){var h=new THREE.Vector3;h.x=a[s]*e,h.y=a[s+1]*e,h.z=a[s+2]*e,n.push(h)}}if(void 0!==t.morphColors&&t.morphColors.length>0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');for(var l=o.faces,u=t.morphColors[0].colors,r=0,i=l.length;r<i;r++)l[r].color.fromArray(u,3*r)}}function a(){var e=[],r=[];void 0!==t.animation&&r.push(t.animation),void 0!==t.animations&&(t.animations.length?r=r.concat(t.animations):r.push(t.animations));for(var i=0;i<r.length;i++){var n=THREE.AnimationClip.parseAnimation(r[i],o.bones);n&&e.push(n)}if(o.morphTargets){var a=THREE.AnimationClip.CreateClipsFromMorphTargetSequences(o.morphTargets,10);e=e.concat(a)}e.length>0&&(o.animations=e)}var o=new THREE.Geometry,s=void 0!==t.scale?1/t.scale:1;if(r(s),i(),n(s),a(),o.computeFaceNormals(),o.computeBoundingSphere(),void 0===t.materials||0===t.materials.length)return{geometry:o};var c=THREE.Loader.prototype.initMaterials(t.materials,e,this.crossOrigin);return{geometry:o,materials:c}}};THREE.LoadingManager=function(t,e,r){var i=this,n=!1,a=0,o=0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=r,this.itemStart=function(t){o++,n===!1&&void 0!==i.onStart&&i.onStart(t,a,o),n=!0},this.itemEnd=function(t){a++,void 0!==i.onProgress&&i.onProgress(t,a,o),a===o&&(n=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(t){void 0!==i.onError&&i.onError(t)}},THREE.DefaultLoadingManager=new THREE.LoadingManager,THREE.BufferGeometryLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.BufferGeometryLoader.prototype={constructor:THREE.BufferGeometryLoader,load:function(t,e,r,i){var n=this,a=new THREE.XHRLoader(n.manager);a.load(t,function(t){e(n.parse(JSON.parse(t)))},r,i)},parse:function(t){var e=new THREE.BufferGeometry,r=t.data.index,i={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};if(void 0!==r){var n=new i[r.type](r.array);e.setIndex(new THREE.BufferAttribute(n,1))}var a=t.data.attributes;for(var o in a){var s=a[o],n=new i[s.type](s.array);e.addAttribute(o,new THREE.BufferAttribute(n,s.itemSize,s.normalized))}var c=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==c)for(var h=0,l=c.length;h!==l;++h){var u=c[h];e.addGroup(u.start,u.count,u.materialIndex)}var p=t.data.boundingSphere;if(void 0!==p){var d=new THREE.Vector3;void 0!==p.center&&d.fromArray(p.center),e.boundingSphere=new THREE.Sphere(d,p.radius)}return e}},THREE.MaterialLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager,this.textures={}},THREE.MaterialLoader.prototype={constructor:THREE.MaterialLoader,load:function(t,e,r,i){var n=this,a=new THREE.XHRLoader(n.manager);a.load(t,function(t){e(n.parse(JSON.parse(t)))},r,i)},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 THREE[t.type];if(void 0!==t.uuid&&(e.uuid=t.uuid),void 0!==t.name&&(e.name=t.name),void 0!==t.color&&e.color.setHex(t.color),void 0!==t.roughness&&(e.roughness=t.roughness),void 0!==t.metalness&&(e.metalness=t.metalness),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.colorWrite&&(e.colorWrite=t.colorWrite),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)),void 0!==t.normalScale){var r=t.normalScale;Array.isArray(r)===!1&&(r=[r,r]),e.normalScale=(new THREE.Vector2).fromArray(r)}if(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.roughnessMap&&(e.roughnessMap=this.getTexture(t.roughnessMap)),void 0!==t.metalnessMap&&(e.metalnessMap=this.getTexture(t.metalnessMap)),void 0!==t.emissiveMap&&(e.emissiveMap=this.getTexture(t.emissiveMap)),void 0!==t.emissiveIntensity&&(e.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(e.specularMap=this.getTexture(t.specularMap)),void 0!==t.envMap&&(e.envMap=this.getTexture(t.envMap),e.combine=THREE.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 i=0,n=t.materials.length;i<n;i++)e.materials.push(this.parse(t.materials[i]));return e}},THREE.ObjectLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager,this.texturePath=""},THREE.ObjectLoader.prototype={
constructor:THREE.ObjectLoader,load:function(t,e,r,i){""===this.texturePath&&(this.texturePath=t.substring(0,t.lastIndexOf("/")+1));var n=this,a=new THREE.XHRLoader(n.manager);a.load(t,function(t){n.parse(JSON.parse(t),e)},r,i)},setTexturePath:function(t){this.texturePath=t},setCrossOrigin:function(t){this.crossOrigin=t},parse:function(t,e){var r=this.parseGeometries(t.geometries),i=this.parseImages(t.images,function(){void 0!==e&&e(o)}),n=this.parseTextures(t.textures,i),a=this.parseMaterials(t.materials,n),o=this.parseObject(t.object,r,a);return t.animations&&(o.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(o),o},parseGeometries:function(t){var e={};if(void 0!==t)for(var r=new THREE.JSONLoader,i=new THREE.BufferGeometryLoader,n=0,a=t.length;n<a;n++){var o,s=t[n];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new THREE[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new THREE[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new THREE[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new THREE[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new THREE[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":o=new THREE.DodecahedronGeometry(s.radius,s.detail);break;case"IcosahedronGeometry":o=new THREE.IcosahedronGeometry(s.radius,s.detail);break;case"OctahedronGeometry":o=new THREE.OctahedronGeometry(s.radius,s.detail);break;case"TetrahedronGeometry":o=new THREE.TetrahedronGeometry(s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new THREE[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new THREE[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new THREE[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"LatheGeometry":case"LatheBufferGeometry":o=new THREE[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"BufferGeometry":o=i.parse(s);break;case"Geometry":o=r.parse(s.data,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),e[s.uuid]=o}return e},parseMaterials:function(t,e){var r={};if(void 0!==t){var i=new THREE.MaterialLoader;i.setTextures(e);for(var n=0,a=t.length;n<a;n++){var o=i.parse(t[n]);r[o.uuid]=o}}return r},parseAnimations:function(t){for(var e=[],r=0;r<t.length;r++){var i=THREE.AnimationClip.parse(t[r]);e.push(i)}return e},parseImages:function(t,e){function r(t){return i.manager.itemStart(t),o.load(t,function(){i.manager.itemEnd(t)})}var i=this,n={};if(void 0!==t&&t.length>0){var a=new THREE.LoadingManager(e),o=new THREE.ImageLoader(a);o.setCrossOrigin(this.crossOrigin);for(var s=0,c=t.length;s<c;s++){var h=t[s],l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url)?h.url:i.texturePath+h.url;n[h.uuid]=r(l)}}return n},parseTextures:function(t,e){function r(t){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),THREE[t])}var i={};if(void 0!==t)for(var n=0,a=t.length;n<a;n++){var o=t[n];void 0===o.image&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),void 0===e[o.image]&&console.warn("THREE.ObjectLoader: Undefined image",o.image);var s=new THREE.Texture(e[o.image]);s.needsUpdate=!0,s.uuid=o.uuid,void 0!==o.name&&(s.name=o.name),void 0!==o.mapping&&(s.mapping=r(o.mapping)),void 0!==o.offset&&(s.offset=new THREE.Vector2(o.offset[0],o.offset[1])),void 0!==o.repeat&&(s.repeat=new THREE.Vector2(o.repeat[0],o.repeat[1])),void 0!==o.minFilter&&(s.minFilter=r(o.minFilter)),void 0!==o.magFilter&&(s.magFilter=r(o.magFilter)),void 0!==o.anisotropy&&(s.anisotropy=o.anisotropy),Array.isArray(o.wrap)&&(s.wrapS=r(o.wrap[0]),s.wrapT=r(o.wrap[1])),i[o.uuid]=s}return i},parseObject:function(){var t=new THREE.Matrix4;return function(e,r,i){function n(t){return void 0===r[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),r[t]}function a(t){if(void 0!==t)return void 0===i[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),i[t]}var o;switch(e.type){case"Scene":o=new THREE.Scene;break;case"PerspectiveCamera":o=new THREE.PerspectiveCamera(e.fov,e.aspect,e.near,e.far),void 0!==e.focus&&(o.focus=e.focus),void 0!==e.zoom&&(o.zoom=e.zoom),void 0!==e.filmGauge&&(o.filmGauge=e.filmGauge),void 0!==e.filmOffset&&(o.filmOffset=e.filmOffset),void 0!==e.view&&(o.view=Object.assign({},e.view));break;case"OrthographicCamera":o=new THREE.OrthographicCamera(e.left,e.right,e.top,e.bottom,e.near,e.far);break;case"AmbientLight":o=new THREE.AmbientLight(e.color,e.intensity);break;case"DirectionalLight":o=new THREE.DirectionalLight(e.color,e.intensity);break;case"PointLight":o=new THREE.PointLight(e.color,e.intensity,e.distance,e.decay);break;case"SpotLight":o=new THREE.SpotLight(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay);break;case"HemisphereLight":o=new THREE.HemisphereLight(e.color,e.groundColor,e.intensity);break;case"Mesh":var s=n(e.geometry),c=a(e.material);o=s.bones&&s.bones.length>0?new THREE.SkinnedMesh(s,c):new THREE.Mesh(s,c);break;case"LOD":o=new THREE.LOD;break;case"Line":o=new THREE.Line(n(e.geometry),a(e.material),e.mode);break;case"PointCloud":case"Points":o=new THREE.Points(n(e.geometry),a(e.material));break;case"Sprite":o=new THREE.Sprite(a(e.material));break;case"Group":o=new THREE.Group;break;default:o=new THREE.Object3D}if(o.uuid=e.uuid,void 0!==e.name&&(o.name=e.name),void 0!==e.matrix?(t.fromArray(e.matrix),t.decompose(o.position,o.quaternion,o.scale)):(void 0!==e.position&&o.position.fromArray(e.position),void 0!==e.rotation&&o.rotation.fromArray(e.rotation),void 0!==e.scale&&o.scale.fromArray(e.scale)),void 0!==e.castShadow&&(o.castShadow=e.castShadow),void 0!==e.receiveShadow&&(o.receiveShadow=e.receiveShadow),void 0!==e.visible&&(o.visible=e.visible),void 0!==e.userData&&(o.userData=e.userData),void 0!==e.children)for(var h in e.children)o.add(this.parseObject(e.children[h],r,i));if("LOD"===e.type)for(var l=e.levels,u=0;u<l.length;u++){var p=l[u],h=o.getObjectByProperty("uuid",p.object);void 0!==h&&o.addLevel(h,p.distance)}return o}}()},THREE.TextureLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(t,e,r,i){var n=new THREE.Texture,a=new THREE.ImageLoader(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(t,function(t){n.image=t,n.needsUpdate=!0,void 0!==e&&e(n)},r,i),n},setCrossOrigin:function(t){this.crossOrigin=t},setPath:function(t){this.path=t}},THREE.CubeTextureLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.CubeTextureLoader.prototype={constructor:THREE.CubeTextureLoader,load:function(t,e,r,i){function n(r){o.load(t[r],function(t){a.images[r]=t,s++,6===s&&(a.needsUpdate=!0,e&&e(a))},void 0,i)}var a=new THREE.CubeTexture,o=new THREE.ImageLoader(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);for(var s=0,c=0;c<t.length;++c)n(c);return a},setCrossOrigin:function(t){this.crossOrigin=t},setPath:function(t){this.path=t}},THREE.DataTextureLoader=THREE.BinaryTextureLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager,this._parser=null},THREE.BinaryTextureLoader.prototype={constructor:THREE.BinaryTextureLoader,load:function(t,e,r,i){var n=this,a=new THREE.DataTexture,o=new THREE.XHRLoader(this.manager);return o.setResponseType("arraybuffer"),o.load(t,function(t){var r=n._parser(t);r&&(void 0!==r.image?a.image=r.image:void 0!==r.data&&(a.image.width=r.width,a.image.height=r.height,a.image.data=r.data),a.wrapS=void 0!==r.wrapS?r.wrapS:THREE.ClampToEdgeWrapping,a.wrapT=void 0!==r.wrapT?r.wrapT:THREE.ClampToEdgeWrapping,a.magFilter=void 0!==r.magFilter?r.magFilter:THREE.LinearFilter,a.minFilter=void 0!==r.minFilter?r.minFilter:THREE.LinearMipMapLinearFilter,a.anisotropy=void 0!==r.anisotropy?r.anisotropy:1,void 0!==r.format&&(a.format=r.format),void 0!==r.type&&(a.type=r.type),void 0!==r.mipmaps&&(a.mipmaps=r.mipmaps),1===r.mipmapCount&&(a.minFilter=THREE.LinearFilter),a.needsUpdate=!0,e&&e(a,r))},r,i),a}},THREE.CompressedTextureLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager,this._parser=null},THREE.CompressedTextureLoader.prototype={constructor:THREE.CompressedTextureLoader,load:function(t,e,r,i){function n(n){c.load(t[n],function(t){var r=a._parser(t,!0);o[n]={width:r.width,height:r.height,format:r.format,mipmaps:r.mipmaps},h+=1,6===h&&(1===r.mipmapCount&&(s.minFilter=THREE.LinearFilter),s.format=r.format,s.needsUpdate=!0,e&&e(s))},r,i)}var a=this,o=[],s=new THREE.CompressedTexture;s.image=o;var c=new THREE.XHRLoader(this.manager);if(c.setPath(this.path),c.setResponseType("arraybuffer"),Array.isArray(t))for(var h=0,l=0,u=t.length;l<u;++l)n(l);else c.load(t,function(t){var r=a._parser(t,!0);if(r.isCubemap)for(var i=r.mipmaps.length/r.mipmapCount,n=0;n<i;n++){o[n]={mipmaps:[]};for(var c=0;c<r.mipmapCount;c++)o[n].mipmaps.push(r.mipmaps[n*r.mipmapCount+c]),o[n].format=r.format,o[n].width=r.width,o[n].height=r.height}else s.image.width=r.width,s.image.height=r.height,s.mipmaps=r.mipmaps;1===r.mipmapCount&&(s.minFilter=THREE.LinearFilter),s.format=r.format,s.needsUpdate=!0,e&&e(s)},r,i);return s},setPath:function(t){this.path=t}},THREE.Material=function(){Object.defineProperty(this,"id",{value:THREE.MaterialIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Material",this.side=THREE.FrontSide,this.opacity=1,this.transparent=!1,this.blending=THREE.NormalBlending,this.blendSrc=THREE.SrcAlphaFactor,this.blendDst=THREE.OneMinusSrcAlphaFactor,this.blendEquation=THREE.AddEquation,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=THREE.LessEqualDepth,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipShadows=!1,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.alphaTest=0,this.premultipliedAlpha=!1,this.overdraw=0,this.visible=!0,this._needsUpdate=!0},THREE.Material.prototype={constructor:THREE.Material,get needsUpdate(){return this._needsUpdate},set needsUpdate(t){t===!0&&this.update(),this._needsUpdate=t},setValues:function(t){if(void 0!==t)for(var e in t){var r=t[e];if(void 0!==r){var i=this[e];void 0!==i?i instanceof THREE.Color?i.set(r):i instanceof THREE.Vector3&&r instanceof THREE.Vector3?i.copy(r):"overdraw"===e?this[e]=Number(r):this[e]=r:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}else console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){function e(t){var e=[];for(var r in t){var i=t[r];delete i.metadata,e.push(i)}return e}var r=void 0===t;r&&(t={textures:{},images:{}});var i={metadata:{version:4.4,type:"Material",generator:"Material.toJSON"}};if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color instanceof THREE.Color&&(i.color=this.color.getHex()),.5!==this.roughness&&(i.roughness=this.roughness),.5!==this.metalness&&(i.metalness=this.metalness),this.emissive instanceof THREE.Color&&(i.emissive=this.emissive.getHex()),this.specular instanceof THREE.Color&&(i.specular=this.specular.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),this.map instanceof THREE.Texture&&(i.map=this.map.toJSON(t).uuid),this.alphaMap instanceof THREE.Texture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap instanceof THREE.Texture&&(i.lightMap=this.lightMap.toJSON(t).uuid),this.bumpMap instanceof THREE.Texture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap instanceof THREE.Texture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalScale=this.normalScale.toArray()),this.displacementMap instanceof THREE.Texture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap instanceof THREE.Texture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap instanceof THREE.Texture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap instanceof THREE.Texture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap instanceof THREE.Texture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.envMap instanceof THREE.Texture&&(i.envMap=this.envMap.toJSON(t).uuid,i.reflectivity=this.reflectivity),void 0!==this.size&&(i.size=this.size),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),void 0!==this.vertexColors&&this.vertexColors!==THREE.NoColors&&(i.vertexColors=this.vertexColors),void 0!==this.shading&&this.shading!==THREE.SmoothShading&&(i.shading=this.shading),void 0!==this.blending&&this.blending!==THREE.NormalBlending&&(i.blending=this.blending),void 0!==this.side&&this.side!==THREE.FrontSide&&(i.side=this.side),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=this.transparent),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=this.premultipliedAlpha),this.wireframe===!0&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),r){var n=e(t.textures),a=e(t.images);n.length>0&&(i.textures=n),a.length>0&&(i.images=a)}return i},clone:function(){return(new this.constructor).copy(this)},copy:function(t){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.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.overdraw=t.overdraw,this.visible=t.visible,this.clipShadows=t.clipShadows;var e=t.clippingPlanes,r=null;if(null!==e){var i=e.length;r=new Array(i);for(var n=0;n!==i;++n)r[n]=e[n].clone()}return this.clippingPlanes=r,this},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.Material.prototype),THREE.MaterialIdCount=0,THREE.LineBasicMaterial=function(t){THREE.Material.call(this),this.type="LineBasicMaterial",this.color=new THREE.Color(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.blending=THREE.NormalBlending,this.vertexColors=THREE.NoColors,this.fog=!0,this.setValues(t)},THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype),THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial,THREE.LineBasicMaterial.prototype.copy=function(t){return THREE.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},THREE.LineDashedMaterial=function(t){THREE.Material.call(this),this.type="LineDashedMaterial",this.color=new THREE.Color(16777215),this.linewidth=1,this.scale=1,this.dashSize=3,this.gapSize=1,this.blending=THREE.NormalBlending,this.vertexColors=THREE.NoColors,this.fog=!0,this.setValues(t)},THREE.LineDashedMaterial.prototype=Object.create(THREE.Material.prototype),THREE.LineDashedMaterial.prototype.constructor=THREE.LineDashedMaterial,THREE.LineDashedMaterial.prototype.copy=function(t){return THREE.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},THREE.MeshBasicMaterial=function(t){THREE.Material.call(this),this.type="MeshBasicMaterial",this.color=new THREE.Color(16777215),this.map=null,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.blending=THREE.NormalBlending,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=THREE.NoColors,this.skinning=!1,this.morphTargets=!1,this.setValues(t)},THREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial,THREE.MeshBasicMaterial.prototype.copy=function(t){return THREE.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},THREE.MeshDepthMaterial=function(t){THREE.Material.call(this),this.type="MeshDepthMaterial",this.depthPacking=THREE.BasicDepthPacking,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)},THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial,THREE.MeshDepthMaterial.prototype.copy=function(t){return THREE.Material.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},THREE.MeshLambertMaterial=function(t){THREE.Material.call(this),this.type="MeshLambertMaterial",this.color=new THREE.Color(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new THREE.Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.blending=THREE.NormalBlending,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=THREE.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)},THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshLambertMaterial.prototype.constructor=THREE.MeshLambertMaterial,THREE.MeshLambertMaterial.prototype.copy=function(t){return THREE.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,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},THREE.MeshNormalMaterial=function(t){THREE.Material.call(this,t),this.type="MeshNormalMaterial",this.wireframe=!1,this.wireframeLinewidth=1,this.morphTargets=!1,this.setValues(t)},THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshNormalMaterial.prototype.constructor=THREE.MeshNormalMaterial,THREE.MeshNormalMaterial.prototype.copy=function(t){return THREE.Material.prototype.copy.call(this,t),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},THREE.MeshPhongMaterial=function(t){THREE.Material.call(this),this.type="MeshPhongMaterial",this.color=new THREE.Color(16777215),this.specular=new THREE.Color(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new THREE.Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new THREE.Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.blending=THREE.NormalBlending,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=THREE.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)},THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial,THREE.MeshPhongMaterial.prototype.copy=function(t){return THREE.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,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},THREE.MeshStandardMaterial=function(t){THREE.Material.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new THREE.Color(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new THREE.Color(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new THREE.Vector2(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.blending=THREE.NormalBlending,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=THREE.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)},THREE.MeshStandardMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshStandardMaterial.prototype.constructor=THREE.MeshStandardMaterial,THREE.MeshStandardMaterial.prototype.copy=function(t){return THREE.Material.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,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.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,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},THREE.MeshPhysicalMaterial=function(t){THREE.MeshStandardMaterial.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.setValues(t)},THREE.MeshPhysicalMaterial.prototype=Object.create(THREE.MeshStandardMaterial.prototype),THREE.MeshPhysicalMaterial.prototype.constructor=THREE.MeshPhysicalMaterial,THREE.MeshPhysicalMaterial.prototype.copy=function(t){return THREE.MeshStandardMaterial.prototype.copy.call(this,t),this.defines={PHYSICAL:""},this.reflectivity=t.reflectivity,this},THREE.MultiMaterial=function(t){this.uuid=THREE.Math.generateUUID(),this.type="MultiMaterial",this.materials=t instanceof Array?t:[],this.visible=!0},THREE.MultiMaterial.prototype={constructor:THREE.MultiMaterial,toJSON:function(t){for(var e={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},r=this.materials,i=0,n=r.length;i<n;i++){var a=r[i].toJSON(t);delete a.metadata,e.materials.push(a)}return e.visible=this.visible,e},clone:function(){for(var t=new this.constructor,e=0;e<this.materials.length;e++)t.materials.push(this.materials[e].clone());return t.visible=this.visible,t}},THREE.PointsMaterial=function(t){THREE.Material.call(this),this.type="PointsMaterial",this.color=new THREE.Color(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.blending=THREE.NormalBlending,this.vertexColors=THREE.NoColors,this.fog=!0,this.setValues(t)},THREE.PointsMaterial.prototype=Object.create(THREE.Material.prototype),THREE.PointsMaterial.prototype.constructor=THREE.PointsMaterial,THREE.PointsMaterial.prototype.copy=function(t){return THREE.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.vertexColors=t.vertexColors,this.fog=t.fog,this},THREE.ShaderMaterial=function(t){THREE.Material.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.shading=THREE.SmoothShading,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.vertexColors=THREE.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))},THREE.ShaderMaterial.prototype=Object.create(THREE.Material.prototype),THREE.ShaderMaterial.prototype.constructor=THREE.ShaderMaterial,THREE.ShaderMaterial.prototype.copy=function(t){return THREE.Material.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=THREE.UniformsUtils.clone(t.uniforms),this.defines=t.defines,this.shading=t.shading,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.vertexColors=t.vertexColors,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},THREE.ShaderMaterial.prototype.toJSON=function(t){var e=THREE.Material.prototype.toJSON.call(this,t);return e.uniforms=this.uniforms,e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader,e},THREE.RawShaderMaterial=function(t){THREE.ShaderMaterial.call(this,t),this.type="RawShaderMaterial"},THREE.RawShaderMaterial.prototype=Object.create(THREE.ShaderMaterial.prototype),THREE.RawShaderMaterial.prototype.constructor=THREE.RawShaderMaterial,THREE.SpriteMaterial=function(t){THREE.Material.call(this),this.type="SpriteMaterial",this.color=new THREE.Color(16777215),this.map=null,this.rotation=0,this.fog=!1,this.setValues(t)},THREE.SpriteMaterial.prototype=Object.create(THREE.Material.prototype),THREE.SpriteMaterial.prototype.constructor=THREE.SpriteMaterial,THREE.SpriteMaterial.prototype.copy=function(t){return THREE.Material.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.rotation=t.rotation,this.fog=t.fog,this},THREE.Texture=function(t,e,r,i,n,a,o,s,c,h){Object.defineProperty(this,"id",{value:THREE.TextureIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.sourceFile="",this.image=void 0!==t?t:THREE.Texture.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:THREE.Texture.DEFAULT_MAPPING,this.wrapS=void 0!==r?r:THREE.ClampToEdgeWrapping,this.wrapT=void 0!==i?i:THREE.ClampToEdgeWrapping,this.magFilter=void 0!==n?n:THREE.LinearFilter,this.minFilter=void 0!==a?a:THREE.LinearMipMapLinearFilter,this.anisotropy=void 0!==c?c:1,this.format=void 0!==o?o:THREE.RGBAFormat,this.type=void 0!==s?s:THREE.UnsignedByteType,this.offset=new THREE.Vector2(0,0),this.repeat=new THREE.Vector2(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==h?h:THREE.LinearEncoding,this.version=0,this.onUpdate=null},THREE.Texture.DEFAULT_IMAGE=void 0,THREE.Texture.DEFAULT_MAPPING=THREE.UVMapping,THREE.Texture.prototype={constructor:THREE.Texture,set needsUpdate(t){t===!0&&this.version++},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){function e(t){var e;return void 0!==t.toDataURL?e=t:(e=document.createElement("canvas"),e.width=t.width,e.height=t.height,e.getContext("2d").drawImage(t,0,0,t.width,t.height)),e.width>2048||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 i=this.image;void 0===i.uuid&&(i.uuid=THREE.Math.generateUUID()),void 0===t.images[i.uuid]&&(t.images[i.uuid]={uuid:i.uuid,url:e(i)}),r.image=i.uuid}return t.textures[this.uuid]=r,r},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(this.mapping===THREE.UVMapping){if(t.multiply(this.repeat),t.add(this.offset),t.x<0||t.x>1)switch(this.wrapS){case THREE.RepeatWrapping:t.x=t.x-Math.floor(t.x);break;case THREE.ClampToEdgeWrapping:t.x=t.x<0?0:1;break;case THREE.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 THREE.RepeatWrapping:t.y=t.y-Math.floor(t.y);break;case THREE.ClampToEdgeWrapping:t.y=t.y<0?0:1;break;case THREE.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)}}},THREE.EventDispatcher.prototype.apply(THREE.Texture.prototype),THREE.TextureIdCount=0,THREE.DepthTexture=function(t,e,r,i,n,a,o,s,c){THREE.Texture.call(this,null,i,n,a,o,s,THREE.DepthFormat,r,c),this.image={width:t,height:e},this.type=void 0!==r?r:THREE.UnsignedShortType,this.magFilter=void 0!==o?o:THREE.NearestFilter,this.minFilter=void 0!==s?s:THREE.NearestFilter,this.flipY=!1,this.generateMipmaps=!1},THREE.DepthTexture.prototype=Object.create(THREE.Texture.prototype),THREE.DepthTexture.prototype.constructor=THREE.DepthTexture,THREE.CanvasTexture=function(t,e,r,i,n,a,o,s,c){THREE.Texture.call(this,t,e,r,i,n,a,o,s,c),this.needsUpdate=!0},THREE.CanvasTexture.prototype=Object.create(THREE.Texture.prototype),THREE.CanvasTexture.prototype.constructor=THREE.CanvasTexture,THREE.CubeTexture=function(t,e,r,i,n,a,o,s,c,h){t=void 0!==t?t:[],e=void 0!==e?e:THREE.CubeReflectionMapping,THREE.Texture.call(this,t,e,r,i,n,a,o,s,c,h),this.flipY=!1},THREE.CubeTexture.prototype=Object.create(THREE.Texture.prototype),THREE.CubeTexture.prototype.constructor=THREE.CubeTexture,Object.defineProperty(THREE.CubeTexture.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),THREE.CompressedTexture=function(t,e,r,i,n,a,o,s,c,h,l,u){THREE.Texture.call(this,null,a,o,s,c,h,i,n,l,u),this.image={width:e,height:r},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1},THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype),THREE.CompressedTexture.prototype.constructor=THREE.CompressedTexture,THREE.DataTexture=function(t,e,r,i,n,a,o,s,c,h,l,u){THREE.Texture.call(this,null,a,o,s,c,h,i,n,l,u),this.image={data:t,width:e,height:r},this.magFilter=void 0!==c?c:THREE.NearestFilter,this.minFilter=void 0!==h?h:THREE.NearestFilter,this.flipY=!1,this.generateMipmaps=!1},THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype),THREE.DataTexture.prototype.constructor=THREE.DataTexture,THREE.VideoTexture=function(t,e,r,i,n,a,o,s,c){function h(){requestAnimationFrame(h),t.readyState>=t.HAVE_CURRENT_DATA&&(l.needsUpdate=!0)}THREE.Texture.call(this,t,e,r,i,n,a,o,s,c),this.generateMipmaps=!1;var l=this;h()},THREE.VideoTexture.prototype=Object.create(THREE.Texture.prototype),THREE.VideoTexture.prototype.constructor=THREE.VideoTexture,THREE.Group=function(){THREE.Object3D.call(this),this.type="Group"},THREE.Group.prototype=Object.create(THREE.Object3D.prototype),THREE.Group.prototype.constructor=THREE.Group,THREE.Points=function(t,e){THREE.Object3D.call(this),this.type="Points",this.geometry=void 0!==t?t:new THREE.Geometry,this.material=void 0!==e?e:new THREE.PointsMaterial({color:16777215*Math.random()})},THREE.Points.prototype=Object.create(THREE.Object3D.prototype),THREE.Points.prototype.constructor=THREE.Points,THREE.Points.prototype.raycast=function(){var t=new THREE.Matrix4,e=new THREE.Ray,r=new THREE.Sphere;return function(i,n){function a(t,r){var a=e.distanceSqToPoint(t);if(a<u){var s=e.closestPointToPoint(t);s.applyMatrix4(c);var h=i.ray.origin.distanceTo(s);if(h<i.near||h>i.far)return;n.push({distance:h,distanceToRay:Math.sqrt(a),point:s.clone(),index:r,face:null,object:o})}}var o=this,s=this.geometry,c=this.matrixWorld,h=i.params.Points.threshold;if(null===s.boundingSphere&&s.computeBoundingSphere(),r.copy(s.boundingSphere),r.applyMatrix4(c),i.ray.intersectsSphere(r)!==!1){t.getInverse(c),e.copy(i.ray).applyMatrix4(t);var l=h/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l,p=new THREE.Vector3;if(s instanceof THREE.BufferGeometry){var d=s.index,E=s.attributes,f=E.position.array;if(null!==d)for(var m=d.array,g=0,v=m.length;g<v;g++){var T=m[g];p.fromArray(f,3*T),a(p,T)}else for(var g=0,y=f.length/3;g<y;g++)p.fromArray(f,3*g),a(p,g)}else for(var R=s.vertices,g=0,y=R.length;g<y;g++)a(R[g],g)}}}(),THREE.Points.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)},THREE.Line=function(t,e,r){return 1===r?(console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new THREE.LineSegments(t,e)):(THREE.Object3D.call(this),this.type="Line",this.geometry=void 0!==t?t:new THREE.Geometry,void(this.material=void 0!==e?e:new THREE.LineBasicMaterial({color:16777215*Math.random()})))},THREE.Line.prototype=Object.create(THREE.Object3D.prototype),THREE.Line.prototype.constructor=THREE.Line,THREE.Line.prototype.raycast=function(){var t=new THREE.Matrix4,e=new THREE.Ray,r=new THREE.Sphere;return function(i,n){var a=i.linePrecision,o=a*a,s=this.geometry,c=this.matrixWorld;if(null===s.boundingSphere&&s.computeBoundingSphere(),r.copy(s.boundingSphere),r.applyMatrix4(c),i.ray.intersectsSphere(r)!==!1){t.getInverse(c),e.copy(i.ray).applyMatrix4(t);var h=new THREE.Vector3,l=new THREE.Vector3,u=new THREE.Vector3,p=new THREE.Vector3,d=this instanceof THREE.LineSegments?2:1;if(s instanceof THREE.BufferGeometry){var E=s.index,f=s.attributes,m=f.position.array;if(null!==E)for(var g=E.array,v=0,T=g.length-1;v<T;v+=d){var y=g[v],R=g[v+1];h.fromArray(m,3*y),l.fromArray(m,3*R);var H=e.distanceSqToSegment(h,l,p,u);if(!(H>o)){p.applyMatrix4(this.matrixWorld);var x=i.ray.origin.distanceTo(p);x<i.near||x>i.far||n.push({distance:x,point:u.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else for(var v=0,T=m.length/3-1;v<T;v+=d){h.fromArray(m,3*v),l.fromArray(m,3*v+3);var H=e.distanceSqToSegment(h,l,p,u);if(!(H>o)){p.applyMatrix4(this.matrixWorld);var x=i.ray.origin.distanceTo(p);x<i.near||x>i.far||n.push({distance:x,point:u.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}}else if(s instanceof THREE.Geometry)for(var b=s.vertices,_=b.length,v=0;v<_-1;v+=d){var H=e.distanceSqToSegment(b[v],b[v+1],p,u);if(!(H>o)){p.applyMatrix4(this.matrixWorld);var x=i.ray.origin.distanceTo(p);x<i.near||x>i.far||n.push({distance:x,point:u.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}}}}(),THREE.Line.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)},THREE.LineStrip=0,THREE.LinePieces=1,THREE.LineSegments=function(t,e){THREE.Line.call(this,t,e),this.type="LineSegments"},THREE.LineSegments.prototype=Object.create(THREE.Line.prototype),THREE.LineSegments.prototype.constructor=THREE.LineSegments,THREE.Mesh=function(t,e){THREE.Object3D.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new THREE.Geometry,this.material=void 0!==e?e:new THREE.MeshBasicMaterial({color:16777215*Math.random()}),this.drawMode=THREE.TrianglesDrawMode,this.updateMorphTargets()},THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype),THREE.Mesh.prototype.constructor=THREE.Mesh,THREE.Mesh.prototype.setDrawMode=function(t){this.drawMode=t},THREE.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;t<e;t++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[t].name]=t}},THREE.Mesh.prototype.getMorphTargetIndexByName=function(t){return void 0!==this.morphTargetDictionary[t]?this.morphTargetDictionary[t]:(console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+t+" does not exist. Returning 0."),0)},THREE.Mesh.prototype.raycast=function(){function t(t,e,r,i,n,a,o){return THREE.Triangle.barycoordFromPoint(t,e,r,i,f),n.multiplyScalar(f.x),a.multiplyScalar(f.y),o.multiplyScalar(f.z),n.add(a).add(o),n.clone()}function e(t,e,r,i,n,a,o){var s,c=t.material;if(s=c.side===THREE.BackSide?r.intersectTriangle(a,n,i,!0,o):r.intersectTriangle(i,n,a,c.side!==THREE.DoubleSide,o),null===s)return null;g.copy(o),g.applyMatrix4(t.matrixWorld);var h=e.ray.origin.distanceTo(g);return h<e.near||h>e.far?null:{distance:h,point:g.clone(),object:t}}function r(r,i,n,a,h,l,u,f){o.fromArray(a,3*l),s.fromArray(a,3*u),c.fromArray(a,3*f);var g=e(r,i,n,o,s,c,m);return g&&(h&&(p.fromArray(h,2*l),d.fromArray(h,2*u),E.fromArray(h,2*f),g.uv=t(m,o,s,c,p,d,E)),g.face=new THREE.Face3(l,u,f,THREE.Triangle.normal(o,s,c)),g.faceIndex=l),g}var i=new THREE.Matrix4,n=new THREE.Ray,a=new THREE.Sphere,o=new THREE.Vector3,s=new THREE.Vector3,c=new THREE.Vector3,h=new THREE.Vector3,l=new THREE.Vector3,u=new THREE.Vector3,p=new THREE.Vector2,d=new THREE.Vector2,E=new THREE.Vector2,f=new THREE.Vector3,m=new THREE.Vector3,g=new THREE.Vector3;return function(f,g){var v=this.geometry,T=this.material,y=this.matrixWorld;if(void 0!==T&&(null===v.boundingSphere&&v.computeBoundingSphere(),a.copy(v.boundingSphere),a.applyMatrix4(y),f.ray.intersectsSphere(a)!==!1&&(i.getInverse(y),n.copy(f.ray).applyMatrix4(i),null===v.boundingBox||n.intersectsBox(v.boundingBox)!==!1))){var R,H;if(v instanceof THREE.BufferGeometry){var x,b,_,M=v.index,w=v.attributes,S=w.position.array;if(void 0!==w.uv&&(R=w.uv.array),null!==M)for(var L=M.array,A=0,C=L.length;A<C;A+=3)x=L[A],b=L[A+1],_=L[A+2],H=r(this,f,n,S,R,x,b,_),H&&(H.faceIndex=Math.floor(A/3),g.push(H));else for(var A=0,C=S.length;A<C;A+=9)x=A/3,b=x+1,_=x+2,H=r(this,f,n,S,R,x,b,_),H&&(H.index=x,g.push(H))}else if(v instanceof THREE.Geometry){var P,B,D,I=T instanceof THREE.MultiMaterial,U=I===!0?T.materials:null,F=v.vertices,N=v.faces,O=v.faceVertexUvs[0];O.length>0&&(R=O);for(var V=0,G=N.length;V<G;V++){var z=N[V],k=I===!0?U[z.materialIndex]:T;if(void 0!==k){if(P=F[z.a],B=F[z.b],D=F[z.c],k.morphTargets===!0){var j=v.morphTargets,W=this.morphTargetInfluences;o.set(0,0,0),s.set(0,0,0),c.set(0,0,0);for(var X=0,q=j.length;X<q;X++){var Y=W[X];if(0!==Y){var Z=j[X].vertices;o.addScaledVector(h.subVectors(Z[z.a],P),Y),s.addScaledVector(l.subVectors(Z[z.b],B),Y),c.addScaledVector(u.subVectors(Z[z.c],D),Y)}}o.add(P),s.add(B),c.add(D),P=o,B=s,D=c}if(H=e(this,f,n,P,B,D,m)){if(R){var K=R[V];p.copy(K[0]),d.copy(K[1]),E.copy(K[2]),H.uv=t(m,P,B,D,p,d,E)}H.face=z,H.faceIndex=V,g.push(H)}}}}}}}(),THREE.Mesh.prototype.clone=function(){return new this.constructor(this.geometry,this.material).copy(this)},THREE.Bone=function(t){THREE.Object3D.call(this),this.type="Bone",this.skin=t},THREE.Bone.prototype=Object.create(THREE.Object3D.prototype),THREE.Bone.prototype.constructor=THREE.Bone,THREE.Bone.prototype.copy=function(t){return THREE.Object3D.prototype.copy.call(this,t),this.skin=t.skin,this},THREE.Skeleton=function(t,e,r){if(this.useVertexTexture=void 0===r||r,this.identityMatrix=new THREE.Matrix4,t=t||[],this.bones=t.slice(0),this.useVertexTexture){var i=Math.sqrt(4*this.bones.length);i=THREE.Math.nextPowerOfTwo(Math.ceil(i)),i=Math.max(i,4),this.boneTextureWidth=i,this.boneTextureHeight=i,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType)}else this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[];for(var n=0,a=this.bones.length;n<a;n++)this.boneInverses.push(new THREE.Matrix4)}},THREE.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var r=new THREE.Matrix4;this.bones[t]&&r.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(r)}},THREE.Skeleton.prototype.pose=function(){for(var t,e=0,r=this.bones.length;e<r;e++)t=this.bones[e],t&&t.matrixWorld.getInverse(this.boneInverses[e]);for(var e=0,r=this.bones.length;e<r;e++)t=this.bones[e],t&&(t.parent?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},THREE.Skeleton.prototype.update=function(){var t=new THREE.Matrix4;return function(){for(var e=0,r=this.bones.length;e<r;e++){var i=this.bones[e]?this.bones[e].matrixWorld:this.identityMatrix;t.multiplyMatrices(i,this.boneInverses[e]),t.toArray(this.boneMatrices,16*e)}this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)}}(),THREE.Skeleton.prototype.clone=function(){return new THREE.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)},THREE.SkinnedMesh=function(t,e,r){THREE.Mesh.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new THREE.Matrix4,this.bindMatrixInverse=new THREE.Matrix4;var i=[];if(this.geometry&&void 0!==this.geometry.bones){for(var n,a,o=0,s=this.geometry.bones.length;o<s;++o)a=this.geometry.bones[o],n=new THREE.Bone(this),i.push(n),n.name=a.name,n.position.fromArray(a.pos),n.quaternion.fromArray(a.rotq),void 0!==a.scl&&n.scale.fromArray(a.scl);for(var o=0,s=this.geometry.bones.length;o<s;++o)a=this.geometry.bones[o],a.parent!==-1&&null!==a.parent&&void 0!==i[a.parent]?i[a.parent].add(i[o]):this.add(i[o])}this.normalizeSkinWeights(),this.updateMatrixWorld(!0),this.bind(new THREE.Skeleton(i,(void 0),r),this.matrixWorld)},THREE.SkinnedMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh,THREE.SkinnedMesh.prototype.bind=function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},THREE.SkinnedMesh.prototype.pose=function(){this.skeleton.pose()},THREE.SkinnedMesh.prototype.normalizeSkinWeights=function(){if(this.geometry instanceof THREE.Geometry)for(var t=0;t<this.geometry.skinWeights.length;t++){var e=this.geometry.skinWeights[t],r=1/e.lengthManhattan();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0)}else if(this.geometry instanceof THREE.BufferGeometry)for(var i=new THREE.Vector4,n=this.geometry.attributes.skinWeight,t=0;t<n.count;t++){i.x=n.getX(t),i.y=n.getY(t),i.z=n.getZ(t),i.w=n.getW(t);var r=1/i.lengthManhattan();r!==1/0?i.multiplyScalar(r):i.set(1,0,0,0),n.setXYZW(t,i.x,i.y,i.z,i.w)}},THREE.SkinnedMesh.prototype.updateMatrixWorld=function(t){THREE.Mesh.prototype.updateMatrixWorld.call(this,!0),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh unrecognized bindMode: "+this.bindMode)},THREE.SkinnedMesh.prototype.clone=function(){return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)},THREE.LOD=function(){THREE.Object3D.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})},THREE.LOD.prototype=Object.create(THREE.Object3D.prototype),THREE.LOD.prototype.constructor=THREE.LOD,THREE.LOD.prototype.addLevel=function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var r=this.levels,i=0;i<r.length&&!(e<r[i].distance);i++);r.splice(i,0,{distance:e,object:t}),this.add(t)},THREE.LOD.prototype.getObjectForDistance=function(t){for(var e=this.levels,r=1,i=e.length;r<i&&!(t<e[r].distance);r++);return e[r-1].object},THREE.LOD.prototype.raycast=function(){var t=new THREE.Vector3;return function(e,r){t.setFromMatrixPosition(this.matrixWorld);var i=e.ray.origin.distanceTo(t);this.getObjectForDistance(i).raycast(e,r)}}(),THREE.LOD.prototype.update=function(){var t=new THREE.Vector3,e=new THREE.Vector3;return function(r){var i=this.levels;if(i.length>1){t.setFromMatrixPosition(r.matrixWorld),e.setFromMatrixPosition(this.matrixWorld);var n=t.distanceTo(e);i[0].object.visible=!0;for(var a=1,o=i.length;a<o&&n>=i[a].distance;a++)i[a-1].object.visible=!1,i[a].object.visible=!0;for(;a<o;a++)i[a].object.visible=!1}}}(),THREE.LOD.prototype.copy=function(t){THREE.Object3D.prototype.copy.call(this,t,!1);for(var e=t.levels,r=0,i=e.length;r<i;r++){var n=e[r];this.addLevel(n.object.clone(),n.distance)}return this},THREE.LOD.prototype.toJSON=function(t){var e=THREE.Object3D.prototype.toJSON.call(this,t);e.object.levels=[];for(var r=this.levels,i=0,n=r.length;i<n;i++){var a=r[i];e.object.levels.push({object:a.object.uuid,distance:a.distance})}return e},THREE.Sprite=function(){var t=new Uint16Array([0,1,2,0,2,3]),e=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]),i=new THREE.BufferGeometry;return i.setIndex(new THREE.BufferAttribute(t,1)),i.addAttribute("position",new THREE.BufferAttribute(e,3)),i.addAttribute("uv",new THREE.BufferAttribute(r,2)),function(t){THREE.Object3D.call(this),this.type="Sprite",this.geometry=i,this.material=void 0!==t?t:new THREE.SpriteMaterial}}(),THREE.Sprite.prototype=Object.create(THREE.Object3D.prototype),THREE.Sprite.prototype.constructor=THREE.Sprite,THREE.Sprite.prototype.raycast=function(){var t=new THREE.Vector3;return function(e,r){t.setFromMatrixPosition(this.matrixWorld);var i=e.ray.distanceSqToPoint(t),n=this.scale.x*this.scale.y/4;i>n||r.push({distance:Math.sqrt(i),point:this.position,face:null,object:this})}}(),THREE.Sprite.prototype.clone=function(){return new this.constructor(this.material).copy(this)},THREE.Particle=THREE.Sprite,THREE.LensFlare=function(t,e,r,i,n){THREE.Object3D.call(this),this.lensFlares=[],this.positionScreen=new THREE.Vector3,this.customUpdateCallback=void 0,void 0!==t&&this.add(t,e,r,i,n)},THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype),THREE.LensFlare.prototype.constructor=THREE.LensFlare,THREE.LensFlare.prototype.add=function(t,e,r,i,n,a){void 0===e&&(e=-1),void 0===r&&(r=0),void 0===a&&(a=1),void 0===n&&(n=new THREE.Color(16777215)),void 0===i&&(i=THREE.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:a,color:n,blending:i})},THREE.LensFlare.prototype.updateLensFlares=function(){var t,e,r=this.lensFlares.length,i=2*-this.positionScreen.x,n=2*-this.positionScreen.y;for(t=0;t<r;t++)e=this.lensFlares[t],e.x=this.positionScreen.x+i*e.distance,e.y=this.positionScreen.y+n*e.distance,e.wantedRotation=e.x*Math.PI*.25,e.rotation+=.25*(e.wantedRotation-e.rotation)},THREE.LensFlare.prototype.copy=function(t){THREE.Object3D.prototype.copy.call(this,t),this.positionScreen.copy(t.positionScreen),this.customUpdateCallback=t.customUpdateCallback;for(var e=0,r=t.lensFlares.length;e<r;e++)this.lensFlares.push(t.lensFlares[e]);return this},THREE.Scene=function(){THREE.Object3D.call(this),this.type="Scene",this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0},THREE.Scene.prototype=Object.create(THREE.Object3D.prototype),THREE.Scene.prototype.constructor=THREE.Scene,THREE.Scene.prototype.copy=function(t,e){return THREE.Object3D.prototype.copy.call(this,t,e),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},THREE.Fog=function(t,e,r){this.name="",this.color=new THREE.Color(t),this.near=void 0!==e?e:1,this.far=void 0!==r?r:1e3},THREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)},THREE.FogExp2=function(t,e){this.name="",this.color=new THREE.Color(t),this.density=void 0!==e?e:25e-5},THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)},THREE.ShaderChunk={},THREE.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",THREE.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",THREE.ShaderChunk.alphatest_fragment="#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",THREE.ShaderChunk.aomap_fragment="#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",THREE.ShaderChunk.aomap_pars_fragment="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",THREE.ShaderChunk.begin_vertex="\nvec3 transformed = vec3( position );\n",THREE.ShaderChunk.beginnormal_vertex="\nvec3 objectNormal = vec3( normal );\n",THREE.ShaderChunk.bsdfs="bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\n\treturn any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",THREE.ShaderChunk.bumpmap_pars_fragment="#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",THREE.ShaderChunk.clipping_planes_fragment="#if NUM_CLIPPING_PLANES > 0\n\tfor ( int i = 0; i < NUM_CLIPPING_PLANES; ++ i ) {\n\t\tvec4 plane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n#endif\n",THREE.ShaderChunk.clipping_planes_pars_fragment="#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n",THREE.ShaderChunk.clipping_planes_pars_vertex="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n",THREE.ShaderChunk.clipping_planes_vertex="#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n",THREE.ShaderChunk.color_fragment="#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",THREE.ShaderChunk.color_pars_fragment="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",THREE.ShaderChunk.color_pars_vertex="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",THREE.ShaderChunk.color_vertex="#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",THREE.ShaderChunk.common="#define PI 3.14159265359\n#define PI2 6.28318530718\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\n",THREE.ShaderChunk.cube_uv_reflection_fragment="#ifdef ENVMAP_TYPE_CUBE_UV\nconst float cubeUV_textureSize = 1024.0;\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\nfloat cubeUV_maxLods1 = log2(cubeUV_textureSize*0.25) - 1.0;\nfloat cubeUV_rangeClamp = exp2((6.0 - 1.0) * 2.0);\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\nfloat cubeUV_maxLods2 = log2(cubeUV_textureSize*0.25) - 2.0;\nconst float cubeUV_rcpTextureSize = 1.0 / cubeUV_textureSize;\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\nfloat cubeUV_maxLods3 = log2(cubeUV_textureSize*0.25) - 3.0;\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n",
THREE.ShaderChunk.defaultnormal_vertex="#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",THREE.ShaderChunk.displacementmap_vertex="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",THREE.ShaderChunk.displacementmap_pars_vertex="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",THREE.ShaderChunk.emissivemap_fragment="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",THREE.ShaderChunk.emissivemap_pars_fragment="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",THREE.ShaderChunk.encodings_pars_fragment="\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n",THREE.ShaderChunk.encodings_fragment=" gl_FragColor = linearToOutputTexel( gl_FragColor );\n",THREE.ShaderChunk.envmap_fragment="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef 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\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",THREE.ShaderChunk.envmap_pars_fragment="#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n";THREE.ShaderChunk.envmap_pars_vertex="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n";THREE.ShaderChunk.envmap_vertex="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n",THREE.ShaderChunk.fog_fragment="#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",THREE.ShaderChunk.fog_pars_fragment="#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",THREE.ShaderChunk.lightmap_fragment="#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",THREE.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",THREE.ShaderChunk.lights_lambert_vertex="vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",THREE.ShaderChunk.lights_pars="uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tif ( testLightInRange( lightDistance, pointLight.distance ) ) {\n\t\t\tdirectLight.color = pointLight.color;\n\t\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",THREE.ShaderChunk.lights_phong_fragment="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",THREE.ShaderChunk.lights_phong_pars_fragment="varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",THREE.ShaderChunk.lights_physical_fragment="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.16 * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#endif\n",THREE.ShaderChunk.lights_physical_pars_fragment="struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t#endif\n};\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",THREE.ShaderChunk.lights_template="\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\tRE_IndirectSpecular( radiance, geometry, material, reflectedLight );\n#endif\n",THREE.ShaderChunk.logdepthbuf_fragment="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",THREE.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",THREE.ShaderChunk.logdepthbuf_pars_vertex="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",THREE.ShaderChunk.logdepthbuf_vertex="#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",THREE.ShaderChunk.map_fragment="#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",THREE.ShaderChunk.map_pars_fragment="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",THREE.ShaderChunk.map_particle_fragment="#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",THREE.ShaderChunk.map_particle_pars_fragment="#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",THREE.ShaderChunk.metalnessmap_fragment="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",THREE.ShaderChunk.metalnessmap_pars_fragment="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",THREE.ShaderChunk.morphnormal_vertex="#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",THREE.ShaderChunk.morphtarget_pars_vertex="#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",THREE.ShaderChunk.morphtarget_vertex="#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",THREE.ShaderChunk.normal_fragment="#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",THREE.ShaderChunk.normalmap_pars_fragment="#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",THREE.ShaderChunk.packing="vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 1.0 - 2.0 * rgb.xyz;\n}\nvec4 packDepthToRGBA( const in float value ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( value * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nfloat unpackRGBAToDepth( const in vec4 rgba ) {\n\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\treturn dot( rgba, bitSh );\n}\nfloat viewZToOrthoDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat OrthoDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n return linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",THREE.ShaderChunk.premultiplied_alpha_fragment="#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",THREE.ShaderChunk.project_vertex="#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",THREE.ShaderChunk.roughnessmap_fragment="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",THREE.ShaderChunk.roughnessmap_pars_fragment="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",THREE.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",
THREE.ShaderChunk.shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",THREE.ShaderChunk.shadowmap_vertex="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",THREE.ShaderChunk.shadowmask_pars_fragment="float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",THREE.ShaderChunk.skinbase_vertex="#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",THREE.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",THREE.ShaderChunk.skinning_vertex="#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n",THREE.ShaderChunk.skinnormal_vertex="#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",THREE.ShaderChunk.specularmap_fragment="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",THREE.ShaderChunk.specularmap_pars_fragment="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",THREE.ShaderChunk.tonemapping_fragment="#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",THREE.ShaderChunk.tonemapping_pars_fragment="#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",THREE.ShaderChunk.uv2_pars_fragment="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",THREE.ShaderChunk.uv2_pars_vertex="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",THREE.ShaderChunk.uv2_vertex="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",THREE.ShaderChunk.uv_pars_fragment="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",THREE.ShaderChunk.uv_pars_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",THREE.ShaderChunk.uv_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",THREE.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n",THREE.UniformsUtils={merge:function(t){for(var e={},r=0;r<t.length;r++){var i=this.clone(t[r]);for(var n in i)e[n]=i[n]}return e},clone:function(t){var e={};for(var r in t){e[r]={};for(var i in t[r]){var n=t[r][i];n instanceof THREE.Color||n instanceof THREE.Vector2||n instanceof THREE.Vector3||n instanceof THREE.Vector4||n instanceof THREE.Matrix3||n instanceof THREE.Matrix4||n instanceof THREE.Texture?e[r][i]=n.clone():Array.isArray(n)?e[r][i]=n.slice():e[r][i]=n}}return e}},THREE.UniformsLib={common:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"1f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},specularMap:{type:"t",value:null},alphaMap:{type:"t",value:null},envMap:{type:"t",value:null},flipEnvMap:{type:"1f",value:-1},reflectivity:{type:"1f",value:1},refractionRatio:{type:"1f",value:.98}},aomap:{aoMap:{type:"t",value:null},aoMapIntensity:{type:"1f",value:1}},lightmap:{lightMap:{type:"t",value:null},lightMapIntensity:{type:"1f",value:1}},emissivemap:{emissiveMap:{type:"t",value:null}},bumpmap:{bumpMap:{type:"t",value:null},bumpScale:{type:"1f",value:1}},normalmap:{normalMap:{type:"t",value:null},normalScale:{type:"v2",value:new THREE.Vector2(1,1)}},displacementmap:{displacementMap:{type:"t",value:null},displacementScale:{type:"1f",value:1},displacementBias:{type:"1f",value:0}},roughnessmap:{roughnessMap:{type:"t",value:null}},metalnessmap:{metalnessMap:{type:"t",value:null}},fog:{fogDensity:{type:"1f",value:25e-5},fogNear:{type:"1f",value:1},fogFar:{type:"1f",value:2e3},fogColor:{type:"c",value:new THREE.Color(16777215)}},lights:{ambientLightColor:{type:"3fv",value:[]},directionalLights:{type:"sa",value:[],properties:{direction:{type:"v3"},color:{type:"c"},shadow:{type:"1i"},shadowBias:{type:"1f"},shadowRadius:{type:"1f"},shadowMapSize:{type:"v2"}}},directionalShadowMap:{type:"tv",value:[]},directionalShadowMatrix:{type:"m4v",value:[]},spotLights:{type:"sa",value:[],properties:{color:{type:"c"},position:{type:"v3"},direction:{type:"v3"},distance:{type:"1f"},coneCos:{type:"1f"},penumbraCos:{type:"1f"},decay:{type:"1f"},shadow:{type:"1i"},shadowBias:{type:"1f"},shadowRadius:{type:"1f"},shadowMapSize:{type:"v2"}}},spotShadowMap:{type:"tv",value:[]},spotShadowMatrix:{type:"m4v",value:[]},pointLights:{type:"sa",value:[],properties:{color:{type:"c"},position:{type:"v3"},decay:{type:"1f"},distance:{type:"1f"},shadow:{type:"1i"},shadowBias:{type:"1f"},shadowRadius:{type:"1f"},shadowMapSize:{type:"v2"}}},pointShadowMap:{type:"tv",value:[]},pointShadowMatrix:{type:"m4v",value:[]},hemisphereLights:{type:"sa",value:[],properties:{direction:{type:"v3"},skyColor:{type:"c"},groundColor:{type:"c"}}}},points:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"1f",value:1},size:{type:"1f",value:1},scale:{type:"1f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)}}},THREE.ShaderChunk.cube_frag="uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\t#include <logdepthbuf_fragment>\n}\n",THREE.ShaderChunk.cube_vert="varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",THREE.ShaderChunk.depth_frag="#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n",THREE.ShaderChunk.depth_vert="#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",THREE.ShaderChunk.distanceRGBA_frag="uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\n#include <packing>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tgl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 );\n}\n",THREE.ShaderChunk.distanceRGBA_vert="varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition;\n}\n",THREE.ShaderChunk.equirect_frag="uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <logdepthbuf_fragment>\n}\n",THREE.ShaderChunk.equirect_vert="varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",THREE.ShaderChunk.linedashed_frag="uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",THREE.ShaderChunk.linedashed_vert="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",THREE.ShaderChunk.meshbasic_frag="uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight;\n\treflectedLight.directDiffuse = vec3( 0.0 );\n\treflectedLight.directSpecular = vec3( 0.0 );\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\n\treflectedLight.indirectSpecular = vec3( 0.0 );\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",THREE.ShaderChunk.meshbasic_vert="#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n}\n",THREE.ShaderChunk.meshlambert_frag="uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",THREE.ShaderChunk.meshlambert_vert="#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n}\n",THREE.ShaderChunk.meshphong_frag="#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",THREE.ShaderChunk.meshphong_vert="#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n}\n",THREE.ShaderChunk.meshphysical_frag="#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",THREE.ShaderChunk.meshphysical_vert="#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",THREE.ShaderChunk.normal_frag="uniform float opacity;\nvarying vec3 vNormal;\n#include <common>\n#include <packing>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tgl_FragColor = vec4( packNormalToRGB( vNormal ), opacity );\n\t#include <logdepthbuf_fragment>\n}\n",THREE.ShaderChunk.normal_vert="varying vec3 vNormal;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvNormal = normalize( normalMatrix * normal );\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",THREE.ShaderChunk.points_frag="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",THREE.ShaderChunk.points_vert="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",THREE.ShaderLib={basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.aomap,THREE.UniformsLib.fog]),vertexShader:THREE.ShaderChunk.meshbasic_vert,fragmentShader:THREE.ShaderChunk.meshbasic_frag},lambert:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.aomap,THREE.UniformsLib.lightmap,THREE.UniformsLib.emissivemap,THREE.UniformsLib.fog,THREE.UniformsLib.lights,{emissive:{type:"c",value:new THREE.Color(0)}}]),vertexShader:THREE.ShaderChunk.meshlambert_vert,fragmentShader:THREE.ShaderChunk.meshlambert_frag},phong:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.aomap,THREE.UniformsLib.lightmap,THREE.UniformsLib.emissivemap,THREE.UniformsLib.bumpmap,THREE.UniformsLib.normalmap,THREE.UniformsLib.displacementmap,THREE.UniformsLib.fog,THREE.UniformsLib.lights,{emissive:{type:"c",value:new THREE.Color(0)},specular:{type:"c",value:new THREE.Color(1118481)},shininess:{type:"1f",value:30}}]),vertexShader:THREE.ShaderChunk.meshphong_vert,fragmentShader:THREE.ShaderChunk.meshphong_frag},standard:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.aomap,THREE.UniformsLib.lightmap,THREE.UniformsLib.emissivemap,THREE.UniformsLib.bumpmap,THREE.UniformsLib.normalmap,THREE.UniformsLib.displacementmap,THREE.UniformsLib.roughnessmap,THREE.UniformsLib.metalnessmap,THREE.UniformsLib.fog,THREE.UniformsLib.lights,{emissive:{type:"c",value:new THREE.Color(0)},roughness:{type:"1f",value:.5},metalness:{type:"1f",value:0},envMapIntensity:{type:"1f",value:1}}]),vertexShader:THREE.ShaderChunk.meshphysical_vert,fragmentShader:THREE.ShaderChunk.meshphysical_frag},points:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.points,THREE.UniformsLib.fog]),vertexShader:THREE.ShaderChunk.points_vert,fragmentShader:THREE.ShaderChunk.points_frag},dashed:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,{scale:{type:"1f",value:1},dashSize:{type:"1f",value:1},totalSize:{type:"1f",value:2}}]),vertexShader:THREE.ShaderChunk.linedashed_vert,fragmentShader:THREE.ShaderChunk.linedashed_frag},depth:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.displacementmap]),vertexShader:THREE.ShaderChunk.depth_vert,fragmentShader:THREE.ShaderChunk.depth_frag},normal:{uniforms:{opacity:{type:"1f",value:1}},vertexShader:THREE.ShaderChunk.normal_vert,fragmentShader:THREE.ShaderChunk.normal_frag},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"1f",value:-1
}},vertexShader:THREE.ShaderChunk.cube_vert,fragmentShader:THREE.ShaderChunk.cube_frag},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"1f",value:-1}},vertexShader:THREE.ShaderChunk.equirect_vert,fragmentShader:THREE.ShaderChunk.equirect_frag},distanceRGBA:{uniforms:{lightPos:{type:"v3",value:new THREE.Vector3}},vertexShader:THREE.ShaderChunk.distanceRGBA_vert,fragmentShader:THREE.ShaderChunk.distanceRGBA_frag}},THREE.ShaderLib.physical={uniforms:THREE.UniformsUtils.merge([THREE.ShaderLib.standard.uniforms,{}]),vertexShader:THREE.ShaderChunk.meshphysical_vert,fragmentShader:THREE.ShaderChunk.meshphysical_frag},THREE.WebGLRenderer=function(t){function e(){return null===xt?Ut:1}function r(t,e,r,i){ut===!0&&(t*=i,e*=i,r*=i),se.clearColor(t,e,r,i)}function i(){se.init(),se.scissor(St.copy(Ft).multiplyScalar(Ut)),se.viewport(At.copy(Ot).multiplyScalar(Ut)),r(Pt.r,Pt.g,Pt.b,Bt)}function n(){Ht=null,wt=null,Mt="",_t=-1,se.reset()}function a(t){t.preventDefault(),n(),i(),ce.clear()}function o(t){var e=t.target;e.removeEventListener("dispose",o),h(e),te.textures--}function s(t){var e=t.target;e.removeEventListener("dispose",s),l(e),te.textures--}function c(t){var e=t.target;e.removeEventListener("dispose",c),u(e)}function h(t){var e=ce.get(t);if(t.image&&e.__image__webglTextureCube)re.deleteTexture(e.__image__webglTextureCube);else{if(void 0===e.__webglInit)return;re.deleteTexture(e.__webglTexture)}ce.delete(t)}function l(t){var e=ce.get(t),r=ce.get(t.texture);if(t){if(void 0!==r.__webglTexture&&re.deleteTexture(r.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t instanceof THREE.WebGLRenderTargetCube)for(var i=0;i<6;i++)re.deleteFramebuffer(e.__webglFramebuffer[i]),e.__webglDepthbuffer&&re.deleteRenderbuffer(e.__webglDepthbuffer[i]);else re.deleteFramebuffer(e.__webglFramebuffer),e.__webglDepthbuffer&&re.deleteRenderbuffer(e.__webglDepthbuffer);ce.delete(t.texture),ce.delete(t)}}function u(t){p(t),ce.delete(t)}function p(t){var e=ce.get(t).program;t.program=void 0,void 0!==e&&le.releaseProgram(e)}function d(t,e,r,i){var n;if(r instanceof THREE.InstancedBufferGeometry&&(n=ae.get("ANGLE_instanced_arrays"),null===n))return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");void 0===i&&(i=0),se.initAttributes();var a=r.attributes,o=e.getAttributes(),s=t.defaultAttributeValues;for(var c in o){var h=o[c];if(h>=0){var l=a[c];if(void 0!==l){var u=re.FLOAT,p=l.array,d=l.normalized;p instanceof Float32Array?u=re.FLOAT:p instanceof Float64Array?console.warn("Unsupported data buffer format: Float64Array"):p instanceof Uint16Array?u=re.UNSIGNED_SHORT:p instanceof Int16Array?u=re.SHORT:p instanceof Uint32Array?u=re.UNSIGNED_INT:p instanceof Int32Array?u=re.INT:p instanceof Int8Array?u=re.BYTE:p instanceof Uint8Array&&(u=re.UNSIGNED_BYTE);var E=l.itemSize,f=he.getAttributeBuffer(l);if(l instanceof THREE.InterleavedBufferAttribute){var m=l.data,g=m.stride,v=l.offset;m instanceof THREE.InstancedInterleavedBuffer?(se.enableAttributeAndDivisor(h,m.meshPerAttribute,n),void 0===r.maxInstancedCount&&(r.maxInstancedCount=m.meshPerAttribute*m.count)):se.enableAttribute(h),re.bindBuffer(re.ARRAY_BUFFER,f),re.vertexAttribPointer(h,E,u,d,g*m.array.BYTES_PER_ELEMENT,(i*g+v)*m.array.BYTES_PER_ELEMENT)}else l instanceof THREE.InstancedBufferAttribute?(se.enableAttributeAndDivisor(h,l.meshPerAttribute,n),void 0===r.maxInstancedCount&&(r.maxInstancedCount=l.meshPerAttribute*l.count)):se.enableAttribute(h),re.bindBuffer(re.ARRAY_BUFFER,f),re.vertexAttribPointer(h,E,u,d,0,i*E*l.array.BYTES_PER_ELEMENT)}else if(void 0!==s){var T=s[c];if(void 0!==T)switch(T.length){case 2:re.vertexAttrib2fv(h,T);break;case 3:re.vertexAttrib3fv(h,T);break;case 4:re.vertexAttrib4fv(h,T);break;default:re.vertexAttrib1fv(h,T)}}}}se.disableUnusedAttributes()}function E(t,e){return Math.abs(e[0])-Math.abs(t[0])}function f(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 m(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 g(t,e,r,i,n){var a,o;r.transparent?(a=mt,o=++gt):(a=Et,o=++ft);var s=a[o];void 0!==s?(s.id=t.id,s.object=t,s.geometry=e,s.material=r,s.z=Jt.z,s.group=n):(s={id:t.id,object:t,geometry:e,material:r,z:Jt.z,group:n},a.push(s))}function v(t){var e=t.geometry;null===e.boundingSphere&&e.computeBoundingSphere();var r=Zt.copy(e.boundingSphere).applyMatrix4(t.matrixWorld);if(!Vt.intersectsSphere(r))return!1;if(0===jt)return!0;var i=Rt.clippingPlanes,n=r.center,a=-r.radius,o=0;do if(i[o].distanceToPoint(n)<a)return!1;while(++o!==jt);return!0}function T(t,e){if(t.visible!==!1){if(t.layers.test(e.layers))if(t instanceof THREE.Light)dt.push(t);else if(t instanceof THREE.Sprite)t.frustumCulled!==!1&&v(t)!==!0||Tt.push(t);else if(t instanceof THREE.LensFlare)yt.push(t);else if(t instanceof THREE.ImmediateRenderObject)Rt.sortObjects===!0&&(Jt.setFromMatrixPosition(t.matrixWorld),Jt.applyProjection(Qt)),g(t,null,t.material,Jt.z,null);else if((t instanceof THREE.Mesh||t instanceof THREE.Line||t instanceof THREE.Points)&&(t instanceof THREE.SkinnedMesh&&t.skeleton.update(),t.frustumCulled===!1||v(t)===!0)){var r=t.material;if(r.visible===!0){Rt.sortObjects===!0&&(Jt.setFromMatrixPosition(t.matrixWorld),Jt.applyProjection(Qt));var i=he.update(t);if(r instanceof THREE.MultiMaterial)for(var n=i.groups,a=r.materials,o=0,s=n.length;o<s;o++){var c=n[o],h=a[c.materialIndex];h.visible===!0&&g(t,i,h,Jt.z,c)}else g(t,i,r,Jt.z,null)}}for(var l=t.children,o=0,s=l.length;o<s;o++)T(l[o],e)}}function y(t,e,r,i){for(var n=0,a=t.length;n<a;n++){var o=t[n],s=o.object,c=o.geometry,h=void 0===i?o.material:i,l=o.group;if(s.modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,s.matrixWorld),s.normalMatrix.getNormalMatrix(s.modelViewMatrix),s instanceof THREE.ImmediateRenderObject){H(h);var u=b(e,r,h,s);Mt="",s.render(function(t){Rt.renderBufferImmediate(t,u,h)})}else Rt.renderBufferDirect(e,r,c,h,s,l)}}function R(t,e,r){var i=ce.get(t),n=le.getParameters(t,$t,e,jt,r),a=le.getProgramCode(t,n),o=i.program,s=!0;if(void 0===o)t.addEventListener("dispose",c);else if(o.code!==a)p(t);else{if(void 0!==n.shaderID)return;s=!1}if(s){if(n.shaderID){var h=THREE.ShaderLib[n.shaderID];i.__webglShader={name:t.type,uniforms:THREE.UniformsUtils.clone(h.uniforms),vertexShader:h.vertexShader,fragmentShader:h.fragmentShader}}else i.__webglShader={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};t.__webglShader=i.__webglShader,o=le.acquireProgram(t,n,a),i.program=o,t.program=o}var l=o.getAttributes();if(t.morphTargets){t.numSupportedMorphTargets=0;for(var u=0;u<Rt.maxMorphTargets;u++)l["morphTarget"+u]>=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(var u=0;u<Rt.maxMorphNormals;u++)l["morphNormal"+u]>=0&&t.numSupportedMorphNormals++}var d=i.__webglShader.uniforms;(t instanceof THREE.ShaderMaterial||t instanceof THREE.RawShaderMaterial)&&t.clipping!==!0||(i.numClippingPlanes=jt,d.clippingPlanes=Wt),(t instanceof THREE.MeshPhongMaterial||t instanceof THREE.MeshLambertMaterial||t instanceof THREE.MeshStandardMaterial||t.lights)&&(i.lightsHash=$t.hash,d.ambientLightColor.value=$t.ambient,d.directionalLights.value=$t.directional,d.spotLights.value=$t.spot,d.pointLights.value=$t.point,d.hemisphereLights.value=$t.hemi,d.directionalShadowMap.value=$t.directionalShadowMap,d.directionalShadowMatrix.value=$t.directionalShadowMatrix,d.spotShadowMap.value=$t.spotShadowMap,d.spotShadowMatrix.value=$t.spotShadowMatrix,d.pointShadowMap.value=$t.pointShadowMap,d.pointShadowMatrix.value=$t.pointShadowMatrix);var E=i.program.getUniforms(),f=THREE.WebGLUniforms.seqWithValue(E.seq,d);i.uniformsList=f,i.dynamicUniforms=THREE.WebGLUniforms.splitDynamic(f,d)}function H(t){x(t),t.transparent===!0?se.setBlending(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha):se.setBlending(THREE.NoBlending),se.setDepthFunc(t.depthFunc),se.setDepthTest(t.depthTest),se.setDepthWrite(t.depthWrite),se.setColorWrite(t.colorWrite),se.setPolygonOffset(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)}function x(t){t.side!==THREE.DoubleSide?se.enable(re.CULL_FACE):se.disable(re.CULL_FACE),se.setFlipSided(t.side===THREE.BackSide)}function b(t,e,r,i){Ct=0;var n=ce.get(r);if(Gt){if(zt||t!==wt){var a=t===wt&&r.id===_t;V(r.clippingPlanes,r.clipShadows,t,n,a)}void 0!==n.numClippingPlanes&&n.numClippingPlanes!==jt&&(r.needsUpdate=!0)}void 0===n.program&&(r.needsUpdate=!0),void 0!==n.lightsHash&&n.lightsHash!==$t.hash&&(r.needsUpdate=!0),r.needsUpdate&&(R(r,e,i),r.needsUpdate=!1);var o=!1,s=!1,c=!1,h=n.program,l=h.getUniforms(),u=n.__webglShader.uniforms;if(h.id!==Ht&&(re.useProgram(h.program),Ht=h.id,o=!0,s=!0,c=!0),r.id!==_t&&(_t=r.id,s=!0),o||t!==wt){if(l.set(re,t,"projectionMatrix"),oe.logarithmicDepthBuffer&&l.setValue(re,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),t!==wt&&(wt=t,s=!0,c=!0),r instanceof THREE.ShaderMaterial||r instanceof THREE.MeshPhongMaterial||r instanceof THREE.MeshStandardMaterial||r.envMap){var p=l.map.cameraPosition;void 0!==p&&p.setValue(re,Jt.setFromMatrixPosition(t.matrixWorld))}(r instanceof THREE.MeshPhongMaterial||r instanceof THREE.MeshLambertMaterial||r instanceof THREE.MeshBasicMaterial||r instanceof THREE.MeshStandardMaterial||r instanceof THREE.ShaderMaterial||r.skinning)&&l.setValue(re,"viewMatrix",t.matrixWorldInverse),l.set(re,Rt,"toneMappingExposure"),l.set(re,Rt,"toneMappingWhitePoint")}if(r.skinning){l.setOptional(re,i,"bindMatrix"),l.setOptional(re,i,"bindMatrixInverse");var d=i.skeleton;d&&(oe.floatVertexTextures&&d.useVertexTexture?(l.set(re,d,"boneTexture"),l.set(re,d,"boneTextureWidth"),l.set(re,d,"boneTextureHeight")):l.setOptional(re,d,"boneMatrices"))}s&&((r instanceof THREE.MeshPhongMaterial||r instanceof THREE.MeshLambertMaterial||r instanceof THREE.MeshStandardMaterial||r.lights)&&D(u,c),e&&r.fog&&L(u,e),(r instanceof THREE.MeshBasicMaterial||r instanceof THREE.MeshLambertMaterial||r instanceof THREE.MeshPhongMaterial||r instanceof THREE.MeshStandardMaterial||r instanceof THREE.MeshDepthMaterial)&&_(u,r),r instanceof THREE.LineBasicMaterial?M(u,r):r instanceof THREE.LineDashedMaterial?(M(u,r),w(u,r)):r instanceof THREE.PointsMaterial?S(u,r):r instanceof THREE.MeshLambertMaterial?A(u,r):r instanceof THREE.MeshPhongMaterial?C(u,r):r instanceof THREE.MeshPhysicalMaterial?B(u,r):r instanceof THREE.MeshStandardMaterial?P(u,r):r instanceof THREE.MeshDepthMaterial?r.displacementMap&&(u.displacementMap.value=r.displacementMap,u.displacementScale.value=r.displacementScale,u.displacementBias.value=r.displacementBias):r instanceof THREE.MeshNormalMaterial&&(u.opacity.value=r.opacity),THREE.WebGLUniforms.upload(re,n.uniformsList,u,Rt)),l.set(re,i,"modelViewMatrix"),l.set(re,i,"normalMatrix"),l.setValue(re,"modelMatrix",i.matrixWorld);var E=n.dynamicUniforms;return null!==E&&(THREE.WebGLUniforms.evalDynamic(E,u,i,t),THREE.WebGLUniforms.upload(re,E,u,Rt)),h}function _(t,e){t.opacity.value=e.opacity,t.diffuse.value=e.color,e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),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.roughnessMap?r=e.roughnessMap:e.metalnessMap?r=e.metalnessMap:e.alphaMap?r=e.alphaMap:e.emissiveMap&&(r=e.emissiveMap),void 0!==r){r instanceof THREE.WebGLRenderTarget&&(r=r.texture);var i=r.offset,n=r.repeat;t.offsetRepeat.value.set(i.x,i.y,n.x,n.y)}t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap instanceof THREE.WebGLRenderTargetCube?1:-1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio}function M(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity}function w(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}function S(t,e){if(t.diffuse.value=e.color,t.opacity.value=e.opacity,t.size.value=e.size*Ut,t.scale.value=.5*at.clientHeight,t.map.value=e.map,null!==e.map){var r=e.map.offset,i=e.map.repeat;t.offsetRepeat.value.set(r.x,r.y,i.x,i.y)}}function L(t,e){t.fogColor.value=e.color,e instanceof THREE.Fog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e instanceof THREE.FogExp2&&(t.fogDensity.value=e.density)}function A(t,e){e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}function C(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 P(t,e){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),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),e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}function B(t,e){P(t,e)}function D(t,e){t.ambientLightColor.needsUpdate=e,t.directionalLights.needsUpdate=e,t.pointLights.needsUpdate=e,t.spotLights.needsUpdate=e,t.hemisphereLights.needsUpdate=e}function I(t){for(var e=0,r=0,i=t.length;r<i;r++){var n=t[r];n.castShadow&&($t.shadows[e++]=n)}$t.shadows.length=e}function U(t,e){var r,i,n,a,o,s,c=0,h=0,l=0,u=e.matrixWorldInverse,p=0,d=0,E=0,f=0;for(r=0,i=t.length;r<i;r++)if(n=t[r],a=n.color,o=n.intensity,s=n.distance,n instanceof THREE.AmbientLight)c+=a.r*o,h+=a.g*o,l+=a.b*o;else if(n instanceof THREE.DirectionalLight){var m=ue.get(n);m.color.copy(n.color).multiplyScalar(n.intensity),m.direction.setFromMatrixPosition(n.matrixWorld),Jt.setFromMatrixPosition(n.target.matrixWorld),m.direction.sub(Jt),m.direction.transformDirection(u),m.shadow=n.castShadow,n.castShadow&&(m.shadowBias=n.shadow.bias,m.shadowRadius=n.shadow.radius,m.shadowMapSize=n.shadow.mapSize),$t.directionalShadowMap[p]=n.shadow.map,$t.directionalShadowMatrix[p]=n.shadow.matrix,$t.directional[p++]=m}else if(n instanceof THREE.SpotLight){var m=ue.get(n);m.position.setFromMatrixPosition(n.matrixWorld),m.position.applyMatrix4(u),m.color.copy(a).multiplyScalar(o),m.distance=s,m.direction.setFromMatrixPosition(n.matrixWorld),Jt.setFromMatrixPosition(n.target.matrixWorld),m.direction.sub(Jt),m.direction.transformDirection(u),m.coneCos=Math.cos(n.angle),m.penumbraCos=Math.cos(n.angle*(1-n.penumbra)),m.decay=0===n.distance?0:n.decay,m.shadow=n.castShadow,n.castShadow&&(m.shadowBias=n.shadow.bias,m.shadowRadius=n.shadow.radius,m.shadowMapSize=n.shadow.mapSize),$t.spotShadowMap[E]=n.shadow.map,$t.spotShadowMatrix[E]=n.shadow.matrix,$t.spot[E++]=m}else if(n instanceof THREE.PointLight){var m=ue.get(n);m.position.setFromMatrixPosition(n.matrixWorld),m.position.applyMatrix4(u),m.color.copy(n.color).multiplyScalar(n.intensity),m.distance=n.distance,m.decay=0===n.distance?0:n.decay,m.shadow=n.castShadow,n.castShadow&&(m.shadowBias=n.shadow.bias,m.shadowRadius=n.shadow.radius,m.shadowMapSize=n.shadow.mapSize),$t.pointShadowMap[d]=n.shadow.map,void 0===$t.pointShadowMatrix[d]&&($t.pointShadowMatrix[d]=new THREE.Matrix4),Jt.setFromMatrixPosition(n.matrixWorld).negate(),$t.pointShadowMatrix[d].identity().setPosition(Jt),$t.point[d++]=m}else if(n instanceof THREE.HemisphereLight){var m=ue.get(n);m.direction.setFromMatrixPosition(n.matrixWorld),m.direction.transformDirection(u),m.direction.normalize(),m.skyColor.copy(n.color).multiplyScalar(o),m.groundColor.copy(n.groundColor).multiplyScalar(o),$t.hemi[f++]=m}$t.ambient[0]=c,$t.ambient[1]=h,$t.ambient[2]=l,$t.directional.length=p,$t.spot.length=E,$t.point.length=d,$t.hemi.length=f,$t.hash=p+","+d+","+E+","+f+","+$t.shadows.length}function F(t,e){Gt=0!==Rt.clippingPlanes.length||Rt.localClippingEnabled||0!==qt||zt,zt=Rt.localClippingEnabled,Xt=N(t,e,0),qt=null!==t?t.length:0}function N(t,e,r,i){var n=null!==t?t.length:0,a=null;if(0!==n){if(a=Wt.value,i!==!0||null===a){var o=r+4*n,s=e.matrixWorldInverse,c=Yt.getNormalMatrix(s);(null===a||a.length<o)&&(a=new Float32Array(o));for(var h=0,l=r;h!==n;++h,l+=4){var u=Kt.copy(t[h]).applyMatrix4(s,c);u.normal.toArray(a,l),a[l+3]=u.constant}}Wt.value=a,Wt.needsUpdate=!0}return jt=n,a}function O(){Wt.value!==Xt&&(Wt.value=Xt,Wt.needsUpdate=qt>0),jt=qt}function V(t,e,r,i,n){if(!zt||null===t||0===t.length||kt&&!e)kt?N(null):O();else{var a=kt?0:qt,o=4*a,s=i.clippingState||null;Wt.value=s,s=N(t,r,o,n);for(var c=0;c!==o;++c)s[c]=Xt[c];i.clippingState=s,jt+=a}}function G(){var t=Ct;return t>=oe.maxTextures&&console.warn("WebGLRenderer: trying to use "+t+" texture units while this GPU supports only "+oe.maxTextures),Ct+=1,t}function z(t,e,r){var i;if(r?(re.texParameteri(t,re.TEXTURE_WRAP_S,nt(e.wrapS)),re.texParameteri(t,re.TEXTURE_WRAP_T,nt(e.wrapT)),re.texParameteri(t,re.TEXTURE_MAG_FILTER,nt(e.magFilter)),re.texParameteri(t,re.TEXTURE_MIN_FILTER,nt(e.minFilter))):(re.texParameteri(t,re.TEXTURE_WRAP_S,re.CLAMP_TO_EDGE),re.texParameteri(t,re.TEXTURE_WRAP_T,re.CLAMP_TO_EDGE),e.wrapS===THREE.ClampToEdgeWrapping&&e.wrapT===THREE.ClampToEdgeWrapping||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",e),re.texParameteri(t,re.TEXTURE_MAG_FILTER,it(e.magFilter)),re.texParameteri(t,re.TEXTURE_MIN_FILTER,it(e.minFilter)),e.minFilter!==THREE.NearestFilter&&e.minFilter!==THREE.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",e)),i=ae.get("EXT_texture_filter_anisotropic")){if(e.type===THREE.FloatType&&null===ae.get("OES_texture_float_linear"))return;if(e.type===THREE.HalfFloatType&&null===ae.get("OES_texture_half_float_linear"))return;(e.anisotropy>1||ce.get(e).__currentAnisotropy)&&(re.texParameterf(t,i.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(e.anisotropy,Rt.getMaxAnisotropy())),ce.get(e).__currentAnisotropy=e.anisotropy)}}function k(t,e,r){void 0===t.__webglInit&&(t.__webglInit=!0,e.addEventListener("dispose",o),t.__webglTexture=re.createTexture(),te.textures++),se.activeTexture(re.TEXTURE0+r),se.bindTexture(re.TEXTURE_2D,t.__webglTexture),re.pixelStorei(re.UNPACK_FLIP_Y_WEBGL,e.flipY),re.pixelStorei(re.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),re.pixelStorei(re.UNPACK_ALIGNMENT,e.unpackAlignment);var i=W(e.image,oe.maxTextureSize);q(e)&&X(i)===!1&&(i=Y(i));var n=X(i),a=nt(e.format),s=nt(e.type);z(re.TEXTURE_2D,e,n);var c,h=e.mipmaps;if(e instanceof THREE.DepthTexture){var l=re.DEPTH_COMPONENT;if(e.type===THREE.FloatType){if(!ne)throw new Error("Float Depth Texture only supported in WebGL2.0");l=re.DEPTH_COMPONENT32F}else ne&&(l=re.DEPTH_COMPONENT16);se.texImage2D(re.TEXTURE_2D,0,l,i.width,i.height,0,a,s,null)}else if(e instanceof THREE.DataTexture)if(h.length>0&&n){for(var u=0,p=h.length;u<p;u++)c=h[u],se.texImage2D(re.TEXTURE_2D,u,a,c.width,c.height,0,a,s,c.data);e.generateMipmaps=!1}else se.texImage2D(re.TEXTURE_2D,0,a,i.width,i.height,0,a,s,i.data);else if(e instanceof THREE.CompressedTexture)for(var u=0,p=h.length;u<p;u++)c=h[u],e.format!==THREE.RGBAFormat&&e.format!==THREE.RGBFormat?se.getCompressedTextureFormats().indexOf(a)>-1?se.compressedTexImage2D(re.TEXTURE_2D,u,a,c.width,c.height,0,c.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):se.texImage2D(re.TEXTURE_2D,u,a,c.width,c.height,0,a,s,c.data);else if(h.length>0&&n){for(var u=0,p=h.length;u<p;u++)c=h[u],se.texImage2D(re.TEXTURE_2D,u,a,a,s,c);e.generateMipmaps=!1}else se.texImage2D(re.TEXTURE_2D,0,a,a,s,i);e.generateMipmaps&&n&&re.generateMipmap(re.TEXTURE_2D),t.__version=e.version,e.onUpdate&&e.onUpdate(e)}function j(t,e){t instanceof THREE.WebGLRenderTarget&&(t=t.texture);var r=ce.get(t);if(t.version>0&&r.__version!==t.version){var i=t.image;return void 0===i?void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",t):i.complete===!1?void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",t):void k(r,t,e)}se.activeTexture(re.TEXTURE0+e),se.bindTexture(re.TEXTURE_2D,r.__webglTexture)}function W(t,e){if(t.width>e||t.height>e){var r=e/Math.max(t.width,t.height),i=document.createElement("canvas");i.width=Math.floor(t.width*r),i.height=Math.floor(t.height*r);var n=i.getContext("2d");return n.drawImage(t,0,0,t.width,t.height,0,0,i.width,i.height),console.warn("THREE.WebGLRenderer: image is too big ("+t.width+"x"+t.height+"). Resized to "+i.width+"x"+i.height,t),i}return t}function X(t){return THREE.Math.isPowerOfTwo(t.width)&&THREE.Math.isPowerOfTwo(t.height)}function q(t){return t.wrapS!==THREE.ClampToEdgeWrapping||t.wrapT!==THREE.ClampToEdgeWrapping||t.minFilter!==THREE.NearestFilter&&t.minFilter!==THREE.LinearFilter}function Y(t){if(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement){var e=document.createElement("canvas");e.width=THREE.Math.nearestPowerOfTwo(t.width),e.height=THREE.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=ce.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=re.createTexture(),te.textures++),se.activeTexture(re.TEXTURE0+e),se.bindTexture(re.TEXTURE_CUBE_MAP,r.__image__webglTextureCube),re.pixelStorei(re.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var i=t instanceof THREE.CompressedTexture,n=t.image[0]instanceof THREE.DataTexture,a=[],s=0;s<6;s++)!Rt.autoScaleCubemaps||i||n?a[s]=n?t.image[s].image:t.image[s]:a[s]=W(t.image[s],oe.maxCubemapSize);var c=a[0],h=X(c),l=nt(t.format),u=nt(t.type);z(re.TEXTURE_CUBE_MAP,t,h);for(var s=0;s<6;s++)if(i)for(var p,d=a[s].mipmaps,E=0,f=d.length;E<f;E++)p=d[E],t.format!==THREE.RGBAFormat&&t.format!==THREE.RGBFormat?se.getCompressedTextureFormats().indexOf(l)>-1?se.compressedTexImage2D(re.TEXTURE_CUBE_MAP_POSITIVE_X+s,E,l,p.width,p.height,0,p.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):se.texImage2D(re.TEXTURE_CUBE_MAP_POSITIVE_X+s,E,l,p.width,p.height,0,l,u,p.data);else n?se.texImage2D(re.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,l,a[s].width,a[s].height,0,l,u,a[s].data):se.texImage2D(re.TEXTURE_CUBE_MAP_POSITIVE_X+s,0,l,l,u,a[s]);t.generateMipmaps&&h&&re.generateMipmap(re.TEXTURE_CUBE_MAP),r.__version=t.version,t.onUpdate&&t.onUpdate(t)}else se.activeTexture(re.TEXTURE0+e),se.bindTexture(re.TEXTURE_CUBE_MAP,r.__image__webglTextureCube)}function K(t,e){se.activeTexture(re.TEXTURE0+e),se.bindTexture(re.TEXTURE_CUBE_MAP,ce.get(t).__webglTexture)}function Q(t,e,r,i){var n=nt(e.texture.format),a=nt(e.texture.type);se.texImage2D(i,0,n,e.width,e.height,0,n,a,null),re.bindFramebuffer(re.FRAMEBUFFER,t),re.framebufferTexture2D(re.FRAMEBUFFER,r,i,ce.get(e.texture).__webglTexture,0),re.bindFramebuffer(re.FRAMEBUFFER,null)}function J(t,e){re.bindRenderbuffer(re.RENDERBUFFER,t),e.depthBuffer&&!e.stencilBuffer?(re.renderbufferStorage(re.RENDERBUFFER,re.DEPTH_COMPONENT16,e.width,e.height),re.framebufferRenderbuffer(re.FRAMEBUFFER,re.DEPTH_ATTACHMENT,re.RENDERBUFFER,t)):e.depthBuffer&&e.stencilBuffer?(re.renderbufferStorage(re.RENDERBUFFER,re.DEPTH_STENCIL,e.width,e.height),re.framebufferRenderbuffer(re.FRAMEBUFFER,re.DEPTH_STENCIL_ATTACHMENT,re.RENDERBUFFER,t)):re.renderbufferStorage(re.RENDERBUFFER,re.RGBA4,e.width,e.height),re.bindRenderbuffer(re.RENDERBUFFER,null)}function $(t,e){var r=e instanceof THREE.WebGLRenderTargetCube;if(r)throw new Error("Depth Texture with cube render targets is not supported!");if(re.bindFramebuffer(re.FRAMEBUFFER,t),!(e.depthTexture instanceof THREE.DepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");ce.get(e.depthTexture).__webglTexture&&e.depthTexture.image.width===e.width&&e.depthTexture.image.height===e.height||(e.depthTexture.image.width=e.width,e.depthTexture.image.height=e.height,e.depthTexture.needsUpdate=!0),Rt.setTexture(e.depthTexture,0);var i=ce.get(e.depthTexture).__webglTexture;re.framebufferTexture2D(re.FRAMEBUFFER,re.DEPTH_ATTACHMENT,re.TEXTURE_2D,i,0)}function tt(t){var e=ce.get(t),r=t instanceof THREE.WebGLRenderTargetCube;if(t.depthTexture){if(r)throw new Error("target.depthTexture not supported in Cube render targets");$(e.__webglFramebuffer,t)}else if(r){e.__webglDepthbuffer=[];for(var i=0;i<6;i++)re.bindFramebuffer(re.FRAMEBUFFER,e.__webglFramebuffer[i]),e.__webglDepthbuffer[i]=re.createRenderbuffer(),J(e.__webglDepthbuffer[i],t)}else re.bindFramebuffer(re.FRAMEBUFFER,e.__webglFramebuffer),e.__webglDepthbuffer=re.createRenderbuffer(),J(e.__webglDepthbuffer,t);re.bindFramebuffer(re.FRAMEBUFFER,null)}function et(t){var e=ce.get(t),r=ce.get(t.texture);t.addEventListener("dispose",s),r.__webglTexture=re.createTexture(),te.textures++;var i=t instanceof THREE.WebGLRenderTargetCube,n=THREE.Math.isPowerOfTwo(t.width)&&THREE.Math.isPowerOfTwo(t.height);if(i){e.__webglFramebuffer=[];for(var a=0;a<6;a++)e.__webglFramebuffer[a]=re.createFramebuffer()}else e.__webglFramebuffer=re.createFramebuffer();if(i){se.bindTexture(re.TEXTURE_CUBE_MAP,r.__webglTexture),z(re.TEXTURE_CUBE_MAP,t.texture,n);for(var a=0;a<6;a++)Q(e.__webglFramebuffer[a],t,re.COLOR_ATTACHMENT0,re.TEXTURE_CUBE_MAP_POSITIVE_X+a);t.texture.generateMipmaps&&n&&re.generateMipmap(re.TEXTURE_CUBE_MAP),se.bindTexture(re.TEXTURE_CUBE_MAP,null)}else se.bindTexture(re.TEXTURE_2D,r.__webglTexture),z(re.TEXTURE_2D,t.texture,n),Q(e.__webglFramebuffer,t,re.COLOR_ATTACHMENT0,re.TEXTURE_2D),t.texture.generateMipmaps&&n&&re.generateMipmap(re.TEXTURE_2D),se.bindTexture(re.TEXTURE_2D,null);t.depthBuffer&&tt(t)}function rt(t){var e=t instanceof THREE.WebGLRenderTargetCube?re.TEXTURE_CUBE_MAP:re.TEXTURE_2D,r=ce.get(t.texture).__webglTexture;se.bindTexture(e,r),re.generateMipmap(e),se.bindTexture(e,null)}function it(t){return t===THREE.NearestFilter||t===THREE.NearestMipMapNearestFilter||t===THREE.NearestMipMapLinearFilter?re.NEAREST:re.LINEAR}function nt(t){var e;if(t===THREE.RepeatWrapping)return re.REPEAT;if(t===THREE.ClampToEdgeWrapping)return re.CLAMP_TO_EDGE;if(t===THREE.MirroredRepeatWrapping)return re.MIRRORED_REPEAT;if(t===THREE.NearestFilter)return re.NEAREST;if(t===THREE.NearestMipMapNearestFilter)return re.NEAREST_MIPMAP_NEAREST;if(t===THREE.NearestMipMapLinearFilter)return re.NEAREST_MIPMAP_LINEAR;if(t===THREE.LinearFilter)return re.LINEAR;if(t===THREE.LinearMipMapNearestFilter)return re.LINEAR_MIPMAP_NEAREST;if(t===THREE.LinearMipMapLinearFilter)return re.LINEAR_MIPMAP_LINEAR;if(t===THREE.UnsignedByteType)return re.UNSIGNED_BYTE;if(t===THREE.UnsignedShort4444Type)return re.UNSIGNED_SHORT_4_4_4_4;if(t===THREE.UnsignedShort5551Type)return re.UNSIGNED_SHORT_5_5_5_1;if(t===THREE.UnsignedShort565Type)return re.UNSIGNED_SHORT_5_6_5;if(t===THREE.ByteType)return re.BYTE;if(t===THREE.ShortType)return re.SHORT;if(t===THREE.UnsignedShortType)return re.UNSIGNED_SHORT;if(t===THREE.IntType)return re.INT;if(t===THREE.UnsignedIntType)return re.UNSIGNED_INT;if(t===THREE.FloatType)return re.FLOAT;if(e=ae.get("OES_texture_half_float"),null!==e&&t===THREE.HalfFloatType)return e.HALF_FLOAT_OES;if(t===THREE.AlphaFormat)return re.ALPHA;if(t===THREE.RGBFormat)return re.RGB;if(t===THREE.RGBAFormat)return re.RGBA;if(t===THREE.LuminanceFormat)return re.LUMINANCE;if(t===THREE.LuminanceAlphaFormat)return re.LUMINANCE_ALPHA;if(t===THREE.DepthFormat)return re.DEPTH_COMPONENT;if(t===THREE.AddEquation)return re.FUNC_ADD;if(t===THREE.SubtractEquation)return re.FUNC_SUBTRACT;if(t===THREE.ReverseSubtractEquation)return re.FUNC_REVERSE_SUBTRACT;if(t===THREE.ZeroFactor)return re.ZERO;if(t===THREE.OneFactor)return re.ONE;if(t===THREE.SrcColorFactor)return re.SRC_COLOR;if(t===THREE.OneMinusSrcColorFactor)return re.ONE_MINUS_SRC_COLOR;if(t===THREE.SrcAlphaFactor)return re.SRC_ALPHA;if(t===THREE.OneMinusSrcAlphaFactor)return re.ONE_MINUS_SRC_ALPHA;if(t===THREE.DstAlphaFactor)return re.DST_ALPHA;if(t===THREE.OneMinusDstAlphaFactor)return re.ONE_MINUS_DST_ALPHA;if(t===THREE.DstColorFactor)return re.DST_COLOR;if(t===THREE.OneMinusDstColorFactor)return re.ONE_MINUS_DST_COLOR;if(t===THREE.SrcAlphaSaturateFactor)return re.SRC_ALPHA_SATURATE;if(e=ae.get("WEBGL_compressed_texture_s3tc"),null!==e){if(t===THREE.RGB_S3TC_DXT1_Format)return e.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===THREE.RGBA_S3TC_DXT1_Format)return e.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===THREE.RGBA_S3TC_DXT3_Format)return e.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===THREE.RGBA_S3TC_DXT5_Format)return e.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e=ae.get("WEBGL_compressed_texture_pvrtc"),null!==e){if(t===THREE.RGB_PVRTC_4BPPV1_Format)return e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===THREE.RGB_PVRTC_2BPPV1_Format)return e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===THREE.RGBA_PVRTC_4BPPV1_Format)return e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===THREE.RGBA_PVRTC_2BPPV1_Format)return e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e=ae.get("WEBGL_compressed_texture_etc1"),null!==e&&t===THREE.RGB_ETC1_Format)return e.COMPRESSED_RGB_ETC1_WEBGL;if(e=ae.get("EXT_blend_minmax"),null!==e){if(t===THREE.MinEquation)return e.MIN_EXT;if(t===THREE.MaxEquation)return e.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION),t=t||{};var at=void 0!==t.canvas?t.canvas:document.createElement("canvas"),ot=void 0!==t.context?t.context:null,st=void 0!==t.alpha&&t.alpha,ct=void 0===t.depth||t.depth,ht=void 0===t.stencil||t.stencil,lt=void 0!==t.antialias&&t.antialias,ut=void 0===t.premultipliedAlpha||t.premultipliedAlpha,pt=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,dt=[],Et=[],ft=-1,mt=[],gt=-1,vt=new Float32Array(8),Tt=[],yt=[];this.domElement=at,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=THREE.LinearToneMapping,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4,this.autoScaleCubemaps=!0;var Rt=this,Ht=null,xt=null,bt=null,_t=-1,Mt="",wt=null,St=new THREE.Vector4,Lt=null,At=new THREE.Vector4,Ct=0,Pt=new THREE.Color(0),Bt=0,Dt=at.width,It=at.height,Ut=1,Ft=new THREE.Vector4(0,0,Dt,It),Nt=!1,Ot=new THREE.Vector4(0,0,Dt,It),Vt=new THREE.Frustum,Gt=!1,zt=!1,kt=!1,jt=0,Wt={type:"4fv",value:null,needsUpdate:!1},Xt=null,qt=0,Yt=new THREE.Matrix3,Zt=new THREE.Sphere,Kt=new THREE.Plane,Qt=new THREE.Matrix4,Jt=new THREE.Vector3,$t={hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],point:[],pointShadowMap:[],
pointShadowMatrix:[],hemi:[],shadows:[]},te={geometries:0,textures:0},ee={calls:0,vertices:0,faces:0,points:0};this.info={render:ee,memory:te,programs:null};var re;try{var ie={alpha:st,depth:ct,stencil:ht,antialias:lt,premultipliedAlpha:ut,preserveDrawingBuffer:pt};if(re=ot||at.getContext("webgl",ie)||at.getContext("experimental-webgl",ie),null===re)throw null!==at.getContext("webgl")?"Error creating WebGL context with your selected attributes.":"Error creating WebGL context.";void 0===re.getShaderPrecisionFormat&&(re.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}}),at.addEventListener("webglcontextlost",a,!1)}catch(t){console.error("THREE.WebGLRenderer: "+t)}var ne="undefined"!=typeof WebGL2RenderingContext&&re instanceof WebGL2RenderingContext,ae=new THREE.WebGLExtensions(re);ae.get("WEBGL_depth_texture"),ae.get("OES_texture_float"),ae.get("OES_texture_float_linear"),ae.get("OES_texture_half_float"),ae.get("OES_texture_half_float_linear"),ae.get("OES_standard_derivatives"),ae.get("ANGLE_instanced_arrays"),ae.get("OES_element_index_uint")&&(THREE.BufferGeometry.MaxIndex=4294967296);var oe=new THREE.WebGLCapabilities(re,ae,t),se=new THREE.WebGLState(re,ae,nt),ce=new THREE.WebGLProperties,he=new THREE.WebGLObjects(re,ce,this.info),le=new THREE.WebGLPrograms(this,oe),ue=new THREE.WebGLLights;this.info.programs=le.programs;var pe=new THREE.WebGLBufferRenderer(re,ae,ee),de=new THREE.WebGLIndexedBufferRenderer(re,ae,ee);i(),this.context=re,this.capabilities=oe,this.extensions=ae,this.properties=ce,this.state=se;var Ee=new THREE.WebGLShadowMap(this,$t,he);this.shadowMap=Ee;var fe=new THREE.SpritePlugin(this,Tt),me=new THREE.LensFlarePlugin(this,yt);this.getContext=function(){return re},this.getContextAttributes=function(){return re.getContextAttributes()},this.forceContextLoss=function(){ae.get("WEBGL_lose_context").loseContext()},this.getMaxAnisotropy=function(){var t;return function(){if(void 0!==t)return t;var e=ae.get("EXT_texture_filter_anisotropic");return t=null!==e?re.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}(),this.getPrecision=function(){return oe.precision},this.getPixelRatio=function(){return Ut},this.setPixelRatio=function(t){void 0!==t&&(Ut=t,this.setSize(Ot.z,Ot.w,!1))},this.getSize=function(){return{width:Dt,height:It}},this.setSize=function(t,e,r){Dt=t,It=e,at.width=t*Ut,at.height=e*Ut,r!==!1&&(at.style.width=t+"px",at.style.height=e+"px"),this.setViewport(0,0,t,e)},this.setViewport=function(t,e,r,i){se.viewport(Ot.set(t,e,r,i))},this.setScissor=function(t,e,r,i){se.scissor(Ft.set(t,e,r,i))},this.setScissorTest=function(t){se.setScissorTest(Nt=t)},this.getClearColor=function(){return Pt},this.setClearColor=function(t,e){Pt.set(t),Bt=void 0!==e?e:1,r(Pt.r,Pt.g,Pt.b,Bt)},this.getClearAlpha=function(){return Bt},this.setClearAlpha=function(t){Bt=t,r(Pt.r,Pt.g,Pt.b,Bt)},this.clear=function(t,e,r){var i=0;(void 0===t||t)&&(i|=re.COLOR_BUFFER_BIT),(void 0===e||e)&&(i|=re.DEPTH_BUFFER_BIT),(void 0===r||r)&&(i|=re.STENCIL_BUFFER_BIT),re.clear(i)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.clearTarget=function(t,e,r,i){this.setRenderTarget(t),this.clear(e,r,i)},this.resetGLState=n,this.dispose=function(){at.removeEventListener("webglcontextlost",a,!1)},this.renderBufferImmediate=function(t,e,r){se.initAttributes();var i=ce.get(t);t.hasPositions&&!i.position&&(i.position=re.createBuffer()),t.hasNormals&&!i.normal&&(i.normal=re.createBuffer()),t.hasUvs&&!i.uv&&(i.uv=re.createBuffer()),t.hasColors&&!i.color&&(i.color=re.createBuffer());var n=e.getAttributes();if(t.hasPositions&&(re.bindBuffer(re.ARRAY_BUFFER,i.position),re.bufferData(re.ARRAY_BUFFER,t.positionArray,re.DYNAMIC_DRAW),se.enableAttribute(n.position),re.vertexAttribPointer(n.position,3,re.FLOAT,!1,0,0)),t.hasNormals){if(re.bindBuffer(re.ARRAY_BUFFER,i.normal),"MeshPhongMaterial"!==r.type&&"MeshStandardMaterial"!==r.type&&"MeshPhysicalMaterial"!==r.type&&r.shading===THREE.FlatShading)for(var a=0,o=3*t.count;a<o;a+=9){var s=t.normalArray,c=(s[a+0]+s[a+3]+s[a+6])/3,h=(s[a+1]+s[a+4]+s[a+7])/3,l=(s[a+2]+s[a+5]+s[a+8])/3;s[a+0]=c,s[a+1]=h,s[a+2]=l,s[a+3]=c,s[a+4]=h,s[a+5]=l,s[a+6]=c,s[a+7]=h,s[a+8]=l}re.bufferData(re.ARRAY_BUFFER,t.normalArray,re.DYNAMIC_DRAW),se.enableAttribute(n.normal),re.vertexAttribPointer(n.normal,3,re.FLOAT,!1,0,0)}t.hasUvs&&r.map&&(re.bindBuffer(re.ARRAY_BUFFER,i.uv),re.bufferData(re.ARRAY_BUFFER,t.uvArray,re.DYNAMIC_DRAW),se.enableAttribute(n.uv),re.vertexAttribPointer(n.uv,2,re.FLOAT,!1,0,0)),t.hasColors&&r.vertexColors!==THREE.NoColors&&(re.bindBuffer(re.ARRAY_BUFFER,i.color),re.bufferData(re.ARRAY_BUFFER,t.colorArray,re.DYNAMIC_DRAW),se.enableAttribute(n.color),re.vertexAttribPointer(n.color,3,re.FLOAT,!1,0,0)),se.disableUnusedAttributes(),re.drawArrays(re.TRIANGLES,0,t.count),t.count=0},this.renderBufferDirect=function(t,r,i,n,a,o){H(n);var s=b(t,r,n,a),c=!1,h=i.id+"_"+s.id+"_"+n.wireframe;h!==Mt&&(Mt=h,c=!0);var l=a.morphTargetInfluences;if(void 0!==l){for(var u=[],p=0,f=l.length;p<f;p++){var m=l[p];u.push([m,p])}u.sort(E),u.length>8&&(u.length=8);for(var g=i.morphAttributes,p=0,f=u.length;p<f;p++){var m=u[p];if(vt[p]=m[0],0!==m[0]){var v=m[1];n.morphTargets===!0&&g.position&&i.addAttribute("morphTarget"+p,g.position[v]),n.morphNormals===!0&&g.normal&&i.addAttribute("morphNormal"+p,g.normal[v])}else n.morphTargets===!0&&i.removeAttribute("morphTarget"+p),n.morphNormals===!0&&i.removeAttribute("morphNormal"+p)}s.getUniforms().setValue(re,"morphTargetInfluences",vt),c=!0}var v=i.index,T=i.attributes.position;n.wireframe===!0&&(v=he.getWireframeAttribute(i));var y;null!==v?(y=de,y.setIndex(v)):y=pe,c&&(d(n,s,i),null!==v&&re.bindBuffer(re.ELEMENT_ARRAY_BUFFER,he.getAttributeBuffer(v)));var R=0,x=1/0;null!==v?x=v.count:void 0!==T&&(x=T.count);var _=i.drawRange.start,M=i.drawRange.count,w=null!==o?o.start:0,S=null!==o?o.count:1/0,L=Math.max(R,_,w),A=Math.min(R+x,_+M,w+S)-1,C=Math.max(0,A-L+1);if(a instanceof THREE.Mesh)if(n.wireframe===!0)se.setLineWidth(n.wireframeLinewidth*e()),y.setMode(re.LINES);else switch(a.drawMode){case THREE.TrianglesDrawMode:y.setMode(re.TRIANGLES);break;case THREE.TriangleStripDrawMode:y.setMode(re.TRIANGLE_STRIP);break;case THREE.TriangleFanDrawMode:y.setMode(re.TRIANGLE_FAN)}else if(a instanceof THREE.Line){var P=n.linewidth;void 0===P&&(P=1),se.setLineWidth(P*e()),a instanceof THREE.LineSegments?y.setMode(re.LINES):y.setMode(re.LINE_STRIP)}else a instanceof THREE.Points&&y.setMode(re.POINTS);i instanceof THREE.InstancedBufferGeometry?i.maxInstancedCount>0&&y.renderInstances(i,L,C):y.render(L,C)},this.render=function(t,e,r,i){if(e instanceof THREE.Camera==!1)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");var n=t.fog;if(Mt="",_t=-1,wt=null,t.autoUpdate===!0&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),e.matrixWorldInverse.getInverse(e.matrixWorld),Qt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),Vt.setFromMatrix(Qt),dt.length=0,ft=-1,gt=-1,Tt.length=0,yt.length=0,F(this.clippingPlanes,e),T(t,e),Et.length=ft+1,mt.length=gt+1,Rt.sortObjects===!0&&(Et.sort(f),mt.sort(m)),Gt&&(kt=!0,N(null)),I(dt),Ee.render(t,e),U(dt,e),Gt&&(kt=!1,O()),ee.calls=0,ee.vertices=0,ee.faces=0,ee.points=0,void 0===r&&(r=null),this.setRenderTarget(r),(this.autoClear||i)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),t.overrideMaterial){var a=t.overrideMaterial;y(Et,e,n,a),y(mt,e,n,a)}else se.setBlending(THREE.NoBlending),y(Et,e,n),y(mt,e,n);if(fe.render(t,e),me.render(t,e,At),r){var o=r.texture;o.generateMipmaps&&X(r)&&o.minFilter!==THREE.NearestFilter&&o.minFilter!==THREE.LinearFilter&&rt(r)}se.setDepthTest(!0),se.setDepthWrite(!0),se.setColorWrite(!0)},this.setFaceCulling=function(t,e){t===THREE.CullFaceNone?se.disable(re.CULL_FACE):(e===THREE.FrontFaceDirectionCW?re.frontFace(re.CW):re.frontFace(re.CCW),t===THREE.CullFaceBack?re.cullFace(re.BACK):t===THREE.CullFaceFront?re.cullFace(re.FRONT):re.cullFace(re.FRONT_AND_BACK),se.enable(re.CULL_FACE))};var ge=!1;this.setTexture=function(t,e){ge||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),ge=!0),j(t,e)},this.allocTextureUnit=G,this.setTexture2D=j,this.setTextureCube=function(t,e){t instanceof THREE.CubeTexture||Array.isArray(t.image)&&6===t.image.length?Z(t,e):K(t.texture,e)},this.getCurrentRenderTarget=function(){return xt},this.setRenderTarget=function(t){xt=t,t&&void 0===ce.get(t).__webglFramebuffer&&et(t);var e,r=t instanceof THREE.WebGLRenderTargetCube;if(t){var i=ce.get(t);e=r?i.__webglFramebuffer[t.activeCubeFace]:i.__webglFramebuffer,St.copy(t.scissor),Lt=t.scissorTest,At.copy(t.viewport)}else e=null,St.copy(Ft).multiplyScalar(Ut),Lt=Nt,At.copy(Ot).multiplyScalar(Ut);if(bt!==e&&(re.bindFramebuffer(re.FRAMEBUFFER,e),bt=e),se.scissor(St),se.setScissorTest(Lt),se.viewport(At),r){var n=ce.get(t.texture);re.framebufferTexture2D(re.FRAMEBUFFER,re.COLOR_ATTACHMENT0,re.TEXTURE_CUBE_MAP_POSITIVE_X+t.activeCubeFace,n.__webglTexture,t.activeMipMapLevel)}},this.readRenderTargetPixels=function(t,e,r,i,n,a){if(t instanceof THREE.WebGLRenderTarget==!1)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");var o=ce.get(t).__webglFramebuffer;if(o){var s=!1;o!==bt&&(re.bindFramebuffer(re.FRAMEBUFFER,o),s=!0);try{var c=t.texture;if(c.format!==THREE.RGBAFormat&&nt(c.format)!==re.getParameter(re.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(c.type===THREE.UnsignedByteType||nt(c.type)===re.getParameter(re.IMPLEMENTATION_COLOR_READ_TYPE)||c.type===THREE.FloatType&&ae.get("WEBGL_color_buffer_float")||c.type===THREE.HalfFloatType&&ae.get("EXT_color_buffer_half_float")))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");re.checkFramebufferStatus(re.FRAMEBUFFER)===re.FRAMEBUFFER_COMPLETE?e>0&&e<=t.width-i&&r>0&&r<=t.height-n&&re.readPixels(e,r,i,n,nt(c.format),nt(c.type),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&re.bindFramebuffer(re.FRAMEBUFFER,bt)}}}},THREE.WebGLRenderTarget=function(t,e,r){this.uuid=THREE.Math.generateUUID(),this.width=t,this.height=e,this.scissor=new THREE.Vector4(0,0,t,e),this.scissorTest=!1,this.viewport=new THREE.Vector4(0,0,t,e),r=r||{},void 0===r.minFilter&&(r.minFilter=THREE.LinearFilter),this.texture=new THREE.Texture((void 0),(void 0),r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.depthBuffer=void 0===r.depthBuffer||r.depthBuffer,this.stencilBuffer=void 0===r.stencilBuffer||r.stencilBuffer,this.depthTexture=null},THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype),THREE.WebGLRenderTargetCube=function(t,e,r){THREE.WebGLRenderTarget.call(this,t,e,r),this.activeCubeFace=0,this.activeMipMapLevel=0},THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype),THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube,THREE.WebGLBufferRenderer=function(t,e,r){function i(t){o=t}function n(e,i){t.drawArrays(o,e,i),r.calls++,r.vertices+=i,o===t.TRIANGLES&&(r.faces+=i/3)}function a(i){var n=e.get("ANGLE_instanced_arrays");if(null===n)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");var a=i.attributes.position,s=0;a instanceof THREE.InterleavedBufferAttribute?(s=a.data.count,n.drawArraysInstancedANGLE(o,0,s,i.maxInstancedCount)):(s=a.count,n.drawArraysInstancedANGLE(o,0,s,i.maxInstancedCount)),r.calls++,r.vertices+=s*i.maxInstancedCount,o===t.TRIANGLES&&(r.faces+=i.maxInstancedCount*s/3)}var o;this.setMode=i,this.render=n,this.renderInstances=a},THREE.WebGLIndexedBufferRenderer=function(t,e,r){function i(t){s=t}function n(r){r.array instanceof Uint32Array&&e.get("OES_element_index_uint")?(c=t.UNSIGNED_INT,h=4):(c=t.UNSIGNED_SHORT,h=2)}function a(e,i){t.drawElements(s,i,c,e*h),r.calls++,r.vertices+=i,s===t.TRIANGLES&&(r.faces+=i/3)}function o(i,n,a){var o=e.get("ANGLE_instanced_arrays");return null===o?void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."):(o.drawElementsInstancedANGLE(s,a,c,n*h,i.maxInstancedCount),r.calls++,r.vertices+=a*i.maxInstancedCount,void(s===t.TRIANGLES&&(r.faces+=i.maxInstancedCount*a/3)))}var s,c,h;this.setMode=i,this.setIndex=n,this.render=a,this.renderInstances=o},THREE.WebGLExtensions=function(t){var e={};this.get=function(r){if(void 0!==e[r])return e[r];var i;switch(r){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":i=t.getExtension("WEBGL_compressed_texture_etc1");break;default:i=t.getExtension(r)}return null===i&&console.warn("THREE.WebGLRenderer: "+r+" extension not supported."),e[r]=i,i}},THREE.WebGLCapabilities=function(t,e,r){function i(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=i,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 n=i(this.precision);n!==this.precision&&(console.warn("THREE.WebGLRenderer:",this.precision,"not supported, using",n,"instead."),this.precision=n),this.logarithmicDepthBuffer&&(this.logarithmicDepthBuffer=!!e.get("EXT_frag_depth"))},THREE.WebGLGeometries=function(t,e,r){function i(t){var e=t.geometry;if(void 0!==h[e.id])return h[e.id];e.addEventListener("dispose",n);var i;return e instanceof THREE.BufferGeometry?i=e:e instanceof THREE.Geometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new THREE.BufferGeometry).setFromObject(t)),i=e._bufferGeometry),h[e.id]=i,r.memory.geometries++,i}function n(t){var i=t.target,a=h[i.id];null!==a.index&&o(a.index),s(a.attributes),i.removeEventListener("dispose",n),delete h[i.id];var c=e.get(i);c.wireframe&&o(c.wireframe),e.delete(i);var l=e.get(a);l.wireframe&&o(l.wireframe),e.delete(a),r.memory.geometries--}function a(t){return t instanceof THREE.InterleavedBufferAttribute?e.get(t.data).__webglBuffer:e.get(t).__webglBuffer}function o(e){var r=a(e);void 0!==r&&(t.deleteBuffer(r),c(e))}function s(t){for(var e in t)o(t[e])}function c(t){t instanceof THREE.InterleavedBufferAttribute?e.delete(t.data):e.delete(t)}var h={};this.get=i},THREE.WebGLLights=function(){var t={};this.get=function(e){if(void 0!==t[e.id])return t[e.id];var r;switch(e.type){case"DirectionalLight":r={direction:new THREE.Vector3,color:new THREE.Color,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new THREE.Vector2};break;case"SpotLight":r={position:new THREE.Vector3,direction:new THREE.Vector3,color:new THREE.Color,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new THREE.Vector2};break;case"PointLight":r={position:new THREE.Vector3,color:new THREE.Color,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new THREE.Vector2};break;case"HemisphereLight":r={direction:new THREE.Vector3,skyColor:new THREE.Color,groundColor:new THREE.Color}}return t[e.id]=r,r}},THREE.WebGLObjects=function(t,e,r){function i(e){var r=l.get(e);e.geometry instanceof THREE.Geometry&&r.updateFromObject(e);var i=r.index,a=r.attributes;null!==i&&n(i,t.ELEMENT_ARRAY_BUFFER);for(var o in a)n(a[o],t.ARRAY_BUFFER);var s=r.morphAttributes;for(var o in s)for(var c=s[o],h=0,u=c.length;h<u;h++)n(c[h],t.ARRAY_BUFFER);return r}function n(t,r){var i=t instanceof THREE.InterleavedBufferAttribute?t.data:t,n=e.get(i);void 0===n.__webglBuffer?a(n,i,r):n.version!==i.version&&o(n,i,r)}function a(e,r,i){e.__webglBuffer=t.createBuffer(),t.bindBuffer(i,e.__webglBuffer);var n=r.dynamic?t.DYNAMIC_DRAW:t.STATIC_DRAW;t.bufferData(i,r.array,n),e.version=r.version}function o(e,r,i){t.bindBuffer(i,e.__webglBuffer),r.dynamic===!1||r.updateRange.count===-1?t.bufferSubData(i,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."):(t.bufferSubData(i,r.updateRange.offset*r.array.BYTES_PER_ELEMENT,r.array.subarray(r.updateRange.offset,r.updateRange.offset+r.updateRange.count)),r.updateRange.count=0),e.version=r.version}function s(t){return t instanceof THREE.InterleavedBufferAttribute?e.get(t.data).__webglBuffer:e.get(t).__webglBuffer}function c(r){var i=e.get(r);if(void 0!==i.wireframe)return i.wireframe;var a=[],o=r.index,s=r.attributes,c=s.position;if(null!==o)for(var l={},u=o.array,p=0,d=u.length;p<d;p+=3){var E=u[p+0],f=u[p+1],m=u[p+2];h(l,E,f)&&a.push(E,f),h(l,f,m)&&a.push(f,m),h(l,m,E)&&a.push(m,E)}else for(var u=s.position.array,p=0,d=u.length/3-1;p<d;p+=3){var E=p+0,f=p+1,m=p+2;a.push(E,f,f,m,m,E)}var g=c.count>65535?Uint32Array:Uint16Array,v=new THREE.BufferAttribute(new g(a),1);return n(v,t.ELEMENT_ARRAY_BUFFER),i.wireframe=v,v}function h(t,e,r){if(e>r){var i=e;e=r,r=i}var n=t[e];return void 0===n?(t[e]=[r],!0):n.indexOf(r)===-1&&(n.push(r),!0)}var l=new THREE.WebGLGeometries(t,e,r);this.getAttributeBuffer=s,this.getWireframeAttribute=c,this.update=i},THREE.WebGLProgram=function(){function t(t){switch(t){case THREE.LinearEncoding:return["Linear","( value )"];case THREE.sRGBEncoding:return["sRGB","( value )"];case THREE.RGBEEncoding:return["RGBE","( value )"];case THREE.RGBM7Encoding:return["RGBM","( value, 7.0 )"];case THREE.RGBM16Encoding:return["RGBM","( value, 16.0 )"];case THREE.RGBDEncoding:return["RGBD","( value, 256.0 )"];case THREE.GammaEncoding:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+t)}}function e(e,r){var i=t(r);return"vec4 "+e+"( vec4 value ) { return "+i[0]+"ToLinear"+i[1]+"; }"}function r(e,r){var i=t(r);return"vec4 "+e+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function i(t,e){var r;switch(e){case THREE.LinearToneMapping:r="Linear";break;case THREE.ReinhardToneMapping:r="Reinhard";break;case THREE.Uncharted2ToneMapping:r="Uncharted2";break;case THREE.CineonToneMapping:r="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+t+"( vec3 color ) { return "+r+"ToneMapping( color ); }"}function n(t,e,r){t=t||{};var i=[t.derivatives||e.envMapCubeUV||e.bumpMap||e.normalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(t.fragDepth||e.logarithmicDepthBuffer)&&r.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",t.drawBuffers&&r.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(t.shaderTextureLOD||e.envMap)&&r.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""];return i.filter(s).join("\n")}function a(t){var e=[];for(var r in t){var i=t[r];i!==!1&&e.push("#define "+r+" "+i)}return e.join("\n")}function o(t,e,r){for(var i={},n=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),a=0;a<n;a++){var o=t.getActiveAttrib(e,a),s=o.name;i[s]=t.getAttribLocation(e,s)}return i}function s(t){return""!==t}function c(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights)}function h(t){function e(t,e){var r=THREE.ShaderChunk[e];if(void 0===r)throw new Error("Can not resolve #include <"+e+">");return h(r)}var r=/#include +<([\w\d.]+)>/g;return t.replace(r,e)}function l(t){function e(t,e,r,i){for(var n="",a=parseInt(e);a<parseInt(r);a++)n+=i.replace(/\[ i \]/g,"[ "+a+" ]");return n}var r=/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;return t.replace(r,e)}var u=0;return function(t,p,d,E){var f=t.context,m=d.extensions,g=d.defines,v=d.__webglShader.vertexShader,T=d.__webglShader.fragmentShader,y="SHADOWMAP_TYPE_BASIC";E.shadowMapType===THREE.PCFShadowMap?y="SHADOWMAP_TYPE_PCF":E.shadowMapType===THREE.PCFSoftShadowMap&&(y="SHADOWMAP_TYPE_PCF_SOFT");var R="ENVMAP_TYPE_CUBE",H="ENVMAP_MODE_REFLECTION",x="ENVMAP_BLENDING_MULTIPLY";if(E.envMap){switch(d.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:R="ENVMAP_TYPE_CUBE";break;case THREE.CubeUVReflectionMapping:case THREE.CubeUVRefractionMapping:R="ENVMAP_TYPE_CUBE_UV";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:R="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:R="ENVMAP_TYPE_SPHERE"}switch(d.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:H="ENVMAP_MODE_REFRACTION"}switch(d.combine){case THREE.MultiplyOperation:x="ENVMAP_BLENDING_MULTIPLY";break;case THREE.MixOperation:x="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:x="ENVMAP_BLENDING_ADD"}}var b,_,M=t.gammaFactor>0?t.gammaFactor:1,w=n(m,E,t.extensions),S=a(g),L=f.createProgram();d instanceof THREE.RawShaderMaterial?(b="",_=""):(b=["precision "+E.precision+" float;","precision "+E.precision+" int;","#define SHADER_NAME "+d.__webglShader.name,S,E.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+M,"#define MAX_BONES "+E.maxBones,E.map?"#define USE_MAP":"",E.envMap?"#define USE_ENVMAP":"",E.envMap?"#define "+H:"",E.lightMap?"#define USE_LIGHTMAP":"",E.aoMap?"#define USE_AOMAP":"",E.emissiveMap?"#define USE_EMISSIVEMAP":"",E.bumpMap?"#define USE_BUMPMAP":"",E.normalMap?"#define USE_NORMALMAP":"",E.displacementMap&&E.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",E.specularMap?"#define USE_SPECULARMAP":"",E.roughnessMap?"#define USE_ROUGHNESSMAP":"",E.metalnessMap?"#define USE_METALNESSMAP":"",E.alphaMap?"#define USE_ALPHAMAP":"",E.vertexColors?"#define USE_COLOR":"",E.flatShading?"#define FLAT_SHADED":"",E.skinning?"#define USE_SKINNING":"",E.useVertexTexture?"#define BONE_TEXTURE":"",E.morphTargets?"#define USE_MORPHTARGETS":"",E.morphNormals&&E.flatShading===!1?"#define USE_MORPHNORMALS":"",E.doubleSided?"#define DOUBLE_SIDED":"",E.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+E.numClippingPlanes,E.shadowMapEnabled?"#define USE_SHADOWMAP":"",E.shadowMapEnabled?"#define "+y:"",E.sizeAttenuation?"#define USE_SIZEATTENUATION":"",E.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",E.logarithmicDepthBuffer&&t.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(s).join("\n"),_=[w,"precision "+E.precision+" float;","precision "+E.precision+" int;","#define SHADER_NAME "+d.__webglShader.name,S,E.alphaTest?"#define ALPHATEST "+E.alphaTest:"","#define GAMMA_FACTOR "+M,E.useFog&&E.fog?"#define USE_FOG":"",E.useFog&&E.fogExp?"#define FOG_EXP2":"",E.map?"#define USE_MAP":"",E.envMap?"#define USE_ENVMAP":"",E.envMap?"#define "+R:"",E.envMap?"#define "+H:"",E.envMap?"#define "+x:"",E.lightMap?"#define USE_LIGHTMAP":"",E.aoMap?"#define USE_AOMAP":"",E.emissiveMap?"#define USE_EMISSIVEMAP":"",E.bumpMap?"#define USE_BUMPMAP":"",E.normalMap?"#define USE_NORMALMAP":"",E.specularMap?"#define USE_SPECULARMAP":"",E.roughnessMap?"#define USE_ROUGHNESSMAP":"",E.metalnessMap?"#define USE_METALNESSMAP":"",E.alphaMap?"#define USE_ALPHAMAP":"",E.vertexColors?"#define USE_COLOR":"",E.flatShading?"#define FLAT_SHADED":"",E.doubleSided?"#define DOUBLE_SIDED":"",E.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+E.numClippingPlanes,E.shadowMapEnabled?"#define USE_SHADOWMAP":"",E.shadowMapEnabled?"#define "+y:"",E.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",E.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",E.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",E.logarithmicDepthBuffer&&t.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",E.envMap&&t.extensions.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",E.toneMapping!==THREE.NoToneMapping?"#define TONE_MAPPING":"",E.toneMapping!==THREE.NoToneMapping?THREE.ShaderChunk.tonemapping_pars_fragment:"",E.toneMapping!==THREE.NoToneMapping?i("toneMapping",E.toneMapping):"",E.outputEncoding||E.mapEncoding||E.envMapEncoding||E.emissiveMapEncoding?THREE.ShaderChunk.encodings_pars_fragment:"",E.mapEncoding?e("mapTexelToLinear",E.mapEncoding):"",E.envMapEncoding?e("envMapTexelToLinear",E.envMapEncoding):"",E.emissiveMapEncoding?e("emissiveMapTexelToLinear",E.emissiveMapEncoding):"",E.outputEncoding?r("linearToOutputTexel",E.outputEncoding):"",E.depthPacking?"#define DEPTH_PACKING "+d.depthPacking:"","\n"].filter(s).join("\n")),v=h(v,E),v=c(v,E),T=h(T,E),T=c(T,E),d instanceof THREE.ShaderMaterial==!1&&(v=l(v),T=l(T));var A=b+v,C=_+T,P=THREE.WebGLShader(f,f.VERTEX_SHADER,A),B=THREE.WebGLShader(f,f.FRAGMENT_SHADER,C);f.attachShader(L,P),f.attachShader(L,B),void 0!==d.index0AttributeName?f.bindAttribLocation(L,0,d.index0AttributeName):E.morphTargets===!0&&f.bindAttribLocation(L,0,"position"),f.linkProgram(L);var D=f.getProgramInfoLog(L),I=f.getShaderInfoLog(P),U=f.getShaderInfoLog(B),F=!0,N=!0;f.getProgramParameter(L,f.LINK_STATUS)===!1?(F=!1,console.error("THREE.WebGLProgram: shader error: ",f.getError(),"gl.VALIDATE_STATUS",f.getProgramParameter(L,f.VALIDATE_STATUS),"gl.getProgramInfoLog",D,I,U)):""!==D?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",D):""!==I&&""!==U||(N=!1),N&&(this.diagnostics={runnable:F,material:d,programLog:D,vertexShader:{log:I,prefix:b},fragmentShader:{log:U,prefix:_}}),f.deleteShader(P),f.deleteShader(B);var O;this.getUniforms=function(){return void 0===O&&(O=new THREE.WebGLUniforms(f,L,t)),O};var V;return this.getAttributes=function(){return void 0===V&&(V=o(f,L)),V},this.destroy=function(){f.deleteProgram(L),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=u++,this.code=p,this.usedTimes=1,this.program=L,this.vertexShader=P,this.fragmentShader=B,this}}(),THREE.WebGLPrograms=function(t,e){function r(t){if(e.floatVertexTextures&&t&&t.skeleton&&t.skeleton.useVertexTexture)return 1024;var r=e.maxVertexUniforms,i=Math.floor((r-20)/4),n=i;return void 0!==t&&t instanceof THREE.SkinnedMesh&&(n=Math.min(t.skeleton.bones.length,n),n<t.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+t.skeleton.bones.length+", this GPU supports just "+n+" (try OpenGL instead of ANGLE)")),n}function i(t,e){var r;return t?t instanceof THREE.Texture?r=t.encoding:t instanceof THREE.WebGLRenderTarget&&(r=t.texture.encoding):r=THREE.LinearEncoding,r===THREE.LinearEncoding&&e&&(r=THREE.GammaEncoding),r}var n=[],a={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"},o=["precision","supportsVertexTextures","map","mapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","displacementMap","specularMap","roughnessMap","metalnessMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","depthPacking"];this.getParameters=function(n,o,s,c,h){var l=a[n.type],u=r(h),p=t.getPrecision();null!==n.precision&&(p=e.getMaxPrecision(n.precision),p!==n.precision&&console.warn("THREE.WebGLProgram.getParameters:",n.precision,"not supported, using",p,"instead."));var d={shaderID:l,precision:p,supportsVertexTextures:e.vertexTextures,outputEncoding:i(t.getCurrentRenderTarget(),t.gammaOutput),map:!!n.map,mapEncoding:i(n.map,t.gammaInput),envMap:!!n.envMap,envMapMode:n.envMap&&n.envMap.mapping,envMapEncoding:i(n.envMap,t.gammaInput),envMapCubeUV:!!n.envMap&&(n.envMap.mapping===THREE.CubeUVReflectionMapping||n.envMap.mapping===THREE.CubeUVRefractionMapping),lightMap:!!n.lightMap,aoMap:!!n.aoMap,emissiveMap:!!n.emissiveMap,emissiveMapEncoding:i(n.emissiveMap,t.gammaInput),bumpMap:!!n.bumpMap,normalMap:!!n.normalMap,displacementMap:!!n.displacementMap,roughnessMap:!!n.roughnessMap,metalnessMap:!!n.metalnessMap,
specularMap:!!n.specularMap,alphaMap:!!n.alphaMap,combine:n.combine,vertexColors:n.vertexColors,fog:s,useFog:n.fog,fogExp:s instanceof THREE.FogExp2,flatShading:n.shading===THREE.FlatShading,sizeAttenuation:n.sizeAttenuation,logarithmicDepthBuffer:e.logarithmicDepthBuffer,skinning:n.skinning,maxBones:u,useVertexTexture:e.floatVertexTextures&&h&&h.skeleton&&h.skeleton.useVertexTexture,morphTargets:n.morphTargets,morphNormals:n.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numHemiLights:o.hemi.length,numClippingPlanes:c,shadowMapEnabled:t.shadowMap.enabled&&h.receiveShadow&&o.shadows.length>0,shadowMapType:t.shadowMap.type,toneMapping:t.toneMapping,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:n.premultipliedAlpha,alphaTest:n.alphaTest,doubleSided:n.side===THREE.DoubleSide,flipSided:n.side===THREE.BackSide,depthPacking:void 0!==n.depthPacking&&n.depthPacking};return d},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 i in t.defines)r.push(i),r.push(t.defines[i]);for(var n=0;n<o.length;n++)r.push(e[o[n]]);return r.join()},this.acquireProgram=function(e,r,i){for(var a,o=0,s=n.length;o<s;o++){var c=n[o];if(c.code===i){a=c,++a.usedTimes;break}}return void 0===a&&(a=new THREE.WebGLProgram(t,i,e,r),n.push(a)),a},this.releaseProgram=function(t){if(0===--t.usedTimes){var e=n.indexOf(t);n[e]=n[n.length-1],n.pop(),t.destroy()}},this.programs=n},THREE.WebGLProperties=function(){var t={};this.get=function(e){var r=e.uuid,i=t[r];return void 0===i&&(i={},t[r]=i),i},this.delete=function(e){delete t[e.uuid]},this.clear=function(){t={}}},THREE.WebGLShader=function(){function t(t){for(var e=t.split("\n"),r=0;r<e.length;r++)e[r]=r+1+": "+e[r];return e.join("\n")}return function(e,r,i){var n=e.createShader(r);return e.shaderSource(n,i),e.compileShader(n),e.getShaderParameter(n,e.COMPILE_STATUS)===!1&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==e.getShaderInfoLog(n)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",r===e.VERTEX_SHADER?"vertex":"fragment",e.getShaderInfoLog(n),t(i)),n}}(),THREE.WebGLShadowMap=function(t,e,r){function i(e,r,i,n){var a=e.geometry,o=null,s=g,c=e.customDepthMaterial;if(i&&(s=v,c=e.customDistanceMaterial),c)o=c;else{var h=void 0!==a.morphTargets&&a.morphTargets.length>0&&r.morphTargets,l=e instanceof THREE.SkinnedMesh&&r.skinning,u=0;h&&(u|=E),l&&(u|=f),o=s[u]}if(t.localClippingEnabled&&r.clipShadows===!0&&0!==r.clippingPlanes.length){var p=o.uuid,d=r.uuid,m=T[p];void 0===m&&(m={},T[p]=m);var y=m[d];void 0===y&&(y=o.clone(),m[d]=y),o=y}return o.visible=r.visible,o.wireframe=r.wireframe,o.side=r.side,o.clipShadows=r.clipShadows,o.clippingPlanes=r.clippingPlanes,o.wireframeLinewidth=r.wireframeLinewidth,o.linewidth=r.linewidth,i&&void 0!==o.uniforms.lightPos&&o.uniforms.lightPos.value.copy(n),o}function n(t,e,r){if(t.visible!==!1){if(t.layers.test(e.layers)&&(t instanceof THREE.Mesh||t instanceof THREE.Line||t instanceof THREE.Points)&&t.castShadow&&(t.frustumCulled===!1||s.intersectsObject(t)===!0)){var i=t.material;i.visible===!0&&(t.modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,t.matrixWorld),d.push(t))}for(var a=t.children,o=0,c=a.length;o<c;o++)n(a[o],e,r)}}var a=t.context,o=t.state,s=new THREE.Frustum,c=new THREE.Matrix4,h=e.shadows,l=new THREE.Vector2,u=new THREE.Vector3,p=new THREE.Vector3,d=[],E=1,f=2,m=(E|f)+1,g=new Array(m),v=new Array(m),T={},y=[new THREE.Vector3(1,0,0),new THREE.Vector3((-1),0,0),new THREE.Vector3(0,0,1),new THREE.Vector3(0,0,(-1)),new THREE.Vector3(0,1,0),new THREE.Vector3(0,(-1),0)],R=[new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,1,0),new THREE.Vector3(0,0,1),new THREE.Vector3(0,0,(-1))],H=[new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4,new THREE.Vector4],x=new THREE.MeshDepthMaterial;x.depthPacking=THREE.RGBADepthPacking,x.clipping=!0;for(var b=THREE.ShaderLib.distanceRGBA,_=THREE.UniformsUtils.clone(b.uniforms),M=0;M!==m;++M){var w=0!==(M&E),S=0!==(M&f),L=x.clone();L.morphTargets=w,L.skinning=S,g[M]=L;var A=new THREE.ShaderMaterial({defines:{USE_SHADOWMAP:""},uniforms:_,vertexShader:b.vertexShader,fragmentShader:b.fragmentShader,morphTargets:w,skinning:S,clipping:!0});v[M]=A}var C=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=THREE.PCFShadowMap,this.cullFace=THREE.CullFaceFront,this.render=function(e,E){if(C.enabled!==!1&&(C.autoUpdate!==!1||C.needsUpdate!==!1)&&0!==h.length){o.clearColor(1,1,1,1),o.disable(a.BLEND),o.enable(a.CULL_FACE),a.frontFace(a.CCW),a.cullFace(C.cullFace===THREE.CullFaceFront?a.FRONT:a.BACK),o.setDepthTest(!0),o.setScissorTest(!1);for(var f,m,g=0,v=h.length;g<v;g++){var T=h[g],x=T.shadow,b=x.camera;if(l.copy(x.mapSize),T instanceof THREE.PointLight){f=6,m=!0;var _=l.x,M=l.y;H[0].set(2*_,M,_,M),H[1].set(0,M,_,M),H[2].set(3*_,M,_,M),H[3].set(_,M,_,M),H[4].set(3*_,0,_,M),H[5].set(_,0,_,M),l.x*=4,l.y*=2}else f=1,m=!1;if(null===x.map){var w={minFilter:THREE.NearestFilter,magFilter:THREE.NearestFilter,format:THREE.RGBAFormat};x.map=new THREE.WebGLRenderTarget(l.x,l.y,w),b.updateProjectionMatrix()}x instanceof THREE.SpotLightShadow&&x.update(T);var S=x.map,L=x.matrix;p.setFromMatrixPosition(T.matrixWorld),b.position.copy(p),t.setRenderTarget(S),t.clear();for(var A=0;A<f;A++){if(m){u.copy(b.position),u.add(y[A]),b.up.copy(R[A]),b.lookAt(u);var P=H[A];o.viewport(P)}else u.setFromMatrixPosition(T.target.matrixWorld),b.lookAt(u);b.updateMatrixWorld(),b.matrixWorldInverse.getInverse(b.matrixWorld),L.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),L.multiply(b.projectionMatrix),L.multiply(b.matrixWorldInverse),c.multiplyMatrices(b.projectionMatrix,b.matrixWorldInverse),s.setFromMatrix(c),d.length=0,n(e,E,b);for(var B=0,D=d.length;B<D;B++){var I=d[B],U=r.update(I),F=I.material;if(F instanceof THREE.MultiMaterial)for(var N=U.groups,O=F.materials,V=0,G=N.length;V<G;V++){var z=N[V],k=O[z.materialIndex];if(k.visible===!0){var j=i(I,k,m,p);t.renderBufferDirect(b,null,U,j,I,z)}}else{var j=i(I,F,m,p);t.renderBufferDirect(b,null,U,j,I,null)}}}}var W=t.getClearColor(),X=t.getClearAlpha();t.setClearColor(W,X),o.enable(a.BLEND),C.cullFace===THREE.CullFaceFront&&a.cullFace(a.BACK),C.needsUpdate=!1}}},THREE.WebGLState=function(t,e,r){var i=this,n=new THREE.Vector4,a=t.getParameter(t.MAX_VERTEX_ATTRIBS),o=new Uint8Array(a),s=new Uint8Array(a),c=new Uint8Array(a),h={},l=null,u=null,p=null,d=null,E=null,f=null,m=null,g=null,v=!1,T=null,y=null,R=null,H=null,x=null,b=null,_=null,M=null,w=null,S=null,L=null,A=null,C=null,P=null,B=null,D=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),I=void 0,U={},F=new THREE.Vector4,N=null,O=null,V=new THREE.Vector4,G=new THREE.Vector4;this.init=function(){this.clearColor(0,0,0,1),this.clearDepth(1),this.clearStencil(0),this.enable(t.DEPTH_TEST),t.depthFunc(t.LEQUAL),t.frontFace(t.CCW),t.cullFace(t.BACK),this.enable(t.CULL_FACE),this.enable(t.BLEND),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA)},this.initAttributes=function(){for(var t=0,e=o.length;t<e;t++)o[t]=0},this.enableAttribute=function(r){if(o[r]=1,0===s[r]&&(t.enableVertexAttribArray(r),s[r]=1),0!==c[r]){var i=e.get("ANGLE_instanced_arrays");i.vertexAttribDivisorANGLE(r,0),c[r]=0}},this.enableAttributeAndDivisor=function(e,r,i){o[e]=1,0===s[e]&&(t.enableVertexAttribArray(e),s[e]=1),c[e]!==r&&(i.vertexAttribDivisorANGLE(e,r),c[e]=r)},this.disableUnusedAttributes=function(){for(var e=0,r=s.length;e<r;e++)s[e]!==o[e]&&(t.disableVertexAttribArray(e),s[e]=0)},this.enable=function(e){h[e]!==!0&&(t.enable(e),h[e]=!0)},this.disable=function(e){h[e]!==!1&&(t.disable(e),h[e]=!1)},this.getCompressedTextureFormats=function(){if(null===l&&(l=[],e.get("WEBGL_compressed_texture_pvrtc")||e.get("WEBGL_compressed_texture_s3tc")||e.get("WEBGL_compressed_texture_etc1")))for(var r=t.getParameter(t.COMPRESSED_TEXTURE_FORMATS),i=0;i<r.length;i++)l.push(r[i]);return l},this.setBlending=function(e,i,n,a,o,s,c,h){e===THREE.NoBlending?this.disable(t.BLEND):this.enable(t.BLEND),e===u&&h===v||(e===THREE.AdditiveBlending?h?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE,t.ONE,t.ONE)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.SRC_ALPHA,t.ONE)):e===THREE.SubtractiveBlending?h?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ZERO,t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ONE_MINUS_SRC_ALPHA)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.ONE_MINUS_SRC_COLOR)):e===THREE.MultiplyBlending?h?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ZERO,t.ZERO,t.SRC_COLOR,t.SRC_ALPHA)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.SRC_COLOR)):h?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA)):(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA)),u=e,v=h),e===THREE.CustomBlending?(o=o||i,s=s||n,c=c||a,i===p&&o===f||(t.blendEquationSeparate(r(i),r(o)),p=i,f=o),n===d&&a===E&&s===m&&c===g||(t.blendFuncSeparate(r(n),r(a),r(s),r(c)),d=n,E=a,m=s,g=c)):(p=null,d=null,E=null,f=null,m=null,g=null)},this.setDepthFunc=function(e){if(T!==e){if(e)switch(e){case THREE.NeverDepth:t.depthFunc(t.NEVER);break;case THREE.AlwaysDepth:t.depthFunc(t.ALWAYS);break;case THREE.LessDepth:t.depthFunc(t.LESS);break;case THREE.LessEqualDepth:t.depthFunc(t.LEQUAL);break;case THREE.EqualDepth:t.depthFunc(t.EQUAL);break;case THREE.GreaterEqualDepth:t.depthFunc(t.GEQUAL);break;case THREE.GreaterDepth:t.depthFunc(t.GREATER);break;case THREE.NotEqualDepth:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}else t.depthFunc(t.LEQUAL);T=e}},this.setDepthTest=function(e){e?this.enable(t.DEPTH_TEST):this.disable(t.DEPTH_TEST)},this.setDepthWrite=function(e){y!==e&&(t.depthMask(e),y=e)},this.setColorWrite=function(e){R!==e&&(t.colorMask(e,e,e,e),R=e)},this.setStencilFunc=function(e,r,i){x===e&&b===r&&_===i||(t.stencilFunc(e,r,i),x=e,b=r,_=i)},this.setStencilOp=function(e,r,i){M===e&&w===r&&S===i||(t.stencilOp(e,r,i),M=e,w=r,S=i)},this.setStencilTest=function(e){e?this.enable(t.STENCIL_TEST):this.disable(t.STENCIL_TEST)},this.setStencilWrite=function(e){H!==e&&(t.stencilMask(e),H=e)},this.setFlipSided=function(e){L!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),L=e)},this.setLineWidth=function(e){e!==A&&(t.lineWidth(e),A=e)},this.setPolygonOffset=function(e,r,i){e?this.enable(t.POLYGON_OFFSET_FILL):this.disable(t.POLYGON_OFFSET_FILL),!e||C===r&&P===i||(t.polygonOffset(r,i),C=r,P=i)},this.getScissorTest=function(){return B},this.setScissorTest=function(e){B=e,e?this.enable(t.SCISSOR_TEST):this.disable(t.SCISSOR_TEST)},this.activeTexture=function(e){void 0===e&&(e=t.TEXTURE0+D-1),I!==e&&(t.activeTexture(e),I=e)},this.bindTexture=function(e,r){void 0===I&&i.activeTexture();var n=U[I];void 0===n&&(n={type:void 0,texture:void 0},U[I]=n),n.type===e&&n.texture===r||(t.bindTexture(e,r),n.type=e,n.texture=r)},this.compressedTexImage2D=function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){console.error(t)}},this.texImage2D=function(){try{t.texImage2D.apply(t,arguments)}catch(t){console.error(t)}},this.clearColor=function(e,r,i,a){n.set(e,r,i,a),F.equals(n)===!1&&(t.clearColor(e,r,i,a),F.copy(n))},this.clearDepth=function(e){N!==e&&(t.clearDepth(e),N=e)},this.clearStencil=function(e){O!==e&&(t.clearStencil(e),O=e)},this.scissor=function(e){V.equals(e)===!1&&(t.scissor(e.x,e.y,e.z,e.w),V.copy(e))},this.viewport=function(e){G.equals(e)===!1&&(t.viewport(e.x,e.y,e.z,e.w),G.copy(e))},this.reset=function(){for(var e=0;e<s.length;e++)1===s[e]&&(t.disableVertexAttribArray(e),s[e]=0);h={},l=null,I=void 0,U={},u=null,R=null,y=null,H=null,L=null}},THREE.WebGLUniforms=function(){var t=function(){this.seq=[],this.map={}},e=[],r=[],i=function(t,r,i){var n=t[0];if(n<=0||n>0)return t;var a=r*i,o=e[a];if(void 0===o&&(o=new Float32Array(a),e[a]=o),0!==r){n.toArray(o,0);for(var s=1,c=0;s!==r;++s)c+=i,t[s].toArray(o,c)}return o},n=function(t,e){var i=r[e];void 0===i&&(i=new Int32Array(e),r[e]=i);for(var n=0;n!==e;++n)i[n]=t.allocTextureUnit();return i},a=function(t,e){t.uniform1f(this.addr,e)},o=function(t,e){t.uniform1i(this.addr,e)},s=function(t,e){void 0===e.x?t.uniform2fv(this.addr,e):t.uniform2f(this.addr,e.x,e.y)},c=function(t,e){void 0!==e.x?t.uniform3f(this.addr,e.x,e.y,e.z):void 0!==e.r?t.uniform3f(this.addr,e.r,e.g,e.b):t.uniform3fv(this.addr,e)},h=function(t,e){void 0===e.x?t.uniform4fv(this.addr,e):t.uniform4f(this.addr,e.x,e.y,e.z,e.w)},l=function(t,e){t.uniformMatrix2fv(this.addr,!1,e.elements||e)},u=function(t,e){t.uniformMatrix3fv(this.addr,!1,e.elements||e)},p=function(t,e){t.uniformMatrix4fv(this.addr,!1,e.elements||e)},d=function(t,e,r){var i=r.allocTextureUnit();t.uniform1i(this.addr,i),e&&r.setTexture2D(e,i)},E=function(t,e,r){var i=r.allocTextureUnit();t.uniform1i(this.addr,i),e&&r.setTextureCube(e,i)},f=function(t,e){t.uniform2iv(this.addr,e)},m=function(t,e){t.uniform3iv(this.addr,e)},g=function(t,e){t.uniform4iv(this.addr,e)},v=function(t){switch(t){case 5126:return a;case 35664:return s;case 35665:return c;case 35666:return h;case 35674:return l;case 35675:return u;case 35676:return p;case 35678:return d;case 35680:return E;case 5124:case 35670:return o;case 35667:case 35671:return f;case 35668:case 35672:return m;case 35669:case 35673:return g}},T=function(t,e){t.uniform1fv(this.addr,e)},y=function(t,e){t.uniform1iv(this.addr,e)},R=function(t,e){t.uniform2fv(this.addr,i(e,this.size,2))},H=function(t,e){t.uniform3fv(this.addr,i(e,this.size,3))},x=function(t,e){t.uniform4fv(this.addr,i(e,this.size,4))},b=function(t,e){t.uniformMatrix2fv(this.addr,!1,i(e,this.size,4))},_=function(t,e){t.uniformMatrix3fv(this.addr,!1,i(e,this.size,9))},M=function(t,e){t.uniformMatrix4fv(this.addr,!1,i(e,this.size,16))},w=function(t,e,r){var i=e.length,a=n(r,i);t.uniform1iv(this.addr,a);for(var o=0;o!==i;++o){var s=e[o];s&&r.setTexture2D(s,a[o])}},S=function(t,e,r){var i=e.length,a=n(r,i);t.uniform1iv(this.addr,a);for(var o=0;o!==i;++o){var s=e[o];s&&r.setTextureCube(s,a[o])}},L=function(t){switch(t){case 5126:return T;case 35664:return R;case 35665:return H;case 35666:return x;case 35674:return b;case 35675:return _;case 35676:return M;case 35678:return w;case 35680:return S;case 5124:case 35670:return y;case 35667:case 35671:return f;case 35668:case 35672:return m;case 35669:case 35673:return g}},A=function(t,e,r){this.id=t,this.addr=r,this.setValue=v(e.type)},C=function(t,e,r){this.id=t,this.addr=r,this.size=e.size,this.setValue=L(e.type)},P=function(e){this.id=e,t.call(this)};P.prototype.setValue=function(t,e){for(var r=this.seq,i=0,n=r.length;i!==n;++i){var a=r[i];a.setValue(t,e[a.id])}};var B=/([\w\d_]+)(\])?(\[|\.)?/g,D=function(t,e){t.seq.push(e),t.map[e.id]=e},I=function(t,e,r){var i=t.name,n=i.length;for(B.lastIndex=0;;){var a=B.exec(i),o=B.lastIndex,s=a[1],c="]"===a[2],h=a[3];if(c&&(s=0|s),void 0===h||"["===h&&o+2===n){D(r,void 0===h?new A(s,t,e):new C(s,t,e));break}var l=r.map,u=l[s];void 0===u&&(u=new P(s),D(r,u)),r=u}},U=function(e,r,i){t.call(this),this.renderer=i;for(var n=e.getProgramParameter(r,e.ACTIVE_UNIFORMS),a=0;a!==n;++a){var o=e.getActiveUniform(r,a),s=o.name,c=e.getUniformLocation(r,s);I(o,c,this)}};return U.prototype.setValue=function(t,e,r){var i=this.map[e];void 0!==i&&i.setValue(t,r,this.renderer)},U.prototype.set=function(t,e,r){var i=this.map[r];void 0!==i&&i.setValue(t,e[r],this.renderer)},U.prototype.setOptional=function(t,e,r){var i=e[r];void 0!==i&&this.setValue(t,r,i)},U.upload=function(t,e,r,i){for(var n=0,a=e.length;n!==a;++n){var o=e[n],s=r[o.id];s.needsUpdate!==!1&&o.setValue(t,s.value,i)}},U.seqWithValue=function(t,e){for(var r=[],i=0,n=t.length;i!==n;++i){var a=t[i];a.id in e&&r.push(a)}return r},U.splitDynamic=function(t,e){for(var r=null,i=t.length,n=0,a=0;a!==i;++a){var o=t[a],s=e[o.id];s&&s.dynamic===!0?(null===r&&(r=[]),r.push(o)):(n<a&&(t[n]=o),++n)}return n<i&&(t.length=n),r},U.evalDynamic=function(t,e,r,i){for(var n=0,a=t.length;n!==a;++n){var o=e[t[n].id],s=o.onUpdateCallback;void 0!==s&&s.call(o,r,i)}},U}(),THREE.LensFlarePlugin=function(t,e){function r(){var t=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),e=new Uint16Array([0,1,2,0,2,3]);n=p.createBuffer(),a=p.createBuffer(),p.bindBuffer(p.ARRAY_BUFFER,n),p.bufferData(p.ARRAY_BUFFER,t,p.STATIC_DRAW),p.bindBuffer(p.ELEMENT_ARRAY_BUFFER,a),p.bufferData(p.ELEMENT_ARRAY_BUFFER,e,p.STATIC_DRAW),l=p.createTexture(),u=p.createTexture(),d.bindTexture(p.TEXTURE_2D,l),p.texImage2D(p.TEXTURE_2D,0,p.RGB,16,16,0,p.RGB,p.UNSIGNED_BYTE,null),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.NEAREST),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.NEAREST),d.bindTexture(p.TEXTURE_2D,u),p.texImage2D(p.TEXTURE_2D,0,p.RGBA,16,16,0,p.RGBA,p.UNSIGNED_BYTE,null),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.NEAREST),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.NEAREST),o={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")},s=i(o),c={vertex:p.getAttribLocation(s,"position"),uv:p.getAttribLocation(s,"uv")},h={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 i(e){var r=p.createProgram(),i=p.createShader(p.FRAGMENT_SHADER),n=p.createShader(p.VERTEX_SHADER),a="precision "+t.getPrecision()+" float;\n";return p.shaderSource(i,a+e.fragmentShader),p.shaderSource(n,a+e.vertexShader),p.compileShader(i),p.compileShader(n),p.attachShader(r,i),p.attachShader(r,n),p.linkProgram(r),r}var n,a,o,s,c,h,l,u,p=t.context,d=t.state;this.render=function(i,o,E){if(0!==e.length){var f=new THREE.Vector3,m=E.w/E.z,g=.5*E.z,v=.5*E.w,T=16/E.w,y=new THREE.Vector2(T*m,T),R=new THREE.Vector3(1,1,0),H=new THREE.Vector2(1,1),x=new THREE.Box2;x.min.set(0,0),x.max.set(E.z-16,E.w-16),void 0===s&&r(),p.useProgram(s),d.initAttributes(),d.enableAttribute(c.vertex),d.enableAttribute(c.uv),d.disableUnusedAttributes(),p.uniform1i(h.occlusionMap,0),p.uniform1i(h.map,1),p.bindBuffer(p.ARRAY_BUFFER,n),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,a),d.disable(p.CULL_FACE),d.setDepthWrite(!1);for(var b=0,_=e.length;b<_;b++){T=16/E.w,y.set(T*m,T);var M=e[b];if(f.set(M.matrixWorld.elements[12],M.matrixWorld.elements[13],M.matrixWorld.elements[14]),f.applyMatrix4(o.matrixWorldInverse),f.applyProjection(o.projectionMatrix),R.copy(f),H.x=E.x+R.x*g+g-8,H.y=E.y+R.y*v+v-8,x.containsPoint(H)===!0){d.activeTexture(p.TEXTURE0),d.bindTexture(p.TEXTURE_2D,null),d.activeTexture(p.TEXTURE1),d.bindTexture(p.TEXTURE_2D,l),p.copyTexImage2D(p.TEXTURE_2D,0,p.RGB,H.x,H.y,16,16,0),p.uniform1i(h.renderType,0),p.uniform2f(h.scale,y.x,y.y),p.uniform3f(h.screenPosition,R.x,R.y,R.z),d.disable(p.BLEND),d.enable(p.DEPTH_TEST),p.drawElements(p.TRIANGLES,6,p.UNSIGNED_SHORT,0),d.activeTexture(p.TEXTURE0),d.bindTexture(p.TEXTURE_2D,u),p.copyTexImage2D(p.TEXTURE_2D,0,p.RGBA,H.x,H.y,16,16,0),p.uniform1i(h.renderType,1),d.disable(p.DEPTH_TEST),d.activeTexture(p.TEXTURE1),d.bindTexture(p.TEXTURE_2D,l),p.drawElements(p.TRIANGLES,6,p.UNSIGNED_SHORT,0),M.positionScreen.copy(R),M.customUpdateCallback?M.customUpdateCallback(M):M.updateLensFlares(),p.uniform1i(h.renderType,2),d.enable(p.BLEND);for(var w=0,S=M.lensFlares.length;w<S;w++){var L=M.lensFlares[w];L.opacity>.001&&L.scale>.001&&(R.x=L.x,R.y=L.y,R.z=L.z,T=L.size*L.scale/E.w,y.x=T*m,y.y=T,p.uniform3f(h.screenPosition,R.x,R.y,R.z),p.uniform2f(h.scale,y.x,y.y),p.uniform1f(h.rotation,L.rotation),p.uniform1f(h.opacity,L.opacity),p.uniform3f(h.color,L.color.r,L.color.g,L.color.b),d.setBlending(L.blending,L.blendEquation,L.blendSrc,L.blendDst),t.setTexture2D(L.texture,1),p.drawElements(p.TRIANGLES,6,p.UNSIGNED_SHORT,0))}}}d.enable(p.CULL_FACE),d.enable(p.DEPTH_TEST),d.setDepthWrite(!0),t.resetGLState()}}},THREE.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]);a=u.createBuffer(),o=u.createBuffer(),u.bindBuffer(u.ARRAY_BUFFER,a),u.bufferData(u.ARRAY_BUFFER,t,u.STATIC_DRAW),u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,o),u.bufferData(u.ELEMENT_ARRAY_BUFFER,e,u.STATIC_DRAW),s=i(),c={position:u.getAttribLocation(s,"position"),uv:u.getAttribLocation(s,"uv")},h={uvOffset:u.getUniformLocation(s,"uvOffset"),uvScale:u.getUniformLocation(s,"uvScale"),rotation:u.getUniformLocation(s,"rotation"),scale:u.getUniformLocation(s,"scale"),color:u.getUniformLocation(s,"color"),map:u.getUniformLocation(s,"map"),opacity:u.getUniformLocation(s,"opacity"),modelViewMatrix:u.getUniformLocation(s,"modelViewMatrix"),projectionMatrix:u.getUniformLocation(s,"projectionMatrix"),fogType:u.getUniformLocation(s,"fogType"),fogDensity:u.getUniformLocation(s,"fogDensity"),fogNear:u.getUniformLocation(s,"fogNear"),fogFar:u.getUniformLocation(s,"fogFar"),fogColor:u.getUniformLocation(s,"fogColor"),alphaTest:u.getUniformLocation(s,"alphaTest")};var r=document.createElement("canvas");r.width=8,r.height=8;var n=r.getContext("2d");n.fillStyle="white",n.fillRect(0,0,8,8),l=new THREE.Texture(r),l.needsUpdate=!0}function i(){var e=u.createProgram(),r=u.createShader(u.VERTEX_SHADER),i=u.createShader(u.FRAGMENT_SHADER);return u.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")),u.shaderSource(i,["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")),u.compileShader(r),u.compileShader(i),u.attachShader(e,r),u.attachShader(e,i),u.linkProgram(e),e}function n(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:e.id-t.id}var a,o,s,c,h,l,u=t.context,p=t.state,d=new THREE.Vector3,E=new THREE.Quaternion,f=new THREE.Vector3;this.render=function(i,m){if(0!==e.length){void 0===s&&r(),u.useProgram(s),p.initAttributes(),p.enableAttribute(c.position),p.enableAttribute(c.uv),p.disableUnusedAttributes(),p.disable(u.CULL_FACE),p.enable(u.BLEND),u.bindBuffer(u.ARRAY_BUFFER,a),u.vertexAttribPointer(c.position,2,u.FLOAT,!1,16,0),u.vertexAttribPointer(c.uv,2,u.FLOAT,!1,16,8),u.bindBuffer(u.ELEMENT_ARRAY_BUFFER,o),u.uniformMatrix4fv(h.projectionMatrix,!1,m.projectionMatrix.elements),p.activeTexture(u.TEXTURE0),u.uniform1i(h.map,0);var g=0,v=0,T=i.fog;T?(u.uniform3f(h.fogColor,T.color.r,T.color.g,T.color.b),T instanceof THREE.Fog?(u.uniform1f(h.fogNear,T.near),u.uniform1f(h.fogFar,T.far),u.uniform1i(h.fogType,1),g=1,v=1):T instanceof THREE.FogExp2&&(u.uniform1f(h.fogDensity,T.density),u.uniform1i(h.fogType,2),g=2,v=2)):(u.uniform1i(h.fogType,0),g=0,v=0);for(var y=0,R=e.length;y<R;y++){var H=e[y];H.modelViewMatrix.multiplyMatrices(m.matrixWorldInverse,H.matrixWorld),H.z=-H.modelViewMatrix.elements[14]}e.sort(n);for(var x=[],y=0,R=e.length;y<R;y++){var H=e[y],b=H.material;u.uniform1f(h.alphaTest,b.alphaTest),u.uniformMatrix4fv(h.modelViewMatrix,!1,H.modelViewMatrix.elements),H.matrixWorld.decompose(d,E,f),x[0]=f.x,x[1]=f.y;var _=0;i.fog&&b.fog&&(_=v),g!==_&&(u.uniform1i(h.fogType,_),g=_),null!==b.map?(u.uniform2f(h.uvOffset,b.map.offset.x,b.map.offset.y),u.uniform2f(h.uvScale,b.map.repeat.x,b.map.repeat.y)):(u.uniform2f(h.uvOffset,0,0),u.uniform2f(h.uvScale,1,1)),u.uniform1f(h.opacity,b.opacity),u.uniform3f(h.color,b.color.r,b.color.g,b.color.b),u.uniform1f(h.rotation,b.rotation),u.uniform2fv(h.scale,x),p.setBlending(b.blending,b.blendEquation,b.blendSrc,b.blendDst),p.setDepthTest(b.depthTest),p.setDepthWrite(b.depthWrite),b.map?t.setTexture2D(b.map,0):t.setTexture2D(l,0),u.drawElements(u.TRIANGLES,6,u.UNSIGNED_SHORT,0)}p.enable(u.CULL_FACE),t.resetGLState()}}},Object.defineProperties(THREE.Box2.prototype,{empty:{value:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()}},isIntersectionBox:{value:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)}}}),Object.defineProperties(THREE.Box3.prototype,{empty:{value:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()}},isIntersectionBox:{value:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)}},isIntersectionSphere:{value:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}}),Object.defineProperties(THREE.Matrix3.prototype,{multiplyVector3:{value:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)}},multiplyVector3Array:{value:function(t){return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(t)}}}),Object.defineProperties(THREE.Matrix4.prototype,{extractPosition:{value:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)}},setRotationFromQuaternion:{value:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)}},multiplyVector3:{value:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),t.applyProjection(this)}},multiplyVector4:{value:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)}},multiplyVector3Array:{value:function(t){return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(t)}},rotateAxis:{value:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)}},crossVector:{value:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)}},translate:{value:function(t){console.error("THREE.Matrix4: .translate() has been removed.")}},rotateX:{value:function(t){console.error("THREE.Matrix4: .rotateX() has been removed.")}},rotateY:{value:function(t){console.error("THREE.Matrix4: .rotateY() has been removed.")}},rotateZ:{value:function(t){console.error("THREE.Matrix4: .rotateZ() has been removed.")}},rotateByAxis:{value:function(t,e){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")}}}),Object.defineProperties(THREE.Plane.prototype,{isIntersectionLine:{value:function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)}}}),Object.defineProperties(THREE.Quaternion.prototype,{multiplyVector3:{value:function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)}}}),Object.defineProperties(THREE.Ray.prototype,{isIntersectionBox:{value:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)}},isIntersectionPlane:{value:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)}},isIntersectionSphere:{value:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}}),Object.defineProperties(THREE.Vector3.prototype,{setEulerFromRotationMatrix:{value:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")}},setEulerFromQuaternion:{value:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.");
}},getPositionFromMatrix:{value:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)}},getScaleFromMatrix:{value:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)}},getColumnFromMatrix:{value:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)}}}),THREE.Face4=function(t,e,r,i,n,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new THREE.Face3(t,e,r,n,a,o)},THREE.Vertex=function(t,e,r){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new THREE.Vector3(t,e,r)},Object.defineProperties(THREE.Object3D.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},getChildByName:{value:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)}},renderDepth:{set:function(t){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")}},translate:{value:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(t){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(THREE,{PointCloud:{value:function(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new THREE.Points(t,e)}},ParticleSystem:{value:function(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new THREE.Points(t,e)}}}),Object.defineProperties(THREE.Light.prototype,{onlyShadow:{set:function(t){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(t){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(t){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(THREE.BufferAttribute.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),this.array.length}}}),Object.defineProperties(THREE.BufferGeometry.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}},addIndex:{value:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)}},addDrawCall:{value:function(t,e,r){void 0!==r&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)}},clearDrawCalls:{value:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()}},computeTangents:{value:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")}},computeOffsets:{value:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}}),Object.defineProperties(THREE.Material.prototype,{wrapAround:{get:function(){console.warn("THREE."+this.type+": .wrapAround has been removed.")},set:function(t){console.warn("THREE."+this.type+": .wrapAround has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE."+this.type+": .wrapRGB has been removed."),new THREE.Color}}}),Object.defineProperties(THREE,{PointCloudMaterial:{value:function(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new THREE.PointsMaterial(t)}},ParticleBasicMaterial:{value:function(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new THREE.PointsMaterial(t)}},ParticleSystemMaterial:{value:function(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new THREE.PointsMaterial(t)}}}),Object.defineProperties(THREE.MeshPhongMaterial.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(t){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(THREE.ShaderMaterial.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.defineProperties(THREE.WebGLRenderer.prototype,{supportsFloatTextures:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")}},supportsHalfFloatTextures:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")}},supportsStandardDerivatives:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")}},supportsCompressedTextureS3TC:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")}},supportsCompressedTexturePVRTC:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")}},supportsBlendMinMax:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")}},supportsVertexTextures:{value:function(){return this.capabilities.vertexTextures}},supportsInstancedArrays:{value:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")}},enableScissorTest:{value:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)}},initMaterial:{value:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")}},addPrePlugin:{value:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")}},addPostPlugin:{value:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")}},updateShadowMap:{value:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}},shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){return this.shadowMap.cullFace},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),this.shadowMap.cullFace=t}}}),Object.defineProperties(THREE.WebGLRenderTarget.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(THREE.Audio.prototype,{load:{value:function(t){console.warn("THREE.Audio: .load has been deprecated. Please use THREE.AudioLoader.");var e=this,r=new THREE.AudioLoader;return r.load(t,function(t){e.setBuffer(t)}),this}}}),THREE.GeometryUtils={merge:function(t,e,r){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var i;e instanceof THREE.Mesh&&(e.matrixAutoUpdate&&e.updateMatrix(),i=e.matrix,e=e.geometry),t.merge(e,i,r)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}},THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(t,e,r,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var n=new THREE.TextureLoader;n.setCrossOrigin(this.crossOrigin);var a=n.load(t,r,void 0,i);return e&&(a.mapping=e),a},loadTextureCube:function(t,e,r,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var n=new THREE.CubeTextureLoader;n.setCrossOrigin(this.crossOrigin);var a=n.load(t,r,void 0,i);return e&&(a.mapping=e),a},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.")}},THREE.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().")}},THREE.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(){}},THREE.MeshFaceMaterial=THREE.MultiMaterial,Object.defineProperties(THREE.LOD.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),THREE.CurveUtils={tangentQuadraticBezier:function(t,e,r,i){return 2*(1-t)*(r-e)+2*t*(i-r)},tangentCubicBezier:function(t,e,r,i,n){return-3*e*(1-t)*(1-t)+3*r*(1-t)*(1-t)-6*t*r*(1-t)+6*t*i*(1-t)-3*t*t*i+3*t*t*n},tangentSpline:function(t,e,r,i,n){var a=6*t*t-6*t,o=3*t*t-4*t+1,s=-6*t*t+6*t,c=3*t*t-2*t;return a+o+s+c},interpolate:function(t,e,r,i,n){var a=.5*(r-t),o=.5*(i-e),s=n*n,c=n*s;return(2*e-2*r+a+o)*c+(-3*e+3*r-2*a-o)*s+a*n+e}},THREE.SceneUtils={createMultiMaterialObject:function(t,e){for(var r=new THREE.Group,i=0,n=e.length;i<n;i++)r.add(new THREE.Mesh(t,e[i]));return r},detach:function(t,e,r){t.applyMatrix(e.matrixWorld),e.remove(t),r.add(t)},attach:function(t,e,r){var i=new THREE.Matrix4;i.getInverse(r.matrixWorld),t.applyMatrix(i),e.remove(t),r.add(t)}},THREE.ShapeUtils={area:function(t){for(var e=t.length,r=0,i=e-1,n=0;n<e;i=n++)r+=t[i].x*t[n].y-t[n].x*t[i].y;return.5*r},triangulate:function(){function t(t,e,r,i,n,a){var o,s,c,h,l,u,p,d,E;if(s=t[a[e]].x,c=t[a[e]].y,h=t[a[r]].x,l=t[a[r]].y,u=t[a[i]].x,p=t[a[i]].y,Number.EPSILON>(h-s)*(p-c)-(l-c)*(u-s))return!1;var f,m,g,v,T,y,R,H,x,b,_,M,w,S,L;for(f=u-h,m=p-l,g=s-u,v=c-p,T=h-s,y=l-c,o=0;o<n;o++)if(d=t[a[o]].x,E=t[a[o]].y,!(d===s&&E===c||d===h&&E===l||d===u&&E===p)&&(R=d-s,H=E-c,x=d-h,b=E-l,_=d-u,M=E-p,L=f*b-m*x,w=T*H-y*R,S=g*M-v*_,L>=-Number.EPSILON&&S>=-Number.EPSILON&&w>=-Number.EPSILON))return!1;return!0}return function(e,r){var i=e.length;if(i<3)return null;var n,a,o,s=[],c=[],h=[];if(THREE.ShapeUtils.area(e)>0)for(a=0;a<i;a++)c[a]=a;else for(a=0;a<i;a++)c[a]=i-1-a;var l=i,u=2*l;for(a=l-1;l>2;){if(u--<=0)return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),r?h:s;if(n=a,l<=n&&(n=0),a=n+1,l<=a&&(a=0),o=a+1,l<=o&&(o=0),t(e,n,a,o,l,c)){var p,d,E,f,m;for(p=c[n],d=c[a],E=c[o],s.push([e[p],e[d],e[E]]),h.push([c[n],c[a],c[o]]),f=a,m=a+1;m<l;f++,m++)c[f]=c[m];l--,u=2*l}}return r?h:s}}(),triangulateShape:function(t,e){function r(t,e,r){return t.x!==e.x?t.x<e.x?t.x<=r.x&&r.x<=e.x:e.x<=r.x&&r.x<=t.x:t.y<e.y?t.y<=r.y&&r.y<=e.y:e.y<=r.y&&r.y<=t.y}function i(t,e,i,n,a){var o=e.x-t.x,s=e.y-t.y,c=n.x-i.x,h=n.y-i.y,l=t.x-i.x,u=t.y-i.y,p=s*c-o*h,d=s*l-o*u;if(Math.abs(p)>Number.EPSILON){var E;if(p>0){if(d<0||d>p)return[];if(E=h*l-c*u,E<0||E>p)return[]}else{if(d>0||d<p)return[];if(E=h*l-c*u,E>0||E<p)return[]}if(0===E)return!a||0!==d&&d!==p?[t]:[];if(E===p)return!a||0!==d&&d!==p?[e]:[];if(0===d)return[i];if(d===p)return[n];var f=E/p;return[{x:t.x+f*o,y:t.y+f*s}]}if(0!==d||h*l!==c*u)return[];var m=0===o&&0===s,g=0===c&&0===h;if(m&&g)return t.x!==i.x||t.y!==i.y?[]:[t];if(m)return r(i,n,t)?[t]:[];if(g)return r(t,e,i)?[i]:[];var v,T,y,R,H,x,b,_;return 0!==o?(t.x<e.x?(v=t,y=t.x,T=e,R=e.x):(v=e,y=e.x,T=t,R=t.x),i.x<n.x?(H=i,b=i.x,x=n,_=n.x):(H=n,b=n.x,x=i,_=i.x)):(t.y<e.y?(v=t,y=t.y,T=e,R=e.y):(v=e,y=e.y,T=t,R=t.y),i.y<n.y?(H=i,b=i.y,x=n,_=n.y):(H=n,b=n.y,x=i,_=i.y)),y<=b?R<b?[]:R===b?a?[]:[H]:R<=_?[H,T]:[H,x]:y>_?[]:y===_?a?[]:[v]:R<=_?[v,T]:[v,x]}function n(t,e,r,i){var n=e.x-t.x,a=e.y-t.y,o=r.x-t.x,s=r.y-t.y,c=i.x-t.x,h=i.y-t.y,l=n*s-a*o,u=n*h-a*c;if(Math.abs(l)>Number.EPSILON){var p=c*s-h*o;return l>0?u>=0&&p>=0:u>=0||p>=0}return u>0}function a(t,e){function r(t,e){var r=v.length-1,i=t-1;i<0&&(i=r);var a=t+1;a>r&&(a=0);var o=n(v[t],v[i],v[a],s[e]);if(!o)return!1;var c=s.length-1,h=e-1;h<0&&(h=c);var l=e+1;return l>c&&(l=0),o=n(s[e],s[h],s[l],v[t]),!!o}function a(t,e){var r,n,a;for(r=0;r<v.length;r++)if(n=r+1,n%=v.length,a=i(t,e,v[r],v[n],!0),a.length>0)return!0;return!1}function o(t,r){var n,a,o,s,c;for(n=0;n<T.length;n++)for(a=e[T[n]],o=0;o<a.length;o++)if(s=o+1,s%=a.length,c=i(t,r,a[o],a[s],!0),c.length>0)return!0;return!1}for(var s,c,h,l,u,p,d,E,f,m,g,v=t.concat(),T=[],y=[],R=0,H=e.length;R<H;R++)T.push(R);for(var x=0,b=2*T.length;T.length>0;){if(b--,b<0){console.log("Infinite Loop! Holes left:"+T.length+", Probably Hole outside Shape!");break}for(h=x;h<v.length;h++){l=v[h],c=-1;for(var R=0;R<T.length;R++)if(p=T[R],d=l.x+":"+l.y+":"+p,void 0===y[d]){s=e[p];for(var _=0;_<s.length;_++)if(u=s[_],r(h,_)&&!a(l,u)&&!o(l,u)){c=_,T.splice(R,1),E=v.slice(0,h+1),f=v.slice(h),m=s.slice(c),g=s.slice(0,c+1),v=E.concat(m).concat(g).concat(f),x=h;break}if(c>=0)break;y[d]=!0}if(c>=0)break}}return v}for(var o,s,c,h,l,u,p={},d=t.concat(),E=0,f=e.length;E<f;E++)Array.prototype.push.apply(d,e[E]);for(o=0,s=d.length;o<s;o++)l=d[o].x+":"+d[o].y,void 0!==p[l]&&console.warn("THREE.Shape: Duplicate point",l),p[l]=o;var m=a(t,e),g=THREE.ShapeUtils.triangulate(m,!1);for(o=0,s=g.length;o<s;o++)for(h=g[o],c=0;c<3;c++)l=h[c].x+":"+h[c].y,u=p[l],void 0!==u&&(h[c]=u);return g.concat()},isClockWise:function(t){return THREE.ShapeUtils.area(t)<0},b2:function(){function t(t,e){var r=1-t;return r*r*e}function e(t,e){return 2*(1-t)*t*e}function r(t,e){return t*t*e}return function(i,n,a,o){return t(i,n)+e(i,a)+r(i,o)}}(),b3:function(){function t(t,e){var r=1-t;return r*r*r*e}function e(t,e){var r=1-t;return 3*r*r*t*e}function r(t,e){var r=1-t;return 3*r*t*t*e}function i(t,e){return t*t*t*e}return function(n,a,o,s,c){return t(n,a)+e(n,o)+r(n,s)+i(n,c)}}()},THREE.Curve=function(){},THREE.Curve.prototype={constructor:THREE.Curve,getPoint:function(t){return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),null},getPointAt:function(t){var e=this.getUtoTmapping(t);return this.getPoint(e)},getPoints:function(t){t||(t=5);var e,r=[];for(e=0;e<=t;e++)r.push(this.getPoint(e/t));return r},getSpacedPoints:function(t){t||(t=5);var e,r=[];for(e=0;e<=t;e++)r.push(this.getPointAt(e/t));return r},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(t||(t=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,r,i=[],n=this.getPoint(0),a=0;for(i.push(0),r=1;r<=t;r++)e=this.getPoint(r/t),a+=e.distanceTo(n),i.push(a),n=e;return this.cacheArcLengths=i,i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var r,i=this.getLengths(),n=0,a=i.length;r=e?e:t*i[a-1];for(var o,s=0,c=a-1;s<=c;)if(n=Math.floor(s+(c-s)/2),o=i[n]-r,o<0)s=n+1;else{if(!(o>0)){c=n;break}c=n-1}if(n=c,i[n]===r){var h=n/(a-1);return h}var l=i[n],u=i[n+1],p=u-l,d=(r-l)/p,h=(n+d)/(a-1);return h},getTangent:function(t){var e=1e-4,r=t-e,i=t+e;r<0&&(r=0),i>1&&(i=1);var n=this.getPoint(r),a=this.getPoint(i),o=a.clone().sub(n);return o.normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)}},THREE.Curve.create=function(t,e){return t.prototype=Object.create(THREE.Curve.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},THREE.CurvePath=function(){this.curves=[],this.autoClose=!1},THREE.CurvePath.prototype=Object.create(THREE.Curve.prototype),THREE.CurvePath.prototype.constructor=THREE.CurvePath,THREE.CurvePath.prototype.add=function(t){this.curves.push(t)},THREE.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 THREE.LineCurve(e,t))},THREE.CurvePath.prototype.getPoint=function(t){for(var e=t*this.getLength(),r=this.getCurveLengths(),i=0;i<r.length;){if(r[i]>=e){var n=r[i]-e,a=this.curves[i],o=1-n/a.getLength();return a.getPointAt(o)}i++}return null},THREE.CurvePath.prototype.getLength=function(){var t=this.getCurveLengths();return t[t.length-1]},THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,r=0,i=this.curves.length;r<i;r++)e+=this.curves[r].getLength(),t.push(e);return this.cacheLengths=t,t},THREE.CurvePath.prototype.createPointsGeometry=function(t){var e=this.getPoints(t);return this.createGeometry(e)},THREE.CurvePath.prototype.createSpacedPointsGeometry=function(t){var e=this.getSpacedPoints(t);return this.createGeometry(e)},THREE.CurvePath.prototype.createGeometry=function(t){for(var e=new THREE.Geometry,r=0,i=t.length;r<i;r++){var n=t[r];e.vertices.push(new THREE.Vector3(n.x,n.y,n.z||0))}return e},THREE.Font=function(t){this.data=t},THREE.Font.prototype={constructor:THREE.Font,generateShapes:function(t,e,r){function i(t){for(var r=String(t).split(""),i=e/a.resolution,o=0,s=[],c=0;c<r.length;c++){var h=n(r[c],i,o);o+=h.offset,s.push(h.path)}return s}function n(t,e,i){var n=a.glyphs[t]||a.glyphs["?"];if(n){var o,s,c,h,l,u,p,d,E,f,m,g=new THREE.Path,v=[],T=THREE.ShapeUtils.b2,y=THREE.ShapeUtils.b3;if(n.o)for(var R=n._cachedOutline||(n._cachedOutline=n.o.split(" ")),H=0,x=R.length;H<x;){var b=R[H++];switch(b){case"m":o=R[H++]*e+i,s=R[H++]*e,g.moveTo(o,s);break;case"l":o=R[H++]*e+i,s=R[H++]*e,g.lineTo(o,s);break;case"q":if(c=R[H++]*e+i,h=R[H++]*e,p=R[H++]*e+i,d=R[H++]*e,g.quadraticCurveTo(p,d,c,h),m=v[v.length-1]){l=m.x,u=m.y;for(var _=1;_<=r;_++){var M=_/r;T(M,l,p,c),T(M,u,d,h)}}break;case"b":if(c=R[H++]*e+i,h=R[H++]*e,p=R[H++]*e+i,d=R[H++]*e,E=R[H++]*e+i,f=R[H++]*e,g.bezierCurveTo(p,d,E,f,c,h),m=v[v.length-1]){l=m.x,u=m.y;for(var _=1;_<=r;_++){var M=_/r;y(M,l,p,E,c),y(M,u,d,f,h)}}}}return{offset:n.ha*e,path:g}}}void 0===e&&(e=100),void 0===r&&(r=4);for(var a=this.data,o=i(t),s=[],c=0,h=o.length;c<h;c++)Array.prototype.push.apply(s,o[c].toShapes());return s}},THREE.Path=function(t){THREE.CurvePath.call(this),this.actions=[],t&&this.fromPoints(t)},THREE.Path.prototype=Object.create(THREE.CurvePath.prototype),THREE.Path.prototype.constructor=THREE.Path,THREE.Path.prototype.fromPoints=function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,r=t.length;e<r;e++)this.lineTo(t[e].x,t[e].y)},THREE.Path.prototype.moveTo=function(t,e){this.actions.push({action:"moveTo",args:[t,e]})},THREE.Path.prototype.lineTo=function(t,e){var r=this.actions[this.actions.length-1].args,i=r[r.length-2],n=r[r.length-1],a=new THREE.LineCurve(new THREE.Vector2(i,n),new THREE.Vector2(t,e));this.curves.push(a),this.actions.push({action:"lineTo",args:[t,e]})},THREE.Path.prototype.quadraticCurveTo=function(t,e,r,i){var n=this.actions[this.actions.length-1].args,a=n[n.length-2],o=n[n.length-1],s=new THREE.QuadraticBezierCurve(new THREE.Vector2(a,o),new THREE.Vector2(t,e),new THREE.Vector2(r,i));this.curves.push(s),this.actions.push({action:"quadraticCurveTo",args:[t,e,r,i]})},THREE.Path.prototype.bezierCurveTo=function(t,e,r,i,n,a){var o=this.actions[this.actions.length-1].args,s=o[o.length-2],c=o[o.length-1],h=new THREE.CubicBezierCurve(new THREE.Vector2(s,c),new THREE.Vector2(t,e),new THREE.Vector2(r,i),new THREE.Vector2(n,a));this.curves.push(h),this.actions.push({action:"bezierCurveTo",args:[t,e,r,i,n,a]})},THREE.Path.prototype.splineThru=function(t){var e=Array.prototype.slice.call(arguments),r=this.actions[this.actions.length-1].args,i=r[r.length-2],n=r[r.length-1],a=[new THREE.Vector2(i,n)];Array.prototype.push.apply(a,t);var o=new THREE.SplineCurve(a);this.curves.push(o),this.actions.push({action:"splineThru",args:e})},THREE.Path.prototype.arc=function(t,e,r,i,n,a){var o=this.actions[this.actions.length-1].args,s=o[o.length-2],c=o[o.length-1];this.absarc(t+s,e+c,r,i,n,a)},THREE.Path.prototype.absarc=function(t,e,r,i,n,a){this.absellipse(t,e,r,r,i,n,a)},THREE.Path.prototype.ellipse=function(t,e,r,i,n,a,o,s){var c=this.actions[this.actions.length-1].args,h=c[c.length-2],l=c[c.length-1];this.absellipse(t+h,e+l,r,i,n,a,o,s)},THREE.Path.prototype.absellipse=function(t,e,r,i,n,a,o,s){var c=[t,e,r,i,n,a,o,s||0],h=new THREE.EllipseCurve(t,e,r,i,n,a,o,s);this.curves.push(h);var l=h.getPoint(1);c.push(l.x),c.push(l.y),this.actions.push({action:"ellipse",args:c})},THREE.Path.prototype.getSpacedPoints=function(t){t||(t=40);for(var e=[],r=0;r<t;r++)e.push(this.getPoint(r/t));return this.autoClose&&e.push(e[0]),e},THREE.Path.prototype.getPoints=function(t){t=t||12;for(var e,r,i,n,a,o,s,c,h,l,u,p=THREE.ShapeUtils.b2,d=THREE.ShapeUtils.b3,E=[],f=0,m=this.actions.length;f<m;f++){var g=this.actions[f],v=g.action,T=g.args;switch(v){case"moveTo":E.push(new THREE.Vector2(T[0],T[1]));break;case"lineTo":E.push(new THREE.Vector2(T[0],T[1]));break;case"quadraticCurveTo":e=T[2],r=T[3],a=T[0],o=T[1],E.length>0?(h=E[E.length-1],s=h.x,c=h.y):(h=this.actions[f-1].args,s=h[h.length-2],c=h[h.length-1]);for(var y=1;y<=t;y++){var R=y/t;l=p(R,s,a,e),u=p(R,c,o,r),E.push(new THREE.Vector2(l,u))}break;case"bezierCurveTo":e=T[4],r=T[5],a=T[0],o=T[1],i=T[2],n=T[3],E.length>0?(h=E[E.length-1],s=h.x,c=h.y):(h=this.actions[f-1].args,s=h[h.length-2],c=h[h.length-1]);for(var y=1;y<=t;y++){var R=y/t;l=d(R,s,a,i,e),u=d(R,c,o,n,r),E.push(new THREE.Vector2(l,u))}break;case"splineThru":h=this.actions[f-1].args;var H=new THREE.Vector2(h[h.length-2],h[h.length-1]),x=[H],b=t*T[0].length;x=x.concat(T[0]);for(var _=new THREE.SplineCurve(x),y=1;y<=b;y++)E.push(_.getPointAt(y/b));break;case"arc":for(var M,w=T[0],S=T[1],L=T[2],A=T[3],C=T[4],P=!!T[5],B=C-A,D=2*t,y=1;y<=D;y++){var R=y/D;P||(R=1-R),M=A+R*B,l=w+L*Math.cos(M),u=S+L*Math.sin(M),E.push(new THREE.Vector2(l,u))}break;case"ellipse":var M,I,U,w=T[0],S=T[1],F=T[2],N=T[3],A=T[4],C=T[5],P=!!T[6],O=T[7],B=C-A,D=2*t;0!==O&&(I=Math.cos(O),U=Math.sin(O));for(var y=1;y<=D;y++){var R=y/D;if(P||(R=1-R),M=A+R*B,l=w+F*Math.cos(M),u=S+N*Math.sin(M),0!==O){var V=l,G=u;l=(V-w)*I-(G-S)*U+w,u=(V-w)*U+(G-S)*I+S}E.push(new THREE.Vector2(l,u))}}}var z=E[E.length-1];return Math.abs(z.x-E[0].x)<Number.EPSILON&&Math.abs(z.y-E[0].y)<Number.EPSILON&&E.splice(E.length-1,1),this.autoClose&&E.push(E[0]),E},THREE.Path.prototype.toShapes=function(t,e){function r(t){for(var e=[],r=new THREE.Path,i=0,n=t.length;i<n;i++){var a=t[i],o=a.args,s=a.action;"moveTo"===s&&0!==r.actions.length&&(e.push(r),r=new THREE.Path),r[s].apply(r,o)}return 0!==r.actions.length&&e.push(r),e}function i(t){for(var e=[],r=0,i=t.length;r<i;r++){var n=t[r],a=new THREE.Shape;a.actions=n.actions,a.curves=n.curves,e.push(a)}return e}function n(t,e){for(var r=e.length,i=!1,n=r-1,a=0;a<r;n=a++){var o=e[n],s=e[a],c=s.x-o.x,h=s.y-o.y;if(Math.abs(h)>Number.EPSILON){if(h<0&&(o=e[a],c=-c,s=e[n],h=-h),t.y<o.y||t.y>s.y)continue;if(t.y===o.y){if(t.x===o.x)return!0}else{var l=h*(t.x-o.x)-c*(t.y-o.y);if(0===l)return!0;if(l<0)continue;i=!i}}else{if(t.y!==o.y)continue;if(s.x<=t.x&&t.x<=o.x||o.x<=t.x&&t.x<=s.x)return!0}}return i}var a=THREE.ShapeUtils.isClockWise,o=r(this.actions);if(0===o.length)return[];if(e===!0)return i(o);var s,c,h,l=[];if(1===o.length)return c=o[0],h=new THREE.Shape,h.actions=c.actions,h.curves=c.curves,l.push(h),l;var u=!a(o[0].getPoints());u=t?!u:u;var p,d=[],E=[],f=[],m=0;E[m]=void 0,f[m]=[];for(var g=0,v=o.length;g<v;g++)c=o[g],p=c.getPoints(),s=a(p),s=t?!s:s,s?(!u&&E[m]&&m++,E[m]={s:new THREE.Shape,p:p},E[m].s.actions=c.actions,E[m].s.curves=c.curves,u&&m++,f[m]=[]):f[m].push({h:c,p:p[0]});if(!E[0])return i(o);if(E.length>1){for(var T=!1,y=[],R=0,H=E.length;R<H;R++)d[R]=[];for(var R=0,H=E.length;R<H;R++)for(var x=f[R],b=0;b<x.length;b++){for(var _=x[b],M=!0,w=0;w<E.length;w++)n(_.p,E[w].p)&&(R!==w&&y.push({froms:R,tos:w,hole:b}),M?(M=!1,d[w].push(_)):T=!0);M&&d[R].push(_)}y.length>0&&(T||(f=d))}for(var S,g=0,L=E.length;g<L;g++){h=E[g].s,l.push(h),S=f[g];for(var A=0,C=S.length;A<C;A++)h.holes.push(S[A].h)}return l},THREE.Shape=function(){THREE.Path.apply(this,arguments),this.holes=[]},THREE.Shape.prototype=Object.create(THREE.Path.prototype),THREE.Shape.prototype.constructor=THREE.Shape,THREE.Shape.prototype.extrude=function(t){return new THREE.ExtrudeGeometry(this,t)},THREE.Shape.prototype.makeGeometry=function(t){return new THREE.ShapeGeometry(this,t)},THREE.Shape.prototype.getPointsHoles=function(t){for(var e=[],r=0,i=this.holes.length;r<i;r++)e[r]=this.holes[r].getPoints(t);return e},THREE.Shape.prototype.extractAllPoints=function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},THREE.Shape.prototype.extractPoints=function(t){return this.extractAllPoints(t)},THREE.LineCurve=function(t,e){this.v1=t,this.v2=e},THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype),THREE.LineCurve.prototype.constructor=THREE.LineCurve,THREE.LineCurve.prototype.getPoint=function(t){var e=this.v2.clone().sub(this.v1);return e.multiplyScalar(t).add(this.v1),e},THREE.LineCurve.prototype.getPointAt=function(t){return this.getPoint(t)},THREE.LineCurve.prototype.getTangent=function(t){var e=this.v2.clone().sub(this.v1);return e.normalize()},THREE.QuadraticBezierCurve=function(t,e,r){this.v0=t,this.v1=e,this.v2=r},THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype),THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve,THREE.QuadraticBezierCurve.prototype.getPoint=function(t){var e=THREE.ShapeUtils.b2;return new THREE.Vector2(e(t,this.v0.x,this.v1.x,this.v2.x),e(t,this.v0.y,this.v1.y,this.v2.y))},THREE.QuadraticBezierCurve.prototype.getTangent=function(t){var e=THREE.CurveUtils.tangentQuadraticBezier;return new THREE.Vector2(e(t,this.v0.x,this.v1.x,this.v2.x),e(t,this.v0.y,this.v1.y,this.v2.y)).normalize()},THREE.CubicBezierCurve=function(t,e,r,i){this.v0=t,this.v1=e,this.v2=r,this.v3=i},THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype),THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve,THREE.CubicBezierCurve.prototype.getPoint=function(t){var e=THREE.ShapeUtils.b3;return new THREE.Vector2(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))},THREE.CubicBezierCurve.prototype.getTangent=function(t){var e=THREE.CurveUtils.tangentCubicBezier;return new THREE.Vector2(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)).normalize();
},THREE.SplineCurve=function(t){this.points=void 0==t?[]:t},THREE.SplineCurve.prototype=Object.create(THREE.Curve.prototype),THREE.SplineCurve.prototype.constructor=THREE.SplineCurve,THREE.SplineCurve.prototype.getPoint=function(t){var e=this.points,r=(e.length-1)*t,i=Math.floor(r),n=r-i,a=e[0===i?i:i-1],o=e[i],s=e[i>e.length-2?e.length-1:i+1],c=e[i>e.length-3?e.length-1:i+2],h=THREE.CurveUtils.interpolate;return new THREE.Vector2(h(a.x,o.x,s.x,c.x,n),h(a.y,o.y,s.y,c.y,n))},THREE.EllipseCurve=function(t,e,r,i,n,a,o,s){this.aX=t,this.aY=e,this.xRadius=r,this.yRadius=i,this.aStartAngle=n,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s||0},THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype),THREE.EllipseCurve.prototype.constructor=THREE.EllipseCurve,THREE.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 i=this.aX+this.xRadius*Math.cos(r),n=this.aY+this.yRadius*Math.sin(r);if(0!==this.aRotation){var a=Math.cos(this.aRotation),o=Math.sin(this.aRotation),s=i,c=n;i=(s-this.aX)*a-(c-this.aY)*o+this.aX,n=(s-this.aX)*o+(c-this.aY)*a+this.aY}return new THREE.Vector2(i,n)},THREE.ArcCurve=function(t,e,r,i,n,a){THREE.EllipseCurve.call(this,t,e,r,r,i,n,a)},THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype),THREE.ArcCurve.prototype.constructor=THREE.ArcCurve,THREE.LineCurve3=THREE.Curve.create(function(t,e){this.v1=t,this.v2=e},function(t){var e=new THREE.Vector3;return e.subVectors(this.v2,this.v1),e.multiplyScalar(t),e.add(this.v1),e}),THREE.QuadraticBezierCurve3=THREE.Curve.create(function(t,e,r){this.v0=t,this.v1=e,this.v2=r},function(t){var e=THREE.ShapeUtils.b2;return new THREE.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))});THREE.CubicBezierCurve3=THREE.Curve.create(function(t,e,r,i){this.v0=t,this.v1=e,this.v2=r,this.v3=i},function(t){var e=THREE.ShapeUtils.b3;return new THREE.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))});THREE.SplineCurve3=THREE.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,i=Math.floor(r),n=r-i,a=e[0==i?i:i-1],o=e[i],s=e[i>e.length-2?e.length-1:i+1],c=e[i>e.length-3?e.length-1:i+2],h=THREE.CurveUtils.interpolate;return new THREE.Vector3(h(a.x,o.x,s.x,c.x,n),h(a.y,o.y,s.y,c.y,n),h(a.z,o.z,s.z,c.z,n))}),THREE.CatmullRomCurve3=function(){function t(){}var e=new THREE.Vector3,r=new t,i=new t,n=new t;return t.prototype.init=function(t,e,r,i){this.c0=t,this.c1=r,this.c2=-3*t+3*e-2*r-i,this.c3=2*t-2*e+r+i},t.prototype.initNonuniformCatmullRom=function(t,e,r,i,n,a,o){var s=(e-t)/n-(r-t)/(n+a)+(r-e)/a,c=(r-e)/a-(i-e)/(a+o)+(i-r)/o;s*=a,c*=a,this.init(e,r,s,c)},t.prototype.initCatmullRom=function(t,e,r,i,n){this.init(e,r,n*(r-t),n*(i-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},THREE.Curve.create(function(t){this.points=t||[],this.closed=!1},function(t){var a,o,s,c,h=this.points;c=h.length,c<2&&console.log("duh, you need at least 2 points"),a=(c-(this.closed?0:1))*t,o=Math.floor(a),s=a-o,this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/h.length)+1)*h.length:0===s&&o===c-1&&(o=c-2,s=1);var l,u,p,d;if(this.closed||o>0?l=h[(o-1)%c]:(e.subVectors(h[0],h[1]).add(h[0]),l=e),u=h[o%c],p=h[(o+1)%c],this.closed||o+2<c?d=h[(o+2)%c]:(e.subVectors(h[c-1],h[c-2]).add(h[c-1]),d=e),void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var E="chordal"===this.type?.5:.25,f=Math.pow(l.distanceToSquared(u),E),m=Math.pow(u.distanceToSquared(p),E),g=Math.pow(p.distanceToSquared(d),E);m<1e-4&&(m=1),f<1e-4&&(f=m),g<1e-4&&(g=m),r.initNonuniformCatmullRom(l.x,u.x,p.x,d.x,f,m,g),i.initNonuniformCatmullRom(l.y,u.y,p.y,d.y,f,m,g),n.initNonuniformCatmullRom(l.z,u.z,p.z,d.z,f,m,g)}else if("catmullrom"===this.type){var v=void 0!==this.tension?this.tension:.5;r.initCatmullRom(l.x,u.x,p.x,d.x,v),i.initCatmullRom(l.y,u.y,p.y,d.y,v),n.initCatmullRom(l.z,u.z,p.z,d.z,v)}var T=new THREE.Vector3(r.calc(s),i.calc(s),n.calc(s));return T})}(),THREE.ClosedSplineCurve3=function(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),THREE.CatmullRomCurve3.call(this,t),this.type="catmullrom",this.closed=!0},THREE.ClosedSplineCurve3.prototype=Object.create(THREE.CatmullRomCurve3.prototype),THREE.BoxGeometry=function(t,e,r,i,n,a){THREE.Geometry.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:r,widthSegments:i,heightSegments:n,depthSegments:a},this.fromBufferGeometry(new THREE.BoxBufferGeometry(t,e,r,i,n,a)),this.mergeVertices()},THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry,THREE.CubeGeometry=THREE.BoxGeometry,THREE.BoxBufferGeometry=function(t,e,r,i,n,a){function o(t,e,r){var i=0;return i+=t*e*2,i+=t*r*2,i+=r*e*2,4*i}function s(t,e,r,i,n,a,o,s,h,l,y){for(var R=a/h,H=o/l,x=a/2,b=o/2,_=s/2,M=h+1,w=l+1,S=0,L=0,A=new THREE.Vector3,C=0;C<w;C++)for(var P=C*H-b,B=0;B<M;B++){var D=B*R-x;A[t]=D*i,A[e]=P*n,A[r]=_,p[f]=A.x,p[f+1]=A.y,p[f+2]=A.z,A[t]=0,A[e]=0,A[r]=s>0?1:-1,d[f]=A.x,d[f+1]=A.y,d[f+2]=A.z,E[m]=B/h,E[m+1]=1-C/l,f+=3,m+=2,S+=1}for(C=0;C<l;C++)for(B=0;B<h;B++){var I=v+B+M*C,U=v+B+M*(C+1),F=v+(B+1)+M*(C+1),N=v+(B+1)+M*C;u[g]=I,u[g+1]=U,u[g+2]=N,u[g+3]=U,u[g+4]=F,u[g+5]=N,g+=6,L+=6}c.addGroup(T,L,y),T+=L,v+=S}THREE.BufferGeometry.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:r,widthSegments:i,heightSegments:n,depthSegments:a};var c=this;i=Math.floor(i)||1,n=Math.floor(n)||1,a=Math.floor(a)||1;var h=o(i,n,a),l=h/4*6,u=new(l>65535?Uint32Array:Uint16Array)(l),p=new Float32Array(3*h),d=new Float32Array(3*h),E=new Float32Array(2*h),f=0,m=0,g=0,v=0,T=0;s("z","y","x",-1,-1,r,e,t,a,n,0),s("z","y","x",1,-1,r,e,-t,a,n,1),s("x","z","y",1,1,t,r,e,i,a,2),s("x","z","y",1,-1,t,r,-e,i,a,3),s("x","y","z",1,-1,t,e,r,i,n,4),s("x","y","z",-1,-1,t,e,-r,i,n,5),this.setIndex(new THREE.BufferAttribute(u,1)),this.addAttribute("position",new THREE.BufferAttribute(p,3)),this.addAttribute("normal",new THREE.BufferAttribute(d,3)),this.addAttribute("uv",new THREE.BufferAttribute(E,2))},THREE.BoxBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.BoxBufferGeometry.prototype.constructor=THREE.BoxBufferGeometry,THREE.CircleGeometry=function(t,e,r,i){THREE.Geometry.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:r,thetaLength:i},this.fromBufferGeometry(new THREE.CircleBufferGeometry(t,e,r,i))},THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry,THREE.CircleBufferGeometry=function(t,e,r,i){THREE.BufferGeometry.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:r,thetaLength:i},t=t||50,e=void 0!==e?Math.max(3,e):8,r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI;var n=e+2,a=new Float32Array(3*n),o=new Float32Array(3*n),s=new Float32Array(2*n);o[2]=1,s[0]=.5,s[1]=.5;for(var c=0,h=3,l=2;c<=e;c++,h+=3,l+=2){var u=r+c/e*i;a[h]=t*Math.cos(u),a[h+1]=t*Math.sin(u),o[h+2]=1,s[l]=(a[h]/t+1)/2,s[l+1]=(a[h+1]/t+1)/2}for(var p=[],h=1;h<=e;h++)p.push(h,h+1,0);this.setIndex(new THREE.BufferAttribute(new Uint16Array(p),1)),this.addAttribute("position",new THREE.BufferAttribute(a,3)),this.addAttribute("normal",new THREE.BufferAttribute(o,3)),this.addAttribute("uv",new THREE.BufferAttribute(s,2)),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,t)},THREE.CircleBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.CircleBufferGeometry.prototype.constructor=THREE.CircleBufferGeometry,THREE.CylinderBufferGeometry=function(t,e,r,i,n,a,o,s){function c(){var t=(i+1)*(n+1);return a===!1&&(t+=2*(i+1)+2*i),t}function h(){var t=i*n*2*3;return a===!1&&(t+=2*i*3),t}function l(){var a,c,h=new THREE.Vector3,l=new THREE.Vector3,u=0,d=(e-t)/r;for(c=0;c<=n;c++){var E=[],b=c/n,_=b*(e-t)+t;for(a=0;a<=i;a++){var M=a/i;l.x=_*Math.sin(M*s+o),l.y=-b*r+H,l.z=_*Math.cos(M*s+o),m.setXYZ(T,l.x,l.y,l.z),h.copy(l),(0===t&&0===c||0===e&&c===n)&&(h.x=Math.sin(M*s+o),h.z=Math.cos(M*s+o)),h.setY(Math.sqrt(h.x*h.x+h.z*h.z)*d).normalize(),g.setXYZ(T,h.x,h.y,h.z),v.setXY(T,M,1-b),E.push(T),T++}R.push(E)}for(a=0;a<i;a++)for(c=0;c<n;c++){var w=R[c][a],S=R[c+1][a],L=R[c+1][a+1],A=R[c][a+1];f.setX(y,w),y++,f.setX(y,S),y++,f.setX(y,A),y++,f.setX(y,S),y++,f.setX(y,L),y++,f.setX(y,A),y++,u+=6}p.addGroup(x,u,0),x+=u}function u(r){var n,a,c,h=new THREE.Vector2,l=new THREE.Vector3,u=0,d=r===!0?t:e,E=r===!0?1:-1;for(a=T,n=1;n<=i;n++)m.setXYZ(T,0,H*E,0),g.setXYZ(T,0,E,0),r===!0?(h.x=n/i,h.y=0):(h.x=(n-1)/i,h.y=1),v.setXY(T,h.x,h.y),T++;for(c=T,n=0;n<=i;n++){var R=n/i;l.x=d*Math.sin(R*s+o),l.y=H*E,l.z=d*Math.cos(R*s+o),m.setXYZ(T,l.x,l.y,l.z),g.setXYZ(T,0,E,0),v.setXY(T,R,r===!0?1:0),T++}for(n=0;n<i;n++){var b=a+n,_=c+n;r===!0?(f.setX(y,_),y++,f.setX(y,_+1),y++,f.setX(y,b),y++):(f.setX(y,_+1),y++,f.setX(y,_),y++,f.setX(y,b),y++),u+=3}p.addGroup(x,u,r===!0?1:2),x+=u}THREE.BufferGeometry.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:r,radialSegments:i,heightSegments:n,openEnded:a,thetaStart:o,thetaLength:s};var p=this;t=void 0!==t?t:20,e=void 0!==e?e:20,r=void 0!==r?r:100,i=Math.floor(i)||8,n=Math.floor(n)||1,a=void 0!==a&&a,o=void 0!==o?o:0,s=void 0!==s?s:2*Math.PI;var d=c(),E=h(),f=new THREE.BufferAttribute(new(E>65535?Uint32Array:Uint16Array)(E),1),m=new THREE.BufferAttribute(new Float32Array(3*d),3),g=new THREE.BufferAttribute(new Float32Array(3*d),3),v=new THREE.BufferAttribute(new Float32Array(2*d),2),T=0,y=0,R=[],H=r/2,x=0;l(),a===!1&&(t>0&&u(!0),e>0&&u(!1)),this.setIndex(f),this.addAttribute("position",m),this.addAttribute("normal",g),this.addAttribute("uv",v)},THREE.CylinderBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.CylinderBufferGeometry.prototype.constructor=THREE.CylinderBufferGeometry,THREE.CylinderGeometry=function(t,e,r,i,n,a,o,s){THREE.Geometry.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:r,radialSegments:i,heightSegments:n,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new THREE.CylinderBufferGeometry(t,e,r,i,n,a,o,s)),this.mergeVertices()},THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry,THREE.EdgesGeometry=function(t,e){function r(t,e){return t-e}THREE.BufferGeometry.call(this),e=void 0!==e?e:1;var i,n=Math.cos(THREE.Math.DEG2RAD*e),a=[0,0],o={},s=["a","b","c"];t instanceof THREE.BufferGeometry?(i=new THREE.Geometry,i.fromBufferGeometry(t)):i=t.clone(),i.mergeVertices(),i.computeFaceNormals();for(var c=i.vertices,h=i.faces,l=0,u=h.length;l<u;l++)for(var p=h[l],d=0;d<3;d++){a[0]=p[s[d]],a[1]=p[s[(d+1)%3]],a.sort(r);var E=a.toString();void 0===o[E]?o[E]={vert1:a[0],vert2:a[1],face1:l,face2:void 0}:o[E].face2=l}var f=[];for(var E in o){var m=o[E];if(void 0===m.face2||h[m.face1].normal.dot(h[m.face2].normal)<=n){var g=c[m.vert1];f.push(g.x),f.push(g.y),f.push(g.z),g=c[m.vert2],f.push(g.x),f.push(g.y),f.push(g.z)}}this.addAttribute("position",new THREE.BufferAttribute(new Float32Array(f),3))},THREE.EdgesGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.EdgesGeometry.prototype.constructor=THREE.EdgesGeometry,THREE.ExtrudeGeometry=function(t,e){return"undefined"==typeof t?void(t=[]):(THREE.Geometry.call(this),this.type="ExtrudeGeometry",t=Array.isArray(t)?t:[t],this.addShapeList(t,e),void this.computeFaceNormals())},THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry,THREE.ExtrudeGeometry.prototype.addShapeList=function(t,e){for(var r=t.length,i=0;i<r;i++){var n=t[i];this.addShape(n,e)}},THREE.ExtrudeGeometry.prototype.addShape=function(t,e){function r(t,e,r){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(r).add(t)}function i(t,e,r){var i,n,a=1,o=t.x-e.x,s=t.y-e.y,c=r.x-t.x,h=r.y-t.y,l=o*o+s*s,u=o*h-s*c;if(Math.abs(u)>Number.EPSILON){var p=Math.sqrt(l),d=Math.sqrt(c*c+h*h),E=e.x-s/p,f=e.y+o/p,m=r.x-h/d,g=r.y+c/d,v=((m-E)*h-(g-f)*c)/(o*h-s*c);i=E+o*v-t.x,n=f+s*v-t.y;var T=i*i+n*n;if(T<=2)return new THREE.Vector2(i,n);a=Math.sqrt(T/2)}else{var y=!1;o>Number.EPSILON?c>Number.EPSILON&&(y=!0):o<-Number.EPSILON?c<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(h)&&(y=!0),y?(i=-s,n=o,a=Math.sqrt(l)):(i=o,n=s,a=Math.sqrt(l/2))}return new THREE.Vector2(i/a,n/a)}function n(){if(T){var t=0,e=z*t;for(W=0;W<k;W++)G=D[W],c(G[2]+e,G[1]+e,G[0]+e);for(t=R+2*v,e=z*t,W=0;W<k;W++)G=D[W],c(G[0]+e,G[1]+e,G[2]+e)}else{for(W=0;W<k;W++)G=D[W],c(G[2],G[1],G[0]);for(W=0;W<k;W++)G=D[W],c(G[0]+z*R,G[1]+z*R,G[2]+z*R)}}function a(){var t=0;for(o(I,t),t+=I.length,M=0,w=P.length;M<w;M++)_=P[M],o(_,t),t+=_.length}function o(t,e){var r,i;for(W=t.length;--W>=0;){r=W,i=W-1,i<0&&(i=t.length-1);var n=0,a=R+2*v;for(n=0;n<a;n++){var o=z*n,s=z*(n+1),c=e+r+o,l=e+i+o,u=e+i+s,p=e+r+s;h(c,l,u,p,t,n,a,r,i)}}}function s(t,e,r){S.vertices.push(new THREE.Vector3(t,e,r))}function c(t,e,r){t+=L,e+=L,r+=L,S.faces.push(new THREE.Face3(t,e,r,null,null,0));var i=b.generateTopUV(S,t,e,r);S.faceVertexUvs[0].push(i)}function h(t,e,r,i,n,a,o,s,c){t+=L,e+=L,r+=L,i+=L,S.faces.push(new THREE.Face3(t,e,i,null,null,1)),S.faces.push(new THREE.Face3(e,r,i,null,null,1));var h=b.generateSideWallUV(S,t,e,r,i);S.faceVertexUvs[0].push([h[0],h[1],h[3]]),S.faceVertexUvs[0].push([h[1],h[2],h[3]])}var l,u,p,d,E,f=void 0!==e.amount?e.amount:100,m=void 0!==e.bevelThickness?e.bevelThickness:6,g=void 0!==e.bevelSize?e.bevelSize:m-2,v=void 0!==e.bevelSegments?e.bevelSegments:3,T=void 0===e.bevelEnabled||e.bevelEnabled,y=void 0!==e.curveSegments?e.curveSegments:12,R=void 0!==e.steps?e.steps:1,H=e.extrudePath,x=!1,b=void 0!==e.UVGenerator?e.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator;H&&(l=H.getSpacedPoints(R),x=!0,T=!1,u=void 0!==e.frames?e.frames:new THREE.TubeGeometry.FrenetFrames(H,R,(!1)),p=new THREE.Vector3,d=new THREE.Vector3,E=new THREE.Vector3),T||(v=0,m=0,g=0);var _,M,w,S=this,L=this.vertices.length,A=t.extractPoints(y),C=A.shape,P=A.holes,B=!THREE.ShapeUtils.isClockWise(C);if(B){for(C=C.reverse(),M=0,w=P.length;M<w;M++)_=P[M],THREE.ShapeUtils.isClockWise(_)&&(P[M]=_.reverse());B=!1}var D=THREE.ShapeUtils.triangulateShape(C,P),I=C;for(M=0,w=P.length;M<w;M++)_=P[M],C=C.concat(_);for(var U,F,N,O,V,G,z=C.length,k=D.length,j=[],W=0,X=I.length,q=X-1,Y=W+1;W<X;W++,q++,Y++)q===X&&(q=0),Y===X&&(Y=0),j[W]=i(I[W],I[q],I[Y]);var Z,K=[],Q=j.concat();for(M=0,w=P.length;M<w;M++){for(_=P[M],Z=[],W=0,X=_.length,q=X-1,Y=W+1;W<X;W++,q++,Y++)q===X&&(q=0),Y===X&&(Y=0),Z[W]=i(_[W],_[q],_[Y]);K.push(Z),Q=Q.concat(Z)}for(U=0;U<v;U++){for(N=U/v,O=m*(1-N),F=g*Math.sin(N*Math.PI/2),W=0,X=I.length;W<X;W++)V=r(I[W],j[W],F),s(V.x,V.y,-O);for(M=0,w=P.length;M<w;M++)for(_=P[M],Z=K[M],W=0,X=_.length;W<X;W++)V=r(_[W],Z[W],F),s(V.x,V.y,-O)}for(F=g,W=0;W<z;W++)V=T?r(C[W],Q[W],F):C[W],x?(d.copy(u.normals[0]).multiplyScalar(V.x),p.copy(u.binormals[0]).multiplyScalar(V.y),E.copy(l[0]).add(d).add(p),s(E.x,E.y,E.z)):s(V.x,V.y,0);var J;for(J=1;J<=R;J++)for(W=0;W<z;W++)V=T?r(C[W],Q[W],F):C[W],x?(d.copy(u.normals[J]).multiplyScalar(V.x),p.copy(u.binormals[J]).multiplyScalar(V.y),E.copy(l[J]).add(d).add(p),s(E.x,E.y,E.z)):s(V.x,V.y,f/R*J);for(U=v-1;U>=0;U--){for(N=U/v,O=m*(1-N),F=g*Math.sin(N*Math.PI/2),W=0,X=I.length;W<X;W++)V=r(I[W],j[W],F),s(V.x,V.y,f+O);for(M=0,w=P.length;M<w;M++)for(_=P[M],Z=K[M],W=0,X=_.length;W<X;W++)V=r(_[W],Z[W],F),x?s(V.x,V.y+l[R-1].y,l[R-1].x+O):s(V.x,V.y,f+O)}n(),a()},THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(t,e,r,i){var n=t.vertices,a=n[e],o=n[r],s=n[i];return[new THREE.Vector2(a.x,a.y),new THREE.Vector2(o.x,o.y),new THREE.Vector2(s.x,s.y)]},generateSideWallUV:function(t,e,r,i,n){var a=t.vertices,o=a[e],s=a[r],c=a[i],h=a[n];return Math.abs(o.y-s.y)<.01?[new THREE.Vector2(o.x,1-o.z),new THREE.Vector2(s.x,1-s.z),new THREE.Vector2(c.x,1-c.z),new THREE.Vector2(h.x,1-h.z)]:[new THREE.Vector2(o.y,1-o.z),new THREE.Vector2(s.y,1-s.z),new THREE.Vector2(c.y,1-c.z),new THREE.Vector2(h.y,1-h.z)]}},THREE.ShapeGeometry=function(t,e){THREE.Geometry.call(this),this.type="ShapeGeometry",Array.isArray(t)===!1&&(t=[t]),this.addShapeList(t,e),this.computeFaceNormals()},THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry,THREE.ShapeGeometry.prototype.addShapeList=function(t,e){for(var r=0,i=t.length;r<i;r++)this.addShape(t[r],e);return this},THREE.ShapeGeometry.prototype.addShape=function(t,e){void 0===e&&(e={});var r,i,n,a=void 0!==e.curveSegments?e.curveSegments:12,o=e.material,s=void 0===e.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:e.UVGenerator,c=this.vertices.length,h=t.extractPoints(a),l=h.shape,u=h.holes,p=!THREE.ShapeUtils.isClockWise(l);if(p){for(l=l.reverse(),r=0,i=u.length;r<i;r++)n=u[r],THREE.ShapeUtils.isClockWise(n)&&(u[r]=n.reverse());p=!1}var d=THREE.ShapeUtils.triangulateShape(l,u);for(r=0,i=u.length;r<i;r++)n=u[r],l=l.concat(n);var E,f,m=l.length,g=d.length;for(r=0;r<m;r++)E=l[r],this.vertices.push(new THREE.Vector3(E.x,E.y,0));for(r=0;r<g;r++){f=d[r];var v=f[0]+c,T=f[1]+c,y=f[2]+c;this.faces.push(new THREE.Face3(v,T,y,null,null,o)),this.faceVertexUvs[0].push(s.generateTopUV(this,v,T,y))}},THREE.LatheBufferGeometry=function(t,e,r,i){THREE.BufferGeometry.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:r,phiLength:i},e=Math.floor(e)||12,r=r||0,i=i||2*Math.PI,i=THREE.Math.clamp(i,0,2*Math.PI);var n,a,o,s=(e+1)*t.length,c=e*t.length*2*3,h=new THREE.BufferAttribute(new(c>65535?Uint32Array:Uint16Array)(c),1),l=new THREE.BufferAttribute(new Float32Array(3*s),3),u=new THREE.BufferAttribute(new Float32Array(2*s),2),p=0,d=0,E=(1/(t.length-1),1/e),f=new THREE.Vector3,m=new THREE.Vector2;for(a=0;a<=e;a++){var g=r+a*E*i,v=Math.sin(g),T=Math.cos(g);for(o=0;o<=t.length-1;o++)f.x=t[o].x*v,f.y=t[o].y,f.z=t[o].x*T,l.setXYZ(p,f.x,f.y,f.z),m.x=a/e,m.y=o/(t.length-1),u.setXY(p,m.x,m.y),p++}for(a=0;a<e;a++)for(o=0;o<t.length-1;o++){n=o+a*t.length;var y=n,R=n+t.length,H=n+t.length+1,x=n+1;h.setX(d,y),d++,h.setX(d,R),d++,h.setX(d,x),d++,h.setX(d,R),d++,h.setX(d,H),d++,h.setX(d,x),d++}if(this.setIndex(h),this.addAttribute("position",l),this.addAttribute("uv",u),this.computeVertexNormals(),i===2*Math.PI){var b=this.attributes.normal.array,_=new THREE.Vector3,M=new THREE.Vector3,w=new THREE.Vector3;for(n=e*t.length*3,a=0,o=0;a<t.length;a++,o+=3)_.x=b[o+0],_.y=b[o+1],_.z=b[o+2],M.x=b[n+o+0],M.y=b[n+o+1],M.z=b[n+o+2],w.addVectors(_,M).normalize(),b[o+0]=b[n+o+0]=w.x,b[o+1]=b[n+o+1]=w.y,b[o+2]=b[n+o+2]=w.z}},THREE.LatheBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.LatheBufferGeometry.prototype.constructor=THREE.LatheBufferGeometry,THREE.LatheGeometry=function(t,e,r,i){THREE.Geometry.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:r,phiLength:i},this.fromBufferGeometry(new THREE.LatheBufferGeometry(t,e,r,i)),this.mergeVertices()},THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry,THREE.PlaneGeometry=function(t,e,r,i){THREE.Geometry.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:r,heightSegments:i},this.fromBufferGeometry(new THREE.PlaneBufferGeometry(t,e,r,i))},THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry,THREE.PlaneBufferGeometry=function(t,e,r,i){THREE.BufferGeometry.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:r,heightSegments:i};for(var n=t/2,a=e/2,o=Math.floor(r)||1,s=Math.floor(i)||1,c=o+1,h=s+1,l=t/o,u=e/s,p=new Float32Array(c*h*3),d=new Float32Array(c*h*3),E=new Float32Array(c*h*2),f=0,m=0,g=0;g<h;g++)for(var v=g*u-a,T=0;T<c;T++){var y=T*l-n;p[f]=y,p[f+1]=-v,d[f+2]=1,E[m]=T/o,E[m+1]=1-g/s,f+=3,m+=2}f=0;for(var R=new(p.length/3>65535?Uint32Array:Uint16Array)(o*s*6),g=0;g<s;g++)for(var T=0;T<o;T++){var H=T+c*g,x=T+c*(g+1),b=T+1+c*(g+1),_=T+1+c*g;R[f]=H,R[f+1]=x,R[f+2]=_,R[f+3]=x,R[f+4]=b,R[f+5]=_,f+=6}this.setIndex(new THREE.BufferAttribute(R,1)),this.addAttribute("position",new THREE.BufferAttribute(p,3)),this.addAttribute("normal",new THREE.BufferAttribute(d,3)),this.addAttribute("uv",new THREE.BufferAttribute(E,2))},THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry,THREE.RingBufferGeometry=function(t,e,r,i,n,a){THREE.BufferGeometry.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:r,phiSegments:i,thetaStart:n,thetaLength:a},t=t||20,e=e||50,n=void 0!==n?n:0,a=void 0!==a?a:2*Math.PI,r=void 0!==r?Math.max(3,r):8,i=void 0!==i?Math.max(1,i):1;var o,s,c,h=(r+1)*(i+1),l=r*i*2*3,u=new THREE.BufferAttribute(new(l>65535?Uint32Array:Uint16Array)(l),1),p=new THREE.BufferAttribute(new Float32Array(3*h),3),d=new THREE.BufferAttribute(new Float32Array(3*h),3),E=new THREE.BufferAttribute(new Float32Array(2*h),2),f=0,m=0,g=t,v=(e-t)/i,T=new THREE.Vector3,y=new THREE.Vector2;for(s=0;s<=i;s++){for(c=0;c<=r;c++)o=n+c/r*a,T.x=g*Math.cos(o),T.y=g*Math.sin(o),p.setXYZ(f,T.x,T.y,T.z),d.setXYZ(f,0,0,1),y.x=(T.x/e+1)/2,y.y=(T.y/e+1)/2,E.setXY(f,y.x,y.y),f++;g+=v}for(s=0;s<i;s++){var R=s*(r+1);for(c=0;c<r;c++){o=c+R;var H=o,x=o+r+1,b=o+r+2,_=o+1;u.setX(m,H),m++,u.setX(m,x),m++,u.setX(m,b),m++,u.setX(m,H),m++,u.setX(m,b),m++,u.setX(m,_),m++}}this.setIndex(u),this.addAttribute("position",p),this.addAttribute("normal",d),this.addAttribute("uv",E)},THREE.RingBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.RingBufferGeometry.prototype.constructor=THREE.RingBufferGeometry,THREE.RingGeometry=function(t,e,r,i,n,a){THREE.Geometry.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:r,phiSegments:i,thetaStart:n,thetaLength:a},this.fromBufferGeometry(new THREE.RingBufferGeometry(t,e,r,i,n,a))},THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.RingGeometry.prototype.constructor=THREE.RingGeometry,THREE.SphereGeometry=function(t,e,r,i,n,a,o){THREE.Geometry.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:r,phiStart:i,phiLength:n,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new THREE.SphereBufferGeometry(t,e,r,i,n,a,o))},THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry,THREE.SphereBufferGeometry=function(t,e,r,i,n,a,o){THREE.BufferGeometry.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:r,phiStart:i,phiLength:n,thetaStart:a,thetaLength:o},t=t||50,e=Math.max(3,Math.floor(e)||8),r=Math.max(2,Math.floor(r)||6),i=void 0!==i?i:0,n=void 0!==n?n:2*Math.PI,a=void 0!==a?a:0,o=void 0!==o?o:Math.PI;for(var s=a+o,c=(e+1)*(r+1),h=new THREE.BufferAttribute(new Float32Array(3*c),3),l=new THREE.BufferAttribute(new Float32Array(3*c),3),u=new THREE.BufferAttribute(new Float32Array(2*c),2),p=0,d=[],E=new THREE.Vector3,f=0;f<=r;f++){for(var m=[],g=f/r,v=0;v<=e;v++){var T=v/e,y=-t*Math.cos(i+T*n)*Math.sin(a+g*o),R=t*Math.cos(a+g*o),H=t*Math.sin(i+T*n)*Math.sin(a+g*o);E.set(y,R,H).normalize(),h.setXYZ(p,y,R,H),l.setXYZ(p,E.x,E.y,E.z),u.setXY(p,T,1-g),m.push(p),p++}d.push(m)}for(var x=[],f=0;f<r;f++)for(var v=0;v<e;v++){var b=d[f][v+1],_=d[f][v],M=d[f+1][v],w=d[f+1][v+1];(0!==f||a>0)&&x.push(b,_,w),(f!==r-1||s<Math.PI)&&x.push(_,M,w)}this.setIndex(new(h.count>65535?THREE.Uint32Attribute:THREE.Uint16Attribute)(x,1)),this.addAttribute("position",h),this.addAttribute("normal",l),this.addAttribute("uv",u),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,t)},THREE.SphereBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.SphereBufferGeometry.prototype.constructor=THREE.SphereBufferGeometry,THREE.TextGeometry=function(t,e){e=e||{};var r=e.font;if(r instanceof THREE.Font==!1)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new THREE.Geometry;var i=r.generateShapes(t,e.size,e.curveSegments);e.amount=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),THREE.ExtrudeGeometry.call(this,i,e),this.type="TextGeometry"},THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype),THREE.TextGeometry.prototype.constructor=THREE.TextGeometry,THREE.TorusBufferGeometry=function(t,e,r,i,n){THREE.BufferGeometry.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:r,tubularSegments:i,arc:n},t=t||100,e=e||40,r=Math.floor(r)||8,i=Math.floor(i)||6,n=n||2*Math.PI;var a,o,s=(r+1)*(i+1),c=r*i*2*3,h=new(c>65535?Uint32Array:Uint16Array)(c),l=new Float32Array(3*s),u=new Float32Array(3*s),p=new Float32Array(2*s),d=0,E=0,f=0,m=new THREE.Vector3,g=new THREE.Vector3,v=new THREE.Vector3;for(a=0;a<=r;a++)for(o=0;o<=i;o++){var T=o/i*n,y=a/r*Math.PI*2;g.x=(t+e*Math.cos(y))*Math.cos(T),g.y=(t+e*Math.cos(y))*Math.sin(T),g.z=e*Math.sin(y),l[d]=g.x,l[d+1]=g.y,l[d+2]=g.z,m.x=t*Math.cos(T),m.y=t*Math.sin(T),v.subVectors(g,m).normalize(),u[d]=v.x,u[d+1]=v.y,u[d+2]=v.z,p[E]=o/i,p[E+1]=a/r,d+=3,E+=2}for(a=1;a<=r;a++)for(o=1;o<=i;o++){var R=(i+1)*a+o-1,H=(i+1)*(a-1)+o-1,x=(i+1)*(a-1)+o,b=(i+1)*a+o;h[f]=R,h[f+1]=H,h[f+2]=b,h[f+3]=H,h[f+4]=x,h[f+5]=b,f+=6}this.setIndex(new THREE.BufferAttribute(h,1)),this.addAttribute("position",new THREE.BufferAttribute(l,3)),this.addAttribute("normal",new THREE.BufferAttribute(u,3)),this.addAttribute("uv",new THREE.BufferAttribute(p,2))},THREE.TorusBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.TorusBufferGeometry.prototype.constructor=THREE.TorusBufferGeometry,THREE.TorusGeometry=function(t,e,r,i,n){THREE.Geometry.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:r,tubularSegments:i,arc:n},this.fromBufferGeometry(new THREE.TorusBufferGeometry(t,e,r,i,n))},THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry,THREE.TorusKnotBufferGeometry=function(t,e,r,i,n,a){function o(t,e,r,i,n){var a=Math.cos(t),o=Math.sin(t),s=r/e*t,c=Math.cos(s);n.x=i*(2+c)*.5*a,n.y=i*(2+c)*o*.5,n.z=i*Math.sin(s)*.5}THREE.BufferGeometry.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:r,radialSegments:i,p:n,q:a},t=t||100,e=e||40,r=Math.floor(r)||64,i=Math.floor(i)||8,n=n||2,a=a||3;var s,c,h=(i+1)*(r+1),l=i*r*2*3,u=new THREE.BufferAttribute(new(l>65535?Uint32Array:Uint16Array)(l),1),p=new THREE.BufferAttribute(new Float32Array(3*h),3),d=new THREE.BufferAttribute(new Float32Array(3*h),3),E=new THREE.BufferAttribute(new Float32Array(2*h),2),f=0,m=0,g=new THREE.Vector3,v=new THREE.Vector3,T=new THREE.Vector2,y=new THREE.Vector3,R=new THREE.Vector3,H=new THREE.Vector3,x=new THREE.Vector3,b=new THREE.Vector3;for(s=0;s<=r;++s){var _=s/r*n*Math.PI*2;for(o(_,n,a,t,y),o(_+.01,n,a,t,R),x.subVectors(R,y),b.addVectors(R,y),H.crossVectors(x,b),b.crossVectors(H,x),H.normalize(),b.normalize(),c=0;c<=i;++c){var M=c/i*Math.PI*2,w=-e*Math.cos(M),S=e*Math.sin(M);g.x=y.x+(w*b.x+S*H.x),g.y=y.y+(w*b.y+S*H.y),g.z=y.z+(w*b.z+S*H.z),p.setXYZ(f,g.x,g.y,g.z),v.subVectors(g,y).normalize(),d.setXYZ(f,v.x,v.y,v.z),T.x=s/r,T.y=c/i,E.setXY(f,T.x,T.y),f++}}for(c=1;c<=r;c++)for(s=1;s<=i;s++){var L=(i+1)*(c-1)+(s-1),A=(i+1)*c+(s-1),C=(i+1)*c+s,P=(i+1)*(c-1)+s;u.setX(m,L),m++,u.setX(m,A),m++,u.setX(m,P),m++,u.setX(m,A),m++,u.setX(m,C),m++,u.setX(m,P),m++}this.setIndex(u),this.addAttribute("position",p),this.addAttribute("normal",d),this.addAttribute("uv",E)},THREE.TorusKnotBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.TorusKnotBufferGeometry.prototype.constructor=THREE.TorusKnotBufferGeometry,THREE.TorusKnotGeometry=function(t,e,r,i,n,a,o){THREE.Geometry.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:r,radialSegments:i,p:n,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new THREE.TorusKnotBufferGeometry(t,e,r,i,n,a)),this.mergeVertices()},THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry,THREE.TubeGeometry=function(t,e,r,i,n,a){function o(t,e,r){return L.vertices.push(new THREE.Vector3(t,e,r))-1}THREE.Geometry.call(this),this.type="TubeGeometry",this.parameters={path:t,segments:e,radius:r,radialSegments:i,closed:n,taper:a},e=e||64,r=r||1,i=i||8,n=n||!1,a=a||THREE.TubeGeometry.NoTaper;var s,c,h,l,u,p,d,E,f,m,g,v,T,y,R,H,x,b,_,M,w,S=[],L=this,A=e+1,C=new THREE.Vector3,P=new THREE.TubeGeometry.FrenetFrames(t,e,n),B=P.tangents,D=P.normals,I=P.binormals;for(this.tangents=B,this.normals=D,this.binormals=I,m=0;m<A;m++)for(S[m]=[],l=m/(A-1),f=t.getPointAt(l),s=B[m],c=D[m],h=I[m],p=r*a(l),g=0;g<i;g++)u=g/i*2*Math.PI,d=-p*Math.cos(u),E=p*Math.sin(u),C.copy(f),C.x+=d*c.x+E*h.x,C.y+=d*c.y+E*h.y,C.z+=d*c.z+E*h.z,S[m][g]=o(C.x,C.y,C.z);for(m=0;m<e;m++)for(g=0;g<i;g++)v=n?(m+1)%e:m+1,T=(g+1)%i,y=S[m][g],R=S[v][g],H=S[v][T],x=S[m][T],b=new THREE.Vector2(m/e,g/i),_=new THREE.Vector2((m+1)/e,g/i),M=new THREE.Vector2((m+1)/e,(g+1)/i),w=new THREE.Vector2(m/e,(g+1)/i),this.faces.push(new THREE.Face3(y,R,x)),this.faceVertexUvs[0].push([b,_,w]),this.faces.push(new THREE.Face3(R,H,x)),this.faceVertexUvs[0].push([_.clone(),M,w.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry,THREE.TubeGeometry.NoTaper=function(t){return 1},THREE.TubeGeometry.SinusoidalTaper=function(t){return Math.sin(Math.PI*t)},THREE.TubeGeometry.FrenetFrames=function(t,e,r){function i(){d[0]=new THREE.Vector3,E[0]=new THREE.Vector3,a=Number.MAX_VALUE,o=Math.abs(p[0].x),s=Math.abs(p[0].y),c=Math.abs(p[0].z),o<=a&&(a=o,u.set(1,0,0)),s<=a&&(a=s,u.set(0,1,0)),c<=a&&u.set(0,0,1),f.crossVectors(p[0],u).normalize(),d[0].crossVectors(p[0],f),E[0].crossVectors(p[0],d[0])}var n,a,o,s,c,h,l,u=new THREE.Vector3,p=[],d=[],E=[],f=new THREE.Vector3,m=new THREE.Matrix4,g=e+1;for(this.tangents=p,this.normals=d,this.binormals=E,h=0;h<g;h++)l=h/(g-1),p[h]=t.getTangentAt(l),p[h].normalize();for(i(),h=1;h<g;h++)d[h]=d[h-1].clone(),E[h]=E[h-1].clone(),f.crossVectors(p[h-1],p[h]),f.length()>Number.EPSILON&&(f.normalize(),n=Math.acos(THREE.Math.clamp(p[h-1].dot(p[h]),-1,1)),d[h].applyMatrix4(m.makeRotationAxis(f,n))),E[h].crossVectors(p[h],d[h]);if(r)for(n=Math.acos(THREE.Math.clamp(d[0].dot(d[g-1]),-1,1)),n/=g-1,p[0].dot(f.crossVectors(d[0],d[g-1]))>0&&(n=-n),h=1;h<g;h++)d[h].applyMatrix4(m.makeRotationAxis(p[h],n*h)),E[h].crossVectors(p[h],d[h])},THREE.PolyhedronGeometry=function(t,e,r,i){function n(t){var e=t.normalize().clone();e.index=l.vertices.push(e)-1;var r=s(t)/2/Math.PI+.5,i=c(t)/Math.PI+.5;return e.uv=new THREE.Vector2(r,1-i),e}function a(t,e,r,i){var n=new THREE.Face3(t.index,e.index,r.index,[t.clone(),e.clone(),r.clone()],(void 0),i);l.faces.push(n),T.copy(t).add(e).add(r).divideScalar(3);var a=s(T);l.faceVertexUvs[0].push([h(t.uv,t,a),h(e.uv,e,a),h(r.uv,r,a)])}function o(t,e){
for(var r=Math.pow(2,e),i=n(l.vertices[t.a]),o=n(l.vertices[t.b]),s=n(l.vertices[t.c]),c=[],h=t.materialIndex,u=0;u<=r;u++){c[u]=[];for(var p=n(i.clone().lerp(s,u/r)),d=n(o.clone().lerp(s,u/r)),E=r-u,f=0;f<=E;f++)0===f&&u===r?c[u][f]=p:c[u][f]=n(p.clone().lerp(d,f/E))}for(var u=0;u<r;u++)for(var f=0;f<2*(r-u)-1;f++){var m=Math.floor(f/2);f%2===0?a(c[u][m+1],c[u+1][m],c[u][m],h):a(c[u][m+1],c[u+1][m+1],c[u+1][m],h)}}function s(t){return Math.atan2(t.z,-t.x)}function c(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}function h(t,e,r){return r<0&&1===t.x&&(t=new THREE.Vector2(t.x-1,t.y)),0===e.x&&0===e.z&&(t=new THREE.Vector2(r/2/Math.PI+.5,t.y)),t.clone()}THREE.Geometry.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:r,detail:i},r=r||1,i=i||0;for(var l=this,u=0,p=t.length;u<p;u+=3)n(new THREE.Vector3(t[u],t[u+1],t[u+2]));for(var d=this.vertices,E=[],u=0,f=0,p=e.length;u<p;u+=3,f++){var m=d[e[u]],g=d[e[u+1]],v=d[e[u+2]];E[f]=new THREE.Face3(m.index,g.index,v.index,[m.clone(),g.clone(),v.clone()],(void 0),f)}for(var T=new THREE.Vector3,u=0,p=E.length;u<p;u++)o(E[u],i);for(var u=0,p=this.faceVertexUvs[0].length;u<p;u++){var y=this.faceVertexUvs[0][u],R=y[0].x,H=y[1].x,x=y[2].x,b=Math.max(R,H,x),_=Math.min(R,H,x);b>.9&&_<.1&&(R<.2&&(y[0].x+=1),H<.2&&(y[1].x+=1),x<.2&&(y[2].x+=1))}for(var u=0,p=this.vertices.length;u<p;u++)this.vertices[u].multiplyScalar(r);this.mergeVertices(),this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,r)},THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry,THREE.DodecahedronGeometry=function(t,e){var r=(1+Math.sqrt(5))/2,i=1/r,n=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-r,0,-i,r,0,i,-r,0,i,r,-i,-r,0,-i,r,0,i,-r,0,i,r,0,-r,0,-i,r,0,-i,-r,0,i,r,0,i],a=[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];THREE.PolyhedronGeometry.call(this,n,a,t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}},THREE.DodecahedronGeometry.prototype=Object.create(THREE.PolyhedronGeometry.prototype),THREE.DodecahedronGeometry.prototype.constructor=THREE.DodecahedronGeometry,THREE.IcosahedronGeometry=function(t,e){var r=(1+Math.sqrt(5))/2,i=[-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],n=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];THREE.PolyhedronGeometry.call(this,i,n,t,e),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e}},THREE.IcosahedronGeometry.prototype=Object.create(THREE.PolyhedronGeometry.prototype),THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry,THREE.OctahedronGeometry=function(t,e){var r=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],i=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];THREE.PolyhedronGeometry.call(this,r,i,t,e),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e}},THREE.OctahedronGeometry.prototype=Object.create(THREE.PolyhedronGeometry.prototype),THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry,THREE.TetrahedronGeometry=function(t,e){var r=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],i=[2,1,0,0,3,2,1,3,0,2,3,1];THREE.PolyhedronGeometry.call(this,r,i,t,e),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e}},THREE.TetrahedronGeometry.prototype=Object.create(THREE.PolyhedronGeometry.prototype),THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry,THREE.ParametricGeometry=function(t,e,r){THREE.Geometry.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:r};var i,n,a,o,s,c=this.vertices,h=this.faces,l=this.faceVertexUvs[0],u=e+1;for(i=0;i<=r;i++)for(s=i/r,n=0;n<=e;n++)o=n/e,a=t(o,s),c.push(a);var p,d,E,f,m,g,v,T;for(i=0;i<r;i++)for(n=0;n<e;n++)p=i*u+n,d=i*u+n+1,E=(i+1)*u+n+1,f=(i+1)*u+n,m=new THREE.Vector2(n/e,i/r),g=new THREE.Vector2((n+1)/e,i/r),v=new THREE.Vector2((n+1)/e,(i+1)/r),T=new THREE.Vector2(n/e,(i+1)/r),h.push(new THREE.Face3(p,d,f)),l.push([m,g,T]),h.push(new THREE.Face3(d,E,f)),l.push([g.clone(),v,T.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry,THREE.WireframeGeometry=function(t){function e(t,e){return t-e}THREE.BufferGeometry.call(this);var r=[0,0],i={},n=["a","b","c"];if(t instanceof THREE.Geometry){for(var a=t.vertices,o=t.faces,s=0,c=new Uint32Array(6*o.length),h=0,l=o.length;h<l;h++)for(var u=o[h],p=0;p<3;p++){r[0]=u[n[p]],r[1]=u[n[(p+1)%3]],r.sort(e);var d=r.toString();void 0===i[d]&&(c[2*s]=r[0],c[2*s+1]=r[1],i[d]=!0,s++)}for(var E=new Float32Array(2*s*3),h=0,l=s;h<l;h++)for(var p=0;p<2;p++){var f=a[c[2*h+p]],m=6*h+3*p;E[m+0]=f.x,E[m+1]=f.y,E[m+2]=f.z}this.addAttribute("position",new THREE.BufferAttribute(E,3))}else if(t instanceof THREE.BufferGeometry)if(null!==t.index){var g=t.index.array,a=t.attributes.position,v=t.groups,s=0;0===v.length&&t.addGroup(0,g.length);for(var c=new Uint32Array(2*g.length),T=0,y=v.length;T<y;++T)for(var R=v[T],H=R.start,x=R.count,h=H,b=H+x;h<b;h+=3)for(var p=0;p<3;p++){r[0]=g[h+p],r[1]=g[h+(p+1)%3],r.sort(e);var d=r.toString();void 0===i[d]&&(c[2*s]=r[0],c[2*s+1]=r[1],i[d]=!0,s++)}for(var E=new Float32Array(2*s*3),h=0,l=s;h<l;h++)for(var p=0;p<2;p++){var m=6*h+3*p,_=c[2*h+p];E[m+0]=a.getX(_),E[m+1]=a.getY(_),E[m+2]=a.getZ(_)}this.addAttribute("position",new THREE.BufferAttribute(E,3))}else{for(var a=t.attributes.position.array,s=a.length/3,M=s/3,E=new Float32Array(2*s*3),h=0,l=M;h<l;h++)for(var p=0;p<3;p++){var m=18*h+6*p,w=9*h+3*p;E[m+0]=a[w],E[m+1]=a[w+1],E[m+2]=a[w+2];var _=9*h+3*((p+1)%3);E[m+3]=a[_],E[m+4]=a[_+1],E[m+5]=a[_+2]}this.addAttribute("position",new THREE.BufferAttribute(E,3))}},THREE.WireframeGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.WireframeGeometry.prototype.constructor=THREE.WireframeGeometry,THREE.AxisHelper=function(t){t=t||1;var e=new Float32Array([0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t]),r=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]),i=new THREE.BufferGeometry;i.addAttribute("position",new THREE.BufferAttribute(e,3)),i.addAttribute("color",new THREE.BufferAttribute(r,3));var n=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});THREE.LineSegments.call(this,i,n)},THREE.AxisHelper.prototype=Object.create(THREE.LineSegments.prototype),THREE.AxisHelper.prototype.constructor=THREE.AxisHelper,THREE.ArrowHelper=function(){var t=new THREE.Geometry;t.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0));var e=new THREE.CylinderGeometry(0,.5,1,5,1);return e.translate(0,-.5,0),function(r,i,n,a,o,s){THREE.Object3D.call(this),void 0===a&&(a=16776960),void 0===n&&(n=1),void 0===o&&(o=.2*n),void 0===s&&(s=.2*o),this.position.copy(i),this.line=new THREE.Line(t,new THREE.LineBasicMaterial({color:a})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new THREE.Mesh(e,new THREE.MeshBasicMaterial({color:a})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(r),this.setLength(n,o,s)}}(),THREE.ArrowHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.ArrowHelper.prototype.constructor=THREE.ArrowHelper,THREE.ArrowHelper.prototype.setDirection=function(){var t,e=new THREE.Vector3;return function(r){r.y>.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))}}(),THREE.ArrowHelper.prototype.setLength=function(t,e,r){void 0===e&&(e=.2*t),void 0===r&&(r=.2*e),this.line.scale.set(1,Math.max(0,t-e),1),this.line.updateMatrix(),this.cone.scale.set(r,e,r),this.cone.position.y=t,this.cone.updateMatrix()},THREE.ArrowHelper.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},THREE.BoxHelper=function(t){var e=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),i=new THREE.BufferGeometry;i.setIndex(new THREE.BufferAttribute(e,1)),i.addAttribute("position",new THREE.BufferAttribute(r,3)),THREE.LineSegments.call(this,i,new THREE.LineBasicMaterial({color:16776960})),void 0!==t&&this.update(t)},THREE.BoxHelper.prototype=Object.create(THREE.LineSegments.prototype),THREE.BoxHelper.prototype.constructor=THREE.BoxHelper,THREE.BoxHelper.prototype.update=function(){var t=new THREE.Box3;return function(e){if(e instanceof THREE.Box3?t.copy(e):t.setFromObject(e),!t.isEmpty()){var r=t.min,i=t.max,n=this.geometry.attributes.position,a=n.array;a[0]=i.x,a[1]=i.y,a[2]=i.z,a[3]=r.x,a[4]=i.y,a[5]=i.z,a[6]=r.x,a[7]=r.y,a[8]=i.z,a[9]=i.x,a[10]=r.y,a[11]=i.z,a[12]=i.x,a[13]=i.y,a[14]=r.z,a[15]=r.x,a[16]=i.y,a[17]=r.z,a[18]=r.x,a[19]=r.y,a[20]=r.z,a[21]=i.x,a[22]=r.y,a[23]=r.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),THREE.BoundingBoxHelper=function(t,e){var r=void 0!==e?e:8947848;this.object=t,this.box=new THREE.Box3,THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:r,wireframe:!0}))},THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype),THREE.BoundingBoxHelper.prototype.constructor=THREE.BoundingBoxHelper,THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object),this.box.size(this.scale),this.box.center(this.position)},THREE.CameraHelper=function(t){function e(t,e,i){r(t,i),r(e,i)}function r(t,e){i.vertices.push(new THREE.Vector3),i.colors.push(new THREE.Color(e)),void 0===a[t]&&(a[t]=[]),a[t].push(i.vertices.length-1)}var i=new THREE.Geometry,n=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),a={},o=16755200,s=16711680,c=43775,h=16777215,l=3355443;e("n1","n2",o),e("n2","n4",o),e("n4","n3",o),e("n3","n1",o),e("f1","f2",o),e("f2","f4",o),e("f4","f3",o),e("f3","f1",o),e("n1","f1",o),e("n2","f2",o),e("n3","f3",o),e("n4","f4",o),e("p","n1",s),e("p","n2",s),e("p","n3",s),e("p","n4",s),e("u1","u2",c),e("u2","u3",c),e("u3","u1",c),e("c","t",h),e("p","c",l),e("cn1","cn2",l),e("cn3","cn4",l),e("cf1","cf2",l),e("cf3","cf4",l),THREE.LineSegments.call(this,i,n),this.camera=t,this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()},THREE.CameraHelper.prototype=Object.create(THREE.LineSegments.prototype),THREE.CameraHelper.prototype.constructor=THREE.CameraHelper,THREE.CameraHelper.prototype.update=function(){function t(t,a,o,s){i.set(a,o,s).unproject(n);var c=r[t];if(void 0!==c)for(var h=0,l=c.length;h<l;h++)e.vertices[c[h]].copy(i)}var e,r,i=new THREE.Vector3,n=new THREE.Camera;return function(){e=this.geometry,r=this.pointMap;var i=1,a=1;n.projectionMatrix.copy(this.camera.projectionMatrix),t("c",0,0,-1),t("t",0,0,1),t("n1",-i,-a,-1),t("n2",i,-a,-1),t("n3",-i,a,-1),t("n4",i,a,-1),t("f1",-i,-a,1),t("f2",i,-a,1),t("f3",-i,a,1),t("f4",i,a,1),t("u1",.7*i,1.1*a,-1),t("u2",.7*-i,1.1*a,-1),t("u3",0,2*a,-1),t("cf1",-i,0,1),t("cf2",i,0,1),t("cf3",0,-a,1),t("cf4",0,a,1),t("cn1",-i,0,-1),t("cn2",i,0,-1),t("cn3",0,-a,-1),t("cn4",0,a,-1),e.verticesNeedUpdate=!0}}(),THREE.DirectionalLightHelper=function(t,e){THREE.Object3D.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,e=e||1;var r=new THREE.Geometry;r.vertices.push(new THREE.Vector3((-e),e,0),new THREE.Vector3(e,e,0),new THREE.Vector3(e,(-e),0),new THREE.Vector3((-e),(-e),0),new THREE.Vector3((-e),e,0));var i=new THREE.LineBasicMaterial({fog:!1});i.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.lightPlane=new THREE.Line(r,i),this.add(this.lightPlane),r=new THREE.Geometry,r.vertices.push(new THREE.Vector3,new THREE.Vector3),i=new THREE.LineBasicMaterial({fog:!1}),i.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine=new THREE.Line(r,i),this.add(this.targetLine),this.update()},THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.DirectionalLightHelper.prototype.constructor=THREE.DirectionalLightHelper,THREE.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},THREE.DirectionalLightHelper.prototype.update=function(){var t=new THREE.Vector3,e=new THREE.Vector3,r=new THREE.Vector3;return function(){t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),r.subVectors(e,t),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)}}(),THREE.EdgesHelper=function(t,e,r){var i=void 0!==e?e:16777215;THREE.LineSegments.call(this,new THREE.EdgesGeometry(t.geometry,r),new THREE.LineBasicMaterial({color:i})),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1},THREE.EdgesHelper.prototype=Object.create(THREE.LineSegments.prototype),THREE.EdgesHelper.prototype.constructor=THREE.EdgesHelper,THREE.FaceNormalsHelper=function(t,e,r,i){this.object=t,this.size=void 0!==e?e:1;var n=void 0!==r?r:16776960,a=void 0!==i?i:1,o=0,s=this.object.geometry;s instanceof THREE.Geometry?o=s.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");var c=new THREE.BufferGeometry,h=new THREE.Float32Attribute(2*o*3,3);c.addAttribute("position",h),THREE.LineSegments.call(this,c,new THREE.LineBasicMaterial({color:n,linewidth:a})),this.matrixAutoUpdate=!1,this.update()},THREE.FaceNormalsHelper.prototype=Object.create(THREE.LineSegments.prototype),THREE.FaceNormalsHelper.prototype.constructor=THREE.FaceNormalsHelper,THREE.FaceNormalsHelper.prototype.update=function(){var t=new THREE.Vector3,e=new THREE.Vector3,r=new THREE.Matrix3;return function(){this.object.updateMatrixWorld(!0),r.getNormalMatrix(this.object.matrixWorld);for(var i=this.object.matrixWorld,n=this.geometry.attributes.position,a=this.object.geometry,o=a.vertices,s=a.faces,c=0,h=0,l=s.length;h<l;h++){var u=s[h],p=u.normal;t.copy(o[u.a]).add(o[u.b]).add(o[u.c]).divideScalar(3).applyMatrix4(i),e.copy(p).applyMatrix3(r).normalize().multiplyScalar(this.size).add(t),n.setXYZ(c,t.x,t.y,t.z),c+=1,n.setXYZ(c,e.x,e.y,e.z),c+=1}return n.needsUpdate=!0,this}}(),THREE.GridHelper=function(t,e){var r=new THREE.Geometry,i=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});this.color1=new THREE.Color(4473924),this.color2=new THREE.Color(8947848);for(var n=-t;n<=t;n+=e){r.vertices.push(new THREE.Vector3((-t),0,n),new THREE.Vector3(t,0,n),new THREE.Vector3(n,0,(-t)),new THREE.Vector3(n,0,t));var a=0===n?this.color1:this.color2;r.colors.push(a,a,a,a)}THREE.LineSegments.call(this,r,i)},THREE.GridHelper.prototype=Object.create(THREE.LineSegments.prototype),THREE.GridHelper.prototype.constructor=THREE.GridHelper,THREE.GridHelper.prototype.setColors=function(t,e){this.color1.set(t),this.color2.set(e),this.geometry.colorsNeedUpdate=!0},THREE.HemisphereLightHelper=function(t,e){THREE.Object3D.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.colors=[new THREE.Color,new THREE.Color];var r=new THREE.SphereGeometry(e,4,2);r.rotateX(-Math.PI/2);for(var i=0,n=8;i<n;i++)r.faces[i].color=this.colors[i<4?0:1];var a=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0});this.lightSphere=new THREE.Mesh(r,a),this.add(this.lightSphere),this.update()},THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.HemisphereLightHelper.prototype.constructor=THREE.HemisphereLightHelper,THREE.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose(),this.lightSphere.material.dispose()},THREE.HemisphereLightHelper.prototype.update=function(){var t=new THREE.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(t.setFromMatrixPosition(this.light.matrixWorld).negate()),this.lightSphere.geometry.colorsNeedUpdate=!0}}(),THREE.PointLightHelper=function(t,e){this.light=t,this.light.updateMatrixWorld();var r=new THREE.SphereGeometry(e,4,2),i=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});i.color.copy(this.light.color).multiplyScalar(this.light.intensity),THREE.Mesh.call(this,r,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1},THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype),THREE.PointLightHelper.prototype.constructor=THREE.PointLightHelper,THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},THREE.SkeletonHelper=function(t){this.bones=this.getBoneList(t);for(var e=new THREE.Geometry,r=0;r<this.bones.length;r++){var i=this.bones[r];i.parent instanceof THREE.Bone&&(e.vertices.push(new THREE.Vector3),e.vertices.push(new THREE.Vector3),e.colors.push(new THREE.Color(0,0,1)),e.colors.push(new THREE.Color(0,1,0)))}e.dynamic=!0;var n=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors,depthTest:!1,depthWrite:!1,transparent:!0});THREE.LineSegments.call(this,e,n),this.root=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.update()},THREE.SkeletonHelper.prototype=Object.create(THREE.LineSegments.prototype),THREE.SkeletonHelper.prototype.constructor=THREE.SkeletonHelper,THREE.SkeletonHelper.prototype.getBoneList=function(t){var e=[];t instanceof THREE.Bone&&e.push(t);for(var r=0;r<t.children.length;r++)e.push.apply(e,this.getBoneList(t.children[r]));return e},THREE.SkeletonHelper.prototype.update=function(){for(var t=this.geometry,e=(new THREE.Matrix4).getInverse(this.root.matrixWorld),r=new THREE.Matrix4,i=0,n=0;n<this.bones.length;n++){var a=this.bones[n];a.parent instanceof THREE.Bone&&(r.multiplyMatrices(e,a.matrixWorld),t.vertices[i].setFromMatrixPosition(r),r.multiplyMatrices(e,a.parent.matrixWorld),t.vertices[i+1].setFromMatrixPosition(r),i+=2)}t.verticesNeedUpdate=!0,t.computeBoundingSphere()},THREE.SpotLightHelper=function(t){THREE.Object3D.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1;for(var e=new THREE.BufferGeometry,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,n=1,a=32;i<a;i++,n++){var o=i/a*Math.PI*2,s=n/a*Math.PI*2;r.push(Math.cos(o),Math.sin(o),1,Math.cos(s),Math.sin(s),1)}e.addAttribute("position",new THREE.Float32Attribute(r,3));var c=new THREE.LineBasicMaterial({fog:!1});this.cone=new THREE.LineSegments(e,c),this.add(this.cone),this.update()},THREE.SpotLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.SpotLightHelper.prototype.constructor=THREE.SpotLightHelper,THREE.SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},THREE.SpotLightHelper.prototype.update=function(){var t=new THREE.Vector3,e=new THREE.Vector3;return function(){var r=this.light.distance?this.light.distance:1e3,i=r*Math.tan(this.light.angle);this.cone.scale.set(i,i,r),t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(e.sub(t)),this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}(),THREE.VertexNormalsHelper=function(t,e,r,i){this.object=t,this.size=void 0!==e?e:1;var n=void 0!==r?r:16711680,a=void 0!==i?i:1,o=0,s=this.object.geometry;s instanceof THREE.Geometry?o=3*s.faces.length:s instanceof THREE.BufferGeometry&&(o=s.attributes.normal.count);var c=new THREE.BufferGeometry,h=new THREE.Float32Attribute(2*o*3,3);c.addAttribute("position",h),THREE.LineSegments.call(this,c,new THREE.LineBasicMaterial({color:n,linewidth:a})),this.matrixAutoUpdate=!1,this.update()},THREE.VertexNormalsHelper.prototype=Object.create(THREE.LineSegments.prototype),THREE.VertexNormalsHelper.prototype.constructor=THREE.VertexNormalsHelper,THREE.VertexNormalsHelper.prototype.update=function(){var t=new THREE.Vector3,e=new THREE.Vector3,r=new THREE.Matrix3;return function(){var i=["a","b","c"];this.object.updateMatrixWorld(!0),r.getNormalMatrix(this.object.matrixWorld);var n=this.object.matrixWorld,a=this.geometry.attributes.position,o=this.object.geometry;if(o instanceof THREE.Geometry)for(var s=o.vertices,c=o.faces,h=0,l=0,u=c.length;l<u;l++)for(var p=c[l],d=0,E=p.vertexNormals.length;d<E;d++){var f=s[p[i[d]]],m=p.vertexNormals[d];t.copy(f).applyMatrix4(n),e.copy(m).applyMatrix3(r).normalize().multiplyScalar(this.size).add(t),a.setXYZ(h,t.x,t.y,t.z),h+=1,a.setXYZ(h,e.x,e.y,e.z),h+=1}else if(o instanceof THREE.BufferGeometry)for(var g=o.attributes.position,v=o.attributes.normal,h=0,d=0,E=g.count;d<E;d++)t.set(g.getX(d),g.getY(d),g.getZ(d)).applyMatrix4(n),e.set(v.getX(d),v.getY(d),v.getZ(d)),e.applyMatrix3(r).normalize().multiplyScalar(this.size).add(t),a.setXYZ(h,t.x,t.y,t.z),h+=1,a.setXYZ(h,e.x,e.y,e.z),h+=1;return a.needsUpdate=!0,this}}(),THREE.WireframeHelper=function(t,e){var r=void 0!==e?e:16777215;THREE.LineSegments.call(this,new THREE.WireframeGeometry(t.geometry),new THREE.LineBasicMaterial({color:r})),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1},THREE.WireframeHelper.prototype=Object.create(THREE.LineSegments.prototype),THREE.WireframeHelper.prototype.constructor=THREE.WireframeHelper,THREE.ImmediateRenderObject=function(t){THREE.Object3D.call(this),this.material=t,this.render=function(t){}},THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype),THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject,THREE.MorphBlendMesh=function(t,e){THREE.Mesh.call(this,t,e),this.animationsMap={},this.animationsList=[];var r=this.geometry.morphTargets.length,i="__default",n=0,a=r-1,o=r/1;this.createAnimation(i,n,a,o),this.setAnimationWeight(i,1)},THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh,THREE.MorphBlendMesh.prototype.createAnimation=function(t,e,r,i){var n={start:e,end:r,length:r-e+1,fps:i,duration:(r-e)/i,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[t]=n,this.animationsList.push(n)},THREE.MorphBlendMesh.prototype.autoCreateAnimations=function(t){for(var e,r=/([a-z]+)_?(\d+)/i,i={},n=this.geometry,a=0,o=n.morphTargets.length;a<o;a++){var s=n.morphTargets[a],c=s.name.match(r);if(c&&c.length>1){var h=c[1];i[h]||(i[h]={start:1/0,end:-(1/0)});var l=i[h];a<l.start&&(l.start=a),a>l.end&&(l.end=a),e||(e=h)}}for(var h in i){var l=i[h];this.createAnimation(h,l.start,l.end,t)}this.firstAnimation=e},THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(t){var e=this.animationsMap[t];e&&(e.direction=1,e.directionBackwards=!1)},THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(t){var e=this.animationsMap[t];e&&(e.direction=-1,e.directionBackwards=!0)},THREE.MorphBlendMesh.prototype.setAnimationFPS=function(t,e){var r=this.animationsMap[t];r&&(r.fps=e,r.duration=(r.end-r.start)/r.fps)},THREE.MorphBlendMesh.prototype.setAnimationDuration=function(t,e){var r=this.animationsMap[t];r&&(r.duration=e,r.fps=(r.end-r.start)/r.duration)},THREE.MorphBlendMesh.prototype.setAnimationWeight=function(t,e){var r=this.animationsMap[t];r&&(r.weight=e)},THREE.MorphBlendMesh.prototype.setAnimationTime=function(t,e){var r=this.animationsMap[t];r&&(r.time=e)},THREE.MorphBlendMesh.prototype.getAnimationTime=function(t){var e=0,r=this.animationsMap[t];return r&&(e=r.time),e},THREE.MorphBlendMesh.prototype.getAnimationDuration=function(t){var e=-1,r=this.animationsMap[t];return r&&(e=r.duration),e},THREE.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()")},THREE.MorphBlendMesh.prototype.stopAnimation=function(t){var e=this.animationsMap[t];e&&(e.active=!1)},THREE.MorphBlendMesh.prototype.update=function(t){for(var e=0,r=this.animationsList.length;e<r;e++){var i=this.animationsList[e];if(i.active){var n=i.duration/i.length;i.time+=i.direction*t,i.mirroredLoop?(i.time>i.duration||i.time<0)&&(i.direction*=-1,i.time>i.duration&&(i.time=i.duration,i.directionBackwards=!0),i.time<0&&(i.time=0,i.directionBackwards=!1)):(i.time=i.time%i.duration,i.time<0&&(i.time+=i.duration));var a=i.start+THREE.Math.clamp(Math.floor(i.time/n),0,i.length-1),o=i.weight;a!==i.currentFrame&&(this.morphTargetInfluences[i.lastFrame]=0,this.morphTargetInfluences[i.currentFrame]=1*o,this.morphTargetInfluences[a]=0,i.lastFrame=i.currentFrame,i.currentFrame=a);var s=i.time%n/n;i.directionBackwards&&(s=1-s),i.currentFrame!==i.lastFrame?(this.morphTargetInfluences[i.currentFrame]=s*o,this.morphTargetInfluences[i.lastFrame]=(1-s)*o):this.morphTargetInfluences[i.currentFrame]=o}}},"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=THREE),exports.THREE=THREE):this.THREE=THREE;
},{}],18:[function(_dereq_,module,exports){
!function(n){if("performance"in n==!1&&(n.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in n.performance==!1){var t=n.performance.timing&&n.performance.timing.navigationStart?performance.timing.navigationStart:Date.now();n.performance.now=function(){return Date.now()-t}}}(this);var TWEEN=TWEEN||function(){var n=[];return{REVISION:"14",getAll:function(){return n},removeAll:function(){n=[]},add:function(t){n.push(t)},remove:function(t){var r=n.indexOf(t);r!==-1&&n.splice(r,1)},update:function(t){if(0===n.length)return!1;var r=0;for(t=void 0!==t?t:window.performance.now();r<n.length;)n[r].update(t)?r++:n.splice(r,1);return!0}}}();TWEEN.Tween=function(n){var t=n,r={},i={},u={},e=1e3,o=0,a=!1,f=!1,c=!1,s=0,h=null,l=TWEEN.Easing.Linear.None,p=TWEEN.Interpolation.Linear,E=[],I=null,v=!1,M=null,m=null,w=null;for(var d in n)r[d]=parseFloat(n[d],10);this.to=function(n,t){return void 0!==t&&(e=t),i=n,this},this.start=function(n){TWEEN.add(this),f=!0,v=!1,h=void 0!==n?n:window.performance.now(),h+=s;for(var e in i){if(i[e]instanceof Array){if(0===i[e].length)continue;i[e]=[t[e]].concat(i[e])}r[e]=t[e],r[e]instanceof Array==!1&&(r[e]*=1),u[e]=r[e]||0}return this},this.stop=function(){return f?(TWEEN.remove(this),f=!1,null!==w&&w.call(t),this.stopChainedTweens(),this):this},this.stopChainedTweens=function(){for(var n=0,t=E.length;n<t;n++)E[n].stop()},this.delay=function(n){return s=n,this},this.repeat=function(n){return o=n,this},this.yoyo=function(n){return a=n,this},this.easing=function(n){return l=n,this},this.interpolation=function(n){return p=n,this},this.chain=function(){return E=arguments,this},this.onStart=function(n){return I=n,this},this.onUpdate=function(n){return M=n,this},this.onComplete=function(n){return m=n,this},this.onStop=function(n){return w=n,this},this.update=function(n){var f;if(n<h)return!0;v===!1&&(null!==I&&I.call(t),v=!0);var w=(n-h)/e;w=w>1?1:w;var d=l(w);for(f in i){var O=r[f]||0,T=i[f];T instanceof Array?t[f]=p(T,d):("string"==typeof T&&(T=O+parseFloat(T,10)),"number"==typeof T&&(t[f]=O+(T-O)*d))}if(null!==M&&M.call(t,d),1==w){if(o>0){isFinite(o)&&o--;for(f in u){if("string"==typeof i[f]&&(u[f]=u[f]+parseFloat(i[f],10)),a){var g=u[f];u[f]=i[f],i[f]=g}r[f]=u[f]}return a&&(c=!c),h=n+s,!0}null!==m&&m.call(t);for(var N=0,W=E.length;N<W;N++)E[N].start(n);return!1}return!0}},TWEEN.Easing={Linear:{None:function(n){return n}},Quadratic:{In:function(n){return n*n},Out:function(n){return n*(2-n)},InOut:function(n){return(n*=2)<1?.5*n*n:-.5*(--n*(n-2)-1)}},Cubic:{In:function(n){return n*n*n},Out:function(n){return--n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n:.5*((n-=2)*n*n+2)}},Quartic:{In:function(n){return n*n*n*n},Out:function(n){return 1- --n*n*n*n},InOut:function(n){return(n*=2)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2)}},Quintic:{In:function(n){return n*n*n*n*n},Out:function(n){return--n*n*n*n*n+1},InOut:function(n){return(n*=2)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2)}},Sinusoidal:{In:function(n){return 1-Math.cos(n*Math.PI/2)},Out:function(n){return Math.sin(n*Math.PI/2)},InOut:function(n){return.5*(1-Math.cos(Math.PI*n))}},Exponential:{In:function(n){return 0===n?0:Math.pow(1024,n-1)},Out:function(n){return 1===n?1:1-Math.pow(2,-10*n)},InOut:function(n){return 0===n?0:1===n?1:(n*=2)<1?.5*Math.pow(1024,n-1):.5*(-Math.pow(2,-10*(n-1))+2)}},Circular:{In:function(n){return 1-Math.sqrt(1-n*n)},Out:function(n){return Math.sqrt(1- --n*n)},InOut:function(n){return(n*=2)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1)}},Elastic:{In:function(n){var t,r=.1,i=.4;return 0===n?0:1===n?1:(!r||r<1?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(n-=1))*Math.sin((n-t)*(2*Math.PI)/i)))},Out:function(n){var t,r=.1,i=.4;return 0===n?0:1===n?1:(!r||r<1?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*n)*Math.sin((n-t)*(2*Math.PI)/i)+1)},InOut:function(n){var t,r=.1,i=.4;return 0===n?0:1===n?1:(!r||r<1?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),(n*=2)<1?-.5*(r*Math.pow(2,10*(n-=1))*Math.sin((n-t)*(2*Math.PI)/i)):r*Math.pow(2,-10*(n-=1))*Math.sin((n-t)*(2*Math.PI)/i)*.5+1)}},Back:{In:function(n){var t=1.70158;return n*n*((t+1)*n-t)},Out:function(n){var t=1.70158;return--n*n*((t+1)*n+t)+1},InOut:function(n){var t=2.5949095;return(n*=2)<1?.5*(n*n*((t+1)*n-t)):.5*((n-=2)*n*((t+1)*n+t)+2)}},Bounce:{In:function(n){return 1-TWEEN.Easing.Bounce.Out(1-n)},Out:function(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},InOut:function(n){return n<.5?.5*TWEEN.Easing.Bounce.In(2*n):.5*TWEEN.Easing.Bounce.Out(2*n-1)+.5}}},TWEEN.Interpolation={Linear:function(n,t){var r=n.length-1,i=r*t,u=Math.floor(i),e=TWEEN.Interpolation.Utils.Linear;return t<0?e(n[0],n[1],i):t>1?e(n[r],n[r-1],r-i):e(n[u],n[u+1>r?r:u+1],i-u)},Bezier:function(n,t){var r,i=0,u=n.length-1,e=Math.pow,o=TWEEN.Interpolation.Utils.Bernstein;for(r=0;r<=u;r++)i+=e(1-t,u-r)*e(t,r)*n[r]*o(u,r);return i},CatmullRom:function(n,t){var r=n.length-1,i=r*t,u=Math.floor(i),e=TWEEN.Interpolation.Utils.CatmullRom;return n[0]===n[r]?(t<0&&(u=Math.floor(i=r*(1+t))),e(n[(u-1+r)%r],n[u],n[(u+1)%r],n[(u+2)%r],i-u)):t<0?n[0]-(e(n[0],n[0],n[1],n[1],-i)-n[0]):t>1?n[r]-(e(n[r],n[r],n[r-1],n[r-1],i-r)-n[r]):e(n[u?u-1:0],n[u],n[r<u+1?r:u+1],n[r<u+2?r:u+2],i-u)},Utils:{Linear:function(n,t,r){return(t-n)*r+n},Bernstein:function(n,t){var r=TWEEN.Interpolation.Utils.Factorial;return r(n)/r(t)/r(n-t)},Factorial:function(){var n=[1];return function(t){var r,i=1;if(n[t])return n[t];for(r=t;r>1;r--)i*=r;return n[t]=i}}(),CatmullRom:function(n,t,r,i,u){var e=.5*(r-n),o=.5*(i-t),a=u*u,f=u*a;return(2*t-2*r+e+o)*f+(-3*t+3*r-2*e-o)*a+e*u+t}}},function(n){"function"==typeof define&&define.amd?define([],function(){return TWEEN}):"object"==typeof exports?module.exports=TWEEN:n.TWEEN=TWEEN}(this);
},{}],19:[function(_dereq_,module,exports){
(function (global){
!function e(t,i,M){function s(r,N){if(!i[r]){if(!t[r]){var n="function"==typeof _dereq_&&_dereq_;if(!N&&n)return n(r,!0);if(A)return A(r,!0);var D=new Error("Cannot find module '"+r+"'");throw D.code="MODULE_NOT_FOUND",D}var u=i[r]={exports:{}};t[r][0].call(u.exports,function(e){var i=t[r][1][e];return s(i?i:e)},u,u.exports,e,t,i,M)}return i[r].exports}for(var A="function"==typeof _dereq_&&_dereq_,r=0;r<M.length;r++)s(M[r]);return s}({1:[function(e,t,i){(function(i,M){(function(){"use strict";function s(e){return"function"==typeof e||"object"==typeof e&&null!==e}function A(e){return"function"==typeof e}function r(e){W=e}function N(e){X=e}function n(){return function(){i.nextTick(g)}}function D(){return function(){F(g)}}function u(){var e=0,t=new q(g),i=document.createTextNode("");return t.observe(i,{characterData:!0}),function(){i.data=e=++e%2}}function o(){var e=new MessageChannel;return e.port1.onmessage=g,function(){e.port2.postMessage(0)}}function a(){return function(){setTimeout(g,1)}}function g(){for(var e=0;e<H;e+=2){var t=te[e],i=te[e+1];t(i),te[e]=void 0,te[e+1]=void 0}H=0}function j(){try{var t=e,i=t("vertx");return F=i.runOnLoop||i.runOnContext,D()}catch(e){return a()}}function I(e,t){var i=this,M=i._state;if(M===Ae&&!e||M===re&&!t)return this;var s=new this.constructor(c),A=i._result;if(M){var r=arguments[M-1];X(function(){m(M,s,r,A)})}else S(i,s,e,t);return s}function L(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var i=new t(c);return d(i,e),i}function c(){}function T(){return new TypeError("You cannot resolve a promise with itself")}function E(){return new TypeError("A promises callback cannot return that same promise.")}function y(e){try{return e.then}catch(e){return Ne.error=e,Ne}}function w(e,t,i,M){try{e.call(t,i,M)}catch(e){return e}}function l(e,t,i){X(function(e){var M=!1,s=w(i,t,function(i){M||(M=!0,t!==i?d(e,i):O(e,i))},function(t){M||(M=!0,C(e,t))},"Settle: "+(e._label||" unknown promise"));!M&&s&&(M=!0,C(e,s))},e)}function z(e,t){t._state===Ae?O(e,t._result):t._state===re?C(e,t._result):S(t,void 0,function(t){d(e,t)},function(t){C(e,t)})}function h(e,t,i){t.constructor===e.constructor&&i===ie&&constructor.resolve===Me?z(e,t):i===Ne?C(e,Ne.error):void 0===i?O(e,t):A(i)?l(e,t,i):O(e,t)}function d(e,t){e===t?C(e,T()):s(t)?h(e,t,y(t)):O(e,t)}function x(e){e._onerror&&e._onerror(e._result),p(e)}function O(e,t){e._state===se&&(e._result=t,e._state=Ae,0!==e._subscribers.length&&X(p,e))}function C(e,t){e._state===se&&(e._state=re,e._result=t,X(x,e))}function S(e,t,i,M){var s=e._subscribers,A=s.length;e._onerror=null,s[A]=t,s[A+Ae]=i,s[A+re]=M,0===A&&e._state&&X(p,e)}function p(e){var t=e._subscribers,i=e._state;if(0!==t.length){for(var M,s,A=e._result,r=0;r<t.length;r+=3)M=t[r],s=t[r+i],M?m(i,M,s,A):s(A);e._subscribers.length=0}}function f(){this.error=null}function Q(e,t){try{return e(t)}catch(e){return ne.error=e,ne}}function m(e,t,i,M){var s,r,N,n,D=A(i);if(D){if(s=Q(i,M),s===ne?(n=!0,r=s.error,s=null):N=!0,t===s)return void C(t,E())}else s=M,N=!0;t._state!==se||(D&&N?d(t,s):n?C(t,r):e===Ae?O(t,s):e===re&&C(t,s))}function k(e,t){try{t(function(t){d(e,t)},function(t){C(e,t)})}catch(t){C(e,t)}}function U(e){return new je(this,e).promise}function Y(e){function t(e){d(s,e)}function i(e){C(s,e)}var M=this,s=new M(c);if(!Z(e))return C(s,new TypeError("You must pass an array to race.")),s;for(var A=e.length,r=0;s._state===se&&r<A;r++)S(M.resolve(e[r]),void 0,t,i);return s}function v(e){var t=this,i=new t(c);return C(i,e),i}function B(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function b(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function _(e){this._id=ae++,this._state=void 0,this._result=void 0,this._subscribers=[],c!==e&&("function"!=typeof e&&B(),this instanceof _?k(this,e):b())}function R(e,t){this._instanceConstructor=e,this.promise=new e(c),Array.isArray(t)?(this._input=t,this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?O(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&O(this.promise,this._result))):C(this.promise,this._validationError())}function G(){var e;if("undefined"!=typeof M)e=M;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;t&&"[object Promise]"===Object.prototype.toString.call(t.resolve())&&!t.cast||(e.Promise=ge)}var P;P=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var F,W,V,Z=P,H=0,X=function(e,t){te[H]=e,te[H+1]=t,H+=2,2===H&&(W?W(g):V())},J="undefined"!=typeof window?window:void 0,K=J||{},q=K.MutationObserver||K.WebKitMutationObserver,$="undefined"!=typeof i&&"[object process]"==={}.toString.call(i),ee="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,te=new Array(1e3);V=$?n():q?u():ee?o():void 0===J&&"function"==typeof e?j():a();var ie=I,Me=L,se=void 0,Ae=1,re=2,Ne=new f,ne=new f,De=U,ue=Y,oe=v,ae=0,ge=_;_.all=De,_.race=ue,_.resolve=Me,_.reject=oe,_._setScheduler=r,_._setAsap=N,_._asap=X,_.prototype={constructor:_,then:ie,catch:function(e){return this.then(null,e)}};var je=R;R.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},R.prototype._enumerate=function(){for(var e=this.length,t=this._input,i=0;this._state===se&&i<e;i++)this._eachEntry(t[i],i)},R.prototype._eachEntry=function(e,t){var i=this._instanceConstructor,M=i.resolve;if(M===Me){var s=y(e);if(s===ie&&e._state!==se)this._settledAt(e._state,t,e._result);else if("function"!=typeof s)this._remaining--,this._result[t]=e;else if(i===ge){var A=new i(c);h(A,e,s),this._willSettleAt(A,t)}else this._willSettleAt(new i(function(t){t(e)}),t)}else this._willSettleAt(M(e),t)},R.prototype._settledAt=function(e,t,i){var M=this.promise;M._state===se&&(this._remaining--,e===re?C(M,i):this._result[t]=i),0===this._remaining&&O(M,this._result)},R.prototype._willSettleAt=function(e,t){var i=this;S(e,void 0,function(e){i._settledAt(Ae,t,e)},function(e){i._settledAt(re,t,e)})};var Ie=G,Le={Promise:ge,polyfill:Ie};"function"==typeof define&&define.amd?define(function(){return Le}):"undefined"!=typeof t&&t.exports?t.exports=Le:"undefined"!=typeof this&&(this.ES6Promise=Le),Ie()}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:3}],2:[function(e,t,i){"use strict";function M(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var s=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(e,t){for(var i,r,N=M(e),n=1;n<arguments.length;n++){i=Object(arguments[n]);for(var D in i)s.call(i,D)&&(N[D]=i[D]);if(Object.getOwnPropertySymbols){r=Object.getOwnPropertySymbols(i);for(var u=0;u<r.length;u++)A.call(i,r[u])&&(N[r[u]]=i[r[u]])}}return N}},{}],3:[function(e,t,i){function M(){u=!1,N.length?D=N.concat(D):o=-1,D.length&&s()}function s(){if(!u){var e=setTimeout(M);u=!0;for(var t=D.length;t;){for(N=D,D=[];++o<t;)N&&N[o].run();o=-1,t=D.length}N=null,u=!1,clearTimeout(e)}}function A(e,t){this.fun=e,this.array=t}function r(){}var N,n=t.exports={},D=[],u=!1,o=-1;n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];D.push(new A(e,t)),1!==D.length||u||setTimeout(s,0)},A.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=r,n.addListener=r,n.once=r,n.off=r,n.removeListener=r,n.removeAllListeners=r,n.emit=r,n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},{}],4:[function(e,t,i){function M(){this.isPolyfilled=!0,this.displayId=D++,this.displayName="webvr-polyfill displayName",this.isConnected=!0,this.isPresenting=!1,this.capabilities={hasPosition:!1,hasOrientation:!1,hasExternalDisplay:!1,canPresent:!1,maxLayers:1},this.stageParameters=null,this.waitingForPresent_=!1,this.layer_=null,this.fullscreenElement_=null,this.fullscreenWrapper_=null,this.fullscreenElementCachedStyle_=null,this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null,this.wakelock_=new n}function s(){this.isPolyfilled=!0,this.hardwareUnitId="webvr-polyfill hardwareUnitId",this.deviceId="webvr-polyfill deviceId",this.deviceName="webvr-polyfill deviceName"}function A(){}function r(){}var N=e("./util.js"),n=e("./wakelock.js"),D=1e3,u=!1;M.prototype.getPose=function(){return this.getImmediatePose()},M.prototype.requestAnimationFrame=function(e){return window.requestAnimationFrame(e)},M.prototype.cancelAnimationFrame=function(e){return window.cancelAnimationFrame(e)},M.prototype.wrapForFullscreen=function(e){function t(){if(s.fullscreenElement_){var e=["position: absolute","top: 0","left: 0","width: "+Math.max(screen.width,screen.height)+"px","height: "+Math.min(screen.height,screen.width)+"px","border: 0","margin: 0","padding: 0"];s.fullscreenElement_.setAttribute("style",e.join("; ")+";")}}if(N.isIOS())return e;if(!this.fullscreenWrapper_){this.fullscreenWrapper_=document.createElement("div");var i=["height: "+Math.min(screen.height,screen.width)+"px !important","top: 0 !important","left: 0 !important","right: 0 !important","border: 0","margin: 0","padding: 0","z-index: 999999 !important","position: fixed"];this.fullscreenWrapper_.setAttribute("style",i.join("; ")+";"),this.fullscreenWrapper_.classList.add("webvr-polyfill-fullscreen-wrapper")}if(this.fullscreenElement_==e)return this.fullscreenWrapper_;this.removeFullscreenWrapper(),this.fullscreenElement_=e;var M=this.fullscreenElement_.parentElement;M.insertBefore(this.fullscreenWrapper_,this.fullscreenElement_),M.removeChild(this.fullscreenElement_),this.fullscreenWrapper_.insertBefore(this.fullscreenElement_,this.fullscreenWrapper_.firstChild),this.fullscreenElementCachedStyle_=this.fullscreenElement_.getAttribute("style");var s=this;return t(),this.fullscreenWrapper_},M.prototype.removeFullscreenWrapper=function(){if(this.fullscreenElement_){var e=this.fullscreenElement_;this.fullscreenElementCachedStyle_?e.setAttribute("style",this.fullscreenElementCachedStyle_):e.removeAttribute("style"),this.fullscreenElement_=null,this.fullscreenElementCachedStyle_=null;var t=this.fullscreenWrapper_.parentElement;return this.fullscreenWrapper_.removeChild(e),t.insertBefore(e,this.fullscreenWrapper_),t.removeChild(this.fullscreenWrapper_),e}},M.prototype.requestPresent=function(e){if(this.isPresenting)return void console.error("Already presenting!");var t=this;return e instanceof Array||(u||(console.warn("Using a deprecated form of requestPresent. Should pass in an array of VRLayers."),u=!0),e=[e]),new Promise(function(i,M){function s(){var e=N.getFullscreenElement();t.isPresenting=r===e,t.isPresenting?(screen.orientation&&screen.orientation.lock&&screen.orientation.lock("landscape-primary"),t.waitingForPresent_=!1,t.beginPresent_(),i()):(screen.orientation&&screen.orientation.unlock&&screen.orientation.unlock(),t.removeFullscreenWrapper(),t.wakelock_.release(),t.endPresent_(),t.removeFullscreenListeners_()),t.fireVRDisplayPresentChange_()}function A(){t.waitingForPresent_&&(t.removeFullscreenWrapper(),t.removeFullscreenListeners_(),t.wakelock_.release(),t.waitingForPresent_=!1,t.isPresenting=!1,M(new Error("Unable to present.")))}if(!t.capabilities.canPresent)return void M(new Error("VRDisplay is not capable of presenting."));if(0==e.length||e.length>t.capabilities.maxLayers)return void M(new Error("Invalid number of layers."));if(t.layer_=e[0],t.waitingForPresent_=!1,t.layer_&&t.layer_.source){var r=t.wrapForFullscreen(t.layer_.source);t.addFullscreenListeners_(r,s,A),N.requestFullscreen(r)?(t.wakelock_.request(),t.waitingForPresent_=!0):N.isIOS()&&(t.wakelock_.request(),t.isPresenting=!0,t.beginPresent_(),t.fireVRDisplayPresentChange_(),i())}t.waitingForPresent_||N.isIOS()||(N.exitFullscreen(),M(new Error("Unable to present.")))})},M.prototype.exitPresent=function(){var e=this.isPresenting,t=this;return this.isPresenting=!1,this.layer_=null,this.wakelock_.release(),new Promise(function(i,M){e?(!N.exitFullscreen()&&N.isIOS()&&(t.endPresent_(),t.fireVRDisplayPresentChange_()),i()):M(new Error("Was not presenting to VRDisplay."))})},M.prototype.getLayers=function(){return this.layer_?[this.layer_]:[]},M.prototype.fireVRDisplayPresentChange_=function(){var e=new CustomEvent("vrdisplaypresentchange",{detail:{vrdisplay:this}});window.dispatchEvent(e)},M.prototype.addFullscreenListeners_=function(e,t,i){this.removeFullscreenListeners_(),this.fullscreenEventTarget_=e,this.fullscreenChangeHandler_=t,this.fullscreenErrorHandler_=i,t&&(e.addEventListener("fullscreenchange",t,!1),e.addEventListener("webkitfullscreenchange",t,!1),document.addEventListener("mozfullscreenchange",t,!1),e.addEventListener("msfullscreenchange",t,!1)),i&&(e.addEventListener("fullscreenerror",i,!1),e.addEventListener("webkitfullscreenerror",i,!1),document.addEventListener("mozfullscreenerror",i,!1),e.addEventListener("msfullscreenerror",i,!1))},M.prototype.removeFullscreenListeners_=function(){if(this.fullscreenEventTarget_){var e=this.fullscreenEventTarget_;if(this.fullscreenChangeHandler_){var t=this.fullscreenChangeHandler_;e.removeEventListener("fullscreenchange",t,!1),e.removeEventListener("webkitfullscreenchange",t,!1),document.removeEventListener("mozfullscreenchange",t,!1),e.removeEventListener("msfullscreenchange",t,!1)}if(this.fullscreenErrorHandler_){var i=this.fullscreenErrorHandler_;e.removeEventListener("fullscreenerror",i,!1),e.removeEventListener("webkitfullscreenerror",i,!1),document.removeEventListener("mozfullscreenerror",i,!1),e.removeEventListener("msfullscreenerror",i,!1)}this.fullscreenEventTarget_=null,this.fullscreenChangeHandler_=null,this.fullscreenErrorHandler_=null}},M.prototype.beginPresent_=function(){},M.prototype.endPresent_=function(){},M.prototype.submitFrame=function(e){},M.prototype.getEyeParameters=function(e){return null},A.prototype=new s,r.prototype=new s,t.exports.VRDisplay=M,t.exports.VRDevice=s,t.exports.HMDVRDevice=A,t.exports.PositionSensorVRDevice=r},{"./util.js":24,"./wakelock.js":26}],5:[function(e,t,i){function M(e){this.gl=e,this.ctxAttribs=e.getContextAttributes(),this.meshWidth=20,this.meshHeight=20,this.bufferScale=WebVRConfig.BUFFER_SCALE,this.bufferWidth=e.drawingBufferWidth,this.bufferHeight=e.drawingBufferHeight,this.realBindFramebuffer=e.bindFramebuffer,this.realEnable=e.enable,this.realDisable=e.disable,this.realColorMask=e.colorMask,this.realClearColor=e.clearColor,this.realViewport=e.viewport,A.isIOS()||(this.realCanvasWidth=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"width"),this.realCanvasHeight=Object.getOwnPropertyDescriptor(e.canvas.__proto__,"height")),this.isPatched=!1,this.lastBoundFramebuffer=null,this.cullFace=!1,this.depthTest=!1,this.blend=!1,this.scissorTest=!1,this.stencilTest=!1,this.viewport=[0,0,0,0],this.colorMask=[!0,!0,!0,!0],this.clearColor=[0,0,0,0],this.attribs={position:0,texCoord:1},this.program=A.linkProgram(e,N,n,this.attribs),this.uniforms=A.getProgramUniforms(e,this.program),this.viewportOffsetScale=new Float32Array(8),this.setTextureBounds(),this.vertexBuffer=e.createBuffer(),this.indexBuffer=e.createBuffer(),this.indexCount=0,this.renderTarget=e.createTexture(),this.framebuffer=e.createFramebuffer(),this.depthStencilBuffer=null,this.depthBuffer=null,this.stencilBuffer=null,this.ctxAttribs.depth&&this.ctxAttribs.stencil?this.depthStencilBuffer=e.createRenderbuffer():this.ctxAttribs.depth?this.depthBuffer=e.createRenderbuffer():this.ctxAttribs.stencil&&(this.stencilBuffer=e.createRenderbuffer()),this.patch(),this.onResize(),WebVRConfig.CARDBOARD_UI_DISABLED||(this.cardboardUI=new s(e))}var s=e("./cardboard-ui.js"),A=e("./util.js"),r=e("./deps/wglu-preserve-state.js"),N=["attribute vec2 position;","attribute vec3 texCoord;","varying vec2 vTexCoord;","uniform vec4 viewportOffsetScale[2];","void main() {"," vec4 viewport = viewportOffsetScale[int(texCoord.z)];"," vTexCoord = (texCoord.xy * viewport.zw) + viewport.xy;"," gl_Position = vec4( position, 1.0, 1.0 );","}"].join("\n"),n=["precision mediump float;","uniform sampler2D diffuse;","varying vec2 vTexCoord;","void main() {"," gl_FragColor = texture2D(diffuse, vTexCoord);","}"].join("\n");M.prototype.destroy=function(){var e=this.gl;this.unpatch(),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer),e.deleteBuffer(this.indexBuffer),e.deleteTexture(this.renderTarget),e.deleteFramebuffer(this.framebuffer),this.depthStencilBuffer&&e.deleteRenderbuffer(this.depthStencilBuffer),this.depthBuffer&&e.deleteRenderbuffer(this.depthBuffer),this.stencilBuffer&&e.deleteRenderbuffer(this.stencilBuffer),this.cardboardUI&&this.cardboardUI.destroy()},M.prototype.onResize=function(){var e=this.gl,t=this,i=[e.RENDERBUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0];r(e,i,function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.framebuffer),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.texImage2D(e.TEXTURE_2D,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,t.bufferWidth,t.bufferHeight,0,t.ctxAttribs.alpha?e.RGBA:e.RGB,e.UNSIGNED_BYTE,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t.renderTarget,0),t.ctxAttribs.depth&&t.ctxAttribs.stencil?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthStencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t.depthStencilBuffer)):t.ctxAttribs.depth?(e.bindRenderbuffer(e.RENDERBUFFER,t.depthBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t.depthBuffer)):t.ctxAttribs.stencil&&(e.bindRenderbuffer(e.RENDERBUFFER,t.stencilBuffer),e.renderbufferStorage(e.RENDERBUFFER,e.STENCIL_INDEX8,t.bufferWidth,t.bufferHeight),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,t.stencilBuffer)),!e.checkFramebufferStatus(e.FRAMEBUFFER)===e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer incomplete!"),t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),t.realClearColor.apply(e,t.clearColor)}),this.cardboardUI&&this.cardboardUI.onResize()},M.prototype.patch=function(){if(!this.isPatched){var e=this,t=this.gl.canvas,i=this.gl;A.isIOS()||(t.width=A.getScreenWidth()*this.bufferScale,t.height=A.getScreenHeight()*this.bufferScale,Object.defineProperty(t,"width",{configurable:!0,enumerable:!0,get:function(){return e.bufferWidth},set:function(t){e.bufferWidth=t,e.onResize()}}),Object.defineProperty(t,"height",{configurable:!0,enumerable:!0,get:function(){return e.bufferHeight},set:function(t){e.bufferHeight=t,e.onResize()}})),this.lastBoundFramebuffer=i.getParameter(i.FRAMEBUFFER_BINDING),null==this.lastBoundFramebuffer&&(this.lastBoundFramebuffer=this.framebuffer,this.gl.bindFramebuffer(i.FRAMEBUFFER,this.framebuffer)),this.gl.bindFramebuffer=function(t,M){e.lastBoundFramebuffer=M?M:e.framebuffer,e.realBindFramebuffer.call(i,t,e.lastBoundFramebuffer)},this.cullFace=i.getParameter(i.CULL_FACE),this.depthTest=i.getParameter(i.DEPTH_TEST),this.blend=i.getParameter(i.BLEND),this.scissorTest=i.getParameter(i.SCISSOR_TEST),this.stencilTest=i.getParameter(i.STENCIL_TEST),i.enable=function(t){switch(t){case i.CULL_FACE:e.cullFace=!0;break;case i.DEPTH_TEST:e.depthTest=!0;break;case i.BLEND:e.blend=!0;break;case i.SCISSOR_TEST:e.scissorTest=!0;break;case i.STENCIL_TEST:e.stencilTest=!0}e.realEnable.call(i,t)},i.disable=function(t){switch(t){case i.CULL_FACE:e.cullFace=!1;break;case i.DEPTH_TEST:e.depthTest=!1;break;case i.BLEND:e.blend=!1;break;case i.SCISSOR_TEST:e.scissorTest=!1;break;case i.STENCIL_TEST:e.stencilTest=!1}e.realDisable.call(i,t)},this.colorMask=i.getParameter(i.COLOR_WRITEMASK),i.colorMask=function(t,M,s,A){e.colorMask[0]=t,e.colorMask[1]=M,e.colorMask[2]=s,e.colorMask[3]=A,e.realColorMask.call(i,t,M,s,A)},this.clearColor=i.getParameter(i.COLOR_CLEAR_VALUE),i.clearColor=function(t,M,s,A){e.clearColor[0]=t,e.clearColor[1]=M,e.clearColor[2]=s,e.clearColor[3]=A,e.realClearColor.call(i,t,M,s,A)},this.viewport=i.getParameter(i.VIEWPORT),i.viewport=function(t,M,s,A){e.viewport[0]=t,e.viewport[1]=M,e.viewport[2]=s,e.viewport[3]=A,e.realViewport.call(i,t,M,s,A)},this.isPatched=!0,A.safariCssSizeWorkaround(t)}},M.prototype.unpatch=function(){if(this.isPatched){var e=this.gl,t=this.gl.canvas;A.isIOS()||(Object.defineProperty(t,"width",this.realCanvasWidth),Object.defineProperty(t,"height",this.realCanvasHeight)),t.width=this.bufferWidth,t.height=this.bufferHeight,e.bindFramebuffer=this.realBindFramebuffer,e.enable=this.realEnable,e.disable=this.realDisable,e.colorMask=this.realColorMask,e.clearColor=this.realClearColor,e.viewport=this.realViewport,this.lastBoundFramebuffer==this.framebuffer&&e.bindFramebuffer(e.FRAMEBUFFER,null),this.isPatched=!1,setTimeout(function(){A.safariCssSizeWorkaround(t)},1)}},M.prototype.setTextureBounds=function(e,t){e||(e=[0,0,.5,1]),t||(t=[.5,0,.5,1]),this.viewportOffsetScale[0]=e[0],this.viewportOffsetScale[1]=e[1],this.viewportOffsetScale[2]=e[2],this.viewportOffsetScale[3]=e[3],this.viewportOffsetScale[4]=t[0],this.viewportOffsetScale[5]=t[1],this.viewportOffsetScale[6]=t[2],this.viewportOffsetScale[7]=t[3]},M.prototype.submitFrame=function(){var e=this.gl,t=this,i=[];if(WebVRConfig.DIRTY_SUBMIT_FRAME_BINDINGS||i.push(e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING,e.ELEMENT_ARRAY_BUFFER_BINDING,e.TEXTURE_BINDING_2D,e.TEXTURE0),r(e,i,function(e){t.realBindFramebuffer.call(e,e.FRAMEBUFFER,null),t.cullFace&&t.realDisable.call(e,e.CULL_FACE),t.depthTest&&t.realDisable.call(e,e.DEPTH_TEST),t.blend&&t.realDisable.call(e,e.BLEND),t.scissorTest&&t.realDisable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realDisable.call(e,e.STENCIL_TEST),t.realColorMask.call(e,!0,!0,!0,!0),t.realViewport.call(e,0,0,e.drawingBufferWidth,e.drawingBufferHeight),(t.ctxAttribs.alpha||A.isIOS())&&(t.realClearColor.call(e,0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)),e.useProgram(t.program),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.indexBuffer),e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.enableVertexAttribArray(t.attribs.position),e.enableVertexAttribArray(t.attribs.texCoord),e.vertexAttribPointer(t.attribs.position,2,e.FLOAT,!1,20,0),e.vertexAttribPointer(t.attribs.texCoord,3,e.FLOAT,!1,20,8),e.activeTexture(e.TEXTURE0),e.uniform1i(t.uniforms.diffuse,0),e.bindTexture(e.TEXTURE_2D,t.renderTarget),e.uniform4fv(t.uniforms.viewportOffsetScale,t.viewportOffsetScale),e.drawElements(e.TRIANGLES,t.indexCount,e.UNSIGNED_SHORT,0),t.cardboardUI&&t.cardboardUI.renderNoState(),t.realBindFramebuffer.call(t.gl,e.FRAMEBUFFER,t.framebuffer),t.ctxAttribs.preserveDrawingBuffer||(t.realClearColor.call(e,0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)),WebVRConfig.DIRTY_SUBMIT_FRAME_BINDINGS||t.realBindFramebuffer.call(e,e.FRAMEBUFFER,t.lastBoundFramebuffer),t.cullFace&&t.realEnable.call(e,e.CULL_FACE),t.depthTest&&t.realEnable.call(e,e.DEPTH_TEST),t.blend&&t.realEnable.call(e,e.BLEND),t.scissorTest&&t.realEnable.call(e,e.SCISSOR_TEST),t.stencilTest&&t.realEnable.call(e,e.STENCIL_TEST),t.realColorMask.apply(e,t.colorMask),t.realViewport.apply(e,t.viewport),!t.ctxAttribs.alpha&&t.ctxAttribs.preserveDrawingBuffer||t.realClearColor.apply(e,t.clearColor)}),A.isIOS()){var M=e.canvas;M.width==t.bufferWidth&&M.height==t.bufferHeight||(t.bufferWidth=M.width,t.bufferHeight=M.height,t.onResize())}},M.prototype.updateDeviceInfo=function(e){var t=this.gl,i=this,M=[t.ARRAY_BUFFER_BINDING,t.ELEMENT_ARRAY_BUFFER_BINDING];r(t,M,function(t){var M=i.computeMeshVertices_(i.meshWidth,i.meshHeight,e);if(t.bindBuffer(t.ARRAY_BUFFER,i.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,M,t.STATIC_DRAW),!i.indexCount){var s=i.computeMeshIndices_(i.meshWidth,i.meshHeight);t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,i.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,s,t.STATIC_DRAW),i.indexCount=s.length}})},M.prototype.computeMeshVertices_=function(e,t,i){for(var M=new Float32Array(2*e*t*5),s=i.getLeftEyeVisibleTanAngles(),r=i.getLeftEyeNoLensTanAngles(),N=i.getLeftEyeVisibleScreenRect(r),n=0,D=0;D<2;D++){for(var u=0;u<t;u++)for(var o=0;o<e;o++,n++){var a=o/(e-1),g=u/(t-1),j=a,I=g,L=A.lerp(s[0],s[2],a),c=A.lerp(s[3],s[1],g),T=Math.sqrt(L*L+c*c),E=i.distortion.distortInverse(T),y=L*E/T,w=c*E/T;a=(y-r[0])/(r[2]-r[0]),g=(w-r[3])/(r[1]-r[3]);i.device.widthMeters/i.device.heightMeters;a=2*(N.x+a*N.width-.5),g=2*(N.y+g*N.height-.5),M[5*n+0]=a,M[5*n+1]=g,M[5*n+2]=j,M[5*n+3]=I,M[5*n+4]=D}var l=s[2]-s[0];s[0]=-(l+s[0]),s[2]=l-s[2],l=r[2]-r[0],r[0]=-(l+r[0]),r[2]=l-r[2],N.x=1-(N.x+N.width)}return M},M.prototype.computeMeshIndices_=function(e,t){for(var i=new Uint16Array(2*(e-1)*(t-1)*6),M=e/2,s=t/2,A=0,r=0,N=0;N<2;N++)for(var n=0;n<t;n++)for(var D=0;D<e;D++,A++)0!=D&&0!=n&&(D<=M==n<=s?(i[r++]=A,i[r++]=A-e-1,i[r++]=A-e,i[r++]=A-e-1,i[r++]=A,i[r++]=A-1):(i[r++]=A-1,i[r++]=A-e,i[r++]=A,i[r++]=A-e,i[r++]=A-1,i[r++]=A-e-1));return i},M.prototype.getOwnPropertyDescriptor_=function(e,t){var i=Object.getOwnPropertyDescriptor(e,t);return void 0!==i.get&&void 0!==i.set||(i.configurable=!0,i.enumerable=!0,i.get=function(){return this.getAttribute(t)},i.set=function(e){this.setAttribute(t,e)}),i},t.exports=M},{"./cardboard-ui.js":6,"./deps/wglu-preserve-state.js":8,"./util.js":24}],6:[function(e,t,i){function M(e){this.gl=e,this.attribs={position:0},this.program=s.linkProgram(e,r,N,this.attribs),this.uniforms=s.getProgramUniforms(e,this.program),this.vertexBuffer=e.createBuffer(),this.gearOffset=0,this.gearVertexCount=0,this.arrowOffset=0,this.arrowVertexCount=0,this.projMat=new Float32Array(16),this.listener=null,this.onResize()}var s=e("./util.js"),A=e("./deps/wglu-preserve-state.js"),r=["attribute vec2 position;","uniform mat4 projectionMat;","void main() {"," gl_Position = projectionMat * vec4( position, -1.0, 1.0 );","}"].join("\n"),N=["precision mediump float;","uniform vec4 color;","void main() {"," gl_FragColor = color;","}"].join("\n"),n=Math.PI/180,D=60,u=12,o=20,a=1,g=.75,j=.3125,I=4,L=28,c=1.5;M.prototype.destroy=function(){var e=this.gl;this.listener&&e.canvas.removeEventListener("click",this.listener,!1),e.deleteProgram(this.program),e.deleteBuffer(this.vertexBuffer)},M.prototype.listen=function(e,t){var i=this.gl.canvas;this.listener=function(M){var s=i.clientWidth/2,A=L*c;M.clientX>s-A&&M.clientX<s+A&&M.clientY>i.clientHeight-A?e(M):M.clientX<A&&M.clientY<A&&t(M)},i.addEventListener("click",this.listener,!1)},M.prototype.onResize=function(){var e=this.gl,t=this,i=[e.ARRAY_BUFFER_BINDING];A(e,i,function(e){function i(e,t){var i=(90-e)*n,M=Math.cos(i),s=Math.sin(i);A.push(j*M*y+r,j*s*y+y),A.push(t*M*y+r,t*s*y+y)}function M(t,i){A.push(w+t,e.drawingBufferHeight-w-i)}var A=[],r=e.drawingBufferWidth/2,N=e.drawingBufferWidth/(screen.width*window.devicePixelRatio);s.isIOS()||(N*=window.devicePixelRatio);var T=I*N/2,E=L*c*N,y=L*N/2,w=(L*c-L)*N;A.push(r-T,E),A.push(r-T,e.drawingBufferHeight),A.push(r+T,E),A.push(r+T,e.drawingBufferHeight),t.gearOffset=A.length/2;for(var l=0;l<=6;l++){var z=l*D;i(z,a),i(z+u,a),i(z+o,g),i(z+(D-o),g),i(z+(D-u),a)}t.gearVertexCount=A.length/2-t.gearOffset,t.arrowOffset=A.length/2;var h=T/Math.sin(45*n);M(0,y),M(y,0),M(y+h,h),M(h,y+h),M(h,y-h),M(0,y),M(y,2*y),M(y+h,2*y-h),M(h,y-h),M(0,y),M(h,y-T),M(L*N,y-T),M(h,y+T),M(L*N,y+T),t.arrowVertexCount=A.length/2-t.arrowOffset,e.bindBuffer(e.ARRAY_BUFFER,t.vertexBuffer),e.bufferData(e.ARRAY_BUFFER,new Float32Array(A),e.STATIC_DRAW)})},M.prototype.render=function(){var e=this.gl,t=this,i=[e.CULL_FACE,e.DEPTH_TEST,e.BLEND,e.SCISSOR_TEST,e.STENCIL_TEST,e.COLOR_WRITEMASK,e.VIEWPORT,e.CURRENT_PROGRAM,e.ARRAY_BUFFER_BINDING];A(e,i,function(e){e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.BLEND),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.colorMask(!0,!0,!0,!0),e.viewport(0,0,e.drawingBufferWidth,e.drawingBufferHeight),t.renderNoState()})},M.prototype.renderNoState=function(){var e=this.gl;e.useProgram(this.program),e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer),e.enableVertexAttribArray(this.attribs.position),e.vertexAttribPointer(this.attribs.position,2,e.FLOAT,!1,8,0),e.uniform4f(this.uniforms.color,1,1,1,1),s.orthoMatrix(this.projMat,0,e.drawingBufferWidth,0,e.drawingBufferHeight,.1,1024),e.uniformMatrix4fv(this.uniforms.projectionMat,!1,this.projMat),e.drawArrays(e.TRIANGLE_STRIP,0,4),e.drawArrays(e.TRIANGLE_STRIP,this.gearOffset,this.gearVertexCount),e.drawArrays(e.TRIANGLE_STRIP,this.arrowOffset,this.arrowVertexCount)},t.exports=M},{"./deps/wglu-preserve-state.js":8,"./util.js":24}],7:[function(e,t,i){function M(){this.displayName="Cardboard VRDisplay (webvr-polyfill)",this.capabilities.hasOrientation=!0,this.capabilities.canPresent=!0,this.bufferScale_=WebVRConfig.BUFFER_SCALE,this.poseSensor_=new n,this.distorter_=null,this.cardboardUI_=null,this.dpdb_=new N((!0),this.onDeviceParamsUpdated_.bind(this)),this.deviceInfo_=new r(this.dpdb_.getDeviceParams()),this.viewerSelector_=new u,this.viewerSelector_.on("change",this.onViewerChanged_.bind(this)),this.deviceInfo_.setViewer(this.viewerSelector_.getCurrentViewer()),WebVRConfig.ROTATE_INSTRUCTIONS_DISABLED||(this.rotateInstructions_=new D),a.isIOS()&&window.addEventListener("resize",this.onResize_.bind(this))}var s=e("./cardboard-distorter.js"),A=e("./cardboard-ui.js"),r=e("./device-info.js"),N=e("./dpdb/dpdb.js"),n=e("./sensor-fusion/fusion-pose-sensor.js"),D=e("./rotate-instructions.js"),u=e("./viewer-selector.js"),o=e("./base.js").VRDisplay,a=e("./util.js"),g={LEFT:"left",RIGHT:"right"};M.prototype=new o,M.prototype.getImmediatePose=function(){return{position:this.poseSensor_.getPosition(),orientation:this.poseSensor_.getOrientation(),linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},M.prototype.resetPose=function(){this.poseSensor_.resetPose()},M.prototype.getEyeParameters=function(e){var t,i=[.5*this.deviceInfo_.viewer.interLensDistance,0,0];if(e==g.LEFT)i[0]*=-1,t=this.deviceInfo_.getFieldOfViewLeftEye();else{if(e!=g.RIGHT)return console.error("Invalid eye provided: %s",e),null;t=this.deviceInfo_.getFieldOfViewRightEye()}return{fieldOfView:t,offset:i,renderWidth:.5*this.deviceInfo_.device.width*this.bufferScale_,renderHeight:this.deviceInfo_.device.height*this.bufferScale_}},M.prototype.onDeviceParamsUpdated_=function(e){console.log("DPDB reported that device params were updated."),this.deviceInfo_.updateDeviceParams(e),this.distorter_&&this.distorter.updateDeviceInfo(this.deviceInfo_)},M.prototype.beginPresent_=function(){var e=this.layer_.source.getContext("webgl");e||(e=this.layer_.source.getContext("experimental-webgl")),e||(e=this.layer_.source.getContext("webgl2")),e&&(this.layer_.predistorted?WebVRConfig.CARDBOARD_UI_DISABLED||(e.canvas.width=a.getScreenWidth()*this.bufferScale_,
e.canvas.height=a.getScreenHeight()*this.bufferScale_,this.cardboardUI_=new A(e)):(this.distorter_=new s(e),this.distorter_.updateDeviceInfo(this.deviceInfo_),this.cardboardUI_=this.distorter_.cardboardUI,(this.layer_.leftBounds||this.layer_.rightBounds)&&this.distorter_.setTextureBounds(this.layer_.leftBounds,this.layer_.rightBounds)),this.cardboardUI_&&this.cardboardUI_.listen(function(e){this.viewerSelector_.show(this.layer_.source.parentElement),e.stopPropagation(),e.preventDefault()}.bind(this),function(e){this.exitPresent(),e.stopPropagation(),e.preventDefault()}.bind(this)),this.rotateInstructions_&&(a.isLandscapeMode()&&a.isMobile()?this.rotateInstructions_.showTemporarily(3e3,this.layer_.source.parentElement):this.rotateInstructions_.update()),this.orientationHandler=this.onOrientationChange_.bind(this),window.addEventListener("orientationchange",this.orientationHandler),this.fireVRDisplayDeviceParamsChange_())},M.prototype.endPresent_=function(){this.distorter_&&(this.distorter_.destroy(),this.distorter_=null),this.cardboardUI_&&(this.cardboardUI_.destroy(),this.cardboardUI_=null),this.rotateInstructions_&&this.rotateInstructions_.hide(),this.viewerSelector_.hide(),window.removeEventListener("orientationchange",this.orientationHandler)},M.prototype.submitFrame=function(e){if(this.distorter_)this.distorter_.submitFrame();else if(this.cardboardUI_&&this.layer_){var t=this.layer_.source.getContext("webgl").canvas;t.width==this.lastWidth&&t.height==this.lastHeight||this.cardboardUI_.onResize(),this.lastWidth=t.width,this.lastHeight=t.height,this.cardboardUI_.render()}},M.prototype.onOrientationChange_=function(e){console.log("onOrientationChange_"),this.viewerSelector_.hide(),this.rotateInstructions_&&this.rotateInstructions_.update(),this.onResize_()},M.prototype.onResize_=function(e){if(this.layer_){var t=this.layer_.source.getContext("webgl"),i=["position: absolute","top: 0","left: 0","width: "+Math.max(screen.width,screen.height)+"px","height: "+Math.min(screen.height,screen.width)+"px","border: 0","margin: 0","padding: 0 10px 10px 0"];t.canvas.setAttribute("style",i.join("; ")+";"),a.safariCssSizeWorkaround(t.canvas)}},M.prototype.onViewerChanged_=function(e){this.deviceInfo_.setViewer(e),this.distorter_&&this.distorter_.updateDeviceInfo(this.deviceInfo_),this.fireVRDisplayDeviceParamsChange_()},M.prototype.fireVRDisplayDeviceParamsChange_=function(){var e=new CustomEvent("vrdisplaydeviceparamschange",{detail:{vrdisplay:this,deviceInfo:this.deviceInfo_}});window.dispatchEvent(e)},t.exports=M},{"./base.js":4,"./cardboard-distorter.js":5,"./cardboard-ui.js":6,"./device-info.js":9,"./dpdb/dpdb.js":13,"./rotate-instructions.js":18,"./sensor-fusion/fusion-pose-sensor.js":20,"./util.js":24,"./viewer-selector.js":25}],8:[function(e,t,i){function M(e,t,i){if(!t)return void i(e);for(var M=[],s=null,A=0;A<t.length;++A){var r=t[A];switch(r){case e.TEXTURE_BINDING_2D:case e.TEXTURE_BINDING_CUBE_MAP:var N=t[++A];if(N<e.TEXTURE0||N>e.TEXTURE31){console.error("TEXTURE_BINDING_2D or TEXTURE_BINDING_CUBE_MAP must be followed by a valid texture unit"),M.push(null,null);break}s||(s=e.getParameter(e.ACTIVE_TEXTURE)),e.activeTexture(N),M.push(e.getParameter(r),null);break;case e.ACTIVE_TEXTURE:s=e.getParameter(e.ACTIVE_TEXTURE),M.push(null);break;default:M.push(e.getParameter(r))}}i(e);for(var A=0;A<t.length;++A){var r=t[A],n=M[A];switch(r){case e.ACTIVE_TEXTURE:break;case e.ARRAY_BUFFER_BINDING:e.bindBuffer(e.ARRAY_BUFFER,n);break;case e.COLOR_CLEAR_VALUE:e.clearColor(n[0],n[1],n[2],n[3]);break;case e.COLOR_WRITEMASK:e.colorMask(n[0],n[1],n[2],n[3]);break;case e.CURRENT_PROGRAM:e.useProgram(n);break;case e.ELEMENT_ARRAY_BUFFER_BINDING:e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n);break;case e.FRAMEBUFFER_BINDING:e.bindFramebuffer(e.FRAMEBUFFER,n);break;case e.RENDERBUFFER_BINDING:e.bindRenderbuffer(e.RENDERBUFFER,n);break;case e.TEXTURE_BINDING_2D:var N=t[++A];if(N<e.TEXTURE0||N>e.TEXTURE31)break;e.activeTexture(N),e.bindTexture(e.TEXTURE_2D,n);break;case e.TEXTURE_BINDING_CUBE_MAP:var N=t[++A];if(N<e.TEXTURE0||N>e.TEXTURE31)break;e.activeTexture(N),e.bindTexture(e.TEXTURE_CUBE_MAP,n);break;case e.VIEWPORT:e.viewport(n[0],n[1],n[2],n[3]);break;case e.BLEND:case e.CULL_FACE:case e.DEPTH_TEST:case e.SCISSOR_TEST:case e.STENCIL_TEST:n?e.enable(r):e.disable(r);break;default:console.log("No GL restore behavior for 0x"+r.toString(16))}s&&e.activeTexture(s)}}t.exports=M},{}],9:[function(e,t,i){function M(e){this.width=e.width||n.getScreenWidth(),this.height=e.height||n.getScreenHeight(),this.widthMeters=e.widthMeters,this.heightMeters=e.heightMeters,this.bevelMeters=e.bevelMeters}function s(e){this.viewer=o.CardboardV2,this.updateDeviceParams(e),this.distortion=new r(this.viewer.distortionCoefficients)}function A(e){this.id=e.id,this.label=e.label,this.fov=e.fov,this.interLensDistance=e.interLensDistance,this.baselineLensDistance=e.baselineLensDistance,this.screenLensDistance=e.screenLensDistance,this.distortionCoefficients=e.distortionCoefficients,this.inverseCoefficients=e.inverseCoefficients}var r=e("./distortion/distortion.js"),N=e("./math-util.js"),n=e("./util.js"),D=new M({widthMeters:.11,heightMeters:.062,bevelMeters:.004}),u=new M({widthMeters:.1038,heightMeters:.0584,bevelMeters:.004}),o={CardboardV1:new A({id:"CardboardV1",label:"Cardboard I/O 2014",fov:40,interLensDistance:.06,baselineLensDistance:.035,screenLensDistance:.042,distortionCoefficients:[.441,.156],inverseCoefficients:[-.4410035,.42756155,-.4804439,.5460139,-.58821183,.5733938,-.48303202,.33299083,-.17573841,.0651772,-.01488963,.001559834]}),CardboardV2:new A({id:"CardboardV2",label:"Cardboard I/O 2015",fov:60,interLensDistance:.064,baselineLensDistance:.035,screenLensDistance:.039,distortionCoefficients:[.34,.55],inverseCoefficients:[-.33836704,-.18162185,.862655,-1.2462051,1.0560602,-.58208317,.21609078,-.05444823,.009177956,-.0009904169,6183535e-11,-16981803e-13]})};s.prototype.updateDeviceParams=function(e){this.device=this.determineDevice_(e)||this.device},s.prototype.getDevice=function(){return this.device},s.prototype.setViewer=function(e){this.viewer=e,this.distortion=new r(this.viewer.distortionCoefficients)},s.prototype.determineDevice_=function(e){if(!e)return n.isIOS()?(console.warn("Using fallback iOS device measurements."),u):(console.warn("Using fallback Android device measurements."),D);var t=.0254,i=t/e.xdpi,s=t/e.ydpi,A=n.getScreenWidth(),r=n.getScreenHeight();return new M({widthMeters:i*A,heightMeters:s*r,bevelMeters:.001*e.bevelMm})},s.prototype.getDistortedFieldOfViewLeftEye=function(){var e=this.viewer,t=this.device,i=this.distortion,M=e.screenLensDistance,s=(t.widthMeters-e.interLensDistance)/2,A=e.interLensDistance/2,r=e.baselineLensDistance-t.bevelMeters,n=t.heightMeters-r,D=N.radToDeg*Math.atan(i.distort(s/M)),u=N.radToDeg*Math.atan(i.distort(A/M)),o=N.radToDeg*Math.atan(i.distort(r/M)),a=N.radToDeg*Math.atan(i.distort(n/M));return{leftDegrees:Math.min(D,e.fov),rightDegrees:Math.min(u,e.fov),downDegrees:Math.min(o,e.fov),upDegrees:Math.min(a,e.fov)}},s.prototype.getLeftEyeVisibleTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,M=Math.tan(-N.degToRad*e.fov),s=Math.tan(N.degToRad*e.fov),A=Math.tan(N.degToRad*e.fov),r=Math.tan(-N.degToRad*e.fov),n=t.widthMeters/4,D=t.heightMeters/2,u=e.baselineLensDistance-t.bevelMeters-D,o=e.interLensDistance/2-n,a=-u,g=e.screenLensDistance,j=i.distort((o-n)/g),I=i.distort((a+D)/g),L=i.distort((o+n)/g),c=i.distort((a-D)/g),T=new Float32Array(4);return T[0]=Math.max(M,j),T[1]=Math.min(s,I),T[2]=Math.min(A,L),T[3]=Math.max(r,c),T},s.prototype.getLeftEyeNoLensTanAngles=function(){var e=this.viewer,t=this.device,i=this.distortion,M=new Float32Array(4),s=i.distortInverse(Math.tan(-N.degToRad*e.fov)),A=i.distortInverse(Math.tan(N.degToRad*e.fov)),r=i.distortInverse(Math.tan(N.degToRad*e.fov)),n=i.distortInverse(Math.tan(-N.degToRad*e.fov)),D=t.widthMeters/4,u=t.heightMeters/2,o=e.baselineLensDistance-t.bevelMeters-u,a=e.interLensDistance/2-D,g=-o,j=e.screenLensDistance,I=(a-D)/j,L=(g+u)/j,c=(a+D)/j,T=(g-u)/j;return M[0]=Math.max(s,I),M[1]=Math.min(A,L),M[2]=Math.min(r,c),M[3]=Math.max(n,T),M},s.prototype.getLeftEyeVisibleScreenRect=function(e){var t=this.viewer,i=this.device,M=t.screenLensDistance,s=(i.widthMeters-t.interLensDistance)/2,A=t.baselineLensDistance-i.bevelMeters,r=(e[0]*M+s)/i.widthMeters,N=(e[1]*M+A)/i.heightMeters,n=(e[2]*M+s)/i.widthMeters,D=(e[3]*M+A)/i.heightMeters;return{x:r,y:D,width:n-r,height:N-D}},s.prototype.getFieldOfViewLeftEye=function(e){return e?this.getUndistortedFieldOfViewLeftEye():this.getDistortedFieldOfViewLeftEye()},s.prototype.getFieldOfViewRightEye=function(e){var t=this.getFieldOfViewLeftEye(e);return{leftDegrees:t.rightDegrees,rightDegrees:t.leftDegrees,upDegrees:t.upDegrees,downDegrees:t.downDegrees}},s.prototype.getUndistortedFieldOfViewLeftEye=function(){var e=this.getUndistortedParams_();return{leftDegrees:N.radToDeg*Math.atan(e.outerDist),rightDegrees:N.radToDeg*Math.atan(e.innerDist),downDegrees:N.radToDeg*Math.atan(e.bottomDist),upDegrees:N.radToDeg*Math.atan(e.topDist)}},s.prototype.getUndistortedViewportLeftEye=function(){var e=this.getUndistortedParams_(),t=this.viewer,i=this.device,M=t.screenLensDistance,s=i.widthMeters/M,A=i.heightMeters/M,r=i.width/s,N=i.height/A,n=Math.round((e.eyePosX-e.outerDist)*r),D=Math.round((e.eyePosY-e.bottomDist)*N);return{x:n,y:D,width:Math.round((e.eyePosX+e.innerDist)*r)-n,height:Math.round((e.eyePosY+e.topDist)*N)-D}},s.prototype.getUndistortedParams_=function(){var e=this.viewer,t=this.device,i=this.distortion,M=e.screenLensDistance,s=e.interLensDistance/2/M,A=t.widthMeters/M,r=t.heightMeters/M,n=A/2-s,D=(e.baselineLensDistance-t.bevelMeters)/M,u=e.fov,o=i.distortInverse(Math.tan(N.degToRad*u)),a=Math.min(n,o),g=Math.min(s,o),j=Math.min(D,o),I=Math.min(r-D,o);return{outerDist:a,innerDist:g,topDist:I,bottomDist:j,eyePosX:n,eyePosY:D}},s.Viewers=o,t.exports=s},{"./distortion/distortion.js":11,"./math-util.js":16,"./util.js":24}],10:[function(e,t,i){function M(e){this.display=e,this.hardwareUnitId=e.displayId,this.deviceId="webvr-polyfill:HMD:"+e.displayId,this.deviceName=e.displayName+" (HMD)"}function s(e){this.display=e,this.hardwareUnitId=e.displayId,this.deviceId="webvr-polyfill:PositionSensor: "+e.displayId,this.deviceName=e.displayName+" (PositionSensor)"}var A=(e("./base.js").VRDisplay,e("./base.js").HMDVRDevice),r=e("./base.js").PositionSensorVRDevice;M.prototype=new A,M.prototype.getEyeParameters=function(e){var t=this.display.getEyeParameters(e);return{currentFieldOfView:t.fieldOfView,maximumFieldOfView:t.fieldOfView,minimumFieldOfView:t.fieldOfView,recommendedFieldOfView:t.fieldOfView,eyeTranslation:{x:t.offset[0],y:t.offset[1],z:t.offset[2]},renderRect:{x:"right"==e?t.renderWidth:0,y:0,width:t.renderWidth,height:t.renderHeight}}},M.prototype.setFieldOfView=function(e,t,i,M){},s.prototype=new r,s.prototype.getState=function(){var e=this.display.getPose();return{position:e.position?{x:e.position[0],y:e.position[1],z:e.position[2]}:null,orientation:e.orientation?{x:e.orientation[0],y:e.orientation[1],z:e.orientation[2],w:e.orientation[3]}:null,linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},s.prototype.resetState=function(){return this.positionDevice.resetPose()},t.exports.VRDisplayHMDDevice=M,t.exports.VRDisplayPositionSensorDevice=s},{"./base.js":4}],11:[function(e,t,i){function M(e){this.coefficients=e}M.prototype.distortInverse=function(e){for(var t=0,i=1,M=e-this.distort(t);Math.abs(i-t)>1e-4;){var s=e-this.distort(i),A=i-s*((i-t)/(s-M));t=i,i=A,M=s}return i},M.prototype.distort=function(e){for(var t=e*e,i=0,M=0;M<this.coefficients.length;M++)i=t*(i+this.coefficients[M]);return(i+1)*e},M.prototype.solveLinear_=function(e,t){for(var i=e.length,M=0;M<i-1;++M)for(var s=M+1;s<i;++s){for(var A=e[M][s]/e[M][M],r=M+1;r<i;++r)e[r][s]-=A*e[r][M];t[s]-=A*t[M]}for(var N=new Array(i),M=i-1;M>=0;--M){for(var n=t[M],r=M+1;r<i;++r)n-=e[r][M]*N[r];N[M]=n/e[M][M]}return N},M.prototype.solveLeastSquares_=function(e,t){var i,M,s,A,r=e.length,N=e[0].length;if(r!=t.Length)throw new Error("Matrix / vector dimension mismatch");var n=new Array(N);for(s=0;s<N;++s)for(n[s]=new Array(N),M=0;M<N;++M){for(A=0,i=0;i<r;++i)A+=e[M][i]*e[s][i];n[s][M]=A}var D=new Array(N);for(M=0;M<N;++M){for(A=0,i=0;i<r;++i)A+=e[M][i]*t[i];D[M]=A}return this.solveLinear_(n,D)},M.prototype.approximateInverse=function(e,t){e=e||1,t=t||100;var i,s,A=6,r=new Array(A);for(s=0;s<A;++s)r[s]=new Array(t);var N=new Array(t);for(i=0;i<t;++i){var n=e*(i+1)/t,D=this.distort(n),u=D;for(s=0;s<A;++s)u*=D*D,r[s][i]=u;N[i]=n-D}var o=this.solveLeastSquares_(r,N);return new M(o)},t.exports=M},{}],12:[function(e,t,i){var M={format:1,last_updated:"2016-01-20T00:18:35Z",devices:[{type:"android",rules:[{mdmh:"asus/*/Nexus 7/*"},{ua:"Nexus 7"}],dpi:[320.8,323],bw:3,ac:500},{type:"android",rules:[{mdmh:"asus/*/ASUS_Z00AD/*"},{ua:"ASUS_Z00AD"}],dpi:[403,404.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"HTC/*/HTC6435LVW/*"},{ua:"HTC6435LVW"}],dpi:[449.7,443.3],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"HTC/*/HTC One XL/*"},{ua:"HTC One XL"}],dpi:[315.3,314.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"htc/*/Nexus 9/*"},{ua:"Nexus 9"}],dpi:289,bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One M9/*"},{ua:"HTC One M9"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One_M8/*"},{ua:"HTC One_M8"}],dpi:[449.7,447.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"HTC/*/HTC One/*"},{ua:"HTC One"}],dpi:472.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Huawei/*/Nexus 6P/*"},{ua:"Nexus 6P"}],dpi:[515.1,518],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 5X/*"},{ua:"Nexus 5X"}],dpi:[422,419.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGMS345/*"},{ua:"LGMS345"}],dpi:[221.7,219.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/LG-D800/*"},{ua:"LG-D800"}],dpi:[422,424.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/LG-D850/*"},{ua:"LG-D850"}],dpi:[537.9,541.9],bw:3,ac:500},{type:"android",rules:[{mdmh:"LGE/*/VS985 4G/*"},{ua:"VS985 4G"}],dpi:[537.9,535.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 5/*"},{ua:"Nexus 5 "}],dpi:[442.4,444.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/Nexus 4/*"},{ua:"Nexus 4"}],dpi:[319.8,318.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LG-P769/*"},{ua:"LG-P769"}],dpi:[240.6,247.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGMS323/*"},{ua:"LGMS323"}],dpi:[206.6,204.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"LGE/*/LGLS996/*"},{ua:"LGLS996"}],dpi:[403.4,401.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/4560MMX/*"},{ua:"4560MMX"}],dpi:[240,219.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/A250/*"},{ua:"Micromax A250"}],dpi:[480,446.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Micromax/*/Micromax AQ4501/*"},{ua:"Micromax AQ4501"}],dpi:240,bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/DROID RAZR/*"},{ua:"DROID RAZR"}],dpi:[368.1,256.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT830C/*"},{ua:"XT830C"}],dpi:[254,255.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1021/*"},{ua:"XT1021"}],dpi:[254,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1023/*"},{ua:"XT1023"}],dpi:[254,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1028/*"},{ua:"XT1028"}],dpi:[326.6,327.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1034/*"},{ua:"XT1034"}],dpi:[326.6,328.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1053/*"},{ua:"XT1053"}],dpi:[315.3,316.1],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1562/*"},{ua:"XT1562"}],dpi:[403.4,402.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/Nexus 6/*"},{ua:"Nexus 6 "}],dpi:[494.3,489.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1063/*"},{ua:"XT1063"}],dpi:[295,296.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"motorola/*/XT1064/*"},{ua:"XT1064"}],dpi:[295,295.6],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1092/*"},{ua:"XT1092"}],dpi:[422,424.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"motorola/*/XT1095/*"},{ua:"XT1095"}],dpi:[422,423.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/A0001/*"},{ua:"A0001"}],dpi:[403.4,401],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE E1005/*"},{ua:"ONE E1005"}],dpi:[442.4,441.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OnePlus/*/ONE A2005/*"},{ua:"ONE A2005"}],dpi:[391.9,405.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"OPPO/*/X909/*"},{ua:"X909"}],dpi:[442.4,444.1],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9082/*"},{ua:"GT-I9082"}],dpi:[184.7,185.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G360P/*"},{ua:"SM-G360P"}],dpi:[196.7,205.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/Nexus S/*"},{ua:"Nexus S"}],dpi:[234.5,229.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300/*"},{ua:"GT-I9300"}],dpi:[304.8,303.9],bw:5,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-T230NU/*"},{ua:"SM-T230NU"}],dpi:216,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SGH-T399/*"},{ua:"SGH-T399"}],dpi:[217.7,231.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N9005/*"},{ua:"SM-N9005"}],dpi:[386.4,387],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SAMSUNG-SM-N900A/*"},{ua:"SAMSUNG-SM-N900A"}],dpi:[386.4,387.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9500/*"},{ua:"GT-I9500"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/GT-I9505/*"},{ua:"GT-I9505"}],dpi:439.4,bw:4,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G900F/*"},{ua:"SM-G900F"}],dpi:[415.6,431.6],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G900M/*"},{ua:"SM-G900M"}],dpi:[415.6,431.6],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G800F/*"},{ua:"SM-G800F"}],dpi:326.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G906S/*"},{ua:"SM-G906S"}],dpi:[562.7,572.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300/*"},{ua:"GT-I9300"}],dpi:[306.7,304.8],bw:5,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-T535/*"},{ua:"SM-T535"}],dpi:[142.6,136.4],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-N920C/*"},{ua:"SM-N920C"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9300I/*"},{ua:"GT-I9300I"}],dpi:[304.8,305.8],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-I9195/*"},{ua:"GT-I9195"}],dpi:[249.4,256.7],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SPH-L520/*"},{ua:"SPH-L520"}],dpi:[249.4,255.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SAMSUNG-SGH-I717/*"},{ua:"SAMSUNG-SGH-I717"}],dpi:285.8,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SPH-D710/*"},{ua:"SPH-D710"}],dpi:[217.7,204.2],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/GT-N7100/*"},{ua:"GT-N7100"}],dpi:265.1,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SCH-I605/*"},{ua:"SCH-I605"}],dpi:265.1,bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/Galaxy Nexus/*"},{ua:"Galaxy Nexus"}],dpi:[315.3,314.2],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N910H/*"},{ua:"SM-N910H"}],dpi:[515.1,518],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-N910C/*"},{ua:"SM-N910C"}],dpi:[515.2,520.2],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G130M/*"},{ua:"SM-G130M"}],dpi:[165.9,164.8],bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G928I/*"},{ua:"SM-G928I"}],dpi:[515.1,518.4],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G920F/*"},{ua:"SM-G920F"}],dpi:580.6,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G920P/*"},{ua:"SM-G920P"}],dpi:[522.5,577],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"samsung/*/SM-G925F/*"},{ua:"SM-G925F"}],dpi:580.6,bw:3,ac:500},{type:"android",rules:[{mdmh:"samsung/*/SM-G925V/*"},{ua:"SM-G925V"}],dpi:[522.5,576.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/C6903/*"},{ua:"C6903"}],dpi:[442.5,443.3],bw:3,ac:500},{type:"android",rules:[{mdmh:"Sony/*/D6653/*"},{ua:"D6653"}],dpi:[428.6,427.6],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/E6653/*"},{ua:"E6653"}],dpi:[428.6,425.7],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/E6853/*"},{ua:"E6853"}],dpi:[403.4,401.9],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"Sony/*/SGP321/*"},{ua:"SGP321"}],dpi:[224.7,224.1],bw:3,ac:500},{type:"android",rules:[{mdmh:"TCT/*/ALCATEL ONE TOUCH Fierce/*"},{ua:"ALCATEL ONE TOUCH Fierce"}],dpi:[240,247.5],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"THL/*/thl 5000/*"},{ua:"thl 5000"}],dpi:[480,443.3],bw:3,ac:1e3},{type:"android",rules:[{mdmh:"ZTE/*/ZTE Blade L2/*"},{ua:"ZTE Blade L2"}],dpi:240,bw:3,ac:500},{type:"ios",rules:[{res:[640,960]}],dpi:[325.1,328.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[640,960]}],dpi:[325.1,328.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[640,1136]}],dpi:[317.1,320.2],bw:3,ac:1e3},{type:"ios",rules:[{res:[640,1136]}],dpi:[317.1,320.2],bw:3,ac:1e3},{type:"ios",rules:[{res:[750,1334]}],dpi:326.4,bw:4,ac:1e3},{type:"ios",rules:[{res:[750,1334]}],dpi:326.4,bw:4,ac:1e3},{type:"ios",rules:[{res:[1242,2208]}],dpi:[453.6,458.4],bw:4,ac:1e3},{type:"ios",rules:[{res:[1242,2208]}],dpi:[453.6,458.4],bw:4,ac:1e3}]};t.exports=M},{}],13:[function(e,t,i){function M(e,t){if(this.dpdb=A,this.recalculateDeviceParams_(),e){this.onDeviceParamsUpdated=t,console.log("Fetching DPDB...");var i=new XMLHttpRequest,M=this;i.open("GET",N,!0),i.addEventListener("load",function(){M.loading=!1,i.status>=200&&i.status<=299?(console.log("Successfully loaded online DPDB."),M.dpdb=JSON.parse(i.response),M.recalculateDeviceParams_()):console.error("Error loading online DPDB!")}),i.send()}}function s(e){this.xdpi=e.xdpi,this.ydpi=e.ydpi,this.bevelMm=e.bevelMm}var A=e("./dpdb-cache.js"),r=e("../util.js"),N="https://storage.googleapis.com/cardboard-dpdb/dpdb.json";M.prototype.getDeviceParams=function(){return this.deviceParams},M.prototype.recalculateDeviceParams_=function(){console.log("Recalculating device params.");var e=this.calcDeviceParams_();console.log("New device parameters:"),console.log(e),e?(this.deviceParams=e,this.onDeviceParamsUpdated&&this.onDeviceParamsUpdated(this.deviceParams)):console.error("Failed to recalculate device parameters.")},M.prototype.calcDeviceParams_=function(){var e=this.dpdb;if(!e)return console.error("DPDB not available."),null;if(1!=e.format)return console.error("DPDB has unexpected format version."),null;if(!e.devices||!e.devices.length)return console.error("DPDB does not have a devices section."),null;var t=navigator.userAgent||navigator.vendor||window.opera,i=r.getScreenWidth(),M=r.getScreenHeight();if(console.log("User agent: "+t),console.log("Pixel width: "+i),console.log("Pixel height: "+M),!e.devices)return console.error("DPDB has no devices section."),null;for(var A=0;A<e.devices.length;A++){var N=e.devices[A];if(N.rules)if("ios"==N.type||"android"==N.type){if(r.isIOS()==("ios"==N.type)){for(var n=!1,D=0;D<N.rules.length;D++){var u=N.rules[D];if(this.matchRule_(u,t,i,M)){console.log("Rule matched:"),console.log(u),n=!0;break}}if(n){var o=N.dpi[0]||N.dpi,a=N.dpi[1]||N.dpi;return new s({xdpi:o,ydpi:a,bevelMm:N.bw})}}}else console.warn("Device["+A+"] has invalid type.");else console.warn("Device["+A+"] has no rules section.")}return console.warn("No DPDB device match."),null},M.prototype.matchRule_=function(e,t,i,M){if(!e.ua&&!e.res)return!1;if(e.ua&&t.indexOf(e.ua)<0)return!1;if(e.res){if(!e.res[0]||!e.res[1])return!1;var s=e.res[0],A=e.res[1];if(Math.min(i,M)!=Math.min(s,A)||Math.max(i,M)!=Math.max(s,A))return!1}return!0},t.exports=M},{"../util.js":24,"./dpdb-cache.js":12}],14:[function(e,t,i){function M(){this.callbacks={}}M.prototype.emit=function(e){var t=this.callbacks[e];if(t){var i=[].slice.call(arguments);i.shift();for(var M=0;M<t.length;M++)t[M].apply(this,i)}},M.prototype.on=function(e,t){e in this.callbacks?this.callbacks[e].push(t):this.callbacks[e]=[t]},t.exports=M},{}],15:[function(e,t,i){var M=e("./util.js"),s=e("./webvr-polyfill.js");window.WebVRConfig=M.extend({FORCE_ENABLE_VR:!1,K_FILTER:.98,PREDICTION_TIME_S:.04,TOUCH_PANNER_DISABLED:!1,CARDBOARD_UI_DISABLED:!1,ROTATE_INSTRUCTIONS_DISABLED:!1,YAW_ONLY:!1,MOUSE_KEYBOARD_CONTROLS_DISABLED:!1,DEFER_INITIALIZATION:!1,ENABLE_DEPRECATED_API:!1,BUFFER_SCALE:.5,DIRTY_SUBMIT_FRAME_BINDINGS:!1},window.WebVRConfig),window.WebVRConfig.DEFER_INITIALIZATION?window.InitializeWebVRPolyfill=function(){new s}:new s},{"./util.js":24,"./webvr-polyfill.js":27}],16:[function(e,t,i){var M=window.MathUtil||{};M.degToRad=Math.PI/180,M.radToDeg=180/Math.PI,M.Vector2=function(e,t){this.x=e||0,this.y=t||0},M.Vector2.prototype={constructor:M.Vector2,set:function(e,t){return this.x=e,this.y=t,this},copy:function(e){return this.x=e.x,this.y=e.y,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}},M.Vector3=function(e,t,i){this.x=e||0,this.y=t||0,this.z=i||0},M.Vector3.prototype={constructor:M.Vector3,set:function(e,t,i){return this.x=e,this.y=t,this.z=i,this},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},normalize:function(){var e=this.length();if(0!==e){var t=1/e;this.multiplyScalar(t)}else this.x=0,this.y=0,this.z=0;return this},multiplyScalar:function(e){this.x*=e,this.y*=e,this.z*=e},applyQuaternion:function(e){var t=this.x,i=this.y,M=this.z,s=e.x,A=e.y,r=e.z,N=e.w,n=N*t+A*M-r*i,D=N*i+r*t-s*M,u=N*M+s*i-A*t,o=-s*t-A*i-r*M;return this.x=n*N+o*-s+D*-r-u*-A,this.y=D*N+o*-A+u*-s-n*-r,this.z=u*N+o*-r+n*-A-D*-s,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},crossVectors:function(e,t){var i=e.x,M=e.y,s=e.z,A=t.x,r=t.y,N=t.z;return this.x=M*N-s*r,this.y=s*A-i*N,this.z=i*r-M*A,this}},M.Quaternion=function(e,t,i,M){this.x=e||0,this.y=t||0,this.z=i||0,this.w=void 0!==M?M:1},M.Quaternion.prototype={constructor:M.Quaternion,set:function(e,t,i,M){return this.x=e,this.y=t,this.z=i,this.w=M,this},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w,this},setFromEulerXYZ:function(e,t,i){var M=Math.cos(e/2),s=Math.cos(t/2),A=Math.cos(i/2),r=Math.sin(e/2),N=Math.sin(t/2),n=Math.sin(i/2);return this.x=r*s*A+M*N*n,this.y=M*N*A-r*s*n,this.z=M*s*n+r*N*A,this.w=M*s*A-r*N*n,this},setFromEulerYXZ:function(e,t,i){var M=Math.cos(e/2),s=Math.cos(t/2),A=Math.cos(i/2),r=Math.sin(e/2),N=Math.sin(t/2),n=Math.sin(i/2);return this.x=r*s*A+M*N*n,this.y=M*N*A-r*s*n,this.z=M*s*n-r*N*A,this.w=M*s*A+r*N*n,this},setFromAxisAngle:function(e,t){var i=t/2,M=Math.sin(i);return this.x=e.x*M,this.y=e.y*M,this.z=e.z*M,this.w=Math.cos(i),this},multiply:function(e){return this.multiplyQuaternions(this,e)},multiplyQuaternions:function(e,t){var i=e.x,M=e.y,s=e.z,A=e.w,r=t.x,N=t.y,n=t.z,D=t.w;return this.x=i*D+A*r+M*n-s*N,this.y=M*D+A*N+s*r-i*n,this.z=s*D+A*n+i*N-M*r,this.w=A*D-i*r-M*N-s*n,this},inverse:function(){return this.x*=-1,this.y*=-1,this.z*=-1,this.normalize(),this},normalize:function(){var e=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===e?(this.x=0,this.y=0,this.z=0,this.w=1):(e=1/e,this.x=this.x*e,this.y=this.y*e,this.z=this.z*e,this.w=this.w*e),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var i=this.x,M=this.y,s=this.z,A=this.w,r=A*e.w+i*e.x+M*e.y+s*e.z;if(r<0?(this.w=-e.w,this.x=-e.x,this.y=-e.y,this.z=-e.z,r=-r):this.copy(e),r>=1)return this.w=A,this.x=i,this.y=M,this.z=s,this;var N=Math.acos(r),n=Math.sqrt(1-r*r);if(Math.abs(n)<.001)return this.w=.5*(A+this.w),this.x=.5*(i+this.x),this.y=.5*(M+this.y),this.z=.5*(s+this.z),this;var D=Math.sin((1-t)*N)/n,u=Math.sin(t*N)/n;return this.w=A*D+this.w*u,this.x=i*D+this.x*u,this.y=M*D+this.y*u,this.z=s*D+this.z*u,this},setFromUnitVectors:function(){var e,t,i=1e-6;return function(s,A){return void 0===e&&(e=new M.Vector3),t=s.dot(A)+1,t<i?(t=0,Math.abs(s.x)>Math.abs(s.z)?e.set(-s.y,s.x,0):e.set(0,-s.z,s.y)):e.crossVectors(s,A),this.x=e.x,this.y=e.y,this.z=e.z,this.w=t,this.normalize(),this}}()},t.exports=M},{}],17:[function(e,t,i){function M(){this.displayName="Mouse and Keyboard VRDisplay (webvr-polyfill)",this.capabilities.hasOrientation=!0,window.addEventListener("keydown",this.onKeyDown_.bind(this)),window.addEventListener("mousemove",this.onMouseMove_.bind(this)),window.addEventListener("mousedown",this.onMouseDown_.bind(this)),window.addEventListener("mouseup",this.onMouseUp_.bind(this)),this.phi_=0,this.theta_=0,this.targetAngle_=null,this.angleAnimation_=null,this.orientation_=new A.Quaternion,this.rotateStart_=new A.Vector2,this.rotateEnd_=new A.Vector2,this.rotateDelta_=new A.Vector2,this.isDragging_=!1,this.orientationOut_=new Float32Array(4)}var s=e("./base.js").VRDisplay,A=e("./math-util.js"),r=e("./util.js"),N=.15,n=80,D=.5,u=.3;M.prototype=new s,M.prototype.getImmediatePose=function(){return this.orientation_.setFromEulerYXZ(this.phi_,this.theta_,0),this.orientationOut_[0]=this.orientation_.x,this.orientationOut_[1]=this.orientation_.y,this.orientationOut_[2]=this.orientation_.z,this.orientationOut_[3]=this.orientation_.w,{position:null,orientation:this.orientationOut_,linearVelocity:null,linearAcceleration:null,angularVelocity:null,angularAcceleration:null}},M.prototype.onKeyDown_=function(e){38==e.keyCode?this.animatePhi_(this.phi_+N):39==e.keyCode?this.animateTheta_(this.theta_-N):40==e.keyCode?this.animatePhi_(this.phi_-N):37==e.keyCode&&this.animateTheta_(this.theta_+N)},M.prototype.animateTheta_=function(e){this.animateKeyTransitions_("theta_",e)},M.prototype.animatePhi_=function(e){e=r.clamp(e,-Math.PI/2,Math.PI/2),this.animateKeyTransitions_("phi_",e)},M.prototype.animateKeyTransitions_=function(e,t){this.angleAnimation_&&cancelAnimationFrame(this.angleAnimation_);var i=this[e],M=new Date;this.angleAnimation_=requestAnimationFrame(function s(){var A=new Date-M;if(A>=n)return this[e]=t,void cancelAnimationFrame(this.angleAnimation_);this.angleAnimation_=requestAnimationFrame(s.bind(this));var r=A/n;this[e]=i+(t-i)*r}.bind(this))},M.prototype.onMouseDown_=function(e){this.rotateStart_.set(e.clientX,e.clientY),this.isDragging_=!0},M.prototype.onMouseMove_=function(e){if(this.isDragging_||this.isPointerLocked_()){if(this.isPointerLocked_()){var t=e.movementX||e.mozMovementX||0,i=e.movementY||e.mozMovementY||0;this.rotateEnd_.set(this.rotateStart_.x-t,this.rotateStart_.y-i)}else this.rotateEnd_.set(e.clientX,e.clientY);this.rotateDelta_.subVectors(this.rotateEnd_,this.rotateStart_),this.rotateStart_.copy(this.rotateEnd_),this.phi_+=2*Math.PI*this.rotateDelta_.y/screen.height*u,this.theta_+=2*Math.PI*this.rotateDelta_.x/screen.width*D,this.phi_=r.clamp(this.phi_,-Math.PI/2,Math.PI/2)}},M.prototype.onMouseUp_=function(e){this.isDragging_=!1},M.prototype.isPointerLocked_=function(){var e=document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement;return void 0!==e},M.prototype.resetPose=function(){this.phi_=0,this.theta_=0},t.exports=M},{"./base.js":4,"./math-util.js":16,"./util.js":24}],18:[function(e,t,i){function M(){this.loadIcon_();var e=document.createElement("div"),t=e.style;t.position="fixed",t.top=0,t.right=0,t.bottom=0,t.left=0,t.backgroundColor="gray",t.fontFamily="sans-serif",t.zIndex=1e6;var i=document.createElement("img");i.src=this.icon;var t=i.style;t.marginLeft="25%",t.marginTop="25%",t.width="50%",e.appendChild(i);var M=document.createElement("div"),t=M.style;t.textAlign="center",t.fontSize="16px",t.lineHeight="24px",t.margin="24px 25%",t.width="50%",M.innerHTML="Place your phone into your Cardboard viewer.",e.appendChild(M);var s=document.createElement("div"),t=s.style;t.backgroundColor="#CFD8DC",t.position="fixed",t.bottom=0,t.width="100%",t.height="48px",t.padding="14px 24px",t.boxSizing="border-box",t.color="#656A6B",e.appendChild(s);var A=document.createElement("div");A.style.float="left",A.innerHTML="No Cardboard viewer?";var r=document.createElement("a");r.href="https://www.google.com/get/cardboard/get-cardboard/",r.innerHTML="get one",r.target="_blank";
var t=r.style;t.float="right",t.fontWeight=600,t.textTransform="uppercase",t.borderLeft="1px solid gray",t.paddingLeft="24px",t.textDecoration="none",t.color="#656A6B",s.appendChild(A),s.appendChild(r),this.overlay=e,this.text=M,this.hide()}var s=e("./util.js");M.prototype.show=function(e){e||this.overlay.parentElement?e&&(this.overlay.parentElement&&this.overlay.parentElement!=e&&this.overlay.parentElement.removeChild(this.overlay),e.appendChild(this.overlay)):document.body.appendChild(this.overlay),this.overlay.style.display="block";var t=this.overlay.querySelector("img"),i=t.style;s.isLandscapeMode()?(i.width="20%",i.marginLeft="40%",i.marginTop="3%"):(i.width="50%",i.marginLeft="25%",i.marginTop="25%")},M.prototype.hide=function(){this.overlay.style.display="none"},M.prototype.showTemporarily=function(e,t){this.show(t),this.timer=setTimeout(this.hide.bind(this),e)},M.prototype.disableShowTemporarily=function(){clearTimeout(this.timer)},M.prototype.update=function(){this.disableShowTemporarily(),!s.isLandscapeMode()&&s.isMobile()?this.show():this.hide()},M.prototype.loadIcon_=function(){this.icon=s.base64("image/svg+xml","PD94bWwgdmVyc2lvbj0iMS4wIiBlbmN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ZpbGw9IiM0NTVBNjQiIHNrZXRjaDp0eXBlPSJNU1NoYXBlR3JvdXAiPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+");
},t.exports=M},{"./util.js":24}],19:[function(e,t,i){function M(e){this.kFilter=e,this.currentAccelMeasurement=new s,this.currentGyroMeasurement=new s,this.previousGyroMeasurement=new s,this.filterQ=new A.Quaternion,this.previousFilterQ=new A.Quaternion,this.accelQ=new A.Quaternion,this.isOrientationInitialized=!1,this.estimatedGravity=new A.Vector3,this.measuredGravity=new A.Vector3,this.gyroIntegralQ=new A.Quaternion}var s=e("./sensor-sample.js"),A=e("../math-util.js"),r=e("../util.js"),N=!1;M.prototype.addAccelMeasurement=function(e,t){this.currentAccelMeasurement.set(e,t)},M.prototype.addGyroMeasurement=function(e,t){this.currentGyroMeasurement.set(e,t);var i=t-this.previousGyroMeasurement.timestampS;r.isTimestampDeltaValid(i)&&this.run_(),this.previousGyroMeasurement.copy(this.currentGyroMeasurement)},M.prototype.run_=function(){if(!this.isOrientationInitialized)return this.accelQ=this.accelToQuaternion_(this.currentAccelMeasurement.sample),this.previousFilterQ.copy(this.accelQ),void(this.isOrientationInitialized=!0);var e=this.currentGyroMeasurement.timestampS-this.previousGyroMeasurement.timestampS,t=this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample,e);this.gyroIntegralQ.multiply(t),this.filterQ.copy(this.previousFilterQ),this.filterQ.multiply(t);var i=new A.Quaternion;i.copy(this.filterQ),i.inverse(),this.estimatedGravity.set(0,0,-1),this.estimatedGravity.applyQuaternion(i),this.estimatedGravity.normalize(),this.measuredGravity.copy(this.currentAccelMeasurement.sample),this.measuredGravity.normalize();var M=new A.Quaternion;M.setFromUnitVectors(this.estimatedGravity,this.measuredGravity),M.inverse(),N&&console.log("Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)",A.radToDeg*r.getQuaternionAngle(M),this.estimatedGravity.x.toFixed(1),this.estimatedGravity.y.toFixed(1),this.estimatedGravity.z.toFixed(1),this.measuredGravity.x.toFixed(1),this.measuredGravity.y.toFixed(1),this.measuredGravity.z.toFixed(1));var s=new A.Quaternion;s.copy(this.filterQ),s.multiply(M),this.filterQ.slerp(s,1-this.kFilter),this.previousFilterQ.copy(this.filterQ)},M.prototype.getOrientation=function(){return this.filterQ},M.prototype.accelToQuaternion_=function(e){var t=new A.Vector3;t.copy(e),t.normalize();var i=new A.Quaternion;return i.setFromUnitVectors(new A.Vector3(0,0,(-1)),t),i.inverse(),i},M.prototype.gyroToQuaternionDelta_=function(e,t){var i=new A.Quaternion,M=new A.Vector3;return M.copy(e),M.normalize(),i.setFromAxisAngle(M,e.length()*t),i},t.exports=M},{"../math-util.js":16,"../util.js":24,"./sensor-sample.js":22}],20:[function(e,t,i){function M(){this.deviceId="webvr-polyfill:fused",this.deviceName="VR Position Device (webvr-polyfill:fused)",this.accelerometer=new N.Vector3,this.gyroscope=new N.Vector3,window.addEventListener("devicemotion",this.onDeviceMotionChange_.bind(this)),window.addEventListener("orientationchange",this.onScreenOrientationChange_.bind(this)),this.filter=new s(WebVRConfig.K_FILTER),this.posePredictor=new A(WebVRConfig.PREDICTION_TIME_S),this.touchPanner=new r,this.filterToWorldQ=new N.Quaternion,n.isIOS()?this.filterToWorldQ.setFromAxisAngle(new N.Vector3(1,0,0),Math.PI/2):this.filterToWorldQ.setFromAxisAngle(new N.Vector3(1,0,0),-Math.PI/2),this.inverseWorldToScreenQ=new N.Quaternion,this.worldToScreenQ=new N.Quaternion,this.originalPoseAdjustQ=new N.Quaternion,this.originalPoseAdjustQ.setFromAxisAngle(new N.Vector3(0,0,1),-window.orientation*Math.PI/180),this.setScreenTransform_(),n.isLandscapeMode()&&this.filterToWorldQ.multiply(this.inverseWorldToScreenQ),this.resetQ=new N.Quaternion,this.isFirefoxAndroid=n.isFirefoxAndroid(),this.isIOS=n.isIOS(),this.orientationOut_=new Float32Array(4)}var s=e("./complementary-filter.js"),A=e("./pose-predictor.js"),r=e("../touch-panner.js"),N=e("../math-util.js"),n=e("../util.js");M.prototype.getPosition=function(){return null},M.prototype.getOrientation=function(){var e=this.filter.getOrientation();this.predictedQ=this.posePredictor.getPrediction(e,this.gyroscope,this.previousTimestampS);var t=new N.Quaternion;return t.copy(this.filterToWorldQ),t.multiply(this.resetQ),WebVRConfig.TOUCH_PANNER_DISABLED||t.multiply(this.touchPanner.getOrientation()),t.multiply(this.predictedQ),t.multiply(this.worldToScreenQ),WebVRConfig.YAW_ONLY&&(t.x=0,t.z=0,t.normalize()),this.orientationOut_[0]=t.x,this.orientationOut_[1]=t.y,this.orientationOut_[2]=t.z,this.orientationOut_[3]=t.w,this.orientationOut_},M.prototype.resetPose=function(){this.resetQ.copy(this.filter.getOrientation()),this.resetQ.x=0,this.resetQ.y=0,this.resetQ.z*=-1,this.resetQ.normalize(),n.isLandscapeMode()&&this.resetQ.multiply(this.inverseWorldToScreenQ),this.resetQ.multiply(this.originalPoseAdjustQ),WebVRConfig.TOUCH_PANNER_DISABLED||this.touchPanner.resetSensor()},M.prototype.onDeviceMotionChange_=function(e){var t=e.accelerationIncludingGravity,i=e.rotationRate,M=e.timeStamp/1e3;this.isFirefoxAndroid&&(M/=1e3);var s=M-this.previousTimestampS;return s<=n.MIN_TIMESTEP||s>n.MAX_TIMESTEP?(console.warn("Invalid timestamps detected. Time step between successive gyroscope sensor samples is very small or not monotonic"),void(this.previousTimestampS=M)):(this.accelerometer.set(-t.x,-t.y,-t.z),this.gyroscope.set(i.alpha,i.beta,i.gamma),(this.isIOS||this.isFirefoxAndroid)&&this.gyroscope.multiplyScalar(Math.PI/180),this.filter.addAccelMeasurement(this.accelerometer,M),this.filter.addGyroMeasurement(this.gyroscope,M),void(this.previousTimestampS=M))},M.prototype.onScreenOrientationChange_=function(e){this.setScreenTransform_()},M.prototype.setScreenTransform_=function(){switch(this.worldToScreenQ.set(0,0,0,1),window.orientation){case 0:break;case 90:this.worldToScreenQ.setFromAxisAngle(new N.Vector3(0,0,1),-Math.PI/2);break;case-90:this.worldToScreenQ.setFromAxisAngle(new N.Vector3(0,0,1),Math.PI/2);break;case 180:}this.inverseWorldToScreenQ.copy(this.worldToScreenQ),this.inverseWorldToScreenQ.inverse()},t.exports=M},{"../math-util.js":16,"../touch-panner.js":23,"../util.js":24,"./complementary-filter.js":19,"./pose-predictor.js":21}],21:[function(e,t,i){function M(e){this.predictionTimeS=e,this.previousQ=new s.Quaternion,this.previousTimestampS=null,this.deltaQ=new s.Quaternion,this.outQ=new s.Quaternion}var s=e("../math-util.js"),A=!1;M.prototype.getPrediction=function(e,t,i){if(!this.previousTimestampS)return this.previousQ.copy(e),this.previousTimestampS=i,e;var M=new s.Vector3;M.copy(t),M.normalize();var r=t.length();if(r<20*s.degToRad)return A&&console.log("Moving slowly, at %s deg/s: no prediction",(s.radToDeg*r).toFixed(1)),this.outQ.copy(e),this.previousQ.copy(e),this.outQ;var N=(i-this.previousTimestampS,r*this.predictionTimeS);return this.deltaQ.setFromAxisAngle(M,N),this.outQ.copy(this.previousQ),this.outQ.multiply(this.deltaQ),this.previousQ.copy(e),this.outQ},t.exports=M},{"../math-util.js":16}],22:[function(e,t,i){function M(e,t){this.set(e,t)}M.prototype.set=function(e,t){this.sample=e,this.timestampS=t},M.prototype.copy=function(e){this.set(e.sample,e.timestampS)},t.exports=M},{}],23:[function(e,t,i){function M(){window.addEventListener("touchstart",this.onTouchStart_.bind(this)),window.addEventListener("touchmove",this.onTouchMove_.bind(this)),window.addEventListener("touchend",this.onTouchEnd_.bind(this)),this.isTouching=!1,this.rotateStart=new s.Vector2,this.rotateEnd=new s.Vector2,this.rotateDelta=new s.Vector2,this.theta=0,this.orientation=new s.Quaternion}var s=e("./math-util.js"),A=e("./util.js"),r=.5;M.prototype.getOrientation=function(){return this.orientation.setFromEulerXYZ(0,0,this.theta),this.orientation},M.prototype.resetSensor=function(){this.theta=0},M.prototype.onTouchStart_=function(e){1==e.touches.length&&(this.rotateStart.set(e.touches[0].pageX,e.touches[0].pageY),this.isTouching=!0)},M.prototype.onTouchMove_=function(e){if(this.isTouching){this.rotateEnd.set(e.touches[0].pageX,e.touches[0].pageY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart),this.rotateStart.copy(this.rotateEnd),A.isIOS()&&(this.rotateDelta.x*=-1);var t=document.body;this.theta+=2*Math.PI*this.rotateDelta.x/t.clientWidth*r}},M.prototype.onTouchEnd_=function(e){this.isTouching=!1},t.exports=M},{"./math-util.js":16,"./util.js":24}],24:[function(e,t,i){var M=e("object-assign"),s=window.Util||{};s.MIN_TIMESTEP=.001,s.MAX_TIMESTEP=1,s.base64=function(e,t){return"data:"+e+";base64,"+t},s.clamp=function(e,t,i){return Math.min(Math.max(t,e),i)},s.lerp=function(e,t,i){return e+(t-e)*i},s.isIOS=function(){var e=/iPad|iPhone|iPod/.test(navigator.platform);return function(){return e}}(),s.isSafari=function(){var e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return function(){return e}}(),s.isFirefoxAndroid=function(){var e=navigator.userAgent.indexOf("Firefox")!==-1&&navigator.userAgent.indexOf("Android")!==-1;return function(){return e}}(),s.isLandscapeMode=function(){return 90==window.orientation||window.orientation==-90},s.isTimestampDeltaValid=function(e){return!isNaN(e)&&(!(e<=s.MIN_TIMESTEP)&&!(e>s.MAX_TIMESTEP))},s.getScreenWidth=function(){return Math.max(window.screen.width,window.screen.height)*window.devicePixelRatio},s.getScreenHeight=function(){return Math.min(window.screen.width,window.screen.height)*window.devicePixelRatio},s.requestFullscreen=function(e){if(e.requestFullscreen)e.requestFullscreen();else if(e.webkitRequestFullscreen)e.webkitRequestFullscreen();else if(e.mozRequestFullScreen)e.mozRequestFullScreen();else{if(!e.msRequestFullscreen)return!1;e.msRequestFullscreen()}return!0},s.exitFullscreen=function(){if(document.exitFullscreen)document.exitFullscreen();else if(document.webkitExitFullscreen)document.webkitExitFullscreen();else if(document.mozCancelFullScreen)document.mozCancelFullScreen();else{if(!document.msExitFullscreen)return!1;document.msExitFullscreen()}return!0},s.getFullscreenElement=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},s.linkProgram=function(e,t,i,M){var s=e.createShader(e.VERTEX_SHADER);e.shaderSource(s,t),e.compileShader(s);var A=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(A,i),e.compileShader(A);var r=e.createProgram();e.attachShader(r,s),e.attachShader(r,A);for(var N in M)e.bindAttribLocation(r,M[N],N);return e.linkProgram(r),e.deleteShader(s),e.deleteShader(A),r},s.getProgramUniforms=function(e,t){for(var i={},M=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),s="",A=0;A<M;A++){var r=e.getActiveUniform(t,A);s=r.name.replace("[0]",""),i[s]=e.getUniformLocation(t,s)}return i},s.orthoMatrix=function(e,t,i,M,s,A,r){var N=1/(t-i),n=1/(M-s),D=1/(A-r);return e[0]=-2*N,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*D,e[11]=0,e[12]=(t+i)*N,e[13]=(s+M)*n,e[14]=(r+A)*D,e[15]=1,e},s.isMobile=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e},s.extend=M,s.safariCssSizeWorkaround=function(e){if(s.isIOS()){var t=e.style.width,i=e.style.height;e.style.width=parseInt(t)+1+"px",e.style.height=parseInt(i)+"px",console.log("Resetting width to...",t),setTimeout(function(){console.log("Done. Width is now",t),e.style.width=t,e.style.height=i},100)}window.Util=s,window.canvas=e},t.exports=s},{"object-assign":2}],25:[function(e,t,i){function M(){try{this.selectedKey=localStorage.getItem(N)||r}catch(e){console.error("Failed to load viewer profile: %s",e)}this.dialog=this.createDialog_(A.Viewers),this.root=null}var s=e("./emitter.js"),A=(e("./util.js"),e("./device-info.js")),r="CardboardV1",N="WEBVR_CARDBOARD_VIEWER",n="webvr-polyfill-viewer-selector";M.prototype=new s,M.prototype.show=function(e){this.root=e,e.appendChild(this.dialog);var t=this.dialog.querySelector("#"+this.selectedKey);t.checked=!0,this.dialog.style.display="block"},M.prototype.hide=function(){this.root&&this.root.contains(this.dialog)&&this.root.removeChild(this.dialog),this.dialog.style.display="none"},M.prototype.getCurrentViewer=function(){return A.Viewers[this.selectedKey]},M.prototype.getSelectedKey_=function(){var e=this.dialog.querySelector("input[name=field]:checked");return e?e.id:null},M.prototype.onSave_=function(){if(this.selectedKey=this.getSelectedKey_(),!this.selectedKey||!A.Viewers[this.selectedKey])return void console.error("ViewerSelector.onSave_: this should never happen!");this.emit("change",A.Viewers[this.selectedKey]);try{localStorage.setItem(N,this.selectedKey)}catch(e){console.error("Failed to save viewer profile: %s",e)}this.hide()},M.prototype.createDialog_=function(e){var t=document.createElement("div");t.classList.add(n),t.style.display="none";var i=document.createElement("div"),M=i.style;M.position="fixed",M.left=0,M.top=0,M.width="100%",M.height="100%",M.background="rgba(0, 0, 0, 0.3)",i.addEventListener("click",this.hide.bind(this));var s=280,A=document.createElement("div"),M=A.style;M.boxSizing="border-box",M.position="fixed",M.top="24px",M.left="50%",M.marginLeft=-s/2+"px",M.width=s+"px",M.padding="24px",M.overflow="hidden",M.background="#fafafa",M.fontFamily="'Roboto', sans-serif",M.boxShadow="0px 5px 20px #666",A.appendChild(this.createH1_("Select your viewer"));for(var r in e)A.appendChild(this.createChoice_(r,e[r].label));return A.appendChild(this.createButton_("Save",this.onSave_.bind(this))),t.appendChild(i),t.appendChild(A),t},M.prototype.createH1_=function(e){var t=document.createElement("h1"),i=t.style;return i.color="black",i.fontSize="20px",i.fontWeight="bold",i.marginTop=0,i.marginBottom="24px",t.innerHTML=e,t},M.prototype.createChoice_=function(e,t){var i=document.createElement("div");i.style.marginTop="8px",i.style.color="black";var M=document.createElement("input");M.style.fontSize="30px",M.setAttribute("id",e),M.setAttribute("type","radio"),M.setAttribute("value",e),M.setAttribute("name","field");var s=document.createElement("label");return s.style.marginLeft="4px",s.setAttribute("for",e),s.innerHTML=t,i.appendChild(M),i.appendChild(s),i},M.prototype.createButton_=function(e,t){var i=document.createElement("button");i.innerHTML=e;var M=i.style;return M.float="right",M.textTransform="uppercase",M.color="#1094f7",M.fontSize="14px",M.letterSpacing=0,M.border=0,M.background="none",M.marginTop="16px",i.addEventListener("click",t),i},t.exports=M},{"./device-info.js":9,"./emitter.js":14,"./util.js":24}],26:[function(e,t,i){function M(){var e=document.createElement("video");e.addEventListener("ended",function(){e.play()}),this.request=function(){e.paused&&(e.src=r.base64("video/mp4","AAAAGGZ0eXBpc29tAAAAAG1wNDFhdmMxAAAIA21vb3YAAABsbXZoZAAAAADSa9v60mvb+gABX5AAlw/gAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAdkdHJhawAAAFx0a2hkA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kUVLD//voAAAAAIAZ49dEN/xIAAAAAIAZ4/akN/xIEAAAAOQZokSahBbJlMCCH//uAAAAAKQZ5CRRUsP/++gQAAAAgBnmF0Q3/EgAAAAAgBnmNqQ3/EgQAAAA5BmmhJqEFsmUwIIf/+4QAAAApBnoZFFSw//76BAAAACAGepXRDf8SBAAAACAGep2pDf8SAAAAADkGarEmoQWyZTAgh//7gAAAACkGeykUVLD//voEAAAAIAZ7pdEN/xIAAAAAIAZ7rakN/xIAAAAAPQZruSahBbJlMFEw3//7B"),e.play())},this.release=function(){e.pause(),e.src=""}}function s(){var e=null;this.request=function(){e||(e=setInterval(function(){window.location=window.location,setTimeout(window.stop,0)},3e4))},this.release=function(){e&&(clearInterval(e),e=null)}}function A(){var e=navigator.userAgent||navigator.vendor||window.opera;return e.match(/iPhone/i)||e.match(/iPod/i)?s:M}var r=e("./util.js");t.exports=A()},{"./util.js":24}],27:[function(e,t,i){function M(){this.displays=[],this.devices=[],this.devicesPopulated=!1,this.nativeWebVRAvailable=this.isWebVRAvailable(),this.nativeLegacyWebVRAvailable=this.isDeprecatedWebVRAvailable(),this.nativeLegacyWebVRAvailable||(this.nativeWebVRAvailable||this.enablePolyfill(),WebVRConfig.ENABLE_DEPRECATED_API&&this.enableDeprecatedPolyfill())}e("es6-promise").polyfill();var s=e("./cardboard-vr-display.js"),A=e("./mouse-keyboard-vr-display.js"),r=e("./base.js").VRDisplay,N=e("./base.js").HMDVRDevice,n=e("./base.js").PositionSensorVRDevice,D=e("./display-wrappers.js").VRDisplayHMDDevice,u=e("./display-wrappers.js").VRDisplayPositionSensorDevice;M.prototype.isWebVRAvailable=function(){return"getVRDisplays"in navigator},M.prototype.isDeprecatedWebVRAvailable=function(){return"getVRDevices"in navigator||"mozGetVRDevices"in navigator},M.prototype.populateDevices=function(){if(!this.devicesPopulated){var e=null;this.isCardboardCompatible()&&(e=new s,this.displays.push(e),WebVRConfig.ENABLE_DEPRECATED_API&&(this.devices.push(new D(e)),this.devices.push(new u(e)))),this.isMobile()||WebVRConfig.MOUSE_KEYBOARD_CONTROLS_DISABLED||(e=new A,this.displays.push(e),WebVRConfig.ENABLE_DEPRECATED_API&&(this.devices.push(new D(e)),this.devices.push(new u(e)))),this.devicesPopulated=!0}},M.prototype.enablePolyfill=function(){navigator.getVRDisplays=this.getVRDisplays.bind(this),window.VRDisplay=r},M.prototype.enableDeprecatedPolyfill=function(){navigator.getVRDevices=this.getVRDevices.bind(this),window.HMDVRDevice=N,window.PositionSensorVRDevice=n},M.prototype.getVRDisplays=function(){this.populateDevices();var e=this.displays;return new Promise(function(t,i){try{t(e)}catch(e){i(e)}})},M.prototype.getVRDevices=function(){console.warn("getVRDevices is deprecated. Please update your code to use getVRDisplays instead.");var e=this;return new Promise(function(t,i){try{if(!e.devicesPopulated){if(e.nativeWebVRAvailable)return navigator.getVRDisplays(function(i){for(var M=0;M<i.length;++M)e.devices.push(new D(i[M])),e.devices.push(new u(i[M]));e.devicesPopulated=!0,t(e.devices)},i);if(e.nativeLegacyWebVRAvailable)return(navigator.getVRDDevices||navigator.mozGetVRDevices)(function(i){for(var M=0;M<i.length;++M)i[M]instanceof N&&e.devices.push(i[M]),i[M]instanceof n&&e.devices.push(i[M]);e.devicesPopulated=!0,t(e.devices)},i)}e.populateDevices(),t(e.devices)}catch(e){i(e)}})},M.prototype.isMobile=function(){return/Android/i.test(navigator.userAgent)||/iPhone|iPad|iPod/i.test(navigator.userAgent)},M.prototype.isCardboardCompatible=function(){return this.isMobile()||WebVRConfig.FORCE_ENABLE_VR},t.exports=M},{"./base.js":4,"./cardboard-vr-display.js":7,"./display-wrappers.js":10,"./mouse-keyboard-vr-display.js":17,"es6-promise":1}]},{},[15]);
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],20:[function(_dereq_,module,exports){
module.exports={"name":"aframe","version":"0.3.2","description":"Building blocks for the VR Web","homepage":"https://aframe.io/","main":"dist/aframe.js","scripts":{"browserify":"browserify src/index.js -s 'AFRAME' -p browserify-derequire","build":"mkdirp build/ && npm run browserify -- --debug -o build/aframe.js","codecov":"codecov","dev":"npm run build && node ./scripts/budo","dist":"npm run dist:min && npm run dist:max","dist:max":"npm run browserify -s -- --debug | exorcist dist/aframe.js.map > dist/aframe.js","dist:min":"npm run browserify -s -- --debug -p [minifyify --map aframe.min.js.map --output dist/aframe.min.js.map] -o dist/aframe.min.js","dist:release":"npm run dist:release:min && npm run dist:release:max","dist:release:max":"npm run browserify -s -- --debug | exorcist dist/aframe-v0.3.2.js.map > dist/aframe-v0.3.2.js","dist:release:min":"npm run browserify -s -- --debug -p [minifyify --map aframe-v0.3.2.min.js.map --output dist/aframe-v0.3.2.min.js.map] -o dist/aframe-v0.3.2.min.js","gh-pages":"npm run ghpages","ghpages":"node ./scripts/gh-pages","lint":"semistandard -v | snazzy","precommit":"npm run lint","preghpages":"npm run dist && rimraf gh-pages && mkdirp gh-pages && cp -r {.nojekyll,dist,lib,examples,index.html,style} gh-pages/. 2>/dev/null || : && git checkout dist/ && replace 'build/aframe.js' 'dist/aframe.min.js' gh-pages/ -r --silent","release:bump":"npm run dist && git commit -am 'bump dist' && npm version patch --preminor","release:push":"npm login && npm publish && git push --follow-tags","start":"npm run dev","test":"karma start ./tests/karma.conf.js","test:firefox":"karma start ./tests/karma.conf.js --browsers Firefox","test:chrome":"karma start ./tests/karma.conf.js --browsers Chrome","test:ci":"TEST_ENV=ci karma start ./tests/karma.conf.js --single-run --browsers Firefox","version":"npm run dist"},"repository":"aframevr/aframe","license":"MIT","dependencies":{"browserify-css":"^0.8.2","debug":"^2.2.0","deep-assign":"^2.0.0","document-register-element":"dmarcos/document-register-element#8ccc532b7","object-assign":"^4.0.1","present":"0.0.6","promise-polyfill":"^3.1.0","style-attr":"^1.0.2","three":"^0.76.1","tween.js":"^15.0.0","webvr-polyfill":"0.9.15"},"devDependencies":{"browserify":"^13.1.0","browserify-derequire":"^0.9.4","browserify-istanbul":"^2.0.0","budo":"^8.1.0","chai":"^3.5.0","chai-shallow-deep-equal":"^1.3.0","codecov":"^1.0.1","exorcist":"^0.4.0","gh-pages":"^0.6.0","husky":"^0.10.1","istanbul":"^0.4.4","karma":"^1.2.0","karma-browserify":"^5.1.0","karma-chai-shallow-deep-equal":"0.0.4","karma-chrome-launcher":"^1.0.1","karma-coverage":"^1.1.1","karma-env-preprocessor":"^0.1.1","karma-firefox-launcher":"^1.0.0","karma-mocha":"^1.1.1","karma-mocha-reporter":"^2.1.0","karma-sinon-chai":"^1.2.3","lolex":"^1.5.1","minifyify":"^7.3.3","mkdirp":"0.5.1","mocha":"^3.0.2","mozilla-download":"^1.0.5","open":"0.0.5","replace":"^0.3.0","rimraf":"2.5.0","semistandard":"^7.0.2","sinon":"^1.17.5","sinon-chai":"^2.8.0","snazzy":"^3.0.0","uglifyjs":"^2.4.10"},"link":true,"browserify":{"transform":["browserify-css"]},"semistandard":{"ignore":["build/**","dist/**","examples/**/shaders/*.js","**/vendor/**"]},"keywords":["3d","aframe","cardboard","components","oculus","three","three.js","rift","vive","vr","web-components","webvr"],"browserify-css":{"minify":true},"engines":{"node":">= 0.12.7","npm":"^2.12.1"}}
},{}],21:[function(_dereq_,module,exports){
var registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three");module.exports.Component=registerComponent("blend-character-model",{schema:{type:"src"},init:function(){this.model=null},update:function(){var e=this,o=this.el,t=this.data;t&&(this.remove(),this.model=new THREE.BlendCharacter,this.model.load(t,function(){o.setObject3D("mesh",e.model),o.emit("model-loaded",{format:"blend",model:e.model}),e.model.castShadow=!0,e.model.receiveShadow=!0,e.model.material.shading=THREE.FlatShading,e.model.geometry.computeBoundingBox()}))},remove:function(){this.model&&this.el.removeObject3D("mesh")}});
},{"../core/component":59,"../lib/three":103}],22:[function(_dereq_,module,exports){
var registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),checkHeadsetConnected=utils.checkHeadsetConnected;module.exports.Component=registerComponent("camera",{schema:{active:{default:!0},far:{default:1e4},fov:{default:80,min:0},near:{default:.005,min:0},userHeight:{default:0,min:0},zoom:{default:1,min:0}},init:function(){var e,t=this.el,i=t.sceneEl;this.savedPose=null,e=this.camera=new THREE.PerspectiveCamera,t.setObject3D("camera",e),this.onEnterVR=this.onEnterVR.bind(this),this.onExitVR=this.onExitVR.bind(this),i.addEventListener("enter-vr",this.onEnterVR),i.addEventListener("exit-vr",this.onExitVR)},update:function(e){var t=this.el,i=this.data,s=this.camera,n=this.system;this.addHeightOffset(e.userHeight),s.aspect=i.aspect||window.innerWidth/window.innerHeight,s.far=i.far,s.fov=i.fov,s.near=i.near,s.zoom=i.zoom,s.updateProjectionMatrix(),e&&e.active===i.active||(i.active&&n.activeCameraEl!==t?n.setActiveCamera(t):i.active||n.activeCameraEl!==t||n.disableActiveCamera())},remove:function(){var e=this.el.sceneEl;this.el.removeObject3D("camera"),e.removeEventListener("enter-vr",this.onEnterVR),e.removeEventListener("exit-vr",this.onExitVR)},onEnterVR:function(){this.saveCameraPose(),this.removeHeightOffset()},onExitVR:function(){this.restoreCameraPose()},addHeightOffset:function(e){var t,i=this.el,s=this.data.userHeight;e=e||0,t=i.getComputedAttribute("position")||{x:0,y:0,z:0},i.setAttribute("position",{x:t.x,y:t.y-e+s,z:t.z})},removeHeightOffset:function(){var e,t,i=this.el,s=i.sceneEl,n=this.data.userHeight;t=this.headsetConnected||checkHeadsetConnected(),!s.isMobile&&n&&t&&(e=i.getAttribute("position")||{x:0,y:0,z:0},i.setAttribute("position",{x:e.x,y:e.y-n,z:e.z}))},saveCameraPose:function(){var e=this.el,t=this.headsetConnected||checkHeadsetConnected();!this.savedPose&&t&&(this.savedPose={position:e.getAttribute("position"),rotation:e.getAttribute("rotation")})},restoreCameraPose:function(){var e=this.el,t=this.savedPose,i=this.headsetConnected||checkHeadsetConnected();t&&i&&(e.setAttribute("position",t.position),e.setAttribute("rotation",t.rotation),this.savedPose=null)}});
},{"../core/component":59,"../lib/three":103,"../utils/":120}],23:[function(_dereq_,module,exports){
var registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three");module.exports.Component=registerComponent("collada-model",{schema:{type:"src"},init:function(){this.model=null,this.loader=new THREE.ColladaLoader,this.loader.options.convertUpAxis=!0},update:function(){var e=this,o=this.el,t=this.data;t&&(this.remove(),this.loader.load(t,function(t){e.model=t.scene,o.setObject3D("mesh",e.model),o.emit("model-loaded",{format:"collada",model:e.model})}))},remove:function(){this.model&&this.el.removeObject3D("mesh")}});
},{"../core/component":59,"../lib/three":103}],24:[function(_dereq_,module,exports){
var registerComponent=_dereq_("../core/component").registerComponent,utils=_dereq_("../utils/"),EVENTS={CLICK:"click",MOUSEENTER:"mouseenter",MOUSEDOWN:"mousedown",MOUSELEAVE:"mouseleave",MOUSEUP:"mouseup"},STATES={FUSING:"cursor-fusing",HOVERING:"cursor-hovering",HOVERED:"cursor-hovered"};module.exports.Component=registerComponent("cursor",{dependencies:["raycaster"],schema:{fuse:{default:utils.isMobile()},fuseTimeout:{default:1500,min:0}},init:function(){var e=this.el,t=e.sceneEl.canvas;return this.fuseTimeout=void 0,this.mouseDownEl=null,this.intersectedEl=null,t?(t.addEventListener("mousedown",this.onMouseDown.bind(this)),t.addEventListener("mouseup",this.onMouseUp.bind(this)),e.addEventListener("raycaster-intersection",this.onIntersection.bind(this)),void e.addEventListener("raycaster-intersection-cleared",this.onIntersectionCleared.bind(this))):void e.sceneEl.addEventListener("render-target-loaded",this.init.bind(this))},onMouseDown:function(e){this.twoWayEmit(EVENTS.MOUSEDOWN),this.mouseDownEl=this.intersectedEl},onMouseUp:function(){this.twoWayEmit(EVENTS.MOUSEUP),!this.data.fuse&&this.intersectedEl&&this.mouseDownEl===this.intersectedEl&&this.twoWayEmit(EVENTS.CLICK)},onIntersection:function(e){var t=this,i=this.el,s=this.data,n=e.detail.els[0];this.intersectedEl!==n&&(this.intersectedEl=n,i.addState(STATES.HOVERING),n.addState(STATES.HOVERED),t.twoWayEmit(EVENTS.MOUSEENTER),0!==s.fuseTimeout&&s.fuse&&(i.addState(STATES.FUSING),this.fuseTimeout=setTimeout(function(){i.removeState(STATES.FUSING),t.twoWayEmit(EVENTS.CLICK)},s.fuseTimeout)))},onIntersectionCleared:function(e){var t=this.el,i=e.detail.el;i&&this.intersectedEl&&(i.removeState(STATES.HOVERED),t.removeState(STATES.HOVERING),t.removeState(STATES.FUSING),this.twoWayEmit(EVENTS.MOUSELEAVE),this.intersectedEl=null,clearTimeout(this.fuseTimeout))},twoWayEmit:function(e){var t=this.intersectedEl;this.el.emit(e,{intersectedEl:this.intersectedEl}),t&&t.emit(e,{cursorEl:this.el})}});
},{"../core/component":59,"../utils/":120}],25:[function(_dereq_,module,exports){
var debug=_dereq_("../utils/debug"),geometries=_dereq_("../core/geometry").geometries,geometryNames=_dereq_("../core/geometry").geometryNames,registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),dummyGeometry=new THREE.Geometry,warn=debug("components:geometry:warn");module.exports.Component=registerComponent("geometry",{schema:{buffer:{default:!0},mergeTo:{type:"selector"},primitive:{default:"box",oneOf:geometryNames},skipCache:{default:!1}},init:function(){this.geometry=null},update:function(e){var t=this.data,r=this.el.getOrCreateObject3D("mesh",THREE.Mesh),o=this.system;this.geometry&&(o.unuseGeometry(e),this.geometry=null),this.geometry=r.geometry=o.getOrCreateGeometry(t),t.mergeTo&&this.mergeTo(t.mergeTo)},mergeTo:function(e){var t,r=this.el,o=r.getObject3D("mesh");return e?e===r?void warn("Source and target geometries cannot be the same for merge"):(t=e.getObject3D("mesh"))?t.geometry instanceof THREE.Geometry==!1||o.geometry instanceof THREE.Geometry==!1?void warn("Geometry merge is only available for `THREE.Geometry` types. Check that both of the merging geometry and the target geometry have `buffer` set to false"):this.data.skipCache===!1?void warn("Cached geometries are not allowed to merge. Set `skipCache` to true"):(o.parent.updateMatrixWorld(),t.geometry.merge(o.geometry,o.matrixWorld),r.emit("geometry-merged",{mergeTarget:e}),void r.parentNode.removeChild(r)):(t=e.getOrCreateObject3D("mesh",THREE.Mesh),void e.setAttribute("material",r.getComputedAttribute("material"))):void warn("There is not a valid entity to merge the geometry to")},remove:function(){this.system.unuseGeometry(this.data),this.el.getObject3D("mesh").geometry=dummyGeometry,this.geometry=null},updateSchema:function(e){var t=e.primitive,r=this.data&&this.data.primitive,o=geometries[t]&&geometries[t].schema;if(!o)throw new Error("Unknown geometry schema `"+t+"`");r&&r===t||this.extendSchema(o)}});
},{"../core/component":59,"../core/geometry":60,"../lib/three":103,"../utils/debug":117}],26:[function(_dereq_,module,exports){
var registerComponent=_dereq_("../core/component").registerComponent,LEFT_HAND_MODEL_URL="https://cdn.aframe.io/controllers/hands/leftHand.json",RIGHT_HAND_MODEL_URL="https://cdn.aframe.io/controllers/hands/rightHand.json";module.exports.Component=registerComponent("hand-controls",{schema:{default:"left"},init:function(){var t=this;this.onGripDown=function(){t.handleButton("grip","down")},this.onGripUp=function(){t.handleButton("grip","up")},this.onTrackpadDown=function(){t.handleButton("trackpad","down")},this.onTrackpadUp=function(){t.handleButton("trackpad","up")},this.onTriggerDown=function(){t.handleButton("trigger","down")},this.onTriggerUp=function(){t.handleButton("trigger","up")}},play:function(){this.addEventListeners()},pause:function(){this.removeEventListeners()},addEventListeners:function(){var t=this.el;t.addEventListener("gripdown",this.onGripDown),t.addEventListener("gripup",this.onGripUp),t.addEventListener("trackpaddown",this.onTrackpadDown),t.addEventListener("trackpadup",this.onTrackpadUp),t.addEventListener("triggerdown",this.onTriggerDown),t.addEventListener("triggerup",this.onTriggerUp)},removeEventListeners:function(){var t=this.el;t.removeEventListener("gripdown",this.onGripDown),t.removeEventListener("gripup",this.onGripUp),t.removeEventListener("trackpaddown",this.onTrackpadDown),t.removeEventListener("trackpadup",this.onTrackpadUp),t.removeEventListener("triggerdown",this.onTriggerDown),t.removeEventListener("triggerup",this.onTriggerUp)},update:function(){var t,e=this.el,n=this.data;t="left"===n?"url("+LEFT_HAND_MODEL_URL+")":"url("+RIGHT_HAND_MODEL_URL+")",e.setAttribute("vive-controls",{hand:n,model:!1}),e.setAttribute("blend-character-model",t)},handleButton:function(t,e){var n=this.el,i="down"===e;switch(t){case"trackpad":if(i===this.trackpadPressed)return;this.trackpadPressed=i,this.playAnimation("thumb",!i),e=i?"thumbup":"thumbdown",n.emit(e);break;case"trigger":if(i===this.triggerPressed)return;this.triggerPressed=i,this.playAnimation("pointing",!i),e=i?"pointup":"pointdown",n.emit(e);break;case"grip":if(i===this.gripPressed)return;this.gripPressed=i,this.playAnimation("close",!i),e=i?"gripclose":"gripopen",n.emit(e)}},playAnimation:function(t,e){var n=this.animationActive,i=1,r=this.el.getObject3D("mesh");r&&(e&&(i=-1),n&&r.play(n,0),r.mixer.clipAction(t).loop=2200,r.mixer.clipAction(t).clampWhenFinished=!0,r.mixer.clipAction(t).timeScale=i,r.play(t,1),this.animationActive=t)}});
},{"../core/component":59}],27:[function(_dereq_,module,exports){
_dereq_("./blend-character-model"),_dereq_("./camera"),_dereq_("./collada-model"),_dereq_("./cursor"),_dereq_("./geometry"),_dereq_("./hand-controls"),_dereq_("./light"),_dereq_("./look-at"),_dereq_("./look-controls"),_dereq_("./material"),_dereq_("./obj-model"),_dereq_("./position"),_dereq_("./raycaster"),_dereq_("./rotation"),_dereq_("./scale"),_dereq_("./sound"),_dereq_("./tracked-controls"),_dereq_("./visible"),_dereq_("./vive-controls"),_dereq_("./wasd-controls"),_dereq_("./scene/canvas"),_dereq_("./scene/debug"),_dereq_("./scene/embedded"),_dereq_("./scene/inspector"),_dereq_("./scene/fog"),_dereq_("./scene/keyboard-shortcuts"),_dereq_("./scene/stats"),_dereq_("./scene/vr-mode-ui");
},{"./blend-character-model":21,"./camera":22,"./collada-model":23,"./cursor":24,"./geometry":25,"./hand-controls":26,"./light":28,"./look-at":29,"./look-controls":30,"./material":31,"./obj-model":32,"./position":33,"./raycaster":34,"./rotation":35,"./scale":36,"./scene/canvas":37,"./scene/debug":38,"./scene/embedded":39,"./scene/fog":40,"./scene/inspector":41,"./scene/keyboard-shortcuts":42,"./scene/stats":43,"./scene/vr-mode-ui":44,"./sound":45,"./tracked-controls":46,"./visible":47,"./vive-controls":48,"./wasd-controls":49}],28:[function(_dereq_,module,exports){
var diff=_dereq_("../utils").diff,debug=_dereq_("../utils/debug"),registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad,warn=debug("components:light:warn");module.exports.Component=registerComponent("light",{schema:{angle:{default:60,if:{type:["spot"]}},color:{type:"color"},groundColor:{type:"color",if:{type:["hemisphere"]}},decay:{default:1,if:{type:["point","spot"]}},distance:{default:0,min:0,if:{type:["point","spot"]}},intensity:{default:1,min:0,if:{type:["ambient","directional","hemisphere","point","spot"]}},penumbra:{default:0,min:0,max:1,if:{type:["spot"]}},type:{default:"directional",oneOf:["ambient","directional","hemisphere","point","spot"]},target:{type:"selector",if:{type:["spot","directional"]}}},init:function(){var t=this.el;this.light=null,this.defaultTarget=null,this.system.registerLight(t)},update:function(t){var e=this.data,i=diff(e,t),o=this.light,r=this;return!o||"type"in i?void this.setLight(this.data):void Object.keys(i).forEach(function(t){var i=e[t];switch(t){case"color":o.color.set(i);break;case"groundcolor":o.groundColor.set(i);break;case"angle":o.angle=degToRad(i);break;case"target":null===i?"spot"!==e.type&&"directional"!==e.type||(o.target=r.defaultTarget):i.hasLoaded?r.onSetTarget(i):i.addEventListener("loaded",r.onSetTarget.bind(r,i));break;default:o[t]=i}})},setLight:function(t){var e=this.el,i=this.getLight(t);i&&(this.light&&e.removeObject3D("light"),this.light=i,this.light.el=e,e.setObject3D("light",this.light),"spot"!==t.type&&"directional"!==t.type&&"hemisphere"!==t.type||e.getObject3D("light").translateY(-1),"spot"===t.type&&(e.setObject3D("light-target",this.defaultTarget),e.getObject3D("light-target").position.set(0,0,-1)))},getLight:function(t){var e=t.angle,i=new THREE.Color(t.color).getHex(),o=t.decay,r=t.distance,a=new THREE.Color(t.groundColor).getHex(),n=t.intensity,s=t.type,l=t.target,h=null;switch(s.toLowerCase()){case"ambient":return new THREE.AmbientLight(i,n);case"directional":return h=new THREE.DirectionalLight(i,n),this.defaultTarget=h.target,l&&(l.hasLoaded?this.onSetTarget(l):l.addEventListener("loaded",this.onSetTarget.bind(this,l))),h;case"hemisphere":return new THREE.HemisphereLight(i,a,n);case"point":return new THREE.PointLight(i,n,r,o);case"spot":return h=new THREE.SpotLight(i,n,r,degToRad(e),t.penumbra,o),this.defaultTarget=h.target,l&&(l.hasLoaded?this.onSetTarget(l):l.addEventListener("loaded",this.onSetTarget.bind(this,l))),h;default:warn("%s is not a valid light type. Choose from ambient, directional, hemisphere, point, spot.",s)}},onSetTarget:function(t){this.light.target=t.object3D},remove:function(){this.el.removeObject3D("light")}});
},{"../core/component":59,"../lib/three":103,"../utils":120,"../utils/debug":117}],29:[function(_dereq_,module,exports){
var debug=_dereq_("../utils/debug"),coordinates=_dereq_("../utils/coordinates"),registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),warn=debug("components:look-at:warn"),isCoordinate=coordinates.isCoordinate;module.exports.Component=registerComponent("look-at",{schema:{default:"",parse:function(e){return isCoordinate(e)||"object"==typeof e?coordinates.parse(e):e},stringify:function(e){return"object"==typeof e?coordinates.stringify(e):e}},init:function(){this.target3D=null,this.vector=new THREE.Vector3,warn("The `look-at` component is deprecated - use https://github.com/ngokevin/aframe-look-at-component instead.")},update:function(){var e,t=this,o=t.data,n=t.el.object3D;return!o||"object"==typeof o&&!Object.keys(o).length?t.remove():"object"==typeof o?n.lookAt(new THREE.Vector3(o.x,o.y,o.z)):(e=t.el.sceneEl.querySelector(o),e?e.hasLoaded?t.beginTracking(e):e.addEventListener("loaded",function(){t.beginTracking(e)}):void warn('"'+o+'" does not point to a valid entity to look-at'))},tick:function(e){var t=this.target3D;if(t)return this.el.object3D.lookAt(this.vector.setFromMatrixPosition(t.matrixWorld))},beginTracking:function(e){this.target3D=e.object3D}});
},{"../core/component":59,"../lib/three":103,"../utils/coordinates":116,"../utils/debug":117}],30:[function(_dereq_,module,exports){
function isNullVector(t){return 0===t.x&&0===t.y&&0===t.z}var registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),isMobile=_dereq_("../utils/").isMobile(),PI_2=Math.PI/2,radToDeg=THREE.Math.radToDeg;module.exports.Component=registerComponent("look-controls",{dependencies:["position","rotation"],schema:{enabled:{default:!0},hmdEnabled:{default:!0},standing:{default:!0}},init:function(){function t(){e.canvas.classList.add("a-grab-cursor")}var e=this.el.sceneEl;this.previousHMDPosition=new THREE.Vector3,this.setupMouseControls(),this.setupHMDControls(),this.bindMethods(),e.canvas?t():e.addEventListener("render-target-loaded",t)},update:function(t){var e=this.data,o=e.hmdEnabled;e.enabled&&(!o&&t&&o!==t.hmdEnabled&&(this.pitchObject.rotation.set(0,0,0),this.yawObject.rotation.set(0,0,0)),this.controls.standing=e.standing,this.controls.update(),this.updateOrientation(),this.updatePosition())},play:function(){this.addEventListeners()},pause:function(){this.removeEventListeners()},tick:function(t){this.update()},remove:function(){this.pause()},bindMethods:function(){this.onMouseDown=this.onMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.releaseMouse=this.releaseMouse.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this)},setupMouseControls:function(){this.mouseDown=!1,this.pitchObject=new THREE.Object3D,this.yawObject=new THREE.Object3D,this.yawObject.position.y=10,this.yawObject.add(this.pitchObject)},setupHMDControls:function(){this.dolly=new THREE.Object3D,this.euler=new THREE.Euler,this.controls=new THREE.VRControls(this.dolly),this.controls.userHeight=0},addEventListeners:function(){var t=this.el.sceneEl,e=t.canvas;return e?(e.addEventListener("mousedown",this.onMouseDown,!1),window.addEventListener("mousemove",this.onMouseMove,!1),window.addEventListener("mouseup",this.releaseMouse,!1),e.addEventListener("touchstart",this.onTouchStart),window.addEventListener("touchmove",this.onTouchMove),void window.addEventListener("touchend",this.onTouchEnd)):void t.addEventListener("render-target-loaded",this.addEventListeners.bind(this))},removeEventListeners:function(){var t=this.el.sceneEl,e=t&&t.canvas;e&&(e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mousemove",this.onMouseMove),e.removeEventListener("mouseup",this.releaseMouse),e.removeEventListener("mouseout",this.releaseMouse),e.removeEventListener("touchstart",this.onTouchStart),e.removeEventListener("touchmove",this.onTouchMove),e.removeEventListener("touchend",this.onTouchEnd))},updateOrientation:function(){var t=new THREE.Euler;return function(){var e,o,n,i=this.pitchObject,s=this.yawObject,r=this.calculateHMDQuaternion(),a=this.el.sceneEl;t.setFromQuaternion(r,"YXZ"),isMobile?n={x:radToDeg(t.x)+radToDeg(i.rotation.x),y:radToDeg(t.y)+radToDeg(s.rotation.y),z:radToDeg(t.z)}:a.is("vr-mode")&&!isNullVector(t)&&this.data.hmdEnabled?n={x:radToDeg(t.x),y:radToDeg(t.y),z:radToDeg(t.z)}:(e=this.el.getComputedAttribute("rotation"),o=this.calculateDeltaRotation(),n={x:e.x+o.x,y:e.y+o.y,z:e.z}),this.el.setAttribute("rotation",n)}}(),calculateDeltaRotation:function(){var t,e;return function(){var o,n=radToDeg(this.pitchObject.rotation.x),i=radToDeg(this.yawObject.rotation.y);return t=t||n,e=e||i,o={x:n-t,y:i-e},t=n,e=i,o}}(),calculateHMDQuaternion:function(){var t=new THREE.Quaternion;return function(){return t.copy(this.dolly.quaternion),t}}(),updatePosition:function(){var t=new THREE.Vector3;return function(){var e,o=this.el,n=o.getComputedAttribute("position"),i=this.previousHMDPosition,s=this.el.sceneEl;e=this.calculateHMDPosition(),t.copy(e).sub(i),s.is("vr-mode")&&!isNullVector(t)&&(i.copy(e),s.is("vr-mode")&&o.setAttribute("position",{x:n.x+t.x,y:n.y+t.y,z:n.z+t.z}))}}(),calculateHMDPosition:function(){var t=this.dolly,e=new THREE.Vector3;return t.updateMatrix(),e.setFromMatrixPosition(t.matrix),e},onMouseMove:function(t){var e=this.pitchObject,o=this.yawObject,n=this.previousMouseEvent;if(this.mouseDown&&this.data.enabled){var i=t.movementX||t.mozMovementX,s=t.movementY||t.mozMovementY;void 0!==i&&void 0!==s||(i=t.screenX-n.screenX,s=t.screenY-n.screenY),this.previousMouseEvent=t,o.rotation.y-=.002*i,e.rotation.x-=.002*s,e.rotation.x=Math.max(-PI_2,Math.min(PI_2,e.rotation.x))}},onMouseDown:function(t){this.mouseDown=!0,this.previousMouseEvent=t,document.body.classList.add("a-grabbing")},releaseMouse:function(){this.mouseDown=!1,document.body.classList.remove("a-grabbing")},onTouchStart:function(t){1===t.touches.length&&(this.touchStart={x:t.touches[0].pageX,y:t.touches[0].pageY},this.touchStarted=!0)},onTouchMove:function(t){var e,o=this.yawObject;this.touchStarted&&(e=2*Math.PI*(t.touches[0].pageX-this.touchStart.x)/this.el.sceneEl.canvas.clientWidth,o.rotation.y-=.5*e,this.touchStart={x:t.touches[0].pageX,y:t.touches[0].pageY})},onTouchEnd:function(){this.touchStarted=!1}});
},{"../core/component":59,"../lib/three":103,"../utils/":120}],31:[function(_dereq_,module,exports){
function parseSide(e){switch(e){case"back":return THREE.BackSide;case"double":return THREE.DoubleSide;default:return THREE.FrontSide}}function disposeMaterial(e,a){e.dispose(),a.unregisterMaterial(e)}var utils=_dereq_("../utils/"),component=_dereq_("../core/component"),THREE=_dereq_("../lib/three"),shader=_dereq_("../core/shader"),error=utils.debug("components:material:error"),registerComponent=component.registerComponent,shaders=shader.shaders,shaderNames=shader.shaderNames;module.exports.Component=registerComponent("material",{schema:{depthTest:{default:!0},flatShading:{default:!1},opacity:{default:1,min:0,max:1},shader:{default:"standard",oneOf:shaderNames},side:{default:"front",oneOf:["front","back","double"]},transparent:{default:!1},visible:{default:!0}},init:function(){this.material=null},update:function(e){var a=this.data;this.shader&&a.shader===e.shader||this.updateShader(a.shader),this.shader.update(this.data),this.updateMaterial()},updateSchema:function(e){var a=e.shader,t=this.data&&this.data.shader,r=a||t,s=shaders[r]&&shaders[r].schema;s||error("Unknown shader schema "+r),t&&a===t||(this.extendSchema(s),this.updateBehavior())},updateBehavior:function(){var e=this.el.sceneEl,a=this.schema,t=this,r={},s=function(e,a){function s(a){r[a]=e}var i=Object.keys(r);i.forEach(s),t.shader.update(r)},i=Object.keys(a);i.forEach(function(i){"time"===a[i].type&&(t.tick=s,r[i]=!0,e.addBehavior(t))}),0===Object.keys(r).length&&e.removeBehavior(this)},updateShader:function(e){var a,t=this.data,r=shaders[e]&&shaders[e].Shader;if(!r)throw new Error("Unknown shader "+e);a=this.shader=new r,a.el=this.el,a.init(t),this.setMaterial(a.material),this.updateSchema(t)},updateMaterial:function(){var e=this.data,a=this.material;a.side=parseSide(e.side),a.opacity=e.opacity,a.transparent=e.transparent!==!1||e.opacity<1,a.depthTest=e.depthTest!==!1,a.shading=e.flatShading?THREE.FlatShading:THREE.SmoothShading,a.visible=e.visible},remove:function(){var e=new THREE.MeshBasicMaterial,a=this.material,t=this.el.getObject3D("mesh");t&&(t.material=e),disposeMaterial(a,this.system)},setMaterial:function(e){var a=this.el.getOrCreateObject3D("mesh",THREE.Mesh),t=this.system;this.material&&disposeMaterial(this.material,t),this.material=a.material=e,t.registerMaterial(e)}});
},{"../core/component":59,"../core/shader":67,"../lib/three":103,"../utils/":120}],32:[function(_dereq_,module,exports){
var debug=_dereq_("../utils/debug"),registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),warn=debug("components:obj-model:warn");module.exports.Component=registerComponent("obj-model",{dependencies:["material"],schema:{mtl:{type:"src"},obj:{type:"src"}},init:function(){this.model=null,this.objLoader=new THREE.OBJLoader,this.mtlLoader=new THREE.MTLLoader(this.objLoader.manager),this.mtlLoader.crossOrigin=""},update:function(){var e=this.data;e.obj&&(this.remove(),this.loadObj(e.obj,e.mtl))},remove:function(){this.model&&this.el.removeObject3D("mesh")},loadObj:function(e,o){var t=this,r=this.el,a=this.mtlLoader,i=this.objLoader;return o?(r.hasAttribute("material")&&warn("Material component properties are ignored when a .MTL is provided"),a.setBaseUrl(o.substr(0,o.lastIndexOf("/")+1)),void a.load(o,function(o){o.preload(),i.setMaterials(o),i.load(e,function(e){t.model=e,r.setObject3D("mesh",e),r.emit("model-loaded",{format:"obj",model:e})})})):void i.load(e,function(e){var o=r.components.material;o&&e.traverse(function(e){e instanceof THREE.Mesh&&(e.material=o.material)}),t.model=e,r.setObject3D("mesh",e),r.emit("model-loaded",{format:"obj",model:e})})}});
},{"../core/component":59,"../lib/three":103,"../utils/debug":117}],33:[function(_dereq_,module,exports){
var registerComponent=_dereq_("../core/component").registerComponent;module.exports.Component=registerComponent("position",{schema:{type:"vec3"},update:function(){var e=this.el.object3D,o=this.data;e.position.set(o.x,o.y,o.z)}});
},{"../core/component":59}],34:[function(_dereq_,module,exports){
var registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),scaleDummy=new THREE.Vector3;module.exports.Component=registerComponent("raycaster",{schema:{far:{default:1/0},interval:{default:100},near:{default:0},objects:{default:""},recursive:{default:!0}},init:function(){this.direction=new THREE.Vector3,this.intersectedEls=[],this.objects=null,this.prevCheckTime=void 0,this.raycaster=new THREE.Raycaster,this.updateOriginDirection()},update:function(){var e=this.data,t=this.raycaster;t.far=e.far,t.near=e.near,this.refreshObjects()},refreshObjects:function(){var e,t,i=this.data;if(i.objects)for(t=this.el.sceneEl.querySelectorAll(i.objects),this.objects=[],e=0;e<t.length;e++)this.objects.push(t[e].object3D);else this.objects=this.el.sceneEl.object3D.children},tick:function(e){var t,i,r,s=this.el,n=this.data,c=this.prevCheckTime;c&&e-c<n.interval||(r=this.intersectedEls.slice(),this.updateOriginDirection(),i=this.raycaster.intersectObjects(this.objects,n.recursive),i=i.filter(function(e){return!!e.object.el}),t=this.intersectedEls=i.map(function(e){return e.object.el}),i.forEach(function(e){var t=e.object.el;t.emit("raycaster-intersected",{el:s,intersection:e})}),i.length&&s.emit("raycaster-intersection",{els:t,intersections:i}),r.forEach(function(e){t.indexOf(e)===-1&&(s.emit("raycaster-intersection-cleared",{el:e}),e.emit("raycaster-intersected-cleared",{el:s}))}))},updateOriginDirection:function(){var e=new THREE.Quaternion,t=new THREE.Vector3;return function(){var i=this.el,r=i.object3D;r.updateMatrixWorld(),r.matrixWorld.decompose(t,e,scaleDummy),this.direction.set(0,0,-1),this.direction.applyQuaternion(e),this.raycaster.set(t,this.direction)}}()});
},{"../core/component":59,"../lib/three":103}],35:[function(_dereq_,module,exports){
var degToRad=_dereq_("../lib/three").Math.degToRad,registerComponent=_dereq_("../core/component").registerComponent;module.exports.Component=registerComponent("rotation",{schema:{type:"vec3"},update:function(){var e=this.data,o=this.el.object3D;o.rotation.set(degToRad(e.x),degToRad(e.y),degToRad(e.z)),o.rotation.order="YXZ"}});
},{"../core/component":59,"../lib/three":103}],36:[function(_dereq_,module,exports){
var registerComponent=_dereq_("../core/component").registerComponent,zeroScale=1e-5;module.exports.Component=registerComponent("scale",{schema:{type:"vec3",default:{x:1,y:1,z:1}},update:function(){var e=this.data,o=this.el.object3D,t=0===e.x?zeroScale:e.x,r=0===e.y?zeroScale:e.y,a=0===e.z?zeroScale:e.z;o.scale.set(t,r,a)}});
},{"../core/component":59}],37:[function(_dereq_,module,exports){
var register=_dereq_("../../core/component").registerComponent;module.exports.Component=register("canvas",{init:function(){function e(e){a.classList.add("fullscreen")}function n(e){a.classList.remove("fullscreen")}function t(){var e=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement;e||r.exitVR(),document.activeElement.blur(),document.body.focus(),setTimeout(r.resize.bind(r),0)}var r=this.el,a=document.createElement("canvas");a.classList.add("a-canvas"),a.dataset.aframeCanvas=!0,r.appendChild(a),document.addEventListener("fullscreenchange",t),document.addEventListener("mozfullscreenchange",t),document.addEventListener("webkitfullscreenchange",t),a.addEventListener("touchmove",function(e){e.preventDefault()}),r.addEventListener("enter-vr",e),r.addEventListener("exit-vr",n),r.canvas=a,r.emit("render-target-loaded",{target:a})}});
},{"../../core/component":59}],38:[function(_dereq_,module,exports){
var register=_dereq_("../../core/component").registerComponent;module.exports.Component=register("debug",{schema:{default:!0}});
},{"../../core/component":59}],39:[function(_dereq_,module,exports){
var registerComponent=_dereq_("../../core/component").registerComponent;module.exports.Component=registerComponent("embedded",{dependencies:["vr-mode-ui"],schema:{default:!0},update:function(){var e=this.el,r=e.querySelector(".a-enter-vr");this.data===!0?(r.classList.add("embedded"),e.removeFullScreenStyles()):(r.classList.remove("embedded"),e.addFullScreenStyles())}});
},{"../../core/component":59}],40:[function(_dereq_,module,exports){
function getFog(e){var o;return o="exponential"===e.type?new THREE.FogExp2(e.color,e.density):new THREE.Fog(e.color,e.near,e.far),o.name=e.type,o}var register=_dereq_("../../core/component").registerComponent,THREE=_dereq_("../../lib/three"),debug=_dereq_("../../utils/debug"),warn=debug("components:fog:warn");module.exports.Component=register("fog",{schema:{color:{default:"#000"},density:{default:25e-5},far:{default:1e3,min:0},near:{default:1,min:0},type:{default:"linear",oneOf:["linear","exponential"]}},update:function(){var e=this.data,o=this.el,t=this.el.object3D.fog;return o.isScene?t&&e.type===t.name?void Object.keys(this.schema).forEach(function(o){var n=e[o];"color"===o&&(n=new THREE.Color(n)),t[o]=n}):(o.object3D.fog=getFog(e),void o.systems.material.updateMaterials()):void warn("Fog component can only be applied to <a-scene>")},remove:function(){var e=this.el.object3D.fog;e&&(e.density=0,e.far=0,e.near=0)}});
},{"../../core/component":59,"../../lib/three":103,"../../utils/debug":117}],41:[function(_dereq_,module,exports){
var registerComponent=_dereq_("../../core/component").registerComponent,pkg=_dereq_("../../../package"),INSPECTOR_URL=pkg.homepage+"releases/"+pkg.version+"/aframe-inspector.min.js";module.exports.Component=registerComponent("inspector",{schema:{url:{default:INSPECTOR_URL}},init:function(){this.onKeydown=this.onKeydown.bind(this),window.addEventListener("keydown",this.onKeydown)},onKeydown:function(e){var n=73===e.keyCode&&e.ctrlKey&&e.altKey;this.data&&n&&this.injectInspector()},injectInspector:function(){var e,n=this;AFRAME.INSPECTOR||AFRAME.inspectorInjected||(e=document.createElement("script"),e.src=this.data.url,e.onload=function(){AFRAME.INSPECTOR.open(),window.removeEventListener("keydown",n.onKeydown)},document.head.appendChild(e),AFRAME.inspectorInjected=!0)},remove:function(){window.removeEventListener("keydown",this.onKeydown)}});
},{"../../../package":20,"../../core/component":59}],42:[function(_dereq_,module,exports){
var registerComponent=_dereq_("../../core/component").registerComponent,shouldCaptureKeyEvent=_dereq_("../../utils/").shouldCaptureKeyEvent,THREE=_dereq_("../../lib/three"),controls=new THREE.VRControls(new THREE.Object3D);module.exports.Component=registerComponent("keyboard-shortcuts",{schema:{enterVR:{default:!0},exitVR:{default:!0},resetSensor:{default:!0}},init:function(){var e=this,t=this.el;this.listener=window.addEventListener("keyup",function(n){shouldCaptureKeyEvent(n)&&(e.enterVREnabled&&70===n.keyCode&&t.enterVR(),e.enterVREnabled&&27===n.keyCode&&t.exitVR(),e.resetSensorEnabled&&90===n.keyCode&&controls.resetSensor())},!1)},update:function(e){var t=this.data;this.enterVREnabled=t.enterVR,this.resetSensorEnabled=t.resetSensor},remove:function(){window.removeEventListener("keyup",this.listener)}});
},{"../../core/component":59,"../../lib/three":103,"../../utils/":120}],43:[function(_dereq_,module,exports){
function createStats(t){var e=new ThreeStats(t.renderer),s=new AFrameStats(t),r=t.isMobile?[]:[e,s];return new RStats({css:[],values:{fps:{caption:"fps",below:30}},groups:[{caption:"Framerate",values:["fps","raf"]}],plugins:r})}var registerComponent=_dereq_("../../core/component").registerComponent,RStats=_dereq_("../../../vendor/rStats");_dereq_("../../../vendor/rStats.extras"),_dereq_("../../lib/rStatsAframe");var HIDDEN_CLASS="a-hidden",ThreeStats=window.threeStats,AFrameStats=window.aframeStats;module.exports.Component=registerComponent("stats",{schema:{default:!0},init:function(){var t=this.el;this.stats=createStats(t),this.statsEl=document.querySelector(".rs-base"),this.hideBound=this.hide.bind(this),this.showBound=this.show.bind(this),t.addEventListener("enter-vr",this.hideBound),t.addEventListener("exit-vr",this.showBound)},update:function(){return this.data?this.show():this.hide()},remove:function(){this.el.removeEventListener("enter-vr",this.hideBound),this.el.removeEventListener("exit-vr",this.showBound),this.statsEl.parentNode.removeChild(this.statsEl)},tick:function(){var t=this.stats;t("rAF").tick(),t("FPS").frame(),t().update()},hide:function(){this.statsEl.classList.add(HIDDEN_CLASS)},show:function(){this.statsEl.classList.remove(HIDDEN_CLASS)}});
},{"../../../vendor/rStats":127,"../../../vendor/rStats.extras":126,"../../core/component":59,"../../lib/rStatsAframe":102}],44:[function(_dereq_,module,exports){
function createEnterVRButton(e){var t,n;return n=document.createElement("div"),n.classList.add(ENTER_VR_CLASS),n.setAttribute(constants.AFRAME_INJECTED,""),t=document.createElement("button"),t.className=ENTER_VR_BTN_CLASS,t.setAttribute(constants.AFRAME_INJECTED,""),n.appendChild(t),t.addEventListener("click",e),n}function createOrientationModal(e){var t=document.createElement("div");t.className=ORIENTATION_MODAL_CLASS,t.classList.add(HIDDEN_CLASS),t.setAttribute(constants.AFRAME_INJECTED,"");var n=document.createElement("button");return n.setAttribute(constants.AFRAME_INJECTED,""),n.innerHTML="Exit VR",n.addEventListener("click",e),t.appendChild(n),t}var registerComponent=_dereq_("../../core/component").registerComponent,constants=_dereq_("../../constants/"),utils=_dereq_("../../utils/"),ENTER_VR_CLASS="a-enter-vr",ENTER_VR_BTN_CLASS="a-enter-vr-button",HIDDEN_CLASS="a-hidden",ORIENTATION_MODAL_CLASS="a-orientation-modal";module.exports.Component=registerComponent("vr-mode-ui",{dependencies:["canvas"],schema:{enabled:{default:!0}},init:function(){var e=this,t=this.el;"false"!==utils.getUrlParameter("ui")&&(this.enterVR=t.enterVR.bind(t),this.exitVR=t.exitVR.bind(t),this.insideLoader=!1,this.enterVREl=null,this.orientationModalEl=null,t.addEventListener("enter-vr",this.updateEnterVRInterface.bind(this)),t.addEventListener("exit-vr",this.updateEnterVRInterface.bind(this)),window.addEventListener("message",function(t){"loaderReady"===t.data.type&&(e.insideLoader=!0,e.remove())}),window.addEventListener("orientationchange",this.toggleOrientationModalIfNeeded.bind(this)))},update:function(){var e=this.el;return!this.data.enabled||this.insideLoader||"false"===utils.getUrlParameter("ui")?this.remove():void(this.enterVREl||this.orientationModalEl||(this.enterVREl=createEnterVRButton(this.enterVR),e.appendChild(this.enterVREl),this.orientationModalEl=createOrientationModal(this.exitVR),e.appendChild(this.orientationModalEl),this.updateEnterVRInterface()))},remove:function(){[this.enterVREl,this.orientationModalEl].forEach(function(e){e&&e.parentNode.removeChild(e)})},updateEnterVRInterface:function(){this.toggleEnterVRButtonIfNeeded(),this.toggleOrientationModalIfNeeded()},toggleEnterVRButtonIfNeeded:function(){var e=this.el;this.enterVREl&&(e.is("vr-mode")?this.enterVREl.classList.add(HIDDEN_CLASS):this.enterVREl.classList.remove(HIDDEN_CLASS))},toggleOrientationModalIfNeeded:function(){var e=this.el,t=this.orientationModalEl;t&&e.isMobile&&(!utils.isLandscape()&&e.is("vr-mode")?t.classList.remove(HIDDEN_CLASS):t.classList.add(HIDDEN_CLASS))}});
},{"../../constants/":51,"../../core/component":59,"../../utils/":120}],45:[function(_dereq_,module,exports){
var debug=_dereq_("../utils/debug"),registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three"),warn=debug("components:sound:warn");module.exports.Component=registerComponent("sound",{schema:{src:{type:"src"},on:{default:""},autoplay:{default:!1},loop:{default:!1},volume:{default:1}},multiple:!0,init:function(){this.listener=null,this.audioLoader=new THREE.AudioLoader,this.sound=null,this.playSound=this.playSound.bind(this)},update:function(e){var t=this.data,n=this.sound,o=t.src!==e.src;if(o){if(!t.src)return void warn("Audio source was not specified with `src`");n=this.setupSound()}n.autoplay=t.autoplay,n.setLoop(t.loop),n.setVolume(t.volume),t.on!==e.on&&this.updateEventListener(e.on),o&&this.audioLoader.load(t.src,function(e){n.setBuffer(e),THREE.Cache.remove(t.src)})},updateEventListener:function(e){var t=this.el;e&&t.removeEventListener(e,this.playSound),t.addEventListener(this.data.on,this.playSound)},removeEventListener:function(){this.el.removeEventListener(this.data.on,this.playSound)},remove:function(){this.removeEventListener(),this.el.removeObject3D(this.attrName);try{this.sound.disconnect()}catch(e){warn("Audio source not properly disconnected")}},play:function(){this.sound&&(this.sound.source.buffer&&this.data.autoplay&&this.sound.play(),this.updateEventListener())},pause:function(){this.sound&&(this.sound.source.buffer&&this.sound.isPlaying&&this.sound.pause(),this.removeEventListener())},setupSound:function(){var e=this.el,t=e.sceneEl,n=this.sound;n&&(this.stopSound(),e.removeObject3D("sound"));var o=this.listener=t.audioListener||new THREE.AudioListener;return t.audioListener=o,t.camera&&t.camera.add(o),t.addEventListener("camera-set-active",function(e){e.detail.cameraEl.getObject3D("camera").add(o)}),n=this.sound=new THREE.PositionalAudio(o),e.setObject3D(this.attrName,n),n.source.onended=function(){n.onEnded(),e.emit("sound-ended")},n},playSound:function(){this.sound.source.buffer&&this.sound.play()},stopSound:function(){this.sound.source.buffer&&this.sound.stop()}});
},{"../core/component":59,"../lib/three":103,"../utils/debug":117}],46:[function(_dereq_,module,exports){
var registerComponent=_dereq_("../core/component").registerComponent,THREE=_dereq_("../lib/three");module.exports.Component=registerComponent("tracked-controls",{schema:{controller:{default:0},id:{default:"OpenVR Gamepad"}},init:function(){this.buttonStates={},this.axisState=[]},update:function(){function t(t){return t.id===r.id}var e=this.system.controllers,r=this.data;e=e.filter(t),this.controller=e[r.controller]},tick:function(t,e){var r=this.el.getObject3D("mesh");r&&(r.update&&r.update(e/1e3),this.updatePose(),this.updateButtons())},updatePose:function(){var t=new THREE.Euler,e=new THREE.Vector3,r=new THREE.Quaternion,o=new THREE.Object3D,n=new THREE.Matrix4;return t.order="YXZ",function(){var i,a,s,u,h=this.el,d=this.system.vrDisplay;this.update(),i=this.controller,i&&(a=i.pose,s=a.orientation||[0,0,0,1],u=a.position||[0,0,0],r.fromArray(s),o.quaternion.fromArray(s),o.position.fromArray(u),o.updateMatrix(),d&&d.stageParameters&&(n.fromArray(d.stageParameters.sittingToStandingTransform),o.applyMatrix(n)),t.setFromRotationMatrix(o.matrix),e.setFromMatrixPosition(o.matrix),h.setAttribute("rotation",{x:THREE.Math.radToDeg(t.x),y:THREE.Math.radToDeg(t.y),z:THREE.Math.radToDeg(t.z)}),h.setAttribute("position",{x:e.x,y:e.y,z:e.z}))}}(),updateButtons:function(){var t,e,r=this.controller;if(this.controller){for(t=0;t<r.buttons.length;++t)e=r.buttons[t],this.handleButton(t,e);this.handleAxes(r.axes)}},handleAxes:function(t){var e,r=this.axisState,o=!1;for(e=0;e<t.length;++e)if(r[e]!==t[e]){o=!0;break}o&&(r=t.slice(),this.el.emit("axismove",{axis:r}))},handleButton:function(t,e){var r=!1;r=r||this.handlePress(t,e),r=r||this.handleTouch(t,e),r=r||this.handleValue(t,e),r&&this.el.emit("buttonchanged",{id:t,state:e})},handlePress:function(t,e){var r,o=this.buttonStates,n=o[t]=o[t]||{};e.pressed!==n.pressed&&(r=e.pressed?"down":"up",this.el.emit("button"+r,{id:t}),n.pressed=e.pressed)},handleTouch:function(t,e){var r,o=this.buttonStates,n=o[t]=o[t]||{};return e.touched!==n.touched&&(r=e.touched?"start":"end",n.touched=e.touched,this.el.emit("touch"+r,{id:t,state:n}),!0)},handleValue:function(t,e){var r=this.buttonStates,o=r[t]=r[t]||{};return e.value!==o.value&&(o.value=e.value,!0)}});
},{"../core/component":59,"../lib/three":103}],47:[function(_dereq_,module,exports){
var registerComponent=_dereq_("../core/component").registerComponent;module.exports.Component=registerComponent("visible",{schema:{default:!0},update:function(){this.el.object3D.visible=this.data}});
},{"../core/component":59}],48:[function(_dereq_,module,exports){
var registerComponent=_dereq_("../core/component").registerComponent,VIVE_CONTROLLER_MODEL_OBJ_URL="https://cdn.aframe.io/controllers/vive/vr_controller_vive.obj",VIVE_CONTROLLER_MODEL_OBJ_MTL="https://cdn.aframe.io/controllers/vive/vr_controller_vive.mtl";module.exports.Component=registerComponent("vive-controls",{dependencies:["tracked-controls"],schema:{hand:{default:"left"},buttonColor:{default:"#FAFAFA"},buttonHighlightColor:{default:"#22D1EE"},model:{default:!0}},mapping:{axis0:"trackpad",axis1:"trackpad",button0:"trackpad",button1:"trigger",button2:"grip",button3:"menu",button4:"system"},init:function(){var t=this;this.animationActive="pointing",this.onButtonChanged=this.onButtonChanged.bind(this),this.onButtonDown=function(e){t.onButtonEvent(e.detail.id,"down")},this.onButtonUp=function(e){t.onButtonEvent(e.detail.id,"up")},this.onModelLoaded=this.onModelLoaded.bind(this)},play:function(){var t=this.el;t.addEventListener("buttonchanged",this.onButtonChanged),t.addEventListener("buttondown",this.onButtonDown),t.addEventListener("buttonup",this.onButtonUp),t.addEventListener("model-loaded",this.onModelLoaded)},pause:function(){var t=this.el;t.removeEventListener("buttonchanged",this.onButtonChanged),t.removeEventListener("buttondown",this.onButtonDown),t.removeEventListener("buttonup",this.onButtonUp),t.removeEventListener("model-loaded",this.onModelLoaded)},update:function(){var t=this.el,e=this.data,o="url("+VIVE_CONTROLLER_MODEL_OBJ_URL+")",n="url("+VIVE_CONTROLLER_MODEL_OBJ_MTL+")",i="right"===e.hand?0:1;t.setAttribute("tracked-controls","controller",i),e.model&&t.setAttribute("obj-model",{obj:o,mtl:n})},onButtonChanged:function(t){var e,o=this.mapping["button"+t.detail.id],n=this.buttonMeshes;"trigger"===o&&n&&(e=t.detail.state.value,n.trigger.rotation.x=-e*(Math.PI/12))},onModelLoaded:function(t){var e,o=t.detail.model;this.data.model&&(e=this.buttonMeshes={},e.grip={left:o.getObjectByName("leftgrip"),right:o.getObjectByName("rightgrip")},e.menu=o.getObjectByName("menubutton"),e.system=o.getObjectByName("systembutton"),e.trackpad=o.getObjectByName("touchpad"),e.trigger=o.getObjectByName("trigger"),o.position.set(0,-.015,.04))},onButtonEvent:function(t,e){var o=this.mapping["button"+t];this.el.emit(o+e),this.data.model&&this.updateModel(o,e)},updateModel:function(t,e){var o="up"===e?this.data.buttonColor:this.data.buttonHighlightColor,n=this.buttonMeshes;if(n)return"grip"===t?(n.grip.left.material.color.set(o),void n.grip.right.material.color.set(o)):void n[t].material.color.set(o)}});
},{"../core/component":59}],49:[function(_dereq_,module,exports){
var registerComponent=_dereq_("../core/component").registerComponent,shouldCaptureKeyEvent=_dereq_("../utils/").shouldCaptureKeyEvent,THREE=_dereq_("../lib/three"),MAX_DELTA=.2;module.exports.Component=registerComponent("wasd-controls",{schema:{easing:{default:20},acceleration:{default:65},enabled:{default:!0},fly:{default:!1},wsAxis:{default:"z",oneOf:["x","y","z"]},adAxis:{default:"x",oneOf:["x","y","z"]},wsInverted:{default:!1},wsEnabled:{default:!0},adInverted:{default:!1},adEnabled:{default:!0}},init:function(){this.velocity=new THREE.Vector3,this.keys={},this.onBlur=this.onBlur.bind(this),this.onFocus=this.onFocus.bind(this),this.onVisibilityChange=this.onVisibilityChange.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.attachVisibilityEventListeners()},update:function(e){var t,i=this.data,n=i.acceleration,s=i.easing,o=this.velocity,r=this.prevTime=this.prevTime||Date.now(),a=window.performance.now(),u=(a-r)/1e3,d=this.keys,h=i.adAxis,l=i.wsAxis,y=i.adInverted?-1:1,c=i.wsInverted?-1:1,v=this.el;if(this.prevTime=a,e||u>MAX_DELTA)return o[h]=0,void(o[l]=0);o[h]-=o[h]*s*u,o[l]-=o[l]*s*u;var E=v.getComputedAttribute("position");i.enabled&&(i.adEnabled&&(d[65]&&(o[h]-=y*n*u),d[68]&&(o[h]+=y*n*u)),i.wsEnabled&&(d[87]&&(o[l]-=c*n*u),d[83]&&(o[l]+=c*n*u))),t=this.getMovementVector(u),v.object3D.translateX(t.x),v.object3D.translateY(t.y),v.object3D.translateZ(t.z),v.setAttribute("position",{x:E.x+t.x,y:E.y+t.y,z:E.z+t.z})},play:function(){this.attachKeyEventListeners()},pause:function(){this.keys={},this.removeKeyEventListeners()},tick:function(e){this.update()},remove:function(){this.pause(),this.removeVisibilityEventListeners()},attachVisibilityEventListeners:function(){window.addEventListener("blur",this.onBlur),window.addEventListener("focus",this.onFocus),document.addEventListener("visibilitychange",this.onVisibilityChange)},removeVisibilityEventListeners:function(){window.removeEventListener("blur",this.onBlur),window.removeEventListener("focus",this.onFocus),document.removeEventListener("visibilitychange",this.onVisibilityChange)},attachKeyEventListeners:function(){window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp)},removeKeyEventListeners:function(){window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp)},onBlur:function(){this.pause()},onFocus:function(){this.play()},onVisibilityChange:function(){document.hidden?this.onBlur():this.onFocus()},onKeyDown:function(e){shouldCaptureKeyEvent(e)&&(this.keys[e.keyCode]=!0)},onKeyUp:function(e){shouldCaptureKeyEvent(e)&&(this.keys[e.keyCode]=!1)},getMovementVector:function(e){var t=new THREE.Vector3(0,0,0),i=new THREE.Euler(0,0,0,"YXZ");return function(e){var n=this.velocity,s=this.el.getComputedAttribute("rotation");return t.copy(n),t.multiplyScalar(e),s?(this.data.fly||(s.x=0),i.set(THREE.Math.degToRad(s.x),THREE.Math.degToRad(s.y),0),t.applyEuler(i),t):t}}()});
},{"../core/component":59,"../lib/three":103,"../utils/":120}],50:[function(_dereq_,module,exports){
var TWEEN=_dereq_("tween.js"),DIRECTIONS={alternate:"alternate",alternateReverse:"alternate-reverse",normal:"normal",reverse:"reverse"},EASING_FUNCTIONS={linear:TWEEN.Easing.Linear.None,ease:TWEEN.Easing.Cubic.InOut,"ease-in":TWEEN.Easing.Cubic.In,"ease-out":TWEEN.Easing.Cubic.Out,"ease-in-out":TWEEN.Easing.Cubic.InOut,"ease-cubic":TWEEN.Easing.Cubic.In,"ease-in-cubic":TWEEN.Easing.Cubic.In,"ease-out-cubic":TWEEN.Easing.Cubic.Out,"ease-in-out-cubic":TWEEN.Easing.Cubic.InOut,"ease-quad":TWEEN.Easing.Quadratic.InOut,"ease-in-quad":TWEEN.Easing.Quadratic.In,"ease-out-quad":TWEEN.Easing.Quadratic.Out,"ease-in-out-quad":TWEEN.Easing.Quadratic.InOut,"ease-quart":TWEEN.Easing.Quartic.InOut,"ease-in-quart":TWEEN.Easing.Quartic.In,"ease-out-quart":TWEEN.Easing.Quartic.Out,"ease-in-out-quart":TWEEN.Easing.Quartic.InOut,"ease-quint":TWEEN.Easing.Quintic.InOut,"ease-in-quint":TWEEN.Easing.Quintic.In,"ease-out-quint":TWEEN.Easing.Quintic.Out,"ease-in-out-quint":TWEEN.Easing.Quintic.InOut,"ease-sine":TWEEN.Easing.Sinusoidal.InOut,"ease-in-sine":TWEEN.Easing.Sinusoidal.In,"ease-out-sine":TWEEN.Easing.Sinusoidal.Out,"ease-in-out-sine":TWEEN.Easing.Sinusoidal.InOut,"ease-expo":TWEEN.Easing.Exponential.InOut,"ease-in-expo":TWEEN.Easing.Exponential.In,"ease-out-expo":TWEEN.Easing.Exponential.Out,"ease-in-out-expo":TWEEN.Easing.Exponential.InOut,"ease-circ":TWEEN.Easing.Circular.InOut,"ease-in-circ":TWEEN.Easing.Circular.In,"ease-out-circ":TWEEN.Easing.Circular.Out,"ease-in-out-circ":TWEEN.Easing.Circular.InOut,"ease-elastic":TWEEN.Easing.Elastic.InOut,"ease-in-elastic":TWEEN.Easing.Elastic.In,"ease-out-elastic":TWEEN.Easing.Elastic.Out,"ease-in-out-elastic":TWEEN.Easing.Elastic.InOut,"ease-back":TWEEN.Easing.Back.InOut,"ease-in-back":TWEEN.Easing.Back.In,"ease-out-back":TWEEN.Easing.Back.Out,"ease-in-out-back":TWEEN.Easing.Back.InOut,"ease-bounce":TWEEN.Easing.Bounce.InOut,"ease-in-bounce":TWEEN.Easing.Bounce.In,"ease-out-bounce":TWEEN.Easing.Bounce.Out,"ease-in-out-bounce":TWEEN.Easing.Bounce.InOut},FILLS={backwards:"backwards",both:"both",forwards:"forwards",none:"none"},REPEATS={indefinite:"indefinite"},DEFAULTS={attribute:"rotation",begin:"",end:"",delay:0,dur:1e3,easing:"ease",direction:DIRECTIONS.normal,fill:FILLS.forwards,from:void 0,repeat:0,to:void 0};module.exports.defaults=DEFAULTS,module.exports.directions=DIRECTIONS,module.exports.easingFunctions=EASING_FUNCTIONS,module.exports.fills=FILLS,module.exports.repeats=REPEATS;
},{"tween.js":18}],51:[function(_dereq_,module,exports){
module.exports={AFRAME_INJECTED:"aframe-injected",animation:_dereq_("./animation")};
},{"./animation":50}],52:[function(_dereq_,module,exports){
function cloneValue(t){return utils.extend({},t)}function getAnimationValues(t,e,i,n,a){function o(){var e=m[0],i=m[1],n=t.components[e],a=n&&n.schema;return a&&a[i]&&"color"===a[i].type}function s(){v=m[0],p=m[1],c=t.components[v],c||(t.setAttribute(v,""),c=t.components[v]),h=c.schema,void 0===i?b[e]=getComponentProperty(t,e):b[e]=i,b[e]=parseProperty(b[e],h[p]),g[e]=parseProperty(n,h[p]),f=function(i){e in i&&t.setAttribute(v,p,i[e])}}function r(){b=i?coordinates.parse(i):a,g=coordinates.parse(n),f=function(i){t.setAttribute(e,i)}}function u(){void 0===i?b[e]=!1:b[e]=strToBool(i),b[e]=boolToNum(b[e]),g[e]=boolToNum(strToBool(n)),f=function(i){t.setAttribute(e,!!i[e])}}function l(){b=new THREE.Color(i),g=new THREE.Color(n),f=function(i){m.length>1&&t.setAttribute(m[0],m[1],rgbVectorToHex(i)),t.setAttribute(e,rgbVectorToHex(i))}}function d(){void 0===i?b[e]=parseFloat(t.getAttribute(e)):b[e]=parseFloat(i),g[e]=parseFloat(n),f=function(i){t.setAttribute(e,i[e])}}var h,c,p,v,f,m=e.split("."),b={},g={};return 2===m.length?o()?l():s():n&&isCoordinate(n)?r():["true","false"].indexOf(n)!==-1?u():isNaN(n)?l():d(),{from:b,partialSetAttribute:f,to:g}}function strToBool(t){return"true"===t}function boolToNum(t){return t?1:0}function componentToHex(t){var e=t.toString(16);return 1===e.length?"0"+e:e}function convertToIntegerColor(t){return Math.floor(255*Math.min(Math.abs(t),1))}function rgbVectorToHex(t){return"#"+["r","g","b"].map(function(e){return componentToHex(convertToIntegerColor(t[e]))}).join("")}var ANode=_dereq_("./a-node"),animationConstants=_dereq_("../constants/animation"),coordinates=_dereq_("../utils/").coordinates,parseProperty=_dereq_("./schema").parseProperty,registerElement=_dereq_("./a-register-element").registerElement,TWEEN=_dereq_("tween.js"),THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),getComponentProperty=utils.entity.getComponentProperty,DEFAULTS=animationConstants.defaults,DIRECTIONS=animationConstants.directions,EASING_FUNCTIONS=animationConstants.easingFunctions,FILLS=animationConstants.fills,REPEATS=animationConstants.repeats,isCoordinate=coordinates.isCoordinate;module.exports.AAnimation=registerElement("a-animation",{prototype:Object.create(ANode.prototype,{createdCallback:{value:function(){this.bindMethods(),this.isRunning=!1,this.partialSetAttribute=function(){},this.tween=null}},attachedCallback:{value:function(){this.el=this.parentNode,this.handleMixinUpdate(),this.update(),this.load()}},attributeChangedCallback:{value:function(t,e,i){this.hasLoaded&&this.isRunning&&(this.stop(),this.handleMixinUpdate(),this.update())}},detachedCallback:{value:function(){this.isRunning&&this.stop()}},getTween:{value:function(){var t,e,i,n,a=this,o=a.data,s=a.el,r=o.attribute,u=parseInt(o.delay,10),l=getComponentProperty(s,r),d=a.getDirection(o.direction),h=EASING_FUNCTIONS[o.easing],c=o.fill,p=o.repeat===REPEATS.indefinite?1/0:0,v=!1;return t=getAnimationValues(s,r,o.from||a.initialValue,o.to,l),e=t.from,i=t.to,a.partialSetAttribute=t.partialSetAttribute,void 0===a.count&&(a.count=p===1/0?0:parseInt(o.repeat,10)),isNaN(u)&&(u=0),a.initialValue=a.initialValue||cloneValue(l),p===1/0&&c===FILLS.forwards&&[DIRECTIONS.alternate,DIRECTIONS.alternateReverse].indexOf(o.direction)!==-1&&(v=!0),d===DIRECTIONS.reverse&&(n=i,i=cloneValue(e),e=cloneValue(n)),[FILLS.backwards,FILLS.both].indexOf(c)!==-1&&a.partialSetAttribute(e),new TWEEN.Tween(cloneValue(e)).to(i,o.dur).delay(u).easing(h).repeat(p).yoyo(v).onUpdate(function(){a.partialSetAttribute(this)}).onComplete(a.onCompleted.bind(a))}},update:{value:function(){var t=this.data;"infinite"===t.repeat&&console.warn("Using 'infinite' as 'repeat' value is invalid. Use 'indefinite' instead."),""===t.begin||isNaN(t.begin)||(console.warn("Using 'begin' to specify a delay is deprecated. Use 'delay' instead."),t.delay=t.begin,t.begin="");var e=t.begin,i=t.end;this.evt&&this.removeEventListeners(this.evt),this.evt={begin:e,end:i},this.addEventListeners(this.evt),""===e&&(this.stop(),this.start())},writable:window.debug},onCompleted:{value:function(){var t=this.data;return this.isRunning=!1,[FILLS.backwards,FILLS.none].indexOf(t.fill)!==-1&&this.partialSetAttribute(this.initialValue),0===this.count?(this.count=void 0,void this.emit("animationend")):(this.isRunning=!1,this.count--,void this.start())}},start:{value:function(){var t=this;return this.el.hasLoaded?void(!this.isRunning&&this.el.isPlaying&&(this.tween=this.getTween(),this.isRunning=!0,this.tween.start(),this.emit("animationstart"))):void this.el.addEventListener("loaded",function(){t.start()})},writable:!0},stop:{value:function(){var t=this.tween;t&&(t.stop(),this.isRunning=!1,[FILLS.backwards,FILLS.none].indexOf(this.data.fill)!==-1&&this.partialSetAttribute(this.initialValue),this.emit("animationstop"))},writable:!0},getDirection:{value:function(t){return t===DIRECTIONS.alternate?(this.prevDirection=this.prevDirection===DIRECTIONS.normal?DIRECTIONS.reverse:DIRECTIONS.normal,this.prevDirection):t===DIRECTIONS.alternateReverse?(this.prevDirection=this.prevDirection===DIRECTIONS.reverse?DIRECTIONS.normal:DIRECTIONS.reverse,this.prevDirection):t}},bindMethods:{value:function(){this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.onStateAdded=this.onStateAdded.bind(this),this.onStateRemoved=this.onStateRemoved.bind(this)}},addEventListeners:{value:function(t){var e=this.el,i=this;utils.splitString(t.begin).forEach(function(t){e.addEventListener(t,i.start)}),utils.splitString(t.end).forEach(function(t){e.addEventListener(t,i.stop)}),""===t.begin&&e.addEventListener("play",this.start),e.addEventListener("pause",this.stop),e.addEventListener("stateadded",this.onStateAdded),e.addEventListener("stateremoved",this.onStateRemoved)}},removeEventListeners:{value:function(t){var e=this.el,i=this.start,n=this.stop;utils.splitString(t.begin).forEach(function(t){e.removeEventListener(t,i)}),utils.splitString(t.end).forEach(function(t){e.removeEventListener(t,n)}),e.removeEventListener("stateadded",this.onStateAdded),e.removeEventListener("stateremoved",this.onStateRemoved)}},onStateAdded:{value:function(t){t.detail.state===this.data.begin&&this.start()},writable:!0},onStateRemoved:{value:function(t){t.detail.state===this.data.begin&&this.stop()},writable:!0},handleMixinUpdate:{value:function(){var t,e,i,n={};i=document.querySelector("#"+this.getAttribute("mixin")),e=i?utils.getElData(i,DEFAULTS):{},t=utils.getElData(this,DEFAULTS),utils.extend(n,DEFAULTS,e,t),this.data=n}}})}),module.exports.getAnimationValues=getAnimationValues;
},{"../constants/animation":50,"../lib/three":103,"../utils/":120,"./a-node":57,"./a-register-element":58,"./schema":66,"tween.js":18}],53:[function(_dereq_,module,exports){
function mediaElementLoaded(e){if(e.hasAttribute("autoplay")||"auto"===e.getAttribute("preload"))return new Promise(function(t,r){function i(){for(var r=0,i=0;i<e.buffered.length;i++)r+=e.buffered.end(i)-e.buffered.start(i);r>=e.duration&&t()}return 4===e.readyState?t():e.error?r():(e.addEventListener("loadeddata",i,!1),e.addEventListener("progress",i,!1),void e.addEventListener("error",r,!1))})}function setCrossOrigin(e){var t,r;return e.hasAttribute("crossorigin")?e:(r=e.getAttribute("src"),r.indexOf("://")===-1?e:extractDomain(r)===window.location.host?e:(warn("Cross-origin element was requested without `crossorigin` set. A-Frame will re-request the asset with `crossorigin` attribute set.",r),e.crossOrigin="anonymous",t=e.cloneNode(!0),e.parentNode.appendChild(t),e.parentNode.removeChild(e),t))}function extractDomain(e){var t=e.indexOf("://")>-1?e.split("/")[2]:e.split("/")[0];return t.split(":")[0]}var ANode=_dereq_("./a-node"),debug=_dereq_("../utils/debug"),registerElement=_dereq_("./a-register-element").registerElement,THREE=_dereq_("../lib/three"),xhrLoader=new THREE.XHRLoader,warn=debug("core:a-assets:warn");module.exports=registerElement("a-assets",{prototype:Object.create(ANode.prototype,{createdCallback:{value:function(){this.isAssets=!0}},attachedCallback:{value:function(){var e,t,r,i,o,a,s=this,n=[];if(!this.parentNode.isScene)throw new Error("<a-assets> must be a child of a <a-scene>.");for(o=this.querySelectorAll("img"),e=0;e<o.length;e++)i=setCrossOrigin(o[e]),n.push(new Promise(function(e,t){i.onload=e,i.onerror=t}));for(r=this.querySelectorAll("audio, video"),e=0;e<r.length;e++)t=setCrossOrigin(r[e]),n.push(mediaElementLoaded(t));Promise.all(n).then(this.load.bind(this)),a=parseInt(this.getAttribute("timeout"),10)||3e3,setTimeout(function(){s.hasLoaded||(warn("Asset loading timed out in ",a,"ms"),s.emit("timeout"),s.load())},a)}},load:{value:function(){ANode.prototype.load.call(this,null,function(e){return e.isAssetItem&&e.hasAttribute("src")})}}})}),registerElement("a-asset-item",{prototype:Object.create(ANode.prototype,{createdCallback:{value:function(){this.data=null,this.isAssetItem=!0}},attachedCallback:{value:function(){var e=this,t=t=this.getAttribute("src");xhrLoader.load(t,function(r){THREE.Cache.files[t]=r,e.data=r,setTimeout(function(){ANode.prototype.load.call(e)})})}}})});
},{"../lib/three":103,"../utils/debug":117,"./a-node":57,"./a-register-element":58}],54:[function(_dereq_,module,exports){
var debug=_dereq_("../utils/debug"),registerElement=_dereq_("./a-register-element").registerElement,warn=debug("core:cubemap:warn");module.exports=registerElement("a-cubemap",{prototype:Object.create(HTMLElement.prototype,{attachedCallback:{value:function(){this.srcs=this.validate()},writable:window.debug},validate:{value:function(){var e,t=this.querySelectorAll("[src]"),r=[];if(6===t.length){for(e=0;e<t.length;e++)r.push(t[e].getAttribute("src"));return r}warn("<a-cubemap> did not contain exactly six elements each with a `src` attribute.")},writable:window.debug}})});
},{"../utils/debug":117,"./a-register-element":58}],55:[function(_dereq_,module,exports){
function checkComponentDefined(t,e){return void 0!==t.defaultComponents[e]||(!(!t.components[e]||!t.components[e].attrValue)||isComponentMixedIn(e,t.mixinEls))}function getMixedInComponents(t){var e=[];return t.mixinEls.forEach(function(t){function i(t){e.push(t)}Object.keys(t.componentCache).forEach(i)}),e}function isComponentMixedIn(t,e){var i,n=!1;for(i=0;i<e.length&&!(n=e[i].hasAttribute(t));++i);return n}var ANode=_dereq_("./a-node"),components=_dereq_("./component").components,registerElement=_dereq_("./a-register-element").registerElement,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),AEntity,debug=utils.debug("core:a-entity:debug"),MULTIPLE_COMPONENT_DELIMITER="__",proto=Object.create(ANode.prototype,{defaultComponents:{value:{position:"",rotation:"",scale:"",visible:""}},createdCallback:{value:function(){this.components={},this.isEntity=!0,this.isPlaying=!1,this.object3D=new THREE.Group,this.object3D.el=this,this.object3DMap={},this.parentEl=null,this.states=[]}},attributeChangedCallback:{value:function(t,e,i){var n=this.components[t];return n&&n.justInitialized&&""===i?void delete n.justInitialized:void((n||null!==i)&&this.setEntityAttribute(t,e,i))}},attachedCallback:{value:function(){var t,e=this.sceneEl,i=this;if(this.addToParent(),!this.isScene)return e?(t=e.querySelector("a-assets"),t&&!t.hasLoaded?void t.addEventListener("loaded",function(){i.load()}):void this.load()):void this.load()}},detachedCallback:{value:function(){this.parentEl&&!this.isScene&&(Object.keys(this.components).forEach(this.removeComponent.bind(this)),this.parentEl.remove(this))}},handleMixinUpdate:{value:function(t){return t?void this.updateComponent(t,this.getAttribute(t)):void this.updateComponents()}},mapStateMixins:{value:function(t,e){var i,n=this.getAttribute("mixin");n&&(i=n.split(" "),i.forEach(function(i){var n=i+"-"+t;e(n)}),this.updateComponents())}},updateStateMixins:{value:function(t,e){var i=this;e=e||"";var n=t.split(" "),o=e?e.split(" "):[],s=o.filter(function(t){return n.indexOf(t)<0});s.forEach(function(t){var e=Array.prototype.forEach,n=document.querySelectorAll("[id^="+t+"-]");e.call(n,function(t){i.unregisterMixin(t.id)})}),this.states.forEach(function(t){n.forEach(function(e){var n=e+"-"+t;i.registerMixin(n)})})}},getObject3D:{value:function(t){return this.object3DMap[t]}},setObject3D:{value:function(t,e){var i=this,n=this.object3DMap[t];n&&this.object3D.remove(n),e instanceof THREE.Object3D&&(e.el=i,this.object3D.add(e),e.children.length&&e.traverse(function(t){t.el=i})),this.object3DMap[t]=e}},removeObject3D:{value:function(t){this.setObject3D(t,null)}},getOrCreateObject3D:{value:function(t,e){var i=this.getObject3D(t);return!i&&e&&(i=new e,this.setObject3D(t,i)),i}},add:{value:function(t){if(!t.object3D)throw new Error("Trying to add an element that doesn't have an `object3D`");this.object3D.add(t.object3D),this.emit("child-attached",{el:t})}},addToParent:{value:function(){var t=this.parentEl=this.parentNode;t&&t.add&&!this.attachedToParent&&(t.add(this),this.attachedToParent=!0)}},load:{value:function(){function t(){e.updateComponents(),(e.isScene||e.parentEl.isPlaying)&&e.play()}var e=this;this.hasLoaded||ANode.prototype.load.call(this,t)},writable:window.debug},remove:{value:function(t){this.object3D.remove(t.object3D)}},getChildEntities:{value:function(){for(var t=this.children,e=[],i=0;i<t.length;i++){var n=t[i];n instanceof AEntity&&e.push(n)}return e}},initComponent:{value:function(t,e,i){var n,o=t.split(MULTIPLE_COMPONENT_DELIMITER),s=o[1],a=o[0],r=checkComponentDefined(this,t)||void 0!==e;if(components[a]&&(r||i)&&!(t in this.components)){if(this.initComponentDependencies(a),s&&!components[a].multiple)throw new Error("Trying to initialize multiple components of type `"+a+"`. There can only be one component of this type per entity.");n=this.components[t]=new components[a].Component(this,e,s),this.isPlaying&&n.play(),this.hasAttribute(t)||(n.justInitialized=!0,HTMLElement.prototype.setAttribute.call(this,t,"")),debug("Component initialized: %s",t)}},writable:window.debug},initComponentDependencies:{value:function(t){var e,i=this,n=components[t];n&&(e=components[t].dependencies,e&&e.forEach(function(t){i.initComponent(t,void 0,!0)}))}},removeComponent:{value:function(t){var e=this.components[t],i=t in this.defaultComponents,n=isComponentMixedIn(t,this.mixinEls);i||n||(e.pause(),e.remove(),delete this.components[t],this.emit("componentremoved",{name:t}))}},updateComponents:{value:function(){function t(t){var e=t.split(MULTIPLE_COMPONENT_DELIMITER)[0];components[e]&&(n[t]=!0)}function e(t){var e=o.getAttribute(t);delete n[t],o.updateComponent(t,e)}var i,n={},o=this;if(this.hasLoaded){var s=this.attributes;for(i=0;i<s.length;++i)t(s[i].name);getMixedInComponents(this).forEach(t),Object.keys(this.defaultComponents).forEach(e),Object.keys(n).forEach(e)}}},updateComponent:{value:function(t,e){var i=this.components[t],n=t in this.defaultComponents;return i?null!==e||n?void i.updateProperties(e):void this.removeComponent(t):void this.initComponent(t,e,!1)}},updateComponentProperty:{value:function(t,e,i){var n=this.components[t],o=n&&n.attrValue,s=o?utils.extend({},o):{};s[e]=i,this.updateComponent(t,s)}},removeAttribute:{value:function(t){var e=this.components[t];e&&(this.setEntityAttribute(t,void 0,null),this.components[t])||HTMLElement.prototype.removeAttribute.call(this,t)}},play:{value:function(){var t=this.components,e=Object.keys(t);!this.isPlaying&&this.hasLoaded&&(this.isPlaying=!0,e.forEach(function(e){t[e].play()}),this.getChildEntities().forEach(function(t){t.play()}),this.emit("play"))},writable:!0},pause:{value:function(){var t=this.components,e=Object.keys(t);this.isPlaying&&(this.isPlaying=!1,e.forEach(function(e){t[e].pause()}),this.getChildEntities().forEach(function(t){t.pause()}),this.emit("pause"))},writable:!0},setEntityAttribute:{value:function(t,e,i){return components[t]||this.components[t]?void this.updateComponent(t,i):"mixin"===t?void this.mixinUpdate(i,e):void 0}},mixinUpdate:{value:function(t,e){e=e||this.getAttribute("mixin"),this.updateStateMixins(t,e),this.updateComponents()}},setAttribute:{value:function(t,e,i){var n=this.sceneEl&&this.sceneEl.getAttribute("debug"),o=t.split(MULTIPLE_COMPONENT_DELIMITER)[0];return components[o]?("string"==typeof e&&void 0!==i?this.updateComponentProperty(t,e,i):this.updateComponent(t,e),void(n&&this.components[t].flushToDOM())):(ANode.prototype.setAttribute.call(this,t,e),void("mixin"===t&&this.mixinUpdate(e)))},writable:window.debug},flushToDOM:{value:function(t){function e(t){o[t].flushToDOM()}var i,n,o=this.components,s=this.children;if(Object.keys(o).forEach(e),t)for(n=0;n<s.length;++n)i=s[n],i.flushToDOM&&i.flushToDOM(t)}},getAttribute:{value:function(t){var e=this.components[t];return e?e.attrValue:HTMLElement.prototype.getAttribute.call(this,t)},writable:window.debug},getComputedAttribute:{value:function(t){var e=this.components[t];return e?e.getData():HTMLElement.prototype.getAttribute.call(this,t)}},addState:{value:function(t){this.is(t)||(this.states.push(t),this.mapStateMixins(t,this.registerMixin.bind(this)),this.emit("stateadded",{state:t}))}},removeState:{value:function(t){var e=this.states.indexOf(t);e!==-1&&(this.states.splice(e,1),this.mapStateMixins(t,this.unregisterMixin.bind(this)),this.emit("stateremoved",{state:t}))}},is:{value:function(t){return this.states.indexOf(t)!==-1}}});AEntity=registerElement("a-entity",{prototype:proto}),module.exports=AEntity;
},{"../lib/three":103,"../utils/":120,"./a-node":57,"./a-register-element":58,"./component":59}],56:[function(_dereq_,module,exports){
var ANode=_dereq_("./a-node"),registerElement=_dereq_("./a-register-element").registerElement,components=_dereq_("./component").components;module.exports=registerElement("a-mixin",{prototype:Object.create(ANode.prototype,{createdCallback:{value:function(){this.componentCache={},this.id=this.getAttribute("id")}},attributeChangedCallback:{value:function(t,e,i){this.cacheAttribute(t,i)}},attachedCallback:{value:function(){this.sceneEl=this.closest("a-scene"),this.cacheAttributes(),this.updateEntities(),this.load()}},setAttribute:{value:function(t,e){this.cacheAttribute(t,e),HTMLElement.prototype.setAttribute.call(this,t,e)}},cacheAttribute:{value:function(t,e){var i=components[t];i&&(void 0===e&&(e=HTMLElement.prototype.getAttribute.call(this,t)),this.componentCache[t]=i.parseAttrValueForCache(e))}},getAttribute:{value:function(t){return this.componentCache[t]||HTMLElement.prototype.getAttribute.call(this,t)}},cacheAttributes:{value:function(){var t,e,i=this.attributes;for(e=0;e<i.length;e++)t=i[e].name,this.cacheAttribute(t)}},updateEntities:{value:function(){if(this.sceneEl)for(var t=this.sceneEl.querySelectorAll("[mixin~="+this.id+"]"),e=0;e<t.length;e++){var i=t[e];i.hasLoaded&&(i.registerMixin(this.id),Object.keys(this.componentCache).forEach(function(t){i.updateComponent(t)}))}}}})});
},{"./a-node":57,"./a-register-element":58,"./component":59}],57:[function(_dereq_,module,exports){
var registerElement=_dereq_("./a-register-element").registerElement,utils=_dereq_("../utils/");module.exports=registerElement("a-node",{prototype:Object.create(HTMLElement.prototype,{createdCallback:{value:function(){this.hasLoaded=!1,this.isNode=!0,this.mixinEls=[],this.mixinObservers={}},writable:window.debug},attachedCallback:{value:function(){var e=this.getAttribute("mixin");this.sceneEl=this.closestScene(),this.emit("nodeready",{},!1),e&&this.updateMixins(e)},writable:window.debug},attributeChangedCallback:{value:function(e,t,i){"mixin"===e&&this.updateMixins(i,t)}},closestScene:{value:function(){for(var e=this;e&&!e.isScene;)e=e.parentElement;return e}},closest:{value:function(e){for(var t=this.matches||this.mozMatchesSelector||this.msMatchesSelector||this.oMatchesSelector||this.webkitMatchesSelector,i=this;i&&!t.call(i,e);)i=i.parentElement;return i}},detachedCallback:{value:function(){}},load:{value:function(e,t){var i,n,r=this;this.hasLoaded||(t=t||function(e){return e.isNode},i=this.getChildren(),n=i.filter(t).map(function(e){return new Promise(function(t){return e.hasLoaded?t():void e.addEventListener("loaded",t)})}),Promise.all(n).then(function(){r.hasLoaded=!0,e&&e(),r.emit("loaded",{},!1)}))},writable:!0},getChildren:{value:function(){return Array.prototype.slice.call(this.children,0)}},updateMixins:{value:function(e,t){var i=e.split(" "),n=t?t.split(" "):[],r=n.filter(function(e){return i.indexOf(e)<0});this.mixinEls=[],r.forEach(this.unregisterMixin.bind(this)),i.forEach(this.registerMixin.bind(this))}},registerMixin:{value:function(e){if(this.sceneEl){var t=this.sceneEl.querySelector("a-mixin#"+e);t&&(this.attachMixinListener(t),this.mixinEls.push(t))}}},setAttribute:{value:function(e,t){"mixin"===e&&this.updateMixins(t),HTMLElement.prototype.setAttribute.call(this,e,t)}},unregisterMixin:{value:function(e){var t,i,n=this.mixinEls;for(i=0;i<n.length;++i)if(t=n[i],e===t.id){n.splice(i,1);break}this.removeMixinListener(e)}},removeMixinListener:{value:function(e){var t=this.mixinObservers[e];t&&(t.disconnect(),this.mixinObservers[e]=null)}},attachMixinListener:{value:function(e){var t=this,i=e.id,n=this.mixinObservers[i];if(e&&!n){var r=new MutationObserver(function(e){var i=e[0].attributeName;t.handleMixinUpdate(i)}),s={attributes:!0};r.observe(e,s),this.mixinObservers[i]=r}}},handleMixinUpdate:{value:function(){}},emit:{value:function(e,t,i){var n=this;t=t||{},void 0===i&&(i=!0);var r={bubbles:!!i,detail:t};return e.split(" ").map(function(e){return utils.fireEvent(n,e,r)})}},emitter:{value:function(e,t,i){var n=this;return function(){n.emit(e,t,i)}}}})});
},{"../utils/":120,"./a-register-element":58}],58:[function(_dereq_,module,exports){
function addTagName(e){knownTags[e.toLowerCase()]=!0}function wrapANodeMethods(e){var t={},o=["attachedCallback","attributeChangedCallback","createdCallback"];return wrapMethods(t,o,e,ANode.prototype),copyProperties(e,t),t}function wrapAEntityMethods(e){var t={},o=["attachedCallback","attributeChangedCallback","createdCallback"],a=["attachedCallback","attributeChangedCallback","createdCallback","detachedCallback"];return wrapMethods(t,o,e,ANode.prototype),wrapMethods(t,a,e,AEntity.prototype),copyProperties(e,t),t}function wrapMethods(e,t,o,a){t.forEach(function(t){wrapMethod(e,t,o,a)})}function wrapMethod(e,t,o,a){var r=o[t],n=a[t];r&&n&&r!==n&&(e[t]={value:function(){return n.apply(this,arguments),r.apply(this,arguments)},writable:window.debug})}function copyProperties(e,t){var o=Object.getOwnPropertyNames(e);o.forEach(function(o){var a;t[o]||(a=Object.getOwnPropertyDescriptor(e,o),t[o]={value:e[o],writable:a.writable})})}_dereq_("document-register-element");var ANode,AEntity,knownTags=module.exports.knownTags={};module.exports.isNode=function(e){return e.tagName.toLowerCase()in knownTags||e.isNode},module.exports.registerElement=function(e,t){var o=Object.getPrototypeOf(t.prototype),a=t,r=ANode&&o===ANode.prototype,n=AEntity&&o===AEntity.prototype;return(r||n)&&addTagName(e),r&&(a=wrapANodeMethods(t.prototype),a={prototype:Object.create(o,a)}),n&&(a=wrapAEntityMethods(t.prototype),a={prototype:Object.create(o,a)}),document.registerElement(e,a)},module.exports.wrapMethods=wrapMethods,ANode=_dereq_("./a-node"),AEntity=_dereq_("./a-entity");
},{"./a-entity":55,"./a-node":57,"document-register-element":8}],59:[function(_dereq_,module,exports){
function buildData(e,t,s,i,r){function a(e){var s=e.getAttribute(t);s&&(o=extendProperties(o,s,p))}var o,n=void 0!==i&&null!==i,p=isSingleProp(s),h=e.mixinEls;return p?o=s.default:(o={},Object.keys(s).forEach(function(e){o[e]=s[e].default})),h.forEach(a),n?p?parseProperty(i,s):(o=extendProperties(o,i,p),parseProperties(o,s,void 0,t,r)):p?parseProperty(o,s):parseProperties(o,s,void 0,t,r)}function extendProperties(e,t,s){return s?t:utils.extend(e,t)}function wrapPause(e){return function(){var t=this.el.sceneEl;this.isPlaying&&(e.call(this),this.isPlaying=!1,this.tick&&t.removeBehavior(this))}}function wrapPlay(e){return function(){var t=this.el.sceneEl,s=this.el.isPlaying&&!this.isPlaying;this.initialized&&s&&(e.call(this),this.isPlaying=!0,this.tick&&t.addBehavior(this))}}var schema=_dereq_("./schema"),systems=_dereq_("./system"),utils=_dereq_("../utils/"),components=module.exports.components={},parseProperties=schema.parseProperties,parseProperty=schema.parseProperty,processSchema=schema.process,isSingleProp=schema.isSingleProperty,stringifyProperties=schema.stringifyProperties,stringifyProperty=schema.stringifyProperty,styleParser=utils.styleParser,Component=module.exports.Component=function(e,t,s){this.el=e,this.id=s,this.attrName=this.name+(s?"__"+s:""),this.updateCachedAttrValue(t)};Component.prototype={schema:{},init:function(){},update:function(e){},updateSchema:void 0,tick:void 0,play:function(){},pause:function(){},remove:function(){},parse:function(e,t){var s=this.schema;return isSingleProp(s)?parseProperty(e,s):parseProperties(styleParser.parse(e),s,!0,this.name,t)},stringify:function(e){var t=this.schema;return"string"==typeof e?e:isSingleProp(t)?stringifyProperty(e,t):(e=stringifyProperties(e,t),styleParser.stringify(e))},getData:function(){var e=this.data;return"object"!=typeof e?e:utils.extend({},e)},updateCachedAttrValue:function(e){var t=isSingleProp(this.schema),s=this.parseAttrValueForCache(e);this.attrValue=extendProperties({},s,t)},parseAttrValueForCache:function(e){var t;return"string"!=typeof e?e:(isSingleProp(this.schema)?(t=this.schema.parse(e),"string"==typeof t&&(t=e)):t=styleParser.parse(e),t)},flushToDOM:function(){var e=this.attrValue;e&&HTMLElement.prototype.setAttribute.call(this.el,this.attrName,this.stringify(e))},updateProperties:function(e){var t=this.el,s=isSingleProp(this.schema),i=extendProperties({},this.data,s);void 0!==e&&this.updateCachedAttrValue(e),this.updateSchema&&this.updateSchema(buildData(t,this.name,this.schema,this.attrValue,!0)),this.data=buildData(t,this.name,this.schema,this.attrValue),!s&&utils.deepEqual(i,this.data)||(this.initialized?this.update(i):(this.init(),this.initialized=!0,this.update(i),t.isPlaying&&this.play()),t.emit("componentchanged",{id:this.id,name:this.name,newData:this.getData(),oldData:i},!1))},extendSchema:function(e){var t=utils.extend({},components[this.name].schema);utils.extend(t,e),this.schema=processSchema(t),this.el.emit("schemachanged",{component:this.name})}},module.exports.registerComponent=function(e,t){var s,i={};if(e.indexOf("__")!==-1)throw new Error("The component name `"+e+"` is not allowed. The sequence __ (double underscore) is reserved to specify an id for multiple components of the same type");if(Object.keys(t).forEach(function(e){i[e]={value:t[e],writable:!0}}),components[e])throw new Error("The component `"+e+"` has been already registered. Check that you are not loading two versions of the same component or two different components of the same name.");return s=function(e,t,s){Component.call(this,e,t,s),e.hasLoaded&&this.updateProperties(this.attrValue)},s.prototype=Object.create(Component.prototype,i),s.prototype.name=e,s.prototype.constructor=s,s.prototype.system=systems&&systems.systems[e],s.prototype.play=wrapPlay(s.prototype.play),s.prototype.pause=wrapPause(s.prototype.pause),components[e]={Component:s,dependencies:s.prototype.dependencies,multiple:s.prototype.multiple,parse:s.prototype.parse,parseAttrValueForCache:s.prototype.parseAttrValueForCache,schema:utils.extend(processSchema(s.prototype.schema)),stringify:s.prototype.stringify,type:s.prototype.type},s},module.exports.buildData=buildData;
},{"../utils/":120,"./schema":66,"./system":68}],60:[function(_dereq_,module,exports){
var schema=_dereq_("./schema"),processSchema=schema.process,geometries=module.exports.geometries={},geometryNames=module.exports.geometryNames=[],THREE=_dereq_("../lib/three"),Geometry=module.exports.Geometry=function(){};Geometry.prototype={schema:{},init:function(e){return this.geometry=new THREE.Geometry,this.geometry},update:function(e){}},module.exports.registerGeometry=function(e,t){var r,o={};if(Object.keys(t).forEach(function(e){o[e]={value:t[e],writable:!0}}),geometries[e])throw new Error("The geometry `"+e+"` has been already registered");return r=function(){Geometry.call(this)},r.prototype=Object.create(Geometry.prototype,o),r.prototype.name=e,r.prototype.constructor=r,geometries[e]={Geometry:r,schema:processSchema(r.prototype.schema)},geometryNames.push(e),r};
},{"../lib/three":103,"./schema":66}],61:[function(_dereq_,module,exports){
function registerPropertyType(r,e,t,i){return"type"in propertyTypes?void error("Property type "+r+" is already registered."):void(propertyTypes[r]={default:e,parse:t||defaultParse,stringify:i||defaultStringify})}function arrayParse(r){function e(r){return r.trim()}return Array.isArray(r)?r:r&&"string"==typeof r?r.split(",").map(e):[]}function arrayStringify(r){return r.join(", ")}function defaultParse(r){return r}function defaultStringify(r){return null===r?"null":r.toString()}function boolParse(r){return"false"!==r&&r!==!1}function intParse(r){return parseInt(r,10)}function numberParse(r){return parseFloat(r,10)}function selectorParse(r){return r?"string"!=typeof r?r:document.querySelector(r):null}function selectorAllParse(r){return r?"string"!=typeof r?r:Array.prototype.slice.call(document.querySelectorAll(r),0):null}function selectorStringify(r){return r.getAttribute?"#"+r.getAttribute("id"):defaultStringify(r)}function selectorAllStringify(r){return r instanceof Array?r.map(function(r){return"#"+r.getAttribute("id")}).join(", "):defaultStringify(r)}function srcParse(r){var e=r.match(/\url\((.+)\)/);if(e)return e[1];var t=selectorParse(r);return t?t.getAttribute("src"):""}function vecParse(r){return coordinates.parse(r,this.default)}var coordinates=_dereq_("../utils/coordinates"),debug=_dereq_("debug"),error=debug("core:propertyTypes:warn"),propertyTypes=module.exports.propertyTypes={};registerPropertyType("array",[],arrayParse,arrayStringify),registerPropertyType("boolean",!1,boolParse),registerPropertyType("color","#FFF",defaultParse,defaultStringify),registerPropertyType("int",0,intParse),registerPropertyType("number",0,numberParse),registerPropertyType("selector","",selectorParse,selectorStringify),registerPropertyType("selectorAll","",selectorAllParse,selectorAllStringify),registerPropertyType("src","",srcParse),registerPropertyType("string","",defaultParse,defaultStringify),registerPropertyType("time",0,intParse),registerPropertyType("vec2",{x:0,y:0},vecParse,coordinates.stringify),registerPropertyType("vec3",{x:0,y:0,z:0},vecParse,coordinates.stringify),registerPropertyType("vec4",{x:0,y:0,z:0,w:0},vecParse,coordinates.stringify),module.exports.registerPropertyType=registerPropertyType;
},{"../utils/coordinates":116,"debug":3}],62:[function(_dereq_,module,exports){
function getCanvasSize(e,t){return t?{height:e.parentElement.offsetHeight,width:e.parentElement.offsetWidth}:{height:window.innerHeight,width:window.innerWidth}}function requestFullscreen(e){var t=e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen;t.apply(e)}var initMetaTags=_dereq_("./metaTags").inject,initWakelock=_dereq_("./wakelock"),re=_dereq_("../a-register-element"),systems=_dereq_("../system").systems,THREE=_dereq_("../../lib/three"),TWEEN=_dereq_("tween.js"),utils=_dereq_("../../utils/"),AEntity=_dereq_("../a-entity"),ANode=_dereq_("../a-node"),initPostMessageAPI=_dereq_("./postMessage"),checkHeadsetConnected=utils.checkHeadsetConnected,registerElement=re.registerElement,isIOS=utils.isIOS(),isMobile=utils.isMobile();module.exports=registerElement("a-scene",{prototype:Object.create(AEntity.prototype,{defaultComponents:{value:{canvas:"",inspector:"","keyboard-shortcuts":"","vr-mode-ui":""}},createdCallback:{value:function(){this.isIOS=isIOS,this.isMobile=isMobile,this.isScene=!0,this.object3D=new THREE.Scene,this.render=this.render.bind(this),this.systems={},this.time=0,this.init()}},init:{value:function(){this.behaviors=[],this.hasLoaded=!1,this.isPlaying=!1,this.originalHTML=this.innerHTML,this.addEventListener("render-target-loaded",function(){this.setupRenderer(),this.resize()}),this.addFullScreenStyles(),initPostMessageAPI(this)},writable:!0},addFullScreenStyles:{value:function(){var e=document.documentElement;e.classList.add("a-html"),document.body.classList.add("a-body"),this.classList.add("fullscreen")}},removeFullScreenStyles:{value:function(){var e=document.documentElement;e.classList.remove("a-html"),document.body.classList.remove("a-body"),this.classList.remove("fullscreen")}},attachedCallback:{value:function(){var e=this.resize.bind(this);initMetaTags(this),initWakelock(this),this.initSystems(),window.addEventListener("load",e),window.addEventListener("resize",e),this.play()},writable:window.debug},initSystems:{value:function(){Object.keys(systems).forEach(this.initSystem.bind(this))}},initSystem:{value:function(e){var t;this.systems[e]||(t=this.systems[e]=new systems[e](this),t.init())}},detachedCallback:{value:function(){window.cancelAnimationFrame(this.animationFrameID),this.animationFrameID=null}},addBehavior:{value:function(e){var t=this.behaviors;t.indexOf(e)===-1&&t.push(e)}},enterVR:{value:function(e){function t(){s.addState("vr-mode"),s.emit("enter-vr",e),s.isMobile&&screen.orientation&&screen.orientation.lock&&screen.orientation.lock("landscape"),s.addFullScreenStyles(),s.isMobile||checkHeadsetConnected()||requestFullscreen(s.canvas),s.resize()}function i(e){throw e&&e.message?new Error("Failed to enter VR mode (`requestPresent`): "+e.message):new Error("Failed to enter VR mode (`requestPresent`).")}var s=this;if(!this.is("vr-mode"))return checkHeadsetConnected()||this.isMobile?this.effect.requestPresent().then(t,i):void t()}},exitVR:{value:function(){function e(){var e=i.getAttribute("embedded");i.removeState("vr-mode"),i.isMobile&&screen.orientation&&screen.orientation.unlock&&screen.orientation.unlock(),e&&i.removeFullScreenStyles(),i.resize(),i.isIOS&&utils.forceCanvasResizeSafariMobile(this.canvas),i.emit("exit-vr",{target:i})}function t(e){throw e&&e.message?new Error("Failed to exit VR mode (`exitPresent`): "+e.message):new Error("Failed to exit VR mode (`exitPresent`).")}var i=this;return this.is("vr-mode")?checkHeadsetConnected()||this.isMobile?this.effect.exitPresent().then(e,t):void e():Promise.resolve()}},getAttribute:{value:function(e){var t=this.systems[e];return t?t.data:AEntity.prototype.getAttribute.call(this,e)}},getComputedAttribute:{value:function(e){var t=this.systems[e];return t?t.data:AEntity.prototype.getComputedAttribute.call(this,e)}},setAttribute:{value:function(e,t,i){var s=this.systems[e];return s?void ANode.prototype.setAttribute.call(this,e,t):void AEntity.prototype.setAttribute.call(this,e,t,i)}},removeBehavior:{value:function(e){var t=this.behaviors,i=t.indexOf(e);i!==-1&&t.splice(i,1)}},resize:{value:function(){var e,t=this.camera,i=this.canvas,s=this.getAttribute("embedded")&&!this.is("vr-mode");!t||!i||this.is("vr-mode")&&isMobile||(e=getCanvasSize(i,s),t.aspect=e.width/e.height,t.updateProjectionMatrix(),this.renderer.setSize(e.width,e.height))},writable:window.debug},setupRenderer:{value:function(){var e=this.canvas,t="true"===this.getAttribute("antialias"),i=this.renderer=new THREE.WebGLRenderer({canvas:e,antialias:t||window.hasNativeWebVRImplementation,alpha:!0});i.setPixelRatio(window.devicePixelRatio),i.sortObjects=!1,this.effect=new THREE.VREffect(i)},writable:window.debug},play:{value:function(){var e=this;return this.renderStarted?void AEntity.prototype.play.call(this):(this.addEventListener("loaded",function(){function e(e){e.renderStarted||(e.resize(),e.renderer&&(window.performance&&window.performance.mark("render-started"),e.render(0),e.renderStarted=!0,e.emit("renderstart")))}return AEntity.prototype.play.call(this),this.camera?void e(this):void this.addEventListener("camera-set-active",function(){e(this)})}),void setTimeout(function(){AEntity.prototype.load.call(e)}))}},reload:{value:function(e){function t(){i.isPlaying&&AEntity.prototype.play.call(i)}var i=this;e&&this.pause(),this.innerHTML=this.originalHTML,this.init(),ANode.prototype.load.call(this,t)}},tick:{value:function(e,t){var i=this.systems;TWEEN.update(e),this.behaviors.forEach(function(i){i.el.isPlaying&&i.tick(e,t)}),Object.keys(i).forEach(function(s){i[s].tick&&i[s].tick(e,t)})}},render:{value:function(e){var t=this.effect,i=e-this.time;this.isPlaying&&this.tick(e,i),this.animationFrameID=t.requestAnimationFrame(this.render),t.render(this.object3D,this.camera),this.time=e},writable:!0}})});
},{"../../lib/three":103,"../../utils/":120,"../a-entity":55,"../a-node":57,"../a-register-element":58,"../system":68,"./metaTags":63,"./postMessage":64,"./wakelock":65,"tween.js":18}],63:[function(_dereq_,module,exports){
function Meta(e){return{tagName:"meta",attributes:e,exists:function(){return document.querySelector('meta[name="'+e.name+'"]')}}}function Link(e){return{tagName:"link",attributes:e,exists:function(){return document.querySelector('link[rel="'+e.rel+'"]')}}}function createTag(e){if(e&&e.tagName){var t=document.createElement(e.tagName);return t.setAttribute(constants.AFRAME_INJECTED,""),extend(t,e.attributes)}}var constants=_dereq_("../../constants/"),extend=_dereq_("../../utils").extend,MOBILE_HEAD_TAGS=module.exports.MOBILE_HEAD_TAGS=[Meta({name:"viewport",content:"width=device-width,initial-scale=1,maximum-scale=1,shrink-to-fit=no,user-scalable=no,minimal-ui"}),Meta({name:"mobile-web-app-capable",content:"yes"}),Meta({name:"theme-color",content:"black"})],MOBILE_IOS_HEAD_TAGS=[Meta({name:"apple-mobile-web-app-capable",content:"yes"}),Meta({name:"apple-mobile-web-app-status-bar-style",content:"black"}),Link({rel:"apple-touch-icon",href:"https://aframe.io/images/aframe-logo-152.png"})];module.exports.inject=function(e){function t(e){e&&!e.exists()&&(a=createTag(e),a&&(r?r.parentNode.insertBefore(a,r):n.appendChild(a),i.push(a)))}var a,n=document.head,r=n.querySelector("script"),i=[];return MOBILE_HEAD_TAGS.forEach(t),e.isIOS&&MOBILE_IOS_HEAD_TAGS.forEach(t),i};
},{"../../constants/":51,"../../utils":120}],64:[function(_dereq_,module,exports){
function postMessageAPIHandler(e){var a=this;if(e.data)switch(e.data.type){case"vr":switch(e.data.data){case"enter":a.enterVR();break;case"exit":a.exitVR()}}}var isIframed=_dereq_("../../utils/").isIframed;module.exports=function(e){isIframed()&&window.addEventListener("message",postMessageAPIHandler.bind(e))};
},{"../../utils/":120}],65:[function(_dereq_,module,exports){
var Wakelock=_dereq_("../../../vendor/wakelock/wakelock");module.exports=function(e){if(e.isMobile){var n=e.wakelock=new Wakelock;e.addEventListener("enter-vr",function(){n.request()}),e.addEventListener("exit-vr",function(){n.release()})}};
},{"../../../vendor/wakelock/wakelock":129}],66:[function(_dereq_,module,exports){
function isSingleProperty(r){return"type"in r?"string"==typeof r.type:"default"in r}function processPropertyDefinition(r){var e,t=r.default,o=r.type;return r.type?"bool"===r.type?o="boolean":"float"===r.type&&(o="number"):o=void 0!==t&&["boolean","number"].indexOf(typeof t)!==-1?typeof t:Array.isArray(t)?"array":"string",e=propertyTypes[o],e||warn("Unknown property type: "+o),r.parse=r.parse||e.parse,r.stringify=r.stringify||e.stringify,r.type=o,"default"in r||(r.default=e.default),r}function parseProperty(r,e){return r=void 0===r||null===r?e.default:r,e.parse(r)}function stringifyProperty(r,e){return"object"!=typeof r?r:e?e.stringify(r):JSON.stringify(r)}var debug=_dereq_("../utils/debug"),propertyTypes=_dereq_("./propertyTypes").propertyTypes,warn=debug("core:schema:warn");module.exports.isSingleProperty=isSingleProperty,module.exports.process=function(r){return isSingleProperty(r)?processPropertyDefinition(r):(Object.keys(r).forEach(function(e){r[e]=processPropertyDefinition(r[e])}),r)},module.exports.processPropertyDefinition=processPropertyDefinition,module.exports.parseProperties=function(r,e,t,o,n){var p=Object.keys(t?r:e);return null===r||"object"!=typeof r?r:(Object.keys(r).forEach(function(r){e[r]||n||warn("Unknown property `"+r+"` for component/system `"+o+"`.")}),p.forEach(function(t){var o=e[t],n=r[t];e[t]&&(r[t]=parseProperty(n,o))}),r)},module.exports.parseProperty=parseProperty,module.exports.stringifyProperties=function(r,e){var t={};return Object.keys(r).forEach(function(o){var n=e[o],p=r[o],i=p;"object"==typeof i&&(i=stringifyProperty(p,n),n||warn("Unknown component property: "+o)),t[o]=i}),t},module.exports.stringifyProperty=stringifyProperty;
},{"../utils/debug":117,"./propertyTypes":61}],67:[function(_dereq_,module,exports){
var schema=_dereq_("./schema"),processSchema=schema.process,shaders=module.exports.shaders={},shaderNames=module.exports.shaderNames=[],THREE=_dereq_("../lib/three"),propertyToThreeMapping={number:"f",time:"f",vec4:"v4",vec3:"v3",vec2:"v2",color:"v3"},Shader=module.exports.Shader=function(){};Shader.prototype={schema:{},vertexShader:"void main() {gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);}",fragmentShader:"void main() {gl_FragColor = vec4(1.0,0.0,1.0,1.0);}",init:function(e){return this.attributes=this.initVariables(e,"attribute"),this.uniforms=this.initVariables(e,"uniform"),this.material=new THREE.ShaderMaterial({uniforms:this.uniforms,vertexShader:this.vertexShader,fragmentShader:this.fragmentShader}),this.material},initVariables:function(e,r){function t(t){if(i[t].is===r){var o=propertyToThreeMapping[i[t].type],n=i[t].parse(e[t]||i[t].default);s[t]={type:o,value:a.parseValue(i[t].type,n)}}}var a=this,s={},i=this.schema,o=Object.keys(i);return o.forEach(t),s},update:function(e){this.updateVariables(e,"attribute"),this.updateVariables(e,"uniform")},updateVariables:function(e,r){function t(t){o[t]&&o[t].is===r&&s[t].value!==e[t]&&(s[t].value=a.parseValue(o[t].type,e[t]),s[t].needsUpdate=!0)}var a=this,s="uniform"===r?this.uniforms:this.attributes,i=Object.keys(e),o=this.schema;i.forEach(t)},parseValue:function(e,r){var t;switch(e){case"vec2":return new THREE.Vector2(r.x,r.y);case"vec3":return new THREE.Vector3(r.x,r.y,r.z);case"vec4":return new THREE.Vector4(r.x,r.y,r.z,r.w);case"color":return t=new THREE.Color(r),new THREE.Vector3(t.r,t.g,t.b);default:return r}}},module.exports.registerShader=function(e,r){var t,a={};if(Object.keys(r).forEach(function(e){a[e]={value:r[e],writable:!0}}),shaders[e])throw new Error("The shader "+e+" has been already registered");return t=function(){Shader.call(this)},t.prototype=Object.create(Shader.prototype,a),t.prototype.name=e,t.prototype.constructor=t,shaders[e]={Shader:t,schema:processSchema(t.prototype.schema)},shaderNames.push(e),t};
},{"../lib/three":103,"./schema":66}],68:[function(_dereq_,module,exports){
var components=_dereq_("./component"),schema=_dereq_("./schema"),utils=_dereq_("../utils/"),parseProperties=schema.parseProperties,parseProperty=schema.parseProperty,processSchema=schema.process,isSingleProp=schema.isSingleProperty,styleParser=utils.styleParser,systems=module.exports.systems={},System=module.exports.System=function(e){var t,s=components&&components.components[this.name],r=this.schema;if(this.sceneEl=e,s&&(s.Component.prototype.system=this),Object.keys(r).length)return t=HTMLElement.prototype.getAttribute.call(e,this.name),isSingleProp(r)?void(this.data=parseProperty(t,r)):void(this.data=parseProperties(styleParser.parse(t)||{},r,!1,this.name))};System.prototype={schema:{},init:function(){},tick:void 0,play:function(){},pause:function(){}},module.exports.registerSystem=function(e,t){var s,r,o={},n=utils.findAllScenes(document);if(Object.keys(t).forEach(function(e){o[e]={value:t[e],writable:!0}}),systems[e])throw new Error("The system `"+e+"` has been already registered. Check that you are not loading two versions of the same system or two different systems of the same name.");for(r=function(e){System.call(this,e)},r.prototype=Object.create(System.prototype,o),r.prototype.name=e,r.prototype.constructor=r,r.prototype.schema=utils.extend(processSchema(r.prototype.schema)),systems[e]=r,s=0;s<n.length;s++)n[s].initSystem(e)};
},{"../utils/":120,"./component":59,"./schema":66}],69:[function(_dereq_,module,exports){
_dereq_("./pivot");
},{"./pivot":70}],70:[function(_dereq_,module,exports){
var registerComponent=_dereq_("../../core/component").registerComponent,THREE=_dereq_("../../lib/three"),originalPosition=new THREE.Vector3,originalRotation=new THREE.Vector3;registerComponent("pivot",{dependencies:["position"],schema:{type:"vec3"},init:function(){var o=this.data,i=this.el,t=i.object3D.parent,e=i.object3D,n=new THREE.Group;originalPosition.copy(e.position),originalRotation.copy(e.rotation),t.remove(e),n.add(e),t.add(n),i.object3D=n,e.position.set(-1*o.x,-1*o.y,-1*o.z),n.position.set(o.x+originalPosition.x,o.y+originalPosition.y,o.z+originalPosition.z),n.rotation.copy(e.rotation),e.rotation.set(0,0,0)}});
},{"../../core/component":59,"../../lib/three":103}],71:[function(_dereq_,module,exports){
var ANode=_dereq_("../../core/a-node"),registerElement=_dereq_("../../core/a-register-element").registerElement,utils=_dereq_("../../utils/"),setComponentProperty=utils.entity.setComponentProperty;module.exports=registerElement("a-event",{prototype:Object.create(ANode.prototype,{createdCallback:{value:function(){this.el=null,this.isAEvent=!0,this.name="",this.targetEls=[]}},attachedCallback:{value:function(){var e=this.getAttribute("target");this.el=this.parentNode,this.name=this.getAttribute("name")||this.getAttribute("type"),console.log("<a-event> has been DEPRECATED. Use https://github.com/ngokevin/aframe-event-set-component instead."),e?this.targetEls=this.el.sceneEl.querySelectorAll(e):this.targetEls=[this.el],this.deprecated&&console.warn("<"+this.tagName.toLowerCase()+'> has been DEPRECATED. Use <a-event name="'+this.name+'"> instead.'),this.hasAttribute("type")&&console.log("<a-event type> has been DEPRECATED. Use <a-event name> instead."),this.listener=this.attachEventListener(),this.load()}},detachedCallback:{value:function(){var e=this.listener;e&&this.removeEventListener(this.name,e)}},attachEventListener:{value:function(){var e=this.attributes,t=this.el,n=this.name,s=this.targetEls;return t.addEventListener(n,function(){for(var t,n,a,r,i=0;i<s.length;i++)for(var o=0;o<e.length;o++)t=e[o],n=t.name,a=t.value,r=s[i],"target"!==n&&setComponentProperty(r,n,a)})}}})});
},{"../../core/a-node":57,"../../core/a-register-element":58,"../../utils/":120}],72:[function(_dereq_,module,exports){
module.exports=function(){return{defaultComponents:{material:{}},mappings:{color:"material.color",metalness:"material.metalness",opacity:"material.opacity",repeat:"material.repeat",roughness:"material.roughness",shader:"material.shader",side:"material.side",src:"material.src",transparent:"material.transparent"},transforms:{src:function(a){return"#"===a[0]?a:"url("+a+")"}}}};
},{}],73:[function(_dereq_,module,exports){
_dereq_("./primitives/a-camera"),_dereq_("./primitives/a-collada-model"),_dereq_("./primitives/a-cursor"),_dereq_("./primitives/a-curvedimage"),_dereq_("./primitives/a-image"),_dereq_("./primitives/a-light"),_dereq_("./primitives/a-obj-model"),_dereq_("./primitives/a-sky"),_dereq_("./primitives/a-sound"),_dereq_("./primitives/a-video"),_dereq_("./primitives/a-videosphere"),_dereq_("./primitives/meshPrimitives");
},{"./primitives/a-camera":75,"./primitives/a-collada-model":76,"./primitives/a-cursor":77,"./primitives/a-curvedimage":78,"./primitives/a-image":79,"./primitives/a-light":80,"./primitives/a-obj-model":81,"./primitives/a-sky":82,"./primitives/a-sound":83,"./primitives/a-video":84,"./primitives/a-videosphere":85,"./primitives/meshPrimitives":86}],74:[function(_dereq_,module,exports){
var AEntity=_dereq_("../../core/a-entity"),components=_dereq_("../../core/component").components,registerElement=_dereq_("../../core/a-register-element").registerElement,utils=_dereq_("../../utils/"),debug=utils.debug,setComponentProperty=utils.entity.setComponentProperty,log=debug("extras:primitives:debug"),primitives=module.exports.primitives={};module.exports.registerPrimitive=function(e,t){e=e.toLowerCase(),log("Registering <%s>",e),t.defaultAttributes&&console.warn("The 'defaultAttributes' object is deprecated. Use 'defaultComponents' instead.");var r=registerElement(e,{prototype:Object.create(AEntity.prototype,{defaultComponentsFromPrimitive:{value:t.defaultComponents||t.defaultAttributes||{}},deprecated:{value:t.deprecated||null},deprecatedMappings:{value:t.deprecatedMappings||{}},mappings:{value:t.mappings||{}},transforms:{value:t.transforms||{}},createdCallback:{value:function(){this.componentData={},t.deprecated&&console.warn(t.deprecated)}},attachedCallback:{value:function(){var e=this,t=this.attributes;this.applyDefaultComponents(),Object.keys(t).forEach(function(r){var n=t[r];e.syncAttributeToComponent(n.name,n.value)})}},attributeChangedCallback:{value:function(e,t,r){this.syncAttributeToComponent(e,r)}},applyDefaultComponents:{value:function(){var e=this,t=this.defaultComponentsFromPrimitive;Object.keys(t).forEach(function(r){var n=t[r];if(n instanceof Object){var i=components[r],o=e.getAttribute(r)||{},s=i.parse(o);return Object.keys(n).forEach(function(e){s[e]||(s[e]=n[e])}),void e.setAttribute(r,s)}e.setAttribute(r,n)})}},syncAttributeToComponent:{value:function(e,t){var r=this.mappings[e];e in this.deprecatedMappings&&console.warn(this.deprecatedMappings[e]),e&&r&&(t=this.getTransformedValue(e,t),setComponentProperty(this,r,t))}},getTransformedValue:{value:function(e,t){return this.transforms&&this.transforms[e]?this.transforms[e].bind(this)(t):t}}})});return primitives[e]=r,r};
},{"../../core/a-entity":55,"../../core/a-register-element":58,"../../core/component":59,"../../utils/":120}],75:[function(_dereq_,module,exports){
var registerPrimitive=_dereq_("../primitives").registerPrimitive;registerPrimitive("a-camera",{defaultComponents:{camera:{userHeight:1.6},"look-controls":{},"wasd-controls":{}},mappings:{active:"camera.active",far:"camera.far",fov:"camera.fov","look-controls-enabled":"look-controls.enabled",near:"camera.near","wasd-controls-enabled":"wasd-controls.enabled","user-height":"camera.userHeight",zoom:"camera.zoom"},deprecatedMappings:{"cursor-color":"a-camera[cursor-color] has been removed. Use a-cursor[color] instead.","cursor-maxdistance":"a-camera[cursor-maxdistance] has been removed. Use a-cursor[max-distance] instead.","cursor-offset":"a-camera[cursor-offset] has been removed. Use a-cursor[position] instead.","cursor-opacity":"a-camera[cursor-offset] has been removed. Use a-cursor[opacity] instead.","cursor-scale":"a-camera[cursor-scale] has been removed. Use a-cursor[scale] instead.","cursor-visible":"a-camera[cursor-visible] has been removed. Use a-cursor[visible] instead."}});
},{"../primitives":74}],76:[function(_dereq_,module,exports){
var getMeshMixin=_dereq_("../getMeshMixin"),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-collada-model",utils.extendDeep({},getMeshMixin(),{mappings:{src:"collada-model"}}));
},{"../../../utils/":120,"../getMeshMixin":72,"../primitives":74}],77:[function(_dereq_,module,exports){
var getMeshMixin=_dereq_("../getMeshMixin"),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-cursor",utils.extendDeep({},getMeshMixin(),{defaultComponents:{cursor:{},geometry:{primitive:"ring",radiusOuter:.016,radiusInner:.01,segmentsTheta:64},material:{color:"#000",shader:"flat",opacity:.8},position:{x:0,y:0,z:-1},raycaster:{far:1e3}},mappings:{far:"raycaster.far",fuse:"cursor.fuse",interval:"raycaster.interval",objects:"raycaster.objects","fuse-timeout":"cursor.fuseTimeout"}}));
},{"../../../utils/":120,"../getMeshMixin":72,"../primitives":74}],78:[function(_dereq_,module,exports){
var getMeshMixin=_dereq_("../getMeshMixin"),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-curvedimage",utils.extendDeep({},getMeshMixin(),{defaultComponents:{geometry:{height:1,primitive:"cylinder",radius:2,segmentsRadial:48,thetaLength:270,openEnded:!0,thetaStart:0},material:{color:"#FFF",shader:"flat",side:"double",transparent:!0,repeat:"-1 1"}},mappings:{height:"geometry.height","open-ended":"geometry.openEnded",radius:"geometry.radius",segments:"geometry.segmentsRadial",start:"geometry.thetaStart","theta-length":"geometry.thetaLength","theta-start":"geometry.thetaStart",width:"geometry.thetaLength"}}));
},{"../../../utils/":120,"../getMeshMixin":72,"../primitives":74}],79:[function(_dereq_,module,exports){
var getMeshMixin=_dereq_("../getMeshMixin"),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-image",utils.extendDeep({},getMeshMixin(),{defaultComponents:{geometry:{primitive:"plane"},material:{color:"#FFF",shader:"flat",side:"double",transparent:!0}},mappings:{height:"geometry.height",width:"geometry.width"}}));
},{"../../../utils/":120,"../getMeshMixin":72,"../primitives":74}],80:[function(_dereq_,module,exports){
var registerPrimitive=_dereq_("../primitives").registerPrimitive;registerPrimitive("a-light",{defaultComponents:{light:{}},mappings:{angle:"light.angle",color:"light.color","ground-color":"light.groundColor",decay:"light.decay",distance:"light.distance",intensity:"light.intensity",penumbra:"light.penumbra",type:"light.type",target:"light.target"}});
},{"../primitives":74}],81:[function(_dereq_,module,exports){
var meshMixin=_dereq_("../getMeshMixin")(),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-obj-model",utils.extendDeep({},meshMixin,{mappings:{src:"obj-model.obj",mtl:"obj-model.mtl"},transforms:{mtl:meshMixin.transforms.src}}));
},{"../../../utils/":120,"../getMeshMixin":72,"../primitives":74}],82:[function(_dereq_,module,exports){
var getMeshMixin=_dereq_("../getMeshMixin"),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-sky",utils.extendDeep({},getMeshMixin(),{defaultComponents:{geometry:{primitive:"sphere",radius:5e3,segmentsWidth:64,segmentsHeight:20},material:{color:"#FFF",shader:"flat"},scale:"-1 1 1"},mappings:{radius:"geometry.radius","segments-width":"geometry.segmentsWidth","segments-height":"geometry.segmentsHeight"}}));
},{"../../../utils/":120,"../getMeshMixin":72,"../primitives":74}],83:[function(_dereq_,module,exports){
var registerPrimitive=_dereq_("../primitives").registerPrimitive;registerPrimitive("a-sound",{defaultComponents:{sound:{}},mappings:{src:"sound.src",on:"sound.on",autoplay:"sound.autoplay",loop:"sound.loop",volume:"sound.volume"}});
},{"../primitives":74}],84:[function(_dereq_,module,exports){
var getMeshMixin=_dereq_("../getMeshMixin"),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-video",utils.extendDeep({},getMeshMixin(),{defaultComponents:{geometry:{primitive:"plane"},material:{color:"#FFF",shader:"flat",side:"double",transparent:!0}},mappings:{height:"geometry.height",width:"geometry.width"}}));
},{"../../../utils/":120,"../getMeshMixin":72,"../primitives":74}],85:[function(_dereq_,module,exports){
var getMeshMixin=_dereq_("../getMeshMixin"),registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/");registerPrimitive("a-videosphere",utils.extendDeep({},getMeshMixin(),{defaultComponents:{geometry:{primitive:"sphere",radius:5e3,segmentsWidth:64,segmentsHeight:20},material:{color:"#FFF",shader:"flat"},scale:"-1 1 1"},mappings:{radius:"geometry.radius","segments-height":"geometry.segmentsHeight","segments-width":"geometry.segmentsWidth"}}));
},{"../../../utils/":120,"../getMeshMixin":72,"../primitives":74}],86:[function(_dereq_,module,exports){
function unCamelCase(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}var getMeshMixin=_dereq_("../getMeshMixin"),geometries=_dereq_("../../../core/geometry").geometries,geometryNames=_dereq_("../../../core/geometry").geometryNames,registerPrimitive=_dereq_("../primitives").registerPrimitive,utils=_dereq_("../../../utils/"),meshPrimitives=module.exports={};geometryNames.forEach(function(e){var i=geometries[e],r=unCamelCase(e),t={};Object.keys(i.schema).forEach(function(e){t[unCamelCase(e)]="geometry."+e});var m="a-"+r,s=registerPrimitive(m,utils.extendDeep({},getMeshMixin(),{defaultComponents:{geometry:{primitive:e}},mappings:t}));meshPrimitives[m]=s});
},{"../../../core/geometry":60,"../../../utils/":120,"../getMeshMixin":72,"../primitives":74}],87:[function(_dereq_,module,exports){
var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("box",{schema:{depth:{default:1,min:0},height:{default:1,min:0},width:{default:1,min:0},segmentsHeight:{default:1,min:1,max:20,type:"int"},segmentsWidth:{default:1,min:1,max:20,type:"int"},segmentsDepth:{default:1,min:1,max:20,type:"int"}},init:function(e){this.geometry=new THREE.BoxGeometry(e.width,e.height,e.depth)}});
},{"../core/geometry":60,"../lib/three":103}],88:[function(_dereq_,module,exports){
var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad;registerGeometry("circle",{schema:{radius:{default:1,min:0},segments:{default:32,min:3,type:"int"},thetaLength:{default:360,min:0},thetaStart:{default:0}},init:function(e){this.geometry=new THREE.CircleGeometry(e.radius,e.segments,degToRad(e.thetaStart),degToRad(e.thetaLength))}});
},{"../core/geometry":60,"../lib/three":103}],89:[function(_dereq_,module,exports){
var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad;registerGeometry("cone",{schema:{height:{default:1,min:0},openEnded:{default:!1},radiusBottom:{default:1,min:0},radiusTop:{default:.8,min:0},segmentsHeight:{default:18,min:1,type:"int"},segmentsRadial:{default:36,min:3,type:"int"},thetaLength:{default:360,min:0},thetaStart:{default:0}},init:function(e){this.geometry=new THREE.CylinderGeometry(e.radiusTop,e.radiusBottom,e.height,e.segmentsRadial,e.segmentsHeight,e.openEnded,degToRad(e.thetaStart),degToRad(e.thetaLength))}});
},{"../core/geometry":60,"../lib/three":103}],90:[function(_dereq_,module,exports){
var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad;registerGeometry("cylinder",{schema:{height:{default:1,min:0},openEnded:{default:!1},radius:{default:1,min:0},segmentsHeight:{default:18,min:1,type:"int"},segmentsRadial:{default:36,min:3,type:"int"},thetaLength:{default:360,min:0},thetaStart:{default:0}},init:function(e){this.geometry=new THREE.CylinderGeometry(e.radius,e.radius,e.height,e.segmentsRadial,e.segmentsHeight,e.openEnded,degToRad(e.thetaStart),degToRad(e.thetaLength))}});
},{"../core/geometry":60,"../lib/three":103}],91:[function(_dereq_,module,exports){
var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("dodecahedron",{schema:{detail:{default:0,min:0,max:5,type:"int"},radius:{default:1,min:0}},init:function(e){this.geometry=new THREE.DodecahedronGeometry(e.radius,e.detail)}});
},{"../core/geometry":60,"../lib/three":103}],92:[function(_dereq_,module,exports){
var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("icosahedron",{schema:{detail:{default:0,min:0,max:5,type:"int"},radius:{default:1,min:0}},init:function(e){this.geometry=new THREE.IcosahedronGeometry(e.radius,e.detail)}});
},{"../core/geometry":60,"../lib/three":103}],93:[function(_dereq_,module,exports){
_dereq_("./box.js"),_dereq_("./circle.js"),_dereq_("./cone.js"),_dereq_("./cylinder.js"),_dereq_("./dodecahedron.js"),_dereq_("./icosahedron.js"),_dereq_("./octahedron.js"),_dereq_("./plane.js"),_dereq_("./ring.js"),_dereq_("./sphere.js"),_dereq_("./tetrahedron.js"),_dereq_("./torus.js"),_dereq_("./torusKnot.js");
},{"./box.js":87,"./circle.js":88,"./cone.js":89,"./cylinder.js":90,"./dodecahedron.js":91,"./icosahedron.js":92,"./octahedron.js":94,"./plane.js":95,"./ring.js":96,"./sphere.js":97,"./tetrahedron.js":98,"./torus.js":99,"./torusKnot.js":100}],94:[function(_dereq_,module,exports){
var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("octahedron",{schema:{detail:{default:0,min:0,max:5,type:"int"},radius:{default:1,min:0}},init:function(e){this.geometry=new THREE.OctahedronGeometry(e.radius,e.detail)}});
},{"../core/geometry":60,"../lib/three":103}],95:[function(_dereq_,module,exports){
var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("plane",{schema:{height:{default:1,min:0},width:{default:1,min:0},segmentsHeight:{default:1,min:1,max:20,type:"int"},segmentsWidth:{default:1,min:1,max:20,type:"int"}},init:function(e){this.geometry=new THREE.PlaneGeometry(e.width,e.height)}});
},{"../core/geometry":60,"../lib/three":103}],96:[function(_dereq_,module,exports){
var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad;registerGeometry("ring",{schema:{radiusInner:{default:.8,min:0},radiusOuter:{default:1.2,min:0},segmentsPhi:{default:10,min:1,type:"int"},segmentsTheta:{default:32,min:3,type:"int"},thetaLength:{default:360,min:0},thetaStart:{default:0}},init:function(e){this.geometry=new THREE.RingGeometry(e.radiusInner,e.radiusOuter,e.segmentsTheta,e.segmentsPhi,degToRad(e.thetaStart),degToRad(e.thetaLength))}});
},{"../core/geometry":60,"../lib/three":103}],97:[function(_dereq_,module,exports){
var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad;registerGeometry("sphere",{schema:{radius:{default:1,min:0},phiLength:{default:360},phiStart:{default:0,min:0},thetaLength:{default:180,min:0},thetaStart:{default:0},segmentsHeight:{default:18,min:2,type:"int"},segmentsWidth:{default:36,min:3,type:"int"}},init:function(e){this.geometry=new THREE.SphereGeometry(e.radius,e.segmentsWidth,e.segmentsHeight,degToRad(e.phiStart),degToRad(e.phiLength),degToRad(e.thetaStart),degToRad(e.thetaLength))}});
},{"../core/geometry":60,"../lib/three":103}],98:[function(_dereq_,module,exports){
var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("tetrahedron",{schema:{detail:{default:0,min:0,max:5,type:"int"},radius:{default:1,min:0}},init:function(e){this.geometry=new THREE.TetrahedronGeometry(e.radius,e.detail)}});
},{"../core/geometry":60,"../lib/three":103}],99:[function(_dereq_,module,exports){
var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three"),degToRad=THREE.Math.degToRad;registerGeometry("torus",{schema:{arc:{default:360},radius:{default:1,min:0},radiusTubular:{default:.2,min:0},segmentsRadial:{default:36,min:2,type:"int"},segmentsTubular:{default:32,min:3,type:"int"}},init:function(e){this.geometry=new THREE.TorusGeometry(e.radius,2*e.radiusTubular,e.segmentsRadial,e.segmentsTubular,degToRad(e.arc))}});
},{"../core/geometry":60,"../lib/three":103}],100:[function(_dereq_,module,exports){
var registerGeometry=_dereq_("../core/geometry").registerGeometry,THREE=_dereq_("../lib/three");registerGeometry("torusKnot",{schema:{p:{default:2,min:1},q:{default:3,min:1},radius:{default:1,min:0},radiusTubular:{default:.2,min:0},segmentsRadial:{default:8,min:3,type:"int"},segmentsTubular:{default:100,min:3,type:"int"}},init:function(e){this.geometry=new THREE.TorusKnotGeometry(e.radius,2*e.radiusTubular,e.segmentsTubular,e.segmentsRadial,e.p,e.q)}});
},{"../core/geometry":60,"../lib/three":103}],101:[function(_dereq_,module,exports){
window.Promise=window.Promise||_dereq_("promise-polyfill"),window.hasNativeWebVRImplementation=!!navigator.getVRDisplays||!!navigator.getVRDevices,window.WebVRConfig=window.WebVRConfig||{BUFFER_SCALE:1,CARDBOARD_UI_DISABLED:!0,ROTATE_INSTRUCTIONS_DISABLED:!0,TOUCH_PANNER_DISABLED:!0,MOUSE_KEYBOARD_CONTROLS_DISABLED:!0},/(iphone|ipod|ipad).*os.*(7|8|9)/i.test(navigator.userAgent)&&(window.WebVRConfig.BUFFER_SCALE=1/window.devicePixelRatio),_dereq_("webvr-polyfill"),_dereq_("present"),_dereq_("./style/aframe.css"),_dereq_("./style/rStats.css");var AScene=_dereq_("./core/scene/a-scene"),components=_dereq_("./core/component").components,registerComponent=_dereq_("./core/component").registerComponent,registerGeometry=_dereq_("./core/geometry").registerGeometry,registerPrimitive=_dereq_("./extras/primitives/primitives").registerPrimitive,registerShader=_dereq_("./core/shader").registerShader,registerSystem=_dereq_("./core/system").registerSystem,shaders=_dereq_("./core/shader").shaders,systems=_dereq_("./core/system").systems,THREE=window.THREE=_dereq_("./lib/three"),TWEEN=window.TWEEN=_dereq_("tween.js"),pkg=_dereq_("../package"),utils=_dereq_("./utils/");_dereq_("./components/index"),_dereq_("./geometries/index"),_dereq_("./shaders/index"),_dereq_("./systems/index");var ANode=_dereq_("./core/a-node"),AEntity=_dereq_("./core/a-entity");_dereq_("./core/a-animation"),_dereq_("./core/a-assets"),_dereq_("./core/a-cubemap"),_dereq_("./core/a-mixin"),_dereq_("./extras/components/"),_dereq_("./extras/declarative-events/"),_dereq_("./extras/primitives/"),console.log("A-Frame Version:",pkg.version),console.log("three Version:",pkg.dependencies.three),console.log("WebVR Polyfill Version:",pkg.dependencies["webvr-polyfill"]),module.exports=window.AFRAME={AEntity:AEntity,ANode:ANode,AScene:AScene,components:components,geometries:_dereq_("./core/geometry").geometries,registerComponent:registerComponent,registerElement:_dereq_("./core/a-register-element").registerElement,registerGeometry:registerGeometry,registerPrimitive:registerPrimitive,registerShader:registerShader,registerSystem:registerSystem,primitives:{getMeshMixin:_dereq_("./extras/primitives/getMeshMixin"),primitives:_dereq_("./extras/primitives/primitives").primitives},schema:_dereq_("./core/schema"),shaders:shaders,systems:systems,THREE:THREE,TWEEN:TWEEN,utils:utils,version:pkg.version};
},{"../package":20,"./components/index":27,"./core/a-animation":52,"./core/a-assets":53,"./core/a-cubemap":54,"./core/a-entity":55,"./core/a-mixin":56,"./core/a-node":57,"./core/a-register-element":58,"./core/component":59,"./core/geometry":60,"./core/scene/a-scene":62,"./core/schema":66,"./core/shader":67,"./core/system":68,"./extras/components/":69,"./extras/declarative-events/":71,"./extras/primitives/":73,"./extras/primitives/getMeshMixin":72,"./extras/primitives/primitives":74,"./geometries/index":93,"./lib/three":103,"./shaders/index":105,"./style/aframe.css":107,"./style/rStats.css":108,"./systems/index":111,"./utils/":120,"present":10,"promise-polyfill":11,"tween.js":18,"webvr-polyfill":19}],102:[function(_dereq_,module,exports){
window.aframeStats=function(t){function e(){i("te").set(n()),i("lt").set(window.performance.getEntriesByName("render-started")[0].startTime.toFixed(0))}function n(){var t=u.querySelectorAll("*");return Array.prototype.slice.call(t).filter(function(t){return t.isEntity}),t.length}function a(){}function r(){}function o(t){i=t}var i=null,u=t,c={te:{caption:"Entities"},lt:{caption:"Load Time"}},l=[{caption:"A-Frame",values:["te","lt"]}];return{update:e,start:a,end:r,attach:o,values:c,groups:l,fractions:[]}},"object"==typeof module&&(module.exports={aframeStats:window.aframeStats});
},{}],103:[function(_dereq_,module,exports){
(function (global){
var THREE=global.THREE=_dereq_("three");THREE.TextureLoader&&(THREE.TextureLoader.prototype.crossOrigin="anonymous"),THREE.ImageLoader&&(THREE.ImageLoader.prototype.crossOrigin="anonymous"),THREE.Cache&&(THREE.Cache.enabled=!0),_dereq_("three/examples/js/loaders/OBJLoader"),_dereq_("three/examples/js/loaders/MTLLoader"),_dereq_("three/examples/js/BlendCharacter"),_dereq_("three/examples/js/loaders/ColladaLoader"),_dereq_("../../vendor/VRControls"),_dereq_("../../vendor/VREffect"),THREE.ColladaLoader.prototype.crossOrigin="anonymous",THREE.MTLLoader.prototype.crossOrigin="anonymous",THREE.OBJLoader.prototype.crossOrigin="anonymous",module.exports=THREE;
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../../vendor/VRControls":124,"../../vendor/VREffect":125,"three":17,"three/examples/js/BlendCharacter":13,"three/examples/js/loaders/ColladaLoader":14,"three/examples/js/loaders/MTLLoader":15,"three/examples/js/loaders/OBJLoader":16}],104:[function(_dereq_,module,exports){
function getMaterialData(e){return{fog:e.fog,color:new THREE.Color(e.color)}}var registerShader=_dereq_("../core/shader").registerShader,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/");module.exports.Component=registerShader("flat",{schema:{color:{type:"color"},fog:{default:!0},height:{default:256},repeat:{default:""},src:{default:""},width:{default:512}},init:function(e){this.textureSrc=null,this.material=new THREE.MeshBasicMaterial(getMaterialData(e)),utils.material.updateMap(this,e)},update:function(e){this.updateMaterial(e),utils.material.updateMap(this,e)},updateMaterial:function(e){var t=this.material;e=getMaterialData(e),Object.keys(e).forEach(function(a){t[a]=e[a]})}});
},{"../core/shader":67,"../lib/three":103,"../utils/":120}],105:[function(_dereq_,module,exports){
_dereq_("./flat"),_dereq_("./standard");
},{"./flat":104,"./standard":106}],106:[function(_dereq_,module,exports){
function getMaterialData(e){return{color:new THREE.Color(e.color),fog:e.fog,metalness:e.metalness,roughness:e.roughness}}var registerShader=_dereq_("../core/shader").registerShader,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),CubeLoader=new THREE.CubeTextureLoader,texturePromises={};module.exports.Component=registerShader("standard",{schema:{color:{type:"color"},envMap:{default:""},fog:{default:!0},height:{default:256},metalness:{default:0,min:0,max:1},repeat:{default:""},roughness:{default:.5,min:0,max:1},src:{default:""},width:{default:512}},init:function(e){this.material=new THREE.MeshStandardMaterial(getMaterialData(e)),utils.material.updateMap(this,e),this.updateEnvMap(e)},update:function(e){this.updateMaterial(e),utils.material.updateMap(this,e),this.updateEnvMap(e)},updateMaterial:function(e){var a=this.material;e=getMaterialData(e),Object.keys(e).forEach(function(t){a[t]=e[t]})},updateEnvMap:function(e){var a=this,t=this.material,i=e.envMap;return!i||this.isLoadingEnvMap?(t.envMap=null,void(t.needsUpdate=!0)):(this.isLoadingEnvMap=!0,texturePromises[i]?void texturePromises[i].then(function(e){a.isLoadingEnvMap=!1,t.envMap=e,t.needsUpdate=!0}):void(texturePromises[i]=new Promise(function(e){utils.srcLoader.validateCubemapSrc(i,function(i){CubeLoader.load(i,function(i){a.isLoadingEnvMap=!1,t.envMap=i,e(i)})})})))}});
},{"../core/shader":67,"../lib/three":103,"../utils/":120}],107:[function(_dereq_,module,exports){
var css = ".a-html{bottom:0;left:0;position:fixed;right:0;top:0}.a-body{height:100%;margin:0;overflow:hidden;padding:0;width:100%}:-webkit-full-screen{background-color:transparent}.a-hidden{display:none!important}.a-canvas{height:100%;left:0;position:absolute;top:0;width:100%}.a-canvas.a-grab-cursor:hover{cursor:grab;cursor:-moz-grabbing;cursor:-webkit-grab}.a-canvas.a-grab-cursor:active,.a-grabbing{cursor:grabbing;cursor:-moz-grabbing;cursor:-webkit-grabbing}// Class is removed when doing <a-scene embedded>. .a-canvas.fullscreen{width:100%!important;height:100%!important;top:0!important;left:0!important;right:0!important;bottom:0!important;z-index:999999!important;position:fixed!important}a-scene{display:block;position:relative;height:100%;width:100%}a-assets,a-scene audio,a-scene img,a-scene video{display:none}.a-enter-vr-modal,.a-orientation-modal{font-family:Consolas,Andale Mono,Courier New,monospace}.a-enter-vr-modal a{border-bottom:1px solid #fff;padding:2px 0;text-decoration:none;transition:.1s color ease-in}.a-enter-vr-modal a:hover{background-color:#fff;color:#111;padding:2px 4px;position:relative;left:-4px}.a-enter-vr{font-family:sans-serif,monospace;font-size:13px;width:100%;font-weight:200;line-height:16px;height:10%;position:absolute;right:20px;bottom:20px}.a-enter-vr.embedded{right:5px;bottom:5px}.a-enter-vr-button,.a-enter-vr-modal,.a-enter-vr-modal a{color:#fff}.a-enter-vr-button{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20245.82%20141.73%22%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill%3A%23fff%3Bfill-rule%3Aevenodd%3B%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Ctitle%3Emask%3C%2Ftitle%3E%3Cpath%20class%3D%22a%22%20d%3D%22M175.56%2C111.37c-22.52%2C0-40.77-18.84-40.77-42.07S153%2C27.24%2C175.56%2C27.24s40.77%2C18.84%2C40.77%2C42.07S198.08%2C111.37%2C175.56%2C111.37ZM26.84%2C69.31c0-23.23%2C18.25-42.07%2C40.77-42.07s40.77%2C18.84%2C40.77%2C42.07-18.26%2C42.07-40.77%2C42.07S26.84%2C92.54%2C26.84%2C69.31ZM27.27%2C0C11.54%2C0%2C0%2C12.34%2C0%2C28.58V110.9c0%2C16.24%2C11.54%2C30.83%2C27.27%2C30.83H99.57c2.17%2C0%2C4.19-1.83%2C5.4-3.7L116.47%2C118a8%2C8%2C0%2C0%2C1%2C12.52-.18l11.51%2C20.34c1.2%2C1.86%2C3.22%2C3.61%2C5.39%2C3.61h72.29c15.74%2C0%2C27.63-14.6%2C27.63-30.83V28.58C245.82%2C12.34%2C233.93%2C0%2C218.19%2C0H27.27Z%22%2F%3E%3C%2Fsvg%3E) 50% 50%/70% 70% no-repeat rgba(0,0,0,.35);border:0;bottom:0;cursor:pointer;min-width:50px;min-height:30px;padding-right:5%;padding-top:4%;position:absolute;right:0;transition:background-color .05s ease;-webkit-transition:background-color .05s ease;z-index:9999}.a-enter-vr-button:active,.a-enter-vr-button:hover{background-color:#666}[data-a-enter-vr-no-webvr] .a-enter-vr-button{border-color:#666;opacity:.65}[data-a-enter-vr-no-webvr] .a-enter-vr-button:active,[data-a-enter-vr-no-webvr] .a-enter-vr-button:hover{background-color:rgba(0,0,0,.35);cursor:not-allowed}.a-enter-vr-modal{background-color:#666;border-radius:0;display:none;min-height:32px;margin-right:70px;padding:9px;width:280px;right:2%;position:absolute}.a-enter-vr-modal:after{border-bottom:10px solid transparent;border-left:10px solid #666;border-top:10px solid transparent;display:inline-block;content:'';position:absolute;right:-5px;top:5px;width:0;height:0}.a-enter-vr-modal a,.a-enter-vr-modal p{display:inline}.a-enter-vr-modal p{margin:0}.a-enter-vr-modal p:after{content:' '}[data-a-enter-vr-no-headset].a-enter-vr:hover .a-enter-vr-modal,[data-a-enter-vr-no-webvr].a-enter-vr:hover .a-enter-vr-modal{display:block}.a-orientation-modal{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20version%3D%221.1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%2090%2090%22%20enable-background%3D%22new%200%200%2090%2090%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%220%2C0%200%2C0%200%2C0%20%22%3E%3C/polygon%3E%3Cg%3E%3Cpath%20d%3D%22M71.545%2C48.145h-31.98V20.743c0-2.627-2.138-4.765-4.765-4.765H18.456c-2.628%2C0-4.767%2C2.138-4.767%2C4.765v42.789%20%20%20c0%2C2.628%2C2.138%2C4.766%2C4.767%2C4.766h5.535v0.959c0%2C2.628%2C2.138%2C4.765%2C4.766%2C4.765h42.788c2.628%2C0%2C4.766-2.137%2C4.766-4.765V52.914%20%20%20C76.311%2C50.284%2C74.173%2C48.145%2C71.545%2C48.145z%20M18.455%2C16.935h16.344c2.1%2C0%2C3.808%2C1.708%2C3.808%2C3.808v27.401H37.25V22.636%20%20%20c0-0.264-0.215-0.478-0.479-0.478H16.482c-0.264%2C0-0.479%2C0.214-0.479%2C0.478v36.585c0%2C0.264%2C0.215%2C0.478%2C0.479%2C0.478h7.507v7.644%20%20%20h-5.534c-2.101%2C0-3.81-1.709-3.81-3.81V20.743C14.645%2C18.643%2C16.354%2C16.935%2C18.455%2C16.935z%20M16.96%2C23.116h19.331v25.031h-7.535%20%20%20c-2.628%2C0-4.766%2C2.139-4.766%2C4.768v5.828h-7.03V23.116z%20M71.545%2C73.064H28.757c-2.101%2C0-3.81-1.708-3.81-3.808V52.914%20%20%20c0-2.102%2C1.709-3.812%2C3.81-3.812h42.788c2.1%2C0%2C3.809%2C1.71%2C3.809%2C3.812v16.343C75.354%2C71.356%2C73.645%2C73.064%2C71.545%2C73.064z%22%3E%3C/path%3E%3Cpath%20d%3D%22M28.919%2C58.424c-1.466%2C0-2.659%2C1.193-2.659%2C2.66c0%2C1.466%2C1.193%2C2.658%2C2.659%2C2.658c1.468%2C0%2C2.662-1.192%2C2.662-2.658%20%20%20C31.581%2C59.617%2C30.387%2C58.424%2C28.919%2C58.424z%20M28.919%2C62.786c-0.939%2C0-1.703-0.764-1.703-1.702c0-0.939%2C0.764-1.704%2C1.703-1.704%20%20%20c0.94%2C0%2C1.705%2C0.765%2C1.705%2C1.704C30.623%2C62.022%2C29.858%2C62.786%2C28.919%2C62.786z%22%3E%3C/path%3E%3Cpath%20d%3D%22M69.654%2C50.461H33.069c-0.264%2C0-0.479%2C0.215-0.479%2C0.479v20.288c0%2C0.264%2C0.215%2C0.478%2C0.479%2C0.478h36.585%20%20%20c0.263%2C0%2C0.477-0.214%2C0.477-0.478V50.939C70.131%2C50.676%2C69.917%2C50.461%2C69.654%2C50.461z%20M69.174%2C51.417V70.75H33.548V51.417H69.174z%22%3E%3C/path%3E%3Cpath%20d%3D%22M45.201%2C30.296c6.651%2C0%2C12.233%2C5.351%2C12.551%2C11.977l-3.033-2.638c-0.193-0.165-0.507-0.142-0.675%2C0.048%20%20%20c-0.174%2C0.198-0.153%2C0.501%2C0.045%2C0.676l3.883%2C3.375c0.09%2C0.075%2C0.198%2C0.115%2C0.312%2C0.115c0.141%2C0%2C0.273-0.061%2C0.362-0.166%20%20%20l3.371-3.877c0.173-0.2%2C0.151-0.502-0.047-0.675c-0.194-0.166-0.508-0.144-0.676%2C0.048l-2.592%2C2.979%20%20%20c-0.18-3.417-1.629-6.605-4.099-9.001c-2.538-2.461-5.877-3.817-9.404-3.817c-0.264%2C0-0.479%2C0.215-0.479%2C0.479%20%20%20C44.72%2C30.083%2C44.936%2C30.296%2C45.201%2C30.296z%22%3E%3C/path%3E%3C/g%3E%3C/svg%3E) center/50% 50% no-repeat rgba(244,244,244,1);bottom:0;font-size:14px;font-weight:600;left:0;line-height:20px;right:0;position:fixed;top:0;z-index:9999999}.a-orientation-modal:after{color:#666;content:\"Insert phone into Cardboard holder.\";display:block;position:absolute;text-align:center;top:70%;transform:translateY(-70%);width:100%}.a-orientation-modal button{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20version%3D%221.1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20100%20100%22%20enable-background%3D%22new%200%200%20100%20100%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23000000%22%20d%3D%22M55.209%2C50l17.803-17.803c1.416-1.416%2C1.416-3.713%2C0-5.129c-1.416-1.417-3.713-1.417-5.129%2C0L50.08%2C44.872%20%20L32.278%2C27.069c-1.416-1.417-3.714-1.417-5.129%2C0c-1.417%2C1.416-1.417%2C3.713%2C0%2C5.129L44.951%2C50L27.149%2C67.803%20%20c-1.417%2C1.416-1.417%2C3.713%2C0%2C5.129c0.708%2C0.708%2C1.636%2C1.062%2C2.564%2C1.062c0.928%2C0%2C1.856-0.354%2C2.564-1.062L50.08%2C55.13l17.803%2C17.802%20%20c0.708%2C0.708%2C1.637%2C1.062%2C2.564%2C1.062s1.856-0.354%2C2.564-1.062c1.416-1.416%2C1.416-3.713%2C0-5.129L55.209%2C50z%22%3E%3C/path%3E%3C/svg%3E) no-repeat;border:none;height:50px;text-indent:-9999px;width:50px}"; (_dereq_("browserify-css").createStyle(css, { "href": "src/style/aframe.css"})); module.exports = css;
},{"browserify-css":1}],108:[function(_dereq_,module,exports){
var css = ".rs-base{background-color:#333;border-radius:0;font:10px monospace;left:5px;line-height:1em;opacity:.85;overflow:hidden;padding:10px;position:fixed;top:5px;width:300px;z-index:10000}.rs-base div.hidden{display:none}.rs-base h1{color:#fff;cursor:pointer;font-size:1.4em;font-weight:300;margin:0 0 5px;padding:0}.rs-group{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column-reverse;flex-direction:column-reverse;margin-bottom:5px}.rs-group:last-child{margin-bottom:0}.rs-counter-base{align-items:center;display:-webkit-box;display:-webkit-flex;display:flex;height:10px;-webkit-justify-content:space-between;justify-content:space-between;margin:2px 0}.rs-counter-id{font-weight:300;-webkit-box-ordinal-group:0;-webkit-order:0;order:0;width:54px}.rs-counter-value{font-weight:300;-webkit-box-ordinal-group:1;-webkit-order:1;order:1;text-align:right;width:35px}.rs-canvas{-webkit-box-ordinal-group:2;-webkit-order:2;order:2}@media (min-width:480px){.rs-base{left:20px;top:20px}}"; (_dereq_("browserify-css").createStyle(css, { "href": "src/style/rStats.css"})); module.exports = css;
},{"browserify-css":1}],109:[function(_dereq_,module,exports){
function removeDefaultCamera(e){var t,a=e.camera;a&&(t=e.querySelector("["+DEFAULT_CAMERA_ATTR+"]"),t&&e.removeChild(t))}var constants=_dereq_("../constants/"),registerSystem=_dereq_("../core/system").registerSystem,DEFAULT_CAMERA_ATTR="data-aframe-default-camera",DEFAULT_USER_HEIGHT=1.6;module.exports.System=registerSystem("camera",{init:function(){this.activeCameraEl=null,this.sceneEl.addEventListener("loaded",this.setupDefaultCamera.bind(this))},setupDefaultCamera:function(){var e,t=this.sceneEl;return t.camera?void t.emit("camera-ready",{cameraEl:t.camera.el}):(e=document.createElement("a-entity"),e.setAttribute("position","0 0 0"),e.setAttribute(DEFAULT_CAMERA_ATTR,""),e.setAttribute("camera",{active:!0,userHeight:DEFAULT_USER_HEIGHT}),e.setAttribute("wasd-controls",""),e.setAttribute("look-controls",""),e.setAttribute(constants.AFRAME_INJECTED,""),t.appendChild(e),t.addEventListener("enter-vr",this.removeDefaultOffset),t.addEventListener("exit-vr",this.addDefaultOffset),void t.emit("camera-ready",{cameraEl:e}))},disableActiveCamera:function(){var e=this.sceneEl.querySelectorAll("[camera]"),t=e[e.length-1];t.setAttribute("camera","active",!0)},setActiveCamera:function(e){var t,a,r,i,s=this.activeCameraEl,c=this.sceneEl;if(i=e.getObject3D("camera"),i&&e!==this.activeCameraEl){var m=c.querySelector("["+DEFAULT_CAMERA_ATTR+"]"),l=m&&m.querySelector("[camera]");for(e!==l&&removeDefaultCamera(c),this.activeCameraEl=e,this.activeCameraEl.play(),c.camera=i,s&&s.setAttribute("camera","active",!1),a=c.querySelectorAll("[camera]"),r=0;r<a.length;r++)t=a[r],e!==t&&(t.setAttribute("camera","active",!1),t.pause());c.emit("camera-set-active",{cameraEl:e})}}});
},{"../constants/":51,"../core/system":68}],110:[function(_dereq_,module,exports){
function createGeometry(e){var t=e.primitive,r=geometries[t]&&geometries[t].Geometry,o=new r;if(!r)throw new Error("Unknown geometry `"+t+"`");return o.init(e),toBufferGeometry(o.geometry,e.buffer)}function decrementCacheCount(e,t){e[t]--}function incrementCacheCount(e,t){e[t]=void 0===e[t]?1:e[t]+1}function toBufferGeometry(e,t){var r;return t?(r=(new THREE.BufferGeometry).fromGeometry(e),r.metadata={type:e.type,parameters:e.parameters||{}},e.dispose(),r):e}var geometries=_dereq_("../core/geometry").geometries,registerSystem=_dereq_("../core/system").registerSystem,THREE=_dereq_("../lib/three");module.exports.System=registerSystem("geometry",{init:function(){this.cache={},this.cacheCount={}},clearCache:function(){this.cache={},this.cacheCount={}},getOrCreateGeometry:function(e){var t,r,o=this.cache;return e.skipCache?createGeometry(e):(r=this.hash(e),t=o[r],incrementCacheCount(this.cacheCount,r),t?t:(t=createGeometry(e),o[r]=t,t))},unuseGeometry:function(e){var t,r,o=this.cache,i=this.cacheCount;e.skipCache||(r=this.hash(e),o[r]&&(decrementCacheCount(i,r),i[r]>0||(t=o[r],t.dispose(),delete o[r],delete i[r])))},hash:function(e){return JSON.stringify(e)}});
},{"../core/geometry":60,"../core/system":68,"../lib/three":103}],111:[function(_dereq_,module,exports){
_dereq_("./camera"),_dereq_("./geometry"),_dereq_("./light"),_dereq_("./material"),_dereq_("./tracked-controls");
},{"./camera":109,"./geometry":110,"./light":112,"./material":113,"./tracked-controls":114}],112:[function(_dereq_,module,exports){
var registerSystem=_dereq_("../core/system").registerSystem,constants=_dereq_("../constants/"),DEFAULT_LIGHT_ATTR="data-aframe-default-light";module.exports.System=registerSystem("light",{init:function(){this.defaultLights=!1,this.userDefinedLights=!1,this.sceneEl.addEventListener("loaded",this.setupDefaultLights.bind(this))},registerLight:function(t){t.hasAttribute(DEFAULT_LIGHT_ATTR)||(this.removeDefaultLights(),this.userDefinedLights=!0)},removeDefaultLights:function(){var t,e=this.sceneEl;if(this.defaultLights){t=document.querySelectorAll("["+DEFAULT_LIGHT_ATTR+"]");for(var i=0;i<t.length;i++)e.removeChild(t[i]);this.defaultLights=!1}},setupDefaultLights:function(){var t,e,i=this.sceneEl;this.userDefinedLights||this.defaultLights||(t=document.createElement("a-entity"),e=document.createElement("a-entity"),t.setAttribute("light",{color:"#BBB",type:"ambient"}),t.setAttribute(DEFAULT_LIGHT_ATTR,""),t.setAttribute(constants.AFRAME_INJECTED,""),i.appendChild(t),e.setAttribute("light",{color:"#FFF",intensity:.6}),e.setAttribute("position",{x:-.5,y:1,z:1}),e.setAttribute(DEFAULT_LIGHT_ATTR,""),e.setAttribute(constants.AFRAME_INJECTED,""),i.appendChild(e),this.defaultLights=!0)}});
},{"../constants/":51,"../core/system":68}],113:[function(_dereq_,module,exports){
function calculateVideoCacheHash(e,t){var r,i,a,o=t.getAttribute("id");if(o)return o;for(i="",a=e||{},r=0;r<t.attributes.length;r++)a[t.attributes[r].name]=t.attributes[r].value;return Object.keys(a).sort().forEach(function(e){i+=e+":"+a[e]+";"}),i}function loadImageTexture(e,t){function r(r,i){function a(e){setTextureProperties(e,t),e.needsUpdate=!0,r(e)}var o="string"!=typeof e;return o?void a(new THREE.Texture(e)):void TextureLoader.load(e,a,function(){},function(e){error("`$s` could not be fetched (Error code: %s; Response: %s)",e.status,e.statusText)})}return new Promise(r)}function setTextureProperties(e,t){var r=t.repeat||"1 1",i=r.split(" ");"1 1"!==r&&2===i.length&&(e.wrapS=THREE.RepeatWrapping,e.wrapT=THREE.RepeatWrapping,e.repeat.set(parseFloat(i[0]),parseFloat(i[1])))}function createVideoEl(e,t,r){var i=document.createElement("video");return i.width=t,i.height=r,i.setAttribute("webkit-playsinline",""),i.autoplay=!0,i.loop=!0,i.crossOrigin="anonymous",i.addEventListener("error",function(){warn("`$s` is not a valid video",e)},!0),i.src=e,i}function fixVideoAttributes(e){return e.autoplay="false"!==e.getAttribute("autoplay"),e.controls="false"!==e.getAttribute("controls"),"false"===e.getAttribute("loop")&&e.removeAttribute("loop"),"false"===e.getAttribute("preload")&&(e.preload="none"),e.crossOrigin=e.crossOrigin||"anonymous",e.setAttribute("webkit-playsinline",""),e}var registerSystem=_dereq_("../core/system").registerSystem,THREE=_dereq_("../lib/three"),utils=_dereq_("../utils/"),debug=utils.debug,error=debug("components:texture:error"),TextureLoader=new THREE.TextureLoader,warn=debug("components:texture:warn");module.exports.System=registerSystem("material",{init:function(){this.materials={},this.textureCache={}},clearTextureCache:function(){this.textureCache={}},loadTexture:function(e,t,r){function i(e){n.loadImage(e,t,r)}function a(e){n.loadVideo(e,t,r)}function o(e){n.loadCanvas(e,t,r)}var n=this;utils.srcLoader.validateSrc(e,i,a,o)},loadImage:function(e,t,r){var i=this.hash(t),a=r,o=this.textureCache;return o[i]?void o[i].then(a):(o[i]=loadImageTexture(e,t),void o[i].then(a))},loadCanvas:function(e,t,r){e.readyState=2,e.HAVE_CURRENT_DATA=2,this.loadVideo(e,t,r)},loadVideo:function(e,t,r){function i(e){e.texture.needsUpdate=!0,r(e.texture,e.videoEl)}var a,o,n,s,u=this.textureCache;if("string"!=typeof e){if(n=e,a=this.hashVideo(t,n),u[a])return void u[a].then(i);fixVideoAttributes(n)}return n=n||createVideoEl(e,t.width,t.height),a=this.hashVideo(t,n),u[a]?void u[a].then(i):(o=new THREE.VideoTexture(n),o.minFilter=THREE.LinearFilter,setTextureProperties(o,t),s={texture:o,videoEl:n},u[a]=Promise.resolve(s),void i(s))},hash:function(e){return JSON.stringify(e)},hashVideo:function(e,t){return calculateVideoCacheHash(e,t)},registerMaterial:function(e){this.materials[e.uuid]=e},unregisterMaterial:function(e){delete this.materials[e.uuid]},updateMaterials:function(e){var t=this.materials;Object.keys(t).forEach(function(e){t[e].needsUpdate=!0})}});
},{"../core/system":68,"../lib/three":103,"../utils/":120}],114:[function(_dereq_,module,exports){
var registerSystem=_dereq_("../core/system").registerSystem;module.exports.System=registerSystem("tracked-controls",{init:function(){var t=this;this.controllers=[],navigator.getVRDisplays&&navigator.getVRDisplays().then(function(e){e.length>0&&(t.vrDisplay=e[0])})},tick:function(){var t,e,r=navigator.getGamepads&&navigator.getGamepads(),s=this.controllers=[];if(r)for(e=0;e<r.length;++e)t=r[e],t&&t.pose&&s.push(t)}});
},{"../core/system":68}],115:[function(_dereq_,module,exports){
var THREE=_dereq_("../lib/three"),dummyDolly=new THREE.Object3D,controls=new THREE.VRControls(dummyDolly);module.exports=function(){var o;if(controls.update(),o=dummyDolly.quaternion,0!==o._x||0!==o._y||0!==o._z)return!0};
},{"../lib/three":103}],116:[function(_dereq_,module,exports){
function parse(e,r){var t,o={};return e&&"object"==typeof e?vecParseFloat(e):"string"!=typeof e||null===e?r:(t=e.trim().replace(/\s+/g," ").split(" "),o.x=t[0]||r&&r.x,o.y=t[1]||r&&r.y,o.z=t[2]||r&&r.z,o.w=t[3]||r&&r.w,vecParseFloat(o))}function stringify(e){return"object"!=typeof e?e:[e.x,e.y,e.z,e.w].join(" ").trim()}function vecParseFloat(e){return Object.keys(e).forEach(function(r){return void 0===e[r]?void delete e[r]:void(e[r]=parseFloat(e[r],10))}),e}var regex=/\s*(-?\d*\.{0,1}\d+)\s+(-?\d*\.{0,1}\d+)\s+(-?\d*\.{0,1}\d+)\s*/;module.exports.regex=regex,module.exports.parse=parse,module.exports.stringify=stringify,module.exports.isCoordinate=function(e){return regex.test(e)},module.exports.toVector3=function(e){return new THREE.Vector3(e.x,e.y,e.z)};
},{}],117:[function(_dereq_,module,exports){
(function (process){
function getDebugNamespaceType(e){var r=e.split(":");return r[r.length-1]}function getDebugNamespaceColor(e){var r=getDebugNamespaceType(e),o=settings.colors&&settings.colors[r];return o||null}function storage(){try{return window.localStorage}catch(e){}}var debugLib=_dereq_("debug"),extend=_dereq_("object-assign"),settings={colors:{debug:"gray",error:"red",info:"gray",warn:"orange"}},debug=function(e){var r=debugLib(e);return r.color=getDebugNamespaceColor(e),r};extend(debug,debugLib);var ls=storage();ls&&(parseInt(ls.logs,10)||"true"===ls.logs)?debug.enable("*"):debug.enable("*:error,*:info,*:warn"),process.browser&&(window.logs=debug),module.exports=debug;
}).call(this,_dereq_('_process'))
},{"_process":2,"debug":3,"object-assign":9}],118:[function(_dereq_,module,exports){
module.exports.getComponentProperty=function(t,e,o){var r;return o=o||".",e.indexOf(o)!==-1?(r=e.split(o),t.getComputedAttribute(r[0])[r[1]]):t.getComputedAttribute(e)},module.exports.setComponentProperty=function(t,e,o,r){var i;return r=r||".",e.indexOf(r)!==-1?(i=e.split(r),void t.setAttribute(i[0],i[1],o)):void t.setAttribute(e,o)};
},{}],119:[function(_dereq_,module,exports){
module.exports=function(t){var e=t.style.width,s=t.style.height;t.style.width=parseInt(e,10)+1+"px",t.style.height=parseInt(s,10)+1+"px",setTimeout(function(){t.style.width=e,t.style.height=s},200)};
},{}],120:[function(_dereq_,module,exports){
function deepEqual(e,t){var o,r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(0===r.length)return e===t;for(o=0;o<r.length;++o)if(e[r[o]]!==t[r[o]])return!1;return!0}var deepAssign=_dereq_("deep-assign"),objectAssign=_dereq_("object-assign");module.exports.coordinates=_dereq_("./coordinates"),module.exports.checkHeadsetConnected=_dereq_("./checkHeadsetConnected"),module.exports.debug=_dereq_("./debug"),module.exports.entity=_dereq_("./entity"),module.exports.forceCanvasResizeSafariMobile=_dereq_("./forceCanvasResizeSafariMobile"),module.exports.material=_dereq_("./material"),module.exports.styleParser=_dereq_("./styleParser"),module.exports.fireEvent=function(e,t,o){o=o||{},o.detail=o.detail||{},o.detail.target=o.detail.target||e;var r=new CustomEvent(t,o);e.dispatchEvent(r)},module.exports.extend=objectAssign,module.exports.extendDeep=deepAssign,module.exports.deepEqual=deepEqual,module.exports.diff=function(e,t){var o={},r=Object.keys(e);return Object.keys(t).forEach(function(e){r.indexOf(e)===-1&&r.push(e)}),r.forEach(function(r){var i=e[r],n=t[r],a=i&&n&&i.constructor===Object&&n.constructor===Object;(a&&!deepEqual(i,n)||!a&&i!==n)&&(o[r]=n)}),o},module.exports.isMobile=function(){var e=!1;return function(t){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0),isIOS()&&(e=!0),isGearVR()&&(e=!1)}(navigator.userAgent||navigator.vendor||window.opera),e};var isIOS=module.exports.isIOS=function(){return/iPad|iPhone|iPod/.test(navigator.platform)},isGearVR=module.exports.isGearVR=function(){return/SamsungBrowser.+Mobile VR/i.test(navigator.userAgent)};module.exports.isLandscape=function(){return 90===window.orientation||window.orientation===-90},module.exports.shouldCaptureKeyEvent=function(e){return!(e.shiftKey||e.metaKey||e.altKey||e.ctrlKey)&&document.activeElement===document.body},module.exports.splitString=function(e,t){"undefined"==typeof t&&(t=" ");var o=new RegExp(t,"g");return e=(e||"").replace(o,t),e.split(t)},module.exports.getElData=function(e,t){function o(t){e.hasAttribute(t)&&(r[t]=e.getAttribute(t))}t=t||{};var r={};return Object.keys(t).forEach(o),r},module.exports.getUrlParameter=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var t=new RegExp("[\\?&]"+e+"=([^&#]*)"),o=t.exec(location.search);return null===o?"":decodeURIComponent(o[1].replace(/\+/g," "))},module.exports.isIframed=function(){return window.top!==window.self},module.exports.findAllScenes=function(e){for(var t=[],o=e.getElementsByTagName("*"),r=0,i=o.length;r<i;r++)o[r].isScene&&t.push(o[r]);return t},module.exports.srcLoader=_dereq_("./src-loader");
},{"./checkHeadsetConnected":115,"./coordinates":116,"./debug":117,"./entity":118,"./forceCanvasResizeSafariMobile":119,"./material":121,"./src-loader":122,"./styleParser":123,"deep-assign":6,"object-assign":9}],121:[function(_dereq_,module,exports){
function handleTextureEvents(e,t){t&&(e.emit("materialtextureloaded",{src:t.image,texture:t}),"VIDEO"===t.image.tagName&&(t.image.addEventListener("loadeddata",function(){e.emit("materialvideoloadeddata",{src:t.image,texture:t})}),t.image.addEventListener("ended",function(){e.emit("materialvideoended",{src:t.image,texture:t})})))}module.exports.updateMap=function(e,t){function a(e){d.map=e,d.needsUpdate=!0,handleTextureEvents(r,e)}var r=e.el,d=e.material,n=t.src;if(n){if(n===e.textureSrc)return;return e.textureSrc=n,void r.sceneEl.systems.material.loadTexture(n,{src:n,repeat:t.repeat},a)}d.map&&a(null)},module.exports.handleTextureEvents=handleTextureEvents;
},{}],122:[function(_dereq_,module,exports){
function validateSrc(e,a,r,t){var n,o,i,d,l=parseUrl(e);return l?void validateImageUrl(l,function(e){return e?void a(l):void r(l)}):(n=validateAndGetQuerySelector(e))?(o=n&&"IMG"===n.tagName,i=n&&"VIDEO"===n.tagName,d=n&&"CANVAS"===n.tagName,o?a(n):i?r(n):d?t(n):void warn('"%s" does not point to a valid <img>, <video>, or <canvas> element',e)):void 0}function validateCubemapSrc(e,a){function r(e){d.push(e),6===d.length&&a(d)}var t,n,o,i="",d=[];for(n=0;n<6;n++)i+="url((.+))s*,s*";if(o=e.match(i))for(n=1;n<7;n++)validateSrc(o[n],r);else if(t=validateAndGetQuerySelector(e))return"A-CUBEMAP"===t.tagName&&t.srcs?a(t.srcs):void warn('Selector "%s" does not point to <a-cubemap>',e)}function parseUrl(e){var a=e.match(/\url\((.+)\)/);if(a)return a[1]}function validateImageUrl(e,a){function r(){a(!0)}function t(){a(!1)}var n=new Image;n.addEventListener("load",r),n.addEventListener("error",t),n.src=e}function validateAndGetQuerySelector(e){try{var a=document.querySelector(e);return a||warn('No element was found matching the selector: "%s"',e),a}catch(a){return void warn('"%s" is not a valid selector',e)}}var debug=_dereq_("./debug"),warn=debug("utils:src-loader:warn");module.exports={parseUrl:parseUrl,validateSrc:validateSrc,validateCubemapSrc:validateCubemapSrc};
},{"./debug":117}],123:[function(_dereq_,module,exports){
function toCamelCase(e){function r(e){return e[1].toUpperCase()}return e.replace(/-([a-z])/g,r)}function transformKeysToCamelCase(e){var r=Object.keys(e),t={};return r.forEach(function(r){var s=toCamelCase(r);t[s]=e[r]}),t}var styleParser=_dereq_("style-attr");module.exports.parse=function(e){var r;return"string"!=typeof e?e:(r=styleParser.parse(e),r[""]?e:transformKeysToCamelCase(r))},module.exports.stringify=function(e){return"string"==typeof e?e:styleParser.stringify(e)},module.exports.toCamelCase=toCamelCase,module.exports.transformKeysToCamelCase=transformKeysToCamelCase;
},{"style-attr":12}],124:[function(_dereq_,module,exports){
THREE.VRControls=function(o,e){function t(o){for(var t=0;t<o.length;t++)if("VRDisplay"in window&&o[t]instanceof VRDisplay||"PositionSensorVRDevice"in window&&o[t]instanceof PositionSensorVRDevice){i=o[t];break}i||e&&e("VR input not available.")}var i,s=this,n=new THREE.Matrix4;navigator.getVRDisplays?navigator.getVRDisplays().then(t):navigator.getVRDevices&&navigator.getVRDevices().then(t),this.scale=1,this.standing=!1,this.userHeight=1.6,this.update=function(){if(i){if(i.getPose){var e=i.getPose();null!==e.orientation&&o.quaternion.fromArray(e.orientation),null!==e.position?o.position.fromArray(e.position):o.position.set(0,0,0)}else{var t=i.getState();null!==t.orientation&&o.quaternion.copy(t.orientation),null!==t.position?o.position.copy(t.position):o.position.set(0,0,0)}this.standing&&(i.stageParameters?(o.updateMatrix(),n.fromArray(i.stageParameters.sittingToStandingTransform),o.applyMatrix(n)):o.position.setY(o.position.y+this.userHeight)),o.position.multiplyScalar(s.scale)}},this.resetPose=function(){i&&(void 0!==i.resetPose?i.resetPose():void 0!==i.resetSensor?i.resetSensor():void 0!==i.zeroSensor&&i.zeroSensor())},this.resetSensor=function(){console.warn("THREE.VRControls: .resetSensor() is now .resetPose()."),this.resetPose()},this.zeroSensor=function(){console.warn("THREE.VRControls: .zeroSensor() is now .resetPose()."),this.resetPose()},this.dispose=function(){i=null}};
},{}],125:[function(_dereq_,module,exports){
THREE.VREffect=function(e,t){function i(e){h=e,e.length>0?o=e[0]:t&&t("HMD not available")}function r(){var t=f.isPresenting;if(f.isPresenting=void 0!==o&&o.isPresenting,f.isPresenting){var i=o.getEyeParameters("left"),r=i.renderWidth,n=i.renderHeight,a=o.getLayers();if(a.length){var s=a[0];x=null!==s.leftBounds&&4===s.leftBounds.length?s.leftBounds:[0,0,.5,1],P=null!==s.rightBounds&&4===s.rightBounds.length?s.rightBounds:[.5,0,.5,1]}t||(v=e.getPixelRatio(),w=e.getSize(),e.setPixelRatio(1),e.setSize(2*r,n,!1))}else t&&(e.setPixelRatio(v),e.setSize(w.width,w.height,m))}function n(e){var t=2/(e.leftTan+e.rightTan),i=(e.leftTan-e.rightTan)*t*.5,r=2/(e.upTan+e.downTan),n=(e.upTan-e.downTan)*r*.5;return{scale:[t,r],offset:[i,n]}}function a(e,t,i,r){t=void 0===t||t,i=void 0===i?.01:i,r=void 0===r?1e4:r;var a=t?-1:1,s=new THREE.Matrix4,o=s.elements,h=n(e);return o[0]=h.scale[0],o[1]=0,o[2]=h.offset[0]*a,o[3]=0,o[4]=0,o[5]=h.scale[1],o[6]=-h.offset[1]*a,o[7]=0,o[8]=0,o[9]=0,o[10]=r/(i-r)*-a,o[11]=r*i/(i-r),o[12]=0,o[13]=0,o[14]=a,o[15]=0,s.transpose(),s}function s(e,t,i,r){var n=Math.PI/180,s={upTan:Math.tan(e.upDegrees*n),downTan:Math.tan(e.downDegrees*n),leftTan:Math.tan(e.leftDegrees*n),rightTan:Math.tan(e.rightDegrees*n)};return a(s,t,i,r)}var o,h,d,l,u=new THREE.Vector3,g=new THREE.Vector3,c=null;"VRFrameData"in window&&(c=new VRFrameData),navigator.getVRDisplays&&navigator.getVRDisplays().then(i),this.isPresenting=!1,this.scale=1;var f=this,w=e.getSize(),m=!1,v=e.getPixelRatio();this.getVRDisplay=function(){return o},this.getVRDisplays=function(){return h},this.setSize=function(t,i,r){if(w={width:t,height:i},m=r,f.isPresenting){var n=o.getEyeParameters("left");e.setPixelRatio(1),e.setSize(2*n.renderWidth,n.renderHeight,!1)}else e.setPixelRatio(v),e.setSize(t,i,r)};var p=e.domElement,x=[0,0,.5,1],P=[.5,0,.5,1];window.addEventListener("vrdisplaypresentchange",r,!1),this.setFullScreen=function(e){return new Promise(function(t,i){return void 0===o?void i(new Error("No VR hardware found.")):f.isPresenting===e?void t():void t(e?o.requestPresent([{source:p}]):o.exitPresent())})},this.requestPresent=function(){return this.setFullScreen(!0)},this.exitPresent=function(){return this.setFullScreen(!1)},this.requestAnimationFrame=function(e){return void 0!==o?o.requestAnimationFrame(e):window.requestAnimationFrame(e)},this.cancelAnimationFrame=function(e){void 0!==o?o.cancelAnimationFrame(e):window.cancelAnimationFrame(e)},this.submitFrame=function(){void 0!==o&&f.isPresenting&&o.submitFrame()},this.autoSubmitFrame=!0;var y=new THREE.PerspectiveCamera;y.layers.enable(1);var T=new THREE.PerspectiveCamera;T.layers.enable(2),this.render=function(t,i,r,n){if(o&&f.isPresenting){var a=t.autoUpdate;a&&(t.updateMatrixWorld(),t.autoUpdate=!1);var h=o.getEyeParameters("left"),w=o.getEyeParameters("right");u.fromArray(h.offset),g.fromArray(w.offset),Array.isArray(t)&&(console.warn("THREE.VREffect.render() no longer supports arrays. Use object.layers instead."),t=t[0]);var m=e.getSize();d={x:Math.round(m.width*x[0]),y:Math.round(m.height*x[1]),width:Math.round(m.width*x[2]),height:Math.round(m.height*x[3])},l={x:Math.round(m.width*P[0]),y:Math.round(m.height*P[1]),width:Math.round(m.width*P[2]),height:Math.round(m.height*P[3])},r?(e.setRenderTarget(r),r.scissorTest=!0):(e.setRenderTarget(null),e.setScissorTest(!0)),(e.autoClear||n)&&e.clear(),null===i.parent&&i.updateMatrixWorld(),i.matrixWorld.decompose(y.position,y.quaternion,y.scale),i.matrixWorld.decompose(T.position,T.quaternion,T.scale);var v=this.scale;return y.translateOnAxis(u,v),T.translateOnAxis(g,v),o.getFrameData?(o.depthNear=i.near,o.depthFar=i.far,o.getFrameData(c),y.projectionMatrix.elements=c.leftProjectionMatrix,T.projectionMatrix.elements=c.rightProjectionMatrix):(y.projectionMatrix=s(h.fieldOfView,!0,i.near,i.far),T.projectionMatrix=s(w.fieldOfView,!0,i.near,i.far)),r?(r.viewport.set(d.x,d.y,d.width,d.height),r.scissor.set(d.x,d.y,d.width,d.height)):(e.setViewport(d.x,d.y,d.width,d.height),e.setScissor(d.x,d.y,d.width,d.height)),e.render(t,y,r,n),r?(r.viewport.set(l.x,l.y,l.width,l.height),r.scissor.set(l.x,l.y,l.width,l.height)):(e.setViewport(l.x,l.y,l.width,l.height),e.setScissor(l.x,l.y,l.width,l.height)),e.render(t,T,r,n),r?(r.viewport.set(0,0,m.width,m.height),r.scissor.set(0,0,m.width,m.height),r.scissorTest=!1,e.setRenderTarget(null)):e.setScissorTest(!1),a&&(t.autoUpdate=!0),void(f.autoSubmitFrame&&f.submitFrame())}e.render(t,i,r,n)}};
},{}],126:[function(_dereq_,module,exports){
window.glStats=function(){function e(e,r){return function(){r.apply(this,arguments),e.apply(this,arguments)}}function r(){a("allcalls").set(s+i),a("drawElements").set(i),a("drawArrays").set(s),a("bindTexture").set(m),a("useProgram").set(d),a("glfaces").set(l),a("glvertices").set(c),a("glpoints").set(p)}function n(){s=0,i=0,d=0,l=0,c=0,p=0,m=0}function t(){}function o(e){a=e}var a=null,s=0,i=0,d=0,l=0,c=0,p=0,m=0;WebGLRenderingContext.prototype.drawArrays=e(WebGLRenderingContext.prototype.drawArrays,function(){s++,arguments[0]==this.POINTS?p+=arguments[2]:c+=arguments[2]}),WebGLRenderingContext.prototype.drawElements=e(WebGLRenderingContext.prototype.drawElements,function(){i++,l+=arguments[1]/3,c+=arguments[1]}),WebGLRenderingContext.prototype.useProgram=e(WebGLRenderingContext.prototype.useProgram,function(){d++}),WebGLRenderingContext.prototype.bindTexture=e(WebGLRenderingContext.prototype.bindTexture,function(){m++});var f={allcalls:{over:3e3,caption:"Calls (hook)"},drawelements:{caption:"drawElements (hook)"},drawarrays:{caption:"drawArrays (hook)"}},u=[{caption:"WebGL",values:["allcalls","drawelements","drawarrays","useprogram","bindtexture","glfaces","glvertices","glpoints"]}],y=[{base:"allcalls",steps:["drawelements","drawarrays"]}];return{update:r,start:n,end:t,attach:o,values:f,groups:u,fractions:y}},window.threeStats=function(e){function r(){a("renderer.info.memory.geometries").set(e.info.memory.geometries),a("renderer.info.programs").set(e.info.programs.length),a("renderer.info.memory.textures").set(e.info.memory.textures),a("renderer.info.render.calls").set(e.info.render.calls),a("renderer.info.render.faces").set(e.info.render.faces),a("renderer.info.render.points").set(e.info.render.points),a("renderer.info.render.vertices").set(e.info.render.vertices)}function n(){}function t(){}function o(e){a=e}var a=null,s={"renderer.info.memory.geometries":{caption:"Geometries"},"renderer.info.memory.textures":{caption:"Textures"},"renderer.info.programs":{caption:"Programs"},"renderer.info.render.calls":{caption:"Calls"},"renderer.info.render.faces":{caption:"Faces",over:1e3},"renderer.info.render.points":{caption:"Points"},"renderer.info.render.vertices":{caption:"Vertices"}},i=[{caption:"Three.js - Memory",values:["renderer.info.memory.geometries","renderer.info.programs","renderer.info.memory.textures"]},{caption:"Three.js - Render",values:["renderer.info.render.calls","renderer.info.render.faces","renderer.info.render.points","renderer.info.render.vertices"]}],d=[];return{update:r,start:n,end:t,attach:o,values:s,groups:i,fractions:d}},window.BrowserStats=function(){function e(e){var r=100,n=Math.floor(Math.log(e)/p);return Math.round(e*r/Math.pow(1024,n))/r}function r(){s=e(performance.memory.usedJSHeapSize),i=e(performance.memory.totalJSHeapSize),a("memory").set(s),a("total").set(i)}function n(){s=0}function t(){}function o(e){a=e}var a=null,s=0,i=0;window.performance&&!performance.memory&&(performance.memory={usedJSHeapSize:0,totalJSHeapSize:0}),0===performance.memory.totalJSHeapSize&&console.warn("totalJSHeapSize === 0... performance.memory is only available in Chrome .");var d={memory:{caption:"Used Memory",average:!0,avgMs:1e3,over:22},total:{caption:"Total Memory"}},l=[{caption:"Browser",values:["memory","total"]}],c=[{base:"total",steps:["memory"]}],p=Math.log(1024);return{update:r,start:n,end:t,attach:o,values:d,groups:l,fractions:c}},"object"==typeof module&&(module.exports={glStats:window.glStats,threeStats:window.threeStats,BrowserStats:window.BrowserStats});
},{}],127:[function(_dereq_,module,exports){
"use strict";!function(){if("undefined"==typeof window.performance&&(window.performance={}),!window.performance.now){var e=Date.now();performance.timing&&performance.timing.navigationStart&&(e=performance.timing.navigationStart),window.performance.now=function(){return Date.now()-e}}window.performance.mark||(window.performance.mark=function(){}),window.performance.measure||(window.performance.measure=function(){})}(),window.rStats=function(e){function t(e,t){for(var n=Object.keys(e),a=0,r=n.length;a<r;a++)t(n[a])}function n(e){var t=document.createElement("link");t.href=e,t.rel="stylesheet",t.type="text/css",document.getElementsByTagName("head")[0].appendChild(t)}function a(e,t,n){function a(){i.width=v,i.height=g,i.style.width=i.width+"px",i.style.height=i.height+"px",i.className="rs-canvas",e.appendChild(i),c.fillStyle="#444444",c.fillRect(0,0,i.width,i.height)}function r(e,t){s+=.1*(e-s),l*=.99,s>l&&(l=s),c.drawImage(i,1,0,i.width-1,i.height,0,0,i.width-1,i.height),t?c.drawImage(p,i.width-1,i.height-s*i.height/l-g):c.drawImage(d,i.width-1,i.height-s*i.height/l-g)}var o=n||{},i=document.createElement("canvas"),c=i.getContext("2d"),l=0,s=0,f=o.color?o.color:"#666666",d=document.createElement("canvas"),u=d.getContext("2d");d.width=1,d.height=2*g,u.fillStyle="#444444",u.fillRect(0,0,1,2*g),u.fillStyle=f,u.fillRect(0,g,1,g),u.fillStyle="#ffffff",u.globalAlpha=.5,u.fillRect(0,g,1,1),u.globalAlpha=1;var p=document.createElement("canvas"),h=p.getContext("2d");return p.width=1,p.height=2*g,h.fillStyle="#444444",h.fillRect(0,0,1,2*g),h.fillStyle="#b70000",h.fillRect(0,g,1,g),h.globalAlpha=.5,h.fillStyle="#ffffff",h.fillRect(0,g,1,1),h.globalAlpha=1,a(),{draw:r}}function r(e,n){function a(){o.width=v,o.height=g*n,o.style.width=o.width+"px",o.style.height=o.height+"px",o.className="rs-canvas",e.appendChild(o),i.fillStyle="#444444",i.fillRect(0,0,o.width,o.height)}function r(e){i.drawImage(o,1,0,o.width-1,o.height,0,0,o.width-1,o.height);var n=0;t(e,function(t){var a=e[t]*o.height;i.fillStyle=f[t],i.fillRect(o.width-1,n,1,a),n+=a})}var o=document.createElement("canvas"),i=o.getContext("2d");return a(),{draw:r}}function o(e,t){function n(e){if(x&&x.average){v+=e,C++;var t=performance.now();t-w>=(x.avgMs||1e3)&&(g=v/C,v=0,w=t,C=0)}}function r(){d=performance.now(),s.userTimingAPI&&performance.mark(u+"-start"),I=!0}function o(){p=performance.now()-d,s.userTimingAPI&&(performance.mark(u+"-end"),I&&performance.measure(u,u+"-start",u+"-end")),n(p)}function i(){o(),r()}function c(){var e=x&&x.average?g:p;b.nodeValue=Math.round(100*e)/100;var t=x&&(x.below&&p<x.below||x.over&&p>x.over);N.draw(p,t),y.style.color=t?"#b70000":"#ffffff"}function l(){var e=performance.now(),t=e-d;h++,t>1e3&&(p=x&&x.interpolate===!1?h:1e3*h/t,h=0,d=e,n(p))}function f(e){p=e,n(p)}var d,u=e,p=0,h=0,g=0,v=0,w=performance.now(),C=0,y=document.createElement("div"),E=document.createElement("span"),S=document.createElement("div"),b=document.createTextNode(""),x=s?s.values[u.toLowerCase()]:null,N=new a(y,u,x),I=!1;return y.className="rs-counter-base",E.className="rs-counter-id",E.textContent=x&&x.caption?x.caption:u,S.className="rs-counter-value",S.appendChild(b),y.appendChild(E),y.appendChild(S),t?t.div.appendChild(y):m.appendChild(y),d=performance.now(),{set:f,start:r,tick:i,end:o,frame:l,value:function(){return p},draw:c}}function i(e){var n=e.toLowerCase();if(void 0===n&&(n="default"),w[n])return w[n];var a=null;s&&s.groups&&t(s.groups,function(e){var t=s.groups[parseInt(e,10)];a||t.values.indexOf(n.toLowerCase())===-1||(a=t)});var r=new o(n,a);return w[n]=r,r}function c(){if(s.plugins){s.values||(s.values={}),s.groups||(s.groups=[]),s.fractions||(s.fractions=[]);for(var e=0;e<s.plugins.length;e++)s.plugins[e].attach(i),t(s.plugins[e].values,function(t){s.values[t]=s.plugins[e].values[t]}),s.groups=s.groups.concat(s.plugins[e].groups),s.fractions=s.fractions.concat(s.plugins[e].fractions)}else s.plugins={};h=document.createElement("div"),h.className="rs-base",m=document.createElement("div"),m.className="rs-container",m.style.height="auto",h.appendChild(m),document.body.appendChild(h),s&&(s.groups&&t(s.groups,function(e){var t=s.groups[parseInt(e,10)],n=document.createElement("div");n.className="rs-group",t.div=n;var a=document.createElement("h1");a.textContent=t.caption,a.addEventListener("click",function(e){this.classList.toggle("hidden"),e.preventDefault()}.bind(n)),m.appendChild(a),m.appendChild(n)}),s.fractions&&t(s.fractions,function(e){var n=s.fractions[parseInt(e,10)],a=document.createElement("div");a.className="rs-fraction";var o=document.createElement("div");o.className="rs-legend";var i=0;t(s.fractions[e].steps,function(t){var n=document.createElement("p");n.textContent=s.fractions[e].steps[t],n.style.color=f[i],o.appendChild(n),i++}),a.appendChild(o),a.style.height=i*g+"px",n.div=a;var c=new r(a,i);n.graph=c,m.appendChild(a)}))}function l(){t(s.plugins,function(e){s.plugins[e].update()}),t(w,function(e){w[e].draw()}),s&&s.fractions&&t(s.fractions,function(e){var n=s.fractions[parseInt(e,10)],a=[],r=w[n.base.toLowerCase()];r&&(r=r.value(),t(s.fractions[e].steps,function(t){var n=s.fractions[e].steps[parseInt(t,10)].toLowerCase(),o=w[n];o&&a.push(o.value()/r)})),n.graph.draw(a)})}var s=e||{},f=s.colours||["#850700","#c74900","#fcb300","#284280","#4c7c0c"],d="https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700,300",u=(s.CSSPath?s.CSSPath:"")+"rStats.css",p=s.css||[d,u];p.forEach(function(e){n(e)}),s.values||(s.values={});var h,m,g=10,v=200,w={};return c(),function(e){return e?i(e):{element:h,update:l}}},"object"==typeof module&&(module.exports=window.rStats);
},{}],128:[function(_dereq_,module,exports){
var Util={};Util.base64=function(e,i){return"data:"+e+";base64,"+i},Util.isMobile=function(){var e=!1;return function(i){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(i.substr(0,4)))&&(e=!0)}(navigator.userAgent||navigator.vendor||window.opera),e},Util.isIOS=function(){return/(iPad|iPhone|iPod)/g.test(navigator.userAgent)},Util.isIFrame=function(){try{return window.self!==window.top}catch(e){return!0}},Util.appendQueryParameter=function(e,i,t){var a=e.indexOf("?")<0?"?":"&";return e+=a+i+"="+t},Util.getQueryParameter=function(e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+e+"=([^&#]*)"),t=i.exec(location.search);return null===t?"":decodeURIComponent(t[1].replace(/\+/g," "))},Util.isLandscapeMode=function(){return 90==window.orientation||window.orientation==-90},module.exports=Util;
},{}],129:[function(_dereq_,module,exports){
function AndroidWakeLock(){var A=document.createElement("video");A.addEventListener("ended",function(){A.play()}),this.request=function(){A.paused&&(A.src=Util.base64("video/webm","GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4ECQoWBAhhTgGcBAAAAAAAH4xFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsggfG7AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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ADYAAAWi0quoCjloEPoACmAECSnABIoAADYAAAWi0quoCjloETiACmAECSnABIYAADYAAAWi0quoAfQ7Z1AQAAAAAAAJTngl3Ao5aBAAAApgBAkpwASCAAA2AAAFotKrqAo5aBA+gApgBAkpwASAAAA2AAAFotKrqAo5aBB9AApgBAkpwAR8AAA2AAAFotKrqAo5aBC7gApgBAkpwAR4AAA2AAAFotKrqAo5aBD6AApgBAkpwAR2AAA2AAAFotKrqAo5aBE4gApgBAkpwARyAAA2AAAFotKrqAH0O2dQEAAAAAAACU54J1MKOWgQAAAKYAwJKcAENgAANgAABaLSq6gKOWgQPoAKYAQJKcAEbgAANgAABaLSq6gKOWgQfQAKYAQJKcAEagAANgAABaLSq6gKOWgQu4AKYAQJKcAEaAAANgAABaLSq6gKOWgQ+gAKYAQJKcAEZAAANgAABaLSq6gKOWgROIAKYAQJKcAEYAAANgAABaLSq6gB9DtnUBAAAAAAAAlOeCjKCjloEAAACmAECSnABF4AADYAAAWi0quoCjloED6ACmAECSnABFwAADYAAAWi0quoCjloEH0ACmAECSnABFoAADYAAAWi0quoCjloELuACmAECSnABFgAADYAAAWi0quoCjloEPoACmAMCSnABDYAADYAAAWi0quoCjloETiACmAECSnABFYAADYAAAWi0quoAfQ7Z1AQAAAAAAAJTngqQQo5aBAAAApgBAkpwARUAAA2AAAFotKrqAo5aBA+gApgBAkpwARSAAA2AAAFotKrqAo5aBB9AApgBAkpwARQAAA2AAAFotKrqAo5aBC7gApgBAkpwARQAAA2AAAFotKrqAo5aBD6AApgBAkpwAROAAA2AAAFotKrqAo5aBE4gApgBAkpwARMAAA2AAAFotKrqAH0O2dQEAAAAAAACU54K7gKOWgQAAAKYAQJKcAESgAANgAABaLSq6gKOWgQPoAKYAQJKcAESAAANgAABaLSq6gKOWgQfQAKYAwJKcAENgAANgAABaLSq6gKOWgQu4AKYAQJKcAERgAANgAABaLSq6gKOWgQ+gAKYAQJKcAERAAANgAABaLSq6gKOWgROIAKYAQJKcAEQgAANgAABaLSq6gB9DtnUBAAAAAAAAlOeC0vCjloEAAACmAECSnABEIAADYAAAWi0quoCjloED6ACmAECSnABEAAADYAAAWi0quoCjloEH0ACmAECSnABD4AADYAAAWi0quoCjloELuACmAECSnABDwAADYAAAWi0quoCjloEPoACmAECSnABDoAADYAAAWi0quoCjloETiACmAECSnABDgAADYAAAWi0quoAcU7trAQAAAAAAABG7j7OBALeK94EB8YIBd/CBAw=="),A.play())},this.release=function(){A.pause(),A.src=""}}function iOSWakeLock(){var A=null;this.request=function(){A||(A=setInterval(function(){window.location=window.location,setTimeout(window.stop,0)},3e4))},this.release=function(){A&&(clearInterval(A),A=null)}}function getWakeLock(){var A=navigator.userAgent||navigator.vendor||window.opera;return A.match(/iPhone/i)||A.match(/iPod/i)?iOSWakeLock:AndroidWakeLock}var Util=_dereq_("./util.js");module.exports=getWakeLock();
},{"./util.js":128}]},{},[101])(101)
});
//# sourceMappingURL=aframe.min.js.map
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>A-Frame Demo </title>
<meta name="description" content="A-Frame Demo">
<script src="./aframe.min.js"></script>
</head>
<body>
<a-scene>
<a-assets>
<a-mixin id="scaledbox" geometry="primitive: box" scale="2 2 2"></a-mixin>
<img id="sky1" src="./sky1.jpg">
<img id="sky2" src="./sky2.jpg">
<img id="sky3" src="./sky3.jpg">
<img id="sky0" src="./sky0.jpg">
</a-assets>
<a-entity position="0 2.2 4">
<a-entity camera look-controls>
<a-entity id="c" position="0 0 -3" geometry="primitive:ring; radiusInner: 0.05; radiusOuter: 0.1"
material="color: cyan; shader: flat" cursor="fuse:true;">
<a-animation begin="cursor-hovering" easing="ease-in" attribute="material.color" to="black"></a-animation>
<a-animation begin="mouseup" easing="ease-in" attribute="material.color" to="cyan" dur="1"></a-animation>
</a-entity>
</a-entity>
<a-sky id="skybox" src="#sky0"></a-sky>
</a-entity>
<a-entity position="-3.5 1 -1" rotation="0 -45 0">
<a-box id="box1" mixin="scaledbox" src="#sky1">
<a-animation begin="click" attribute="rotation" to="0 360 0"
easing="linear" dur="2000" fill="backwards"></a-animation>
</a-box>
</a-entity>
<a-entity position="0 1 -2" rotation="0 0 0">
<a-box id="box2" mixin="scaledbox" src="#sky2">
<a-animation begin="click" attribute="rotation" to="0 360 0"
easing="linear" dur="2000" fill="backwards"></a-animation>
</a-box>
</a-entity>
<a-entity position="3.5 1 -1" rotation="0 45 0">
<a-box id="box3" mixin="scaledbox" src="#sky3">
<a-animation begin="click" attribute="rotation" to="0 360 0"
easing="linear" dur="2000" fill="backwards"></a-animation>
</a-box>
</a-entity>
<a-entity position="0 3 0" rotation="0 45 0" scale=".5 .5 .5">
<a-box id="redbox" material="color:red;">
<a-animation begin="click" attribute="rotation" to="0 360 0"
easing="linear" dur="2000" fill="backwards"></a-animation>
</a-box>
<a-entity position="-3.5 1 -1" rotation="0 -45 0">
</a-scene>
<script type="text/javascript">
var sky = document.getElementById("skybox");
var box1 = document.getElementById("box1");
var box2 = document.getElementById("box2");
var box3 = document.getElementById("box3");
box1.addEventListener("click" , function() {
sky.setAttribute("src" , box1.getAttribute("src"));
});
box2.addEventListener("click" , function() {
sky.setAttribute("src" , box2.getAttribute("src"));
});
box3.addEventListener("click" , function() {
sky.setAttribute("src" , box3.getAttribute("src"));
});
</script>
</body>
</html>
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/7gAOQWRvYmUAZMAAAAAB/9sAQwABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAgICAgICAgICAgIDAwMDAwMDAwMD/9sAQwEBAQEBAQECAQECAgIBAgIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMD/8AAEQgEAAQAAwERAAIRAQMRAf/EAB4AAAICAwEBAQEAAAAAAAAAAAABAgUDBAYHCAkK/8QAZRAAAQIEAwUFBwIEAQYICQIXAQIDAAQFERIhMQZBUWHwBxNxgZEUIqGxwdHhM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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWFlaIAAAAAAAAPNRAAEAAAABFsxYWVogAAAAAAAAAAAAAAAAAAAAAGN1cnYAAAAAAAAAAQIzAABjdXJ2AAAAAAAAAAECMwAAY3VydgAAAAAAAAABAjMAAFhZWiAAAAAAAACcGAAAT6UAAAT8WF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment