define("domReady",[],function(){"use strict";function t(){var t=c;h&&t.length&&(c=[],function(t){var e;for(e=0;e=r[t].size){if(n===r[t])return;return n=r[t],h.dispatch({type:"change"})}}()},h=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(e=!0,a=o(),s(),window.addEventListener("resize",s,!1),window.addEventListener("orientationchange",s,!1),window.addEventListener("load",s,!1)),{eventEmitter:h,getData:function(){return{breakpoint:n}}}}),define("touch/touch.store",["dispatcher","resize/breakpoint.store"],function(t,e){"use strict";var i,r,n,a,o,s,h=!1,l=function(){var t=e.getData();(n=r?"desktop"!==t.breakpoint.name:!!i||"desktop"!==t.breakpoint.name)!==a&&((a=n)?(o.classList.add("touch-detected"),o.classList.remove("touch-undetected")):(o.classList.remove("touch-detected"),o.classList.add("touch-undetected")),c.dispatch())},c=(s=[],{dispatch:function(t){for(var e=s.length-1;0<=e;e--)s[e](t)},subscribe:function(t){s.push(t)},unsubscribe:function(t){for(var e=0;e<=s.length-1;e++)s[e]==t&&s.splice(e--,1)}});return h||(h=!0,o=document.getElementsByTagName("html")[0],i="ontouchstart"in window,r=-1i.offsetHeight){e=i,t.fastClickScrollParent=i;break}i=i.parentElement}while(i)}e&&(e.fastClickLastScrollTop=e.scrollTop)},o.prototype.getTargetElementFromEventTarget=function(t){return t.nodeType===Node.TEXT_NODE?t.parentNode:t},o.prototype.onTouchStart=function(t){var e,i,r;if(1i||Math.abs(e.pageY-this.touchStartY)>i},o.prototype.onTouchMove=function(t){return!this.trackingClick||((this.targetElement!==this.getTargetElementFromEventTarget(t.target)||this.touchHasMoved(t))&&(this.trackingClick=!1,this.targetElement=null),!0)},o.prototype.findControl=function(t){return void 0!==t.control?t.control:t.htmlFor?document.getElementById(t.htmlFor):t.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},o.prototype.onTouchEnd=function(t){var e,i,r,n,a,o=this.targetElement;if(!this.trackingClick)return!0;if(t.timeStamp-this.lastClickTime>0,0!==this._cycle&&this._cycle===this._totalTime/o&&this._cycle--,this._time=this._totalTime-this._cycle*o,this._yoyo&&0!=(1&this._cycle)&&(this._time=m-this._time),this._time>m?this._time=m:this._time<0&&(this._time=0)),this._easeType?(s=this._time/m,(1===(h=this._easeType)||3===h&&.5<=s)&&(s=1-s),3===h&&(s*=2),1===(l=this._easePower)?s*=s:2===l?s*=s*s:3===l?s*=s*s*s:4===l&&(s*=s*s*s*s),1===h?this.ratio=1-s:2===h?this.ratio=s:this._time/m<.5?this.ratio=s/2:this.ratio=1-s/2):this.ratio=this._ease.getRatio(this._time/m)),d!==this._time||i||f!==this._cycle){if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!i&&this._firstPT&&(!1!==this.vars.lazy&&this._duration||this.vars.lazy&&!this._duration))return this._time=d,this._totalTime=p,this._rawPrevTime=E,this._cycle=f,T.lazyTweens.push(this),void(this._lazy=[t,e]);this._time&&!r?this.ratio=this._ease.getRatio(this._time/m):r&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(!1!==this._lazy&&(this._lazy=!1),this._active||!this._paused&&this._time!==d&&0<=t&&(this._active=!0),0===p&&(2===this._initted&&0this._duration&&(t=this._duration),this._yoyo&&0!=(1&this._cycle)?t=this._duration-t+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(t+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(t,e)):this._time},t.duration=function(t){return arguments.length?r.prototype.duration.call(this,t):this._duration},t.totalDuration=function(t){return arguments.length?-1===this._repeat?this:this.duration((t-this._repeat*this._repeatDelay)/(this._repeat+1)):(this._dirty&&(this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat,this._dirty=!1),this._totalDuration)},t.repeat=function(t){return arguments.length?(this._repeat=t,this._uncache(!0)):this._repeat},t.repeatDelay=function(t){return arguments.length?(this._repeatDelay=t,this._uncache(!0)):this._repeatDelay},t.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},y},!0),_gsScope._gsDefine("TimelineLite",["core.Animation","core.SimpleTimeline","TweenLite"],function(c,u,d){var p=function(t){u.call(this,t),this._labels={},this.autoRemoveChildren=!0===this.vars.autoRemoveChildren,this.smoothChildTiming=!0===this.vars.smoothChildTiming,this._sortChildren=!0,this._onUpdate=this.vars.onUpdate;var e,i,r=this.vars;for(i in r)e=r[i],m(e)&&-1!==e.join("").indexOf("{self}")&&(r[i]=this._swapSelfInParams(e));m(r.tweens)&&this.add(r.tweens,0,r.align,r.stagger)},t=d._internals,e=p._internals={},f=t.isSelector,m=t.isArray,E=t.lazyTweens,g=t.lazyRender,o=_gsScope._gsDefine.globals,v=function(t){var e,i={};for(e in t)i[e]=t[e];return i},y=function(t,e,i){var r,n,a=t.cycle;for(r in a)n=a[r],t[r]="function"==typeof n?n.call(e[i],i):n[i%n.length];delete t.cycle},a=e.pauseCallback=function(){},T=function(t){var e,i=[],r=t.length;for(e=0;e!==r;i.push(t[e++]));return i},i=p.prototype=new u;return p.version="1.18.0",i.constructor=p,i.kill()._gc=i._forcingPlayhead=i._hasPause=!1,i.to=function(t,e,i,r){var n=i.repeat&&o.TweenMax||d;return e?this.add(new n(t,e,i),r):this.set(t,i,r)},i.from=function(t,e,i,r){return this.add((i.repeat&&o.TweenMax||d).from(t,e,i),r)},i.fromTo=function(t,e,i,r,n){var a=r.repeat&&o.TweenMax||d;return e?this.add(a.fromTo(t,e,i,r),n):this.set(t,r,n)},i.staggerTo=function(t,e,i,r,n,a,o,s){var h,l,c=new p({onComplete:a,onCompleteParams:o,callbackScope:s,smoothChildTiming:this.smoothChildTiming}),u=i.cycle;for("string"==typeof t&&(t=d.selector(t)||t),f(t=t||[])&&(t=T(t)),(r=r||0)<0&&((t=T(t)).reverse(),r*=-1),l=0;lt._startTime;h._timeline;)l&&h._timeline.smoothChildTiming?h.totalTime(h._totalTime,!0):h._gc&&h._enabled(!0,!1),h=h._timeline;return this},i.remove=function(t){if(t instanceof c){this._remove(t,!1);var e=t._timeline=t.vars.useFrames?c._rootFramesTimeline:c._rootTimeline;return t._startTime=(t._paused?t._pauseTime:e._time)-(t._reversed?t.totalDuration()-t._totalTime:t._totalTime)/t._timeScale,this}if(t instanceof Array||t&&t.push&&m(t)){for(var i=t.length;-1<--i;)this.remove(t[i]);return this}return"string"==typeof t?this.removeLabel(t):this.kill(null,t)},i._remove=function(t,e){u.prototype._remove.call(this,t,e);var i=this._last;return i?this._time>i._startTime+i._totalDuration/i._timeScale&&(this._time=this.duration(),this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},i.append=function(t,e){return this.add(t,this._parseTimeOrLabel(null,e,!0,t))},i.insert=i.insertMultiple=function(t,e,i,r){return this.add(t,e||0,i,r)},i.appendMultiple=function(t,e,i,r){return this.add(t,this._parseTimeOrLabel(null,e,!0,t),i,r)},i.addLabel=function(t,e){return this._labels[t]=this._parseTimeOrLabel(e),this},i.addPause=function(t,e,i,r){var n=d.delayedCall(0,a,i,r||this);return n.vars.onComplete=n.vars.onReverseComplete=e,n.data="isPause",this._hasPause=!0,this.add(n,t)},i.removeLabel=function(t){return delete this._labels[t],this},i.getLabelTime=function(t){return null!=this._labels[t]?this._labels[t]:-1},i._parseTimeOrLabel=function(t,e,i,r){var n;if(r instanceof c&&r.timeline===this)this.remove(r);else if(r&&(r instanceof Array||r.push&&m(r)))for(n=r.length;-1<--n;)r[n]instanceof c&&r[n].timeline===this&&this.remove(r[n]);if("string"==typeof e)return this._parseTimeOrLabel(e,i&&"number"==typeof t&&null==this._labels[e]?t-this.duration():0,i);if(e=e||0,"string"!=typeof t||!isNaN(t)&&null==this._labels[t])null==t&&(t=this.duration());else{if(-1===(n=t.indexOf("=")))return null==this._labels[t]?i?this._labels[t]=this.duration()+e:e:this._labels[t]+e;e=parseInt(t.charAt(n-1)+"1",10)*Number(t.substr(n+1)),t=1=t&&!h;)r._duration||"isPause"===r.data&&0=c)for(r=this._first;r&&(a=r._next,!this._paused||p);)(r._active||r._startTime<=this._time&&!r._paused&&!r._gc)&&(h===r&&this.pause(),r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)),r=a;else for(r=this._last;r&&(a=r._prev,!this._paused||p);){if(r._active||r._startTime<=c&&!r._paused&&!r._gc){if(h===r){for(h=r._prev;h&&h.endTime()>this._time;)h.render(h._reversed?h.totalDuration()-(t-h._startTime)*h._timeScale:(t-h._startTime)*h._timeScale,e,i),h=h._prev;h=null,this.pause()}r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)}r=a}this._onUpdate&&(e||(E.length&&g(),this._callback("onUpdate"))),o&&(this._gc||u!==this._startTime&&d===this._timeScale||(0===this._time||l>=this.totalDuration())&&(n&&(E.length&&g(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[o]&&this._callback(o)))}},i._hasPausedChild=function(){for(var t=this._first;t;){if(t._paused||t instanceof p&&t._hasPausedChild())return!0;t=t._next}return!1},i.getChildren=function(t,e,i,r){r=r||-9999999999;for(var n=[],a=this._first,o=0;a;)a._startTime=i&&(n._startTime+=t),n=n._next;if(e)for(r in a)a[r]>=i&&(a[r]+=t);return this._uncache(!0)},i._kill=function(t,e){if(!t&&!e)return this._enabled(!1,!1);for(var i=e?this.getTweensOf(e):this.getChildren(!0,!0,!1),r=i.length,n=!1;-1<--r;)i[r]._kill(t,e)&&(n=!0);return n},i.clear=function(t){var e=this.getChildren(!1,!0,!0),i=e.length;for(this._time=this._totalTime=0;-1<--i;)e[i]._enabled(!1,!1);return!1!==t&&(this._labels={}),this._uncache(!0)},i.invalidate=function(){for(var t=this._first;t;)t.invalidate(),t=t._next;return c.prototype.invalidate.call(this)},i._enabled=function(t,e){if(t===this._gc)for(var i=this._first;i;)i._enabled(t,!0),i=i._next;return u.prototype._enabled.call(this,t,e)},i.totalTime=function(t,e,i){this._forcingPlayhead=!0;var r=c.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,r},i.duration=function(t){return arguments.length?(0!==this.duration()&&0!==t&&this.timeScale(this._duration/t),this):(this._dirty&&this.totalDuration(),this._duration)},i.totalDuration=function(t){if(!arguments.length){if(this._dirty){for(var e,i,r=0,n=this._last,a=999999999999;n;)e=n._prev,n._dirty&&n.totalDuration(),n._startTime>a&&this._sortChildren&&!n._paused?this.add(n,n._startTime-n._delay):a=n._startTime,n._startTime<0&&!n._paused&&(r-=n._startTime,this._timeline.smoothChildTiming&&(this._startTime+=n._startTime/this._timeScale),this.shiftChildren(-n._startTime,!1,-9999999999),a=0),r<(i=n._startTime+n._totalDuration/n._timeScale)&&(r=i),n=e;this._duration=this._totalDuration=r,this._dirty=!1}return this._totalDuration}return 0!==this.totalDuration()&&0!==t&&this.timeScale(this._totalDuration/t),this},i.paused=function(t){if(!t)for(var e=this._first,i=this._time;e;)e._startTime===i&&"isPause"===e.data&&(e._rawPrevTime=0),e=e._next;return c.prototype.paused.apply(this,arguments)},i.usesFrames=function(){for(var t=this._timeline;t._timeline;)t=t._timeline;return t===c._rootFramesTimeline},i.rawTime=function(){return this._paused?this._totalTime:(this._timeline.rawTime()-this._startTime)*this._timeScale},p},!0),_gsScope._gsDefine("TimelineMax",["TimelineLite","TweenLite","easing.Ease"],function(e,o,t){var i=function(t){e.call(this,t),this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._cycle=0,this._yoyo=!0===this.vars.yoyo,this._dirty=!0},r=o._internals,w=r.lazyTweens,H=r.lazyRender,s=new t(null,null,1,0),n=i.prototype=new e;return n.constructor=i,n.kill()._gc=!1,i.version="1.18.0",n.invalidate=function(){return this._yoyo=!0===this.vars.yoyo,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),e.prototype.invalidate.call(this)},n.addCallback=function(t,e,i,r){return this.add(o.delayedCall(0,t,i,r),e)},n.removeCallback=function(t,e){if(t)if(null==e)this._kill(null,t);else for(var i=this.getTweensOf(t,!1),r=i.length,n=this._parseTimeOrLabel(e);-1<--r;)i[r]._startTime===n&&i[r]._enabled(!1,!1);return this},n.removePause=function(t){return this.removeCallback(e._internals.pauseCallback,t)},n.tweenTo=function(t,e){e=e||{};var i,r,n,a={ease:s,useFrames:this.usesFrames(),immediateRender:!1};for(r in e)a[r]=e[r];return a.time=this._parseTimeOrLabel(t),i=Math.abs(Number(a.time)-this._time)/this._timeScale||.001,n=new o(this,i,a),a.onStart=function(){n.target.paused(!0),n.vars.time!==n.target.time()&&i===n.duration()&&n.duration(Math.abs(n.vars.time-n.target.time())/n.target._timeScale),e.onStart&&n._callback("onStart")},n},n.tweenFromTo=function(t,e,i){i=i||{},t=this._parseTimeOrLabel(t),i.startAt={onComplete:this.seek,onCompleteParams:[t],callbackScope:this},i.immediateRender=!1!==i.immediateRender;var r=this.tweenTo(e,i);return r.duration(Math.abs(r.vars.time-t)/this._timeScale||.001)},n.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var r,n,a,o,s,h,l,c=this._dirty?this.totalDuration():this._totalDuration,u=this._duration,d=this._time,p=this._totalTime,f=this._startTime,m=this._timeScale,E=this._rawPrevTime,g=this._paused,v=this._cycle;if(c<=t)this._locked||(this._totalTime=c,this._cycle=this._repeat),this._reversed||this._hasPausedChild()||(n=!0,o="onComplete",s=!!this._timeline.autoRemoveChildren,0===this._duration&&(0===t||E<0||1e-10===E)&&E!==t&&this._first&&(s=!0,1e-10>0,0!==this._cycle&&this._cycle===this._totalTime/h&&this._cycle--,this._time=this._totalTime-this._cycle*h,this._yoyo&&0!=(1&this._cycle)&&(this._time=u-this._time),this._time>u?t=(this._time=u)+1e-4:this._time<0?this._time=t=0:t=this._time)),this._hasPause&&!this._forcingPlayhead&&!e){if((t=this._time)>=d)for(r=this._first;r&&r._startTime<=t&&!l;)r._duration||"isPause"!==r.data||r.ratio||0===r._startTime&&0===this._rawPrevTime||(l=r),r=r._next;else for(r=this._last;r&&r._startTime>=t&&!l;)r._duration||"isPause"===r.data&&0=d)for(r=this._first;r&&(a=r._next,!this._paused||g);)(r._active||r._startTime<=this._time&&!r._paused&&!r._gc)&&(l===r&&this.pause(),r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)),r=a;else for(r=this._last;r&&(a=r._prev,!this._paused||g);){if(r._active||r._startTime<=d&&!r._paused&&!r._gc){if(l===r){for(l=r._prev;l&&l.endTime()>this._time;)l.render(l._reversed?l.totalDuration()-(t-l._startTime)*l._timeScale:(t-l._startTime)*l._timeScale,e,i),l=l._prev;l=null,this.pause()}r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)}r=a}this._onUpdate&&(e||(w.length&&H(),this._callback("onUpdate"))),o&&(this._locked||this._gc||f!==this._startTime&&m===this._timeScale||(0===this._time||c>=this.totalDuration())&&(n&&(w.length&&H(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[o]&&this._callback(o)))}else p!==this._totalTime&&this._onUpdate&&(e||this._callback("onUpdate"))},n.getActive=function(t,e,i){null==t&&(t=!0),null==e&&(e=!0),null==i&&(i=!1);var r,n,a=[],o=this.getChildren(t,e,i),s=0,h=o.length;for(r=0;rt)return i[e].name;return null},n.getLabelBefore=function(t){null==t&&(t=this._time);for(var e=this.getLabelsArray(),i=e.length;-1<--i;)if(e[i].timethis._duration&&(t=this._duration),this._yoyo&&0!=(1&this._cycle)?t=this._duration-t+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(t+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(t,e)):this._time},n.repeat=function(t){return arguments.length?(this._repeat=t,this._uncache(!0)):this._repeat},n.repeatDelay=function(t){return arguments.length?(this._repeatDelay=t,this._uncache(!0)):this._repeatDelay},n.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},n.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.getLabelBefore(this._time+1e-8)},i},!0),x=180/Math.PI,R=[],_=[],b=[],g={},i=_gsScope._gsDefine.globals,v=function(t,e,i,r){this.a=t,this.b=e,this.c=i,this.d=r,this.da=r-t,this.ca=i-t,this.ba=e-t},w=function(t,e,i,r){var n={a:t},a={},o={},s={c:r},h=(t+e)/2,l=(e+i)/2,c=(i+r)/2,u=(h+l)/2,d=(l+c)/2,p=(d-u)/8;return n.b=h+(t-h)/4,a.b=u+p,n.c=a.a=(n.b+a.b)/2,a.c=o.a=(u+d)/2,o.b=d-p,s.b=c+(r-c)/4,o.c=s.a=(o.b+s.b)/2,[n,a,o,s]},y=function(t,e,i,r,n){var a,o,s,h,l,c,u,d,p,f,m,E,g,v=t.length-1,y=0,T=t[0].a;for(a=0;a>0||6)-1,u=[],d=[];for(i in t)f(t[i],o,e);for(n=o.length,r=0;r>0]=d,s[a]=l,h=0,d=[]);return{length:l,lengths:s,segments:u}}(this._beziers,this._timeRes);this._length=d.length,this._lengths=d.lengths,this._segments=d.segments,this._l1=this._li=this._s1=this._si=0,this._l2=this._lengths[0],this._curSeg=this._segments[0],this._s2=this._curSeg[0],this._prec=1/this._curSeg.length}if(u=this._autoRotate)for(this._initialRotations=[],u[0]instanceof Array||(this._autoRotate=u=[u]),a=u.length;-1<--a;){for(o=0;o<3;o++)r=u[a][o],this._func[r]="function"==typeof t[r]&&t[r.indexOf("set")||"function"!=typeof t["get"+r.substr(3)]?r:"get"+r.substr(3)];r=u[a][2],this._initialRotations[a]=this._func[r]?this._func[r].call(this._target):this._target[r]}return this._startRatio=i.vars.runBackwards?1:0,!0},set:function(t){var e,i,r,n,a,o,s,h,l,c,u=this._segCount,d=this._func,p=this._target,f=t!==this._startRatio;if(this._timeRes){if(l=this._lengths,c=this._curSeg,t*=this._length,r=this._li,t>this._l2&&r=t;);0===r&&tthis._s2&&r=t;);0===r&&t>0)*(1/u))*u;for(i=1-o,r=this._props.length;-1<--r;)n=this._props[r],s=(o*o*(a=this._beziers[n][e]).da+3*i*(o*a.ca+i*a.ba))*o+a.a,this._round[n]&&(s=Math.round(s)),d[n]?p[n](s):p[n]=s;if(this._autoRotate){var m,E,g,v,y,T,R,_=this._autoRotate;for(r=_.length;-1<--r;)n=_[r][2],T=_[r][3]||0,R=!0===_[r][4]?1:x,a=this._beziers[_[r][0]],m=this._beziers[_[r][1]],a&&m&&(a=a[e],m=m[e],E=a.a+(a.b-a.a)*o,E+=((v=a.b+(a.c-a.b)*o)-E)*o,v+=(a.c+(a.d-a.c)*o-v)*o,g=m.a+(m.b-m.a)*o,g+=((y=m.b+(m.c-m.b)*o)-g)*o,y+=(m.c+(m.d-m.c)*o-y)*o,s=f?Math.atan2(y-g,v-E)*R+T:this._initialRotations[r],d[n]?p[n](s):p[n]=s)}}}),r=E.prototype,E.bezierThrough=p,E.cubicToQuadratic=w,E._autoCSS=!0,E.quadraticToCubic=function(t,e,i){return new v(t,(2*e+t)/3,(2*e+i)/3,i)},E._cssRegister=function(){var t=i.CSSPlugin;if(t){var e=t._internals,p=e._parseToProxy,f=e._setPluginRatio,m=e.CSSPropTween;e._registerComplexSpecialProp("bezier",{parser:function(t,e,i,r,n,a){e instanceof Array&&(e={values:e}),a=new E;var o,s,h,l=e.values,c=l.length-1,u=[],d={};if(c<0)return n;for(o=0;o<=c;o++)h=p(t,l[o],r,n,a,c!==o),u[o]=h.end;for(s in e)d[s]=e[s];return d.values=u,(n=new m(t,"bezier",0,0,h.pt,2)).data=h,n.plugin=a,n.setRatio=f,0===d.autoRotate&&(d.autoRotate=!0),!d.autoRotate||d.autoRotate instanceof Array||(o=!0===d.autoRotate?0:Number(d.autoRotate),d.autoRotate=null!=h.end.left?[["left","top","rotation",o,!1]]:null!=h.end.x&&[["x","y","rotation",o,!1]]),d.autoRotate&&(r._transform||r._enableTransforms(!1),h.autoRotate=r._target._gsTransform),a._onInitTween(h.proxy,d,r._tween),n}})}},r._roundProps=function(t,e){for(var i=this._overwriteProps,r=i.length;-1<--r;)(t[i[r]]||t.bezier||t.bezierThrough)&&(this._round[i[r]]=e)},r._kill=function(t){var e,i,r=this._props;for(e in this._beziers)if(e in t)for(delete this._beziers[e],delete this._func[e],i=r.length;-1<--i;)r[i]===e&&r.splice(i,1);return this._super._kill.call(this,t)},_gsScope._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(a,U){var f,b,V,p,I=function(){a.call(this,"css"),this._overwriteProps.length=0,this.setRatio=I.prototype.setRatio},l=_gsScope._gsDefine.globals,m={},t=I.prototype=new a("css");(t.constructor=I).version="1.18.0",I.API=2,I.defaultTransformPerspective=0,I.defaultSkewType="compensated",I.defaultSmoothOrigin=!0,t="px",I.suffixMap={top:t,right:t,bottom:t,left:t,width:t,height:t,fontSize:t,padding:t,margin:t,perspective:t,lineHeight:""};var M,E,g,O,v,w,e,i,S=/(?:\d|\-\d|\.\d|\-\.\d)+/g,C=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,y=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,c=/(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g,H=/(?:\d|\-|\+|=|#|\.)*/g,A=/opacity *= *([^)]*)/i,T=/opacity:([^;]*)/i,o=/alpha\(opacity *=.+?\)/i,R=/^(rgb|hsl)/,s=/([A-Z])/g,h=/-([a-z])/gi,_=/(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,u=function(t,e){return e.toUpperCase()},d=/(?:Left|Right|Width)/i,x=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,P=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,L=/,(?=[^\)]*(?:\(|$))/gi,N=Math.PI/180,G=180/Math.PI,k={},D=document,r=function(t){return D.createElementNS?D.createElementNS("http://www.w3.org/1999/xhtml",t):D.createElement(t)},F=r("div"),z=r("img"),n=I._internals={_specialProps:m},B=navigator.userAgent,W=(e=B.indexOf("Android"),i=r("a"),g=-1!==B.indexOf("Safari")&&-1===B.indexOf("Chrome")&&(-1===e||3>16,t>>8&255,255&t];else{if(","===t.charAt(t.length-1)&&(t=t.substr(0,t.length-1)),lt[t])i=lt[t];else if("#"===t.charAt(0))4===t.length&&(t="#"+(r=t.charAt(1))+r+(n=t.charAt(2))+n+(a=t.charAt(3))+a),i=[(t=parseInt(t.substr(1),16))>>16,t>>8&255,255&t];else if("hsl"===t.substr(0,3))if(i=d=t.match(S),e){if(-1!==t.indexOf("="))return t.match(C)}else o=Number(i[0])%360/360,s=Number(i[1])/100,r=2*(h=Number(i[2])/100)-(n=h<=.5?h*(s+1):h+s-h*s),3r--)for(;++rr--)for(;++r>0];return r.parse(t,o,n,a)}},Et=(n._setPluginRatio=function(t){this.plugin.setRatio(t);for(var e,i,r,n,a=this.data,o=a.proxy,s=a.firstMPT;s;)e=o[s.v],s.r?e=Math.round(e):e<1e-6&&-1e-6s.length?h.length:s.length,o=0;on.pr;)a=a._next;(n._prev=a?a._prev:s)?n._prev._next=n:o=n,(n._next=a)?a._prev=n:s=n,n=h}this._firstPT=o}return!0},t.parse=function(t,e,i,r){var n,a,o,s,h,l,c,u,d,p,f=t.style;for(n in e)l=e[n],(a=m[n])?i=a.parse(t,l,n,this,i,r,e):(h=Z(t,n,V)+"",d="string"==typeof l,"color"===n||"fill"===n||"stroke"===n||-1!==n.indexOf("Color")||d&&R.test(l)?(d||(l=(3<(l=ut(l)).length?"rgba(":"rgb(")+l.join(",")+")"),i=yt(f,n,h,l,!0,"transparent",i,0,r)):!d||-1===l.indexOf(" ")&&-1===l.indexOf(",")?(c=(o=parseFloat(h))||0===o?h.substr((o+"").length):"",""!==h&&"auto"!==h||("width"===n||"height"===n?(o=nt(t,n,V),c="px"):"left"===n||"top"===n?(o=$(t,n,V),c="px"):(o="opacity"!==n?0:1,c="")),(p=d&&"="===l.charAt(1))?(s=parseInt(l.charAt(0)+"1",10),l=l.substr(2),s*=parseFloat(l),u=l.replace(H,"")):(s=parseFloat(l),u=d?l.replace(H,""):""),""===u&&(u=n in b?b[n]:c),l=s||0===s?(p?s+o:s)+u:e[n],c!==u&&""!==u&&(s||0===s)&&o&&(o=J(t,n,o,c),"%"===u?(o/=J(t,n,100,"%")/100,!0!==e.strictUnits&&(h=o+"%")):"em"===u||"rem"===u?o/=J(t,n,1,u):"px"!==u&&(s=J(t,n,s,u),u="px"),p&&(s||0===s)&&(l=s+o+u)),p&&(s+=o),!o&&0!==o||!s&&0!==s?void 0!==f[n]&&(l||l+""!="NaN"&&null!=l)?(i=new gt(f,n,s||o||0,0,i,-1,n,!1,0,h,l)).xs0="none"!==l||"display"!==n&&-1===n.indexOf("Style")?l:h:q("invalid "+n+" tween value: "+e[n]):(i=new gt(f,n,o,s-o,i,0,n,!1!==M&&("px"===u||"zIndex"===n),0,h,l)).xs0=u):i=yt(f,n,h,l,!0,null,i,0,r)),r&&i&&!i.plugin&&(i.plugin=r);return i},t.setRatio=function(t){var e,i,r,n=this._firstPT;if(1!==t||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(t||this._tween._time!==this._tween._duration&&0!==this._tween._time||-1e-6===this._tween._rawPrevTime)for(;n;){if(e=n.c*t+n.s,n.r?e=Math.round(e):e<1e-6&&-1e-6this._p3?this._calcEnd?1-(t=(t-this._p3)/this._p1)*t:e+(t-e)*(t=(t-this._p3)/this._p1)*t*t*t:this._calcEnd?1:e},p.ease=new p(.7,.7),f.config=p.config=function(t,e,i){return new p(t,e,i)},(f=(e=s("easing.SteppedEase",function(t){t=t||1,this._p1=1/t,this._p2=t+1},!0)).prototype=new E).constructor=e,f.getRatio=function(t){return t<0?t=0:1<=t&&(t=.999999999),(this._p2*t>>0)*this._p1},f.config=e.config=function(t){return new e(t)},(f=(i=s("easing.RoughEase",function(t){for(var e,i,r,n,a,o,s=(t=t||{}).taper||"none",h=[],l=0,c=0|(t.points||20),u=c,d=!1!==t.randomize,p=!0===t.clamp,f=t.template instanceof E?t.template:null,m="number"==typeof t.strength?.4*t.strength:.4;-1<--u;)e=d?Math.random():1/c*u,i=f?f.getRatio(e):e,"none"===s?r=m:"out"===s?r=(n=1-e)*n*m:"in"===s?r=e*e*m:r=(n=e<.5?2*e:2*(1-e))*n*.5*m,d?i+=Math.random()*r-.5*r:u%2?i+=.5*r:i-=.5*r,p&&(1e.t){for(;e.next&&t>=e.t;)e=e.next;e=e.prev}else for(;e.prev&&t<=e.t;)e=e.prev;return(this._prev=e).v+(t-e.t)/e.gap*e.c},f.config=function(t){return new i(t)},i.ease=new i,c("Bounce",h("BounceOut",function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}),h("BounceIn",function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}),h("BounceInOut",function(t){var e=t<.5;return(t=e?1-2*t:2*t-1)<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5})),c("Circ",h("CircOut",function(t){return Math.sqrt(1-(t-=1)*t)}),h("CircIn",function(t){return-(Math.sqrt(1-t*t)-1)}),h("CircInOut",function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)})),c("Elastic",(t=function(t,e,i){var r=s("easing."+t,function(t,e){this._p1=1<=t?t:1,this._p2=(e||i)/(t<1?t:1),this._p3=this._p2/a*(Math.asin(1/this._p1)||0),this._p2=a/this._p2},!0),n=r.prototype=new E;return n.constructor=r,n.getRatio=e,n.config=function(t,e){return new r(t,e)},r})("ElasticOut",function(t){return this._p1*Math.pow(2,-10*t)*Math.sin((t-this._p3)*this._p2)+1},.3),t("ElasticIn",function(t){return-this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*this._p2)},.3),t("ElasticInOut",function(t){return(t*=2)<1?this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*this._p2)*-.5:this._p1*Math.pow(2,-10*(t-=1))*Math.sin((t-this._p3)*this._p2)*.5+1},.45)),c("Expo",h("ExpoOut",function(t){return 1-Math.pow(2,-10*t)}),h("ExpoIn",function(t){return Math.pow(2,10*(t-1))-.001}),h("ExpoInOut",function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))})),c("Sine",h("SineOut",function(t){return Math.sin(t*o)}),h("SineIn",function(t){return 1-Math.cos(t*o)}),h("SineInOut",function(t){return-.5*(Math.cos(Math.PI*t)-1)})),s("easing.EaseLookup",{find:function(t){return E.map[t]}},!0),l(r.SlowMo,"SlowMo","ease,"),l(i,"RoughEase","ease,"),l(e,"SteppedEase","ease,"),d},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(p,t){"use strict";var e,i,f=p.GreenSockGlobals=p.GreenSockGlobals||p;if(!f.TweenLite){var r,n,a,m,E,g=function(t){var e,i=t.split("."),r=f;for(e=0;e=i&&tthis._duration?this._duration:t,e)):this._time},a.totalTime=function(t,e,i){if(E||m.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(t<0&&!i&&(t+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var r=this._totalDuration,n=this._timeline;if(ra;)n=n._prev;return n?(t._next=n._next,n._next=t):(t._next=this._first,this._first=t),t._next?t._next._prev=t:this._last=t,t._prev=n,this._recent=t,this._timeline&&this._uncache(!0),this},a._remove=function(t,e){return t.timeline===this&&(e||t._enabled(!1,!0),t._prev?t._prev._next=t._next:this._first===t&&(this._first=t._next),t._next?t._next._prev=t._prev:this._last===t&&(this._last=t._prev),t._next=t._prev=t.timeline=null,t===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},a.render=function(t,e,i){var r,n=this._first;for(this._totalTime=this._time=this._rawPrevTime=t;n;)r=n._next,(n._active||t>=n._startTime&&!n._paused)&&(n._reversed?n.render((n._dirty?n.totalDuration():n._totalDuration)-(t-n._startTime)*n._timeScale,e,i):n.render((t-n._startTime)*n._timeScale,e,i)),n=r},a.rawTime=function(){return E||m.wake(),this._totalTime};var L=d("TweenLite",function(t,e,i){if(C.call(this,e,i),this.render=L.prototype.render,null==t)throw"Cannot tween a null target.";this.target=t="string"!=typeof t?t:L.selector(t)||t;var r,n,a,o=t.jquery||t.length&&t!==p&&t[0]&&(t[0]===p||t[0].nodeType&&t[0].style&&!t.nodeType),s=this.vars.overwrite;if(this._overwrite=s=null==s?j[L.defaultOverwrite]:"number"==typeof s?s>>0:j[s],(o||t instanceof Array||t.push&&y(t))&&"number"!=typeof t[0])for(this._targets=a=h(t),this._propLookup=[],this._siblings=[],r=0;r=Y){for(i in Y=m.frame+(parseInt(L.autoSleep,10)||120),I){for(t=(e=I[i].tweens).length;-1<--t;)e[t]._gc&&e.splice(t,1);0===e.length&&delete I[i]}if((!(i=X._first)||i._paused)&&L.autoSleep&&!q._first&&1===m._listeners.tick.length){for(;i&&i._paused;)i=i._next;i||m.sleep()}}},m.addEventListener("tick",C._updateRoot);var Q=function(t,e,i){var r,n,a=t._gsTweenID;if(I[a||(t._gsTweenID=a="t"+G++)]||(I[a]={target:t,tweens:[]}),e&&((r=I[a].tweens)[n=r.length]=e,i))for(;-1<--n;)r[n]===e&&r.splice(n,1);return I[a].tweens},Z=function(t,e,i,r){var n,a,o=t.vars.onOverwrite;return o&&(n=o(t,e,i,r)),(o=L.onOverwrite)&&(a=o(t,e,i,r)),!1!==n&&!1!==a},J=function(t,e,i,r,n){var a,o,s,h;if(1===r||4<=r){for(h=n.length,a=0;ac&&((p||!s._initted)&&c-s._startTime<=2e-10||(u[d++]=s)));for(a=d;-1<--a;)if(s=u[a],2===r&&s._kill(i,t,e)&&(o=!0),2!==r||!s._firstPT&&s._initted){if(2!==r&&!Z(s,e))continue;s._enabled(!1,!1)&&(o=!0)}return o},$=function(t,e,i){for(var r=t._timeline,n=r._timeScale,a=t._startTime;r._timeline;){if(a+=r._startTime,n*=r._timeScale,r._paused)return-100;r=r._timeline}return e<(a/=n)?a-e:i&&a===e||!t._initted&&a-e<2e-10?1e-10:(a+=t.totalDuration()/t._timeScale/n)>e+1e-10?0:a-e-1e-10};a._init=function(){var t,e,i,r,n,a=this.vars,o=this._overwrittenProps,s=this._duration,h=!!a.immediateRender,l=a.ease;if(a.startAt){for(r in this._startAt&&(this._startAt.render(-1,!0),this._startAt.kill()),n={},a.startAt)n[r]=a.startAt[r];if(n.overwrite=!1,n.immediateRender=!0,n.lazy=h&&!1!==a.lazy,n.startAt=n.delay=null,this._startAt=L.to(this.target,0,n),h)if(0s.pr;)r=r._next;(s._prev=r?r._prev:a)?s._prev._next=s:n=s,(s._next=r)?r._prev=s:a=s,s=o}s=e._firstPT=n}for(;s;)s.pg&&"function"==typeof s.t[t]&&s.t[t]()&&(i=!0),s=s._next;return i},tt.activate=function(t){for(var e=t.length;-1<--e;)t[e].API===tt.API&&(V[(new t[e])._propName]=t[e]);return!0},o.plugin=function(t){if(!(t&&t.propName&&t.init&&t.API))throw"illegal plugin definition.";var e,i=t.propName,r=t.priority||0,n=t.overwriteProps,a={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_roundProps",initAll:"_onInitAllProps"},o=d("plugins."+i.charAt(0).toUpperCase()+i.substr(1)+"Plugin",function(){tt.call(this,i,r),this._overwriteProps=n||[]},!0===t.global),s=o.prototype=new tt(i);for(e in(s.constructor=o).API=t.API,a)"function"==typeof t[e]&&(s[a[e]]=t[e]);return o.version=t.version,tt.activate([o]),o},r=p._gsQueue){for(n=0;n=n.length&&(o=0),n[o].style.opacity=1),r(e))};e()}(),u.classList.add("prevent-scroll"),u.addEventListener("touchmove",E),d.style.display="block"},opacity:1,onComplete:function(){l.dispatch({type:"transition-step-1",animation:"menu"})}}),e.to(i,0,{opacity:1},"-=0.3")):console.warn("imgs elemeny is missing")},g=function(){var t,e,i,r,n=c.getData();!0===n.step1ready&&!1===n.step2ready&&(e=document.getElementById("simple-preloader-text"),i=a.getData().height,r=document.getElementsByClassName("page-wrapper")[0],t=new TimelineLite,"menu"===f&&(l.dispatch({type:"menu-close"}),p?window.scrollTo(0,i):window.scrollTo(0,0),t.to(e,.6,{onStart:function(){r.classList.remove("transition-animation-complete")},onComplete:function(){l.dispatch({type:"transition-step-2",animation:"menu"})},opacity:0}))),!0===n.step1ready&&!0===n.step2ready&&function(){var t,e=document.getElementById("simple-preloader-text"),i=document.getElementById("preload-imgs"),r=document.getElementsByClassName("page-wrapper")[0];if(t=new TimelineLite,"menu"===f){var n=c.getData(),a=n.scheme,o=n.pageNameId,s=n.text,h=(n.color,n.projectText);p?l.dispatch({type:"svg-text-change",id:"simple-preloader-text",text:h}):l.dispatch({type:"svg-text-change",id:"simple-preloader-text",text:s}),l.dispatch({type:"page-name-change",id:!1}),l.dispatch({type:"page-color-change",color:a}),t.to(e,.2,{}),t.to(e,.6,{opacity:1}),t.to(i,0,{opacity:0,onComplete:function(){m=!1}}),t.to(d,.6,{opacity:0,onStart:function(){r.classList.add("transition-animation-complete")},onComplete:function(){u.classList.remove("prevent-scroll"),u.removeEventListener("touchmove",E),d.style.display="none",f=!1,p?l.dispatch({type:"page-name-change",id:"projects"}):l.dispatch({type:"page-name-change",id:o}),l.dispatch({type:"transition-step-reset",animation:!1})}})}}()};return{init:function(){u=document.getElementsByTagName("body")[0],Modernizr.prefixed("transform"),r=e.getRequestAnimationFrame(),d=document.getElementById("simple-preloader"),n=document.getElementsByClassName("loop-img"),d&&(i=d.getElementsByClassName("bg"))&&i.length?i=i[0]:console.warn("simple-preloader is missing"),g(),c.eventEmitter.subscribe(g),l.subscribe(function(t){"link-animation-start"===t.type&&h(t)})}}}),define("svg-text/svg-text.store",["dispatcher"],function(t){"use strict";var i,e=!1,r={},n=("ABCDEFGHIJKLMNOPQRSTUVWXYZ ,.-АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ".split(""),{}),a=function(t){if("svg-text-change"===t.type){if(n.hasOwnProperty(t.id)&&n[t.id].text===t.text)return;n[t.id]={id:t.id,text:t.text},o.dispatch()}"svg-text-delete"===t.type&&n.hasOwnProperty(t.id)&&delete n[t.id]},o=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(e=!0,r={A:{char:"A",width:73,spacing:173,w:800,h:700,bezier:"M267 261h182l-90 209zM303 700h115l307 -700h-162l-57 130h-293l-57 -130h-160z"},B:{char:"B",width:68,spacing:168,w:800,h:700,bezier:"M220 555v-128h145q47 0 70.5 16t23.5 43q0 17 -5 30t-17 21.5t-32.5 13t-52.5 4.5h-132zM220 287v-142h134q70 0 98.5 17t28.5 55q0 37 -26.5 53.5t-92.5 16.5h-142zM65 700h313q69 0 115 -13t74.5 -37t40.5 -57t12 -72q0 -52 -19.5 -88t-48.5 -62q43 -20 67 -58.5 t24 -104.5q0 -55 -20.5 -94.5t-57 -64.5t-86.5 -37t-109 -12h-305v700z"},C:{char:"C",width:70,spacing:170,w:800,h:700,bezier:"M686 132q-48 -69 -126 -106.5t-172 -37.5q-82 0 -148 26t-112.5 73.5t-72 114.5t-25.5 148q0 75 26 141t73.5 115t114.5 77.5t148 28.5q97 0 171 -36.5t112 -96.5l-105 -96q-32 39 -78 59t-89 20q-47 0 -86 -15t-67 -42.5t-43.5 -66.5t-15.5 -88q0 -47 16 -86t44 -67 t66.5 -43.5t83.5 -15.5q59 0 108 24t85 69z"},D:{char:"D",width:72,spacing:172,w:800,h:700,bezier:"M220 555v-410h65q66 0 112.5 15t76 43t43 67.5t13.5 88.5q0 44 -12.5 80.5t-41.5 62t-76 39.5t-115 14h-65zM65 700h222q112 0 189.5 -27.5t124.5 -74.5t68 -108.5t21 -130.5q0 -75 -24 -140.5t-75 -114t-130 -76.5t-189 -28h-207v700z"},E:{char:"E",width:65,spacing:165,w:800,h:700,bezier:"M65 700h535v-145h-380v-130h355v-140h-355v-140h389v-145h-544v700z"},F:{char:"F",width:62,spacing:162,w:800,h:700,bezier:"M65 700h530v-145h-375v-153h350v-145h-350v-257h-155v700z"},G:{char:"G",width:74,spacing:174,w:800,h:700,bezier:"M365 392h326v-283q-51 -57 -124 -89t-158 -32q-83 0 -152.5 26t-119.5 73.5t-78.5 114.5t-28.5 148q0 75 26 141t74 115t114.5 77.5t147.5 28.5q45 0 88 -9t80 -25.5t67 -40t48 -51.5l-107 -96q-30 34 -73 53t-97 19q-96 0 -151.5 -56t-55.5 -156q0 -51 16.5 -90.5 t45.5 -66.5t69 -41t88 -14q35 0 69.5 10t62.5 30v74h-177v140z"},H:{char:"H",width:76,spacing:176,w:800,h:700,bezier:"M531 280h-311v-280h-155v700h155v-275h311v275h155v-700h-155v280z"},I:{char:"I",width:30,spacing:130,w:800,h:700,bezier:"M70 700h155v-700h-155v700z"},J:{char:"J",width:49,spacing:149,w:800,h:700,bezier:"M426 219q0 -113 -58 -172t-154 -59q-46 0 -82 11t-63 29.5t-46.5 43t-32.5 50.5l113 87q37 -76 97 -76q39 0 55 29t16 87v451h155v-481z"},K:{char:"K",width:71,spacing:171,w:800,h:700,bezier:"M65 700h155v-273l269 273h202l-304 -310l324 -390h-204l-237 286l-50 -51v-235h-155v700z"},L:{char:"L",width:61,spacing:161,w:800,h:700,bezier:"M65 700h155v-555h378v-145h-533v700z"},M:{char:"M",width:86,spacing:186,w:800,h:700,bezier:"M65 700h144l224 -335l213 335h140v-700h-155v420l-182 -279h-41l-188 282v-423h-155v700z"},N:{char:"N",width:74,spacing:174,w:800,h:700,bezier:"M555 0l-339 415v-415h-151v700h119l340 -416v416h151v-700h-120z"},O:{char:"O",width:79,spacing:179,w:800,h:700,bezier:"M191 350q0 -49 16.5 -88t44 -66.5t63.5 -42.5t76 -15q41 0 77.5 15t63.5 42.5t42.5 66.5t15.5 88t-17 88t-44.5 66.5t-63.5 42.5t-74 15q-40 0 -76 -15t-63.5 -42.5t-44 -66.5t-16.5 -88zM30 350q0 76 28 142t76.5 115t114.5 77t142 28q75 0 140.5 -27.5t114.5 -75.5 t77 -114.5t28 -144.5q0 -77 -28 -143.5t-77 -115t-114.5 -76t-140.5 -27.5t-141 27.5t-114.5 75.5t-77 114.5t-28.5 144.5z"},P:{char:"P",width:68,spacing:168,w:800,h:700,bezier:"M220 555v-190h133q73 0 105.5 25t32.5 70q0 21 -7 38t-22.5 30t-40.5 20t-62 7h-139zM65 0v700h290q89 0 146.5 -21.5t91 -56t46.5 -77.5t13 -86q0 -44 -15.5 -87t-50.5 -77t-91.5 -54.5t-139.5 -20.5h-135v-220h-155z"},Q:{char:"Q",width:79,spacing:179,w:800,h:700,bezier:"M191 350q0 -49 15 -88t42 -66.5t63.5 -42.5t79.5 -15q27 0 41 3.5t29 9.5l-56 64l98 83l56 -68q16 23 23.5 53.5t7.5 66.5q0 49 -15 88t-41.5 66.5t-63 42.5t-79.5 15t-79.5 -15t-63.5 -42.5t-42 -66.5t-15 -88zM30 350q0 76 27 142t75.5 115t114.5 77t144 28 q80 0 146 -27.5t113.5 -75.5t74 -114.5t26.5 -144.5q0 -69 -22 -130t-70 -112l60 -74l-108 -87l-64 78q-35 -17 -74 -27t-82 -10q-80 0 -146.5 26t-114 73t-74 114t-26.5 149z"},R:{char:"R",width:69,spacing:169,w:800,h:700,bezier:"M220 555v-171h131q57 0 88 23t31 65q0 19 -5.5 34t-20 26t-38.5 17t-61 6h-125zM65 0v700h283q84 0 138.5 -19.5t86.5 -51t45 -73t13 -84.5q0 -68 -37 -124t-100 -81l195 -267h-187l-171 239h-111v-239h-155z"},S:{char:"S",width:62,spacing:162,w:800,h:700,bezier:"M429 194q0 31 -29 48t-72 30t-94 27t-94 38t-72 63t-29 103q0 42 19 80.5t54 68t85.5 47t112.5 17.5q90 0 159.5 -34.5t114.5 -94.5l-104 -100q-30 33 -73.5 58.5t-102.5 25.5q-54 0 -79.5 -18t-25.5 -48q0 -27 29 -42t72 -27t94 -26t94 -38t72 -63.5t29 -102.5 q0 -48 -20 -88.5t-55.5 -70t-84 -46.5t-105.5 -17q-63 0 -115 14t-92.5 37.5t-69.5 54.5t-47 65l113 94q35 -56 88.5 -88t118.5 -32q59 0 84 19.5t25 45.5z"},T:{char:"T",width:61,spacing:161,w:800,h:700,bezier:"M0 700h604v-145h-225v-555h-155v555h-224v145z"},U:{char:"U",width:72,spacing:172,w:800,h:700,bezier:"M665 300q0 -82 -25.5 -140.5t-67.5 -95.5t-95.5 -54t-108.5 -17q-63 0 -119.5 19.5t-99.5 59t-68.5 98t-25.5 136.5v394h155v-376q0 -41 10 -75.5t30 -59t49.5 -38t68.5 -13.5q76 0 109 49t33 133v380h155v-400z"},V:{char:"V",width:73,spacing:173,w:800,h:700,bezier:"M427 0h-108l-329 700h171l213 -464l199 464h167z"},W:{char:"W",width:98,spacing:198,w:800,h:700,bezier:"M764 0h-126l-149 424l-145 -424h-126l-218 700h160l128 -422l140 422h124l143 -419l122 419h154z"},X:{char:"X",width:71,spacing:171,w:800,h:700,bezier:"M446 355l261 -355h-189l-164 229l-165 -229h-189l262 355l-251 345h187l157 -217l156 217h188z"},Y:{char:"Y",width:70,spacing:170,w:800,h:700,bezier:"M426 251v-251h-155v251l-281 449h185l176 -280l180 280h179z"},Z:{char:"Z",width:64,spacing:164,w:800,h:700,bezier:"M27 700h579v-103l-373 -452h382v-145h-605v103l371 452h-354v145z"},"А":{char:"А",width:73,spacing:173,w:800,h:700,bezier:"M267 261h182l-90 209zM303 700h115l307 -700h-162l-57 130h-293l-57 -130h-160z"},"Б":{char:"Б",width:67,spacing:167,w:800,h:700,bezier:"M220 296v-151h135q64 0 94 18t30 61q0 39 -27 55.5t-91 16.5h-141zM592 555h-372v-114h176q124 0 184 -57t60 -159q0 -117 -75.5 -171t-215.5 -54h-284v700h527v-145z"},"В":{char:"В",width:68,spacing:168,w:800,h:700,bezier:"M220 555v-128h145q47 0 70.5 16t23.5 43q0 17 -5 30t-17 21.5t-32.5 13t-52.5 4.5h-132zM220 287v-142h134q70 0 98.5 17t28.5 55q0 37 -26.5 53.5t-92.5 16.5h-142zM65 700h313q69 0 115 -13t74.5 -37t40.5 -57t12 -72q0 -52 -19.5 -88t-48.5 -62q43 -20 67 -58.5 t24 -104.5q0 -55 -20.5 -94.5t-57 -64.5t-86.5 -37t-109 -12h-305v700z"},"Г":{char:"Г",width:59,spacing:159,w:800,h:700,bezier:"M65 700h525v-145h-370v-555h-155v700zM298 516q-3 -126 -20 -222t-40 -149h267v410h-206zM2 145h76q10 21 22.5 57.5t23.5 93.5t19 136t8 184v84h509v-555h81v-262h-145v117h-449v-117h-145v262z"},"Д":{char:"Д",width:76,spacing:176,w:800,h:700,bezier:"M298 516q-3 -126 -20 -222t-40 -149h267v410h-206zM2 145h76q10 21 22.5 57.5t23.5 93.5t19 136t8 184v84h509v-555h81v-262h-145v117h-449v-117h-145v262z"},"Е":{char:"Е",width:65,spacing:165,w:800,h:700,bezier:"M65 700h535v-145h-380v-130h355v-140h-355v-140h389v-145h-544v700z"},"Ё":{char:"Ё",width:65,spacing:165,w:800,h:700,bezier:"M65 700h535v-145h-380v-130h355v-140h-355v-140h389v-145h-544v700zM364 831q0 33 25.5 54.5t59.5 21.5q31 0 56.5 -20.5t25.5 -55.5t-25.5 -56t-56.5 -21q-34 0 -59.5 21t-25.5 56zM115 831q0 33 24.5 54.5t60.5 21.5q15 0 30 -5.5t27 -16t19 -24.5t7 -30q0 -35 -26 -56 t-57 -21q-36 0 -60.5 21t-24.5 56z"},"Ж":{char:"Ж",width:99,spacing:199,w:800,h:700,bezier:"M-4 700h190l232 -277v277h155v-279l229 279h192l-280 -325l278 -375h-184l-215 286l-20 -30v-256h-155l1 255l-19 27l-225 -282h-176l277 360z"},"З":{char:"З",width:66,spacing:166,w:800,h:700,bezier:"M338 -12q-109 0 -194.5 35.5t-143.5 121.5l123 83q36 -48 87 -71.5t124 -23.5q39 0 64.5 5.5t41.5 16t22.5 24t6.5 30.5q0 40 -37 57.5t-109 17.5h-110v145h104q63 0 96 18t33 47q0 22 -12 36t-30 22t-39.5 11.5t-41.5 3.5q-61 0 -102 -19t-76 -58l-120 81 q47 64 120 102.5t187 38.5q133 0 201.5 -54t68.5 -150q0 -44 -16 -77t-56 -56q31 -12 49.5 -30.5t28.5 -39.5t13.5 -43.5t3.5 -43.5q0 -54 -21 -96.5t-59 -72.5t-90.5 -45.5t-116.5 -15.5z"},"И":{char:"И",width:76,spacing:176,w:800,h:700,bezier:"M65 0v700h155v-429l339 429h129v-700h-155v427l-341 -427h-127z"},"Й":{char:"Й",width:76,spacing:176,w:800,h:700,bezier:"M65 0v700h155v-429l339 429h129v-700h-155v427l-341 -427h-127zM323 893q7 -29 22.5 -40t37.5 -11q21 0 39.5 12t22.5 39h130q-2 -35 -19.5 -65t-43.5 -52t-58.5 -34.5t-64.5 -12.5q-46 0 -80.5 12.5t-58.5 34.5t-38 52t-19 65h130z"},"К":{char:"К",width:71,spacing:171,w:800,h:700,bezier:"M65 700h155v-273l269 273h202l-304 -310l324 -390h-204l-237 286l-50 -51v-235h-155v700z"},"Л":{char:"Л",width:73,spacing:173,w:800,h:700,bezier:"M507 550h-219l-4 -81q-5 -108 -16 -185.5t-27.5 -130t-37.5 -83.5t-47.5 -47t-57.5 -21t-66 -5q-9 0 -19.5 0.5t-20.5 2.5v144q14 -2 25 -2q12 0 27.5 2.5t31 18.5t26.5 48t18 86t10.5 133.5t5.5 190.5l1 79h525v-700h-155v550z"},"М":{char:"М",width:86,spacing:186,w:800,h:700,bezier:"M65 700h144l224 -335l213 335h140v-700h-155v420l-182 -279h-41l-188 282v-423h-155v700z"},"Н":{char:"Н",width:76,spacing:176,w:800,h:700,bezier:"M531 280h-311v-280h-155v700h155v-275h311v275h155v-700h-155v280z"},"О":{char:"О",width:79,spacing:179,w:800,h:700,bezier:"M191 350q0 -49 16.5 -88t44 -66.5t63.5 -42.5t76 -15q41 0 77.5 15t63.5 42.5t42.5 66.5t15.5 88t-17 88t-44.5 66.5t-63.5 42.5t-74 15q-40 0 -76 -15t-63.5 -42.5t-44 -66.5t-16.5 -88zM30 350q0 76 28 142t76.5 115t114.5 77t142 28q75 0 140.5 -27.5t114.5 -75.5 t77 -114.5t28 -144.5q0 -77 -28 -143.5t-77 -115t-114.5 -76t-140.5 -27.5t-141 27.5t-114.5 75.5t-77 114.5t-28.5 144.5z"},"П":{char:"П",width:75,spacing:175,w:800,h:700,bezier:"M530 555h-310v-555h-155v700h620v-700h-155v555z"},"Р":{char:"Р",width:68,spacing:168,w:800,h:700,bezier:"M220 555v-190h133q73 0 105.5 25t32.5 70q0 21 -7 38t-22.5 30t-40.5 20t-62 7h-139zM65 0v700h290q89 0 146.5 -21.5t91 -56t46.5 -77.5t13 -86q0 -44 -15.5 -87t-50.5 -77t-91.5 -54.5t-139.5 -20.5h-135v-220h-155z"},"С":{char:"С",width:70,spacing:170,w:800,h:700,bezier:"M686 132q-48 -69 -126 -106.5t-172 -37.5q-82 0 -148 26t-112.5 73.5t-72 114.5t-25.5 148q0 75 26 141t73.5 115t114.5 77.5t148 28.5q97 0 171 -36.5t112 -96.5l-105 -96q-32 39 -78 59t-89 20q-47 0 -86 -15t-67 -42.5t-43.5 -66.5t-15.5 -88q0 -47 16 -86t44 -67 t66.5 -43.5t83.5 -15.5q59 0 108 24t85 69z"},"Т":{char:"Т",width:61,spacing:161,w:800,h:700,bezier:"M0 700h604v-145h-225v-555h-155v555h-224v145z"},"У":{char:"У",width:73,spacing:173,w:800,h:700,bezier:"M728 700l-254 -536q-19 -39 -38.5 -69.5t-43.5 -51.5t-52.5 -32t-65.5 -11q-34 0 -71.5 16.5t-69.5 63.5l100 91q17 -26 43 -26q12 0 25 8t25 34l-326 513h192l213 -348l161 348h162z"},"Ф":{char:"Ф",width:90,spacing:190,w:800,h:700,bezier:"M185 360q0 -29 10.5 -56t33 -47.5t57.5 -33t83 -12.5h3v298q-102 0 -144.5 -36.5t-42.5 -112.5zM527 509v-298h6q89 0 135 36.5t46 112.5q0 72 -41.5 110.5t-143.5 38.5h-2zM372 66h-4q-78 0 -141.5 21t-108.5 59.5t-69 93t-24 120.5q0 71 23.5 125.5t68.5 92t109.5 57 t145.5 19.5v61h155v-61q75 0 138.5 -18t110 -54.5t72.5 -92t26 -129.5q0 -66 -24 -120t-68 -93t-107 -60t-142 -21h-6v-81h-155v81z"},"Х":{char:"Х",width:71,spacing:171,w:800,h:700,bezier:"M446 355l261 -355h-189l-164 229l-165 -229h-189l262 355l-251 345h187l157 -217l156 217h188z"},"Ц":{char:"Ц",width:75,spacing:175,w:800,h:700,bezier:"M65 700h155v-555h283v555h155v-555h81v-262h-144v117h-530v700z"},"Ч":{char:"Ч",width:71,spacing:171,w:800,h:700,bezier:"M644 0h-155v263q-29 -15 -75 -27t-96 -12q-59 0 -109.5 13.5t-88 42t-59 74t-21.5 110.5v236h156v-138q0 -54 8.5 -91t25.5 -59.5t44 -32.5t65 -10t79 11t71 31v289h155v-700z"},"Ш":{char:"Ш",width:95,spacing:195,w:800,h:700,bezier:"M65 700h155v-555h177v555h155v-555h177v555h155v-700h-819v700z"},"Щ":{char:"Щ",width:98,spacing:198,w:800,h:700,bezier:"M65 700h155v-555h178v555h155v-555h178v555h155v-555h81v-262h-145v117h-757v700z"},"Ъ":{char:"Ъ",width:75,spacing:175,w:800,h:700,bezier:"M308 323v-178h124q69 0 103.5 19t34.5 72q0 45 -33.5 66t-101.5 21h-127zM0 700h308v-232h129q294 0 294 -232q0 -61 -20.5 -105.5t-59.5 -73.5t-95.5 -43t-127.5 -14h-275v555h-153v145z"},"Ы":{char:"Ы",width:90,spacing:190,w:800,h:700,bezier:"M220 468h104q74 0 129 -16.5t92 -47t55 -73.5t18 -95q0 -118 -80 -177t-223 -59h-250v700h155v-232zM220 323v-178h99q69 0 103.5 19t34.5 72q0 45 -33.5 66t-102.5 21h-101zM680 700h155v-700h-155v700z"},"Ь":{char:"Ь",width:66,spacing:166,w:800,h:700,bezier:"M221 468h132q149 0 221.5 -58.5t72.5 -173.5q0 -117 -80 -176.5t-222 -59.5h-280v700h156v-232zM221 323v-178h127q138 0 138 91q0 45 -33.5 66t-101.5 21h-130z"},"Э":{char:"Э",width:71,spacing:171,w:800,h:700,bezier:"M207 430h308q-17 61 -68.5 97t-132.5 36q-23 0 -50 -4.5t-54 -14.5t-52.5 -27.5t-46.5 -42.5l-102 100q26 35 61 60t75.5 41.5t85 24.5t89.5 8q82 0 148.5 -25t112.5 -71t71 -112t25 -147q0 -78 -24.5 -144t-71 -114.5t-114.5 -75.5t-155 -27q-38 0 -79.5 6.5t-83 23.5 t-80 46t-69.5 74l103 88q19 -27 44.5 -45t53.5 -28.5t57.5 -15t57.5 -4.5q82 0 136 40t65 108h-310v145z"},"Ю":{char:"Ю",width:102,spacing:202,w:800,h:700,bezier:"M443 350q0 -49 14.5 -88.5t40.5 -67t61 -42.5t76 -15q87 0 137.5 57.5t50.5 155.5q0 49 -13.5 88t-38.5 67t-59.5 43t-76.5 15q-41 0 -76.5 -15t-61 -43t-40 -67t-14.5 -88zM65 700h155v-278h71q11 62 41 114.5t75 90.5t103 59.5t125 21.5q80 0 144.5 -26.5t110 -74.5 t70 -113.5t24.5 -143.5q0 -77 -26.5 -142.5t-73 -113.5t-110.5 -75t-139 -27q-69 0 -128 20t-104 58t-74.5 93.5t-38.5 126.5h-70v-290h-155v700z"},"Я":{char:"Я",width:71,spacing:171,w:800,h:700,bezier:"M481 376v179h-147q-67 0 -95 -23t-28 -67q0 -37 31.5 -63t85.5 -26h153zM481 231h-119l-179 -231h-183l206 260q-75 23 -115.5 74.5t-40.5 129.5q0 50 18 93t55 75t91.5 50t128.5 18h293v-700h-155v231z"},space:{char:" ",width:24,spacing:124,w:800,h:700,bezier:""},comma:{char:",",width:27,spacing:127,w:800,h:700,bezier:"M96 -5q-25 9 -43 32t-18 53q0 40 25 61.5t71 21.5q45 0 69 -29t24 -75q0 -44 -14.5 -80t-38 -62.5t-52.5 -43t-59 -22.5l-40 87q10 2 22.5 6.5t23.5 11t19 16.5t11 23z"},period:{char:".",width:29,spacing:129,w:800,h:700,bezier:"M50 81q0 15 6.5 30.5t19 27.5t30 19.5t38.5 7.5q19 0 36 -7.5t29.5 -19.5t19.5 -27.5t7 -30.5q0 -17 -7 -32.5t-19.5 -27.5t-29.5 -19.5t-36 -7.5q-43 0 -68.5 26.5t-25.5 60.5z"},hyphen:{char:"-",width:43,spacing:143,w:800,h:700,bezier:"M60 347h304v-130h-304v130z"}},t.subscribe(a)),{eventEmitter:o,getData:function(){return{lettersData:r,items:n}}}}),define("page-transition/simple-transition.view",["dispatcher","TweenMax","page-transition/page-transition.store","resize/resize.store","utils","svg-text/svg-text.store"],function(l,t,c,a,e,o){"use strict";var u,d,i,p,s,f=!1,m=!1,h=[],E=0,g=0,v=function(t){t.preventDefault()},r=function(t){var e,i,r=document.getElementById("preload-imgs"),n=o.getData();n.hasOwnProperty("stage-svg-text")?i=n.items["stage-svg-text"].text:i=document.getElementsByClassName("home")[0].getAttribute("data-text"),p=t.scroll,r?"simple"===(f=t.animation)&&(e=new TimelineLite,l.dispatch({type:"svg-text-change",id:"simple-preloader-text",text:i}),e.to(d,0,{opacity:0}),e.to(d,.6,{onStart:function(){m=!0,function(){for(var t=0;t=h.length&&(E=0),h[E].style.opacity=1),s(e))};e()}(),u.classList.add("prevent-scroll"),u.addEventListener("touchmove",v),d.style.display="block"},opacity:1,onComplete:function(){l.dispatch({type:"transition-step-1",animation:"menu"})}}),e.to(r,0,{opacity:1},"-=0.3")):console.warn("imgs elemeny is missing")},n=function(){var t,e,i,r,n=c.getData();!0===n.step1ready&&!1===n.step2ready&&(e=document.getElementById("simple-preloader-text"),i=a.getData().height,r=document.getElementsByClassName("page-wrapper")[0],t=new TimelineLite,"simple"===f&&(l.dispatch({type:"menu-close"}),p?window.scrollTo(0,i):window.scrollTo(0,0),t.to(e,.6,{onStart:function(){r.classList.remove("transition-animation-complete")},onComplete:function(){l.dispatch({type:"transition-step-2",animation:"menu"})},opacity:0}))),!0===n.step1ready&&!0===n.step2ready&&function(){var t,e=document.getElementById("simple-preloader-text"),i=document.getElementById("preload-imgs"),r=document.getElementsByClassName("page-wrapper")[0];if(t=new TimelineLite,"simple"===f){var n=c.getData(),a=n.scheme,o=n.pageNameId,s=n.text,h=(n.color,n.projectText);p?l.dispatch({type:"svg-text-change",id:"simple-preloader-text",text:h}):l.dispatch({type:"svg-text-change",id:"simple-preloader-text",text:s}),p?window.scrollTo(0,wh):window.scrollTo(0,0),l.dispatch({type:"page-name-change",id:!1}),l.dispatch({type:"page-color-change",color:a}),t.to(e,.2,{}),t.to(e,.6,{opacity:1}),t.to(i,0,{opacity:0,onComplete:function(){m=!1}}),t.to(d,.6,{onStart:function(){r.classList.add("transition-animation-complete")},opacity:0,onComplete:function(){u.classList.remove("prevent-scroll"),u.removeEventListener("touchmove",v),d.style.display="none",f=!1,p?l.dispatch({type:"page-name-change",id:"projects"}):l.dispatch({type:"page-name-change",id:o}),l.dispatch({type:"transition-step-reset",animation:!1})}})}}()};return{init:function(){u=document.getElementsByTagName("body")[0],Modernizr.prefixed("transform"),s=e.getRequestAnimationFrame(),d=document.getElementById("simple-preloader"),h=document.getElementsByClassName("loop-img"),d&&(i=d.getElementsByClassName("bg"))&&i.length?i=i[0]:console.warn("simple-preloader is missing"),n(),c.eventEmitter.subscribe(n),l.subscribe(function(t){"link-animation-start"===t.type&&r(t)})}}}),define("preload/preload.store",["dispatcher"],function(t){"use strict";var i,e=!1,r=!1,n=function(t){if("preload-complete"===t.type){if(r)return;r=!0,a.dispatch()}if("preload-reset"===t.type){if(!r)return;r=!1}},a=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(e||(e=!0,t.subscribe(n))),{eventEmitter:a,getData:function(){return{complete:r}}}}),define("video/video.store",["dispatcher"],function(t){"use strict";var i,e=!1,r={},n=function(t){if("video-add"===t.type){if(r.hasOwnProperty(t.id))return;r[t.id]={id:t.id,status:"not-ready"}}if("video-remove"===t.type){if(!r.hasOwnProperty(t.id))return;delete r[t.id]}"video-ready"===t.type&&r.hasOwnProperty(t.id)&&(r[t.id].status="ready",a.dispatch({type:"change"})),"video-play"===t.type&&r.hasOwnProperty(t.id)&&(r[t.id].status="play",a.dispatch({type:"change"})),"video-stop"===t.type&&r.hasOwnProperty(t.id)&&(r[t.id].status="stop",a.dispatch({type:"change"})),"video-reset"===t.type&&r.hasOwnProperty(t.id)&&(r[t.id].status="not-ready",a.dispatch({type:"change"}))},a=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(r={},e||(e=!0,t.subscribe(n))),{eventEmitter:a,getData:function(){return{items:r}}}}),define("preload/preload.view",["dispatcher","preload/preload.store","images/images.store","video/video.store"],function(e,i,n,a){"use strict";var r,o,s,h={},l={},c=0,u=!1,d=1,p=function(){var t=i.getData();u!==t.complete&&(u=t.complete,r.classList.add("load-complete"),r.classList.add("load-complete-once"),e.dispatch({type:"transition-step-2"}))},f=function(){var t;(t=Date.now()-s+0)<0&&(t=0),setTimeout(function(){e.dispatch({type:"preload-complete"})},t+500)},m=function(){var t,e=n.getData(),i=0;for(var r in h)h.hasOwnProperty(r)&&(t=h[r],e.items.hasOwnProperty(t.id)&&(t.loaded||e.items[t.id].loaded&&(i++,t.loaded=!0)));c<=i&&f()},E=function(){var t,e=a.getData(),i=0;for(var r in l)l.hasOwnProperty(r)&&(t=l[r],e.items.hasOwnProperty(t.id)&&(t.loaded||"not-ready"!==e.items[t.id].status&&(i++,t.loaded=!0)));c<=i&&f()},g=function(t,e){var i=t.getAttribute("data-preload-id");i||(i="preload-image-id-"+d,d++,t.setAttribute("data-preload-id",i)),e[i]={id:i,element:t,loaded:!1}},v=function(){r=document.querySelector(".page-wrapper"),o=document.querySelectorAll(".wait-load-image"),h={},c=0,u=!(l={}),r.classList.remove("load-complete"),e.dispatch({type:"preload-reset"}),c=o.length,s=Date.now();for(var t=0;te.offset&&(e.triggered||(e.triggered=!0,u.dispatch({type:"trigger-element",id:e.id,me:"scroll-trigger"}))),f-50<=e.offset&&e.triggered&&(e.triggered=!1,u.dispatch({type:"untrigger-element",me:"scroll-trigger",id:e.id}))));var e,i}()),o(g))},v=function(){for(var t in a=n.getData().height,h=s+a,c)c.hasOwnProperty(t)&&(e=c[t],void 0,i=d.offset(e.element).top,r=e.element.clientHeight,e.height=r,e.offset=i);var e,i,r},y=function(){var t;t=document.getElementsByClassName("scroll-trigger");for(var e=0;ee[t.id].total&&(e[t.id].index=0):e[t.id].index>e[t.id].total&&(e[t.id].index=e[t.id].total),a.dispatch()}if("slider-change-prev"===t.type){if(!e.hasOwnProperty(t.id))return;e[t.id].index--,e[t.id].continious?e[t.id].index<0&&(e[t.id].index=e[t.id].total):e[t.id].index<0&&(e[t.id].index=0),a.dispatch()}if("slider-change-to"===t.type){if(!e.hasOwnProperty(t.id))return;if(e[t.id].index!==t.index){if(t.index>(e[t.id].total||t.index<0))return void console.warn("no slide width index "+t.index+" for slider width id "+t.id);e[t.id].index=t.index,a.dispatch()}}},a=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return r||(r=!0,t.subscribe(n)),{eventEmitter:a,getData:function(){return{items:e}}}}),define("swipe",[],function(){return{Swipe:function(i,o){"use strict";function e(){p=g.children,E=p.length,p.length<2&&(o.continuous=!1),d.transitions&&o.continuous&&p.length<3&&(g.appendChild(p[0].cloneNode(!0)),g.appendChild(g.children[1].cloneNode(!0)),p=g.children),f=new Array(p.length),m=i.getBoundingClientRect().width||i.offsetWidth,g.style.width=p.length*m+"px";for(var t=p.length;t--;){var e=p[t];e.style.width=m+"px",e.setAttribute("data-index",t),d.transitions&&(e.style.left=t*-m+"px",s(t,tm/2,r=!v&&0t.current&&(t.slides[r].classList.add("to-right"),t.slides[r].classList.remove("to-center"),t.slides[r].classList.remove("to-left"))}}else console.warn("slider with id "+e+" is missing")}(r[t])},n=function(){var t;t=document.getElementsByClassName("view-slider");for(var e=0;et.slide&&(t.element.classList.add("viewed"),t.element.classList.remove("active"))))},i=function(){var t;t=document.getElementsByClassName("view-slider-control");for(var e=0;e=K.endTime?(i=K.targetTop,t=K.done,K=void 0):(e=K.easing((r-K.startTime)/K.duration),i=K.startTop+e*K.topDiff|0),I.setScrollTop(i,!0);else if(!$){J.targetTop-i&&(J={startTop:yt,topDiff:i-yt,targetTop:i,startTime:Tt,endTime:Tt+Z}),r<=J.endTime&&(e=P.sqrt((r-J.startTime)/Z),i=J.startTop+e*J.topDiff|0)}if(wt&&W&&M.setStyle(W,"transform","translate(0, "+-Ht+"px) "+et),$||yt!==i){var n={curTop:i,lastTop:yt,maxTop:Et,direction:vt=ytf.frame,g=m?p:f,v=h.emitEvents,y=h.lastFrameIndex;if(m||E){if(m&&-1===h.edge||E&&1===h.edge)continue;switch(m?(ut(l,["skrollable-before"],["skrollable-after","skrollable-between"]),v&&-1=u[R].frame&&c<=u[R+1].frame){var _,x=u[R],b=u[R+1];for(o in x.props)if(S.call(x.props,o)){var w=(c-x.frame)/(b.frame-x.frame);if(w=x.props[o].easing(w),s=O(x.props[o].value,b.props[o].value,w),"transform"===o&&r-400<=i)for(var H=s.length-1;0<=H;H--)_=C.round(s[H]),C.abs(_-s[H])<1&&(s[H]=C.round(s[H]));s=N(s),0===o.indexOf("@")?l.setAttribute(o.substr(1),s):M.setStyle(l,o,s)}v&&y!==R&&(ot(l,"down"===vt?x.eventType:b.eventType,vt),h.lastFrameIndex=R);break}}}(i,I.getScrollTop(),r,J.endTime),yt=i,j.render&&j.render.call(I,n)),t&&t.call(I,!1)}Tt=r},D=function(t){for(var e=0,i=t.keyFrames.length;eEt&&(Et=o.frame);for(Et=C.max(Et,lt()),s=0,h=G.length;s=r[t].size){if(n===r[t])return;return n=r[t],h.dispatch({type:"change"})}}()},h=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(e=!0,a=o(),s(),window.addEventListener("resize",s,!1),window.addEventListener("orientationchange",s,!1),window.addEventListener("load",s,!1)),{eventEmitter:h,getData:function(){return{breakpoint:n}}}}),define("svg-text/svg-text-reposition.view",["dispatcher","svg-text/svg-text.store","resize/resize.store","resize/breakpoint-main-text.store"],function(o,i,r,n){"use strict";var a,s=1,h={},E=!1,l={mobile:10,tablet1:15,tablet2:15,desktop:20},c={mobile:36,tablet1:60,tablet2:120,desktop:150},u=function(){var a,p,f=r.getData().width,t=n.getData(),m=i.getData();for(var e in a=c[t.breakpoint.name]/100,p=l[t.breakpoint.name],h)h.hasOwnProperty(e)&&function(t){var e,i,s,h,l,c,u,d=[],r=a;if(m.items.hasOwnProperty(t.id)&&(t.text!==m.items[t.id].text||E!==f)){t.text=m.items[t.id].text,t.text||(t.text=""),t.text=t.text.toUpperCase(),e=t.text.split("");for(var n=0;no[r].offset&&(e=!1)}if(!0===e){n.dispatch({type:"svg-text-change",id:"stage-svg-text",text:o[i].text}),n.dispatch({type:"svg-text-change",id:"stage-svg-text-2",text:o[i].text});break}}},c=function(){var t;t=document.getElementsByClassName("text-bg-control");for(var e=0;e=a.length&&(o=0)))},c=function(){var t=i.getData().top,e=r.getData().height;t=r[t].size){if(n===r[t])return;return n=r[t],h.dispatch({type:"change"})}}()},h=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(e=!0,a=o(),s(),window.addEventListener("resize",s,!1),window.addEventListener("orientationchange",s,!1),window.addEventListener("load",s,!1)),{eventEmitter:h,getData:function(){return{breakpoint:n}}}}),define("decor/team-align.view",["dispatcher","resize/breakpoint-team.store"],function(t,n){"use strict";var a,o,s,h,e=function(){var t,e,i=n.getData().breakpoint.name;if(a)for(var r=0;ra-o/2&&!s&&(s=!0,e.dispatch({type:"page-name-change",id:"projects"})),t.top<=a-o/2&&s&&(s=!1,e.dispatch({type:"page-name-change",id:!1})))},c=function(){var t=document.getElementsByClassName("project-name-scroll");s=!1,n=!(!t||!t.length)&&t[0]};return{init:function(){c(),h(),l(),t.eventEmitter.subscribe(h),i.eventEmitter.subscribe(l),e.subscribe(function(t){"mutate"===t.type&&(setTimeout(function(){c(),h(),l()},0),setTimeout(function(){l()},1e3))})}}}),define("timer/timer.view",["dispatcher"],function(t){"use strict";var s,h,o=1,l={},c=!1,e=function(){var t=new Date,e=new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours()+3,t.getUTCMinutes(),t.getUTCSeconds()),i=new Date(e),r=i.getHours(),n=i.getMinutes(),a=r,o=12<=r?"pm":"am";s&&h&&((r=(r%=12)||12)<10&&(r="0"+r),n<10&&(n="0"+n),h.innerHTML=r+":"+n+" "+o,function(t){for(var e in l)if(l.hasOwnProperty(e)&&t>=l[e].start&&ts.length&&(e=s.length),function(){for(var t=0;t>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,i){return this.r=t,this.g=e,this.b=i,this},setHSL:function(t,e,i){if(0===e)this.r=this.g=this.b=i;else{var r=function(t,e,i){return i<0&&(i+=1),1Math.abs(t.z)?i.set(-t.y,t.x,0):i.set(0,-t.z,t.y)):i.crossVectors(t,e),this._x=i.x,this._y=i.y,this._z=i.z,this._w=r,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._z=this._y=this._x=0,this._w=1):(t=1/t,this._x*=t,this._y*=t,this._z*=t,this._w*=t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(THREE.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 i=t._x,r=t._y,n=t._z,a=t._w,o=e._x,s=e._y,h=e._z,l=e._w;return this._x=i*l+a*o+r*h-n*s,this._y=r*l+a*s+n*o-i*h,this._z=n*l+a*h+i*s-r*o,this._w=a*l-i*o-r*s-n*h,this.onChangeCallback(),this},multiplyVector3:function(t){return THREE.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var i=this._x,r=this._y,n=this._z,a=this._w,o=a*t._w+i*t._x+r*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),1<=o)return this._w=a,this._x=i,this._y=r,this._z=n,this;var s=Math.acos(o),h=Math.sqrt(1-o*o);return Math.abs(h)<.001?(this._w=.5*(a+this._w),this._x=.5*(i+this._x),this._y=.5*(r+this._y),this._z=.5*(n+this._z)):(o=Math.sin((1-e)*s)/h,s=Math.sin(e*s)/h,this._w=a*o+this._w*s,this._x=i*o+this._x*s,this._y=r*o+this._y*s,this._z=n*o+this._z*s,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(){},clone:function(){return new THREE.Quaternion(this._x,this._y,this._z,this._w)}},THREE.Quaternion.slerp=function(t,e,i,r){return i.copy(t).slerp(e,r)},THREE.Vector2=function(t,e){this.x=t||0,this.y=e||0},THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(t,e){return this.x=t,this.y=e,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw Error("index is out of range: "+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+t)}},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(THREE.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},sub:function(t,e){return void 0!==e?(THREE.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 this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return 0!==t?(t=1/t,this.x*=t,this.y*=t):this.y=this.x=0,this},min:function(t){return this.x>t.x&&(this.x=t.x),this.y>t.y&&(this.y=t.y),this},max:function(t){return this.xe.x&&(this.x=e.x),this.ye.y&&(this.y=e.y),this},clampScalar:function(){var i,r;return function(t,e){return void 0===i&&(i=new THREE.Vector2,r=new THREE.Vector2),i.set(t,t),r.set(e,e),this.clamp(i,r)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(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)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x;return e*e+(t=this.y-t.y)*t},setLength:function(t){var e=this.length();return 0!==e&&t!==e&&this.multiplyScalar(t/e),this},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).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,i){return void 0===i&&(i=0),e=e*t.itemSize+i,this.x=t.array[e],this.y=t.array[e+1],this},clone:function(){return new THREE.Vector2(this.x,this.y)}},THREE.Vector3=function(t,e,i){this.x=t||0,this.y=e||0,this.z=i||0},THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(t,e,i){return this.x=t,this.y=e,this.z=i,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 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 Error("index is out of range: "+t)}},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?(THREE.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},sub:function(t,e){return void 0!==e?(THREE.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?(THREE.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 this.x*=t,this.y*=t,this.z*=t,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 e;return function(t){return 0==t instanceof THREE.Euler&&THREE.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order."),void 0===e&&(e=new THREE.Quaternion),this.applyQuaternion(e.setFromEuler(t)),this}}(),applyAxisAngle:function(){var i;return function(t,e){return void 0===i&&(i=new THREE.Quaternion),this.applyQuaternion(i.setFromAxisAngle(t,e)),this}}(),applyMatrix3:function(t){var e=this.x,i=this.y,r=this.z;return t=t.elements,this.x=t[0]*e+t[3]*i+t[6]*r,this.y=t[1]*e+t[4]*i+t[7]*r,this.z=t[2]*e+t[5]*i+t[8]*r,this},applyMatrix4:function(t){var e=this.x,i=this.y,r=this.z;return t=t.elements,this.x=t[0]*e+t[4]*i+t[8]*r+t[12],this.y=t[1]*e+t[5]*i+t[9]*r+t[13],this.z=t[2]*e+t[6]*i+t[10]*r+t[14],this},applyProjection:function(t){var e=this.x,i=this.y,r=this.z,n=1/((t=t.elements)[3]*e+t[7]*i+t[11]*r+t[15]);return this.x=(t[0]*e+t[4]*i+t[8]*r+t[12])*n,this.y=(t[1]*e+t[5]*i+t[9]*r+t[13])*n,this.z=(t[2]*e+t[6]*i+t[10]*r+t[14])*n,this},applyQuaternion:function(t){var e=this.x,i=this.y,r=this.z,n=t.x,a=t.y,o=t.z,s=(t=t.w)*e+a*r-o*i,h=t*i+o*e-n*r,l=t*r+n*i-a*e;e=-n*e-a*i-o*r;return this.x=s*t+e*-n+h*-o-l*-a,this.y=h*t+e*-a+l*-n-s*-o,this.z=l*t+e*-o+s*-a-h*-n,this},project:function(){var e;return function(t){return void 0===e&&(e=new THREE.Matrix4),e.multiplyMatrices(t.projectionMatrix,e.getInverse(t.matrixWorld)),this.applyProjection(e)}}(),unproject:function(){var e;return function(t){return void 0===e&&(e=new THREE.Matrix4),e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyProjection(e)}}(),transformDirection:function(t){var e=this.x,i=this.y,r=this.z;return t=t.elements,this.x=t[0]*e+t[4]*i+t[8]*r,this.y=t[1]*e+t[5]*i+t[9]*r,this.z=t[2]*e+t[6]*i+t[10]*r,this.normalize(),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return 0!==t?(t=1/t,this.x*=t,this.y*=t,this.z*=t):this.z=this.y=this.x=0,this},min:function(t){return this.x>t.x&&(this.x=t.x),this.y>t.y&&(this.y=t.y),this.z>t.z&&(this.z=t.z),this},max:function(t){return this.xe.x&&(this.x=e.x),this.ye.y&&(this.y=e.y),this.ze.z&&(this.z=e.z),this},clampScalar:function(){var i,r;return function(t,e){return void 0===i&&(i=new THREE.Vector3,r=new THREE.Vector3),i.set(t,t,t),r.set(e,e,e),this.clamp(i,r)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(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){var e=this.length();return 0!==e&&t!==e&&this.multiplyScalar(t/e),this},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,i){return this.subVectors(e,t).multiplyScalar(i).add(t),this},cross:function(t,e){if(void 0!==e)return THREE.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e);var i=this.x,r=this.y,n=this.z;return this.x=r*t.z-n*t.y,this.y=n*t.x-i*t.z,this.z=i*t.y-r*t.x,this},crossVectors:function(t,e){var i=t.x,r=t.y,n=t.z,a=e.x,o=e.y,s=e.z;return this.x=r*s-n*o,this.y=n*a-i*s,this.z=i*o-r*a,this},projectOnVector:function(){var e,i;return function(t){return void 0===e&&(e=new THREE.Vector3),e.copy(t).normalize(),i=this.dot(e),this.copy(e).multiplyScalar(i)}}(),projectOnPlane:function(){var e;return function(t){return void 0===e&&(e=new THREE.Vector3),e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e;return function(t){return void 0===e&&(e=new THREE.Vector3),this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(t){return t=this.dot(t)/(this.length()*t.length()),Math.acos(THREE.Math.clamp(t,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i+(t=this.z-t.z)*t},setEulerFromRotationMatrix:function(t,e){THREE.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(t,e){THREE.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return THREE.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return THREE.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return THREE.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},setFromMatrixPosition:function(t){return this.x=t.elements[12],this.y=t.elements[13],this.z=t.elements[14],this},setFromMatrixScale:function(t){var e=this.set(t.elements[0],t.elements[1],t.elements[2]).length(),i=this.set(t.elements[4],t.elements[5],t.elements[6]).length();return t=this.set(t.elements[8],t.elements[9],t.elements[10]).length(),this.x=e,this.y=i,this.z=t,this},setFromMatrixColumn:function(t,e){var i=4*t,r=e.elements;return this.x=r[i],this.y=r[i+1],this.z=r[i+2],this},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromAttribute:function(t,e,i){return void 0===i&&(i=0),e=e*t.itemSize+i,this.x=t.array[e],this.y=t.array[e+1],this.z=t.array[e+2],this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}},THREE.Vector4=function(t,e,i,r){this.x=t||0,this.y=e||0,this.z=i||0,this.w=void 0!==r?r:1},THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},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 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 Error("index is out of range: "+t)}},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?(THREE.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},sub:function(t,e){return void 0!==e?(THREE.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 this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,i=this.y,r=this.z,n=this.w;return t=t.elements,this.x=t[0]*e+t[4]*i+t[8]*r+t[12]*n,this.y=t[1]*e+t[5]*i+t[9]*r+t[13]*n,this.z=t[2]*e+t[6]*i+t[10]*r+t[14]*n,this.w=t[3]*e+t[7]*i+t[11]*r+t[15]*n,this},divideScalar:function(t){return 0!==t?(t=1/t,this.x*=t,this.y*=t,this.z*=t,this.w*=t):(this.z=this.y=this.x=0,this.w=1),this},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.z=this.y=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,i,r,n=(t=t.elements)[0];r=t[4];var a=t[8],o=t[1],s=t[5],h=t[9];i=t[2],e=t[6];var l=t[10];return Math.abs(r-o)<.01&&Math.abs(a-i)<.01&&Math.abs(h-e)<.01?Math.abs(r+o)<.1&&Math.abs(a+i)<.1&&Math.abs(h+e)<.1&&Math.abs(n+s+l-3)<.1?this.set(1,0,0,0):(t=Math.PI,l=(l+1)/2,r=(r+o)/4,a=(a+i)/4,h=(h+e)/4,(s=(s+1)/2)<(n=(n+1)/2)&&lt.x&&(this.x=t.x),this.y>t.y&&(this.y=t.y),this.z>t.z&&(this.z=t.z),this.w>t.w&&(this.w=t.w),this},max:function(t){return this.xe.x&&(this.x=e.x),this.ye.y&&(this.y=e.y),this.ze.z&&(this.z=e.z),this.we.w&&(this.w=e.w),this},clampScalar:function(){var i,r;return function(t,e){return void 0===i&&(i=new THREE.Vector4,r=new THREE.Vector4),i.set(t,t,t,t),r.set(e,e,e,e),this.clamp(i,r)}}(),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){var e=this.length();return 0!==e&&t!==e&&this.multiplyScalar(t/e),this},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,i){return this.subVectors(e,t).multiplyScalar(i).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,i){return void 0===i&&(i=0),e=e*t.itemSize+i,this.x=t.array[e],this.y=t.array[e+1],this.z=t.array[e+2],this.w=t.array[e+3],this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}},THREE.Euler=function(t,e,i,r){this._x=t||0,this._y=e||0,this._z=i||0,this._order=r||THREE.Euler.DefaultOrder},THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" "),THREE.Euler.DefaultOrder="XYZ",THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,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,i,r){return this._x=t,this._y=e,this._z=i,this._order=r||this._order,this.onChangeCallback(),this},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,i){var r=THREE.Math.clamp;t=(u=t.elements)[0];var n=u[4],a=u[8],o=u[1],s=u[5],h=u[9],l=u[2],c=u[6],u=u[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(r(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(-h,u),this._z=Math.atan2(-n,t)):(this._x=Math.atan2(c,s),this._z=0)):"YXZ"===e?(this._x=Math.asin(-r(h,-1,1)),Math.abs(h)<.99999?(this._y=Math.atan2(a,u),this._z=Math.atan2(o,s)):(this._y=Math.atan2(-l,t),this._z=0)):"ZXY"===e?(this._x=Math.asin(r(c,-1,1)),Math.abs(c)<.99999?(this._y=Math.atan2(-l,u),this._z=Math.atan2(-n,s)):(this._y=0,this._z=Math.atan2(o,t))):"ZYX"===e?(this._y=Math.asin(-r(l,-1,1)),Math.abs(l)<.99999?(this._x=Math.atan2(c,u),this._z=Math.atan2(o,t)):(this._x=0,this._z=Math.atan2(-n,s))):"YZX"===e?(this._z=Math.asin(r(o,-1,1)),Math.abs(o)<.99999?(this._x=Math.atan2(-h,s),this._y=Math.atan2(-l,t)):(this._x=0,this._y=Math.atan2(a,u))):"XZY"===e?(this._z=Math.asin(-r(n,-1,1)),Math.abs(n)<.99999?(this._x=Math.atan2(c,s),this._y=Math.atan2(a,t)):(this._x=Math.atan2(-h,u),this._y=0)):THREE.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==i&&this.onChangeCallback(),this},setFromQuaternion:function(){var r;return function(t,e,i){return void 0===r&&(r=new THREE.Matrix4),r.makeRotationFromQuaternion(t),this.setFromRotationMatrix(r,e,i),this}}(),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(){var e=new THREE.Quaternion;return function(t){e.setFromEuler(this),this.setFromQuaternion(e,t)}}(),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(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}},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},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},center:function(t){return(t||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return(t||new THREE.Vector3).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 i=e||new THREE.Vector3;return this.delta(i).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(){var r=new THREE.Vector3,n=new THREE.Vector3;return function(t,e){r.subVectors(t,this.start),n.subVectors(this.end,this.start);var i=n.dot(n);i=n.dot(r)/i;return e&&(i=THREE.Math.clamp(i,0,1)),i}}(),closestPointToPoint:function(t,e,i){return t=this.closestPointToPointParameter(t,e),i=i||new THREE.Vector3,this.delta(i).multiplyScalar(t).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)},clone:function(){return(new THREE.Line3).copy(this)}},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,i=t.length;ethis.max.x||t.ythis.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return(e||new THREE.Vector2).set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)},clampPoint:function(t,e){return(e||new THREE.Vector2).copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var e=new THREE.Vector2;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).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)},clone:function(){return(new THREE.Box2).copy(this)}},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},setFromPoints:function(t){this.makeEmpty();for(var e=0,i=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return(e||new THREE.Vector3).set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)},clampPoint:function(t,e){return(e||new THREE.Vector3).copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var e=new THREE.Vector3;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),getBoundingSphere:function(){var e=new THREE.Vector3;return function(t){return(t=t||new THREE.Sphere).center=this.center(),t.radius=.5*this.size(e).length(),t}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(){var e=[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(t){return e[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),e[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),e[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),e[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),e[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),e[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),e[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),e[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.makeEmpty(),this.setFromPoints(e),this}}(),translate:function(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)},clone:function(){return(new THREE.Box3).copy(this)}},THREE.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),0this.radius*this.radius&&(r.sub(this.center).normalize(),r.multiplyScalar(this.radius).add(this.center)),r},getBoundingBox:function(t){return(t=t||new THREE.Box3).set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),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},clone:function(){return(new THREE.Sphere).copy(this)}},THREE.Frustum=function(t,e,i,r,n,a){this.planes=[void 0!==t?t:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==i?i:new THREE.Plane,void 0!==r?r: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,i,r,n,a){var o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(i),o[3].copy(r),o[4].copy(n),o[5].copy(a),this},copy:function(t){for(var e=this.planes,i=0;i<6;i++)e[i].copy(t.planes[i]);return this},setFromMatrix:function(t){var e=this.planes;t=(E=t.elements)[0];var i=E[1],r=E[2],n=E[3],a=E[4],o=E[5],s=E[6],h=E[7],l=E[8],c=E[9],u=E[10],d=E[11],p=E[12],f=E[13],m=E[14],E=E[15];return e[0].setComponents(n-t,h-a,d-l,E-p).normalize(),e[1].setComponents(n+t,h+a,d+l,E+p).normalize(),e[2].setComponents(n+i,h+o,d+c,E+f).normalize(),e[3].setComponents(n-i,h-o,d-c,E-f).normalize(),e[4].setComponents(n-r,h-s,d-u,E-m).normalize(),e[5].setComponents(n+r,h+s,d+u,E+m).normalize(),this},intersectsObject:function(){var i=new THREE.Sphere;return function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),i.copy(e.boundingSphere),i.applyMatrix4(t.matrixWorld),this.intersectsSphere(i)}}(),intersectsSphere:function(t){var e=this.planes,i=t.center;t=-t.radius;for(var r=0;r<6;r++)if(e[r].distanceToPoint(i)>=4,r[t]=i[19==t?3&e|8:e]);return r.join("")}}(),clamp:function(t,e,i){return t>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}},THREE.Spline=function(t){function e(t,e,i,r,n,a,o){return(2*(e-i)+(t=.5*(i-t))+(r=.5*(r-e)))*o+(-3*(e-i)-2*t-r)*a+t*n+e}this.points=t;var i,r,n,a,o,s,h,l,c,u=[],d={x:0,y:0,z:0};this.initFromArray=function(t){this.points=[];for(var e=0;ethis.points.length-2?this.points.length-1:r+1,u[3]=r>this.points.length-3?this.points.length-1:r+2,s=this.points[u[0]],h=this.points[u[1]],l=this.points[u[2]],c=this.points[u[3]],o=n*(a=n*n),d.x=e(s.x,h.x,l.x,c.x,n,a,o),d.y=e(s.y,h.y,l.y,c.y,n,a,o),d.z=e(s.z,h.z,l.z,c.z,n,a,o),d},this.getControlPointsArray=function(){var t,e,i=this.points.length,r=[];for(t=0;th.index+t)for(h={start:a,count:0,index:o},s.push(h),l=0;l<6;l+=2)-1<(f=c[l+1])&&ft.far||e.push({distance:E,point:a.clone().applyMatrix4(this.matrixWorld),index:m,offsetIndex:u,face:null,faceIndex:null,object:this})}}else for(l=l.position.array,m=0;mi||(E=v.origin.distanceTo(o))t.far||e.push({distance:E,point:a.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this});else if(m instanceof THREE.Geometry)for(n=(r=m.vertices).length,m=0;mi||(E=v.origin.distanceTo(o))t.far||e.push({distance:E,point:a.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}}(),THREE.Line.prototype.clone=function(t){return void 0===t&&(t=new THREE.Line(this.geometry,this.material,this.mode)),THREE.Object3D.prototype.clone.call(this,t),t},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.updateMorphTargets()},THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype),THREE.Mesh.prototype.constructor=THREE.Mesh,THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0t.far||e.push({distance:E,point:m,face:new THREE.Face3(a,r,n,THREE.Triangle.normal(x,b,w)),faceIndex:null,object:this})}}}}else for(s=p=0,f=(h=a.position.array).length;pt.far||e.push({distance:E,point:m,face:new THREE.Face3(a,r,n,THREE.Triangle.normal(x,b,w)),faceIndex:null,object:this}))}}else if(p instanceof THREE.Geometry)for(h=!0===(s=this.material instanceof THREE.MeshFaceMaterial)?this.material.materials:null,o=t.precision,l=p.vertices,c=0,u=p.faces.length;ct.far||e.push({distance:E,point:m,face:d,faceIndex:c,object:this}))}}}(),THREE.Mesh.prototype.clone=function(t,e){return void 0===t&&(t=new THREE.Mesh(this.geometry,this.material)),THREE.Object3D.prototype.clone.call(this,t,e),t},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.Skeleton=function(t,e,i){if(this.useVertexTexture=void 0===i||i,this.identityMatrix=new THREE.Matrix4,t=t||[],this.bones=t.slice(0),this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=t=256s.end&&(s.end=n),e||(e=o)}}t.firstAnimation=e},THREE.MorphAnimMesh.prototype.setAnimationLabel=function(t,e,i){this.geometry.animations||(this.geometry.animations={}),this.geometry.animations[t]={start:e,end:i}},THREE.MorphAnimMesh.prototype.playAnimation=function(t,e){var i=this.geometry.animations[t];i?(this.setFrameRange(i.start,i.end),this.duration=(i.end-i.start)/e*1e3,this.time=0):THREE.warn("THREE.MorphAnimMesh: animation["+t+"] undefined in .playAnimation()")},THREE.MorphAnimMesh.prototype.updateAnimation=function(t){var e=this.duration/this.length;this.time+=this.direction*t,this.mirroredLoop?(this.time>this.duration||this.time<0)&&(this.direction*=-1,this.time>this.duration&&(this.time=this.duration,this.directionBackwards=!0),this.time<0&&(this.time=0,this.directionBackwards=!1)):(this.time%=this.duration,this.time<0&&(this.time+=this.duration)),(t=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/e),0,this.length-1))!==this.currentKeyframe&&(this.morphTargetInfluences[this.lastKeyframe]=0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[t]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=t),e=this.time%e/e,this.directionBackwards&&(e=1-e),this.morphTargetInfluences[this.currentKeyframe]=e,this.morphTargetInfluences[this.lastKeyframe]=1-e},THREE.MorphAnimMesh.prototype.interpolateTargets=function(t,e,i){for(var r=this.morphTargetInfluences,n=0,a=r.length;n=this.objects[e].distance;e++)this.objects[e-1].object.visible=!1,this.objects[e].object.visible=!0;for(;ethis.scale.x||e.push({distance:i,point:this.position,face:null,object:this})}}(),THREE.Sprite.prototype.clone=function(t){return void 0===t&&(t=new THREE.Sprite(this.material)),THREE.Object3D.prototype.clone.call(this,t),t},THREE.Particle=THREE.Sprite,THREE.LensFlare=function(t,e,i,r,n){THREE.Object3D.call(this),this.lensFlares=[],this.positionScreen=new THREE.Vector3,(this.customUpdateCallback=void 0)!==t&&this.add(t,e,i,r,n)},THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype),THREE.LensFlare.prototype.constructor=THREE.LensFlare,THREE.LensFlare.prototype.add=function(t,e,i,r,n,a){void 0===e&&(e=-1),void 0===i&&(i=0),void 0===a&&(a=1),void 0===n&&(n=new THREE.Color(16777215)),void 0===r&&(r=THREE.NormalBlending),i=Math.min(i,Math.max(0,i)),this.lensFlares.push({texture:t,size:e,distance:i,x:0,y:0,z:0,scale:1,rotation:1,opacity:a,color:n,blending:r})},THREE.LensFlare.prototype.updateLensFlares=function(){var t,e,i=this.lensFlares.length,r=2*-this.positionScreen.x,n=2*-this.positionScreen.y;for(t=0;t 0.0 ) {\n\t return pow( saturate( 1.0 - lightDistance / cutoffDistance ), decayExponent );\n\t}\n\treturn 1.0;\n}\n\nvec3 inputToLinear( in vec3 a ) {\n#ifdef GAMMA_INPUT\n\treturn pow( a, vec3( float( GAMMA_FACTOR ) ) );\n#else\n\treturn a;\n#endif\n}\nvec3 linearToOutput( in vec3 a ) {\n#ifdef GAMMA_OUTPUT\n\treturn pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );\n#else\n\treturn a;\n#endif\n}\n",THREE.ShaderChunk.alphatest_fragment="#ifdef ALPHATEST\n\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n\n#endif\n",THREE.ShaderChunk.lights_lambert_vertex="vLightFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack = vec3( 0.0 );\n\n#endif\n\ntransformedNormal = normalize( transformedNormal );\n\n#if MAX_DIR_LIGHTS > 0\n\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\tvec3 dirVector = transformDirection( directionalLightDirection[ i ], viewMatrix );\n\n\tfloat dotProduct = dot( transformedNormal, dirVector );\n\tvec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tvec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tvec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t#endif\n\n\t#endif\n\n\t#ifdef WRAP_AROUND\n\n\t\tvec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\tdirectionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tdirectionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );\n\n\t\t#endif\n\n\t#endif\n\n\tvLightFront += directionalLightColor[ i ] * directionalLightWeighting;\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tvLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;\n\n\t#endif\n\n}\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n\t\tfloat attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n\t\tlVector = normalize( lVector );\n\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\n\t\tvec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tvec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tvec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\t\tpointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tpointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\tvLightFront += pointLightColor[ i ] * pointLightWeighting * attenuation;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += pointLightColor[ i ] * pointLightWeightingBack * attenuation;\n\n\t\t#endif\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - worldPosition.xyz ) );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n\t\t\tfloat attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n\t\t\tlVector = normalize( lVector );\n\n\t\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\t\t\tvec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\t\tvec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tvec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\t\t\tspotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );\n\n\t\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\t\tspotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvLightFront += spotLightColor[ i ] * spotLightWeighting * attenuation * spotEffect;\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvLightBack += spotLightColor[ i ] * spotLightWeightingBack * attenuation * spotEffect;\n\n\t\t\t#endif\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec3 lVector = transformDirection( hemisphereLightDirection[ i ], viewMatrix );\n\n\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\t\tfloat hemiDiffuseWeightBack = -0.5 * dotProduct + 0.5;\n\n\t\tvLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );\n\n\t\t#endif\n\n\t}\n\n#endif\n\nvLightFront += ambientLightColor;\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack += ambientLightColor;\n\n#endif\n",THREE.ShaderChunk.map_particle_pars_fragment="#ifdef USE_MAP\n\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n\n#endif\n",THREE.ShaderChunk.default_vertex="#ifdef USE_SKINNING\n\n\tvec4 mvPosition = modelViewMatrix * skinned;\n\n#elif defined( USE_MORPHTARGETS )\n\n\tvec4 mvPosition = modelViewMatrix * vec4( morphed, 1.0 );\n\n#else\n\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\n#endif\n\ngl_Position = projectionMatrix * mvPosition;\n",THREE.ShaderChunk.map_pars_fragment="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvarying vec2 vUv;\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif",THREE.ShaderChunk.skinnormal_vertex="#ifdef USE_SKINNING\n\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\n\t#ifdef USE_MORPHNORMALS\n\n\tvec4 skinnedNormal = skinMatrix * vec4( morphedNormal, 0.0 );\n\n\t#else\n\n\tvec4 skinnedNormal = skinMatrix * vec4( normal, 0.0 );\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_pars_vertex="#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n\tuniform float logDepthBufFC;\n\n#endif",THREE.ShaderChunk.lightmap_pars_vertex="#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vUv2;\n\n#endif",THREE.ShaderChunk.lights_phong_fragment="#ifndef FLAT_SHADED\n\n\tvec3 normal = normalize( vNormal );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\n\t#endif\n\n#else\n\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n\n#endif\n\nvec3 viewPosition = normalize( vViewPosition );\n\n#ifdef USE_NORMALMAP\n\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\n#elif defined( USE_BUMPMAP )\n\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n\nvec3 totalDiffuseLight = vec3( 0.0 );\nvec3 totalSpecularLight = vec3( 0.0 );\n\n#if MAX_POINT_LIGHTS > 0\n\n\tfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n\t\tfloat attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n\t\tlVector = normalize( lVector );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, lVector );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tfloat pointDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\tfloat pointDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\tvec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n\n\t\t#else\n\n\t\t\tfloat pointDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t#endif\n\n\t\ttotalDiffuseLight += pointLightColor[ i ] * pointDiffuseWeight * attenuation;\n\n\t\t\t\t// specular\n\n\t\tvec3 pointHalfVector = normalize( lVector + viewPosition );\n\t\tfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\n\t\tfloat pointSpecularWeight = specularStrength * max( pow( pointDotNormalHalf, shininess ), 0.0 );\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, pointHalfVector ), 0.0 ), 5.0 );\n\t\ttotalSpecularLight += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * attenuation * specularNormalization;\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n\t\tfloat attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n\t\tlVector = normalize( lVector );\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n\t\t\t// diffuse\n\n\t\t\tfloat dotProduct = dot( normal, lVector );\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tfloat spotDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\t\tfloat spotDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\t\tvec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\n\n\t\t\t#else\n\n\t\t\t\tfloat spotDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t\t#endif\n\n\t\t\ttotalDiffuseLight += spotLightColor[ i ] * spotDiffuseWeight * attenuation * spotEffect;\n\n\t\t\t// specular\n\n\t\t\tvec3 spotHalfVector = normalize( lVector + viewPosition );\n\t\t\tfloat spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\n\t\t\tfloat spotSpecularWeight = specularStrength * max( pow( spotDotNormalHalf, shininess ), 0.0 );\n\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, spotHalfVector ), 0.0 ), 5.0 );\n\t\t\ttotalSpecularLight += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * attenuation * specularNormalization * spotEffect;\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_DIR_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\t\tvec3 dirVector = transformDirection( directionalLightDirection[ i ], viewMatrix );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, dirVector );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tfloat dirDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\tfloat dirDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\tvec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );\n\n\t\t#else\n\n\t\t\tfloat dirDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t#endif\n\n\t\ttotalDiffuseLight += directionalLightColor[ i ] * dirDiffuseWeight;\n\n\t\t// specular\n\n\t\tvec3 dirHalfVector = normalize( dirVector + viewPosition );\n\t\tfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\n\t\tfloat dirSpecularWeight = specularStrength * max( pow( dirDotNormalHalf, shininess ), 0.0 );\n\n\t\t/*\n\t\t// fresnel term from skin shader\n\t\tconst float F0 = 0.128;\n\n\t\tfloat base = 1.0 - dot( viewPosition, dirHalfVector );\n\t\tfloat exponential = pow( base, 5.0 );\n\n\t\tfloat fresnel = exponential + F0 * ( 1.0 - exponential );\n\t\t*/\n\n\t\t/*\n\t\t// fresnel term from fresnel shader\n\t\tconst float mFresnelBias = 0.08;\n\t\tconst float mFresnelScale = 0.3;\n\t\tconst float mFresnelPower = 5.0;\n\n\t\tfloat fresnel = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( -viewPosition ), normal ), mFresnelPower );\n\t\t*/\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\t// \t\tdirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization * fresnel;\n\n\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\n\t\ttotalSpecularLight += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n\n\n\t}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec3 lVector = transformDirection( hemisphereLightDirection[ i ], viewMatrix );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, lVector );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\n\t\tvec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\ttotalDiffuseLight += hemiColor;\n\n\t\t// specular (sky light)\n\n\t\tvec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\n\t\tfloat hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\n\t\tfloat hemiSpecularWeightSky = specularStrength * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\n\n\t\t// specular (ground light)\n\n\t\tvec3 lVectorGround = -lVector;\n\n\t\tvec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\n\t\tfloat hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\n\t\tfloat hemiSpecularWeightGround = specularStrength * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\n\n\t\tfloat dotProductGround = dot( normal, lVectorGround );\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\tvec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\n\t\tvec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\n\t\ttotalSpecularLight += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\n\n\t}\n\n#endif\n\n#ifdef METAL\n\n\toutgoingLight += diffuseColor.rgb * ( totalDiffuseLight + ambientLightColor ) * specular + totalSpecularLight + emissive;\n\n#else\n\n\toutgoingLight += diffuseColor.rgb * ( totalDiffuseLight + ambientLightColor ) + totalSpecularLight + emissive;\n\n#endif\n",THREE.ShaderChunk.fog_pars_fragment="#ifdef USE_FOG\n\n\tuniform vec3 fogColor;\n\n\t#ifdef FOG_EXP2\n\n\t\tuniform float fogDensity;\n\n\t#else\n\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n\n#endif",THREE.ShaderChunk.morphnormal_vertex="#ifdef USE_MORPHNORMALS\n\n\tvec3 morphedNormal = vec3( 0.0 );\n\n\tmorphedNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tmorphedNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tmorphedNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tmorphedNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n\n\tmorphedNormal += normal;\n\n#endif",THREE.ShaderChunk.envmap_pars_fragment="#ifdef USE_ENVMAP\n\n\tuniform float reflectivity;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\tuniform float refractionRatio;\n\n\t#else\n\n\t\tvarying vec3 vReflect;\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_fragment="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n\n#endif",THREE.ShaderChunk.normalmap_pars_fragment="#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\n\t// Per-Pixel Tangent Space Normal Mapping\n\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\n\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\n\t}\n\n#endif\n",THREE.ShaderChunk.lights_phong_pars_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n",THREE.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vUv2;\n\tuniform sampler2D lightMap;\n\n#endif",THREE.ShaderChunk.shadowmap_vertex="#ifdef USE_SHADOWMAP\n\n\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\tvShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n\n\t}\n\n#endif",THREE.ShaderChunk.lights_phong_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvWorldPosition = worldPosition.xyz;\n\n#endif",THREE.ShaderChunk.map_fragment="#ifdef USE_MAP\n\n\tvec4 texelColor = texture2D( map, vUv );\n\n\ttexelColor.xyz = inputToLinear( texelColor.xyz );\n\n\tdiffuseColor *= texelColor;\n\n#endif",THREE.ShaderChunk.lightmap_vertex="#ifdef USE_LIGHTMAP\n\n\tvUv2 = uv2;\n\n#endif",THREE.ShaderChunk.map_particle_fragment="#ifdef USE_MAP\n\n\tdiffuseColor *= texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\n#endif\n",THREE.ShaderChunk.color_pars_fragment="#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif\n",THREE.ShaderChunk.color_vertex="#ifdef USE_COLOR\n\n\tvColor.xyz = inputToLinear( color.xyz );\n\n#endif",THREE.ShaderChunk.skinning_vertex="#ifdef USE_SKINNING\n\n\t#ifdef USE_MORPHTARGETS\n\n\tvec4 skinVertex = bindMatrix * vec4( morphed, 1.0 );\n\n\t#else\n\n\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\n\n\t#endif\n\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n\n#endif\n",THREE.ShaderChunk.envmap_pars_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n\tvarying vec3 vReflect;\n\n\tuniform float refractionRatio;\n\n#endif\n",THREE.ShaderChunk.linear_to_gamma_fragment="\n\toutgoingLight = linearToOutput( outgoingLight );\n",THREE.ShaderChunk.color_pars_vertex="#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif",THREE.ShaderChunk.lights_lambert_pars_vertex="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#ifdef WRAP_AROUND\n\n\tuniform vec3 wrapRGB;\n\n#endif\n",THREE.ShaderChunk.map_pars_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n\n#endif\n",THREE.ShaderChunk.envmap_fragment="#ifdef USE_ENVMAP\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\n\t\t// Transforming Normal Vectors with the Inverse Transformation\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\n\t\t#else\n\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#else\n\n\t\tvec3 reflectVec = vReflect;\n\n\t#endif\n\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\n\tenvColor.xyz = inputToLinear( envColor.xyz );\n\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.specularmap_pars_fragment="#ifdef USE_SPECULARMAP\n\n\tuniform sampler2D specularMap;\n\n#endif",THREE.ShaderChunk.logdepthbuf_vertex="#ifdef USE_LOGDEPTHBUF\n\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\n#else\n\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\n\t#endif\n\n#endif",THREE.ShaderChunk.morphtarget_pars_vertex="#ifdef USE_MORPHTARGETS\n\n\t#ifndef USE_MORPHNORMALS\n\n\tuniform float morphTargetInfluences[ 8 ];\n\n\t#else\n\n\tuniform float morphTargetInfluences[ 4 ];\n\n\t#endif\n\n#endif",THREE.ShaderChunk.specularmap_fragment="float specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n\n#else\n\n\tspecularStrength = 1.0;\n\n#endif",THREE.ShaderChunk.fog_fragment="#ifdef USE_FOG\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\n\t#else\n\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\n\t#endif\n\n\t#ifdef FOG_EXP2\n\n\t\tfloat fogFactor = exp2( - square( fogDensity ) * square( depth ) * LOG2 );\n\t\tfogFactor = whiteCompliment( fogFactor );\n\n\t#else\n\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\n\t#endif\n\t\n\toutgoingLight = mix( outgoingLight, fogColor, fogFactor );\n\n#endif",THREE.ShaderChunk.bumpmap_pars_fragment="#ifdef USE_BUMPMAP\n\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\n\t// Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\n\t// http://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\n\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n\tvec2 dHdxy_fwd() {\n\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\n\t\treturn vec2( dBx, dBy );\n\n\t}\n\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\t\t// normalized\n\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\n\t}\n\n#endif\n",THREE.ShaderChunk.defaultnormal_vertex="#ifdef USE_SKINNING\n\n\tvec3 objectNormal = skinnedNormal.xyz;\n\n#elif defined( USE_MORPHNORMALS )\n\n\tvec3 objectNormal = morphedNormal;\n\n#else\n\n\tvec3 objectNormal = normal;\n\n#endif\n\n#ifdef FLIP_SIDED\n\n\tobjectNormal = -objectNormal;\n\n#endif\n\nvec3 transformedNormal = normalMatrix * objectNormal;\n",THREE.ShaderChunk.lights_phong_pars_fragment="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n\n#ifdef WRAP_AROUND\n\n\tuniform vec3 wrapRGB;\n\n#endif\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n",THREE.ShaderChunk.skinbase_vertex="#ifdef USE_SKINNING\n\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n\n#endif",THREE.ShaderChunk.map_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n\n#endif",THREE.ShaderChunk.lightmap_fragment="#ifdef USE_LIGHTMAP\n\n\toutgoingLight *= diffuseColor.xyz * texture2D( lightMap, vUv2 ).xyz;\n\n#endif",THREE.ShaderChunk.shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\tuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n\n#endif",THREE.ShaderChunk.color_fragment="#ifdef USE_COLOR\n\n\tdiffuseColor.rgb *= vColor;\n\n#endif",THREE.ShaderChunk.morphtarget_vertex="#ifdef USE_MORPHTARGETS\n\n\tvec3 morphed = vec3( 0.0 );\n\tmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\tmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\tmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\tmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\n\t#ifndef USE_MORPHNORMALS\n\n\tmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\tmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\tmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\tmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\n\t#endif\n\n\tmorphed += position;\n\n#endif",THREE.ShaderChunk.envmap_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n\tvec3 worldNormal = transformDirection( objectNormal, modelMatrix );\n\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t#else\n\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.shadowmap_fragment="#ifdef USE_SHADOWMAP\n\n\t#ifdef SHADOWMAP_DEBUG\n\n\t\tvec3 frustumColors[3];\n\t\tfrustumColors[0] = vec3( 1.0, 0.5, 0.0 );\n\t\tfrustumColors[1] = vec3( 0.0, 1.0, 0.8 );\n\t\tfrustumColors[2] = vec3( 0.0, 0.5, 1.0 );\n\n\t#endif\n\n\t#ifdef SHADOWMAP_CASCADE\n\n\t\tint inFrustumCount = 0;\n\n\t#endif\n\n\tfloat fDepth;\n\tvec3 shadowColor = vec3( 1.0 );\n\n\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\tvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\n\n\t\t\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\n\t\t\t\t// if ( all( something, something ) ) using this instead\n\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\n\t\t\t\t// don't shadow pixels outside of light frustum\n\t\t\t\t// use just first frustum (for cascades)\n\t\t\t\t// don't shadow pixels behind far plane of light frustum\n\n\t\t#ifdef SHADOWMAP_CASCADE\n\n\t\t\tinFrustumCount += int( inFrustum );\n\t\t\tbvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );\n\n\t\t#else\n\n\t\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n\t\t#endif\n\n\t\tbool frustumTest = all( frustumTestVec );\n\n\t\tif ( frustumTest ) {\n\n\t\t\tshadowCoord.z += shadowBias[ i ];\n\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\t\t\t\t\t\t// Percentage-close filtering\n\t\t\t\t\t\t// (9 pixel kernel)\n\t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n\n\t\t\t\tfloat shadow = 0.0;\n\n\t\t/*\n\t\t\t\t\t\t// nested loops breaks shader compiler / validator on some ATI cards when using OpenGL\n\t\t\t\t\t\t// must enroll loop manually\n\n\t\t\t\tfor ( float y = -1.25; y <= 1.25; y += 1.25 )\n\t\t\t\t\tfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\n\n\t\t\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\n\n\t\t\t\t\t\t\t\t// doesn't seem to produce any noticeable visual difference compared to simple texture2D lookup\n\t\t\t\t\t\t\t\t//vec4 rgbaDepth = texture2DProj( shadowMap[ i ], vec4( vShadowCoord[ i ].w * ( vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy ), 0.05, vShadowCoord[ i ].w ) );\n\n\t\t\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\t\t\tif ( fDepth < shadowCoord.z )\n\t\t\t\t\t\t\tshadow += 1.0;\n\n\t\t\t\t}\n\n\t\t\t\tshadow /= 9.0;\n\n\t\t*/\n\n\t\t\t\tconst float shadowDelta = 1.0 / 9.0;\n\n\t\t\t\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n\t\t\t\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n\t\t\t\tfloat dx0 = -1.25 * xPixelOffset;\n\t\t\t\tfloat dy0 = -1.25 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.25 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.25 * yPixelOffset;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n\t\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\t\t\t\t// Percentage-close filtering\n\t\t\t\t\t\t// (9 pixel kernel)\n\t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n\n\t\t\t\tfloat shadow = 0.0;\n\n\t\t\t\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n\t\t\t\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n\t\t\t\tfloat dx0 = -1.0 * xPixelOffset;\n\t\t\t\tfloat dy0 = -1.0 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.0 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.0 * yPixelOffset;\n\n\t\t\t\tmat3 shadowKernel;\n\t\t\t\tmat3 depthKernel;\n\n\t\t\t\tdepthKernel[0][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tdepthKernel[0][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tdepthKernel[0][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tdepthKernel[1][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tdepthKernel[1][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tdepthKernel[1][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tdepthKernel[2][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tdepthKernel[2][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tdepthKernel[2][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\n\t\t\t\tvec3 shadowZ = vec3( shadowCoord.z );\n\t\t\t\tshadowKernel[0] = vec3(lessThan(depthKernel[0], shadowZ ));\n\t\t\t\tshadowKernel[0] *= vec3(0.25);\n\n\t\t\t\tshadowKernel[1] = vec3(lessThan(depthKernel[1], shadowZ ));\n\t\t\t\tshadowKernel[1] *= vec3(0.25);\n\n\t\t\t\tshadowKernel[2] = vec3(lessThan(depthKernel[2], shadowZ ));\n\t\t\t\tshadowKernel[2] *= vec3(0.25);\n\n\t\t\t\tvec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[i].xy );\n\n\t\t\t\tshadowKernel[0] = mix( shadowKernel[1], shadowKernel[0], fractionalCoord.x );\n\t\t\t\tshadowKernel[1] = mix( shadowKernel[2], shadowKernel[1], fractionalCoord.x );\n\n\t\t\t\tvec4 shadowValues;\n\t\t\t\tshadowValues.x = mix( shadowKernel[0][1], shadowKernel[0][0], fractionalCoord.y );\n\t\t\t\tshadowValues.y = mix( shadowKernel[0][2], shadowKernel[0][1], fractionalCoord.y );\n\t\t\t\tshadowValues.z = mix( shadowKernel[1][1], shadowKernel[1][0], fractionalCoord.y );\n\t\t\t\tshadowValues.w = mix( shadowKernel[1][2], shadowKernel[1][1], fractionalCoord.y );\n\n\t\t\t\tshadow = dot( shadowValues, vec4( 1.0 ) );\n\n\t\t\t\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n\t\t\t#else\n\n\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\n\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\tif ( fDepth < shadowCoord.z )\n\n\t\t// spot with multiple shadows is darker\n\n\t\t\t\t\tshadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );\n\n\t\t// spot with multiple shadows has the same color as single shadow spot\n\n\t\t// \t\t\t\t\tshadowColor = min( shadowColor, vec3( shadowDarkness[ i ] ) );\n\n\t\t\t#endif\n\n\t\t}\n\n\n\t\t#ifdef SHADOWMAP_DEBUG\n\n\t\t\t#ifdef SHADOWMAP_CASCADE\n\n\t\t\t\tif ( inFrustum && inFrustumCount == 1 ) outgoingLight *= frustumColors[ i ];\n\n\t\t\t#else\n\n\t\t\t\tif ( inFrustum ) outgoingLight *= frustumColors[ i ];\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t}\n\n\t// NOTE: I am unsure if this is correct in linear space. -bhouston, Dec 29, 2014\n\tshadowColor = inputToLinear( shadowColor );\n\n\toutgoingLight = outgoingLight * shadowColor;\n\n#endif\n",THREE.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\n\t#ifdef USE_SKINNING\n\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\n\t#elif defined( USE_MORPHTARGETS )\n\n\t\tvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n\n\t#else\n\n\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\n\tuniform sampler2D shadowMap[ MAX_SHADOWS ];\n\tuniform vec2 shadowMapSize[ MAX_SHADOWS ];\n\n\tuniform float shadowDarkness[ MAX_SHADOWS ];\n\tuniform float shadowBias[ MAX_SHADOWS ];\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\tfloat depth = dot( rgba_depth, bit_shift );\n\t\treturn depth;\n\n\t}\n\n#endif",THREE.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\n\t\t\ty = dy * ( y + 0.5 );\n\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n\n\tuniform float logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\t#extension GL_EXT_frag_depth : enable\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n#endif",THREE.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n",THREE.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",THREE.UniformsUtils={merge:function(t){for(var e={},i=0;i dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.color_fragment,"\toutgoingLight = diffuseColor.rgb;",THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2e3},opacity:{type:"f",value:1}},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float mNear;\nuniform float mFar;\nuniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\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\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvNormal = normalize( normalMatrix * normal );",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;\nvarying vec3 vNormal;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\nsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\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( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}},THREE.WebGLRenderer=function(t){function u(t){var e=t.geometry;t=t.material;var i=e.vertices.length;if(t.attributes)for(var r in void 0===e.__webglCustomAttributesList&&(e.__webglCustomAttributesList=[]),t.attributes){var n=t.attributes[r];if(!n.__webglInitialized||n.createUniqueBuffers){n.__webglInitialized=!0;var a=1;"v2"===n.type?a=2:"v3"===n.type?a=3:"v4"===n.type?a=4:"c"===n.type&&(a=3),n.size=a,n.array=new Float32Array(i*a),n.buffer=We.createBuffer(),n.buffer.belongsToAttribute=r,n.needsUpdate=!0}e.__webglCustomAttributesList.push(n)}}function Ue(t,e){return t.material instanceof THREE.MeshFaceMaterial?t.material.materials[e.materialIndex]:t.material}function d(t,e,i,r){i=i.attributes;for(var n=e.attributes,a=0,o=(e=e.attributesKeys).length;ah&&(r[m].counter+=1,(n=r[m].hash+"_"+r[m].counter)in u||(a={id:dt++,faces3:[],materialIndex:m,vertices:0,numMorphTargets:l,numMorphNormals:c},u[n]=a,d.push(a))),u[n].faces3.push(p),u[n].vertices+=3}o[s]=d,e.groupsNeedUpdate=!1}for(s=0,i=(o=qe[e.id]).length;se||t.height>e){var i=e/Math.max(t.width,t.height),r=document.createElement("canvas");return r.width=Math.floor(t.width*i),r.height=Math.floor(t.height*i),r.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,r.width,r.height),THREE.warn("THREE.WebGLRenderer: image is too big ("+t.width+"x"+t.height+"). Resized to "+r.width+"x"+r.height,t),r}return t}function h(t,e){We.bindRenderbuffer(We.RENDERBUFFER,t),e.depthBuffer&&!e.stencilBuffer?(We.renderbufferStorage(We.RENDERBUFFER,We.DEPTH_COMPONENT16,e.width,e.height),We.framebufferRenderbuffer(We.FRAMEBUFFER,We.DEPTH_ATTACHMENT,We.RENDERBUFFER,t)):e.depthBuffer&&e.stencilBuffer?(We.renderbufferStorage(We.RENDERBUFFER,We.DEPTH_STENCIL,e.width,e.height),We.framebufferRenderbuffer(We.FRAMEBUFFER,We.DEPTH_STENCIL_ATTACHMENT,We.RENDERBUFFER,t)):We.renderbufferStorage(We.RENDERBUFFER,We.RGBA4,e.width,e.height)}function r(t){return t===THREE.NearestFilter||t===THREE.NearestMipMapNearestFilter||t===THREE.NearestMipMapLinearFilter?We.NEAREST:We.LINEAR}function Te(t){var e;if(t===THREE.RepeatWrapping)return We.REPEAT;if(t===THREE.ClampToEdgeWrapping)return We.CLAMP_TO_EDGE;if(t===THREE.MirroredRepeatWrapping)return We.MIRRORED_REPEAT;if(t===THREE.NearestFilter)return We.NEAREST;if(t===THREE.NearestMipMapNearestFilter)return We.NEAREST_MIPMAP_NEAREST;if(t===THREE.NearestMipMapLinearFilter)return We.NEAREST_MIPMAP_LINEAR;if(t===THREE.LinearFilter)return We.LINEAR;if(t===THREE.LinearMipMapNearestFilter)return We.LINEAR_MIPMAP_NEAREST;if(t===THREE.LinearMipMapLinearFilter)return We.LINEAR_MIPMAP_LINEAR;if(t===THREE.UnsignedByteType)return We.UNSIGNED_BYTE;if(t===THREE.UnsignedShort4444Type)return We.UNSIGNED_SHORT_4_4_4_4;if(t===THREE.UnsignedShort5551Type)return We.UNSIGNED_SHORT_5_5_5_1;if(t===THREE.UnsignedShort565Type)return We.UNSIGNED_SHORT_5_6_5;if(t===THREE.ByteType)return We.BYTE;if(t===THREE.ShortType)return We.SHORT;if(t===THREE.UnsignedShortType)return We.UNSIGNED_SHORT;if(t===THREE.IntType)return We.INT;if(t===THREE.UnsignedIntType)return We.UNSIGNED_INT;if(t===THREE.FloatType)return We.FLOAT;if(null!==(e=W.get("OES_texture_half_float"))&&t===THREE.HalfFloatType)return e.HALF_FLOAT_OES;if(t===THREE.AlphaFormat)return We.ALPHA;if(t===THREE.RGBFormat)return We.RGB;if(t===THREE.RGBAFormat)return We.RGBA;if(t===THREE.LuminanceFormat)return We.LUMINANCE;if(t===THREE.LuminanceAlphaFormat)return We.LUMINANCE_ALPHA;if(t===THREE.AddEquation)return We.FUNC_ADD;if(t===THREE.SubtractEquation)return We.FUNC_SUBTRACT;if(t===THREE.ReverseSubtractEquation)return We.FUNC_REVERSE_SUBTRACT;if(t===THREE.ZeroFactor)return We.ZERO;if(t===THREE.OneFactor)return We.ONE;if(t===THREE.SrcColorFactor)return We.SRC_COLOR;if(t===THREE.OneMinusSrcColorFactor)return We.ONE_MINUS_SRC_COLOR;if(t===THREE.SrcAlphaFactor)return We.SRC_ALPHA;if(t===THREE.OneMinusSrcAlphaFactor)return We.ONE_MINUS_SRC_ALPHA;if(t===THREE.DstAlphaFactor)return We.DST_ALPHA;if(t===THREE.OneMinusDstAlphaFactor)return We.ONE_MINUS_DST_ALPHA;if(t===THREE.DstColorFactor)return We.DST_COLOR;if(t===THREE.OneMinusDstColorFactor)return We.ONE_MINUS_DST_COLOR;if(t===THREE.SrcAlphaSaturateFactor)return We.SRC_ALPHA_SATURATE;if(null!==(e=W.get("WEBGL_compressed_texture_s3tc"))){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(null!==(e=W.get("WEBGL_compressed_texture_pvrtc"))){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(null!==(e=W.get("EXT_blend_minmax"))){if(t===THREE.MinEquation)return e.MIN_EXT;if(t===THREE.MaxEquation)return e.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);var Re=void 0!==(t=t||{}).canvas?t.canvas:document.createElement("canvas"),e=void 0!==t.context?t.context:null,x=1,_e=void 0!==t.precision?t.precision:"highp",i=void 0!==t.alpha&&t.alpha,n=void 0===t.depth||t.depth,a=void 0===t.stencil||t.stencil,o=void 0!==t.antialias&&t.antialias,s=void 0===t.premultipliedAlpha||t.premultipliedAlpha,l=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,xe=void 0!==t.logarithmicDepthBuffer&&t.logarithmicDepthBuffer,c=new THREE.Color(0),b=0,w=[],H={},M=[],S=[],C=[],A=[],P=[];this.domElement=Re,this.context=null,this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0,this.gammaFactor=2,this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1,this.shadowMapType=THREE.PCFShadowMap,this.shadowMapCullFace=THREE.CullFaceFront,this.shadowMapCascade=this.shadowMapDebug=!1,this.maxMorphTargets=8,this.maxMorphNormals=4,this.autoScaleCubemaps=!0,this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var We,be=this,we=[],He=null,L=null,Me=-1,k="",Se=null,Ce=0,D=0,F=0,z=Re.width,B=Re.height,O=0,N=0,U=new THREE.Frustum,V=new THREE.Matrix4,Ae=new THREE.Vector3,Pe=new THREE.Vector3,Le=!0,ke={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}};try{var I={alpha:i,depth:n,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:l};if(null===(We=e||Re.getContext("webgl",I)||Re.getContext("experimental-webgl",I))){if(null!==Re.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context."}Re.addEventListener("webglcontextlost",function(t){t.preventDefault(),X(),q(),H={}},!1)}catch(t){THREE.error("THREE.WebGLRenderer: "+t)}var G=new THREE.WebGLState(We,Te);void 0===We.getShaderPrecisionFormat&&(We.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var W=new THREE.WebGLExtensions(We);W.get("OES_texture_float"),W.get("OES_texture_float_linear"),W.get("OES_texture_half_float"),W.get("OES_texture_half_float_linear"),W.get("OES_standard_derivatives"),xe&&W.get("EXT_frag_depth");var j=function(t,e,i,r){!0===s&&(t*=r,e*=r,i*=r),We.clearColor(t,e,i,r)},q=function(){We.clearColor(0,0,0,1),We.clearDepth(1),We.clearStencil(0),We.enable(We.DEPTH_TEST),We.depthFunc(We.LEQUAL),We.frontFace(We.CCW),We.cullFace(We.BACK),We.enable(We.CULL_FACE),We.enable(We.BLEND),We.blendEquation(We.FUNC_ADD),We.blendFunc(We.SRC_ALPHA,We.ONE_MINUS_SRC_ALPHA),We.viewport(D,F,z,B),j(c.r,c.g,c.b,b)},X=function(){Se=He=null,Me=-1,Le=!(k=""),G.reset()};q(),this.context=We,this.state=G;var Y,K=We.getParameter(We.MAX_TEXTURE_IMAGE_UNITS),Q=We.getParameter(We.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Z=We.getParameter(We.MAX_TEXTURE_SIZE),De=We.getParameter(We.MAX_CUBE_MAP_TEXTURE_SIZE),Fe=0s.length&&(console.warn("THREE.WebGLRenderer: Influences array is bigger than morphTargets array."),l.length=s.length),s=0,o=l.length;sr.numSupportedMorphTargets?(h.sort(m),h.length=r.numSupportedMorphTargets):h.length>r.numSupportedMorphNormals?h.sort(m):0===h.length&&h.push([0,0]);s=0;for(var c=r.numSupportedMorphTargets;sH.x&&(H.x=l.x),l.yH.y&&(H.y=l.y),l.zH.z&&(H.z=l.z);a.left=w.x,a.right=H.x,a.top=H.y,a.bottom=w.y,a.updateProjectionMatrix()}for(a=n.shadowMap,s=n.shadowMatrix,(o=n.shadowCamera).position.setFromMatrixPosition(n.matrixWorld),M.setFromMatrixPosition(n.target.matrixWorld),o.lookAt(M),o.updateMatrixWorld(),o.matrixWorldInverse.getInverse(o.matrixWorld),n.cameraHelper&&(n.cameraHelper.visible=n.shadowCameraVisible),n.shadowCameraVisible&&n.cameraHelper.update(),s.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),s.multiply(o.projectionMatrix),s.multiply(o.matrixWorldInverse),b.multiplyMatrices(o.projectionMatrix,o.matrixWorldInverse),x.setFromMatrix(b),f.setRenderTarget(a),f.clear(),S.length=0,g(t,t,o),n=0,a=S.length;n 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")),k.compileShader(r),k.compileShader(n),k.attachShader(i,r),k.attachShader(i,n),k.linkProgram(i),P=i,M=k.getAttribLocation(P,"position"),S=k.getAttribLocation(P,"uv"),d=k.getUniformLocation(P,"uvOffset"),p=k.getUniformLocation(P,"uvScale"),f=k.getUniformLocation(P,"rotation"),m=k.getUniformLocation(P,"scale"),E=k.getUniformLocation(P,"color"),g=k.getUniformLocation(P,"map"),v=k.getUniformLocation(P,"opacity"),y=k.getUniformLocation(P,"modelViewMatrix"),T=k.getUniformLocation(P,"projectionMatrix"),R=k.getUniformLocation(P,"fogType"),_=k.getUniformLocation(P,"fogDensity"),x=k.getUniformLocation(P,"fogNear"),b=k.getUniformLocation(P,"fogFar"),w=k.getUniformLocation(P,"fogColor"),H=k.getUniformLocation(P,"alphaTest"),(i=document.createElement("canvas")).width=8,i.height=8,(r=i.getContext("2d")).fillStyle="white",r.fillRect(0,0,8,8),(L=new THREE.Texture(i)).needsUpdate=!0}k.useProgram(P),k.enableVertexAttribArray(M),k.enableVertexAttribArray(S),k.disable(k.CULL_FACE),k.enable(k.BLEND),k.bindBuffer(k.ARRAY_BUFFER,C),k.vertexAttribPointer(M,2,k.FLOAT,!1,16,0),k.vertexAttribPointer(S,2,k.FLOAT,!1,16,8),k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,A),k.uniformMatrix4fv(T,!1,e.projectionMatrix.elements),k.activeTexture(k.TEXTURE0),k.uniform1i(g,0),r=i=0,(n=t.fog)?(k.uniform3f(w,n.color.r,n.color.g,n.color.b),n instanceof THREE.Fog?(k.uniform1f(x,n.near),k.uniform1f(b,n.far),k.uniform1i(R,1),r=i=1):n instanceof THREE.FogExp2&&(k.uniform1f(_,n.density),k.uniform1i(R,2),r=i=2)):(k.uniform1i(R,0),r=i=0);n=0;for(var a=c.length;n=e)return e=1-(e=i[t]-e)/(t=this.curves[t]).getLength(),t.getPointAt(e);t++}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;var t,e=[],i=0,r=this.curves.length;for(t=0;tt?t=s.x:s.xe?e=s.y:s.yi?i=s.z:s.zs.y))if(t.y==o.y){if(t.x==o.x)return!0}else{if(0==(n=l*(t.x-o.x)-h*(t.y-o.y)))return!0;n<0||(r=!r)}}else if(t.y==o.y&&(s.x<=t.x&&t.x<=o.x||o.x<=t.x&&t.x<=s.x))return!0}return r})(f.p,d[m].p)&&(a!=m&&u.push({froms:a,tos:m,hole:h}),l?(l=!1,o[m].push(f)):c=!0);l&&o[a].push(f)}0a.length-2?a.length-1:e+1],a=a[e>a.length-3?a.length-1:e+2];return(e=new THREE.Vector2).x=THREE.Curve.Utils.interpolate(i.x,r.x,n.x,a.x,t),e.y=THREE.Curve.Utils.interpolate(i.y,r.y,n.y,a.y,t),e},THREE.EllipseCurve=function(t,e,i,r,n,a,o){this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=r,this.aStartAngle=n,this.aEndAngle=a,this.aClockwise=o},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;return e<0&&(e+=2*Math.PI),e>2*Math.PI&&(e-=2*Math.PI),t=!0===this.aClockwise?this.aEndAngle+(1-t)*(2*Math.PI-e):this.aStartAngle+t*e,(e=new THREE.Vector2).x=this.aX+this.xRadius*Math.cos(t),e.y=this.aY+this.yRadius*Math.sin(t),e},THREE.ArcCurve=function(t,e,i,r,n,a){THREE.EllipseCurve.call(this,t,e,i,i,r,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,i){this.v0=t,this.v1=e,this.v2=i},function(t){var e=new THREE.Vector3;return e.x=THREE.Shape.Utils.b2(t,this.v0.x,this.v1.x,this.v2.x),e.y=THREE.Shape.Utils.b2(t,this.v0.y,this.v1.y,this.v2.y),e.z=THREE.Shape.Utils.b2(t,this.v0.z,this.v1.z,this.v2.z),e}),THREE.CubicBezierCurve3=THREE.Curve.create(function(t,e,i,r){this.v0=t,this.v1=e,this.v2=i,this.v3=r},function(t){var e=new THREE.Vector3;return e.x=THREE.Shape.Utils.b3(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e.y=THREE.Shape.Utils.b3(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y),e.z=THREE.Shape.Utils.b3(t,this.v0.z,this.v1.z,this.v2.z,this.v3.z),e}),THREE.SplineCurve3=THREE.Curve.create(function(t){this.points=null==t?[]:t},function(t){t*=(a=this.points).length-1,t-=e=Math.floor(t);var e,i=a[0==e?e:e-1],r=a[e],n=a[e>a.length-2?a.length-1:e+1],a=a[e>a.length-3?a.length-1:e+2];return(e=new THREE.Vector3).x=THREE.Curve.Utils.interpolate(i.x,r.x,n.x,a.x,t),e.y=THREE.Curve.Utils.interpolate(i.y,r.y,n.y,a.y,t),e.z=THREE.Curve.Utils.interpolate(i.z,r.z,n.z,a.z,t),e}),THREE.ClosedSplineCurve3=THREE.Curve.create(function(t){this.points=null==t?[]:t},function(t){t*=(a=this.points).length-0,t-=e=Math.floor(t);var e,i=a[((e=e+(0a.index;)a=o,o=this.getNextKeyWith(r,t,o.index+1);n.prevKey[r]=a,n.nextKey[r]=o}}},resetBlendWeights:function(){for(var t=0,e=this.hierarchy.length;tt.length-2?r:r+1,h[3]=r>t.length-3?r:r+2,r=t[h[0]],a=t[h[1]],o=t[h[2]],s=t[h[3]],n=i*(h=i*i),l[0]=c(r[0],a[0],o[0],s[0],i,h,n),l[1]=c(r[1],a[1],o[1],s[1],i,h,n),l[2]=c(r[2],a[2],o[2],s[2],i,h,n),l},c=function(t,e,i,r,n,a,o){return(2*(e-i)+(t=.5*(i-t))+(r=.5*(r-e)))*o+(-3*(e-i)-2*t-r)*a+t*n+e};return function(t){if(!1!==this.isPlaying&&(this.currentTime+=t*this.timeScale,0!==this.weight)){t=this.data.length,(this.currentTime>t||this.currentTime<0)&&(this.loop?(this.currentTime%=t,this.currentTime<0&&(this.currentTime+=t),this.reset()):this.stop()),t=0;for(var e=this.hierarchy.length;t=this.currentTime){for(s=this.data.hierarchy[t].keys[0],h=this.getNextKeyWith(o,t,1);h.times.index;)s=h,h=this.getNextKeyWith(o,t,h.index+1);r.prevKey[o]=s,r.nextKey[o]=h}var l=(this.currentTime-s.time)/(h.time-s.time),c=s[o],u=h[o];l<0&&(l=0),1t&&(this.currentTime%=t),this.currentTime=Math.min(this.currentTime,t),t=0;for(var e=this.hierarchy.length;ta.index;)o=r[(a=o).index+1];n.prevKey=a,n.nextKey=o}o.time>=this.currentTime?a.interpolate(o,this.currentTime):a.interpolate(o,o.time),this.data.hierarchy[t].node.updateMatrix(),i.matrixWorldNeedsUpdate=!0}}}},getNextKeyWith:function(t,e,i){for(i%=(e=this.data.hierarchy[e].keys).length;ithis.duration&&(this.currentTime%=this.duration),this.currentTime=Math.min(this.currentTime,this.duration),t=this.duration/this.frames;var e=Math.floor(this.currentTime/t),i=this.mesh.morphTargetInfluences;e!=this.currentFrame&&(i[this.lastFrame]=0,i[this.currentFrame]=1,i[e]=0,this.lastFrame=this.currentFrame,this.currentFrame=e),i[e]=this.currentTime%t/t,i[this.lastFrame]=1-i[e]}}},THREE.BoxGeometry=function(t,e,i,r,n,a){function o(t,e,i,r,n,a,o,s){var h,l=T.widthSegments,c=T.heightSegments,u=n/2,d=a/2,p=T.vertices.length;"x"===t&&"y"===e||"y"===t&&"x"===e?h="z":"x"===t&&"z"===e||"z"===t&&"x"===e?(h="y",c=T.depthSegments):("z"===t&&"y"===e||"y"===t&&"z"===e)&&(h="x",l=T.depthSegments);var f=l+1,m=c+1,E=n/l,g=a/c,v=new THREE.Vector3;for(v[h]=0s.end&&(s.end=a),e||(e=h)}}for(h in r)s=r[h],this.createAnimation(h,s.start,s.end,t);this.firstAnimation=e},THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(t){(t=this.animationsMap[t])&&(t.direction=1,t.directionBackwards=!1)},THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(t){(t=this.animationsMap[t])&&(t.direction=-1,t.directionBackwards=!0)},THREE.MorphBlendMesh.prototype.setAnimationFPS=function(t,e){var i=this.animationsMap[t];i&&(i.fps=e,i.duration=(i.end-i.start)/i.fps)},THREE.MorphBlendMesh.prototype.setAnimationDuration=function(t,e){var i=this.animationsMap[t];i&&(i.duration=e,i.fps=(i.end-i.start)/i.duration)},THREE.MorphBlendMesh.prototype.setAnimationWeight=function(t,e){var i=this.animationsMap[t];i&&(i.weight=e)},THREE.MorphBlendMesh.prototype.setAnimationTime=function(t,e){var i=this.animationsMap[t];i&&(i.time=e)},THREE.MorphBlendMesh.prototype.getAnimationTime=function(t){var e=0;return(t=this.animationsMap[t])&&(e=t.time),e},THREE.MorphBlendMesh.prototype.getAnimationDuration=function(t){var e=-1;return(t=this.animationsMap[t])&&(e=t.duration),e},THREE.MorphBlendMesh.prototype.playAnimation=function(t){var e=this.animationsMap[t];e?(e.time=0,e.active=!0):THREE.warn("THREE.MorphBlendMesh: animation["+t+"] undefined in .playAnimation()")},THREE.MorphBlendMesh.prototype.stopAnimation=function(t){(t=this.animationsMap[t])&&(t.active=!1)},THREE.MorphBlendMesh.prototype.update=function(t){for(var e=0,i=this.animationsList.length;er.duration||r.time<0)&&(r.direction*=-1,r.time>r.duration&&(r.time=r.duration,r.directionBackwards=!0),r.time<0&&(r.time=0,r.directionBackwards=!1)):(r.time%=r.duration,r.time<0&&(r.time+=r.duration));var a=r.startFrame+THREE.Math.clamp(Math.floor(r.time/n),0,r.length-1),o=r.weight;a!==r.currentFrame&&(this.morphTargetInfluences[r.lastFrame]=0,this.morphTargetInfluences[r.currentFrame]=1*o,this.morphTargetInfluences[a]=0,r.lastFrame=r.currentFrame,r.currentFrame=a),n=r.time%n/n,r.directionBackwards&&(n=1-n),this.morphTargetInfluences[r.currentFrame]=n*o,this.morphTargetInfluences[r.lastFrame]=(1-n)*o}}},THREE.RenderPass=function(t,e,i,r,n){this.scene=t,this.camera=e,this.overrideMaterial=i,this.clearColor=r,this.clearAlpha=void 0!==n?n:1,this.oldClearColor=new THREE.Color,this.oldClearAlpha=1,this.enabled=!0,this.clear=!0,this.needsSwap=!1},THREE.RenderPass.prototype={render:function(t,e,i,r){this.scene.overrideMaterial=this.overrideMaterial,this.clearColor&&(this.oldClearColor.copy(t.getClearColor()),this.oldClearAlpha=t.getClearAlpha(),t.setClearColor(this.clearColor,this.clearAlpha)),t.render(this.scene,this.camera,i,this.clear),this.clearColor&&t.setClearColor(this.oldClearColor,this.oldClearAlpha),this.scene.overrideMaterial=null}},THREE.ShaderPass=function(t,e){this.textureID=void 0!==e?e:"tDiffuse",this.uniforms=THREE.UniformsUtils.clone(t.uniforms),this.material=new THREE.ShaderMaterial({uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader}),this.renderToScreen=!1,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.camera=new THREE.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new THREE.Scene,this.quad=new THREE.Mesh(new THREE.PlaneGeometry(2,2),null),this.scene.add(this.quad)},THREE.ShaderPass.prototype={render:function(t,e,i,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=i),this.quad.material=this.material,this.renderToScreen?t.render(this.scene,this.camera):t.render(this.scene,this.camera,e,this.clear)}},THREE.CopyShader={uniforms:{tDiffuse:{type:"t",value:null},opacity:{type:"f",value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")},THREE.MaskPass=function(t,e){this.scene=t,this.camera=e,this.enabled=!0,this.clear=!0,this.needsSwap=!1,this.inverse=!1},THREE.MaskPass.prototype={render:function(t,e,i,r){var n,a,o=t.context;o.colorMask(!1,!1,!1,!1),o.depthMask(!1),this.inverse?(n=0,a=1):(n=1,a=0),o.enable(o.STENCIL_TEST),o.stencilOp(o.REPLACE,o.REPLACE,o.REPLACE),o.stencilFunc(o.ALWAYS,n,4294967295),o.clearStencil(a),t.render(this.scene,this.camera,i,this.clear),t.render(this.scene,this.camera,e,this.clear),o.colorMask(!0,!0,!0,!0),o.depthMask(!0),o.stencilFunc(o.EQUAL,1,4294967295),o.stencilOp(o.KEEP,o.KEEP,o.KEEP)}},THREE.ClearMaskPass=function(){this.enabled=!0},THREE.ClearMaskPass.prototype={render:function(t,e,i,r){var n=t.context;n.disable(n.STENCIL_TEST)}},THREE.EffectComposer=function(t,e){if(this.renderer=t,void 0===e){var i=window.innerWidth||1,r=window.innerHeight||1,n={minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat,stencilBuffer:!1};e=new THREE.WebGLRenderTarget(i,r,n)}this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.passes=[],void 0===THREE.CopyShader&&console.error("THREE.EffectComposer relies on THREE.CopyShader"),this.copyPass=new THREE.ShaderPass(THREE.CopyShader)},THREE.EffectComposer.prototype={swapBuffers:function(){var t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t},addPass:function(t){this.passes.push(t)},insertPass:function(t,e){this.passes.splice(e,0,t)},render:function(t){this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2;var e,i,r=!1,n=this.passes.length;for(i=0;i lumaMax ) ) {","gl_FragColor = vec4( rgbA, opacity );","} else {","gl_FragColor = vec4( rgbB, opacity );","}","}"].join("\n")},define("THREE",function(t){return function(){return t.THREE}}(this)),define("webgl/webgl.store",["dispatcher","TweenMax"],function(t,e){"use strict";var i,r,n,a=!1,o=!1,s=!1,h=!0,l={globalAlpha:1,maskShift:0,alpha:1,displacementX:0,displacementY:0,maskAlpha:0},c=new TimelineLite,u=function(t){if("texture-reset"===t.type&&(o=!1),"texture-needs-update"===t.type)if(o){if(s)return;s=!0,c.to(l,0,{maskShift:.05,maskAlpha:0}),c.to(l,.6,{globalAlpha:0,displacementY:.5,maskShift:.07,alpha:.5,onComplete:function(){d.dispatch({type:"texture-can-update"}),s=!1}}),c.to(l,0,{alpha:0,maskShift:0,displacementX:1,displacementY:2,maskAlpha:0}),c.to(l,.6,{globalAlpha:1,maskAlpha:1}),c.to(l,2,{maskShift:.05,displacementX:0,displacementY:0},"-=0.6"),c.to(l,1,{alpha:1,maskAlpha:0},"-=1.6"),c.to(l,0,{maskShift:0,displacementY:0,onComplete:function(){}})}else o=!0,d.dispatch({type:"texture-can-update"})},d=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return a||(a=!0,r=document.createElement("canvas").getContext("webgl"),n=document.getElementsByTagName("html")[0],r?h=!0:(h=!1,n.classList.remove("webgl"),n.classList.add("no-webgl")),t.subscribe(u)),{eventEmitter:d,getData:function(){return{shadersData:l,webglSupport:h}}}}),define("webgl/webgl-text.view",["dispatcher","THREE","resize/resize.store","resize/breakpoint-main-text.store","scroll/scroll.store","utils","touch/touch.store","webgl/webgl.store"],function(t,r,n,a,e,i,o,s){"use strict";var h,l,c,u,d,p,f,m,E,g,v,y,T,R,_,x,b,w,H,M,S,C,A,P={mobile:47,tablet1:78,tablet2:155,desktop:193},L={init:function(){var t,e,i=a.getData();m=P[i.breakpoint.name],f=n.getData().width,n.getData().height,c=1,void 0!==window.devicePixelRatio&&(c=window.devicePixelRatio),c=1/c,C=document.getElementById("simpleVertexShader").innerHTML,A=document.getElementById("blurShader").innerHTML,t=.4/f,e=.4/m,"mobile"===i.breakpoint.name&&(t=.2/f,e=.2/m),S={uniforms:{h:{type:"f",value:t},v:{type:"f",value:e}},vertexShader:C,fragmentShader:A},u=new r.OrthographicCamera(f*c/-2,f*c/2,m*c/2,m*c/-2,-100,100),d=new r.Scene,(b=new r.WebGLRenderer({antialias:!0,alpha:!0})).setPixelRatio(window.devicePixelRatio),b.setSize(f,m),b.domElement.style.width="100%",b.domElement.style.height="100%",l.appendChild(b.domElement),w=new r.RenderPass(d,u),M=new r.ShaderPass(S),H=new r.ShaderPass(r.CopyShader),M.renderToScreen=!0,(p=new r.EffectComposer(b)).setSize(f,m),p.addPass(w),p.addPass(H),p.addPass(M)},render:function(){p.render(d,u)},resize:function(){var t=a.getData();m=P[t.breakpoint.name],f=n.getData().width,n.getData().height,u&&b&&(u.left=f*c/-2,u.right=f*c/2,u.top=m*c/2,u.bottom=m*c/-2,u.updateProjectionMatrix(),b.setPixelRatio(window.devicePixelRatio),b.setSize(f,m),b.domElement.style.width="100%",b.domElement.style.height="100%")}},k={init:function(){var t=a.getData();m=P[t.breakpoint.name],T=document.getElementById("text-texture"),f=n.getData().width,n.getData().height,T&&((y=new r.Texture(T)).needsUpdate=!0,y.premultiplyAlpha=!0,y.magFilter=r.NearestFilter,y.minFilter=r.NearestFilter,g=new r.PlaneGeometry(1,1),R=document.getElementById("simpleVertexShader").innerHTML,_=document.getElementById("textShader").innerHTML,x={textTexture:{type:"t",value:y},maskShift:{type:"f",value:0},shiftX:{type:"f",value:0},shiftY:{type:"f",value:0},globalAlpha:{type:"f",value:1},alphaFactor:{type:"f",value:0}},(v=new r.ShaderMaterial({uniforms:x,transparent:!0,vertexShader:R,fragmentShader:_})).blending=r.NormalBlending,(E=new r.Mesh(g,v)).position.x=0,E.position.y=0,E.position.z=0,E.scale.set(f*c,m*c,1),d.add(E))},render:function(){var t=s.getData().shadersData;x.shiftX.value=t.displacementX,x.shiftY.value=t.displacementY,x.maskShift.value=t.maskShift,x.globalAlpha.value=t.globalAlpha,x.alphaFactor.value=t.alpha},resize:function(){var t=a.getData();m=P[t.breakpoint.name],f=n.getData().width,n.getData().height,E&&E.scale.set(f*c,m*c,1)},update:function(){y&&(y.needsUpdate=!0)}},D=function(){l&&(o.getData().isTouchDevice||(L.render(),k.render()),h(D))},F=function(){L.resize(),k.resize()},z=function(){(l=document.getElementById("stage-svg-text"))?s.getData().webglSupport&&Modernizr.webgl&&(L.init(),L.resize(),k.init(),k.resize(),D()):E=p=d=u=l=!1};return{init:function(){h=i.getRequestAnimationFrame(),z(),n.eventEmitter.subscribe(F),t.subscribe(function(t){"mutate"===t.type&&z(),"texture-update"===t.type&&k.update()})}}}),define("webgl/texture.view",["dispatcher","webgl/webgl.store","svg-text/svg-text-positions.store","resize/resize.store","resize/breakpoint-main-text.store","svg-text/svg-text.store","utils"],function(o,t,e,i,s,h,r){"use strict";var l,a,c,u,d,p,f,m,n,E="stage-svg-text",g=!1,v={mobile:47,tablet1:78,tablet2:155,desktop:193},y={mobile:36,tablet1:60,tablet2:120,desktop:150},T=function(){var t,e=s.getData(),i=y[e.breakpoint.name],r=-1