-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvendor.64ca8190.js
More file actions
25 lines (25 loc) · 776 KB
/
vendor.64ca8190.js
File metadata and controls
25 lines (25 loc) · 776 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require=function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[a]={exports:{}};t[a][0].call(l.exports,function(e){var r=t[a][1][e];return i(r?r:e)},l,l.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(){!function(e,t,r){"use strict";function n(e,t){return t=t||Error,function(){var r,n,i=arguments[0],o="["+(e?e+":":"")+i+"] ",a=arguments[1],s=arguments;for(r=o+a.replace(/\{\d+\}/g,function(e){var t=+e.slice(1,-1);return t+2<s.length?ft(s[t+2]):e}),r=r+"\nhttp://errors.angularjs.org/1.3.15/"+(e?e+"/":"")+i,n=2;n<arguments.length;n++)r=r+(2==n?"?":"&")+"p"+(n-2)+"="+encodeURIComponent(ft(arguments[n]));return new t(r)}}function i(e){if(null==e||E(e))return!1;var t=e.length;return e.nodeType===bi&&t?!0:x(e)||fi(e)||0===t||"number"==typeof t&&t>0&&t-1 in e}function o(e,t,r){var n,a;if(e)if(S(e))for(n in e)"prototype"==n||"length"==n||"name"==n||e.hasOwnProperty&&!e.hasOwnProperty(n)||t.call(r,e[n],n,e);else if(fi(e)||i(e)){var s="object"!=typeof e;for(n=0,a=e.length;a>n;n++)(s||n in e)&&t.call(r,e[n],n,e)}else if(e.forEach&&e.forEach!==o)e.forEach(t,r,e);else for(n in e)e.hasOwnProperty(n)&&t.call(r,e[n],n,e);return e}function a(e){return Object.keys(e).sort()}function s(e,t,r){for(var n=a(e),i=0;i<n.length;i++)t.call(r,e[n[i]],n[i]);return n}function u(e){return function(t,r){e(r,t)}}function c(){return++li}function l(e,t){t?e.$$hashKey=t:delete e.$$hashKey}function h(e){for(var t=e.$$hashKey,r=1,n=arguments.length;n>r;r++){var i=arguments[r];if(i)for(var o=Object.keys(i),a=0,s=o.length;s>a;a++){var u=o[a];e[u]=i[u]}}return l(e,t),e}function f(e){return parseInt(e,10)}function p(e,t){return h(Object.create(e),t)}function d(){}function m(e){return e}function v(e){return function(){return e}}function g(e){return"undefined"==typeof e}function y(e){return"undefined"!=typeof e}function b(e){return null!==e&&"object"==typeof e}function x(e){return"string"==typeof e}function w(e){return"number"==typeof e}function _(e){return"[object Date]"===si.call(e)}function S(e){return"function"==typeof e}function M(e){return"[object RegExp]"===si.call(e)}function E(e){return e&&e.window===e}function T(e){return e&&e.$evalAsync&&e.$watch}function C(e){return"[object File]"===si.call(e)}function A(e){return"[object FormData]"===si.call(e)}function $(e){return"[object Blob]"===si.call(e)}function k(e){return"boolean"==typeof e}function P(e){return e&&S(e.then)}function R(e){return!(!e||!(e.nodeName||e.prop&&e.attr&&e.find))}function O(e){var t,r={},n=e.split(",");for(t=0;t<n.length;t++)r[n[t]]=!0;return r}function L(e){return Yn(e.nodeName||e[0]&&e[0].nodeName)}function F(e,t){var r=e.indexOf(t);return r>=0&&e.splice(r,1),t}function j(e,t,r,n){if(E(e)||T(e))throw ui("cpws","Can't copy! Making copies of Window or Scope instances is not supported.");if(t){if(e===t)throw ui("cpi","Can't copy! Source and destination are identical.");if(r=r||[],n=n||[],b(e)){var i=r.indexOf(e);if(-1!==i)return n[i];r.push(e),n.push(t)}var a;if(fi(e)){t.length=0;for(var s=0;s<e.length;s++)a=j(e[s],null,r,n),b(e[s])&&(r.push(e[s]),n.push(a)),t.push(a)}else{var u=t.$$hashKey;fi(t)?t.length=0:o(t,function(e,r){delete t[r]});for(var c in e)e.hasOwnProperty(c)&&(a=j(e[c],null,r,n),b(e[c])&&(r.push(e[c]),n.push(a)),t[c]=a);l(t,u)}}else if(t=e,e)if(fi(e))t=j(e,[],r,n);else if(_(e))t=new Date(e.getTime());else if(M(e))t=new RegExp(e.source,e.toString().match(/[^\/]*$/)[0]),t.lastIndex=e.lastIndex;else if(b(e)){var h=Object.create(Object.getPrototypeOf(e));t=j(e,h,r,n)}return t}function D(e,t){if(fi(e)){t=t||[];for(var r=0,n=e.length;n>r;r++)t[r]=e[r]}else if(b(e)){t=t||{};for(var i in e)("$"!==i.charAt(0)||"$"!==i.charAt(1))&&(t[i]=e[i])}return t||e}function N(e,t){if(e===t)return!0;if(null===e||null===t)return!1;if(e!==e&&t!==t)return!0;var n,i,o,a=typeof e,s=typeof t;if(a==s&&"object"==a){if(!fi(e)){if(_(e))return _(t)?N(e.getTime(),t.getTime()):!1;if(M(e))return M(t)?e.toString()==t.toString():!1;if(T(e)||T(t)||E(e)||E(t)||fi(t)||_(t)||M(t))return!1;o={};for(i in e)if("$"!==i.charAt(0)&&!S(e[i])){if(!N(e[i],t[i]))return!1;o[i]=!0}for(i in t)if(!o.hasOwnProperty(i)&&"$"!==i.charAt(0)&&t[i]!==r&&!S(t[i]))return!1;return!0}if(!fi(t))return!1;if((n=e.length)==t.length){for(i=0;n>i;i++)if(!N(e[i],t[i]))return!1;return!0}}return!1}function U(e,t,r){return e.concat(ii.call(t,r))}function V(e,t){return ii.call(e,t||0)}function B(e,t){var r=arguments.length>2?V(arguments,2):[];return!S(t)||t instanceof RegExp?t:r.length?function(){return arguments.length?t.apply(e,U(r,arguments,0)):t.apply(e,r)}:function(){return arguments.length?t.apply(e,arguments):t.call(e)}}function I(e,n){var i=n;return"string"==typeof e&&"$"===e.charAt(0)&&"$"===e.charAt(1)?i=r:E(n)?i="$WINDOW":n&&t===n?i="$DOCUMENT":T(n)&&(i="$SCOPE"),i}function z(e,t){return"undefined"==typeof e?r:(w(t)||(t=t?2:null),JSON.stringify(e,I,t))}function G(e){return x(e)?JSON.parse(e):e}function H(e){e=ti(e).clone();try{e.empty()}catch(t){}var r=ti("<div>").append(e).html();try{return e[0].nodeType===xi?Yn(r):r.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(e,t){return"<"+Yn(t)})}catch(t){return Yn(r)}}function W(e){try{return decodeURIComponent(e)}catch(t){}}function q(e){var t,r,n={};return o((e||"").split("&"),function(e){if(e&&(t=e.replace(/\+/g,"%20").split("="),r=W(t[0]),y(r))){var i=y(t[1])?W(t[1]):!0;Kn.call(n,r)?fi(n[r])?n[r].push(i):n[r]=[n[r],i]:n[r]=i}}),n}function X(e){var t=[];return o(e,function(e,r){fi(e)?o(e,function(e){t.push(K(r,!0)+(e===!0?"":"="+K(e,!0)))}):t.push(K(r,!0)+(e===!0?"":"="+K(e,!0)))}),t.length?t.join("&"):""}function Y(e){return K(e,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function K(e,t){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,t?"%20":"+")}function Q(e,t){var r,n,i=vi.length;for(e=ti(e),n=0;i>n;++n)if(r=vi[n]+t,x(r=e.attr(r)))return r;return null}function Z(e,t){var r,n,i={};o(vi,function(t){var i=t+"app";!r&&e.hasAttribute&&e.hasAttribute(i)&&(r=e,n=e.getAttribute(i))}),o(vi,function(t){var i,o=t+"app";!r&&(i=e.querySelector("["+o.replace(":","\\:")+"]"))&&(r=i,n=i.getAttribute(o))}),r&&(i.strictDi=null!==Q(r,"strict-di"),t(r,n?[n]:[],i))}function J(r,n,i){b(i)||(i={});var a={strictDi:!1};i=h(a,i);var s=function(){if(r=ti(r),r.injector()){var e=r[0]===t?"document":H(r);throw ui("btstrpd","App Already Bootstrapped with this Element '{0}'",e.replace(/</,"<").replace(/>/,">"))}n=n||[],n.unshift(["$provide",function(e){e.value("$rootElement",r)}]),i.debugInfoEnabled&&n.push(["$compileProvider",function(e){e.debugInfoEnabled(!0)}]),n.unshift("ng");var o=Gt(n,i.strictDi);return o.invoke(["$rootScope","$rootElement","$compile","$injector",function(e,t,r,n){e.$apply(function(){t.data("$injector",n),r(t)(e)})}]),o},u=/^NG_ENABLE_DEBUG_INFO!/,c=/^NG_DEFER_BOOTSTRAP!/;return e&&u.test(e.name)&&(i.debugInfoEnabled=!0,e.name=e.name.replace(u,"")),e&&!c.test(e.name)?s():(e.name=e.name.replace(c,""),ci.resumeBootstrap=function(e){return o(e,function(e){n.push(e)}),s()},void(S(ci.resumeDeferredBootstrap)&&ci.resumeDeferredBootstrap()))}function et(){e.name="NG_ENABLE_DEBUG_INFO!"+e.name,e.location.reload()}function tt(e){var t=ci.element(e).injector();if(!t)throw ui("test","no injector found for element argument to getTestability");return t.get("$$testability")}function rt(e,t){return t=t||"_",e.replace(gi,function(e,r){return(r?t:"")+e.toLowerCase()})}function nt(){var t;yi||(ri=e.jQuery,ri&&ri.fn.on?(ti=ri,h(ri.fn,{scope:Ni.scope,isolateScope:Ni.isolateScope,controller:Ni.controller,injector:Ni.injector,inheritedData:Ni.inheritedData}),t=ri.cleanData,ri.cleanData=function(e){var r;if(hi)hi=!1;else for(var n,i=0;null!=(n=e[i]);i++)r=ri._data(n,"events"),r&&r.$destroy&&ri(n).triggerHandler("$destroy");t(e)}):ti=xt,ci.element=ti,yi=!0)}function it(e,t,r){if(!e)throw ui("areq","Argument '{0}' is {1}",t||"?",r||"required");return e}function ot(e,t,r){return r&&fi(e)&&(e=e[e.length-1]),it(S(e),t,"not a function, got "+(e&&"object"==typeof e?e.constructor.name||"Object":typeof e)),e}function at(e,t){if("hasOwnProperty"===e)throw ui("badname","hasOwnProperty is not a valid {0} name",t)}function st(e,t,r){if(!t)return e;for(var n,i=t.split("."),o=e,a=i.length,s=0;a>s;s++)n=i[s],e&&(e=(o=e)[n]);return!r&&S(e)?B(o,e):e}function ut(e){var t=e[0],r=e[e.length-1],n=[t];do{if(t=t.nextSibling,!t)break;n.push(t)}while(t!==r);return ti(n)}function ct(){return Object.create(null)}function lt(e){function t(e,t,r){return e[t]||(e[t]=r())}var r=n("$injector"),i=n("ng"),o=t(e,"angular",Object);return o.$$minErr=o.$$minErr||n,t(o,"module",function(){var e={};return function(n,o,a){var s=function(e,t){if("hasOwnProperty"===e)throw i("badname","hasOwnProperty is not a valid {0} name",t)};return s(n,"module"),o&&e.hasOwnProperty(n)&&(e[n]=null),t(e,n,function(){function e(e,r,n,i){return i||(i=t),function(){return i[n||"push"]([e,r,arguments]),c}}if(!o)throw r("nomod","Module '{0}' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.",n);var t=[],i=[],s=[],u=e("$injector","invoke","push",i),c={_invokeQueue:t,_configBlocks:i,_runBlocks:s,requires:o,name:n,provider:e("$provide","provider"),factory:e("$provide","factory"),service:e("$provide","service"),value:e("$provide","value"),constant:e("$provide","constant","unshift"),animation:e("$animateProvider","register"),filter:e("$filterProvider","register"),controller:e("$controllerProvider","register"),directive:e("$compileProvider","directive"),config:u,run:function(e){return s.push(e),this}};return a&&u(a),c})}})}function ht(e){var t=[];return JSON.stringify(e,function(e,r){if(r=I(e,r),b(r)){if(t.indexOf(r)>=0)return"<<already seen>>";t.push(r)}return r})}function ft(e){return"function"==typeof e?e.toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof e?"undefined":"string"!=typeof e?ht(e):e}function pt(t){h(t,{bootstrap:J,copy:j,extend:h,equals:N,element:ti,forEach:o,injector:Gt,noop:d,bind:B,toJson:z,fromJson:G,identity:m,isUndefined:g,isDefined:y,isString:x,isFunction:S,isObject:b,isNumber:w,isElement:R,isArray:fi,version:Mi,isDate:_,lowercase:Yn,uppercase:Qn,callbacks:{counter:0},getTestability:tt,$$minErr:n,$$csp:mi,reloadWithDebugInfo:et}),ni=lt(e);try{ni("ngLocale")}catch(r){ni("ngLocale",[]).provider("$locale",vr)}ni("ng",["ngLocale"],["$provide",function(e){e.provider({$$sanitizeUri:Xr}),e.provider("$compile",Qt).directive({a:Po,input:Xo,textarea:Xo,form:jo,script:Da,select:Va,style:Ia,option:Ba,ngBind:Qo,ngBindHtml:Jo,ngBindTemplate:Zo,ngClass:ta,ngClassEven:na,ngClassOdd:ra,ngCloak:ia,ngController:oa,ngForm:Do,ngHide:Pa,ngIf:ua,ngInclude:ca,ngInit:ha,ngNonBindable:Ea,ngPluralize:Ta,ngRepeat:Ca,ngShow:ka,ngStyle:Ra,ngSwitch:Oa,ngSwitchWhen:La,ngSwitchDefault:Fa,ngOptions:Ua,ngTransclude:ja,ngModel:_a,ngList:fa,ngChange:ea,pattern:Ga,ngPattern:Ga,required:za,ngRequired:za,minlength:Wa,ngMinlength:Wa,maxlength:Ha,ngMaxlength:Ha,ngValue:Ko,ngModelOptions:Ma}).directive({ngInclude:la}).directive(Ro).directive(aa),e.provider({$anchorScroll:Ht,$animate:Xi,$browser:Xt,$cacheFactory:Yt,$controller:tr,$document:rr,$exceptionHandler:nr,$filter:sn,$interpolate:dr,$interval:mr,$http:lr,$httpBackend:fr,$location:kr,$log:Pr,$parse:Ir,$rootScope:qr,$q:zr,$$q:Gr,$sce:Zr,$sceDelegate:Qr,$sniffer:Jr,$templateCache:Kt,$templateRequest:en,$$testability:tn,$timeout:rn,$window:an,$$rAF:Wr,$$asyncCallback:Wt,$$jqLite:Ut})}])}function dt(){return++Ti}function mt(e){return e.replace($i,function(e,t,r,n){return n?r.toUpperCase():r}).replace(ki,"Moz$1")}function vt(e){return!Li.test(e)}function gt(e){var t=e.nodeType;return t===bi||!t||t===_i}function yt(e,t){var r,n,i,a,s=t.createDocumentFragment(),u=[];if(vt(e))u.push(t.createTextNode(e));else{for(r=r||s.appendChild(t.createElement("div")),n=(Fi.exec(e)||["",""])[1].toLowerCase(),i=Di[n]||Di._default,r.innerHTML=i[1]+e.replace(ji,"<$1></$2>")+i[2],a=i[0];a--;)r=r.lastChild;u=U(u,r.childNodes),r=s.firstChild,r.textContent=""}return s.textContent="",s.innerHTML="",o(u,function(e){s.appendChild(e)}),s}function bt(e,r){r=r||t;var n;return(n=Oi.exec(e))?[r.createElement(n[1])]:(n=yt(e,r))?n.childNodes:[]}function xt(e){if(e instanceof xt)return e;var t;if(x(e)&&(e=pi(e),t=!0),!(this instanceof xt)){if(t&&"<"!=e.charAt(0))throw Ri("nosel","Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element");return new xt(e)}t?kt(this,bt(e)):kt(this,e)}function wt(e){return e.cloneNode(!0)}function _t(e,t){if(t||Mt(e),e.querySelectorAll)for(var r=e.querySelectorAll("*"),n=0,i=r.length;i>n;n++)Mt(r[n])}function St(e,t,r,n){if(y(n))throw Ri("offargs","jqLite#off() does not support the `selector` argument");var i=Et(e),a=i&&i.events,s=i&&i.handle;if(s)if(t)o(t.split(" "),function(t){if(y(r)){var n=a[t];if(F(n||[],r),n&&n.length>0)return}Ai(e,t,s),delete a[t]});else for(t in a)"$destroy"!==t&&Ai(e,t,s),delete a[t]}function Mt(e,t){var n=e.ng339,i=n&&Ei[n];if(i){if(t)return void delete i.data[t];i.handle&&(i.events.$destroy&&i.handle({},"$destroy"),St(e)),delete Ei[n],e.ng339=r}}function Et(e,t){var n=e.ng339,i=n&&Ei[n];return t&&!i&&(e.ng339=n=dt(),i=Ei[n]={events:{},data:{},handle:r}),i}function Tt(e,t,r){if(gt(e)){var n=y(r),i=!n&&t&&!b(t),o=!t,a=Et(e,!i),s=a&&a.data;if(n)s[t]=r;else{if(o)return s;if(i)return s&&s[t];h(s,t)}}}function Ct(e,t){return e.getAttribute?(" "+(e.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+t+" ")>-1:!1}function At(e,t){t&&e.setAttribute&&o(t.split(" "),function(t){e.setAttribute("class",pi((" "+(e.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+pi(t)+" "," ")))})}function $t(e,t){if(t&&e.setAttribute){var r=(" "+(e.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");o(t.split(" "),function(e){e=pi(e),-1===r.indexOf(" "+e+" ")&&(r+=e+" ")}),e.setAttribute("class",pi(r))}}function kt(e,t){if(t)if(t.nodeType)e[e.length++]=t;else{var r=t.length;if("number"==typeof r&&t.window!==t){if(r)for(var n=0;r>n;n++)e[e.length++]=t[n]}else e[e.length++]=t}}function Pt(e,t){return Rt(e,"$"+(t||"ngController")+"Controller")}function Rt(e,t,n){e.nodeType==_i&&(e=e.documentElement);for(var i=fi(t)?t:[t];e;){for(var o=0,a=i.length;a>o;o++)if((n=ti.data(e,i[o]))!==r)return n;e=e.parentNode||e.nodeType===Si&&e.host}}function Ot(e){for(_t(e,!0);e.firstChild;)e.removeChild(e.firstChild)}function Lt(e,t){t||_t(e);var r=e.parentNode;r&&r.removeChild(e)}function Ft(t,r){r=r||e,"complete"===r.document.readyState?r.setTimeout(t):ti(r).on("load",t)}function jt(e,t){var r=Ui[t.toLowerCase()];return r&&Vi[L(e)]&&r}function Dt(e,t){var r=e.nodeName;return("INPUT"===r||"TEXTAREA"===r)&&Bi[t]}function Nt(e,t){var r=function(r,n){r.isDefaultPrevented=function(){return r.defaultPrevented};var i=t[n||r.type],o=i?i.length:0;if(o){if(g(r.immediatePropagationStopped)){var a=r.stopImmediatePropagation;r.stopImmediatePropagation=function(){r.immediatePropagationStopped=!0,r.stopPropagation&&r.stopPropagation(),a&&a.call(r)}}r.isImmediatePropagationStopped=function(){return r.immediatePropagationStopped===!0},o>1&&(i=D(i));for(var s=0;o>s;s++)r.isImmediatePropagationStopped()||i[s].call(e,r)}};return r.elem=e,r}function Ut(){this.$get=function(){return h(xt,{hasClass:function(e,t){return e.attr&&(e=e[0]),Ct(e,t)},addClass:function(e,t){return e.attr&&(e=e[0]),$t(e,t)},removeClass:function(e,t){return e.attr&&(e=e[0]),At(e,t)}})}}function Vt(e,t){var r=e&&e.$$hashKey;if(r)return"function"==typeof r&&(r=e.$$hashKey()),r;var n=typeof e;return r="function"==n||"object"==n&&null!==e?e.$$hashKey=n+":"+(t||c)():n+":"+e}function Bt(e,t){if(t){var r=0;this.nextUid=function(){return++r}}o(e,this.put,this)}function It(e){var t=e.toString().replace(Hi,""),r=t.match(Ii);return r?"function("+(r[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function zt(e,t,r){var n,i,a,s;if("function"==typeof e){if(!(n=e.$inject)){if(n=[],e.length){if(t)throw x(r)&&r||(r=e.name||It(e)),Wi("strictdi","{0} is not using explicit annotation and cannot be invoked in strict mode",r);i=e.toString().replace(Hi,""),a=i.match(Ii),o(a[1].split(zi),function(e){e.replace(Gi,function(e,t,r){n.push(r)})})}e.$inject=n}}else fi(e)?(s=e.length-1,ot(e[s],"fn"),n=e.slice(0,s)):ot(e,"fn",!0);return n}function Gt(e,t){function n(e){return function(t,r){return b(t)?void o(t,u(e)):e(t,r)}}function i(e,t){if(at(e,"service"),(S(t)||fi(t))&&(t=T.instantiate(t)),!t.$get)throw Wi("pget","Provider '{0}' must define $get factory method.",e);return E[e+w]=t}function a(e,t){return function(){var r=A.invoke(t,this);if(g(r))throw Wi("undef","Provider '{0}' must return a value from $get factory method.",e);return r}}function s(e,t,r){return i(e,{$get:r!==!1?a(e,t):t})}function c(e,t){return s(e,["$injector",function(e){return e.instantiate(t)}])}function l(e,t){return s(e,v(t),!1)}function h(e,t){at(e,"constant"),E[e]=t,C[e]=t}function f(e,t){var r=T.get(e+w),n=r.$get;r.$get=function(){var e=A.invoke(n,r);return A.invoke(t,null,{$delegate:e})}}function p(e){var t,r=[];return o(e,function(e){function n(e){var t,r;for(t=0,r=e.length;r>t;t++){var n=e[t],i=T.get(n[0]);i[n[1]].apply(i,n[2])}}if(!M.get(e)){M.put(e,!0);try{x(e)?(t=ni(e),r=r.concat(p(t.requires)).concat(t._runBlocks),n(t._invokeQueue),n(t._configBlocks)):S(e)?r.push(T.invoke(e)):fi(e)?r.push(T.invoke(e)):ot(e,"module")}catch(i){throw fi(e)&&(e=e[e.length-1]),i.message&&i.stack&&-1==i.stack.indexOf(i.message)&&(i=i.message+"\n"+i.stack),Wi("modulerr","Failed to instantiate module {0} due to:\n{1}",e,i.stack||i.message||i)}}}),r}function m(e,r){function n(t,n){if(e.hasOwnProperty(t)){if(e[t]===y)throw Wi("cdep","Circular dependency found: {0}",t+" <- "+_.join(" <- "));return e[t]}try{return _.unshift(t),e[t]=y,e[t]=r(t,n)}catch(i){throw e[t]===y&&delete e[t],i}finally{_.shift()}}function i(e,r,i,o){"string"==typeof i&&(o=i,i=null);var a,s,u,c=[],l=Gt.$$annotate(e,t,o);for(s=0,a=l.length;a>s;s++){if(u=l[s],"string"!=typeof u)throw Wi("itkn","Incorrect injection token! Expected service name as string, got {0}",u);c.push(i&&i.hasOwnProperty(u)?i[u]:n(u,o))}return fi(e)&&(e=e[a]),e.apply(r,c)}function o(e,t,r){var n=Object.create((fi(e)?e[e.length-1]:e).prototype||null),o=i(e,n,t,r);return b(o)||S(o)?o:n}return{invoke:i,instantiate:o,get:n,annotate:Gt.$$annotate,has:function(t){return E.hasOwnProperty(t+w)||e.hasOwnProperty(t)}}}t=t===!0;var y={},w="Provider",_=[],M=new Bt([],!0),E={$provide:{provider:n(i),factory:n(s),service:n(c),value:n(l),constant:n(h),decorator:f}},T=E.$injector=m(E,function(e,t){throw ci.isString(t)&&_.push(t),Wi("unpr","Unknown provider: {0}",_.join(" <- "))}),C={},A=C.$injector=m(C,function(e,t){var n=T.get(e+w,t);return A.invoke(n.$get,n,r,e)});return o(p(e),function(e){A.invoke(e||d)}),A}function Ht(){var e=!0;this.disableAutoScrolling=function(){e=!1},this.$get=["$window","$location","$rootScope",function(t,r,n){function i(e){var t=null;return Array.prototype.some.call(e,function(e){return"a"===L(e)?(t=e,!0):void 0}),t}function o(){var e=s.yOffset;if(S(e))e=e();else if(R(e)){var r=e[0],n=t.getComputedStyle(r);e="fixed"!==n.position?0:r.getBoundingClientRect().bottom}else w(e)||(e=0);return e}function a(e){if(e){e.scrollIntoView();var r=o();if(r){var n=e.getBoundingClientRect().top;t.scrollBy(0,n-r)}}else t.scrollTo(0,0)}function s(){var e,t=r.hash();t?(e=u.getElementById(t))?a(e):(e=i(u.getElementsByName(t)))?a(e):"top"===t&&a(null):a(null)}var u=t.document;return e&&n.$watch(function(){return r.hash()},function(e,t){(e!==t||""!==e)&&Ft(function(){n.$evalAsync(s)})}),s}]}function Wt(){this.$get=["$$rAF","$timeout",function(e,t){return e.supported?function(t){return e(t)}:function(e){return t(e,0,!1)}}]}function qt(e,t,n,i){function a(e){try{e.apply(null,V(arguments,1))}finally{if(M--,0===M)for(;E.length;)try{E.pop()()}catch(t){n.error(t)}}}function s(e){var t=e.indexOf("#");return-1===t?"":e.substr(t+1)}function u(e,t){!function r(){o(C,function(e){e()}),T=t(r,e)}()}function c(){h(),f()}function l(){try{return b.state}catch(e){}}function h(){A=l(),A=g(A)?null:A,N(A,F)&&(A=F),F=A}function f(){(k!==m.url()||$!==A)&&(k=m.url(),$=A,o(O,function(e){e(m.url(),A)}))}function p(e){try{return decodeURIComponent(e)}catch(t){return e}}var m=this,v=t[0],y=e.location,b=e.history,w=e.setTimeout,_=e.clearTimeout,S={};m.isMock=!1;var M=0,E=[];m.$$completeOutstandingRequest=a,m.$$incOutstandingRequestCount=function(){M++},m.notifyWhenNoOutstandingRequests=function(e){o(C,function(e){e()}),0===M?e():E.push(e)};var T,C=[];m.addPollFn=function(e){return g(T)&&u(100,w),C.push(e),e};var A,$,k=y.href,P=t.find("base"),R=null;h(),$=A,m.url=function(t,r,n){if(g(n)&&(n=null),y!==e.location&&(y=e.location),b!==e.history&&(b=e.history),t){var o=$===n;if(k===t&&(!i.history||o))return m;var a=k&&wr(k)===wr(t);return k=t,$=n,!i.history||a&&o?(a||(R=t),r?y.replace(t):a?y.hash=s(t):y.href=t):(b[r?"replaceState":"pushState"](n,"",t),h(),$=A),m}return R||y.href.replace(/%27/g,"'")},m.state=function(){return A};var O=[],L=!1,F=null;m.onUrlChange=function(t){return L||(i.history&&ti(e).on("popstate",c),ti(e).on("hashchange",c),L=!0),O.push(t),t},m.$$checkUrlChange=f,m.baseHref=function(){var e=P.attr("href");return e?e.replace(/^(https?\:)?\/\/[^\/]*/,""):""};var j={},D="",U=m.baseHref();m.cookies=function(e,t){var i,o,a,s,u;if(!e){if(v.cookie!==D)for(D=v.cookie,o=D.split("; "),j={},s=0;s<o.length;s++)a=o[s],u=a.indexOf("="),u>0&&(e=p(a.substring(0,u)),j[e]===r&&(j[e]=p(a.substring(u+1))));return j}t===r?v.cookie=encodeURIComponent(e)+"=;path="+U+";expires=Thu, 01 Jan 1970 00:00:00 GMT":x(t)&&(i=(v.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path="+U).length+1,i>4096&&n.warn("Cookie '"+e+"' possibly not set or overflowed because it was too large ("+i+" > 4096 bytes)!"))},m.defer=function(e,t){var r;return M++,r=w(function(){delete S[r],a(e)},t||0),S[r]=!0,r},m.defer.cancel=function(e){return S[e]?(delete S[e],_(e),a(d),!0):!1}}function Xt(){this.$get=["$window","$log","$sniffer","$document",function(e,t,r,n){return new qt(e,n,t,r)}]}function Yt(){this.$get=function(){function e(e,r){function i(e){e!=f&&(p?p==e&&(p=e.n):p=e,o(e.n,e.p),o(e,f),f=e,f.n=null)}function o(e,t){e!=t&&(e&&(e.p=t),t&&(t.n=e))}if(e in t)throw n("$cacheFactory")("iid","CacheId '{0}' is already taken!",e);var a=0,s=h({},r,{id:e}),u={},c=r&&r.capacity||Number.MAX_VALUE,l={},f=null,p=null;return t[e]={put:function(e,t){if(c<Number.MAX_VALUE){var r=l[e]||(l[e]={key:e});i(r)}if(!g(t))return e in u||a++,u[e]=t,a>c&&this.remove(p.key),t},get:function(e){if(c<Number.MAX_VALUE){var t=l[e];if(!t)return;i(t)}return u[e]},remove:function(e){if(c<Number.MAX_VALUE){var t=l[e];if(!t)return;t==f&&(f=t.p),t==p&&(p=t.n),o(t.n,t.p),delete l[e]}delete u[e],a--},removeAll:function(){u={},a=0,l={},f=p=null},destroy:function(){u=null,s=null,l=null,delete t[e]},info:function(){return h({},s,{size:a})}}}var t={};return e.info=function(){var e={};return o(t,function(t,r){e[r]=t.info()}),e},e.get=function(e){return t[e]},e}}function Kt(){this.$get=["$cacheFactory",function(e){return e("templates")}]}function Qt(e,n){function i(e,t){var r=/^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/,n={};return o(e,function(e,i){var o=e.match(r);if(!o)throw Yi("iscp","Invalid isolate scope definition for directive '{0}'. Definition: {... {1}: '{2}' ...}",t,i,e);n[i]={mode:o[1][0],collection:"*"===o[2],optional:"?"===o[3],attrName:o[4]||i}}),n}var a={},s="Directive",c=/^\s*directive\:\s*([\w\-]+)\s+(.*)$/,l=/(([\w\-]+)(?:\:([^;]+))?;?)/,f=O("ngSrc,ngSrcset,src,srcset"),g=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,w=/^(on[a-z]+|formaction)$/;this.directive=function M(t,r){return at(t,"directive"),x(t)?(it(r,"directiveFactory"),a.hasOwnProperty(t)||(a[t]=[],e.factory(t+s,["$injector","$exceptionHandler",function(e,r){var n=[];return o(a[t],function(o,a){try{var s=e.invoke(o);S(s)?s={compile:v(s)}:!s.compile&&s.link&&(s.compile=v(s.link)),s.priority=s.priority||0,s.index=a,s.name=s.name||t,s.require=s.require||s.controller&&s.name,s.restrict=s.restrict||"EA",b(s.scope)&&(s.$$isolateBindings=i(s.scope,s.name)),n.push(s)}catch(u){r(u)}}),n}])),a[t].push(r)):o(t,u(M)),this},this.aHrefSanitizationWhitelist=function(e){return y(e)?(n.aHrefSanitizationWhitelist(e),this):n.aHrefSanitizationWhitelist()},this.imgSrcSanitizationWhitelist=function(e){return y(e)?(n.imgSrcSanitizationWhitelist(e),this):n.imgSrcSanitizationWhitelist()};var _=!0;this.debugInfoEnabled=function(e){return y(e)?(_=e,this):_},this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$document","$sce","$animate","$$sanitizeUri",function(e,n,i,u,v,y,M,E,C,A,$){function k(e,t){try{e.addClass(t)}catch(r){}}function P(e,t,r,n,i){e instanceof ti||(e=ti(e)),o(e,function(t,r){t.nodeType==xi&&t.nodeValue.match(/\S+/)&&(e[r]=ti(t).wrap("<span></span>").parent()[0])});var a=O(e,t,e,r,n,i);P.$$addScopeClass(e);var s=null;return function(t,r,n){it(t,"scope"),n=n||{};var i=n.parentBoundTranscludeFn,o=n.transcludeControllers,u=n.futureParentElement;i&&i.$$boundTransclude&&(i=i.$$boundTransclude),s||(s=R(u));var c;if(c="html"!==s?ti(Z(s,ti("<div>").append(e).html())):r?Ni.clone.call(e):e,o)for(var l in o)c.data("$"+l+"Controller",o[l].instance);return P.$$addScopeInfo(c,t),r&&r(c,t),a&&a(t,c,c,i),c}}function R(e){var t=e&&e[0];return t&&"foreignobject"!==L(t)&&t.toString().match(/SVG/)?"svg":"html"}function O(e,t,n,i,o,a){function s(e,n,i,o){var a,s,u,c,l,h,f,p,v;if(d){var g=n.length;for(v=new Array(g),l=0;l<m.length;l+=3)f=m[l],v[f]=n[f]}else v=n;for(l=0,h=m.length;h>l;)u=v[m[l++]],a=m[l++],s=m[l++],a?(a.scope?(c=e.$new(),P.$$addScopeInfo(ti(u),c)):c=e,p=a.transcludeOnThisElement?j(e,a.transclude,o,a.elementTranscludeOnThisElement):!a.templateOnThisElement&&o?o:!o&&t?j(e,t):null,a(s,c,u,i,p)):s&&s(e,u.childNodes,r,o)}for(var u,c,l,h,f,p,d,m=[],v=0;v<e.length;v++)u=new at,c=D(e[v],[],u,0===v?i:r,o),l=c.length?I(c,e[v],u,t,n,null,[],[],a):null,l&&l.scope&&P.$$addScopeClass(u.$$element),f=l&&l.terminal||!(h=e[v].childNodes)||!h.length?null:O(h,l?(l.transcludeOnThisElement||!l.templateOnThisElement)&&l.transclude:t),(l||f)&&(m.push(v,l,f),p=!0,d=d||l),a=null;return p?s:null}function j(e,t,r){var n=function(n,i,o,a,s){return n||(n=e.$new(!1,s),n.$$transcluded=!0),t(n,i,{parentBoundTranscludeFn:r,transcludeControllers:o,futureParentElement:a})};return n}function D(e,t,r,n,i){var o,a,s=e.nodeType,u=r.$attr;switch(s){case bi:G(t,Zt(L(e)),"E",n,i);for(var h,f,p,d,m,v,g=e.attributes,y=0,w=g&&g.length;w>y;y++){var _=!1,S=!1;h=g[y],f=h.name,m=pi(h.value),d=Zt(f),(v=ht.test(d))&&(f=f.replace(Ki,"").substr(8).replace(/_(.)/g,function(e,t){return t.toUpperCase()}));var M=d.replace(/(Start|End)$/,"");W(M)&&d===M+"Start"&&(_=f,S=f.substr(0,f.length-5)+"end",f=f.substr(0,f.length-6)),p=Zt(f.toLowerCase()),u[p]=f,(v||!r.hasOwnProperty(p))&&(r[p]=m,jt(e,p)&&(r[p]=!0)),et(e,t,m,p,v),G(t,p,"A",n,i,_,S)}if(a=e.className,b(a)&&(a=a.animVal),x(a)&&""!==a)for(;o=l.exec(a);)p=Zt(o[2]),G(t,p,"C",n,i)&&(r[p]=pi(o[3])),a=a.substr(o.index+o[0].length);break;case xi:Q(t,e.nodeValue);break;case wi:try{o=c.exec(e.nodeValue),o&&(p=Zt(o[1]),G(t,p,"M",n,i)&&(r[p]=pi(o[2])))}catch(E){}}return t.sort(Y),t}function U(e,t,r){var n=[],i=0;if(t&&e.hasAttribute&&e.hasAttribute(t)){do{if(!e)throw Yi("uterdir","Unterminated attribute, found '{0}' but no matching '{1}' found.",t,r);e.nodeType==bi&&(e.hasAttribute(t)&&i++,e.hasAttribute(r)&&i--),n.push(e),e=e.nextSibling}while(i>0)}else n.push(e);return ti(n)}function B(e,t,r){return function(n,i,o,a,s){return i=U(i[0],t,r),e(n,i,o,a,s)}}function I(e,a,s,u,c,l,h,f,p){function d(e,t,r,n){e&&(r&&(e=B(e,r,n)),e.require=E.require,e.directiveName=C,(L===E||E.$$isolateScope)&&(e=nt(e,{isolateScope:!0})),h.push(e)),t&&(r&&(t=B(t,r,n)),t.require=E.require,t.directiveName=C,(L===E||E.$$isolateScope)&&(t=nt(t,{isolateScope:!0})),f.push(t))}function m(e,t,r,n){var i,a,s="data",u=!1,c=r;if(x(t)){if(a=t.match(g),t=t.substring(a[0].length),a[3]&&(a[1]?a[3]=null:a[1]=a[3]),"^"===a[1]?s="inheritedData":"^^"===a[1]&&(s="inheritedData",c=r.parent()),"?"===a[2]&&(u=!0),i=null,n&&"data"===s&&(i=n[t])&&(i=i.instance),i=i||c[s]("$"+t+"Controller"),!i&&!u)throw Yi("ctreq","Controller '{0}', required by directive '{1}', can't be found!",t,e);return i||null}return fi(t)&&(i=[],o(t,function(t){i.push(m(e,t,r,n))})),i}function w(e,t,i,u,c){function l(e,t,n){var i;return T(e)||(n=t,t=e,e=r),W&&(i=w),n||(n=W?S.parent():S),c(e,t,i,n,$)}var p,d,g,b,x,w,_,S,E;if(a===i?(E=s,S=s.$$element):(S=ti(i),E=new at(S,s)),L&&(x=t.$new(!0)),c&&(_=l,_.$$boundTransclude=c),O&&(M={},w={},o(O,function(e){var r,n={$scope:e===L||e.$$isolateScope?x:t,$element:S,$attrs:E,$transclude:_};b=e.controller,"@"==b&&(b=E[e.name]),r=y(b,n,!0,e.controllerAs),w[e.name]=r,W||S.data("$"+e.name+"Controller",r.instance),M[e.name]=r})),L){P.$$addScopeInfo(S,x,!0,!(F&&(F===L||F===L.$$originalDirective))),P.$$addScopeClass(S,!0);var C=M&&M[L.name],A=x;C&&C.identifier&&L.bindToController===!0&&(A=C.instance),o(x.$$isolateBindings=L.$$isolateBindings,function(e,r){var i,o,a,s,u=e.attrName,c=e.optional,l=e.mode;switch(l){case"@":E.$observe(u,function(e){A[r]=e}),E.$$observers[u].$$scope=t,E[u]&&(A[r]=n(E[u])(t));break;case"=":if(c&&!E[u])return;o=v(E[u]),s=o.literal?N:function(e,t){return e===t||e!==e&&t!==t},a=o.assign||function(){throw i=A[r]=o(t),Yi("nonassign","Expression '{0}' used with directive '{1}' is non-assignable!",E[u],L.name)},i=A[r]=o(t);var h=function(e){return s(e,A[r])||(s(e,i)?a(t,e=A[r]):A[r]=e),i=e};h.$stateful=!0;var f;f=e.collection?t.$watchCollection(E[u],h):t.$watch(v(E[u],h),null,o.literal),x.$on("$destroy",f);break;case"&":o=v(E[u]),A[r]=function(e){return o(t,e)}}})}for(M&&(o(M,function(e){e()}),M=null),p=0,d=h.length;d>p;p++)g=h[p],ot(g,g.isolateScope?x:t,S,E,g.require&&m(g.directiveName,g.require,S,w),_);var $=t;for(L&&(L.template||null===L.templateUrl)&&($=x),e&&e($,i.childNodes,r,c),p=f.length-1;p>=0;p--)g=f[p],ot(g,g.isolateScope?x:t,S,E,g.require&&m(g.directiveName,g.require,S,w),_)}p=p||{};for(var _,M,E,C,A,$,k,R=-Number.MAX_VALUE,O=p.controllerDirectives,L=p.newIsolateScopeDirective,F=p.templateDirective,j=p.nonTlbTranscludeDirective,I=!1,G=!1,W=p.hasElementTranscludeDirective,Y=s.$$element=ti(a),Q=l,J=u,et=0,rt=e.length;rt>et;et++){E=e[et];var it=E.$$start,st=E.$$end;if(it&&(Y=U(a,it,st)),A=r,R>E.priority)break;if((k=E.scope)&&(E.templateUrl||(b(k)?(K("new/isolated scope",L||_,E,Y),L=E):K("new/isolated scope",L,E,Y)),_=_||E),C=E.name,!E.templateUrl&&E.controller&&(k=E.controller,O=O||{},K("'"+C+"' controller",O[C],E,Y),O[C]=E),(k=E.transclude)&&(I=!0,E.$$tlb||(K("transclusion",j,E,Y),j=E),"element"==k?(W=!0,R=E.priority,A=Y,Y=s.$$element=ti(t.createComment(" "+C+": "+s[C]+" ")),a=Y[0],tt(c,V(A),a),J=P(A,u,R,Q&&Q.name,{nonTlbTranscludeDirective:j})):(A=ti(wt(a)).contents(),Y.empty(),J=P(A,u))),E.template)if(G=!0,K("template",F,E,Y),F=E,k=S(E.template)?E.template(Y,s):E.template,k=lt(k),E.replace){if(Q=E,A=vt(k)?[]:er(Z(E.templateNamespace,pi(k))),a=A[0],1!=A.length||a.nodeType!==bi)throw Yi("tplrt","Template for directive '{0}' must have exactly one root element. {1}",C,"");tt(c,Y,a);var ut={$attr:{}},ct=D(a,[],ut),ht=e.splice(et+1,e.length-(et+1));L&&z(ct),e=e.concat(ct).concat(ht),q(s,ut),rt=e.length}else Y.html(k);if(E.templateUrl)G=!0,K("template",F,E,Y),F=E,E.replace&&(Q=E),w=X(e.splice(et,e.length-et),Y,s,c,I&&J,h,f,{controllerDirectives:O,newIsolateScopeDirective:L,templateDirective:F,nonTlbTranscludeDirective:j}),rt=e.length;else if(E.compile)try{$=E.compile(Y,s,J),S($)?d(null,$,it,st):$&&d($.pre,$.post,it,st)}catch(ft){i(ft,H(Y))}E.terminal&&(w.terminal=!0,R=Math.max(R,E.priority))
}return w.scope=_&&_.scope===!0,w.transcludeOnThisElement=I,w.elementTranscludeOnThisElement=W,w.templateOnThisElement=G,w.transclude=J,p.hasElementTranscludeDirective=W,w}function z(e){for(var t=0,r=e.length;r>t;t++)e[t]=p(e[t],{$$isolateScope:!0})}function G(t,n,o,u,c,l,h){if(n===c)return null;var f=null;if(a.hasOwnProperty(n))for(var d,m=e.get(n+s),v=0,g=m.length;g>v;v++)try{d=m[v],(u===r||u>d.priority)&&-1!=d.restrict.indexOf(o)&&(l&&(d=p(d,{$$start:l,$$end:h})),t.push(d),f=d)}catch(y){i(y)}return f}function W(t){if(a.hasOwnProperty(t))for(var r,n=e.get(t+s),i=0,o=n.length;o>i;i++)if(r=n[i],r.multiElement)return!0;return!1}function q(e,t){var r=t.$attr,n=e.$attr,i=e.$$element;o(e,function(n,i){"$"!=i.charAt(0)&&(t[i]&&t[i]!==n&&(n+=("style"===i?";":" ")+t[i]),e.$set(i,n,!0,r[i]))}),o(t,function(t,o){"class"==o?(k(i,t),e["class"]=(e["class"]?e["class"]+" ":"")+t):"style"==o?(i.attr("style",i.attr("style")+";"+t),e.style=(e.style?e.style+";":"")+t):"$"==o.charAt(0)||e.hasOwnProperty(o)||(e[o]=t,n[o]=r[o])})}function X(e,t,r,n,i,a,s,c){var l,h,f=[],d=t[0],m=e.shift(),v=p(m,{templateUrl:null,transclude:null,replace:null,$$originalDirective:m}),g=S(m.templateUrl)?m.templateUrl(t,r):m.templateUrl,y=m.templateNamespace;return t.empty(),u(C.getTrustedResourceUrl(g)).then(function(u){var p,x,w,_;if(u=lt(u),m.replace){if(w=vt(u)?[]:er(Z(y,pi(u))),p=w[0],1!=w.length||p.nodeType!==bi)throw Yi("tplrt","Template for directive '{0}' must have exactly one root element. {1}",m.name,g);x={$attr:{}},tt(n,t,p);var S=D(p,[],x);b(m.scope)&&z(S),e=S.concat(e),q(r,x)}else p=d,t.html(u);for(e.unshift(v),l=I(e,p,r,i,t,m,a,s,c),o(n,function(e,r){e==p&&(n[r]=t[0])}),h=O(t[0].childNodes,i);f.length;){var M=f.shift(),E=f.shift(),T=f.shift(),C=f.shift(),A=t[0];if(!M.$$destroyed){if(E!==d){var $=E.className;c.hasElementTranscludeDirective&&m.replace||(A=wt(p)),tt(T,ti(E),A),k(ti(A),$)}_=l.transcludeOnThisElement?j(M,l.transclude,C):C,l(h,M,A,n,_)}}f=null}),function(e,t,r,n,i){var o=i;t.$$destroyed||(f?f.push(t,r,n,o):(l.transcludeOnThisElement&&(o=j(t,l.transclude,i)),l(h,t,r,n,o)))}}function Y(e,t){var r=t.priority-e.priority;return 0!==r?r:e.name!==t.name?e.name<t.name?-1:1:e.index-t.index}function K(e,t,r,n){if(t)throw Yi("multidir","Multiple directives [{0}, {1}] asking for {2} on: {3}",t.name,r.name,e,H(n))}function Q(e,t){var r=n(t,!0);r&&e.push({priority:0,compile:function(e){var t=e.parent(),n=!!t.length;return n&&P.$$addBindingClass(t),function(e,t){var i=t.parent();n||P.$$addBindingClass(i),P.$$addBindingInfo(i,r.expressions),e.$watch(r,function(e){t[0].nodeValue=e})}}})}function Z(e,r){switch(e=Yn(e||"html")){case"svg":case"math":var n=t.createElement("div");return n.innerHTML="<"+e+">"+r+"</"+e+">",n.childNodes[0].childNodes;default:return r}}function J(e,t){if("srcdoc"==t)return C.HTML;var r=L(e);return"xlinkHref"==t||"form"==r&&"action"==t||"img"!=r&&("src"==t||"ngSrc"==t)?C.RESOURCE_URL:void 0}function et(e,t,r,i,o){var a=J(e,i);o=f[i]||o;var s=n(r,!0,a,o);if(s){if("multiple"===i&&"select"===L(e))throw Yi("selmulti","Binding to the 'multiple' attribute is not supported. Element: {0}",H(e));t.push({priority:100,compile:function(){return{pre:function(e,t,u){var c=u.$$observers||(u.$$observers={});if(w.test(i))throw Yi("nodomevents","Interpolations for HTML DOM event attributes are disallowed. Please use the ng- versions (such as ng-click instead of onclick) instead.");var l=u[i];l!==r&&(s=l&&n(l,!0,a,o),r=l),s&&(u[i]=s(e),(c[i]||(c[i]=[])).$$inter=!0,(u.$$observers&&u.$$observers[i].$$scope||e).$watch(s,function(e,t){"class"===i&&e!=t?u.$updateClass(e,t):u.$set(i,e)}))}}}})}}function tt(e,r,n){var i,o,a=r[0],s=r.length,u=a.parentNode;if(e)for(i=0,o=e.length;o>i;i++)if(e[i]==a){e[i++]=n;for(var c=i,l=c+s-1,h=e.length;h>c;c++,l++)h>l?e[c]=e[l]:delete e[c];e.length-=s-1,e.context===a&&(e.context=n);break}u&&u.replaceChild(n,a);var f=t.createDocumentFragment();f.appendChild(a),ti(n).data(ti(a).data()),ri?(hi=!0,ri.cleanData([a])):delete ti.cache[a[ti.expando]];for(var p=1,d=r.length;d>p;p++){var m=r[p];ti(m).remove(),f.appendChild(m),delete r[p]}r[0]=n,r.length=1}function nt(e,t){return h(function(){return e.apply(null,arguments)},e,t)}function ot(e,t,r,n,o,a){try{e(t,r,n,o,a)}catch(s){i(s,H(r))}}var at=function(e,t){if(t){var r,n,i,o=Object.keys(t);for(r=0,n=o.length;n>r;r++)i=o[r],this[i]=t[i]}else this.$attr={};this.$$element=e};at.prototype={$normalize:Zt,$addClass:function(e){e&&e.length>0&&A.addClass(this.$$element,e)},$removeClass:function(e){e&&e.length>0&&A.removeClass(this.$$element,e)},$updateClass:function(e,t){var r=Jt(e,t);r&&r.length&&A.addClass(this.$$element,r);var n=Jt(t,e);n&&n.length&&A.removeClass(this.$$element,n)},$set:function(e,t,n,a){var s,u=this.$$element[0],c=jt(u,e),l=Dt(u,e),h=e;if(c?(this.$$element.prop(e,t),a=c):l&&(this[l]=t,h=l),this[e]=t,a?this.$attr[e]=a:(a=this.$attr[e],a||(this.$attr[e]=a=rt(e,"-"))),s=L(this.$$element),"a"===s&&"href"===e||"img"===s&&"src"===e)this[e]=t=$(t,"src"===e);else if("img"===s&&"srcset"===e){for(var f="",p=pi(t),d=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,m=/\s/.test(p)?d:/(,)/,v=p.split(m),g=Math.floor(v.length/2),y=0;g>y;y++){var b=2*y;f+=$(pi(v[b]),!0),f+=" "+pi(v[b+1])}var x=pi(v[2*y]).split(/\s/);f+=$(pi(x[0]),!0),2===x.length&&(f+=" "+pi(x[1])),this[e]=t=f}n!==!1&&(null===t||t===r?this.$$element.removeAttr(a):this.$$element.attr(a,t));var w=this.$$observers;w&&o(w[h],function(e){try{e(t)}catch(r){i(r)}})},$observe:function(e,t){var r=this,n=r.$$observers||(r.$$observers=ct()),i=n[e]||(n[e]=[]);return i.push(t),M.$evalAsync(function(){!i.$$inter&&r.hasOwnProperty(e)&&t(r[e])}),function(){F(i,t)}}};var st=n.startSymbol(),ut=n.endSymbol(),lt="{{"==st||"}}"==ut?m:function(e){return e.replace(/\{\{/g,st).replace(/}}/g,ut)},ht=/^ngAttr[A-Z]/;return P.$$addBindingInfo=_?function(e,t){var r=e.data("$binding")||[];fi(t)?r=r.concat(t):r.push(t),e.data("$binding",r)}:d,P.$$addBindingClass=_?function(e){k(e,"ng-binding")}:d,P.$$addScopeInfo=_?function(e,t,r,n){var i=r?n?"$isolateScopeNoTemplate":"$isolateScope":"$scope";e.data(i,t)}:d,P.$$addScopeClass=_?function(e,t){k(e,t?"ng-isolate-scope":"ng-scope")}:d,P}]}function Zt(e){return mt(e.replace(Ki,""))}function Jt(e,t){var r="",n=e.split(/\s+/),i=t.split(/\s+/);e:for(var o=0;o<n.length;o++){for(var a=n[o],s=0;s<i.length;s++)if(a==i[s])continue e;r+=(r.length>0?" ":"")+a}return r}function er(e){e=ti(e);var t=e.length;if(1>=t)return e;for(;t--;){var r=e[t];r.nodeType===wi&&oi.call(e,t,1)}return e}function tr(){var e={},t=!1,i=/^(\S+)(\s+as\s+(\w+))?$/;this.register=function(t,r){at(t,"controller"),b(t)?h(e,t):e[t]=r},this.allowGlobals=function(){t=!0},this.$get=["$injector","$window",function(o,a){function s(e,t,r,i){if(!e||!b(e.$scope))throw n("$controller")("noscp","Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",i,t);e.$scope[t]=r}return function(n,u,c,l){var f,p,d,m;if(c=c===!0,l&&x(l)&&(m=l),x(n)){if(p=n.match(i),!p)throw Qi("ctrlfmt","Badly formed controller string '{0}'. Must match `__name__ as __id__` or `__name__`.",n);d=p[1],m=m||p[3],n=e.hasOwnProperty(d)?e[d]:st(u.$scope,d,!0)||(t?st(a,d,!0):r),ot(n,d,!0)}if(c){var v=(fi(n)?n[n.length-1]:n).prototype;return f=Object.create(v||null),m&&s(u,m,f,d||n.name),h(function(){return o.invoke(n,f,u,d),f},{instance:f,identifier:m})}return f=o.instantiate(n,u,d),m&&s(u,m,f,d||n.name),f}}]}function rr(){this.$get=["$window",function(e){return ti(e.document)}]}function nr(){this.$get=["$log",function(e){return function(){e.error.apply(e,arguments)}}]}function ir(e,t){if(x(e)){var r=e.replace(ro,"").trim();if(r){var n=t("Content-Type");(n&&0===n.indexOf(Zi)||or(r))&&(e=G(r))}}return e}function or(e){var t=e.match(eo);return t&&to[t[0]].test(e)}function ar(e){var t,r,n,i=ct();return e?(o(e.split("\n"),function(e){n=e.indexOf(":"),t=Yn(pi(e.substr(0,n))),r=pi(e.substr(n+1)),t&&(i[t]=i[t]?i[t]+", "+r:r)}),i):i}function sr(e){var t=b(e)?e:r;return function(r){if(t||(t=ar(e)),r){var n=t[Yn(r)];return void 0===n&&(n=null),n}return t}}function ur(e,t,r,n){return S(n)?n(e,t,r):(o(n,function(n){e=n(e,t,r)}),e)}function cr(e){return e>=200&&300>e}function lr(){var e=this.defaults={transformResponse:[ir],transformRequest:[function(e){return!b(e)||C(e)||$(e)||A(e)?e:z(e)}],headers:{common:{Accept:"application/json, text/plain, */*"},post:D(Ji),put:D(Ji),patch:D(Ji)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN"},t=!1;this.useApplyAsync=function(e){return y(e)?(t=!!e,this):t};var i=this.interceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(a,u,c,l,f,p){function d(t){function i(e){var t=h({},e);return t.data=e.data?ur(e.data,e.headers,e.status,u.transformResponse):e.data,cr(e.status)?t:f.reject(t)}function a(e){var t,r={};return o(e,function(e,n){S(e)?(t=e(),null!=t&&(r[n]=t)):r[n]=e}),r}function s(t){var r,n,i,o=e.headers,s=h({},t.headers);o=h({},o.common,o[Yn(t.method)]);e:for(r in o){n=Yn(r);for(i in s)if(Yn(i)===n)continue e;s[r]=o[r]}return a(s)}if(!ci.isObject(t))throw n("$http")("badreq","Http request configuration must be an object. Received: {0}",t);var u=h({method:"get",transformRequest:e.transformRequest,transformResponse:e.transformResponse},t);u.headers=s(t),u.method=Qn(u.method);var c=function(t){var n=t.headers,a=ur(t.data,sr(n),r,t.transformRequest);return g(a)&&o(n,function(e,t){"content-type"===Yn(t)&&delete n[t]}),g(t.withCredentials)&&!g(e.withCredentials)&&(t.withCredentials=e.withCredentials),w(t,a).then(i,i)},l=[c,r],p=f.when(u);for(o(T,function(e){(e.request||e.requestError)&&l.unshift(e.request,e.requestError),(e.response||e.responseError)&&l.push(e.response,e.responseError)});l.length;){var d=l.shift(),m=l.shift();p=p.then(d,m)}return p.success=function(e){return p.then(function(t){e(t.data,t.status,t.headers,u)}),p},p.error=function(e){return p.then(null,function(t){e(t.data,t.status,t.headers,u)}),p},p}function m(){o(arguments,function(e){d[e]=function(t,r){return d(h(r||{},{method:e,url:t}))}})}function v(){o(arguments,function(e){d[e]=function(t,r,n){return d(h(n||{},{method:e,url:t,data:r}))}})}function w(n,i){function o(e,r,n,i){function o(){s(r,e,n,i)}p&&(cr(e)?p.put(_,[e,r,ar(n),i]):p.remove(_)),t?l.$applyAsync(o):(o(),l.$$phase||l.$apply())}function s(e,t,r,i){t=Math.max(t,0),(cr(t)?v.resolve:v.reject)({data:e,status:t,headers:sr(r),config:n,statusText:i})}function c(e){s(e.data,e.status,D(e.headers()),e.statusText)}function h(){var e=d.pendingRequests.indexOf(n);-1!==e&&d.pendingRequests.splice(e,1)}var p,m,v=f.defer(),x=v.promise,w=n.headers,_=M(n.url,n.params);if(d.pendingRequests.push(n),x.then(h,h),!n.cache&&!e.cache||n.cache===!1||"GET"!==n.method&&"JSONP"!==n.method||(p=b(n.cache)?n.cache:b(e.cache)?e.cache:E),p&&(m=p.get(_),y(m)?P(m)?m.then(c,c):fi(m)?s(m[1],m[0],D(m[2]),m[3]):s(m,200,{},"OK"):p.put(_,x)),g(m)){var S=on(n.url)?u.cookies()[n.xsrfCookieName||e.xsrfCookieName]:r;S&&(w[n.xsrfHeaderName||e.xsrfHeaderName]=S),a(n.method,_,i,o,w,n.timeout,n.withCredentials,n.responseType)}return x}function M(e,t){if(!t)return e;var r=[];return s(t,function(e,t){null===e||g(e)||(fi(e)||(e=[e]),o(e,function(e){b(e)&&(e=_(e)?e.toISOString():z(e)),r.push(K(t)+"="+K(e))}))}),r.length>0&&(e+=(-1==e.indexOf("?")?"?":"&")+r.join("&")),e}var E=c("$http"),T=[];return o(i,function(e){T.unshift(x(e)?p.get(e):p.invoke(e))}),d.pendingRequests=[],m("get","delete","head","jsonp"),v("post","put","patch"),d.defaults=e,d}]}function hr(){return new e.XMLHttpRequest}function fr(){this.$get=["$browser","$window","$document",function(e,t,r){return pr(e,hr,e.defer,t.angular.callbacks,r[0])}]}function pr(e,t,n,i,a){function s(e,t,r){var n=a.createElement("script"),o=null;return n.type="text/javascript",n.src=e,n.async=!0,o=function(e){Ai(n,"load",o),Ai(n,"error",o),a.body.removeChild(n),n=null;var s=-1,u="unknown";e&&("load"!==e.type||i[t].called||(e={type:"error"}),u=e.type,s="error"===e.type?404:200),r&&r(s,u)},Ci(n,"load",o),Ci(n,"error",o),a.body.appendChild(n),o}return function(a,u,c,l,h,f,p,m){function v(){x&&x(),w&&w.abort()}function g(t,i,o,a,s){M!==r&&n.cancel(M),x=w=null,t(i,o,a,s),e.$$completeOutstandingRequest(d)}if(e.$$incOutstandingRequestCount(),u=u||e.url(),"jsonp"==Yn(a)){var b="_"+(i.counter++).toString(36);i[b]=function(e){i[b].data=e,i[b].called=!0};var x=s(u.replace("JSON_CALLBACK","angular.callbacks."+b),b,function(e,t){g(l,e,i[b].data,"",t),i[b]=d})}else{var w=t();w.open(a,u,!0),o(h,function(e,t){y(e)&&w.setRequestHeader(t,e)}),w.onload=function(){var e=w.statusText||"",t="response"in w?w.response:w.responseText,r=1223===w.status?204:w.status;0===r&&(r=t?200:"file"==nn(u).protocol?404:0),g(l,r,t,w.getAllResponseHeaders(),e)};var _=function(){g(l,-1,null,null,"")};if(w.onerror=_,w.onabort=_,p&&(w.withCredentials=!0),m)try{w.responseType=m}catch(S){if("json"!==m)throw S}w.send(c||null)}if(f>0)var M=n(v,f);else P(f)&&f.then(v)}}function dr(){var e="{{",t="}}";this.startSymbol=function(t){return t?(e=t,this):e},this.endSymbol=function(e){return e?(t=e,this):t},this.$get=["$parse","$exceptionHandler","$sce",function(r,n,i){function o(e){return"\\\\\\"+e}function a(o,a,f,p){function d(r){return r.replace(c,e).replace(l,t)}function m(e){try{return e=$(e),p&&!y(e)?e:k(e)}catch(t){var r=no("interr","Can't interpolate: {0}\n{1}",o,t.toString());n(r)}}p=!!p;for(var v,b,x,w=0,_=[],M=[],E=o.length,T=[],C=[];E>w;){if(-1==(v=o.indexOf(e,w))||-1==(b=o.indexOf(t,v+s))){w!==E&&T.push(d(o.substring(w)));break}w!==v&&T.push(d(o.substring(w,v))),x=o.substring(v+s,b),_.push(x),M.push(r(x,m)),w=b+u,C.push(T.length),T.push("")}if(f&&T.length>1)throw no("noconcat","Error while interpolating: {0}\nStrict Contextual Escaping disallows interpolations that concatenate multiple expressions when a trusted value is required. See http://docs.angularjs.org/api/ng.$sce",o);if(!a||_.length){var A=function(e){for(var t=0,r=_.length;r>t;t++){if(p&&g(e[t]))return;T[C[t]]=e[t]}return T.join("")},$=function(e){return f?i.getTrusted(f,e):i.valueOf(e)},k=function(e){if(null==e)return"";switch(typeof e){case"string":break;case"number":e=""+e;break;default:e=z(e)}return e};return h(function(e){var t=0,r=_.length,i=new Array(r);try{for(;r>t;t++)i[t]=M[t](e);return A(i)}catch(a){var s=no("interr","Can't interpolate: {0}\n{1}",o,a.toString());n(s)}},{exp:o,expressions:_,$$watchDelegate:function(e,t,r){var n;return e.$watchGroup(M,function(r,i){var o=A(r);S(t)&&t.call(this,o,r!==i?n:o,e),n=o},r)}})}}var s=e.length,u=t.length,c=new RegExp(e.replace(/./g,o),"g"),l=new RegExp(t.replace(/./g,o),"g");return a.startSymbol=function(){return e},a.endSymbol=function(){return t},a}]}function mr(){this.$get=["$rootScope","$window","$q","$$q",function(e,t,r,n){function i(i,a,s,u){var c=t.setInterval,l=t.clearInterval,h=0,f=y(u)&&!u,p=(f?n:r).defer(),d=p.promise;return s=y(s)?s:0,d.then(null,null,i),d.$$intervalId=c(function(){p.notify(h++),s>0&&h>=s&&(p.resolve(h),l(d.$$intervalId),delete o[d.$$intervalId]),f||e.$apply()},a),o[d.$$intervalId]=p,d}var o={};return i.cancel=function(e){return e&&e.$$intervalId in o?(o[e.$$intervalId].reject("canceled"),t.clearInterval(e.$$intervalId),delete o[e.$$intervalId],!0):!1},i}]}function vr(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"¤",posSuf:"",negPre:"(¤",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a",ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"]},pluralCat:function(e){return 1===e?"one":"other"}}}}function gr(e){for(var t=e.split("/"),r=t.length;r--;)t[r]=Y(t[r]);return t.join("/")}function yr(e,t){var r=nn(e);t.$$protocol=r.protocol,t.$$host=r.hostname,t.$$port=f(r.port)||oo[r.protocol]||null}function br(e,t){var r="/"!==e.charAt(0);r&&(e="/"+e);var n=nn(e);t.$$path=decodeURIComponent(r&&"/"===n.pathname.charAt(0)?n.pathname.substring(1):n.pathname),t.$$search=q(n.search),t.$$hash=decodeURIComponent(n.hash),t.$$path&&"/"!=t.$$path.charAt(0)&&(t.$$path="/"+t.$$path)}function xr(e,t){return 0===t.indexOf(e)?t.substr(e.length):void 0}function wr(e){var t=e.indexOf("#");return-1==t?e:e.substr(0,t)}function _r(e){return e.replace(/(#.+)|#$/,"$1")}function Sr(e){return e.substr(0,wr(e).lastIndexOf("/")+1)}function Mr(e){return e.substring(0,e.indexOf("/",e.indexOf("//")+2))}function Er(e,t){this.$$html5=!0,t=t||"";var n=Sr(e);yr(e,this),this.$$parse=function(e){var t=xr(n,e);if(!x(t))throw ao("ipthprfx",'Invalid url "{0}", missing path prefix "{1}".',e,n);br(t,this),this.$$path||(this.$$path="/"),this.$$compose()},this.$$compose=function(){var e=X(this.$$search),t=this.$$hash?"#"+Y(this.$$hash):"";this.$$url=gr(this.$$path)+(e?"?"+e:"")+t,this.$$absUrl=n+this.$$url.substr(1)},this.$$parseLinkUrl=function(i,o){if(o&&"#"===o[0])return this.hash(o.slice(1)),!0;var a,s,u;return(a=xr(e,i))!==r?(s=a,u=(a=xr(t,a))!==r?n+(xr("/",a)||a):e+s):(a=xr(n,i))!==r?u=n+a:n==i+"/"&&(u=n),u&&this.$$parse(u),!!u}}function Tr(e,t){var r=Sr(e);yr(e,this),this.$$parse=function(n){function i(e,t,r){var n,i=/^\/[A-Z]:(\/.*)/;return 0===t.indexOf(r)&&(t=t.replace(r,"")),i.exec(t)?e:(n=i.exec(e),n?n[1]:e)}var o,a=xr(e,n)||xr(r,n);"#"===a.charAt(0)?(o=xr(t,a),g(o)&&(o=a)):o=this.$$html5?a:"",br(o,this),this.$$path=i(this.$$path,o,e),this.$$compose()},this.$$compose=function(){var r=X(this.$$search),n=this.$$hash?"#"+Y(this.$$hash):"";this.$$url=gr(this.$$path)+(r?"?"+r:"")+n,this.$$absUrl=e+(this.$$url?t+this.$$url:"")},this.$$parseLinkUrl=function(t){return wr(e)==wr(t)?(this.$$parse(t),!0):!1}}function Cr(e,t){this.$$html5=!0,Tr.apply(this,arguments);var r=Sr(e);this.$$parseLinkUrl=function(n,i){if(i&&"#"===i[0])return this.hash(i.slice(1)),!0;var o,a;return e==wr(n)?o=n:(a=xr(r,n))?o=e+t+a:r===n+"/"&&(o=r),o&&this.$$parse(o),!!o},this.$$compose=function(){var r=X(this.$$search),n=this.$$hash?"#"+Y(this.$$hash):"";this.$$url=gr(this.$$path)+(r?"?"+r:"")+n,this.$$absUrl=e+t+this.$$url}}function Ar(e){return function(){return this[e]}}function $r(e,t){return function(r){return g(r)?this[e]:(this[e]=t(r),this.$$compose(),this)}}function kr(){var e="",t={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(t){return y(t)?(e=t,this):e},this.html5Mode=function(e){return k(e)?(t.enabled=e,this):b(e)?(k(e.enabled)&&(t.enabled=e.enabled),k(e.requireBase)&&(t.requireBase=e.requireBase),k(e.rewriteLinks)&&(t.rewriteLinks=e.rewriteLinks),this):t},this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(r,n,i,o,a){function s(e,t,r){var i=c.url(),o=c.$$state;try{n.url(e,t,r),c.$$state=n.state()}catch(a){throw c.url(i),c.$$state=o,a}}function u(e,t){r.$broadcast("$locationChangeSuccess",c.absUrl(),e,c.$$state,t)}var c,l,h,f=n.baseHref(),p=n.url();if(t.enabled){if(!f&&t.requireBase)throw ao("nobase","$location in HTML5 mode requires a <base> tag to be present!");h=Mr(p)+(f||"/"),l=i.history?Er:Cr}else h=wr(p),l=Tr;c=new l(h,"#"+e),c.$$parseLinkUrl(p,p),c.$$state=n.state();var d=/^\s*(javascript|mailto):/i;o.on("click",function(e){if(t.rewriteLinks&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&2!=e.which&&2!=e.button){for(var i=ti(e.target);"a"!==L(i[0]);)if(i[0]===o[0]||!(i=i.parent())[0])return;var s=i.prop("href"),u=i.attr("href")||i.attr("xlink:href");b(s)&&"[object SVGAnimatedString]"===s.toString()&&(s=nn(s.animVal).href),d.test(s)||!s||i.attr("target")||e.isDefaultPrevented()||c.$$parseLinkUrl(s,u)&&(e.preventDefault(),c.absUrl()!=n.url()&&(r.$apply(),a.angular["ff-684208-preventDefault"]=!0))}}),_r(c.absUrl())!=_r(p)&&n.url(c.absUrl(),!0);var m=!0;return n.onUrlChange(function(e,t){r.$evalAsync(function(){var n,i=c.absUrl(),o=c.$$state;c.$$parse(e),c.$$state=t,n=r.$broadcast("$locationChangeStart",e,i,t,o).defaultPrevented,c.absUrl()===e&&(n?(c.$$parse(i),c.$$state=o,s(i,!1,o)):(m=!1,u(i,o)))}),r.$$phase||r.$digest()}),r.$watch(function(){var e=_r(n.url()),t=_r(c.absUrl()),o=n.state(),a=c.$$replace,l=e!==t||c.$$html5&&i.history&&o!==c.$$state;(m||l)&&(m=!1,r.$evalAsync(function(){var t=c.absUrl(),n=r.$broadcast("$locationChangeStart",t,e,c.$$state,o).defaultPrevented;c.absUrl()===t&&(n?(c.$$parse(e),c.$$state=o):(l&&s(t,a,o===c.$$state?null:c.$$state),u(e,o)))})),c.$$replace=!1}),c}]}function Pr(){var e=!0,t=this;this.debugEnabled=function(t){return y(t)?(e=t,this):e},this.$get=["$window",function(r){function n(e){return e instanceof Error&&(e.stack?e=e.message&&-1===e.stack.indexOf(e.message)?"Error: "+e.message+"\n"+e.stack:e.stack:e.sourceURL&&(e=e.message+"\n"+e.sourceURL+":"+e.line)),e}function i(e){var t=r.console||{},i=t[e]||t.log||d,a=!1;try{a=!!i.apply}catch(s){}return a?function(){var e=[];return o(arguments,function(t){e.push(n(t))}),i.apply(t,e)}:function(e,t){i(e,null==t?"":t)}}return{log:i("log"),info:i("info"),warn:i("warn"),error:i("error"),debug:function(){var r=i("debug");return function(){e&&r.apply(t,arguments)}}()}}]}function Rr(e,t){if("__defineGetter__"===e||"__defineSetter__"===e||"__lookupGetter__"===e||"__lookupSetter__"===e||"__proto__"===e)throw uo("isecfld","Attempting to access a disallowed field in Angular expressions! Expression: {0}",t);return e}function Or(e,t){if(e){if(e.constructor===e)throw uo("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",t);if(e.window===e)throw uo("isecwindow","Referencing the Window in Angular expressions is disallowed! Expression: {0}",t);if(e.children&&(e.nodeName||e.prop&&e.attr&&e.find))throw uo("isecdom","Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}",t);if(e===Object)throw uo("isecobj","Referencing Object in Angular expressions is disallowed! Expression: {0}",t)}return e}function Lr(e,t){if(e){if(e.constructor===e)throw uo("isecfn","Referencing Function in Angular expressions is disallowed! Expression: {0}",t);if(e===co||e===lo||e===ho)throw uo("isecff","Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}",t)}}function Fr(e){return e.constant}function jr(e,t,r,n,i){Or(e,i),Or(t,i);for(var o,a=r.split("."),s=0;a.length>1;s++){o=Rr(a.shift(),i);var u=0===s&&t&&t[o]||e[o];u||(u={},e[o]=u),e=Or(u,i)}return o=Rr(a.shift(),i),Or(e[o],i),e[o]=n,n}function Dr(e){return"constructor"==e}function Nr(e,t,n,i,o,a,s){Rr(e,a),Rr(t,a),Rr(n,a),Rr(i,a),Rr(o,a);var u=function(e){return Or(e,a)},c=s||Dr(e)?u:m,l=s||Dr(t)?u:m,h=s||Dr(n)?u:m,f=s||Dr(i)?u:m,p=s||Dr(o)?u:m;return function(a,s){var u=s&&s.hasOwnProperty(e)?s:a;return null==u?u:(u=c(u[e]),t?null==u?r:(u=l(u[t]),n?null==u?r:(u=h(u[n]),i?null==u?r:(u=f(u[i]),o?null==u?r:u=p(u[o]):u):u):u):u)}}function Ur(e,t){return function(r,n){return e(r,n,Or,t)}}function Vr(e,t,n){var i=t.expensiveChecks,a=i?bo:yo,s=a[e];if(s)return s;var u=e.split("."),c=u.length;if(t.csp)s=6>c?Nr(u[0],u[1],u[2],u[3],u[4],n,i):function(e,t){var o,a=0;do o=Nr(u[a++],u[a++],u[a++],u[a++],u[a++],n,i)(e,t),t=r,e=o;while(c>a);return o};else{var l="";i&&(l+="s = eso(s, fe);\nl = eso(l, fe);\n");var h=i;o(u,function(e,t){Rr(e,n);var r=(t?"s":'((l&&l.hasOwnProperty("'+e+'"))?l:s)')+"."+e;(i||Dr(e))&&(r="eso("+r+", fe)",h=!0),l+="if(s == null) return undefined;\ns="+r+";\n"}),l+="return s;";var f=new Function("s","l","eso","fe",l);f.toString=v(l),h&&(f=Ur(f,n)),s=f}return s.sharedGetter=!0,s.assign=function(t,r,n){return jr(t,n,e,r,e)},a[e]=s,s}function Br(e){return S(e.valueOf)?e.valueOf():xo.call(e)}function Ir(){var e=ct(),t=ct();this.$get=["$filter","$sniffer",function(r,n){function i(e){var t=e;return e.sharedGetter&&(t=function(t,r){return e(t,r)},t.literal=e.literal,t.constant=e.constant,t.assign=e.assign),t}function a(e,t){for(var r=0,n=e.length;n>r;r++){var i=e[r];i.constant||(i.inputs?a(i.inputs,t):-1===t.indexOf(i)&&t.push(i))}return t}function s(e,t){return null==e||null==t?e===t:"object"==typeof e&&(e=Br(e),"object"==typeof e)?!1:e===t||e!==e&&t!==t}function u(e,t,r,n){var i,o=n.$$inputs||(n.$$inputs=a(n.inputs,[]));if(1===o.length){var u=s;return o=o[0],e.$watch(function(e){var t=o(e);return s(t,u)||(i=n(e),u=t&&Br(t)),i},t,r)}for(var c=[],l=0,h=o.length;h>l;l++)c[l]=s;return e.$watch(function(e){for(var t=!1,r=0,a=o.length;a>r;r++){var u=o[r](e);(t||(t=!s(u,c[r])))&&(c[r]=u&&Br(u))}return t&&(i=n(e)),i},t,r)}function c(e,t,r,n){var i,o;return i=e.$watch(function(e){return n(e)},function(e,r,n){o=e,S(t)&&t.apply(this,arguments),y(e)&&n.$$postDigest(function(){y(o)&&i()})},r)}function l(e,t,r,n){function i(e){var t=!0;return o(e,function(e){y(e)||(t=!1)}),t}var a,s;return a=e.$watch(function(e){return n(e)},function(e,r,n){s=e,S(t)&&t.call(this,e,r,n),i(e)&&n.$$postDigest(function(){i(s)&&a()})},r)}function h(e,t,r,n){var i;return i=e.$watch(function(e){return n(e)},function(){S(t)&&t.apply(this,arguments),i()},r)}function f(e,t){if(!t)return e;var r=e.$$watchDelegate,n=r!==l&&r!==c,i=n?function(r,n){var i=e(r,n);return t(i,r,n)}:function(r,n){var i=e(r,n),o=t(i,r,n);return y(i)?o:i};return e.$$watchDelegate&&e.$$watchDelegate!==u?i.$$watchDelegate=e.$$watchDelegate:t.$stateful||(i.$$watchDelegate=u,i.inputs=[e]),i}var p={csp:n.csp,expensiveChecks:!1},m={csp:n.csp,expensiveChecks:!0};return function(n,o,a){var s,v,g;switch(typeof n){case"string":g=n=n.trim();var y=a?t:e;if(s=y[g],!s){":"===n.charAt(0)&&":"===n.charAt(1)&&(v=!0,n=n.substring(2));var b=a?m:p,x=new vo(b),w=new go(x,r,b);s=w.parse(n),s.constant?s.$$watchDelegate=h:v?(s=i(s),s.$$watchDelegate=s.literal?l:c):s.inputs&&(s.$$watchDelegate=u),y[g]=s}return f(s,o);case"function":return f(n,o);default:return f(d,o)}}}]}function zr(){this.$get=["$rootScope","$exceptionHandler",function(e,t){return Hr(function(t){e.$evalAsync(t)},t)}]}function Gr(){this.$get=["$browser","$exceptionHandler",function(e,t){return Hr(function(t){e.defer(t)},t)}]}function Hr(e,t){function i(e,t,r){function n(t){return function(r){i||(i=!0,t.call(e,r))}}var i=!1;return[n(t),n(r)]}function a(){this.$$state={status:0}}function s(e,t){return function(r){t.call(e,r)}}function u(e){var n,i,o;o=e.pending,e.processScheduled=!1,e.pending=r;for(var a=0,s=o.length;s>a;++a){i=o[a][0],n=o[a][e.status];try{S(n)?i.resolve(n(e.value)):1===e.status?i.resolve(e.value):i.reject(e.value)}catch(u){i.reject(u),t(u)}}}function c(t){!t.processScheduled&&t.pending&&(t.processScheduled=!0,e(function(){u(t)}))}function l(){this.promise=new a,this.resolve=s(this,this.resolve),this.reject=s(this,this.reject),this.notify=s(this,this.notify)}function h(e){var t=new l,r=0,n=fi(e)?[]:{};return o(e,function(e,i){r++,g(e).then(function(e){n.hasOwnProperty(i)||(n[i]=e,--r||t.resolve(n))},function(e){n.hasOwnProperty(i)||t.reject(e)})}),0===r&&t.resolve(n),t.promise}var f=n("$q",TypeError),p=function(){return new l};a.prototype={then:function(e,t,r){var n=new l;return this.$$state.pending=this.$$state.pending||[],this.$$state.pending.push([n,e,t,r]),this.$$state.status>0&&c(this.$$state),n.promise},"catch":function(e){return this.then(null,e)},"finally":function(e,t){return this.then(function(t){return v(t,!0,e)},function(t){return v(t,!1,e)},t)}},l.prototype={resolve:function(e){this.promise.$$state.status||(e===this.promise?this.$$reject(f("qcycle","Expected promise to be resolved with value other than itself '{0}'",e)):this.$$resolve(e))},$$resolve:function(e){var r,n;n=i(this,this.$$resolve,this.$$reject);try{(b(e)||S(e))&&(r=e&&e.then),S(r)?(this.promise.$$state.status=-1,r.call(e,n[0],n[1],this.notify)):(this.promise.$$state.value=e,this.promise.$$state.status=1,c(this.promise.$$state))}catch(o){n[1](o),t(o)}},reject:function(e){this.promise.$$state.status||this.$$reject(e)},$$reject:function(e){this.promise.$$state.value=e,this.promise.$$state.status=2,c(this.promise.$$state)},notify:function(r){var n=this.promise.$$state.pending;this.promise.$$state.status<=0&&n&&n.length&&e(function(){for(var e,i,o=0,a=n.length;a>o;o++){i=n[o][0],e=n[o][3];try{i.notify(S(e)?e(r):r)}catch(s){t(s)}}})}};var d=function(e){var t=new l;return t.reject(e),t.promise},m=function(e,t){var r=new l;return t?r.resolve(e):r.reject(e),r.promise},v=function(e,t,r){var n=null;try{S(r)&&(n=r())}catch(i){return m(i,!1)}return P(n)?n.then(function(){return m(e,t)},function(e){return m(e,!1)}):m(e,t)},g=function(e,t,r,n){var i=new l;return i.resolve(e),i.promise.then(t,r,n)},y=function x(e){function t(e){n.resolve(e)}function r(e){n.reject(e)}if(!S(e))throw f("norslvr","Expected resolverFn, got '{0}'",e);if(!(this instanceof x))return new x(e);var n=new l;return e(t,r),n.promise};return y.defer=p,y.reject=d,y.when=g,y.all=h,y}function Wr(){this.$get=["$window","$timeout",function(e,t){var r=e.requestAnimationFrame||e.webkitRequestAnimationFrame,n=e.cancelAnimationFrame||e.webkitCancelAnimationFrame||e.webkitCancelRequestAnimationFrame,i=!!r,o=i?function(e){var t=r(e);return function(){n(t)}}:function(e){var r=t(e,16.66,!1);return function(){t.cancel(r)}};return o.supported=i,o}]}function qr(){function e(e){function t(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null,this.$$listeners={},this.$$listenerCount={},this.$$watchersCount=0,this.$id=c(),this.$$ChildScope=null}return t.prototype=e,t}var t=10,r=n("$rootScope"),a=null,s=null;this.digestTtl=function(e){return arguments.length&&(t=e),t},this.$get=["$injector","$exceptionHandler","$parse","$browser",function(n,u,l,h){function f(e){e.currentScope.$$destroyed=!0}function p(){this.$id=c(),this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null,this.$root=this,this.$$destroyed=!1,this.$$listeners={},this.$$listenerCount={},this.$$isolateBindings=null}function m(e){if(M.$$phase)throw r("inprog","{0} already in progress",M.$$phase);M.$$phase=e}function v(){M.$$phase=null}function y(e,t,r){do e.$$listenerCount[r]-=t,0===e.$$listenerCount[r]&&delete e.$$listenerCount[r];while(e=e.$parent)}function x(){}function w(){for(;C.length;)try{C.shift()()}catch(e){u(e)}s=null}function _(){null===s&&(s=h.defer(function(){M.$apply(w)}))}p.prototype={constructor:p,$new:function(t,r){var n;return r=r||this,t?(n=new p,n.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=e(this)),n=new this.$$ChildScope),n.$parent=r,n.$$prevSibling=r.$$childTail,r.$$childHead?(r.$$childTail.$$nextSibling=n,r.$$childTail=n):r.$$childHead=r.$$childTail=n,(t||r!=this)&&n.$on("$destroy",f),n},$watch:function(e,t,r){var n=l(e);if(n.$$watchDelegate)return n.$$watchDelegate(this,t,r,n);var i=this,o=i.$$watchers,s={fn:t,last:x,get:n,exp:e,eq:!!r};return a=null,S(t)||(s.fn=d),o||(o=i.$$watchers=[]),o.unshift(s),function(){F(o,s),a=null}},$watchGroup:function(e,t){function r(){u=!1,c?(c=!1,t(i,i,s)):t(i,n,s)}var n=new Array(e.length),i=new Array(e.length),a=[],s=this,u=!1,c=!0;if(!e.length){var l=!0;return s.$evalAsync(function(){l&&t(i,i,s)}),function(){l=!1}}return 1===e.length?this.$watch(e[0],function(e,r,o){i[0]=e,n[0]=r,t(i,e===r?i:n,o)}):(o(e,function(e,t){var o=s.$watch(e,function(e,o){i[t]=e,n[t]=o,u||(u=!0,s.$evalAsync(r))});a.push(o)}),function(){for(;a.length;)a.shift()()})},$watchCollection:function(e,t){function r(e){o=e;var t,r,n,s,u;if(!g(o)){if(b(o))if(i(o)){a!==p&&(a=p,v=a.length=0,h++),t=o.length,v!==t&&(h++,a.length=v=t);for(var c=0;t>c;c++)u=a[c],s=o[c],n=u!==u&&s!==s,n||u===s||(h++,a[c]=s)}else{a!==d&&(a=d={},v=0,h++),t=0;for(r in o)o.hasOwnProperty(r)&&(t++,s=o[r],u=a[r],r in a?(n=u!==u&&s!==s,n||u===s||(h++,a[r]=s)):(v++,a[r]=s,h++));if(v>t){h++;for(r in a)o.hasOwnProperty(r)||(v--,delete a[r])
}}else a!==o&&(a=o,h++);return h}}function n(){if(m?(m=!1,t(o,o,u)):t(o,s,u),c)if(b(o))if(i(o)){s=new Array(o.length);for(var e=0;e<o.length;e++)s[e]=o[e]}else{s={};for(var r in o)Kn.call(o,r)&&(s[r]=o[r])}else s=o}r.$stateful=!0;var o,a,s,u=this,c=t.length>1,h=0,f=l(e,r),p=[],d={},m=!0,v=0;return this.$watch(f,n)},$digest:function(){var e,n,i,o,c,l,f,p,d,g,y=t,b=this,_=[];m("$digest"),h.$$checkUrlChange(),this===M&&null!==s&&(h.defer.cancel(s),w()),a=null;do{for(l=!1,p=b;E.length;){try{g=E.shift(),g.scope.$eval(g.expression,g.locals)}catch(C){u(C)}a=null}e:do{if(o=p.$$watchers)for(c=o.length;c--;)try{if(e=o[c])if((n=e.get(p))===(i=e.last)||(e.eq?N(n,i):"number"==typeof n&&"number"==typeof i&&isNaN(n)&&isNaN(i))){if(e===a){l=!1;break e}}else l=!0,a=e,e.last=e.eq?j(n,null):n,e.fn(n,i===x?n:i,p),5>y&&(d=4-y,_[d]||(_[d]=[]),_[d].push({msg:S(e.exp)?"fn: "+(e.exp.name||e.exp.toString()):e.exp,newVal:n,oldVal:i}))}catch(C){u(C)}if(!(f=p.$$childHead||p!==b&&p.$$nextSibling))for(;p!==b&&!(f=p.$$nextSibling);)p=p.$parent}while(p=f);if((l||E.length)&&!y--)throw v(),r("infdig","{0} $digest() iterations reached. Aborting!\nWatchers fired in the last 5 iterations: {1}",t,_)}while(l||E.length);for(v();T.length;)try{T.shift()()}catch(C){u(C)}},$destroy:function(){if(!this.$$destroyed){var e=this.$parent;if(this.$broadcast("$destroy"),this.$$destroyed=!0,this!==M){for(var t in this.$$listenerCount)y(this,this.$$listenerCount[t],t);e.$$childHead==this&&(e.$$childHead=this.$$nextSibling),e.$$childTail==this&&(e.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=d,this.$on=this.$watch=this.$watchGroup=function(){return d},this.$$listeners={},this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=this.$root=this.$$watchers=null}}},$eval:function(e,t){return l(e)(this,t)},$evalAsync:function(e,t){M.$$phase||E.length||h.defer(function(){E.length&&M.$digest()}),E.push({scope:this,expression:e,locals:t})},$$postDigest:function(e){T.push(e)},$apply:function(e){try{return m("$apply"),this.$eval(e)}catch(t){u(t)}finally{v();try{M.$digest()}catch(t){throw u(t),t}}},$applyAsync:function(e){function t(){r.$eval(e)}var r=this;e&&C.push(t),_()},$on:function(e,t){var r=this.$$listeners[e];r||(this.$$listeners[e]=r=[]),r.push(t);var n=this;do n.$$listenerCount[e]||(n.$$listenerCount[e]=0),n.$$listenerCount[e]++;while(n=n.$parent);var i=this;return function(){var n=r.indexOf(t);-1!==n&&(r[n]=null,y(i,1,e))}},$emit:function(e){var t,r,n,i=[],o=this,a=!1,s={name:e,targetScope:o,stopPropagation:function(){a=!0},preventDefault:function(){s.defaultPrevented=!0},defaultPrevented:!1},c=U([s],arguments,1);do{for(t=o.$$listeners[e]||i,s.currentScope=o,r=0,n=t.length;n>r;r++)if(t[r])try{t[r].apply(null,c)}catch(l){u(l)}else t.splice(r,1),r--,n--;if(a)return s.currentScope=null,s;o=o.$parent}while(o);return s.currentScope=null,s},$broadcast:function(e){var t=this,r=t,n=t,i={name:e,targetScope:t,preventDefault:function(){i.defaultPrevented=!0},defaultPrevented:!1};if(!t.$$listenerCount[e])return i;for(var o,a,s,c=U([i],arguments,1);r=n;){for(i.currentScope=r,o=r.$$listeners[e]||[],a=0,s=o.length;s>a;a++)if(o[a])try{o[a].apply(null,c)}catch(l){u(l)}else o.splice(a,1),a--,s--;if(!(n=r.$$listenerCount[e]&&r.$$childHead||r!==t&&r.$$nextSibling))for(;r!==t&&!(n=r.$$nextSibling);)r=r.$parent}return i.currentScope=null,i}};var M=new p,E=M.$$asyncQueue=[],T=M.$$postDigestQueue=[],C=M.$$applyAsyncQueue=[];return M}]}function Xr(){var e=/^\s*(https?|ftp|mailto|tel|file):/,t=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(t){return y(t)?(e=t,this):e},this.imgSrcSanitizationWhitelist=function(e){return y(e)?(t=e,this):t},this.$get=function(){return function(r,n){var i,o=n?t:e;return i=nn(r).href,""===i||i.match(o)?r:"unsafe:"+i}}}function Yr(e){if("self"===e)return e;if(x(e)){if(e.indexOf("***")>-1)throw wo("iwcard","Illegal sequence *** in string matcher. String: {0}",e);return e=di(e).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*"),new RegExp("^"+e+"$")}if(M(e))return new RegExp("^"+e.source+"$");throw wo("imatcher",'Matchers may only be "self", string patterns or RegExp objects')}function Kr(e){var t=[];return y(e)&&o(e,function(e){t.push(Yr(e))}),t}function Qr(){this.SCE_CONTEXTS=_o;var e=["self"],t=[];this.resourceUrlWhitelist=function(t){return arguments.length&&(e=Kr(t)),e},this.resourceUrlBlacklist=function(e){return arguments.length&&(t=Kr(e)),t},this.$get=["$injector",function(n){function i(e,t){return"self"===e?on(t):!!e.exec(t.href)}function o(r){var n,o,a=nn(r.toString()),s=!1;for(n=0,o=e.length;o>n;n++)if(i(e[n],a)){s=!0;break}if(s)for(n=0,o=t.length;o>n;n++)if(i(t[n],a)){s=!1;break}return s}function a(e){var t=function(e){this.$$unwrapTrustedValue=function(){return e}};return e&&(t.prototype=new e),t.prototype.valueOf=function(){return this.$$unwrapTrustedValue()},t.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()},t}function s(e,t){var n=f.hasOwnProperty(e)?f[e]:null;if(!n)throw wo("icontext","Attempted to trust a value in invalid context. Context: {0}; Value: {1}",e,t);if(null===t||t===r||""===t)return t;if("string"!=typeof t)throw wo("itype","Attempted to trust a non-string value in a content requiring a string: Context: {0}",e);return new n(t)}function u(e){return e instanceof h?e.$$unwrapTrustedValue():e}function c(e,t){if(null===t||t===r||""===t)return t;var n=f.hasOwnProperty(e)?f[e]:null;if(n&&t instanceof n)return t.$$unwrapTrustedValue();if(e===_o.RESOURCE_URL){if(o(t))return t;throw wo("insecurl","Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}",t.toString())}if(e===_o.HTML)return l(t);throw wo("unsafe","Attempting to use an unsafe value in a safe context.")}var l=function(){throw wo("unsafe","Attempting to use an unsafe value in a safe context.")};n.has("$sanitize")&&(l=n.get("$sanitize"));var h=a(),f={};return f[_o.HTML]=a(h),f[_o.CSS]=a(h),f[_o.URL]=a(h),f[_o.JS]=a(h),f[_o.RESOURCE_URL]=a(f[_o.URL]),{trustAs:s,getTrusted:c,valueOf:u}}]}function Zr(){var e=!0;this.enabled=function(t){return arguments.length&&(e=!!t),e},this.$get=["$parse","$sceDelegate",function(t,r){if(e&&8>ei)throw wo("iequirks","Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks mode. You can fix this by adding the text <!doctype html> to the top of your HTML document. See http://docs.angularjs.org/api/ng.$sce for more information.");var n=D(_o);n.isEnabled=function(){return e},n.trustAs=r.trustAs,n.getTrusted=r.getTrusted,n.valueOf=r.valueOf,e||(n.trustAs=n.getTrusted=function(e,t){return t},n.valueOf=m),n.parseAs=function(e,r){var i=t(r);return i.literal&&i.constant?i:t(r,function(t){return n.getTrusted(e,t)})};var i=n.parseAs,a=n.getTrusted,s=n.trustAs;return o(_o,function(e,t){var r=Yn(t);n[mt("parse_as_"+r)]=function(t){return i(e,t)},n[mt("get_trusted_"+r)]=function(t){return a(e,t)},n[mt("trust_as_"+r)]=function(t){return s(e,t)}}),n}]}function Jr(){this.$get=["$window","$document",function(e,t){var r,n,i={},o=f((/android (\d+)/.exec(Yn((e.navigator||{}).userAgent))||[])[1]),a=/Boxee/i.test((e.navigator||{}).userAgent),s=t[0]||{},u=/^(Moz|webkit|ms)(?=[A-Z])/,c=s.body&&s.body.style,l=!1,h=!1;if(c){for(var p in c)if(n=u.exec(p)){r=n[0],r=r.substr(0,1).toUpperCase()+r.substr(1);break}r||(r="WebkitOpacity"in c&&"webkit"),l=!!("transition"in c||r+"Transition"in c),h=!!("animation"in c||r+"Animation"in c),!o||l&&h||(l=x(s.body.style.webkitTransition),h=x(s.body.style.webkitAnimation))}return{history:!(!e.history||!e.history.pushState||4>o||a),hasEvent:function(e){if("input"===e&&11>=ei)return!1;if(g(i[e])){var t=s.createElement("div");i[e]="on"+e in t}return i[e]},csp:mi(),vendorPrefix:r,transitions:l,animations:h,android:o}}]}function en(){this.$get=["$templateCache","$http","$q",function(e,t,r){function n(i,o){function a(e){if(!o)throw Yi("tpload","Failed to load template: {0}",i);return r.reject(e)}n.totalPendingRequests++;var s=t.defaults&&t.defaults.transformResponse;fi(s)?s=s.filter(function(e){return e!==ir}):s===ir&&(s=null);var u={cache:e,transformResponse:s};return t.get(i,u)["finally"](function(){n.totalPendingRequests--}).then(function(e){return e.data},a)}return n.totalPendingRequests=0,n}]}function tn(){this.$get=["$rootScope","$browser","$location",function(e,t,r){var n={};return n.findBindings=function(e,t,r){var n=e.getElementsByClassName("ng-binding"),i=[];return o(n,function(e){var n=ci.element(e).data("$binding");n&&o(n,function(n){if(r){var o=new RegExp("(^|\\s)"+di(t)+"(\\s|\\||$)");o.test(n)&&i.push(e)}else-1!=n.indexOf(t)&&i.push(e)})}),i},n.findModels=function(e,t,r){for(var n=["ng-","data-ng-","ng\\:"],i=0;i<n.length;++i){var o=r?"=":"*=",a="["+n[i]+"model"+o+'"'+t+'"]',s=e.querySelectorAll(a);if(s.length)return s}},n.getLocation=function(){return r.url()},n.setLocation=function(t){t!==r.url()&&(r.url(t),e.$digest())},n.whenStable=function(e){t.notifyWhenNoOutstandingRequests(e)},n}]}function rn(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",function(e,t,r,n,i){function o(o,s,u){var c,l=y(u)&&!u,h=(l?n:r).defer(),f=h.promise;return c=t.defer(function(){try{h.resolve(o())}catch(t){h.reject(t),i(t)}finally{delete a[f.$$timeoutId]}l||e.$apply()},s),f.$$timeoutId=c,a[c]=h,f}var a={};return o.cancel=function(e){return e&&e.$$timeoutId in a?(a[e.$$timeoutId].reject("canceled"),delete a[e.$$timeoutId],t.defer.cancel(e.$$timeoutId)):!1},o}]}function nn(e){var t=e;return ei&&(So.setAttribute("href",t),t=So.href),So.setAttribute("href",t),{href:So.href,protocol:So.protocol?So.protocol.replace(/:$/,""):"",host:So.host,search:So.search?So.search.replace(/^\?/,""):"",hash:So.hash?So.hash.replace(/^#/,""):"",hostname:So.hostname,port:So.port,pathname:"/"===So.pathname.charAt(0)?So.pathname:"/"+So.pathname}}function on(e){var t=x(e)?nn(e):e;return t.protocol===Mo.protocol&&t.host===Mo.host}function an(){this.$get=v(e)}function sn(e){function t(n,i){if(b(n)){var a={};return o(n,function(e,r){a[r]=t(r,e)}),a}return e.factory(n+r,i)}var r="Filter";this.register=t,this.$get=["$injector",function(e){return function(t){return e.get(t+r)}}],t("currency",hn),t("date",Mn),t("filter",un),t("json",En),t("limitTo",Tn),t("lowercase",$o),t("number",fn),t("orderBy",Cn),t("uppercase",ko)}function un(){return function(e,t,r){if(!fi(e))return e;var n,i;switch(typeof t){case"function":n=t;break;case"boolean":case"number":case"string":i=!0;case"object":n=cn(t,r,i);break;default:return e}return e.filter(n)}}function cn(e,t,r){var n,i=b(e)&&"$"in e;return t===!0?t=N:S(t)||(t=function(e,t){return b(e)||b(t)?!1:(e=Yn(""+e),t=Yn(""+t),-1!==e.indexOf(t))}),n=function(n){return i&&!b(n)?ln(n,e.$,t,!1):ln(n,e,t,r)}}function ln(e,t,r,n,i){var o=null!==e?typeof e:"null",a=null!==t?typeof t:"null";if("string"===a&&"!"===t.charAt(0))return!ln(e,t.substring(1),r,n);if(fi(e))return e.some(function(e){return ln(e,t,r,n)});switch(o){case"object":var s;if(n){for(s in e)if("$"!==s.charAt(0)&&ln(e[s],t,r,!0))return!0;return i?!1:ln(e,t,r,!1)}if("object"===a){for(s in t){var u=t[s];if(!S(u)&&!g(u)){var c="$"===s,l=c?e:e[s];if(!ln(l,u,r,c,c))return!1}}return!0}return r(e,t);case"function":return!1;default:return r(e,t)}}function hn(e){var t=e.NUMBER_FORMATS;return function(e,r,n){return g(r)&&(r=t.CURRENCY_SYM),g(n)&&(n=t.PATTERNS[1].maxFrac),null==e?e:pn(e,t.PATTERNS[1],t.GROUP_SEP,t.DECIMAL_SEP,n).replace(/\u00A4/g,r)}}function fn(e){var t=e.NUMBER_FORMATS;return function(e,r){return null==e?e:pn(e,t.PATTERNS[0],t.GROUP_SEP,t.DECIMAL_SEP,r)}}function pn(e,t,r,n,i){if(!isFinite(e)||b(e))return"";var o=0>e;e=Math.abs(e);var a=e+"",s="",u=[],c=!1;if(-1!==a.indexOf("e")){var l=a.match(/([\d\.]+)e(-?)(\d+)/);l&&"-"==l[2]&&l[3]>i+1?e=0:(s=a,c=!0)}if(c)i>0&&1>e&&(s=e.toFixed(i),e=parseFloat(s));else{var h=(a.split(Eo)[1]||"").length;g(i)&&(i=Math.min(Math.max(t.minFrac,h),t.maxFrac)),e=+(Math.round(+(e.toString()+"e"+i)).toString()+"e"+-i);var f=(""+e).split(Eo),p=f[0];f=f[1]||"";var d,m=0,v=t.lgSize,y=t.gSize;if(p.length>=v+y)for(m=p.length-v,d=0;m>d;d++)(m-d)%y===0&&0!==d&&(s+=r),s+=p.charAt(d);for(d=m;d<p.length;d++)(p.length-d)%v===0&&0!==d&&(s+=r),s+=p.charAt(d);for(;f.length<i;)f+="0";i&&"0"!==i&&(s+=n+f.substr(0,i))}return 0===e&&(o=!1),u.push(o?t.negPre:t.posPre,s,o?t.negSuf:t.posSuf),u.join("")}function dn(e,t,r){var n="";for(0>e&&(n="-",e=-e),e=""+e;e.length<t;)e="0"+e;return r&&(e=e.substr(e.length-t)),n+e}function mn(e,t,r,n){return r=r||0,function(i){var o=i["get"+e]();return(r>0||o>-r)&&(o+=r),0===o&&-12==r&&(o=12),dn(o,t,n)}}function vn(e,t){return function(r,n){var i=r["get"+e](),o=Qn(t?"SHORT"+e:e);return n[o][i]}}function gn(e){var t=-1*e.getTimezoneOffset(),r=t>=0?"+":"";return r+=dn(Math[t>0?"floor":"ceil"](t/60),2)+dn(Math.abs(t%60),2)}function yn(e){var t=new Date(e,0,1).getDay();return new Date(e,0,(4>=t?5:12)-t)}function bn(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+(4-e.getDay()))}function xn(e){return function(t){var r=yn(t.getFullYear()),n=bn(t),i=+n-+r,o=1+Math.round(i/6048e5);return dn(o,e)}}function wn(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}function _n(e,t){return e.getFullYear()<=0?t.ERAS[0]:t.ERAS[1]}function Sn(e,t){return e.getFullYear()<=0?t.ERANAMES[0]:t.ERANAMES[1]}function Mn(e){function t(e){var t;if(t=e.match(r)){var n=new Date(0),i=0,o=0,a=t[8]?n.setUTCFullYear:n.setFullYear,s=t[8]?n.setUTCHours:n.setHours;t[9]&&(i=f(t[9]+t[10]),o=f(t[9]+t[11])),a.call(n,f(t[1]),f(t[2])-1,f(t[3]));var u=f(t[4]||0)-i,c=f(t[5]||0)-o,l=f(t[6]||0),h=Math.round(1e3*parseFloat("0."+(t[7]||0)));return s.call(n,u,c,l,h),n}return e}var r=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(r,n,i){var a,s,u="",c=[];if(n=n||"mediumDate",n=e.DATETIME_FORMATS[n]||n,x(r)&&(r=Ao.test(r)?f(r):t(r)),w(r)&&(r=new Date(r)),!_(r))return r;for(;n;)s=Co.exec(n),s?(c=U(c,s,1),n=c.pop()):(c.push(n),n=null);return i&&"UTC"===i&&(r=new Date(r.getTime()),r.setMinutes(r.getMinutes()+r.getTimezoneOffset())),o(c,function(t){a=To[t],u+=a?a(r,e.DATETIME_FORMATS):t.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),u}}function En(){return function(e,t){return g(t)&&(t=2),z(e,t)}}function Tn(){return function(e,t){return w(e)&&(e=e.toString()),fi(e)||x(e)?(t=1/0===Math.abs(Number(t))?Number(t):f(t),t?t>0?e.slice(0,t):e.slice(t):x(e)?"":[]):e}}function Cn(e){return function(t,r,n){function o(e,t){for(var n=0;n<r.length;n++){var i=r[n](e,t);if(0!==i)return i}return 0}function a(e,t){return t?function(t,r){return e(r,t)}:e}function s(e){switch(typeof e){case"number":case"boolean":case"string":return!0;default:return!1}}function u(e){return null===e?"null":"function"==typeof e.valueOf&&(e=e.valueOf(),s(e))?e:"function"==typeof e.toString&&(e=e.toString(),s(e))?e:""}function c(e,t){var r=typeof e,n=typeof t;return r===n&&"object"===r&&(e=u(e),t=u(t)),r===n?("string"===r&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t?0:t>e?-1:1):n>r?-1:1}return i(t)?(r=fi(r)?r:[r],0===r.length&&(r=["+"]),r=r.map(function(t){var r=!1,n=t||m;if(x(t)){if(("+"==t.charAt(0)||"-"==t.charAt(0))&&(r="-"==t.charAt(0),t=t.substring(1)),""===t)return a(c,r);if(n=e(t),n.constant){var i=n();return a(function(e,t){return c(e[i],t[i])},r)}}return a(function(e,t){return c(n(e),n(t))},r)}),ii.call(t).sort(a(o,n))):t}}function An(e){return S(e)&&(e={link:e}),e.restrict=e.restrict||"AC",v(e)}function $n(e,t){e.$name=t}function kn(e,t,n,i,a){var s=this,u=[],c=s.$$parentForm=e.parent().controller("form")||Oo;s.$error={},s.$$success={},s.$pending=r,s.$name=a(t.name||t.ngForm||"")(n),s.$dirty=!1,s.$pristine=!0,s.$valid=!0,s.$invalid=!1,s.$submitted=!1,c.$addControl(s),s.$rollbackViewValue=function(){o(u,function(e){e.$rollbackViewValue()})},s.$commitViewValue=function(){o(u,function(e){e.$commitViewValue()})},s.$addControl=function(e){at(e.$name,"input"),u.push(e),e.$name&&(s[e.$name]=e)},s.$$renameControl=function(e,t){var r=e.$name;s[r]===e&&delete s[r],s[t]=e,e.$name=t},s.$removeControl=function(e){e.$name&&s[e.$name]===e&&delete s[e.$name],o(s.$pending,function(t,r){s.$setValidity(r,null,e)}),o(s.$error,function(t,r){s.$setValidity(r,null,e)}),o(s.$$success,function(t,r){s.$setValidity(r,null,e)}),F(u,e)},Hn({ctrl:this,$element:e,set:function(e,t,r){var n=e[t];if(n){var i=n.indexOf(r);-1===i&&n.push(r)}else e[t]=[r]},unset:function(e,t,r){var n=e[t];n&&(F(n,r),0===n.length&&delete e[t])},parentForm:c,$animate:i}),s.$setDirty=function(){i.removeClass(e,ma),i.addClass(e,va),s.$dirty=!0,s.$pristine=!1,c.$setDirty()},s.$setPristine=function(){i.setClass(e,ma,va+" "+Lo),s.$dirty=!1,s.$pristine=!0,s.$submitted=!1,o(u,function(e){e.$setPristine()})},s.$setUntouched=function(){o(u,function(e){e.$setUntouched()})},s.$setSubmitted=function(){i.addClass(e,Lo),s.$submitted=!0,c.$setSubmitted()}}function Pn(e){e.$formatters.push(function(t){return e.$isEmpty(t)?t:t.toString()})}function Rn(e,t,r,n,i,o){On(e,t,r,n,i,o),Pn(n)}function On(e,t,r,n,i,o){var a=Yn(t[0].type);if(!i.android){var s=!1;t.on("compositionstart",function(){s=!0}),t.on("compositionend",function(){s=!1,u()})}var u=function(e){if(c&&(o.defer.cancel(c),c=null),!s){var i=t.val(),u=e&&e.type;"password"===a||r.ngTrim&&"false"===r.ngTrim||(i=pi(i)),(n.$viewValue!==i||""===i&&n.$$hasNativeValidators)&&n.$setViewValue(i,u)}};if(i.hasEvent("input"))t.on("input",u);else{var c,l=function(e,t,r){c||(c=o.defer(function(){c=null,t&&t.value===r||u(e)}))};t.on("keydown",function(e){var t=e.keyCode;91===t||t>15&&19>t||t>=37&&40>=t||l(e,this,this.value)}),i.hasEvent("paste")&&t.on("paste cut",l)}t.on("change",u),n.$render=function(){t.val(n.$isEmpty(n.$viewValue)?"":n.$viewValue)}}function Ln(e,t){if(_(e))return e;if(x(e)){Go.lastIndex=0;var r=Go.exec(e);if(r){var n=+r[1],i=+r[2],o=0,a=0,s=0,u=0,c=yn(n),l=7*(i-1);return t&&(o=t.getHours(),a=t.getMinutes(),s=t.getSeconds(),u=t.getMilliseconds()),new Date(n,0,c.getDate()+l,o,a,s,u)}}return 0/0}function Fn(e,t){return function(r,n){var i,a;if(_(r))return r;if(x(r)){if('"'==r.charAt(0)&&'"'==r.charAt(r.length-1)&&(r=r.substring(1,r.length-1)),No.test(r))return new Date(r);if(e.lastIndex=0,i=e.exec(r))return i.shift(),a=n?{yyyy:n.getFullYear(),MM:n.getMonth()+1,dd:n.getDate(),HH:n.getHours(),mm:n.getMinutes(),ss:n.getSeconds(),sss:n.getMilliseconds()/1e3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},o(i,function(e,r){r<t.length&&(a[t[r]]=+e)}),new Date(a.yyyy,a.MM-1,a.dd,a.HH,a.mm,a.ss||0,1e3*a.sss||0)}return 0/0}}function jn(e,t,n,i){return function(o,a,s,u,c,l,h){function f(e){return e&&!(e.getTime&&e.getTime()!==e.getTime())}function p(e){return y(e)?_(e)?e:n(e):r}Dn(o,a,s,u),On(o,a,s,u,c,l);var d,m=u&&u.$options&&u.$options.timezone;if(u.$$parserName=e,u.$parsers.push(function(e){if(u.$isEmpty(e))return null;if(t.test(e)){var i=n(e,d);return"UTC"===m&&i.setMinutes(i.getMinutes()-i.getTimezoneOffset()),i}return r}),u.$formatters.push(function(e){if(e&&!_(e))throw xa("datefmt","Expected `{0}` to be a date",e);if(f(e)){if(d=e,d&&"UTC"===m){var t=6e4*d.getTimezoneOffset();d=new Date(d.getTime()+t)}return h("date")(e,i,m)}return d=null,""}),y(s.min)||s.ngMin){var v;u.$validators.min=function(e){return!f(e)||g(v)||n(e)>=v},s.$observe("min",function(e){v=p(e),u.$validate()})}if(y(s.max)||s.ngMax){var b;u.$validators.max=function(e){return!f(e)||g(b)||n(e)<=b},s.$observe("max",function(e){b=p(e),u.$validate()})}}}function Dn(e,t,n,i){var o=t[0],a=i.$$hasNativeValidators=b(o.validity);a&&i.$parsers.push(function(e){var n=t.prop(Xn)||{};return n.badInput&&!n.typeMismatch?r:e})}function Nn(e,t,n,i,o,a){if(Dn(e,t,n,i),On(e,t,n,i,o,a),i.$$parserName="number",i.$parsers.push(function(e){return i.$isEmpty(e)?null:Bo.test(e)?parseFloat(e):r}),i.$formatters.push(function(e){if(!i.$isEmpty(e)){if(!w(e))throw xa("numfmt","Expected `{0}` to be a number",e);e=e.toString()}return e}),y(n.min)||n.ngMin){var s;i.$validators.min=function(e){return i.$isEmpty(e)||g(s)||e>=s},n.$observe("min",function(e){y(e)&&!w(e)&&(e=parseFloat(e,10)),s=w(e)&&!isNaN(e)?e:r,i.$validate()})}if(y(n.max)||n.ngMax){var u;i.$validators.max=function(e){return i.$isEmpty(e)||g(u)||u>=e},n.$observe("max",function(e){y(e)&&!w(e)&&(e=parseFloat(e,10)),u=w(e)&&!isNaN(e)?e:r,i.$validate()})}}function Un(e,t,r,n,i,o){On(e,t,r,n,i,o),Pn(n),n.$$parserName="url",n.$validators.url=function(e,t){var r=e||t;return n.$isEmpty(r)||Uo.test(r)}}function Vn(e,t,r,n,i,o){On(e,t,r,n,i,o),Pn(n),n.$$parserName="email",n.$validators.email=function(e,t){var r=e||t;return n.$isEmpty(r)||Vo.test(r)}}function Bn(e,t,r,n){g(r.name)&&t.attr("name",c());var i=function(e){t[0].checked&&n.$setViewValue(r.value,e&&e.type)};t.on("click",i),n.$render=function(){var e=r.value;t[0].checked=e==n.$viewValue},r.$observe("value",n.$render)}function In(e,t,r,i,o){var a;if(y(i)){if(a=e(i),!a.constant)throw n("ngModel")("constexpr","Expected constant expression for `{0}`, but saw `{1}`.",r,i);return a(t)}return o}function zn(e,t,r,n,i,o,a,s){var u=In(s,e,"ngTrueValue",r.ngTrueValue,!0),c=In(s,e,"ngFalseValue",r.ngFalseValue,!1),l=function(e){n.$setViewValue(t[0].checked,e&&e.type)};t.on("click",l),n.$render=function(){t[0].checked=n.$viewValue},n.$isEmpty=function(e){return e===!1},n.$formatters.push(function(e){return N(e,u)}),n.$parsers.push(function(e){return e?u:c})}function Gn(e,t){return e="ngClass"+e,["$animate",function(r){function n(e,t){var r=[];e:for(var n=0;n<e.length;n++){for(var i=e[n],o=0;o<t.length;o++)if(i==t[o])continue e;r.push(i)}return r}function i(e){if(fi(e))return e;if(x(e))return e.split(" ");if(b(e)){var t=[];return o(e,function(e,r){e&&(t=t.concat(r.split(" ")))}),t}return e}return{restrict:"AC",link:function(a,s,u){function c(e){var t=h(e,1);u.$addClass(t)}function l(e){var t=h(e,-1);u.$removeClass(t)}function h(e,t){var r=s.data("$classCounts")||{},n=[];return o(e,function(e){(t>0||r[e])&&(r[e]=(r[e]||0)+t,r[e]===+(t>0)&&n.push(e))}),s.data("$classCounts",r),n.join(" ")}function f(e,t){var i=n(t,e),o=n(e,t);i=h(i,1),o=h(o,-1),i&&i.length&&r.addClass(s,i),o&&o.length&&r.removeClass(s,o)}function p(e){if(t===!0||a.$index%2===t){var r=i(e||[]);if(d){if(!N(e,d)){var n=i(d);f(n,r)}}else c(r)}d=D(e)}var d;a.$watch(u[e],p,!0),u.$observe("class",function(){p(a.$eval(u[e]))}),"ngClass"!==e&&a.$watch("$index",function(r,n){var o=1&r;if(o!==(1&n)){var s=i(a.$eval(u[e]));o===t?c(s):l(s)}})}}}]}function Hn(e){function t(e,t,u){t===r?n("$pending",e,u):i("$pending",e,u),k(t)?t?(h(s.$error,e,u),l(s.$$success,e,u)):(l(s.$error,e,u),h(s.$$success,e,u)):(h(s.$error,e,u),h(s.$$success,e,u)),s.$pending?(o(ba,!0),s.$valid=s.$invalid=r,a("",null)):(o(ba,!1),s.$valid=Wn(s.$error),s.$invalid=!s.$valid,a("",s.$valid));var c;c=s.$pending&&s.$pending[e]?r:s.$error[e]?!1:s.$$success[e]?!0:null,a(e,c),f.$setValidity(e,c,s)}function n(e,t,r){s[e]||(s[e]={}),l(s[e],t,r)}function i(e,t,n){s[e]&&h(s[e],t,n),Wn(s[e])&&(s[e]=r)}function o(e,t){t&&!c[e]?(p.addClass(u,e),c[e]=!0):!t&&c[e]&&(p.removeClass(u,e),c[e]=!1)}function a(e,t){e=e?"-"+rt(e,"-"):"",o(pa+e,t===!0),o(da+e,t===!1)}var s=e.ctrl,u=e.$element,c={},l=e.set,h=e.unset,f=e.parentForm,p=e.$animate;c[da]=!(c[pa]=u.hasClass(pa)),s.$setValidity=t}function Wn(e){if(e)for(var t in e)return!1;return!0}var qn=/^\/(.+)\/([a-z]*)$/,Xn="validity",Yn=function(e){return x(e)?e.toLowerCase():e},Kn=Object.prototype.hasOwnProperty,Qn=function(e){return x(e)?e.toUpperCase():e},Zn=function(e){return x(e)?e.replace(/[A-Z]/g,function(e){return String.fromCharCode(32|e.charCodeAt(0))}):e},Jn=function(e){return x(e)?e.replace(/[a-z]/g,function(e){return String.fromCharCode(-33&e.charCodeAt(0))}):e};"i"!=="I".toLowerCase()&&(Yn=Zn,Qn=Jn);var ei,ti,ri,ni,ii=[].slice,oi=[].splice,ai=[].push,si=Object.prototype.toString,ui=n("ng"),ci=e.angular||(e.angular={}),li=0;ei=t.documentMode,d.$inject=[],m.$inject=[];var hi,fi=Array.isArray,pi=function(e){return x(e)?e.trim():e},di=function(e){return e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},mi=function(){if(y(mi.isActive_))return mi.isActive_;var e=!(!t.querySelector("[ng-csp]")&&!t.querySelector("[data-ng-csp]"));if(!e)try{new Function("")}catch(r){e=!0}return mi.isActive_=e},vi=["ng-","data-ng-","ng:","x-ng-"],gi=/[A-Z]/g,yi=!1,bi=1,xi=3,wi=8,_i=9,Si=11,Mi={full:"1.3.15",major:1,minor:3,dot:15,codeName:"locality-filtration"};xt.expando="ng339";var Ei=xt.cache={},Ti=1,Ci=function(e,t,r){e.addEventListener(t,r,!1)},Ai=function(e,t,r){e.removeEventListener(t,r,!1)};xt._data=function(e){return this.cache[e[this.expando]]||{}};var $i=/([\:\-\_]+(.))/g,ki=/^moz([A-Z])/,Pi={mouseleave:"mouseout",mouseenter:"mouseover"},Ri=n("jqLite"),Oi=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,Li=/<|&#?\w+;/,Fi=/<([\w:]+)/,ji=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Di={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Di.optgroup=Di.option,Di.tbody=Di.tfoot=Di.colgroup=Di.caption=Di.thead,Di.th=Di.td;var Ni=xt.prototype={ready:function(r){function n(){i||(i=!0,r())}var i=!1;"complete"===t.readyState?setTimeout(n):(this.on("DOMContentLoaded",n),xt(e).on("load",n))},toString:function(){var e=[];return o(this,function(t){e.push(""+t)}),"["+e.join(", ")+"]"},eq:function(e){return ti(e>=0?this[e]:this[this.length+e])},length:0,push:ai,sort:[].sort,splice:[].splice},Ui={};o("multiple,selected,checked,disabled,readOnly,required,open".split(","),function(e){Ui[Yn(e)]=e});var Vi={};o("input,select,option,textarea,button,form,details".split(","),function(e){Vi[e]=!0});var Bi={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};o({data:Tt,removeData:Mt},function(e,t){xt[t]=e}),o({data:Tt,inheritedData:Rt,scope:function(e){return ti.data(e,"$scope")||Rt(e.parentNode||e,["$isolateScope","$scope"])},isolateScope:function(e){return ti.data(e,"$isolateScope")||ti.data(e,"$isolateScopeNoTemplate")},controller:Pt,injector:function(e){return Rt(e,"$injector")},removeAttr:function(e,t){e.removeAttribute(t)},hasClass:Ct,css:function(e,t,r){return t=mt(t),y(r)?void(e.style[t]=r):e.style[t]},attr:function(e,t,n){var i=Yn(t);if(Ui[i]){if(!y(n))return e[t]||(e.attributes.getNamedItem(t)||d).specified?i:r;n?(e[t]=!0,e.setAttribute(t,i)):(e[t]=!1,e.removeAttribute(i))}else if(y(n))e.setAttribute(t,n);else if(e.getAttribute){var o=e.getAttribute(t,2);return null===o?r:o}},prop:function(e,t,r){return y(r)?void(e[t]=r):e[t]},text:function(){function e(e,t){if(g(t)){var r=e.nodeType;return r===bi||r===xi?e.textContent:""}e.textContent=t}return e.$dv="",e}(),val:function(e,t){if(g(t)){if(e.multiple&&"select"===L(e)){var r=[];return o(e.options,function(e){e.selected&&r.push(e.value||e.text)}),0===r.length?null:r}return e.value}e.value=t},html:function(e,t){return g(t)?e.innerHTML:(_t(e,!0),void(e.innerHTML=t))},empty:Ot},function(e,t){xt.prototype[t]=function(t,n){var i,o,a=this.length;if(e!==Ot&&(2==e.length&&e!==Ct&&e!==Pt?t:n)===r){if(b(t)){for(i=0;a>i;i++)if(e===Tt)e(this[i],t);else for(o in t)e(this[i],o,t[o]);return this}for(var s=e.$dv,u=s===r?Math.min(a,1):a,c=0;u>c;c++){var l=e(this[c],t,n);s=s?s+l:l}return s}for(i=0;a>i;i++)e(this[i],t,n);return this}}),o({removeData:Mt,on:function qa(e,t,r,n){if(y(n))throw Ri("onargs","jqLite#on() does not support the `selector` or `eventData` parameters");if(gt(e)){var i=Et(e,!0),o=i.events,a=i.handle;a||(a=i.handle=Nt(e,o));for(var s=t.indexOf(" ")>=0?t.split(" "):[t],u=s.length;u--;){t=s[u];var c=o[t];c||(o[t]=[],"mouseenter"===t||"mouseleave"===t?qa(e,Pi[t],function(e){var r=this,n=e.relatedTarget;(!n||n!==r&&!r.contains(n))&&a(e,t)}):"$destroy"!==t&&Ci(e,t,a),c=o[t]),c.push(r)}}},off:St,one:function(e,t,r){e=ti(e),e.on(t,function n(){e.off(t,r),e.off(t,n)}),e.on(t,r)},replaceWith:function(e,t){var r,n=e.parentNode;_t(e),o(new xt(t),function(t){r?n.insertBefore(t,r.nextSibling):n.replaceChild(t,e),r=t})},children:function(e){var t=[];return o(e.childNodes,function(e){e.nodeType===bi&&t.push(e)}),t},contents:function(e){return e.contentDocument||e.childNodes||[]},append:function(e,t){var r=e.nodeType;if(r===bi||r===Si){t=new xt(t);for(var n=0,i=t.length;i>n;n++){var o=t[n];e.appendChild(o)}}},prepend:function(e,t){if(e.nodeType===bi){var r=e.firstChild;o(new xt(t),function(t){e.insertBefore(t,r)})}},wrap:function(e,t){t=ti(t).eq(0).clone()[0];var r=e.parentNode;r&&r.replaceChild(t,e),t.appendChild(e)},remove:Lt,detach:function(e){Lt(e,!0)},after:function(e,t){var r=e,n=e.parentNode;t=new xt(t);for(var i=0,o=t.length;o>i;i++){var a=t[i];n.insertBefore(a,r.nextSibling),r=a}},addClass:$t,removeClass:At,toggleClass:function(e,t,r){t&&o(t.split(" "),function(t){var n=r;g(n)&&(n=!Ct(e,t)),(n?$t:At)(e,t)})},parent:function(e){var t=e.parentNode;return t&&t.nodeType!==Si?t:null},next:function(e){return e.nextElementSibling},find:function(e,t){return e.getElementsByTagName?e.getElementsByTagName(t):[]},clone:wt,triggerHandler:function(e,t,r){var n,i,a,s=t.type||t,u=Et(e),c=u&&u.events,l=c&&c[s];l&&(n={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return this.defaultPrevented===!0},stopImmediatePropagation:function(){this.immediatePropagationStopped=!0},isImmediatePropagationStopped:function(){return this.immediatePropagationStopped===!0},stopPropagation:d,type:s,target:e},t.type&&(n=h(n,t)),i=D(l),a=r?[n].concat(r):[n],o(i,function(t){n.isImmediatePropagationStopped()||t.apply(e,a)}))}},function(e,t){xt.prototype[t]=function(t,r,n){for(var i,o=0,a=this.length;a>o;o++)g(i)?(i=e(this[o],t,r,n),y(i)&&(i=ti(i))):kt(i,e(this[o],t,r,n));return y(i)?i:this},xt.prototype.bind=xt.prototype.on,xt.prototype.unbind=xt.prototype.off}),Bt.prototype={put:function(e,t){this[Vt(e,this.nextUid)]=t},get:function(e){return this[Vt(e,this.nextUid)]},remove:function(e){var t=this[e=Vt(e,this.nextUid)];return delete this[e],t}};var Ii=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,zi=/,/,Gi=/^\s*(_?)(\S+?)\1\s*$/,Hi=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,Wi=n("$injector");Gt.$$annotate=zt;var qi=n("$animate"),Xi=["$provide",function(e){this.$$selectors={},this.register=function(t,r){var n=t+"-animation";if(t&&"."!=t.charAt(0))throw qi("notcsel","Expecting class selector starting with '.' got '{0}'.",t);this.$$selectors[t.substr(1)]=n,e.factory(n,r)},this.classNameFilter=function(e){return 1===arguments.length&&(this.$$classNameFilter=e instanceof RegExp?e:null),this.$$classNameFilter},this.$get=["$$q","$$asyncCallback","$rootScope",function(e,t,r){function n(t){var n,i=e.defer();return i.promise.$$cancelFn=function(){n&&n()},r.$$postDigest(function(){n=t(function(){i.resolve()})}),i.promise}function i(e,t){var r=[],n=[],i=ct();return o((e.attr("class")||"").split(/\s+/),function(e){i[e]=!0}),o(t,function(e,t){var o=i[t];e===!1&&o?n.push(t):e!==!0||o||r.push(t)}),r.length+n.length>0&&[r.length?r:null,n.length?n:null]}function a(e,t,r){for(var n=0,i=t.length;i>n;++n){var o=t[n];e[o]=r}}function s(){return c||(c=e.defer(),t(function(){c.resolve(),c=null})),c.promise}function u(e,t){if(ci.isObject(t)){var r=h(t.from||{},t.to||{});e.css(r)}}var c;return{animate:function(e,t,r){return u(e,{from:t,to:r}),s()},enter:function(e,t,r,n){return u(e,n),r?r.after(e):t.prepend(e),s()},leave:function(e,t){return u(e,t),e.remove(),s()},move:function(e,t,r,n){return this.enter(e,t,r,n)},addClass:function(e,t,r){return this.setClass(e,t,[],r)},$$addClassImmediately:function(e,t,r){return e=ti(e),t=x(t)?t:fi(t)?t.join(" "):"",o(e,function(e){$t(e,t)}),u(e,r),s()},removeClass:function(e,t,r){return this.setClass(e,[],t,r)},$$removeClassImmediately:function(e,t,r){return e=ti(e),t=x(t)?t:fi(t)?t.join(" "):"",o(e,function(e){At(e,t)}),u(e,r),s()
},setClass:function(e,t,r,o){var s=this,u="$$animateClasses",c=!1;e=ti(e);var l=e.data(u);l?o&&l.options&&(l.options=ci.extend(l.options||{},o)):(l={classes:{},options:o},c=!0);var h=l.classes;return t=fi(t)?t:t.split(" "),r=fi(r)?r:r.split(" "),a(h,t,!0),a(h,r,!1),c&&(l.promise=n(function(t){var r=e.data(u);if(e.removeData(u),r){var n=i(e,r.classes);n&&s.$$setClassImmediately(e,n[0],n[1],r.options)}t()}),e.data(u,l)),l.promise},$$setClassImmediately:function(e,t,r,n){return t&&this.$$addClassImmediately(e,t),r&&this.$$removeClassImmediately(e,r),u(e,n),s()},enabled:d,cancel:d}}]}],Yi=n("$compile");Qt.$inject=["$provide","$$sanitizeUriProvider"];var Ki=/^((?:x|data)[\:\-_])/i,Qi=n("$controller"),Zi="application/json",Ji={"Content-Type":Zi+";charset=utf-8"},eo=/^\[|^\{(?!\{)/,to={"[":/]$/,"{":/}$/},ro=/^\)\]\}',?\n/,no=n("$interpolate"),io=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,oo={http:80,https:443,ftp:21},ao=n("$location"),so={$$html5:!1,$$replace:!1,absUrl:Ar("$$absUrl"),url:function(e){if(g(e))return this.$$url;var t=io.exec(e);return(t[1]||""===e)&&this.path(decodeURIComponent(t[1])),(t[2]||t[1]||""===e)&&this.search(t[3]||""),this.hash(t[5]||""),this},protocol:Ar("$$protocol"),host:Ar("$$host"),port:Ar("$$port"),path:$r("$$path",function(e){return e=null!==e?e.toString():"","/"==e.charAt(0)?e:"/"+e}),search:function(e,t){switch(arguments.length){case 0:return this.$$search;case 1:if(x(e)||w(e))e=e.toString(),this.$$search=q(e);else{if(!b(e))throw ao("isrcharg","The first argument of the `$location#search()` call must be a string or an object.");e=j(e,{}),o(e,function(t,r){null==t&&delete e[r]}),this.$$search=e}break;default:g(t)||null===t?delete this.$$search[e]:this.$$search[e]=t}return this.$$compose(),this},hash:$r("$$hash",function(e){return null!==e?e.toString():""}),replace:function(){return this.$$replace=!0,this}};o([Cr,Tr,Er],function(e){e.prototype=Object.create(so),e.prototype.state=function(t){if(!arguments.length)return this.$$state;if(e!==Er||!this.$$html5)throw ao("nostate","History API state support is available only in HTML5 mode and only in browsers supporting HTML5 History API");return this.$$state=g(t)?null:t,this}});var uo=n("$parse"),co=Function.prototype.call,lo=Function.prototype.apply,ho=Function.prototype.bind,fo=ct();o({"null":function(){return null},"true":function(){return!0},"false":function(){return!1},undefined:function(){}},function(e,t){e.constant=e.literal=e.sharedGetter=!0,fo[t]=e}),fo["this"]=function(e){return e},fo["this"].sharedGetter=!0;var po=h(ct(),{"+":function(e,t,n,i){return n=n(e,t),i=i(e,t),y(n)?y(i)?n+i:n:y(i)?i:r},"-":function(e,t,r,n){return r=r(e,t),n=n(e,t),(y(r)?r:0)-(y(n)?n:0)},"*":function(e,t,r,n){return r(e,t)*n(e,t)},"/":function(e,t,r,n){return r(e,t)/n(e,t)},"%":function(e,t,r,n){return r(e,t)%n(e,t)},"===":function(e,t,r,n){return r(e,t)===n(e,t)},"!==":function(e,t,r,n){return r(e,t)!==n(e,t)},"==":function(e,t,r,n){return r(e,t)==n(e,t)},"!=":function(e,t,r,n){return r(e,t)!=n(e,t)},"<":function(e,t,r,n){return r(e,t)<n(e,t)},">":function(e,t,r,n){return r(e,t)>n(e,t)},"<=":function(e,t,r,n){return r(e,t)<=n(e,t)},">=":function(e,t,r,n){return r(e,t)>=n(e,t)},"&&":function(e,t,r,n){return r(e,t)&&n(e,t)},"||":function(e,t,r,n){return r(e,t)||n(e,t)},"!":function(e,t,r){return!r(e,t)},"=":!0,"|":!0}),mo={n:"\n",f:"\f",r:"\r",t:" ",v:"","'":"'",'"':'"'},vo=function(e){this.options=e};vo.prototype={constructor:vo,lex:function(e){for(this.text=e,this.index=0,this.tokens=[];this.index<this.text.length;){var t=this.text.charAt(this.index);if('"'===t||"'"===t)this.readString(t);else if(this.isNumber(t)||"."===t&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdent(t))this.readIdent();else if(this.is(t,"(){}[].,;:?"))this.tokens.push({index:this.index,text:t}),this.index++;else if(this.isWhitespace(t))this.index++;else{var r=t+this.peek(),n=r+this.peek(2),i=po[t],o=po[r],a=po[n];if(i||o||a){var s=a?n:o?r:t;this.tokens.push({index:this.index,text:s,operator:!0}),this.index+=s.length}else this.throwError("Unexpected next character ",this.index,this.index+1)}}return this.tokens},is:function(e,t){return-1!==t.indexOf(e)},peek:function(e){var t=e||1;return this.index+t<this.text.length?this.text.charAt(this.index+t):!1},isNumber:function(e){return e>="0"&&"9">=e&&"string"==typeof e},isWhitespace:function(e){return" "===e||"\r"===e||" "===e||"\n"===e||""===e||" "===e},isIdent:function(e){return e>="a"&&"z">=e||e>="A"&&"Z">=e||"_"===e||"$"===e},isExpOperator:function(e){return"-"===e||"+"===e||this.isNumber(e)},throwError:function(e,t,r){r=r||this.index;var n=y(t)?"s "+t+"-"+this.index+" ["+this.text.substring(t,r)+"]":" "+r;throw uo("lexerr","Lexer Error: {0} at column{1} in expression [{2}].",e,n,this.text)},readNumber:function(){for(var e="",t=this.index;this.index<this.text.length;){var r=Yn(this.text.charAt(this.index));if("."==r||this.isNumber(r))e+=r;else{var n=this.peek();if("e"==r&&this.isExpOperator(n))e+=r;else if(this.isExpOperator(r)&&n&&this.isNumber(n)&&"e"==e.charAt(e.length-1))e+=r;else{if(!this.isExpOperator(r)||n&&this.isNumber(n)||"e"!=e.charAt(e.length-1))break;this.throwError("Invalid exponent")}}this.index++}this.tokens.push({index:t,text:e,constant:!0,value:Number(e)})},readIdent:function(){for(var e=this.index;this.index<this.text.length;){var t=this.text.charAt(this.index);if(!this.isIdent(t)&&!this.isNumber(t))break;this.index++}this.tokens.push({index:e,text:this.text.slice(e,this.index),identifier:!0})},readString:function(e){var t=this.index;this.index++;for(var r="",n=e,i=!1;this.index<this.text.length;){var o=this.text.charAt(this.index);if(n+=o,i){if("u"===o){var a=this.text.substring(this.index+1,this.index+5);a.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+a+"]"),this.index+=4,r+=String.fromCharCode(parseInt(a,16))}else{var s=mo[o];r+=s||o}i=!1}else if("\\"===o)i=!0;else{if(o===e)return this.index++,void this.tokens.push({index:t,text:n,constant:!0,value:r});r+=o}this.index++}this.throwError("Unterminated quote",t)}};var go=function(e,t,r){this.lexer=e,this.$filter=t,this.options=r};go.ZERO=h(function(){return 0},{sharedGetter:!0,constant:!0}),go.prototype={constructor:go,parse:function(e){this.text=e,this.tokens=this.lexer.lex(e);var t=this.statements();return 0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]),t.literal=!!t.literal,t.constant=!!t.constant,t},primary:function(){var e;this.expect("(")?(e=this.filterChain(),this.consume(")")):this.expect("[")?e=this.arrayDeclaration():this.expect("{")?e=this.object():this.peek().identifier&&this.peek().text in fo?e=fo[this.consume().text]:this.peek().identifier?e=this.identifier():this.peek().constant?e=this.constant():this.throwError("not a primary expression",this.peek());for(var t,r;t=this.expect("(","[",".");)"("===t.text?(e=this.functionCall(e,r),r=null):"["===t.text?(r=e,e=this.objectIndex(e)):"."===t.text?(r=e,e=this.fieldAccess(e)):this.throwError("IMPOSSIBLE");return e},throwError:function(e,t){throw uo("syntax","Syntax Error: Token '{0}' {1} at column {2} of the expression [{3}] starting at [{4}].",t.text,e,t.index+1,this.text,this.text.substring(t.index))},peekToken:function(){if(0===this.tokens.length)throw uo("ueoe","Unexpected end of expression: {0}",this.text);return this.tokens[0]},peek:function(e,t,r,n){return this.peekAhead(0,e,t,r,n)},peekAhead:function(e,t,r,n,i){if(this.tokens.length>e){var o=this.tokens[e],a=o.text;if(a===t||a===r||a===n||a===i||!t&&!r&&!n&&!i)return o}return!1},expect:function(e,t,r,n){var i=this.peek(e,t,r,n);return i?(this.tokens.shift(),i):!1},consume:function(e){if(0===this.tokens.length)throw uo("ueoe","Unexpected end of expression: {0}",this.text);var t=this.expect(e);return t||this.throwError("is unexpected, expecting ["+e+"]",this.peek()),t},unaryFn:function(e,t){var r=po[e];return h(function(e,n){return r(e,n,t)},{constant:t.constant,inputs:[t]})},binaryFn:function(e,t,r,n){var i=po[t];return h(function(t,n){return i(t,n,e,r)},{constant:e.constant&&r.constant,inputs:!n&&[e,r]})},identifier:function(){for(var e=this.consume().text;this.peek(".")&&this.peekAhead(1).identifier&&!this.peekAhead(2,"(");)e+=this.consume().text+this.consume().text;return Vr(e,this.options,this.text)},constant:function(){var e=this.consume().value;return h(function(){return e},{constant:!0,literal:!0})},statements:function(){for(var e=[];;)if(this.tokens.length>0&&!this.peek("}",")",";","]")&&e.push(this.filterChain()),!this.expect(";"))return 1===e.length?e[0]:function(t,r){for(var n,i=0,o=e.length;o>i;i++)n=e[i](t,r);return n}},filterChain:function(){for(var e,t=this.expression();e=this.expect("|");)t=this.filter(t);return t},filter:function(e){var t,n,i=this.$filter(this.consume().text);if(this.peek(":"))for(t=[],n=[];this.expect(":");)t.push(this.expression());var o=[e].concat(t||[]);return h(function(o,a){var s=e(o,a);if(n){n[0]=s;for(var u=t.length;u--;)n[u+1]=t[u](o,a);return i.apply(r,n)}return i(s)},{constant:!i.$stateful&&o.every(Fr),inputs:!i.$stateful&&o})},expression:function(){return this.assignment()},assignment:function(){var e,t,r=this.ternary();return(t=this.expect("="))?(r.assign||this.throwError("implies assignment but ["+this.text.substring(0,t.index)+"] can not be assigned to",t),e=this.ternary(),h(function(t,n){return r.assign(t,e(t,n),n)},{inputs:[r,e]})):r},ternary:function(){var e,t,r=this.logicalOR();if((t=this.expect("?"))&&(e=this.assignment(),this.consume(":"))){var n=this.assignment();return h(function(t,i){return r(t,i)?e(t,i):n(t,i)},{constant:r.constant&&e.constant&&n.constant})}return r},logicalOR:function(){for(var e,t=this.logicalAND();e=this.expect("||");)t=this.binaryFn(t,e.text,this.logicalAND(),!0);return t},logicalAND:function(){for(var e,t=this.equality();e=this.expect("&&");)t=this.binaryFn(t,e.text,this.equality(),!0);return t},equality:function(){for(var e,t=this.relational();e=this.expect("==","!=","===","!==");)t=this.binaryFn(t,e.text,this.relational());return t},relational:function(){for(var e,t=this.additive();e=this.expect("<",">","<=",">=");)t=this.binaryFn(t,e.text,this.additive());return t},additive:function(){for(var e,t=this.multiplicative();e=this.expect("+","-");)t=this.binaryFn(t,e.text,this.multiplicative());return t},multiplicative:function(){for(var e,t=this.unary();e=this.expect("*","/","%");)t=this.binaryFn(t,e.text,this.unary());return t},unary:function(){var e;return this.expect("+")?this.primary():(e=this.expect("-"))?this.binaryFn(go.ZERO,e.text,this.unary()):(e=this.expect("!"))?this.unaryFn(e.text,this.unary()):this.primary()},fieldAccess:function(e){var t=this.identifier();return h(function(n,i,o){var a=o||e(n,i);return null==a?r:t(a)},{assign:function(r,n,i){var o=e(r,i);return o||e.assign(r,o={},i),t.assign(o,n)}})},objectIndex:function(e){var t=this.text,n=this.expression();return this.consume("]"),h(function(i,o){var a,s=e(i,o),u=n(i,o);return Rr(u,t),s?a=Or(s[u],t):r},{assign:function(r,i,o){var a=Rr(n(r,o),t),s=Or(e(r,o),t);return s||e.assign(r,s={},o),s[a]=i}})},functionCall:function(e,t){var n=[];if(")"!==this.peekToken().text)do n.push(this.expression());while(this.expect(","));this.consume(")");var i=this.text,o=n.length?[]:null;return function(a,s){var u=t?t(a,s):y(t)?r:a,c=e(a,s,u)||d;if(o)for(var l=n.length;l--;)o[l]=Or(n[l](a,s),i);Or(u,i),Lr(c,i);var h=c.apply?c.apply(u,o):c(o[0],o[1],o[2],o[3],o[4]);return o&&(o.length=0),Or(h,i)}},arrayDeclaration:function(){var e=[];if("]"!==this.peekToken().text)do{if(this.peek("]"))break;e.push(this.expression())}while(this.expect(","));return this.consume("]"),h(function(t,r){for(var n=[],i=0,o=e.length;o>i;i++)n.push(e[i](t,r));return n},{literal:!0,constant:e.every(Fr),inputs:e})},object:function(){var e=[],t=[];if("}"!==this.peekToken().text)do{if(this.peek("}"))break;var r=this.consume();r.constant?e.push(r.value):r.identifier?e.push(r.text):this.throwError("invalid key",r),this.consume(":"),t.push(this.expression())}while(this.expect(","));return this.consume("}"),h(function(r,n){for(var i={},o=0,a=t.length;a>o;o++)i[e[o]]=t[o](r,n);return i},{literal:!0,constant:t.every(Fr),inputs:t})}};var yo=ct(),bo=ct(),xo=Object.prototype.valueOf,wo=n("$sce"),_o={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},Yi=n("$compile"),So=t.createElement("a"),Mo=nn(e.location.href);sn.$inject=["$provide"],hn.$inject=["$locale"],fn.$inject=["$locale"];var Eo=".",To={yyyy:mn("FullYear",4),yy:mn("FullYear",2,0,!0),y:mn("FullYear",1),MMMM:vn("Month"),MMM:vn("Month",!0),MM:mn("Month",2,1),M:mn("Month",1,1),dd:mn("Date",2),d:mn("Date",1),HH:mn("Hours",2),H:mn("Hours",1),hh:mn("Hours",2,-12),h:mn("Hours",1,-12),mm:mn("Minutes",2),m:mn("Minutes",1),ss:mn("Seconds",2),s:mn("Seconds",1),sss:mn("Milliseconds",3),EEEE:vn("Day"),EEE:vn("Day",!0),a:wn,Z:gn,ww:xn(2),w:xn(1),G:_n,GG:_n,GGG:_n,GGGG:Sn},Co=/((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,Ao=/^\-?\d+$/;Mn.$inject=["$locale"];var $o=v(Yn),ko=v(Qn);Cn.$inject=["$parse"];var Po=v({restrict:"E",compile:function(e,t){return t.href||t.xlinkHref||t.name?void 0:function(e,t){if("a"===t[0].nodeName.toLowerCase()){var r="[object SVGAnimatedString]"===si.call(t.prop("href"))?"xlink:href":"href";t.on("click",function(e){t.attr(r)||e.preventDefault()})}}}}),Ro={};o(Ui,function(e,t){if("multiple"!=e){var r=Zt("ng-"+t);Ro[r]=function(){return{restrict:"A",priority:100,link:function(e,n,i){e.$watch(i[r],function(e){i.$set(t,!!e)})}}}}}),o(Bi,function(e,t){Ro[t]=function(){return{priority:100,link:function(e,r,n){if("ngPattern"===t&&"/"==n.ngPattern.charAt(0)){var i=n.ngPattern.match(qn);if(i)return void n.$set("ngPattern",new RegExp(i[1],i[2]))}e.$watch(n[t],function(e){n.$set(t,e)})}}}}),o(["src","srcset","href"],function(e){var t=Zt("ng-"+e);Ro[t]=function(){return{priority:99,link:function(r,n,i){var o=e,a=e;"href"===e&&"[object SVGAnimatedString]"===si.call(n.prop("href"))&&(a="xlinkHref",i.$attr[a]="xlink:href",o=null),i.$observe(t,function(t){return t?(i.$set(a,t),void(ei&&o&&n.prop(o,i[a]))):void("href"===e&&i.$set(a,null))})}}}});var Oo={$addControl:d,$$renameControl:$n,$removeControl:d,$setValidity:d,$setDirty:d,$setPristine:d,$setSubmitted:d},Lo="ng-submitted";kn.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var Fo=function(e){return["$timeout",function(t){var n={name:"form",restrict:e?"EAC":"E",controller:kn,compile:function(n,i){n.addClass(ma).addClass(pa);var o=i.name?"name":e&&i.ngForm?"ngForm":!1;return{pre:function(e,n,i,a){if(!("action"in i)){var s=function(t){e.$apply(function(){a.$commitViewValue(),a.$setSubmitted()}),t.preventDefault()};Ci(n[0],"submit",s),n.on("$destroy",function(){t(function(){Ai(n[0],"submit",s)},0,!1)})}var u=a.$$parentForm;o&&(jr(e,null,a.$name,a,a.$name),i.$observe(o,function(t){a.$name!==t&&(jr(e,null,a.$name,r,a.$name),u.$$renameControl(a,t),jr(e,null,a.$name,a,a.$name))})),n.on("$destroy",function(){u.$removeControl(a),o&&jr(e,null,i[o],r,a.$name),h(a,Oo)})}}}};return n}]},jo=Fo(),Do=Fo(!0),No=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/,Uo=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,Vo=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,Bo=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,Io=/^(\d{4})-(\d{2})-(\d{2})$/,zo=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Go=/^(\d{4})-W(\d\d)$/,Ho=/^(\d{4})-(\d\d)$/,Wo=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,qo={text:Rn,date:jn("date",Io,Fn(Io,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":jn("datetimelocal",zo,Fn(zo,["yyyy","MM","dd","HH","mm","ss","sss"]),"yyyy-MM-ddTHH:mm:ss.sss"),time:jn("time",Wo,Fn(Wo,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:jn("week",Go,Ln,"yyyy-Www"),month:jn("month",Ho,Fn(Ho,["yyyy","MM"]),"yyyy-MM"),number:Nn,url:Un,email:Vn,radio:Bn,checkbox:zn,hidden:d,button:d,submit:d,reset:d,file:d},Xo=["$browser","$sniffer","$filter","$parse",function(e,t,r,n){return{restrict:"E",require:["?ngModel"],link:{pre:function(i,o,a,s){s[0]&&(qo[Yn(a.type)]||qo.text)(i,o,a,s[0],t,e,r,n)}}}}],Yo=/^(true|false|\d+)$/,Ko=function(){return{restrict:"A",priority:100,compile:function(e,t){return Yo.test(t.ngValue)?function(e,t,r){r.$set("value",e.$eval(r.ngValue))}:function(e,t,r){e.$watch(r.ngValue,function(e){r.$set("value",e)})}}}},Qo=["$compile",function(e){return{restrict:"AC",compile:function(t){return e.$$addBindingClass(t),function(t,n,i){e.$$addBindingInfo(n,i.ngBind),n=n[0],t.$watch(i.ngBind,function(e){n.textContent=e===r?"":e})}}}}],Zo=["$interpolate","$compile",function(e,t){return{compile:function(n){return t.$$addBindingClass(n),function(n,i,o){var a=e(i.attr(o.$attr.ngBindTemplate));t.$$addBindingInfo(i,a.expressions),i=i[0],o.$observe("ngBindTemplate",function(e){i.textContent=e===r?"":e})}}}}],Jo=["$sce","$parse","$compile",function(e,t,r){return{restrict:"A",compile:function(n,i){var o=t(i.ngBindHtml),a=t(i.ngBindHtml,function(e){return(e||"").toString()});return r.$$addBindingClass(n),function(t,n,i){r.$$addBindingInfo(n,i.ngBindHtml),t.$watch(a,function(){n.html(e.getTrustedHtml(o(t))||"")})}}}}],ea=v({restrict:"A",require:"ngModel",link:function(e,t,r,n){n.$viewChangeListeners.push(function(){e.$eval(r.ngChange)})}}),ta=Gn("",!0),ra=Gn("Odd",0),na=Gn("Even",1),ia=An({compile:function(e,t){t.$set("ngCloak",r),e.removeClass("ng-cloak")}}),oa=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],aa={},sa={blur:!0,focus:!0};o("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(e){var t=Zt("ng-"+e);aa[t]=["$parse","$rootScope",function(r,n){return{restrict:"A",compile:function(i,o){var a=r(o[t],null,!0);return function(t,r){r.on(e,function(r){var i=function(){a(t,{$event:r})};sa[e]&&n.$$phase?t.$evalAsync(i):t.$apply(i)})}}}}]});var ua=["$animate",function(e){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(r,n,i,o,a){var s,u,c;r.$watch(i.ngIf,function(r){r?u||a(function(r,o){u=o,r[r.length++]=t.createComment(" end ngIf: "+i.ngIf+" "),s={clone:r},e.enter(r,n.parent(),n)}):(c&&(c.remove(),c=null),u&&(u.$destroy(),u=null),s&&(c=ut(s.clone),e.leave(c).then(function(){c=null}),s=null))})}}}],ca=["$templateRequest","$anchorScroll","$animate","$sce",function(e,t,r,n){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:ci.noop,compile:function(i,o){var a=o.ngInclude||o.src,s=o.onload||"",u=o.autoscroll;return function(i,o,c,l,h){var f,p,d,m=0,v=function(){p&&(p.remove(),p=null),f&&(f.$destroy(),f=null),d&&(r.leave(d).then(function(){p=null}),p=d,d=null)};i.$watch(n.parseAsResourceUrl(a),function(n){var a=function(){!y(u)||u&&!i.$eval(u)||t()},c=++m;n?(e(n,!0).then(function(e){if(c===m){var t=i.$new();l.template=e;var u=h(t,function(e){v(),r.enter(e,null,o).then(a)});f=t,d=u,f.$emit("$includeContentLoaded",n),i.$eval(s)}},function(){c===m&&(v(),i.$emit("$includeContentError",n))}),i.$emit("$includeContentRequested",n)):(v(),l.template=null)})}}}}],la=["$compile",function(e){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(r,n,i,o){return/SVG/.test(n[0].toString())?(n.empty(),void e(yt(o.template,t).childNodes)(r,function(e){n.append(e)},{futureParentElement:n})):(n.html(o.template),void e(n.contents())(r))}}}],ha=An({priority:450,compile:function(){return{pre:function(e,t,r){e.$eval(r.ngInit)}}}}),fa=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(e,t,n,i){var a=t.attr(n.$attr.ngList)||", ",s="false"!==n.ngTrim,u=s?pi(a):a,c=function(e){if(!g(e)){var t=[];return e&&o(e.split(u),function(e){e&&t.push(s?pi(e):e)}),t}};i.$parsers.push(c),i.$formatters.push(function(e){return fi(e)?e.join(a):r}),i.$isEmpty=function(e){return!e||!e.length}}}},pa="ng-valid",da="ng-invalid",ma="ng-pristine",va="ng-dirty",ga="ng-untouched",ya="ng-touched",ba="ng-pending",xa=new n("ngModel"),wa=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(e,t,n,i,a,s,u,c,l,h){this.$viewValue=Number.NaN,this.$modelValue=Number.NaN,this.$$rawModelValue=r,this.$validators={},this.$asyncValidators={},this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$untouched=!0,this.$touched=!1,this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$error={},this.$$success={},this.$pending=r,this.$name=h(n.name||"",!1)(e);var f,p=a(n.ngModel),m=p.assign,v=p,b=m,x=null,_=this;this.$$setOptions=function(e){if(_.$options=e,e&&e.getterSetter){var t=a(n.ngModel+"()"),r=a(n.ngModel+"($$$p)");v=function(e){var r=p(e);return S(r)&&(r=t(e)),r},b=function(e){S(p(e))?r(e,{$$$p:_.$modelValue}):m(e,_.$modelValue)}}else if(!p.assign)throw xa("nonassign","Expression '{0}' is non-assignable. Element: {1}",n.ngModel,H(i))},this.$render=d,this.$isEmpty=function(e){return g(e)||""===e||null===e||e!==e};var M=i.inheritedData("$formController")||Oo,E=0;Hn({ctrl:this,$element:i,set:function(e,t){e[t]=!0},unset:function(e,t){delete e[t]},parentForm:M,$animate:s}),this.$setPristine=function(){_.$dirty=!1,_.$pristine=!0,s.removeClass(i,va),s.addClass(i,ma)},this.$setDirty=function(){_.$dirty=!0,_.$pristine=!1,s.removeClass(i,ma),s.addClass(i,va),M.$setDirty()},this.$setUntouched=function(){_.$touched=!1,_.$untouched=!0,s.setClass(i,ga,ya)},this.$setTouched=function(){_.$touched=!0,_.$untouched=!1,s.setClass(i,ya,ga)},this.$rollbackViewValue=function(){u.cancel(x),_.$viewValue=_.$$lastCommittedViewValue,_.$render()},this.$validate=function(){if(!w(_.$modelValue)||!isNaN(_.$modelValue)){var e=_.$$lastCommittedViewValue,t=_.$$rawModelValue,n=_.$valid,i=_.$modelValue,o=_.$options&&_.$options.allowInvalid;_.$$runValidators(t,e,function(e){o||n===e||(_.$modelValue=e?t:r,_.$modelValue!==i&&_.$$writeModelToScope())})}},this.$$runValidators=function(e,t,n){function i(){var e=_.$$parserName||"parse";return f!==r?(f||(o(_.$validators,function(e,t){u(t,null)}),o(_.$asyncValidators,function(e,t){u(t,null)})),u(e,f),f):(u(e,null),!0)}function a(){var r=!0;return o(_.$validators,function(n,i){var o=n(e,t);r=r&&o,u(i,o)}),r?!0:(o(_.$asyncValidators,function(e,t){u(t,null)}),!1)}function s(){var n=[],i=!0;o(_.$asyncValidators,function(o,a){var s=o(e,t);if(!P(s))throw xa("$asyncValidators","Expected asynchronous validator to return a promise but got '{0}' instead.",s);u(a,r),n.push(s.then(function(){u(a,!0)},function(){i=!1,u(a,!1)}))}),n.length?l.all(n).then(function(){c(i)},d):c(!0)}function u(e,t){h===E&&_.$setValidity(e,t)}function c(e){h===E&&n(e)}E++;var h=E;return i()&&a()?void s():void c(!1)},this.$commitViewValue=function(){var e=_.$viewValue;u.cancel(x),(_.$$lastCommittedViewValue!==e||""===e&&_.$$hasNativeValidators)&&(_.$$lastCommittedViewValue=e,_.$pristine&&this.$setDirty(),this.$$parseAndValidate())},this.$$parseAndValidate=function(){function t(){_.$modelValue!==a&&_.$$writeModelToScope()}var n=_.$$lastCommittedViewValue,i=n;if(f=g(i)?r:!0)for(var o=0;o<_.$parsers.length;o++)if(i=_.$parsers[o](i),g(i)){f=!1;break}w(_.$modelValue)&&isNaN(_.$modelValue)&&(_.$modelValue=v(e));var a=_.$modelValue,s=_.$options&&_.$options.allowInvalid;_.$$rawModelValue=i,s&&(_.$modelValue=i,t()),_.$$runValidators(i,_.$$lastCommittedViewValue,function(e){s||(_.$modelValue=e?i:r,t())})},this.$$writeModelToScope=function(){b(e,_.$modelValue),o(_.$viewChangeListeners,function(e){try{e()}catch(r){t(r)}})},this.$setViewValue=function(e,t){_.$viewValue=e,(!_.$options||_.$options.updateOnDefault)&&_.$$debounceViewValueCommit(t)},this.$$debounceViewValueCommit=function(t){var r,n=0,i=_.$options;i&&y(i.debounce)&&(r=i.debounce,w(r)?n=r:w(r[t])?n=r[t]:w(r["default"])&&(n=r["default"])),u.cancel(x),n?x=u(function(){_.$commitViewValue()},n):c.$$phase?_.$commitViewValue():e.$apply(function(){_.$commitViewValue()})},e.$watch(function(){var t=v(e);if(t!==_.$modelValue){_.$modelValue=_.$$rawModelValue=t,f=r;for(var n=_.$formatters,i=n.length,o=t;i--;)o=n[i](o);_.$viewValue!==o&&(_.$viewValue=_.$$lastCommittedViewValue=o,_.$render(),_.$$runValidators(t,o,d))}return t})}],_a=["$rootScope",function(e){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:wa,priority:1,compile:function(t){return t.addClass(ma).addClass(ga).addClass(pa),{pre:function(e,t,r,n){var i=n[0],o=n[1]||Oo;i.$$setOptions(n[2]&&n[2].$options),o.$addControl(i),r.$observe("name",function(e){i.$name!==e&&o.$$renameControl(i,e)}),e.$on("$destroy",function(){o.$removeControl(i)})},post:function(t,r,n,i){var o=i[0];o.$options&&o.$options.updateOn&&r.on(o.$options.updateOn,function(e){o.$$debounceViewValueCommit(e&&e.type)}),r.on("blur",function(){o.$touched||(e.$$phase?t.$evalAsync(o.$setTouched):t.$apply(o.$setTouched))})}}}}}],Sa=/(\s+|^)default(\s+|$)/,Ma=function(){return{restrict:"A",controller:["$scope","$attrs",function(e,t){var n=this;this.$options=e.$eval(t.ngModelOptions),this.$options.updateOn!==r?(this.$options.updateOnDefault=!1,this.$options.updateOn=pi(this.$options.updateOn.replace(Sa,function(){return n.$options.updateOnDefault=!0," "}))):this.$options.updateOnDefault=!0}]}},Ea=An({terminal:!0,priority:1e3}),Ta=["$locale","$interpolate",function(e,t){var r=/{}/g,n=/^when(Minus)?(.+)$/;return{restrict:"EA",link:function(i,a,s){function u(e){a.text(e||"")}var c,l=s.count,h=s.$attr.when&&a.attr(s.$attr.when),f=s.offset||0,p=i.$eval(h)||{},d={},m=t.startSymbol(),v=t.endSymbol(),g=m+l+"-"+f+v,y=ci.noop;o(s,function(e,t){var r=n.exec(t);if(r){var i=(r[1]?"-":"")+Yn(r[2]);p[i]=a.attr(s.$attr[t])}}),o(p,function(e,n){d[n]=t(e.replace(r,g))}),i.$watch(l,function(t){var r=parseFloat(t),n=isNaN(r);n||r in p||(r=e.pluralCat(r-f)),r===c||n&&isNaN(c)||(y(),y=i.$watch(d[r],u),c=r)})}}}],Ca=["$parse","$animate",function(e,a){var s="$$NG_REMOVED",u=n("ngRepeat"),c=function(e,t,r,n,i,o,a){e[r]=n,i&&(e[i]=o),e.$index=t,e.$first=0===t,e.$last=t===a-1,e.$middle=!(e.$first||e.$last),e.$odd=!(e.$even=0===(1&t))},l=function(e){return e.clone[0]},h=function(e){return e.clone[e.clone.length-1]};return{restrict:"A",multiElement:!0,transclude:"element",priority:1e3,terminal:!0,$$tlb:!0,compile:function(n,f){var p=f.ngRepeat,d=t.createComment(" end ngRepeat: "+p+" "),m=p.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!m)throw u("iexp","Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",p);var v=m[1],g=m[2],y=m[3],b=m[4];if(m=v.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/),!m)throw u("iidexp","'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",v);var x=m[3]||m[1],w=m[2];if(y&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(y)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(y)))throw u("badident","alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.",y);var _,S,M,E,T={$id:Vt};return b?_=e(b):(M=function(e,t){return Vt(t)},E=function(e){return e}),function(e,t,n,f,m){_&&(S=function(t,r,n){return w&&(T[w]=t),T[x]=r,T.$index=n,_(e,T)});var v=ct();e.$watchCollection(g,function(n){var f,g,b,_,T,C,A,$,k,P,R,O,L=t[0],F=ct();if(y&&(e[y]=n),i(n))k=n,$=S||M;else{$=S||E,k=[];for(var j in n)n.hasOwnProperty(j)&&"$"!=j.charAt(0)&&k.push(j);k.sort()}for(_=k.length,R=new Array(_),f=0;_>f;f++)if(T=n===k?f:k[f],C=n[T],A=$(T,C,f),v[A])P=v[A],delete v[A],F[A]=P,R[f]=P;else{if(F[A])throw o(R,function(e){e&&e.scope&&(v[e.id]=e)}),u("dupes","Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}",p,A,C);R[f]={id:A,scope:r,clone:r},F[A]=!0}for(var D in v){if(P=v[D],O=ut(P.clone),a.leave(O),O[0].parentNode)for(f=0,g=O.length;g>f;f++)O[f][s]=!0;P.scope.$destroy()}for(f=0;_>f;f++)if(T=n===k?f:k[f],C=n[T],P=R[f],P.scope){b=L;do b=b.nextSibling;while(b&&b[s]);l(P)!=b&&a.move(ut(P.clone),null,ti(L)),L=h(P),c(P.scope,f,x,C,w,T,_)}else m(function(e,t){P.scope=t;var r=d.cloneNode(!1);e[e.length++]=r,a.enter(e,null,ti(L)),L=r,P.clone=e,F[P.id]=P,c(P.scope,f,x,C,w,T,_)});v=F})}}}}],Aa="ng-hide",$a="ng-hide-animate",ka=["$animate",function(e){return{restrict:"A",multiElement:!0,link:function(t,r,n){t.$watch(n.ngShow,function(t){e[t?"removeClass":"addClass"](r,Aa,{tempClasses:$a})})}}}],Pa=["$animate",function(e){return{restrict:"A",multiElement:!0,link:function(t,r,n){t.$watch(n.ngHide,function(t){e[t?"addClass":"removeClass"](r,Aa,{tempClasses:$a})})}}}],Ra=An(function(e,t,r){e.$watchCollection(r.ngStyle,function(e,r){r&&e!==r&&o(r,function(e,r){t.css(r,"")}),e&&t.css(e)})}),Oa=["$animate",function(e){return{restrict:"EA",require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(r,n,i,a){var s=i.ngSwitch||i.on,u=[],c=[],l=[],h=[],f=function(e,t){return function(){e.splice(t,1)}};r.$watch(s,function(r){var n,i;for(n=0,i=l.length;i>n;++n)e.cancel(l[n]);for(l.length=0,n=0,i=h.length;i>n;++n){var s=ut(c[n].clone);h[n].$destroy();var p=l[n]=e.leave(s);p.then(f(l,n))}c.length=0,h.length=0,(u=a.cases["!"+r]||a.cases["?"])&&o(u,function(r){r.transclude(function(n,i){h.push(i);var o=r.element;n[n.length++]=t.createComment(" end ngSwitchWhen: ");var a={clone:n};c.push(a),e.enter(n,o.parent(),o)})})})}}}],La=An({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(e,t,r,n,i){n.cases["!"+r.ngSwitchWhen]=n.cases["!"+r.ngSwitchWhen]||[],n.cases["!"+r.ngSwitchWhen].push({transclude:i,element:t})}}),Fa=An({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(e,t,r,n,i){n.cases["?"]=n.cases["?"]||[],n.cases["?"].push({transclude:i,element:t})}}),ja=An({restrict:"EAC",link:function(e,t,r,i,o){if(!o)throw n("ngTransclude")("orphan","Illegal use of ngTransclude directive in the template! No parent directive that requires a transclusion found. Element: {0}",H(t));o(function(e){t.empty(),t.append(e)})}}),Da=["$templateCache",function(e){return{restrict:"E",terminal:!0,compile:function(t,r){if("text/ng-template"==r.type){var n=r.id,i=t[0].text;e.put(n,i)}}}}],Na=n("ngOptions"),Ua=v({restrict:"A",terminal:!0}),Va=["$compile","$parse",function(e,n){var i=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,s={$setViewValue:d};return{restrict:"E",require:["select","?ngModel"],controller:["$element","$scope","$attrs",function(e,t,r){var n,i,o=this,a={},u=s;o.databound=r.ngModel,o.init=function(e,t,r){u=e,n=t,i=r},o.addOption=function(t,r){at(t,'"option value"'),a[t]=!0,u.$viewValue==t&&(e.val(t),i.parent()&&i.remove()),r&&r[0].hasAttribute("selected")&&(r[0].selected=!0)},o.removeOption=function(e){this.hasOption(e)&&(delete a[e],u.$viewValue===e&&this.renderUnknownOption(e))},o.renderUnknownOption=function(t){var r="? "+Vt(t)+" ?";i.val(r),e.prepend(i),e.val(r),i.prop("selected",!0)},o.hasOption=function(e){return a.hasOwnProperty(e)},t.$on("$destroy",function(){o.renderUnknownOption=d})}],link:function(s,u,c,l){function h(e,t,r,n){r.$render=function(){var e=r.$viewValue;n.hasOption(e)?(E.parent()&&E.remove(),t.val(e),""===e&&d.prop("selected",!0)):g(e)&&d?t.val(""):n.renderUnknownOption(e)},t.on("change",function(){e.$apply(function(){E.parent()&&E.remove(),r.$setViewValue(t.val())})})}function f(e,t,r){var n;r.$render=function(){var e=new Bt(r.$viewValue);o(t.find("option"),function(t){t.selected=y(e.get(t.value))})},e.$watch(function(){N(n,r.$viewValue)||(n=D(r.$viewValue),r.$render())}),t.on("change",function(){e.$apply(function(){var e=[];o(t.find("option"),function(t){t.selected&&e.push(t.value)}),r.$setViewValue(e)})})}function p(t,s,u){function c(e,r,n){return N[C]=n,k&&(N[k]=r),e(t,N)
}function l(){t.$apply(function(){var e,r=O(t)||[];if(b)e=[],o(s.val(),function(t){t=F?j[t]:t,e.push(h(t,r[t]))});else{var n=F?j[s.val()]:s.val();e=h(n,r[n])}u.$setViewValue(e),g()})}function h(e,t){if("?"===e)return r;if(""===e)return null;var n=$?$:R;return c(n,e,t)}function f(){var e,r=O(t);if(r&&fi(r)){e=new Array(r.length);for(var n=0,i=r.length;i>n;n++)e[n]=c(T,n,r[n]);return e}if(r){e={};for(var o in r)r.hasOwnProperty(o)&&(e[o]=c(T,o,r[o]))}return e}function p(e){var t;if(b)if(F&&fi(e)){t=new Bt([]);for(var r=0;r<e.length;r++)t.put(c(F,null,e[r]),!0)}else t=new Bt(e);else F&&(e=c(F,null,e));return function(r,n){var i;return i=F?F:$?$:R,b?y(t.remove(c(i,r,n))):e===c(i,r,n)}}function d(){_||(t.$$postDigest(g),_=!0)}function v(e,t,r){e[t]=e[t]||0,e[t]+=r?1:-1}function g(){_=!1;var e,r,n,i,l,h,f,d,g,x,E,C,A,$,R,L,U,V={"":[]},B=[""],I=u.$viewValue,z=O(t)||[],G=k?a(z):z,H={},W=p(I),q=!1;for(j={},C=0;x=G.length,x>C;C++)f=C,k&&(f=G[C],"$"===f.charAt(0))||(d=z[f],e=c(P,f,d)||"",(r=V[e])||(r=V[e]=[],B.push(e)),A=W(f,d),q=q||A,L=c(T,f,d),L=y(L)?L:"",U=F?F(t,N):k?G[C]:C,F&&(j[U]=f),r.push({id:U,label:L,selected:A}));for(b||(w||null===I?V[""].unshift({id:"",label:"",selected:!q}):q||V[""].unshift({id:"?",label:"",selected:!0})),E=0,g=B.length;g>E;E++){for(e=B[E],r=V[e],D.length<=E?(i={element:M.clone().attr("label",e),label:r.label},l=[i],D.push(l),s.append(i.element)):(l=D[E],i=l[0],i.label!=e&&i.element.attr("label",i.label=e)),$=null,C=0,x=r.length;x>C;C++)n=r[C],(h=l[C+1])?($=h.element,h.label!==n.label&&(v(H,h.label,!1),v(H,n.label,!0),$.text(h.label=n.label),$.prop("label",h.label)),h.id!==n.id&&$.val(h.id=n.id),$[0].selected!==n.selected&&($.prop("selected",h.selected=n.selected),ei&&$.prop("selected",h.selected))):(""===n.id&&w?R=w:(R=S.clone()).val(n.id).prop("selected",n.selected).attr("selected",n.selected).prop("label",n.label).text(n.label),l.push(h={element:R,label:n.label,id:n.id,selected:n.selected}),v(H,n.label,!0),$?$.after(R):i.element.append(R),$=R);for(C++;l.length>C;)n=l.pop(),v(H,n.label,!1),n.element.remove()}for(;D.length>E;){for(r=D.pop(),C=1;C<r.length;++C)v(H,r[C].label,!1);r[0].element.remove()}o(H,function(e,t){e>0?m.addOption(t):0>e&&m.removeOption(t)})}var E;if(!(E=x.match(i)))throw Na("iexp","Expected expression in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '{0}'. Element: {1}",x,H(s));var T=n(E[2]||E[1]),C=E[4]||E[6],A=/ as /.test(E[0])&&E[1],$=A?n(A):null,k=E[5],P=n(E[3]||""),R=n(E[2]?E[1]:C),O=n(E[7]),L=E[8],F=L?n(E[8]):null,j={},D=[[{element:s,label:""}]],N={};w&&(e(w)(t),w.removeClass("ng-scope"),w.remove()),s.empty(),s.on("change",l),u.$render=g,t.$watchCollection(O,d),t.$watchCollection(f,d),b&&t.$watchCollection(function(){return u.$modelValue},d)}if(l[1]){for(var d,m=l[0],v=l[1],b=c.multiple,x=c.ngOptions,w=!1,_=!1,S=ti(t.createElement("option")),M=ti(t.createElement("optgroup")),E=S.clone(),T=0,C=u.children(),A=C.length;A>T;T++)if(""===C[T].value){d=w=C.eq(T);break}m.init(v,w,E),b&&(v.$isEmpty=function(e){return!e||0===e.length}),x?p(s,u,v):b?f(s,u,v):h(s,u,v,m)}}}}],Ba=["$interpolate",function(e){var t={addOption:d,removeOption:d};return{restrict:"E",priority:100,compile:function(r,n){if(g(n.value)){var i=e(r.text(),!0);i||n.$set("value",r.text())}return function(e,r,n){var o="$selectController",a=r.parent(),s=a.data(o)||a.parent().data(o);s&&s.databound||(s=t),i?e.$watch(i,function(e,t){n.$set("value",e),t!==e&&s.removeOption(t),s.addOption(e,r)}):s.addOption(n.value,r),r.on("$destroy",function(){s.removeOption(n.value)})}}}}],Ia=v({restrict:"E",terminal:!1}),za=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,r,n){n&&(r.required=!0,n.$validators.required=function(e,t){return!r.required||!n.$isEmpty(t)},r.$observe("required",function(){n.$validate()}))}}},Ga=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,i,o){if(o){var a,s=i.ngPattern||i.pattern;i.$observe("pattern",function(e){if(x(e)&&e.length>0&&(e=new RegExp("^"+e+"$")),e&&!e.test)throw n("ngPattern")("noregexp","Expected {0} to be a RegExp but was {1}. Element: {2}",s,e,H(t));a=e||r,o.$validate()}),o.$validators.pattern=function(e){return o.$isEmpty(e)||g(a)||a.test(e)}}}}},Ha=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,r,n){if(n){var i=-1;r.$observe("maxlength",function(e){var t=f(e);i=isNaN(t)?-1:t,n.$validate()}),n.$validators.maxlength=function(e,t){return 0>i||n.$isEmpty(t)||t.length<=i}}}}},Wa=function(){return{restrict:"A",require:"?ngModel",link:function(e,t,r,n){if(n){var i=0;r.$observe("minlength",function(e){i=f(e)||0,n.$validate()}),n.$validators.minlength=function(e,t){return n.$isEmpty(t)||t.length>=i}}}}};return e.angular.bootstrap?void console.log("WARNING: Tried to load angular more than once."):(nt(),pt(ci),void ti(t).ready(function(){Z(t,J)}))}(window,document),!window.angular.$$csp()&&window.angular.element(document).find("head").prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}</style>')},{}],2:[function(e,t,r){r.endianness=function(){return"LE"},r.hostname=function(){return"undefined"!=typeof location?location.hostname:""},r.loadavg=function(){return[]},r.uptime=function(){return 0},r.freemem=function(){return Number.MAX_VALUE},r.totalmem=function(){return Number.MAX_VALUE},r.cpus=function(){return[]},r.type=function(){return"Browser"},r.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},r.networkInterfaces=r.getNetworkInterfaces=function(){return{}},r.arch=function(){return"javascript"},r.platform=function(){return"browser"},r.tmpdir=r.tmpDir=function(){return"/tmp"},r.EOL="\n"},{}],3:[function(e,t,r){(function(e){function t(e,t){for(var r=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n<e.length;n++)t(e[n],n,e)&&r.push(e[n]);return r}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(e){return i.exec(e).slice(1)};r.resolve=function(){for(var r="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a=o>=0?arguments[o]:e.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(r=a+"/"+r,i="/"===a.charAt(0))}return r=t(n(r.split("/"),function(e){return!!e}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(e){var i=r.isAbsolute(e),o="/"===a(e,-1);return e=t(n(e.split("/"),function(e){return!!e}),!i).join("/"),e||i||(e="."),e&&o&&(e+="/"),(i?"/":"")+e},r.isAbsolute=function(e){return"/"===e.charAt(0)},r.join=function(){var e=Array.prototype.slice.call(arguments,0);return r.normalize(n(e,function(e){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},r.relative=function(e,t){function n(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=r.resolve(e).substr(1),t=r.resolve(t).substr(1);for(var i=n(e.split("/")),o=n(t.split("/")),a=Math.min(i.length,o.length),s=a,u=0;a>u;u++)if(i[u]!==o[u]){s=u;break}for(var c=[],u=s;u<i.length;u++)c.push("..");return c=c.concat(o.slice(s)),c.join("/")},r.sep="/",r.delimiter=":",r.dirname=function(e){var t=o(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},r.basename=function(e,t){var r=o(e)[2];return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},r.extname=function(e){return o(e)[3]};var a="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return 0>t&&(t=e.length+t),e.substr(t,r)}}).call(this,e("_process"))},{_process:4}],4:[function(e,t){function r(){if(!a){a=!0;for(var e,t=o.length;t;){e=o,o=[];for(var r=-1;++r<t;)e[r]();t=o.length}a=!1}}function n(){}var i=t.exports={},o=[],a=!1;i.nextTick=function(e){o.push(e),a||setTimeout(r,0)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=n,i.addListener=n,i.once=n,i.off=n,i.removeListener=n,i.removeAllListeners=n,i.emit=n,i.binding=function(){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],5:[function(e,t){"use strict";var r,n=(r=e("../cloud/cloud"),r&&r.__esModule&&r||{"default":r})["default"];t.exports=function(e,t,r){return n(e,t,r).destroy()}},{"../cloud/cloud":9}],6:[function(e,t){"use strict";var r,n,i=(r=e("./launch"),r&&r.__esModule&&r||{"default":r})["default"],o=(n=e("./destroy"),n&&n.__esModule&&n||{"default":n})["default"];t.exports=function(e,t,r,n,a){return{providers:e,proxies:a,launch:function(t,o){return i(t,e,o||r,n,a)},destroy:function(t,n){return o(t,e,n||r)}}}},{"./destroy":5,"./launch":7}],7:[function(e,t){"use strict";var r,n=(r=e("../cloud/cloud"),r&&r.__esModule&&r||{"default":r})["default"];t.exports=function(e,t,r,i,o){return n(e,t,r,i,o).launch()}},{"../cloud/cloud":9}],8:[function(e,t){"use strict";t.exports=function(e,t){function r(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return o({type:t,start:e,args:r})}function n(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return o({type:t,ok:e,args:r})}function i(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return o({type:t,bad:e,args:r})}var o=function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.apply(void 0,$traceurRuntime.spread(t)),t}}(e);return{log:o,start:r,ok:n,bad:i}}},{}],9:[function(e,t){"use strict";var r,n,i,o,a,s,u=(r=e("./expand"),r&&r.__esModule&&r||{"default":r})["default"],c=(n=e("./validate"),n&&n.__esModule&&n||{"default":n})["default"],l=(i=e("./generatePlan"),i&&i.__esModule&&i||{"default":i})["default"],h=(o=e("./executePlan"),o&&o.__esModule&&o||{"default":o})["default"],f=(a=e("./destroy"),a&&a.__esModule&&a||{"default":a})["default"],p=((s=e("lodash"),s&&s.__esModule&&s||{"default":s})["default"],"https://registry.hub.docker.com"),d="https://discovery.etcd.io";t.exports=function(e,t,r,n,i){function o(){return u(e).then(function(e){return c(e,t,r,n,i.dockerHubApiRoot||p)}).then(function(e){return l(e,t,r,n,i.discoveryEtcdApiRoot||d)}).then(function(e){return h(e,t,r)}).then(function(e){return e})}function a(){return f(e,t,r)}return{launch:o,destroy:a}}},{"./destroy":10,"./executePlan":11,"./expand":12,"./generatePlan":13,"./validate":14,lodash:"lodash"}],10:[function(e,t){"use strict";var r,n,i,o=(r=e("./buildLog"),r&&r.__esModule&&r||{"default":r})["default"],a=(n=e("lodash"),n&&n.__esModule&&n||{"default":n})["default"],s=(i=e("generator-trees"),i&&i.__esModule&&i||{"default":i})["default"],u=s,c=u.g,l=u.p;t.exports=function(e,t,r){function n(e){h("Cloud",{cloud:e});var t=a.groupBy(m,function(e){return e.provider}),r=Promise.all(a.map(t,i)).then(function(){return f("Cloud",{cloud:e}),e});return r["catch"](function(e){p("Cloud",{error:e})}),r}function i(e,r){return new Promise(function(n,i){var o=t[r];l.async(o.api.MAX_CONCURRENT_CALLS,c.map(c.interleave(c.map(c.toGenerator(e),function(e){return c.toGenerator(a.map(e.machines,function(e){return e}))})),function(e){return new Promise(function(t,r){h("Machine",{machine:e}),o.api.destroyMachine(e).then(function(r){f("Machine",{machine:e,response:r}),t(e)},function(t){return r(p("Machine",{machine:e,error:t}))})})}),function(e,t){u("destroyed",e,t)}).then(function(e){n(e)},function(e){return i(p("Cloud",{providerName:r,error:e}))})})}var s=o(r,"Destroy"),u=s.log,h=s.start,f=s.ok,p=s.bad,d=e,m=(d.id,d.clusters);return n(e)}},{"./buildLog":8,"generator-trees":19,lodash:"lodash"}],11:[function(e,t){"use strict";function r(e,t){return e.replace(/^/gm,t)}var n,i,o,a,s=(n=e("./buildLog"),n&&n.__esModule&&n||{"default":n})["default"],u=(i=e("../templates"),i&&i.__esModule&&i||{"default":i})["default"],c=(o=e("lodash"),o&&o.__esModule&&o||{"default":o})["default"],l=(a=e("generator-trees"),a&&a.__esModule&&a||{"default":a})["default"],h=l,f=h.g,p=h.p;t.exports=function(e,t,n){function i(){return new Promise(function(t,r){v("Plan");var n=c.groupBy(e.clusters,function(e){return e.providerName}),i=Promise.all(c.map(n,o)).then(function(e){var r=c.reduce(e,function(e,t){return c.each(t,function(t,r){e[r]=t,t.machineCount=c.keys(t.machines).length}),e},{}),n={id:x,clusters:r,clusterCount:c.keys(r).length,definition:w};g("Plan",{cloud:n}),t(n)});return i["catch"](function(e){r(y("Plan",{error:e}))}),i})}function o(e,r){return new Promise(function(n,i){var o=t[r],s=c.reduce(e,function(e,t){var n=t,i=n.id,o=n.location,a=n.discoveryURL;return e[i]={id:i,discoveryURL:a,location:o,machines:{},provider:r},e},{});v("Provider",{providerName:r}),p.async(o.api.MAX_CONCURRENT_CALLS,f.map(f.interleave(f.map(f.toGenerator(e),function(e){return e.machineGenerator()})),function(e){return new Promise(function(t,r){var n=e,i=n.id,s=n.roleName,l=n.cluster,h=n.generatedAt,f=l,p=f.id,d=f.location,m=f.providerName,b=f.discoveryURL,x="512mb",_="coreos-stable",S=a(i,s),M=c.map({id:i,clusterID:p,provider:m,location:d,size:x,image:_,roleName:s,generatedAt:h},function(e,t){return t+"="+e}).join(","),E=u.cloudConfig.render({discoveryURL:b,metadata:M,files:S}),T={id:i,clusterID:p,provider:m,location:d,size:x,image:_,roleName:s,keys:w.authorizations,generatedAt:h,userData:E};v("Machine",{machine:T}),o.api.createMachine(T).then(function(r){T.response=r,T.providerData=r,g("Machine",{machine:T,machineDef:e}),t(T)},function(t){return r(y("Machine",{machine:T,machineDef:e,error:t}))})})}),function(e){s[e.clusterID].machines[e.id]=c.pick(e,["size","image","roleName","generatedAt","response","id","providerData"])}).then(function(){g("Provider",{providerName:r}),n(s)},function(e){return i(y("Provider",{providerName:r,error:e}))})})}function a(e,t){var n=w.roles[t],i={path:"/home/core/bootstrap.sh",owner:"core",permissions:"0700",content:r(u.bootstrap.render({services:c.map(n,function(t){var r=c.contains(w.roles.$all||[],t);return t+=r?"":"@",{fileName:t+".service",name:""+t+(r?"":e)}})})," ")},o={path:"/home/core/util.sh",owner:"core",permissiosn:"0700",content:r(u.util_sh," ")};return[i,o].concat(c.map(n,function(e){return l(t,e)}))}function l(e,t){var n=c.contains(w.roles.$all||[],t),i=n?u.containerService:u["container@Service"],o=t+(n?"":"@"),a=w.containers[t]||{},s=h(a);"cadvisor"!==t||s||(s="-v /:/rootfs:ro -v /var/run:/var/run:rw -v /sys:/sys:ro -v /var/lib/docker:/var/lib/docker:ro -p 8080:8080"),t=d(t);var l={name:t,content:i.render({serviceName:o,containerName:t,statsContainerName:t.replace("/","_"),roleName:e,options:s,isGlobal:n})};return{path:"/home/core/"+o+".service",owner:"core",permissions:"0600",content:r(l.content," ")}}function h(e){if(e.options)return e.options;var t=e,r=t.environment,n=t.ports,i=t.volumes;return c.compact([c.map(r,function(e,t){return"-e "+t+"="+e}).join(" "),c.map(n,function(e,t){return"-p "+t+(e===!0?"":":"+e)}).join(" "),c.map(i,function(e,t){return"-v "+t+(e===!0?"":":"+e)}).join(" ")]).join(" ")}function d(e){if("cadvisor"===e)return"google/cadvisor";if(!w.containers)return e;var t=w.containers[e];return t?t.container||e:e}{var m=s(n,"Execute"),v=(m.log,m.start),g=m.ok,y=m.bad,b=e,x=b.cloudID,w=b.definition;b.clusters}return i()}},{"../templates":16,"./buildLog":8,"generator-trees":19,lodash:"lodash"}],12:[function(e,t){"use strict";var r,n=(r=e("lodash"),r&&r.__esModule&&r||{"default":r})["default"];t.exports=function(e){return new Promise(function(t){function r(e,t){n.each(e,function(e,n){"number"==typeof e?t[n]||(t[n]=[n]):r(e,t)})}function i(e){var t=e.$all;t&&t.length>0&&n.each(e,function(e,r){"$all"!==r&&n.each(t,function(t){n.contains(e,t)||e.unshift(t)})})}function o(e,t){n.each(e,function(e,r){if("$all"!==r){if(!Array.isArray(e))throw new Error("What is this role:? "+r);n.each(e,function(e){t[e]||(t[e]={container:e})})}})}var a=e,s=a.configuration,u=a.roles,c=a.containers;r(s,u),i(u),o(u,c),t(e)})}},{lodash:"lodash"}],13:[function(e,t){"use strict";var r,n,i,o,a=(r=e("lodash"),r&&r.__esModule&&r||{"default":r})["default"],s=(n=e("uuid"),n&&n.__esModule&&n||{"default":n})["default"],u=(i=e("./buildLog"),i&&i.__esModule&&i||{"default":i})["default"],c=(o=e("generator-trees"),o&&o.__esModule&&o||{"default":o})["default"],l=c,h=l.g,f=l.p,p=5;t.exports=function(e,t,r,n,i){function o(){return new Promise(function(t){var r={cloudID:s.v4(),definition:e};t(r)})}function c(e){return new Promise(function(t,r){function o(t){return new Promise(function(r,o){g("Cluster",{cluster:t}),n(i+"/new",function(n,i,a){return n?(o(b("Cluster",{error:n,cluster:t})),!1):(t.discoveryURL=a,t.machineGenerator=l(t),y("Cluster",{cluster:t}),void r(e))})})}var u=a.flatten(a.map(w,function(e,t){return a.map(e,function(e){return{id:s.v4(),providerName:t,location:e,machineCount:a.reduce(_,function(e,t){return e+t},0)}})})),c=a.reduce(u,function(e,t){return e[t.id]=t,e},{}),d=a.reduce(c,function(e,t){return e+t.machineCount},0);v({type:"Machines",args:[{machineCount:d}]}),g("Clusters",{clusters:c}),f.async(p,h.map(h.toGenerator(u),o),function(){}).then(function(){e.clusters=c,y("Clusters",{clusters:c}),t(e)},r)})}function l(e){return function(){return h.interleave(h.map(h.toGenerator(a.map(_,function(e,t){return[t,e]})),function(t){var r,n,i=t,o=(r=i[$traceurRuntime.toProperty(Symbol.iterator)](),(n=r.next()).done?void 0:n.value),a=(n=r.next()).done?void 0:n.value;if("number"==typeof a)return h.take($traceurRuntime.initGeneratorFunction(function s(){return $traceurRuntime.createGeneratorInstance(function(t){for(;;)switch(t.state){case 0:t.state=1;break;case 1:return t.state=2,d(e,o);case 2:t.maybeThrow(),t.state=0;break;default:return t.end()}},s,this)})(),a);throw new Error("Can't handle non-number role values yet!")}))}}function d(e,t){return{id:s.v4(),roleName:t,cluster:e,generatedAt:new Date}}var m=u(r,"Generate"),v=m.log,g=m.start,y=m.ok,b=m.bad,x=e,w=x.locations,_=x.configuration;g("Plan");var S=o().then(c).then(function(e){return y("Plan",{plan:e}),e});return S["catch"](function(e){return b("Plan",{error:e})}),S}},{"./buildLog":8,"generator-trees":19,lodash:"lodash",uuid:29}],14:[function(e,t){"use strict";var r,n,i=(r=e("./buildLog"),r&&r.__esModule&&r||{"default":r})["default"],o=(n=e("lodash"),n&&n.__esModule&&n||{"default":n})["default"];t.exports=function(e,t,r,n,a){function s(){return new Promise(function(t){e.domain&&(g("Domain"),y("Domain")),t()})}function u(){return new Promise(function(t){e.root&&(g("Root"),y("Root")),t()})}function c(){return new Promise(function(t){e.authorizations&&(g("Authorizations"),y("Authorizations")),t()})}function l(){return new Promise(function(e,r){g("Locations");var n=o.filter(o.keys(w),function(e){return!t[e]});if(n.length>0)return r(b("Locations",{invalidProviders:n}));var i=o.pick(o.mapValues(w,function(e,r){var n=t[r];return o.filter(e,function(e){return!n.profile.locations[e]})}),function(e){return e.length>0});if(o.keys(i).length>0)return r(b("Locations",{invalidLocations:i}));var a=0,s=o.reduce(w,function(e,r,n){t[n];return r.length&&a++,e+r.length},0);return isNaN(s)||0===s?r(b("Locations",{status:"No locations selected!"})):(y("Locations",{status:"Will Launch on "+a+" Provider"+(a>1?"s":"")+" in "+s+" Location"+(s>1?"s":"")+"!"}),void e())})}function h(){return new Promise(function(r,n){function i(e){var t=e,r=t.credentialSchema,n=t.credentials,i=[];return o.each(r,function(e,t){var r=n[t];(void 0===r||null===r||0===r.length)&&i.push(t)}),i}g("Credentials");var a=o.map(o.pick(e.locations,function(e){return e.length>0}),function(e,r){return t[r]}),s={};return o.each(a,function(e){var t=i(e);t.length>0&&(s[e.name]=t)}),o.keys(s).length>0?n(b("Credentials",{missing:s})):void Promise.all(o.map(a,function(e){return e.api.verifyAccount()})).then(function(){y("Credentials"),r()})["catch"](function(e){var t=e,r=t.error,i=t.data,o=(t.response,t.provider);n(b("Credentials",{error:r,data:i,provider:o}))})})}function f(){function e(e){return new Promise(function(r,i){g("Container",{containerName:e});var o=e.match(/([^\/]*)(?:\/([^:]*))?(?::(\w*))?/);if(!o)return void i(b("Container",{containerName:e,message:"Could not parse"}));var s=o[1],u=o[2],c=o[3]||"latest",l=s+(u?"/"+u:""),h=a+"/v1/repositories/"+l+"/tags/"+c;t[h]=n(h,function(n,o){if(delete t[h],n)i({type:"HubConnection",message:"Could not connect!",error:n});else{var a=o.statusCode;200===a?(y("Container",{containerName:e,tag:c}),r()):i(404===a?b("Container",{containerName:e,tag:c,message:"Does not exist!"}):b("Container",{containerName:e,tag:c,statusCode:a}))}})})}g("Containers");var t={},r=Promise.all(o.map(_,function(t,r){return e(t.container||r)}));return r["catch"](function(){v("validateContainers failed"),o.each(t,function(e,t){v("Aborting",t),e.abort()}),b("Containers")}),r.then(function(e){return y("Containers"),e})}function p(){return new Promise(function(e){e()})}function d(){return new Promise(function(e){g("Configuration"),y("Configuration"),e()})}var m=i(r,"Validate"),v=m.log,g=m.start,y=m.ok,b=m.bad;g("Cloud Description");var x=e,w=(x.domain,x.root,x.authorizations,x.locations),_=(x.configuration,x.roles,x.containers),S=s(e).then(u).then(c).then(l).then(h).then(f).then(p).then(d).then(function(){return y("Cloud Description"),e});return S["catch"](function(e){return b("Cloud Description",{error:e})}),S}},{"./buildLog":8,lodash:"lodash"}],15:[function(e,t){"use strict";{var r,n,i=(r=e("./api"),r&&r.__esModule&&r||{"default":r})["default"];(n=e("./traceur-runtime"),n&&n.__esModule&&n||{"default":n})["default"]}t.exports=function(e){var t=e,r=t.providers,n=t.providerConfigs,o=t.log,a=t.request,s=t.proxies;return i(r,n,o,a,s)}},{"./api":6,"./traceur-runtime":17}],16:[function(e,t){"use strict";var r=e("hogan.js");t.exports={bootstrap:r.compile('#!/bin/bash\n\n#DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"\n\ncd /home/core\n\n(\n if free | awk \'/^Swap:/ {exit !$2}\'; then\n echo "Have swap"\n else\n SWAPSIZE=4G\n SWAPFILE=/${SWAPSIZE}iB.swap\n sudo /usr/bin/fallocate -l ${SWAPSIZE} ${SWAPFILE};\n sudo /usr/bin/chmod 600 ${SWAPFILE};\n sudo /usr/bin/chattr +C ${SWAPFILE};\n sudo /usr/sbin/mkswap ${SWAPFILE};\n sudo /usr/sbin/losetup -f ${SWAPFILE};\n sudo /usr/sbin/swapon $(/usr/sbin/losetup -j ${SWAPFILE} | /usr/bin/cut -d : -f 1);\n fi\n) &\n\nsource util.sh\n\nsetEtcd /machines/$(hostname)/stats/on $(TIME="@$(grep btime /proc/stat | cut -d \' \' -f2)" && date --date=$TIME -Is)\nsetEtcd /machines/$(hostname)/stats/joindate $(date -Is)\n#until etcdctl set /machines/$(hostname)/"$(date)" 1; do echo \'etcd not ready...sleeping\' && sleep 1; done\n\nwaitForFleet\n\n{{#services}}\nfleetSubmit {{fileName}}\n{{/services}}\n\n{{#services}}\nfleetStart {{name}}\n{{/services}}'.toString()),cloudConfig:r.compile("#cloud-config\n\ncoreos:\n etcd:\n discovery: {{discoveryURL}}\n addr: $public_ipv4:4001\n peer-addr: $public_ipv4:7001\n fleet:\n public-ip: $public_ipv4\n metadata: {{metadata}}\n\n{{#hasAuthorizedKeys}}\n ssh_authorized_keys:\n {{#keys}}\n - ssh-rsa {{key}}\n {{/keys}}\n{{/hasAuthorizedKeys}}\n\n units:\n - name: etcd.service\n command: start\n\n - name: fleet.socket\n command: start\n content: |\n [Socket]\n ListenStream=/var/run/fleet.socket\n Service=fleet.service\n\n [Install]\n WantedBy=sockets.target\n\n - name: fleet.service\n command: start\n\n - name: docker.service\n command: start\n\n - name: bootstrap.service\n command: start\n content: |\n [Unit]\n Description=bootstraps us\n\n Requires=etcd.service\n Requires=fleet.socket\n Requires=fleet.service\n Requires=docker.service\n\n After=etcd.service\n After=fleet.socket\n After=fleet.service\n After=docker.service\n\n [Service]\n ExecStart=/home/core/bootstrap.sh\n\nwrite_files:\n{{#files}}\n - path: {{path}}\n owner: {{owner}}\n permissions: {{permissions}}\n content: |\n{{{content}}}\n{{/files}}".toString()),containerService:r.compile('[Unit]\nDescription={{serviceName}}\n\nAfter=etcd.service\nAfter=fleet.service\nAfter=docker.service\n\n[Service]\nTimeoutStartSec=0\nRestart=always\nExecStartPre=-/usr/bin/docker kill %p\nExecStartPre=-/usr/bin/docker rm %p\nExecStartPre=/bin/sh -c "until etcdctl set /machines/$(hostname)/stats/{{statsContainerName}}Pull $(date -Is); do sleep 1; done && /usr/bin/docker pull {{containerName}} && until etcdctl set /machines/$(hostname)/stats/{{statsContainerName}}Pulled $(date -Is); do sleep 1; done"\nExecStart=/usr/bin/docker run --name=%p --rm {{options}} {{containerName}}\nExecStop=/usr/bin/docker stop %p\n\n[X-Fleet]\n{{^isGlobal}}\nMachineMetadata=roleName={{roleName}}\n{{/isGlobal}}\n{{#isGlobal}}\nGlobal=true\n{{/isGlobal}}'.toString()),"container@Service":r.compile('[Unit]\nDescription={{serviceName}}%i\n\nAfter=etcd.service\nAfter=fleet.service\nAfter=docker.service\n\n[Service]\nTimeoutStartSec=0\nRestart=always\nExecStartPre=-/usr/bin/docker kill %p.%i\nExecStartPre=-/usr/bin/docker rm %p.%i\nExecStartPre=/bin/sh -c "until etcdctl set /machines/$(hostname)/stats/{{statsContainerName}}Pull $(date -Is); do sleep 1; done && /usr/bin/docker pull {{containerName}} && until etcdctl set /machines/$(hostname)/stats/{{statsContainerName}}Pulled $(date -Is); do sleep 1; done"\nExecStart=/usr/bin/docker run --name=%p.%i --rm {{options}} {{containerName}}\nExecStop=/usr/bin/docker stop %p.%i\n\n[X-Fleet]\nMachineMetadata=roleName={{roleName}}\n{{#isGlobal}}\nGlobal=true\n{{/isGlobal}}'.toString()),util_sh:"#!/bin/bash\n\nfunction setEtcd() {\n until etcdctl set $1 $2; do echo 'etcd not ready...sleeping' && sleep 1; done\n}\n\nfunction waitForFleet() {\n until fleetctl list-units; do echo 'fleet not ready...sleeping' && sleep 1; done\n}\n\nfunction fleetSubmit() {\n until fleetctl submit $1; do echo 'fleetctl not ready...sleeping' && sleep 1; done\n}\n\nfunction fleetStart() {\n until fleetctl start $1; do echo 'fleectl not ready...sleeping' && sleep 1; done\n}\n".toString()}},{"hogan.js":26}],17:[function(e){(function(t,r){!function(e){"use strict";function t(e,t,r){for(var n=[t],i=0;i<r.length;i++)n[i+1]=r[i];var o=T(Function.prototype.bind,e,n);return o}function r(e,r){var n=new(t(e,null,r));return n}function n(){return"__$"+Math.floor(1e9*Math.random())+"$"+ ++C+"$__"}function i(e){return A[e]}function o(){var e=n();return A[e]=!0,e}function a(e,t,r){return[$,e,t,r]}function s(e){return e&&e[0]===$}function u(){k=o(),Function.prototype.call=c(function(){var e=h(function(e){for(var t=[],r=1;r<arguments.length;++r)t[r-1]=arguments[r];var n=a(this,e,t);return n},this,arguments);return e}),Function.prototype.apply=c(function(){var e=h(function(e,t){var r=a(this,e,t);return r},this,arguments);return e})}function c(e){return null===k&&u(),e[k]=!0,e}function l(e){return!!e[k]}function h(e,t,r){var n=r[0];if(s(n))return n=T(e,t,n[3]);for(n=a(e,t,r);;){if(n=l(e)?T(e,n[2],[n]):T(e,n[2],n[3]),!s(n))return n;e=n[1]}}function f(){var e;return e=l(this)?r(this,[a(null,null,arguments)]):r(this,arguments)}if(!e.$traceurRuntime){var p=Object,d=TypeError,m=p.create,v=p.defineProperties,g=p.defineProperty,y=p.freeze,b=p.getOwnPropertyDescriptor,x=p.getOwnPropertyNames,w=p.keys,_=p.prototype.hasOwnProperty,S=(p.prototype.toString,Object.preventExtensions),M=Object.seal,E=Object.isExtensible,T=Function.prototype.call.bind(Function.prototype.apply),C=0,A=m(null),$=Object.create(null),k=null;!function(){function t(e){return{configurable:!0,enumerable:!1,value:e,writable:!0}}function r(e){return"object"==typeof e&&e instanceof l}function s(e){return r(e)?"symbol":typeof e}function u(e){var t=new l(e);if(!(this instanceof u))return t;throw new TypeError("Symbol cannot be new'ed")}function l(e){var t=n();g(this,Q,{value:this}),g(this,Y,{value:t}),g(this,K,{value:e}),C(this),Z[t]=this}function T(e){var t=e[J];return t&&t.self===e?t:E(e)?(tt.hash.value=rt++,tt.self.value=e,et.value=m(null,tt),g(e,J,et),et.value):void 0}function C(e){return T(e),y.apply(this,arguments)}function $(e){return T(e),S.apply(this,arguments)}function k(e){return T(e),M.apply(this,arguments)}function P(e){return Z[e]||A[e]}function R(e){return r(e)?e[Y]:e}function O(e){for(var t=[],r=0;r<e.length;r++)P(e[r])||t.push(e[r]);return t}function L(e){return O(x(e))}function F(e){return O(w(e))}function j(e){for(var t=[],r=x(e),n=0;n<r.length;n++){var i=Z[r[n]];i&&t.push(i)}return t}function D(e,t){return b(e,R(t))}function N(e){return _.call(this,R(e))}function U(t){return e.$traceurRuntime.options[t]}function V(e,t,n){return r(t)&&(t=t[Y]),g(e,t,n),e}function B(e){g(e,"defineProperty",{value:V}),g(e,"getOwnPropertyNames",{value:L}),g(e,"getOwnPropertyDescriptor",{value:D}),g(e.prototype,"hasOwnProperty",{value:N}),g(e,"freeze",{value:C}),g(e,"preventExtensions",{value:$}),g(e,"seal",{value:k}),g(e,"keys",{value:F})}function I(e){for(var t=1;t<arguments.length;t++)for(var r=x(arguments[t]),n=0;n<r.length;n++){var i=r[n];P(i)||!function(t,r){g(e,r,{get:function(){return t[r]},enumerable:!0})}(arguments[t],r[n])}return e}function z(e){return null!=e&&("object"==typeof e||"function"==typeof e)}function G(e){if(null==e)throw d();return p(e)}function H(e){if(null==e)throw new TypeError("Value cannot be converted to an Object");return e}function W(e,t){e.Symbol||(e.Symbol=t,Object.getOwnPropertySymbols=j),e.Symbol.iterator||(e.Symbol.iterator=t("Symbol.iterator")),e.Symbol.observer||(e.Symbol.observer=t("Symbol.observer"))}function q(e){W(e,u),e.Reflect=e.Reflect||{},e.Reflect.global=e.Reflect.global||e,B(e.Object)}var X=t,Y=n(),K=n(),Q=n(),Z=m(null);g(u.prototype,"constructor",t(u)),g(u.prototype,"toString",X(function(){var e=this[Q];return e[Y]})),g(u.prototype,"valueOf",X(function(){var e=this[Q];if(!e)throw TypeError("Conversion from symbol to string");return U("symbols")?e:e[Y]})),g(l.prototype,"constructor",t(u)),g(l.prototype,"toString",{value:u.prototype.toString,enumerable:!1}),g(l.prototype,"valueOf",{value:u.prototype.valueOf,enumerable:!1});var J=o(),et={value:void 0},tt={hash:{value:void 0},self:{value:void 0}},rt=0;C(l.prototype),q(e),e.$traceurRuntime={call:h,checkObjectCoercible:H,construct:f,continuation:a,createPrivateName:o,defineProperties:v,defineProperty:g,exportStar:I,getOwnHashObject:T,getOwnPropertyDescriptor:b,getOwnPropertyNames:x,initTailRecursiveFunction:c,isObject:z,isPrivateName:i,isSymbolString:P,keys:w,options:{},setupGlobals:q,toObject:G,toProperty:R,"typeof":s}}()}}("undefined"!=typeof window?window:"undefined"!=typeof r?r:"undefined"!=typeof self?self:this),function(){function e(e,t,r,n,i,o,a){var s=[];return e&&s.push(e,":"),r&&(s.push("//"),t&&s.push(t,"@"),s.push(r),n&&s.push(":",n)),i&&s.push(i),o&&s.push("?",o),a&&s.push("#",a),s.join("")}function t(e){return e.match(s)}function r(e){if("/"===e)return"/";for(var t="/"===e[0]?"/":"",r="/"===e.slice(-1)?"/":"",n=e.split("/"),i=[],o=0,a=0;a<n.length;a++){var s=n[a];switch(s){case"":case".":break;case"..":i.length?i.pop():o++;break;default:i.push(s)}}if(!t){for(;o-->0;)i.unshift("..");0===i.length&&i.push(".")}return t+i.join("/")+r}function n(t){var n=t[u.PATH]||"";return n=r(n),t[u.PATH]=n,e(t[u.SCHEME],t[u.USER_INFO],t[u.DOMAIN],t[u.PORT],t[u.PATH],t[u.QUERY_DATA],t[u.FRAGMENT])}function i(e){var r=t(e);return n(r)}function o(e,r){var i=t(r),o=t(e);if(i[u.SCHEME])return n(i);i[u.SCHEME]=o[u.SCHEME];for(var a=u.SCHEME;a<=u.PORT;a++)i[a]||(i[a]=o[a]);if("/"==i[u.PATH][0])return n(i);var s=o[u.PATH],c=s.lastIndexOf("/");return s=s.slice(0,c+1)+i[u.PATH],i[u.PATH]=s,n(i)}function a(e){if(!e)return!1;if("/"===e[0])return!0;var r=t(e);return r[u.SCHEME]?!0:!1}var s=new RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([\\w\\d\\-\\u0100-\\uffff.%]*)(?::([0-9]+))?)?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$"),u={SCHEME:1,USER_INFO:2,DOMAIN:3,PORT:4,PATH:5,QUERY_DATA:6,FRAGMENT:7};
$traceurRuntime.canonicalizeUrl=i,$traceurRuntime.isAbsolute=a,$traceurRuntime.removeDotSegments=r,$traceurRuntime.resolveUrl=o}(),function(e){"use strict";function t(e,t){this.url=e,this.value_=t}function r(e,t){this.message=this.constructor.name+": "+this.stripCause(t)+" in "+e,this.stack=t instanceof r||!t.stack?"":this.stripStack(t.stack)}function n(e,t){var r=[],n=t-3;0>n&&(n=0);for(var i=n;t>i;i++)r.push(e[i]);return r}function i(e,t){var r=t+1;r>e.length-1&&(r=e.length-1);for(var n=[],i=t;r>=i;i++)n.push(e[i]);return n}function o(e){for(var t="",r=0;e-1>r;r++)t+="-";return t}function a(e,r){t.call(this,e,null),this.func=r}function s(e){if(e){var t=g.normalize(e);return d[t]}}function u(e){var t=arguments[1],r=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){var i,o;if(t===v){var a=Object.getOwnPropertyDescriptor(e,n);a.get&&(i=a.get)}i||(o=e[n],i=function(){return o}),Object.defineProperty(r,n,{get:i,enumerable:!0})}),Object.preventExtensions(r),r}var c,l=$traceurRuntime,h=l.canonicalizeUrl,f=l.resolveUrl,p=l.isAbsolute,d=Object.create(null);c=e.location&&e.location.href?f(e.location.href,"./"):"",r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.stripError=function(e){return e.replace(/.*Error:/,this.constructor.name+":")},r.prototype.stripCause=function(e){return e?e.message?this.stripError(e.message):e+"":""},r.prototype.loadedBy=function(e){this.stack+="\n loaded by "+e},r.prototype.stripStack=function(e){var t=[];return e.split("\n").some(function(e){return/UncoatedModuleInstantiator/.test(e)?!0:void t.push(e)}),t[0]=this.stripError(t[0]),t.join("\n")},a.prototype=Object.create(t.prototype),a.prototype.getUncoatedModule=function(){if(this.value_)return this.value_;try{var t;return void 0!==typeof $traceurRuntime&&$traceurRuntime.require&&(t=$traceurRuntime.require.bind(null,this.url)),this.value_=this.func.call(e,t)}catch(a){if(a instanceof r)throw a.loadedBy(this.url),a;if(a.stack){var s=this.func.toString().split("\n"),u=[];a.stack.split("\n").some(function(e){if(e.indexOf("UncoatedModuleInstantiator.getUncoatedModule")>0)return!0;var t=/(at\s[^\s]*\s).*>:(\d*):(\d*)\)/.exec(e);if(t){var r=parseInt(t[2],10);u=u.concat(n(s,r)),u.push(o(t[3])+"^"),u=u.concat(i(s,r)),u.push("= = = = = = = = =")}else u.push(e)}),a.stack=u.join("\n")}throw new r(this.url,a)}};var m=Object.create(null),v={},g={normalize:function(e,t){if("string"!=typeof e)throw new TypeError("module name must be a string, not "+typeof e);if(p(e))return h(e);if(/[^\.]\/\.\.\//.test(e))throw new Error("module name embeds /../: "+e);return"."===e[0]&&t?f(t,e):h(e)},get:function(e){var t=s(e);if(!t)return void 0;var r=m[t.url];return r?r:(r=u(t.getUncoatedModule(),v),m[t.url]=r)},set:function(e,t){e=String(e),d[e]=new a(e,function(){return t}),m[e]=t},get baseURL(){return c},set baseURL(e){c=String(e)},registerModule:function(e,t,r){var n=g.normalize(e);if(d[n])throw new Error("duplicate module named "+n);d[n]=new a(n,r)},bundleStore:Object.create(null),register:function(e,t,r){t&&(t.length||r.length)?this.bundleStore[e]={deps:t,execute:function(){var e=arguments,n={};t.forEach(function(t,r){return n[t]=e[r]});var i=r.call(this,n);return i.execute.call(this),i.exports}}:this.registerModule(e,t,r)},getAnonymousModule:function(t){return new u(t.call(e),v)},getForTesting:function(e){var t=this;return this.testingPrefix_||Object.keys(m).some(function(e){var r=/(traceur@[^\/]*\/)/.exec(e);return r?(t.testingPrefix_=r[1],!0):void 0}),this.get(this.testingPrefix_+e)}},y=new u({ModuleStore:g});g.set("@traceur/src/runtime/ModuleStore",y),g.set("@traceur/src/runtime/ModuleStore.js",y);var b=$traceurRuntime.setupGlobals;$traceurRuntime.setupGlobals=function(e){b(e)},$traceurRuntime.ModuleStore=g,e.System={register:g.register.bind(g),registerModule:g.registerModule.bind(g),get:g.get,set:g.set,normalize:g.normalize},$traceurRuntime.getModuleImpl=function(e){var t=s(e);return t&&t.getUncoatedModule()}}("undefined"!=typeof window?window:"undefined"!=typeof r?r:"undefined"!=typeof self?self:this),System.registerModule("[email protected]/src/runtime/async.js",[],function(){"use strict";function e(){}function t(){}function r(e){return e.prototype=c(t.prototype),e.__proto__=t,e}function n(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=c(t.prototype);return i[l]=this,i[h]=r,i[f]=e,i}function i(e,t){return new Promise(function(r,n){var i=e({next:function(e){return t.call(i,e)},"throw":function(e){n(e)},"return":function(e){r(e)}})})}function o(e){return Promise.resolve().then(e)}function a(e,t){return new v(e,t)}if("object"!=typeof $traceurRuntime)throw new Error("traceur runtime not found.");var s=$traceurRuntime.createPrivateName,u=$traceurRuntime.defineProperty,c=($traceurRuntime.defineProperties,Object.create),l=s(),h=s(),f=s();e.prototype=t,t.constructor=e,u(t,"constructor",{enumerable:!1});var p=function(e){var t=this;this.decoratedObserver=$traceurRuntime.createDecoratedGenerator(e,function(){t.done=!0}),this.done=!1,this.inReturn=!1};$traceurRuntime.createClass(p,{"throw":function(e){if(!this.inReturn)throw e},"yield":function(e){if(this.done)throw void(this.inReturn=!0);var t;try{t=this.decoratedObserver.next(e)}catch(r){throw this.done=!0,r}if(void 0!==t){if(t.done)throw this.done=!0,void(this.inReturn=!0);return t.value}},yieldFor:function(e){var t=this;return $traceurRuntime.observeForEach(e[$traceurRuntime.toProperty(Symbol.observer)].bind(e),function(e){if(t.done)return void this["return"]();var r;try{r=t.decoratedObserver.next(e)}catch(n){throw t.done=!0,n}if(void 0!==r)return r.done&&(t.done=!0),r})}},{}),t.prototype[Symbol.observer]=function(e){var t=this[f],r=new p(e);return $traceurRuntime.schedule(function(){return t(r)}).then(function(e){r.done||r.decoratedObserver["return"](e)})["catch"](function(e){r.done||r.decoratedObserver["throw"](e)}),r.decoratedObserver},u(t.prototype,Symbol.observer,{enumerable:!1});var d=Symbol(),m=Symbol(),v=function(e,t){this[d]=e,this[m]=t};return $traceurRuntime.createClass(v,{next:function(e){var t=this[d].next(e);return void 0!==t&&t.done&&this[m].call(this),t},"throw":function(e){return this[m].call(this),this[d]["throw"](e)},"return":function(e){return this[m].call(this),this[d]["return"](e)}},{}),$traceurRuntime.initAsyncGeneratorFunction=r,$traceurRuntime.createAsyncGeneratorInstance=n,$traceurRuntime.observeForEach=i,$traceurRuntime.schedule=o,$traceurRuntime.createDecoratedGenerator=a,{}}),System.registerModule("[email protected]/src/runtime/classes.js",[],function(){"use strict";function e(e,t){var r=p(e);do{var n=f(r,t);if(n)return n;r=p(r)}while(r);return void 0}function t(e){return e.__proto__}function r(t,r,n){var i=e(r,n);return i?i.get?i.get.call(t):i.value:void 0}function n(t,r,n,i){var o=e(r,n);if(o&&o.set)return o.set.call(t,i),i;throw u("super has no setter '"+n+"'.")}function i(e){for(var t={},r=m(e),n=0;n<r.length;n++){var i=r[n];t[i]=f(e,i)}for(var o=v(e),n=0;n<o.length;n++){var a=o[n];t[$traceurRuntime.toProperty(a)]=f(e,$traceurRuntime.toProperty(a))}return t}function o(e,t,r,n){return h(t,"constructor",{value:e,configurable:!0,enumerable:!1,writable:!0}),arguments.length>3?("function"==typeof n&&(e.__proto__=n),e.prototype=c(a(n),i(t))):e.prototype=t,h(e,"prototype",{configurable:!1,writable:!1}),l(e,i(r))}function a(e){if("function"==typeof e){var t=e.prototype;if(s(t)===t||null===t)return e.prototype;throw new u("super prototype must be an Object or null")}if(null===e)return null;throw new u("Super expression must either be null or a function, not "+typeof e+".")}var s=Object,u=TypeError,c=s.create,l=$traceurRuntime.defineProperties,h=$traceurRuntime.defineProperty,f=$traceurRuntime.getOwnPropertyDescriptor,p=($traceurRuntime.getOwnPropertyNames,Object.getPrototypeOf),d=Object,m=d.getOwnPropertyNames,v=d.getOwnPropertySymbols;return $traceurRuntime.createClass=o,$traceurRuntime.superConstructor=t,$traceurRuntime.superGet=r,$traceurRuntime.superSet=n,{}}),System.registerModule("[email protected]/src/runtime/destructuring.js",[],function(){"use strict";function e(e){for(var t,r=[],n=0;!(t=e.next()).done;)r[n++]=t.value;return r}return $traceurRuntime.iteratorToArray=e,{}}),System.registerModule("[email protected]/src/runtime/generators.js",[],function(){"use strict";function e(e){return{configurable:!0,enumerable:!1,value:e,writable:!0}}function t(e){return new Error("Traceur compiler bug: invalid state in state machine: "+e)}function r(){this.state=0,this.GState=g,this.storedException=void 0,this.finallyFallThrough=void 0,this.sent_=void 0,this.returnValue=void 0,this.oldReturnValue=void 0,this.tryStack_=[]}function n(e,t,r,n){switch(e.GState){case y:throw new Error('"'+r+'" on executing generator');case x:if("next"==r)return{value:void 0,done:!0};if(n===S)return{value:e.returnValue,done:!0};throw n;case g:if("throw"===r){if(e.GState=x,n===S)return{value:e.returnValue,done:!0};throw n}if(void 0!==n)throw v("Sent value to newborn generator");case b:e.GState=y,e.action=r,e.sent=n;var i;try{i=t(e)}catch(o){if(o!==S)throw o;i=e}var a=i===e;return a&&(i=e.returnValue),e.GState=a?x:b,{value:i,done:a}}}function i(){}function o(){}function a(e,t,n){var i=l(e,n),o=new r,a=m(t.prototype);return a[M]=o,a[E]=i,a}function s(e){return e.prototype=m(o.prototype),e.__proto__=o,e}function u(){r.call(this),this.err=void 0;var e=this;e.result=new Promise(function(t,r){e.resolve=t,e.reject=r})}function c(e,t){var r=l(e,t),n=new u;return n.createCallback=function(e){return function(t){n.state=e,n.value=t,r(n)}},n.errback=function(e){h(n,e),r(n)},r(n),n.result}function l(e,t){return function(r){for(;;)try{return e.call(t,r)}catch(n){h(r,n)}}}function h(e,t){e.storedException=t;var r=e.tryStack_[e.tryStack_.length-1];return r?(e.state=void 0!==r["catch"]?r["catch"]:r["finally"],void(void 0!==r.finallyFallThrough&&(e.finallyFallThrough=r.finallyFallThrough))):void e.handleException(t)}if("object"!=typeof $traceurRuntime)throw new Error("traceur runtime not found.");var f=$traceurRuntime.createPrivateName,p=$traceurRuntime.defineProperties,d=$traceurRuntime.defineProperty,m=Object.create,v=TypeError,g=0,y=1,b=2,x=3,w=-2,_=-3,S={};r.prototype={pushTry:function(e,t){if(null!==t){for(var r=null,n=this.tryStack_.length-1;n>=0;n--)if(void 0!==this.tryStack_[n]["catch"]){r=this.tryStack_[n]["catch"];break}null===r&&(r=_),this.tryStack_.push({"finally":t,finallyFallThrough:r})}null!==e&&this.tryStack_.push({"catch":e})},popTry:function(){this.tryStack_.pop()},maybeUncatchable:function(){if(this.storedException===S)throw S},get sent(){return this.maybeThrow(),this.sent_},set sent(e){this.sent_=e},get sentIgnoreThrow(){return this.sent_},maybeThrow:function(){if("throw"===this.action)throw this.action="next",this.sent_},end:function(){switch(this.state){case w:return this;case _:throw this.storedException;default:throw t(this.state)}},handleException:function(e){throw this.GState=x,this.state=w,e},wrapYieldStar:function(e){var t=this;return{next:function(t){return e.next(t)},"throw":function(r){var n;if(r===S){if(e["return"]){if(n=e["return"](t.returnValue),!n.done)return t.returnValue=t.oldReturnValue,n;t.returnValue=n.value}throw r}if(e["throw"])return e["throw"](r);throw e["return"]&&e["return"](),v("Inner iterator does not have a throw method")}}}};var M=f(),E=f();return i.prototype=o,d(o,"constructor",e(i)),o.prototype={constructor:o,next:function(e){return n(this[M],this[E],"next",e)},"throw":function(e){return n(this[M],this[E],"throw",e)},"return":function(e){return this[M].oldReturnValue=this[M].returnValue,this[M].returnValue=e,n(this[M],this[E],"throw",S)}},p(o.prototype,{constructor:{enumerable:!1},next:{enumerable:!1},"throw":{enumerable:!1},"return":{enumerable:!1}}),Object.defineProperty(o.prototype,Symbol.iterator,e(function(){return this})),u.prototype=m(r.prototype),u.prototype.end=function(){switch(this.state){case w:this.resolve(this.returnValue);break;case _:this.reject(this.storedException);break;default:this.reject(t(this.state))}},u.prototype.handleException=function(){this.state=_},$traceurRuntime.asyncWrap=c,$traceurRuntime.initGeneratorFunction=s,$traceurRuntime.createGeneratorInstance=a,{}}),System.registerModule("[email protected]/src/runtime/relativeRequire.js",[],function(){"use strict";function t(t,n){function i(e){return"/"===e.slice(-1)}function o(e){return"/"===e[0]}function a(e){return"."===e[0]}return r=r||"undefined"!=typeof e&&e("path"),i(n)||o(n)?void 0:e(a(n)?r.resolve(r.dirname(t),n):n)}var r;return $traceurRuntime.require=t,{}}),System.registerModule("[email protected]/src/runtime/spread.js",[],function(){"use strict";function e(){for(var e,t=[],r=0,n=0;n<arguments.length;n++){var i=$traceurRuntime.checkObjectCoercible(arguments[n]);if("function"!=typeof i[$traceurRuntime.toProperty(Symbol.iterator)])throw new TypeError("Cannot spread non-iterable object.");for(var o=i[$traceurRuntime.toProperty(Symbol.iterator)]();!(e=o.next()).done;)t[r++]=e.value}return t}return $traceurRuntime.spread=e,{}}),System.registerModule("[email protected]/src/runtime/type-assertions.js",[],function(){"use strict";function e(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];var o=n,a=$traceurRuntime.getOwnHashObject(e).hash;o[a]||(o[a]=Object.create(null)),o=o[a];for(var s=0;s<t.length-1;s++)a=$traceurRuntime.getOwnHashObject(t[s]).hash,o[a]||(o[a]=Object.create(null)),o=o[a];var u=t[t.length-1];return a=$traceurRuntime.getOwnHashObject(u).hash,o[a]||(o[a]=new r(e,t)),o[a]}var t={any:{name:"any"},"boolean":{name:"boolean"},number:{name:"number"},string:{name:"string"},symbol:{name:"symbol"},"void":{name:"void"}},r=function(e,t){this.type=e,this.argumentTypes=t};$traceurRuntime.createClass(r,{},{});var n=Object.create(null);return $traceurRuntime.GenericType=r,$traceurRuntime.genericType=e,$traceurRuntime.type=t,{}}),System.registerModule("[email protected]/src/runtime/runtime-modules.js",[],function(){"use strict";return System.get("[email protected]/src/runtime/relativeRequire.js"),System.get("[email protected]/src/runtime/spread.js"),System.get("[email protected]/src/runtime/destructuring.js"),System.get("[email protected]/src/runtime/classes.js"),System.get("[email protected]/src/runtime/async.js"),System.get("[email protected]/src/runtime/generators.js"),System.get("[email protected]/src/runtime/type-assertions.js"),{}}),System.get("[email protected]/src/runtime/runtime-modules.js"),System.registerModule("[email protected]/src/runtime/polyfills/utils.js",[],function(){"use strict";function e(e){return e>>>0}function t(e){return e&&("object"==typeof e||"function"==typeof e)}function r(e){return"function"==typeof e}function n(e){return"number"==typeof e}function i(e){return e=+e,x(e)?0:0!==e&&b(e)?e>0?y(e):g(e):e}function o(e){var t=i(e);return 0>t?0:_(t,M)}function a(e){return t(e)?e[Symbol.iterator]:void 0}function s(e){return r(e)}function u(e,t){return{value:e,done:t}}function c(e,t,r){t in e||Object.defineProperty(e,t,r)}function l(e,t,r){c(e,t,{value:r,configurable:!0,enumerable:!1,writable:!0})}function h(e,t,r){c(e,t,{value:r,configurable:!1,enumerable:!1,writable:!1})}function f(e,t){for(var r=0;r<t.length;r+=2){var n=t[r],i=t[r+1];l(e,n,i)}}function p(e,t){for(var r=0;r<t.length;r+=2){var n=t[r],i=t[r+1];h(e,n,i)}}function d(e,t,r){r&&r.iterator&&!e[r.iterator]&&(e["@@iterator"]&&(t=e["@@iterator"]),Object.defineProperty(e,r.iterator,{value:t,configurable:!0,enumerable:!1,writable:!0}))}function m(e){E.push(e)}function v(e){E.forEach(function(t){return t(e)})}var g=Math.ceil,y=Math.floor,b=isFinite,x=isNaN,w=Math.pow,_=Math.min,S=$traceurRuntime.toObject,M=w(2,53)-1,E=[];return{get toObject(){return S},get toUint32(){return e},get isObject(){return t},get isCallable(){return r},get isNumber(){return n},get toInteger(){return i},get toLength(){return o},get checkIterable(){return a},get isConstructor(){return s},get createIteratorResultObject(){return u},get maybeDefine(){return c},get maybeDefineMethod(){return l},get maybeDefineConst(){return h},get maybeAddFunctions(){return f},get maybeAddConsts(){return p},get maybeAddIterator(){return d},get registerPolyfill(){return m},get polyfillAll(){return v}}}),System.registerModule("[email protected]/src/runtime/polyfills/Map.js",[],function(){"use strict";function e(e,t){if(i(t)){var r=s(t);return r&&e.objectIndex_[r.hash]}return"string"==typeof t?e.stringIndex_[t]:e.primitiveIndex_[t]}function t(e){e.entries_=[],e.objectIndex_=Object.create(null),e.stringIndex_=Object.create(null),e.primitiveIndex_=Object.create(null),e.deletedCount_=0}function r(e){var t=e,r=t.Object,n=t.Symbol;e.Map||(e.Map=l);var i=e.Map.prototype;void 0===i.entries&&(e.Map=l),i.entries&&(o(i,i.entries,n),o(r.getPrototypeOf((new e.Map).entries()),function(){return this},n))}var n=System.get("[email protected]/src/runtime/polyfills/utils.js"),i=n.isObject,o=n.maybeAddIterator,a=n.registerPolyfill,s=$traceurRuntime.getOwnHashObject,u=Object.prototype.hasOwnProperty,c={},l=function(){var e,r,n=arguments[0];if(!i(this))throw new TypeError("Map called on incompatible type");if(u.call(this,"entries_"))throw new TypeError("Map can not be reentrantly initialised");if(t(this),null!==n&&void 0!==n){var o=!0,a=!1,s=void 0;try{for(var c=void 0,l=n[$traceurRuntime.toProperty(Symbol.iterator)]();!(o=(c=l.next()).done);o=!0){var h=c.value,f=(e=h[$traceurRuntime.toProperty(Symbol.iterator)](),(r=e.next()).done?void 0:r.value),p=(r=e.next()).done?void 0:r.value;this.set(f,p)}}catch(d){a=!0,s=d}finally{try{o||null==l["return"]||l["return"]()}finally{if(a)throw s}}}};return $traceurRuntime.createClass(l,{get size(){return this.entries_.length/2-this.deletedCount_},get:function(t){var r=e(this,t);return void 0!==r?this.entries_[r+1]:void 0},set:function(t,r){var n=i(t),o="string"==typeof t,a=e(this,t);if(void 0!==a)this.entries_[a+1]=r;else if(a=this.entries_.length,this.entries_[a]=t,this.entries_[a+1]=r,n){var u=s(t),c=u.hash;this.objectIndex_[c]=a}else o?this.stringIndex_[t]=a:this.primitiveIndex_[t]=a;return this},has:function(t){return void 0!==e(this,t)},"delete":function(e){var t,r,n=i(e),o="string"==typeof e;if(n){var a=s(e);a&&(t=this.objectIndex_[r=a.hash],delete this.objectIndex_[r])}else o?(t=this.stringIndex_[e],delete this.stringIndex_[e]):(t=this.primitiveIndex_[e],delete this.primitiveIndex_[e]);return void 0!==t?(this.entries_[t]=c,this.entries_[t+1]=void 0,this.deletedCount_++,!0):!1},clear:function(){t(this)},forEach:function(e){for(var t=arguments[1],r=0;r<this.entries_.length;r+=2){var n=this.entries_[r],i=this.entries_[r+1];n!==c&&e.call(t,i,n,this)}},entries:$traceurRuntime.initGeneratorFunction(function h(){var e,t,r;return $traceurRuntime.createGeneratorInstance(function(n){for(;;)switch(n.state){case 0:e=0,n.state=12;break;case 12:n.state=e<this.entries_.length?8:-2;break;case 4:e+=2,n.state=12;break;case 8:t=this.entries_[e],r=this.entries_[e+1],n.state=9;break;case 9:n.state=t===c?4:6;break;case 6:return n.state=2,[t,r];case 2:n.maybeThrow(),n.state=4;break;default:return n.end()}},h,this)}),keys:$traceurRuntime.initGeneratorFunction(function f(){var e,t,r;return $traceurRuntime.createGeneratorInstance(function(n){for(;;)switch(n.state){case 0:e=0,n.state=12;break;case 12:n.state=e<this.entries_.length?8:-2;break;case 4:e+=2,n.state=12;break;case 8:t=this.entries_[e],r=this.entries_[e+1],n.state=9;break;case 9:n.state=t===c?4:6;break;case 6:return n.state=2,t;case 2:n.maybeThrow(),n.state=4;break;default:return n.end()}},f,this)}),values:$traceurRuntime.initGeneratorFunction(function p(){var e,t,r;return $traceurRuntime.createGeneratorInstance(function(n){for(;;)switch(n.state){case 0:e=0,n.state=12;break;case 12:n.state=e<this.entries_.length?8:-2;break;case 4:e+=2,n.state=12;break;case 8:t=this.entries_[e],r=this.entries_[e+1],n.state=9;break;case 9:n.state=t===c?4:6;break;case 6:return n.state=2,r;case 2:n.maybeThrow(),n.state=4;break;default:return n.end()}},p,this)})},{}),Object.defineProperty(l.prototype,Symbol.iterator,{configurable:!0,writable:!0,value:l.prototype.entries}),a(r),{get Map(){return l},get polyfillMap(){return r}}}),System.get("[email protected]/src/runtime/polyfills/Map.js"),System.registerModule("[email protected]/src/runtime/polyfills/Set.js",[],function(){"use strict";function e(e){e.map_=new a}function t(e){var t=e,r=t.Object,n=t.Symbol;e.Set||(e.Set=u);var o=e.Set.prototype;o.values&&(i(o,o.values,n),i(r.getPrototypeOf((new e.Set).values()),function(){return this},n))}var r=System.get("[email protected]/src/runtime/polyfills/utils.js"),n=r.isObject,i=r.maybeAddIterator,o=r.registerPolyfill,a=System.get("[email protected]/src/runtime/polyfills/Map.js").Map,s=($traceurRuntime.getOwnHashObject,Object.prototype.hasOwnProperty),u=function(){var t=arguments[0];if(!n(this))throw new TypeError("Set called on incompatible type");if(s.call(this,"map_"))throw new TypeError("Set can not be reentrantly initialised");if(e(this),null!==t&&void 0!==t){var r=!0,i=!1,o=void 0;try{for(var a=void 0,u=t[$traceurRuntime.toProperty(Symbol.iterator)]();!(r=(a=u.next()).done);r=!0){var c=a.value;this.add(c)}}catch(l){i=!0,o=l}finally{try{r||null==u["return"]||u["return"]()}finally{if(i)throw o}}}};return $traceurRuntime.createClass(u,{get size(){return this.map_.size},has:function(e){return this.map_.has(e)},add:function(e){return this.map_.set(e,e),this},"delete":function(e){return this.map_["delete"](e)},clear:function(){return this.map_.clear()},forEach:function(e){var t=arguments[1],r=this;return this.map_.forEach(function(n,i){e.call(t,i,i,r)})},values:$traceurRuntime.initGeneratorFunction(function c(){var e,t;return $traceurRuntime.createGeneratorInstance(function(r){for(;;)switch(r.state){case 0:e=r.wrapYieldStar(this.map_.keys()[Symbol.iterator]()),r.sent=void 0,r.action="next",r.state=12;break;case 12:t=e[r.action](r.sentIgnoreThrow),r.state=9;break;case 9:r.state=t.done?3:2;break;case 3:r.sent=t.value,r.state=-2;break;case 2:return r.state=12,t.value;default:return r.end()}},c,this)}),entries:$traceurRuntime.initGeneratorFunction(function l(){var e,t;return $traceurRuntime.createGeneratorInstance(function(r){for(;;)switch(r.state){case 0:e=r.wrapYieldStar(this.map_.entries()[Symbol.iterator]()),r.sent=void 0,r.action="next",r.state=12;break;case 12:t=e[r.action](r.sentIgnoreThrow),r.state=9;break;case 9:r.state=t.done?3:2;break;case 3:r.sent=t.value,r.state=-2;break;case 2:return r.state=12,t.value;default:return r.end()}},l,this)})},{}),Object.defineProperty(u.prototype,Symbol.iterator,{configurable:!0,writable:!0,value:u.prototype.values}),Object.defineProperty(u.prototype,"keys",{configurable:!0,writable:!0,value:u.prototype.values}),o(t),{get Set(){return u},get polyfillSet(){return t}}}),System.get("[email protected]/src/runtime/polyfills/Set.js"),System.registerModule("[email protected]/node_modules/rsvp/lib/rsvp/asap.js",[],function(){"use strict";function e(e,t){p[u]=e,p[u+1]=t,u+=2,2===u&&s()}function r(){return function(){t.nextTick(a)}}function n(){var e=0,t=new h(a),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function i(){var e=new MessageChannel;return e.port1.onmessage=a,function(){e.port2.postMessage(0)}}function o(){return function(){setTimeout(a,1)}}function a(){for(var e=0;u>e;e+=2){var t=p[e],r=p[e+1];t(r),p[e]=void 0,p[e+1]=void 0}u=0}var s,u=0,c=e,l="undefined"!=typeof window?window:{},h=l.MutationObserver||l.WebKitMutationObserver,f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,p=new Array(1e3);return s="undefined"!=typeof t&&"[object process]"==={}.toString.call(t)?r():h?n():f?i():o(),{get default(){return c}}}),System.registerModule("[email protected]/src/runtime/polyfills/Promise.js",[],function(){"use strict";function e(e){return e&&"object"==typeof e&&void 0!==e.status_}function t(e){return e}function r(e){throw e}function n(e){var n=void 0!==arguments[1]?arguments[1]:t,o=void 0!==arguments[2]?arguments[2]:r,a=i(e.constructor);switch(e.status_){case void 0:throw TypeError;case 0:e.onResolve_.push(n,a),e.onReject_.push(o,a);break;case 1:l(e.value_,[n,a]);break;case-1:l(e.value_,[o,a])}return a.promise}function i(e){if(this===b){var t=a(new b(g));return{promise:t,resolve:function(e){s(t,e)},reject:function(e){u(t,e)}}}var r={};return r.promise=new e(function(e,t){r.resolve=e,r.reject=t}),r}function o(e,t,r,n,i){return e.status_=t,e.value_=r,e.onResolve_=n,e.onReject_=i,e}function a(e){return o(e,0,void 0,[],[])}function s(e,t){c(e,1,t,e.onResolve_)}function u(e,t){c(e,-1,t,e.onReject_)}function c(e,t,r,n){0===e.status_&&(l(r,n),o(e,t,r))}function l(e,t){m(function(){for(var r=0;r<t.length;r+=2)h(e,t[r],t[r+1])})}function h(t,r,i){try{var o=r(t);if(o===i.promise)throw new TypeError;e(o)?n(o,i.resolve,i.reject):i.resolve(o)}catch(a){try{i.reject(a)}catch(a){}}}function f(e){return e&&("object"==typeof e||"function"==typeof e)}function p(t,r){if(!e(r)&&f(r)){var n;try{n=r.then}catch(o){var a=x.call(t,o);return r[w]=a,a}if("function"==typeof n){var s=r[w];if(s)return s;var u=i(t);r[w]=u.promise;try{n.call(r,u.resolve,u.reject)}catch(o){u.reject(o)}return u.promise}}return r}function d(e){e.Promise||(e.Promise=y)}var m=System.get("[email protected]/node_modules/rsvp/lib/rsvp/asap.js")["default"],v=System.get("[email protected]/src/runtime/polyfills/utils.js").registerPolyfill,g={},y=function(e){if(e!==g){if("function"!=typeof e)throw new TypeError;var t=a(this);try{e(function(e){s(t,e)},function(e){u(t,e)})}catch(r){u(t,r)}}};$traceurRuntime.createClass(y,{"catch":function(e){return this.then(void 0,e)},then:function(i,o){"function"!=typeof i&&(i=t),"function"!=typeof o&&(o=r);var a=this,s=this.constructor;return n(this,function(t){return t=p(s,t),t===a?o(new TypeError):e(t)?t.then(i,o):i(t)},o)}},{resolve:function(t){return this===b?e(t)?t:o(new b(g),1,t):new this(function(e){e(t)})},reject:function(e){return this===b?o(new b(g),-1,e):new this(function(t,r){r(e)})},all:function(e){var t=i(this),r=[];try{var n=function(e){return function(n){r[e]=n,0===--o&&t.resolve(r)}},o=0,a=0,s=!0,u=!1,c=void 0;try{for(var l=void 0,h=e[$traceurRuntime.toProperty(Symbol.iterator)]();!(s=(l=h.next()).done);s=!0){var f=l.value,p=n(a);this.resolve(f).then(p,function(e){t.reject(e)}),++a,++o}}catch(d){u=!0,c=d}finally{try{s||null==h["return"]||h["return"]()}finally{if(u)throw c}}0===o&&t.resolve(r)}catch(m){t.reject(m)}return t.promise},race:function(e){var t=i(this);try{for(var r=0;r<e.length;r++)this.resolve(e[r]).then(function(e){t.resolve(e)},function(e){t.reject(e)})}catch(n){t.reject(n)}return t.promise}});var b=y,x=b.reject,w="@@thenable";return v(d),{get Promise(){return y},get polyfillPromise(){return d}}}),System.get("[email protected]/src/runtime/polyfills/Promise.js"),System.registerModule("[email protected]/src/runtime/polyfills/StringIterator.js",[],function(){"use strict";function e(e){var t=String(e),r=Object.create(c.prototype);return r[o(s)]=t,r[o(u)]=0,r}var t,r=System.get("[email protected]/src/runtime/polyfills/utils.js"),n=r.createIteratorResultObject,i=r.isObject,o=$traceurRuntime.toProperty,a=Object.prototype.hasOwnProperty,s=Symbol("iteratedString"),u=Symbol("stringIteratorNextIndex"),c=function(){};return $traceurRuntime.createClass(c,(t={},Object.defineProperty(t,"next",{value:function(){var e=this;if(!i(e)||!a.call(e,s))throw new TypeError("this must be a StringIterator object");var t=e[o(s)];if(void 0===t)return n(void 0,!0);var r=e[o(u)],c=t.length;if(r>=c)return e[o(s)]=void 0,n(void 0,!0);var l,h=t.charCodeAt(r);if(55296>h||h>56319||r+1===c)l=String.fromCharCode(h);else{var f=t.charCodeAt(r+1);l=56320>f||f>57343?String.fromCharCode(h):String.fromCharCode(h)+String.fromCharCode(f)}return e[o(u)]=r+l.length,n(l,!1)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(t,Symbol.iterator,{value:function(){return this},configurable:!0,enumerable:!0,writable:!0}),t),{}),{get createStringIterator(){return e}}}),System.registerModule("[email protected]/src/runtime/polyfills/String.js",[],function(){"use strict";function e(e){var t=String(this);if(null==this||"[object RegExp]"==d.call(e))throw TypeError();var r=t.length,n=String(e),i=(n.length,arguments.length>1?arguments[1]:void 0),o=i?Number(i):0;isNaN(o)&&(o=0);var a=Math.min(Math.max(o,0),r);return m.call(t,n,o)==a}function t(e){var t=String(this);if(null==this||"[object RegExp]"==d.call(e))throw TypeError();var r=t.length,n=String(e),i=n.length,o=r;if(arguments.length>1){var a=arguments[1];void 0!==a&&(o=a?Number(a):0,isNaN(o)&&(o=0))}var s=Math.min(Math.max(o,0),r),u=s-i;return 0>u?!1:v.call(t,n,u)==u}function r(e){if(null==this)throw TypeError();var t=String(this);if(e&&"[object RegExp]"==d.call(e))throw TypeError();var r=t.length,n=String(e),i=n.length,o=arguments.length>1?arguments[1]:void 0,a=o?Number(o):0;a!=a&&(a=0);var s=Math.min(Math.max(a,0),r);return i+s>r?!1:-1!=m.call(t,n,a)}function n(e){if(null==this)throw TypeError();var t=String(this),r=e?Number(e):0;if(isNaN(r)&&(r=0),0>r||1/0==r)throw RangeError();if(0==r)return"";for(var n="";r--;)n+=t;return n}function i(e){if(null==this)throw TypeError();var t=String(this),r=t.length,n=e?Number(e):0;if(isNaN(n)&&(n=0),0>n||n>=r)return void 0;var i,o=t.charCodeAt(n);return o>=55296&&56319>=o&&r>n+1&&(i=t.charCodeAt(n+1),i>=56320&&57343>=i)?1024*(o-55296)+i-56320+65536:o}function o(e){var t=e.raw,r=t.length>>>0;if(0===r)return"";for(var n="",i=0;;){if(n+=t[i],i+1===r)return n;n+=arguments[++i]}}function a(){var e,t,r=[],n=Math.floor,i=-1,o=arguments.length;if(!o)return"";for(;++i<o;){var a=Number(arguments[i]);if(!isFinite(a)||0>a||a>1114111||n(a)!=a)throw RangeError("Invalid code point: "+a);65535>=a?r.push(a):(a-=65536,e=(a>>10)+55296,t=a%1024+56320,r.push(e,t))}return String.fromCharCode.apply(null,r)}function s(){var e=$traceurRuntime.checkObjectCoercible(this),t=String(e);return c(t)}function u(u){var c=u.String;h(c.prototype,["codePointAt",i,"endsWith",t,"includes",r,"repeat",n,"startsWith",e]),h(c,["fromCodePoint",a,"raw",o]),f(c.prototype,s,Symbol)}var c=System.get("[email protected]/src/runtime/polyfills/StringIterator.js").createStringIterator,l=System.get("[email protected]/src/runtime/polyfills/utils.js"),h=l.maybeAddFunctions,f=l.maybeAddIterator,p=l.registerPolyfill,d=Object.prototype.toString,m=String.prototype.indexOf,v=String.prototype.lastIndexOf;return p(u),{get startsWith(){return e},get endsWith(){return t},get includes(){return r},get repeat(){return n},get codePointAt(){return i},get raw(){return o},get fromCodePoint(){return a},get stringPrototypeIterator(){return s},get polyfillString(){return u}}}),System.get("[email protected]/src/runtime/polyfills/String.js"),System.registerModule("[email protected]/src/runtime/polyfills/ArrayIterator.js",[],function(){"use strict";function e(e,t){var r=a(e),n=new f;return n.iteratorObject_=r,n.arrayIteratorNextIndex_=0,n.arrayIterationKind_=t,n}function t(){return e(this,h)}function r(){return e(this,c)}function n(){return e(this,l)}var i,o=System.get("[email protected]/src/runtime/polyfills/utils.js"),a=o.toObject,s=o.toUint32,u=o.createIteratorResultObject,c=1,l=2,h=3,f=function(){};return $traceurRuntime.createClass(f,(i={},Object.defineProperty(i,"next",{value:function(){var e=a(this),t=e.iteratorObject_;if(!t)throw new TypeError("Object is not an ArrayIterator");var r=e.arrayIteratorNextIndex_,n=e.arrayIterationKind_,i=s(t.length);return r>=i?(e.arrayIteratorNextIndex_=1/0,u(void 0,!0)):(e.arrayIteratorNextIndex_=r+1,n==l?u(t[r],!1):n==h?u([r,t[r]],!1):u(r,!1))},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,Symbol.iterator,{value:function(){return this},configurable:!0,enumerable:!0,writable:!0}),i),{}),{get entries(){return t
},get keys(){return r},get values(){return n}}}),System.registerModule("[email protected]/src/runtime/polyfills/Array.js",[],function(){"use strict";function e(e){var t,r,n=arguments[1],i=arguments[2],o=this,a=x(e),s=void 0!==n,u=0;if(s&&!p(n))throw TypeError();if(f(a)){t=d(o)?new o:[];var c=!0,l=!1,h=void 0;try{for(var m=void 0,v=a[$traceurRuntime.toProperty(Symbol.iterator)]();!(c=(m=v.next()).done);c=!0){var g=m.value;t[u]=s?n.call(i,g,u):g,u++}}catch(y){l=!0,h=y}finally{try{c||null==v["return"]||v["return"]()}finally{if(l)throw h}}return t.length=u,t}for(r=b(a.length),t=d(o)?new o(r):new Array(r);r>u;u++)t[u]=s?"undefined"==typeof i?n(a[u],u):n.call(i,a[u],u):a[u];return t.length=r,t}function t(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=this,n=e.length,i=d(r)?new r(n):new Array(n),o=0;n>o;o++)i[o]=e[o];return i.length=n,i}function r(e){var t=void 0!==arguments[1]?arguments[1]:0,r=arguments[2],n=x(this),i=b(n.length),o=y(t),a=void 0!==r?y(r):i;for(o=0>o?Math.max(i+o,0):Math.min(o,i),a=0>a?Math.max(i+a,0):Math.min(a,i);a>o;)n[o]=e,o++;return n}function n(e){var t=arguments[1];return o(this,e,t)}function i(e){var t=arguments[1];return o(this,e,t,!0)}function o(e,t){var r=arguments[2],n=void 0!==arguments[3]?arguments[3]:!1,i=x(e),o=b(i.length);if(!p(t))throw TypeError();for(var a=0;o>a;a++){var s=i[a];if(t.call(r,s,a,i))return n?a:s}return n?-1:void 0}function a(o){var a=o,s=a.Array,h=a.Object,f=a.Symbol,p=l;f&&f.iterator&&s.prototype[f.iterator]&&(p=s.prototype[f.iterator]),m(s.prototype,["entries",u,"keys",c,"values",p,"fill",r,"find",n,"findIndex",i]),m(s,["from",e,"of",t]),v(s.prototype,p,f),v(h.getPrototypeOf([].values()),function(){return this},f)}var s=System.get("[email protected]/src/runtime/polyfills/ArrayIterator.js"),u=s.entries,c=s.keys,l=s.values,h=System.get("[email protected]/src/runtime/polyfills/utils.js"),f=h.checkIterable,p=h.isCallable,d=h.isConstructor,m=h.maybeAddFunctions,v=h.maybeAddIterator,g=h.registerPolyfill,y=h.toInteger,b=h.toLength,x=h.toObject;return g(a),{get from(){return e},get of(){return t},get fill(){return r},get find(){return n},get findIndex(){return i},get polyfillArray(){return a}}}),System.get("[email protected]/src/runtime/polyfills/Array.js"),System.registerModule("[email protected]/src/runtime/polyfills/Object.js",[],function(){"use strict";function e(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}function t(e){for(var t=1;t<arguments.length;t++){var r=arguments[t],n=null==r?[]:f(r),i=void 0,o=n.length;for(i=0;o>i;i++){var a=n[i];h(a)||(e[a]=r[a])}}return e}function r(e,t){var r,n,i=l(t),o=i.length;for(r=0;o>r;r++){var a=i[r];h(a)||(n=c(t,i[r]),u(e,i[r],n))}return e}function n(n){var i=n.Object;o(i,["assign",t,"is",e,"mixin",r])}var i=System.get("[email protected]/src/runtime/polyfills/utils.js"),o=i.maybeAddFunctions,a=i.registerPolyfill,s=$traceurRuntime,u=s.defineProperty,c=s.getOwnPropertyDescriptor,l=s.getOwnPropertyNames,h=s.isPrivateName,f=s.keys;return a(n),{get is(){return e},get assign(){return t},get mixin(){return r},get polyfillObject(){return n}}}),System.get("[email protected]/src/runtime/polyfills/Object.js"),System.registerModule("[email protected]/src/runtime/polyfills/Number.js",[],function(){"use strict";function e(e){return a(e)&&f(e)}function t(t){return e(t)&&l(t)===t}function r(e){return a(e)&&p(e)}function n(t){if(e(t)){var r=l(t);if(r===t)return h(r)<=d}return!1}function i(i){var o=i.Number;s(o,["MAX_SAFE_INTEGER",d,"MIN_SAFE_INTEGER",m,"EPSILON",v]),u(o,["isFinite",e,"isInteger",t,"isNaN",r,"isSafeInteger",n])}var o=System.get("[email protected]/src/runtime/polyfills/utils.js"),a=o.isNumber,s=o.maybeAddConsts,u=o.maybeAddFunctions,c=o.registerPolyfill,l=o.toInteger,h=Math.abs,f=isFinite,p=isNaN,d=Math.pow(2,53)-1,m=-Math.pow(2,53)+1,v=Math.pow(2,-52);return c(i),{get MAX_SAFE_INTEGER(){return d},get MIN_SAFE_INTEGER(){return m},get EPSILON(){return v},get isFinite(){return e},get isInteger(){return t},get isNaN(){return r},get isSafeInteger(){return n},get polyfillNumber(){return i}}}),System.get("[email protected]/src/runtime/polyfills/Number.js"),System.registerModule("[email protected]/src/runtime/polyfills/fround.js",[],function(){"use strict";function e(e,t,r){function n(e){var t=l(e),r=e-t;return.5>r?t:r>.5?t+1:t%2?t+1:t}var i,o,a,s,d,m,v,g=(1<<t-1)-1;for(e!==e?(o=(1<<t)-1,a=p(2,r-1),i=0):1/0===e||e===-1/0?(o=(1<<t)-1,a=0,i=0>e?1:0):0===e?(o=0,a=0,i=1/e===-1/0?1:0):(i=0>e,e=c(e),e>=p(2,1-g)?(o=f(l(h(e)/u),1023),a=n(e/p(2,o)*p(2,r)),a/p(2,r)>=2&&(o+=1,a=1),o>g?(o=(1<<t)-1,a=0):(o+=g,a-=p(2,r))):(o=0,a=n(e/p(2,1-g-r)))),d=[],s=r;s;s-=1)d.push(a%2?1:0),a=l(a/2);for(s=t;s;s-=1)d.push(o%2?1:0),o=l(o/2);for(d.push(i?1:0),d.reverse(),m=d.join(""),v=[];m.length;)v.push(parseInt(m.substring(0,8),2)),m=m.substring(8);return v}function t(e,t,r){var n,i,o,a,s,u,c,l,h=[];for(n=e.length;n;n-=1)for(o=e[n-1],i=8;i;i-=1)h.push(o%2?1:0),o>>=1;return h.reverse(),a=h.join(""),s=(1<<t-1)-1,u=parseInt(a.substring(0,1),2)?-1:1,c=parseInt(a.substring(1,1+t),2),l=parseInt(a.substring(1+t),2),c===(1<<t)-1?0!==l?0/0:1/0*u:c>0?u*p(2,c-s)*(1+l/p(2,r)):0!==l?u*p(2,-(s-1))*(l/p(2,r)):0>u?-0:0}function r(e){return t(e,8,23)}function n(t){return e(t,8,23)}function i(e){return 0===e||!o(e)||a(e)?e:r(n(Number(e)))}var o=isFinite,a=isNaN,s=Math,u=s.LN2,c=s.abs,l=s.floor,h=s.log,f=s.min,p=s.pow;return{get fround(){return i}}}),System.registerModule("[email protected]/src/runtime/polyfills/Math.js",[],function(){"use strict";function e(e){if(e=S(+e),0==e)return 32;var t=0;return 0===(4294901760&e)&&(e<<=16,t+=16),0===(4278190080&e)&&(e<<=8,t+=8),0===(4026531840&e)&&(e<<=4,t+=4),0===(3221225472&e)&&(e<<=2,t+=2),0===(2147483648&e)&&(e<<=1,t+=1),t}function t(e,t){e=S(+e),t=S(+t);var r=e>>>16&65535,n=65535&e,i=t>>>16&65535,o=65535&t;return n*o+(r*o+n*i<<16>>>0)|0}function r(e){return e=+e,e>0?1:0>e?-1:e}function n(e){return.4342944819032518*P(e)}function i(e){return 1.4426950408889634*P(e)}function o(e){if(e=+e,-1>e||E(e))return 0/0;if(0===e||1/0===e)return e;if(-1===e)return-1/0;var t=0,r=50;if(0>e||e>1)return P(1+e);for(var n=1;r>n;n++)n%2===0?t-=R(e,n)/n:t+=R(e,n)/n;return t}function a(e){return e=+e,e===-1/0?-1:M(e)&&0!==e?$(e)-1:e}function s(e){return e=+e,0===e?1:E(e)?0/0:M(e)?(0>e&&(e=-e),e>21?$(e)/2:($(e)+$(-e))/2):1/0}function u(e){return e=+e,M(e)&&0!==e?($(e)-$(-e))/2:e}function c(e){if(e=+e,0===e)return e;if(!M(e))return r(e);var t=$(e),n=$(-e);return(t-n)/(t+n)}function l(e){return e=+e,1>e?0/0:M(e)?P(e+O(e+1)*O(e-1)):e}function h(e){return e=+e,0!==e&&M(e)?e>0?P(e+O(e*e+1)):-P(-e+O(e*e+1)):e}function f(e){return e=+e,-1===e?-1/0:1===e?1/0:0===e?e:E(e)||-1>e||e>1?0/0:.5*P((1+e)/(1-e))}function p(){for(var e=arguments.length,t=new Array(e),r=0,n=0;e>n;n++){var i=arguments[n];if(i=+i,1/0===i||i===-1/0)return 1/0;i=C(i),i>r&&(r=i),t[n]=i}0===r&&(r=1);for(var o=0,a=0,n=0;e>n;n++){var i=t[n]/r,s=i*i-a,u=o+s;a=u-o-s,o=u}return O(o)*r}function d(e){return e=+e,e>0?k(e):0>e?A(e):e}function m(e){if(e=+e,0===e)return e;var t=0>e;t&&(e=-e);var r=R(e,1/3);return t?-r:r}function v(v){var y=v.Math;w(y,["acosh",l,"asinh",h,"atanh",f,"cbrt",m,"clz32",e,"cosh",s,"expm1",a,"fround",g,"hypot",p,"imul",t,"log10",n,"log1p",o,"log2",i,"sign",r,"sinh",u,"tanh",c,"trunc",d])}var g,y,b=System.get("[email protected]/src/runtime/polyfills/fround.js").fround,x=System.get("[email protected]/src/runtime/polyfills/utils.js"),w=x.maybeAddFunctions,_=x.registerPolyfill,S=x.toUint32,M=isFinite,E=isNaN,T=Math,C=T.abs,A=T.ceil,$=T.exp,k=T.floor,P=T.log,R=T.pow,O=T.sqrt;return"function"==typeof Float32Array?(y=new Float32Array(1),g=function(e){return y[0]=Number(e),y[0]}):g=b,_(v),{get clz32(){return e},get imul(){return t},get sign(){return r},get log10(){return n},get log2(){return i},get log1p(){return o},get expm1(){return a},get cosh(){return s},get sinh(){return u},get tanh(){return c},get acosh(){return l},get asinh(){return h},get atanh(){return f},get hypot(){return p},get trunc(){return d},get fround(){return g},get cbrt(){return m},get polyfillMath(){return v}}}),System.get("[email protected]/src/runtime/polyfills/Math.js"),System.registerModule("[email protected]/src/runtime/polyfills/polyfills.js",[],function(){"use strict";var e=System.get("[email protected]/src/runtime/polyfills/utils.js").polyfillAll;e(Reflect.global);var t=$traceurRuntime.setupGlobals;return $traceurRuntime.setupGlobals=function(r){t(r),e(r)},{}}),System.get("[email protected]/src/runtime/polyfills/polyfills.js")}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:4,path:3}],18:[function(e,t,r){"use strict";function n(e,t){for(;;){var r=e.next();if(t(r.value),r.done)return}}function i(e){for(var t=[];;){var r=e.next(),n=r.value,i=r.done;if(n!=x&&t.push(n),i)return t}}var o=e("babel-runtime/core-js")["default"],a=e("babel-runtime/regenerator")["default"],s=a.mark(function w(e){var t,r,n,i;return a.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:t=[],r=0;case 1:if(n=e.next(),n.done){o.next=9;break}return t.push(n.value),o.next=7,n.value;case 7:o.next=10;break;case 9:return o.abrupt("break",12);case 10:o.next=1;break;case 12:if(n=e.next(),n.done){o.next=20;break}return t.push(n.value),o.next=18,n.value;case 18:o.next=24;break;case 20:return i=t[r],o.next=23,i;case 23:r=(r+1)%t.length;case 24:o.next=12;break;case 26:case"end":return o.stop()}},w,this)}),u=a.mark(function _(e){var t,r,n,o,s;return a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:s=function(e){var n=t.indexOf(e);if(-1==n)throw Error("Tried to remove object that is not in q",e,t);t.splice(n,1),r>=n&&(r=0==r?t.length-1:r-1)},t=i(e),r=0;case 2:if(!(t.length>0)){a.next=14;break}if(r%=t.length,n=t[r],o=n.next(),!o.done){a.next=9;break}if(s(n),0!=t.length){a.next=9;break}return a.abrupt("return",o.value);case 9:return r+=1,a.next=12,o.value;case 12:a.next=2;break;case 14:case"end":return a.stop()}},_,this)}),c=(a.mark(function S(e,t){var r,n;return a.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:for(;;)r=e.next(t),n=r.value;case 1:case"end":return i.stop()}},S,this)}),a.mark(function M(e,t){var r,n,i;return a.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(r=e.next(),n=r.value,i=r.done,!i){o.next=8;break}return o.abrupt("return",n==x?x:t(n));case 8:return o.next=10,t(n);case 10:o.next=0;break;case 12:case"end":return o.stop()}},M,this)})),l=a.mark(function E(e,t){var r;return a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(r=e.next(),!(r.done||--t<=0)){n.next=4;break}return n.abrupt("return",r.value);case 4:return n.next=6,r.value;case 6:n.next=0;break;case 8:case"end":return n.stop()}},E,this)}),h=a.mark(function T(e){var t,r,n,o,s,u;return a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:t=i(e),r=t.length;case 2:if(!(r>0)){a.next=11;break}for(n=[],o=0;o<t.length;o++)s=t[o],u=null!=s?s.next():void 0,u?(n.push(u.value),u.done&&(delete t[o],r--)):n.push(void 0);if(0!=r){a.next=7;break}return a.abrupt("return",n);case 7:return a.next=9,n;case 9:a.next=2;break;case 11:case"end":return a.stop()}},T,this)}),f=a.mark(function C(e,t){var r,n;return a.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return r=[],i.next=3,a.mark(function o(){var t;return a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(t=e.next(),console.log("got result",t),r.push(t.value),!t.done){n.next=8;break}return n.abrupt("return",t.value);case 8:return n.next=10,t.value;case 10:n.next=0;break;case 12:case"end":return n.stop()}},o,this)});case 3:n=0;case 4:if(!(t-1>n)){i.next=10;break}return i.next=7,a.mark(function s(){var e;return a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=0;case 1:if(!(e<r.length-1)){t.next=7;break}return t.next=4,r[e];case 4:e++,t.next=1;break;case 7:return t.abrupt("return",r[e]);case 8:case"end":return t.stop()}},s,this)});case 7:n++,i.next=4;break;case 10:case"end":return i.stop()}},C,this)}),p=a.mark(function A(e,t){var r;return a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(0!=t){n.next=2;break}throw new Error("why did you do that?");case 2:r=0;case 3:if(!(t-1>r)){n.next=9;break}return n.next=6,e;case 6:r++,n.next=3;break;case 9:return n.abrupt("return",e);case 10:case"end":return n.stop()}},A,this)}),d=a.mark(function $(e){var t,r;return a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(t=e.length,0!=t){n.next=3;break}throw Error("What should we do here?");case 3:r=0;case 4:if(!(t-1>r)){n.next=10;break}return n.next=7,e[r];case 7:r++,n.next=4;break;case 10:return n.abrupt("return",e[r]);case 11:case"end":return n.stop()}},$,this)}),m=a.mark(function k(e){return a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(0!=e.length){t.next=2;break}throw Error("Empty stack",e);case 2:if(!(e.length>1)){t.next=7;break}return t.next=5,e.pop();case 5:t.next=2;break;case 7:return t.abrupt("return",e.pop());case 8:case"end":return t.stop()}},k,this)}),v=a.mark(function P(e){return a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(0!=e.length){t.next=2;break}throw Error("Empty queue",e);case 2:if(!(e.length>1)){t.next=7;break}return t.next=5,e.shift();case 5:t.next=2;break;case 7:return t.abrupt("return",e.shift());case 8:case"end":return t.stop()}},P,this)}),g=a.mark(function R(e){return a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(0!=e.length){t.next=2;break}throw Error("Empty stack",e);case 2:return t.next=4,e.pop();case 4:if(e.length>0){t.next=2;break}case 5:return t.abrupt("return",x);case 6:case"end":return t.stop()}},R,this)}),y=a.mark(function O(e){return a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(0!=e.length){t.next=2;break}throw Error("Empty queue",e);case 2:return t.next=4,e.shift();case 4:if(e.length>0){t.next=2;break}case 5:return t.abrupt("return",x);case 6:case"end":return t.stop()}},O,this)}),b=a.mark(function L(e,t){var r;return a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(void 0==t){n.next=8;break}r=e||0;case 2:if(!(t>r)){n.next=7;break}return n.next=5,r++;case 5:n.next=2;break;case 7:return n.abrupt("return",r);case 8:r=e||0;case 9:return n.next=12,r++;case 12:n.next=9;break;case 14:case"end":return n.stop()}},L,this)});Object.defineProperty(r,"__esModule",{value:!0});var x=o.Symbol();r.transform=c,r.map=c,r.each=n,r.modifiableStack=m,r.modifiableQueue=v,r.modifiableStackAlt=g,r.modifiableQueueAlt=y,r.toGenerator=d,r.toArray=i,r.loop=s,r.interleave=u,r.repeat=p,r.repeatG=f,r.integers=b,r.take=l,r.zip=h,r.TERMINAL=x},{"babel-runtime/core-js":22,"babel-runtime/regenerator":23}],19:[function(e,t){"use strict";t.exports={g:e("./generators"),p:e("./promises"),t:e("./trees")}},{"./generators":18,"./promises":20,"./trees":21}],20:[function(e,t){"use strict";function r(e,t,r){return new o.Promise(function(n,i){function o(e){function s(t){a++,r(t),l?n(a):o(e)}var u=e.next(),c=u.value,l=u.done;c.then(function(r){a++,t(r,a),l?n(a):o(e)},r?s:i)}var a=0;o(e)})}function n(e,t,r){return new o.Promise(function(n,i){function o(e){function a(r,i){t(r),i?n(r):o(e)}function s(t){r?(r(t),l?n(count):o(e)):i(t)}var u=e.next(),c=u.value,l=u.done;c.then(a,s)}o(e)})}function i(e,t,r,n){return new o.Promise(function(i,o){function a(t){c++,u++;var h=t.next(),f=h.value,p=h.done;l=p,f.then(function(e){c--,r(e,u),l?0==c&&i(u):a(t)},n?s:o),e>c&&!l&&a(t)}function s(e){c--,u++,n(e),l?0==c&&i(u):a(t)}var u=0,c=0,l=!1;a(t)})}var o=e("babel-runtime/core-js")["default"];t.exports={sync:r,pipe:n,async:i}},{"babel-runtime/core-js":22}],21:[function(e,t){"use strict";function r(e,t,r,n){function i(e){console.log("reduceNode",e),e||console.log("reduceNode, no node!");var t=e.next(),i=t.value;return t.done?r(i,n()):r(i,o(e))}function o(e){console.log("reduceChildren",e);for(var r=n();;){var o=e.next(),a=o.value;if(r=t(r,i(a)),o.done)break}return r}return void 0==n&&(n=r,r=t),i(e)}function n(e,t){return function(){return f(e,t)}}function i(e){var t={},r=e.next();return t.value=r.value,r.done||(t.children=m(e)),t}function o(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];return i(e.apply(void 0,r))}function a(e,t){function r(e){console.log(i(t)+e)}function n(e){var r=e.next(),n=r.value;return void 0!=n&&a(n,t+1),!r.done}function i(e,t){t=t||" ";for(var r="",n=0;e>n;n++)r+=t;return r}if(t=t||0,void 0==e)return r("<undefined>");var o=e(),s=o.next(),u=s.value;if(void 0!=u){if(s.done)return r(u);n(o),r(u),n(o)}}var s=e("babel-runtime/regenerator")["default"],u=s.mark(function g(e){var t,r,n,i,o;return s.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(e){a.next=2;break}throw Error("preorder, no node!");case 2:if(console.log("preorder",e),t=e.next(),r=t.value,!t.done){a.next=6;break}return a.abrupt("return",r);case 6:return a.next=8,r;case 8:n=e.next(),i=g(n.value);case 11:if(o=i.next(),!o.done){a.next=21;break}if(!n.done){a.next=16;break}return a.abrupt("return",o.value);case 16:return a.next=18,o.value;case 18:return a.abrupt("break",25);case 21:return a.next=23,o.value;case 23:a.next=11;break;case 25:a.next=8;break;case 27:case"end":return a.stop()}},g,this)}),c=s.mark(function y(e){var t,r,n,i,o,a;return s.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(e||console.log("inorder, no node!"),t=e.next(),r=t.value,!t.done){s.next=4;break}return s.abrupt("return",r);case 4:n=!1;case 5:i=e.next(),o=y(i.value);case 8:if(a=o.next(),!a.done){s.next=18;break}if(!n||!i.done){s.next=13;break}return s.abrupt("return",a.value);case 13:return s.next=15,a.value;case 15:return s.abrupt("break",22);case 18:return s.next=20,a.value;case 20:s.next=8;break;case 22:if(n){s.next=30;break}if(!i.done){s.next=27;break}return s.abrupt("return",r);case 27:return s.next=29,r;case 29:n=!0;case 30:s.next=5;break;case 32:case"end":return s.stop()}},y,this)}),l=s.mark(function b(e){var t,r,n,i,o;return s.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(e||console.log("postorder, no node!"),t=e.next(),r=t.value,!t.done){a.next=4;break}return a.abrupt("return",r);case 4:n=e.next(),i=b(n.value);case 7:return o=i.next(),a.next=11,o.value;case 11:if(!o.done){a.next=13;break}return a.abrupt("break",15);case 13:a.next=7;break;case 15:if(!n.done){a.next=17;break}return a.abrupt("return",r);case 17:a.next=4;break;case 19:case"end":return a.stop()}},b,this)}),h=s.mark(function x(e,t){var r,n,i,o,a,u,c;return s.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(t=t||"",e||console.log("breadthFirst, no node",e),r=e.next(),n=r.value,!r.done){s.next=5;break}return s.abrupt("return",n);case 5:return s.next=7,n;case 7:i=[{generator:e}];case 8:if(0==i.length){s.next=27;break}o=i.shift();case 10:if(a=o.generator.next(),u=a.value,c=u.next(),!c.done){s.next=18;break}if(!a.done||0!=i.length){s.next=16;break}return s.abrupt("return",c.value);case 16:s.next=19;break;case 18:i.push({parent:c.value,generator:u});case 19:return s.next=21,c.value;case 21:if(!a.done){s.next=23;break}return s.abrupt("break",25);case 23:s.next=10;break;case 25:s.next=8;break;case 27:case"end":return s.stop()}},x,this)}),f=s.mark(function w(e,t){var r;return s.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!t){n.next=17;break}return n.next=3,e;case 3:t.length&&(t=v(t)),"function"==typeof t&&(t=t());case 5:if(r=t.next(),!r.done){n.next=11;break}return n.abrupt("return",r.value);case 11:return n.next=13,r.value;case 13:n.next=5;break;case 15:n.next=18;break;case 17:return n.abrupt("return",e);case 18:case"end":return n.stop()}},w,this)}),p=s.mark(function _(e,t){var r,n,i=s.mark(function o(e,t,r,n){var i;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:i=r(n).next().value;case 1:case"end":return e.stop()}},o,this)});return s.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(0!=e){o.next=2;break}return o.abrupt("return",f(void 0));case 2:r=0;case 4:if(!(e-1>r)){o.next=15;break}n=0;case 6:if(!(e-r-1>n)){o.next=12;break}return o.next=9,i(r,n,t,0);case 9:n++,o.next=6;break;case 12:r++,o.next=4;break;case 15:case"end":return o.stop()}},_,this)}),p=s.mark(function S(e,t,r){var i,o,a,u,c,l,h,f,p;return s.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(0!=e){s.next=2;break}return s.abrupt("return",n(void 0));case 2:if(i=t(r).next().value,1!=e){s.next=5;break}return s.abrupt("return",n(i));case 5:o=0;case 7:if(!(e-1>o)){s.next=26;break}a=S(o,t,i+1);case 9:u=e-1-o,c=S(u,t,i+1),l=a.next(),h=l.value;case 11:return f=c.next(),p=f.value,s.next=15,n(i,[h,p]);case 15:if(!f.done){s.next=17;break}return s.abrupt("break",19);case 17:s.next=11;break;case 19:if(!l.done){s.next=21;break}return s.abrupt("break",23);case 21:s.next=9;break;case 23:o++,s.next=7;break;case 26:a=S(o,t,i+1);case 27:if(l=a.next(),!l.done){s.next=31;break}return s.abrupt("return",n(i,[l.value,n(void 0)]));case 31:return s.next=33,n(i,[l.value,n(void 0)]);case 33:s.next=27;break;case 35:case"end":return s.stop()}},S,this)}),d=(s.mark(function M(e,t,r,n){var i,o,a,u,c,l,h,d;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(console.log("all",e),0!=e){t.next=3;break}return t.abrupt("return",f(void 0));case 3:if(nodeValue=n.next().value,1!=e){t.next=6;break}return t.abrupt("return",f(nodeValue));case 6:return t.next=8,f(nodeValue);case 8:i=0;case 10:if(!(e-1>i)){t.next=37;break}console.log("i",i),o=p(i,n),console.log("left",o);case 14:a=o.next(),u=e-1-i,c=p(u,n),console.log("leftResult",a),console.log("right",c);case 18:return l=c.next(),h=[],console.log("rightResult",l),console.log("children",h),console.log("nodeValue",nodeValue),d=n.next().value,t.next=26,f(d,[a.value,l.value]);case 26:if(!l.done){t.next=28;break}return t.abrupt("break",30);case 28:t.next=18;break;case 30:if(!a.done){t.next=32;break}return t.abrupt("break",34);case 32:t.next=14;break;case 34:i++,t.next=10;break;case 37:o=p(i,n),u=0;case 38:if(a=o.next(),console.log("last leftResult",a),nodeValue=n.next().value,!a.done){t.next=44;break}return t.abrupt("return",f(nodeValue,[a.value,f(void 0)]));case 44:return t.next=46,f(nodeValue,[a.value,f(void 0)]);case 46:u++,t.next=38;break;case 49:case"end":return t.stop()}},M,this)}),e("./generators")),m=d.toArray,v=d.toGenerator;t.exports={preorder:u,inorder:c,postorder:l,breadthFirst:h,reduce:r,makeNode:f,toNode:i,asNode:o,allBinaryTrees:p,printTree:a}},{"./generators":18,"babel-runtime/regenerator":23}],22:[function(e,t){!function(e,r,n){"use strict";function i(e){return null!==e&&("object"==typeof e||"function"==typeof e)}function o(e){return"function"==typeof e}function a(e,t,r){e&&!yr(e=r?e:e[bt],Vr)&&Fr(e,Vr,t)}function s(e){return ar.call(e).slice(8,-1)}function u(e){var t,r;return e==n?e===n?"Undefined":"Null":"string"==typeof(r=(t=Pt(e))[Vr])?r:s(t)}function c(){for(var e=P(this),t=arguments.length,r=Rt(t),n=0,i=Gr._,o=!1;t>n;)(r[n]=arguments[n++])===i&&(o=!0);return function(){var n,a=this,s=arguments.length,u=0,c=0;if(!o&&!s)return h(e,r,a);if(n=r.slice(),o)for(;t>u;u++)n[u]===i&&(n[u]=arguments[c++]);for(;s>c;)n.push(arguments[c++]);return h(e,n,a)}}function l(e,t,r){if(P(e),~r&&t===n)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}}function h(e,t,r){var i=r===n;switch(0|t.length){case 0:return i?e():e.call(r);case 1:return i?e(t[0]):e.call(r,t[0]);case 2:return i?e(t[0],t[1]):e.call(r,t[0],t[1]);case 3:return i?e(t[0],t[1],t[2]):e.call(r,t[0],t[1],t[2]);case 4:return i?e(t[0],t[1],t[2],t[3]):e.call(r,t[0],t[1],t[2],t[3]);case 5:return i?e(t[0],t[1],t[2],t[3],t[4]):e.call(r,t[0],t[1],t[2],t[3],t[4])}return e.apply(r,t)}function f(e){return br(k(e))}function p(e){return e}function d(){return this}function m(e,t){return yr(e,t)?e[t]:void 0}function v(e){return R(e),vr?mr(e).concat(vr(e)):mr(e)}function g(e,t){for(var r,n=f(e),i=dr(n),o=i.length,a=0;o>a;)if(n[r=i[a++]]===t)return r}function y(e){return Ot(e).split(",")}function b(e){var t=1==e,r=2==e,i=3==e,o=4==e,a=6==e,s=5==e||a;return function(u){for(var c,h,f=Pt(k(this)),p=arguments[1],d=br(f),m=l(u,p,3),v=M(d.length),g=0,y=t?Rt(v):r?[]:n;v>g;g++)if((s||g in d)&&(c=d[g],h=m(c,g,f),e))if(t)y[g]=h;else if(h)switch(e){case 3:return!0;case 5:return c;case 6:return g;case 2:y.push(c)}else if(o)return!1;return a?-1:i||o?o:y}}function x(e){return function(t){var r=f(this),n=M(r.length),i=E(arguments[1],n);if(e&&t!=t){for(;n>i;i++)if(_(r[i]))return e||i}else for(;n>i;i++)if((e||i in r)&&r[i]===t)return e||i;return!e&&-1}}function w(e,t){return"function"==typeof e?e:t}function _(e){return e!=e}function S(e){return isNaN(e)?0:Pr(e)}function M(e){return e>0?$r(S(e),Sr):0}function E(e,t){var e=S(e);return 0>e?Ar(e+t,0):$r(e,t)}function T(e){return e>9?e:"0"+e}function C(e,t,r){var n=i(t)?function(e){return t[e]}:t;return function(t){return Ot(r?t:this).replace(e,n)}}function A(e){return function(t){var r,i,o=Ot(k(this)),a=S(t),s=o.length;return 0>a||a>=s?e?"":n:(r=o.charCodeAt(a),55296>r||r>56319||a+1===s||(i=o.charCodeAt(a+1))<56320||i>57343?e?o.charAt(a):r:e?o.slice(a,a+2):(r-55296<<10)+(i-56320)+65536)}}function $(e,t,r){if(!e)throw Bt(r?t+r:t)}function k(e){if(e==n)throw Bt("Function called on null or undefined");return e}function P(e){return $(o(e),e," is not a function!"),e}function R(e){return $(i(e),e," is not an object!"),e}function O(e,t,r){$(e instanceof t,r,": use the 'new' operator!")}function L(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}function F(e,t,r){return e[t]=r,e}function j(e){return Or?function(t,r,n){return fr(t,r,L(e,n))}:F}function D(e){return mt+"("+e+")_"+(++Lr+kr())[wt](36)}function N(e,t){return Ut&&Ut[e]||(t?Ut:Dr)(mt+ir+e)}function U(e,t){for(var r in t)Fr(e,r,t[r]);return e}function V(e){!Or||!r&&or(e)||fr(e,Br,{configurable:!0,get:d})}function B(t,n,i){var a,s,u,c,h=t&qr,f=h?e:t&Xr?e[n]:(e[n]||tr)[bt],p=h?zr:zr[n]||(zr[n]={});h&&(i=n);for(a in i)s=!(t&Wr)&&f&&a in f&&(!o(f[a])||or(f[a])),u=(s?f:i)[a],r||!h||o(f[a])?t&Kr&&s?c=l(u,e):t&Qr&&!r&&f[a]==u?(c=function(e){return this instanceof u?new u(e):u(e)},c[bt]=u[bt]):c=t&Yr&&o(u)?l(sr,u):u:c=i[a],r&&f&&!s&&(h?f[a]=u:delete f[a]&&Fr(f,a,u)),p[a]!=u&&Fr(p,a,c)}function I(e,t){Fr(e,rt,t),Ct in er&&Fr(e,Ct,t)}function z(e,t,r,n){e[bt]=cr(n||rn,{next:L(1,r)}),a(e,t+" Iterator")}function G(e,t,n,i){var o=e[bt],s=m(o,rt)||m(o,Ct)||i&&m(o,i)||n;if(r&&(I(o,s),s!==n)){var u=lr(s.call(new e));a(u,t+" Iterator",!0),yr(o,Ct)&&I(u,d)}return tn[t]=s,tn[t+" Iterator"]=d,s}function H(e,t,r,n,i,o){function a(e){return function(){return new r(this,e)}}z(r,t,n);var s=a(Jr+en),u=a(en);i==en?u=G(e,t,u,"values"):s=G(e,t,s,"entries"),i&&B(Yr+Wr*nn,t,{entries:s,keys:o?u:a(Jr),values:u})}function W(e,t){return{value:t,done:!!e}}function q(t){var r=Pt(t),n=e[mt],i=(n&&n[Tt]||Ct)in r;return i||rt in r||yr(tn,u(r))}function X(t){var r=e[mt],n=t[r&&r[Tt]||Ct],i=n||t[rt]||tn[u(t)];return R(i.call(t))}function Y(e,t,r){return r?h(e,t):e(t)}function K(e){var t=!0,r={next:function(){throw 1},"return":function(){t=!1}};r[rt]=d;try{e(r)}catch(n){}return t}function Q(e){var t=e["return"];t!==n&&t.call(e)}function Z(e,t){try{e(t)}catch(r){throw Q(t),r}}function J(e,t,r,n){Z(function(e){for(var i,o=l(r,n,t?2:1);!(i=e.next()).done;)if(Y(o,i.value,t)===!1)return Q(e)},X(e))}var et,tt,rt,nt,it="Object",ot="Function",at="Array",st="String",ut="Number",ct="RegExp",lt="Date",ht="Map",ft="Set",pt="WeakMap",dt="WeakSet",mt="Symbol",vt="Promise",gt="Math",yt="Arguments",bt="prototype",xt="constructor",wt="toString",_t=wt+"Tag",St="toLocaleString",Mt="hasOwnProperty",Et="forEach",Tt="iterator",Ct="@@"+Tt,At="process",$t="createElement",kt=e[ot],Pt=e[it],Rt=e[at],Ot=e[st],Lt=e[ut],Ft=(e[ct],e[lt],e[ht]),jt=e[ft],Dt=e[pt],Nt=e[dt],Ut=e[mt],Vt=e[gt],Bt=e.TypeError,It=e.RangeError,zt=e.setTimeout,Gt=e.setImmediate,Ht=e.clearImmediate,Wt=e.parseInt,qt=e.isFinite,Xt=e[At],Yt=Xt&&Xt.nextTick,Kt=e.document,Qt=Kt&&Kt.documentElement,Zt=(e.navigator,e.define),Jt=e.console||{},er=Rt[bt],tr=Pt[bt],rr=kt[bt],nr=1/0,ir=".",or=l(/./.test,/\[native code\]\s*\}\s*$/,1),ar=tr[wt],sr=rr.call,ur=rr.apply,cr=Pt.create,lr=Pt.getPrototypeOf,hr=Pt.setPrototypeOf,fr=Pt.defineProperty,pr=(Pt.defineProperties,Pt.getOwnPropertyDescriptor),dr=Pt.keys,mr=Pt.getOwnPropertyNames,vr=Pt.getOwnPropertySymbols,gr=Pt.isFrozen,yr=l(sr,tr[Mt],2),br=Pt,xr=Pt.assign||function(e){for(var t=Pt(k(e)),r=arguments.length,n=1;r>n;)for(var i,o=br(arguments[n++]),a=dr(o),s=a.length,u=0;s>u;)t[i=a[u++]]=o[i];return t},wr=er.push,_r=(er.unshift,er.slice,er.splice,er.indexOf,er[Et]),Sr=9007199254740991,Mr=Vt.pow,Er=Vt.abs,Tr=Vt.ceil,Cr=Vt.floor,Ar=Vt.max,$r=Vt.min,kr=Vt.random,Pr=Vt.trunc||function(e){return(e>0?Cr:Tr)(e)},Rr="Reduce of empty object with no initial value",Or=!!function(){try{return 2==fr({},"a",{get:function(){return 2}}).a}catch(e){}}(),Lr=0,Fr=j(1),jr=Ut?F:Fr,Dr=Ut||D,Nr=N("unscopables"),Ur=er[Nr]||{},Vr=N(_t),Br=N("species"),Ir=s(Xt)==At,zr={},Gr=r?e:zr,Hr=e.core,Wr=1,qr=2,Xr=4,Yr=8,Kr=16,Qr=32;"undefined"!=typeof t&&t.exports?t.exports=zr:o(Zt)&&Zt.amd?Zt(function(){return zr}):nt=!0,(nt||r)&&(zr.noConflict=function(){return e.core=Hr,zr},e.core=zr),rt=N(Tt);var Zr=Dr("iter"),Jr=1,en=2,tn={},rn={},nn="keys"in er&&!("next"in[].keys());I(rn,d),!function(t,r,n,i){or(Ut)||(Ut=function(e){$(!(this instanceof Ut),mt+" is not a "+xt);var r=D(e),o=jr(cr(Ut[bt]),t,r);return n[r]=o,Or&&i&&fr(tr,r,{configurable:!0,set:function(e){Fr(this,r,e)}}),o},Fr(Ut[bt],wt,function(){return this[t]})),B(qr+Qr,{Symbol:Ut});var o={"for":function(e){return yr(r,e+="")?r[e]:r[e]=Ut(e)},iterator:rt||N(Tt),keyFor:c.call(g,r),species:Br,toStringTag:Vr=N(_t,!0),unscopables:Nr,pure:Dr,set:jr,useSetter:function(){i=!0},useSimple:function(){i=!1}};_r.call(y("hasInstance,isConcatSpreadable,match,replace,search,split,toPrimitive"),function(e){o[e]=N(e)}),B(Xr,mt,o),a(Ut,mt),B(Xr+Wr*!or(Ut),it,{getOwnPropertyNames:function(e){for(var t,r=mr(f(e)),i=[],o=0;r.length>o;)yr(n,t=r[o++])||i.push(t);return i},getOwnPropertySymbols:function(e){for(var t,r=mr(f(e)),i=[],o=0;r.length>o;)yr(n,t=r[o++])&&i.push(n[t]);return i}}),a(Vt,gt,!0),a(e.JSON,"JSON",!0)}(Dr("tag"),{},{},!0),!function(){var e={assign:xr,is:function(e,t){return e===t?0!==e||1/e===1/t:e!=e&&t!=t}};"__proto__"in tr&&function(t,r){try{r=l(sr,pr(tr,"__proto__").set,2),r({},er)}catch(n){t=!0}e.setPrototypeOf=hr=hr||function(e,n){return R(e),$(null===n||i(n),n,": can't set as prototype!"),t?e.__proto__=n:r(e,n),e}}(),B(Xr,it,e)}(),!function(){function e(e,t){var r=Pt[e],n=zr[it][e],o=0,a={};if(!n||or(n)){a[e]=1==t?function(e){return i(e)?r(e):e}:2==t?function(e){return i(e)?r(e):!0}:3==t?function(e){return i(e)?r(e):!1}:4==t?function(e,t){return r(f(e),t)}:function(e){return r(f(e))};try{r(ir)}catch(s){o=1}B(Xr+Wr*o,it,a)}}e("freeze",1),e("seal",1),e("preventExtensions",1),e("isFrozen",2),e("isSealed",2),e("isExtensible",3),e("getOwnPropertyDescriptor",4),e("getPrototypeOf"),e("keys"),e("getOwnPropertyNames")}(),!function(e){B(Xr,ut,{EPSILON:Mr(2,-52),isFinite:function(e){return"number"==typeof e&&qt(e)},isInteger:e,isNaN:_,isSafeInteger:function(t){return e(t)&&Er(t)<=Sr},MAX_SAFE_INTEGER:Sr,MIN_SAFE_INTEGER:-Sr,parseFloat:parseFloat,parseInt:Wt})}(Lt.isInteger||function(e){return!i(e)&&qt(e)&&Cr(e)===e}),!function(){function e(t){return qt(t=+t)&&0!=t?0>t?-e(-t):i(t+o(t*t+1)):t}function t(e){return 0==(e=+e)?e:e>-1e-6&&1e-6>e?e+e*e/2:n(e)-1}var r=Vt.E,n=Vt.exp,i=Vt.log,o=Vt.sqrt,a=Vt.sign||function(e){return 0==(e=+e)||e!=e?e:0>e?-1:1};B(Xr,gt,{acosh:function(e){return(e=+e)<1?0/0:qt(e)?i(e/r+o(e+1)*o(e-1)/r)+1:e},asinh:e,atanh:function(e){return 0==(e=+e)?e:i((1+e)/(1-e))/2},cbrt:function(e){return a(e=+e)*Mr(Er(e),1/3)},clz32:function(e){return(e>>>=0)?32-e[wt](2).length:32},cosh:function(e){return(n(e=+e)+n(-e))/2},expm1:t,fround:function(e){return new Float32Array([e])[0]},hypot:function(){for(var e,t=0,r=arguments.length,n=r,i=Rt(r),a=-nr;r--;){if(e=i[r]=+arguments[r],e==nr||e==-nr)return nr;
e>a&&(a=e)}for(a=e||1;n--;)t+=Mr(i[n]/a,2);return a*o(t)},imul:function(e,t){var r=65535,n=+e,i=+t,o=r&n,a=r&i;return 0|o*a+((r&n>>>16)*a+o*(r&i>>>16)<<16>>>0)},log1p:function(e){return(e=+e)>-1e-8&&1e-8>e?e-e*e/2:i(1+e)},log10:function(e){return i(e)/Vt.LN10},log2:function(e){return i(e)/Vt.LN2},sign:a,sinh:function(e){return Er(e=+e)<1?(t(e)-t(-e))/2:(n(e-1)-n(-e-1))*(r/2)},tanh:function(e){var r=t(e=+e),i=t(-e);return r==nr?1:i==nr?-1:(r-i)/(n(e)+n(-e))},trunc:Pr})}(),!function(e){function t(e){if(s(e)==ct)throw Bt()}B(Xr,st,{fromCodePoint:function(){for(var t,r=[],n=arguments.length,i=0;n>i;){if(t=+arguments[i++],E(t,1114111)!==t)throw It(t+" is not a valid code point");r.push(65536>t?e(t):e(((t-=65536)>>10)+55296,t%1024+56320))}return r.join("")},raw:function(e){for(var t=f(e.raw),r=M(t.length),n=arguments.length,i=[],o=0;r>o;)i.push(Ot(t[o++])),n>o&&i.push(Ot(arguments[o]));return i.join("")}}),B(Yr,st,{codePointAt:A(!1),endsWith:function(e){t(e);var r=Ot(k(this)),i=arguments[1],o=M(r.length),a=i===n?o:$r(M(i),o);return e+="",r.slice(a-e.length,a)===e},includes:function(e){return t(e),!!~Ot(k(this)).indexOf(e,arguments[1])},repeat:function(e){var t=Ot(k(this)),r="",n=S(e);if(0>n||n==nr)throw It("Count can't be negative");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r},startsWith:function(e){t(e);var r=Ot(k(this)),n=M($r(arguments[1],r.length));return e+="",r.slice(n,n+e.length)===e}})}(Ot.fromCharCode),!function(){B(Xr+Wr*K(Rt.from),at,{from:function(e){var t,r,i,o=Pt(k(e)),a=arguments[1],s=a!==n,u=s?l(a,arguments[2],2):n,c=0;if(q(o))r=new(w(this,Rt)),Z(function(e){for(;!(i=e.next()).done;c++)r[c]=s?u(i.value,c):i.value},X(o));else for(r=new(w(this,Rt))(t=M(o.length));t>c;c++)r[c]=s?u(o[c],c):o[c];return r.length=c,r}}),B(Xr,at,{of:function(){for(var e=0,t=arguments.length,r=new(w(this,Rt))(t);t>e;)r[e]=arguments[e++];return r.length=t,r}}),V(Rt)}(),!function(){B(Yr,at,{copyWithin:function(e,t){var r=Pt(k(this)),i=M(r.length),o=E(e,i),a=E(t,i),s=arguments[2],u=s===n?i:E(s,i),c=$r(u-a,i-o),l=1;for(o>a&&a+c>o&&(l=-1,a=a+c-1,o=o+c-1);c-->0;)a in r?r[o]=r[a]:delete r[o],o+=l,a+=l;return r},fill:function(e){for(var t=Pt(k(this)),r=M(t.length),i=E(arguments[1],r),o=arguments[2],a=o===n?r:E(o,r);a>i;)t[i++]=e;return t},find:b(5),findIndex:b(6)}),r&&(_r.call(y("find,findIndex,fill,copyWithin,entries,keys,values"),function(e){Ur[e]=!0}),Nr in er||Fr(er,Nr,Ur))}(),!function(e){H(Rt,at,function(e,t){jr(this,Zr,{o:f(e),i:0,k:t})},function(){var e=this[Zr],t=e.o,r=e.k,i=e.i++;return!t||i>=t.length?(e.o=n,W(1)):r==Jr?W(0,i):r==en?W(0,t[i]):W(0,[i,t[i]])},en),tn[yt]=tn[at],H(Ot,st,function(e){jr(this,Zr,{o:Ot(e),i:0})},function(){var t,r=this[Zr],n=r.o,i=r.i;return i>=n.length?W(1):(t=e.call(n,i),r.i+=t.length,W(0,t))})}(A(!0)),o(Gt)&&o(Ht)||function(t){function r(e){if(yr(m,e)){var t=m[e];delete m[e],t()}}function n(e){r(e.data)}var i,a,s,u=e.postMessage,f=e.addEventListener,p=e.MessageChannel,d=0,m={};Gt=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return m[++d]=function(){h(o(e)?e:kt(e),t)},i(d),d},Ht=function(e){delete m[e]},Ir?i=function(e){Yt(c.call(r,e))}:f&&o(u)&&!e.importScripts?(i=function(e){u(e,"*")},f("message",n,!1)):o(p)?(a=new p,s=a.port2,a.port1.onmessage=n,i=l(s.postMessage,s,1)):i=Kt&&t in Kt[$t]("script")?function(e){Qt.appendChild(Kt[$t]("script"))[t]=function(){Qt.removeChild(this),r(e)}}:function(e){zt(r,0,e)}}("onreadystatechange"),B(qr+Kr,{setImmediate:Gt,clearImmediate:Ht}),!function(e,t){o(e)&&o(e.resolve)&&e.resolve(t=new e(function(){}))==t||function(t,r){function a(e){var t;return i(e)&&(t=e.then),o(t)?t:!1}function s(e){var t,n=e[r],i=n.c,o=0;if(n.h)return!0;for(;i.length>o;)if(t=i[o++],t.fail||s(t.P))return!0}function u(e,r){var n=e.c;(r||n.length)&&t(function(){var t=e.p,i=e.v,u=1==e.s,c=0;if(r&&!s(t))zt(function(){s(t)||(Ir?!Xt.emit("unhandledRejection",i,t):o(Jt.error)&&Jt.error("Unhandled promise rejection",i))},1e3);else for(;n.length>c;)!function(t){var r,n,o=u?t.ok:t.fail;try{o?(u||(e.h=!0),r=o===!0?i:o(i),r===t.P?t.rej(Bt(vt+"-chain cycle")):(n=a(r))?n.call(r,t.res,t.rej):t.res(r)):t.rej(i)}catch(s){t.rej(s)}}(n[c++]);n.length=0})}function c(e){var t,r,n=this;if(!n.d){n.d=!0,n=n.r||n;try{(t=a(e))?(r={r:n,d:!1},t.call(e,l(c,r,1),l(h,r,1))):(n.v=e,n.s=1,u(n))}catch(i){h.call(r||{r:n,d:!1},i)}}}function h(e){var t=this;t.d||(t.d=!0,t=t.r||t,t.v=e,t.s=2,u(t,!0))}function f(e){var t=R(e)[Br];return t!=n?t:e}e=function(t){P(t),O(this,e,vt);var i={p:this,c:[],s:0,d:!1,v:n,h:!1};Fr(this,r,i);try{t(l(c,i,1),l(h,i,1))}catch(o){h.call(i,o)}},U(e[bt],{then:function(t,i){var a=R(R(this)[xt])[Br],s={ok:o(t)?t:!0,fail:o(i)?i:!1},c=s.P=new(a!=n?a:e)(function(e,t){s.res=P(e),s.rej=P(t)}),l=this[r];return l.c.push(s),l.s&&u(l),c},"catch":function(e){return this.then(n,e)}}),U(e,{all:function(e){var t=f(this),r=[];return new t(function(n,i){J(e,!1,wr,r);var o=r.length,a=Rt(o);o?_r.call(r,function(e,r){t.resolve(e).then(function(e){a[r]=e,--o||n(a)},i)}):n(a)})},race:function(e){var t=f(this);return new t(function(r,n){J(e,!1,function(e){t.resolve(e).then(r,n)})})},reject:function(e){return new(f(this))(function(t,r){r(e)})},resolve:function(e){return i(e)&&r in e&&lr(e)===this[bt]?e:new(f(this))(function(t){t(e)})}})}(Yt||Gt,Dr("record")),a(e,vt),V(e),B(qr+Wr*!or(e),{Promise:e})}(e[vt]),!function(){function e(e,t,i,o,s,u){function c(e,t){return t!=n&&J(t,s,e[p],e),e}function l(e,t){var n=d[e];r&&(d[e]=function(e,r){var i=n.call(this,0===e?0:e,r);return t?this:i})}var p=s?"set":"add",d=e&&e[bt],y={};if(or(e)&&(u||!nn&&yr(d,Et)&&yr(d,"entries"))){var x,w=e,_=new e,S=_[p](u?{}:-0,1);K(function(t){new e(t)})&&(e=function(r){return O(this,e,t),c(new w,r)},e[bt]=d,r&&(d[xt]=e)),u||_[Et](function(e,t){x=1/t===-nr}),x&&(l("delete"),l("has"),s&&l("get")),(x||S!==_)&&l(p,!0)}else e=u?function(r){O(this,e,t),jr(this,h,b++),c(this,r)}:function(r){var i=this;O(i,e,t),jr(i,f,cr(null)),jr(i,g,0),jr(i,m,n),jr(i,v,n),c(i,r)},U(U(e[bt],i),o),u||!Or||fr(e[bt],"size",{get:function(){return k(this[g])}});return a(e,t),V(e),y[t]=e,B(qr+Qr+Wr*!or(e),y),u||H(e,t,function(e,t){jr(this,Zr,{o:e,k:t})},function(){for(var e=this[Zr],t=e.k,r=e.l;r&&r.r;)r=r.p;return e.o&&(e.l=r=r?r.n:e.o[v])?t==Jr?W(0,r.k):t==en?W(0,r.v):W(0,[r.k,r.v]):(e.o=n,W(1))},s?Jr+en:en,!s),e}function t(e,t){if(!i(e))return("string"==typeof e?"S":"P")+e;if(gr(e))return"F";if(!yr(e,h)){if(!t)return"E";Fr(e,h,++b)}return"O"+e[h]}function o(e,r){var n,i=t(r);if("F"!=i)return e[f][i];for(n=e[v];n;n=n.n)if(n.k==r)return n}function s(e,r,i){var a,s,u=o(e,r);return u?u.v=i:(e[m]=u={i:s=t(r,!0),k:r,v:i,p:a=e[m],n:n,r:!1},e[v]||(e[v]=u),a&&(a.n=u),e[g]++,"F"!=s&&(e[f][s]=u)),e}function u(e,t,r){return gr(R(t))?c(e).set(t,r):(yr(t,p)||Fr(t,p,{}),t[p][e[h]]=r),e}function c(e){return e[d]||Fr(e,d,new Ft)[d]}var h=Dr("uid"),f=Dr("O1"),p=Dr("weak"),d=Dr("leak"),m=Dr("last"),v=Dr("first"),g=Or?Dr("size"):"size",b=0,x={},w={clear:function(){for(var e=this,t=e[f],r=e[v];r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=n),delete t[r.i];e[v]=e[m]=n,e[g]=0},"delete":function(e){var t=this,r=o(t,e);if(r){var n=r.n,i=r.p;delete t[f][r.i],r.r=!0,i&&(i.n=n),n&&(n.p=i),t[v]==r&&(t[v]=n),t[m]==r&&(t[m]=i),t[g]--}return!!r},forEach:function(e){for(var t,r=l(e,arguments[1],3);t=t?t.n:this[v];)for(r(t.v,t.k,this);t&&t.r;)t=t.p},has:function(e){return!!o(this,e)}};Ft=e(Ft,ht,{get:function(e){var t=o(this,e);return t&&t.v},set:function(e,t){return s(this,0===e?0:e,t)}},w,!0),jt=e(jt,ft,{add:function(e){return s(this,e=0===e?0:e,e)}},w);var _={"delete":function(e){return i(e)?gr(e)?c(this)["delete"](e):yr(e,p)&&yr(e[p],this[h])&&delete e[p][this[h]]:!1},has:function(e){return i(e)?gr(e)?c(this).has(e):yr(e,p)&&yr(e[p],this[h]):!1}};Dt=e(Dt,pt,{get:function(e){if(i(e)){if(gr(e))return c(this).get(e);if(yr(e,p))return e[p][this[h]]}},set:function(e,t){return u(this,e,t)}},_,!0,!0),r&&7!=(new Dt).set(Pt.freeze(x),7).get(x)&&_r.call(y("delete,has,get,set"),function(e){var t=Dt[bt][e];Dt[bt][e]=function(r,n){if(i(r)&&gr(r)){var o=c(this)[e](r,n);return"set"==e?this:o}return t.call(this,r,n)}}),Nt=e(Nt,dt,{add:function(e){return u(this,e,!0)}},_,!1,!0)}(),!function(){function e(e){var t,r=[];for(t in e)r.push(t);jr(this,Zr,{o:e,a:r,i:0})}function t(e){return function(t){R(t);try{return e.apply(n,arguments),!0}catch(r){return!1}}}function r(e,t){var o,a=arguments.length<3?e:arguments[2],s=pr(R(e),t);return s?yr(s,"value")?s.value:s.get===n?n:s.get.call(a):i(o=lr(e))?r(o,t,a):n}function o(e,t,r){var a,s,u=arguments.length<4?e:arguments[3],c=pr(R(e),t);if(!c){if(i(s=lr(e)))return o(s,t,r,u);c=L(0)}return yr(c,"value")?c.writable!==!1&&i(u)?(a=pr(u,t)||L(0),a.value=r,fr(u,t,a),!0):!1:c.set===n?!1:(c.set.call(u,r),!0)}z(e,it,function(){var e,t=this[Zr],r=t.a;do if(t.i>=r.length)return W(1);while(!((e=r[t.i++])in t.o));return W(0,e)});var a=Pt.isExtensible||p,s={apply:l(sr,ur,3),construct:function(e,t){var r=P(arguments.length<3?e:arguments[2])[bt],n=cr(i(r)?r:tr),o=ur.call(e,n,t);return i(o)?o:n},defineProperty:t(fr),deleteProperty:function(e,t){var r=pr(R(e),t);return r&&!r.configurable?!1:delete e[t]},enumerate:function(t){return new e(R(t))},get:r,getOwnPropertyDescriptor:function(e,t){return pr(R(e),t)},getPrototypeOf:function(e){return lr(R(e))},has:function(e,t){return t in e},isExtensible:function(e){return!!a(R(e))},ownKeys:v,preventExtensions:t(Pt.preventExtensions||p),set:o};hr&&(s.setPrototypeOf=function(e,t){return hr(R(e),t),!0}),B(qr,{Reflect:{}}),B(Xr,"Reflect",s)}(),!function(){function e(e){return function(t){var r,n=f(t),i=dr(t),o=i.length,a=0,s=Rt(o);if(e)for(;o>a;)s[a]=[r=i[a++],n[r]];else for(;o>a;)s[a]=n[i[a++]];return s}}B(Yr,at,{includes:x(!0)}),B(Yr,st,{at:A(!0)}),B(Xr,it,{getOwnPropertyDescriptors:function(e){var t=f(e),r={};return _r.call(v(t),function(e){fr(r,e,L(0,pr(t,e)))}),r},values:e(!1),entries:e(!0)}),B(Xr,ct,{escape:C(/([\\\-[\]{}()*+?.,^$|])/g,"\\$1",!0)})}(),!function(e){function t(e){if(e){var t=e[bt];Fr(t,et,t.get),Fr(t,r,t.set),Fr(t,n,t["delete"])}}et=N(e+"Get",!0);var r=N(e+ft,!0),n=N(e+"Delete",!0);B(Xr,mt,{referenceGet:et,referenceSet:r,referenceDelete:n}),Fr(rr,et,d),t(Ft),t(Dt)}("reference"),!function(e){function t(e,t){jr(this,Zr,{o:f(e),a:dr(e),i:0,k:t})}function r(e){return function(r){return new t(r,e)}}function o(e){var t=1==e,r=4==e;return function(i,o,a){var s,u,c,h=l(o,a,3),p=f(i),d=t||7==e||2==e?new(w(this,tt)):n;for(s in p)if(yr(p,s)&&(u=p[s],c=h(u,s,i),e))if(t)d[s]=c;else if(c)switch(e){case 2:d[s]=u;break;case 3:return!0;case 5:return u;case 6:return s;case 7:d[c[0]]=c[1]}else if(r)return!1;return 3==e||r?r:d}}function a(e){return function(t,r,i){P(r);var o,a,s,u=f(t),c=dr(u),l=c.length,h=0;for(e?o=i==n?new(w(this,tt)):Pt(i):arguments.length<3?($(l,Rr),o=u[c[h++]]):o=Pt(i);l>h;)if(yr(u,a=c[h++]))if(s=r(o,u[a],a,t),e){if(s===!1)break}else o=s;return o}}function s(e,t){return(t==t?g(e,t):u(e,_))!==n}tt=function(e){var t=cr(null);return e!=n&&(q(e)?J(e,!0,function(e,r){t[e]=r}):xr(t,e)),t},tt[bt]=null,z(t,e,function(){var e,t=this[Zr],r=t.o,i=t.a,o=t.k;do if(t.i>=i.length)return t.o=n,W(1);while(!yr(r,e=i[t.i++]));return o==Jr?W(0,e):o==en?W(0,r[e]):W(0,[e,r[e]])});var u=o(6),c={keys:r(Jr),values:r(en),entries:r(Jr+en),forEach:o(0),map:o(1),filter:o(2),some:o(3),every:o(4),find:o(5),findKey:u,mapPairs:o(7),reduce:a(!1),turn:a(!0),keyOf:g,includes:s,has:yr,get:m,set:j(0),isDict:function(e){return i(e)&&lr(e)===tt[bt]}};if(et)for(var p in c)!function(e){function t(){for(var t=[this],r=0;r<arguments.length;)t.push(arguments[r++]);return h(e,t)}e[et]=function(){return t}}(c[p]);B(qr+Wr,{Dict:U(tt,c)})}("Dict"),!function(e,t){function r(t,n){return this instanceof r?(this[Zr]=X(t),void(this[e]=!!n)):new r(t,n)}function i(r){function n(r,n,i){this[Zr]=X(r),this[e]=r[e],this[t]=l(n,i,r[e]?2:1)}return z(n,"Chain",r,o),I(n[bt],d),n}z(r,"Wrapper",function(){return this[Zr].next()});var o=r[bt];I(o,function(){return this[Zr]});var a=i(function(){var r=this[Zr].next();return r.done?r:W(0,Y(this[t],r.value,this[e]))}),s=i(function(){for(;;){var r=this[Zr].next();if(r.done||Y(this[t],r.value,this[e]))return r}});U(o,{of:function(t,r){J(this,this[e],t,r)},array:function(e,t){var r=[];return J(e!=n?this.map(e,t):this,!1,wr,r),r},filter:function(e,t){return new s(this,e,t)},map:function(e,t){return new a(this,e,t)}}),r.isIterable=q,r.getIterator=X,B(qr+Wr,{$for:r})}("entries",Dr("fn")),B(qr+Wr,{delay:function(e){return new Promise(function(t){zt(t,e,!0)})}}),!function(e,t){function r(r){var i=this,o={};return Fr(i,e,function(e){return e!==n&&e in i?yr(o,e)?o[e]:o[e]=l(i[e],i,-1):t.call(i)})[e](r)}zr._=Gr._=Gr._||{},B(Yr+Wr,ot,{part:c,only:function(e,t){var r=P(this),n=M(e),i=arguments.length>1;return function(){for(var e=$r(n,arguments.length),o=Rt(e),a=0;e>a;)o[a]=arguments[a++];return h(r,o,i?t:this)}}}),Fr(Gr._,wt,function(){return e}),Fr(tr,e,r),Or||Fr(er,e,r)}(Or?D("tie"):St,tr[St]),!function(){function e(e,t){for(var r,n=v(f(t)),i=n.length,o=0;i>o;)fr(e,r=n[o++],pr(t,r));return e}B(Xr+Wr,it,{isObject:i,classof:u,define:e,make:function(t,r){return e(cr(t),r)}})}(),B(Yr+Wr,at,{turn:function(e,t){P(e);for(var r=t==n?[]:Pt(t),i=br(this),o=M(i.length),a=0;o>a&&e(r,i[a],a++,this)!==!1;);return r}}),r&&(Ur.turn=!0),!function(e){function t(e){jr(this,Zr,{l:M(e),i:0})}z(t,ut,function(){var e=this[Zr],t=e.i++;return t<e.l?W(0,t):W(1)}),G(Lt,ut,function(){return new t(this)}),e.random=function(e){var t=+this,r=e==n?0:+e,i=$r(t,r);return kr()*(Ar(t,r)-i)+i},_r.call(y("round,floor,ceil,abs,sin,asin,cos,acos,tan,atan,exp,sqrt,max,min,pow,atan2,acosh,asinh,atanh,cbrt,clz32,cosh,expm1,hypot,imul,log1p,log10,log2,sign,sinh,tanh,trunc"),function(t){var r=Vt[t];r&&(e[t]=function(){for(var e=[+this],t=0;arguments.length>t;)e.push(arguments[t++]);return h(r,e)})}),B(Yr+Wr,ut,e)}({}),!function(){var e,t={"&":"&","<":"<",">":">",'"':""","'":"'"},r={};for(e in t)r[t[e]]=e;B(Yr+Wr,st,{escapeHTML:C(/[&<>"']/g,t),unescapeHTML:C(/&(?:amp|lt|gt|quot|apos);/g,r)})}(),!function(e,t,r,n,i,o,a,s,u){function c(t){return function(c,l){function h(e){return f[t+e]()}var f=this,p=r[yr(r,l)?l:n];return Ot(c).replace(e,function(e){switch(e){case"s":return h(i);case"ss":return T(h(i));case"m":return h(o);case"mm":return T(h(o));case"h":return h(a);case"hh":return T(h(a));case"D":return h(lt);case"DD":return T(h(lt));case"W":return p[0][h("Day")];case"N":return h(s)+1;case"NN":return T(h(s)+1);case"M":return p[2][h(s)];case"MM":return p[1][h(s)];case"Y":return h(u);case"YY":return T(h(u)%100)}return e})}}function l(e,n){function i(e){var r=[];return _r.call(y(n.months),function(n){r.push(n.replace(t,"$"+e))}),r}return r[e]=[y(n.weekdays),i(1),i(2)],zr}B(Yr+Wr,lt,{format:c("get"),formatUTC:c("getUTC")}),l(n,{weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday",months:"January,February,March,April,May,June,July,August,September,October,November,December"}),l("ru",{weekdays:"Воскресенье,Понедельник,Вторник,Среда,Четверг,Пятница,Суббота",months:"Январ:я|ь,Феврал:я|ь,Март:а|,Апрел:я|ь,Ма:я|й,Июн:я|ь,Июл:я|ь,Август:а|,Сентябр:я|ь,Октябр:я|ь,Ноябр:я|ь,Декабр:я|ь"}),zr.locale=function(e){return yr(r,e)?n=e:n},zr.addLocale=l}(/\b\w\w?\b/g,/:(.*)\|(.*)$/,{},"en","Seconds","Minutes","Hours","Month","FullYear"),B(qr+Wr,{global:e}),!function(e){function t(t,r){_r.call(y(t),function(t){t in er&&(e[t]=l(sr,er[t],r))})}t("pop,reverse,shift,keys,values,entries",1),t("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3),t("join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill,turn"),B(Xr,at,e)}({}),!function(e){!r||!e||rt in e[bt]||Fr(e[bt],rt,tn[at]),tn.NodeList=tn[at]}(e.NodeList),!function(e,t){_r.call(y("assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,isIndependentlyComposed,log,markTimeline,profile,profileEnd,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn"),function(r){e[r]=function(){return t&&r in Jt?ur.call(Jt[r],Jt,arguments):void 0}}),B(qr+Wr,{log:xr(e.log,e,{enable:function(){t=!0},disable:function(){t=!1}})})}({},!0)}("undefined"!=typeof self&&self.Math===Math?self:Function("return this")(),!1),t.exports={"default":t.exports,__esModule:!0}},{}],23:[function(e,t){(function(r){var n="object"==typeof r?r:"object"==typeof window?window:this,i=Object.prototype.hasOwnProperty,o=i.call(n,"regeneratorRuntime"),a=o&&n.regeneratorRuntime;delete n.regeneratorRuntime,t.exports=e("./runtime"),o?n.regeneratorRuntime=a:delete n.regeneratorRuntime,t.exports={"default":t.exports,__esModule:!0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./runtime":24}],24:[function(e,t){(function(r){"use strict";var n=e("babel-runtime/core-js")["default"];!function(e){function r(e,t,r,n){return new s(e,t,r||null,n||[])}function i(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(n){return{type:"throw",arg:n}}}function o(){}function a(){}function s(e,t,r,n){function o(t,n){if(u===x)throw new Error("Generator is already running");if(u===w)return f();for(;;){var o=s.delegate;if(o){var a=i(o.iterator[t],o.iterator,n);if("throw"===a.type){s.delegate=null,t="throw",n=a.arg;continue}t="next",n=p;var c=a.arg;if(!c.done)return u=b,c;s[o.resultName]=c.value,s.next=o.nextLoc,s.delegate=null}if("next"===t){if(u===y&&"undefined"!=typeof n)throw new TypeError("attempt to send "+JSON.stringify(n)+" to newborn generator");u===b?s.sent=n:delete s.sent}else if("throw"===t){if(u===y)throw u=w,n;s.dispatchException(n)&&(t="next",n=p)}else"return"===t&&s.abrupt("return",n);u=x;var a=i(e,r,s);if("normal"===a.type){u=s.done?w:b;var c={value:a.arg,done:s.done};if(a.arg!==_)return c;s.delegate&&"next"===t&&(n=p)}else"throw"===a.type&&(u=w,"next"===t?s.dispatchException(a.arg):n=a.arg)}}var a=t?Object.create(t.prototype):this,s=new l(n),u=y;return a.next=o.bind(a,"next"),a["throw"]=o.bind(a,"throw"),a["return"]=o.bind(a,"return"),a}function u(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function c(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function l(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(u,this),this.reset()}function h(e){if(e){var t=e[m];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function i(){for(;++r<e.length;)if(d.call(e,r))return i.value=e[r],i.done=!1,i;return i.value=p,i.done=!0,i};return n.next=n}}return{next:f}}function f(){return{value:p,done:!0}}var p,d=Object.prototype.hasOwnProperty,m="function"==typeof n.Symbol&&n.Symbol.iterator||"@@iterator",v="object"==typeof t,g=e.regeneratorRuntime;if(g)return void(v&&(t.exports=g));g=e.regeneratorRuntime=v?t.exports:{},g.wrap=r;var y="suspendedStart",b="suspendedYield",x="executing",w="completed",_={},S=a.prototype=s.prototype;o.prototype=S.constructor=a,a.constructor=o,o.displayName="GeneratorFunction",g.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return t?t===o||"GeneratorFunction"===(t.displayName||t.name):!1},g.mark=function(e){return e.__proto__=a,e.prototype=Object.create(S),e},g.async=function(e,t,o,a){return new n.Promise(function(s,u){function c(e){var t=i(this,null,e);if("throw"===t.type)return void u(t.arg);var r=t.arg;r.done?s(r.value):n.Promise.resolve(r.value).then(h,f)}var l=r(e,t,o,a),h=c.bind(l.next),f=c.bind(l["throw"]);h()})},S[m]=function(){return this},S.toString=function(){return"[object Generator]"},g.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},g.values=h,l.prototype={constructor:l,reset:function(){this.prev=0,this.next=0,this.sent=p,this.done=!1,this.delegate=null,this.tryEntries.forEach(c);for(var e,t=0;d.call(this,e="t"+t)||20>t;++t)this[e]=null},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){function t(t,n){return o.type="throw",o.arg=e,r.next=t,!!n}if(this.done)throw e;for(var r=this,n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],o=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var a=d.call(i,"catchLoc"),s=d.call(i,"finallyLoc");if(a&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&d.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?this.next=i.finallyLoc:this.complete(o),_},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=e.arg,this.next="end"):"normal"===e.type&&t&&(this.next=t),_},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc)}},"catch":function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;c(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:h(e),resultName:t,nextLoc:r},_}}}("object"==typeof r?r:"object"==typeof window?window:void 0)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"babel-runtime/core-js":22}],25:[function(e,t,r){!function(e){function t(e){"}"===e.n.substr(e.n.length-1)&&(e.n=e.n.substring(0,e.n.length-1))}function r(e){return e.trim?e.trim():e.replace(/^\s*|\s*$/g,"")}function n(e,t,r){if(t.charAt(r)!=e.charAt(0))return!1;for(var n=1,i=e.length;i>n;n++)if(t.charAt(r+n)!=e.charAt(n))return!1;return!0}function i(t,r,n,s){var u=[],c=null,l=null,h=null;for(l=n[n.length-1];t.length>0;){if(h=t.shift(),l&&"<"==l.tag&&!(h.tag in w))throw new Error("Illegal content in < super tag.");if(e.tags[h.tag]<=e.tags.$||o(h,s))n.push(h),h.nodes=i(t,h.tag,n,s);else{if("/"==h.tag){if(0===n.length)throw new Error("Closing tag without opener: /"+h.n);if(c=n.pop(),h.n!=c.n&&!a(h.n,c.n,s))throw new Error("Nesting error: "+c.n+" vs. "+h.n);return c.end=h.i,u}"\n"==h.tag&&(h.last=0==t.length||"\n"==t[0].tag)}u.push(h)}if(n.length>0)throw new Error("missing closing tag: "+n.pop().n);return u}function o(e,t){for(var r=0,n=t.length;n>r;r++)if(t[r].o==e.n)return e.tag="#",!0}function a(e,t,r){for(var n=0,i=r.length;i>n;n++)if(r[n].c==e&&r[n].o==t)return!0}function s(e){var t=[];for(var r in e)t.push('"'+c(r)+'": function(c,p,t,i) {'+e[r]+"}");return"{ "+t.join(",")+" }"}function u(e){var t=[];for(var r in e.partials)t.push('"'+c(r)+'":{name:"'+c(e.partials[r].name)+'", '+u(e.partials[r])+"}");return"partials: {"+t.join(",")+"}, subs: "+s(e.subs)}function c(e){return e.replace(y,"\\\\").replace(m,'\\"').replace(v,"\\n").replace(g,"\\r").replace(b,"\\u2028").replace(x,"\\u2029")}function l(e){return~e.indexOf(".")?"d":"f"}function h(e,t){var r="<"+(t.prefix||""),n=r+e.n+_++;return t.partials[n]={name:e.n,partials:{}},t.code+='t.b(t.rp("'+c(n)+'",c,p,"'+(e.indent||"")+'"));',n}function f(e,t){t.code+="t.b(t.t(t."+l(e.n)+'("'+c(e.n)+'",c,p,0)));'}function p(e){return"t.b("+e+");"}var d=/\S/,m=/\"/g,v=/\n/g,g=/\r/g,y=/\\/g,b=/\u2028/,x=/\u2029/;e.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},e.scan=function(i,o){function a(){y.length>0&&(b.push({tag:"_t",text:new String(y)}),y="")}function s(){for(var t=!0,r=_;r<b.length;r++)if(t=e.tags[b[r].tag]<e.tags._v||"_t"==b[r].tag&&null===b[r].text.match(d),!t)return!1;return t}function u(e,t){if(a(),e&&s())for(var r,n=_;n<b.length;n++)b[n].text&&((r=b[n+1])&&">"==r.tag&&(r.indent=b[n].text.toString()),b.splice(n,1));else t||b.push({tag:"\n"});x=!1,_=b.length}function c(e,t){var n="="+M,i=e.indexOf(n,t),o=r(e.substring(e.indexOf("=",t)+1,i)).split(" ");return S=o[0],M=o[o.length-1],i+n.length-1}var l=i.length,h=0,f=1,p=2,m=h,v=null,g=null,y="",b=[],x=!1,w=0,_=0,S="{{",M="}}";for(o&&(o=o.split(" "),S=o[0],M=o[1]),w=0;l>w;w++)m==h?n(S,i,w)?(--w,a(),m=f):"\n"==i.charAt(w)?u(x):y+=i.charAt(w):m==f?(w+=S.length-1,g=e.tags[i.charAt(w+1)],v=g?i.charAt(w+1):"_v","="==v?(w=c(i,w),m=h):(g&&w++,m=p),x=w):n(M,i,w)?(b.push({tag:v,n:r(y),otag:S,ctag:M,i:"/"==v?x-S.length:w+M.length}),y="",w+=M.length-1,m=h,"{"==v&&("}}"==M?w++:t(b[b.length-1]))):y+=i.charAt(w);return u(x,!0),b};var w={_t:!0,"\n":!0,$:!0,"/":!0};e.stringify=function(t){return"{code: function (c,p,i) { "+e.wrapMain(t.code)+" },"+u(t)+"}"};var _=0;e.generate=function(t,r,n){_=0;var i={code:"",subs:{},partials:{}};return e.walk(t,i),n.asString?this.stringify(i,r,n):this.makeTemplate(i,r,n)},e.wrapMain=function(e){return'var t=this;t.b(i=i||"");'+e+"return t.fl();"},e.template=e.Template,e.makeTemplate=function(e,t,r){var n=this.makePartials(e);return n.code=new Function("c","p","i",this.wrapMain(e.code)),new this.template(n,t,this,r)},e.makePartials=function(e){var t,r={subs:{},partials:e.partials,name:e.name};for(t in r.partials)r.partials[t]=this.makePartials(r.partials[t]);for(t in e.subs)r.subs[t]=new Function("c","p","t","i",e.subs[t]);return r},e.codegen={"#":function(t,r){r.code+="if(t.s(t."+l(t.n)+'("'+c(t.n)+'",c,p,1),c,p,0,'+t.i+","+t.end+',"'+t.otag+" "+t.ctag+'")){t.rs(c,p,function(c,p,t){',e.walk(t.nodes,r),r.code+="});c.pop();}"},"^":function(t,r){r.code+="if(!t.s(t."+l(t.n)+'("'+c(t.n)+'",c,p,1),c,p,1,0,0,"")){',e.walk(t.nodes,r),r.code+="};"},">":h,"<":function(t,r){var n={partials:{},code:"",subs:{},inPartial:!0};e.walk(t.nodes,n);var i=r.partials[h(t,r)];i.subs=n.subs,i.partials=n.partials},$:function(t,r){var n={subs:{},code:"",partials:r.partials,prefix:t.n};e.walk(t.nodes,n),r.subs[t.n]=n.code,r.inPartial||(r.code+='t.sub("'+c(t.n)+'",c,p,i);')},"\n":function(e,t){t.code+=p('"\\n"'+(e.last?"":" + i"))},_v:function(e,t){t.code+="t.b(t.v(t."+l(e.n)+'("'+c(e.n)+'",c,p,0)));'},_t:function(e,t){t.code+=p('"'+c(e.text)+'"')},"{":f,"&":f},e.walk=function(t,r){for(var n,i=0,o=t.length;o>i;i++)n=e.codegen[t[i].tag],n&&n(t[i],r);return r},e.parse=function(e,t,r){return r=r||{},i(e,"",[],r.sectionTags||[])},e.cache={},e.cacheKey=function(e,t){return[e,!!t.asString,!!t.disableLambda,t.delimiters,!!t.modelGet].join("||")},e.compile=function(t,r){r=r||{};var n=e.cacheKey(t,r),i=this.cache[n];if(i){var o=i.partials;for(var a in o)delete o[a].instance;return i}return i=this.generate(this.parse(this.scan(t,r.delimiters),t,r),t,r),this.cache[n]=i}}("undefined"!=typeof r?r:Hogan)},{}],26:[function(e,t){var r=e("./compiler");r.Template=e("./template").Template,r.template=r.Template,t.exports=r},{"./compiler":25,"./template":27}],27:[function(e,t,r){var n={};!function(e){function t(e,t,r){var n;return t&&"object"==typeof t&&(void 0!==t[e]?n=t[e]:r&&t.get&&"function"==typeof t.get&&(n=t.get(e))),n}function r(e,t,r,n,i,o){function a(){}function s(){}a.prototype=e,s.prototype=e.subs;var u,c=new a;c.subs=new s,c.subsText={},c.buf="",n=n||{},c.stackSubs=n,c.subsText=o;for(u in t)n[u]||(n[u]=t[u]);for(u in n)c.subs[u]=n[u];i=i||{},c.stackPartials=i;for(u in r)i[u]||(i[u]=r[u]);for(u in i)c.partials[u]=i[u];return c}function n(e){return String(null===e||void 0===e?"":e)}function i(e){return e=n(e),l.test(e)?e.replace(o,"&").replace(a,"<").replace(s,">").replace(u,"'").replace(c,"""):e}e.Template=function(e,t,r,n){e=e||{},this.r=e.code||this.r,this.c=r,this.options=n||{},this.text=t||"",this.partials=e.partials||{},this.subs=e.subs||{},this.buf=""},e.Template.prototype={r:function(){return""},v:i,t:n,render:function(e,t,r){return this.ri([e],t||{},r)},ri:function(e,t,r){return this.r(e,t,r)},ep:function(e,t){var n=this.partials[e],i=t[n.name];if(n.instance&&n.base==i)return n.instance;if("string"==typeof i){if(!this.c)throw new Error("No compiler available.");i=this.c.compile(i,this.options)}if(!i)return null;if(this.partials[e].base=i,n.subs){t.stackText||(t.stackText={});for(key in n.subs)t.stackText[key]||(t.stackText[key]=void 0!==this.activeSub&&t.stackText[this.activeSub]?t.stackText[this.activeSub]:this.text);i=r(i,n.subs,n.partials,this.stackSubs,this.stackPartials,t.stackText)}return this.partials[e].instance=i,i},rp:function(e,t,r,n){var i=this.ep(e,r);return i?i.ri(t,r,n):""},rs:function(e,t,r){var n=e[e.length-1];if(!h(n))return void r(e,t,this);for(var i=0;i<n.length;i++)e.push(n[i]),r(e,t,this),e.pop()},s:function(e,t,r,n,i,o,a){var s;return h(e)&&0===e.length?!1:("function"==typeof e&&(e=this.ms(e,t,r,n,i,o,a)),s=!!e,!n&&s&&t&&t.push("object"==typeof e?e:t[t.length-1]),s)},d:function(e,r,n,i){var o,a=e.split("."),s=this.f(a[0],r,n,i),u=this.options.modelGet,c=null;if("."===e&&h(r[r.length-2]))s=r[r.length-1];else for(var l=1;l<a.length;l++)o=t(a[l],s,u),void 0!==o?(c=s,s=o):s="";return i&&!s?!1:(i||"function"!=typeof s||(r.push(c),s=this.mv(s,r,n),r.pop()),s)},f:function(e,r,n,i){for(var o=!1,a=null,s=!1,u=this.options.modelGet,c=r.length-1;c>=0;c--)if(a=r[c],o=t(e,a,u),void 0!==o){s=!0;break}return s?(i||"function"!=typeof o||(o=this.mv(o,r,n)),o):i?!1:""},ls:function(e,t,r,i,o){var a=this.options.delimiters;return this.options.delimiters=o,this.b(this.ct(n(e.call(t,i)),t,r)),this.options.delimiters=a,!1},ct:function(e,t,r){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(e,this.options).render(t,r)},b:function(e){this.buf+=e},fl:function(){var e=this.buf;return this.buf="",e},ms:function(e,t,r,n,i,o,a){var s,u=t[t.length-1],c=e.call(u);return"function"==typeof c?n?!0:(s=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(c,u,r,s.substring(i,o),a)):c},mv:function(e,t,r){var i=t[t.length-1],o=e.call(i);return"function"==typeof o?this.ct(n(o.call(i)),i,r):o},sub:function(e,t,r,n){var i=this.subs[e];i&&(this.activeSub=e,i(t,r,this,n),this.activeSub=!1)}};var o=/&/g,a=/</g,s=/>/g,u=/\'/g,c=/\"/g,l=/[&<>\"\']/,h=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}}("undefined"!=typeof r?r:n)},{}],28:[function(e,t){(function(e){var r;if(e.crypto&&crypto.getRandomValues){var n=new Uint8Array(16);r=function(){return crypto.getRandomValues(n),n}}if(!r){var i=new Array(16);r=function(){for(var e,t=0;16>t;t++)0===(3&t)&&(e=4294967296*Math.random()),i[t]=e>>>((3&t)<<3)&255;return i}}t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],29:[function(e,t){function r(e,t,r){var n=t&&r||0,i=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,function(e){16>i&&(t[n+i++]=u[e])});16>i;)t[n+i++]=0;return t}function n(e,t){var r=t||0,n=s;return n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]}function i(e,t,r){var i=t&&r||0,o=t||[];e=e||{};var a=void 0!==e.clockseq?e.clockseq:f,s=void 0!==e.msecs?e.msecs:(new Date).getTime(),u=void 0!==e.nsecs?e.nsecs:d+1,c=s-p+(u-d)/1e4;if(0>c&&void 0===e.clockseq&&(a=a+1&16383),(0>c||s>p)&&void 0===e.nsecs&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");p=s,d=u,f=a,s+=122192928e5;var l=(1e4*(268435455&s)+u)%4294967296;o[i++]=l>>>24&255,o[i++]=l>>>16&255,o[i++]=l>>>8&255,o[i++]=255&l;var m=s/4294967296*1e4&268435455;o[i++]=m>>>8&255,o[i++]=255&m,o[i++]=m>>>24&15|16,o[i++]=m>>>16&255,o[i++]=a>>>8|128,o[i++]=255&a;for(var v=e.node||h,g=0;6>g;g++)o[i+g]=v[g];return t?t:n(o)}function o(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"==e?new Array(16):null,e=null),e=e||{};
var o=e.random||(e.rng||a)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var s=0;16>s;s++)t[i+s]=o[s];return t||n(o)}for(var a=e("./rng"),s=[],u={},c=0;256>c;c++)s[c]=(c+256).toString(16).substr(1),u[s[c]]=c;var l=a(),h=[1|l[0],l[1],l[2],l[3],l[4],l[5]],f=16383&(l[6]<<8|l[7]),p=0,d=0,m=o;m.v1=i,m.v4=o,m.parse=r,m.unparse=n,t.exports=m},{"./rng":28}],30:[function(e,t){t.exports=e("./profile.json")},{"./profile.json":31}],31:[function(e,t){t.exports={name:"DigitalOcean",sizes:{"512mb":{id:"512mb",memory:512,cpus:1,disk:20,transfer:1,price_monthly:5,price_hourly:.00744,locations:["nyc1","sgp1","ams1","sfo1","nyc2","lon1","nyc3","ams3","ams2"]},"1gb":{id:"1gb",memory:1024,cpus:1,disk:30,transfer:2,price_monthly:10,price_hourly:.01488,locations:["nyc2","sgp1","ams1","sfo1","lon1","nyc3","ams3","nyc1","ams2"]},"2gb":{id:"2gb",memory:2048,cpus:2,disk:40,transfer:3,price_monthly:20,price_hourly:.02976,locations:["nyc2","sfo1","ams1","sgp1","lon1","nyc3","ams3","nyc1","ams2"]},"4gb":{id:"4gb",memory:4096,cpus:2,disk:60,transfer:4,price_monthly:40,price_hourly:.05952,locations:["nyc2","ams1","sgp1","lon1","nyc3","ams3","nyc1","ams2","sfo1"]},"8gb":{id:"8gb",memory:8192,cpus:4,disk:80,transfer:5,price_monthly:80,price_hourly:.11905,locations:["nyc2","sgp1","ams1","nyc1","lon1","nyc3","ams3","ams2","sfo1"]},"16gb":{id:"16gb",memory:16384,cpus:8,disk:160,transfer:6,price_monthly:160,price_hourly:.2381,locations:["sgp1","nyc1","nyc3","lon1","nyc2","ams1","ams3","ams2","sfo1"]},"32gb":{id:"32gb",memory:32768,cpus:12,disk:320,transfer:7,price_monthly:320,price_hourly:.47619,locations:["nyc2","sgp1","nyc1","lon1","ams3","nyc3","ams2","sfo1"]},"48gb":{id:"48gb",memory:49152,cpus:16,disk:480,transfer:8,price_monthly:480,price_hourly:.71429,locations:["sgp1","nyc1","lon1","nyc2","ams3","nyc3","ams2","sfo1"]},"64gb":{id:"64gb",memory:65536,cpus:20,disk:640,transfer:9,price_monthly:640,price_hourly:.95238,locations:["sgp1","nyc1","nyc2","lon1","ams3","nyc3","ams2","sfo1"]}},locations:{sfo1:{id:"sfo1",vicinity:"San Francisco 1",physicalLocation:{lat:37.774929,lon:-122.419416},sizes:["32gb","16gb","2gb","1gb","4gb","8gb","512mb","64gb","48gb"]},ams2:{id:"ams2",vicinity:"Amsterdam 2",physicalLocation:{lat:52.370216,lon:4.895168},sizes:["32gb","16gb","2gb","1gb","4gb","8gb","512mb","64gb","48gb"]},sgp1:{id:"sgp1",vicinity:"Singapore 1",physicalLocation:{lat:1.352083,lon:103.819836},sizes:["32gb","16gb","2gb","1gb","4gb","8gb","512mb","64gb","48gb"]},lon1:{id:"lon1",vicinity:"London 1",physicalLocation:{lat:51.507351,lon:-.127758},sizes:["32gb","16gb","2gb","1gb","4gb","8gb","512mb","64gb","48gb"]},nyc3:{id:"nyc3",vicinity:"New York 3",physicalLocation:{lat:40.712784,lon:-74.005941},sizes:["32gb","16gb","2gb","1gb","4gb","8gb","512mb","64gb","48gb"]},ams3:{id:"ams3",vicinity:"Amsterdam 3",physicalLocation:{lat:52.370216,lon:4.895168},sizes:["32gb","16gb","2gb","1gb","4gb","8gb","512mb","64gb","48gb"]}}}},{}],32:[function(e,t){"use strict";function r(e,t){function n(e){var t=c(),r=e,n=r.id,i=r.location,o=r.size,s=r.image,u=r.keys,f=r.userData;return a(t.dropletsCreateNewDroplet.bind(t),n,i,o,s,{ssh_keys:u,user_data:f}).then(l,h).then(function(e){var t,r,n=e,i=(t=n[$traceurRuntime.toProperty(Symbol.iterator)](),(r=t.next()).done?void 0:r.value),o=((r=t.next()).done?void 0:r.value,(r=t.next()).done?void 0:r.value,i.droplet),a={id:o.id,createdAt:o.created_at};return a})}function i(e){var t=c();return a(t.dropletsDeleteDroplet.bind(t),e.response.id).then(l).then(function(){return{success:!0}})}function o(){var e=c();return a(e.dropletsGetAll.bind(e)).then(l).then(function(e){var t,r,n=(t=e[$traceurRuntime.toProperty(Symbol.iterator)](),(r=t.next()).done?void 0:r.value),i=n.droplets;return s.reduce(i,function(e,t){var r=t,n=r.id,i=r.created_at,o=r.name,a=r.networks,u=r.status;return e[o]={id:n,createdAt:i,networks:{v4:s.map(a.v4,function(e){var t=e,r=t.ip_address,n=t.netmask,i=t.gateway,o=t.type;return{ipAddress:r,netmask:n,gateway:i,type:o}}),v6:a.v6},status:u},e},{})})}function u(){var e=c();return a(e.account.bind(e)).then(l).then(function(e){var t,r,n=(t=e[$traceurRuntime.toProperty(Symbol.iterator)](),(r=t.next()).done?void 0:r.value);p.machineLimit=n.account.droplet_limit})}function c(){return new e(t.token,1e3)}function l(e){return new Promise(function(t){var r,n,i,o,a;Array.isArray(e)?(r=e,n=r[$traceurRuntime.toProperty(Symbol.iterator)](),o=(i=n.next()).done?void 0:i.value,a=(i=n.next()).done?void 0:i.value,r):o=a=e,a=a||o;var s=a.headers||f(a,["RateLimit-Limit","RateLimit-Remaining","RateLimit-Reset"]);p.limit=parseInt(s["RateLimit-Limit"]||"0"),p.remaining=parseInt(s["RateLimit-Remaining"]||"0"),p.reset=new Date(1e3*parseInt(s["RateLimit-Reset"]||"0")),t(e)})}function h(e){return new Promise(function(t,n){var i,o,a=e,s=a.error,u=a.args,c=u,l=(i=c[$traceurRuntime.toProperty(Symbol.iterator)](),(o=i.next()).done?void 0:o.value),h=(o=i.next()).done?void 0:o.value;return h=h||l,401===h.statusCode?void n({error:"Unauthorized",data:l,response:h,provider:r.$name}):void n({error:s,data:l,response:h,provider:r.$name})})}function f(e,t){return s.reduce(t,function(t,r){return t[r]=e.getResponseHeader(r),t},{})}var p={limit:void 0,remaining:void 0,resetTime:void 0,machineLimit:void 0};return{createMachine:n,destroyMachine:i,listMachines:o,verifyAccount:u,status:p,MAX_CONCURRENT_CALLS:5}}var n,i,o,a=(n=e("promise-callback"),n&&n.__esModule&&n||{"default":n})["default"],s=(i=e("lodash"),i&&i.__esModule&&i||{"default":i})["default"],u=(o=e("../profile"),o&&o.__esModule&&o||{"default":o})["default"];e("traceur-runtime"),t.exports=function(e){var t={},n={token:{type:"string",header:"Personal Access Token",link:"https://cloud.digitalocean.com/settings/tokens/new",required:!0,environmentVariable:"DO_TOKEN"}};return{name:"digitalocean",targets:["coreos"],api:r(e,t),$rawAPI:e,profile:u,credentials:t,credentialSchema:n,dashboardUrl:"https://cloud.digitalocean.com",referralUrl:"https://www.digitalocean.com/?refcode=4df1a6f6f727",referralTeaser:"Signup for a DigitalOcean account through this referral link to get $10 in free credits and to support cloud-launcher."}}},{"../profile":30,lodash:"lodash","promise-callback":34,"traceur-runtime":36}],33:[function(e,t){"use strict";function r(){function e(e,t,r,i,o){var a=o||{},u=(a.ssh_keys,a.user_data,n.machines);if(u[e])throw new Error("Machine "+e+" already exists!");var c=s[r];if(!c)throw new Error("Size "+r+" doesn't exist!");var h=l[t];if(!h)throw new Error("Location "+t+" doesn't exist!");var f=n.nextMachineId++,p=(new Date).getTime(),d={v4:[],v6:[]},m={id:f,name:e,memory:c.memory,location:t,size:r,image:i,options:o,networks:d,created_at:p,status:"new"};return u[f]=m,m}function t(e){return"new"===e.status?r(e):"active"===e.status,e}function r(e){var t=h.machine["new"].active,r=1e3*f[t.distribution](t),n=(new Date).getTime()-e.created_at;n>r&&(e.status="active",e.networks.v4.push({ip_address:"10.0.0.1",netmask:"255.255.255.0",gateway:"10.0.0.0"}))}var n={nextMachineId:0,machines:{}},i={"RateLimit-Limit":5e3,"RateLimit-Remaining":5e3,"RateLimit-Reset":(new Date).getTime()},o={headers:i},a=u,s=a.sizes,l=a.locations;return function(r){function a(t,r,n,i,a,s){h();try{var u=e(t,r,n,i,a);s(void 0,[{droplet:u},o])}catch(c){s(c)}}function s(e,t){h();var r=n.machines,i=r[e];return i?(delete r[e],void t(void 0,[{success:!0},o])):void t(new Error("No machine with id "+e))}function u(e){h();var r=n.machines;c.each(r,t),e(void 0,[{droplets:c.map(r,function(e){var t=e,r=t.id,n=t.name,i=t.created_at,o=t.networks,a="new";return{id:r,created_at:i,name:n,networks:o,status:a}})},o])}function l(e){h(),r?e(void 0,[{account:{droplet_limit:1e3}},o]):e(new Error("Credentials not defined!"))}function h(){var e=i["RateLimit-Remaining"];if(0===e)throw new Error("Rate Limit Reached!");i["RateLimit-Remaining"]=e-1}return{dropletsCreateNewDroplet:a,dropletsDeleteDroplet:s,dropletsGetAll:u,account:l}}}var n,i,o,a,s=(n=e("./core"),n&&n.__esModule&&n||{"default":n})["default"],u=(i=e("../profile"),i&&i.__esModule&&i||{"default":i})["default"],c=(o=e("lodash"),o&&o.__esModule&&o||{"default":o})["default"],l=(a=e("random-distrib.js"),a&&a.__esModule&&a||{"default":a})["default"],h={machine:{"new":{active:{distribution:"lognormal",a:2,mu:0,sigma:.5}}}},f={lognormal:function(e){return l.lognormal(e.a,e.mu,e.sigma)}};t.exports=function(){return s(r())}},{"../profile":30,"./core":32,lodash:"lodash","random-distrib.js":35}],34:[function(e,t){"use strict";t.exports=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];return new Promise(function(t,n){e.apply(void 0,r.concat([function(e){for(var r=arguments.length,i=Array(r>1?r-1:0),o=1;r>o;o++)i[o-1]=arguments[o];e?n({error:e,args:i}):t(1===i.length?i[0]:i)}]))})}},{}],35:[function(e,t,r){!function(e){var t=e,r=Math.E,n=Math.PI,i=n/2,o=(Math.abs,Math.acos,Math.asin),a=(Math.atan,Math.ceil,Math.cos,Math.exp),s=Math.floor,u=Math.log,c=Math.pow,l=Math.random,h=Math.sin,f=Math.sqrt,p=Math.tan;e.arcsine=function(e,r){var n=h(i*t.uniform(0,1));return e+(r-e)*n*n},e.beta=function(e,r,n,i){if(r>e)return i-(i-n)*t.beta(r,e,0,1);var o=t.gamma(0,1,e),a=t.gamma(0,1,r);return n+(i-n)*o/(o+a)},e.cauchy=function(e,r){return e+r*p(n*t.uniform(-.5,.5))},e.chiSquare=function(e){return t.gamma(0,2,.5*e)},e.cosine=function(e,r){var i=.5*(e+r),a=(r-e)/n;return i+a*o(t.uniform(-1,1))},e.doubleLog=function(e,r){var n=.5*(e+r),i=.5*(r-e);return 0===t.bernoulli(.5)&&(i=-i),n+i*t.uniform(0,1)*t.uniform(0,1)},e.erlang=function(e,r){for(var n=1,i=1;r>i;i++)n*=t.uniform(0,1);return-e*u(n)},e.exponential=function(e,r){return e-r*u(t.uniform(0,1))},e.extremeValue=function(e,r){return e+r*u(-u(t.uniform(0,1)))},e.fRatio=function(e,r){return t.chiSquare(e)/e/(t.chiSquare(r)/r)},e.gamma=function(e,n,i){var o=1/f(2*i-1),s=i-u(4),l=i+1/o,h=4.5,p=1+u(h),d=1+i/r;if(1>i)for(;;){var m=d*t.uniform(0,1);if(m>1){var v=-u((d-m)/i);if(t.uniform(0,1)<=c(v,i-1))return e+n*v}else{var v=c(m,1/i);if(t.uniform(0,1)<=a(-v))return e+n*v}}else{if(1==i)return t.exponential(e,n);for(;;){var g=t.uniform(0,1),y=t.uniform(0,1),b=o*u(g/(1-g)),v=i*a(b),x=g*g*y,w=s+l*b-v;if(w+p-h*x>0||w>=u(x))return e+n*v}}},e.laplace=function(e,r){return 1==t.bernoulli(.5)?e+r*u(t.uniform(0,1)):e-r*u(t.uniform(0,1))},e.logarithmic=function(e,r){var n=e,i=r-e;return n+i*t.uniform(0,1)*t.uniform(0,1)},e.logistic=function(e,r){return e-r*u(1/t.uniform(0,1)-1)},e.lognormal=function(e,r,n){return e+a(t.normal(r,n))},e.normal=function(e,r){var n,i,o;do i=t.uniform(-1,1),o=t.uniform(-1,1),n=i*i+o*o;while(n>=1);return e+r*i*f(-2*u(n)/n)},e.parabolic=function(e,r){var n=function(e,t,r){if(t>e||e>r)return 0;var n=.5*(t+r),i=.5*(r-t),o=3/(4*i);return o*(1-(e-n)*(e-n)/(i*i))},i=.5*(e+r),o=n(i,e+r);return t.userSpecified(n,e,r,0,o)},e.pareto=function(e){return c(t.uniform(0,1),-1/e)},e.pearson5=function(e,r){return 1/t.gamma(0,1/e,r)},e.pearson6=function(e,r,n){return t.gamma(0,e,r)/t.gamma(0,e,n)},e.power=function(e){return c(t.uniform(0,1),1/e)},e.rayleigh=function(e,r){return e+r*f(-u(t.uniform(0,1)))},e.studentT=function(e){return t.normal(0,1)/f(t.chiSquare(e)/e)},e.triangular=function(e,r,n){var i=t.uniform(0,1),o=1-i;return(n-e)/(r-e)>=i?e+f((r-e)*(n-e)*i):r-f((r-e)*(r-n)*o)},e.uniform=function(e,t){return e+(t-e)*l()},e.userSpecified=function(e,r,n,i,o){var a,s,u=(n-r)*(o-i);do a=t.uniform(0,u)/(o-i)+r,s=t.uniform(i,o);while(s>e(a,r,n));return a},e.weibull=function(e,r,n){return e+r*c(-u(t.uniform(0,1)),1/n)},e.bernoulli=function(e){return t.uniform(0,1)<e?0:1},e.binomial=function(e,r){for(var n=0,i=0;e>i;i++)n+=t.bernoulli(r);return n},e.geometric=function(e){return s(u(t.uniform(0,1))/u(1-e))},e.hypergeometric=function(e,r,n){for(var i=0,o=0;e>o;o++,r--){var a=n/r;t.bernoulli(a)&&(i++,n--)}return i},e.negativeBinomial=function(e,r){for(var n=0,i=0;e>i;i++)n+=t.geometric(r);return n},e.pascal=function(e,r){return t.negativeBinomial(e,r)+e},e.poisson=function(e){for(var r=1,n=0;r>=a(-e);n++)r*=t.uniform(0,1);return n-1},e.uniformDiscrete=function(e,r){return e+s((r-e+1)*t.uniform(0,1))}}("undefined"==typeof r?this.random={}:r)},{}],36:[function(e,t){(function(e,r){!function(e){"use strict";function t(e){return{configurable:!0,enumerable:!1,value:e,writable:!0}}function r(){return"__$"+Math.floor(1e9*Math.random())+"$"+ ++B+"$__"}function n(){var e=r();return W[e]=!0,e}function i(e){return"object"==typeof e&&e instanceof s}function o(e){return i(e)?"symbol":typeof e}function a(e){var t=new s(e);if(!(this instanceof a))return t;throw new TypeError("Symbol cannot be new'ed")}function s(e){var t=r();k(this,G,{value:this}),k(this,I,{value:t}),k(this,z,{value:e}),c(this),H[t]=this}function u(e){var t=e[q];return t&&t.self===e?t:N(e)?(Y.hash.value=K++,Y.self.value=e,X.value=A(null,Y),k(e,q,X),X.value):void 0}function c(e){return u(e),P.apply(this,arguments)}function l(e){return u(e),j.apply(this,arguments)}function h(e){return u(e),D.apply(this,arguments)}function f(e){return i(e)?e[I]:e}function p(e){for(var t=[],r=O(e),n=0;n<r.length;n++){var i=r[n];H[i]||W[i]||t.push(i)}return t}function d(e,t){return R(e,f(t))}function m(e){for(var t=[],r=O(e),n=0;n<r.length;n++){var i=H[r[n]];i&&t.push(i)}return t}function v(e){return F.call(this,f(e))}function g(t){return e.traceur&&e.traceur.options[t]}function y(e,t,r){var n,o;return i(t)&&(n=t,t=t[I]),e[t]=r,n&&(o=R(e,t))&&k(e,t,{enumerable:!1}),r}function b(e,t,r){return i(t)&&(r.enumerable&&(r=A(r,{enumerable:{value:!1}})),t=t[I]),k(e,t,r),e}function x(e){k(e,"defineProperty",{value:b}),k(e,"getOwnPropertyNames",{value:p}),k(e,"getOwnPropertyDescriptor",{value:d}),k(e.prototype,"hasOwnProperty",{value:v}),k(e,"freeze",{value:c}),k(e,"preventExtensions",{value:l}),k(e,"seal",{value:h}),e.getOwnPropertySymbols=m}function w(e){for(var t=1;t<arguments.length;t++)for(var r=O(arguments[t]),n=0;n<r.length;n++){var i=r[n];W[i]||!function(t,r){k(e,r,{get:function(){return t[r]},enumerable:!0})}(arguments[t],r[n])}return e}function _(e){return null!=e&&("object"==typeof e||"function"==typeof e)}function S(e){if(null==e)throw C();return T(e)}function M(e){if(null==e)throw new TypeError("Value cannot be converted to an Object");return e}function E(e){e.Symbol=a,e.Reflect=e.Reflect||{},e.Reflect.global=e.Reflect.global||e,x(e.Object)}if(!e.$traceurRuntime){var T=Object,C=TypeError,A=T.create,$=T.defineProperties,k=T.defineProperty,P=T.freeze,R=T.getOwnPropertyDescriptor,O=T.getOwnPropertyNames,L=T.keys,F=T.prototype.hasOwnProperty,j=(T.prototype.toString,Object.preventExtensions),D=Object.seal,N=Object.isExtensible,U={"void":function(){},any:function(){},string:function(){},number:function(){},"boolean":function(){}},V=t,B=0,I=r(),z=r(),G=r(),H=A(null),W=A(null);k(a.prototype,"constructor",t(a)),k(a.prototype,"toString",V(function(){var e=this[G];if(!g("symbols"))return e[I];if(!e)throw TypeError("Conversion from symbol to string");var t=e[z];return void 0===t&&(t=""),"Symbol("+t+")"})),k(a.prototype,"valueOf",V(function(){var e=this[G];if(!e)throw TypeError("Conversion from symbol to string");return g("symbols")?e:e[I]})),k(s.prototype,"constructor",t(a)),k(s.prototype,"toString",{value:a.prototype.toString,enumerable:!1}),k(s.prototype,"valueOf",{value:a.prototype.valueOf,enumerable:!1});var q=n(),X={value:void 0},Y={hash:{value:void 0},self:{value:void 0}},K=0;a.iterator=a(),c(s.prototype),E(e),e.$traceurRuntime={createPrivateName:n,exportStar:w,getOwnHashObject:u,privateNames:W,setProperty:y,setupGlobals:E,toObject:S,isObject:_,toProperty:f,type:U,"typeof":o,checkObjectCoercible:M,hasOwnProperty:function(e,t){return v.call(e,t)},defineProperties:$,defineProperty:k,getOwnPropertyDescriptor:R,getOwnPropertyNames:O,keys:L}}}("undefined"!=typeof r?r:this),function(){"use strict";function e(){for(var e,t=[],r=0,n=0;n<arguments.length;n++){var i=$traceurRuntime.checkObjectCoercible(arguments[n]);if("function"!=typeof i[$traceurRuntime.toProperty(Symbol.iterator)])throw new TypeError("Cannot spread non-iterable object.");for(var o=i[$traceurRuntime.toProperty(Symbol.iterator)]();!(e=o.next()).done;)t[r++]=e.value}return t}$traceurRuntime.spread=e}(),function(){"use strict";function e(e,t){var r=m(e);do{var n=p(r,t);if(n)return n;r=m(r)}while(r);return void 0}function t(e,t,n,i){return r(e,t,n).apply(e,i)}function r(t,r,n){var i=e(r,n);return i?i.get?i.get.call(t):i.value:void 0}function n(t,r,n,i){var o=e(r,n);if(o&&o.set)return o.set.call(t,i),i;throw c("super has no setter '"+n+"'.")}function i(e){for(var t,r={},n=d(e),i=0;i<n.length;i++){var t=n[i];r[t]=p(e,t)}return r}function o(e,t,r,n){return f(t,"constructor",{value:e,configurable:!0,enumerable:!1,writable:!0}),arguments.length>3?("function"==typeof n&&(e.__proto__=n),e.prototype=l(a(n),i(t))):e.prototype=t,f(e,"prototype",{configurable:!1,writable:!1}),h(e,i(r))}function a(e){if("function"==typeof e){var t=e.prototype;if(u(t)===t||null===t)return e.prototype;throw new c("super prototype must be an Object or null")}if(null===e)return null;throw new c("Super expression must either be null or a function, not "+typeof e+".")}function s(e,r,n){null!==m(r)&&t(e,r,"constructor",n)}var u=Object,c=TypeError,l=u.create,h=$traceurRuntime.defineProperties,f=$traceurRuntime.defineProperty,p=$traceurRuntime.getOwnPropertyDescriptor,d=$traceurRuntime.getOwnPropertyNames,m=Object.getPrototypeOf;$traceurRuntime.createClass=o,$traceurRuntime.defaultSuperCall=s,$traceurRuntime.superCall=t,$traceurRuntime.superGet=r,$traceurRuntime.superSet=n}(),function(){"use strict";function e(e){return{configurable:!0,enumerable:!1,value:e,writable:!0}}function t(e){return new Error("Traceur compiler bug: invalid state in state machine: "+e)}function r(){this.state=0,this.GState=g,this.storedException=void 0,this.finallyFallThrough=void 0,this.sent_=void 0,this.returnValue=void 0,this.tryStack_=[]}function n(e,t,r,n){switch(e.GState){case y:throw new Error('"'+r+'" on executing generator');case x:if("next"==r)return{value:void 0,done:!0};throw n;case g:if("throw"===r)throw e.GState=x,n;if(void 0!==n)throw v("Sent value to newborn generator");case b:e.GState=y,e.action=r,e.sent=n;var i=t(e),o=i===e;return o&&(i=e.returnValue),e.GState=o?x:b,{value:i,done:o}}}function i(){}function o(){}function a(e,t,n){var i=l(e,n),o=new r,a=m(t.prototype);return a[S]=o,a[M]=i,a}function s(e){return e.prototype=m(o.prototype),e.__proto__=o,e}function u(){r.call(this),this.err=void 0;var e=this;e.result=new Promise(function(t,r){e.resolve=t,e.reject=r})}function c(e,t){var r=l(e,t),n=new u;return n.createCallback=function(e){return function(t){n.state=e,n.value=t,r(n)}},n.errback=function(e){h(n,e),r(n)},r(n),n.result}function l(e,t){return function(r){for(;;)try{return e.call(t,r)}catch(n){h(r,n)}}}function h(e,t){e.storedException=t;var r=e.tryStack_[e.tryStack_.length-1];return r?(e.state=void 0!==r["catch"]?r["catch"]:r["finally"],void(void 0!==r.finallyFallThrough&&(e.finallyFallThrough=r.finallyFallThrough))):void e.handleException(t)}var f=$traceurRuntime.createPrivateName,p=$traceurRuntime.defineProperties,d=$traceurRuntime.defineProperty,m=Object.create,v=TypeError,g=0,y=1,b=2,x=3,w=-2,_=-3;r.prototype={pushTry:function(e,t){if(null!==t){for(var r=null,n=this.tryStack_.length-1;n>=0;n--)if(void 0!==this.tryStack_[n]["catch"]){r=this.tryStack_[n]["catch"];break}null===r&&(r=_),this.tryStack_.push({"finally":t,finallyFallThrough:r})}null!==e&&this.tryStack_.push({"catch":e})},popTry:function(){this.tryStack_.pop()},get sent(){return this.maybeThrow(),this.sent_},set sent(e){this.sent_=e},get sentIgnoreThrow(){return this.sent_},maybeThrow:function(){if("throw"===this.action)throw this.action="next",this.sent_},end:function(){switch(this.state){case w:return this;case _:throw this.storedException;default:throw t(this.state)}},handleException:function(e){throw this.GState=x,this.state=w,e}};var S=f(),M=f();i.prototype=o,d(o,"constructor",e(i)),o.prototype={constructor:o,next:function(e){return n(this[S],this[M],"next",e)},"throw":function(e){return n(this[S],this[M],"throw",e)}},p(o.prototype,{constructor:{enumerable:!1},next:{enumerable:!1},"throw":{enumerable:!1}}),Object.defineProperty(o.prototype,Symbol.iterator,e(function(){return this})),u.prototype=m(r.prototype),u.prototype.end=function(){switch(this.state){case w:this.resolve(this.returnValue);break;case _:this.reject(this.storedException);break;default:this.reject(t(this.state))}},u.prototype.handleException=function(){this.state=_},$traceurRuntime.asyncWrap=c,$traceurRuntime.initGeneratorFunction=s,$traceurRuntime.createGeneratorInstance=a}(),function(){function e(e,t,r,n,i,o,a){var s=[];return e&&s.push(e,":"),r&&(s.push("//"),t&&s.push(t,"@"),s.push(r),n&&s.push(":",n)),i&&s.push(i),o&&s.push("?",o),a&&s.push("#",a),s.join("")}function t(e){return e.match(s)}function r(e){if("/"===e)return"/";for(var t="/"===e[0]?"/":"",r="/"===e.slice(-1)?"/":"",n=e.split("/"),i=[],o=0,a=0;a<n.length;a++){var s=n[a];switch(s){case"":case".":break;case"..":i.length?i.pop():o++;break;default:i.push(s)}}if(!t){for(;o-->0;)i.unshift("..");0===i.length&&i.push(".")}return t+i.join("/")+r}function n(t){var n=t[u.PATH]||"";return n=r(n),t[u.PATH]=n,e(t[u.SCHEME],t[u.USER_INFO],t[u.DOMAIN],t[u.PORT],t[u.PATH],t[u.QUERY_DATA],t[u.FRAGMENT])}function i(e){var r=t(e);return n(r)}function o(e,r){var i=t(r),o=t(e);if(i[u.SCHEME])return n(i);i[u.SCHEME]=o[u.SCHEME];for(var a=u.SCHEME;a<=u.PORT;a++)i[a]||(i[a]=o[a]);if("/"==i[u.PATH][0])return n(i);var s=o[u.PATH],c=s.lastIndexOf("/");return s=s.slice(0,c+1)+i[u.PATH],i[u.PATH]=s,n(i)}function a(e){if(!e)return!1;if("/"===e[0])return!0;var r=t(e);return r[u.SCHEME]?!0:!1}var s=new RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([\\w\\d\\-\\u0100-\\uffff.%]*)(?::([0-9]+))?)?([^?#]+)?(?:\\?([^#]*))?(?:#(.*))?$"),u={SCHEME:1,USER_INFO:2,DOMAIN:3,PORT:4,PATH:5,QUERY_DATA:6,FRAGMENT:7};$traceurRuntime.canonicalizeUrl=i,$traceurRuntime.isAbsolute=a,$traceurRuntime.removeDotSegments=r,$traceurRuntime.resolveUrl=o}(),function(e){"use strict";function t(e){if(e){var t=m.normalize(e);return u[t]}}function r(e){var t=arguments[1],r=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){var i,o;if(t===d){var a=Object.getOwnPropertyDescriptor(e,n);a.get&&(i=a.get)}i||(o=e[n],i=function(){return o}),Object.defineProperty(r,n,{get:i,enumerable:!0})}),Object.preventExtensions(r),r}var n,i=$traceurRuntime,o=i.canonicalizeUrl,a=i.resolveUrl,s=i.isAbsolute,u=Object.create(null);n=e.location&&e.location.href?a(e.location.href,"./"):"";var c=function(e,t){this.url=e,this.value_=t};$traceurRuntime.createClass(c,{},{});var l=function(e,t){this.message=this.constructor.name+(t?": '"+t+"'":"")+" in "+e};$traceurRuntime.createClass(l,{loadedBy:function(e){this.message+="\n loaded by "+e}},{},Error);var h=function(e,t){$traceurRuntime.superCall(this,f.prototype,"constructor",[e,null]),this.func=t},f=h;$traceurRuntime.createClass(h,{getUncoatedModule:function(){if(this.value_)return this.value_;try{return this.value_=this.func.call(e)}catch(t){if(t instanceof l)throw t.loadedBy(this.url),t;throw new l(this.url,t)}}},{},c);var p=Object.create(null),d={},m={normalize:function(e,t){if("string"!=typeof e)throw new TypeError("module name must be a string, not "+typeof e);if(s(e))return o(e);if(/[^\.]\/\.\.\//.test(e))throw new Error("module name embeds /../: "+e);return"."===e[0]&&t?a(t,e):o(e)},get:function(e){var n=t(e);if(!n)return void 0;var i=p[n.url];return i?i:(i=r(n.getUncoatedModule(),d),p[n.url]=i)},set:function(e,t){e=String(e),u[e]=new h(e,function(){return t}),p[e]=t},get baseURL(){return n},set baseURL(e){n=String(e)},registerModule:function(e,t){var r=m.normalize(e);if(u[r])throw new Error("duplicate module named "+r);u[r]=new h(r,t)},bundleStore:Object.create(null),register:function(e,t,r){t&&(t.length||r.length)?this.bundleStore[e]={deps:t,execute:function(){var e=arguments,n={};t.forEach(function(t,r){return n[t]=e[r]});var i=r.call(this,n);return i.execute.call(this),i.exports}}:this.registerModule(e,r)},getAnonymousModule:function(t){return new r(t.call(e),d)},getForTesting:function(e){var t=this;return this.testingPrefix_||Object.keys(p).some(function(e){var r=/(traceur@[^\/]*\/)/.exec(e);return r?(t.testingPrefix_=r[1],!0):void 0}),this.get(this.testingPrefix_+e)}};m.set("@traceur/src/runtime/ModuleStore",new r({ModuleStore:m}));var v=$traceurRuntime.setupGlobals;$traceurRuntime.setupGlobals=function(e){v(e)},$traceurRuntime.ModuleStore=m,e.System={register:m.register.bind(m),get:m.get,set:m.set,normalize:m.normalize},$traceurRuntime.getModuleImpl=function(e){var r=t(e);return r&&r.getUncoatedModule()}}("undefined"!=typeof r?r:this),System.register("[email protected]/src/runtime/polyfills/utils",[],function(){"use strict";function e(e){return e>>>0}function t(e){return e&&("object"==typeof e||"function"==typeof e)}function r(e){return"function"==typeof e}function n(e){return"number"==typeof e}function i(e){return e=+e,x(e)?0:0!==e&&b(e)?e>0?y(e):g(e):e}function o(e){var t=i(e);return 0>t?0:_(t,M)}function a(e){return t(e)?e[Symbol.iterator]:void 0}function s(e){return r(e)}function u(e,t){return{value:e,done:t}}function c(e,t,r){t in e||Object.defineProperty(e,t,r)}function l(e,t,r){c(e,t,{value:r,configurable:!0,enumerable:!1,writable:!0})}function h(e,t,r){c(e,t,{value:r,configurable:!1,enumerable:!1,writable:!1})}function f(e,t){for(var r=0;r<t.length;r+=2){var n=t[r],i=t[r+1];l(e,n,i)}}function p(e,t){for(var r=0;r<t.length;r+=2){var n=t[r],i=t[r+1];h(e,n,i)}}function d(e,t,r){r&&r.iterator&&!e[r.iterator]&&(e["@@iterator"]&&(t=e["@@iterator"]),Object.defineProperty(e,r.iterator,{value:t,configurable:!0,enumerable:!1,writable:!0}))}function m(e){E.push(e)}function v(e){E.forEach(function(t){return t(e)})}var g=Math.ceil,y=Math.floor,b=isFinite,x=isNaN,w=Math.pow,_=Math.min,S=$traceurRuntime.toObject,M=w(2,53)-1,E=[];return{get toObject(){return S},get toUint32(){return e},get isObject(){return t},get isCallable(){return r},get isNumber(){return n},get toInteger(){return i},get toLength(){return o},get checkIterable(){return a},get isConstructor(){return s},get createIteratorResultObject(){return u},get maybeDefine(){return c},get maybeDefineMethod(){return l},get maybeDefineConst(){return h},get maybeAddFunctions(){return f},get maybeAddConsts(){return p},get maybeAddIterator(){return d},get registerPolyfill(){return m},get polyfillAll(){return v}}}),System.register("[email protected]/src/runtime/polyfills/Map",[],function(){"use strict";function e(e,t){if(i(t)){var r=s(t);return r&&e.objectIndex_[r.hash]}return"string"==typeof t?e.stringIndex_[t]:e.primitiveIndex_[t]}function t(e){e.entries_=[],e.objectIndex_=Object.create(null),e.stringIndex_=Object.create(null),e.primitiveIndex_=Object.create(null),e.deletedCount_=0}function r(e){var t=e,r=t.Object,n=t.Symbol;e.Map||(e.Map=l);var i=e.Map.prototype;i.entries&&(o(i,i.entries,n),o(r.getPrototypeOf((new e.Map).entries()),function(){return this},n))}var n=System.get("[email protected]/src/runtime/polyfills/utils"),i=n.isObject,o=n.maybeAddIterator,a=n.registerPolyfill,s=$traceurRuntime.getOwnHashObject,u=Object.prototype.hasOwnProperty,c={},l=function(){var e=arguments[0];if(!i(this))throw new TypeError("Map called on incompatible type");if(u.call(this,"entries_"))throw new TypeError("Map can not be reentrantly initialised");if(t(this),null!==e&&void 0!==e)for(var r,n=e[Symbol.iterator]();!(r=n.next()).done;){var o=r.value,a=o[0],s=o[1];this.set(a,s)}};return $traceurRuntime.createClass(l,{get size(){return this.entries_.length/2-this.deletedCount_},get:function(t){var r=e(this,t);return void 0!==r?this.entries_[r+1]:void 0},set:function(t,r){var n=i(t),o="string"==typeof t,a=e(this,t);if(void 0!==a)this.entries_[a+1]=r;else if(a=this.entries_.length,this.entries_[a]=t,this.entries_[a+1]=r,n){var u=s(t),c=u.hash;this.objectIndex_[c]=a}else o?this.stringIndex_[t]=a:this.primitiveIndex_[t]=a;return this},has:function(t){return void 0!==e(this,t)},"delete":function(e){var t,r,n=i(e),o="string"==typeof e;if(n){var a=s(e);a&&(t=this.objectIndex_[r=a.hash],delete this.objectIndex_[r])}else o?(t=this.stringIndex_[e],delete this.stringIndex_[e]):(t=this.primitiveIndex_[e],delete this.primitiveIndex_[e]);return void 0!==t?(this.entries_[t]=c,this.entries_[t+1]=void 0,this.deletedCount_++,!0):!1},clear:function(){t(this)},forEach:function(e){for(var t=arguments[1],r=0,n=this.entries_.length;n>r;r+=2){var i=this.entries_[r],o=this.entries_[r+1];i!==c&&e.call(t,o,i,this)}},entries:$traceurRuntime.initGeneratorFunction(function h(){var e,t,r,n;return $traceurRuntime.createGeneratorInstance(function(i){for(;;)switch(i.state){case 0:e=0,t=this.entries_.length,i.state=12;break;case 12:i.state=t>e?8:-2;break;case 4:e+=2,i.state=12;break;case 8:r=this.entries_[e],n=this.entries_[e+1],i.state=9;break;case 9:i.state=r===c?4:6;break;case 6:return i.state=2,[r,n];case 2:i.maybeThrow(),i.state=4;break;default:return i.end()}},h,this)}),keys:$traceurRuntime.initGeneratorFunction(function f(){var e,t,r,n;return $traceurRuntime.createGeneratorInstance(function(i){for(;;)switch(i.state){case 0:e=0,t=this.entries_.length,i.state=12;break;case 12:i.state=t>e?8:-2;break;case 4:e+=2,i.state=12;break;case 8:r=this.entries_[e],n=this.entries_[e+1],i.state=9;break;case 9:i.state=r===c?4:6;break;case 6:return i.state=2,r;case 2:i.maybeThrow(),i.state=4;break;default:return i.end()}},f,this)}),values:$traceurRuntime.initGeneratorFunction(function p(){var e,t,r,n;return $traceurRuntime.createGeneratorInstance(function(i){for(;;)switch(i.state){case 0:e=0,t=this.entries_.length,i.state=12;break;case 12:i.state=t>e?8:-2;break;case 4:e+=2,i.state=12;break;case 8:r=this.entries_[e],n=this.entries_[e+1],i.state=9;break;case 9:i.state=r===c?4:6;break;case 6:return i.state=2,n;case 2:i.maybeThrow(),i.state=4;break;default:return i.end()}},p,this)})},{}),Object.defineProperty(l.prototype,Symbol.iterator,{configurable:!0,writable:!0,value:l.prototype.entries}),a(r),{get Map(){return l},get polyfillMap(){return r}}}),System.get("[email protected]/src/runtime/polyfills/Map"),System.register("[email protected]/src/runtime/polyfills/Set",[],function(){"use strict";function e(e){e.map_=new a}function t(e){var t=e,r=t.Object,n=t.Symbol;e.Set||(e.Set=u);var o=e.Set.prototype;o.values&&(i(o,o.values,n),i(r.getPrototypeOf((new e.Set).values()),function(){return this},n))}var r=System.get("[email protected]/src/runtime/polyfills/utils"),n=r.isObject,i=r.maybeAddIterator,o=r.registerPolyfill,a=System.get("[email protected]/src/runtime/polyfills/Map").Map,s=($traceurRuntime.getOwnHashObject,Object.prototype.hasOwnProperty),u=function(){var t=arguments[0];if(!n(this))throw new TypeError("Set called on incompatible type");if(s.call(this,"map_"))throw new TypeError("Set can not be reentrantly initialised");if(e(this),null!==t&&void 0!==t)for(var r,i=t[Symbol.iterator]();!(r=i.next()).done;){var o=r.value;this.add(o)}};return $traceurRuntime.createClass(u,{get size(){return this.map_.size},has:function(e){return this.map_.has(e)},add:function(e){return this.map_.set(e,e),this},"delete":function(e){return this.map_["delete"](e)},clear:function(){return this.map_.clear()},forEach:function(e){var t=arguments[1],r=this;return this.map_.forEach(function(n,i){e.call(t,i,i,r)})},values:$traceurRuntime.initGeneratorFunction(function c(){var e,t;return $traceurRuntime.createGeneratorInstance(function(r){for(;;)switch(r.state){case 0:e=this.map_.keys()[Symbol.iterator](),r.sent=void 0,r.action="next",r.state=12;break;case 12:t=e[r.action](r.sentIgnoreThrow),r.state=9;break;case 9:r.state=t.done?3:2;break;case 3:r.sent=t.value,r.state=-2;break;case 2:return r.state=12,t.value;default:return r.end()}},c,this)}),entries:$traceurRuntime.initGeneratorFunction(function l(){var e,t;return $traceurRuntime.createGeneratorInstance(function(r){for(;;)switch(r.state){case 0:e=this.map_.entries()[Symbol.iterator](),r.sent=void 0,r.action="next",r.state=12;
break;case 12:t=e[r.action](r.sentIgnoreThrow),r.state=9;break;case 9:r.state=t.done?3:2;break;case 3:r.sent=t.value,r.state=-2;break;case 2:return r.state=12,t.value;default:return r.end()}},l,this)})},{}),Object.defineProperty(u.prototype,Symbol.iterator,{configurable:!0,writable:!0,value:u.prototype.values}),Object.defineProperty(u.prototype,"keys",{configurable:!0,writable:!0,value:u.prototype.values}),o(t),{get Set(){return u},get polyfillSet(){return t}}}),System.get("[email protected]/src/runtime/polyfills/Set"),System.register("[email protected]/node_modules/rsvp/lib/rsvp/asap",[],function(){"use strict";function t(e,t){p[u]=e,p[u+1]=t,u+=2,2===u&&s()}function r(){return function(){e.nextTick(a)}}function n(){var e=0,t=new h(a),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function i(){var e=new MessageChannel;return e.port1.onmessage=a,function(){e.port2.postMessage(0)}}function o(){return function(){setTimeout(a,1)}}function a(){for(var e=0;u>e;e+=2){var t=p[e],r=p[e+1];t(r),p[e]=void 0,p[e+1]=void 0}u=0}var s,u=0,c=t,l="undefined"!=typeof window?window:{},h=l.MutationObserver||l.WebKitMutationObserver,f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,p=new Array(1e3);return s="undefined"!=typeof e&&"[object process]"==={}.toString.call(e)?r():h?n():f?i():o(),{get default(){return c}}}),System.register("[email protected]/src/runtime/polyfills/Promise",[],function(){"use strict";function e(e){return e&&"object"==typeof e&&void 0!==e.status_}function t(e){return e}function r(e){throw e}function n(e){var n=void 0!==arguments[1]?arguments[1]:t,o=void 0!==arguments[2]?arguments[2]:r,a=i(e.constructor);switch(e.status_){case void 0:throw TypeError;case 0:e.onResolve_.push(n,a),e.onReject_.push(o,a);break;case 1:l(e.value_,[n,a]);break;case-1:l(e.value_,[o,a])}return a.promise}function i(e){if(this===b){var t=a(new b(g));return{promise:t,resolve:function(e){s(t,e)},reject:function(e){u(t,e)}}}var r={};return r.promise=new e(function(e,t){r.resolve=e,r.reject=t}),r}function o(e,t,r,n,i){return e.status_=t,e.value_=r,e.onResolve_=n,e.onReject_=i,e}function a(e){return o(e,0,void 0,[],[])}function s(e,t){c(e,1,t,e.onResolve_)}function u(e,t){c(e,-1,t,e.onReject_)}function c(e,t,r,n){0===e.status_&&(l(r,n),o(e,t,r))}function l(e,t){m(function(){for(var r=0;r<t.length;r+=2)h(e,t[r],t[r+1])})}function h(t,r,i){try{var o=r(t);if(o===i.promise)throw new TypeError;e(o)?n(o,i.resolve,i.reject):i.resolve(o)}catch(a){try{i.reject(a)}catch(a){}}}function f(e){return e&&("object"==typeof e||"function"==typeof e)}function p(t,r){if(!e(r)&&f(r)){var n;try{n=r.then}catch(o){var a=x.call(t,o);return r[w]=a,a}if("function"==typeof n){var s=r[w];if(s)return s;var u=i(t);r[w]=u.promise;try{n.call(r,u.resolve,u.reject)}catch(o){u.reject(o)}return u.promise}}return r}function d(e){e.Promise||(e.Promise=y)}var m=System.get("[email protected]/node_modules/rsvp/lib/rsvp/asap")["default"],v=System.get("[email protected]/src/runtime/polyfills/utils").registerPolyfill,g={},y=function(e){if(e!==g){if("function"!=typeof e)throw new TypeError;var t=a(this);try{e(function(e){s(t,e)},function(e){u(t,e)})}catch(r){u(t,r)}}};$traceurRuntime.createClass(y,{"catch":function(e){return this.then(void 0,e)},then:function(i,o){"function"!=typeof i&&(i=t),"function"!=typeof o&&(o=r);var a=this,s=this.constructor;return n(this,function(t){return t=p(s,t),t===a?o(new TypeError):e(t)?t.then(i,o):i(t)},o)}},{resolve:function(t){return this===b?e(t)?t:o(new b(g),1,t):new this(function(e){e(t)})},reject:function(e){return this===b?o(new b(g),-1,e):new this(function(t,r){r(e)})},all:function(e){var t=i(this),r=[];try{var n=e.length;if(0===n)t.resolve(r);else for(var o=0;o<e.length;o++)this.resolve(e[o]).then(function(e,i){r[e]=i,0===--n&&t.resolve(r)}.bind(void 0,o),function(e){t.reject(e)})}catch(a){t.reject(a)}return t.promise},race:function(e){var t=i(this);try{for(var r=0;r<e.length;r++)this.resolve(e[r]).then(function(e){t.resolve(e)},function(e){t.reject(e)})}catch(n){t.reject(n)}return t.promise}});var b=y,x=b.reject,w="@@thenable";return v(d),{get Promise(){return y},get polyfillPromise(){return d}}}),System.get("[email protected]/src/runtime/polyfills/Promise"),System.register("[email protected]/src/runtime/polyfills/StringIterator",[],function(){"use strict";function e(e){var t=String(e),r=Object.create(l.prototype);return r[s(u)]=t,r[s(c)]=0,r}var t,r=System.get("[email protected]/src/runtime/polyfills/utils"),n=r.createIteratorResultObject,i=r.isObject,o=$traceurRuntime,a=o.hasOwnProperty,s=o.toProperty,u=Symbol("iteratedString"),c=Symbol("stringIteratorNextIndex"),l=function(){};return $traceurRuntime.createClass(l,(t={},Object.defineProperty(t,"next",{value:function(){var e=this;if(!i(e)||!a(e,u))throw new TypeError("this must be a StringIterator object");var t=e[s(u)];if(void 0===t)return n(void 0,!0);var r=e[s(c)],o=t.length;if(r>=o)return e[s(u)]=void 0,n(void 0,!0);var l,h=t.charCodeAt(r);if(55296>h||h>56319||r+1===o)l=String.fromCharCode(h);else{var f=t.charCodeAt(r+1);l=56320>f||f>57343?String.fromCharCode(h):String.fromCharCode(h)+String.fromCharCode(f)}return e[s(c)]=r+l.length,n(l,!1)},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(t,Symbol.iterator,{value:function(){return this},configurable:!0,enumerable:!0,writable:!0}),t),{}),{get createStringIterator(){return e}}}),System.register("[email protected]/src/runtime/polyfills/String",[],function(){"use strict";function e(e){var t=String(this);if(null==this||"[object RegExp]"==d.call(e))throw TypeError();var r=t.length,n=String(e),i=(n.length,arguments.length>1?arguments[1]:void 0),o=i?Number(i):0;isNaN(o)&&(o=0);var a=Math.min(Math.max(o,0),r);return m.call(t,n,o)==a}function t(e){var t=String(this);if(null==this||"[object RegExp]"==d.call(e))throw TypeError();var r=t.length,n=String(e),i=n.length,o=r;if(arguments.length>1){var a=arguments[1];void 0!==a&&(o=a?Number(a):0,isNaN(o)&&(o=0))}var s=Math.min(Math.max(o,0),r),u=s-i;return 0>u?!1:v.call(t,n,u)==u}function r(e){if(null==this)throw TypeError();var t=String(this),r=t.length,n=String(e),i=(n.length,arguments.length>1?arguments[1]:void 0),o=i?Number(i):0;isNaN(o)&&(o=0);Math.min(Math.max(o,0),r);return-1!=m.call(t,n,o)}function n(e){if(null==this)throw TypeError();var t=String(this),r=e?Number(e):0;if(isNaN(r)&&(r=0),0>r||1/0==r)throw RangeError();if(0==r)return"";for(var n="";r--;)n+=t;return n}function i(e){if(null==this)throw TypeError();var t=String(this),r=t.length,n=e?Number(e):0;if(isNaN(n)&&(n=0),0>n||n>=r)return void 0;var i,o=t.charCodeAt(n);return o>=55296&&56319>=o&&r>n+1&&(i=t.charCodeAt(n+1),i>=56320&&57343>=i)?1024*(o-55296)+i-56320+65536:o}function o(e){var t=e.raw,r=t.length>>>0;if(0===r)return"";for(var n="",i=0;;){if(n+=t[i],i+1===r)return n;n+=arguments[++i]}}function a(){var e,t,r=[],n=Math.floor,i=-1,o=arguments.length;if(!o)return"";for(;++i<o;){var a=Number(arguments[i]);if(!isFinite(a)||0>a||a>1114111||n(a)!=a)throw RangeError("Invalid code point: "+a);65535>=a?r.push(a):(a-=65536,e=(a>>10)+55296,t=a%1024+56320,r.push(e,t))}return String.fromCharCode.apply(null,r)}function s(){var e=$traceurRuntime.checkObjectCoercible(this),t=String(e);return c(t)}function u(u){var c=u.String;h(c.prototype,["codePointAt",i,"contains",r,"endsWith",t,"startsWith",e,"repeat",n]),h(c,["fromCodePoint",a,"raw",o]),f(c.prototype,s,Symbol)}var c=System.get("[email protected]/src/runtime/polyfills/StringIterator").createStringIterator,l=System.get("[email protected]/src/runtime/polyfills/utils"),h=l.maybeAddFunctions,f=l.maybeAddIterator,p=l.registerPolyfill,d=Object.prototype.toString,m=String.prototype.indexOf,v=String.prototype.lastIndexOf;return p(u),{get startsWith(){return e},get endsWith(){return t},get contains(){return r},get repeat(){return n},get codePointAt(){return i},get raw(){return o},get fromCodePoint(){return a},get stringPrototypeIterator(){return s},get polyfillString(){return u}}}),System.get("[email protected]/src/runtime/polyfills/String"),System.register("[email protected]/src/runtime/polyfills/ArrayIterator",[],function(){"use strict";function e(e,t){var r=a(e),n=new f;return n.iteratorObject_=r,n.arrayIteratorNextIndex_=0,n.arrayIterationKind_=t,n}function t(){return e(this,h)}function r(){return e(this,c)}function n(){return e(this,l)}var i,o=System.get("[email protected]/src/runtime/polyfills/utils"),a=o.toObject,s=o.toUint32,u=o.createIteratorResultObject,c=1,l=2,h=3,f=function(){};return $traceurRuntime.createClass(f,(i={},Object.defineProperty(i,"next",{value:function(){var e=a(this),t=e.iteratorObject_;if(!t)throw new TypeError("Object is not an ArrayIterator");var r=e.arrayIteratorNextIndex_,n=e.arrayIterationKind_,i=s(t.length);return r>=i?(e.arrayIteratorNextIndex_=1/0,u(void 0,!0)):(e.arrayIteratorNextIndex_=r+1,n==l?u(t[r],!1):n==h?u([r,t[r]],!1):u(r,!1))},configurable:!0,enumerable:!0,writable:!0}),Object.defineProperty(i,Symbol.iterator,{value:function(){return this},configurable:!0,enumerable:!0,writable:!0}),i),{}),{get entries(){return t},get keys(){return r},get values(){return n}}}),System.register("[email protected]/src/runtime/polyfills/Array",[],function(){"use strict";function e(e){var t,r,n=arguments[1],i=arguments[2],o=this,a=x(e),s=void 0!==n,u=0;if(s&&!p(n))throw TypeError();if(f(a)){t=d(o)?new o:[];for(var c,l=a[Symbol.iterator]();!(c=l.next()).done;){var h=c.value;t[u]=s?n.call(i,h,u):h,u++}return t.length=u,t}for(r=b(a.length),t=d(o)?new o(r):new Array(r);r>u;u++)t[u]=s?"undefined"==typeof i?n(a[u],u):n.call(i,a[u],u):a[u];return t.length=r,t}function t(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=this,n=e.length,i=d(r)?new r(n):new Array(n),o=0;n>o;o++)i[o]=e[o];return i.length=n,i}function r(e){var t=void 0!==arguments[1]?arguments[1]:0,r=arguments[2],n=x(this),i=b(n.length),o=y(t),a=void 0!==r?y(r):i;for(o=0>o?Math.max(i+o,0):Math.min(o,i),a=0>a?Math.max(i+a,0):Math.min(a,i);a>o;)n[o]=e,o++;return n}function n(e){var t=arguments[1];return o(this,e,t)}function i(e){var t=arguments[1];return o(this,e,t,!0)}function o(e,t){var r=arguments[2],n=void 0!==arguments[3]?arguments[3]:!1,i=x(e),o=b(i.length);if(!p(t))throw TypeError();for(var a=0;o>a;a++)if(a in i){var s=i[a];if(t.call(r,s,a,i))return n?a:s}return n?-1:void 0}function a(o){var a=o,s=a.Array,h=a.Object,f=a.Symbol;m(s.prototype,["entries",u,"keys",c,"values",l,"fill",r,"find",n,"findIndex",i]),m(s,["from",e,"of",t]),v(s.prototype,l,f),v(h.getPrototypeOf([].values()),function(){return this},f)}var s=System.get("[email protected]/src/runtime/polyfills/ArrayIterator"),u=s.entries,c=s.keys,l=s.values,h=System.get("[email protected]/src/runtime/polyfills/utils"),f=h.checkIterable,p=h.isCallable,d=h.isConstructor,m=h.maybeAddFunctions,v=h.maybeAddIterator,g=h.registerPolyfill,y=h.toInteger,b=h.toLength,x=h.toObject;return g(a),{get from(){return e},get of(){return t},get fill(){return r},get find(){return n},get findIndex(){return i},get polyfillArray(){return a}}}),System.get("[email protected]/src/runtime/polyfills/Array"),System.register("[email protected]/src/runtime/polyfills/Object",[],function(){"use strict";function e(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}function t(e){for(var t=1;t<arguments.length;t++){var r,n=arguments[t],i=h(n),o=i.length;for(r=0;o>r;r++){var a=i[r];f[a]||(e[a]=n[a])}}return e}function r(e,t){var r,n,i=l(t),o=i.length;for(r=0;o>r;r++){var a=i[r];f[a]||(n=c(t,i[r]),u(e,i[r],n))}return e}function n(n){var i=n.Object;o(i,["assign",t,"is",e,"mixin",r])}var i=System.get("[email protected]/src/runtime/polyfills/utils"),o=i.maybeAddFunctions,a=i.registerPolyfill,s=$traceurRuntime,u=s.defineProperty,c=s.getOwnPropertyDescriptor,l=s.getOwnPropertyNames,h=s.keys,f=s.privateNames;return a(n),{get is(){return e},get assign(){return t},get mixin(){return r},get polyfillObject(){return n}}}),System.get("[email protected]/src/runtime/polyfills/Object"),System.register("[email protected]/src/runtime/polyfills/Number",[],function(){"use strict";function e(e){return a(e)&&f(e)}function t(t){return e(t)&&l(t)===t}function r(e){return a(e)&&p(e)}function n(t){if(e(t)){var r=l(t);if(r===t)return h(r)<=d}return!1}function i(i){var o=i.Number;s(o,["MAX_SAFE_INTEGER",d,"MIN_SAFE_INTEGER",m,"EPSILON",v]),u(o,["isFinite",e,"isInteger",t,"isNaN",r,"isSafeInteger",n])}var o=System.get("[email protected]/src/runtime/polyfills/utils"),a=o.isNumber,s=o.maybeAddConsts,u=o.maybeAddFunctions,c=o.registerPolyfill,l=o.toInteger,h=Math.abs,f=isFinite,p=isNaN,d=Math.pow(2,53)-1,m=-Math.pow(2,53)+1,v=Math.pow(2,-52);return c(i),{get MAX_SAFE_INTEGER(){return d},get MIN_SAFE_INTEGER(){return m},get EPSILON(){return v},get isFinite(){return e},get isInteger(){return t},get isNaN(){return r},get isSafeInteger(){return n},get polyfillNumber(){return i}}}),System.get("[email protected]/src/runtime/polyfills/Number"),System.register("[email protected]/src/runtime/polyfills/polyfills",[],function(){"use strict";var e=System.get("[email protected]/src/runtime/polyfills/utils").polyfillAll;e(this);var t=$traceurRuntime.setupGlobals;return $traceurRuntime.setupGlobals=function(r){t(r),e(r)},{}}),System.get("[email protected]/src/runtime/polyfills/polyfills"),t.exports=$traceurRuntime}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:4}],37:[function(e,t,r){arguments[4][5][0].apply(r,arguments)},{"../cloud/cloud":41,dup:5}],38:[function(e,t,r){arguments[4][6][0].apply(r,arguments)},{"./destroy":37,"./launch":39,dup:6}],39:[function(e,t,r){arguments[4][7][0].apply(r,arguments)},{"../cloud/cloud":41,dup:7}],40:[function(e,t,r){arguments[4][8][0].apply(r,arguments)},{dup:8}],41:[function(e,t,r){arguments[4][9][0].apply(r,arguments)},{"./destroy":42,"./executePlan":43,"./expand":44,"./generatePlan":45,"./validate":46,dup:9,lodash:"lodash"}],42:[function(e,t,r){arguments[4][10][0].apply(r,arguments)},{"./buildLog":40,dup:10,"generator-trees":51,lodash:"lodash"}],43:[function(e,t,r){arguments[4][11][0].apply(r,arguments)},{"../templates":48,"./buildLog":40,dup:11,"generator-trees":51,lodash:"lodash"}],44:[function(e,t,r){arguments[4][12][0].apply(r,arguments)},{dup:12,lodash:"lodash"}],45:[function(e,t,r){arguments[4][13][0].apply(r,arguments)},{"./buildLog":40,dup:13,"generator-trees":51,lodash:"lodash",uuid:61}],46:[function(e,t,r){arguments[4][14][0].apply(r,arguments)},{"./buildLog":40,dup:14,lodash:"lodash"}],47:[function(e,t,r){arguments[4][15][0].apply(r,arguments)},{"./api":38,"./traceur-runtime":49,dup:15}],48:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{dup:16,"hogan.js":58}],49:[function(e,t,r){arguments[4][17][0].apply(r,arguments)},{_process:4,dup:17,path:3}],50:[function(e,t,r){"use strict";function n(e,t){for(;;){var r=e.next();if(t(r.value),r.done)return}}function i(e){for(var t=[];;){var r=e.next(),n=r.value,i=r.done;if(n!=x&&t.push(n),i)return t}}var o=e("babel-runtime/core-js")["default"],a=e("babel-runtime/regenerator")["default"],s=a.mark(function w(e){var t,r,n,i;return a.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:t=[],r=0;case 1:if(n=e.next(),n.done){o.next=9;break}return t.push(n.value),o.next=7,n.value;case 7:o.next=10;break;case 9:return o.abrupt("break",12);case 10:o.next=1;break;case 12:if(n=e.next(),n.done){o.next=20;break}return t.push(n.value),o.next=18,n.value;case 18:o.next=24;break;case 20:return i=t[r],o.next=23,i;case 23:r=(r+1)%t.length;case 24:o.next=12;break;case 26:case"end":return o.stop()}},w,this)}),u=a.mark(function _(e){var t,r,n,o,s;return a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:s=function(e){var n=t.indexOf(e);if(-1==n)throw Error("Tried to remove object that is not in q",e,t);t.splice(n,1),r>=n&&(r=0==r?t.length-1:r-1)},t=i(e),r=0;case 2:if(!(t.length>0)){a.next=14;break}if(r%=t.length,n=t[r],o=n.next(),!o.done){a.next=9;break}if(s(n),0!=t.length){a.next=9;break}return a.abrupt("return",o.value);case 9:return r+=1,a.next=12,o.value;case 12:a.next=2;break;case 14:case"end":return a.stop()}},_,this)}),c=(a.mark(function S(e,t){var r,n;return a.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:for(;;)r=e.next(t),n=r.value;case 1:case"end":return i.stop()}},S,this)}),a.mark(function M(e,t){var r,n,i;return a.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(r=e.next(),n=r.value,i=r.done,!i){o.next=8;break}return o.abrupt("return",n==x?x:t(n));case 8:return o.next=10,t(n);case 10:o.next=0;break;case 12:case"end":return o.stop()}},M,this)})),l=a.mark(function E(e,t){var r;return a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(r=e.next(),!(r.done||--t<=0)){n.next=4;break}return n.abrupt("return",r.value);case 4:return n.next=6,r.value;case 6:n.next=0;break;case 8:case"end":return n.stop()}},E,this)}),h=a.mark(function T(e){var t,r,n,o,s,u;return a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:t=i(e),r=t.length;case 2:if(!(r>0)){a.next=11;break}for(n=[],o=0;o<t.length;o++)s=t[o],u=null!=s?s.next():void 0,u?(n.push(u.value),u.done&&(delete t[o],r--)):n.push(void 0);if(0!=r){a.next=7;break}return a.abrupt("return",n);case 7:return a.next=9,n;case 9:a.next=2;break;case 11:case"end":return a.stop()}},T,this)}),f=a.mark(function C(e,t){var r,n;return a.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return r=[],i.next=3,a.mark(function o(){var t;return a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(t=e.next(),console.log("got result",t),r.push(t.value),!t.done){n.next=8;break}return n.abrupt("return",t.value);case 8:return n.next=10,t.value;case 10:n.next=0;break;case 12:case"end":return n.stop()}},o,this)});case 3:n=0;case 4:if(!(t-1>n)){i.next=10;break}return i.next=7,a.mark(function s(){var e;return a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=0;case 1:if(!(e<r.length-1)){t.next=7;break}return t.next=4,r[e];case 4:e++,t.next=1;break;case 7:return t.abrupt("return",r[e]);case 8:case"end":return t.stop()}},s,this)});case 7:n++,i.next=4;break;case 10:case"end":return i.stop()}},C,this)}),p=a.mark(function A(e,t){var r;return a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(0!=t){n.next=2;break}throw new Error("why did you do that?");case 2:r=0;case 3:if(!(t-1>r)){n.next=9;break}return n.next=6,e;case 6:r++,n.next=3;break;case 9:return n.abrupt("return",e);case 10:case"end":return n.stop()}},A,this)}),d=a.mark(function $(e){var t,r;return a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(t=e.length,0!=t){n.next=3;break}throw Error("What should we do here?");case 3:r=0;case 4:if(!(t-1>r)){n.next=10;break}return n.next=7,e[r];case 7:r++,n.next=4;break;case 10:return n.abrupt("return",e[r]);case 11:case"end":return n.stop()}},$,this)}),m=a.mark(function k(e){return a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(0!=e.length){t.next=2;break}throw Error("Empty stack",e);case 2:if(!(e.length>1)){t.next=7;break}return t.next=5,e.pop();case 5:t.next=2;break;case 7:return t.abrupt("return",e.pop());case 8:case"end":return t.stop()}},k,this)}),v=a.mark(function P(e){return a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(0!=e.length){t.next=2;break}throw Error("Empty queue",e);case 2:if(!(e.length>1)){t.next=7;break}return t.next=5,e.shift();case 5:t.next=2;break;case 7:return t.abrupt("return",e.shift());case 8:case"end":return t.stop()}},P,this)}),g=a.mark(function R(e){return a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(0!=e.length){t.next=2;break}throw Error("Empty stack",e);case 2:return t.next=4,e.pop();case 4:if(e.length>0){t.next=2;break}case 5:return t.abrupt("return",x);case 6:case"end":return t.stop()}},R,this)}),y=a.mark(function O(e){return a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(0!=e.length){t.next=2;break}throw Error("Empty queue",e);case 2:return t.next=4,e.shift();case 4:if(e.length>0){t.next=2;break}case 5:return t.abrupt("return",x);case 6:case"end":return t.stop()}},O,this)}),b=a.mark(function L(e,t){var r;return a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(void 0==t){n.next=8;break}r=e||0;case 2:if(!(t>r)){n.next=7;break}return n.next=5,r++;case 5:n.next=2;break;case 7:return n.abrupt("return",r);case 8:r=e||0;case 9:return n.next=12,r++;case 12:n.next=9;break;case 14:case"end":return n.stop()}},L,this)});Object.defineProperty(r,"__esModule",{value:!0});var x=o.Symbol();r.transform=c,r.map=c,r.each=n,r.modifiableStack=m,r.modifiableQueue=v,r.modifiableStackAlt=g,r.modifiableQueueAlt=y,r.toGenerator=d,r.toArray=i,r.loop=s,r.interleave=u,r.repeat=p,r.repeatG=f,r.integers=b,r.take=l,r.zip=h,r.TERMINAL=x},{"babel-runtime/core-js":54,"babel-runtime/regenerator":55}],51:[function(e,t){"use strict";t.exports={g:e("./generators"),p:e("./promises"),t:e("./trees")}},{"./generators":50,"./promises":52,"./trees":53}],52:[function(e,t){"use strict";function r(e,t,r){return new o.Promise(function(n,i){function o(e){function s(t){a++,r(t),l?n(a):o(e)}var u=e.next(),c=u.value,l=u.done;c.then(function(r){a++,t(r,a),l?n(a):o(e)},r?s:i)}var a=0;o(e)})}function n(e,t,r){return new o.Promise(function(n,i){function o(e){function a(r,i){t(r),i?n(r):o(e)}function s(t){r?(r(t),l?n(count):o(e)):i(t)}var u=e.next(),c=u.value,l=u.done;c.then(a,s)}o(e)})}function i(e,t,r,n){return new o.Promise(function(i,o){function a(t){c++,u++;var h=t.next(),f=h.value,p=h.done;l=p,f.then(function(e){c--,r(e,u),l?0==c&&i(u):a(t)},n?s:o),e>c&&!l&&a(t)}function s(e){c--,u++,n(e),l?0==c&&i(u):a(t)}var u=0,c=0,l=!1;a(t)})}var o=e("babel-runtime/core-js")["default"];t.exports={sync:r,pipe:n,async:i}},{"babel-runtime/core-js":54}],53:[function(e,t){"use strict";function r(e,t,r,n){function i(e){console.log("reduceNode",e),e||console.log("reduceNode, no node!");var t=e.next(),i=t.value;return t.done?r(i,n()):r(i,o(e))}function o(e){console.log("reduceChildren",e);for(var r=n();;){var o=e.next(),a=o.value;if(r=t(r,i(a)),o.done)break}return r}return void 0==n&&(n=r,r=t),i(e)}function n(e,t){return function(){return f(e,t)}}function i(e){var t={},r=e.next();return t.value=r.value,r.done||(t.children=m(e)),t}function o(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];return i(e.apply(void 0,r))}function a(e,t){function r(e){console.log(i(t)+e)}function n(e){var r=e.next(),n=r.value;return void 0!=n&&a(n,t+1),!r.done}function i(e,t){t=t||" ";for(var r="",n=0;e>n;n++)r+=t;return r}if(t=t||0,void 0==e)return r("<undefined>");var o=e(),s=o.next(),u=s.value;if(void 0!=u){if(s.done)return r(u);n(o),r(u),n(o)}}var s=e("babel-runtime/regenerator")["default"],u=s.mark(function g(e){var t,r,n,i,o;return s.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(e){a.next=2;break}throw Error("preorder, no node!");case 2:if(console.log("preorder",e),t=e.next(),r=t.value,!t.done){a.next=6;break}return a.abrupt("return",r);case 6:return a.next=8,r;case 8:n=e.next(),i=g(n.value);case 11:if(o=i.next(),!o.done){a.next=21;break}if(!n.done){a.next=16;break}return a.abrupt("return",o.value);case 16:return a.next=18,o.value;case 18:return a.abrupt("break",25);case 21:return a.next=23,o.value;case 23:a.next=11;break;case 25:a.next=8;break;case 27:case"end":return a.stop()}},g,this)}),c=s.mark(function y(e){var t,r,n,i,o,a;return s.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(e||console.log("inorder, no node!"),t=e.next(),r=t.value,!t.done){s.next=4;break}return s.abrupt("return",r);case 4:n=!1;case 5:i=e.next(),o=y(i.value);case 8:if(a=o.next(),!a.done){s.next=18;break}if(!n||!i.done){s.next=13;break}return s.abrupt("return",a.value);case 13:return s.next=15,a.value;case 15:return s.abrupt("break",22);case 18:return s.next=20,a.value;case 20:s.next=8;break;case 22:if(n){s.next=30;break}if(!i.done){s.next=27;break}return s.abrupt("return",r);case 27:return s.next=29,r;case 29:n=!0;case 30:s.next=5;break;case 32:case"end":return s.stop()}},y,this)}),l=s.mark(function b(e){var t,r,n,i,o;return s.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(e||console.log("postorder, no node!"),t=e.next(),r=t.value,!t.done){a.next=4;break}return a.abrupt("return",r);case 4:n=e.next(),i=b(n.value);case 7:return o=i.next(),a.next=11,o.value;case 11:if(!o.done){a.next=13;break}return a.abrupt("break",15);case 13:a.next=7;break;case 15:if(!n.done){a.next=17;break}return a.abrupt("return",r);case 17:a.next=4;break;case 19:case"end":return a.stop()}},b,this)}),h=s.mark(function x(e,t){var r,n,i,o,a,u,c;return s.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(t=t||"",e||console.log("breadthFirst, no node",e),r=e.next(),n=r.value,!r.done){s.next=5;break}return s.abrupt("return",n);case 5:return s.next=7,n;case 7:i=[{generator:e}];case 8:if(0==i.length){s.next=27;break}o=i.shift();case 10:if(a=o.generator.next(),u=a.value,c=u.next(),!c.done){s.next=18;break}if(!a.done||0!=i.length){s.next=16;break}return s.abrupt("return",c.value);case 16:s.next=19;break;case 18:i.push({parent:c.value,generator:u});case 19:return s.next=21,c.value;case 21:if(!a.done){s.next=23;break}return s.abrupt("break",25);case 23:s.next=10;break;case 25:s.next=8;break;case 27:case"end":return s.stop()}},x,this)}),f=s.mark(function w(e,t){var r;return s.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(!t){n.next=17;break}return n.next=3,e;case 3:t.length&&(t=v(t)),"function"==typeof t&&(t=t());case 5:if(r=t.next(),!r.done){n.next=11;break}return n.abrupt("return",r.value);case 11:return n.next=13,r.value;case 13:n.next=5;break;case 15:n.next=18;break;case 17:return n.abrupt("return",e);case 18:case"end":return n.stop()}},w,this)}),p=s.mark(function _(e,t){var r,n,i=s.mark(function o(e,t,r,n){var i;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:i=r(n).next().value;case 1:case"end":return e.stop()}},o,this)});return s.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(0!=e){o.next=2;break}return o.abrupt("return",f(void 0));case 2:r=0;case 4:if(!(e-1>r)){o.next=15;break}n=0;case 6:if(!(e-r-1>n)){o.next=12;break}return o.next=9,i(r,n,t,0);case 9:n++,o.next=6;break;case 12:r++,o.next=4;break;case 15:case"end":return o.stop()}},_,this)}),p=s.mark(function S(e,t,r){var i,o,a,u,c,l,h,f,p;return s.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(0!=e){s.next=2;break}return s.abrupt("return",n(void 0));case 2:if(i=t(r).next().value,1!=e){s.next=5;break}return s.abrupt("return",n(i));case 5:o=0;case 7:if(!(e-1>o)){s.next=26;break}a=S(o,t,i+1);case 9:u=e-1-o,c=S(u,t,i+1),l=a.next(),h=l.value;case 11:return f=c.next(),p=f.value,s.next=15,n(i,[h,p]);case 15:if(!f.done){s.next=17;break}return s.abrupt("break",19);case 17:s.next=11;break;case 19:if(!l.done){s.next=21;break}return s.abrupt("break",23);case 21:s.next=9;break;case 23:o++,s.next=7;break;case 26:a=S(o,t,i+1);case 27:if(l=a.next(),!l.done){s.next=31;break}return s.abrupt("return",n(i,[l.value,n(void 0)]));case 31:return s.next=33,n(i,[l.value,n(void 0)]);case 33:s.next=27;break;case 35:case"end":return s.stop()}},S,this)}),d=(s.mark(function M(e,t,r,n){var i,o,a,u,c,l,h,d;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(console.log("all",e),0!=e){t.next=3;break}return t.abrupt("return",f(void 0));case 3:if(nodeValue=n.next().value,1!=e){t.next=6;break}return t.abrupt("return",f(nodeValue));case 6:return t.next=8,f(nodeValue);case 8:i=0;case 10:if(!(e-1>i)){t.next=37;break}console.log("i",i),o=p(i,n),console.log("left",o);case 14:a=o.next(),u=e-1-i,c=p(u,n),console.log("leftResult",a),console.log("right",c);case 18:return l=c.next(),h=[],console.log("rightResult",l),console.log("children",h),console.log("nodeValue",nodeValue),d=n.next().value,t.next=26,f(d,[a.value,l.value]);case 26:if(!l.done){t.next=28;break}return t.abrupt("break",30);case 28:t.next=18;break;case 30:if(!a.done){t.next=32;break}return t.abrupt("break",34);case 32:t.next=14;break;case 34:i++,t.next=10;break;case 37:o=p(i,n),u=0;case 38:if(a=o.next(),console.log("last leftResult",a),nodeValue=n.next().value,!a.done){t.next=44;break}return t.abrupt("return",f(nodeValue,[a.value,f(void 0)]));case 44:return t.next=46,f(nodeValue,[a.value,f(void 0)]);case 46:u++,t.next=38;break;case 49:case"end":return t.stop()}},M,this)}),e("./generators")),m=d.toArray,v=d.toGenerator;t.exports={preorder:u,inorder:c,postorder:l,breadthFirst:h,reduce:r,makeNode:f,toNode:i,asNode:o,allBinaryTrees:p,printTree:a}},{"./generators":50,"babel-runtime/regenerator":55}],54:[function(e,t,r){arguments[4][22][0].apply(r,arguments)},{dup:22}],55:[function(e,t,r){arguments[4][23][0].apply(r,arguments)},{"./runtime":56,dup:23}],56:[function(e,t,r){arguments[4][24][0].apply(r,arguments)},{"babel-runtime/core-js":54,dup:24}],57:[function(e,t,r){arguments[4][25][0].apply(r,arguments)},{dup:25}],58:[function(e,t,r){arguments[4][26][0].apply(r,arguments)},{"./compiler":57,"./template":59,dup:26}],59:[function(e,t,r){arguments[4][27][0].apply(r,arguments)},{dup:27}],60:[function(e,t,r){arguments[4][28][0].apply(r,arguments)},{dup:28}],61:[function(e,t,r){arguments[4][29][0].apply(r,arguments)},{"./rng":60,dup:29}],62:[function(e,t,r){arguments[4][30][0].apply(r,arguments)},{"./profile.json":63,dup:30}],63:[function(e,t,r){arguments[4][31][0].apply(r,arguments)},{dup:31}],64:[function(e,t){"use strict";var r,n,i=(r=e("./core"),r&&r.__esModule&&r||{"default":r})["default"],o=(n=e("do-wrapper-browser"),n&&n.__esModule&&n||{"default":n})["default"];t.exports=function(){return i(o)}},{"./core":65,"do-wrapper-browser":66}],65:[function(e,t,r){arguments[4][32][0].apply(r,arguments)},{"../profile":62,dup:32,lodash:"lodash","promise-callback":68,"traceur-runtime":69}],66:[function(e,t){var r=e("browser-request"),n=e("xtend"),i="https://api.digitalocean.com/v2/",o=function(e,t){this.headers={authorization:"Bearer "+e,content_type:"application/json"},this.querySize=t||50};t.exports=o,o.prototype._get=function(e,t){var n=i+e+"?per_page="+this.querySize;r.get({url:n,headers:this.headers,strictSSL:!0,json:!0},function(e,r,n){!e&&n.status&&"OK"!==n.status&&(e=new Error(n.description||n)),t(e,n||{},r)})},o.prototype._post=function(e,t,n){var o=i+e;r.post({url:o,body:t,headers:this.headers,strictSSL:!0,json:!0},function(e,t,r){!e&&r.status&&"OK"!==r.status&&(e=new Error(r.description||r)),n(e,r||{},t)})},o.prototype._delete=function(e,t){var n=i+e;r["delete"]({url:n,headers:this.headers,strictSSL:!0},function(e,r){t(e,r||{})})},o.prototype.dropletsGetAll=function(e){this._get("droplets/",function(t,r,n){e(t,r,n)})},o.prototype.dropletsGetKernelsForDroplet=function(e,t){var r="droplets/"+e+"/kernels";this._get(r,function(e,r,n){t(e,r,n)})},o.prototype.dropletsGetSnapshotsForDroplet=function(e,t){var r="droplets/"+e+"/snapshots";this._get(r,function(e,r,n){t(e,r,n)})},o.prototype.dropletsGetBackupsForDroplet=function(e,t){var r="droplets/"+e+"/backups";this._get(r,function(e,r,n){t(e,r,n)})},o.prototype.dropletsGetActionsForDroplet=function(e,t){var r="droplets/"+e+"/actions";this._get(r,function(e,r,n){t(e,r,n)})},o.prototype.dropletsCreateNewDroplet=function(e,t,r,i,o,a){var s={name:e,region:t,size:r,image:i},u="/droplets";s=n(s,o),this._post(u,s,function(e,t,r){a(e,t,r)})},o.prototype.dropletsGetDropletById=function(e,t){var r="droplets/"+e;this._get(r,function(e,r,n){t(e,r,n)})},o.prototype.dropletsDeleteDroplet=function(e,t){var r="droplets/"+e;this._delete(r,function(e,r){t(e,r)})},o.prototype.dropletActionRequest=function(e,t,r,i){var o="droplets/"+e+"/actions",t={type:t};t=n(t,r),this._post(o,t,function(e,t,r){i(e,t.action,r)})},o.prototype.dropletActionGetStatus=function(e,t,r){var n="droplets/"+e+"/actions/"+t;this._get(n,function(e,t,n){r(e,t,n)})},o.prototype.domainGetAll=function(e){var t="domains/";this._get(t,function(t,r,n){e(t,r,n)})},o.prototype.domainAddNew=function(e,t,r){var n="domains/",i={name:e,ip_address:t};
this._post(n,i,function(e,t,n){r(e,t,n)})},o.prototype.domainGetByName=function(e,t){var r="domains/"+e;this._get(r,function(e,r,n){t(e,r,n)})},o.prototype.domainDeleteDomain=function(e,t){var r="domains/"+e;this._delete(r,function(e,r){t(e,r)})},o.prototype.domainRecordsGetAll=function(e,t){var r="domains/"+e+"/records";this._get(r,function(e,r,n){t(e,r,n)})},o.prototype.domainRecordsAddnew=function(e,t,r,i){var o="domains/"+e+"/records",a={type:t};a=n(a,r),this._post(o,a,function(e,t,r){i(e,t,r)})},o.prototype.domainRecordsGetRecord=function(e,t,r){var n="domains/"+e+"/records/"+t;this._get(n,function(e,t,n){r(e,t,n)})},o.prototype.domainRecordsDeleteRecord=function(e,t,r){var n="domains/"+e+"/records/"+t;this._delete(n,function(e,t){r(e,t)})},o.prototype.regionsGetAll=function(e){var t="regions/";this._get(t,function(t,r,n){e(t,r,n)})},o.prototype.sizesGetAll=function(e){var t="sizes/";this._get(t,function(t,r,n){e(t,r,n)})},o.prototype.account=function(e){var t="account";this._get(t,function(t,r,n){e(t,r,n)})},o.prototype.keysGetAll=function(e){var t="account/keys/";this._get(t,function(t,r,n){e(t,r,n)})},o.prototype.keysAddNew=function(e,t,r){var n="account/keys/",i={name:e,public_key:t};this._post(n,i,function(e,t,n){r(e,t,n)})},o.prototype.keysGetKey=function(e,t){var r="account/keys/"+e;this._get(r,function(e,r,n){t(e,r,n)})},o.prototype.keysUpdateKey=function(e,t,r){var n="account/keys/"+e,i={name:t};this._post(n,i,function(e,t,n){r(e,t,n)})},o.prototype.keysDestroyKey=function(e,t){var r="account/keys/"+e;this._delete(r,function(e,r){t(e,r)})},o.prototype.imagesGetAll=function(e){var t="images/";this._get(t,function(t,r,n){e(t,r,n)})},o.prototype.imagesGetImage=function(e,t){var r="images/"+e;this._get(r,function(e,r,n){t(e,r,n)})},o.prototype.imagesGetBySlug=function(e,t){var r="images/"+e;this._get(r,function(e,r,n){t(e,r,n)})},o.prototype.imagesDeleteImage=function(e,t){var r="images/"+e;this._delete(r,function(e,r){t(e,r)})},o.prototype.imagesTransferImage=function(e,t,r){var n="images/"+e+"/actions",i={type:"transfer",region:t};this._post(n,i,function(e,t,n){r(e,t,n)})},o.prototype.imagesGetActionStatus=function(e,t,r){var n="images/"+e+"/action/"+t;this._get(n,function(e,t,n){r(e,t,n)})}},{"browser-request":"browser-request",xtend:67}],67:[function(e,t){function r(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}return e}t.exports=r},{}],68:[function(e,t,r){arguments[4][34][0].apply(r,arguments)},{dup:34}],69:[function(e,t,r){arguments[4][36][0].apply(r,arguments)},{_process:4,dup:36}],"angular-local-storage":[function(){!function(e,t){"use strict";function r(e){return/^-?\d+\.?\d*$/.test(e.replace(/["']/g,""))}var n=t.isDefined,i=t.isUndefined,o=t.isNumber,a=t.isObject,s=t.isArray,u=t.extend,c=t.toJson,l=t.fromJson,h=t.module("LocalStorageModule",[]);h.provider("localStorageService",function(){this.prefix="ls",this.storageType="localStorage",this.cookie={expiry:30,path:"/"},this.notify={setItem:!0,removeItem:!1},this.setPrefix=function(e){return this.prefix=e,this},this.setStorageType=function(e){return this.storageType=e,this},this.setStorageCookie=function(e,t){return this.cookie={expiry:e,path:t},this},this.setStorageCookieDomain=function(e){return this.cookie.domain=e,this},this.setNotify=function(e,t){return this.notify={setItem:e,removeItem:t},this},this.$get=["$rootScope","$window","$document","$parse",function(e,t,h,f){var p,d=this,m=d.prefix,v=d.cookie,g=d.notify,y=d.storageType;h?h[0]&&(h=h[0]):h=document,"."!==m.substr(-1)&&(m=m?m+".":"");var b=function(e){return m+e},x=function(){try{var r=y in t&&null!==t[y],n=b("__"+Math.round(1e7*Math.random()));return r&&(p=t[y],p.setItem(n,""),p.removeItem(n)),r}catch(i){return y="cookie",e.$broadcast("LocalStorageModule.notification.error",i.message),!1}}(),w=function(t,r){if(i(r)?r=null:(a(r)||s(r)||o(+r||r))&&(r=c(r)),!x||"cookie"===d.storageType)return x||e.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),g.setItem&&e.$broadcast("LocalStorageModule.notification.setitem",{key:t,newvalue:r,storageType:"cookie"}),C(t,r);try{(a(r)||s(r))&&(r=c(r)),p&&p.setItem(b(t),r),g.setItem&&e.$broadcast("LocalStorageModule.notification.setitem",{key:t,newvalue:r,storageType:d.storageType})}catch(n){return e.$broadcast("LocalStorageModule.notification.error",n.message),C(t,r)}return!0},_=function(t){if(!x||"cookie"===d.storageType)return x||e.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),A(t);var n=p?p.getItem(b(t)):null;return n&&"null"!==n?"{"===n.charAt(0)||"["===n.charAt(0)||r(n)?l(n):n:null},S=function(t){if(!x||"cookie"===d.storageType)return x||e.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),g.removeItem&&e.$broadcast("LocalStorageModule.notification.removeitem",{key:t,storageType:"cookie"}),$(t);try{p.removeItem(b(t)),g.removeItem&&e.$broadcast("LocalStorageModule.notification.removeitem",{key:t,storageType:d.storageType})}catch(r){return e.$broadcast("LocalStorageModule.notification.error",r.message),$(t)}return!0},M=function(){if(!x)return e.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),!1;var t=m.length,r=[];for(var n in p)if(n.substr(0,t)===m)try{r.push(n.substr(t))}catch(i){return e.$broadcast("LocalStorageModule.notification.error",i.Description),[]}return r},E=function(t){t=t||"";var r=m.slice(0,-1),n=new RegExp(r+"."+t);if(!x||"cookie"===d.storageType)return x||e.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),k();var i=m.length;for(var o in p)if(n.test(o))try{S(o.substr(i))}catch(a){return e.$broadcast("LocalStorageModule.notification.error",a.message),k()}return!0},T=function(){try{return t.navigator.cookieEnabled||"cookie"in h&&(h.cookie.length>0||(h.cookie="test").indexOf.call(h.cookie,"test")>-1)}catch(r){return e.$broadcast("LocalStorageModule.notification.error",r.message),!1}}(),C=function(t,r){if(i(r))return!1;if((s(r)||a(r))&&(r=c(r)),!T)return e.$broadcast("LocalStorageModule.notification.error","COOKIES_NOT_SUPPORTED"),!1;try{var n="",o=new Date,u="";if(null===r?(o.setTime(o.getTime()+-864e5),n="; expires="+o.toGMTString(),r=""):0!==v.expiry&&(o.setTime(o.getTime()+24*v.expiry*60*60*1e3),n="; expires="+o.toGMTString()),t){var l="; path="+v.path;v.domain&&(u="; domain="+v.domain),h.cookie=b(t)+"="+encodeURIComponent(r)+n+l+u}}catch(f){return e.$broadcast("LocalStorageModule.notification.error",f.message),!1}return!0},A=function(t){if(!T)return e.$broadcast("LocalStorageModule.notification.error","COOKIES_NOT_SUPPORTED"),!1;for(var r=h.cookie&&h.cookie.split(";")||[],n=0;n<r.length;n++){for(var i=r[n];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(b(t)+"=")){var o=decodeURIComponent(i.substring(m.length+t.length+1,i.length));try{var a=JSON.parse(o);return l(a)}catch(s){return o}}}return null},$=function(e){C(e,null)},k=function(){for(var e=null,t=m.length,r=h.cookie.split(";"),n=0;n<r.length;n++){for(e=r[n];" "===e.charAt(0);)e=e.substring(1,e.length);var i=e.substring(t,e.indexOf("="));$(i)}},P=function(){return y},R=function(e,t,r,i){i=i||t;var o=_(i);return null===o&&n(r)?o=r:a(o)&&a(r)&&(o=u(r,o)),f(t).assign(e,o),e.$watch(t,function(e){w(i,e)},a(e[t]))},O=function(){for(var e=0,r=t[y],n=0;n<r.length;n++)0===r.key(n).indexOf(m)&&e++;return e};return{isSupported:x,getStorageType:P,set:w,add:w,get:_,keys:M,remove:S,clearAll:E,bind:R,deriveKey:b,length:O,cookie:{isSupported:T,set:C,add:C,get:A,remove:$,clearAll:k}}}]})}(window,window.angular)},{}],angular:[function(e,t){e("./angular"),t.exports=angular},{"./angular":1}],"browser-request":[function(e,t){function r(e,t){if("function"!=typeof t)throw new Error("Bad callback given: "+t);if(!e)throw new Error("No options given");var a=e.onResponse;if(e="string"==typeof e?{uri:e}:JSON.parse(JSON.stringify(e)),e.onResponse=a,e.verbose&&(r.log=o()),e.url&&(e.uri=e.url,delete e.url),!e.uri&&""!==e.uri)throw new Error("options.uri is a required argument");if("string"!=typeof e.uri)throw new Error("options.uri must be a string");for(var s=["proxy","_redirectsFollowed","maxRedirects","followRedirect"],c=0;c<s.length;c++)if(e[s[c]])throw new Error("options."+s[c]+" is not supported");if(e.callback=t,e.method=e.method||"GET",e.headers=e.headers||{},e.body=e.body||null,e.timeout=e.timeout||r.DEFAULT_TIMEOUT,e.headers.host)throw new Error("Options.headers.host is not supported");e.json&&(e.headers.accept=e.headers.accept||"application/json","GET"!==e.method&&(e.headers["content-type"]="application/json"),"boolean"!=typeof e.json?e.body=JSON.stringify(e.json):"string"!=typeof e.body&&(e.body=JSON.stringify(e.body)));var l=function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t.join("&")};if(e.qs){var h="string"==typeof e.qs?e.qs:l(e.qs);e.uri=-1!==e.uri.indexOf("?")?e.uri+"&"+h:e.uri+"?"+h}var f=function(e){var t={};t.boundry="-------------------------------"+Math.floor(1e9*Math.random());var r=[];for(var n in e)e.hasOwnProperty(n)&&r.push("--"+t.boundry+'\nContent-Disposition: form-data; name="'+n+'"\n\n'+e[n]+"\n");return r.push("--"+t.boundry+"--"),t.body=r.join(""),t.length=t.body.length,t.type="multipart/form-data; boundary="+t.boundry,t};if(e.form){if("string"==typeof e.form)throw"form name unsupported";if("POST"===e.method){var p=(e.encoding||"application/x-www-form-urlencoded").toLowerCase();switch(e.headers["content-type"]=p,p){case"application/x-www-form-urlencoded":e.body=l(e.form).replace(/%20/g,"+");break;case"multipart/form-data":var d=f(e.form);e.body=d.body,e.headers["content-type"]=d.type;break;default:throw new Error("unsupported encoding:"+p)}}}return e.onResponse=e.onResponse||i,e.onResponse===!0&&(e.onResponse=t,e.callback=i),!e.headers.authorization&&e.auth&&(e.headers.authorization="Basic "+u(e.auth.username+":"+e.auth.password)),n(e)}function n(e){function t(){l=!0;var t=new Error("ETIMEDOUT");return t.code="ETIMEDOUT",t.duration=e.timeout,r.log.error("Timeout",{id:u._id,milliseconds:e.timeout}),e.callback(t,u)}function n(){if(l)return r.log.debug("Ignoring timed out state change",{state:u.readyState,id:u.id});if(r.log.debug("State change",{state:u.readyState,id:u.id,timed_out:l}),u.readyState===c.OPENED){r.log.debug("Request started",{id:u.id});for(var t in e.headers)u.setRequestHeader(t,e.headers[t])}else u.readyState===c.HEADERS_RECEIVED?i():u.readyState===c.LOADING?(i(),o()):u.readyState===c.DONE&&(i(),o(),a())}function i(){if(!m.response){if(m.response=!0,r.log.debug("Got response",{id:u.id,status:u.status}),clearTimeout(u.timeoutTimer),u.statusCode=u.status,f&&0==u.statusCode){var t=new Error("CORS request rejected: "+e.uri);return t.cors="rejected",m.loading=!0,m.end=!0,e.callback(t,u)}e.onResponse(null,u)}}function o(){m.loading||(m.loading=!0,r.log.debug("Response body loading",{id:u.id}))}function a(){if(!m.end){if(m.end=!0,r.log.debug("Request done",{id:u.id}),u.body=u.responseText,e.json)try{u.body=JSON.parse(u.responseText)}catch(t){return e.callback(t,u)}e.callback(null,u,u.body)}}var u=new c,l=!1,f=s(e.uri),p="withCredentials"in u;if(h+=1,u.seq_id=h,u.id=h+": "+e.method+" "+e.uri,u._id=u.id,f&&!p){var d=new Error("Browser does not support cross-origin request: "+e.uri);return d.cors="unsupported",e.callback(d,u)}u.timeoutTimer=setTimeout(t,e.timeout);var m={response:!1,loading:!1,end:!1};return u.onreadystatechange=n,u.open(e.method,e.uri,!0),f&&(u.withCredentials=!!e.withCredentials),u.send(e.body),u}function i(){}function o(){var e,t,r={},n=["trace","debug","info","warn","error"];for(t=0;t<n.length;t++)e=n[t],r[e]=i,"undefined"!=typeof console&&console&&console[e]&&(r[e]=a(console,e));return r}function a(e,t){function r(r,n){return"object"==typeof n&&(r+=" "+JSON.stringify(n)),e[t].call(e,r)}return r}function s(e){var t,r=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/;try{t=location.href}catch(n){t=document.createElement("a"),t.href="",t=t.href}var i=r.exec(t.toLowerCase())||[],o=r.exec(e.toLowerCase()),a=!(!o||o[1]==i[1]&&o[2]==i[2]&&(o[3]||("http:"===o[1]?80:443))==(i[3]||("http:"===i[1]?80:443)));return a}function u(e){var t,r,n,i,o,a,s,u,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=0,h=0,f="",p=[];if(!e)return e;do t=e.charCodeAt(l++),r=e.charCodeAt(l++),n=e.charCodeAt(l++),u=t<<16|r<<8|n,i=u>>18&63,o=u>>12&63,a=u>>6&63,s=63&u,p[h++]=c.charAt(i)+c.charAt(o)+c.charAt(a)+c.charAt(s);while(l<e.length);switch(f=p.join(""),e.length%3){case 1:f=f.slice(0,-2)+"==";break;case 2:f=f.slice(0,-1)+"="}return f}var c=XMLHttpRequest;if(!c)throw new Error("missing XMLHttpRequest");r.log={trace:i,debug:i,info:i,warn:i,error:i};var l=18e4,h=0;r.withCredentials=!1,r.DEFAULT_TIMEOUT=l,r.defaults=function(e){var t=function(t){var r=function(r,n){r="string"==typeof r?{uri:r}:JSON.parse(JSON.stringify(r));for(var i in e)void 0===r[i]&&(r[i]=e[i]);return t(r,n)};return r},n=t(r);return n.get=t(r.get),n.post=t(r.post),n.put=t(r.put),n.head=t(r.head),n["delete"]=t(r["delete"]),n};var f=["get","put","post","head","delete"];f.forEach(function(e){var t=e.toUpperCase(),n=e.toLowerCase();r[n]=function(e){"string"==typeof e?e={method:t,uri:e}:(e=JSON.parse(JSON.stringify(e)),e.method=t);var n=[e].concat(Array.prototype.slice.apply(arguments,[1]));return r.apply(this,n)}}),r.couch=function(e,t){function n(e,r,n){if(e)return t(e,r,n);if((r.statusCode<200||r.statusCode>299)&&n.error){e=new Error("CouchDB error: "+(n.error.reason||n.error.error));for(var i in n)e[i]=n[i];return t(e,r,n)}return t(e,r,n)}"string"==typeof e&&(e={uri:e}),e.json=!0,e.body&&(e.json=e.body),delete e.body,t=t||i;var o=r(e,n);return o},t.exports=r},{}],hjson:[function(e,t){var r=function(){"use strict";var e="\n",t=!1,r=function(e){function t(){return n=e.charAt(s),s++,n}var r,n,i="",o=0,a=!0,s=0;for(t(),"-"===n&&(i="-",t());n>="0"&&"9">=n;)a&&("0"==n?o++:a=!1),i+=n,t();if(a&&o--,"."===n)for(i+=".";t()&&n>="0"&&"9">=n;)i+=n;if("e"===n||"E"===n)for(i+=n,t(),("-"===n||"+"===n)&&(i+=n,t());n>="0"&&"9">=n;)i+=n,t();for(;n&&" ">=n;)t();return r=+i,n||o||!isFinite(r)?void 0:r},n=function(){var e,t,n,i,o={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:" "},a=function(r){var n,i=0,o=1;for(n=t-1;n>0&&"\n"!==e[n];n--,i++);for(;n>0;n--)"\n"===e[n]&&o++;throw new Error(r+" at line "+o+","+i+" >>>"+e.substr(t-i,20)+" ...")},s=function(r){return r&&r!==n&&a("Expected '"+r+"' instead of '"+n+"'"),n=e.charAt(t),t++,n},u=function(r){return e.charAt(t+r)},c=function(){var e,t,r,i="";if('"'===n)for(;s();){if('"'===n)return s(),i;if("\\"===n)if(s(),"u"===n){for(r=0,t=0;4>t&&(e=parseInt(s(),16),isFinite(e));t++)r=16*r+e;i+=String.fromCharCode(r)}else{if("string"!=typeof o[n])break;i+=o[n]}else i+=n}a("Bad string")},l=function(){for(var e="",t=0,r=0;;){var i=u(-r-5);if(!i||"\n"===i)break;r++}for(var o=function(){for(var e=r;n&&" ">=n&&"\n"!==n&&e-->0;)s()};n&&" ">=n&&"\n"!==n;)s();for("\n"===n&&(s(),o());;){if(n){if("'"===n){if(t++,s(),3===t)return"\n"===e.slice(-1)&&(e=e.slice(0,-1)),e;continue}for(;t>0;)e+="'",t--}else a("Bad multiline string");"\n"===n?(e+="\n",s(),o()):("\r"!==n&&(e+=n),s())}},h=function(){if('"'===n)return c();for(var e="";;){if(":"===n)return e||a("Empty key name requires quotes"),e;(" ">=n||"{"===n||"}"===n||"["===n||"]"===n||","===n)&&a("Key names that include {}[],: or whitespace require quotes"),e+=n,s()}},f=function(){for(;n;){for(;n&&" ">=n;)s();if("#"===n||"/"===n&&"/"===u(0))for(;n&&"\n"!==n;)s();else{if("/"!==n||"*"!==u(0))break;for(s(),s();n&&("*"!==n||"/"!==u(0));)s();n&&(s(),s())}}},p=function(){for(var e=n;s();){if(3===e.length&&"'''"===e)return l();var t="\r"===n||"\n"===n;if(t||","===n||"}"===n||"]"===n||"#"===n||"/"===n&&("/"===u(0)||"*"===u(0))){var i=e[0];switch(i){case"f":if("false"===e.trim())return!1;break;case"n":if("null"===e.trim())return null;break;case"t":if("true"===e.trim())return!0;break;default:if("-"===i||i>="0"&&"9">=i){var o=r(e);if(void 0!==o)return o}}if(t)return e}e+=n}a("Bad value")},d=function(r){var n;for(r--,n=t-2;n>r&&e[n]<=" "&&"\n"!==e[n];n--);"\n"===e[n]&&n--,"\r"===e[n]&&n--;var i=e.substr(r,n-r+1);for(n=0;n<i.length;n++)if(i[n]>" ")return i;return""},m=function(){var e,r,o=[];if(i&&(Object.defineProperty&&Object.defineProperty(o,"__WSC__",{enumerable:!1,writable:!0}),o.__WSC__=e=[]),"["===n){if(s(),r=t,f(),e&&e.push(d(r)),"]"===n)return s(),o;for(;n;){if(o.push(g()),r=t,f(),","===n&&(s(),r=t,f()),e&&e.push(d(r)),"]"===n)return s(),o;f()}}a("Bad array")},v=function(){function e(e){o.c[e]=d(u),e&&o.o.push(e)}var r,o,u,c={};if(i&&(Object.defineProperty&&Object.defineProperty(c,"__WSC__",{enumerable:!1,writable:!0}),c.__WSC__=o={c:{},o:[]}),"{"===n){if(s(),u=t,f(),o&&e(""),"}"===n)return s(),c;for(;n;){if(r=h(),f(),s(":"),c[r]=g(),u=t,f(),","===n&&(s(),u=t,f()),o&&e(r),"}"===n)return s(),c;f()}}a("Bad object")},g=function(){switch(f(),n){case"{":return v();case"[":return m();case'"':return c();default:return p()}};return function(r,o){var s;return i=o&&o.keepWsc,e=r,t=0,n=" ",s=g(),f(),n&&a("Syntax error"),s}}(),i=function(){function n(e){return" ">=e}function i(e){return"true"==e||"false"==e||"null"==e}function o(e){return e.replace(d,function(e){var t=g[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})}function a(e,t,a){if(!e)return'""';m.lastIndex=0;var u=p||a||m.test(e),c=e[0],l=e[e.length-1];return u||n(c)||'"'===c||"#"===c||"/"===c&&("*"===e[1]||"/"===e[1])||"{"===c||"["===c||n(l)||void 0!==r(e)||i(e)?(d.lastIndex=0,v.lastIndex=0,d.test(e)?v.test(e)?'"'+o(e)+'"':s(e,t):'"'+e+'"'):e}function s(e,t){var r,n=e.replace(/\r/g,"").split("\n");if(t+=x,1===n.length)return"'''"+n[0]+"'''";var i=l+t+"'''";for(r=0;r<n.length;r++)i+=l,n[r]&&(i+=t+n[r]);return i+l+t+"'''"}function u(e){return e?y.test(e)?(d.lastIndex=0,'"'+(d.test(e)?o(e):e)+'"'):e:'""'}function c(e,t,r){function n(e){return e&&"\n"===e["\r"===e[0]?1:0]}function i(e){return e&&!n(e)}function o(e){if(!e)return"";for(var t=0;t<e.length;t++){var r=e[t];if("\n"===r||"#"===r)break;if(r>" ")return" # "+e}return e}switch(typeof e){case"string":return a(e,b,t);case"number":return isFinite(e)?String(e):"null";case"boolean":return String(e);case"object":if(!e)return"null";var s=b;b+=x;var p,d,m,v,g,y,w=l+s,_=l+b,S=r||f?"":w,M=[];if("[object Array]"===Object.prototype.toString.apply(e)){for(h&&(g=e.__WSC__),p=0,d=e.length;d>p;p++)g&&M.push(o(g[p])+_),M.push(c(e[p],g?i(g[p+1]):!1,!0)||"null");g&&M.push(o(g[p])+w),v=g?S+"["+M.join("")+"]":0===M.length?"[]":S+"["+_+M.join(_)+w+"]"}else{if(h&&e.__WSC__){g=e.__WSC__,y=o(g.c[""]);var E=g.o.slice();for(m in e)Object.prototype.hasOwnProperty.call(e,m)&&E.indexOf(m)<0&&E.push(m);for(p=0,d=E.length;d>p;p++)m=E[p],M.push(y+_),y=o(g.c[m]),v=c(e[m],i(y)),v&&M.push(u(m)+(n(v)?":":": ")+v);M.push(y+w)}else for(m in e)Object.prototype.hasOwnProperty.call(e,m)&&(v=c(e[m]),v&&M.push(u(m)+(n(v)?":":": ")+v));v=g?S+"{"+M.join("")+"}":0===M.length?"{}":S+"{"+_+M.join(_)+w+"}"}return b=s,v}}var l,h,f,p,d=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,m=/[\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,v=/'''|[\x00-\x09\x0b\x0c\x0e-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,g={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},y=/[,\{\[\}\]\s]/,b="",x=" ";return function(r,n){var i,o;if(l=e,x=" ",h=!1,f=t,p=!1,n&&"object"==typeof n&&(("\n"===n.eol||"\r\n"===n.eol)&&(l=n.eol),o=n.space,h=n.keepWsc,f=n.bracesSameLine||t,p="always"===n.quotes),"number"==typeof o)for(x="",i=0;o>i;i++)x+=" ";else"string"==typeof o&&(x=o);return c(r,null,!0)}}();return{parse:n,stringify:i,endOfLine:function(){return e},setEndOfLine:function(t){("\n"===t||"\r\n"===t)&&(e=t)},bracesSameLine:function(){return bracesSameLine},setBracesSameLine:function(e){bracesSameLine=e},rt:{parse:function(e,t){return(t=t||{}).keepWsc=!0,n(e,t)},stringify:function(e,t){return(t=t||{}).keepWsc=!0,i(e,t)}}}}();if("object"==typeof t){if("function"==typeof e){var n=e("os");r.setEndOfLine(n.EOL)}t.exports=r}},{os:2}],"launch-cloud-browser-simulator":[function(e,t){"use strict";var r,n,i,o=(r=e("launch-cloud-core"),r&&r.__esModule&&r||{"default":r})["default"],a=(n=e("provider-digitalocean/.dist/provider/simulator"),n&&n.__esModule&&n||{"default":n})["default"],s=(i=e("browser-request"),i&&i.__esModule&&i||{"default":i})["default"],u={dockerHubApiRoot:"http://104.131.153.23:8082",discoveryEtcdApiRoot:"http://104.131.153.23:8081"};t.exports=function(e,t){if(void 0===e||null===e)throw Error("Must provide a providerConfigs object!");var r=o({providers:{digitalocean:a()},providerConfigs:e,log:t,request:s,proxies:u});return r.isSimulator=!0,r}},{"browser-request":"browser-request","launch-cloud-core":15,"provider-digitalocean/.dist/provider/simulator":33}],"launch-cloud-browser":[function(e,t){"use strict";var r,n,i,o=(r=e("launch-cloud-core"),r&&r.__esModule&&r||{"default":r})["default"],a=(n=e("provider-digitalocean/.dist/provider/browser"),n&&n.__esModule&&n||{"default":n})["default"],s=(i=e("browser-request"),i&&i.__esModule&&i||{"default":i})["default"],u={dockerHubApiRoot:"http://104.131.153.23:8082",discoveryEtcdApiRoot:"http://104.131.153.23:8081"};t.exports=function(e,t){if(void 0===e||null===e)throw Error("Must provide a providerConfigs object!");var r=o({providers:{digitalocean:a()},providerConfigs:e,log:t,request:s,proxies:u});return r}},{"browser-request":"browser-request","launch-cloud-core":47,"provider-digitalocean/.dist/provider/browser":64}],lodash:[function(e,t,r){(function(e){(function(){function n(e,t){if(e!==t){var r=e===e,n=t===t;if(e>t||!r||"undefined"==typeof e&&n)return 1;if(t>e||!n||"undefined"==typeof t&&r)return-1}return 0}function i(e,t,r){for(var n=e.length,i=r?n:-1;r?i--:++i<n;)if(t(e[i],i,e))return i;return-1}function o(e,t,r){if(t!==t)return v(e,r);for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}function a(e){return"function"==typeof e||!1}function s(e){return"string"==typeof e?e:null==e?"":e+""}function u(e){return e.charCodeAt(0)}function c(e,t){for(var r=-1,n=e.length;++r<n&&t.indexOf(e.charAt(r))>-1;);return r}function l(e,t){for(var r=e.length;r--&&t.indexOf(e.charAt(r))>-1;);return r}function h(e,t){return n(e.criteria,t.criteria)||e.index-t.index}function f(e,t,r){for(var i=-1,o=e.criteria,a=t.criteria,s=o.length,u=r.length;++i<s;){var c=n(o[i],a[i]);if(c)return i>=u?c:c*(r[i]?1:-1)}return e.index-t.index}function p(e){return Bt[e]}function d(e){return It[e]}function m(e){return"\\"+Ht[e]}function v(e,t,r){for(var n=e.length,i=t+(r?0:-1);r?i--:++i<n;){var o=e[i];if(o!==o)return i}return-1}function g(e){return!!e&&"object"==typeof e}function y(e){return 160>=e&&e>=9&&13>=e||32==e||160==e||5760==e||6158==e||e>=8192&&(8202>=e||8232==e||8233==e||8239==e||8287==e||12288==e||65279==e)}function b(e,t){for(var r=-1,n=e.length,i=-1,o=[];++r<n;)e[r]===t&&(e[r]=G,o[++i]=r);return o}function x(e,t){for(var r,n=-1,i=e.length,o=-1,a=[];++n<i;){var s=e[n],u=t?t(s,n,e):s;n&&r===u||(r=u,a[++o]=s)}return a}function w(e){for(var t=-1,r=e.length;++t<r&&y(e.charCodeAt(t)););return t}function _(e){for(var t=e.length;t--&&y(e.charCodeAt(t)););return t}function S(e){return zt[e]}function M(e){function t(e){if(g(e)&&!au(e)&&!(e instanceof Q)){if(e instanceof y)return e;if(Pa.call(e,"__chain__")&&Pa.call(e,"__wrapped__"))return Xn(e)}return new y(e)}function r(){}function y(e,t,r){this.__wrapped__=e,this.__actions__=r||[],this.__chain__=!!t}function Q(e){this.__wrapped__=e,this.__actions__=null,this.__dir__=1,this.__dropCount__=0,this.__filtered__=!1,this.__iteratees__=null,this.__takeCount__=ss,this.__views__=null}function tt(){var e=this.__actions__,t=this.__iteratees__,r=this.__views__,n=new Q(this.__wrapped__);return n.__actions__=e?Kt(e):null,n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=t?Kt(t):null,n.__takeCount__=this.__takeCount__,n.__views__=r?Kt(r):null,n}function nt(){if(this.__filtered__){var e=new Q(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e}function Bt(){var e=this.__wrapped__.value();if(!au(e))return qr(e,this.__actions__);var t=this.__dir__,r=0>t,n=Pn(0,e.length,this.__views__),i=n.start,o=n.end,a=o-i,s=r?o:i-1,u=ts(a,this.__takeCount__),c=this.__iteratees__,l=c?c.length:0,h=0,f=[];e:for(;a--&&u>h;){s+=t;for(var p=-1,d=e[s];++p<l;){var m=c[p],v=m.iteratee,g=m.type;if(g==V){if(m.done&&(r?s>m.index:s<m.index)&&(m.count=0,m.done=!1),m.index=s,!m.done){var y=m.limit;if(!(m.done=y>-1?m.count++>=y:!v(d)))continue e}}else{var b=v(d);if(g==I)d=b;else if(!b){if(g==B)continue e;break e}}}f[h++]=d}return f}function It(){this.__data__={}}function zt(e){return this.has(e)&&delete this.__data__[e]}function Gt(e){return"__proto__"==e?E:this.__data__[e]}function Ht(e){return"__proto__"!=e&&Pa.call(this.__data__,e)}function Wt(e,t){return"__proto__"!=e&&(this.__data__[e]=t),this}function qt(e){var t=e?e.length:0;for(this.data={hash:Qa(null),set:new Ga};t--;)this.push(e[t])}function Xt(e,t){var r=e.data,n="string"==typeof t||fo(t)?r.set.has(t):r.hash[t];return n?0:-1}function Yt(e){var t=this.data;"string"==typeof e||fo(e)?t.set.add(e):t.hash[e]=!0}function Kt(e,t){var r=-1,n=e.length;for(t||(t=ma(n));++r<n;)t[r]=e[r];return t}function Qt(e,t){for(var r=-1,n=e.length;++r<n&&t(e[r],r,e)!==!1;);return e}function er(e,t){for(var r=e.length;r--&&t(e[r],r,e)!==!1;);return e}function tr(e,t){for(var r=-1,n=e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function rr(e,t){for(var r=-1,n=e.length,i=-1,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[++i]=a)}return o}function nr(e,t){for(var r=-1,n=e.length,i=ma(n);++r<n;)i[r]=t(e[r],r,e);return i}function ir(e){for(var t=-1,r=e.length,n=as;++t<r;){var i=e[t];i>n&&(n=i)}return n}function or(e){for(var t=-1,r=e.length,n=ss;++t<r;){var i=e[t];n>i&&(n=i)}return n}function ar(e,t,r,n){var i=-1,o=e.length;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function sr(e,t,r,n){var i=e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function ur(e,t){for(var r=-1,n=e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function cr(e){for(var t=e.length,r=0;t--;)r+=+e[t]||0;return r}function lr(e,t){return"undefined"==typeof e?t:e}function hr(e,t,r,n){return"undefined"!=typeof e&&Pa.call(n,r)?e:t}function fr(e,t,r){var n=yu(t);if(!r)return dr(t,e,n);for(var i=-1,o=n.length;++i<o;){var a=n[i],s=e[a],u=r(s,t[a],a,e,t);(u===u?u===s:s!==s)&&("undefined"!=typeof s||a in e)||(e[a]=u)}return e}function pr(e,t){for(var r=-1,n=e.length,i=Nn(n),o=t.length,a=ma(o);++r<o;){var s=t[r];i?(s=parseFloat(s),a[r]=Fn(s,n)?e[s]:E):a[r]=e[s]}return a}function dr(e,t,r){r||(r=t,t={});for(var n=-1,i=r.length;++n<i;){var o=r[n];t[o]=e[o]}return t}function mr(e,t,r){var n=typeof e;return"function"==n?"undefined"==typeof t?e:Kr(e,t,r):null==e?ra:"object"==n?Rr(e):"undefined"==typeof t?jr(e+""):Or(e+"",t)}function vr(e,t,r,n,i,o,a){var s;if(r&&(s=i?r(e,n,i):r(e)),"undefined"!=typeof s)return s;if(!fo(e))return e;var u=au(e);if(u){if(s=Rn(e),!t)return Kt(e,s)}else{var c=Oa.call(e),l=c==K;if(c!=J&&c!=H&&(!l||i))return Ut[c]?Ln(e,c,t):i?e:{};if(s=On(l?{}:e),!t)return dr(e,s,yu(e))}o||(o=[]),a||(a=[]);for(var h=o.length;h--;)if(o[h]==e)return a[h];return o.push(e),a.push(s),(u?Qt:Er)(e,function(n,i){s[i]=vr(n,t,r,i,e,o,a)}),s}function gr(e,t,r){if("function"!=typeof e)throw new Ma(z);return Ha(function(){e.apply(E,r)},t)}function yr(e,t){var r=e?e.length:0,n=[];if(!r)return n;var i=-1,a=kn(),s=a==o,u=s&&t.length>=200?_s(t):null,c=t.length;u&&(a=Xt,s=!1,t=u);e:for(;++i<r;){var l=e[i];if(s&&l===l){for(var h=c;h--;)if(t[h]===l)continue e;n.push(l)}else a(t,l,0)<0&&n.push(l)}return n}function br(e,t){var r=!0;return gs(e,function(e,n,i){return r=!!t(e,n,i)}),r}function xr(e,t,r,n){var i=e.length;for(r=null==r?0:+r||0,0>r&&(r=-r>i?0:i+r),n="undefined"==typeof n||n>i?i:+n||0,0>n&&(n+=i),i=r>n?0:n>>>0,r>>>=0;i>r;)e[r++]=t;return e}function wr(e,t){var r=[];return gs(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r}function _r(e,t,r,n){var i;return r(e,function(e,r,o){return t(e,r,o)?(i=n?r:e,!1):void 0}),i}function Sr(e,t,r){for(var n=-1,i=e.length,o=-1,a=[];++n<i;){var s=e[n];if(g(s)&&Nn(s.length)&&(au(s)||oo(s))){t&&(s=Sr(s,t,r));var u=-1,c=s.length;for(a.length+=c;++u<c;)a[++o]=s[u]}else r||(a[++o]=s)}return a}function Mr(e,t){return bs(e,t,$o)}function Er(e,t){return bs(e,t,yu)}function Tr(e,t){return xs(e,t,yu)}function Cr(e,t){for(var r=-1,n=t.length,i=-1,o=[];++r<n;){var a=t[r];uu(e[a])&&(o[++i]=a)}return o}function Ar(e,t,r,n,i,o){if(e===t)return 0!==e||1/e==1/t;var a=typeof e,s=typeof t;return"function"!=a&&"object"!=a&&"function"!=s&&"object"!=s||null==e||null==t?e!==e&&t!==t:$r(e,t,Ar,r,n,i,o)}function $r(e,t,r,n,i,o,a){var s=au(e),u=au(t),c=W,l=W;s||(c=Oa.call(e),c==H?c=J:c!=J&&(s=wo(e))),u||(l=Oa.call(t),l==H?l=J:l!=J&&(u=wo(t)));var h=c==J||i&&c==K,f=l==J||i&&l==K,p=c==l;if(p&&!s&&!h)return Tn(e,t,c);if(i){if(!(p||h&&f))return!1}else{var d=h&&Pa.call(e,"__wrapped__"),m=f&&Pa.call(t,"__wrapped__");if(d||m)return r(d?e.value():e,m?t.value():t,n,i,o,a);if(!p)return!1}o||(o=[]),a||(a=[]);for(var v=o.length;v--;)if(o[v]==e)return a[v]==t;o.push(e),a.push(t);var g=(s?En:Cn)(e,t,r,n,i,o,a);return o.pop(),a.pop(),g}function kr(e,t,r,n,i){for(var o=-1,a=t.length,s=!i;++o<a;)if(s&&n[o]?r[o]!==e[t[o]]:!(t[o]in e))return!1;for(o=-1;++o<a;){var u=t[o],c=e[u],l=r[o];if(s&&n[o])var h="undefined"!=typeof c||u in e;else h=i?i(c,l,u):E,"undefined"==typeof h&&(h=Ar(l,c,i,!0));if(!h)return!1}return!0}function Pr(e,t){var r=[];return gs(e,function(e,n,i){r.push(t(e,n,i))}),r}function Rr(e){var t=yu(e),r=t.length;if(!r)return ta(!0);if(1==r){var n=t[0],i=e[n];if(Un(i))return function(e){return null!=e&&e[n]===i&&("undefined"!=typeof i||n in qn(e))}}for(var o=ma(r),a=ma(r);r--;)i=e[t[r]],o[r]=i,a[r]=Un(i);return function(e){return null!=e&&kr(qn(e),t,o,a)}}function Or(e,t){return Un(t)?function(r){return null!=r&&r[e]===t&&("undefined"!=typeof t||e in qn(r))}:function(r){return null!=r&&Ar(t,r[e],null,!0)}}function Lr(e,t,r,n,i){if(!fo(e))return e;var o=Nn(t.length)&&(au(t)||wo(t));return(o?Qt:Er)(t,function(t,a,s){if(g(t))return n||(n=[]),i||(i=[]),Fr(e,s,a,Lr,r,n,i);var u=e[a],c=r?r(u,t,a,e,s):E,l="undefined"==typeof c;l&&(c=t),!o&&"undefined"==typeof c||!l&&(c===c?c===u:u!==u)||(e[a]=c)}),e}function Fr(e,t,r,n,i,o,a){for(var s=o.length,u=t[r];s--;)if(o[s]==u)return void(e[r]=a[s]);var c=e[r],l=i?i(c,u,r,e,t):E,h="undefined"==typeof l;h&&(l=u,Nn(u.length)&&(au(u)||wo(u))?l=au(c)?c:c&&c.length?Kt(c):[]:cu(u)||oo(u)?l=oo(c)?Mo(c):cu(c)?c:{}:h=!1),o.push(u),a.push(l),h?e[r]=n(l,u,i,o,a):(l===l?l!==c:c===c)&&(e[r]=l)}function jr(e){return function(t){return null==t?E:t[e]}}function Dr(e,t){return e+Va(os()*(t-e+1))}function Nr(e,t,r,n,i){return i(e,function(e,i,o){r=n?(n=!1,e):t(r,e,i,o)}),r}function Ur(e,t,r){var n=-1,i=e.length;t=null==t?0:+t||0,0>t&&(t=-t>i?0:i+t),r="undefined"==typeof r||r>i?i:+r||0,0>r&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=ma(i);++n<i;)o[n]=e[n+t];return o}function Vr(e,t){var r;return gs(e,function(e,n,i){return r=t(e,n,i),!r}),!!r}function Br(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}function Ir(e,t,r){var n=-1,i=e.length,o=Nn(i)?ma(i):[];return gs(e,function(e){for(var r=t.length,i=ma(r);r--;)i[r]=null==e?E:e[t[r]];o[++n]={criteria:i,index:n,value:e}}),Br(o,function(e,t){return f(e,t,r)})}function zr(e,t){var r=0;return gs(e,function(e,n,i){r+=+t(e,n,i)||0}),r}function Gr(e,t){var r=-1,n=kn(),i=e.length,a=n==o,s=a&&i>=200,u=s?_s():null,c=[];u?(n=Xt,a=!1):(s=!1,u=t?[]:c);e:for(;++r<i;){var l=e[r],h=t?t(l,r,e):l;if(a&&l===l){for(var f=u.length;f--;)if(u[f]===h)continue e;t&&u.push(h),c.push(l)}else n(u,h,0)<0&&((t||s)&&u.push(h),c.push(l))}return c}function Hr(e,t){for(var r=-1,n=t.length,i=ma(n);++r<n;)i[r]=e[t[r]];
return i}function Wr(e,t,r,n){for(var i=e.length,o=n?i:-1;(n?o--:++o<i)&&t(e[o],o,e););return r?Ur(e,n?0:o,n?o+1:i):Ur(e,n?o+1:0,n?i:o)}function qr(e,t){var r=e;r instanceof Q&&(r=r.value());for(var n=-1,i=t.length;++n<i;){var o=[r],a=t[n];Ia.apply(o,a.args),r=a.func.apply(a.thisArg,o)}return r}function Xr(e,t,r){var n=0,i=e?e.length:n;if("number"==typeof t&&t===t&&ls>=i){for(;i>n;){var o=n+i>>>1,a=e[o];(r?t>=a:t>a)?n=o+1:i=o}return i}return Yr(e,t,ra,r)}function Yr(e,t,r,n){t=r(t);for(var i=0,o=e?e.length:0,a=t!==t,s="undefined"==typeof t;o>i;){var u=Va((i+o)/2),c=r(e[u]),l=c===c;if(a)var h=l||n;else h=s?l&&(n||"undefined"!=typeof c):n?t>=c:t>c;h?i=u+1:o=u}return ts(o,cs)}function Kr(e,t,r){if("function"!=typeof e)return ra;if("undefined"==typeof t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 3:return function(r,n,i){return e.call(t,r,n,i)};case 4:return function(r,n,i,o){return e.call(t,r,n,i,o)};case 5:return function(r,n,i,o,a){return e.call(t,r,n,i,o,a)}}return function(){return e.apply(t,arguments)}}function Qr(e){return Da.call(e,0)}function Zr(e,t,r){for(var n=r.length,i=-1,o=es(e.length-n,0),a=-1,s=t.length,u=ma(o+s);++a<s;)u[a]=t[a];for(;++i<n;)u[r[i]]=e[i];for(;o--;)u[a++]=e[i++];return u}function Jr(e,t,r){for(var n=-1,i=r.length,o=-1,a=es(e.length-i,0),s=-1,u=t.length,c=ma(a+u);++o<a;)c[o]=e[o];for(var l=o;++s<u;)c[l+s]=t[s];for(;++n<i;)c[l+r[n]]=e[o++];return c}function en(e,t){return function(r,n,i){var o=t?t():{};if(n=$n(n,i,3),au(r))for(var a=-1,s=r.length;++a<s;){var u=r[a];e(o,u,n(u,a,r),r)}else gs(r,function(t,r,i){e(o,t,n(t,r,i),i)});return o}}function tn(e){return function(){var t=arguments,r=t.length,n=t[0];if(2>r||null==n)return n;var i=t[r-2],o=t[r-1],a=t[3];r>3&&"function"==typeof i?(i=Kr(i,o,5),r-=2):(i=r>2&&"function"==typeof o?o:null,r-=i?1:0),a&&jn(t[1],t[2],a)&&(i=3==r?null:i,r=2);for(var s=0;++s<r;){var u=t[s];u&&e(n,u,i)}return n}}function rn(e,t){return function(r,n){var i=r?r.length:0;if(!Nn(i))return e(r,n);for(var o=t?i:-1,a=qn(r);(t?o--:++o<i)&&n(a[o],o,a)!==!1;);return r}}function nn(e){return function(t,r,n){for(var i=qn(t),o=n(t),a=o.length,s=e?a:-1;e?s--:++s<a;){var u=o[s];if(r(i[u],u,i)===!1)break}return t}}function on(e,t){function r(){var i=this&&this!==Zt&&this instanceof r?n:e;return i.apply(t,arguments)}var n=sn(e);return r}function an(e){return function(t){for(var r=-1,n=Jo(Uo(t)),i=n.length,o="";++r<i;)o=e(o,n[r],r);return o}}function sn(e){return function(){var t=vs(e.prototype),r=e.apply(t,arguments);return fo(r)?r:t}}function un(e){function t(r,n,i){i&&jn(r,n,i)&&(n=null);var o=Mn(r,e,null,null,null,null,null,n);return o.placeholder=t.placeholder,o}return t}function cn(e,t){return function(r,n,i){i&&jn(r,n,i)&&(n=null);var o=$n(),a=null==n;if(o===mr&&a||(a=!1,n=o(n,i,3)),a){var s=au(r);if(s||!xo(r))return e(s?r:Wn(r));n=u}return An(r,n,t)}}function ln(e,t){return function(r,n,o){if(n=$n(n,o,3),au(r)){var a=i(r,n,t);return a>-1?r[a]:E}return _r(r,n,e)}}function hn(e){return function(t,r,n){return t&&t.length?(r=$n(r,n,3),i(t,r,e)):-1}}function fn(e){return function(t,r,n){return r=$n(r,n,3),_r(t,r,e,!0)}}function pn(e){return function(){var t=arguments.length;if(!t)return function(){return arguments[0]};for(var r,n=e?t:-1,i=0,o=ma(t);e?n--:++n<t;){var a=o[i++]=arguments[n];if("function"!=typeof a)throw new Ma(z);var s=r?"":Ms(a);r="wrapper"==s?new y([]):r}for(n=r?-1:t;++n<t;){a=o[n],s=Ms(a);var u="wrapper"==s?Ss(a):null;r=u&&Dn(u[0])?r[Ms(u[0])].apply(r,u[3]):1==a.length&&Dn(a)?r[s]():r.thru(a)}return function(){var e=arguments;if(r&&1==e.length&&au(e[0]))return r.plant(e[0]).value();for(var n=0,i=o[n].apply(this,e);++n<t;)i=o[n].call(this,i);return i}}}function dn(e,t){return function(r,n,i){return"function"==typeof n&&"undefined"==typeof i&&au(r)?e(r,n):t(r,Kr(n,i,3))}}function mn(e){return function(t,r,n){return("function"!=typeof r||"undefined"!=typeof n)&&(r=Kr(r,n,3)),e(t,r,$o)}}function vn(e){return function(t,r,n){return("function"!=typeof r||"undefined"!=typeof n)&&(r=Kr(r,n,3)),e(t,r)}}function gn(e){return function(t,r,n){return t=s(t),t&&(e?t:"")+wn(t,r,n)+(e?"":t)}}function yn(e){var t=Ji(function(r,n){var i=b(n,t.placeholder);return Mn(r,e,null,n,i)});return t}function bn(e,t){return function(r,n,i,o){var a=arguments.length<3;return"function"==typeof n&&"undefined"==typeof o&&au(r)?e(r,n,i,a):Nr(r,$n(n,o,4),i,a,t)}}function xn(e,t,r,n,i,o,a,s,u,c){function l(){for(var x=arguments.length,w=x,_=ma(x);w--;)_[w]=arguments[w];if(n&&(_=Zr(_,n,i)),o&&(_=Jr(_,o,a)),d||v){var S=l.placeholder,M=b(_,S);if(x-=M.length,c>x){var T=s?Kt(s):null,$=es(c-x,0),k=d?M:null,P=d?null:M,L=d?_:null,F=d?null:_;t|=d?R:O,t&=~(d?O:R),m||(t&=~(C|A));var j=[e,t,r,L,k,F,P,T,u,$],D=xn.apply(E,j);return Dn(e)&&Es(D,j),D.placeholder=S,D}}var N=f?r:this;p&&(e=N[y]),s&&(_=zn(_,s)),h&&u<_.length&&(_.length=u);var U=this&&this!==Zt&&this instanceof l?g||sn(e):e;return U.apply(N,_)}var h=t&L,f=t&C,p=t&A,d=t&k,m=t&$,v=t&P,g=!p&&sn(e),y=e;return l}function wn(e,t,r){var n=e.length;if(t=+t,n>=t||!Za(t))return"";var i=t-n;return r=null==r?" ":r+"",Ho(r,Na(i/r.length)).slice(0,i)}function _n(e,t,r,n){function i(){for(var t=-1,s=arguments.length,u=-1,c=n.length,l=ma(s+c);++u<c;)l[u]=n[u];for(;s--;)l[u++]=arguments[++t];var h=this&&this!==Zt&&this instanceof i?a:e;return h.apply(o?r:this,l)}var o=t&C,a=sn(e);return i}function Sn(e){return function(t,r,n,i){var o=$n(n);return o===mr&&null==n?Xr(t,r,e):Yr(t,r,o(n,i,1),e)}}function Mn(e,t,r,n,i,o,a,s){var u=t&A;if(!u&&"function"!=typeof e)throw new Ma(z);var c=n?n.length:0;if(c||(t&=~(R|O),n=i=null),c-=i?i.length:0,t&O){var l=n,h=i;n=i=null}var f=u?null:Ss(e),p=[e,t,r,n,i,l,h,o,a,s];if(f&&(Vn(p,f),t=p[1],s=p[9]),p[9]=null==s?u?0:e.length:es(s-c,0)||0,t==C)var d=on(p[0],p[2]);else d=t!=R&&t!=(C|R)||p[4].length?xn.apply(E,p):_n.apply(E,p);var m=f?ws:Es;return m(d,p)}function En(e,t,r,n,i,o,a){var s=-1,u=e.length,c=t.length,l=!0;if(u!=c&&!(i&&c>u))return!1;for(;l&&++s<u;){var h=e[s],f=t[s];if(l=E,n&&(l=i?n(f,h,s):n(h,f,s)),"undefined"==typeof l)if(i)for(var p=c;p--&&(f=t[p],!(l=h&&h===f||r(h,f,n,i,o,a))););else l=h&&h===f||r(h,f,n,i,o,a)}return!!l}function Tn(e,t,r){switch(r){case q:case X:return+e==+t;case Y:return e.name==t.name&&e.message==t.message;case Z:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case et:case rt:return e==t+""}return!1}function Cn(e,t,r,n,i,o,a){var s=yu(e),u=s.length,c=yu(t),l=c.length;if(u!=l&&!i)return!1;for(var h=i,f=-1;++f<u;){var p=s[f],d=i?p in t:Pa.call(t,p);if(d){var m=e[p],v=t[p];d=E,n&&(d=i?n(v,m,p):n(m,v,p)),"undefined"==typeof d&&(d=m&&m===v||r(m,v,n,i,o,a))}if(!d)return!1;h||(h="constructor"==p)}if(!h){var g=e.constructor,y=t.constructor;if(g!=y&&"constructor"in e&&"constructor"in t&&!("function"==typeof g&&g instanceof g&&"function"==typeof y&&y instanceof y))return!1}return!0}function An(e,t,r){var n=r?ss:as,i=n,o=i;return gs(e,function(e,a,s){var u=t(e,a,s);((r?i>u:u>i)||u===n&&u===o)&&(i=u,o=e)}),o}function $n(e,r,n){var i=t.callback||ea;return i=i===ea?mr:i,n?i(e,r,n):i}function kn(e,r,n){var i=t.indexOf||oi;return i=i===oi?o:i,e?i(e,r,n):i}function Pn(e,t,r){for(var n=-1,i=r?r.length:0;++n<i;){var o=r[n],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=ts(t,e+a);break;case"takeRight":e=es(e,t-a)}}return{start:e,end:t}}function Rn(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Pa.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function On(e){var t=e.constructor;return"function"==typeof t&&t instanceof t||(t=wa),new t}function Ln(e,t,r){var n=e.constructor;switch(t){case it:return Qr(e);case q:case X:return new n(+e);case ot:case at:case st:case ut:case ct:case lt:case ht:case ft:case pt:var i=e.buffer;return new n(r?Qr(i):i,e.byteOffset,e.length);case Z:case rt:return new n(e);case et:var o=new n(e.source,Tt.exec(e));o.lastIndex=e.lastIndex}return o}function Fn(e,t){return e=+e,t=null==t?fs:t,e>-1&&e%1==0&&t>e}function jn(e,t,r){if(!fo(r))return!1;var n=typeof t;if("number"==n)var i=r.length,o=Nn(i)&&Fn(t,i);else o="string"==n&&t in r;if(o){var a=r[t];return e===e?e===a:a!==a}return!1}function Dn(e){var r=Ms(e);return!!r&&e===t[r]&&r in Q.prototype}function Nn(e){return"number"==typeof e&&e>-1&&e%1==0&&fs>=e}function Un(e){return e===e&&(0===e?1/e>0:!fo(e))}function Vn(e,t){var r=e[1],n=t[1],i=r|n,o=L>i,a=n==L&&r==k||n==L&&r==F&&e[7].length<=t[8]||n==(L|F)&&r==k;if(!o&&!a)return e;n&C&&(e[2]=t[2],i|=r&C?0:$);var s=t[3];if(s){var u=e[3];e[3]=u?Zr(u,s,t[4]):Kt(s),e[4]=u?b(e[3],G):Kt(t[4])}return s=t[5],s&&(u=e[5],e[5]=u?Jr(u,s,t[6]):Kt(s),e[6]=u?b(e[5],G):Kt(t[6])),s=t[7],s&&(e[7]=Kt(s)),n&L&&(e[8]=null==e[8]?t[8]:ts(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}function Bn(e,t){e=qn(e);for(var r=-1,n=t.length,i={};++r<n;){var o=t[r];o in e&&(i[o]=e[o])}return i}function In(e,t){var r={};return Mr(e,function(e,n,i){t(e,n,i)&&(r[n]=e)}),r}function zn(e,t){for(var r=e.length,n=ts(t.length,r),i=Kt(e);n--;){var o=t[n];e[n]=Fn(o,r)?i[o]:E}return e}function Gn(e){{var r;t.support}if(!g(e)||Oa.call(e)!=J||!Pa.call(e,"constructor")&&(r=e.constructor,"function"==typeof r&&!(r instanceof r)))return!1;var n;return Mr(e,function(e,t){n=t}),"undefined"==typeof n||Pa.call(e,n)}function Hn(e){for(var r=$o(e),n=r.length,i=n&&e.length,o=t.support,a=i&&Nn(i)&&(au(e)||o.nonEnumArgs&&oo(e)),s=-1,u=[];++s<n;){var c=r[s];(a&&Fn(c,i)||Pa.call(e,c))&&u.push(c)}return u}function Wn(e){return null==e?[]:Nn(e.length)?fo(e)?e:wa(e):Lo(e)}function qn(e){return fo(e)?e:wa(e)}function Xn(e){return e instanceof Q?e.clone():new y(e.__wrapped__,e.__chain__,Kt(e.__actions__))}function Yn(e,t,r){t=(r?jn(e,t,r):null==t)?1:es(+t||1,1);for(var n=0,i=e?e.length:0,o=-1,a=ma(Na(i/t));i>n;)a[++o]=Ur(e,n,n+=t);return a}function Kn(e){for(var t=-1,r=e?e.length:0,n=-1,i=[];++t<r;){var o=e[t];o&&(i[++n]=o)}return i}function Qn(e,t,r){var n=e?e.length:0;return n?((r?jn(e,t,r):null==t)&&(t=1),Ur(e,0>t?0:t)):[]}function Zn(e,t,r){var n=e?e.length:0;return n?((r?jn(e,t,r):null==t)&&(t=1),t=n-(+t||0),Ur(e,0,0>t?0:t)):[]}function Jn(e,t,r){return e&&e.length?Wr(e,$n(t,r,3),!0,!0):[]}function ei(e,t,r){return e&&e.length?Wr(e,$n(t,r,3),!0):[]}function ti(e,t,r,n){var i=e?e.length:0;return i?(r&&"number"!=typeof r&&jn(e,t,r)&&(r=0,n=i),xr(e,t,r,n)):[]}function ri(e){return e?e[0]:E}function ni(e,t,r){var n=e?e.length:0;return r&&jn(e,t,r)&&(t=!1),n?Sr(e,t):[]}function ii(e){var t=e?e.length:0;return t?Sr(e,!0):[]}function oi(e,t,r){var n=e?e.length:0;if(!n)return-1;if("number"==typeof r)r=0>r?es(n+r,0):r;else if(r){var i=Xr(e,t),a=e[i];return(t===t?t===a:a!==a)?i:-1}return o(e,t,r||0)}function ai(e){return Zn(e,1)}function si(){for(var e=[],t=-1,r=arguments.length,n=[],i=kn(),a=i==o;++t<r;){var s=arguments[t];(au(s)||oo(s))&&(e.push(s),n.push(a&&s.length>=120?_s(t&&s):null))}r=e.length;var u=e[0],c=-1,l=u?u.length:0,h=[],f=n[0];e:for(;++c<l;)if(s=u[c],(f?Xt(f,s):i(h,s,0))<0){for(t=r;--t;){var p=n[t];if((p?Xt(p,s):i(e[t],s,0))<0)continue e}f&&f.push(s),h.push(s)}return h}function ui(e){var t=e?e.length:0;return t?e[t-1]:E}function ci(e,t,r){var n=e?e.length:0;if(!n)return-1;var i=n;if("number"==typeof r)i=(0>r?es(n+r,0):ts(r||0,n-1))+1;else if(r){i=Xr(e,t,!0)-1;var o=e[i];return(t===t?t===o:o!==o)?i:-1}if(t!==t)return v(e,i,!0);for(;i--;)if(e[i]===t)return i;return-1}function li(){var e=arguments,t=e[0];if(!t||!t.length)return t;for(var r=0,n=kn(),i=e.length;++r<i;)for(var o=0,a=e[r];(o=n(t,a,o))>-1;)Wa.call(t,o,1);return t}function hi(e,t,r){var n=-1,i=e?e.length:0,o=[];for(t=$n(t,r,3);++n<i;){var a=e[n];t(a,n,e)&&(o.push(a),Wa.call(e,n--,1),i--)}return o}function fi(e){return Qn(e,1)}function pi(e,t,r){var n=e?e.length:0;return n?(r&&"number"!=typeof r&&jn(e,t,r)&&(t=0,r=n),Ur(e,t,r)):[]}function di(e,t,r){var n=e?e.length:0;return n?((r?jn(e,t,r):null==t)&&(t=1),Ur(e,0,0>t?0:t)):[]}function mi(e,t,r){var n=e?e.length:0;return n?((r?jn(e,t,r):null==t)&&(t=1),t=n-(+t||0),Ur(e,0>t?0:t)):[]}function vi(e,t,r){return e&&e.length?Wr(e,$n(t,r,3),!1,!0):[]}function gi(e,t,r){return e&&e.length?Wr(e,$n(t,r,3)):[]}function yi(e,t,r,n){var i=e?e.length:0;if(!i)return[];null!=t&&"boolean"!=typeof t&&(n=r,r=jn(e,t,n)?null:t,t=!1);var a=$n();return(a!==mr||null!=r)&&(r=a(r,n,3)),t&&kn()==o?x(e,r):Gr(e,r)}function bi(e){for(var t=-1,r=(e&&e.length&&ir(nr(e,ka)))>>>0,n=ma(r);++t<r;)n[t]=nr(e,jr(t));return n}function xi(){for(var e=-1,t=arguments.length;++e<t;){var r=arguments[e];if(au(r)||oo(r))var n=n?yr(n,r).concat(yr(r,n)):r}return n?Gr(n):[]}function wi(e,t){var r=-1,n=e?e.length:0,i={};for(!n||t||au(e[0])||(t=[]);++r<n;){var o=e[r];t?i[o]=t[r]:o&&(i[o[0]]=o[1])}return i}function _i(e){var r=t(e);return r.__chain__=!0,r}function Si(e,t,r){return t.call(r,e),e}function Mi(e,t,r){return t.call(r,e)}function Ei(){return _i(this)}function Ti(){return new y(this.value(),this.__chain__)}function Ci(e){for(var t,n=this;n instanceof r;){var i=Xn(n);t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t}function Ai(){var e=this.__wrapped__;return e instanceof Q?(this.__actions__.length&&(e=new Q(this)),new y(e.reverse(),this.__chain__)):this.thru(function(e){return e.reverse()})}function $i(){return this.value()+""}function ki(){return qr(this.__wrapped__,this.__actions__)}function Pi(e,t,r){var n=au(e)?tr:br;return r&&jn(e,t,r)&&(t=null),("function"!=typeof t||"undefined"!=typeof r)&&(t=$n(t,r,3)),n(e,t)}function Ri(e,t,r){var n=au(e)?rr:wr;return t=$n(t,r,3),n(e,t)}function Oi(e,t){return Ds(e,Rr(t))}function Li(e,t,r,n){var i=e?e.length:0;return Nn(i)||(e=Lo(e),i=e.length),i?(r="number"!=typeof r||n&&jn(t,r,n)?0:0>r?es(i+r,0):r||0,"string"==typeof e||!au(e)&&xo(e)?i>r&&e.indexOf(t,r)>-1:kn(e,t,r)>-1):!1}function Fi(e,t,r){var n=au(e)?nr:Pr;return t=$n(t,r,3),n(e,t)}function ji(e,t){return Fi(e,jr(t))}function Di(e,t,r){var n=au(e)?rr:wr;return t=$n(t,r,3),n(e,function(e,r,n){return!t(e,r,n)})}function Ni(e,t,r){if(r?jn(e,t,r):null==t){e=Wn(e);var n=e.length;return n>0?e[Dr(0,n-1)]:E}var i=Ui(e);return i.length=ts(0>t?0:+t||0,i.length),i}function Ui(e){e=Wn(e);for(var t=-1,r=e.length,n=ma(r);++t<r;){var i=Dr(0,t);t!=i&&(n[t]=n[i]),n[i]=e[t]}return n}function Vi(e){var t=e?e.length:0;return Nn(t)?t:yu(e).length}function Bi(e,t,r){var n=au(e)?ur:Vr;return r&&jn(e,t,r)&&(t=null),("function"!=typeof t||"undefined"!=typeof r)&&(t=$n(t,r,3)),n(e,t)}function Ii(e,t,r){if(null==e)return[];var n=-1,i=e.length,o=Nn(i)?ma(i):[];return r&&jn(e,t,r)&&(t=null),t=$n(t,r,3),gs(e,function(e,r,i){o[++n]={criteria:t(e,r,i),index:n,value:e}}),Br(o,h)}function zi(){var e=arguments,t=e[0],r=e[3],n=0,i=e.length-1;if(null==t)return[];for(var o=ma(i);i>n;)o[n]=e[++n];return r&&jn(e[1],e[2],r)&&(o=e[1]),Ir(t,Sr(o),[])}function Gi(e,t,r,n){return null==e?[]:(n&&jn(t,r,n)&&(r=null),au(t)||(t=null==t?[]:[t]),au(r)||(r=null==r?[]:[r]),Ir(e,t,r))}function Hi(e,t){return Ri(e,Rr(t))}function Wi(e,t){if("function"!=typeof t){if("function"!=typeof e)throw new Ma(z);var r=e;e=t,t=r}return e=Za(e=+e)?e:0,function(){return--e<1?t.apply(this,arguments):void 0}}function qi(e,t,r){return r&&jn(e,t,r)&&(t=null),t=e&&null==t?e.length:es(+t||0,0),Mn(e,L,null,null,null,null,t)}function Xi(e,t){var r;if("function"!=typeof t){if("function"!=typeof e)throw new Ma(z);var n=e;e=t,t=n}return function(){return--e>0?r=t.apply(this,arguments):t=null,r}}function Yi(e,t,r){function n(){f&&Ua(f),u&&Ua(u),u=f=p=E}function i(){var r=t-(qs()-l);if(0>=r||r>t){u&&Ua(u);var n=p;u=f=p=E,n&&(d=qs(),c=e.apply(h,s),f||u||(s=h=null))}else f=Ha(i,r)}function o(){f&&Ua(f),u=f=p=E,(v||m!==t)&&(d=qs(),c=e.apply(h,s),f||u||(s=h=null))}function a(){if(s=arguments,l=qs(),h=this,p=v&&(f||!g),m===!1)var r=g&&!f;else{u||g||(d=l);var n=m-(l-d),a=0>=n||n>m;a?(u&&(u=Ua(u)),d=l,c=e.apply(h,s)):u||(u=Ha(o,n))}return a&&f?f=Ua(f):f||t===m||(f=Ha(i,t)),r&&(a=!0,c=e.apply(h,s)),!a||f||u||(s=h=null),c}var s,u,c,l,h,f,p,d=0,m=!1,v=!0;if("function"!=typeof e)throw new Ma(z);if(t=0>t?0:+t||0,r===!0){var g=!0;v=!1}else fo(r)&&(g=r.leading,m="maxWait"in r&&es(+r.maxWait||0,t),v="trailing"in r?r.trailing:v);return a.cancel=n,a}function Ki(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new Ma(z);var r=function(){var n=arguments,i=r.cache,o=t?t.apply(this,n):n[0];if(i.has(o))return i.get(o);var a=e.apply(this,n);return i.set(o,a),a};return r.cache=new Ki.Cache,r}function Qi(e){if("function"!=typeof e)throw new Ma(z);return function(){return!e.apply(this,arguments)}}function Zi(e){return Xi(e,2)}function Ji(e,t){if("function"!=typeof e)throw new Ma(z);return t=es("undefined"==typeof t?e.length-1:+t||0,0),function(){for(var r=arguments,n=-1,i=es(r.length-t,0),o=ma(i);++n<i;)o[n]=r[t+n];switch(t){case 0:return e.call(this,o);case 1:return e.call(this,r[0],o);case 2:return e.call(this,r[0],r[1],o)}var a=ma(t+1);for(n=-1;++n<t;)a[n]=r[n];return a[t]=o,e.apply(this,a)}}function eo(e){if("function"!=typeof e)throw new Ma(z);return function(t){return e.apply(this,t)}}function to(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new Ma(z);return r===!1?n=!1:fo(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Vt.leading=n,Vt.maxWait=+t,Vt.trailing=i,Yi(e,t,Vt)}function ro(e,t){return t=null==t?ra:t,Mn(t,R,null,[e],[])}function no(e,t,r,n){return t&&"boolean"!=typeof t&&jn(e,t,r)?t=!1:"function"==typeof t&&(n=r,r=t,t=!1),r="function"==typeof r&&Kr(r,n,1),vr(e,t,r)}function io(e,t,r){return t="function"==typeof t&&Kr(t,r,1),vr(e,!0,t)}function oo(e){var t=g(e)?e.length:E;return Nn(t)&&Oa.call(e)==H}function ao(e){return e===!0||e===!1||g(e)&&Oa.call(e)==q}function so(e){return g(e)&&Oa.call(e)==X}function uo(e){return!!e&&1===e.nodeType&&g(e)&&Oa.call(e).indexOf("Element")>-1}function co(e){if(null==e)return!0;var t=e.length;return Nn(t)&&(au(e)||xo(e)||oo(e)||g(e)&&uu(e.splice))?!t:!yu(e).length}function lo(e,t,r,n){if(r="function"==typeof r&&Kr(r,n,3),!r&&Un(e)&&Un(t))return e===t;var i=r?r(e,t):E;return"undefined"==typeof i?Ar(e,t,r):!!i}function ho(e){return g(e)&&"string"==typeof e.message&&Oa.call(e)==Y}function fo(e){var t=typeof e;return"function"==t||!!e&&"object"==t}function po(e,t,r,n){var i=yu(t),o=i.length;if(!o)return!0;if(null==e)return!1;if(r="function"==typeof r&&Kr(r,n,3),!r&&1==o){var a=i[0],s=t[a];if(Un(s))return s===e[a]&&("undefined"!=typeof s||a in qn(e))}for(var u=ma(o),c=ma(o);o--;)s=u[o]=t[i[o]],c[o]=Un(s);return kr(qn(e),i,u,c,r)}function mo(e){return yo(e)&&e!=+e}function vo(e){return null==e?!1:Oa.call(e)==K?Fa.test($a.call(e)):g(e)&&At.test(e)}function go(e){return null===e}function yo(e){return"number"==typeof e||g(e)&&Oa.call(e)==Z}function bo(e){return g(e)&&Oa.call(e)==et||!1}function xo(e){return"string"==typeof e||g(e)&&Oa.call(e)==rt}function wo(e){return g(e)&&Nn(e.length)&&!!Nt[Oa.call(e)]}function _o(e){return"undefined"==typeof e}function So(e){var t=e?e.length:0;return Nn(t)?t?Kt(e):[]:Lo(e)}function Mo(e){return dr(e,$o(e))}function Eo(e,t,r){var n=vs(e);return r&&jn(e,t,r)&&(t=null),t?dr(t,n,yu(t)):n}function To(e){return Cr(e,$o(e))}function Co(e,t){return e?Pa.call(e,t):!1}function Ao(e,t,r){r&&jn(e,t,r)&&(t=null);for(var n=-1,i=yu(e),o=i.length,a={};++n<o;){var s=i[n],u=e[s];t?Pa.call(a,u)?a[u].push(s):a[u]=[s]:a[u]=s}return a}function $o(e){if(null==e)return[];fo(e)||(e=wa(e));var t=e.length;t=t&&Nn(t)&&(au(e)||ms.nonEnumArgs&&oo(e))&&t||0;for(var r=e.constructor,n=-1,i="function"==typeof r&&r.prototype===e,o=ma(t),a=t>0;++n<t;)o[n]=n+"";for(var s in e)a&&Fn(s,t)||"constructor"==s&&(i||!Pa.call(e,s))||o.push(s);return o}function ko(e,t,r){var n={};return t=$n(t,r,3),Er(e,function(e,r,i){n[r]=t(e,r,i)}),n}function Po(e){for(var t=-1,r=yu(e),n=r.length,i=ma(n);++t<n;){var o=r[t];i[t]=[o,e[o]]}return i}function Ro(e,t,r){var n=null==e?E:e[t];return"undefined"==typeof n&&(n=r),uu(n)?n.call(e):n}function Oo(e,t,r,n){var i=au(e)||wo(e);if(t=$n(t,n,4),null==r)if(i||fo(e)){var o=e.constructor;r=i?au(e)?new o:[]:vs(uu(o)&&o.prototype)}else r={};return(i?Qt:Er)(e,function(e,n,i){return t(r,e,n,i)}),r}function Lo(e){return Hr(e,yu(e))}function Fo(e){return Hr(e,$o(e))}function jo(e,t,r){return t=+t||0,"undefined"==typeof r?(r=t,t=0):r=+r||0,e>=t&&r>e}function Do(e,t,r){r&&jn(e,t,r)&&(t=r=null);var n=null==e,i=null==t;if(null==r&&(i&&"boolean"==typeof e?(r=e,e=1):"boolean"==typeof t&&(r=t,i=!0)),n&&i&&(t=1,i=!1),e=+e||0,i?(t=e,e=0):t=+t||0,r||e%1||t%1){var o=os();return ts(e+o*(t-e+parseFloat("1e-"+((o+"").length-1))),t)}return Dr(e,t)}function No(e){return e=s(e),e&&e.charAt(0).toUpperCase()+e.slice(1)}function Uo(e){return e=s(e),e&&e.replace($t,p).replace(Mt,"")}function Vo(e,t,r){e=s(e),t+="";var n=e.length;return r="undefined"==typeof r?n:ts(0>r?0:+r||0,n),r-=t.length,r>=0&&e.indexOf(t,r)==r}function Bo(e){return e=s(e),e&&xt.test(e)?e.replace(yt,d):e}function Io(e){return e=s(e),e&&Rt.test(e)?e.replace(Pt,"\\$&"):e}function zo(e,t,r){e=s(e),t=+t;var n=e.length;if(n>=t||!Za(t))return e;var i=(t-n)/2,o=Va(i),a=Na(i);return r=wn("",a,r),r.slice(0,o)+e+r}function Go(e,t,r){return r&&jn(e,t,r)&&(t=0),is(e,t)}function Ho(e,t){var r="";if(e=s(e),t=+t,1>t||!e||!Za(t))return r;do t%2&&(r+=e),t=Va(t/2),e+=e;while(t);return r}function Wo(e,t,r){return e=s(e),r=null==r?0:ts(0>r?0:+r||0,e.length),e.lastIndexOf(t,r)==r}function qo(e,r,n){var i=t.templateSettings;n&&jn(e,r,n)&&(r=n=null),e=s(e),r=fr(fr({},n||r),i,hr);var o,a,u=fr(fr({},r.imports),i.imports,hr),c=yu(u),l=Hr(u,c),h=0,f=r.interpolate||kt,p="__p += '",d=_a((r.escape||kt).source+"|"+f.source+"|"+(f===St?Et:kt).source+"|"+(r.evaluate||kt).source+"|$","g"),v="//# sourceURL="+("sourceURL"in r?r.sourceURL:"lodash.templateSources["+ ++Dt+"]")+"\n";e.replace(d,function(t,r,n,i,s,u){return n||(n=i),p+=e.slice(h,u).replace(Ot,m),r&&(o=!0,p+="' +\n__e("+r+") +\n'"),s&&(a=!0,p+="';\n"+s+";\n__p += '"),n&&(p+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),h=u+t.length,t}),p+="';\n";var g=r.variable;g||(p="with (obj) {\n"+p+"\n}\n"),p=(a?p.replace(dt,""):p).replace(mt,"$1").replace(vt,"$1;"),p="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var y=Au(function(){return ya(c,v+"return "+p).apply(E,l)});if(y.source=p,ho(y))throw y;return y}function Xo(e,t,r){var n=e;return(e=s(e))?(r?jn(n,t,r):null==t)?e.slice(w(e),_(e)+1):(t+="",e.slice(c(e,t),l(e,t)+1)):e}function Yo(e,t,r){var n=e;return e=s(e),e?e.slice((r?jn(n,t,r):null==t)?w(e):c(e,t+"")):e}function Ko(e,t,r){var n=e;return e=s(e),e?(r?jn(n,t,r):null==t)?e.slice(0,_(e)+1):e.slice(0,l(e,t+"")+1):e}function Qo(e,t,r){r&&jn(e,t,r)&&(t=null);var n=j,i=D;if(null!=t)if(fo(t)){var o="separator"in t?t.separator:o;n="length"in t?+t.length||0:n,i="omission"in t?s(t.omission):i}else n=+t||0;if(e=s(e),n>=e.length)return e;var a=n-i.length;if(1>a)return i;var u=e.slice(0,a);if(null==o)return u+i;if(bo(o)){if(e.slice(a).search(o)){var c,l,h=e.slice(0,a);for(o.global||(o=_a(o.source,(Tt.exec(o)||"")+"g")),o.lastIndex=0;c=o.exec(h);)l=c.index;u=u.slice(0,null==l?a:l)}}else if(e.indexOf(o,a)!=a){var f=u.lastIndexOf(o);f>-1&&(u=u.slice(0,f))}return u+i}function Zo(e){return e=s(e),e&&bt.test(e)?e.replace(gt,S):e}function Jo(e,t,r){return r&&jn(e,t,r)&&(t=null),e=s(e),e.match(t||Lt)||[]}function ea(e,t,r){return r&&jn(e,t,r)&&(t=null),g(e)?na(e):mr(e,t)}function ta(e){return function(){return e}}function ra(e){return e}function na(e){return Rr(vr(e,!0))}function ia(e,t){return Or(e+"",vr(t,!0))}function oa(e,t,r){if(null==r){var n=fo(t),i=n&&yu(t),o=i&&i.length&&Cr(t,i);(o?o.length:n)||(o=!1,r=t,t=e,e=this)}o||(o=Cr(t,yu(t)));var a=!0,s=-1,u=uu(e),c=o.length;r===!1?a=!1:fo(r)&&"chain"in r&&(a=r.chain);for(;++s<c;){var l=o[s],h=t[l];e[l]=h,u&&(e.prototype[l]=function(t){return function(){var r=this.__chain__;if(a||r){var n=e(this.__wrapped__),i=n.__actions__=Kt(this.__actions__);return i.push({func:t,args:arguments,thisArg:e}),n.__chain__=r,n}var o=[this.value()];return Ia.apply(o,arguments),t.apply(e,o)}}(h))}return e}function aa(){return e._=La,this}function sa(){}function ua(e){return jr(e+"")}function ca(e){return function(t){return null==e?E:e[t]}}function la(e,t,r){r&&jn(e,t,r)&&(t=r=null),e=+e||0,r=null==r?1:+r||0,null==t?(t=e,e=0):t=+t||0;for(var n=-1,i=es(Na((t-e)/(r||1)),0),o=ma(i);++n<i;)o[n]=e,e+=r;return o}function ha(e,t,r){if(e=+e,1>e||!Za(e))return[];var n=-1,i=ma(ts(e,us));for(t=Kr(t,r,1);++n<e;)us>n?i[n]=t(n):t(n);return i}function fa(e){var t=++Ra;return s(e)+t}function pa(e,t){return e+t}function da(e,t,r){r&&jn(e,t,r)&&(t=null);var n=$n(),i=null==t;return n===mr&&i||(i=!1,t=n(t,r,3)),i?cr(au(e)?e:Wn(e)):zr(e,t)}e=e?Jt.defaults(Zt.Object(),e,Jt.pick(Zt,jt)):Zt;var ma=e.Array,va=e.Date,ga=e.Error,ya=e.Function,ba=e.Math,xa=e.Number,wa=e.Object,_a=e.RegExp,Sa=e.String,Ma=e.TypeError,Ea=ma.prototype,Ta=wa.prototype,Ca=Sa.prototype,Aa=(Aa=e.window)&&Aa.document,$a=ya.prototype.toString,ka=jr("length"),Pa=Ta.hasOwnProperty,Ra=0,Oa=Ta.toString,La=e._,Fa=_a("^"+Io(Oa).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ja=vo(ja=e.ArrayBuffer)&&ja,Da=vo(Da=ja&&new ja(0).slice)&&Da,Na=ba.ceil,Ua=e.clearTimeout,Va=ba.floor,Ba=vo(Ba=wa.getPrototypeOf)&&Ba,Ia=Ea.push,za=Ta.propertyIsEnumerable,Ga=vo(Ga=e.Set)&&Ga,Ha=e.setTimeout,Wa=Ea.splice,qa=vo(qa=e.Uint8Array)&&qa,Xa=vo(Xa=e.WeakMap)&&Xa,Ya=function(){try{var t=vo(t=e.Float64Array)&&t,r=new t(new ja(10),0,1)&&t}catch(n){}return r}(),Ka=vo(Ka=ma.isArray)&&Ka,Qa=vo(Qa=wa.create)&&Qa,Za=e.isFinite,Ja=vo(Ja=wa.keys)&&Ja,es=ba.max,ts=ba.min,rs=vo(rs=va.now)&&rs,ns=vo(ns=xa.isFinite)&&ns,is=e.parseInt,os=ba.random,as=xa.NEGATIVE_INFINITY,ss=xa.POSITIVE_INFINITY,us=ba.pow(2,32)-1,cs=us-1,ls=us>>>1,hs=Ya?Ya.BYTES_PER_ELEMENT:0,fs=ba.pow(2,53)-1,ps=Xa&&new Xa,ds={},ms=t.support={};!function(){ms.funcDecomp=/\bthis\b/.test(function(){return this}),ms.funcNames="string"==typeof ya.name;try{ms.dom=11===Aa.createDocumentFragment().nodeType}catch(e){ms.dom=!1}try{ms.nonEnumArgs=!za.call(arguments,1)}catch(e){ms.nonEnumArgs=!0}}(0,0),t.templateSettings={escape:wt,evaluate:_t,interpolate:St,variable:"",imports:{_:t}};var vs=function(){function t(){}return function(r){if(fo(r)){t.prototype=r;var n=new t;t.prototype=null}return n||e.Object()}}(),gs=rn(Er),ys=rn(Tr,!0),bs=nn(),xs=nn(!0),ws=ps?function(e,t){return ps.set(e,t),e}:ra;Da||(Qr=ja&&qa?function(e){var t=e.byteLength,r=Ya?Va(t/hs):0,n=r*hs,i=new ja(t);if(r){var o=new Ya(i,0,r);o.set(new Ya(e,0,r))}return t!=n&&(o=new qa(i,n),o.set(new qa(e,n))),i}:ta(null));var _s=Qa&&Ga?function(e){return new qt(e)}:ta(null),Ss=ps?function(e){return ps.get(e)}:sa,Ms=function(){return ms.funcNames?"constant"==ta.name?jr("name"):function(e){for(var t=e.name,r=ds[t],n=r?r.length:0;n--;){var i=r[n],o=i.func;if(null==o||o==e)return i.name}return t}:ta("")}(),Es=function(){var e=0,t=0;return function(r,n){var i=qs(),o=U-(i-t);if(t=i,o>0){if(++e>=N)return r}else e=0;return ws(r,n)}}(),Ts=Ji(function(e,t){return au(e)||oo(e)?yr(e,Sr(t,!1,!0)):[]}),Cs=hn(),As=hn(!0),$s=Ji(function(e,t){e||(e=[]),t=Sr(t);var r=t.length,i=pr(e,t);for(t.sort(n);r--;){var o=parseFloat(t[r]);if(o!=a&&Fn(o)){var a=o;Wa.call(e,o,1)}}return i}),ks=Sn(),Ps=Sn(!0),Rs=Ji(function(e){return Gr(Sr(e,!1,!0))}),Os=Ji(function(e,t){return au(e)||oo(e)?yr(e,t):[]}),Ls=Ji(bi),Fs=Ji(function(e,t){var r=e?e.length:0;return Nn(r)&&(e=Wn(e)),pr(e,Sr(t))}),js=en(function(e,t,r){Pa.call(e,r)?++e[r]:e[r]=1}),Ds=ln(gs),Ns=ln(ys,!0),Us=dn(Qt,gs),Vs=dn(er,ys),Bs=en(function(e,t,r){Pa.call(e,r)?e[r].push(t):e[r]=[t]}),Is=en(function(e,t,r){e[r]=t}),zs=Ji(function(e,t,r){var n=-1,i="function"==typeof t,o=e?e.length:0,a=Nn(o)?ma(o):[];return gs(e,function(e){var o=i?t:null!=e&&e[t];a[++n]=o?o.apply(e,r):E}),a}),Gs=en(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]}),Hs=bn(ar,gs),Ws=bn(sr,ys),qs=rs||function(){return(new va).getTime()},Xs=Ji(function(e,t,r){var n=C;if(r.length){var i=b(r,Xs.placeholder);n|=R}return Mn(e,n,t,r,i)}),Ys=Ji(function(e,t){t=t.length?Sr(t):To(e);for(var r=-1,n=t.length;++r<n;){var i=t[r];e[i]=Mn(e[i],C,e)}return e}),Ks=Ji(function(e,t,r){var n=C|A;if(r.length){var i=b(r,Ks.placeholder);n|=R}return Mn(t,n,e,r,i)}),Qs=un(k),Zs=un(P),Js=Ji(function(e,t){return gr(e,1,t)}),eu=Ji(function(e,t,r){return gr(e,t,r)}),tu=pn(),ru=pn(!0),nu=yn(R),iu=yn(O),ou=Ji(function(e,t){return Mn(e,F,null,null,null,Sr(t))}),au=Ka||function(e){return g(e)&&Nn(e.length)&&Oa.call(e)==W};ms.dom||(uo=function(e){return!!e&&1===e.nodeType&&g(e)&&!cu(e)});var su=ns||function(e){return"number"==typeof e&&Za(e)},uu=a(/x/)||qa&&!a(qa)?function(e){return Oa.call(e)==K}:a,cu=Ba?function(e){if(!e||Oa.call(e)!=J)return!1;var t=e.valueOf,r=vo(t)&&(r=Ba(t))&&Ba(r);return r?e==r||Ba(e)==r:Gn(e)}:Gn,lu=tn(fr),hu=Ji(function(e){var t=e[0];return null==t?t:(e.push(lr),lu.apply(E,e))}),fu=fn(Er),pu=fn(Tr),du=mn(bs),mu=mn(xs),vu=vn(Er),gu=vn(Tr),yu=Ja?function(e){if(e)var t=e.constructor,r=e.length;return"function"==typeof t&&t.prototype===e||"function"!=typeof e&&r&&Nn(r)?Hn(e):fo(e)?Ja(e):[]}:Hn,bu=tn(Lr),xu=Ji(function(e,t){if(null==e)return{};if("function"!=typeof t[0]){var t=nr(Sr(t),Sa);return Bn(e,yr($o(e),t))}var r=Kr(t[0],t[1],3);return In(e,function(e,t,n){return!r(e,t,n)})}),wu=Ji(function(e,t){return null==e?{}:"function"==typeof t[0]?In(e,Kr(t[0],t[1],3)):Bn(e,Sr(t))}),_u=an(function(e,t,r){return t=t.toLowerCase(),e+(r?t.charAt(0).toUpperCase()+t.slice(1):t)}),Su=an(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),Mu=gn(),Eu=gn(!0);8!=is(Ft+"08")&&(Go=function(e,t,r){return(r?jn(e,t,r):null==t)?t=0:t&&(t=+t),e=Xo(e),is(e,t||(Ct.test(e)?16:10))});var Tu=an(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}),Cu=an(function(e,t,r){return e+(r?" ":"")+(t.charAt(0).toUpperCase()+t.slice(1))}),Au=Ji(function(e,t){try{return e.apply(E,t)}catch(r){return ho(r)?r:new ga(r)}}),$u=cn(ir),ku=cn(or,!0);return t.prototype=r.prototype,y.prototype=vs(r.prototype),y.prototype.constructor=y,Q.prototype=vs(r.prototype),Q.prototype.constructor=Q,It.prototype["delete"]=zt,It.prototype.get=Gt,It.prototype.has=Ht,It.prototype.set=Wt,qt.prototype.push=Yt,Ki.Cache=It,t.after=Wi,t.ary=qi,t.assign=lu,t.at=Fs,t.before=Xi,t.bind=Xs,t.bindAll=Ys,t.bindKey=Ks,t.callback=ea,t.chain=_i,t.chunk=Yn,t.compact=Kn,t.constant=ta,t.countBy=js,t.create=Eo,t.curry=Qs,t.curryRight=Zs,t.debounce=Yi,t.defaults=hu,t.defer=Js,t.delay=eu,t.difference=Ts,t.drop=Qn,t.dropRight=Zn,t.dropRightWhile=Jn,t.dropWhile=ei,t.fill=ti,t.filter=Ri,t.flatten=ni,t.flattenDeep=ii,t.flow=tu,t.flowRight=ru,t.forEach=Us,t.forEachRight=Vs,t.forIn=du,t.forInRight=mu,t.forOwn=vu,t.forOwnRight=gu,t.functions=To,t.groupBy=Bs,t.indexBy=Is,t.initial=ai,t.intersection=si,t.invert=Ao,t.invoke=zs,t.keys=yu,t.keysIn=$o,t.map=Fi,t.mapValues=ko,t.matches=na,t.matchesProperty=ia,t.memoize=Ki,t.merge=bu,t.mixin=oa,t.negate=Qi,t.omit=xu,t.once=Zi,t.pairs=Po,t.partial=nu,t.partialRight=iu,t.partition=Gs,t.pick=wu,t.pluck=ji,t.property=ua,t.propertyOf=ca,t.pull=li,t.pullAt=$s,t.range=la,t.rearg=ou,t.reject=Di,t.remove=hi,t.rest=fi,t.restParam=Ji,t.shuffle=Ui,t.slice=pi,t.sortBy=Ii,t.sortByAll=zi,t.sortByOrder=Gi,t.spread=eo,t.take=di,t.takeRight=mi,t.takeRightWhile=vi,t.takeWhile=gi,t.tap=Si,t.throttle=to,t.thru=Mi,t.times=ha,t.toArray=So,t.toPlainObject=Mo,t.transform=Oo,t.union=Rs,t.uniq=yi,t.unzip=bi,t.values=Lo,t.valuesIn=Fo,t.where=Hi,t.without=Os,t.wrap=ro,t.xor=xi,t.zip=Ls,t.zipObject=wi,t.backflow=ru,t.collect=Fi,t.compose=ru,t.each=Us,t.eachRight=Vs,t.extend=lu,t.iteratee=ea,t.methods=To,t.object=wi,t.select=Ri,t.tail=fi,t.unique=yi,oa(t,t),t.add=pa,t.attempt=Au,t.camelCase=_u,t.capitalize=No,t.clone=no,t.cloneDeep=io,t.deburr=Uo,t.endsWith=Vo,t.escape=Bo,t.escapeRegExp=Io,t.every=Pi,t.find=Ds,t.findIndex=Cs,t.findKey=fu,t.findLast=Ns,t.findLastIndex=As,t.findLastKey=pu,t.findWhere=Oi,t.first=ri,t.has=Co,t.identity=ra,t.includes=Li,t.indexOf=oi,t.inRange=jo,t.isArguments=oo,t.isArray=au,t.isBoolean=ao,t.isDate=so,t.isElement=uo,t.isEmpty=co,t.isEqual=lo,t.isError=ho,t.isFinite=su,t.isFunction=uu,t.isMatch=po,t.isNaN=mo,t.isNative=vo,t.isNull=go,t.isNumber=yo,t.isObject=fo,t.isPlainObject=cu,t.isRegExp=bo,t.isString=xo,t.isTypedArray=wo,t.isUndefined=_o,t.kebabCase=Su,t.last=ui,t.lastIndexOf=ci,t.max=$u,t.min=ku,t.noConflict=aa,t.noop=sa,t.now=qs,t.pad=zo,t.padLeft=Mu,t.padRight=Eu,t.parseInt=Go,t.random=Do,t.reduce=Hs,t.reduceRight=Ws,t.repeat=Ho,t.result=Ro,t.runInContext=M,t.size=Vi,t.snakeCase=Tu,t.some=Bi,t.sortedIndex=ks,t.sortedLastIndex=Ps,t.startCase=Cu,t.startsWith=Wo,t.sum=da,t.template=qo,t.trim=Xo,t.trimLeft=Yo,t.trimRight=Ko,t.trunc=Qo,t.unescape=Zo,t.uniqueId=fa,t.words=Jo,t.all=Pi,t.any=Bi,t.contains=Li,t.detect=Ds,t.foldl=Hs,t.foldr=Ws,t.head=ri,t.include=Li,t.inject=Hs,oa(t,function(){var e={};
return Er(t,function(r,n){t.prototype[n]||(e[n]=r)}),e}(),!1),t.sample=Ni,t.prototype.sample=function(e){return this.__chain__||null!=e?this.thru(function(t){return Ni(t,e)}):Ni(this.value())},t.VERSION=T,Qt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){t[e].placeholder=t}),Qt(["dropWhile","filter","map","takeWhile"],function(e,t){var r=t!=I,n=t==V;Q.prototype[e]=function(e,i){var o=this.__filtered__,a=o&&n?new Q(this):this.clone(),s=a.__iteratees__||(a.__iteratees__=[]);return s.push({done:!1,count:0,index:0,iteratee:$n(e,i,1),limit:-1,type:t}),a.__filtered__=o||r,a}}),Qt(["drop","take"],function(e,t){var r=e+"While";Q.prototype[e]=function(r){var n=this.__filtered__,i=n&&!t?this.dropWhile():this.clone();if(r=null==r?1:es(Va(r)||0,0),n)t?i.__takeCount__=ts(i.__takeCount__,r):ui(i.__iteratees__).limit=r;else{var o=i.__views__||(i.__views__=[]);o.push({size:r,type:e+(i.__dir__<0?"Right":"")})}return i},Q.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()},Q.prototype[e+"RightWhile"]=function(e,t){return this.reverse()[r](e,t).reverse()}}),Qt(["first","last"],function(e,t){var r="take"+(t?"Right":"");Q.prototype[e]=function(){return this[r](1).value()[0]}}),Qt(["initial","rest"],function(e,t){var r="drop"+(t?"":"Right");Q.prototype[e]=function(){return this[r](1)}}),Qt(["pluck","where"],function(e,t){var r=t?"filter":"map",n=t?Rr:jr;Q.prototype[e]=function(e){return this[r](n(e))}}),Q.prototype.compact=function(){return this.filter(ra)},Q.prototype.reject=function(e,t){return e=$n(e,t,1),this.filter(function(t){return!e(t)})},Q.prototype.slice=function(e,t){e=null==e?0:+e||0;var r=0>e?this.takeRight(-e):this.drop(e);return"undefined"!=typeof t&&(t=+t||0,r=0>t?r.dropRight(-t):r.take(t-e)),r},Q.prototype.toArray=function(){return this.drop(0)},Er(Q.prototype,function(e,r){var n=t[r];if(n){var i=/^(?:filter|map|reject)|While$/.test(r),o=/^(?:first|last)$/.test(r);t.prototype[r]=function(){var r=arguments,a=(r.length,this.__chain__),s=this.__wrapped__,u=!!this.__actions__.length,c=s instanceof Q,l=r[0],h=c||au(s);h&&i&&"function"==typeof l&&1!=l.length&&(c=h=!1);var f=c&&!u;if(o&&!a)return f?e.call(s):n.call(t,this.value());var p=function(e){var i=[e];return Ia.apply(i,r),n.apply(t,i)};if(h){var d=f?s:new Q(this),m=e.apply(d,r);if(!o&&(u||m.__actions__)){var v=m.__actions__||(m.__actions__=[]);v.push({func:Mi,args:[p],thisArg:t})}return new y(m,a)}return this.thru(p)}}}),Qt(["concat","join","pop","push","replace","shift","sort","splice","split","unshift"],function(e){var r=(/^(?:replace|split)$/.test(e)?Ca:Ea)[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:join|pop|replace|shift)$/.test(e);t.prototype[e]=function(){var e=arguments;return i&&!this.__chain__?r.apply(this.value(),e):this[n](function(t){return r.apply(t,e)})}}),Er(Q.prototype,function(e,r){var n=t[r];if(n){var i=n.name,o=ds[i]||(ds[i]=[]);o.push({name:r,func:n})}}),ds[xn(null,A).name]=[{name:"wrapper",func:null}],Q.prototype.clone=tt,Q.prototype.reverse=nt,Q.prototype.value=Bt,t.prototype.chain=Ei,t.prototype.commit=Ti,t.prototype.plant=Ci,t.prototype.reverse=Ai,t.prototype.toString=$i,t.prototype.run=t.prototype.toJSON=t.prototype.valueOf=t.prototype.value=ki,t.prototype.collect=t.prototype.map,t.prototype.head=t.prototype.first,t.prototype.select=t.prototype.filter,t.prototype.tail=t.prototype.rest,t}var E,T="3.6.0",C=1,A=2,$=4,k=8,P=16,R=32,O=64,L=128,F=256,j=30,D="...",N=150,U=16,V=0,B=1,I=2,z="Expected a function",G="__lodash_placeholder__",H="[object Arguments]",W="[object Array]",q="[object Boolean]",X="[object Date]",Y="[object Error]",K="[object Function]",Q="[object Map]",Z="[object Number]",J="[object Object]",et="[object RegExp]",tt="[object Set]",rt="[object String]",nt="[object WeakMap]",it="[object ArrayBuffer]",ot="[object Float32Array]",at="[object Float64Array]",st="[object Int8Array]",ut="[object Int16Array]",ct="[object Int32Array]",lt="[object Uint8Array]",ht="[object Uint8ClampedArray]",ft="[object Uint16Array]",pt="[object Uint32Array]",dt=/\b__p \+= '';/g,mt=/\b(__p \+=) '' \+/g,vt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,gt=/&(?:amp|lt|gt|quot|#39|#96);/g,yt=/[&<>"'`]/g,bt=RegExp(gt.source),xt=RegExp(yt.source),wt=/<%-([\s\S]+?)%>/g,_t=/<%([\s\S]+?)%>/g,St=/<%=([\s\S]+?)%>/g,Mt=/[\u0300-\u036f\ufe20-\ufe23]/g,Et=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Tt=/\w*$/,Ct=/^0[xX]/,At=/^\[object .+?Constructor\]$/,$t=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,kt=/($^)/,Pt=/[.*+?^${}()|[\]\/\\]/g,Rt=RegExp(Pt.source),Ot=/['\n\r\u2028\u2029\\]/g,Lt=function(){var e="[A-Z\\xc0-\\xd6\\xd8-\\xde]",t="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(e+"+(?="+e+t+")|"+e+"?"+t+"|"+e+"+|[0-9]+","g")}(),Ft=" \f \n\r\u2028\u2029 ",jt=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","document","isFinite","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","window"],Dt=-1,Nt={};Nt[ot]=Nt[at]=Nt[st]=Nt[ut]=Nt[ct]=Nt[lt]=Nt[ht]=Nt[ft]=Nt[pt]=!0,Nt[H]=Nt[W]=Nt[it]=Nt[q]=Nt[X]=Nt[Y]=Nt[K]=Nt[Q]=Nt[Z]=Nt[J]=Nt[et]=Nt[tt]=Nt[rt]=Nt[nt]=!1;var Ut={};Ut[H]=Ut[W]=Ut[it]=Ut[q]=Ut[X]=Ut[ot]=Ut[at]=Ut[st]=Ut[ut]=Ut[ct]=Ut[Z]=Ut[J]=Ut[et]=Ut[rt]=Ut[lt]=Ut[ht]=Ut[ft]=Ut[pt]=!0,Ut[Y]=Ut[K]=Ut[Q]=Ut[tt]=Ut[nt]=!1;var Vt={leading:!1,maxWait:0,trailing:!1},Bt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},It={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},zt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Gt={"function":!0,object:!0},Ht={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Wt=Gt[typeof r]&&r&&!r.nodeType&&r,qt=Gt[typeof t]&&t&&!t.nodeType&&t,Xt=Wt&&qt&&"object"==typeof e&&e,Yt=Gt[typeof self]&&self&&self.Object&&self,Kt=Gt[typeof window]&&window&&window.Object&&window,Qt=qt&&qt.exports===Wt&&Wt,Zt=Xt||Kt!==(this&&this.window)&&Kt||Yt||this,Jt=M();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Zt._=Jt,define(function(){return Jt})):Wt&&qt?Qt?(qt.exports=Jt)._=Jt:Wt._=Jt:Zt._=Jt}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],three:[function(e,t){var r={REVISION:"70"};"object"==typeof t&&(t.exports=r),void 0===Math.sign&&(Math.sign=function(e){return 0>e?-1:e>0?1:0}),r.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2},r.CullFaceNone=0,r.CullFaceBack=1,r.CullFaceFront=2,r.CullFaceFrontBack=3,r.FrontFaceDirectionCW=0,r.FrontFaceDirectionCCW=1,r.BasicShadowMap=0,r.PCFShadowMap=1,r.PCFSoftShadowMap=2,r.FrontSide=0,r.BackSide=1,r.DoubleSide=2,r.NoShading=0,r.FlatShading=1,r.SmoothShading=2,r.NoColors=0,r.FaceColors=1,r.VertexColors=2,r.NoBlending=0,r.NormalBlending=1,r.AdditiveBlending=2,r.SubtractiveBlending=3,r.MultiplyBlending=4,r.CustomBlending=5,r.AddEquation=100,r.SubtractEquation=101,r.ReverseSubtractEquation=102,r.MinEquation=103,r.MaxEquation=104,r.ZeroFactor=200,r.OneFactor=201,r.SrcColorFactor=202,r.OneMinusSrcColorFactor=203,r.SrcAlphaFactor=204,r.OneMinusSrcAlphaFactor=205,r.DstAlphaFactor=206,r.OneMinusDstAlphaFactor=207,r.DstColorFactor=208,r.OneMinusDstColorFactor=209,r.SrcAlphaSaturateFactor=210,r.MultiplyOperation=0,r.MixOperation=1,r.AddOperation=2,r.UVMapping=300,r.CubeReflectionMapping=301,r.CubeRefractionMapping=302,r.EquirectangularReflectionMapping=303,r.EquirectangularRefractionMapping=304,r.SphericalReflectionMapping=305,r.RepeatWrapping=1e3,r.ClampToEdgeWrapping=1001,r.MirroredRepeatWrapping=1002,r.NearestFilter=1003,r.NearestMipMapNearestFilter=1004,r.NearestMipMapLinearFilter=1005,r.LinearFilter=1006,r.LinearMipMapNearestFilter=1007,r.LinearMipMapLinearFilter=1008,r.UnsignedByteType=1009,r.ByteType=1010,r.ShortType=1011,r.UnsignedShortType=1012,r.IntType=1013,r.UnsignedIntType=1014,r.FloatType=1015,r.UnsignedShort4444Type=1016,r.UnsignedShort5551Type=1017,r.UnsignedShort565Type=1018,r.AlphaFormat=1019,r.RGBFormat=1020,r.RGBAFormat=1021,r.LuminanceFormat=1022,r.LuminanceAlphaFormat=1023,r.RGBEFormat=r.RGBAFormat,r.RGB_S3TC_DXT1_Format=2001,r.RGBA_S3TC_DXT1_Format=2002,r.RGBA_S3TC_DXT3_Format=2003,r.RGBA_S3TC_DXT5_Format=2004,r.RGB_PVRTC_4BPPV1_Format=2100,r.RGB_PVRTC_2BPPV1_Format=2101,r.RGBA_PVRTC_4BPPV1_Format=2102,r.RGBA_PVRTC_2BPPV1_Format=2103,r.Projector=function(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(e,t){console.warn("THREE.Projector: .projectVector() is now vector.project()."),e.project(t)},this.unprojectVector=function(e,t){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),e.unproject(t)},this.pickingRay=function(){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}},r.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElement("canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}},r.Color=function(e){return 3===arguments.length?this.setRGB(arguments[0],arguments[1],arguments[2]):this.set(e)},r.Color.prototype={constructor:r.Color,r:1,g:1,b:1,set:function(e){return e instanceof r.Color?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this},setHex:function(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,r){return this.r=e,this.g=t,this.b=r,this},setHSL:function(e,t,r){if(0===t)this.r=this.g=this.b=r;else{var n=function(e,t,r){return 0>r&&(r+=1),r>1&&(r-=1),1/6>r?e+6*(t-e)*r:.5>r?t:2/3>r?e+6*(t-e)*(2/3-r):e},i=.5>=r?r*(1+t):r+t-r*t,o=2*r-i;this.r=n(o,i,e+1/3),this.g=n(o,i,e),this.b=n(o,i,e-1/3)}return this},setStyle:function(e){if(/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.test(e)){var t=/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.exec(e);return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,this}if(/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.test(e)){var t=/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.exec(e);return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,this}if(/^\#([0-9a-f]{6})$/i.test(e)){var t=/^\#([0-9a-f]{6})$/i.exec(e);return this.setHex(parseInt(t[1],16)),this}if(/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.test(e)){var t=/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(e);return this.setHex(parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3],16)),this}return/^(\w+)$/i.test(e)?(this.setHex(r.ColorKeywords[e]),this):void 0},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e){return this.r=e.r*e.r,this.g=e.g*e.g,this.b=e.b*e.b,this},copyLinearToGamma:function(e){return this.r=Math.sqrt(e.r),this.g=Math.sqrt(e.g),this.b=Math.sqrt(e.b),this},convertGammaToLinear:function(){var e=this.r,t=this.g,r=this.b;return this.r=e*e,this.g=t*t,this.b=r*r,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){var t,r,n=e||{h:0,s:0,l:0},i=this.r,o=this.g,a=this.b,s=Math.max(i,o,a),u=Math.min(i,o,a),c=(u+s)/2;if(u===s)t=0,r=0;else{var l=s-u;switch(r=.5>=c?l/(s+u):l/(2-s-u),s){case i:t=(o-a)/l+(a>o?6:0);break;case o:t=(a-i)/l+2;break;case a:t=(i-o)/l+4}t/=6}return n.h=t,n.s=r,n.l=c,n},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(e,t,r){var n=this.getHSL();return n.h+=e,n.s+=t,n.l+=r,this.setHSL(n.h,n.s,n.l),this},add:function(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this},addColors:function(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this},addScalar:function(e){return this.r+=e,this.g+=e,this.b+=e,this},multiply:function(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this},multiplyScalar:function(e){return this.r*=e,this.g*=e,this.b*=e,this},lerp:function(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this},equals:function(e){return e.r===this.r&&e.g===this.g&&e.b===this.b},fromArray:function(e){return this.r=e[0],this.g=e[1],this.b=e[2],this},toArray:function(){return[this.r,this.g,this.b]},clone:function(){return(new r.Color).setRGB(this.r,this.g,this.b)}},r.ColorKeywords={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},r.Quaternion=function(e,t,r,n){this._x=e||0,this._y=t||0,this._z=r||0,this._w=void 0!==n?n:1},r.Quaternion.prototype={constructor:r.Quaternion,_x:0,_y:0,_z:0,_w:0,get x(){return this._x},set x(e){this._x=e,this.onChangeCallback()},get y(){return this._y},set y(e){this._y=e,this.onChangeCallback()},get z(){return this._z},set z(e){this._z=e,this.onChangeCallback()},get w(){return this._w},set w(e){this._w=e,this.onChangeCallback()},set:function(e,t,r,n){return this._x=e,this._y=t,this._z=r,this._w=n,this.onChangeCallback(),this},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if(e instanceof r.Euler==!1)throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var n=Math.cos(e._x/2),i=Math.cos(e._y/2),o=Math.cos(e._z/2),a=Math.sin(e._x/2),s=Math.sin(e._y/2),u=Math.sin(e._z/2);return"XYZ"===e.order?(this._x=a*i*o+n*s*u,this._y=n*s*o-a*i*u,this._z=n*i*u+a*s*o,this._w=n*i*o-a*s*u):"YXZ"===e.order?(this._x=a*i*o+n*s*u,this._y=n*s*o-a*i*u,this._z=n*i*u-a*s*o,this._w=n*i*o+a*s*u):"ZXY"===e.order?(this._x=a*i*o-n*s*u,this._y=n*s*o+a*i*u,this._z=n*i*u+a*s*o,this._w=n*i*o-a*s*u):"ZYX"===e.order?(this._x=a*i*o-n*s*u,this._y=n*s*o+a*i*u,this._z=n*i*u-a*s*o,this._w=n*i*o+a*s*u):"YZX"===e.order?(this._x=a*i*o+n*s*u,this._y=n*s*o+a*i*u,this._z=n*i*u-a*s*o,this._w=n*i*o-a*s*u):"XZY"===e.order&&(this._x=a*i*o-n*s*u,this._y=n*s*o-a*i*u,this._z=n*i*u+a*s*o,this._w=n*i*o+a*s*u),t!==!1&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var r=t/2,n=Math.sin(r);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(r),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t,r=e.elements,n=r[0],i=r[4],o=r[8],a=r[1],s=r[5],u=r[9],c=r[2],l=r[6],h=r[10],f=n+s+h;return f>0?(t=.5/Math.sqrt(f+1),this._w=.25/t,this._x=(l-u)*t,this._y=(o-c)*t,this._z=(a-i)*t):n>s&&n>h?(t=2*Math.sqrt(1+n-s-h),this._w=(l-u)/t,this._x=.25*t,this._y=(i+a)/t,this._z=(o+c)/t):s>h?(t=2*Math.sqrt(1+s-n-h),this._w=(o-c)/t,this._x=(i+a)/t,this._y=.25*t,this._z=(u+l)/t):(t=2*Math.sqrt(1+h-n-s),this._w=(a-i)/t,this._x=(o+c)/t,this._y=(u+l)/t,this._z=.25*t),this.onChangeCallback(),this},setFromUnitVectors:function(){var e,t,n=1e-6;return function(i,o){return void 0===e&&(e=new r.Vector3),t=i.dot(o)+1,n>t?(t=0,Math.abs(i.x)>Math.abs(i.z)?e.set(-i.y,i.x,0):e.set(0,-i.z,i.y)):e.crossVectors(i,o),this._x=e.x,this._y=e.y,this._z=e.z,this._w=t,this.normalize(),this}}(),inverse:function(){return this.conjugate().normalize(),this},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this.onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},multiplyQuaternions:function(e,t){var r=e._x,n=e._y,i=e._z,o=e._w,a=t._x,s=t._y,u=t._z,c=t._w;return this._x=r*c+o*a+n*u-i*s,this._y=n*c+o*s+i*a-r*u,this._z=i*c+o*u+r*s-n*a,this._w=o*c-r*a-n*s-i*u,this.onChangeCallback(),this},multiplyVector3:function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var r=this._x,n=this._y,i=this._z,o=this._w,a=o*e._w+r*e._x+n*e._y+i*e._z;if(0>a?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=r,this._y=n,this._z=i,this;var s=Math.acos(a),u=Math.sqrt(1-a*a);if(Math.abs(u)<.001)return this._w=.5*(o+this._w),this._x=.5*(r+this._x),this._y=.5*(n+this._y),this._z=.5*(i+this._z),this;var c=Math.sin((1-t)*s)/u,l=Math.sin(t*s)/u;return this._w=o*c+this._w*l,this._x=r*c+this._x*l,this._y=n*c+this._y*l,this._z=i*c+this._z*l,this.onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){},clone:function(){return new r.Quaternion(this._x,this._y,this._z,this._w)}},r.Quaternion.slerp=function(e,t,r,n){return r.copy(e).slerp(t,n)},r.Vector2=function(e,t){this.x=e||0,this.y=t||0},r.Vector2.prototype={constructor:r.Vector2,set:function(e,t){return this.x=e,this.y=t,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScalar:function(e){return this.x+=e,this.y+=e,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){if(0!==e){var t=1/e;this.x*=t,this.y*=t}else this.x=0,this.y=0;return this},min:function(e){return this.x>e.x&&(this.x=e.x),this.y>e.y&&(this.y=e.y),this},max:function(e){return this.x<e.x&&(this.x=e.x),this.y<e.y&&(this.y=e.y),this},clamp:function(e,t){return this.x<e.x?this.x=e.x:this.x>t.x&&(this.x=t.x),this.y<e.y?this.y=e.y:this.y>t.y&&(this.y=t.y),this},clampScalar:function(){var e,t;return function(n,i){return void 0===e&&(e=new r.Vector2,t=new r.Vector2),e.set(n,n),t.set(i,i),this.clamp(e,t)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,r=this.y-e.y;return t*t+r*r},setLength:function(e){var t=this.length();return 0!==t&&e!==t&&this.multiplyScalar(e/t),this},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromAttribute:function(e,t,r){return void 0===r&&(r=0),t=t*e.itemSize+r,this.x=e.array[t],this.y=e.array[t+1],this},clone:function(){return new r.Vector2(this.x,this.y)}},r.Vector3=function(e,t,r){this.x=e||0,this.y=t||0,this.z=r||0},r.Vector3.prototype={constructor:r.Vector3,set:function(e,t,r){return this.x=e,this.y=t,this.z=r,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(){var e;return function(t){return t instanceof r.Euler==!1&&console.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order."),void 0===e&&(e=new r.Quaternion),this.applyQuaternion(e.setFromEuler(t)),this}}(),applyAxisAngle:function(){var e;return function(t,n){return void 0===e&&(e=new r.Quaternion),this.applyQuaternion(e.setFromAxisAngle(t,n)),this}}(),applyMatrix3:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6]*n,this.y=i[1]*t+i[4]*r+i[7]*n,this.z=i[2]*t+i[5]*r+i[8]*n,this},applyMatrix4:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[4]*r+i[8]*n+i[12],this.y=i[1]*t+i[5]*r+i[9]*n+i[13],this.z=i[2]*t+i[6]*r+i[10]*n+i[14],this},applyProjection:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements,o=1/(i[3]*t+i[7]*r+i[11]*n+i[15]);return this.x=(i[0]*t+i[4]*r+i[8]*n+i[12])*o,this.y=(i[1]*t+i[5]*r+i[9]*n+i[13])*o,this.z=(i[2]*t+i[6]*r+i[10]*n+i[14])*o,this},applyQuaternion:function(e){var t=this.x,r=this.y,n=this.z,i=e.x,o=e.y,a=e.z,s=e.w,u=s*t+o*n-a*r,c=s*r+a*t-i*n,l=s*n+i*r-o*t,h=-i*t-o*r-a*n;return this.x=u*s+h*-i+c*-a-l*-o,this.y=c*s+h*-o+l*-i-u*-a,this.z=l*s+h*-a+u*-o-c*-i,this},project:function(){var e;return function(t){return void 0===e&&(e=new r.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 r.Matrix4),e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyProjection(e)}}(),transformDirection:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[4]*r+i[8]*n,this.y=i[1]*t+i[5]*r+i[9]*n,this.z=i[2]*t+i[6]*r+i[10]*n,this.normalize(),this},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){if(0!==e){var t=1/e;this.x*=t,this.y*=t,this.z*=t}else this.x=0,this.y=0,this.z=0;return this},min:function(e){return this.x>e.x&&(this.x=e.x),this.y>e.y&&(this.y=e.y),this.z>e.z&&(this.z=e.z),this},max:function(e){return this.x<e.x&&(this.x=e.x),this.y<e.y&&(this.y=e.y),this.z<e.z&&(this.z=e.z),this},clamp:function(e,t){return this.x<e.x?this.x=e.x:this.x>t.x&&(this.x=t.x),this.y<e.y?this.y=e.y:this.y>t.y&&(this.y=t.y),this.z<e.z?this.z=e.z:this.z>t.z&&(this.z=t.z),this},clampScalar:function(){var e,t;return function(n,i){return void 0===e&&(e=new r.Vector3,t=new r.Vector3),e.set(n,n,n),t.set(i,i,i),this.clamp(e,t)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(e){var t=this.length();return 0!==t&&e!==t&&this.multiplyScalar(e/t),this},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},cross:function(e,t){if(void 0!==t)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t);var r=this.x,n=this.y,i=this.z;return this.x=n*e.z-i*e.y,this.y=i*e.x-r*e.z,this.z=r*e.y-n*e.x,this},crossVectors:function(e,t){var r=e.x,n=e.y,i=e.z,o=t.x,a=t.y,s=t.z;return this.x=n*s-i*a,this.y=i*o-r*s,this.z=r*a-n*o,this},projectOnVector:function(){var e,t;return function(n){return void 0===e&&(e=new r.Vector3),e.copy(n).normalize(),t=this.dot(e),this.copy(e).multiplyScalar(t)}}(),projectOnPlane:function(){var e;return function(t){return void 0===e&&(e=new r.Vector3),e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e;return function(t){return void 0===e&&(e=new r.Vector3),this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(e){var t=this.dot(e)/(this.length()*e.length());return Math.acos(r.Math.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,r=this.y-e.y,n=this.z-e.z;return t*t+r*r+n*n},setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},setFromMatrixPosition:function(e){return this.x=e.elements[12],this.y=e.elements[13],this.z=e.elements[14],this},setFromMatrixScale:function(e){var t=this.set(e.elements[0],e.elements[1],e.elements[2]).length(),r=this.set(e.elements[4],e.elements[5],e.elements[6]).length(),n=this.set(e.elements[8],e.elements[9],e.elements[10]).length();return this.x=t,this.y=r,this.z=n,this},setFromMatrixColumn:function(e,t){var r=4*e,n=t.elements;return this.x=n[r],this.y=n[r+1],this.z=n[r+2],this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromAttribute:function(e,t,r){return void 0===r&&(r=0),t=t*e.itemSize+r,this.x=e.array[t],this.y=e.array[t+1],this.z=e.array[t+2],this
},clone:function(){return new r.Vector3(this.x,this.y,this.z)}},r.Vector4=function(e,t,r,n){this.x=e||0,this.y=t||0,this.z=r||0,this.w=void 0!==n?n:1},r.Vector4.prototype={constructor:r.Vector4,set:function(e,t,r,n){return this.x=e,this.y=t,this.z=r,this.w=n,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,r=this.y,n=this.z,i=this.w,o=e.elements;return this.x=o[0]*t+o[4]*r+o[8]*n+o[12]*i,this.y=o[1]*t+o[5]*r+o[9]*n+o[13]*i,this.z=o[2]*t+o[6]*r+o[10]*n+o[14]*i,this.w=o[3]*t+o[7]*r+o[11]*n+o[15]*i,this},divideScalar:function(e){if(0!==e){var t=1/e;this.x*=t,this.y*=t,this.z*=t,this.w*=t}else this.x=0,this.y=0,this.z=0,this.w=1;return this},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return 1e-4>t?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,r,n,i,o=.01,a=.1,s=e.elements,u=s[0],c=s[4],l=s[8],h=s[1],f=s[5],p=s[9],d=s[2],m=s[6],v=s[10];if(Math.abs(c-h)<o&&Math.abs(l-d)<o&&Math.abs(p-m)<o){if(Math.abs(c+h)<a&&Math.abs(l+d)<a&&Math.abs(p+m)<a&&Math.abs(u+f+v-3)<a)return this.set(1,0,0,0),this;t=Math.PI;var g=(u+1)/2,y=(f+1)/2,b=(v+1)/2,x=(c+h)/4,w=(l+d)/4,_=(p+m)/4;return g>y&&g>b?o>g?(r=0,n=.707106781,i=.707106781):(r=Math.sqrt(g),n=x/r,i=w/r):y>b?o>y?(r=.707106781,n=0,i=.707106781):(n=Math.sqrt(y),r=x/n,i=_/n):o>b?(r=.707106781,n=.707106781,i=0):(i=Math.sqrt(b),r=w/i,n=_/i),this.set(r,n,i,t),this}var S=Math.sqrt((m-p)*(m-p)+(l-d)*(l-d)+(h-c)*(h-c));return Math.abs(S)<.001&&(S=1),this.x=(m-p)/S,this.y=(l-d)/S,this.z=(h-c)/S,this.w=Math.acos((u+f+v-1)/2),this},min:function(e){return this.x>e.x&&(this.x=e.x),this.y>e.y&&(this.y=e.y),this.z>e.z&&(this.z=e.z),this.w>e.w&&(this.w=e.w),this},max:function(e){return this.x<e.x&&(this.x=e.x),this.y<e.y&&(this.y=e.y),this.z<e.z&&(this.z=e.z),this.w<e.w&&(this.w=e.w),this},clamp:function(e,t){return this.x<e.x?this.x=e.x:this.x>t.x&&(this.x=t.x),this.y<e.y?this.y=e.y:this.y>t.y&&(this.y=t.y),this.z<e.z?this.z=e.z:this.z>t.z&&(this.z=t.z),this.w<e.w?this.w=e.w:this.w>t.w&&(this.w=t.w),this},clampScalar:function(){var e,t;return function(n,i){return void 0===e&&(e=new r.Vector4,t=new r.Vector4),e.set(n,n,n,n),t.set(i,i,i,i),this.clamp(e,t)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},setLength:function(e){var t=this.length();return 0!==t&&e!==t&&this.multiplyScalar(e/t),this},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromAttribute:function(e,t,r){return void 0===r&&(r=0),t=t*e.itemSize+r,this.x=e.array[t],this.y=e.array[t+1],this.z=e.array[t+2],this.w=e.array[t+3],this},clone:function(){return new r.Vector4(this.x,this.y,this.z,this.w)}},r.Euler=function(e,t,n,i){this._x=e||0,this._y=t||0,this._z=n||0,this._order=i||r.Euler.DefaultOrder},r.Euler.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],r.Euler.DefaultOrder="XYZ",r.Euler.prototype={constructor:r.Euler,_x:0,_y:0,_z:0,_order:r.Euler.DefaultOrder,get x(){return this._x},set x(e){this._x=e,this.onChangeCallback()},get y(){return this._y},set y(e){this._y=e,this.onChangeCallback()},get z(){return this._z},set z(e){this._z=e,this.onChangeCallback()},get order(){return this._order},set order(e){this._order=e,this.onChangeCallback()},set:function(e,t,r,n){return this._x=e,this._y=t,this._z=r,this._order=n||this._order,this.onChangeCallback(),this},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this.onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var i=r.Math.clamp,o=e.elements,a=o[0],s=o[4],u=o[8],c=o[1],l=o[5],h=o[9],f=o[2],p=o[6],d=o[10];return t=t||this._order,"XYZ"===t?(this._y=Math.asin(i(u,-1,1)),Math.abs(u)<.99999?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-s,a)):(this._x=Math.atan2(p,l),this._z=0)):"YXZ"===t?(this._x=Math.asin(-i(h,-1,1)),Math.abs(h)<.99999?(this._y=Math.atan2(u,d),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-f,a),this._z=0)):"ZXY"===t?(this._x=Math.asin(i(p,-1,1)),Math.abs(p)<.99999?(this._y=Math.atan2(-f,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(c,a))):"ZYX"===t?(this._y=Math.asin(-i(f,-1,1)),Math.abs(f)<.99999?(this._x=Math.atan2(p,d),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-s,l))):"YZX"===t?(this._z=Math.asin(i(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-f,a)):(this._x=0,this._y=Math.atan2(u,d))):"XZY"===t?(this._z=Math.asin(-i(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(p,l),this._y=Math.atan2(u,a)):(this._x=Math.atan2(-h,d),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+t),this._order=t,n!==!1&&this.onChangeCallback(),this},setFromQuaternion:function(){var e;return function(t,n,i){return void 0===e&&(e=new r.Matrix4),e.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e,n,i),this}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(){var e=new r.Quaternion;return function(t){e.setFromEuler(this),this.setFromQuaternion(e,t)}}(),equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this.onChangeCallback(),this},toArray:function(){return[this._x,this._y,this._z,this._order]},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new r.Vector3(this._x,this._y,this._z)},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){},clone:function(){return new r.Euler(this._x,this._y,this._z,this._order)}},r.Line3=function(e,t){this.start=void 0!==e?e:new r.Vector3,this.end=void 0!==t?t:new r.Vector3},r.Line3.prototype={constructor:r.Line3,set:function(e,t){return this.start.copy(e),this.end.copy(t),this},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},center:function(e){var t=e||new r.Vector3;return t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){var t=e||new r.Vector3;return t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){var n=t||new r.Vector3;return this.delta(n).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(){var e=new r.Vector3,t=new r.Vector3;return function(n,i){e.subVectors(n,this.start),t.subVectors(this.end,this.start);var o=t.dot(t),a=t.dot(e),s=a/o;return i&&(s=r.Math.clamp(s,0,1)),s}}(),closestPointToPoint:function(e,t,n){var i=this.closestPointToPointParameter(e,t),o=n||new r.Vector3;return this.delta(o).multiplyScalar(i).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)},clone:function(){return(new r.Line3).copy(this)}},r.Box2=function(e,t){this.min=void 0!==e?e:new r.Vector2(1/0,1/0),this.max=void 0!==t?t:new r.Vector2(-1/0,-1/0)},r.Box2.prototype={constructor:r.Box2,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,r=e.length;r>t;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new r.Vector2;return function(t,r){var n=e.copy(r).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}}(),copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},empty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},center:function(e){var t=e||new r.Vector2;return t.addVectors(this.min,this.max).multiplyScalar(.5)},size:function(e){var t=e||new r.Vector2;return t.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y?!1:!0},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y?!0:!1},getParameter:function(e,t){var n=t||new r.Vector2;return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(e){return e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y?!1:!0},clampPoint:function(e,t){var n=t||new r.Vector2;return n.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new r.Vector2;return function(t){var r=e.copy(t).clamp(this.min,this.max);return r.sub(t).length()}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)},clone:function(){return(new r.Box2).copy(this)}},r.Box3=function(e,t){this.min=void 0!==e?e:new r.Vector3(1/0,1/0,1/0),this.max=void 0!==t?t:new r.Vector3(-1/0,-1/0,-1/0)},r.Box3.prototype={constructor:r.Box3,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,r=e.length;r>t;t++)this.expandByPoint(e[t]);return this},setFromCenterAndSize:function(){var e=new r.Vector3;return function(t,r){var n=e.copy(r).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}}(),setFromObject:function(){var e=new r.Vector3;return function(t){var n=this;return t.updateMatrixWorld(!0),this.makeEmpty(),t.traverse(function(t){var i=t.geometry;if(void 0!==i)if(i instanceof r.Geometry)for(var o=i.vertices,a=0,s=o.length;s>a;a++)e.copy(o[a]),e.applyMatrix4(t.matrixWorld),n.expandByPoint(e);else if(i instanceof r.BufferGeometry&&void 0!==i.attributes.position)for(var u=i.attributes.position.array,a=0,s=u.length;s>a;a+=3)e.set(u[a],u[a+1],u[a+2]),e.applyMatrix4(t.matrixWorld),n.expandByPoint(e)}),this}}(),copy:function(e){return this.min.copy(e.min),this.max.copy(e.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},empty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},center:function(e){var t=e||new r.Vector3;return t.addVectors(this.min,this.max).multiplyScalar(.5)},size:function(e){var t=e||new r.Vector3;return t.subVectors(this.max,this.min)},expandByPoint:function(e){return this.min.min(e),this.max.max(e),this},expandByVector:function(e){return this.min.sub(e),this.max.add(e),this},expandByScalar:function(e){return this.min.addScalar(-e),this.max.addScalar(e),this},containsPoint:function(e){return e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z?!1:!0},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z?!0:!1},getParameter:function(e,t){var n=t||new r.Vector3;return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(e){return e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z?!1:!0},clampPoint:function(e,t){var n=t||new r.Vector3;return n.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new r.Vector3;return function(t){var r=e.copy(t).clamp(this.min,this.max);return r.sub(t).length()}}(),getBoundingSphere:function(){var e=new r.Vector3;return function(t){var n=t||new r.Sphere;return n.center=this.center(),n.radius=.5*this.size(e).length(),n}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(){var e=[new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3,new r.Vector3];return function(t){return e[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),e[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),e[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),e[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),e[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),e[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),e[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),e[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.makeEmpty(),this.setFromPoints(e),this}}(),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)},clone:function(){return(new r.Box3).copy(this)}},r.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")},r.Matrix3.prototype={constructor:r.Matrix3,set:function(e,t,r,n,i,o,a,s,u){var c=this.elements;return c[0]=e,c[3]=t,c[6]=r,c[1]=n,c[4]=i,c[7]=o,c[2]=a,c[5]=s,c[8]=u,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},copy:function(e){var t=e.elements;return this.set(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]),this},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(e){return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(e)},applyToVector3Array:function(){var e=new r.Vector3;return function(t,r,n){void 0===r&&(r=0),void 0===n&&(n=t.length);for(var i=0,o=r;n>i;i+=3,o+=3)e.x=t[o],e.y=t[o+1],e.z=t[o+2],e.applyMatrix3(this),t[o]=e.x,t[o+1]=e.y,t[o+2]=e.z;return t}}(),multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this},determinant:function(){var e=this.elements,t=e[0],r=e[1],n=e[2],i=e[3],o=e[4],a=e[5],s=e[6],u=e[7],c=e[8];return t*o*c-t*a*u-r*i*c+r*a*s+n*i*u-n*o*s},getInverse:function(e,t){var r=e.elements,n=this.elements;n[0]=r[10]*r[5]-r[6]*r[9],n[1]=-r[10]*r[1]+r[2]*r[9],n[2]=r[6]*r[1]-r[2]*r[5],n[3]=-r[10]*r[4]+r[6]*r[8],n[4]=r[10]*r[0]-r[2]*r[8],n[5]=-r[6]*r[0]+r[2]*r[4],n[6]=r[9]*r[4]-r[5]*r[8],n[7]=-r[9]*r[0]+r[1]*r[8],n[8]=r[5]*r[0]-r[1]*r[4];var i=r[0]*n[0]+r[1]*n[3]+r[2]*n[6];if(0===i){var o="Matrix3.getInverse(): can't invert matrix, determinant is 0";if(t)throw new Error(o);return console.warn(o),this.identity(),this}return this.multiplyScalar(1/i),this},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},flattenToArrayOffset:function(e,t){var r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e},getNormalMatrix:function(e){return this.getInverse(e).transpose(),this},transposeIntoArray:function(e){var t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this},fromArray:function(e){return this.elements.set(e),this},toArray:function(){var e=this.elements;return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},clone:function(){return(new r.Matrix3).fromArray(this.elements)}},r.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")},r.Matrix4.prototype={constructor:r.Matrix4,set:function(e,t,r,n,i,o,a,s,u,c,l,h,f,p,d,m){var v=this.elements;return v[0]=e,v[4]=t,v[8]=r,v[12]=n,v[1]=i,v[5]=o,v[9]=a,v[13]=s,v[2]=u,v[6]=c,v[10]=l,v[14]=h,v[3]=f,v[7]=p,v[11]=d,v[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},copy:function(e){return this.elements.set(e.elements),this},extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},copyPosition:function(e){var t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this},extractBasis:function(e,t,r){var n=this.elements;return e.set(n[0],n[1],n[2]),t.set(n[4],n[5],n[6]),r.set(n[8],n[9],n[10]),this},makeBasis:function(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this},extractRotation:function(){var e=new r.Vector3;return function(t){var r=this.elements,n=t.elements,i=1/e.set(n[0],n[1],n[2]).length(),o=1/e.set(n[4],n[5],n[6]).length(),a=1/e.set(n[8],n[9],n[10]).length();return r[0]=n[0]*i,r[1]=n[1]*i,r[2]=n[2]*i,r[4]=n[4]*o,r[5]=n[5]*o,r[6]=n[6]*o,r[8]=n[8]*a,r[9]=n[9]*a,r[10]=n[10]*a,this}}(),makeRotationFromEuler:function(e){e instanceof r.Euler==!1&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,n=e.x,i=e.y,o=e.z,a=Math.cos(n),s=Math.sin(n),u=Math.cos(i),c=Math.sin(i),l=Math.cos(o),h=Math.sin(o);if("XYZ"===e.order){var f=a*l,p=a*h,d=s*l,m=s*h;t[0]=u*l,t[4]=-u*h,t[8]=c,t[1]=p+d*c,t[5]=f-m*c,t[9]=-s*u,t[2]=m-f*c,t[6]=d+p*c,t[10]=a*u}else if("YXZ"===e.order){var v=u*l,g=u*h,y=c*l,b=c*h;t[0]=v+b*s,t[4]=y*s-g,t[8]=a*c,t[1]=a*h,t[5]=a*l,t[9]=-s,t[2]=g*s-y,t[6]=b+v*s,t[10]=a*u}else if("ZXY"===e.order){var v=u*l,g=u*h,y=c*l,b=c*h;t[0]=v-b*s,t[4]=-a*h,t[8]=y+g*s,t[1]=g+y*s,t[5]=a*l,t[9]=b-v*s,t[2]=-a*c,t[6]=s,t[10]=a*u}else if("ZYX"===e.order){var f=a*l,p=a*h,d=s*l,m=s*h;t[0]=u*l,t[4]=d*c-p,t[8]=f*c+m,t[1]=u*h,t[5]=m*c+f,t[9]=p*c-d,t[2]=-c,t[6]=s*u,t[10]=a*u}else if("YZX"===e.order){var x=a*u,w=a*c,_=s*u,S=s*c;t[0]=u*l,t[4]=S-x*h,t[8]=_*h+w,t[1]=h,t[5]=a*l,t[9]=-s*l,t[2]=-c*l,t[6]=w*h+_,t[10]=x-S*h}else if("XZY"===e.order){var x=a*u,w=a*c,_=s*u,S=s*c;t[0]=u*l,t[4]=-h,t[8]=c*l,t[1]=x*h+S,t[5]=a*l,t[9]=w*h-_,t[2]=_*h-w,t[6]=s*l,t[10]=S*h+x}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},makeRotationFromQuaternion:function(e){var t=this.elements,r=e.x,n=e.y,i=e.z,o=e.w,a=r+r,s=n+n,u=i+i,c=r*a,l=r*s,h=r*u,f=n*s,p=n*u,d=i*u,m=o*a,v=o*s,g=o*u;return t[0]=1-(f+d),t[4]=l-g,t[8]=h+v,t[1]=l+g,t[5]=1-(c+d),t[9]=p-m,t[2]=h-v,t[6]=p+m,t[10]=1-(c+f),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},lookAt:function(){var e=new r.Vector3,t=new r.Vector3,n=new r.Vector3;return function(r,i,o){var a=this.elements;return n.subVectors(r,i).normalize(),0===n.length()&&(n.z=1),e.crossVectors(o,n).normalize(),0===e.length()&&(n.x+=1e-4,e.crossVectors(o,n).normalize()),t.crossVectors(n,e),a[0]=e.x,a[4]=t.x,a[8]=n.x,a[1]=e.y,a[5]=t.y,a[9]=n.y,a[2]=e.z,a[6]=t.z,a[10]=n.z,this}}(),multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},multiplyMatrices:function(e,t){var r=e.elements,n=t.elements,i=this.elements,o=r[0],a=r[4],s=r[8],u=r[12],c=r[1],l=r[5],h=r[9],f=r[13],p=r[2],d=r[6],m=r[10],v=r[14],g=r[3],y=r[7],b=r[11],x=r[15],w=n[0],_=n[4],S=n[8],M=n[12],E=n[1],T=n[5],C=n[9],A=n[13],$=n[2],k=n[6],P=n[10],R=n[14],O=n[3],L=n[7],F=n[11],j=n[15];return i[0]=o*w+a*E+s*$+u*O,i[4]=o*_+a*T+s*k+u*L,i[8]=o*S+a*C+s*P+u*F,i[12]=o*M+a*A+s*R+u*j,i[1]=c*w+l*E+h*$+f*O,i[5]=c*_+l*T+h*k+f*L,i[9]=c*S+l*C+h*P+f*F,i[13]=c*M+l*A+h*R+f*j,i[2]=p*w+d*E+m*$+v*O,i[6]=p*_+d*T+m*k+v*L,i[10]=p*S+d*C+m*P+v*F,i[14]=p*M+d*A+m*R+v*j,i[3]=g*w+y*E+b*$+x*O,i[7]=g*_+y*T+b*k+x*L,i[11]=g*S+y*C+b*P+x*F,i[15]=g*M+y*A+b*R+x*j,this},multiplyToArray:function(e,t,r){var n=this.elements;return this.multiplyMatrices(e,t),r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],r[4]=n[4],r[5]=n[5],r[6]=n[6],r[7]=n[7],r[8]=n[8],r[9]=n[9],r[10]=n[10],r[11]=n[11],r[12]=n[12],r[13]=n[13],r[14]=n[14],r[15]=n[15],this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),e.applyProjection(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(e){return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(e)},applyToVector3Array:function(){var e=new r.Vector3;return function(t,r,n){void 0===r&&(r=0),void 0===n&&(n=t.length);for(var i=0,o=r;n>i;i+=3,o+=3)e.x=t[o],e.y=t[o+1],e.z=t[o+2],e.applyMatrix4(this),t[o]=e.x,t[o+1]=e.y,t[o+2]=e.z;return t}}(),rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},determinant:function(){var e=this.elements,t=e[0],r=e[4],n=e[8],i=e[12],o=e[1],a=e[5],s=e[9],u=e[13],c=e[2],l=e[6],h=e[10],f=e[14],p=e[3],d=e[7],m=e[11],v=e[15];return p*(+i*s*l-n*u*l-i*a*h+r*u*h+n*a*f-r*s*f)+d*(+t*s*f-t*u*h+i*o*h-n*o*f+n*u*c-i*s*c)+m*(+t*u*l-t*a*f-i*o*l+r*o*f+i*a*c-r*u*c)+v*(-n*a*c-t*s*l+t*a*h+n*o*l-r*o*h+r*s*c)},transpose:function(){var e,t=this.elements;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},flattenToArrayOffset:function(e,t){var r=this.elements;return e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=r[3],e[t+4]=r[4],e[t+5]=r[5],e[t+6]=r[6],e[t+7]=r[7],e[t+8]=r[8],e[t+9]=r[9],e[t+10]=r[10],e[t+11]=r[11],e[t+12]=r[12],e[t+13]=r[13],e[t+14]=r[14],e[t+15]=r[15],e},getPosition:function(){var e=new r.Vector3;return function(){console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var t=this.elements;return e.set(t[12],t[13],t[14])}}(),setPosition:function(e){var t=this.elements;return t[12]=e.x,t[13]=e.y,t[14]=e.z,this},getInverse:function(e,t){var r=this.elements,n=e.elements,i=n[0],o=n[4],a=n[8],s=n[12],u=n[1],c=n[5],l=n[9],h=n[13],f=n[2],p=n[6],d=n[10],m=n[14],v=n[3],g=n[7],y=n[11],b=n[15];r[0]=l*m*g-h*d*g+h*p*y-c*m*y-l*p*b+c*d*b,r[4]=s*d*g-a*m*g-s*p*y+o*m*y+a*p*b-o*d*b,r[8]=a*h*g-s*l*g+s*c*y-o*h*y-a*c*b+o*l*b,r[12]=s*l*p-a*h*p-s*c*d+o*h*d+a*c*m-o*l*m,r[1]=h*d*v-l*m*v-h*f*y+u*m*y+l*f*b-u*d*b,r[5]=a*m*v-s*d*v+s*f*y-i*m*y-a*f*b+i*d*b,r[9]=s*l*v-a*h*v-s*u*y+i*h*y+a*u*b-i*l*b,r[13]=a*h*f-s*l*f+s*u*d-i*h*d-a*u*m+i*l*m,r[2]=c*m*v-h*p*v+h*f*g-u*m*g-c*f*b+u*p*b,r[6]=s*p*v-o*m*v-s*f*g+i*m*g+o*f*b-i*p*b,r[10]=o*h*v-s*c*v+s*u*g-i*h*g-o*u*b+i*c*b,r[14]=s*c*f-o*h*f-s*u*p+i*h*p+o*u*m-i*c*m,r[3]=l*p*v-c*d*v-l*f*g+u*d*g+c*f*y-u*p*y,r[7]=o*d*v-a*p*v+a*f*g-i*d*g-o*f*y+i*p*y,r[11]=a*c*v-o*l*v-a*u*g+i*l*g+o*u*y-i*c*y,r[15]=o*l*f-a*c*f+a*u*p-i*l*p-o*u*d+i*c*d;var x=i*r[0]+u*r[4]+f*r[8]+v*r[12];if(0==x){var w="Matrix4.getInverse(): can't invert matrix, determinant is 0";if(t)throw new Error(w);return console.warn(w),this.identity(),this}return this.multiplyScalar(1/x),this},translate:function(){console.warn("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.warn("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.warn("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.warn("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.warn("THREE.Matrix4: .rotateByAxis() has been removed.")},scale:function(e){var t=this.elements,r=e.x,n=e.y,i=e.z;return t[0]*=r,t[4]*=n,t[8]*=i,t[1]*=r,t[5]*=n,t[9]*=i,t[2]*=r,t[6]*=n,t[10]*=i,t[3]*=r,t[7]*=n,t[11]*=i,this},getMaxScaleOnAxis:function(){var e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],r=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,Math.max(r,n)))},makeTranslation:function(e,t,r){return this.set(1,0,0,e,0,1,0,t,0,0,1,r,0,0,0,1),this},makeRotationX:function(e){var t=Math.cos(e),r=Math.sin(e);return this.set(1,0,0,0,0,t,-r,0,0,r,t,0,0,0,0,1),this},makeRotationY:function(e){var t=Math.cos(e),r=Math.sin(e);return this.set(t,0,r,0,0,1,0,0,-r,0,t,0,0,0,0,1),this},makeRotationZ:function(e){var t=Math.cos(e),r=Math.sin(e);return this.set(t,-r,0,0,r,t,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(e,t){var r=Math.cos(t),n=Math.sin(t),i=1-r,o=e.x,a=e.y,s=e.z,u=i*o,c=i*a;return this.set(u*o+r,u*a-n*s,u*s+n*a,0,u*a+n*s,c*a+r,c*s-n*o,0,u*s-n*a,c*s+n*o,i*s*s+r,0,0,0,0,1),this},makeScale:function(e,t,r){return this.set(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1),this},compose:function(e,t,r){return this.makeRotationFromQuaternion(t),this.scale(r),this.setPosition(e),this},decompose:function(){var e=new r.Vector3,t=new r.Matrix4;return function(r,n,i){var o=this.elements,a=e.set(o[0],o[1],o[2]).length(),s=e.set(o[4],o[5],o[6]).length(),u=e.set(o[8],o[9],o[10]).length(),c=this.determinant();0>c&&(a=-a),r.x=o[12],r.y=o[13],r.z=o[14],t.elements.set(this.elements);var l=1/a,h=1/s,f=1/u;return t.elements[0]*=l,t.elements[1]*=l,t.elements[2]*=l,t.elements[4]*=h,t.elements[5]*=h,t.elements[6]*=h,t.elements[8]*=f,t.elements[9]*=f,t.elements[10]*=f,n.setFromRotationMatrix(t),i.x=a,i.y=s,i.z=u,this}}(),makeFrustum:function(e,t,r,n,i,o){var a=this.elements,s=2*i/(t-e),u=2*i/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),h=-(o+i)/(o-i),f=-2*o*i/(o-i);return a[0]=s,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=u,a[9]=l,a[13]=0,a[2]=0,a[6]=0,a[10]=h,a[14]=f,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makePerspective:function(e,t,n,i){var o=n*Math.tan(r.Math.degToRad(.5*e)),a=-o,s=a*t,u=o*t;return this.makeFrustum(s,u,a,o,n,i)},makeOrthographic:function(e,t,r,n,i,o){var a=this.elements,s=t-e,u=r-n,c=o-i,l=(t+e)/s,h=(r+n)/u,f=(o+i)/c;return a[0]=2/s,a[4]=0,a[8]=0,a[12]=-l,a[1]=0,a[5]=2/u,a[9]=0,a[13]=-h,a[2]=0,a[6]=0,a[10]=-2/c,a[14]=-f,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},fromArray:function(e){return this.elements.set(e),this},toArray:function(){var e=this.elements;return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},clone:function(){return(new r.Matrix4).fromArray(this.elements)}},r.Ray=function(e,t){this.origin=void 0!==e?e:new r.Vector3,this.direction=void 0!==t?t:new r.Vector3},r.Ray.prototype={constructor:r.Ray,set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){var n=t||new r.Vector3;return n.copy(this.direction).multiplyScalar(e).add(this.origin)},recast:function(){var e=new r.Vector3;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(e,t){var n=t||new r.Vector3;n.subVectors(e,this.origin);var i=n.dot(this.direction);return 0>i?n.copy(this.origin):n.copy(this.direction).multiplyScalar(i).add(this.origin)},distanceToPoint:function(){var e=new r.Vector3;return function(t){var r=e.subVectors(t,this.origin).dot(this.direction);return 0>r?this.origin.distanceTo(t):(e.copy(this.direction).multiplyScalar(r).add(this.origin),e.distanceTo(t))}}(),distanceSqToSegment:function(){var e=new r.Vector3,t=new r.Vector3,n=new r.Vector3;return function(r,i,o,a){e.copy(r).add(i).multiplyScalar(.5),t.copy(i).sub(r).normalize(),n.copy(this.origin).sub(e);var s,u,c,l,h=.5*r.distanceTo(i),f=-this.direction.dot(t),p=n.dot(this.direction),d=-n.dot(t),m=n.lengthSq(),v=Math.abs(1-f*f);if(v>0)if(s=f*d-p,u=f*p-d,l=h*v,s>=0)if(u>=-l)if(l>=u){var g=1/v;s*=g,u*=g,c=s*(s+f*u+2*p)+u*(f*s+u+2*d)+m}else u=h,s=Math.max(0,-(f*u+p)),c=-s*s+u*(u+2*d)+m;else u=-h,s=Math.max(0,-(f*u+p)),c=-s*s+u*(u+2*d)+m;else-l>=u?(s=Math.max(0,-(-f*h+p)),u=s>0?-h:Math.min(Math.max(-h,-d),h),c=-s*s+u*(u+2*d)+m):l>=u?(s=0,u=Math.min(Math.max(-h,-d),h),c=u*(u+2*d)+m):(s=Math.max(0,-(f*h+p)),u=s>0?h:Math.min(Math.max(-h,-d),h),c=-s*s+u*(u+2*d)+m);else u=f>0?-h:h,s=Math.max(0,-(f*u+p)),c=-s*s+u*(u+2*d)+m;return o&&o.copy(this.direction).multiplyScalar(s).add(this.origin),a&&a.copy(t).multiplyScalar(u).add(e),c}}(),isIntersectionSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},intersectSphere:function(){var e=new r.Vector3;return function(t,r){e.subVectors(t.center,this.origin);var n=e.dot(this.direction),i=e.dot(e)-n*n,o=t.radius*t.radius;if(i>o)return null;var a=Math.sqrt(o-i),s=n-a,u=n+a;return 0>s&&0>u?null:0>s?this.at(u,r):this.at(s,r)}}(),isIntersectionPlane:function(e){var t=e.distanceToPoint(this.origin);if(0===t)return!0;var r=e.normal.dot(this.direction);return 0>r*t?!0:!1},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0==t)return 0==e.distanceToPoint(this.origin)?0:null;
var r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null},intersectPlane:function(e,t){var r=this.distanceToPlane(e);return null===r?null:this.at(r,t)},isIntersectionBox:function(){var e=new r.Vector3;return function(t){return null!==this.intersectBox(t,e)}}(),intersectBox:function(e,t){var r,n,i,o,a,s,u=1/this.direction.x,c=1/this.direction.y,l=1/this.direction.z,h=this.origin;return u>=0?(r=(e.min.x-h.x)*u,n=(e.max.x-h.x)*u):(r=(e.max.x-h.x)*u,n=(e.min.x-h.x)*u),c>=0?(i=(e.min.y-h.y)*c,o=(e.max.y-h.y)*c):(i=(e.max.y-h.y)*c,o=(e.min.y-h.y)*c),r>o||i>n?null:((i>r||r!==r)&&(r=i),(n>o||n!==n)&&(n=o),l>=0?(a=(e.min.z-h.z)*l,s=(e.max.z-h.z)*l):(a=(e.max.z-h.z)*l,s=(e.min.z-h.z)*l),r>s||a>n?null:((a>r||r!==r)&&(r=a),(n>s||n!==n)&&(n=s),0>n?null:this.at(r>=0?r:n,t)))},intersectTriangle:function(){var e=new r.Vector3,t=new r.Vector3,n=new r.Vector3,i=new r.Vector3;return function(r,o,a,s,u){t.subVectors(o,r),n.subVectors(a,r),i.crossVectors(t,n);var c,l=this.direction.dot(i);if(l>0){if(s)return null;c=1}else{if(!(0>l))return null;c=-1,l=-l}e.subVectors(this.origin,r);var h=c*this.direction.dot(n.crossVectors(e,n));if(0>h)return null;var f=c*this.direction.dot(t.cross(e));if(0>f)return null;if(h+f>l)return null;var p=-c*e.dot(i);return 0>p?null:this.at(p/l,u)}}(),applyMatrix4:function(e){return this.direction.add(this.origin).applyMatrix4(e),this.origin.applyMatrix4(e),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)},clone:function(){return(new r.Ray).copy(this)}},r.Sphere=function(e,t){this.center=void 0!==e?e:new r.Vector3,this.radius=void 0!==t?t:0},r.Sphere.prototype={constructor:r.Sphere,set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(){var e=new r.Box3;return function(t,r){var n=this.center;void 0!==r?n.copy(r):e.setFromPoints(t).center(n);for(var i=0,o=0,a=t.length;a>o;o++)i=Math.max(i,n.distanceToSquared(t[o]));return this.radius=Math.sqrt(i),this}}(),copy:function(e){return this.center.copy(e.center),this.radius=e.radius,this},empty:function(){return this.radius<=0},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},clampPoint:function(e,t){var n=this.center.distanceToSquared(e),i=t||new r.Vector3;return i.copy(e),n>this.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i},getBoundingBox:function(e){var t=e||new r.Box3;return t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius},clone:function(){return(new r.Sphere).copy(this)}},r.Frustum=function(e,t,n,i,o,a){this.planes=[void 0!==e?e:new r.Plane,void 0!==t?t:new r.Plane,void 0!==n?n:new r.Plane,void 0!==i?i:new r.Plane,void 0!==o?o:new r.Plane,void 0!==a?a:new r.Plane]},r.Frustum.prototype={constructor:r.Frustum,set:function(e,t,r,n,i,o){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(r),a[3].copy(n),a[4].copy(i),a[5].copy(o),this},copy:function(e){for(var t=this.planes,r=0;6>r;r++)t[r].copy(e.planes[r]);return this},setFromMatrix:function(e){var t=this.planes,r=e.elements,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5],c=r[6],l=r[7],h=r[8],f=r[9],p=r[10],d=r[11],m=r[12],v=r[13],g=r[14],y=r[15];return t[0].setComponents(a-n,l-s,d-h,y-m).normalize(),t[1].setComponents(a+n,l+s,d+h,y+m).normalize(),t[2].setComponents(a+i,l+u,d+f,y+v).normalize(),t[3].setComponents(a-i,l-u,d-f,y-v).normalize(),t[4].setComponents(a-o,l-c,d-p,y-g).normalize(),t[5].setComponents(a+o,l+c,d+p,y+g).normalize(),this},intersectsObject:function(){var e=new r.Sphere;return function(t){var r=t.geometry;return null===r.boundingSphere&&r.computeBoundingSphere(),e.copy(r.boundingSphere),e.applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSphere:function(e){for(var t=this.planes,r=e.center,n=-e.radius,i=0;6>i;i++){var o=t[i].distanceToPoint(r);if(n>o)return!1}return!0},intersectsBox:function(){var e=new r.Vector3,t=new r.Vector3;return function(r){for(var n=this.planes,i=0;6>i;i++){var o=n[i];e.x=o.normal.x>0?r.min.x:r.max.x,t.x=o.normal.x>0?r.max.x:r.min.x,e.y=o.normal.y>0?r.min.y:r.max.y,t.y=o.normal.y>0?r.max.y:r.min.y,e.z=o.normal.z>0?r.min.z:r.max.z,t.z=o.normal.z>0?r.max.z:r.min.z;var a=o.distanceToPoint(e),s=o.distanceToPoint(t);if(0>a&&0>s)return!1}return!0}}(),containsPoint:function(e){for(var t=this.planes,r=0;6>r;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0},clone:function(){return(new r.Frustum).copy(this)}},r.Plane=function(e,t){this.normal=void 0!==e?e:new r.Vector3(1,0,0),this.constant=void 0!==t?t:0},r.Plane.prototype={constructor:r.Plane,set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,r,n){return this.normal.set(e,t,r),this.constant=n,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new r.Vector3,t=new r.Vector3;return function(r,n,i){var o=e.subVectors(i,n).cross(t.subVectors(r,n)).normalize();return this.setFromNormalAndCoplanarPoint(o,r),this}}(),copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return this.orthoPoint(e,t).sub(e).negate()},orthoPoint:function(e,t){var n=this.distanceToPoint(e),i=t||new r.Vector3;return i.copy(this.normal).multiplyScalar(n)},isIntersectionLine:function(e){var t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return 0>t&&r>0||0>r&&t>0},intersectLine:function(){var e=new r.Vector3;return function(t,n){var i=n||new r.Vector3,o=t.delta(e),a=this.normal.dot(o);if(0==a)return 0==this.distanceToPoint(t.start)?i.copy(t.start):void 0;var s=-(t.start.dot(this.normal)+this.constant)/a;return 0>s||s>1?void 0:i.copy(o).multiplyScalar(s).add(t.start)}}(),coplanarPoint:function(e){var t=e||new r.Vector3;return t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var e=new r.Vector3,t=new r.Vector3,n=new r.Matrix3;return function(r,i){var o=i||n.getNormalMatrix(r),a=e.copy(this.normal).applyMatrix3(o),s=this.coplanarPoint(t);return s.applyMatrix4(r),this.setFromNormalAndCoplanarPoint(a,s),this}}(),translate:function(e){return this.constant=this.constant-e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant==this.constant},clone:function(){return(new r.Plane).copy(this)}},r.Math={generateUUID:function(){var e,t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),r=new Array(36),n=0;return function(){for(var i=0;36>i;i++)8==i||13==i||18==i||23==i?r[i]="-":14==i?r[i]="4":(2>=n&&(n=33554432+16777216*Math.random()|0),e=15&n,n>>=4,r[i]=t[19==i?3&e|8:e]);return r.join("")}}(),clamp:function(e,t,r){return t>e?t:e>r?r:e},clampBottom:function(e,t){return t>e?t:e},mapLinear:function(e,t,r,n,i){return n+(e-t)*(i-n)/(r-t)},smoothstep:function(e,t,r){return t>=e?0:e>=r?1:(e=(e-t)/(r-t),e*e*(3-2*e))},smootherstep:function(e,t,r){return t>=e?0:e>=r?1:(e=(e-t)/(r-t),e*e*e*(e*(6*e-15)+10))},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(e,t){return Math.floor(this.randFloat(e,t))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(){var e=Math.PI/180;return function(t){return t*e}}(),radToDeg:function(){var e=180/Math.PI;return function(t){return t*e}}(),isPowerOfTwo:function(e){return 0===(e&e-1)&&0!==e}},r.Spline=function(e){function t(e,t,r,n,i,o,a){var s=.5*(r-e),u=.5*(n-t);return(2*(t-r)+s+u)*a+(-3*(t-r)-2*s-u)*o+s*i+t}this.points=e;var n,i,o,a,s,u,c,l,h,f=[],p={x:0,y:0,z:0};this.initFromArray=function(e){this.points=[];for(var t=0;t<e.length;t++)this.points[t]={x:e[t][0],y:e[t][1],z:e[t][2]}},this.getPoint=function(e){return n=(this.points.length-1)*e,i=Math.floor(n),o=n-i,f[0]=0===i?i:i-1,f[1]=i,f[2]=i>this.points.length-2?this.points.length-1:i+1,f[3]=i>this.points.length-3?this.points.length-1:i+2,u=this.points[f[0]],c=this.points[f[1]],l=this.points[f[2]],h=this.points[f[3]],a=o*o,s=o*a,p.x=t(u.x,c.x,l.x,h.x,o,a,s),p.y=t(u.y,c.y,l.y,h.y,o,a,s),p.z=t(u.z,c.z,l.z,h.z,o,a,s),p},this.getControlPointsArray=function(){var e,t,r=this.points.length,n=[];for(e=0;r>e;e++)t=this.points[e],n[e]=[t.x,t.y,t.z];return n},this.getLength=function(e){var t,n,i,o,a=0,s=0,u=0,c=new r.Vector3,l=new r.Vector3,h=[],f=0;for(h[0]=0,e||(e=100),i=this.points.length*e,c.copy(this.points[0]),t=1;i>t;t++)n=t/i,o=this.getPoint(n),l.copy(o),f+=l.distanceTo(c),c.copy(o),a=(this.points.length-1)*n,s=Math.floor(a),s!=u&&(h[s]=f,u=s);return h[h.length]=f,{chunks:h,total:f}},this.reparametrizeByArcLength=function(e){var t,n,i,o,a,s,u,c,l=[],h=new r.Vector3,f=this.getLength();for(l.push(h.copy(this.points[0]).clone()),t=1;t<this.points.length;t++){for(s=f.chunks[t]-f.chunks[t-1],u=Math.ceil(e*s/f.total),o=(t-1)/(this.points.length-1),a=t/(this.points.length-1),n=1;u-1>n;n++)i=o+n*(1/u)*(a-o),c=this.getPoint(i),l.push(h.copy(c).clone());l.push(h.copy(this.points[t]).clone())}this.points=l}},r.Triangle=function(e,t,n){this.a=void 0!==e?e:new r.Vector3,this.b=void 0!==t?t:new r.Vector3,this.c=void 0!==n?n:new r.Vector3},r.Triangle.normal=function(){var e=new r.Vector3;return function(t,n,i,o){var a=o||new r.Vector3;a.subVectors(i,n),e.subVectors(t,n),a.cross(e);var s=a.lengthSq();return s>0?a.multiplyScalar(1/Math.sqrt(s)):a.set(0,0,0)}}(),r.Triangle.barycoordFromPoint=function(){var e=new r.Vector3,t=new r.Vector3,n=new r.Vector3;return function(i,o,a,s,u){e.subVectors(s,o),t.subVectors(a,o),n.subVectors(i,o);var c=e.dot(e),l=e.dot(t),h=e.dot(n),f=t.dot(t),p=t.dot(n),d=c*f-l*l,m=u||new r.Vector3;if(0==d)return m.set(-2,-1,-1);var v=1/d,g=(f*h-l*p)*v,y=(c*p-l*h)*v;return m.set(1-g-y,y,g)}}(),r.Triangle.containsPoint=function(){var e=new r.Vector3;return function(t,n,i,o){var a=r.Triangle.barycoordFromPoint(t,n,i,o,e);return a.x>=0&&a.y>=0&&a.x+a.y<=1}}(),r.Triangle.prototype={constructor:r.Triangle,set:function(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this},setFromPointsAndIndices:function(e,t,r,n){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[n]),this},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},area:function(){var e=new r.Vector3,t=new r.Vector3;return function(){return e.subVectors(this.c,this.b),t.subVectors(this.a,this.b),.5*e.cross(t).length()}}(),midpoint:function(e){var t=e||new r.Vector3;return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(e){return r.Triangle.normal(this.a,this.b,this.c,e)},plane:function(e){var t=e||new r.Plane;return t.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(e,t){return r.Triangle.barycoordFromPoint(e,this.a,this.b,this.c,t)},containsPoint:function(e){return r.Triangle.containsPoint(e,this.a,this.b,this.c)},equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)},clone:function(){return(new r.Triangle).copy(this)}},r.Clock=function(e){this.autoStart=void 0!==e?e:!0,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1},r.Clock.prototype={constructor:r.Clock,start:function(){this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(),this.oldTime=this.startTime,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var e=0;if(this.autoStart&&!this.running&&this.start(),this.running){var t=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now();e=.001*(t-this.oldTime),this.oldTime=t,this.elapsedTime+=e}return e}},r.EventDispatcher=function(){},r.EventDispatcher.prototype={constructor:r.EventDispatcher,apply:function(e){e.addEventListener=r.EventDispatcher.prototype.addEventListener,e.hasEventListener=r.EventDispatcher.prototype.hasEventListener,e.removeEventListener=r.EventDispatcher.prototype.removeEventListener,e.dispatchEvent=r.EventDispatcher.prototype.dispatchEvent},addEventListener:function(e,t){void 0===this._listeners&&(this._listeners={});var r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)},hasEventListener:function(e,t){if(void 0===this._listeners)return!1;var r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)?!0:!1},removeEventListener:function(e,t){if(void 0!==this._listeners){var r=this._listeners,n=r[e];if(void 0!==n){var i=n.indexOf(t);-1!==i&&n.splice(i,1)}}},dispatchEvent:function(e){if(void 0!==this._listeners){var t=this._listeners,r=t[e.type];if(void 0!==r){e.target=this;for(var n=[],i=r.length,o=0;i>o;o++)n[o]=r[o];for(var o=0;i>o;o++)n[o].call(this,e)}}}},function(e){e.Raycaster=function(t,r,n,i){this.ray=new e.Ray(t,r),this.near=n||0,this.far=i||1/0,this.params={Sprite:{},Mesh:{},PointCloud:{threshold:1},LOD:{},Line:{}}};var t=function(e,t){return e.distance-t.distance},r=function(e,t,n,i){if(e.raycast(t,n),i===!0)for(var o=e.children,a=0,s=o.length;s>a;a++)r(o[a],t,n,!0)};e.Raycaster.prototype={constructor:e.Raycaster,precision:1e-4,linePrecision:1,set:function(e,t){this.ray.set(e,t)},setFromCamera:function(t,r){r instanceof e.PerspectiveCamera?(this.ray.origin.copy(r.position),this.ray.direction.set(t.x,t.y,.5).unproject(r).sub(r.position).normalize()):r instanceof e.OrthographicCamera?(this.ray.origin.set(t.x,t.y,-1).unproject(r),this.ray.direction.set(0,0,-1).transformDirection(r.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(e,n){var i=[];return r(e,this,i,n),i.sort(t),i},intersectObjects:function(e,n){var i=[];if(e instanceof Array==!1)return console.log("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var o=0,a=e.length;a>o;o++)r(e[o],this,i,n);return i.sort(t),i}}}(r),r.Object3D=function(){Object.defineProperty(this,"id",{value:r.Object3DIdCount++}),this.uuid=r.Math.generateUUID(),this.name="",this.type="Object3D",this.parent=void 0,this.children=[],this.up=r.Object3D.DefaultUp.clone();var e=new r.Vector3,t=new r.Euler,n=new r.Quaternion,i=new r.Vector3(1,1,1),o=function(){n.setFromEuler(t,!1)},a=function(){t.setFromQuaternion(n,void 0,!1)};t.onChange(o),n.onChange(a),Object.defineProperties(this,{position:{enumerable:!0,value:e},rotation:{enumerable:!0,value:t},quaternion:{enumerable:!0,value:n},scale:{enumerable:!0,value:i}}),this.rotationAutoUpdate=!0,this.matrix=new r.Matrix4,this.matrixWorld=new r.Matrix4,this.matrixAutoUpdate=!0,this.matrixWorldNeedsUpdate=!1,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.userData={}},r.Object3D.DefaultUp=new r.Vector3(0,1,0),r.Object3D.prototype={constructor:r.Object3D,get eulerOrder(){return console.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order."),this.rotation.order},set eulerOrder(e){console.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order."),this.rotation.order=e},get useQuaternion(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set useQuaternion(e){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},applyMatrix:function(e){this.matrix.multiplyMatrices(e,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(e,t){this.quaternion.setFromAxisAngle(e,t)},setRotationFromEuler:function(e){this.quaternion.setFromEuler(e,!0)},setRotationFromMatrix:function(e){this.quaternion.setFromRotationMatrix(e)},setRotationFromQuaternion:function(e){this.quaternion.copy(e)},rotateOnAxis:function(){var e=new r.Quaternion;return function(t,r){return e.setFromAxisAngle(t,r),this.quaternion.multiply(e),this}}(),rotateX:function(){var e=new r.Vector3(1,0,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateY:function(){var e=new r.Vector3(0,1,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateZ:function(){var e=new r.Vector3(0,0,1);return function(t){return this.rotateOnAxis(e,t)}}(),translateOnAxis:function(){var e=new r.Vector3;return function(t,r){return e.copy(t).applyQuaternion(this.quaternion),this.position.add(e.multiplyScalar(r)),this}}(),translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},translateX:function(){var e=new r.Vector3(1,0,0);return function(t){return this.translateOnAxis(e,t)}}(),translateY:function(){var e=new r.Vector3(0,1,0);return function(t){return this.translateOnAxis(e,t)}}(),translateZ:function(){var e=new r.Vector3(0,0,1);return function(t){return this.translateOnAxis(e,t)}}(),localToWorld:function(e){return e.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var e=new r.Matrix4;return function(t){return t.applyMatrix4(e.getInverse(this.matrixWorld))}}(),lookAt:function(){var e=new r.Matrix4;return function(t){e.lookAt(t,this.position,this.up),this.quaternion.setFromRotationMatrix(e)}}(),add:function(e){if(arguments.length>1){for(var t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add:",e,"can't be added as a child of itself."),this):(e instanceof r.Object3D?(void 0!==e.parent&&e.parent.remove(e),e.parent=this,e.dispatchEvent({type:"added"}),this.children.push(e)):console.error("THREE.Object3D.add:",e,"is not an instance of THREE.Object3D."),this)},remove:function(e){if(arguments.length>1)for(var t=0;t<arguments.length;t++)this.remove(arguments[t]);var r=this.children.indexOf(e);-1!==r&&(e.parent=void 0,e.dispatchEvent({type:"removed"}),this.children.splice(r,1))},getChildByName:function(e,t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e,t)},getObjectById:function(e,t){return this.getObjectByProperty("id",e,t)},getObjectByName:function(e,t){return this.getObjectByProperty("name",e,t)},getObjectByProperty:function(e,t,r){if(this[e]===t)return this;for(var n=0,i=this.children.length;i>n;n++){var o=this.children[n],a=o.getObjectByProperty(e,t,r);if(void 0!==a)return a}return void 0},getWorldPosition:function(e){var t=e||new r.Vector3;return this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var e=new r.Vector3,t=new r.Vector3;return function(n){var i=n||new r.Quaternion;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,i,t),i}}(),getWorldRotation:function(){var e=new r.Quaternion;return function(t){var n=t||new r.Euler;return this.getWorldQuaternion(e),n.setFromQuaternion(e,this.rotation.order,!1)}}(),getWorldScale:function(){var e=new r.Vector3,t=new r.Quaternion;return function(n){var i=n||new r.Vector3;return this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,t,i),i}}(),getWorldDirection:function(){var e=new r.Quaternion;return function(t){var n=t||new r.Vector3;return this.getWorldQuaternion(e),n.set(0,0,1).applyQuaternion(e)}}(),raycast:function(){},traverse:function(e){e(this);for(var t=0,r=this.children.length;r>t;t++)this.children[t].traverse(e)},traverseVisible:function(e){if(this.visible!==!1){e(this);for(var t=0,r=this.children.length;r>t;t++)this.children[t].traverseVisible(e)}},traverseAncestors:function(e){this.parent&&(e(this.parent),this.parent.traverseAncestors(e))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(e){this.matrixAutoUpdate===!0&&this.updateMatrix(),(this.matrixWorldNeedsUpdate===!0||e===!0)&&(void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);for(var t=0,r=this.children.length;r>t;t++)this.children[t].updateMatrixWorld(e)},toJSON:function(){var e={metadata:{version:4.3,type:"Object",generator:"ObjectExporter"}},t={},n=function(r){if(void 0===e.geometries&&(e.geometries=[]),void 0===t[r.uuid]){var n=r.toJSON();delete n.metadata,t[r.uuid]=n,e.geometries.push(n)}return r.uuid},i={},o=function(t){if(void 0===e.materials&&(e.materials=[]),void 0===i[t.uuid]){var r=t.toJSON();delete r.metadata,i[t.uuid]=r,e.materials.push(r)}return t.uuid},a=function(e){var t={};if(t.uuid=e.uuid,t.type=e.type,""!==e.name&&(t.name=e.name),"{}"!==JSON.stringify(e.userData)&&(t.userData=e.userData),e.visible!==!0&&(t.visible=e.visible),e instanceof r.PerspectiveCamera?(t.fov=e.fov,t.aspect=e.aspect,t.near=e.near,t.far=e.far):e instanceof r.OrthographicCamera?(t.left=e.left,t.right=e.right,t.top=e.top,t.bottom=e.bottom,t.near=e.near,t.far=e.far):e instanceof r.AmbientLight?t.color=e.color.getHex():e instanceof r.DirectionalLight?(t.color=e.color.getHex(),t.intensity=e.intensity):e instanceof r.PointLight?(t.color=e.color.getHex(),t.intensity=e.intensity,t.distance=e.distance):e instanceof r.SpotLight?(t.color=e.color.getHex(),t.intensity=e.intensity,t.distance=e.distance,t.angle=e.angle,t.exponent=e.exponent):e instanceof r.HemisphereLight?(t.color=e.color.getHex(),t.groundColor=e.groundColor.getHex()):e instanceof r.Mesh?(t.geometry=n(e.geometry),t.material=o(e.material)):e instanceof r.Line?(t.geometry=n(e.geometry),t.material=o(e.material)):e instanceof r.Sprite&&(t.material=o(e.material)),t.matrix=e.matrix.toArray(),e.children.length>0){t.children=[];for(var i=0;i<e.children.length;i++)t.children.push(a(e.children[i]))}return t};return e.object=a(this),e},clone:function(e,t){if(void 0===e&&(e=new r.Object3D),void 0===t&&(t=!0),e.name=this.name,e.up.copy(this.up),e.position.copy(this.position),e.quaternion.copy(this.quaternion),e.scale.copy(this.scale),e.rotationAutoUpdate=this.rotationAutoUpdate,e.matrix.copy(this.matrix),e.matrixWorld.copy(this.matrixWorld),e.matrixAutoUpdate=this.matrixAutoUpdate,e.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate,e.visible=this.visible,e.castShadow=this.castShadow,e.receiveShadow=this.receiveShadow,e.frustumCulled=this.frustumCulled,e.userData=JSON.parse(JSON.stringify(this.userData)),t===!0)for(var n=0;n<this.children.length;n++){var i=this.children[n];e.add(i.clone())}return e}},r.EventDispatcher.prototype.apply(r.Object3D.prototype),r.Object3DIdCount=0,r.Face3=function(e,t,n,i,o,a){this.a=e,this.b=t,this.c=n,this.normal=i instanceof r.Vector3?i:new r.Vector3,this.vertexNormals=i instanceof Array?i:[],this.color=o instanceof r.Color?o:new r.Color,this.vertexColors=o instanceof Array?o:[],this.vertexTangents=[],this.materialIndex=void 0!==a?a:0},r.Face3.prototype={constructor:r.Face3,clone:function(){var e=new r.Face3(this.a,this.b,this.c);e.normal.copy(this.normal),e.color.copy(this.color),e.materialIndex=this.materialIndex;for(var t=0,n=this.vertexNormals.length;n>t;t++)e.vertexNormals[t]=this.vertexNormals[t].clone();for(var t=0,n=this.vertexColors.length;n>t;t++)e.vertexColors[t]=this.vertexColors[t].clone();for(var t=0,n=this.vertexTangents.length;n>t;t++)e.vertexTangents[t]=this.vertexTangents[t].clone();return e}},r.Face4=function(e,t,n,i,o,a,s){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new r.Face3(e,t,n,o,a,s)},r.BufferAttribute=function(e,t){this.array=e,this.itemSize=t,this.needsUpdate=!1},r.BufferAttribute.prototype={constructor:r.BufferAttribute,get length(){return this.array.length},copyAt:function(e,t,r){e*=this.itemSize,r*=t.itemSize;for(var n=0,i=this.itemSize;i>n;n++)this.array[e+n]=t.array[r+n]},set:function(e){return this.array.set(e),this},setX:function(e,t){return this.array[e*this.itemSize]=t,this},setY:function(e,t){return this.array[e*this.itemSize+1]=t,this},setZ:function(e,t){return this.array[e*this.itemSize+2]=t,this},setXY:function(e,t,r){return e*=this.itemSize,this.array[e]=t,this.array[e+1]=r,this},setXYZ:function(e,t,r,n){return e*=this.itemSize,this.array[e]=t,this.array[e+1]=r,this.array[e+2]=n,this},setXYZW:function(e,t,r,n,i){return e*=this.itemSize,this.array[e]=t,this.array[e+1]=r,this.array[e+2]=n,this.array[e+3]=i,this},clone:function(){return new r.BufferAttribute(new this.array.constructor(this.array),this.itemSize)}},r.Int8Attribute=function(e,t){return console.warn("THREE.Int8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new r.BufferAttribute(e,t)},r.Uint8Attribute=function(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new r.BufferAttribute(e,t)},r.Uint8ClampedAttribute=function(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new r.BufferAttribute(e,t)},r.Int16Attribute=function(e,t){return console.warn("THREE.Int16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new r.BufferAttribute(e,t)},r.Uint16Attribute=function(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new r.BufferAttribute(e,t)},r.Int32Attribute=function(e,t){return console.warn("THREE.Int32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new r.BufferAttribute(e,t)},r.Uint32Attribute=function(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new r.BufferAttribute(e,t)},r.Float32Attribute=function(e,t){return console.warn("THREE.Float32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new r.BufferAttribute(e,t)},r.Float64Attribute=function(e,t){return console.warn("THREE.Float64Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new r.BufferAttribute(e,t)},r.BufferGeometry=function(){Object.defineProperty(this,"id",{value:r.GeometryIdCount++}),this.uuid=r.Math.generateUUID(),this.name="",this.type="BufferGeometry",this.attributes={},this.attributesKeys=[],this.drawcalls=[],this.offsets=this.drawcalls,this.boundingBox=null,this.boundingSphere=null},r.BufferGeometry.prototype={constructor:r.BufferGeometry,addAttribute:function(e,t){return t instanceof r.BufferAttribute==!1?(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),void(this.attributes[e]={array:arguments[1],itemSize:arguments[2]})):(this.attributes[e]=t,void(this.attributesKeys=Object.keys(this.attributes)))},getAttribute:function(e){return this.attributes[e]},addDrawCall:function(e,t,r){this.drawcalls.push({start:e,count:t,index:void 0!==r?r:0})},applyMatrix:function(e){var t=this.attributes.position;void 0!==t&&(e.applyToVector3Array(t.array),t.needsUpdate=!0);var n=this.attributes.normal;if(void 0!==n){var i=(new r.Matrix3).getNormalMatrix(e);i.applyToVector3Array(n.array),n.needsUpdate=!0}},center:function(){},fromGeometry:function(e,t){t=t||{vertexColors:r.NoColors};var n=e.vertices,i=e.faces,o=e.faceVertexUvs,a=t.vertexColors,s=o[0].length>0,u=3==i[0].vertexNormals.length,c=new Float32Array(3*i.length*3);this.addAttribute("position",new r.BufferAttribute(c,3));var l=new Float32Array(3*i.length*3);if(this.addAttribute("normal",new r.BufferAttribute(l,3)),a!==r.NoColors){var h=new Float32Array(3*i.length*3);this.addAttribute("color",new r.BufferAttribute(h,3))}if(s===!0){var f=new Float32Array(3*i.length*2);this.addAttribute("uv",new r.BufferAttribute(f,2))}for(var p=0,d=0,m=0;p<i.length;p++,d+=6,m+=9){var v=i[p],g=n[v.a],y=n[v.b],b=n[v.c];if(c[m]=g.x,c[m+1]=g.y,c[m+2]=g.z,c[m+3]=y.x,c[m+4]=y.y,c[m+5]=y.z,c[m+6]=b.x,c[m+7]=b.y,c[m+8]=b.z,u===!0){var x=v.vertexNormals[0],w=v.vertexNormals[1],_=v.vertexNormals[2];l[m]=x.x,l[m+1]=x.y,l[m+2]=x.z,l[m+3]=w.x,l[m+4]=w.y,l[m+5]=w.z,l[m+6]=_.x,l[m+7]=_.y,l[m+8]=_.z}else{var S=v.normal;l[m]=S.x,l[m+1]=S.y,l[m+2]=S.z,l[m+3]=S.x,l[m+4]=S.y,l[m+5]=S.z,l[m+6]=S.x,l[m+7]=S.y,l[m+8]=S.z}if(a===r.FaceColors){var M=v.color;h[m]=M.r,h[m+1]=M.g,h[m+2]=M.b,h[m+3]=M.r,h[m+4]=M.g,h[m+5]=M.b,h[m+6]=M.r,h[m+7]=M.g,h[m+8]=M.b}else if(a===r.VertexColors){var E=v.vertexColors[0],T=v.vertexColors[1],C=v.vertexColors[2];h[m]=E.r,h[m+1]=E.g,h[m+2]=E.b,h[m+3]=T.r,h[m+4]=T.g,h[m+5]=T.b,h[m+6]=C.r,h[m+7]=C.g,h[m+8]=C.b}if(s===!0){var A=o[0][p][0],$=o[0][p][1],k=o[0][p][2];f[d]=A.x,f[d+1]=A.y,f[d+2]=$.x,f[d+3]=$.y,f[d+4]=k.x,f[d+5]=k.y}}return this.computeBoundingSphere(),this},computeBoundingBox:function(){var e=new r.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new r.Box3);var t=this.attributes.position.array;if(t){var n=this.boundingBox;n.makeEmpty();for(var i=0,o=t.length;o>i;i+=3)e.set(t[i],t[i+1],t[i+2]),n.expandByPoint(e)}(void 0===t||0===t.length)&&(this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0)),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')}}(),computeBoundingSphere:function(){var e=new r.Box3,t=new r.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new r.Sphere);var n=this.attributes.position.array;if(n){e.makeEmpty();for(var i=this.boundingSphere.center,o=0,a=n.length;a>o;o+=3)t.set(n[o],n[o+1],n[o+2]),e.expandByPoint(t);e.center(i);for(var s=0,o=0,a=n.length;a>o;o+=3)t.set(n[o],n[o+1],n[o+2]),s=Math.max(s,i.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var e=this.attributes;if(e.position){var t=e.position.array;if(void 0===e.normal)this.addAttribute("normal",new r.BufferAttribute(new Float32Array(t.length),3));else for(var n=e.normal.array,i=0,o=n.length;o>i;i++)n[i]=0;var a,s,u,n=e.normal.array,c=new r.Vector3,l=new r.Vector3,h=new r.Vector3,f=new r.Vector3,p=new r.Vector3;if(e.index)for(var d=e.index.array,m=this.offsets.length>0?this.offsets:[{start:0,count:d.length,index:0}],v=0,g=m.length;g>v;++v)for(var y=m[v].start,b=m[v].count,x=m[v].index,i=y,o=y+b;o>i;i+=3)a=3*(x+d[i]),s=3*(x+d[i+1]),u=3*(x+d[i+2]),c.fromArray(t,a),l.fromArray(t,s),h.fromArray(t,u),f.subVectors(h,l),p.subVectors(c,l),f.cross(p),n[a]+=f.x,n[a+1]+=f.y,n[a+2]+=f.z,n[s]+=f.x,n[s+1]+=f.y,n[s+2]+=f.z,n[u]+=f.x,n[u+1]+=f.y,n[u+2]+=f.z;else for(var i=0,o=t.length;o>i;i+=9)c.fromArray(t,i),l.fromArray(t,i+3),h.fromArray(t,i+6),f.subVectors(h,l),p.subVectors(c,l),f.cross(p),n[i]=f.x,n[i+1]=f.y,n[i+2]=f.z,n[i+3]=f.x,n[i+4]=f.y,n[i+5]=f.z,n[i+6]=f.x,n[i+7]=f.y,n[i+8]=f.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},computeTangents:function(){function e(e,t,r){k.fromArray(i,3*e),P.fromArray(i,3*t),R.fromArray(i,3*r),O.fromArray(a,2*e),L.fromArray(a,2*t),F.fromArray(a,2*r),f=P.x-k.x,p=R.x-k.x,d=P.y-k.y,m=R.y-k.y,v=P.z-k.z,g=R.z-k.z,y=L.x-O.x,b=F.x-O.x,x=L.y-O.y,w=F.y-O.y,_=1/(y*w-b*x),j.set((w*f-x*p)*_,(w*d-x*m)*_,(w*v-x*g)*_),D.set((y*p-b*f)*_,(y*m-b*d)*_,(y*g-b*v)*_),c[e].add(j),c[t].add(j),c[r].add(j),l[e].add(D),l[t].add(D),l[r].add(D)}function t(e){q.fromArray(o,3*e),X.copy(q),z=c[e],H.copy(z),H.sub(q.multiplyScalar(q.dot(z))).normalize(),W.crossVectors(X,z),G=W.dot(l[e]),I=0>G?-1:1,u[4*e]=H.x,u[4*e+1]=H.y,u[4*e+2]=H.z,u[4*e+3]=I
}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)return void console.warn("Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");var n=this.attributes.index.array,i=this.attributes.position.array,o=this.attributes.normal.array,a=this.attributes.uv.array,s=i.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new r.BufferAttribute(new Float32Array(4*s),4));for(var u=this.attributes.tangent.array,c=[],l=[],h=0;s>h;h++)c[h]=new r.Vector3,l[h]=new r.Vector3;var f,p,d,m,v,g,y,b,x,w,_,S,M,E,T,C,A,$,k=new r.Vector3,P=new r.Vector3,R=new r.Vector3,O=new r.Vector2,L=new r.Vector2,F=new r.Vector2,j=new r.Vector3,D=new r.Vector3;0===this.drawcalls.length&&this.addDrawCall(0,n.length,0);var N=this.drawcalls;for(E=0,T=N.length;T>E;++E){var U=N[E].start,V=N[E].count,B=N[E].index;for(S=U,M=U+V;M>S;S+=3)C=B+n[S],A=B+n[S+1],$=B+n[S+2],e(C,A,$)}var I,z,G,H=new r.Vector3,W=new r.Vector3,q=new r.Vector3,X=new r.Vector3;for(E=0,T=N.length;T>E;++E){var U=N[E].start,V=N[E].count,B=N[E].index;for(S=U,M=U+V;M>S;S+=3)C=B+n[S],A=B+n[S+1],$=B+n[S+2],t(C),t(A),t($)}},computeOffsets:function(e){var t=e;void 0===e&&(t=65535);for(var r=(Date.now(),this.attributes.index.array),n=this.attributes.position.array,i=(n.length/3,r.length/3),o=new Uint16Array(r.length),a=0,s=0,u=[{start:0,count:0,index:0}],c=u[0],l=0,h=0,f=new Int32Array(6),p=new Int32Array(n.length),d=new Int32Array(n.length),m=0;m<n.length;m++)p[m]=-1,d[m]=-1;for(var v=0;i>v;v++){h=0;for(var g=0;3>g;g++){var y=r[3*v+g];-1==p[y]?(f[2*g]=y,f[2*g+1]=-1,h++):p[y]<c.index?(f[2*g]=y,f[2*g+1]=-1,l++):(f[2*g]=y,f[2*g+1]=p[y])}var b=s+h;if(b>c.index+t){var x={start:a,count:0,index:s};u.push(x),c=x;for(var w=0;6>w;w+=2){var _=f[w+1];_>-1&&_<c.index&&(f[w+1]=-1)}}for(var w=0;6>w;w+=2){var y=f[w],_=f[w+1];-1===_&&(_=s++),p[y]=_,d[_]=y,o[a++]=_-c.index,c.count++}}return this.reorderBuffers(o,d,s),this.offsets=u,u},merge:function(e,t){if(e instanceof r.BufferGeometry==!1)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",e);void 0===t&&(t=0);var n=this.attributes;for(var i in n)if(void 0!==e.attributes[i])for(var o=n[i],a=o.array,s=e.attributes[i],u=s.array,c=s.itemSize,l=0,h=c*t;l<u.length;l++,h++)a[h]=u[l];return this},normalizeNormals:function(){for(var e,t,r,n,i=this.attributes.normal.array,o=0,a=i.length;a>o;o+=3)e=i[o],t=i[o+1],r=i[o+2],n=1/Math.sqrt(e*e+t*t+r*r),i[o]*=n,i[o+1]*=n,i[o+2]*=n},reorderBuffers:function(e,t,r){var n={};for(var i in this.attributes)if("index"!=i){var o=this.attributes[i].array;n[i]=new o.constructor(this.attributes[i].itemSize*r)}for(var a=0;r>a;a++){var s=t[a];for(var i in this.attributes)if("index"!=i)for(var u=this.attributes[i].array,c=this.attributes[i].itemSize,l=n[i],h=0;c>h;h++)l[a*c+h]=u[s*c+h]}this.attributes.index.array=e;for(var i in this.attributes)"index"!=i&&(this.attributes[i].array=n[i],this.attributes[i].numItems=this.attributes[i].itemSize*r)},toJSON:function(){var e={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type,data:{attributes:{}}},t=this.attributes,r=this.offsets,n=this.boundingSphere;for(var i in t){for(var o=t[i],a=[],s=o.array,u=0,c=s.length;c>u;u++)a[u]=s[u];e.data.attributes[i]={itemSize:o.itemSize,type:o.array.constructor.name,array:a}}return r.length>0&&(e.data.offsets=JSON.parse(JSON.stringify(r))),null!==n&&(e.data.boundingSphere={center:n.center.toArray(),radius:n.radius}),e},clone:function(){var e=new r.BufferGeometry;for(var t in this.attributes){var n=this.attributes[t];e.addAttribute(t,n.clone())}for(var i=0,o=this.offsets.length;o>i;i++){var a=this.offsets[i];e.offsets.push({start:a.start,index:a.index,count:a.count})}return e},dispose:function(){this.dispatchEvent({type:"dispose"})}},r.EventDispatcher.prototype.apply(r.BufferGeometry.prototype),r.Geometry=function(){Object.defineProperty(this,"id",{value:r.GeometryIdCount++}),this.uuid=r.Math.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphColors=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.hasTangents=!1,this.dynamic=!0,this.verticesNeedUpdate=!1,this.elementsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.tangentsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1},r.Geometry.prototype={constructor:r.Geometry,applyMatrix:function(e){for(var t=(new r.Matrix3).getNormalMatrix(e),n=0,i=this.vertices.length;i>n;n++){var o=this.vertices[n];o.applyMatrix4(e)}for(var n=0,i=this.faces.length;i>n;n++){var a=this.faces[n];a.normal.applyMatrix3(t).normalize();for(var s=0,u=a.vertexNormals.length;u>s;s++)a.vertexNormals[s].applyMatrix3(t).normalize()}this.boundingBox instanceof r.Box3&&this.computeBoundingBox(),this.boundingSphere instanceof r.Sphere&&this.computeBoundingSphere()},fromBufferGeometry:function(e){for(var t=this,n=e.attributes,i=n.position.array,o=void 0!==n.index?n.index.array:void 0,a=void 0!==n.normal?n.normal.array:void 0,s=void 0!==n.color?n.color.array:void 0,u=void 0!==n.uv?n.uv.array:void 0,c=[],l=[],h=0,f=0;h<i.length;h+=3,f+=2)t.vertices.push(new r.Vector3(i[h],i[h+1],i[h+2])),void 0!==a&&c.push(new r.Vector3(a[h],a[h+1],a[h+2])),void 0!==s&&t.colors.push(new r.Color(s[h],s[h+1],s[h+2])),void 0!==u&&l.push(new r.Vector2(u[f],u[f+1]));var p=function(e,n,i){var o=void 0!==a?[c[e].clone(),c[n].clone(),c[i].clone()]:[],h=void 0!==s?[t.colors[e].clone(),t.colors[n].clone(),t.colors[i].clone()]:[];t.faces.push(new r.Face3(e,n,i,o,h)),void 0!==u&&t.faceVertexUvs[0].push([l[e].clone(),l[n].clone(),l[i].clone()])};if(void 0!==o)for(var h=0;h<o.length;h+=3)p(o[h],o[h+1],o[h+2]);else for(var h=0;h<i.length/3;h+=3)p(h,h+1,h+2);return this.computeFaceNormals(),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var e=new r.Vector3;return e.addVectors(this.boundingBox.min,this.boundingBox.max),e.multiplyScalar(-.5),this.applyMatrix((new r.Matrix4).makeTranslation(e.x,e.y,e.z)),this.computeBoundingBox(),e},computeFaceNormals:function(){for(var e=new r.Vector3,t=new r.Vector3,n=0,i=this.faces.length;i>n;n++){var o=this.faces[n],a=this.vertices[o.a],s=this.vertices[o.b],u=this.vertices[o.c];e.subVectors(u,s),t.subVectors(a,s),e.cross(t),e.normalize(),o.normal.copy(e)}},computeVertexNormals:function(e){var t,n,i,o,a,s;for(s=new Array(this.vertices.length),t=0,n=this.vertices.length;n>t;t++)s[t]=new r.Vector3;if(e){{var u,c,l,h=new r.Vector3,f=new r.Vector3;new r.Vector3,new r.Vector3,new r.Vector3}for(i=0,o=this.faces.length;o>i;i++)a=this.faces[i],u=this.vertices[a.a],c=this.vertices[a.b],l=this.vertices[a.c],h.subVectors(l,c),f.subVectors(u,c),h.cross(f),s[a.a].add(h),s[a.b].add(h),s[a.c].add(h)}else for(i=0,o=this.faces.length;o>i;i++)a=this.faces[i],s[a.a].add(a.normal),s[a.b].add(a.normal),s[a.c].add(a.normal);for(t=0,n=this.vertices.length;n>t;t++)s[t].normalize();for(i=0,o=this.faces.length;o>i;i++)a=this.faces[i],a.vertexNormals[0]=s[a.a].clone(),a.vertexNormals[1]=s[a.b].clone(),a.vertexNormals[2]=s[a.c].clone()},computeMorphNormals:function(){var e,t,n,i,o;for(n=0,i=this.faces.length;i>n;n++)for(o=this.faces[n],o.__originalFaceNormal?o.__originalFaceNormal.copy(o.normal):o.__originalFaceNormal=o.normal.clone(),o.__originalVertexNormals||(o.__originalVertexNormals=[]),e=0,t=o.vertexNormals.length;t>e;e++)o.__originalVertexNormals[e]?o.__originalVertexNormals[e].copy(o.vertexNormals[e]):o.__originalVertexNormals[e]=o.vertexNormals[e].clone();var a=new r.Geometry;for(a.faces=this.faces,e=0,t=this.morphTargets.length;t>e;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];var s,u,c=this.morphNormals[e].faceNormals,l=this.morphNormals[e].vertexNormals;for(n=0,i=this.faces.length;i>n;n++)s=new r.Vector3,u={a:new r.Vector3,b:new r.Vector3,c:new r.Vector3},c.push(s),l.push(u)}var h=this.morphNormals[e];a.vertices=this.morphTargets[e].vertices,a.computeFaceNormals(),a.computeVertexNormals();var s,u;for(n=0,i=this.faces.length;i>n;n++)o=this.faces[n],s=h.faceNormals[n],u=h.vertexNormals[n],s.copy(o.normal),u.a.copy(o.vertexNormals[0]),u.b.copy(o.vertexNormals[1]),u.c.copy(o.vertexNormals[2])}for(n=0,i=this.faces.length;i>n;n++)o=this.faces[n],o.normal=o.__originalFaceNormal,o.vertexNormals=o.__originalVertexNormals},computeTangents:function(){function e(e,t,r,n,i,o,a){l=e.vertices[t],h=e.vertices[r],f=e.vertices[n],p=c[i],d=c[o],m=c[a],v=h.x-l.x,g=f.x-l.x,y=h.y-l.y,b=f.y-l.y,x=h.z-l.z,w=f.z-l.z,_=d.x-p.x,S=m.x-p.x,M=d.y-p.y,E=m.y-p.y,T=1/(_*E-S*M),R.set((E*v-M*g)*T,(E*y-M*b)*T,(E*x-M*w)*T),O.set((_*g-S*v)*T,(_*b-S*y)*T,(_*w-S*x)*T),k[t].add(R),k[r].add(R),k[n].add(R),P[t].add(O),P[r].add(O),P[n].add(O)}var t,n,i,o,a,s,u,c,l,h,f,p,d,m,v,g,y,b,x,w,_,S,M,E,T,C,A,$,k=[],P=[],R=new r.Vector3,O=new r.Vector3,L=new r.Vector3,F=new r.Vector3,j=new r.Vector3;for(i=0,o=this.vertices.length;o>i;i++)k[i]=new r.Vector3,P[i]=new r.Vector3;for(t=0,n=this.faces.length;n>t;t++)u=this.faces[t],c=this.faceVertexUvs[0][t],e(this,u.a,u.b,u.c,0,1,2);var D=["a","b","c","d"];for(t=0,n=this.faces.length;n>t;t++)for(u=this.faces[t],a=0;a<Math.min(u.vertexNormals.length,3);a++)j.copy(u.vertexNormals[a]),s=u[D[a]],C=k[s],L.copy(C),L.sub(j.multiplyScalar(j.dot(C))).normalize(),F.crossVectors(u.vertexNormals[a],C),A=F.dot(P[s]),$=0>A?-1:1,u.vertexTangents[a]=new r.Vector4(L.x,L.y,L.z,$);this.hasTangents=!0},computeLineDistances:function(){for(var e=0,t=this.vertices,r=0,n=t.length;n>r;r++)r>0&&(e+=t[r].distanceTo(t[r-1])),this.lineDistances[r]=e},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new r.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new r.Sphere),this.boundingSphere.setFromPoints(this.vertices)},merge:function(e,t,n){if(e instanceof r.Geometry==!1)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",e);var i,o=this.vertices.length,a=this.vertices,s=e.vertices,u=this.faces,c=e.faces,l=this.faceVertexUvs[0],h=e.faceVertexUvs[0];void 0===n&&(n=0),void 0!==t&&(i=(new r.Matrix3).getNormalMatrix(t));for(var f=0,p=s.length;p>f;f++){var d=s[f],m=d.clone();void 0!==t&&m.applyMatrix4(t),a.push(m)}for(f=0,p=c.length;p>f;f++){var v,g,y,b=c[f],x=b.vertexNormals,w=b.vertexColors;v=new r.Face3(b.a+o,b.b+o,b.c+o),v.normal.copy(b.normal),void 0!==i&&v.normal.applyMatrix3(i).normalize();for(var _=0,S=x.length;S>_;_++)g=x[_].clone(),void 0!==i&&g.applyMatrix3(i).normalize(),v.vertexNormals.push(g);v.color.copy(b.color);for(var _=0,S=w.length;S>_;_++)y=w[_],v.vertexColors.push(y.clone());v.materialIndex=b.materialIndex+n,u.push(v)}for(f=0,p=h.length;p>f;f++){var M=h[f],E=[];if(void 0!==M){for(var _=0,S=M.length;S>_;_++)E.push(M[_].clone());l.push(E)}}},mergeMesh:function(e){return e instanceof r.Mesh==!1?void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",e):(e.matrixAutoUpdate&&e.updateMatrix(),void this.merge(e.geometry,e.matrix))},mergeVertices:function(){var e,t,r,n,i,o,a,s,u={},c=[],l=[],h=4,f=Math.pow(10,h);for(r=0,n=this.vertices.length;n>r;r++)e=this.vertices[r],t=Math.round(e.x*f)+"_"+Math.round(e.y*f)+"_"+Math.round(e.z*f),void 0===u[t]?(u[t]=r,c.push(this.vertices[r]),l[r]=c.length-1):l[r]=l[u[t]];var p=[];for(r=0,n=this.faces.length;n>r;r++){i=this.faces[r],i.a=l[i.a],i.b=l[i.b],i.c=l[i.c],o=[i.a,i.b,i.c];for(var d=-1,m=0;3>m;m++)if(o[m]==o[(m+1)%3]){d=m,p.push(r);break}}for(r=p.length-1;r>=0;r--){var v=p[r];for(this.faces.splice(v,1),a=0,s=this.faceVertexUvs.length;s>a;a++)this.faceVertexUvs[a].splice(v,1)}var g=this.vertices.length-c.length;return this.vertices=c,g},toJSON:function(){function e(e,t,r){return r?e|1<<t:e&~(1<<t)}function t(e){var t=e.x.toString()+e.y.toString()+e.z.toString();return void 0!==f[t]?f[t]:(f[t]=h.length/3,h.push(e.x,e.y,e.z),f[t])}function r(e){var t=e.r.toString()+e.g.toString()+e.b.toString();return void 0!==d[t]?d[t]:(d[t]=p.length,p.push(e.getHex()),d[t])}function n(e){var t=e.x.toString()+e.y.toString();return void 0!==v[t]?v[t]:(v[t]=m.length/2,m.push(e.x,e.y),v[t])}var i={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type};if(""!==this.name&&(i.name=this.name),void 0!==this.parameters){var o=this.parameters;for(var a in o)void 0!==o[a]&&(i[a]=o[a]);return i}for(var s=[],u=0;u<this.vertices.length;u++){var c=this.vertices[u];s.push(c.x,c.y,c.z)}for(var l=[],h=[],f={},p=[],d={},m=[],v={},u=0;u<this.faces.length;u++){var g=this.faces[u],y=!1,b=!1,x=void 0!==this.faceVertexUvs[0][u],w=g.normal.length()>0,_=g.vertexNormals.length>0,S=1!==g.color.r||1!==g.color.g||1!==g.color.b,M=g.vertexColors.length>0,E=0;if(E=e(E,0,0),E=e(E,1,y),E=e(E,2,b),E=e(E,3,x),E=e(E,4,w),E=e(E,5,_),E=e(E,6,S),E=e(E,7,M),l.push(E),l.push(g.a,g.b,g.c),x){var T=this.faceVertexUvs[0][u];l.push(n(T[0]),n(T[1]),n(T[2]))}if(w&&l.push(t(g.normal)),_){var C=g.vertexNormals;l.push(t(C[0]),t(C[1]),t(C[2]))}if(S&&l.push(r(g.color)),M){var A=g.vertexColors;l.push(r(A[0]),r(A[1]),r(A[2]))}}return i.data={},i.data.vertices=s,i.data.normals=h,p.length>0&&(i.data.colors=p),m.length>0&&(i.data.uvs=[m]),i.data.faces=l,i},clone:function(){for(var e=new r.Geometry,t=this.vertices,n=0,i=t.length;i>n;n++)e.vertices.push(t[n].clone());for(var o=this.faces,n=0,i=o.length;i>n;n++)e.faces.push(o[n].clone());for(var n=0,i=this.faceVertexUvs.length;i>n;n++){var a=this.faceVertexUvs[n];void 0===e.faceVertexUvs[n]&&(e.faceVertexUvs[n]=[]);for(var s=0,u=a.length;u>s;s++){for(var c=a[s],l=[],h=0,f=c.length;f>h;h++){var p=c[h];l.push(p.clone())}e.faceVertexUvs[n].push(l)}}return e},dispose:function(){this.dispatchEvent({type:"dispose"})}},r.EventDispatcher.prototype.apply(r.Geometry.prototype),r.GeometryIdCount=0,r.Camera=function(){r.Object3D.call(this),this.type="Camera",this.matrixWorldInverse=new r.Matrix4,this.projectionMatrix=new r.Matrix4},r.Camera.prototype=Object.create(r.Object3D.prototype),r.Camera.prototype.constructor=r.Camera,r.Camera.prototype.getWorldDirection=function(){var e=new r.Quaternion;return function(t){var n=t||new r.Vector3;return this.getWorldQuaternion(e),n.set(0,0,-1).applyQuaternion(e)}}(),r.Camera.prototype.lookAt=function(){var e=new r.Matrix4;return function(t){e.lookAt(this.position,t,this.up),this.quaternion.setFromRotationMatrix(e)}}(),r.Camera.prototype.clone=function(e){return void 0===e&&(e=new r.Camera),r.Object3D.prototype.clone.call(this,e),e.matrixWorldInverse.copy(this.matrixWorldInverse),e.projectionMatrix.copy(this.projectionMatrix),e},r.CubeCamera=function(e,t,n){r.Object3D.call(this),this.type="CubeCamera";var i=90,o=1,a=new r.PerspectiveCamera(i,o,e,t);a.up.set(0,-1,0),a.lookAt(new r.Vector3(1,0,0)),this.add(a);var s=new r.PerspectiveCamera(i,o,e,t);s.up.set(0,-1,0),s.lookAt(new r.Vector3(-1,0,0)),this.add(s);var u=new r.PerspectiveCamera(i,o,e,t);u.up.set(0,0,1),u.lookAt(new r.Vector3(0,1,0)),this.add(u);var c=new r.PerspectiveCamera(i,o,e,t);c.up.set(0,0,-1),c.lookAt(new r.Vector3(0,-1,0)),this.add(c);var l=new r.PerspectiveCamera(i,o,e,t);l.up.set(0,-1,0),l.lookAt(new r.Vector3(0,0,1)),this.add(l);var h=new r.PerspectiveCamera(i,o,e,t);h.up.set(0,-1,0),h.lookAt(new r.Vector3(0,0,-1)),this.add(h),this.renderTarget=new r.WebGLRenderTargetCube(n,n,{format:r.RGBFormat,magFilter:r.LinearFilter,minFilter:r.LinearFilter}),this.updateCubeMap=function(e,t){var r=this.renderTarget,n=r.generateMipmaps;r.generateMipmaps=!1,r.activeCubeFace=0,e.render(t,a,r),r.activeCubeFace=1,e.render(t,s,r),r.activeCubeFace=2,e.render(t,u,r),r.activeCubeFace=3,e.render(t,c,r),r.activeCubeFace=4,e.render(t,l,r),r.generateMipmaps=n,r.activeCubeFace=5,e.render(t,h,r)}},r.CubeCamera.prototype=Object.create(r.Object3D.prototype),r.CubeCamera.prototype.constructor=r.CubeCamera,r.OrthographicCamera=function(e,t,n,i,o,a){r.Camera.call(this),this.type="OrthographicCamera",this.zoom=1,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=void 0!==o?o:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()},r.OrthographicCamera.prototype=Object.create(r.Camera.prototype),r.OrthographicCamera.prototype.constructor=r.OrthographicCamera,r.OrthographicCamera.prototype.updateProjectionMatrix=function(){var e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,n=(this.top+this.bottom)/2;this.projectionMatrix.makeOrthographic(r-e,r+e,n+t,n-t,this.near,this.far)},r.OrthographicCamera.prototype.clone=function(){var e=new r.OrthographicCamera;return r.Camera.prototype.clone.call(this,e),e.zoom=this.zoom,e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e.projectionMatrix.copy(this.projectionMatrix),e},r.PerspectiveCamera=function(e,t,n,i){r.Camera.call(this),this.type="PerspectiveCamera",this.zoom=1,this.fov=void 0!==e?e:50,this.aspect=void 0!==t?t:1,this.near=void 0!==n?n:.1,this.far=void 0!==i?i:2e3,this.updateProjectionMatrix()},r.PerspectiveCamera.prototype=Object.create(r.Camera.prototype),r.PerspectiveCamera.prototype.constructor=r.PerspectiveCamera,r.PerspectiveCamera.prototype.setLens=function(e,t){void 0===t&&(t=24),this.fov=2*r.Math.radToDeg(Math.atan(t/(2*e))),this.updateProjectionMatrix()},r.PerspectiveCamera.prototype.setViewOffset=function(e,t,r,n,i,o){this.fullWidth=e,this.fullHeight=t,this.x=r,this.y=n,this.width=i,this.height=o,this.updateProjectionMatrix()},r.PerspectiveCamera.prototype.updateProjectionMatrix=function(){var e=r.Math.radToDeg(2*Math.atan(Math.tan(.5*r.Math.degToRad(this.fov))/this.zoom));if(this.fullWidth){var t=this.fullWidth/this.fullHeight,n=Math.tan(r.Math.degToRad(.5*e))*this.near,i=-n,o=t*i,a=t*n,s=Math.abs(a-o),u=Math.abs(n-i);this.projectionMatrix.makeFrustum(o+this.x*s/this.fullWidth,o+(this.x+this.width)*s/this.fullWidth,n-(this.y+this.height)*u/this.fullHeight,n-this.y*u/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(e,this.aspect,this.near,this.far)},r.PerspectiveCamera.prototype.clone=function(){var e=new r.PerspectiveCamera;return r.Camera.prototype.clone.call(this,e),e.zoom=this.zoom,e.fov=this.fov,e.aspect=this.aspect,e.near=this.near,e.far=this.far,e.projectionMatrix.copy(this.projectionMatrix),e},r.Light=function(e){r.Object3D.call(this),this.type="Light",this.color=new r.Color(e)},r.Light.prototype=Object.create(r.Object3D.prototype),r.Light.prototype.constructor=r.Light,r.Light.prototype.clone=function(e){return void 0===e&&(e=new r.Light),r.Object3D.prototype.clone.call(this,e),e.color.copy(this.color),e},r.AmbientLight=function(e){r.Light.call(this,e),this.type="AmbientLight"},r.AmbientLight.prototype=Object.create(r.Light.prototype),r.AmbientLight.prototype.constructor=r.AmbientLight,r.AmbientLight.prototype.clone=function(){var e=new r.AmbientLight;return r.Light.prototype.clone.call(this,e),e},r.AreaLight=function(e,t){r.Light.call(this,e),this.type="AreaLight",this.normal=new r.Vector3(0,-1,0),this.right=new r.Vector3(1,0,0),this.intensity=void 0!==t?t:1,this.width=1,this.height=1,this.constantAttenuation=1.5,this.linearAttenuation=.5,this.quadraticAttenuation=.1},r.AreaLight.prototype=Object.create(r.Light.prototype),r.AreaLight.prototype.constructor=r.AreaLight,r.DirectionalLight=function(e,t){r.Light.call(this,e),this.type="DirectionalLight",this.position.set(0,1,0),this.target=new r.Object3D,this.intensity=void 0!==t?t:1,this.castShadow=!1,this.onlyShadow=!1,this.shadowCameraNear=50,this.shadowCameraFar=5e3,this.shadowCameraLeft=-500,this.shadowCameraRight=500,this.shadowCameraTop=500,this.shadowCameraBottom=-500,this.shadowCameraVisible=!1,this.shadowBias=0,this.shadowDarkness=.5,this.shadowMapWidth=512,this.shadowMapHeight=512,this.shadowCascade=!1,this.shadowCascadeOffset=new r.Vector3(0,0,-1e3),this.shadowCascadeCount=2,this.shadowCascadeBias=[0,0,0],this.shadowCascadeWidth=[512,512,512],this.shadowCascadeHeight=[512,512,512],this.shadowCascadeNearZ=[-1,.99,.998],this.shadowCascadeFarZ=[.99,.998,1],this.shadowCascadeArray=[],this.shadowMap=null,this.shadowMapSize=null,this.shadowCamera=null,this.shadowMatrix=null},r.DirectionalLight.prototype=Object.create(r.Light.prototype),r.DirectionalLight.prototype.constructor=r.DirectionalLight,r.DirectionalLight.prototype.clone=function(){var e=new r.DirectionalLight;return r.Light.prototype.clone.call(this,e),e.target=this.target.clone(),e.intensity=this.intensity,e.castShadow=this.castShadow,e.onlyShadow=this.onlyShadow,e.shadowCameraNear=this.shadowCameraNear,e.shadowCameraFar=this.shadowCameraFar,e.shadowCameraLeft=this.shadowCameraLeft,e.shadowCameraRight=this.shadowCameraRight,e.shadowCameraTop=this.shadowCameraTop,e.shadowCameraBottom=this.shadowCameraBottom,e.shadowCameraVisible=this.shadowCameraVisible,e.shadowBias=this.shadowBias,e.shadowDarkness=this.shadowDarkness,e.shadowMapWidth=this.shadowMapWidth,e.shadowMapHeight=this.shadowMapHeight,e.shadowCascade=this.shadowCascade,e.shadowCascadeOffset.copy(this.shadowCascadeOffset),e.shadowCascadeCount=this.shadowCascadeCount,e.shadowCascadeBias=this.shadowCascadeBias.slice(0),e.shadowCascadeWidth=this.shadowCascadeWidth.slice(0),e.shadowCascadeHeight=this.shadowCascadeHeight.slice(0),e.shadowCascadeNearZ=this.shadowCascadeNearZ.slice(0),e.shadowCascadeFarZ=this.shadowCascadeFarZ.slice(0),e},r.HemisphereLight=function(e,t,n){r.Light.call(this,e),this.type="HemisphereLight",this.position.set(0,100,0),this.groundColor=new r.Color(t),this.intensity=void 0!==n?n:1},r.HemisphereLight.prototype=Object.create(r.Light.prototype),r.HemisphereLight.prototype.constructor=r.HemisphereLight,r.HemisphereLight.prototype.clone=function(){var e=new r.HemisphereLight;return r.Light.prototype.clone.call(this,e),e.groundColor.copy(this.groundColor),e.intensity=this.intensity,e},r.PointLight=function(e,t,n){r.Light.call(this,e),this.type="PointLight",this.intensity=void 0!==t?t:1,this.distance=void 0!==n?n:0},r.PointLight.prototype=Object.create(r.Light.prototype),r.PointLight.prototype.constructor=r.PointLight,r.PointLight.prototype.clone=function(){var e=new r.PointLight;return r.Light.prototype.clone.call(this,e),e.intensity=this.intensity,e.distance=this.distance,e},r.SpotLight=function(e,t,n,i,o){r.Light.call(this,e),this.type="SpotLight",this.position.set(0,1,0),this.target=new r.Object3D,this.intensity=void 0!==t?t:1,this.distance=void 0!==n?n:0,this.angle=void 0!==i?i:Math.PI/3,this.exponent=void 0!==o?o:10,this.castShadow=!1,this.onlyShadow=!1,this.shadowCameraNear=50,this.shadowCameraFar=5e3,this.shadowCameraFov=50,this.shadowCameraVisible=!1,this.shadowBias=0,this.shadowDarkness=.5,this.shadowMapWidth=512,this.shadowMapHeight=512,this.shadowMap=null,this.shadowMapSize=null,this.shadowCamera=null,this.shadowMatrix=null},r.SpotLight.prototype=Object.create(r.Light.prototype),r.SpotLight.prototype.constructor=r.SpotLight,r.SpotLight.prototype.clone=function(){var e=new r.SpotLight;return r.Light.prototype.clone.call(this,e),e.target=this.target.clone(),e.intensity=this.intensity,e.distance=this.distance,e.angle=this.angle,e.exponent=this.exponent,e.castShadow=this.castShadow,e.onlyShadow=this.onlyShadow,e.shadowCameraNear=this.shadowCameraNear,e.shadowCameraFar=this.shadowCameraFar,e.shadowCameraFov=this.shadowCameraFov,e.shadowCameraVisible=this.shadowCameraVisible,e.shadowBias=this.shadowBias,e.shadowDarkness=this.shadowDarkness,e.shadowMapWidth=this.shadowMapWidth,e.shadowMapHeight=this.shadowMapHeight,e},r.Cache=function(){this.files={}},r.Cache.prototype={constructor:r.Cache,add:function(e,t){this.files[e]=t},get:function(e){return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},r.Loader=function(e){this.showStatus=e,this.statusDomElement=e?r.Loader.prototype.addStatusElement():null,this.imageLoader=new r.ImageLoader,this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}},r.Loader.prototype={constructor:r.Loader,crossOrigin:void 0,addStatusElement:function(){var e=document.createElement("div");return e.style.position="absolute",e.style.right="0px",e.style.top="0px",e.style.fontSize="0.8em",e.style.textAlign="left",e.style.background="rgba(0,0,0,0.25)",e.style.color="#fff",e.style.width="120px",e.style.padding="0.5em 0.5em 0.5em 0.5em",e.style.zIndex=1e3,e.innerHTML="Loading ...",e},updateProgress:function(e){var t="Loaded ";t+=e.total?(100*e.loaded/e.total).toFixed(0)+"%":(e.loaded/1024).toFixed(2)+" KB",this.statusDomElement.innerHTML=t},extractUrlBase:function(e){var t=e.split("/");return 1===t.length?"./":(t.pop(),t.join("/")+"/")},initMaterials:function(e,t){for(var r=[],n=0;n<e.length;++n)r[n]=this.createMaterial(e[n],t);return r},needsTangents:function(e){for(var t=0,n=e.length;n>t;t++){var i=e[t];if(i instanceof r.ShaderMaterial)return!0}return!1},createMaterial:function(e,t){function n(e){var t=Math.log(e)/Math.LN2;return Math.pow(2,Math.round(t))}function i(e,i,o,s,u,c,l){var h,f=t+o,p=r.Loader.Handlers.get(f);if(null!==p?h=p.load(f):(h=new r.Texture,p=a.imageLoader,p.crossOrigin=a.crossOrigin,p.load(f,function(e){if(r.Math.isPowerOfTwo(e.width)===!1||r.Math.isPowerOfTwo(e.height)===!1){var t=n(e.width),i=n(e.height),o=document.createElement("canvas");o.width=t,o.height=i;var a=o.getContext("2d");a.drawImage(e,0,0,t,i),h.image=o}else h.image=e;h.needsUpdate=!0})),h.sourceFile=o,s&&(h.repeat.set(s[0],s[1]),1!==s[0]&&(h.wrapS=r.RepeatWrapping),1!==s[1]&&(h.wrapT=r.RepeatWrapping)),u&&h.offset.set(u[0],u[1]),c){var d={repeat:r.RepeatWrapping,mirror:r.MirroredRepeatWrapping};void 0!==d[c[0]]&&(h.wrapS=d[c[0]]),void 0!==d[c[1]]&&(h.wrapT=d[c[1]])}l&&(h.anisotropy=l),e[i]=h}function o(e){return(255*e[0]<<16)+(255*e[1]<<8)+255*e[2]}var a=this,s="MeshLambertMaterial",u={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(e.shading){var c=e.shading.toLowerCase();"phong"===c?s="MeshPhongMaterial":"basic"===c&&(s="MeshBasicMaterial")}void 0!==e.blending&&void 0!==r[e.blending]&&(u.blending=r[e.blending]),(void 0!==e.transparent||e.opacity<1)&&(u.transparent=e.transparent),void 0!==e.depthTest&&(u.depthTest=e.depthTest),void 0!==e.depthWrite&&(u.depthWrite=e.depthWrite),void 0!==e.visible&&(u.visible=e.visible),void 0!==e.flipSided&&(u.side=r.BackSide),void 0!==e.doubleSided&&(u.side=r.DoubleSide),void 0!==e.wireframe&&(u.wireframe=e.wireframe),void 0!==e.vertexColors&&("face"===e.vertexColors?u.vertexColors=r.FaceColors:e.vertexColors&&(u.vertexColors=r.VertexColors)),e.colorDiffuse?u.color=o(e.colorDiffuse):e.DbgColor&&(u.color=e.DbgColor),e.colorSpecular&&(u.specular=o(e.colorSpecular)),e.colorAmbient&&(u.ambient=o(e.colorAmbient)),e.colorEmissive&&(u.emissive=o(e.colorEmissive)),e.transparency&&(u.opacity=e.transparency),e.specularCoef&&(u.shininess=e.specularCoef),e.mapDiffuse&&t&&i(u,"map",e.mapDiffuse,e.mapDiffuseRepeat,e.mapDiffuseOffset,e.mapDiffuseWrap,e.mapDiffuseAnisotropy),e.mapLight&&t&&i(u,"lightMap",e.mapLight,e.mapLightRepeat,e.mapLightOffset,e.mapLightWrap,e.mapLightAnisotropy),e.mapBump&&t&&i(u,"bumpMap",e.mapBump,e.mapBumpRepeat,e.mapBumpOffset,e.mapBumpWrap,e.mapBumpAnisotropy),e.mapNormal&&t&&i(u,"normalMap",e.mapNormal,e.mapNormalRepeat,e.mapNormalOffset,e.mapNormalWrap,e.mapNormalAnisotropy),e.mapSpecular&&t&&i(u,"specularMap",e.mapSpecular,e.mapSpecularRepeat,e.mapSpecularOffset,e.mapSpecularWrap,e.mapSpecularAnisotropy),e.mapAlpha&&t&&i(u,"alphaMap",e.mapAlpha,e.mapAlphaRepeat,e.mapAlphaOffset,e.mapAlphaWrap,e.mapAlphaAnisotropy),e.mapBumpScale&&(u.bumpScale=e.mapBumpScale),e.mapNormalFactor&&(u.normalScale=new r.Vector2(e.mapNormalFactor,e.mapNormalFactor));var l=new r[s](u);return void 0!==e.DbgName&&(l.name=e.DbgName),l}},r.Loader.Handlers={handlers:[],add:function(e,t){this.handlers.push(e,t)},get:function(e){for(var t=0,r=this.handlers.length;r>t;t+=2){var n=this.handlers[t],i=this.handlers[t+1];if(n.test(e))return i}return null}},r.XHRLoader=function(e){this.cache=new r.Cache,this.manager=void 0!==e?e:r.DefaultLoadingManager},r.XHRLoader.prototype={constructor:r.XHRLoader,load:function(e,t,r,n){var i=this,o=i.cache.get(e);if(void 0!==o)return void(t&&t(o));var a=new XMLHttpRequest;a.open("GET",e,!0),a.addEventListener("load",function(){i.cache.add(e,this.response),t&&t(this.response),i.manager.itemEnd(e)},!1),void 0!==r&&a.addEventListener("progress",function(e){r(e)},!1),void 0!==n&&a.addEventListener("error",function(e){n(e)},!1),void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),void 0!==this.responseType&&(a.responseType=this.responseType),a.send(null),i.manager.itemStart(e)},setResponseType:function(e){this.responseType=e},setCrossOrigin:function(e){this.crossOrigin=e}},r.ImageLoader=function(e){this.cache=new r.Cache,this.manager=void 0!==e?e:r.DefaultLoadingManager},r.ImageLoader.prototype={constructor:r.ImageLoader,load:function(e,t,r,n){var i=this,o=i.cache.get(e);if(void 0!==o)return void t(o);var a=document.createElement("img");return void 0!==t&&a.addEventListener("load",function(){i.cache.add(e,this),t(this),i.manager.itemEnd(e)},!1),void 0!==r&&a.addEventListener("progress",function(e){r(e)},!1),void 0!==n&&a.addEventListener("error",function(e){n(e)},!1),void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),a.src=e,i.manager.itemStart(e),a},setCrossOrigin:function(e){this.crossOrigin=e}},r.JSONLoader=function(e){r.Loader.call(this,e),this.withCredentials=!1},r.JSONLoader.prototype=Object.create(r.Loader.prototype),r.JSONLoader.prototype.constructor=r.JSONLoader,r.JSONLoader.prototype.load=function(e,t,r){r=r&&"string"==typeof r?r:this.extractUrlBase(e),this.onLoadStart(),this.loadAjaxJSON(this,e,t,r)},r.JSONLoader.prototype.loadAjaxJSON=function(e,t,r,n,i){var o=new XMLHttpRequest,a=0;o.onreadystatechange=function(){if(o.readyState===o.DONE)if(200===o.status||0===o.status){if(o.responseText){var s=JSON.parse(o.responseText);if(void 0!==s.metadata&&"scene"===s.metadata.type)return void console.error('THREE.JSONLoader: "'+t+'" seems to be a Scene. Use THREE.SceneLoader instead.');var u=e.parse(s,n);r(u.geometry,u.materials)}else console.error('THREE.JSONLoader: "'+t+'" seems to be unreachable or the file is empty.');e.onLoadComplete()}else console.error("THREE.JSONLoader: Couldn't load \""+t+'" ('+o.status+")");else o.readyState===o.LOADING?i&&(0===a&&(a=o.getResponseHeader("Content-Length")),i({total:a,loaded:o.responseText.length})):o.readyState===o.HEADERS_RECEIVED&&void 0!==i&&(a=o.getResponseHeader("Content-Length"))},o.open("GET",t,!0),o.withCredentials=this.withCredentials,o.send(null)},r.JSONLoader.prototype.parse=function(e,t){function n(t){function n(e,t){return e&1<<t}var i,o,s,u,c,l,h,f,p,d,m,v,g,y,b,x,w,_,S,M,E,T,C,A,$,k,P,R=e.faces,O=e.vertices,L=e.normals,F=e.colors,j=0;if(void 0!==e.uvs){for(i=0;i<e.uvs.length;i++)e.uvs[i].length&&j++;for(i=0;j>i;i++)a.faceVertexUvs[i]=[]}for(u=0,c=O.length;c>u;)_=new r.Vector3,_.x=O[u++]*t,_.y=O[u++]*t,_.z=O[u++]*t,a.vertices.push(_);for(u=0,c=R.length;c>u;)if(d=R[u++],m=n(d,0),v=n(d,1),g=n(d,3),y=n(d,4),b=n(d,5),x=n(d,6),w=n(d,7),m){if(M=new r.Face3,M.a=R[u],M.b=R[u+1],M.c=R[u+3],E=new r.Face3,E.a=R[u+1],E.b=R[u+2],E.c=R[u+3],u+=4,v&&(p=R[u++],M.materialIndex=p,E.materialIndex=p),s=a.faces.length,g)for(i=0;j>i;i++)for(A=e.uvs[i],a.faceVertexUvs[i][s]=[],a.faceVertexUvs[i][s+1]=[],o=0;4>o;o++)f=R[u++],k=A[2*f],P=A[2*f+1],$=new r.Vector2(k,P),2!==o&&a.faceVertexUvs[i][s].push($),0!==o&&a.faceVertexUvs[i][s+1].push($);if(y&&(h=3*R[u++],M.normal.set(L[h++],L[h++],L[h]),E.normal.copy(M.normal)),b)for(i=0;4>i;i++)h=3*R[u++],C=new r.Vector3(L[h++],L[h++],L[h]),2!==i&&M.vertexNormals.push(C),0!==i&&E.vertexNormals.push(C);
if(x&&(l=R[u++],T=F[l],M.color.setHex(T),E.color.setHex(T)),w)for(i=0;4>i;i++)l=R[u++],T=F[l],2!==i&&M.vertexColors.push(new r.Color(T)),0!==i&&E.vertexColors.push(new r.Color(T));a.faces.push(M),a.faces.push(E)}else{if(S=new r.Face3,S.a=R[u++],S.b=R[u++],S.c=R[u++],v&&(p=R[u++],S.materialIndex=p),s=a.faces.length,g)for(i=0;j>i;i++)for(A=e.uvs[i],a.faceVertexUvs[i][s]=[],o=0;3>o;o++)f=R[u++],k=A[2*f],P=A[2*f+1],$=new r.Vector2(k,P),a.faceVertexUvs[i][s].push($);if(y&&(h=3*R[u++],S.normal.set(L[h++],L[h++],L[h])),b)for(i=0;3>i;i++)h=3*R[u++],C=new r.Vector3(L[h++],L[h++],L[h]),S.vertexNormals.push(C);if(x&&(l=R[u++],S.color.setHex(F[l])),w)for(i=0;3>i;i++)l=R[u++],S.vertexColors.push(new r.Color(F[l]));a.faces.push(S)}}function i(){var t=void 0!==e.influencesPerVertex?e.influencesPerVertex:2;if(e.skinWeights)for(var n=0,i=e.skinWeights.length;i>n;n+=t){var o=e.skinWeights[n],s=t>1?e.skinWeights[n+1]:0,u=t>2?e.skinWeights[n+2]:0,c=t>3?e.skinWeights[n+3]:0;a.skinWeights.push(new r.Vector4(o,s,u,c))}if(e.skinIndices)for(var n=0,i=e.skinIndices.length;i>n;n+=t){var l=e.skinIndices[n],h=t>1?e.skinIndices[n+1]:0,f=t>2?e.skinIndices[n+2]:0,p=t>3?e.skinIndices[n+3]:0;a.skinIndices.push(new r.Vector4(l,h,f,p))}a.bones=e.bones,a.bones&&a.bones.length>0&&(a.skinWeights.length!==a.skinIndices.length||a.skinIndices.length!==a.vertices.length)&&console.warn("When skinning, number of vertices ("+a.vertices.length+"), skinIndices ("+a.skinIndices.length+"), and skinWeights ("+a.skinWeights.length+") should match."),a.animation=e.animation,a.animations=e.animations}function o(t){if(void 0!==e.morphTargets){var n,i,o,s,u,c;for(n=0,i=e.morphTargets.length;i>n;n++)for(a.morphTargets[n]={},a.morphTargets[n].name=e.morphTargets[n].name,a.morphTargets[n].vertices=[],u=a.morphTargets[n].vertices,c=e.morphTargets[n].vertices,o=0,s=c.length;s>o;o+=3){var l=new r.Vector3;l.x=c[o]*t,l.y=c[o+1]*t,l.z=c[o+2]*t,u.push(l)}}if(void 0!==e.morphColors){var n,i,h,f,p,d,m;for(n=0,i=e.morphColors.length;i>n;n++)for(a.morphColors[n]={},a.morphColors[n].name=e.morphColors[n].name,a.morphColors[n].colors=[],p=a.morphColors[n].colors,d=e.morphColors[n].colors,h=0,f=d.length;f>h;h+=3)m=new r.Color(16755200),m.setRGB(d[h],d[h+1],d[h+2]),p.push(m)}}var a=new r.Geometry,s=void 0!==e.scale?1/e.scale:1;if(n(s),i(),o(s),a.computeFaceNormals(),a.computeBoundingSphere(),void 0===e.materials||0===e.materials.length)return{geometry:a};var u=this.initMaterials(e.materials,t);return this.needsTangents(u)&&a.computeTangents(),{geometry:a,materials:u}},r.LoadingManager=function(e,t,r){var n=this,i=0,o=0;this.onLoad=e,this.onProgress=t,this.onError=r,this.itemStart=function(){o++},this.itemEnd=function(e){i++,void 0!==n.onProgress&&n.onProgress(e,i,o),i===o&&void 0!==n.onLoad&&n.onLoad()}},r.DefaultLoadingManager=new r.LoadingManager,r.BufferGeometryLoader=function(e){this.manager=void 0!==e?e:r.DefaultLoadingManager},r.BufferGeometryLoader.prototype={constructor:r.BufferGeometryLoader,load:function(e,t,n,i){var o=this,a=new r.XHRLoader(o.manager);a.setCrossOrigin(this.crossOrigin),a.load(e,function(e){t(o.parse(JSON.parse(e)))},n,i)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e){var t=new r.BufferGeometry,n=e.attributes;for(var i in n){var o=n[i],a=new self[o.type](o.array);t.addAttribute(i,new r.BufferAttribute(a,o.itemSize))}var s=e.offsets;void 0!==s&&(t.offsets=JSON.parse(JSON.stringify(s)));var u=e.boundingSphere;if(void 0!==u){var c=new r.Vector3;void 0!==u.center&&c.fromArray(u.center),t.boundingSphere=new r.Sphere(c,u.radius)}return t}},r.MaterialLoader=function(e){this.manager=void 0!==e?e:r.DefaultLoadingManager},r.MaterialLoader.prototype={constructor:r.MaterialLoader,load:function(e,t,n,i){var o=this,a=new r.XHRLoader(o.manager);a.setCrossOrigin(this.crossOrigin),a.load(e,function(e){t(o.parse(JSON.parse(e)))},n,i)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e){var t=new r[e.type];if(void 0!==e.color&&t.color.setHex(e.color),void 0!==e.ambient&&t.ambient.setHex(e.ambient),void 0!==e.emissive&&t.emissive.setHex(e.emissive),void 0!==e.specular&&t.specular.setHex(e.specular),void 0!==e.shininess&&(t.shininess=e.shininess),void 0!==e.uniforms&&(t.uniforms=e.uniforms),void 0!==e.vertexShader&&(t.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(t.fragmentShader=e.fragmentShader),void 0!==e.vertexColors&&(t.vertexColors=e.vertexColors),void 0!==e.shading&&(t.shading=e.shading),void 0!==e.blending&&(t.blending=e.blending),void 0!==e.side&&(t.side=e.side),void 0!==e.opacity&&(t.opacity=e.opacity),void 0!==e.transparent&&(t.transparent=e.transparent),void 0!==e.wireframe&&(t.wireframe=e.wireframe),void 0!==e.materials)for(var n=0,i=e.materials.length;i>n;n++)t.materials.push(this.parse(e.materials[n]));return t}},r.ObjectLoader=function(e){this.manager=void 0!==e?e:r.DefaultLoadingManager},r.ObjectLoader.prototype={constructor:r.ObjectLoader,load:function(e,t,n,i){var o=this,a=new r.XHRLoader(o.manager);a.setCrossOrigin(this.crossOrigin),a.load(e,function(e){t(o.parse(JSON.parse(e)))},n,i)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e){var t=this.parseGeometries(e.geometries),r=this.parseMaterials(e.materials),n=this.parseObject(e.object,t,r);return n},parseGeometries:function(e){var t={};if(void 0!==e)for(var n=new r.JSONLoader,i=new r.BufferGeometryLoader,o=0,a=e.length;a>o;o++){var s,u=e[o];switch(u.type){case"PlaneGeometry":s=new r.PlaneGeometry(u.width,u.height,u.widthSegments,u.heightSegments);break;case"BoxGeometry":case"CubeGeometry":s=new r.BoxGeometry(u.width,u.height,u.depth,u.widthSegments,u.heightSegments,u.depthSegments);break;case"CircleGeometry":s=new r.CircleGeometry(u.radius,u.segments);break;case"CylinderGeometry":s=new r.CylinderGeometry(u.radiusTop,u.radiusBottom,u.height,u.radialSegments,u.heightSegments,u.openEnded);break;case"SphereGeometry":s=new r.SphereGeometry(u.radius,u.widthSegments,u.heightSegments,u.phiStart,u.phiLength,u.thetaStart,u.thetaLength);break;case"IcosahedronGeometry":s=new r.IcosahedronGeometry(u.radius,u.detail);break;case"TorusGeometry":s=new r.TorusGeometry(u.radius,u.tube,u.radialSegments,u.tubularSegments,u.arc);break;case"TorusKnotGeometry":s=new r.TorusKnotGeometry(u.radius,u.tube,u.radialSegments,u.tubularSegments,u.p,u.q,u.heightScale);break;case"BufferGeometry":s=i.parse(u.data);break;case"Geometry":s=n.parse(u.data).geometry}s.uuid=u.uuid,void 0!==u.name&&(s.name=u.name),t[u.uuid]=s}return t},parseMaterials:function(e){var t={};if(void 0!==e)for(var n=new r.MaterialLoader,i=0,o=e.length;o>i;i++){var a=e[i],s=n.parse(a);s.uuid=a.uuid,void 0!==a.name&&(s.name=a.name),t[a.uuid]=s}return t},parseObject:function(){var e=new r.Matrix4;return function(t,n,i){var o;switch(t.type){case"Scene":o=new r.Scene;break;case"PerspectiveCamera":o=new r.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);break;case"OrthographicCamera":o=new r.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);break;case"AmbientLight":o=new r.AmbientLight(t.color);break;case"DirectionalLight":o=new r.DirectionalLight(t.color,t.intensity);break;case"PointLight":o=new r.PointLight(t.color,t.intensity,t.distance);break;case"SpotLight":o=new r.SpotLight(t.color,t.intensity,t.distance,t.angle,t.exponent);break;case"HemisphereLight":o=new r.HemisphereLight(t.color,t.groundColor,t.intensity);break;case"Mesh":var a=n[t.geometry],s=i[t.material];void 0===a&&console.warn("THREE.ObjectLoader: Undefined geometry",t.geometry),void 0===s&&console.warn("THREE.ObjectLoader: Undefined material",t.material),o=new r.Mesh(a,s);break;case"Line":var a=n[t.geometry],s=i[t.material];void 0===a&&console.warn("THREE.ObjectLoader: Undefined geometry",t.geometry),void 0===s&&console.warn("THREE.ObjectLoader: Undefined material",t.material),o=new r.Line(a,s);break;case"Sprite":var s=i[t.material];void 0===s&&console.warn("THREE.ObjectLoader: Undefined material",t.material),o=new r.Sprite(s);break;case"Group":o=new r.Group;break;default:o=new r.Object3D}if(o.uuid=t.uuid,void 0!==t.name&&(o.name=t.name),void 0!==t.matrix?(e.fromArray(t.matrix),e.decompose(o.position,o.quaternion,o.scale)):(void 0!==t.position&&o.position.fromArray(t.position),void 0!==t.rotation&&o.rotation.fromArray(t.rotation),void 0!==t.scale&&o.scale.fromArray(t.scale)),void 0!==t.visible&&(o.visible=t.visible),void 0!==t.userData&&(o.userData=t.userData),void 0!==t.children)for(var u in t.children)o.add(this.parseObject(t.children[u],n,i));return o}}()},r.TextureLoader=function(e){this.manager=void 0!==e?e:r.DefaultLoadingManager},r.TextureLoader.prototype={constructor:r.TextureLoader,load:function(e,t,n,i){var o=this,a=new r.ImageLoader(o.manager);a.setCrossOrigin(this.crossOrigin),a.load(e,function(e){var n=new r.Texture(e);n.needsUpdate=!0,void 0!==t&&t(n)},n,i)},setCrossOrigin:function(e){this.crossOrigin=e}},r.DataTextureLoader=r.BinaryTextureLoader=function(){this._parser=null},r.BinaryTextureLoader.prototype={constructor:r.BinaryTextureLoader,load:function(e,t,n,i){var o=this,a=new r.DataTexture,s=new r.XHRLoader;return s.setResponseType("arraybuffer"),s.load(e,function(e){var n=o._parser(e);n&&(void 0!==n.image?a.image=n.image:void 0!==n.data&&(a.image.width=n.width,a.image.height=n.height,a.image.data=n.data),a.wrapS=void 0!==n.wrapS?n.wrapS:r.ClampToEdgeWrapping,a.wrapT=void 0!==n.wrapT?n.wrapT:r.ClampToEdgeWrapping,a.magFilter=void 0!==n.magFilter?n.magFilter:r.LinearFilter,a.minFilter=void 0!==n.minFilter?n.minFilter:r.LinearMipMapLinearFilter,a.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(a.format=n.format),void 0!==n.type&&(a.type=n.type),void 0!==n.mipmaps&&(a.mipmaps=n.mipmaps),1===n.mipmapCount&&(a.minFilter=r.LinearFilter),a.needsUpdate=!0,t&&t(a,n))},n,i),a}},r.CompressedTextureLoader=function(){this._parser=null},r.CompressedTextureLoader.prototype={constructor:r.CompressedTextureLoader,load:function(e,t){var n=this,i=[],o=new r.CompressedTexture;o.image=i;var a=new r.XHRLoader;if(a.setResponseType("arraybuffer"),e instanceof Array)for(var s=0,u=function(u){a.load(e[u],function(e){var a=n._parser(e,!0);i[u]={width:a.width,height:a.height,format:a.format,mipmaps:a.mipmaps},s+=1,6===s&&(1==a.mipmapCount&&(o.minFilter=r.LinearFilter),o.format=a.format,o.needsUpdate=!0,t&&t(o))})},c=0,l=e.length;l>c;++c)u(c);else a.load(e,function(e){var a=n._parser(e,!0);if(a.isCubemap)for(var s=a.mipmaps.length/a.mipmapCount,u=0;s>u;u++){i[u]={mipmaps:[]};for(var c=0;c<a.mipmapCount;c++)i[u].mipmaps.push(a.mipmaps[u*a.mipmapCount+c]),i[u].format=a.format,i[u].width=a.width,i[u].height=a.height}else o.image.width=a.width,o.image.height=a.height,o.mipmaps=a.mipmaps;1===a.mipmapCount&&(o.minFilter=r.LinearFilter),o.format=a.format,o.needsUpdate=!0,t&&t(o)});return o}},r.Material=function(){Object.defineProperty(this,"id",{value:r.MaterialIdCount++}),this.uuid=r.Math.generateUUID(),this.name="",this.type="Material",this.side=r.FrontSide,this.opacity=1,this.transparent=!1,this.blending=r.NormalBlending,this.blendSrc=r.SrcAlphaFactor,this.blendDst=r.OneMinusSrcAlphaFactor,this.blendEquation=r.AddEquation,this.depthTest=!0,this.depthWrite=!0,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.alphaTest=0,this.overdraw=0,this.visible=!0,this.needsUpdate=!0},r.Material.prototype={constructor:r.Material,setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0!==n){if(t in this){var i=this[t];i instanceof r.Color?i.set(n):i instanceof r.Vector3&&n instanceof r.Vector3?i.copy(n):this[t]="overdraw"==t?Number(n):n}}else console.warn("THREE.Material: '"+t+"' parameter is undefined.")}},toJSON:function(){var e={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type};return""!==this.name&&(e.name=this.name),this instanceof r.MeshBasicMaterial?(e.color=this.color.getHex(),this.vertexColors!==r.NoColors&&(e.vertexColors=this.vertexColors),this.blending!==r.NormalBlending&&(e.blending=this.blending),this.side!==r.FrontSide&&(e.side=this.side)):this instanceof r.MeshLambertMaterial?(e.color=this.color.getHex(),e.ambient=this.ambient.getHex(),e.emissive=this.emissive.getHex(),this.vertexColors!==r.NoColors&&(e.vertexColors=this.vertexColors),this.blending!==r.NormalBlending&&(e.blending=this.blending),this.side!==r.FrontSide&&(e.side=this.side)):this instanceof r.MeshPhongMaterial?(e.color=this.color.getHex(),e.ambient=this.ambient.getHex(),e.emissive=this.emissive.getHex(),e.specular=this.specular.getHex(),e.shininess=this.shininess,this.vertexColors!==r.NoColors&&(e.vertexColors=this.vertexColors),this.blending!==r.NormalBlending&&(e.blending=this.blending),this.side!==r.FrontSide&&(e.side=this.side)):this instanceof r.MeshNormalMaterial?(this.shading!==r.FlatShading&&(e.shading=this.shading),this.blending!==r.NormalBlending&&(e.blending=this.blending),this.side!==r.FrontSide&&(e.side=this.side)):this instanceof r.MeshDepthMaterial?(this.blending!==r.NormalBlending&&(e.blending=this.blending),this.side!==r.FrontSide&&(e.side=this.side)):this instanceof r.ShaderMaterial?(e.uniforms=this.uniforms,e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader):this instanceof r.SpriteMaterial&&(e.color=this.color.getHex()),this.opacity<1&&(e.opacity=this.opacity),this.transparent!==!1&&(e.transparent=this.transparent),this.wireframe!==!1&&(e.wireframe=this.wireframe),e},clone:function(e){return void 0===e&&(e=new r.Material),e.name=this.name,e.side=this.side,e.opacity=this.opacity,e.transparent=this.transparent,e.blending=this.blending,e.blendSrc=this.blendSrc,e.blendDst=this.blendDst,e.blendEquation=this.blendEquation,e.depthTest=this.depthTest,e.depthWrite=this.depthWrite,e.polygonOffset=this.polygonOffset,e.polygonOffsetFactor=this.polygonOffsetFactor,e.polygonOffsetUnits=this.polygonOffsetUnits,e.alphaTest=this.alphaTest,e.overdraw=this.overdraw,e.visible=this.visible,e},dispose:function(){this.dispatchEvent({type:"dispose"})}},r.EventDispatcher.prototype.apply(r.Material.prototype),r.MaterialIdCount=0,r.LineBasicMaterial=function(e){r.Material.call(this),this.type="LineBasicMaterial",this.color=new r.Color(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.vertexColors=r.NoColors,this.fog=!0,this.setValues(e)},r.LineBasicMaterial.prototype=Object.create(r.Material.prototype),r.LineBasicMaterial.prototype.constructor=r.LineBasicMaterial,r.LineBasicMaterial.prototype.clone=function(){var e=new r.LineBasicMaterial;return r.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.linewidth=this.linewidth,e.linecap=this.linecap,e.linejoin=this.linejoin,e.vertexColors=this.vertexColors,e.fog=this.fog,e},r.LineDashedMaterial=function(e){r.Material.call(this),this.type="LineDashedMaterial",this.color=new r.Color(16777215),this.linewidth=1,this.scale=1,this.dashSize=3,this.gapSize=1,this.vertexColors=!1,this.fog=!0,this.setValues(e)},r.LineDashedMaterial.prototype=Object.create(r.Material.prototype),r.LineDashedMaterial.prototype.constructor=r.LineDashedMaterial,r.LineDashedMaterial.prototype.clone=function(){var e=new r.LineDashedMaterial;return r.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.linewidth=this.linewidth,e.scale=this.scale,e.dashSize=this.dashSize,e.gapSize=this.gapSize,e.vertexColors=this.vertexColors,e.fog=this.fog,e},r.MeshBasicMaterial=function(e){r.Material.call(this),this.type="MeshBasicMaterial",this.color=new r.Color(16777215),this.map=null,this.lightMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=r.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=r.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=r.NoColors,this.skinning=!1,this.morphTargets=!1,this.setValues(e)},r.MeshBasicMaterial.prototype=Object.create(r.Material.prototype),r.MeshBasicMaterial.prototype.constructor=r.MeshBasicMaterial,r.MeshBasicMaterial.prototype.clone=function(){var e=new r.MeshBasicMaterial;return r.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.map=this.map,e.lightMap=this.lightMap,e.specularMap=this.specularMap,e.alphaMap=this.alphaMap,e.envMap=this.envMap,e.combine=this.combine,e.reflectivity=this.reflectivity,e.refractionRatio=this.refractionRatio,e.fog=this.fog,e.shading=this.shading,e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e.wireframeLinecap=this.wireframeLinecap,e.wireframeLinejoin=this.wireframeLinejoin,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e},r.MeshLambertMaterial=function(e){r.Material.call(this),this.type="MeshLambertMaterial",this.color=new r.Color(16777215),this.ambient=new r.Color(16777215),this.emissive=new r.Color(0),this.wrapAround=!1,this.wrapRGB=new r.Vector3(1,1,1),this.map=null,this.lightMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=r.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=r.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=r.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)},r.MeshLambertMaterial.prototype=Object.create(r.Material.prototype),r.MeshLambertMaterial.prototype.constructor=r.MeshLambertMaterial,r.MeshLambertMaterial.prototype.clone=function(){var e=new r.MeshLambertMaterial;return r.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.ambient.copy(this.ambient),e.emissive.copy(this.emissive),e.wrapAround=this.wrapAround,e.wrapRGB.copy(this.wrapRGB),e.map=this.map,e.lightMap=this.lightMap,e.specularMap=this.specularMap,e.alphaMap=this.alphaMap,e.envMap=this.envMap,e.combine=this.combine,e.reflectivity=this.reflectivity,e.refractionRatio=this.refractionRatio,e.fog=this.fog,e.shading=this.shading,e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e.wireframeLinecap=this.wireframeLinecap,e.wireframeLinejoin=this.wireframeLinejoin,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e.morphNormals=this.morphNormals,e},r.MeshPhongMaterial=function(e){r.Material.call(this),this.type="MeshPhongMaterial",this.color=new r.Color(16777215),this.ambient=new r.Color(16777215),this.emissive=new r.Color(0),this.specular=new r.Color(1118481),this.shininess=30,this.metal=!1,this.wrapAround=!1,this.wrapRGB=new r.Vector3(1,1,1),this.map=null,this.lightMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new r.Vector2(1,1),this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=r.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=r.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.vertexColors=r.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(e)},r.MeshPhongMaterial.prototype=Object.create(r.Material.prototype),r.MeshPhongMaterial.prototype.constructor=r.MeshPhongMaterial,r.MeshPhongMaterial.prototype.clone=function(){var e=new r.MeshPhongMaterial;return r.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.ambient.copy(this.ambient),e.emissive.copy(this.emissive),e.specular.copy(this.specular),e.shininess=this.shininess,e.metal=this.metal,e.wrapAround=this.wrapAround,e.wrapRGB.copy(this.wrapRGB),e.map=this.map,e.lightMap=this.lightMap,e.bumpMap=this.bumpMap,e.bumpScale=this.bumpScale,e.normalMap=this.normalMap,e.normalScale.copy(this.normalScale),e.specularMap=this.specularMap,e.alphaMap=this.alphaMap,e.envMap=this.envMap,e.combine=this.combine,e.reflectivity=this.reflectivity,e.refractionRatio=this.refractionRatio,e.fog=this.fog,e.shading=this.shading,e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e.wireframeLinecap=this.wireframeLinecap,e.wireframeLinejoin=this.wireframeLinejoin,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e.morphNormals=this.morphNormals,e},r.MeshDepthMaterial=function(e){r.Material.call(this),this.type="MeshDepthMaterial",this.morphTargets=!1,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)},r.MeshDepthMaterial.prototype=Object.create(r.Material.prototype),r.MeshDepthMaterial.prototype.constructor=r.MeshDepthMaterial,r.MeshDepthMaterial.prototype.clone=function(){var e=new r.MeshDepthMaterial;return r.Material.prototype.clone.call(this,e),e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e},r.MeshNormalMaterial=function(e){r.Material.call(this,e),this.type="MeshNormalMaterial",this.shading=r.FlatShading,this.wireframe=!1,this.wireframeLinewidth=1,this.morphTargets=!1,this.setValues(e)},r.MeshNormalMaterial.prototype=Object.create(r.Material.prototype),r.MeshNormalMaterial.prototype.constructor=r.MeshNormalMaterial,r.MeshNormalMaterial.prototype.clone=function(){var e=new r.MeshNormalMaterial;return r.Material.prototype.clone.call(this,e),e.shading=this.shading,e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e},r.MeshFaceMaterial=function(e){this.uuid=r.Math.generateUUID(),this.type="MeshFaceMaterial",this.materials=e instanceof Array?e:[]},r.MeshFaceMaterial.prototype={constructor:r.MeshFaceMaterial,toJSON:function(){for(var e={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},t=0,r=this.materials.length;r>t;t++)e.materials.push(this.materials[t].toJSON());return e},clone:function(){for(var e=new r.MeshFaceMaterial,t=0;t<this.materials.length;t++)e.materials.push(this.materials[t].clone());return e}},r.PointCloudMaterial=function(e){r.Material.call(this),this.type="PointCloudMaterial",this.color=new r.Color(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.vertexColors=r.NoColors,this.fog=!0,this.setValues(e)},r.PointCloudMaterial.prototype=Object.create(r.Material.prototype),r.PointCloudMaterial.prototype.constructor=r.PointCloudMaterial,r.PointCloudMaterial.prototype.clone=function(){var e=new r.PointCloudMaterial;return r.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.map=this.map,e.size=this.size,e.sizeAttenuation=this.sizeAttenuation,e.vertexColors=this.vertexColors,e.fog=this.fog,e},r.ParticleBasicMaterial=function(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointCloudMaterial."),new r.PointCloudMaterial(e)},r.ParticleSystemMaterial=function(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointCloudMaterial."),new r.PointCloudMaterial(e)},r.ShaderMaterial=function(e){r.Material.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.attributes=null,this.vertexShader="void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.shading=r.SmoothShading,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.vertexColors=r.NoColors,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.setValues(e)},r.ShaderMaterial.prototype=Object.create(r.Material.prototype),r.ShaderMaterial.prototype.constructor=r.ShaderMaterial,r.ShaderMaterial.prototype.clone=function(){var e=new r.ShaderMaterial;return r.Material.prototype.clone.call(this,e),e.fragmentShader=this.fragmentShader,e.vertexShader=this.vertexShader,e.uniforms=r.UniformsUtils.clone(this.uniforms),e.attributes=this.attributes,e.defines=this.defines,e.shading=this.shading,e.wireframe=this.wireframe,e.wireframeLinewidth=this.wireframeLinewidth,e.fog=this.fog,e.lights=this.lights,e.vertexColors=this.vertexColors,e.skinning=this.skinning,e.morphTargets=this.morphTargets,e.morphNormals=this.morphNormals,e},r.RawShaderMaterial=function(e){r.ShaderMaterial.call(this,e),this.type="RawShaderMaterial"},r.RawShaderMaterial.prototype=Object.create(r.ShaderMaterial.prototype),r.RawShaderMaterial.prototype.constructor=r.RawShaderMaterial,r.RawShaderMaterial.prototype.clone=function(){var e=new r.RawShaderMaterial;return r.ShaderMaterial.prototype.clone.call(this,e),e},r.SpriteMaterial=function(e){r.Material.call(this),this.type="SpriteMaterial",this.color=new r.Color(16777215),this.map=null,this.rotation=0,this.fog=!1,this.setValues(e)},r.SpriteMaterial.prototype=Object.create(r.Material.prototype),r.SpriteMaterial.prototype.constructor=r.SpriteMaterial,r.SpriteMaterial.prototype.clone=function(){var e=new r.SpriteMaterial;return r.Material.prototype.clone.call(this,e),e.color.copy(this.color),e.map=this.map,e.rotation=this.rotation,e.fog=this.fog,e},r.Texture=function(e,t,n,i,o,a,s,u,c){Object.defineProperty(this,"id",{value:r.TextureIdCount++}),this.uuid=r.Math.generateUUID(),this.name="",this.image=void 0!==e?e:r.Texture.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:r.Texture.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:r.ClampToEdgeWrapping,this.wrapT=void 0!==i?i:r.ClampToEdgeWrapping,this.magFilter=void 0!==o?o:r.LinearFilter,this.minFilter=void 0!==a?a:r.LinearMipMapLinearFilter,this.anisotropy=void 0!==c?c:1,this.format=void 0!==s?s:r.RGBAFormat,this.type=void 0!==u?u:r.UnsignedByteType,this.offset=new r.Vector2(0,0),this.repeat=new r.Vector2(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this._needsUpdate=!1,this.onUpdate=null},r.Texture.DEFAULT_IMAGE=void 0,r.Texture.DEFAULT_MAPPING=r.UVMapping,r.Texture.prototype={constructor:r.Texture,get needsUpdate(){return this._needsUpdate},set needsUpdate(e){e===!0&&this.update(),this._needsUpdate=e},clone:function(e){return void 0===e&&(e=new r.Texture),e.image=this.image,e.mipmaps=this.mipmaps.slice(0),e.mapping=this.mapping,e.wrapS=this.wrapS,e.wrapT=this.wrapT,e.magFilter=this.magFilter,e.minFilter=this.minFilter,e.anisotropy=this.anisotropy,e.format=this.format,e.type=this.type,e.offset.copy(this.offset),e.repeat.copy(this.repeat),e.generateMipmaps=this.generateMipmaps,e.premultiplyAlpha=this.premultiplyAlpha,e.flipY=this.flipY,e.unpackAlignment=this.unpackAlignment,e},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},r.EventDispatcher.prototype.apply(r.Texture.prototype),r.TextureIdCount=0,r.CubeTexture=function(e,t,n,i,o,a,s,u,c){t=void 0!==t?t:r.CubeReflectionMapping,r.Texture.call(this,e,t,n,i,o,a,s,u,c),this.images=e},r.CubeTexture.prototype=Object.create(r.Texture.prototype),r.CubeTexture.prototype.constructor=r.CubeTexture,r.CubeTexture.clone=function(e){return void 0===e&&(e=new r.CubeTexture),r.Texture.prototype.clone.call(this,e),e.images=this.images,e},r.CompressedTexture=function(e,t,n,i,o,a,s,u,c,l,h){r.Texture.call(this,null,a,s,u,c,l,i,o,h),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1},r.CompressedTexture.prototype=Object.create(r.Texture.prototype),r.CompressedTexture.prototype.constructor=r.CompressedTexture,r.CompressedTexture.prototype.clone=function(){var e=new r.CompressedTexture;return r.Texture.prototype.clone.call(this,e),e},r.DataTexture=function(e,t,n,i,o,a,s,u,c,l,h){r.Texture.call(this,null,a,s,u,c,l,i,o,h),this.image={data:e,width:t,height:n}},r.DataTexture.prototype=Object.create(r.Texture.prototype),r.DataTexture.prototype.constructor=r.DataTexture,r.DataTexture.prototype.clone=function(){var e=new r.DataTexture;return r.Texture.prototype.clone.call(this,e),e},r.VideoTexture=function(e,t,n,i,o,a,s,u,c){r.Texture.call(this,e,t,n,i,o,a,s,u,c),this.generateMipmaps=!1;var l=this,h=function(){requestAnimationFrame(h),e.readyState===e.HAVE_ENOUGH_DATA&&(l.needsUpdate=!0)};h()},r.VideoTexture.prototype=Object.create(r.Texture.prototype),r.VideoTexture.prototype.constructor=r.VideoTexture,r.Group=function(){r.Object3D.call(this),this.type="Group"},r.Group.prototype=Object.create(r.Object3D.prototype),r.Group.prototype.constructor=r.Group,r.PointCloud=function(e,t){r.Object3D.call(this),this.type="PointCloud",this.geometry=void 0!==e?e:new r.Geometry,this.material=void 0!==t?t:new r.PointCloudMaterial({color:16777215*Math.random()})},r.PointCloud.prototype=Object.create(r.Object3D.prototype),r.PointCloud.prototype.constructor=r.PointCloud,r.PointCloud.prototype.raycast=function(){var e=new r.Matrix4,t=new r.Ray;return function(n,i){var o=this,a=o.geometry,s=n.params.PointCloud.threshold;if(e.getInverse(this.matrixWorld),t.copy(n.ray).applyMatrix4(e),null===a.boundingBox||t.isIntersectionBox(a.boundingBox)!==!1){var u=s/((this.scale.x+this.scale.y+this.scale.z)/3),c=new r.Vector3,l=function(e,r){var a=t.distanceToPoint(e);if(u>a){var s=t.closestPointToPoint(e);s.applyMatrix4(o.matrixWorld);var c=n.ray.origin.distanceTo(s);i.push({distance:c,distanceToRay:a,point:s.clone(),index:r,face:null,object:o})}};if(a instanceof r.BufferGeometry){var h=a.attributes,f=h.position.array;if(void 0!==h.index){var p=h.index.array,d=a.offsets;if(0===d.length){var m={start:0,count:p.length,index:0};d=[m]}for(var v=0,g=d.length;g>v;++v)for(var y=d[v].start,b=d[v].count,x=d[v].index,w=y,_=y+b;_>w;w++){var S=x+p[w];c.fromArray(f,3*S),l(c,S)}}else for(var M=f.length/3,w=0;M>w;w++)c.set(f[3*w],f[3*w+1],f[3*w+2]),l(c,w)}else for(var E=this.geometry.vertices,w=0;w<E.length;w++)l(E[w],w)}}}(),r.PointCloud.prototype.clone=function(e){return void 0===e&&(e=new r.PointCloud(this.geometry,this.material)),r.Object3D.prototype.clone.call(this,e),e},r.ParticleSystem=function(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.PointCloud."),new r.PointCloud(e,t)},r.Line=function(e,t,n){r.Object3D.call(this),this.type="Line",this.geometry=void 0!==e?e:new r.Geometry,this.material=void 0!==t?t:new r.LineBasicMaterial({color:16777215*Math.random()}),this.mode=void 0!==n?n:r.LineStrip},r.LineStrip=0,r.LinePieces=1,r.Line.prototype=Object.create(r.Object3D.prototype),r.Line.prototype.constructor=r.Line,r.Line.prototype.raycast=function(){var e=new r.Matrix4,t=new r.Ray,n=new r.Sphere;return function(i,o){var a=i.linePrecision,s=a*a,u=this.geometry;if(null===u.boundingSphere&&u.computeBoundingSphere(),n.copy(u.boundingSphere),n.applyMatrix4(this.matrixWorld),i.ray.isIntersectionSphere(n)!==!1){e.getInverse(this.matrixWorld),t.copy(i.ray).applyMatrix4(e);var c=new r.Vector3,l=new r.Vector3,h=new r.Vector3,f=new r.Vector3,p=this.mode===r.LineStrip?1:2;if(u instanceof r.BufferGeometry){var d=u.attributes;if(void 0!==d.index){var m=d.index.array,v=d.position.array,g=u.offsets;0===g.length&&(g=[{start:0,count:m.length,index:0}]);for(var y=0;y<g.length;y++)for(var b=g[y].start,x=g[y].count,w=g[y].index,_=b;b+x-1>_;_+=p){var S=w+m[_],M=w+m[_+1];c.fromArray(v,3*S),l.fromArray(v,3*M);var E=t.distanceSqToSegment(c,l,f,h);if(!(E>s)){var T=t.origin.distanceTo(f);T<i.near||T>i.far||o.push({distance:T,point:h.clone().applyMatrix4(this.matrixWorld),face:null,faceIndex:null,object:this})}}}else for(var v=d.position.array,_=0;_<v.length/3-1;_+=p){c.fromArray(v,3*_),l.fromArray(v,3*_+3);var E=t.distanceSqToSegment(c,l,f,h);if(!(E>s)){var T=t.origin.distanceTo(f);T<i.near||T>i.far||o.push({distance:T,point:h.clone().applyMatrix4(this.matrixWorld),face:null,faceIndex:null,object:this})}}}else if(u instanceof r.Geometry)for(var C=u.vertices,A=C.length,_=0;A-1>_;_+=p){var E=t.distanceSqToSegment(C[_],C[_+1],f,h);if(!(E>s)){var T=t.origin.distanceTo(f);T<i.near||T>i.far||o.push({distance:T,point:h.clone().applyMatrix4(this.matrixWorld),face:null,faceIndex:null,object:this})}}}}}(),r.Line.prototype.clone=function(e){return void 0===e&&(e=new r.Line(this.geometry,this.material,this.mode)),r.Object3D.prototype.clone.call(this,e),e},r.Mesh=function(e,t){r.Object3D.call(this),this.type="Mesh",this.geometry=void 0!==e?e:new r.Geometry,this.material=void 0!==t?t:new r.MeshBasicMaterial({color:16777215*Math.random()}),this.updateMorphTargets()
},r.Mesh.prototype=Object.create(r.Object3D.prototype),r.Mesh.prototype.constructor=r.Mesh,r.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&this.geometry.morphTargets.length>0){this.morphTargetBase=-1,this.morphTargetForcedOrder=[],this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var e=0,t=this.geometry.morphTargets.length;t>e;e++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[e].name]=e}},r.Mesh.prototype.getMorphTargetIndexByName=function(e){return void 0!==this.morphTargetDictionary[e]?this.morphTargetDictionary[e]:(console.log("THREE.Mesh.getMorphTargetIndexByName: morph target "+e+" does not exist. Returning 0."),0)},r.Mesh.prototype.raycast=function(){var e=new r.Matrix4,t=new r.Ray,n=new r.Sphere,i=new r.Vector3,o=new r.Vector3,a=new r.Vector3;return function(s,u){var c=this.geometry;if(null===c.boundingSphere&&c.computeBoundingSphere(),n.copy(c.boundingSphere),n.applyMatrix4(this.matrixWorld),s.ray.isIntersectionSphere(n)!==!1&&(e.getInverse(this.matrixWorld),t.copy(s.ray).applyMatrix4(e),null===c.boundingBox||t.isIntersectionBox(c.boundingBox)!==!1))if(c instanceof r.BufferGeometry){var l=this.material;if(void 0===l)return;var h,f,p,d=c.attributes,m=s.precision;if(void 0!==d.index){var v=d.index.array,g=d.position.array,y=c.offsets;0===y.length&&(y=[{start:0,count:v.length,index:0}]);for(var b=0,x=y.length;x>b;++b)for(var w=y[b].start,_=y[b].count,S=y[b].index,M=w,E=w+_;E>M;M+=3){if(h=S+v[M],f=S+v[M+1],p=S+v[M+2],i.fromArray(g,3*h),o.fromArray(g,3*f),a.fromArray(g,3*p),l.side===r.BackSide)var T=t.intersectTriangle(a,o,i,!0);else var T=t.intersectTriangle(i,o,a,l.side!==r.DoubleSide);if(null!==T){T.applyMatrix4(this.matrixWorld);var C=s.ray.origin.distanceTo(T);m>C||C<s.near||C>s.far||u.push({distance:C,point:T,face:new r.Face3(h,f,p,r.Triangle.normal(i,o,a)),faceIndex:null,object:this})}}}else for(var g=d.position.array,M=0,A=0,E=g.length;E>M;M+=3,A+=9){if(h=M,f=M+1,p=M+2,i.fromArray(g,A),o.fromArray(g,A+3),a.fromArray(g,A+6),l.side===r.BackSide)var T=t.intersectTriangle(a,o,i,!0);else var T=t.intersectTriangle(i,o,a,l.side!==r.DoubleSide);if(null!==T){T.applyMatrix4(this.matrixWorld);var C=s.ray.origin.distanceTo(T);m>C||C<s.near||C>s.far||u.push({distance:C,point:T,face:new r.Face3(h,f,p,r.Triangle.normal(i,o,a)),faceIndex:null,object:this})}}}else if(c instanceof r.Geometry)for(var h,f,p,$=this.material instanceof r.MeshFaceMaterial,k=$===!0?this.material.materials:null,m=s.precision,P=c.vertices,R=0,O=c.faces.length;O>R;R++){var L=c.faces[R],l=$===!0?k[L.materialIndex]:this.material;if(void 0!==l){if(h=P[L.a],f=P[L.b],p=P[L.c],l.morphTargets===!0){var F=c.morphTargets,j=this.morphTargetInfluences;i.set(0,0,0),o.set(0,0,0),a.set(0,0,0);for(var D=0,N=F.length;N>D;D++){var U=j[D];if(0!==U){var V=F[D].vertices;i.x+=(V[L.a].x-h.x)*U,i.y+=(V[L.a].y-h.y)*U,i.z+=(V[L.a].z-h.z)*U,o.x+=(V[L.b].x-f.x)*U,o.y+=(V[L.b].y-f.y)*U,o.z+=(V[L.b].z-f.z)*U,a.x+=(V[L.c].x-p.x)*U,a.y+=(V[L.c].y-p.y)*U,a.z+=(V[L.c].z-p.z)*U}}i.add(h),o.add(f),a.add(p),h=i,f=o,p=a}if(l.side===r.BackSide)var T=t.intersectTriangle(p,f,h,!0);else var T=t.intersectTriangle(h,f,p,l.side!==r.DoubleSide);if(null!==T){T.applyMatrix4(this.matrixWorld);var C=s.ray.origin.distanceTo(T);m>C||C<s.near||C>s.far||u.push({distance:C,point:T,face:L,faceIndex:R,object:this})}}}}}(),r.Mesh.prototype.clone=function(e,t){return void 0===e&&(e=new r.Mesh(this.geometry,this.material)),r.Object3D.prototype.clone.call(this,e,t),e},r.Bone=function(e){r.Object3D.call(this),this.skin=e},r.Bone.prototype=Object.create(r.Object3D.prototype),r.Bone.prototype.constructor=r.Bone,r.Skeleton=function(e,t,n){if(this.useVertexTexture=void 0!==n?n:!0,this.identityMatrix=new r.Matrix4,e=e||[],this.bones=e.slice(0),this.useVertexTexture){var i;i=this.bones.length>256?64:this.bones.length>64?32:this.bones.length>16?16:8,this.boneTextureWidth=i,this.boneTextureHeight=i,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new r.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,r.RGBAFormat,r.FloatType),this.boneTexture.minFilter=r.NearestFilter,this.boneTexture.magFilter=r.NearestFilter,this.boneTexture.generateMipmaps=!1,this.boneTexture.flipY=!1}else this.boneMatrices=new Float32Array(16*this.bones.length);if(void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[];for(var o=0,a=this.bones.length;a>o;o++)this.boneInverses.push(new r.Matrix4)}},r.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var e=0,t=this.bones.length;t>e;e++){var n=new r.Matrix4;this.bones[e]&&n.getInverse(this.bones[e].matrixWorld),this.boneInverses.push(n)}},r.Skeleton.prototype.pose=function(){for(var e,t=0,r=this.bones.length;r>t;t++)e=this.bones[t],e&&e.matrixWorld.getInverse(this.boneInverses[t]);for(var t=0,r=this.bones.length;r>t;t++)e=this.bones[t],e&&(e.parent?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))},r.Skeleton.prototype.update=function(){var e=new r.Matrix4;return function(){for(var t=0,r=this.bones.length;r>t;t++){var n=this.bones[t]?this.bones[t].matrixWorld:this.identityMatrix;e.multiplyMatrices(n,this.boneInverses[t]),e.flattenToArrayOffset(this.boneMatrices,16*t)}this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)}}(),r.SkinnedMesh=function(e,t,n){r.Mesh.call(this,e,t),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new r.Matrix4,this.bindMatrixInverse=new r.Matrix4;var i=[];if(this.geometry&&void 0!==this.geometry.bones){for(var o,a,s,u,c,l=0,h=this.geometry.bones.length;h>l;++l)a=this.geometry.bones[l],s=a.pos,u=a.rotq,c=a.scl,o=new r.Bone(this),i.push(o),o.name=a.name,o.position.set(s[0],s[1],s[2]),o.quaternion.set(u[0],u[1],u[2],u[3]),void 0!==c?o.scale.set(c[0],c[1],c[2]):o.scale.set(1,1,1);for(var l=0,h=this.geometry.bones.length;h>l;++l)a=this.geometry.bones[l],-1!==a.parent?i[a.parent].add(i[l]):this.add(i[l])}this.normalizeSkinWeights(),this.updateMatrixWorld(!0),this.bind(new r.Skeleton(i,void 0,n))},r.SkinnedMesh.prototype=Object.create(r.Mesh.prototype),r.SkinnedMesh.prototype.constructor=r.SkinnedMesh,r.SkinnedMesh.prototype.bind=function(e,t){this.skeleton=e,void 0===t&&(this.updateMatrixWorld(!0),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.getInverse(t)},r.SkinnedMesh.prototype.pose=function(){this.skeleton.pose()},r.SkinnedMesh.prototype.normalizeSkinWeights=function(){if(this.geometry instanceof r.Geometry)for(var e=0;e<this.geometry.skinIndices.length;e++){var t=this.geometry.skinWeights[e],n=1/t.lengthManhattan();1/0!==n?t.multiplyScalar(n):t.set(1)}},r.SkinnedMesh.prototype.updateMatrixWorld=function(){r.Mesh.prototype.updateMatrixWorld.call(this,!0),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh unreckognized bindMode: "+this.bindMode)},r.SkinnedMesh.prototype.clone=function(e){return void 0===e&&(e=new r.SkinnedMesh(this.geometry,this.material,this.useVertexTexture)),r.Mesh.prototype.clone.call(this,e),e},r.MorphAnimMesh=function(e,t){r.Mesh.call(this,e,t),this.type="MorphAnimMesh",this.duration=1e3,this.mirroredLoop=!1,this.time=0,this.lastKeyframe=0,this.currentKeyframe=0,this.direction=1,this.directionBackwards=!1,this.setFrameRange(0,this.geometry.morphTargets.length-1)},r.MorphAnimMesh.prototype=Object.create(r.Mesh.prototype),r.MorphAnimMesh.prototype.constructor=r.MorphAnimMesh,r.MorphAnimMesh.prototype.setFrameRange=function(e,t){this.startKeyframe=e,this.endKeyframe=t,this.length=this.endKeyframe-this.startKeyframe+1},r.MorphAnimMesh.prototype.setDirectionForward=function(){this.direction=1,this.directionBackwards=!1},r.MorphAnimMesh.prototype.setDirectionBackward=function(){this.direction=-1,this.directionBackwards=!0},r.MorphAnimMesh.prototype.parseAnimations=function(){var e=this.geometry;e.animations||(e.animations={});for(var t,r=e.animations,n=/([a-z]+)_?(\d+)/,i=0,o=e.morphTargets.length;o>i;i++){var a=e.morphTargets[i],s=a.name.match(n);if(s&&s.length>1){{var u=s[1];s[2]}r[u]||(r[u]={start:1/0,end:-1/0});var c=r[u];i<c.start&&(c.start=i),i>c.end&&(c.end=i),t||(t=u)}}e.firstAnimation=t},r.MorphAnimMesh.prototype.setAnimationLabel=function(e,t,r){this.geometry.animations||(this.geometry.animations={}),this.geometry.animations[e]={start:t,end:r}},r.MorphAnimMesh.prototype.playAnimation=function(e,t){var r=this.geometry.animations[e];r?(this.setFrameRange(r.start,r.end),this.duration=1e3*((r.end-r.start)/t),this.time=0):console.warn("animation["+e+"] undefined")},r.MorphAnimMesh.prototype.updateAnimation=function(e){var t=this.duration/this.length;this.time+=this.direction*e,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.time%this.duration,this.time<0&&(this.time+=this.duration));var n=this.startKeyframe+r.Math.clamp(Math.floor(this.time/t),0,this.length-1);n!==this.currentKeyframe&&(this.morphTargetInfluences[this.lastKeyframe]=0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[n]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=n);var i=this.time%t/t;this.directionBackwards&&(i=1-i),this.morphTargetInfluences[this.currentKeyframe]=i,this.morphTargetInfluences[this.lastKeyframe]=1-i},r.MorphAnimMesh.prototype.interpolateTargets=function(e,t,r){for(var n=this.morphTargetInfluences,i=0,o=n.length;o>i;i++)n[i]=0;e>-1&&(n[e]=1-r),t>-1&&(n[t]=r)},r.MorphAnimMesh.prototype.clone=function(e){return void 0===e&&(e=new r.MorphAnimMesh(this.geometry,this.material)),e.duration=this.duration,e.mirroredLoop=this.mirroredLoop,e.time=this.time,e.lastKeyframe=this.lastKeyframe,e.currentKeyframe=this.currentKeyframe,e.direction=this.direction,e.directionBackwards=this.directionBackwards,r.Mesh.prototype.clone.call(this,e),e},r.LOD=function(){r.Object3D.call(this),this.objects=[]},r.LOD.prototype=Object.create(r.Object3D.prototype),r.LOD.prototype.constructor=r.LOD,r.LOD.prototype.addLevel=function(e,t){void 0===t&&(t=0),t=Math.abs(t);for(var r=0;r<this.objects.length&&!(t<this.objects[r].distance);r++);this.objects.splice(r,0,{distance:t,object:e}),this.add(e)},r.LOD.prototype.getObjectForDistance=function(e){for(var t=1,r=this.objects.length;r>t&&!(e<this.objects[t].distance);t++);return this.objects[t-1].object},r.LOD.prototype.raycast=function(){var e=new r.Vector3;return function(t,r){e.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(e);this.getObjectForDistance(n).raycast(t,r)}}(),r.LOD.prototype.update=function(){var e=new r.Vector3,t=new r.Vector3;return function(r){if(this.objects.length>1){e.setFromMatrixPosition(r.matrixWorld),t.setFromMatrixPosition(this.matrixWorld);var n=e.distanceTo(t);this.objects[0].object.visible=!0;for(var i=1,o=this.objects.length;o>i&&n>=this.objects[i].distance;i++)this.objects[i-1].object.visible=!1,this.objects[i].object.visible=!0;for(;o>i;i++)this.objects[i].object.visible=!1}}}(),r.LOD.prototype.clone=function(e){void 0===e&&(e=new r.LOD),r.Object3D.prototype.clone.call(this,e);for(var t=0,n=this.objects.length;n>t;t++){var i=this.objects[t].object.clone();i.visible=0===t,e.addLevel(i,this.objects[t].distance)}return e},r.Sprite=function(){var e=new Uint16Array([0,1,2,0,2,3]),t=new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0]),n=new Float32Array([0,0,1,0,1,1,0,1]),i=new r.BufferGeometry;return i.addAttribute("index",new r.BufferAttribute(e,1)),i.addAttribute("position",new r.BufferAttribute(t,3)),i.addAttribute("uv",new r.BufferAttribute(n,2)),function(e){r.Object3D.call(this),this.type="Sprite",this.geometry=i,this.material=void 0!==e?e:new r.SpriteMaterial}}(),r.Sprite.prototype=Object.create(r.Object3D.prototype),r.Sprite.prototype.constructor=r.Sprite,r.Sprite.prototype.raycast=function(){var e=new r.Vector3;return function(t,r){e.setFromMatrixPosition(this.matrixWorld);var n=t.ray.distanceToPoint(e);n>this.scale.x||r.push({distance:n,point:this.position,face:null,object:this})}}(),r.Sprite.prototype.clone=function(e){return void 0===e&&(e=new r.Sprite(this.material)),r.Object3D.prototype.clone.call(this,e),e},r.Particle=r.Sprite,r.LensFlare=function(e,t,n,i,o){r.Object3D.call(this),this.lensFlares=[],this.positionScreen=new r.Vector3,this.customUpdateCallback=void 0,void 0!==e&&this.add(e,t,n,i,o)},r.LensFlare.prototype=Object.create(r.Object3D.prototype),r.LensFlare.prototype.constructor=r.LensFlare,r.LensFlare.prototype.add=function(e,t,n,i,o,a){void 0===t&&(t=-1),void 0===n&&(n=0),void 0===a&&(a=1),void 0===o&&(o=new r.Color(16777215)),void 0===i&&(i=r.NormalBlending),n=Math.min(n,Math.max(0,n)),this.lensFlares.push({texture:e,size:t,distance:n,x:0,y:0,z:0,scale:1,rotation:1,opacity:a,color:o,blending:i})},r.LensFlare.prototype.updateLensFlares=function(){var e,t,r=this.lensFlares.length,n=2*-this.positionScreen.x,i=2*-this.positionScreen.y;for(e=0;r>e;e++)t=this.lensFlares[e],t.x=this.positionScreen.x+n*t.distance,t.y=this.positionScreen.y+i*t.distance,t.wantedRotation=t.x*Math.PI*.25,t.rotation+=.25*(t.wantedRotation-t.rotation)},r.Scene=function(){r.Object3D.call(this),this.type="Scene",this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0},r.Scene.prototype=Object.create(r.Object3D.prototype),r.Scene.prototype.constructor=r.Scene,r.Scene.prototype.clone=function(e){return void 0===e&&(e=new r.Scene),r.Object3D.prototype.clone.call(this,e),null!==this.fog&&(e.fog=this.fog.clone()),null!==this.overrideMaterial&&(e.overrideMaterial=this.overrideMaterial.clone()),e.autoUpdate=this.autoUpdate,e.matrixAutoUpdate=this.matrixAutoUpdate,e},r.Fog=function(e,t,n){this.name="",this.color=new r.Color(e),this.near=void 0!==t?t:1,this.far=void 0!==n?n:1e3},r.Fog.prototype.clone=function(){return new r.Fog(this.color.getHex(),this.near,this.far)},r.FogExp2=function(e,t){this.name="",this.color=new r.Color(e),this.density=void 0!==t?t:25e-5},r.FogExp2.prototype.clone=function(){return new r.FogExp2(this.color.getHex(),this.density)},r.ShaderChunk={},r.ShaderChunk.alphatest_fragment="#ifdef ALPHATEST\n\n if ( gl_FragColor.a < ALPHATEST ) discard;\n\n#endif\n",r.ShaderChunk.lights_lambert_vertex="vLightFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\n vLightBack = 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 vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\n vec3 dirVector = normalize( lDirection.xyz );\n\n float dotProduct = dot( transformedNormal, dirVector );\n vec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n #ifdef DOUBLE_SIDED\n\n vec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n #ifdef WRAP_AROUND\n\n vec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n #endif\n\n #endif\n\n #ifdef WRAP_AROUND\n\n vec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n directionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );\n\n #ifdef DOUBLE_SIDED\n\n directionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );\n\n #endif\n\n #endif\n\n vLightFront += directionalLightColor[ i ] * directionalLightWeighting;\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;\n\n #endif\n\n}\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n for( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n vec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n float lDistance = 1.0;\n if ( pointLightDistance[ i ] > 0.0 )\n lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\n\n lVector = normalize( lVector );\n float dotProduct = dot( transformedNormal, lVector );\n\n vec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n #ifdef DOUBLE_SIDED\n\n vec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n #ifdef WRAP_AROUND\n\n vec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n #endif\n\n #endif\n\n #ifdef WRAP_AROUND\n\n vec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n pointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );\n\n #ifdef DOUBLE_SIDED\n\n pointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );\n\n #endif\n\n #endif\n\n vLightFront += pointLightColor[ i ] * pointLightWeighting * lDistance;\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += pointLightColor[ i ] * pointLightWeightingBack * lDistance;\n\n #endif\n\n }\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n for( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n vec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n float spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - worldPosition.xyz ) );\n\n if ( spotEffect > spotLightAngleCos[ i ] ) {\n\n spotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n float lDistance = 1.0;\n if ( spotLightDistance[ i ] > 0.0 )\n lDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );\n\n lVector = normalize( lVector );\n\n float dotProduct = dot( transformedNormal, lVector );\n vec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n #ifdef DOUBLE_SIDED\n\n vec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n #ifdef WRAP_AROUND\n\n vec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n #endif\n\n #endif\n\n #ifdef WRAP_AROUND\n\n vec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n spotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );\n\n #ifdef DOUBLE_SIDED\n\n spotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );\n\n #endif\n\n #endif\n\n vLightFront += spotLightColor[ i ] * spotLightWeighting * lDistance * spotEffect;\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += spotLightColor[ i ] * spotLightWeightingBack * lDistance * spotEffect;\n\n #endif\n\n }\n\n }\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n for( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n vec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\n vec3 lVector = normalize( lDirection.xyz );\n\n float dotProduct = dot( transformedNormal, lVector );\n\n float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n float hemiDiffuseWeightBack = -0.5 * dotProduct + 0.5;\n\n vLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n #ifdef DOUBLE_SIDED\n\n vLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );\n\n #endif\n\n }\n\n#endif\n\nvLightFront = vLightFront * diffuse + ambient * ambientLightColor + emissive;\n\n#ifdef DOUBLE_SIDED\n\n vLightBack = vLightBack * diffuse + ambient * ambientLightColor + emissive;\n\n#endif",r.ShaderChunk.map_particle_pars_fragment="#ifdef USE_MAP\n\n uniform sampler2D map;\n\n#endif",r.ShaderChunk.default_vertex="#ifdef USE_SKINNING\n\n vec4 mvPosition = modelViewMatrix * skinned;\n\n#elif defined( USE_MORPHTARGETS )\n\n vec4 mvPosition = modelViewMatrix * vec4( morphed, 1.0 );\n\n#else\n\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\n#endif\n\ngl_Position = projectionMatrix * mvPosition;\n",r.ShaderChunk.map_pars_fragment="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n varying vec2 vUv;\n\n#endif\n\n#ifdef USE_MAP\n\n uniform sampler2D map;\n\n#endif",r.ShaderChunk.skinnormal_vertex="#ifdef USE_SKINNING\n\n mat4 skinMatrix = mat4( 0.0 );\n skinMatrix += skinWeight.x * boneMatX;\n skinMatrix += skinWeight.y * boneMatY;\n skinMatrix += skinWeight.z * boneMatZ;\n skinMatrix += skinWeight.w * boneMatW;\n skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\n #ifdef USE_MORPHNORMALS\n\n vec4 skinnedNormal = skinMatrix * vec4( morphedNormal, 0.0 );\n\n #else\n\n vec4 skinnedNormal = skinMatrix * vec4( normal, 0.0 );\n\n #endif\n\n#endif\n",r.ShaderChunk.logdepthbuf_pars_vertex="#ifdef USE_LOGDEPTHBUF\n\n #ifdef USE_LOGDEPTHBUF_EXT\n\n varying float vFragDepth;\n\n #endif\n\n uniform float logDepthBufFC;\n\n#endif",r.ShaderChunk.lightmap_pars_vertex="#ifdef USE_LIGHTMAP\n\n varying vec2 vUv2;\n\n#endif",r.ShaderChunk.lights_phong_fragment="vec3 normal = normalize( vNormal );\nvec3 viewPosition = normalize( vViewPosition );\n\n#ifdef DOUBLE_SIDED\n\n normal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\n#endif\n\n#ifdef USE_NORMALMAP\n\n normal = perturbNormal2Arb( -vViewPosition, normal );\n\n#elif defined( USE_BUMPMAP )\n\n normal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n vec3 pointDiffuse = vec3( 0.0 );\n vec3 pointSpecular = vec3( 0.0 );\n\n for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n vec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n float lDistance = 1.0;\n if ( pointLightDistance[ i ] > 0.0 )\n lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );\n\n lVector = normalize( lVector );\n\n // diffuse\n\n float dotProduct = dot( normal, lVector );\n\n #ifdef WRAP_AROUND\n\n float pointDiffuseWeightFull = max( dotProduct, 0.0 );\n float pointDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n vec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n\n #else\n\n float pointDiffuseWeight = max( dotProduct, 0.0 );\n\n #endif\n\n pointDiffuse += diffuse * pointLightColor[ i ] * pointDiffuseWeight * lDistance;\n\n // specular\n\n vec3 pointHalfVector = normalize( lVector + viewPosition );\n float pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\n float pointSpecularWeight = specularStrength * max( pow( pointDotNormalHalf, shininess ), 0.0 );\n\n float specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n vec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, pointHalfVector ), 0.0 ), 5.0 );\n pointSpecular += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * lDistance * specularNormalization;\n\n }\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n vec3 spotDiffuse = vec3( 0.0 );\n vec3 spotSpecular = vec3( 0.0 );\n\n for ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n vec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n vec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n float lDistance = 1.0;\n if ( spotLightDistance[ i ] > 0.0 )\n lDistance = 1.0 - min( ( length( lVector ) / spotLightDistance[ i ] ), 1.0 );\n\n lVector = normalize( lVector );\n\n float spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\n\n if ( spotEffect > spotLightAngleCos[ i ] ) {\n\n spotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n // diffuse\n\n float dotProduct = dot( normal, lVector );\n\n #ifdef WRAP_AROUND\n\n float spotDiffuseWeightFull = max( dotProduct, 0.0 );\n float spotDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n vec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\n\n #else\n\n float spotDiffuseWeight = max( dotProduct, 0.0 );\n\n #endif\n\n spotDiffuse += diffuse * spotLightColor[ i ] * spotDiffuseWeight * lDistance * spotEffect;\n\n // specular\n\n vec3 spotHalfVector = normalize( lVector + viewPosition );\n float spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\n float spotSpecularWeight = specularStrength * max( pow( spotDotNormalHalf, shininess ), 0.0 );\n\n float specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n vec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, spotHalfVector ), 0.0 ), 5.0 );\n spotSpecular += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * lDistance * specularNormalization * spotEffect;\n\n }\n\n }\n\n#endif\n\n#if MAX_DIR_LIGHTS > 0\n\n vec3 dirDiffuse = vec3( 0.0 );\n vec3 dirSpecular = vec3( 0.0 );\n\n for( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );\n vec3 dirVector = normalize( lDirection.xyz );\n\n // diffuse\n\n float dotProduct = dot( normal, dirVector );\n\n #ifdef WRAP_AROUND\n\n float dirDiffuseWeightFull = max( dotProduct, 0.0 );\n float dirDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n vec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );\n\n #else\n\n float dirDiffuseWeight = max( dotProduct, 0.0 );\n\n #endif\n\n dirDiffuse += diffuse * directionalLightColor[ i ] * dirDiffuseWeight;\n\n // specular\n\n vec3 dirHalfVector = normalize( dirVector + viewPosition );\n float dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\n float dirSpecularWeight = specularStrength * max( pow( dirDotNormalHalf, shininess ), 0.0 );\n\n /*\n // fresnel term from skin shader\n const float F0 = 0.128;\n\n float base = 1.0 - dot( viewPosition, dirHalfVector );\n float exponential = pow( base, 5.0 );\n\n float fresnel = exponential + F0 * ( 1.0 - exponential );\n */\n\n /*\n // fresnel term from fresnel shader\n const float mFresnelBias = 0.08;\n const float mFresnelScale = 0.3;\n const float mFresnelPower = 5.0;\n\n float fresnel = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( -viewPosition ), normal ), mFresnelPower );\n */\n\n float specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n // dirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization * fresnel;\n\n vec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\n dirSpecular += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n\n\n }\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n vec3 hemiDiffuse = vec3( 0.0 );\n vec3 hemiSpecular = vec3( 0.0 );\n\n for( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n vec4 lDirection = viewMatrix * vec4( hemisphereLightDirection[ i ], 0.0 );\n vec3 lVector = normalize( lDirection.xyz );\n\n // diffuse\n\n float dotProduct = dot( normal, lVector );\n float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\n vec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n hemiDiffuse += diffuse * hemiColor;\n\n // specular (sky light)\n\n vec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\n float hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\n float hemiSpecularWeightSky = specularStrength * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\n\n // specular (ground light)\n\n vec3 lVectorGround = -lVector;\n\n vec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\n float hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\n float hemiSpecularWeightGround = specularStrength * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\n\n float dotProductGround = dot( normal, lVectorGround );\n\n float specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n vec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\n vec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\n hemiSpecular += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\n\n }\n\n#endif\n\nvec3 totalDiffuse = vec3( 0.0 );\nvec3 totalSpecular = vec3( 0.0 );\n\n#if MAX_DIR_LIGHTS > 0\n\n totalDiffuse += dirDiffuse;\n totalSpecular += dirSpecular;\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n totalDiffuse += hemiDiffuse;\n totalSpecular += hemiSpecular;\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n totalDiffuse += pointDiffuse;\n totalSpecular += pointSpecular;\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n totalDiffuse += spotDiffuse;\n totalSpecular += spotSpecular;\n\n#endif\n\n#ifdef METAL\n\n gl_FragColor.xyz = gl_FragColor.xyz * ( emissive + totalDiffuse + ambientLightColor * ambient + totalSpecular );\n\n#else\n\n gl_FragColor.xyz = gl_FragColor.xyz * ( emissive + totalDiffuse + ambientLightColor * ambient ) + totalSpecular;\n\n#endif",r.ShaderChunk.fog_pars_fragment="#ifdef USE_FOG\n\n uniform vec3 fogColor;\n\n #ifdef FOG_EXP2\n\n uniform float fogDensity;\n\n #else\n\n uniform float fogNear;\n uniform float fogFar;\n #endif\n\n#endif",r.ShaderChunk.morphnormal_vertex="#ifdef USE_MORPHNORMALS\n\n vec3 morphedNormal = vec3( 0.0 );\n\n morphedNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n morphedNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n morphedNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n morphedNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n\n morphedNormal += normal;\n\n#endif",r.ShaderChunk.envmap_pars_fragment="#ifdef USE_ENVMAP\n\n uniform float reflectivity;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n uniform float flipEnvMap;\n\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n uniform float refractionRatio;\n\n #else\n\n varying vec3 vReflect;\n\n #endif\n\n#endif\n",r.ShaderChunk.logdepthbuf_fragment="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\n gl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n\n#endif",r.ShaderChunk.normalmap_pars_fragment="#ifdef USE_NORMALMAP\n\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n\n // Per-Pixel Tangent Space Normal Mapping\n // http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\n\n vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( vUv.st );\n vec2 st1 = dFdy( vUv.st );\n\n vec3 S = normalize( q0 * st1.t - q1 * st0.t );\n vec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n vec3 N = normalize( surf_norm );\n\n vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n mapN.xy = normalScale * mapN.xy;\n mat3 tsn = mat3( S, T, N );\n return normalize( tsn * mapN );\n\n }\n\n#endif\n",r.ShaderChunk.lights_phong_pars_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n varying vec3 vWorldPosition;\n\n#endif\n",r.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n\n varying vec2 vUv2;\n uniform sampler2D lightMap;\n\n#endif",r.ShaderChunk.shadowmap_vertex="#ifdef USE_SHADOWMAP\n\n for( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n vShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n\n }\n\n#endif",r.ShaderChunk.lights_phong_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n vWorldPosition = worldPosition.xyz;\n\n#endif",r.ShaderChunk.map_fragment="#ifdef USE_MAP\n\n vec4 texelColor = texture2D( map, vUv );\n\n #ifdef GAMMA_INPUT\n\n texelColor.xyz *= texelColor.xyz;\n\n #endif\n\n gl_FragColor = gl_FragColor * texelColor;\n\n#endif",r.ShaderChunk.lightmap_vertex="#ifdef USE_LIGHTMAP\n\n vUv2 = uv2;\n\n#endif",r.ShaderChunk.map_particle_fragment="#ifdef USE_MAP\n\n gl_FragColor = gl_FragColor * texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) );\n\n#endif",r.ShaderChunk.color_pars_fragment="#ifdef USE_COLOR\n\n varying vec3 vColor;\n\n#endif\n",r.ShaderChunk.color_vertex="#ifdef USE_COLOR\n\n #ifdef GAMMA_INPUT\n\n vColor = color * color;\n\n #else\n\n vColor = color;\n\n #endif\n\n#endif",r.ShaderChunk.skinning_vertex="#ifdef USE_SKINNING\n\n #ifdef USE_MORPHTARGETS\n\n vec4 skinVertex = bindMatrix * vec4( morphed, 1.0 );\n\n #else\n\n vec4 skinVertex = bindMatrix * vec4( position, 1.0 );\n\n #endif\n\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n skinned = bindMatrixInverse * skinned;\n\n#endif\n",r.ShaderChunk.envmap_pars_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n varying vec3 vReflect;\n\n uniform float refractionRatio;\n\n#endif\n",r.ShaderChunk.linear_to_gamma_fragment="#ifdef GAMMA_OUTPUT\n\n gl_FragColor.xyz = sqrt( gl_FragColor.xyz );\n\n#endif",r.ShaderChunk.color_pars_vertex="#ifdef USE_COLOR\n\n varying vec3 vColor;\n\n#endif",r.ShaderChunk.lights_lambert_pars_vertex="uniform vec3 ambient;\nuniform vec3 diffuse;\nuniform vec3 emissive;\n\nuniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n uniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n uniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n uniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n uniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n uniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#ifdef WRAP_AROUND\n\n uniform vec3 wrapRGB;\n\n#endif\n",r.ShaderChunk.map_pars_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n varying vec2 vUv;\n uniform vec4 offsetRepeat;\n\n#endif\n",r.ShaderChunk.envmap_fragment="#ifdef USE_ENVMAP\n\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n vec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\n // http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\n // Transforming Normal Vectors with the Inverse Transformation\n\n vec3 worldNormal = normalize( vec3( vec4( normal, 0.0 ) * viewMatrix ) );\n\n #ifdef ENVMAP_MODE_REFLECTION\n\n vec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\n #else\n\n vec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\n #endif\n\n #else\n\n vec3 reflectVec = vReflect;\n\n #endif\n\n #ifdef DOUBLE_SIDED\n float flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n #else\n float flipNormal = 1.0;\n #endif\n\n #ifdef ENVMAP_TYPE_CUBE\n vec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n #elif defined( ENVMAP_TYPE_EQUIREC )\n vec2 sampleUV;\n sampleUV.y = clamp( flipNormal * reflectVec.y * 0.5 + 0.5, 0.0, 1.0);\n sampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * 0.15915494309189533576888376337251 + 0.5; // reciprocal( 2 PI ) + 0.5\n vec4 envColor = texture2D( envMap, sampleUV );\n \n #elif defined( ENVMAP_TYPE_SPHERE )\n vec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n vec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n #endif\n\n #ifdef GAMMA_INPUT\n\n envColor.xyz *= envColor.xyz;\n\n #endif\n\n #ifdef ENVMAP_BLENDING_MULTIPLY\n\n gl_FragColor.xyz = mix( gl_FragColor.xyz, gl_FragColor.xyz * envColor.xyz, specularStrength * reflectivity );\n\n #elif defined( ENVMAP_BLENDING_MIX )\n\n gl_FragColor.xyz = mix( gl_FragColor.xyz, envColor.xyz, specularStrength * reflectivity );\n\n #elif defined( ENVMAP_BLENDING_ADD )\n\n gl_FragColor.xyz += envColor.xyz * specularStrength * reflectivity;\n\n #endif\n\n#endif\n",r.ShaderChunk.specularmap_pars_fragment="#ifdef USE_SPECULARMAP\n\n uniform sampler2D specularMap;\n\n#endif",r.ShaderChunk.logdepthbuf_vertex="#ifdef USE_LOGDEPTHBUF\n\n gl_Position.z = log2(max(1e-6, gl_Position.w + 1.0)) * logDepthBufFC;\n\n #ifdef USE_LOGDEPTHBUF_EXT\n\n vFragDepth = 1.0 + gl_Position.w;\n\n#else\n\n gl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\n #endif\n\n#endif",r.ShaderChunk.morphtarget_pars_vertex="#ifdef USE_MORPHTARGETS\n\n #ifndef USE_MORPHNORMALS\n\n uniform float morphTargetInfluences[ 8 ];\n\n #else\n\n uniform float morphTargetInfluences[ 4 ];\n\n #endif\n\n#endif",r.ShaderChunk.specularmap_fragment="float specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n vec4 texelSpecular = texture2D( specularMap, vUv );\n specularStrength = texelSpecular.r;\n\n#else\n\n specularStrength = 1.0;\n\n#endif",r.ShaderChunk.fog_fragment="#ifdef USE_FOG\n\n #ifdef USE_LOGDEPTHBUF_EXT\n\n float depth = gl_FragDepthEXT / gl_FragCoord.w;\n\n #else\n\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n\n #endif\n\n #ifdef FOG_EXP2\n\n const float LOG2 = 1.442695;\n float fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\n fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n\n #else\n\n float fogFactor = smoothstep( fogNear, fogFar, depth );\n\n #endif\n \n gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n\n#endif",r.ShaderChunk.bumpmap_pars_fragment="#ifdef USE_BUMPMAP\n\n uniform sampler2D bumpMap;\n uniform float bumpScale;\n\n // Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\n // http://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\n\n // Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n vec2 dHdxy_fwd() {\n\n vec2 dSTdx = dFdx( vUv );\n vec2 dSTdy = dFdy( vUv );\n\n float Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\n return vec2( dBx, dBy );\n\n }\n\n vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\n vec3 vSigmaX = dFdx( surf_pos );\n vec3 vSigmaY = dFdy( surf_pos );\n vec3 vN = surf_norm; // normalized\n\n vec3 R1 = cross( vSigmaY, vN );\n vec3 R2 = cross( vN, vSigmaX );\n\n float fDet = dot( vSigmaX, R1 );\n\n vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n return normalize( abs( fDet ) * surf_norm - vGrad );\n\n }\n\n#endif",r.ShaderChunk.defaultnormal_vertex="#ifdef USE_SKINNING\n\n vec3 objectNormal = skinnedNormal.xyz;\n\n#elif defined( USE_MORPHNORMALS )\n\n vec3 objectNormal = morphedNormal;\n\n#else\n\n vec3 objectNormal = normal;\n\n#endif\n\n#ifdef FLIP_SIDED\n\n objectNormal = -objectNormal;\n\n#endif\n\nvec3 transformedNormal = normalMatrix * objectNormal;\n",r.ShaderChunk.lights_phong_pars_fragment="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n uniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n uniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n uniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n uniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n uniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n uniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\n uniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n uniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n uniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n uniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n uniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n uniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n uniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\n uniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n varying vec3 vWorldPosition;\n\n#endif\n\n#ifdef WRAP_AROUND\n\n uniform vec3 wrapRGB;\n\n#endif\n\nvarying vec3 vViewPosition;\nvarying vec3 vNormal;",r.ShaderChunk.skinbase_vertex="#ifdef USE_SKINNING\n\n mat4 boneMatX = getBoneMatrix( skinIndex.x );\n mat4 boneMatY = getBoneMatrix( skinIndex.y );\n mat4 boneMatZ = getBoneMatrix( skinIndex.z );\n mat4 boneMatW = getBoneMatrix( skinIndex.w );\n\n#endif",r.ShaderChunk.map_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n vUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n\n#endif",r.ShaderChunk.lightmap_fragment="#ifdef USE_LIGHTMAP\n\n gl_FragColor = gl_FragColor * texture2D( lightMap, vUv2 );\n\n#endif",r.ShaderChunk.shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n\n varying vec4 vShadowCoord[ MAX_SHADOWS ];\n uniform mat4 shadowMatrix[ MAX_SHADOWS ];\n\n#endif",r.ShaderChunk.color_fragment="#ifdef USE_COLOR\n\n gl_FragColor = gl_FragColor * vec4( vColor, 1.0 );\n\n#endif",r.ShaderChunk.morphtarget_vertex="#ifdef USE_MORPHTARGETS\n\n vec3 morphed = vec3( 0.0 );\n morphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n morphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n morphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n morphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\n #ifndef USE_MORPHNORMALS\n\n morphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n morphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n morphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n morphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\n #endif\n\n morphed += position;\n\n#endif",r.ShaderChunk.envmap_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n vec3 worldNormal = mat3( modelMatrix[ 0 ].xyz, modelMatrix[ 1 ].xyz, modelMatrix[ 2 ].xyz ) * objectNormal;\n worldNormal = normalize( worldNormal );\n\n vec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n #ifdef ENVMAP_MODE_REFLECTION\n\n vReflect = reflect( cameraToVertex, worldNormal );\n\n #else\n\n vReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n #endif\n\n#endif\n",r.ShaderChunk.shadowmap_fragment="#ifdef USE_SHADOWMAP\n\n #ifdef SHADOWMAP_DEBUG\n\n vec3 frustumColors[3];\n frustumColors[0] = vec3( 1.0, 0.5, 0.0 );\n frustumColors[1] = vec3( 0.0, 1.0, 0.8 );\n frustumColors[2] = vec3( 0.0, 0.5, 1.0 );\n\n #endif\n\n #ifdef SHADOWMAP_CASCADE\n\n int inFrustumCount = 0;\n\n #endif\n\n float fDepth;\n vec3 shadowColor = vec3( 1.0 );\n\n for( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n vec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\n\n // if ( something && something ) breaks ATI OpenGL shader compiler\n // if ( all( something, something ) ) using this instead\n\n bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n bool inFrustum = all( inFrustumVec );\n\n // don't shadow pixels outside of light frustum\n // use just first frustum (for cascades)\n // don't shadow pixels behind far plane of light frustum\n\n #ifdef SHADOWMAP_CASCADE\n\n inFrustumCount += int( inFrustum );\n bvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );\n\n #else\n\n bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n #endif\n\n bool frustumTest = all( frustumTestVec );\n\n if ( frustumTest ) {\n\n shadowCoord.z += shadowBias[ i ];\n\n #if defined( SHADOWMAP_TYPE_PCF )\n\n // Percentage-close filtering\n // (9 pixel kernel)\n // http://fabiensanglard.net/shadowmappingPCF/\n\n float shadow = 0.0;\n\n /*\n // nested loops breaks shader compiler / validator on some ATI cards when using OpenGL\n // must enroll loop manually\n\n for ( float y = -1.25; y <= 1.25; y += 1.25 )\n for ( float x = -1.25; x <= 1.25; x += 1.25 ) {\n\n vec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\n\n // doesn't seem to produce any noticeable visual difference compared to simple texture2D lookup\n //vec4 rgbaDepth = texture2DProj( shadowMap[ i ], vec4( vShadowCoord[ i ].w * ( vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy ), 0.05, vShadowCoord[ i ].w ) );\n\n float fDepth = unpackDepth( rgbaDepth );\n\n if ( fDepth < shadowCoord.z )\n shadow += 1.0;\n\n }\n\n shadow /= 9.0;\n\n */\n\n const float shadowDelta = 1.0 / 9.0;\n\n float xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n float yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n float dx0 = -1.25 * xPixelOffset;\n float dy0 = -1.25 * yPixelOffset;\n float dx1 = 1.25 * xPixelOffset;\n float dy1 = 1.25 * yPixelOffset;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n fDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n if ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n shadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n #elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n // Percentage-close filtering\n // (9 pixel kernel)\n // http://fabiensanglard.net/shadowmappingPCF/\n\n float shadow = 0.0;\n\n float xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n float yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n float dx0 = -1.0 * xPixelOffset;\n float dy0 = -1.0 * yPixelOffset;\n float dx1 = 1.0 * xPixelOffset;\n float dy1 = 1.0 * yPixelOffset;\n\n mat3 shadowKernel;\n mat3 depthKernel;\n\n depthKernel[0][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n depthKernel[0][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n depthKernel[0][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n depthKernel[1][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n depthKernel[1][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n depthKernel[1][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n depthKernel[2][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n depthKernel[2][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n depthKernel[2][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\n vec3 shadowZ = vec3( shadowCoord.z );\n shadowKernel[0] = vec3(lessThan(depthKernel[0], shadowZ ));\n shadowKernel[0] *= vec3(0.25);\n\n shadowKernel[1] = vec3(lessThan(depthKernel[1], shadowZ ));\n shadowKernel[1] *= vec3(0.25);\n\n shadowKernel[2] = vec3(lessThan(depthKernel[2], shadowZ ));\n shadowKernel[2] *= vec3(0.25);\n\n vec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[i].xy );\n\n shadowKernel[0] = mix( shadowKernel[1], shadowKernel[0], fractionalCoord.x );\n shadowKernel[1] = mix( shadowKernel[2], shadowKernel[1], fractionalCoord.x );\n\n vec4 shadowValues;\n shadowValues.x = mix( shadowKernel[0][1], shadowKernel[0][0], fractionalCoord.y );\n shadowValues.y = mix( shadowKernel[0][2], shadowKernel[0][1], fractionalCoord.y );\n shadowValues.z = mix( shadowKernel[1][1], shadowKernel[1][0], fractionalCoord.y );\n shadowValues.w = mix( shadowKernel[1][2], shadowKernel[1][1], fractionalCoord.y );\n\n shadow = dot( shadowValues, vec4( 1.0 ) );\n\n shadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n #else\n\n vec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\n float fDepth = unpackDepth( rgbaDepth );\n\n if ( fDepth < shadowCoord.z )\n\n // spot with multiple shadows is darker\n\n shadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );\n\n // spot with multiple shadows has the same color as single shadow spot\n\n // shadowColor = min( shadowColor, vec3( shadowDarkness[ i ] ) );\n\n #endif\n\n }\n\n\n #ifdef SHADOWMAP_DEBUG\n\n #ifdef SHADOWMAP_CASCADE\n\n if ( inFrustum && inFrustumCount == 1 ) gl_FragColor.xyz *= frustumColors[ i ];\n\n #else\n\n if ( inFrustum ) gl_FragColor.xyz *= frustumColors[ i ];\n\n #endif\n\n #endif\n\n }\n\n #ifdef GAMMA_OUTPUT\n\n shadowColor *= shadowColor;\n\n #endif\n\n gl_FragColor.xyz = gl_FragColor.xyz * shadowColor;\n\n#endif\n",r.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\n #ifdef USE_SKINNING\n\n vec4 worldPosition = modelMatrix * skinned;\n\n #elif defined( USE_MORPHTARGETS )\n\n vec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n\n #else\n\n vec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\n #endif\n\n#endif\n",r.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\n uniform sampler2D shadowMap[ MAX_SHADOWS ];\n uniform vec2 shadowMapSize[ MAX_SHADOWS ];\n\n uniform float shadowDarkness[ MAX_SHADOWS ];\n uniform float shadowBias[ MAX_SHADOWS ];\n\n varying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n float unpackDepth( const in vec4 rgba_depth ) {\n\n const vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n float depth = dot( rgba_depth, bit_shift );\n return depth;\n\n }\n\n#endif",r.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n\n uniform mat4 bindMatrix;\n uniform mat4 bindMatrixInverse;\n\n #ifdef BONE_TEXTURE\n\n uniform sampler2D boneTexture;\n uniform int boneTextureWidth;\n uniform int boneTextureHeight;\n\n mat4 getBoneMatrix( const in float i ) {\n\n float j = i * 4.0;\n float x = mod( j, float( boneTextureWidth ) );\n float y = floor( j / float( boneTextureWidth ) );\n\n float dx = 1.0 / float( boneTextureWidth );\n float dy = 1.0 / float( boneTextureHeight );\n\n y = dy * ( y + 0.5 );\n\n vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n mat4 bone = mat4( v1, v2, v3, v4 );\n\n return bone;\n\n }\n\n #else\n\n uniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\n mat4 getBoneMatrix( const in float i ) {\n\n mat4 bone = boneGlobalMatrices[ int(i) ];\n return bone;\n\n }\n\n #endif\n\n#endif\n",r.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n\n uniform float logDepthBufFC;\n\n #ifdef USE_LOGDEPTHBUF_EXT\n\n #extension GL_EXT_frag_depth : enable\n varying float vFragDepth;\n\n #endif\n\n#endif",r.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n\n gl_FragColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n",r.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n\n uniform sampler2D alphaMap;\n\n#endif\n",r.UniformsUtils={merge:function(e){for(var t={},r=0;r<e.length;r++){var n=this.clone(e[r]);
for(var i in n)t[i]=n[i]}return t},clone:function(e){var t={};for(var n in e){t[n]={};for(var i in e[n]){var o=e[n][i];t[n][i]=o instanceof r.Color||o instanceof r.Vector2||o instanceof r.Vector3||o instanceof r.Vector4||o instanceof r.Matrix4||o instanceof r.Texture?o.clone():o instanceof Array?o.slice():o}}return t}},r.UniformsLib={common:{diffuse:{type:"c",value:new r.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new r.Vector4(0,0,1,1)},lightMap:{type:"t",value:null},specularMap:{type:"t",value:null},alphaMap:{type:"t",value:null},envMap:{type:"t",value:null},flipEnvMap:{type:"f",value:-1},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:.98},morphTargetInfluences:{type:"f",value:0}},bump:{bumpMap:{type:"t",value:null},bumpScale:{type:"f",value:1}},normalmap:{normalMap:{type:"t",value:null},normalScale:{type:"v2",value:new r.Vector2(1,1)}},fog:{fogDensity:{type:"f",value:25e-5},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},fogColor:{type:"c",value:new r.Color(16777215)}},lights:{ambientLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]},directionalLightColor:{type:"fv",value:[]},hemisphereLightDirection:{type:"fv",value:[]},hemisphereLightSkyColor:{type:"fv",value:[]},hemisphereLightGroundColor:{type:"fv",value:[]},pointLightColor:{type:"fv",value:[]},pointLightPosition:{type:"fv",value:[]},pointLightDistance:{type:"fv1",value:[]},spotLightColor:{type:"fv",value:[]},spotLightPosition:{type:"fv",value:[]},spotLightDirection:{type:"fv",value:[]},spotLightDistance:{type:"fv1",value:[]},spotLightAngleCos:{type:"fv1",value:[]},spotLightExponent:{type:"fv1",value:[]}},particle:{psColor:{type:"c",value:new r.Color(15658734)},opacity:{type:"f",value:1},size:{type:"f",value:1},scale:{type:"f",value:1},map:{type:"t",value:null},fogDensity:{type:"f",value:25e-5},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},fogColor:{type:"c",value:new r.Color(16777215)}},shadowmap:{shadowMap:{type:"tv",value:[]},shadowMapSize:{type:"v2v",value:[]},shadowBias:{type:"fv1",value:[]},shadowDarkness:{type:"fv1",value:[]},shadowMatrix:{type:"m4v",value:[]}}},r.ShaderLib={basic:{uniforms:r.UniformsUtils.merge([r.UniformsLib.common,r.UniformsLib.fog,r.UniformsLib.shadowmap]),vertexShader:[r.ShaderChunk.map_pars_vertex,r.ShaderChunk.lightmap_pars_vertex,r.ShaderChunk.envmap_pars_vertex,r.ShaderChunk.color_pars_vertex,r.ShaderChunk.morphtarget_pars_vertex,r.ShaderChunk.skinning_pars_vertex,r.ShaderChunk.shadowmap_pars_vertex,r.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",r.ShaderChunk.map_vertex,r.ShaderChunk.lightmap_vertex,r.ShaderChunk.color_vertex,r.ShaderChunk.skinbase_vertex," #ifdef USE_ENVMAP",r.ShaderChunk.morphnormal_vertex,r.ShaderChunk.skinnormal_vertex,r.ShaderChunk.defaultnormal_vertex," #endif",r.ShaderChunk.morphtarget_vertex,r.ShaderChunk.skinning_vertex,r.ShaderChunk.default_vertex,r.ShaderChunk.logdepthbuf_vertex,r.ShaderChunk.worldpos_vertex,r.ShaderChunk.envmap_vertex,r.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;","uniform float opacity;",r.ShaderChunk.color_pars_fragment,r.ShaderChunk.map_pars_fragment,r.ShaderChunk.alphamap_pars_fragment,r.ShaderChunk.lightmap_pars_fragment,r.ShaderChunk.envmap_pars_fragment,r.ShaderChunk.fog_pars_fragment,r.ShaderChunk.shadowmap_pars_fragment,r.ShaderChunk.specularmap_pars_fragment,r.ShaderChunk.logdepthbuf_pars_fragment,"void main() {"," gl_FragColor = vec4( diffuse, opacity );",r.ShaderChunk.logdepthbuf_fragment,r.ShaderChunk.map_fragment,r.ShaderChunk.alphamap_fragment,r.ShaderChunk.alphatest_fragment,r.ShaderChunk.specularmap_fragment,r.ShaderChunk.lightmap_fragment,r.ShaderChunk.color_fragment,r.ShaderChunk.envmap_fragment,r.ShaderChunk.shadowmap_fragment,r.ShaderChunk.linear_to_gamma_fragment,r.ShaderChunk.fog_fragment,"}"].join("\n")},lambert:{uniforms:r.UniformsUtils.merge([r.UniformsLib.common,r.UniformsLib.fog,r.UniformsLib.lights,r.UniformsLib.shadowmap,{ambient:{type:"c",value:new r.Color(16777215)},emissive:{type:"c",value:new r.Color(0)},wrapRGB:{type:"v3",value:new r.Vector3(1,1,1)}}]),vertexShader:["#define LAMBERT","varying vec3 vLightFront;","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;","#endif",r.ShaderChunk.map_pars_vertex,r.ShaderChunk.lightmap_pars_vertex,r.ShaderChunk.envmap_pars_vertex,r.ShaderChunk.lights_lambert_pars_vertex,r.ShaderChunk.color_pars_vertex,r.ShaderChunk.morphtarget_pars_vertex,r.ShaderChunk.skinning_pars_vertex,r.ShaderChunk.shadowmap_pars_vertex,r.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",r.ShaderChunk.map_vertex,r.ShaderChunk.lightmap_vertex,r.ShaderChunk.color_vertex,r.ShaderChunk.morphnormal_vertex,r.ShaderChunk.skinbase_vertex,r.ShaderChunk.skinnormal_vertex,r.ShaderChunk.defaultnormal_vertex,r.ShaderChunk.morphtarget_vertex,r.ShaderChunk.skinning_vertex,r.ShaderChunk.default_vertex,r.ShaderChunk.logdepthbuf_vertex,r.ShaderChunk.worldpos_vertex,r.ShaderChunk.envmap_vertex,r.ShaderChunk.lights_lambert_vertex,r.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;","varying vec3 vLightFront;","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;","#endif",r.ShaderChunk.color_pars_fragment,r.ShaderChunk.map_pars_fragment,r.ShaderChunk.alphamap_pars_fragment,r.ShaderChunk.lightmap_pars_fragment,r.ShaderChunk.envmap_pars_fragment,r.ShaderChunk.fog_pars_fragment,r.ShaderChunk.shadowmap_pars_fragment,r.ShaderChunk.specularmap_pars_fragment,r.ShaderChunk.logdepthbuf_pars_fragment,"void main() {"," gl_FragColor = vec4( vec3( 1.0 ), opacity );",r.ShaderChunk.logdepthbuf_fragment,r.ShaderChunk.map_fragment,r.ShaderChunk.alphamap_fragment,r.ShaderChunk.alphatest_fragment,r.ShaderChunk.specularmap_fragment," #ifdef DOUBLE_SIDED"," if ( gl_FrontFacing )"," gl_FragColor.xyz *= vLightFront;"," else"," gl_FragColor.xyz *= vLightBack;"," #else"," gl_FragColor.xyz *= vLightFront;"," #endif",r.ShaderChunk.lightmap_fragment,r.ShaderChunk.color_fragment,r.ShaderChunk.envmap_fragment,r.ShaderChunk.shadowmap_fragment,r.ShaderChunk.linear_to_gamma_fragment,r.ShaderChunk.fog_fragment,"}"].join("\n")},phong:{uniforms:r.UniformsUtils.merge([r.UniformsLib.common,r.UniformsLib.bump,r.UniformsLib.normalmap,r.UniformsLib.fog,r.UniformsLib.lights,r.UniformsLib.shadowmap,{ambient:{type:"c",value:new r.Color(16777215)},emissive:{type:"c",value:new r.Color(0)},specular:{type:"c",value:new r.Color(1118481)},shininess:{type:"f",value:30},wrapRGB:{type:"v3",value:new r.Vector3(1,1,1)}}]),vertexShader:["#define PHONG","varying vec3 vViewPosition;","varying vec3 vNormal;",r.ShaderChunk.map_pars_vertex,r.ShaderChunk.lightmap_pars_vertex,r.ShaderChunk.envmap_pars_vertex,r.ShaderChunk.lights_phong_pars_vertex,r.ShaderChunk.color_pars_vertex,r.ShaderChunk.morphtarget_pars_vertex,r.ShaderChunk.skinning_pars_vertex,r.ShaderChunk.shadowmap_pars_vertex,r.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",r.ShaderChunk.map_vertex,r.ShaderChunk.lightmap_vertex,r.ShaderChunk.color_vertex,r.ShaderChunk.morphnormal_vertex,r.ShaderChunk.skinbase_vertex,r.ShaderChunk.skinnormal_vertex,r.ShaderChunk.defaultnormal_vertex," vNormal = normalize( transformedNormal );",r.ShaderChunk.morphtarget_vertex,r.ShaderChunk.skinning_vertex,r.ShaderChunk.default_vertex,r.ShaderChunk.logdepthbuf_vertex," vViewPosition = -mvPosition.xyz;",r.ShaderChunk.worldpos_vertex,r.ShaderChunk.envmap_vertex,r.ShaderChunk.lights_phong_vertex,r.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["#define PHONG","uniform vec3 diffuse;","uniform float opacity;","uniform vec3 ambient;","uniform vec3 emissive;","uniform vec3 specular;","uniform float shininess;",r.ShaderChunk.color_pars_fragment,r.ShaderChunk.map_pars_fragment,r.ShaderChunk.alphamap_pars_fragment,r.ShaderChunk.lightmap_pars_fragment,r.ShaderChunk.envmap_pars_fragment,r.ShaderChunk.fog_pars_fragment,r.ShaderChunk.lights_phong_pars_fragment,r.ShaderChunk.shadowmap_pars_fragment,r.ShaderChunk.bumpmap_pars_fragment,r.ShaderChunk.normalmap_pars_fragment,r.ShaderChunk.specularmap_pars_fragment,r.ShaderChunk.logdepthbuf_pars_fragment,"void main() {"," gl_FragColor = vec4( vec3( 1.0 ), opacity );",r.ShaderChunk.logdepthbuf_fragment,r.ShaderChunk.map_fragment,r.ShaderChunk.alphamap_fragment,r.ShaderChunk.alphatest_fragment,r.ShaderChunk.specularmap_fragment,r.ShaderChunk.lights_phong_fragment,r.ShaderChunk.lightmap_fragment,r.ShaderChunk.color_fragment,r.ShaderChunk.envmap_fragment,r.ShaderChunk.shadowmap_fragment,r.ShaderChunk.linear_to_gamma_fragment,r.ShaderChunk.fog_fragment,"}"].join("\n")},particle_basic:{uniforms:r.UniformsUtils.merge([r.UniformsLib.particle,r.UniformsLib.shadowmap]),vertexShader:["uniform float size;","uniform float scale;",r.ShaderChunk.color_pars_vertex,r.ShaderChunk.shadowmap_pars_vertex,r.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",r.ShaderChunk.color_vertex," vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );"," #ifdef USE_SIZEATTENUATION"," gl_PointSize = size * ( scale / length( mvPosition.xyz ) );"," #else"," gl_PointSize = size;"," #endif"," gl_Position = projectionMatrix * mvPosition;",r.ShaderChunk.logdepthbuf_vertex,r.ShaderChunk.worldpos_vertex,r.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 psColor;","uniform float opacity;",r.ShaderChunk.color_pars_fragment,r.ShaderChunk.map_particle_pars_fragment,r.ShaderChunk.fog_pars_fragment,r.ShaderChunk.shadowmap_pars_fragment,r.ShaderChunk.logdepthbuf_pars_fragment,"void main() {"," gl_FragColor = vec4( psColor, opacity );",r.ShaderChunk.logdepthbuf_fragment,r.ShaderChunk.map_particle_fragment,r.ShaderChunk.alphatest_fragment,r.ShaderChunk.color_fragment,r.ShaderChunk.shadowmap_fragment,r.ShaderChunk.fog_fragment,"}"].join("\n")},dashed:{uniforms:r.UniformsUtils.merge([r.UniformsLib.common,r.UniformsLib.fog,{scale:{type:"f",value:1},dashSize:{type:"f",value:1},totalSize:{type:"f",value:2}}]),vertexShader:["uniform float scale;","attribute float lineDistance;","varying float vLineDistance;",r.ShaderChunk.color_pars_vertex,r.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",r.ShaderChunk.color_vertex," vLineDistance = scale * lineDistance;"," vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );"," gl_Position = projectionMatrix * mvPosition;",r.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;","uniform float opacity;","uniform float dashSize;","uniform float totalSize;","varying float vLineDistance;",r.ShaderChunk.color_pars_fragment,r.ShaderChunk.fog_pars_fragment,r.ShaderChunk.logdepthbuf_pars_fragment,"void main() {"," if ( mod( vLineDistance, totalSize ) > dashSize ) {"," discard;"," }"," gl_FragColor = vec4( diffuse, opacity );",r.ShaderChunk.logdepthbuf_fragment,r.ShaderChunk.color_fragment,r.ShaderChunk.fog_fragment,"}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2e3},opacity:{type:"f",value:1}},vertexShader:[r.ShaderChunk.morphtarget_pars_vertex,r.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",r.ShaderChunk.morphtarget_vertex,r.ShaderChunk.default_vertex,r.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float mNear;","uniform float mFar;","uniform float opacity;",r.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",r.ShaderChunk.logdepthbuf_fragment," #ifdef USE_LOGDEPTHBUF_EXT"," float depth = gl_FragDepthEXT / gl_FragCoord.w;"," #else"," float depth = gl_FragCoord.z / gl_FragCoord.w;"," #endif"," float color = 1.0 - smoothstep( mNear, mFar, depth );"," gl_FragColor = vec4( vec3( color ), opacity );","}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",r.ShaderChunk.morphtarget_pars_vertex,r.ShaderChunk.logdepthbuf_pars_vertex,"void main() {"," vNormal = normalize( normalMatrix * normal );",r.ShaderChunk.morphtarget_vertex,r.ShaderChunk.default_vertex,r.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;","varying vec3 vNormal;",r.ShaderChunk.logdepthbuf_pars_fragment,"void main() {"," gl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",r.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",r.ShaderChunk.logdepthbuf_pars_vertex,"void main() {"," vec4 worldPosition = modelMatrix * vec4( position, 1.0 );"," vWorldPosition = worldPosition.xyz;"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",r.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","uniform float tFlip;","varying vec3 vWorldPosition;",r.ShaderChunk.logdepthbuf_pars_fragment,"void main() {"," gl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",r.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",r.ShaderChunk.logdepthbuf_pars_vertex,"void main() {"," vec4 worldPosition = modelMatrix * vec4( position, 1.0 );"," vWorldPosition = worldPosition.xyz;"," gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",r.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;","uniform float tFlip;","varying vec3 vWorldPosition;",r.ShaderChunk.logdepthbuf_pars_fragment,"void main() {","vec3 direction = normalize( vWorldPosition );","vec2 sampleUV;","sampleUV.y = clamp( tFlip * direction.y * -0.5 + 0.5, 0.0, 1.0);","sampleUV.x = atan( direction.z, direction.x ) * 0.15915494309189533576888376337251 + 0.5;","gl_FragColor = texture2D( tEquirect, sampleUV );",r.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[r.ShaderChunk.morphtarget_pars_vertex,r.ShaderChunk.skinning_pars_vertex,r.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",r.ShaderChunk.skinbase_vertex,r.ShaderChunk.morphtarget_vertex,r.ShaderChunk.skinning_vertex,r.ShaderChunk.default_vertex,r.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[r.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {"," const vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );"," const vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );"," vec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );"," res -= res.xxyz * bit_mask;"," return res;","}","void main() {",r.ShaderChunk.logdepthbuf_fragment," #ifdef USE_LOGDEPTHBUF_EXT"," gl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );"," #else"," gl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );"," #endif","}"].join("\n")}},r.WebGLRenderer=function(e){function t(e){e.__webglVertexBuffer=jt.createBuffer(),e.__webglColorBuffer=jt.createBuffer(),Dt.info.memory.geometries++}function n(e){e.__webglVertexBuffer=jt.createBuffer(),e.__webglColorBuffer=jt.createBuffer(),e.__webglLineDistanceBuffer=jt.createBuffer(),Dt.info.memory.geometries++}function i(e){e.__webglVertexBuffer=jt.createBuffer(),e.__webglNormalBuffer=jt.createBuffer(),e.__webglTangentBuffer=jt.createBuffer(),e.__webglColorBuffer=jt.createBuffer(),e.__webglUVBuffer=jt.createBuffer(),e.__webglUV2Buffer=jt.createBuffer(),e.__webglSkinIndicesBuffer=jt.createBuffer(),e.__webglSkinWeightsBuffer=jt.createBuffer(),e.__webglFaceBuffer=jt.createBuffer(),e.__webglLineBuffer=jt.createBuffer();var t=e.numMorphTargets;if(t){e.__webglMorphTargetsBuffers=[];for(var r=0,n=t;n>r;r++)e.__webglMorphTargetsBuffers.push(jt.createBuffer())}var i=e.numMorphNormals;if(i){e.__webglMorphNormalsBuffers=[];for(var r=0,n=i;n>r;r++)e.__webglMorphNormalsBuffers.push(jt.createBuffer())}Dt.info.memory.geometries++}function o(e){var t=e.geometry,r=e.material,n=t.vertices.length;if(r.attributes){void 0===t.__webglCustomAttributesList&&(t.__webglCustomAttributesList=[]);for(var i in r.attributes){var o=r.attributes[i];if(!o.__webglInitialized||o.createUniqueBuffers){o.__webglInitialized=!0;var a=1;"v2"===o.type?a=2:"v3"===o.type?a=3:"v4"===o.type?a=4:"c"===o.type&&(a=3),o.size=a,o.array=new Float32Array(n*a),o.buffer=jt.createBuffer(),o.buffer.belongsToAttribute=i,o.needsUpdate=!0}t.__webglCustomAttributesList.push(o)}}}function a(e,t){var r=e.vertices.length;e.__vertexArray=new Float32Array(3*r),e.__colorArray=new Float32Array(3*r),e.__sortArray=[],e.__webglParticleCount=r,o(t)}function s(e,t){var r=e.vertices.length;e.__vertexArray=new Float32Array(3*r),e.__colorArray=new Float32Array(3*r),e.__lineDistanceArray=new Float32Array(1*r),e.__webglLineCount=r,o(t)}function u(e,t){var r=t.geometry,n=e.faces3,i=3*n.length,o=1*n.length,a=3*n.length,s=c(t,e);e.__vertexArray=new Float32Array(3*i),e.__normalArray=new Float32Array(3*i),e.__colorArray=new Float32Array(3*i),e.__uvArray=new Float32Array(2*i),r.faceVertexUvs.length>1&&(e.__uv2Array=new Float32Array(2*i)),r.hasTangents&&(e.__tangentArray=new Float32Array(4*i)),t.geometry.skinWeights.length&&t.geometry.skinIndices.length&&(e.__skinIndexArray=new Float32Array(4*i),e.__skinWeightArray=new Float32Array(4*i));var u=null!==br.get("OES_element_index_uint")&&o>21845?Uint32Array:Uint16Array;e.__typeArray=u,e.__faceArray=new u(3*o),e.__lineArray=new u(2*a);var l=e.numMorphTargets;if(l){e.__morphTargetsArrays=[];for(var h=0,f=l;f>h;h++)e.__morphTargetsArrays.push(new Float32Array(3*i))}var p=e.numMorphNormals;if(p){e.__morphNormalsArrays=[];for(var h=0,f=p;f>h;h++)e.__morphNormalsArrays.push(new Float32Array(3*i))}if(e.__webglFaceCount=3*o,e.__webglLineCount=2*a,s.attributes){void 0===e.__webglCustomAttributesList&&(e.__webglCustomAttributesList=[]);for(var d in s.attributes){var m=s.attributes[d],v={};for(var g in m)v[g]=m[g];if(!v.__webglInitialized||v.createUniqueBuffers){v.__webglInitialized=!0;var y=1;"v2"===v.type?y=2:"v3"===v.type?y=3:"v4"===v.type?y=4:"c"===v.type&&(y=3),v.size=y,v.array=new Float32Array(i*y),v.buffer=jt.createBuffer(),v.buffer.belongsToAttribute=d,m.needsUpdate=!0,v.__original=m}e.__webglCustomAttributesList.push(v)}}e.__inittedArrays=!0}function c(e,t){return e.material instanceof r.MeshFaceMaterial?e.material.materials[t.materialIndex]:e.material}function l(e){return e&&void 0!==e.shading&&e.shading===r.SmoothShading}function h(e,t){var r,n,i,o,a,s,u,c,l,h,f,p=e.vertices,d=p.length,m=e.colors,v=m.length,g=e.__vertexArray,y=e.__colorArray,b=(e.__sortArray,e.verticesNeedUpdate),x=(e.elementsNeedUpdate,e.colorsNeedUpdate),w=e.__webglCustomAttributesList;if(b){for(r=0;d>r;r++)i=p[r],o=3*r,g[o]=i.x,g[o+1]=i.y,g[o+2]=i.z;jt.bindBuffer(jt.ARRAY_BUFFER,e.__webglVertexBuffer),jt.bufferData(jt.ARRAY_BUFFER,g,t)}if(x){for(n=0;v>n;n++)a=m[n],o=3*n,y[o]=a.r,y[o+1]=a.g,y[o+2]=a.b;jt.bindBuffer(jt.ARRAY_BUFFER,e.__webglColorBuffer),jt.bufferData(jt.ARRAY_BUFFER,y,t)}if(w)for(s=0,u=w.length;u>s;s++){if(f=w[s],f.needsUpdate&&(void 0===f.boundTo||"vertices"===f.boundTo))if(l=f.value.length,o=0,1===f.size)for(c=0;l>c;c++)f.array[c]=f.value[c];else if(2===f.size)for(c=0;l>c;c++)h=f.value[c],f.array[o]=h.x,f.array[o+1]=h.y,o+=2;else if(3===f.size)if("c"===f.type)for(c=0;l>c;c++)h=f.value[c],f.array[o]=h.r,f.array[o+1]=h.g,f.array[o+2]=h.b,o+=3;else for(c=0;l>c;c++)h=f.value[c],f.array[o]=h.x,f.array[o+1]=h.y,f.array[o+2]=h.z,o+=3;else if(4===f.size)for(c=0;l>c;c++)h=f.value[c],f.array[o]=h.x,f.array[o+1]=h.y,f.array[o+2]=h.z,f.array[o+3]=h.w,o+=4;jt.bindBuffer(jt.ARRAY_BUFFER,f.buffer),jt.bufferData(jt.ARRAY_BUFFER,f.array,t),f.needsUpdate=!1}}function f(e,t){var r,n,i,o,a,s,u,c,l,h,f,p,d=e.vertices,m=e.colors,v=e.lineDistances,g=d.length,y=m.length,b=v.length,x=e.__vertexArray,w=e.__colorArray,_=e.__lineDistanceArray,S=e.verticesNeedUpdate,M=e.colorsNeedUpdate,E=e.lineDistancesNeedUpdate,T=e.__webglCustomAttributesList;if(S){for(r=0;g>r;r++)o=d[r],a=3*r,x[a]=o.x,x[a+1]=o.y,x[a+2]=o.z;jt.bindBuffer(jt.ARRAY_BUFFER,e.__webglVertexBuffer),jt.bufferData(jt.ARRAY_BUFFER,x,t)}if(M){for(n=0;y>n;n++)s=m[n],a=3*n,w[a]=s.r,w[a+1]=s.g,w[a+2]=s.b;jt.bindBuffer(jt.ARRAY_BUFFER,e.__webglColorBuffer),jt.bufferData(jt.ARRAY_BUFFER,w,t)}if(E){for(i=0;b>i;i++)_[i]=v[i];jt.bindBuffer(jt.ARRAY_BUFFER,e.__webglLineDistanceBuffer),jt.bufferData(jt.ARRAY_BUFFER,_,t)}if(T)for(u=0,c=T.length;c>u;u++)if(p=T[u],p.needsUpdate&&(void 0===p.boundTo||"vertices"===p.boundTo)){if(a=0,h=p.value.length,1===p.size)for(l=0;h>l;l++)p.array[l]=p.value[l];else if(2===p.size)for(l=0;h>l;l++)f=p.value[l],p.array[a]=f.x,p.array[a+1]=f.y,a+=2;else if(3===p.size)if("c"===p.type)for(l=0;h>l;l++)f=p.value[l],p.array[a]=f.r,p.array[a+1]=f.g,p.array[a+2]=f.b,a+=3;else for(l=0;h>l;l++)f=p.value[l],p.array[a]=f.x,p.array[a+1]=f.y,p.array[a+2]=f.z,a+=3;else if(4===p.size)for(l=0;h>l;l++)f=p.value[l],p.array[a]=f.x,p.array[a+1]=f.y,p.array[a+2]=f.z,p.array[a+3]=f.w,a+=4;jt.bindBuffer(jt.ARRAY_BUFFER,p.buffer),jt.bufferData(jt.ARRAY_BUFFER,p.array,t),p.needsUpdate=!1}}function p(e,t,n,i,o){if(e.__inittedArrays){var a,s,u,c,h,f,p,d,m,v,g,y,b,x,w,_,S,M,E,T,C,A,$,k,P,R,O,L,F,j,D,N,U,V,B,I,z,G,H,W,q,X,Y=l(o),K=0,Q=0,Z=0,J=0,et=0,tt=0,rt=0,nt=0,it=0,ot=0,at=0,st=0,ut=0,ct=e.__vertexArray,lt=e.__uvArray,ht=e.__uv2Array,ft=e.__normalArray,pt=e.__tangentArray,dt=e.__colorArray,mt=e.__skinIndexArray,vt=e.__skinWeightArray,gt=e.__morphTargetsArrays,yt=e.__morphNormalsArrays,bt=e.__webglCustomAttributesList,xt=e.__faceArray,wt=e.__lineArray,_t=t.geometry,St=_t.verticesNeedUpdate,Mt=_t.elementsNeedUpdate,Et=_t.uvsNeedUpdate,Tt=_t.normalsNeedUpdate,Ct=_t.tangentsNeedUpdate,At=_t.colorsNeedUpdate,$t=_t.morphTargetsNeedUpdate,kt=_t.vertices,Pt=e.faces3,Rt=_t.faces,Ot=_t.faceVertexUvs[0],Lt=_t.faceVertexUvs[1],Ft=(_t.colors,_t.skinIndices),Dt=_t.skinWeights,Nt=_t.morphTargets,Ut=_t.morphNormals;if(St){for(a=0,s=Pt.length;s>a;a++)c=Rt[Pt[a]],y=kt[c.a],b=kt[c.b],x=kt[c.c],ct[Q]=y.x,ct[Q+1]=y.y,ct[Q+2]=y.z,ct[Q+3]=b.x,ct[Q+4]=b.y,ct[Q+5]=b.z,ct[Q+6]=x.x,ct[Q+7]=x.y,ct[Q+8]=x.z,Q+=9;jt.bindBuffer(jt.ARRAY_BUFFER,e.__webglVertexBuffer),jt.bufferData(jt.ARRAY_BUFFER,ct,n)}if($t)for(B=0,I=Nt.length;I>B;B++){for(at=0,a=0,s=Pt.length;s>a;a++)H=Pt[a],c=Rt[H],y=Nt[B].vertices[c.a],b=Nt[B].vertices[c.b],x=Nt[B].vertices[c.c],z=gt[B],z[at]=y.x,z[at+1]=y.y,z[at+2]=y.z,z[at+3]=b.x,z[at+4]=b.y,z[at+5]=b.z,z[at+6]=x.x,z[at+7]=x.y,z[at+8]=x.z,o.morphNormals&&(Y?(W=Ut[B].vertexNormals[H],M=W.a,E=W.b,T=W.c):(M=Ut[B].faceNormals[H],E=M,T=M),G=yt[B],G[at]=M.x,G[at+1]=M.y,G[at+2]=M.z,G[at+3]=E.x,G[at+4]=E.y,G[at+5]=E.z,G[at+6]=T.x,G[at+7]=T.y,G[at+8]=T.z),at+=9;jt.bindBuffer(jt.ARRAY_BUFFER,e.__webglMorphTargetsBuffers[B]),jt.bufferData(jt.ARRAY_BUFFER,gt[B],n),o.morphNormals&&(jt.bindBuffer(jt.ARRAY_BUFFER,e.__webglMorphNormalsBuffers[B]),jt.bufferData(jt.ARRAY_BUFFER,yt[B],n))}if(Dt.length){for(a=0,s=Pt.length;s>a;a++)c=Rt[Pt[a]],k=Dt[c.a],P=Dt[c.b],R=Dt[c.c],vt[ot]=k.x,vt[ot+1]=k.y,vt[ot+2]=k.z,vt[ot+3]=k.w,vt[ot+4]=P.x,vt[ot+5]=P.y,vt[ot+6]=P.z,vt[ot+7]=P.w,vt[ot+8]=R.x,vt[ot+9]=R.y,vt[ot+10]=R.z,vt[ot+11]=R.w,O=Ft[c.a],L=Ft[c.b],F=Ft[c.c],mt[ot]=O.x,mt[ot+1]=O.y,mt[ot+2]=O.z,mt[ot+3]=O.w,mt[ot+4]=L.x,mt[ot+5]=L.y,mt[ot+6]=L.z,mt[ot+7]=L.w,mt[ot+8]=F.x,mt[ot+9]=F.y,mt[ot+10]=F.z,mt[ot+11]=F.w,ot+=12;ot>0&&(jt.bindBuffer(jt.ARRAY_BUFFER,e.__webglSkinIndicesBuffer),jt.bufferData(jt.ARRAY_BUFFER,mt,n),jt.bindBuffer(jt.ARRAY_BUFFER,e.__webglSkinWeightsBuffer),jt.bufferData(jt.ARRAY_BUFFER,vt,n))}if(At){for(a=0,s=Pt.length;s>a;a++)c=Rt[Pt[a]],p=c.vertexColors,d=c.color,3===p.length&&o.vertexColors===r.VertexColors?(C=p[0],A=p[1],$=p[2]):(C=d,A=d,$=d),dt[it]=C.r,dt[it+1]=C.g,dt[it+2]=C.b,dt[it+3]=A.r,dt[it+4]=A.g,dt[it+5]=A.b,dt[it+6]=$.r,dt[it+7]=$.g,dt[it+8]=$.b,it+=9;it>0&&(jt.bindBuffer(jt.ARRAY_BUFFER,e.__webglColorBuffer),jt.bufferData(jt.ARRAY_BUFFER,dt,n))}if(Ct&&_t.hasTangents){for(a=0,s=Pt.length;s>a;a++)c=Rt[Pt[a]],m=c.vertexTangents,w=m[0],_=m[1],S=m[2],pt[rt]=w.x,pt[rt+1]=w.y,pt[rt+2]=w.z,pt[rt+3]=w.w,pt[rt+4]=_.x,pt[rt+5]=_.y,pt[rt+6]=_.z,pt[rt+7]=_.w,pt[rt+8]=S.x,pt[rt+9]=S.y,pt[rt+10]=S.z,pt[rt+11]=S.w,rt+=12;jt.bindBuffer(jt.ARRAY_BUFFER,e.__webglTangentBuffer),jt.bufferData(jt.ARRAY_BUFFER,pt,n)}if(Tt){for(a=0,s=Pt.length;s>a;a++)if(c=Rt[Pt[a]],h=c.vertexNormals,f=c.normal,3===h.length&&Y)for(j=0;3>j;j++)N=h[j],ft[tt]=N.x,ft[tt+1]=N.y,ft[tt+2]=N.z,tt+=3;else for(j=0;3>j;j++)ft[tt]=f.x,ft[tt+1]=f.y,ft[tt+2]=f.z,tt+=3;jt.bindBuffer(jt.ARRAY_BUFFER,e.__webglNormalBuffer),jt.bufferData(jt.ARRAY_BUFFER,ft,n)}if(Et&&Ot){for(a=0,s=Pt.length;s>a;a++)if(u=Pt[a],v=Ot[u],void 0!==v)for(j=0;3>j;j++)U=v[j],lt[Z]=U.x,lt[Z+1]=U.y,Z+=2;Z>0&&(jt.bindBuffer(jt.ARRAY_BUFFER,e.__webglUVBuffer),jt.bufferData(jt.ARRAY_BUFFER,lt,n))}if(Et&&Lt){for(a=0,s=Pt.length;s>a;a++)if(u=Pt[a],g=Lt[u],void 0!==g)for(j=0;3>j;j++)V=g[j],ht[J]=V.x,ht[J+1]=V.y,J+=2;J>0&&(jt.bindBuffer(jt.ARRAY_BUFFER,e.__webglUV2Buffer),jt.bufferData(jt.ARRAY_BUFFER,ht,n))}if(Mt){for(a=0,s=Pt.length;s>a;a++)xt[et]=K,xt[et+1]=K+1,xt[et+2]=K+2,et+=3,wt[nt]=K,wt[nt+1]=K+1,wt[nt+2]=K,wt[nt+3]=K+2,wt[nt+4]=K+1,wt[nt+5]=K+2,nt+=6,K+=3;jt.bindBuffer(jt.ELEMENT_ARRAY_BUFFER,e.__webglFaceBuffer),jt.bufferData(jt.ELEMENT_ARRAY_BUFFER,xt,n),jt.bindBuffer(jt.ELEMENT_ARRAY_BUFFER,e.__webglLineBuffer),jt.bufferData(jt.ELEMENT_ARRAY_BUFFER,wt,n)}if(bt)for(j=0,D=bt.length;D>j;j++)if(X=bt[j],X.__original.needsUpdate){if(st=0,ut=0,1===X.size){if(void 0===X.boundTo||"vertices"===X.boundTo)for(a=0,s=Pt.length;s>a;a++)c=Rt[Pt[a]],X.array[st]=X.value[c.a],X.array[st+1]=X.value[c.b],X.array[st+2]=X.value[c.c],st+=3;else if("faces"===X.boundTo)for(a=0,s=Pt.length;s>a;a++)q=X.value[Pt[a]],X.array[st]=q,X.array[st+1]=q,X.array[st+2]=q,st+=3}else if(2===X.size){if(void 0===X.boundTo||"vertices"===X.boundTo)for(a=0,s=Pt.length;s>a;a++)c=Rt[Pt[a]],y=X.value[c.a],b=X.value[c.b],x=X.value[c.c],X.array[st]=y.x,X.array[st+1]=y.y,X.array[st+2]=b.x,X.array[st+3]=b.y,X.array[st+4]=x.x,X.array[st+5]=x.y,st+=6;else if("faces"===X.boundTo)for(a=0,s=Pt.length;s>a;a++)q=X.value[Pt[a]],y=q,b=q,x=q,X.array[st]=y.x,X.array[st+1]=y.y,X.array[st+2]=b.x,X.array[st+3]=b.y,X.array[st+4]=x.x,X.array[st+5]=x.y,st+=6}else if(3===X.size){var Vt;if(Vt="c"===X.type?["r","g","b"]:["x","y","z"],void 0===X.boundTo||"vertices"===X.boundTo)for(a=0,s=Pt.length;s>a;a++)c=Rt[Pt[a]],y=X.value[c.a],b=X.value[c.b],x=X.value[c.c],X.array[st]=y[Vt[0]],X.array[st+1]=y[Vt[1]],X.array[st+2]=y[Vt[2]],X.array[st+3]=b[Vt[0]],X.array[st+4]=b[Vt[1]],X.array[st+5]=b[Vt[2]],X.array[st+6]=x[Vt[0]],X.array[st+7]=x[Vt[1]],X.array[st+8]=x[Vt[2]],st+=9;else if("faces"===X.boundTo)for(a=0,s=Pt.length;s>a;a++)q=X.value[Pt[a]],y=q,b=q,x=q,X.array[st]=y[Vt[0]],X.array[st+1]=y[Vt[1]],X.array[st+2]=y[Vt[2]],X.array[st+3]=b[Vt[0]],X.array[st+4]=b[Vt[1]],X.array[st+5]=b[Vt[2]],X.array[st+6]=x[Vt[0]],X.array[st+7]=x[Vt[1]],X.array[st+8]=x[Vt[2]],st+=9;else if("faceVertices"===X.boundTo)for(a=0,s=Pt.length;s>a;a++)q=X.value[Pt[a]],y=q[0],b=q[1],x=q[2],X.array[st]=y[Vt[0]],X.array[st+1]=y[Vt[1]],X.array[st+2]=y[Vt[2]],X.array[st+3]=b[Vt[0]],X.array[st+4]=b[Vt[1]],X.array[st+5]=b[Vt[2]],X.array[st+6]=x[Vt[0]],X.array[st+7]=x[Vt[1]],X.array[st+8]=x[Vt[2]],st+=9}else if(4===X.size)if(void 0===X.boundTo||"vertices"===X.boundTo)for(a=0,s=Pt.length;s>a;a++)c=Rt[Pt[a]],y=X.value[c.a],b=X.value[c.b],x=X.value[c.c],X.array[st]=y.x,X.array[st+1]=y.y,X.array[st+2]=y.z,X.array[st+3]=y.w,X.array[st+4]=b.x,X.array[st+5]=b.y,X.array[st+6]=b.z,X.array[st+7]=b.w,X.array[st+8]=x.x,X.array[st+9]=x.y,X.array[st+10]=x.z,X.array[st+11]=x.w,st+=12;else if("faces"===X.boundTo)for(a=0,s=Pt.length;s>a;a++)q=X.value[Pt[a]],y=q,b=q,x=q,X.array[st]=y.x,X.array[st+1]=y.y,X.array[st+2]=y.z,X.array[st+3]=y.w,X.array[st+4]=b.x,X.array[st+5]=b.y,X.array[st+6]=b.z,X.array[st+7]=b.w,X.array[st+8]=x.x,X.array[st+9]=x.y,X.array[st+10]=x.z,X.array[st+11]=x.w,st+=12;else if("faceVertices"===X.boundTo)for(a=0,s=Pt.length;s>a;a++)q=X.value[Pt[a]],y=q[0],b=q[1],x=q[2],X.array[st]=y.x,X.array[st+1]=y.y,X.array[st+2]=y.z,X.array[st+3]=y.w,X.array[st+4]=b.x,X.array[st+5]=b.y,X.array[st+6]=b.z,X.array[st+7]=b.w,X.array[st+8]=x.x,X.array[st+9]=x.y,X.array[st+10]=x.z,X.array[st+11]=x.w,st+=12;jt.bindBuffer(jt.ARRAY_BUFFER,X.buffer),jt.bufferData(jt.ARRAY_BUFFER,X.array,n)}i&&(delete e.__inittedArrays,delete e.__colorArray,delete e.__normalArray,delete e.__tangentArray,delete e.__uvArray,delete e.__uv2Array,delete e.__faceArray,delete e.__vertexArray,delete e.__lineArray,delete e.__skinIndexArray,delete e.__skinWeightArray)}}function d(e,t,r,n){for(var i=r.attributes,o=t.attributes,a=t.attributesKeys,s=0,u=a.length;u>s;s++){var c=a[s],l=o[c];if(l>=0){var h=i[c];if(void 0!==h){var f=h.itemSize;jt.bindBuffer(jt.ARRAY_BUFFER,h.buffer),v(l),jt.vertexAttribPointer(l,f,jt.FLOAT,!1,0,n*f*4)}else void 0!==e.defaultAttributeValues&&(2===e.defaultAttributeValues[c].length?jt.vertexAttrib2fv(l,e.defaultAttributeValues[c]):3===e.defaultAttributeValues[c].length&&jt.vertexAttrib3fv(l,e.defaultAttributeValues[c]))}}g()}function m(){for(var e=0,t=cr.length;t>e;e++)cr[e]=0}function v(e){cr[e]=1,0===lr[e]&&(jt.enableVertexAttribArray(e),lr[e]=1)}function g(){for(var e=0,t=lr.length;t>e;e++)lr[e]!==cr[e]&&(jt.disableVertexAttribArray(e),lr[e]=0)}function y(e,t,r){var n=e.program.attributes;if(-1!==r.morphTargetBase&&n.position>=0?(jt.bindBuffer(jt.ARRAY_BUFFER,t.__webglMorphTargetsBuffers[r.morphTargetBase]),v(n.position),jt.vertexAttribPointer(n.position,3,jt.FLOAT,!1,0,0)):n.position>=0&&(jt.bindBuffer(jt.ARRAY_BUFFER,t.__webglVertexBuffer),v(n.position),jt.vertexAttribPointer(n.position,3,jt.FLOAT,!1,0,0)),r.morphTargetForcedOrder.length)for(var i,o=0,a=r.morphTargetForcedOrder,s=r.morphTargetInfluences;o<e.numSupportedMorphTargets&&o<a.length;)i=n["morphTarget"+o],i>=0&&(jt.bindBuffer(jt.ARRAY_BUFFER,t.__webglMorphTargetsBuffers[a[o]]),v(i),jt.vertexAttribPointer(i,3,jt.FLOAT,!1,0,0)),i=n["morphNormal"+o],i>=0&&e.morphNormals&&(jt.bindBuffer(jt.ARRAY_BUFFER,t.__webglMorphNormalsBuffers[a[o]]),v(i),jt.vertexAttribPointer(i,3,jt.FLOAT,!1,0,0)),r.__webglMorphTargetInfluences[o]=s[a[o]],o++;else{for(var u=[],s=r.morphTargetInfluences,c=0,l=s.length;l>c;c++){var h=s[c];u.push([h,c])}u.length>e.numSupportedMorphTargets?(u.sort(w),u.length=e.numSupportedMorphTargets):u.length>e.numSupportedMorphNormals?u.sort(w):0===u.length&&u.push([0,0]);for(var i,o=0,f=e.numSupportedMorphTargets;f>o;o++)if(u[o]){var p=u[o][1];i=n["morphTarget"+o],i>=0&&(jt.bindBuffer(jt.ARRAY_BUFFER,t.__webglMorphTargetsBuffers[p]),v(i),jt.vertexAttribPointer(i,3,jt.FLOAT,!1,0,0)),i=n["morphNormal"+o],i>=0&&e.morphNormals&&(jt.bindBuffer(jt.ARRAY_BUFFER,t.__webglMorphNormalsBuffers[p]),v(i),jt.vertexAttribPointer(i,3,jt.FLOAT,!1,0,0)),r.__webglMorphTargetInfluences[o]=s[p]}else r.__webglMorphTargetInfluences[o]=0}null!==e.program.uniforms.morphTargetInfluences&&jt.uniform1fv(e.program.uniforms.morphTargetInfluences,r.__webglMorphTargetInfluences)}function b(e,t){return e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function x(e,t){return e.z!==t.z?t.z-e.z:e.id-t.id}function w(e,t){return t[0]-e[0]}function _(e){if(e.visible!==!1){if(e instanceof r.Scene||e instanceof r.Group);else if(C(e),e instanceof r.Light)$t.push(e);else if(e instanceof r.Sprite)Lt.push(e);else if(e instanceof r.LensFlare)Ft.push(e);else{var t=kt[e.id];if(t&&(e.frustumCulled===!1||hr.intersectsObject(e)===!0))for(var n=0,i=t.length;i>n;n++){var o=t[n];T(o),o.render=!0,Dt.sortObjects===!0&&(pr.setFromMatrixPosition(e.matrixWorld),pr.applyProjection(fr),o.z=pr.z)}}for(var n=0,i=e.children.length;i>n;n++)_(e.children[n])}}function S(e,t,n,i,o,a){for(var s,u=0,c=e.length;c>u;u++){var l=e[u],h=l.object,f=l.buffer;if(Z(h,t),a)s=a;else{if(s=l.material,!s)continue;o&&Dt.setBlending(s.blending,s.blendEquation,s.blendSrc,s.blendDst),Dt.setDepthTest(s.depthTest),Dt.setDepthWrite(s.depthWrite),nt(s.polygonOffset,s.polygonOffsetFactor,s.polygonOffsetUnits)}Dt.setMaterialFaces(s),f instanceof r.BufferGeometry?Dt.renderBufferDirect(t,n,i,s,f,h):Dt.renderBuffer(t,n,i,s,f,h)}}function M(e,t,r,n,i,o,a){for(var s,u=0,c=e.length;c>u;u++){var l=e[u],h=l.object;
if(h.visible){if(a)s=a;else{if(s=l[t],!s)continue;o&&Dt.setBlending(s.blending,s.blendEquation,s.blendSrc,s.blendDst),Dt.setDepthTest(s.depthTest),Dt.setDepthWrite(s.depthWrite),nt(s.polygonOffset,s.polygonOffsetFactor,s.polygonOffsetUnits)}Dt.renderImmediateObject(r,n,i,s,h)}}}function E(e){var t=e.object,r=t.material;r.transparent?(e.transparent=r,e.opaque=null):(e.opaque=r,e.transparent=null)}function T(e){var t=e.object,n=e.buffer,i=t.geometry,o=t.material;if(o instanceof r.MeshFaceMaterial){var a=i instanceof r.BufferGeometry?0:n.materialIndex;o=o.materials[a],e.material=o,o.transparent?Ot.push(e):Rt.push(e)}else o&&(e.material=o,o.transparent?Ot.push(e):Rt.push(e))}function C(e){void 0===e.__webglInit&&(e.__webglInit=!0,e._modelViewMatrix=new r.Matrix4,e._normalMatrix=new r.Matrix3,e.addEventListener("removed",Nr));var i=e.geometry;if(void 0===i||void 0===i.__webglInit&&(i.__webglInit=!0,i.addEventListener("dispose",Ur),i instanceof r.BufferGeometry?Dt.info.memory.geometries++:e instanceof r.Mesh?$(e,i):e instanceof r.Line?void 0===i.__webglVertexBuffer&&(n(i),s(i,e),i.verticesNeedUpdate=!0,i.colorsNeedUpdate=!0,i.lineDistancesNeedUpdate=!0):e instanceof r.PointCloud&&void 0===i.__webglVertexBuffer&&(t(i),a(i,e),i.verticesNeedUpdate=!0,i.colorsNeedUpdate=!0)),void 0===e.__webglActive)if(e.__webglActive=!0,e instanceof r.Mesh){if(i instanceof r.BufferGeometry)k(kt,i,e);else if(i instanceof r.Geometry)for(var o=Xr[i.id],u=0,c=o.length;c>u;u++)k(kt,o[u],e)}else e instanceof r.Line||e instanceof r.PointCloud?k(kt,i,e):(e instanceof r.ImmediateRenderObject||e.immediateRenderCallback)&&P(Pt,e)}function A(e,t){for(var r,n,i=br.get("OES_element_index_uint")?4294967296:65535,o={},a=e.morphTargets.length,s=e.morphNormals.length,u={},c=[],l=0,h=e.faces.length;h>l;l++){var f=e.faces[l],p=t?f.materialIndex:0;p in o||(o[p]={hash:p,counter:0}),r=o[p].hash+"_"+o[p].counter,r in u||(n={id:Yr++,faces3:[],materialIndex:p,vertices:0,numMorphTargets:a,numMorphNormals:s},u[r]=n,c.push(n)),u[r].vertices+3>i&&(o[p].counter+=1,r=o[p].hash+"_"+o[p].counter,r in u||(n={id:Yr++,faces3:[],materialIndex:p,vertices:0,numMorphTargets:a,numMorphNormals:s},u[r]=n,c.push(n))),u[r].faces3.push(l),u[r].vertices+=3}return c}function $(e,t){var n=e.material,o=!1;(void 0===Xr[t.id]||t.groupsNeedUpdate===!0)&&(delete kt[e.id],Xr[t.id]=A(t,n instanceof r.MeshFaceMaterial),t.groupsNeedUpdate=!1);for(var a=Xr[t.id],s=0,c=a.length;c>s;s++){var l=a[s];void 0===l.__webglVertexBuffer?(i(l),u(l,e),t.verticesNeedUpdate=!0,t.morphTargetsNeedUpdate=!0,t.elementsNeedUpdate=!0,t.uvsNeedUpdate=!0,t.normalsNeedUpdate=!0,t.tangentsNeedUpdate=!0,t.colorsNeedUpdate=!0,o=!0):o=!1,(o||void 0===e.__webglActive)&&k(kt,l,e)}e.__webglActive=!0}function k(e,t,r){var n=r.id;e[n]=e[n]||[],e[n].push({id:n,buffer:t,object:r,material:null,z:0})}function P(e,t){e.push({id:null,object:t,opaque:null,transparent:null,z:0})}function R(e){var t=e.geometry;if(t instanceof r.BufferGeometry)for(var n=t.attributes,i=t.attributesKeys,o=0,a=i.length;a>o;o++){var s=i[o],l=n[s];if(void 0===l.buffer&&(l.buffer=jt.createBuffer(),l.needsUpdate=!0),l.needsUpdate===!0){var d="index"===s?jt.ELEMENT_ARRAY_BUFFER:jt.ARRAY_BUFFER;jt.bindBuffer(d,l.buffer),jt.bufferData(d,l.array,jt.STATIC_DRAW),l.needsUpdate=!1}}else if(e instanceof r.Mesh){t.groupsNeedUpdate===!0&&$(e,t);for(var m=Xr[t.id],o=0,v=m.length;v>o;o++){var g=m[o],y=c(e,g);t.groupsNeedUpdate===!0&&u(g,e);var b=y.attributes&&O(y);(t.verticesNeedUpdate||t.morphTargetsNeedUpdate||t.elementsNeedUpdate||t.uvsNeedUpdate||t.normalsNeedUpdate||t.colorsNeedUpdate||t.tangentsNeedUpdate||b)&&p(g,e,jt.DYNAMIC_DRAW,!t.dynamic,y)}t.verticesNeedUpdate=!1,t.morphTargetsNeedUpdate=!1,t.elementsNeedUpdate=!1,t.uvsNeedUpdate=!1,t.normalsNeedUpdate=!1,t.colorsNeedUpdate=!1,t.tangentsNeedUpdate=!1,y.attributes&&L(y)}else if(e instanceof r.Line){var y=c(e,t),b=y.attributes&&O(y);(t.verticesNeedUpdate||t.colorsNeedUpdate||t.lineDistancesNeedUpdate||b)&&f(t,jt.DYNAMIC_DRAW),t.verticesNeedUpdate=!1,t.colorsNeedUpdate=!1,t.lineDistancesNeedUpdate=!1,y.attributes&&L(y)}else if(e instanceof r.PointCloud){var y=c(e,t),b=y.attributes&&O(y);(t.verticesNeedUpdate||t.colorsNeedUpdate||b)&&h(t,jt.DYNAMIC_DRAW,e),t.verticesNeedUpdate=!1,t.colorsNeedUpdate=!1,y.attributes&&L(y)}}function O(e){for(var t in e.attributes)if(e.attributes[t].needsUpdate)return!0;return!1}function L(e){for(var t in e.attributes)e.attributes[t].needsUpdate=!1}function F(e){e instanceof r.Mesh||e instanceof r.PointCloud||e instanceof r.Line?delete kt[e.id]:(e instanceof r.ImmediateRenderObject||e.immediateRenderCallback)&&j(Pt,e),delete e.__webglInit,delete e._modelViewMatrix,delete e._normalMatrix,delete e.__webglActive}function j(e,t){for(var r=e.length-1;r>=0;r--)e[r].object===t&&e.splice(r,1)}function D(e,t,n,i){e.addEventListener("dispose",Ir);var o=Kr[e.type];if(o){var a=r.ShaderLib[o];e.__webglShader={uniforms:r.UniformsUtils.clone(a.uniforms),vertexShader:a.vertexShader,fragmentShader:a.fragmentShader}}else e.__webglShader={uniforms:e.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader};var s=dt(t),u=mt(t),c=pt(i),l={precision:bt,supportsVertexTextures:Tr,map:!!e.map,envMap:!!e.envMap,envMapMode:e.envMap&&e.envMap.mapping,lightMap:!!e.lightMap,bumpMap:!!e.bumpMap,normalMap:!!e.normalMap,specularMap:!!e.specularMap,alphaMap:!!e.alphaMap,combine:e.combine,vertexColors:e.vertexColors,fog:n,useFog:e.fog,fogExp:n instanceof r.FogExp2,sizeAttenuation:e.sizeAttenuation,logarithmicDepthBuffer:Tt,skinning:e.skinning,maxBones:c,useVertexTexture:Cr&&i&&i.skeleton&&i.skeleton.useVertexTexture,morphTargets:e.morphTargets,morphNormals:e.morphNormals,maxMorphTargets:Dt.maxMorphTargets,maxMorphNormals:Dt.maxMorphNormals,maxDirLights:s.directional,maxPointLights:s.point,maxSpotLights:s.spot,maxHemiLights:s.hemi,maxShadows:u,shadowMapEnabled:Dt.shadowMapEnabled&&i.receiveShadow&&u>0,shadowMapType:Dt.shadowMapType,shadowMapDebug:Dt.shadowMapDebug,shadowMapCascade:Dt.shadowMapCascade,alphaTest:e.alphaTest,metal:e.metal,wrapAround:e.wrapAround,doubleSided:e.side===r.DoubleSide,flipSided:e.side===r.BackSide},h=[];if(o?h.push(o):(h.push(e.fragmentShader),h.push(e.vertexShader)),void 0!==e.defines)for(var f in e.defines)h.push(f),h.push(e.defines[f]);for(var f in l)h.push(f),h.push(l[f]);for(var p,d=h.join(),m=0,v=Nt.length;v>m;m++){var g=Nt[m];if(g.code===d){p=g,p.usedTimes++;break}}void 0===p&&(p=new r.WebGLProgram(Dt,d,e,l),Nt.push(p),Dt.info.memory.programs=Nt.length),e.program=p;var y=p.attributes;if(e.morphTargets){e.numSupportedMorphTargets=0;for(var b,x="morphTarget",w=0;w<Dt.maxMorphTargets;w++)b=x+w,y[b]>=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;var b,x="morphNormal";for(w=0;w<Dt.maxMorphNormals;w++)b=x+w,y[b]>=0&&e.numSupportedMorphNormals++}e.uniformsList=[];for(var _ in e.__webglShader.uniforms){var S=e.program.uniforms[_];S&&e.uniformsList.push([e.__webglShader.uniforms[_],S])}}function N(e,t,n,i,o){Gt=0,i.needsUpdate&&(i.program&&qr(i),D(i,t,n,o),i.needsUpdate=!1),i.morphTargets&&(o.__webglMorphTargetInfluences||(o.__webglMorphTargetInfluences=new Float32Array(Dt.maxMorphTargets)));var a=!1,s=!1,u=!1,c=i.program,l=c.uniforms,h=i.__webglShader.uniforms;if(c.id!==Ut&&(jt.useProgram(c.program),Ut=c.id,a=!0,s=!0,u=!0),i.id!==Bt&&(-1===Bt&&(u=!0),Bt=i.id,s=!0),(a||e!==zt)&&(jt.uniformMatrix4fv(l.projectionMatrix,!1,e.projectionMatrix.elements),Tt&&jt.uniform1f(l.logDepthBufFC,2/(Math.log(e.far+1)/Math.LN2)),e!==zt&&(zt=e),(i instanceof r.ShaderMaterial||i instanceof r.MeshPhongMaterial||i.envMap)&&null!==l.cameraPosition&&(pr.setFromMatrixPosition(e.matrixWorld),jt.uniform3f(l.cameraPosition,pr.x,pr.y,pr.z)),(i instanceof r.MeshPhongMaterial||i instanceof r.MeshLambertMaterial||i instanceof r.MeshBasicMaterial||i instanceof r.ShaderMaterial||i.skinning)&&null!==l.viewMatrix&&jt.uniformMatrix4fv(l.viewMatrix,!1,e.matrixWorldInverse.elements)),i.skinning)if(o.bindMatrix&&null!==l.bindMatrix&&jt.uniformMatrix4fv(l.bindMatrix,!1,o.bindMatrix.elements),o.bindMatrixInverse&&null!==l.bindMatrixInverse&&jt.uniformMatrix4fv(l.bindMatrixInverse,!1,o.bindMatrixInverse.elements),Cr&&o.skeleton&&o.skeleton.useVertexTexture){if(null!==l.boneTexture){var f=K();jt.uniform1i(l.boneTexture,f),Dt.setTexture(o.skeleton.boneTexture,f)}null!==l.boneTextureWidth&&jt.uniform1i(l.boneTextureWidth,o.skeleton.boneTextureWidth),null!==l.boneTextureHeight&&jt.uniform1i(l.boneTextureHeight,o.skeleton.boneTextureHeight)}else o.skeleton&&o.skeleton.boneMatrices&&null!==l.boneGlobalMatrices&&jt.uniformMatrix4fv(l.boneGlobalMatrices,!1,o.skeleton.boneMatrices);return s&&(n&&i.fog&&z(h,n),(i instanceof r.MeshPhongMaterial||i instanceof r.MeshLambertMaterial||i.lights)&&(mr&&(u=!0,tt(t),mr=!1),u?(W(h,vr),q(h,!0)):q(h,!1)),(i instanceof r.MeshBasicMaterial||i instanceof r.MeshLambertMaterial||i instanceof r.MeshPhongMaterial)&&U(h,i),i instanceof r.LineBasicMaterial?V(h,i):i instanceof r.LineDashedMaterial?(V(h,i),B(h,i)):i instanceof r.PointCloudMaterial?I(h,i):i instanceof r.MeshPhongMaterial?G(h,i):i instanceof r.MeshLambertMaterial?H(h,i):i instanceof r.MeshDepthMaterial?(h.mNear.value=e.near,h.mFar.value=e.far,h.opacity.value=i.opacity):i instanceof r.MeshNormalMaterial&&(h.opacity.value=i.opacity),o.receiveShadow&&!i._shadowPass&&X(h,t),Q(i.uniformsList)),Y(l,o),null!==l.modelMatrix&&jt.uniformMatrix4fv(l.modelMatrix,!1,o.matrixWorld.elements),c}function U(e,t){e.opacity.value=t.opacity,Dt.gammaInput?e.diffuse.value.copyGammaToLinear(t.color):e.diffuse.value=t.color,e.map.value=t.map,e.lightMap.value=t.lightMap,e.specularMap.value=t.specularMap,e.alphaMap.value=t.alphaMap,t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale));var n;if(t.map?n=t.map:t.specularMap?n=t.specularMap:t.normalMap?n=t.normalMap:t.bumpMap?n=t.bumpMap:t.alphaMap&&(n=t.alphaMap),void 0!==n){var i=n.offset,o=n.repeat;e.offsetRepeat.value.set(i.x,i.y,o.x,o.y)}e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap instanceof r.WebGLRenderTargetCube?1:-1,e.reflectivity.value=Dt.gammaInput?t.reflectivity:t.reflectivity,e.refractionRatio.value=t.refractionRatio}function V(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity}function B(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}function I(e,t){e.psColor.value=t.color,e.opacity.value=t.opacity,e.size.value=t.size,e.scale.value=vt.height/2,e.map.value=t.map}function z(e,t){e.fogColor.value=t.color,t instanceof r.Fog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t instanceof r.FogExp2&&(e.fogDensity.value=t.density)}function G(e,t){e.shininess.value=t.shininess,Dt.gammaInput?(e.ambient.value.copyGammaToLinear(t.ambient),e.emissive.value.copyGammaToLinear(t.emissive),e.specular.value.copyGammaToLinear(t.specular)):(e.ambient.value=t.ambient,e.emissive.value=t.emissive,e.specular.value=t.specular),t.wrapAround&&e.wrapRGB.value.copy(t.wrapRGB)}function H(e,t){Dt.gammaInput?(e.ambient.value.copyGammaToLinear(t.ambient),e.emissive.value.copyGammaToLinear(t.emissive)):(e.ambient.value=t.ambient,e.emissive.value=t.emissive),t.wrapAround&&e.wrapRGB.value.copy(t.wrapRGB)}function W(e,t){e.ambientLightColor.value=t.ambient,e.directionalLightColor.value=t.directional.colors,e.directionalLightDirection.value=t.directional.positions,e.pointLightColor.value=t.point.colors,e.pointLightPosition.value=t.point.positions,e.pointLightDistance.value=t.point.distances,e.spotLightColor.value=t.spot.colors,e.spotLightPosition.value=t.spot.positions,e.spotLightDistance.value=t.spot.distances,e.spotLightDirection.value=t.spot.directions,e.spotLightAngleCos.value=t.spot.anglesCos,e.spotLightExponent.value=t.spot.exponents,e.hemisphereLightSkyColor.value=t.hemi.skyColors,e.hemisphereLightGroundColor.value=t.hemi.groundColors,e.hemisphereLightDirection.value=t.hemi.positions}function q(e,t){e.ambientLightColor.needsUpdate=t,e.directionalLightColor.needsUpdate=t,e.directionalLightDirection.needsUpdate=t,e.pointLightColor.needsUpdate=t,e.pointLightPosition.needsUpdate=t,e.pointLightDistance.needsUpdate=t,e.spotLightColor.needsUpdate=t,e.spotLightPosition.needsUpdate=t,e.spotLightDistance.needsUpdate=t,e.spotLightDirection.needsUpdate=t,e.spotLightAngleCos.needsUpdate=t,e.spotLightExponent.needsUpdate=t,e.hemisphereLightSkyColor.needsUpdate=t,e.hemisphereLightGroundColor.needsUpdate=t,e.hemisphereLightDirection.needsUpdate=t}function X(e,t){if(e.shadowMatrix)for(var n=0,i=0,o=t.length;o>i;i++){var a=t[i];a.castShadow&&(a instanceof r.SpotLight||a instanceof r.DirectionalLight&&!a.shadowCascade)&&(e.shadowMap.value[n]=a.shadowMap,e.shadowMapSize.value[n]=a.shadowMapSize,e.shadowMatrix.value[n]=a.shadowMatrix,e.shadowDarkness.value[n]=a.shadowDarkness,e.shadowBias.value[n]=a.shadowBias,n++)}}function Y(e,t){jt.uniformMatrix4fv(e.modelViewMatrix,!1,t._modelViewMatrix.elements),e.normalMatrix&&jt.uniformMatrix3fv(e.normalMatrix,!1,t._normalMatrix.elements)}function K(){var e=Gt;return e>=_r&&console.warn("WebGLRenderer: trying to use "+e+" texture units while this GPU supports only "+_r),Gt+=1,e}function Q(e){for(var t,n,i,o=0,a=e.length;a>o;o++){var s=e[o][0];if(s.needsUpdate!==!1){var u=s.type,c=s.value,l=e[o][1];switch(u){case"1i":jt.uniform1i(l,c);break;case"1f":jt.uniform1f(l,c);break;case"2f":jt.uniform2f(l,c[0],c[1]);break;case"3f":jt.uniform3f(l,c[0],c[1],c[2]);break;case"4f":jt.uniform4f(l,c[0],c[1],c[2],c[3]);break;case"1iv":jt.uniform1iv(l,c);break;case"3iv":jt.uniform3iv(l,c);break;case"1fv":jt.uniform1fv(l,c);break;case"2fv":jt.uniform2fv(l,c);break;case"3fv":jt.uniform3fv(l,c);break;case"4fv":jt.uniform4fv(l,c);break;case"Matrix3fv":jt.uniformMatrix3fv(l,!1,c);break;case"Matrix4fv":jt.uniformMatrix4fv(l,!1,c);break;case"i":jt.uniform1i(l,c);break;case"f":jt.uniform1f(l,c);break;case"v2":jt.uniform2f(l,c.x,c.y);break;case"v3":jt.uniform3f(l,c.x,c.y,c.z);break;case"v4":jt.uniform4f(l,c.x,c.y,c.z,c.w);break;case"c":jt.uniform3f(l,c.r,c.g,c.b);break;case"iv1":jt.uniform1iv(l,c);break;case"iv":jt.uniform3iv(l,c);break;case"fv1":jt.uniform1fv(l,c);break;case"fv":jt.uniform3fv(l,c);break;case"v2v":void 0===s._array&&(s._array=new Float32Array(2*c.length));for(var h=0,f=c.length;f>h;h++)i=2*h,s._array[i]=c[h].x,s._array[i+1]=c[h].y;jt.uniform2fv(l,s._array);break;case"v3v":void 0===s._array&&(s._array=new Float32Array(3*c.length));for(var h=0,f=c.length;f>h;h++)i=3*h,s._array[i]=c[h].x,s._array[i+1]=c[h].y,s._array[i+2]=c[h].z;jt.uniform3fv(l,s._array);break;case"v4v":void 0===s._array&&(s._array=new Float32Array(4*c.length));for(var h=0,f=c.length;f>h;h++)i=4*h,s._array[i]=c[h].x,s._array[i+1]=c[h].y,s._array[i+2]=c[h].z,s._array[i+3]=c[h].w;jt.uniform4fv(l,s._array);break;case"m3":jt.uniformMatrix3fv(l,!1,c.elements);break;case"m3v":void 0===s._array&&(s._array=new Float32Array(9*c.length));for(var h=0,f=c.length;f>h;h++)c[h].flattenToArrayOffset(s._array,9*h);jt.uniformMatrix3fv(l,!1,s._array);break;case"m4":jt.uniformMatrix4fv(l,!1,c.elements);break;case"m4v":void 0===s._array&&(s._array=new Float32Array(16*c.length));for(var h=0,f=c.length;f>h;h++)c[h].flattenToArrayOffset(s._array,16*h);jt.uniformMatrix4fv(l,!1,s._array);break;case"t":if(t=c,n=K(),jt.uniform1i(l,n),!t)continue;t instanceof r.CubeTexture||t.image instanceof Array&&6===t.image.length?at(t,n):t instanceof r.WebGLRenderTargetCube?st(t,n):Dt.setTexture(t,n);break;case"tv":void 0===s._array&&(s._array=[]);for(var h=0,f=s.value.length;f>h;h++)s._array[h]=K();jt.uniform1iv(l,s._array);for(var h=0,f=s.value.length;f>h;h++)t=s.value[h],n=s._array[h],t&&Dt.setTexture(t,n);break;default:console.warn("THREE.WebGLRenderer: Unknown uniform type: "+u)}}}}function Z(e,t){e._modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,e.matrixWorld),e._normalMatrix.getNormalMatrix(e._modelViewMatrix)}function J(e,t,r,n){e[t]=r.r*r.r*n,e[t+1]=r.g*r.g*n,e[t+2]=r.b*r.b*n}function et(e,t,r,n){e[t]=r.r*n,e[t+1]=r.g*n,e[t+2]=r.b*n}function tt(e){var t,n,i,o,a,s,u,c,l,h=0,f=0,p=0,d=vr,m=d.directional.colors,v=d.directional.positions,g=d.point.colors,y=d.point.positions,b=d.point.distances,x=d.spot.colors,w=d.spot.positions,_=d.spot.distances,S=d.spot.directions,M=d.spot.anglesCos,E=d.spot.exponents,T=d.hemi.skyColors,C=d.hemi.groundColors,A=d.hemi.positions,$=0,k=0,P=0,R=0,O=0,L=0,F=0,j=0,D=0,N=0,U=0,V=0;for(t=0,n=e.length;n>t;t++)if(i=e[t],!i.onlyShadow)if(o=i.color,u=i.intensity,l=i.distance,i instanceof r.AmbientLight){if(!i.visible)continue;Dt.gammaInput?(h+=o.r*o.r,f+=o.g*o.g,p+=o.b*o.b):(h+=o.r,f+=o.g,p+=o.b)}else if(i instanceof r.DirectionalLight){if(O+=1,!i.visible)continue;dr.setFromMatrixPosition(i.matrixWorld),pr.setFromMatrixPosition(i.target.matrixWorld),dr.sub(pr),dr.normalize(),D=3*$,v[D]=dr.x,v[D+1]=dr.y,v[D+2]=dr.z,Dt.gammaInput?J(m,D,o,u*u):et(m,D,o,u),$+=1}else if(i instanceof r.PointLight){if(L+=1,!i.visible)continue;N=3*k,Dt.gammaInput?J(g,N,o,u*u):et(g,N,o,u),pr.setFromMatrixPosition(i.matrixWorld),y[N]=pr.x,y[N+1]=pr.y,y[N+2]=pr.z,b[k]=l,k+=1}else if(i instanceof r.SpotLight){if(F+=1,!i.visible)continue;U=3*P,Dt.gammaInput?J(x,U,o,u*u):et(x,U,o,u),dr.setFromMatrixPosition(i.matrixWorld),w[U]=dr.x,w[U+1]=dr.y,w[U+2]=dr.z,_[P]=l,pr.setFromMatrixPosition(i.target.matrixWorld),dr.sub(pr),dr.normalize(),S[U]=dr.x,S[U+1]=dr.y,S[U+2]=dr.z,M[P]=Math.cos(i.angle),E[P]=i.exponent,P+=1}else if(i instanceof r.HemisphereLight){if(j+=1,!i.visible)continue;dr.setFromMatrixPosition(i.matrixWorld),dr.normalize(),V=3*R,A[V]=dr.x,A[V+1]=dr.y,A[V+2]=dr.z,a=i.color,s=i.groundColor,Dt.gammaInput?(c=u*u,J(T,V,a,c),J(C,V,s,c)):(et(T,V,a,u),et(C,V,s,u)),R+=1}for(t=3*$,n=Math.max(m.length,3*O);n>t;t++)m[t]=0;for(t=3*k,n=Math.max(g.length,3*L);n>t;t++)g[t]=0;for(t=3*P,n=Math.max(x.length,3*F);n>t;t++)x[t]=0;for(t=3*R,n=Math.max(T.length,3*j);n>t;t++)T[t]=0;for(t=3*R,n=Math.max(C.length,3*j);n>t;t++)C[t]=0;d.directional.length=$,d.point.length=k,d.spot.length=P,d.hemi.length=R,d.ambient[0]=h,d.ambient[1]=f,d.ambient[2]=p}function rt(e){e*=yt,e!==rr&&(jt.lineWidth(e),rr=e)}function nt(e,t,r){Jt!==e&&(e?jt.enable(jt.POLYGON_OFFSET_FILL):jt.disable(jt.POLYGON_OFFSET_FILL),Jt=e),!e||er===t&&tr===r||(jt.polygonOffset(t,r),er=t,tr=r)}function it(e,t,n){var i;n?(jt.texParameteri(e,jt.TEXTURE_WRAP_S,ft(t.wrapS)),jt.texParameteri(e,jt.TEXTURE_WRAP_T,ft(t.wrapT)),jt.texParameteri(e,jt.TEXTURE_MAG_FILTER,ft(t.magFilter)),jt.texParameteri(e,jt.TEXTURE_MIN_FILTER,ft(t.minFilter))):(jt.texParameteri(e,jt.TEXTURE_WRAP_S,jt.CLAMP_TO_EDGE),jt.texParameteri(e,jt.TEXTURE_WRAP_T,jt.CLAMP_TO_EDGE),(t.wrapS!==r.ClampToEdgeWrapping||t.wrapT!==r.ClampToEdgeWrapping)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT is set to THREE.ClampToEdgeWrapping. ( "+t.sourceFile+" )"),jt.texParameteri(e,jt.TEXTURE_MAG_FILTER,ht(t.magFilter)),jt.texParameteri(e,jt.TEXTURE_MIN_FILTER,ht(t.minFilter)),t.minFilter!==r.NearestFilter&&t.minFilter!==r.LinearFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter is set to THREE.LinearFilter or THREE.NearestFilter. ( "+t.sourceFile+" )")),i=br.get("EXT_texture_filter_anisotropic"),i&&t.type!==r.FloatType&&(t.anisotropy>1||t.__oldAnisotropy)&&(jt.texParameterf(e,i.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,Dt.getMaxAnisotropy())),t.__oldAnisotropy=t.anisotropy)}function ot(e,t){if(e.width>t||e.height>t){var r=t/Math.max(e.width,e.height),n=document.createElement("canvas");n.width=Math.floor(e.width*r),n.height=Math.floor(e.height*r);var i=n.getContext("2d");return i.drawImage(e,0,0,e.width,e.height,0,0,n.width,n.height),console.log("THREE.WebGLRenderer:",e,"is too big ("+e.width+"x"+e.height+"). Resized to "+n.width+"x"+n.height+"."),n}return e}function at(e,t){if(6===e.image.length)if(e.needsUpdate){e.image.__webglTextureCube||(e.addEventListener("dispose",Vr),e.image.__webglTextureCube=jt.createTexture(),Dt.info.memory.textures++),jt.activeTexture(jt.TEXTURE0+t),jt.bindTexture(jt.TEXTURE_CUBE_MAP,e.image.__webglTextureCube),jt.pixelStorei(jt.UNPACK_FLIP_Y_WEBGL,e.flipY);for(var n=e instanceof r.CompressedTexture,i=e.image[0]instanceof r.DataTexture,o=[],a=0;6>a;a++)o[a]=!Dt.autoScaleCubemaps||n||i?i?e.image[a].image:e.image[a]:ot(e.image[a],Er);var s=o[0],u=r.Math.isPowerOfTwo(s.width)&&r.Math.isPowerOfTwo(s.height),c=ft(e.format),l=ft(e.type);it(jt.TEXTURE_CUBE_MAP,e,u);for(var a=0;6>a;a++)if(n)for(var h,f=o[a].mipmaps,p=0,d=f.length;d>p;p++)h=f[p],e.format!==r.RGBAFormat&&e.format!==r.RGBFormat?Rr().indexOf(c)>-1?jt.compressedTexImage2D(jt.TEXTURE_CUBE_MAP_POSITIVE_X+a,p,c,h.width,h.height,0,h.data):console.warn("Attempt to load unsupported compressed texture format"):jt.texImage2D(jt.TEXTURE_CUBE_MAP_POSITIVE_X+a,p,c,h.width,h.height,0,c,l,h.data);else i?jt.texImage2D(jt.TEXTURE_CUBE_MAP_POSITIVE_X+a,0,c,o[a].width,o[a].height,0,c,l,o[a].data):jt.texImage2D(jt.TEXTURE_CUBE_MAP_POSITIVE_X+a,0,c,c,l,o[a]);e.generateMipmaps&&u&&jt.generateMipmap(jt.TEXTURE_CUBE_MAP),e.needsUpdate=!1,e.onUpdate&&e.onUpdate()}else jt.activeTexture(jt.TEXTURE0+t),jt.bindTexture(jt.TEXTURE_CUBE_MAP,e.image.__webglTextureCube)}function st(e,t){jt.activeTexture(jt.TEXTURE0+t),jt.bindTexture(jt.TEXTURE_CUBE_MAP,e.__webglTexture)}function ut(e,t,r){jt.bindFramebuffer(jt.FRAMEBUFFER,e),jt.framebufferTexture2D(jt.FRAMEBUFFER,jt.COLOR_ATTACHMENT0,r,t.__webglTexture,0)}function ct(e,t){jt.bindRenderbuffer(jt.RENDERBUFFER,e),t.depthBuffer&&!t.stencilBuffer?(jt.renderbufferStorage(jt.RENDERBUFFER,jt.DEPTH_COMPONENT16,t.width,t.height),jt.framebufferRenderbuffer(jt.FRAMEBUFFER,jt.DEPTH_ATTACHMENT,jt.RENDERBUFFER,e)):t.depthBuffer&&t.stencilBuffer?(jt.renderbufferStorage(jt.RENDERBUFFER,jt.DEPTH_STENCIL,t.width,t.height),jt.framebufferRenderbuffer(jt.FRAMEBUFFER,jt.DEPTH_STENCIL_ATTACHMENT,jt.RENDERBUFFER,e)):jt.renderbufferStorage(jt.RENDERBUFFER,jt.RGBA4,t.width,t.height)}function lt(e){e instanceof r.WebGLRenderTargetCube?(jt.bindTexture(jt.TEXTURE_CUBE_MAP,e.__webglTexture),jt.generateMipmap(jt.TEXTURE_CUBE_MAP),jt.bindTexture(jt.TEXTURE_CUBE_MAP,null)):(jt.bindTexture(jt.TEXTURE_2D,e.__webglTexture),jt.generateMipmap(jt.TEXTURE_2D),jt.bindTexture(jt.TEXTURE_2D,null))}function ht(e){return e===r.NearestFilter||e===r.NearestMipMapNearestFilter||e===r.NearestMipMapLinearFilter?jt.NEAREST:jt.LINEAR}function ft(e){var t;if(e===r.RepeatWrapping)return jt.REPEAT;if(e===r.ClampToEdgeWrapping)return jt.CLAMP_TO_EDGE;if(e===r.MirroredRepeatWrapping)return jt.MIRRORED_REPEAT;if(e===r.NearestFilter)return jt.NEAREST;if(e===r.NearestMipMapNearestFilter)return jt.NEAREST_MIPMAP_NEAREST;if(e===r.NearestMipMapLinearFilter)return jt.NEAREST_MIPMAP_LINEAR;if(e===r.LinearFilter)return jt.LINEAR;if(e===r.LinearMipMapNearestFilter)return jt.LINEAR_MIPMAP_NEAREST;if(e===r.LinearMipMapLinearFilter)return jt.LINEAR_MIPMAP_LINEAR;if(e===r.UnsignedByteType)return jt.UNSIGNED_BYTE;if(e===r.UnsignedShort4444Type)return jt.UNSIGNED_SHORT_4_4_4_4;if(e===r.UnsignedShort5551Type)return jt.UNSIGNED_SHORT_5_5_5_1;if(e===r.UnsignedShort565Type)return jt.UNSIGNED_SHORT_5_6_5;if(e===r.ByteType)return jt.BYTE;if(e===r.ShortType)return jt.SHORT;if(e===r.UnsignedShortType)return jt.UNSIGNED_SHORT;if(e===r.IntType)return jt.INT;if(e===r.UnsignedIntType)return jt.UNSIGNED_INT;if(e===r.FloatType)return jt.FLOAT;if(e===r.AlphaFormat)return jt.ALPHA;if(e===r.RGBFormat)return jt.RGB;if(e===r.RGBAFormat)return jt.RGBA;if(e===r.LuminanceFormat)return jt.LUMINANCE;if(e===r.LuminanceAlphaFormat)return jt.LUMINANCE_ALPHA;if(e===r.AddEquation)return jt.FUNC_ADD;if(e===r.SubtractEquation)return jt.FUNC_SUBTRACT;if(e===r.ReverseSubtractEquation)return jt.FUNC_REVERSE_SUBTRACT;if(e===r.ZeroFactor)return jt.ZERO;if(e===r.OneFactor)return jt.ONE;if(e===r.SrcColorFactor)return jt.SRC_COLOR;if(e===r.OneMinusSrcColorFactor)return jt.ONE_MINUS_SRC_COLOR;if(e===r.SrcAlphaFactor)return jt.SRC_ALPHA;if(e===r.OneMinusSrcAlphaFactor)return jt.ONE_MINUS_SRC_ALPHA;if(e===r.DstAlphaFactor)return jt.DST_ALPHA;if(e===r.OneMinusDstAlphaFactor)return jt.ONE_MINUS_DST_ALPHA;if(e===r.DstColorFactor)return jt.DST_COLOR;if(e===r.OneMinusDstColorFactor)return jt.ONE_MINUS_DST_COLOR;if(e===r.SrcAlphaSaturateFactor)return jt.SRC_ALPHA_SATURATE;if(t=br.get("WEBGL_compressed_texture_s3tc"),null!==t){if(e===r.RGB_S3TC_DXT1_Format)return t.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===r.RGBA_S3TC_DXT1_Format)return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===r.RGBA_S3TC_DXT3_Format)return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===r.RGBA_S3TC_DXT5_Format)return t.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t=br.get("WEBGL_compressed_texture_pvrtc"),null!==t){if(e===r.RGB_PVRTC_4BPPV1_Format)return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===r.RGB_PVRTC_2BPPV1_Format)return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===r.RGBA_PVRTC_4BPPV1_Format)return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===r.RGBA_PVRTC_2BPPV1_Format)return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t=br.get("EXT_blend_minmax"),null!==t){if(e===r.MinEquation)return t.MIN_EXT;if(e===r.MaxEquation)return t.MAX_EXT}return 0}function pt(e){if(Cr&&e&&e.skeleton&&e.skeleton.useVertexTexture)return 1024;var t=jt.getParameter(jt.MAX_VERTEX_UNIFORM_VECTORS),n=Math.floor((t-20)/4),i=n;return void 0!==e&&e instanceof r.SkinnedMesh&&(i=Math.min(e.skeleton.bones.length,i),i<e.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+e.skeleton.bones.length+", this GPU supports just "+i+" (try OpenGL instead of ANGLE)")),i}function dt(e){for(var t=0,n=0,i=0,o=0,a=0,s=e.length;s>a;a++){var u=e[a];u.onlyShadow||u.visible===!1||(u instanceof r.DirectionalLight&&t++,u instanceof r.PointLight&&n++,u instanceof r.SpotLight&&i++,u instanceof r.HemisphereLight&&o++)}return{directional:t,point:n,spot:i,hemi:o}}function mt(e){for(var t=0,n=0,i=e.length;i>n;n++){var o=e[n];o.castShadow&&(o instanceof r.SpotLight&&t++,o instanceof r.DirectionalLight&&!o.shadowCascade&&t++)}return t}console.log("THREE.WebGLRenderer",r.REVISION),e=e||{};var vt=void 0!==e.canvas?e.canvas:document.createElement("canvas"),gt=void 0!==e.context?e.context:null,yt=1,bt=void 0!==e.precision?e.precision:"highp",xt=void 0!==e.alpha?e.alpha:!1,wt=void 0!==e.depth?e.depth:!0,_t=void 0!==e.stencil?e.stencil:!0,St=void 0!==e.antialias?e.antialias:!1,Mt=void 0!==e.premultipliedAlpha?e.premultipliedAlpha:!0,Et=void 0!==e.preserveDrawingBuffer?e.preserveDrawingBuffer:!1,Tt=void 0!==e.logarithmicDepthBuffer?e.logarithmicDepthBuffer:!1,Ct=new r.Color(0),At=0,$t=[],kt={},Pt=[],Rt=[],Ot=[],Lt=[],Ft=[];this.domElement=vt,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.gammaInput=!1,this.gammaOutput=!1,this.shadowMapEnabled=!1,this.shadowMapType=r.PCFShadowMap,this.shadowMapCullFace=r.CullFaceFront,this.shadowMapDebug=!1,this.shadowMapCascade=!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 jt,Dt=this,Nt=[],Ut=null,Vt=null,Bt=-1,It="",zt=null,Gt=0,Ht=-1,Wt=-1,qt=-1,Xt=-1,Yt=-1,Kt=-1,Qt=-1,Zt=-1,Jt=null,er=null,tr=null,rr=null,nr=0,ir=0,or=vt.width,ar=vt.height,sr=0,ur=0,cr=new Uint8Array(16),lr=new Uint8Array(16),hr=new r.Frustum,fr=new r.Matrix4,pr=(new r.Matrix4,new r.Vector3),dr=new r.Vector3,mr=!0,vr={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}};try{var gr={alpha:xt,depth:wt,stencil:_t,antialias:St,premultipliedAlpha:Mt,preserveDrawingBuffer:Et};if(jt=gt||vt.getContext("webgl",gr)||vt.getContext("experimental-webgl",gr),null===jt)throw null!==vt.getContext("webgl")?"Error creating WebGL context with your selected attributes.":"Error creating WebGL context.";vt.addEventListener("webglcontextlost",function(e){e.preventDefault(),wr(),xr(),kt={}},!1)}catch(yr){console.error(yr)}void 0===jt.getShaderPrecisionFormat&&(jt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var br=new r.WebGLExtensions(jt);br.get("OES_texture_float"),br.get("OES_texture_float_linear"),br.get("OES_standard_derivatives"),Tt&&br.get("EXT_frag_depth");var xr=function(){jt.clearColor(0,0,0,1),jt.clearDepth(1),jt.clearStencil(0),jt.enable(jt.DEPTH_TEST),jt.depthFunc(jt.LEQUAL),jt.frontFace(jt.CCW),jt.cullFace(jt.BACK),jt.enable(jt.CULL_FACE),jt.enable(jt.BLEND),jt.blendEquation(jt.FUNC_ADD),jt.blendFunc(jt.SRC_ALPHA,jt.ONE_MINUS_SRC_ALPHA),jt.viewport(nr,ir,or,ar),jt.clearColor(Ct.r,Ct.g,Ct.b,At)},wr=function(){Ut=null,zt=null,qt=-1,Qt=-1,Zt=-1,Ht=-1,Wt=-1,It="",Bt=-1,mr=!0;for(var e=0;e<lr.length;e++)lr[e]=0};xr(),this.context=jt;var _r=jt.getParameter(jt.MAX_TEXTURE_IMAGE_UNITS),Sr=jt.getParameter(jt.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Mr=jt.getParameter(jt.MAX_TEXTURE_SIZE),Er=jt.getParameter(jt.MAX_CUBE_MAP_TEXTURE_SIZE),Tr=Sr>0,Cr=Tr&&br.get("OES_texture_float"),Ar=jt.getShaderPrecisionFormat(jt.VERTEX_SHADER,jt.HIGH_FLOAT),$r=jt.getShaderPrecisionFormat(jt.VERTEX_SHADER,jt.MEDIUM_FLOAT),kr=(jt.getShaderPrecisionFormat(jt.VERTEX_SHADER,jt.LOW_FLOAT),jt.getShaderPrecisionFormat(jt.FRAGMENT_SHADER,jt.HIGH_FLOAT)),Pr=jt.getShaderPrecisionFormat(jt.FRAGMENT_SHADER,jt.MEDIUM_FLOAT),Rr=(jt.getShaderPrecisionFormat(jt.FRAGMENT_SHADER,jt.LOW_FLOAT),function(){var e;return function(){if(void 0!==e)return e;if(e=[],br.get("WEBGL_compressed_texture_pvrtc")||br.get("WEBGL_compressed_texture_s3tc"))for(var t=jt.getParameter(jt.COMPRESSED_TEXTURE_FORMATS),r=0;r<t.length;r++)e.push(t[r]);return e}}()),Or=Ar.precision>0&&kr.precision>0,Lr=$r.precision>0&&Pr.precision>0;"highp"!==bt||Or||(Lr?(bt="mediump",console.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(bt="lowp",console.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp."))),"mediump"!==bt||Lr||(bt="lowp",console.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var Fr=new r.ShadowMapPlugin(this,$t,kt,Pt),jr=new r.SpritePlugin(this,Lt),Dr=new r.LensFlarePlugin(this,Ft);this.getContext=function(){return jt},this.forceContextLoss=function(){br.get("WEBGL_lose_context").loseContext()},this.supportsVertexTextures=function(){return Tr},this.supportsFloatTextures=function(){return br.get("OES_texture_float")},this.supportsStandardDerivatives=function(){return br.get("OES_standard_derivatives")},this.supportsCompressedTextureS3TC=function(){return br.get("WEBGL_compressed_texture_s3tc")},this.supportsCompressedTexturePVRTC=function(){return br.get("WEBGL_compressed_texture_pvrtc")},this.supportsBlendMinMax=function(){return br.get("EXT_blend_minmax")},this.getMaxAnisotropy=function(){var e;return function(){if(void 0!==e)return e;var t=br.get("EXT_texture_filter_anisotropic");return e=null!==t?jt.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0}}(),this.getPrecision=function(){return bt},this.getPixelRatio=function(){return yt},this.setPixelRatio=function(e){yt=e},this.setSize=function(e,t,r){vt.width=e*yt,vt.height=t*yt,r!==!1&&(vt.style.width=e+"px",vt.style.height=t+"px"),this.setViewport(0,0,e,t)},this.setViewport=function(e,t,r,n){nr=e*yt,ir=t*yt,or=r*yt,ar=n*yt,jt.viewport(nr,ir,or,ar)},this.setScissor=function(e,t,r,n){jt.scissor(e*yt,t*yt,r*yt,n*yt)},this.enableScissorTest=function(e){e?jt.enable(jt.SCISSOR_TEST):jt.disable(jt.SCISSOR_TEST)},this.getClearColor=function(){return Ct},this.setClearColor=function(e,t){Ct.set(e),At=void 0!==t?t:1,jt.clearColor(Ct.r,Ct.g,Ct.b,At)},this.getClearAlpha=function(){return At},this.setClearAlpha=function(e){At=e,jt.clearColor(Ct.r,Ct.g,Ct.b,At)},this.clear=function(e,t,r){var n=0;(void 0===e||e)&&(n|=jt.COLOR_BUFFER_BIT),(void 0===t||t)&&(n|=jt.DEPTH_BUFFER_BIT),(void 0===r||r)&&(n|=jt.STENCIL_BUFFER_BIT),jt.clear(n)},this.clearColor=function(){jt.clear(jt.COLOR_BUFFER_BIT)
},this.clearDepth=function(){jt.clear(jt.DEPTH_BUFFER_BIT)},this.clearStencil=function(){jt.clear(jt.STENCIL_BUFFER_BIT)},this.clearTarget=function(e,t,r,n){this.setRenderTarget(e),this.clear(t,r,n)},this.resetGLState=wr;var Nr=function(e){var t=e.target;t.traverse(function(e){e.removeEventListener("remove",Nr),F(e)})},Ur=function(e){var t=e.target;t.removeEventListener("dispose",Ur),Gr(t)},Vr=function(e){var t=e.target;t.removeEventListener("dispose",Vr),Hr(t),Dt.info.memory.textures--},Br=function(e){var t=e.target;t.removeEventListener("dispose",Br),Wr(t),Dt.info.memory.textures--},Ir=function(e){var t=e.target;t.removeEventListener("dispose",Ir),qr(t)},zr=function(e){for(var t=["__webglVertexBuffer","__webglNormalBuffer","__webglTangentBuffer","__webglColorBuffer","__webglUVBuffer","__webglUV2Buffer","__webglSkinIndicesBuffer","__webglSkinWeightsBuffer","__webglFaceBuffer","__webglLineBuffer","__webglLineDistanceBuffer"],r=0,n=t.length;n>r;r++){var i=t[r];void 0!==e[i]&&(jt.deleteBuffer(e[i]),delete e[i])}if(void 0!==e.__webglCustomAttributesList){for(var i in e.__webglCustomAttributesList)jt.deleteBuffer(e.__webglCustomAttributesList[i].buffer);delete e.__webglCustomAttributesList}Dt.info.memory.geometries--},Gr=function(e){if(delete e.__webglInit,e instanceof r.BufferGeometry){for(var t in e.attributes){var n=e.attributes[t];void 0!==n.buffer&&(jt.deleteBuffer(n.buffer),delete n.buffer)}Dt.info.memory.geometries--}else{var i=Xr[e.id];if(void 0!==i){for(var o=0,a=i.length;a>o;o++){var s=i[o];if(void 0!==s.numMorphTargets){for(var u=0,c=s.numMorphTargets;c>u;u++)jt.deleteBuffer(s.__webglMorphTargetsBuffers[u]);delete s.__webglMorphTargetsBuffers}if(void 0!==s.numMorphNormals){for(var u=0,c=s.numMorphNormals;c>u;u++)jt.deleteBuffer(s.__webglMorphNormalsBuffers[u]);delete s.__webglMorphNormalsBuffers}zr(s)}delete Xr[e.id]}else zr(e)}It=""},Hr=function(e){if(e.image&&e.image.__webglTextureCube)jt.deleteTexture(e.image.__webglTextureCube),delete e.image.__webglTextureCube;else{if(void 0===e.__webglInit)return;jt.deleteTexture(e.__webglTexture),delete e.__webglTexture,delete e.__webglInit}},Wr=function(e){if(e&&void 0!==e.__webglTexture){if(jt.deleteTexture(e.__webglTexture),delete e.__webglTexture,e instanceof r.WebGLRenderTargetCube)for(var t=0;6>t;t++)jt.deleteFramebuffer(e.__webglFramebuffer[t]),jt.deleteRenderbuffer(e.__webglRenderbuffer[t]);else jt.deleteFramebuffer(e.__webglFramebuffer),jt.deleteRenderbuffer(e.__webglRenderbuffer);delete e.__webglFramebuffer,delete e.__webglRenderbuffer}},qr=function(e){var t=e.program.program;if(void 0!==t){e.program=void 0;var r,n,i,o=!1;for(r=0,n=Nt.length;n>r;r++)if(i=Nt[r],i.program===t){i.usedTimes--,0===i.usedTimes&&(o=!0);break}if(o===!0){var a=[];for(r=0,n=Nt.length;n>r;r++)i=Nt[r],i.program!==t&&a.push(i);Nt=a,jt.deleteProgram(t),Dt.info.memory.programs--}}};this.renderBufferImmediate=function(e,t,n){if(m(),e.hasPositions&&!e.__webglVertexBuffer&&(e.__webglVertexBuffer=jt.createBuffer()),e.hasNormals&&!e.__webglNormalBuffer&&(e.__webglNormalBuffer=jt.createBuffer()),e.hasUvs&&!e.__webglUvBuffer&&(e.__webglUvBuffer=jt.createBuffer()),e.hasColors&&!e.__webglColorBuffer&&(e.__webglColorBuffer=jt.createBuffer()),e.hasPositions&&(jt.bindBuffer(jt.ARRAY_BUFFER,e.__webglVertexBuffer),jt.bufferData(jt.ARRAY_BUFFER,e.positionArray,jt.DYNAMIC_DRAW),v(t.attributes.position),jt.vertexAttribPointer(t.attributes.position,3,jt.FLOAT,!1,0,0)),e.hasNormals){if(jt.bindBuffer(jt.ARRAY_BUFFER,e.__webglNormalBuffer),n.shading===r.FlatShading){var i,o,a,s,u,c,l,h,f,p,d,y,b,x,w=3*e.count;for(x=0;w>x;x+=9)b=e.normalArray,s=b[x],l=b[x+1],p=b[x+2],u=b[x+3],h=b[x+4],d=b[x+5],c=b[x+6],f=b[x+7],y=b[x+8],i=(s+u+c)/3,o=(l+h+f)/3,a=(p+d+y)/3,b[x]=i,b[x+1]=o,b[x+2]=a,b[x+3]=i,b[x+4]=o,b[x+5]=a,b[x+6]=i,b[x+7]=o,b[x+8]=a}jt.bufferData(jt.ARRAY_BUFFER,e.normalArray,jt.DYNAMIC_DRAW),v(t.attributes.normal),jt.vertexAttribPointer(t.attributes.normal,3,jt.FLOAT,!1,0,0)}e.hasUvs&&n.map&&(jt.bindBuffer(jt.ARRAY_BUFFER,e.__webglUvBuffer),jt.bufferData(jt.ARRAY_BUFFER,e.uvArray,jt.DYNAMIC_DRAW),v(t.attributes.uv),jt.vertexAttribPointer(t.attributes.uv,2,jt.FLOAT,!1,0,0)),e.hasColors&&n.vertexColors!==r.NoColors&&(jt.bindBuffer(jt.ARRAY_BUFFER,e.__webglColorBuffer),jt.bufferData(jt.ARRAY_BUFFER,e.colorArray,jt.DYNAMIC_DRAW),v(t.attributes.color),jt.vertexAttribPointer(t.attributes.color,3,jt.FLOAT,!1,0,0)),g(),jt.drawArrays(jt.TRIANGLES,0,e.count),e.count=0},this.renderBufferDirect=function(e,t,n,i,o,a){if(i.visible!==!1){R(a);var s=N(e,t,n,i,a),u=!1,c=i.wireframe?1:0,l="direct_"+o.id+"_"+s.id+"_"+c;if(l!==It&&(It=l,u=!0),u&&m(),a instanceof r.Mesh){var h=i.wireframe===!0?jt.LINES:jt.TRIANGLES,f=o.attributes.index;if(f){var p,v;f.array instanceof Uint32Array&&br.get("OES_element_index_uint")?(p=jt.UNSIGNED_INT,v=4):(p=jt.UNSIGNED_SHORT,v=2);var g=o.offsets;if(0===g.length)u&&(d(i,s,o,0),jt.bindBuffer(jt.ELEMENT_ARRAY_BUFFER,f.buffer)),jt.drawElements(h,f.array.length,p,0),Dt.info.render.calls++,Dt.info.render.vertices+=f.array.length,Dt.info.render.faces+=f.array.length/3;else{u=!0;for(var y=0,b=g.length;b>y;y++){var x=g[y].index;u&&(d(i,s,o,x),jt.bindBuffer(jt.ELEMENT_ARRAY_BUFFER,f.buffer)),jt.drawElements(h,g[y].count,p,g[y].start*v),Dt.info.render.calls++,Dt.info.render.vertices+=g[y].count,Dt.info.render.faces+=g[y].count/3}}}else{u&&d(i,s,o,0);var w=o.attributes.position;jt.drawArrays(h,0,w.array.length/3),Dt.info.render.calls++,Dt.info.render.vertices+=w.array.length/3,Dt.info.render.faces+=w.array.length/9}}else if(a instanceof r.PointCloud){var h=jt.POINTS,f=o.attributes.index;if(f){var p,v;f.array instanceof Uint32Array&&br.get("OES_element_index_uint")?(p=jt.UNSIGNED_INT,v=4):(p=jt.UNSIGNED_SHORT,v=2);var g=o.offsets;if(0===g.length)u&&(d(i,s,o,0),jt.bindBuffer(jt.ELEMENT_ARRAY_BUFFER,f.buffer)),jt.drawElements(h,f.array.length,p,0),Dt.info.render.calls++,Dt.info.render.points+=f.array.length;else{g.length>1&&(u=!0);for(var y=0,b=g.length;b>y;y++){var x=g[y].index;u&&(d(i,s,o,x),jt.bindBuffer(jt.ELEMENT_ARRAY_BUFFER,f.buffer)),jt.drawElements(h,g[y].count,p,g[y].start*v),Dt.info.render.calls++,Dt.info.render.points+=g[y].count}}}else{u&&d(i,s,o,0);var w=o.attributes.position,g=o.offsets;if(0===g.length)jt.drawArrays(h,0,w.array.length/3),Dt.info.render.calls++,Dt.info.render.points+=w.array.length/3;else for(var y=0,b=g.length;b>y;y++)jt.drawArrays(h,g[y].index,g[y].count),Dt.info.render.calls++,Dt.info.render.points+=g[y].count}}else if(a instanceof r.Line){var h=a.mode===r.LineStrip?jt.LINE_STRIP:jt.LINES;rt(i.linewidth);var f=o.attributes.index;if(f){var p,v;f.array instanceof Uint32Array?(p=jt.UNSIGNED_INT,v=4):(p=jt.UNSIGNED_SHORT,v=2);var g=o.offsets;if(0===g.length)u&&(d(i,s,o,0),jt.bindBuffer(jt.ELEMENT_ARRAY_BUFFER,f.buffer)),jt.drawElements(h,f.array.length,p,0),Dt.info.render.calls++,Dt.info.render.vertices+=f.array.length;else{g.length>1&&(u=!0);for(var y=0,b=g.length;b>y;y++){var x=g[y].index;u&&(d(i,s,o,x),jt.bindBuffer(jt.ELEMENT_ARRAY_BUFFER,f.buffer)),jt.drawElements(h,g[y].count,p,g[y].start*v),Dt.info.render.calls++,Dt.info.render.vertices+=g[y].count}}}else{u&&d(i,s,o,0);var w=o.attributes.position,g=o.offsets;if(0===g.length)jt.drawArrays(h,0,w.array.length/3),Dt.info.render.calls++,Dt.info.render.vertices+=w.array.length/3;else for(var y=0,b=g.length;b>y;y++)jt.drawArrays(h,g[y].index,g[y].count),Dt.info.render.calls++,Dt.info.render.vertices+=g[y].count}}}},this.renderBuffer=function(e,t,n,i,o,a){if(i.visible!==!1){R(a);var s=N(e,t,n,i,a),u=s.attributes,c=!1,l=i.wireframe?1:0,h=o.id+"_"+s.id+"_"+l;if(h!==It&&(It=h,c=!0),c&&m(),!i.morphTargets&&u.position>=0?c&&(jt.bindBuffer(jt.ARRAY_BUFFER,o.__webglVertexBuffer),v(u.position),jt.vertexAttribPointer(u.position,3,jt.FLOAT,!1,0,0)):a.morphTargetBase&&y(i,o,a),c){if(o.__webglCustomAttributesList)for(var f=0,p=o.__webglCustomAttributesList.length;p>f;f++){var d=o.__webglCustomAttributesList[f];u[d.buffer.belongsToAttribute]>=0&&(jt.bindBuffer(jt.ARRAY_BUFFER,d.buffer),v(u[d.buffer.belongsToAttribute]),jt.vertexAttribPointer(u[d.buffer.belongsToAttribute],d.size,jt.FLOAT,!1,0,0))}u.color>=0&&(a.geometry.colors.length>0||a.geometry.faces.length>0?(jt.bindBuffer(jt.ARRAY_BUFFER,o.__webglColorBuffer),v(u.color),jt.vertexAttribPointer(u.color,3,jt.FLOAT,!1,0,0)):void 0!==i.defaultAttributeValues&&jt.vertexAttrib3fv(u.color,i.defaultAttributeValues.color)),u.normal>=0&&(jt.bindBuffer(jt.ARRAY_BUFFER,o.__webglNormalBuffer),v(u.normal),jt.vertexAttribPointer(u.normal,3,jt.FLOAT,!1,0,0)),u.tangent>=0&&(jt.bindBuffer(jt.ARRAY_BUFFER,o.__webglTangentBuffer),v(u.tangent),jt.vertexAttribPointer(u.tangent,4,jt.FLOAT,!1,0,0)),u.uv>=0&&(a.geometry.faceVertexUvs[0]?(jt.bindBuffer(jt.ARRAY_BUFFER,o.__webglUVBuffer),v(u.uv),jt.vertexAttribPointer(u.uv,2,jt.FLOAT,!1,0,0)):void 0!==i.defaultAttributeValues&&jt.vertexAttrib2fv(u.uv,i.defaultAttributeValues.uv)),u.uv2>=0&&(a.geometry.faceVertexUvs[1]?(jt.bindBuffer(jt.ARRAY_BUFFER,o.__webglUV2Buffer),v(u.uv2),jt.vertexAttribPointer(u.uv2,2,jt.FLOAT,!1,0,0)):void 0!==i.defaultAttributeValues&&jt.vertexAttrib2fv(u.uv2,i.defaultAttributeValues.uv2)),i.skinning&&u.skinIndex>=0&&u.skinWeight>=0&&(jt.bindBuffer(jt.ARRAY_BUFFER,o.__webglSkinIndicesBuffer),v(u.skinIndex),jt.vertexAttribPointer(u.skinIndex,4,jt.FLOAT,!1,0,0),jt.bindBuffer(jt.ARRAY_BUFFER,o.__webglSkinWeightsBuffer),v(u.skinWeight),jt.vertexAttribPointer(u.skinWeight,4,jt.FLOAT,!1,0,0)),u.lineDistance>=0&&(jt.bindBuffer(jt.ARRAY_BUFFER,o.__webglLineDistanceBuffer),v(u.lineDistance),jt.vertexAttribPointer(u.lineDistance,1,jt.FLOAT,!1,0,0))}if(g(),a instanceof r.Mesh){var b=o.__typeArray===Uint32Array?jt.UNSIGNED_INT:jt.UNSIGNED_SHORT;i.wireframe?(rt(i.wireframeLinewidth),c&&jt.bindBuffer(jt.ELEMENT_ARRAY_BUFFER,o.__webglLineBuffer),jt.drawElements(jt.LINES,o.__webglLineCount,b,0)):(c&&jt.bindBuffer(jt.ELEMENT_ARRAY_BUFFER,o.__webglFaceBuffer),jt.drawElements(jt.TRIANGLES,o.__webglFaceCount,b,0)),Dt.info.render.calls++,Dt.info.render.vertices+=o.__webglFaceCount,Dt.info.render.faces+=o.__webglFaceCount/3}else if(a instanceof r.Line){var x=a.mode===r.LineStrip?jt.LINE_STRIP:jt.LINES;rt(i.linewidth),jt.drawArrays(x,0,o.__webglLineCount),Dt.info.render.calls++}else a instanceof r.PointCloud&&(jt.drawArrays(jt.POINTS,0,o.__webglParticleCount),Dt.info.render.calls++,Dt.info.render.points+=o.__webglParticleCount)}},this.render=function(e,t,n,i){if(t instanceof r.Camera==!1)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");var o=e.fog;It="",Bt=-1,zt=null,mr=!0,e.autoUpdate===!0&&e.updateMatrixWorld(),void 0===t.parent&&t.updateMatrixWorld(),e.traverse(function(e){e instanceof r.SkinnedMesh&&e.skeleton.update()}),t.matrixWorldInverse.getInverse(t.matrixWorld),fr.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),hr.setFromMatrix(fr),$t.length=0,Rt.length=0,Ot.length=0,Lt.length=0,Ft.length=0,_(e),Dt.sortObjects===!0&&(Rt.sort(b),Ot.sort(x)),Fr.render(e,t),Dt.info.render.calls=0,Dt.info.render.vertices=0,Dt.info.render.faces=0,Dt.info.render.points=0,this.setRenderTarget(n),(this.autoClear||i)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil);for(var a=0,s=Pt.length;s>a;a++){var u=Pt[a],c=u.object;c.visible&&(Z(c,t),E(u))}if(e.overrideMaterial){var l=e.overrideMaterial;this.setBlending(l.blending,l.blendEquation,l.blendSrc,l.blendDst),this.setDepthTest(l.depthTest),this.setDepthWrite(l.depthWrite),nt(l.polygonOffset,l.polygonOffsetFactor,l.polygonOffsetUnits),S(Rt,t,$t,o,!0,l),S(Ot,t,$t,o,!0,l),M(Pt,"",t,$t,o,!1,l)}else{var l=null;this.setBlending(r.NoBlending),S(Rt,t,$t,o,!1,l),M(Pt,"opaque",t,$t,o,!1,l),S(Ot,t,$t,o,!0,l),M(Pt,"transparent",t,$t,o,!0,l)}jr.render(e,t),Dr.render(e,t,sr,ur),n&&n.generateMipmaps&&n.minFilter!==r.NearestFilter&&n.minFilter!==r.LinearFilter&<(n),this.setDepthTest(!0),this.setDepthWrite(!0)},this.renderImmediateObject=function(e,t,r,n,i){var o=N(e,t,r,n,i);It="",Dt.setMaterialFaces(n),i.immediateRenderCallback?i.immediateRenderCallback(o,jt,hr):i.render(function(e){Dt.renderBufferImmediate(e,o,n)})};var Xr={},Yr=0,Kr={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};this.setFaceCulling=function(e,t){e===r.CullFaceNone?jt.disable(jt.CULL_FACE):(jt.frontFace(t===r.FrontFaceDirectionCW?jt.CW:jt.CCW),jt.cullFace(e===r.CullFaceBack?jt.BACK:e===r.CullFaceFront?jt.FRONT:jt.FRONT_AND_BACK),jt.enable(jt.CULL_FACE))},this.setMaterialFaces=function(e){var t=e.side===r.DoubleSide,n=e.side===r.BackSide;Ht!==t&&(t?jt.disable(jt.CULL_FACE):jt.enable(jt.CULL_FACE),Ht=t),Wt!==n&&(jt.frontFace(n?jt.CW:jt.CCW),Wt=n)},this.setDepthTest=function(e){Qt!==e&&(e?jt.enable(jt.DEPTH_TEST):jt.disable(jt.DEPTH_TEST),Qt=e)},this.setDepthWrite=function(e){Zt!==e&&(jt.depthMask(e),Zt=e)},this.setBlending=function(e,t,n,i){e!==qt&&(e===r.NoBlending?jt.disable(jt.BLEND):e===r.AdditiveBlending?(jt.enable(jt.BLEND),jt.blendEquation(jt.FUNC_ADD),jt.blendFunc(jt.SRC_ALPHA,jt.ONE)):e===r.SubtractiveBlending?(jt.enable(jt.BLEND),jt.blendEquation(jt.FUNC_ADD),jt.blendFunc(jt.ZERO,jt.ONE_MINUS_SRC_COLOR)):e===r.MultiplyBlending?(jt.enable(jt.BLEND),jt.blendEquation(jt.FUNC_ADD),jt.blendFunc(jt.ZERO,jt.SRC_COLOR)):e===r.CustomBlending?jt.enable(jt.BLEND):(jt.enable(jt.BLEND),jt.blendEquationSeparate(jt.FUNC_ADD,jt.FUNC_ADD),jt.blendFuncSeparate(jt.SRC_ALPHA,jt.ONE_MINUS_SRC_ALPHA,jt.ONE,jt.ONE_MINUS_SRC_ALPHA)),qt=e),e===r.CustomBlending?(t!==Xt&&(jt.blendEquation(ft(t)),Xt=t),(n!==Yt||i!==Kt)&&(jt.blendFunc(ft(n),ft(i)),Yt=n,Kt=i)):(Xt=null,Yt=null,Kt=null)},this.uploadTexture=function(e){void 0===e.__webglInit&&(e.__webglInit=!0,e.addEventListener("dispose",Vr),e.__webglTexture=jt.createTexture(),Dt.info.memory.textures++),jt.bindTexture(jt.TEXTURE_2D,e.__webglTexture),jt.pixelStorei(jt.UNPACK_FLIP_Y_WEBGL,e.flipY),jt.pixelStorei(jt.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),jt.pixelStorei(jt.UNPACK_ALIGNMENT,e.unpackAlignment),e.image=ot(e.image,Mr);var t=e.image,n=r.Math.isPowerOfTwo(t.width)&&r.Math.isPowerOfTwo(t.height),i=ft(e.format),o=ft(e.type);it(jt.TEXTURE_2D,e,n);var a,s=e.mipmaps;if(e instanceof r.DataTexture)if(s.length>0&&n){for(var u=0,c=s.length;c>u;u++)a=s[u],jt.texImage2D(jt.TEXTURE_2D,u,i,a.width,a.height,0,i,o,a.data);e.generateMipmaps=!1}else jt.texImage2D(jt.TEXTURE_2D,0,i,t.width,t.height,0,i,o,t.data);else if(e instanceof r.CompressedTexture)for(var u=0,c=s.length;c>u;u++)a=s[u],e.format!==r.RGBAFormat&&e.format!==r.RGBFormat?Rr().indexOf(i)>-1?jt.compressedTexImage2D(jt.TEXTURE_2D,u,i,a.width,a.height,0,a.data):console.warn("Attempt to load unsupported compressed texture format"):jt.texImage2D(jt.TEXTURE_2D,u,i,a.width,a.height,0,i,o,a.data);else if(s.length>0&&n){for(var u=0,c=s.length;c>u;u++)a=s[u],jt.texImage2D(jt.TEXTURE_2D,u,i,i,o,a);e.generateMipmaps=!1}else jt.texImage2D(jt.TEXTURE_2D,0,i,i,o,e.image);e.generateMipmaps&&n&&jt.generateMipmap(jt.TEXTURE_2D),e.needsUpdate=!1,e.onUpdate&&e.onUpdate()},this.setTexture=function(e,t){jt.activeTexture(jt.TEXTURE0+t),e.needsUpdate?Dt.uploadTexture(e):jt.bindTexture(jt.TEXTURE_2D,e.__webglTexture)},this.setRenderTarget=function(e){var t=e instanceof r.WebGLRenderTargetCube;if(e&&void 0===e.__webglFramebuffer){void 0===e.depthBuffer&&(e.depthBuffer=!0),void 0===e.stencilBuffer&&(e.stencilBuffer=!0),e.addEventListener("dispose",Br),e.__webglTexture=jt.createTexture(),Dt.info.memory.textures++;var n=r.Math.isPowerOfTwo(e.width)&&r.Math.isPowerOfTwo(e.height),i=ft(e.format),o=ft(e.type);if(t){e.__webglFramebuffer=[],e.__webglRenderbuffer=[],jt.bindTexture(jt.TEXTURE_CUBE_MAP,e.__webglTexture),it(jt.TEXTURE_CUBE_MAP,e,n);for(var a=0;6>a;a++)e.__webglFramebuffer[a]=jt.createFramebuffer(),e.__webglRenderbuffer[a]=jt.createRenderbuffer(),jt.texImage2D(jt.TEXTURE_CUBE_MAP_POSITIVE_X+a,0,i,e.width,e.height,0,i,o,null),ut(e.__webglFramebuffer[a],e,jt.TEXTURE_CUBE_MAP_POSITIVE_X+a),ct(e.__webglRenderbuffer[a],e);n&&jt.generateMipmap(jt.TEXTURE_CUBE_MAP)}else e.__webglFramebuffer=jt.createFramebuffer(),e.__webglRenderbuffer=e.shareDepthFrom?e.shareDepthFrom.__webglRenderbuffer:jt.createRenderbuffer(),jt.bindTexture(jt.TEXTURE_2D,e.__webglTexture),it(jt.TEXTURE_2D,e,n),jt.texImage2D(jt.TEXTURE_2D,0,i,e.width,e.height,0,i,o,null),ut(e.__webglFramebuffer,e,jt.TEXTURE_2D),e.shareDepthFrom?e.depthBuffer&&!e.stencilBuffer?jt.framebufferRenderbuffer(jt.FRAMEBUFFER,jt.DEPTH_ATTACHMENT,jt.RENDERBUFFER,e.__webglRenderbuffer):e.depthBuffer&&e.stencilBuffer&&jt.framebufferRenderbuffer(jt.FRAMEBUFFER,jt.DEPTH_STENCIL_ATTACHMENT,jt.RENDERBUFFER,e.__webglRenderbuffer):ct(e.__webglRenderbuffer,e),n&&jt.generateMipmap(jt.TEXTURE_2D);t?jt.bindTexture(jt.TEXTURE_CUBE_MAP,null):jt.bindTexture(jt.TEXTURE_2D,null),jt.bindRenderbuffer(jt.RENDERBUFFER,null),jt.bindFramebuffer(jt.FRAMEBUFFER,null)}var s,u,c,l,h;e?(s=t?e.__webglFramebuffer[e.activeCubeFace]:e.__webglFramebuffer,u=e.width,c=e.height,l=0,h=0):(s=null,u=or,c=ar,l=nr,h=ir),s!==Vt&&(jt.bindFramebuffer(jt.FRAMEBUFFER,s),jt.viewport(l,h,u,c),Vt=s),sr=u,ur=c},this.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},this.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},this.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},this.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}},r.WebGLRenderTarget=function(e,t,n){this.width=e,this.height=t,n=n||{},this.wrapS=void 0!==n.wrapS?n.wrapS:r.ClampToEdgeWrapping,this.wrapT=void 0!==n.wrapT?n.wrapT:r.ClampToEdgeWrapping,this.magFilter=void 0!==n.magFilter?n.magFilter:r.LinearFilter,this.minFilter=void 0!==n.minFilter?n.minFilter:r.LinearMipMapLinearFilter,this.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,this.offset=new r.Vector2(0,0),this.repeat=new r.Vector2(1,1),this.format=void 0!==n.format?n.format:r.RGBAFormat,this.type=void 0!==n.type?n.type:r.UnsignedByteType,this.depthBuffer=void 0!==n.depthBuffer?n.depthBuffer:!0,this.stencilBuffer=void 0!==n.stencilBuffer?n.stencilBuffer:!0,this.generateMipmaps=!0,this.shareDepthFrom=null},r.WebGLRenderTarget.prototype={constructor:r.WebGLRenderTarget,setSize:function(e,t){this.width=e,this.height=t},clone:function(){var e=new r.WebGLRenderTarget(this.width,this.height);return e.wrapS=this.wrapS,e.wrapT=this.wrapT,e.magFilter=this.magFilter,e.minFilter=this.minFilter,e.anisotropy=this.anisotropy,e.offset.copy(this.offset),e.repeat.copy(this.repeat),e.format=this.format,e.type=this.type,e.depthBuffer=this.depthBuffer,e.stencilBuffer=this.stencilBuffer,e.generateMipmaps=this.generateMipmaps,e.shareDepthFrom=this.shareDepthFrom,e},dispose:function(){this.dispatchEvent({type:"dispose"})}},r.EventDispatcher.prototype.apply(r.WebGLRenderTarget.prototype),r.WebGLRenderTargetCube=function(e,t,n){r.WebGLRenderTarget.call(this,e,t,n),this.activeCubeFace=0},r.WebGLRenderTargetCube.prototype=Object.create(r.WebGLRenderTarget.prototype),r.WebGLRenderTargetCube.prototype.constructor=r.WebGLRenderTargetCube,r.WebGLExtensions=function(e){var t={};this.get=function(r){if(void 0!==t[r])return t[r];var n;switch(r){case"EXT_texture_filter_anisotropic":n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=e.getExtension(r)}return null===n&&console.log("THREE.WebGLRenderer: "+r+" extension not supported."),t[r]=n,n}},r.WebGLProgram=function(){var e=0,t=function(e){var t,r,n=[];for(var i in e)t=e[i],t!==!1&&(r="#define "+i+" "+t,n.push(r));return n.join("\n")},n=function(e,t,r){for(var n={},i=0,o=r.length;o>i;i++){var a=r[i];n[a]=e.getUniformLocation(t,a)}return n},i=function(e,t,r){for(var n={},i=0,o=r.length;o>i;i++){var a=r[i];n[a]=e.getAttribLocation(t,a)}return n};return function(o,a,s,u){var c=o,l=c.context,h=s.defines,f=s.__webglShader.uniforms,p=s.attributes,d=s.__webglShader.vertexShader,m=s.__webglShader.fragmentShader,v=s.index0AttributeName;void 0===v&&u.morphTargets===!0&&(v="position");var g="SHADOWMAP_TYPE_BASIC";u.shadowMapType===r.PCFShadowMap?g="SHADOWMAP_TYPE_PCF":u.shadowMapType===r.PCFSoftShadowMap&&(g="SHADOWMAP_TYPE_PCF_SOFT");var y="ENVMAP_TYPE_CUBE",b="ENVMAP_MODE_REFLECTION",x="ENVMAP_BLENDING_MULTIPLY";if(u.envMap){switch(s.envMap.mapping){case r.CubeReflectionMapping:case r.CubeRefractionMapping:y="ENVMAP_TYPE_CUBE";break;case r.EquirectangularReflectionMapping:case r.EquirectangularRefractionMapping:y="ENVMAP_TYPE_EQUIREC";break;case r.SphericalReflectionMapping:y="ENVMAP_TYPE_SPHERE"}switch(s.envMap.mapping){case r.CubeRefractionMapping:case r.EquirectangularRefractionMapping:b="ENVMAP_MODE_REFRACTION"}switch(s.combine){case r.MultiplyOperation:x="ENVMAP_BLENDING_MULTIPLY";break;case r.MixOperation:x="ENVMAP_BLENDING_MIX";break;case r.AddOperation:x="ENVMAP_BLENDING_ADD"}}var w,_,S=t(h),M=l.createProgram();s instanceof r.RawShaderMaterial?(w="",_=""):(w=["precision "+u.precision+" float;","precision "+u.precision+" int;",S,u.supportsVertexTextures?"#define VERTEX_TEXTURES":"",c.gammaInput?"#define GAMMA_INPUT":"",c.gammaOutput?"#define GAMMA_OUTPUT":"","#define MAX_DIR_LIGHTS "+u.maxDirLights,"#define MAX_POINT_LIGHTS "+u.maxPointLights,"#define MAX_SPOT_LIGHTS "+u.maxSpotLights,"#define MAX_HEMI_LIGHTS "+u.maxHemiLights,"#define MAX_SHADOWS "+u.maxShadows,"#define MAX_BONES "+u.maxBones,u.map?"#define USE_MAP":"",u.envMap?"#define USE_ENVMAP":"",u.envMap?"#define "+b:"",u.lightMap?"#define USE_LIGHTMAP":"",u.bumpMap?"#define USE_BUMPMAP":"",u.normalMap?"#define USE_NORMALMAP":"",u.specularMap?"#define USE_SPECULARMAP":"",u.alphaMap?"#define USE_ALPHAMAP":"",u.vertexColors?"#define USE_COLOR":"",u.skinning?"#define USE_SKINNING":"",u.useVertexTexture?"#define BONE_TEXTURE":"",u.morphTargets?"#define USE_MORPHTARGETS":"",u.morphNormals?"#define USE_MORPHNORMALS":"",u.wrapAround?"#define WRAP_AROUND":"",u.doubleSided?"#define DOUBLE_SIDED":"",u.flipSided?"#define FLIP_SIDED":"",u.shadowMapEnabled?"#define USE_SHADOWMAP":"",u.shadowMapEnabled?"#define "+g:"",u.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",u.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",u.sizeAttenuation?"#define USE_SIZEATTENUATION":"",u.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","attribute vec2 uv2;","#ifdef USE_COLOR"," attribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",""].join("\n"),_=["precision "+u.precision+" float;","precision "+u.precision+" int;",u.bumpMap||u.normalMap?"#extension GL_OES_standard_derivatives : enable":"",S,"#define MAX_DIR_LIGHTS "+u.maxDirLights,"#define MAX_POINT_LIGHTS "+u.maxPointLights,"#define MAX_SPOT_LIGHTS "+u.maxSpotLights,"#define MAX_HEMI_LIGHTS "+u.maxHemiLights,"#define MAX_SHADOWS "+u.maxShadows,u.alphaTest?"#define ALPHATEST "+u.alphaTest:"",c.gammaInput?"#define GAMMA_INPUT":"",c.gammaOutput?"#define GAMMA_OUTPUT":"",u.useFog&&u.fog?"#define USE_FOG":"",u.useFog&&u.fogExp?"#define FOG_EXP2":"",u.map?"#define USE_MAP":"",u.envMap?"#define USE_ENVMAP":"",u.envMap?"#define "+y:"",u.envMap?"#define "+b:"",u.envMap?"#define "+x:"",u.lightMap?"#define USE_LIGHTMAP":"",u.bumpMap?"#define USE_BUMPMAP":"",u.normalMap?"#define USE_NORMALMAP":"",u.specularMap?"#define USE_SPECULARMAP":"",u.alphaMap?"#define USE_ALPHAMAP":"",u.vertexColors?"#define USE_COLOR":"",u.metal?"#define METAL":"",u.wrapAround?"#define WRAP_AROUND":"",u.doubleSided?"#define DOUBLE_SIDED":"",u.flipSided?"#define FLIP_SIDED":"",u.shadowMapEnabled?"#define USE_SHADOWMAP":"",u.shadowMapEnabled?"#define "+g:"",u.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",u.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",u.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",""].join("\n"));var E=new r.WebGLShader(l,l.VERTEX_SHADER,w+d),T=new r.WebGLShader(l,l.FRAGMENT_SHADER,_+m);l.attachShader(M,E),l.attachShader(M,T),void 0!==v&&l.bindAttribLocation(M,0,v),l.linkProgram(M),l.getProgramParameter(M,l.LINK_STATUS)===!1&&(console.error("THREE.WebGLProgram: Could not initialise shader."),console.error("gl.VALIDATE_STATUS",l.getProgramParameter(M,l.VALIDATE_STATUS)),console.error("gl.getError()",l.getError())),""!==l.getProgramInfoLog(M)&&console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",l.getProgramInfoLog(M)),l.deleteShader(E),l.deleteShader(T);var C=["viewMatrix","modelViewMatrix","projectionMatrix","normalMatrix","modelMatrix","cameraPosition","morphTargetInfluences","bindMatrix","bindMatrixInverse"];u.useVertexTexture?(C.push("boneTexture"),C.push("boneTextureWidth"),C.push("boneTextureHeight")):C.push("boneGlobalMatrices"),u.logarithmicDepthBuffer&&C.push("logDepthBufFC");for(var A in f)C.push(A);this.uniforms=n(l,M,C),C=["position","normal","uv","uv2","tangent","color","skinIndex","skinWeight","lineDistance"];for(var $=0;$<u.maxMorphTargets;$++)C.push("morphTarget"+$);for(var $=0;$<u.maxMorphNormals;$++)C.push("morphNormal"+$);for(var k in p)C.push(k);return this.attributes=i(l,M,C),this.attributesKeys=Object.keys(this.attributes),this.id=e++,this.code=a,this.usedTimes=1,this.program=M,this.vertexShader=E,this.fragmentShader=T,this}}(),r.WebGLShader=function(){var e=function(e){for(var t=e.split("\n"),r=0;r<t.length;r++)t[r]=r+1+": "+t[r];return t.join("\n")};return function(t,r,n){var i=t.createShader(r);return t.shaderSource(i,n),t.compileShader(i),t.getShaderParameter(i,t.COMPILE_STATUS)===!1&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==t.getShaderInfoLog(i)&&(console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",t.getShaderInfoLog(i)),console.warn(e(n))),i}}(),r.LensFlarePlugin=function(e,t){function n(t){var r=f.createProgram(),n=f.createShader(f.FRAGMENT_SHADER),i=f.createShader(f.VERTEX_SHADER),o="precision "+e.getPrecision()+" float;\n";return f.shaderSource(n,o+t.fragmentShader),f.shaderSource(i,o+t.vertexShader),f.compileShader(n),f.compileShader(i),f.attachShader(r,n),f.attachShader(r,i),f.linkProgram(r),r}var i,o,a,s,u,c,l,h,f=e.context,p=function(){var e=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),t=new Uint16Array([0,1,2,0,2,3]);i=f.createBuffer(),o=f.createBuffer(),f.bindBuffer(f.ARRAY_BUFFER,i),f.bufferData(f.ARRAY_BUFFER,e,f.STATIC_DRAW),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,o),f.bufferData(f.ELEMENT_ARRAY_BUFFER,t,f.STATIC_DRAW),l=f.createTexture(),h=f.createTexture(),f.bindTexture(f.TEXTURE_2D,l),f.texImage2D(f.TEXTURE_2D,0,f.RGB,16,16,0,f.RGB,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.NEAREST),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.NEAREST),f.bindTexture(f.TEXTURE_2D,h),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,16,16,0,f.RGBA,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.NEAREST),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.NEAREST),c=f.getParameter(f.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;var r;r=c?{vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","uniform sampler2D occlusionMap;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","varying float vVisibility;","void main() {","vUV = uv;","vec2 pos = position;","if( renderType == 2 ) {","vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );","visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );","vVisibility = visibility.r / 9.0;","vVisibility *= 1.0 - visibility.g / 9.0;","vVisibility *= visibility.b / 9.0;","vVisibility *= 1.0 - visibility.a / 9.0;","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join("\n"),fragmentShader:["uniform lowp int renderType;","uniform sampler2D map;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","varying float vVisibility;","void main() {","if( renderType == 0 ) {","gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );","} else if( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * vVisibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join("\n")}:{vertexShader:["uniform lowp int renderType;","uniform vec3 screenPosition;","uniform vec2 scale;","uniform float rotation;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uv;","vec2 pos = position;","if( renderType == 2 ) {","pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;","pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;","}","gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );","}"].join("\n"),fragmentShader:["precision mediump float;","uniform lowp int renderType;","uniform sampler2D map;","uniform sampler2D occlusionMap;","uniform float opacity;","uniform vec3 color;","varying vec2 vUV;","void main() {","if( renderType == 0 ) {","gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );","} else if( renderType == 1 ) {","gl_FragColor = texture2D( map, vUV );","} else {","float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;","visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;","visibility = ( 1.0 - visibility / 4.0 );","vec4 texture = texture2D( map, vUV );","texture.a *= opacity * visibility;","gl_FragColor = texture;","gl_FragColor.rgb *= color;","}","}"].join("\n")},a=n(r),s={vertex:f.getAttribLocation(a,"position"),uv:f.getAttribLocation(a,"uv")},u={renderType:f.getUniformLocation(a,"renderType"),map:f.getUniformLocation(a,"map"),occlusionMap:f.getUniformLocation(a,"occlusionMap"),opacity:f.getUniformLocation(a,"opacity"),color:f.getUniformLocation(a,"color"),scale:f.getUniformLocation(a,"scale"),rotation:f.getUniformLocation(a,"rotation"),screenPosition:f.getUniformLocation(a,"screenPosition")}
};this.render=function(n,d,m,v){if(0!==t.length){var g=new r.Vector3,y=v/m,b=.5*m,x=.5*v,w=16/v,_=new r.Vector2(w*y,w),S=new r.Vector3(1,1,0),M=new r.Vector2(1,1);void 0===a&&p(),f.useProgram(a),f.enableVertexAttribArray(s.vertex),f.enableVertexAttribArray(s.uv),f.uniform1i(u.occlusionMap,0),f.uniform1i(u.map,1),f.bindBuffer(f.ARRAY_BUFFER,i),f.vertexAttribPointer(s.vertex,2,f.FLOAT,!1,16,0),f.vertexAttribPointer(s.uv,2,f.FLOAT,!1,16,8),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,o),f.disable(f.CULL_FACE),f.depthMask(!1);for(var E=0,T=t.length;T>E;E++){w=16/v,_.set(w*y,w);var C=t[E];if(g.set(C.matrixWorld.elements[12],C.matrixWorld.elements[13],C.matrixWorld.elements[14]),g.applyMatrix4(d.matrixWorldInverse),g.applyProjection(d.projectionMatrix),S.copy(g),M.x=S.x*b+b,M.y=S.y*x+x,c||M.x>0&&M.x<m&&M.y>0&&M.y<v){f.activeTexture(f.TEXTURE1),f.bindTexture(f.TEXTURE_2D,l),f.copyTexImage2D(f.TEXTURE_2D,0,f.RGB,M.x-8,M.y-8,16,16,0),f.uniform1i(u.renderType,0),f.uniform2f(u.scale,_.x,_.y),f.uniform3f(u.screenPosition,S.x,S.y,S.z),f.disable(f.BLEND),f.enable(f.DEPTH_TEST),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0),f.activeTexture(f.TEXTURE0),f.bindTexture(f.TEXTURE_2D,h),f.copyTexImage2D(f.TEXTURE_2D,0,f.RGBA,M.x-8,M.y-8,16,16,0),f.uniform1i(u.renderType,1),f.disable(f.DEPTH_TEST),f.activeTexture(f.TEXTURE1),f.bindTexture(f.TEXTURE_2D,l),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0),C.positionScreen.copy(S),C.customUpdateCallback?C.customUpdateCallback(C):C.updateLensFlares(),f.uniform1i(u.renderType,2),f.enable(f.BLEND);for(var A=0,$=C.lensFlares.length;$>A;A++){var k=C.lensFlares[A];k.opacity>.001&&k.scale>.001&&(S.x=k.x,S.y=k.y,S.z=k.z,w=k.size*k.scale/v,_.x=w*y,_.y=w,f.uniform3f(u.screenPosition,S.x,S.y,S.z),f.uniform2f(u.scale,_.x,_.y),f.uniform1f(u.rotation,k.rotation),f.uniform1f(u.opacity,k.opacity),f.uniform3f(u.color,k.color.r,k.color.g,k.color.b),e.setBlending(k.blending,k.blendEquation,k.blendSrc,k.blendDst),e.setTexture(k.texture,1),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0))}}}f.enable(f.CULL_FACE),f.enable(f.DEPTH_TEST),f.depthMask(!0),e.resetGLState()}}},r.ShadowMapPlugin=function(e,t,n,i){function o(e,t,r){if(t.visible){var i=n[t.id];if(i&&t.castShadow&&(t.frustumCulled===!1||m.intersectsObject(t)===!0))for(var a=0,s=i.length;s>a;a++){var u=i[a];t._modelViewMatrix.multiplyMatrices(r.matrixWorldInverse,t.matrixWorld),x.push(u)}for(var a=0,s=t.children.length;s>a;a++)o(e,t.children[a],r)}}function a(e,t){var n=new r.DirectionalLight;n.isVirtual=!0,n.onlyShadow=!0,n.castShadow=!0,n.shadowCameraNear=e.shadowCameraNear,n.shadowCameraFar=e.shadowCameraFar,n.shadowCameraLeft=e.shadowCameraLeft,n.shadowCameraRight=e.shadowCameraRight,n.shadowCameraBottom=e.shadowCameraBottom,n.shadowCameraTop=e.shadowCameraTop,n.shadowCameraVisible=e.shadowCameraVisible,n.shadowDarkness=e.shadowDarkness,n.shadowBias=e.shadowCascadeBias[t],n.shadowMapWidth=e.shadowCascadeWidth[t],n.shadowMapHeight=e.shadowCascadeHeight[t],n.pointsWorld=[],n.pointsFrustum=[];for(var i=n.pointsWorld,o=n.pointsFrustum,a=0;8>a;a++)i[a]=new r.Vector3,o[a]=new r.Vector3;var s=e.shadowCascadeNearZ[t],u=e.shadowCascadeFarZ[t];return o[0].set(-1,-1,s),o[1].set(1,-1,s),o[2].set(-1,1,s),o[3].set(1,1,s),o[4].set(-1,-1,u),o[5].set(1,-1,u),o[6].set(-1,1,u),o[7].set(1,1,u),n}function s(e,t){var r=e.shadowCascadeArray[t];r.position.copy(e.position),r.target.position.copy(e.target.position),r.lookAt(r.target),r.shadowCameraVisible=e.shadowCameraVisible,r.shadowDarkness=e.shadowDarkness,r.shadowBias=e.shadowCascadeBias[t];var n=e.shadowCascadeNearZ[t],i=e.shadowCascadeFarZ[t],o=r.pointsFrustum;o[0].z=n,o[1].z=n,o[2].z=n,o[3].z=n,o[4].z=i,o[5].z=i,o[6].z=i,o[7].z=i}function u(e,t){var r=t.shadowCamera,n=t.pointsFrustum,i=t.pointsWorld;g.set(1/0,1/0,1/0),y.set(-1/0,-1/0,-1/0);for(var o=0;8>o;o++){var a=i[o];a.copy(n[o]),a.unproject(e),a.applyMatrix4(r.matrixWorldInverse),a.x<g.x&&(g.x=a.x),a.x>y.x&&(y.x=a.x),a.y<g.y&&(g.y=a.y),a.y>y.y&&(y.y=a.y),a.z<g.z&&(g.z=a.z),a.z>y.z&&(y.z=a.z)}r.left=g.x,r.right=y.x,r.top=y.y,r.bottom=g.y,r.updateProjectionMatrix()}function c(e){return e.material instanceof r.MeshFaceMaterial?e.material.materials[0]:e.material}var l,h,f,p,d=e.context,m=new r.Frustum,v=new r.Matrix4,g=new r.Vector3,y=new r.Vector3,b=new r.Vector3,x=[],w=r.ShaderLib.depthRGBA,_=r.UniformsUtils.clone(w.uniforms);l=new r.ShaderMaterial({uniforms:_,vertexShader:w.vertexShader,fragmentShader:w.fragmentShader}),h=new r.ShaderMaterial({uniforms:_,vertexShader:w.vertexShader,fragmentShader:w.fragmentShader,morphTargets:!0}),f=new r.ShaderMaterial({uniforms:_,vertexShader:w.vertexShader,fragmentShader:w.fragmentShader,skinning:!0}),p=new r.ShaderMaterial({uniforms:_,vertexShader:w.vertexShader,fragmentShader:w.fragmentShader,morphTargets:!0,skinning:!0}),l._shadowPass=!0,h._shadowPass=!0,f._shadowPass=!0,p._shadowPass=!0,this.render=function(n,g){if(e.shadowMapEnabled!==!1){var y,w,_,S,M,E,T,C,A,$,k,P,R,O=[],L=0,F=null;for(d.clearColor(1,1,1,1),d.disable(d.BLEND),d.enable(d.CULL_FACE),d.frontFace(d.CCW),d.cullFace(e.shadowMapCullFace===r.CullFaceFront?d.FRONT:d.BACK),e.setDepthTest(!0),y=0,w=t.length;w>y;y++)if(R=t[y],R.castShadow)if(R instanceof r.DirectionalLight&&R.shadowCascade)for(M=0;M<R.shadowCascadeCount;M++){var j;if(R.shadowCascadeArray[M])j=R.shadowCascadeArray[M];else{j=a(R,M),j.originalCamera=g;var D=new r.Gyroscope;D.position.copy(R.shadowCascadeOffset),D.add(j),D.add(j.target),g.add(D),R.shadowCascadeArray[M]=j,console.log("Created virtualLight",j)}s(R,M),O[L]=j,L++}else O[L]=R,L++;for(y=0,w=O.length;w>y;y++){if(R=O[y],!R.shadowMap){var N=r.LinearFilter;e.shadowMapType===r.PCFSoftShadowMap&&(N=r.NearestFilter);var U={minFilter:N,magFilter:N,format:r.RGBAFormat};R.shadowMap=new r.WebGLRenderTarget(R.shadowMapWidth,R.shadowMapHeight,U),R.shadowMapSize=new r.Vector2(R.shadowMapWidth,R.shadowMapHeight),R.shadowMatrix=new r.Matrix4}if(!R.shadowCamera){if(R instanceof r.SpotLight)R.shadowCamera=new r.PerspectiveCamera(R.shadowCameraFov,R.shadowMapWidth/R.shadowMapHeight,R.shadowCameraNear,R.shadowCameraFar);else{if(!(R instanceof r.DirectionalLight)){console.error("Unsupported light type for shadow");continue}R.shadowCamera=new r.OrthographicCamera(R.shadowCameraLeft,R.shadowCameraRight,R.shadowCameraTop,R.shadowCameraBottom,R.shadowCameraNear,R.shadowCameraFar)}n.add(R.shadowCamera),n.autoUpdate===!0&&n.updateMatrixWorld()}R.shadowCameraVisible&&!R.cameraHelper&&(R.cameraHelper=new r.CameraHelper(R.shadowCamera),n.add(R.cameraHelper)),R.isVirtual&&j.originalCamera==g&&u(g,R),E=R.shadowMap,T=R.shadowMatrix,C=R.shadowCamera,C.position.setFromMatrixPosition(R.matrixWorld),b.setFromMatrixPosition(R.target.matrixWorld),C.lookAt(b),C.updateMatrixWorld(),C.matrixWorldInverse.getInverse(C.matrixWorld),R.cameraHelper&&(R.cameraHelper.visible=R.shadowCameraVisible),R.shadowCameraVisible&&R.cameraHelper.update(),T.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),T.multiply(C.projectionMatrix),T.multiply(C.matrixWorldInverse),v.multiplyMatrices(C.projectionMatrix,C.matrixWorldInverse),m.setFromMatrix(v),e.setRenderTarget(E),e.clear(),x.length=0,o(n,n,C);var V,B,I;for(_=0,S=x.length;S>_;_++)k=x[_],P=k.object,A=k.buffer,V=c(P),B=void 0!==P.geometry.morphTargets&&P.geometry.morphTargets.length>0&&V.morphTargets,I=P instanceof r.SkinnedMesh&&V.skinning,$=P.customDepthMaterial?P.customDepthMaterial:I?B?p:f:B?h:l,e.setMaterialFaces(V),A instanceof r.BufferGeometry?e.renderBufferDirect(C,t,F,$,A,P):e.renderBuffer(C,t,F,$,A,P);for(_=0,S=i.length;S>_;_++)k=i[_],P=k.object,P.visible&&P.castShadow&&(P._modelViewMatrix.multiplyMatrices(C.matrixWorldInverse,P.matrixWorld),e.renderImmediateObject(C,t,F,l,P))}var z=e.getClearColor(),G=e.getClearAlpha();d.clearColor(z.r,z.g,z.b,G),d.enable(d.BLEND),e.shadowMapCullFace===r.CullFaceFront&&d.cullFace(d.BACK),e.resetGLState()}}},r.SpritePlugin=function(e,t){function n(){var t=h.createProgram(),r=h.createShader(h.VERTEX_SHADER),n=h.createShader(h.FRAGMENT_SHADER);return h.shaderSource(r,["precision "+e.getPrecision()+" float;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform float rotation;","uniform vec2 scale;","uniform vec2 uvOffset;","uniform vec2 uvScale;","attribute vec2 position;","attribute vec2 uv;","varying vec2 vUV;","void main() {","vUV = uvOffset + uv * uvScale;","vec2 alignedPosition = position * scale;","vec2 rotatedPosition;","rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;","rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;","vec4 finalPosition;","finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );","finalPosition.xy += rotatedPosition;","finalPosition = projectionMatrix * finalPosition;","gl_Position = finalPosition;","}"].join("\n")),h.shaderSource(n,["precision "+e.getPrecision()+" float;","uniform vec3 color;","uniform sampler2D map;","uniform float opacity;","uniform int fogType;","uniform vec3 fogColor;","uniform float fogDensity;","uniform float fogNear;","uniform float fogFar;","uniform float alphaTest;","varying vec2 vUV;","void main() {","vec4 texture = texture2D( map, vUV );","if ( texture.a < alphaTest ) discard;","gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );","if ( fogType > 0 ) {","float depth = gl_FragCoord.z / gl_FragCoord.w;","float fogFactor = 0.0;","if ( fogType == 1 ) {","fogFactor = smoothstep( fogNear, fogFar, depth );","} else {","const float LOG2 = 1.442695;","float fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );","fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );","}","gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );","}","}"].join("\n")),h.compileShader(r),h.compileShader(n),h.attachShader(t,r),h.attachShader(t,n),h.linkProgram(t),t}function i(e,t){return e.z!==t.z?t.z-e.z:t.id-e.id}var o,a,s,u,c,l,h=e.context,f=new r.Vector3,p=new r.Quaternion,d=new r.Vector3,m=function(){var e=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),t=new Uint16Array([0,1,2,0,2,3]);o=h.createBuffer(),a=h.createBuffer(),h.bindBuffer(h.ARRAY_BUFFER,o),h.bufferData(h.ARRAY_BUFFER,e,h.STATIC_DRAW),h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,a),h.bufferData(h.ELEMENT_ARRAY_BUFFER,t,h.STATIC_DRAW),s=n(),u={position:h.getAttribLocation(s,"position"),uv:h.getAttribLocation(s,"uv")},c={uvOffset:h.getUniformLocation(s,"uvOffset"),uvScale:h.getUniformLocation(s,"uvScale"),rotation:h.getUniformLocation(s,"rotation"),scale:h.getUniformLocation(s,"scale"),color:h.getUniformLocation(s,"color"),map:h.getUniformLocation(s,"map"),opacity:h.getUniformLocation(s,"opacity"),modelViewMatrix:h.getUniformLocation(s,"modelViewMatrix"),projectionMatrix:h.getUniformLocation(s,"projectionMatrix"),fogType:h.getUniformLocation(s,"fogType"),fogDensity:h.getUniformLocation(s,"fogDensity"),fogNear:h.getUniformLocation(s,"fogNear"),fogFar:h.getUniformLocation(s,"fogFar"),fogColor:h.getUniformLocation(s,"fogColor"),alphaTest:h.getUniformLocation(s,"alphaTest")};var i=document.createElement("canvas");i.width=8,i.height=8;var f=i.getContext("2d");f.fillStyle="white",f.fillRect(0,0,8,8),l=new r.Texture(i),l.needsUpdate=!0};this.render=function(n,v){if(0!==t.length){void 0===s&&m(),h.useProgram(s),h.enableVertexAttribArray(u.position),h.enableVertexAttribArray(u.uv),h.disable(h.CULL_FACE),h.enable(h.BLEND),h.bindBuffer(h.ARRAY_BUFFER,o),h.vertexAttribPointer(u.position,2,h.FLOAT,!1,16,0),h.vertexAttribPointer(u.uv,2,h.FLOAT,!1,16,8),h.bindBuffer(h.ELEMENT_ARRAY_BUFFER,a),h.uniformMatrix4fv(c.projectionMatrix,!1,v.projectionMatrix.elements),h.activeTexture(h.TEXTURE0),h.uniform1i(c.map,0);var g=0,y=0,b=n.fog;b?(h.uniform3f(c.fogColor,b.color.r,b.color.g,b.color.b),b instanceof r.Fog?(h.uniform1f(c.fogNear,b.near),h.uniform1f(c.fogFar,b.far),h.uniform1i(c.fogType,1),g=1,y=1):b instanceof r.FogExp2&&(h.uniform1f(c.fogDensity,b.density),h.uniform1i(c.fogType,2),g=2,y=2)):(h.uniform1i(c.fogType,0),g=0,y=0);for(var x=0,w=t.length;w>x;x++){var _=t[x];_._modelViewMatrix.multiplyMatrices(v.matrixWorldInverse,_.matrixWorld),_.z=-_._modelViewMatrix.elements[14]}t.sort(i);for(var S=[],x=0,w=t.length;w>x;x++){var _=t[x],M=_.material;h.uniform1f(c.alphaTest,M.alphaTest),h.uniformMatrix4fv(c.modelViewMatrix,!1,_._modelViewMatrix.elements),_.matrixWorld.decompose(f,p,d),S[0]=d.x,S[1]=d.y;var E=0;n.fog&&M.fog&&(E=y),g!==E&&(h.uniform1i(c.fogType,E),g=E),null!==M.map?(h.uniform2f(c.uvOffset,M.map.offset.x,M.map.offset.y),h.uniform2f(c.uvScale,M.map.repeat.x,M.map.repeat.y)):(h.uniform2f(c.uvOffset,0,0),h.uniform2f(c.uvScale,1,1)),h.uniform1f(c.opacity,M.opacity),h.uniform3f(c.color,M.color.r,M.color.g,M.color.b),h.uniform1f(c.rotation,M.rotation),h.uniform2fv(c.scale,S),e.setBlending(M.blending,M.blendEquation,M.blendSrc,M.blendDst),e.setDepthTest(M.depthTest),e.setDepthWrite(M.depthWrite),M.map&&M.map.image&&M.map.image.width?e.setTexture(M.map,0):e.setTexture(l,0),h.drawElements(h.TRIANGLES,6,h.UNSIGNED_SHORT,0)}h.enable(h.CULL_FACE),e.resetGLState()}}},r.GeometryUtils={merge:function(e,t,n){console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");var i;t instanceof r.Mesh&&(t.matrixAutoUpdate&&t.updateMatrix(),i=t.matrix,t=t.geometry),e.merge(t,i,n)},center:function(e){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),e.center()}},r.ImageUtils={crossOrigin:void 0,loadTexture:function(e,t,n,i){var o=new r.ImageLoader;o.crossOrigin=this.crossOrigin;var a=new r.Texture(void 0,t);return o.load(e,function(e){a.image=e,a.needsUpdate=!0,n&&n(a)},void 0,function(e){i&&i(e)}),a.sourceFile=e,a},loadTextureCube:function(e,t,n,i){var o=[],a=new r.ImageLoader;a.crossOrigin=this.crossOrigin;var s=new r.CubeTexture(o,t);s.flipY=!1;for(var u=0,c=function(t){a.load(e[t],function(e){s.images[t]=e,u+=1,6===u&&(s.needsUpdate=!0,n&&n(s))},void 0,i)},l=0,h=e.length;h>l;++l)c(l);return s},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(e,t){var r=function(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]},n=function(e,t){return[e[0]-t[0],e[1]-t[1],e[2]-t[2]]},i=function(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);return[e[0]/t,e[1]/t,e[2]/t]};t=1|t;var o=e.width,a=e.height,s=document.createElement("canvas");s.width=o,s.height=a;var u=s.getContext("2d");u.drawImage(e,0,0);for(var c=u.getImageData(0,0,o,a).data,l=u.createImageData(o,a),h=l.data,f=0;o>f;f++)for(var p=0;a>p;p++){var d=0>p-1?0:p-1,m=p+1>a-1?a-1:p+1,v=0>f-1?0:f-1,g=f+1>o-1?o-1:f+1,y=[],b=[0,0,c[4*(p*o+f)]/255*t];y.push([-1,0,c[4*(p*o+v)]/255*t]),y.push([-1,-1,c[4*(d*o+v)]/255*t]),y.push([0,-1,c[4*(d*o+f)]/255*t]),y.push([1,-1,c[4*(d*o+g)]/255*t]),y.push([1,0,c[4*(p*o+g)]/255*t]),y.push([1,1,c[4*(m*o+g)]/255*t]),y.push([0,1,c[4*(m*o+f)]/255*t]),y.push([-1,1,c[4*(m*o+v)]/255*t]);for(var x=[],w=y.length,_=0;w>_;_++){var S=y[_],M=y[(_+1)%w];S=n(S,b),M=n(M,b),x.push(i(r(S,M)))}for(var E=[0,0,0],_=0;_<x.length;_++)E[0]+=x[_][0],E[1]+=x[_][1],E[2]+=x[_][2];E[0]/=x.length,E[1]/=x.length,E[2]/=x.length;var T=4*(p*o+f);h[T]=(E[0]+1)/2*255|0,h[T+1]=(E[1]+1)/2*255|0,h[T+2]=255*E[2]|0,h[T+3]=255}return u.putImageData(l,0,0),s},generateDataTexture:function(e,t,n){for(var i=e*t,o=new Uint8Array(3*i),a=Math.floor(255*n.r),s=Math.floor(255*n.g),u=Math.floor(255*n.b),c=0;i>c;c++)o[3*c]=a,o[3*c+1]=s,o[3*c+2]=u;var l=new r.DataTexture(o,e,t,r.RGBFormat);return l.needsUpdate=!0,l}},r.SceneUtils={createMultiMaterialObject:function(e,t){for(var n=new r.Object3D,i=0,o=t.length;o>i;i++)n.add(new r.Mesh(e,t[i]));return n},detach:function(e,t,r){e.applyMatrix(t.matrixWorld),t.remove(e),r.add(e)},attach:function(e,t,n){var i=new r.Matrix4;i.getInverse(n.matrixWorld),e.applyMatrix(i),t.remove(e),n.add(e)}},r.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){try{return this.faces[this.face][this.weight][this.style]}catch(e){throw"The font "+this.face+" with "+this.weight+" weight and "+this.style+" style is missing."}},loadFace:function(e){var t=e.familyName.toLowerCase(),r=this;r.faces[t]=r.faces[t]||{},r.faces[t][e.cssFontWeight]=r.faces[t][e.cssFontWeight]||{},r.faces[t][e.cssFontWeight][e.cssFontStyle]=e;r.faces[t][e.cssFontWeight][e.cssFontStyle]=e;return e},drawText:function(e){var t,n=this.getFace(),i=this.size/n.resolution,o=0,a=String(e).split(""),s=a.length,u=[];for(t=0;s>t;t++){var c=new r.Path,l=this.extractGlyphPoints(a[t],n,i,o,c);o+=l.offset,u.push(l.path)}var h=o/2;return{paths:u,offset:h}},extractGlyphPoints:function(e,t,n,i,o){var a,s,u,c,l,h,f,p,d,m,v,g,y,b,x,w,_,S,M,E=[],T=t.glyphs[e]||t.glyphs["?"];if(T){if(T.o)for(c=T._cachedOutline||(T._cachedOutline=T.o.split(" ")),h=c.length,f=n,p=n,a=0;h>a;)switch(l=c[a++]){case"m":d=c[a++]*f+i,m=c[a++]*p,o.moveTo(d,m);break;case"l":d=c[a++]*f+i,m=c[a++]*p,o.lineTo(d,m);break;case"q":if(v=c[a++]*f+i,g=c[a++]*p,x=c[a++]*f+i,w=c[a++]*p,o.quadraticCurveTo(x,w,v,g),M=E[E.length-1])for(y=M.x,b=M.y,s=1,u=this.divisions;u>=s;s++){var C=s/u;r.Shape.Utils.b2(C,y,x,v),r.Shape.Utils.b2(C,b,w,g)}break;case"b":if(v=c[a++]*f+i,g=c[a++]*p,x=c[a++]*f+i,w=c[a++]*p,_=c[a++]*f+i,S=c[a++]*p,o.bezierCurveTo(x,w,_,S,v,g),M=E[E.length-1])for(y=M.x,b=M.y,s=1,u=this.divisions;u>=s;s++){var C=s/u;r.Shape.Utils.b3(C,y,x,_,v),r.Shape.Utils.b3(C,b,w,S,g)}}return{offset:T.ha*n,path:o}}}},r.FontUtils.generateShapes=function(e,t){t=t||{};var n=void 0!==t.size?t.size:100,i=void 0!==t.curveSegments?t.curveSegments:4,o=void 0!==t.font?t.font:"helvetiker",a=void 0!==t.weight?t.weight:"normal",s=void 0!==t.style?t.style:"normal";r.FontUtils.size=n,r.FontUtils.divisions=i,r.FontUtils.face=o,r.FontUtils.weight=a,r.FontUtils.style=s;for(var u=r.FontUtils.drawText(e),c=u.paths,l=[],h=0,f=c.length;f>h;h++)Array.prototype.push.apply(l,c[h].toShapes());return l},function(e){var t=1e-10,r=function(e,t){var r=e.length;if(3>r)return null;var o,a,s,u=[],c=[],l=[];if(n(e)>0)for(a=0;r>a;a++)c[a]=a;else for(a=0;r>a;a++)c[a]=r-1-a;var h=r,f=2*h;for(a=h-1;h>2;){if(f--<=0)return console.log("Warning, unable to triangulate polygon!"),t?l:u;if(o=a,o>=h&&(o=0),a=o+1,a>=h&&(a=0),s=a+1,s>=h&&(s=0),i(e,o,a,s,h,c)){var p,d,m,v,g;for(p=c[o],d=c[a],m=c[s],u.push([e[p],e[d],e[m]]),l.push([c[o],c[a],c[s]]),v=a,g=a+1;h>g;v++,g++)c[v]=c[g];h--,f=2*h}}return t?l:u},n=function(e){for(var t=e.length,r=0,n=t-1,i=0;t>i;n=i++)r+=e[n].x*e[i].y-e[i].x*e[n].y;return.5*r},i=function(e,r,n,i,o,a){var s,u,c,l,h,f,p,d,m;if(u=e[a[r]].x,c=e[a[r]].y,l=e[a[n]].x,h=e[a[n]].y,f=e[a[i]].x,p=e[a[i]].y,t>(l-u)*(p-c)-(h-c)*(f-u))return!1;var v,g,y,b,x,w,_,S,M,E,T,C,A,$,k;for(v=f-l,g=p-h,y=u-f,b=c-p,x=l-u,w=h-c,s=0;o>s;s++)if(d=e[a[s]].x,m=e[a[s]].y,!(d===u&&m===c||d===l&&m===h||d===f&&m===p)&&(_=d-u,S=m-c,M=d-l,E=m-h,T=d-f,C=m-p,k=v*E-g*M,A=x*S-w*_,$=y*C-b*T,k>=-t&&$>=-t&&A>=-t))return!1;return!0};return e.Triangulate=r,e.Triangulate.area=n,e}(r.FontUtils),self._typeface_js={faces:r.FontUtils.faces,loadFace:r.FontUtils.loadFace},r.typeface_js=self._typeface_js,r.Audio=function(e){r.Object3D.call(this),this.type="Audio",this.context=e.context,this.source=this.context.createBufferSource(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.panner=this.context.createPanner(),this.panner.connect(this.gain)},r.Audio.prototype=Object.create(r.Object3D.prototype),r.Audio.prototype.constructor=r.Audio,r.Audio.prototype.load=function(e){var t=this,r=new XMLHttpRequest;return r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){t.context.decodeAudioData(this.response,function(e){t.source.buffer=e,t.source.connect(t.panner),t.source.start(0)})},r.send(),this},r.Audio.prototype.setLoop=function(e){this.source.loop=e},r.Audio.prototype.setRefDistance=function(e){this.panner.refDistance=e},r.Audio.prototype.setRolloffFactor=function(e){this.panner.rolloffFactor=e},r.Audio.prototype.updateMatrixWorld=function(){var e=new r.Vector3;return function(t){r.Object3D.prototype.updateMatrixWorld.call(this,t),e.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(e.x,e.y,e.z)}}(),r.AudioListener=function(){r.Object3D.call(this),this.type="AudioListener",this.context=new(window.AudioContext||window.webkitAudioContext)},r.AudioListener.prototype=Object.create(r.Object3D.prototype),r.AudioListener.prototype.constructor=r.AudioListener,r.AudioListener.prototype.updateMatrixWorld=function(){var e=new r.Vector3,t=new r.Quaternion,n=new r.Vector3,i=new r.Vector3,o=new r.Vector3,a=new r.Vector3;return function(s){r.Object3D.prototype.updateMatrixWorld.call(this,s);var u=this.context.listener,c=this.up;this.matrixWorld.decompose(e,t,n),i.set(0,0,-1).applyQuaternion(t),o.subVectors(e,a),u.setPosition(e.x,e.y,e.z),u.setOrientation(i.x,i.y,i.z,c.x,c.y,c.z),u.setVelocity(o.x,o.y,o.z),a.copy(e)}}(),r.Curve=function(){},r.Curve.prototype.getPoint=function(){return console.log("Warning, getPoint() not implemented!"),null},r.Curve.prototype.getPointAt=function(e){var t=this.getUtoTmapping(e);return this.getPoint(t)},r.Curve.prototype.getPoints=function(e){e||(e=5);var t,r=[];for(t=0;e>=t;t++)r.push(this.getPoint(t/e));return r},r.Curve.prototype.getSpacedPoints=function(e){e||(e=5);var t,r=[];for(t=0;e>=t;t++)r.push(this.getPointAt(t/e));return r},r.Curve.prototype.getLength=function(){var e=this.getLengths();return e[e.length-1]},r.Curve.prototype.getLengths=function(e){if(e||(e=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length==e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,r,n=[],i=this.getPoint(0),o=0;for(n.push(0),r=1;e>=r;r++)t=this.getPoint(r/e),o+=t.distanceTo(i),n.push(o),i=t;return this.cacheArcLengths=n,n},r.Curve.prototype.updateArcLengths=function(){this.needsUpdate=!0,this.getLengths()},r.Curve.prototype.getUtoTmapping=function(e,t){var r,n=this.getLengths(),i=0,o=n.length;r=t?t:e*n[o-1];for(var a,s=0,u=o-1;u>=s;)if(i=Math.floor(s+(u-s)/2),a=n[i]-r,0>a)s=i+1;else{if(!(a>0)){u=i;break}u=i-1}if(i=u,n[i]==r){var c=i/(o-1);return c}var l=n[i],h=n[i+1],f=h-l,p=(r-l)/f,c=(i+p)/(o-1);return c},r.Curve.prototype.getTangent=function(e){var t=1e-4,r=e-t,n=e+t;0>r&&(r=0),n>1&&(n=1);var i=this.getPoint(r),o=this.getPoint(n),a=o.clone().sub(i);return a.normalize()},r.Curve.prototype.getTangentAt=function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},r.Curve.Utils={tangentQuadraticBezier:function(e,t,r,n){return 2*(1-e)*(r-t)+2*e*(n-r)},tangentCubicBezier:function(e,t,r,n,i){return-3*t*(1-e)*(1-e)+3*r*(1-e)*(1-e)-6*e*r*(1-e)+6*e*n*(1-e)-3*e*e*n+3*e*e*i},tangentSpline:function(e){var t=6*e*e-6*e,r=3*e*e-4*e+1,n=-6*e*e+6*e,i=3*e*e-2*e;return t+r+n+i},interpolate:function(e,t,r,n,i){var o=.5*(r-e),a=.5*(n-t),s=i*i,u=i*s;return(2*t-2*r+o+a)*u+(-3*t+3*r-2*o-a)*s+o*i+t}},r.Curve.create=function(e,t){return e.prototype=Object.create(r.Curve.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},r.CurvePath=function(){this.curves=[],this.bends=[],this.autoClose=!1},r.CurvePath.prototype=Object.create(r.Curve.prototype),r.CurvePath.prototype.constructor=r.CurvePath,r.CurvePath.prototype.add=function(e){this.curves.push(e)},r.CurvePath.prototype.checkConnection=function(){},r.CurvePath.prototype.closePath=function(){var e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);e.equals(t)||this.curves.push(new r.LineCurve(t,e))},r.CurvePath.prototype.getPoint=function(e){for(var t,r,n=e*this.getLength(),i=this.getCurveLengths(),o=0;o<i.length;){if(i[o]>=n){t=i[o]-n,r=this.curves[o];var a=1-t/r.getLength();return r.getPointAt(a)}o++}return null},r.CurvePath.prototype.getLength=function(){var e=this.getCurveLengths();return e[e.length-1]},r.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var e,t=[],r=0,n=this.curves.length;for(e=0;n>e;e++)r+=this.curves[e].getLength(),t.push(r);return this.cacheLengths=t,t},r.CurvePath.prototype.getBoundingBox=function(){var e,t,n,i,o,a,s=this.getPoints();e=t=Number.NEGATIVE_INFINITY,i=o=Number.POSITIVE_INFINITY;var u,c,l,h,f=s[0]instanceof r.Vector3;for(h=f?new r.Vector3:new r.Vector2,c=0,l=s.length;l>c;c++)u=s[c],u.x>e?e=u.x:u.x<i&&(i=u.x),u.y>t?t=u.y:u.y<o&&(o=u.y),f&&(u.z>n?n=u.z:u.z<a&&(a=u.z)),h.add(u);var p={minX:i,minY:o,maxX:e,maxY:t};return f&&(p.maxZ=n,p.minZ=a),p},r.CurvePath.prototype.createPointsGeometry=function(e){var t=this.getPoints(e,!0);return this.createGeometry(t)},r.CurvePath.prototype.createSpacedPointsGeometry=function(e){var t=this.getSpacedPoints(e,!0);return this.createGeometry(t)},r.CurvePath.prototype.createGeometry=function(e){for(var t=new r.Geometry,n=0;n<e.length;n++)t.vertices.push(new r.Vector3(e[n].x,e[n].y,e[n].z||0));return t},r.CurvePath.prototype.addWrapPath=function(e){this.bends.push(e)},r.CurvePath.prototype.getTransformedPoints=function(e,t){var r,n,i=this.getPoints(e);for(t||(t=this.bends),r=0,n=t.length;n>r;r++)i=this.getWrapPoints(i,t[r]);return i},r.CurvePath.prototype.getTransformedSpacedPoints=function(e,t){var r,n,i=this.getSpacedPoints(e);for(t||(t=this.bends),r=0,n=t.length;n>r;r++)i=this.getWrapPoints(i,t[r]);return i},r.CurvePath.prototype.getWrapPoints=function(e,t){var r,n,i,o,a,s,u=this.getBoundingBox();for(r=0,n=e.length;n>r;r++){i=e[r],o=i.x,a=i.y,s=o/u.maxX,s=t.getUtoTmapping(s,o);var c=t.getPoint(s),l=t.getTangent(s);l.set(-l.y,l.x).multiplyScalar(a),i.x=c.x+l.x,i.y=c.y+l.y}return e},r.Gyroscope=function(){r.Object3D.call(this)},r.Gyroscope.prototype=Object.create(r.Object3D.prototype),r.Gyroscope.prototype.constructor=r.Gyroscope,r.Gyroscope.prototype.updateMatrixWorld=function(){var e=new r.Vector3,t=new r.Quaternion,n=new r.Vector3,i=new r.Vector3,o=new r.Quaternion,a=new r.Vector3;return function(r){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||r)&&(this.parent?(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorld.decompose(i,o,a),this.matrix.decompose(e,t,n),this.matrixWorld.compose(i,t,a)):this.matrixWorld.copy(this.matrix),this.matrixWorldNeedsUpdate=!1,r=!0);for(var s=0,u=this.children.length;u>s;s++)this.children[s].updateMatrixWorld(r)}}(),r.Path=function(e){r.CurvePath.call(this),this.actions=[],e&&this.fromPoints(e)},r.Path.prototype=Object.create(r.CurvePath.prototype),r.Path.prototype.constructor=r.Path,r.PathActions={MOVE_TO:"moveTo",LINE_TO:"lineTo",QUADRATIC_CURVE_TO:"quadraticCurveTo",BEZIER_CURVE_TO:"bezierCurveTo",CSPLINE_THRU:"splineThru",ARC:"arc",ELLIPSE:"ellipse"},r.Path.prototype.fromPoints=function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,r=e.length;r>t;t++)this.lineTo(e[t].x,e[t].y)},r.Path.prototype.moveTo=function(){var e=Array.prototype.slice.call(arguments);this.actions.push({action:r.PathActions.MOVE_TO,args:e})},r.Path.prototype.lineTo=function(e,t){var n=Array.prototype.slice.call(arguments),i=this.actions[this.actions.length-1].args,o=i[i.length-2],a=i[i.length-1],s=new r.LineCurve(new r.Vector2(o,a),new r.Vector2(e,t));this.curves.push(s),this.actions.push({action:r.PathActions.LINE_TO,args:n})},r.Path.prototype.quadraticCurveTo=function(e,t,n,i){var o=Array.prototype.slice.call(arguments),a=this.actions[this.actions.length-1].args,s=a[a.length-2],u=a[a.length-1],c=new r.QuadraticBezierCurve(new r.Vector2(s,u),new r.Vector2(e,t),new r.Vector2(n,i));this.curves.push(c),this.actions.push({action:r.PathActions.QUADRATIC_CURVE_TO,args:o})},r.Path.prototype.bezierCurveTo=function(e,t,n,i,o,a){var s=Array.prototype.slice.call(arguments),u=this.actions[this.actions.length-1].args,c=u[u.length-2],l=u[u.length-1],h=new r.CubicBezierCurve(new r.Vector2(c,l),new r.Vector2(e,t),new r.Vector2(n,i),new r.Vector2(o,a));this.curves.push(h),this.actions.push({action:r.PathActions.BEZIER_CURVE_TO,args:s})},r.Path.prototype.splineThru=function(e){var t=Array.prototype.slice.call(arguments),n=this.actions[this.actions.length-1].args,i=n[n.length-2],o=n[n.length-1],a=[new r.Vector2(i,o)];Array.prototype.push.apply(a,e);var s=new r.SplineCurve(a);this.curves.push(s),this.actions.push({action:r.PathActions.CSPLINE_THRU,args:t})},r.Path.prototype.arc=function(e,t,r,n,i,o){var a=this.actions[this.actions.length-1].args,s=a[a.length-2],u=a[a.length-1];this.absarc(e+s,t+u,r,n,i,o)},r.Path.prototype.absarc=function(e,t,r,n,i,o){this.absellipse(e,t,r,r,n,i,o)},r.Path.prototype.ellipse=function(e,t,r,n,i,o,a){var s=this.actions[this.actions.length-1].args,u=s[s.length-2],c=s[s.length-1];this.absellipse(e+u,t+c,r,n,i,o,a)},r.Path.prototype.absellipse=function(e,t,n,i,o,a,s){var u=Array.prototype.slice.call(arguments),c=new r.EllipseCurve(e,t,n,i,o,a,s);this.curves.push(c);var l=c.getPoint(1);u.push(l.x),u.push(l.y),this.actions.push({action:r.PathActions.ELLIPSE,args:u})},r.Path.prototype.getSpacedPoints=function(e){e||(e=40);for(var t=[],r=0;e>r;r++)t.push(this.getPoint(r/e));return t},r.Path.prototype.getPoints=function(e,t){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(e,t);e=e||12;var n,i,o,a,s,u,c,l,h,f,p,d,m,v,g,y,b,x,w=[];for(n=0,i=this.actions.length;i>n;n++)switch(o=this.actions[n],a=o.action,s=o.args,a){case r.PathActions.MOVE_TO:w.push(new r.Vector2(s[0],s[1]));break;case r.PathActions.LINE_TO:w.push(new r.Vector2(s[0],s[1]));break;case r.PathActions.QUADRATIC_CURVE_TO:for(u=s[2],c=s[3],f=s[0],p=s[1],w.length>0?(v=w[w.length-1],d=v.x,m=v.y):(v=this.actions[n-1].args,d=v[v.length-2],m=v[v.length-1]),g=1;e>=g;g++)y=g/e,b=r.Shape.Utils.b2(y,d,f,u),x=r.Shape.Utils.b2(y,m,p,c),w.push(new r.Vector2(b,x));break;case r.PathActions.BEZIER_CURVE_TO:for(u=s[4],c=s[5],f=s[0],p=s[1],l=s[2],h=s[3],w.length>0?(v=w[w.length-1],d=v.x,m=v.y):(v=this.actions[n-1].args,d=v[v.length-2],m=v[v.length-1]),g=1;e>=g;g++)y=g/e,b=r.Shape.Utils.b3(y,d,f,l,u),x=r.Shape.Utils.b3(y,m,p,h,c),w.push(new r.Vector2(b,x));break;case r.PathActions.CSPLINE_THRU:v=this.actions[n-1].args;var _=new r.Vector2(v[v.length-2],v[v.length-1]),S=[_],M=e*s[0].length;S=S.concat(s[0]);var E=new r.SplineCurve(S);for(g=1;M>=g;g++)w.push(E.getPointAt(g/M));break;case r.PathActions.ARC:var T,C=s[0],A=s[1],$=s[2],k=s[3],P=s[4],R=!!s[5],O=P-k,L=2*e;for(g=1;L>=g;g++)y=g/L,R||(y=1-y),T=k+y*O,b=C+$*Math.cos(T),x=A+$*Math.sin(T),w.push(new r.Vector2(b,x));break;case r.PathActions.ELLIPSE:var T,C=s[0],A=s[1],F=s[2],j=s[3],k=s[4],P=s[5],R=!!s[6],O=P-k,L=2*e;for(g=1;L>=g;g++)y=g/L,R||(y=1-y),T=k+y*O,b=C+F*Math.cos(T),x=A+j*Math.sin(T),w.push(new r.Vector2(b,x))}var D=w[w.length-1],N=1e-10;return Math.abs(D.x-w[0].x)<N&&Math.abs(D.y-w[0].y)<N&&w.splice(w.length-1,1),t&&w.push(w[0]),w},r.Path.prototype.toShapes=function(e,t){function n(e){var t,n,i,o,a,s=[],u=new r.Path;for(t=0,n=e.length;n>t;t++)i=e[t],a=i.args,o=i.action,o==r.PathActions.MOVE_TO&&0!=u.actions.length&&(s.push(u),u=new r.Path),u[o].apply(u,a);return 0!=u.actions.length&&s.push(u),s}function i(e){for(var t=[],n=0,i=e.length;i>n;n++){var o=e[n],a=new r.Shape;a.actions=o.actions,a.curves=o.curves,t.push(a)}return t}function o(e,t){for(var r=1e-10,n=t.length,i=!1,o=n-1,a=0;n>a;o=a++){var s=t[o],u=t[a],c=u.x-s.x,l=u.y-s.y;if(Math.abs(l)>r){if(0>l&&(s=t[a],c=-c,u=t[o],l=-l),e.y<s.y||e.y>u.y)continue;if(e.y==s.y){if(e.x==s.x)return!0}else{var h=l*(e.x-s.x)-c*(e.y-s.y);if(0==h)return!0;if(0>h)continue;i=!i}}else{if(e.y!=s.y)continue;if(u.x<=e.x&&e.x<=s.x||s.x<=e.x&&e.x<=u.x)return!0}}return i}var a=n(this.actions);if(0==a.length)return[];if(t===!0)return i(a);var s,u,c,l=[];if(1==a.length)return u=a[0],c=new r.Shape,c.actions=u.actions,c.curves=u.curves,l.push(c),l;var h=!r.Shape.Utils.isClockWise(a[0].getPoints());h=e?!h:h;var f,p=[],d=[],m=[],v=0;d[v]=void 0,m[v]=[];
var g,y;for(g=0,y=a.length;y>g;g++)u=a[g],f=u.getPoints(),s=r.Shape.Utils.isClockWise(f),s=e?!s:s,s?(!h&&d[v]&&v++,d[v]={s:new r.Shape,p:f},d[v].s.actions=u.actions,d[v].s.curves=u.curves,h&&v++,m[v]=[]):m[v].push({h:u,p:f[0]});if(!d[0])return i(a);if(d.length>1){for(var b=!1,x=[],w=0,_=d.length;_>w;w++)p[w]=[];for(var w=0,_=d.length;_>w;w++)for(var S=(d[w],m[w]),M=0;M<S.length;M++){for(var E=S[M],T=!0,C=0;C<d.length;C++)o(E.p,d[C].p)&&(w!=C&&x.push({froms:w,tos:C,hole:M}),T?(T=!1,p[C].push(E)):b=!0);T&&p[w].push(E)}x.length>0&&(b||(m=p))}var A,$,k;for(g=0,y=d.length;y>g;g++)for(c=d[g].s,l.push(c),A=m[g],$=0,k=A.length;k>$;$++)c.holes.push(A[$].h);return l},r.Shape=function(){r.Path.apply(this,arguments),this.holes=[]},r.Shape.prototype=Object.create(r.Path.prototype),r.Shape.prototype.constructor=r.Shape,r.Shape.prototype.extrude=function(e){var t=new r.ExtrudeGeometry(this,e);return t},r.Shape.prototype.makeGeometry=function(e){var t=new r.ShapeGeometry(this,e);return t},r.Shape.prototype.getPointsHoles=function(e){var t,r=this.holes.length,n=[];for(t=0;r>t;t++)n[t]=this.holes[t].getTransformedPoints(e,this.bends);return n},r.Shape.prototype.getSpacedPointsHoles=function(e){var t,r=this.holes.length,n=[];for(t=0;r>t;t++)n[t]=this.holes[t].getTransformedSpacedPoints(e,this.bends);return n},r.Shape.prototype.extractAllPoints=function(e){return{shape:this.getTransformedPoints(e),holes:this.getPointsHoles(e)}},r.Shape.prototype.extractPoints=function(e){return this.useSpacedPoints?this.extractAllSpacedPoints(e):this.extractAllPoints(e)},r.Shape.prototype.extractAllSpacedPoints=function(e){return{shape:this.getTransformedSpacedPoints(e),holes:this.getSpacedPointsHoles(e)}},r.Shape.Utils={triangulateShape:function(e,t){function n(e,t,r){return e.x!=t.x?e.x<t.x?e.x<=r.x&&r.x<=t.x:t.x<=r.x&&r.x<=e.x:e.y<t.y?e.y<=r.y&&r.y<=t.y:t.y<=r.y&&r.y<=e.y}function i(e,t,r,i,o){var a=1e-10,s=t.x-e.x,u=t.y-e.y,c=i.x-r.x,l=i.y-r.y,h=e.x-r.x,f=e.y-r.y,p=u*c-s*l,d=u*h-s*f;if(Math.abs(p)>a){var m;if(p>0){if(0>d||d>p)return[];if(m=l*h-c*f,0>m||m>p)return[]}else{if(d>0||p>d)return[];if(m=l*h-c*f,m>0||p>m)return[]}if(0==m)return!o||0!=d&&d!=p?[e]:[];if(m==p)return!o||0!=d&&d!=p?[t]:[];if(0==d)return[r];if(d==p)return[i];var v=m/p;return[{x:e.x+v*s,y:e.y+v*u}]}if(0!=d||l*h!=c*f)return[];var g=0==s&&0==u,y=0==c&&0==l;if(g&&y)return e.x!=r.x||e.y!=r.y?[]:[e];if(g)return n(r,i,e)?[e]:[];if(y)return n(e,t,r)?[r]:[];var b,x,w,_,S,M,E,T;return 0!=s?(e.x<t.x?(b=e,w=e.x,x=t,_=t.x):(b=t,w=t.x,x=e,_=e.x),r.x<i.x?(S=r,E=r.x,M=i,T=i.x):(S=i,E=i.x,M=r,T=r.x)):(e.y<t.y?(b=e,w=e.y,x=t,_=t.y):(b=t,w=t.y,x=e,_=e.y),r.y<i.y?(S=r,E=r.y,M=i,T=i.y):(S=i,E=i.y,M=r,T=r.y)),E>=w?E>_?[]:_==E?o?[]:[S]:T>=_?[S,x]:[S,M]:w>T?[]:w==T?o?[]:[b]:T>=_?[b,x]:[b,M]}function o(e,t,r,n){var i=1e-10,o=t.x-e.x,a=t.y-e.y,s=r.x-e.x,u=r.y-e.y,c=n.x-e.x,l=n.y-e.y,h=o*u-a*s,f=o*l-a*c;if(Math.abs(h)>i){var p=c*u-l*s;return h>0?f>=0&&p>=0:f>=0||p>=0}return f>0}function a(e,t){function r(e,t){var r=y.length-1,n=e-1;0>n&&(n=r);var i=e+1;i>r&&(i=0);var a=o(y[e],y[n],y[i],s[t]);if(!a)return!1;var u=s.length-1,c=t-1;0>c&&(c=u);var l=t+1;return l>u&&(l=0),a=o(s[t],s[c],s[l],y[e]),a?!0:!1}function n(e,t){var r,n,o;for(r=0;r<y.length;r++)if(n=r+1,n%=y.length,o=i(e,t,y[r],y[n],!0),o.length>0)return!0;return!1}function a(e,r){var n,o,a,s,u;for(n=0;n<b.length;n++)for(o=t[b[n]],a=0;a<o.length;a++)if(s=a+1,s%=o.length,u=i(e,r,o[a],o[s],!0),u.length>0)return!0;return!1}for(var s,u,c,l,h,f,p,d,m,v,g,y=e.concat(),b=[],x=[],w=0,_=t.length;_>w;w++)b.push(w);for(var S=0,M=2*b.length;b.length>0;){if(M--,0>M){console.log("Infinite Loop! Holes left:"+b.length+", Probably Hole outside Shape!");break}for(c=S;c<y.length;c++){l=y[c],u=-1;for(var w=0;w<b.length;w++)if(f=b[w],p=l.x+":"+l.y+":"+f,void 0===x[p]){s=t[f];for(var E=0;E<s.length;E++)if(h=s[E],r(c,E)&&!n(l,h)&&!a(l,h)){u=E,b.splice(w,1),d=y.slice(0,c+1),m=y.slice(c),v=s.slice(u),g=s.slice(0,u+1),y=d.concat(v).concat(g).concat(m),S=c;break}if(u>=0)break;x[p]=!0}if(u>=0)break}}return y}for(var s,u,c,l,h,f,p={},d=e.concat(),m=0,v=t.length;v>m;m++)Array.prototype.push.apply(d,t[m]);for(s=0,u=d.length;u>s;s++)h=d[s].x+":"+d[s].y,void 0!==p[h]&&console.log("Duplicate point",h),p[h]=s;var g=a(e,t),y=r.FontUtils.Triangulate(g,!1);for(s=0,u=y.length;u>s;s++)for(l=y[s],c=0;3>c;c++)h=l[c].x+":"+l[c].y,f=p[h],void 0!==f&&(l[c]=f);return y.concat()},isClockWise:function(e){return r.FontUtils.Triangulate.area(e)<0},b2p0:function(e,t){var r=1-e;return r*r*t},b2p1:function(e,t){return 2*(1-e)*e*t},b2p2:function(e,t){return e*e*t},b2:function(e,t,r,n){return this.b2p0(e,t)+this.b2p1(e,r)+this.b2p2(e,n)},b3p0:function(e,t){var r=1-e;return r*r*r*t},b3p1:function(e,t){var r=1-e;return 3*r*r*e*t},b3p2:function(e,t){var r=1-e;return 3*r*e*e*t},b3p3:function(e,t){return e*e*e*t},b3:function(e,t,r,n,i){return this.b3p0(e,t)+this.b3p1(e,r)+this.b3p2(e,n)+this.b3p3(e,i)}},r.LineCurve=function(e,t){this.v1=e,this.v2=t},r.LineCurve.prototype=Object.create(r.Curve.prototype),r.LineCurve.prototype.constructor=r.LineCurve,r.LineCurve.prototype.getPoint=function(e){var t=this.v2.clone().sub(this.v1);return t.multiplyScalar(e).add(this.v1),t},r.LineCurve.prototype.getPointAt=function(e){return this.getPoint(e)},r.LineCurve.prototype.getTangent=function(){var e=this.v2.clone().sub(this.v1);return e.normalize()},r.QuadraticBezierCurve=function(e,t,r){this.v0=e,this.v1=t,this.v2=r},r.QuadraticBezierCurve.prototype=Object.create(r.Curve.prototype),r.QuadraticBezierCurve.prototype.constructor=r.QuadraticBezierCurve,r.QuadraticBezierCurve.prototype.getPoint=function(e){var t=new r.Vector2;return t.x=r.Shape.Utils.b2(e,this.v0.x,this.v1.x,this.v2.x),t.y=r.Shape.Utils.b2(e,this.v0.y,this.v1.y,this.v2.y),t},r.QuadraticBezierCurve.prototype.getTangent=function(e){var t=new r.Vector2;return t.x=r.Curve.Utils.tangentQuadraticBezier(e,this.v0.x,this.v1.x,this.v2.x),t.y=r.Curve.Utils.tangentQuadraticBezier(e,this.v0.y,this.v1.y,this.v2.y),t.normalize()},r.CubicBezierCurve=function(e,t,r,n){this.v0=e,this.v1=t,this.v2=r,this.v3=n},r.CubicBezierCurve.prototype=Object.create(r.Curve.prototype),r.CubicBezierCurve.prototype.constructor=r.CubicBezierCurve,r.CubicBezierCurve.prototype.getPoint=function(e){var t,n;return t=r.Shape.Utils.b3(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),n=r.Shape.Utils.b3(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y),new r.Vector2(t,n)},r.CubicBezierCurve.prototype.getTangent=function(e){var t,n;t=r.Curve.Utils.tangentCubicBezier(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),n=r.Curve.Utils.tangentCubicBezier(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y);var i=new r.Vector2(t,n);return i.normalize(),i},r.SplineCurve=function(e){this.points=void 0==e?[]:e},r.SplineCurve.prototype=Object.create(r.Curve.prototype),r.SplineCurve.prototype.constructor=r.SplineCurve,r.SplineCurve.prototype.getPoint=function(e){var t=this.points,n=(t.length-1)*e,i=Math.floor(n),o=n-i,a=t[0==i?i:i-1],s=t[i],u=t[i>t.length-2?t.length-1:i+1],c=t[i>t.length-3?t.length-1:i+2],l=new r.Vector2;return l.x=r.Curve.Utils.interpolate(a.x,s.x,u.x,c.x,o),l.y=r.Curve.Utils.interpolate(a.y,s.y,u.y,c.y,o),l},r.EllipseCurve=function(e,t,r,n,i,o,a){this.aX=e,this.aY=t,this.xRadius=r,this.yRadius=n,this.aStartAngle=i,this.aEndAngle=o,this.aClockwise=a},r.EllipseCurve.prototype=Object.create(r.Curve.prototype),r.EllipseCurve.prototype.constructor=r.EllipseCurve,r.EllipseCurve.prototype.getPoint=function(e){var t=this.aEndAngle-this.aStartAngle;0>t&&(t+=2*Math.PI),t>2*Math.PI&&(t-=2*Math.PI);var n;n=this.aClockwise===!0?this.aEndAngle+(1-e)*(2*Math.PI-t):this.aStartAngle+e*t;var i=new r.Vector2;return i.x=this.aX+this.xRadius*Math.cos(n),i.y=this.aY+this.yRadius*Math.sin(n),i},r.ArcCurve=function(e,t,n,i,o,a){r.EllipseCurve.call(this,e,t,n,n,i,o,a)},r.ArcCurve.prototype=Object.create(r.EllipseCurve.prototype),r.ArcCurve.prototype.constructor=r.ArcCurve,r.LineCurve3=r.Curve.create(function(e,t){this.v1=e,this.v2=t},function(e){var t=new r.Vector3;return t.subVectors(this.v2,this.v1),t.multiplyScalar(e),t.add(this.v1),t}),r.QuadraticBezierCurve3=r.Curve.create(function(e,t,r){this.v0=e,this.v1=t,this.v2=r},function(e){var t=new r.Vector3;return t.x=r.Shape.Utils.b2(e,this.v0.x,this.v1.x,this.v2.x),t.y=r.Shape.Utils.b2(e,this.v0.y,this.v1.y,this.v2.y),t.z=r.Shape.Utils.b2(e,this.v0.z,this.v1.z,this.v2.z),t}),r.CubicBezierCurve3=r.Curve.create(function(e,t,r,n){this.v0=e,this.v1=t,this.v2=r,this.v3=n},function(e){var t=new r.Vector3;return t.x=r.Shape.Utils.b3(e,this.v0.x,this.v1.x,this.v2.x,this.v3.x),t.y=r.Shape.Utils.b3(e,this.v0.y,this.v1.y,this.v2.y,this.v3.y),t.z=r.Shape.Utils.b3(e,this.v0.z,this.v1.z,this.v2.z,this.v3.z),t}),r.SplineCurve3=r.Curve.create(function(e){this.points=void 0==e?[]:e},function(e){var t=this.points,n=(t.length-1)*e,i=Math.floor(n),o=n-i,a=t[0==i?i:i-1],s=t[i],u=t[i>t.length-2?t.length-1:i+1],c=t[i>t.length-3?t.length-1:i+2],l=new r.Vector3;return l.x=r.Curve.Utils.interpolate(a.x,s.x,u.x,c.x,o),l.y=r.Curve.Utils.interpolate(a.y,s.y,u.y,c.y,o),l.z=r.Curve.Utils.interpolate(a.z,s.z,u.z,c.z,o),l}),r.ClosedSplineCurve3=r.Curve.create(function(e){this.points=void 0==e?[]:e},function(e){var t=this.points,n=(t.length-0)*e,i=Math.floor(n),o=n-i;i+=i>0?0:(Math.floor(Math.abs(i)/t.length)+1)*t.length;var a=t[(i-1)%t.length],s=t[i%t.length],u=t[(i+1)%t.length],c=t[(i+2)%t.length],l=new r.Vector3;return l.x=r.Curve.Utils.interpolate(a.x,s.x,u.x,c.x,o),l.y=r.Curve.Utils.interpolate(a.y,s.y,u.y,c.y,o),l.z=r.Curve.Utils.interpolate(a.z,s.z,u.z,c.z,o),l}),r.AnimationHandler={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2,add:function(){console.warn("THREE.AnimationHandler.add() has been deprecated.")},get:function(){console.warn("THREE.AnimationHandler.get() has been deprecated.")},remove:function(){console.warn("THREE.AnimationHandler.remove() has been deprecated.")},animations:[],init:function(e){if(e.initialized===!0)return e;for(var t=0;t<e.hierarchy.length;t++){for(var n=0;n<e.hierarchy[t].keys.length;n++)if(e.hierarchy[t].keys[n].time<0&&(e.hierarchy[t].keys[n].time=0),void 0!==e.hierarchy[t].keys[n].rot&&!(e.hierarchy[t].keys[n].rot instanceof r.Quaternion)){var i=e.hierarchy[t].keys[n].rot;e.hierarchy[t].keys[n].rot=(new r.Quaternion).fromArray(i)}if(e.hierarchy[t].keys.length&&void 0!==e.hierarchy[t].keys[0].morphTargets){for(var o={},n=0;n<e.hierarchy[t].keys.length;n++)for(var a=0;a<e.hierarchy[t].keys[n].morphTargets.length;a++){var s=e.hierarchy[t].keys[n].morphTargets[a];o[s]=-1}e.hierarchy[t].usedMorphTargets=o;for(var n=0;n<e.hierarchy[t].keys.length;n++){var u={};for(var s in o){for(var a=0;a<e.hierarchy[t].keys[n].morphTargets.length;a++)if(e.hierarchy[t].keys[n].morphTargets[a]===s){u[s]=e.hierarchy[t].keys[n].morphTargetsInfluences[a];break}a===e.hierarchy[t].keys[n].morphTargets.length&&(u[s]=0)}e.hierarchy[t].keys[n].morphTargetsInfluences=u}}for(var n=1;n<e.hierarchy[t].keys.length;n++)e.hierarchy[t].keys[n].time===e.hierarchy[t].keys[n-1].time&&(e.hierarchy[t].keys.splice(n,1),n--);for(var n=0;n<e.hierarchy[t].keys.length;n++)e.hierarchy[t].keys[n].index=n}return e.initialized=!0,e},parse:function(e){var t=function(e,r){r.push(e);for(var n=0;n<e.children.length;n++)t(e.children[n],r)},n=[];if(e instanceof r.SkinnedMesh)for(var i=0;i<e.skeleton.bones.length;i++)n.push(e.skeleton.bones[i]);else t(e,n);return n},play:function(e){-1===this.animations.indexOf(e)&&this.animations.push(e)},stop:function(e){var t=this.animations.indexOf(e);-1!==t&&this.animations.splice(t,1)},update:function(e){for(var t=0;t<this.animations.length;t++)this.animations[t].resetBlendWeights();for(var t=0;t<this.animations.length;t++)this.animations[t].update(e)}},r.Animation=function(e,t){this.root=e,this.data=r.AnimationHandler.init(t),this.hierarchy=r.AnimationHandler.parse(e),this.currentTime=0,this.timeScale=1,this.isPlaying=!1,this.loop=!0,this.weight=0,this.interpolationType=r.AnimationHandler.LINEAR},r.Animation.prototype.keyTypes=["pos","rot","scl"],r.Animation.prototype.play=function(e,t){this.currentTime=void 0!==e?e:0,this.weight=void 0!==t?t:1,this.isPlaying=!0,this.reset(),r.AnimationHandler.play(this)},r.Animation.prototype.stop=function(){this.isPlaying=!1,r.AnimationHandler.stop(this)},r.Animation.prototype.reset=function(){for(var e=0,t=this.hierarchy.length;t>e;e++){var r=this.hierarchy[e];void 0===r.animationCache&&(r.animationCache={animations:{},blending:{positionWeight:0,quaternionWeight:0,scaleWeight:0}}),void 0===r.animationCache.animations[this.data.name]&&(r.animationCache.animations[this.data.name]={},r.animationCache.animations[this.data.name].prevKey={pos:0,rot:0,scl:0},r.animationCache.animations[this.data.name].nextKey={pos:0,rot:0,scl:0},r.animationCache.animations[this.data.name].originalMatrix=r.matrix);for(var n=r.animationCache.animations[this.data.name],i=0;3>i;i++){for(var o=this.keyTypes[i],a=this.data.hierarchy[e].keys[0],s=this.getNextKeyWith(o,e,1);s.time<this.currentTime&&s.index>a.index;)a=s,s=this.getNextKeyWith(o,e,s.index+1);n.prevKey[o]=a,n.nextKey[o]=s}}},r.Animation.prototype.resetBlendWeights=function(){for(var e=0,t=this.hierarchy.length;t>e;e++){var r=this.hierarchy[e];void 0!==r.animationCache&&(r.animationCache.blending.positionWeight=0,r.animationCache.blending.quaternionWeight=0,r.animationCache.blending.scaleWeight=0)}},r.Animation.prototype.update=function(){var e=[],t=new r.Vector3,n=new r.Vector3,i=new r.Quaternion,o=function(e,t){var r,n,i,o,s,u,c,l,h,f=[],p=[];return r=(e.length-1)*t,n=Math.floor(r),i=r-n,f[0]=0===n?n:n-1,f[1]=n,f[2]=n>e.length-2?n:n+1,f[3]=n>e.length-3?n:n+2,u=e[f[0]],c=e[f[1]],l=e[f[2]],h=e[f[3]],o=i*i,s=i*o,p[0]=a(u[0],c[0],l[0],h[0],i,o,s),p[1]=a(u[1],c[1],l[1],h[1],i,o,s),p[2]=a(u[2],c[2],l[2],h[2],i,o,s),p},a=function(e,t,r,n,i,o,a){var s=.5*(r-e),u=.5*(n-t);return(2*(t-r)+s+u)*a+(-3*(t-r)-2*s-u)*o+s*i+t};return function(a){if(this.isPlaying!==!1&&(this.currentTime+=a*this.timeScale,0!==this.weight)){var s=this.data.length;(this.currentTime>s||this.currentTime<0)&&(this.loop?(this.currentTime%=s,this.currentTime<0&&(this.currentTime+=s),this.reset()):this.stop());for(var u=0,c=this.hierarchy.length;c>u;u++)for(var l=this.hierarchy[u],h=l.animationCache.animations[this.data.name],f=l.animationCache.blending,p=0;3>p;p++){var d=this.keyTypes[p],m=h.prevKey[d],v=h.nextKey[d];if(this.timeScale>0&&v.time<=this.currentTime||this.timeScale<0&&m.time>=this.currentTime){for(m=this.data.hierarchy[u].keys[0],v=this.getNextKeyWith(d,u,1);v.time<this.currentTime&&v.index>m.index;)m=v,v=this.getNextKeyWith(d,u,v.index+1);h.prevKey[d]=m,h.nextKey[d]=v}var g=(this.currentTime-m.time)/(v.time-m.time),y=m[d],b=v[d];if(0>g&&(g=0),g>1&&(g=1),"pos"===d){if(this.interpolationType===r.AnimationHandler.LINEAR){n.x=y[0]+(b[0]-y[0])*g,n.y=y[1]+(b[1]-y[1])*g,n.z=y[2]+(b[2]-y[2])*g;var x=this.weight/(this.weight+f.positionWeight);l.position.lerp(n,x),f.positionWeight+=this.weight}else if(this.interpolationType===r.AnimationHandler.CATMULLROM||this.interpolationType===r.AnimationHandler.CATMULLROM_FORWARD){e[0]=this.getPrevKeyWith("pos",u,m.index-1).pos,e[1]=y,e[2]=b,e[3]=this.getNextKeyWith("pos",u,v.index+1).pos,g=.33*g+.33;var w=o(e,g),x=this.weight/(this.weight+f.positionWeight);f.positionWeight+=this.weight;var _=l.position;if(_.x=_.x+(w[0]-_.x)*x,_.y=_.y+(w[1]-_.y)*x,_.z=_.z+(w[2]-_.z)*x,this.interpolationType===r.AnimationHandler.CATMULLROM_FORWARD){var S=o(e,1.01*g);t.set(S[0],S[1],S[2]),t.sub(_),t.y=0,t.normalize();var M=Math.atan2(t.x,t.z);l.rotation.set(0,M,0)}}}else if("rot"===d)if(r.Quaternion.slerp(y,b,i,g),0===f.quaternionWeight)l.quaternion.copy(i),f.quaternionWeight=this.weight;else{var x=this.weight/(this.weight+f.quaternionWeight);r.Quaternion.slerp(l.quaternion,i,l.quaternion,x),f.quaternionWeight+=this.weight}else if("scl"===d){n.x=y[0]+(b[0]-y[0])*g,n.y=y[1]+(b[1]-y[1])*g,n.z=y[2]+(b[2]-y[2])*g;var x=this.weight/(this.weight+f.scaleWeight);l.scale.lerp(n,x),f.scaleWeight+=this.weight}}return!0}}}(),r.Animation.prototype.getNextKeyWith=function(e,t,n){var i=this.data.hierarchy[t].keys;for(this.interpolationType===r.AnimationHandler.CATMULLROM||this.interpolationType===r.AnimationHandler.CATMULLROM_FORWARD?n=n<i.length-1?n:i.length-1:n%=i.length;n<i.length;n++)if(void 0!==i[n][e])return i[n];return this.data.hierarchy[t].keys[0]},r.Animation.prototype.getPrevKeyWith=function(e,t,n){var i=this.data.hierarchy[t].keys;for(n=this.interpolationType===r.AnimationHandler.CATMULLROM||this.interpolationType===r.AnimationHandler.CATMULLROM_FORWARD?n>0?n:0:n>=0?n:n+i.length;n>=0;n--)if(void 0!==i[n][e])return i[n];return this.data.hierarchy[t].keys[i.length-1]},r.KeyFrameAnimation=function(e){this.root=e.node,this.data=r.AnimationHandler.init(e),this.hierarchy=r.AnimationHandler.parse(this.root),this.currentTime=0,this.timeScale=.001,this.isPlaying=!1,this.isPaused=!0,this.loop=!0;for(var t=0,n=this.hierarchy.length;n>t;t++){var i=this.data.hierarchy[t].keys,o=this.data.hierarchy[t].sids,a=this.hierarchy[t];if(i.length&&o){for(var s=0;s<o.length;s++){var u=o[s],c=this.getNextKeyWith(u,t,0);c&&c.apply(u)}a.matrixAutoUpdate=!1,this.data.hierarchy[t].node.updateMatrix(),a.matrixWorldNeedsUpdate=!0}}},r.KeyFrameAnimation.prototype.play=function(e){if(this.currentTime=void 0!==e?e:0,this.isPlaying===!1){this.isPlaying=!0;var t,n,i,o=this.hierarchy.length;for(t=0;o>t;t++){n=this.hierarchy[t],i=this.data.hierarchy[t],void 0===i.animationCache&&(i.animationCache={},i.animationCache.prevKey=null,i.animationCache.nextKey=null,i.animationCache.originalMatrix=n.matrix);var a=this.data.hierarchy[t].keys;a.length&&(i.animationCache.prevKey=a[0],i.animationCache.nextKey=a[1],this.startTime=Math.min(a[0].time,this.startTime),this.endTime=Math.max(a[a.length-1].time,this.endTime))}this.update(0)}this.isPaused=!1,r.AnimationHandler.play(this)},r.KeyFrameAnimation.prototype.stop=function(){this.isPlaying=!1,this.isPaused=!1,r.AnimationHandler.stop(this);for(var e=0;e<this.data.hierarchy.length;e++){var t=this.hierarchy[e],n=this.data.hierarchy[e];if(void 0!==n.animationCache){var i=n.animationCache.originalMatrix;i.copy(t.matrix),t.matrix=i,delete n.animationCache}}},r.KeyFrameAnimation.prototype.update=function(e){if(this.isPlaying!==!1){this.currentTime+=e*this.timeScale;var t=this.data.length;this.loop===!0&&this.currentTime>t&&(this.currentTime%=t),this.currentTime=Math.min(this.currentTime,t);for(var r=0,n=this.hierarchy.length;n>r;r++){var i=this.hierarchy[r],o=this.data.hierarchy[r],a=o.keys,s=o.animationCache;if(a.length){var u=s.prevKey,c=s.nextKey;if(c.time<=this.currentTime){for(;c.time<this.currentTime&&c.index>u.index;)u=c,c=a[u.index+1];s.prevKey=u,s.nextKey=c}c.time>=this.currentTime?u.interpolate(c,this.currentTime):u.interpolate(c,c.time),this.data.hierarchy[r].node.updateMatrix(),i.matrixWorldNeedsUpdate=!0}}}},r.KeyFrameAnimation.prototype.getNextKeyWith=function(e,t,r){var n=this.data.hierarchy[t].keys;for(r%=n.length;r<n.length;r++)if(n[r].hasTarget(e))return n[r];return n[0]},r.KeyFrameAnimation.prototype.getPrevKeyWith=function(e,t,r){var n=this.data.hierarchy[t].keys;for(r=r>=0?r:r+n.length;r>=0;r--)if(n[r].hasTarget(e))return n[r];return n[n.length-1]},r.MorphAnimation=function(e){this.mesh=e,this.frames=e.morphTargetInfluences.length,this.currentTime=0,this.duration=1e3,this.loop=!0,this.lastFrame=0,this.currentFrame=0,this.isPlaying=!1},r.MorphAnimation.prototype={constructor:r.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(e){if(this.isPlaying!==!1){this.currentTime+=e,this.loop===!0&&this.currentTime>this.duration&&(this.currentTime%=this.duration),this.currentTime=Math.min(this.currentTime,this.duration);var t=this.duration/this.frames,r=Math.floor(this.currentTime/t);r!=this.currentFrame&&(this.mesh.morphTargetInfluences[this.lastFrame]=0,this.mesh.morphTargetInfluences[this.currentFrame]=1,this.mesh.morphTargetInfluences[r]=0,this.lastFrame=this.currentFrame,this.currentFrame=r),this.mesh.morphTargetInfluences[r]=this.currentTime%t/t,this.mesh.morphTargetInfluences[this.lastFrame]=1-this.mesh.morphTargetInfluences[r]}}},r.BoxGeometry=function(e,t,n,i,o,a){function s(e,t,n,i,o,a,s,c){var l,h,f,p=u.widthSegments,d=u.heightSegments,m=o/2,v=a/2,g=u.vertices.length;"x"===e&&"y"===t||"y"===e&&"x"===t?l="z":"x"===e&&"z"===t||"z"===e&&"x"===t?(l="y",d=u.depthSegments):("z"===e&&"y"===t||"y"===e&&"z"===t)&&(l="x",p=u.depthSegments);var y=p+1,b=d+1,x=o/p,w=a/d,_=new r.Vector3;for(_[l]=s>0?1:-1,f=0;b>f;f++)for(h=0;y>h;h++){var S=new r.Vector3;S[e]=(h*x-m)*n,S[t]=(f*w-v)*i,S[l]=s,u.vertices.push(S)}for(f=0;d>f;f++)for(h=0;p>h;h++){var M=h+y*f,E=h+y*(f+1),T=h+1+y*(f+1),C=h+1+y*f,A=new r.Vector2(h/p,1-f/d),$=new r.Vector2(h/p,1-(f+1)/d),k=new r.Vector2((h+1)/p,1-(f+1)/d),P=new r.Vector2((h+1)/p,1-f/d),R=new r.Face3(M+g,E+g,C+g);R.normal.copy(_),R.vertexNormals.push(_.clone(),_.clone(),_.clone()),R.materialIndex=c,u.faces.push(R),u.faceVertexUvs[0].push([A,$,P]),R=new r.Face3(E+g,T+g,C+g),R.normal.copy(_),R.vertexNormals.push(_.clone(),_.clone(),_.clone()),R.materialIndex=c,u.faces.push(R),u.faceVertexUvs[0].push([$.clone(),k,P.clone()])}}r.Geometry.call(this),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:o,depthSegments:a},this.widthSegments=i||1,this.heightSegments=o||1,this.depthSegments=a||1;var u=this,c=e/2,l=t/2,h=n/2;s("z","y",-1,-1,n,t,c,0),s("z","y",1,-1,n,t,-c,1),s("x","z",1,1,e,n,l,2),s("x","z",1,-1,e,n,-l,3),s("x","y",1,-1,e,t,h,4),s("x","y",-1,-1,e,t,-h,5),this.mergeVertices()},r.BoxGeometry.prototype=Object.create(r.Geometry.prototype),r.BoxGeometry.prototype.constructor=r.BoxGeometry,r.CircleGeometry=function(e,t,n,i){r.Geometry.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:i},e=e||50,t=void 0!==t?Math.max(3,t):8,n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;var o,a=[],s=new r.Vector3,u=new r.Vector2(.5,.5);for(this.vertices.push(s),a.push(u),o=0;t>=o;o++){var c=new r.Vector3,l=n+o/t*i;c.x=e*Math.cos(l),c.y=e*Math.sin(l),this.vertices.push(c),a.push(new r.Vector2((c.x/e+1)/2,(c.y/e+1)/2))}var h=new r.Vector3(0,0,1);for(o=1;t>=o;o++)this.faces.push(new r.Face3(o,o+1,0,[h.clone(),h.clone(),h.clone()])),this.faceVertexUvs[0].push([a[o].clone(),a[o+1].clone(),u.clone()]);this.computeFaceNormals(),this.boundingSphere=new r.Sphere(new r.Vector3,e)},r.CircleGeometry.prototype=Object.create(r.Geometry.prototype),r.CircleGeometry.prototype.constructor=r.CircleGeometry,r.CubeGeometry=function(e,t,n,i,o,a){return console.warn("THREE.CubeGeometry has been renamed to THREE.BoxGeometry."),new r.BoxGeometry(e,t,n,i,o,a)},r.CylinderGeometry=function(e,t,n,i,o,a,s,u){r.Geometry.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:o,openEnded:a,thetaStart:s,thetaLength:u},e=void 0!==e?e:20,t=void 0!==t?t:20,n=void 0!==n?n:100,i=i||8,o=o||1,a=void 0!==a?a:!1,s=void 0!==s?s:0,u=void 0!==u?u:2*Math.PI;var c,l,h=n/2,f=[],p=[];for(l=0;o>=l;l++){var d=[],m=[],v=l/o,g=v*(t-e)+e;for(c=0;i>=c;c++){var y=c/i,b=new r.Vector3;b.x=g*Math.sin(y*u+s),b.y=-v*n+h,b.z=g*Math.cos(y*u+s),this.vertices.push(b),d.push(this.vertices.length-1),m.push(new r.Vector2(y,1-v))}f.push(d),p.push(m)}var x,w,_=(t-e)/n;for(c=0;i>c;c++)for(0!==e?(x=this.vertices[f[0][c]].clone(),w=this.vertices[f[0][c+1]].clone()):(x=this.vertices[f[1][c]].clone(),w=this.vertices[f[1][c+1]].clone()),x.setY(Math.sqrt(x.x*x.x+x.z*x.z)*_).normalize(),w.setY(Math.sqrt(w.x*w.x+w.z*w.z)*_).normalize(),l=0;o>l;l++){var S=f[l][c],M=f[l+1][c],E=f[l+1][c+1],T=f[l][c+1],C=x.clone(),A=x.clone(),$=w.clone(),k=w.clone(),P=p[l][c].clone(),R=p[l+1][c].clone(),O=p[l+1][c+1].clone(),L=p[l][c+1].clone();this.faces.push(new r.Face3(S,M,T,[C,A,k])),this.faceVertexUvs[0].push([P,R,L]),this.faces.push(new r.Face3(M,E,T,[A.clone(),$,k.clone()])),this.faceVertexUvs[0].push([R.clone(),O,L.clone()])}if(a===!1&&e>0)for(this.vertices.push(new r.Vector3(0,h,0)),c=0;i>c;c++){var S=f[0][c],M=f[0][c+1],E=this.vertices.length-1,C=new r.Vector3(0,1,0),A=new r.Vector3(0,1,0),$=new r.Vector3(0,1,0),P=p[0][c].clone(),R=p[0][c+1].clone(),O=new r.Vector2(R.x,0);this.faces.push(new r.Face3(S,M,E,[C,A,$])),this.faceVertexUvs[0].push([P,R,O])}if(a===!1&&t>0)for(this.vertices.push(new r.Vector3(0,-h,0)),c=0;i>c;c++){var S=f[o][c+1],M=f[o][c],E=this.vertices.length-1,C=new r.Vector3(0,-1,0),A=new r.Vector3(0,-1,0),$=new r.Vector3(0,-1,0),P=p[o][c+1].clone(),R=p[o][c].clone(),O=new r.Vector2(R.x,1);this.faces.push(new r.Face3(S,M,E,[C,A,$])),this.faceVertexUvs[0].push([P,R,O])}this.computeFaceNormals()},r.CylinderGeometry.prototype=Object.create(r.Geometry.prototype),r.CylinderGeometry.prototype.constructor=r.CylinderGeometry,r.ExtrudeGeometry=function(e,t){return"undefined"==typeof e?void(e=[]):(r.Geometry.call(this),this.type="ExtrudeGeometry",e=e instanceof Array?e:[e],this.addShapeList(e,t),void this.computeFaceNormals())},r.ExtrudeGeometry.prototype=Object.create(r.Geometry.prototype),r.ExtrudeGeometry.prototype.constructor=r.ExtrudeGeometry,r.ExtrudeGeometry.prototype.addShapeList=function(e,t){for(var r=e.length,n=0;r>n;n++){var i=e[n];this.addShape(i,t)}},r.ExtrudeGeometry.prototype.addShape=function(e,t){function n(e,t,r){return t||console.log("die"),t.clone().multiplyScalar(r).add(e)}function i(e,t,n){var i,o,a=1e-10,s=1,u=e.x-t.x,c=e.y-t.y,l=n.x-e.x,h=n.y-e.y,f=u*u+c*c,p=u*h-c*l;if(Math.abs(p)>a){var d=Math.sqrt(f),m=Math.sqrt(l*l+h*h),v=t.x-c/d,g=t.y+u/d,y=n.x-h/m,b=n.y+l/m,x=((y-v)*h-(b-g)*l)/(u*h-c*l);i=v+u*x-e.x,o=g+c*x-e.y;var w=i*i+o*o;if(2>=w)return new r.Vector2(i,o);s=Math.sqrt(w/2)}else{var _=!1;u>a?l>a&&(_=!0):-a>u?-a>l&&(_=!0):Math.sign(c)==Math.sign(h)&&(_=!0),_?(i=-c,o=u,s=Math.sqrt(f)):(i=u,o=c,s=Math.sqrt(f/2))}return new r.Vector2(i/s,o/s)}function o(){if(x){var e=0,t=H*e;for(X=0;W>X;X++)G=D[X],c(G[2]+t,G[1]+t,G[0]+t);for(e=_+2*b,t=H*e,X=0;W>X;X++)G=D[X],c(G[0]+t,G[1]+t,G[2]+t)}else{for(X=0;W>X;X++)G=D[X],c(G[2],G[1],G[0]);for(X=0;W>X;X++)G=D[X],c(G[0]+H*_,G[1]+H*_,G[2]+H*_)}}function a(){var e=0;for(s(N,e),e+=N.length,$=0,k=F.length;k>$;$++)A=F[$],s(A,e),e+=A.length}function s(e,t){var r,n;for(X=e.length;--X>=0;){r=X,n=X-1,0>n&&(n=e.length-1);var i=0,o=_+2*b;for(i=0;o>i;i++){var a=H*i,s=H*(i+1),u=t+r+a,c=t+n+a,h=t+n+s,f=t+r+s;l(u,c,h,f,e,i,o,r,n)}}}function u(e,t,n){P.vertices.push(new r.Vector3(e,t,n))}function c(e,t,n){e+=R,t+=R,n+=R,P.faces.push(new r.Face3(e,t,n,null,null,E));var i=C.generateTopUV(P,e,t,n);P.faceVertexUvs[0].push(i)}function l(e,t,n,i){e+=R,t+=R,n+=R,i+=R,P.faces.push(new r.Face3(e,t,i,null,null,T)),P.faces.push(new r.Face3(t,n,i,null,null,T));var o=C.generateSideWallUV(P,e,t,n,i);P.faceVertexUvs[0].push([o[0],o[1],o[3]]),P.faceVertexUvs[0].push([o[1],o[2],o[3]])}var h,f,p,d,m,v=void 0!==t.amount?t.amount:100,g=void 0!==t.bevelThickness?t.bevelThickness:6,y=void 0!==t.bevelSize?t.bevelSize:g-2,b=void 0!==t.bevelSegments?t.bevelSegments:3,x=void 0!==t.bevelEnabled?t.bevelEnabled:!0,w=void 0!==t.curveSegments?t.curveSegments:12,_=void 0!==t.steps?t.steps:1,S=t.extrudePath,M=!1,E=t.material,T=t.extrudeMaterial,C=void 0!==t.UVGenerator?t.UVGenerator:r.ExtrudeGeometry.WorldUVGenerator;S&&(h=S.getSpacedPoints(_),M=!0,x=!1,f=void 0!==t.frames?t.frames:new r.TubeGeometry.FrenetFrames(S,_,!1),p=new r.Vector3,d=new r.Vector3,m=new r.Vector3),x||(b=0,g=0,y=0);var A,$,k,P=this,R=this.vertices.length,O=e.extractPoints(w),L=O.shape,F=O.holes,j=!r.Shape.Utils.isClockWise(L);if(j){for(L=L.reverse(),$=0,k=F.length;k>$;$++)A=F[$],r.Shape.Utils.isClockWise(A)&&(F[$]=A.reverse());j=!1}var D=r.Shape.Utils.triangulateShape(L,F),N=L;for($=0,k=F.length;k>$;$++)A=F[$],L=L.concat(A);for(var U,V,B,I,z,G,H=L.length,W=D.length,q=(N.length,180/Math.PI,[]),X=0,Y=N.length,K=Y-1,Q=X+1;Y>X;X++,K++,Q++){K===Y&&(K=0),Q===Y&&(Q=0);{N[X],N[K],N[Q]}q[X]=i(N[X],N[K],N[Q])}var Z,J=[],et=q.concat();for($=0,k=F.length;k>$;$++){for(A=F[$],Z=[],X=0,Y=A.length,K=Y-1,Q=X+1;Y>X;X++,K++,Q++)K===Y&&(K=0),Q===Y&&(Q=0),Z[X]=i(A[X],A[K],A[Q]);J.push(Z),et=et.concat(Z)}for(U=0;b>U;U++){for(B=U/b,I=g*(1-B),V=y*Math.sin(B*Math.PI/2),X=0,Y=N.length;Y>X;X++)z=n(N[X],q[X],V),u(z.x,z.y,-I);for($=0,k=F.length;k>$;$++)for(A=F[$],Z=J[$],X=0,Y=A.length;Y>X;X++)z=n(A[X],Z[X],V),u(z.x,z.y,-I)}for(V=y,X=0;H>X;X++)z=x?n(L[X],et[X],V):L[X],M?(d.copy(f.normals[0]).multiplyScalar(z.x),p.copy(f.binormals[0]).multiplyScalar(z.y),m.copy(h[0]).add(d).add(p),u(m.x,m.y,m.z)):u(z.x,z.y,0);var tt;for(tt=1;_>=tt;tt++)for(X=0;H>X;X++)z=x?n(L[X],et[X],V):L[X],M?(d.copy(f.normals[tt]).multiplyScalar(z.x),p.copy(f.binormals[tt]).multiplyScalar(z.y),m.copy(h[tt]).add(d).add(p),u(m.x,m.y,m.z)):u(z.x,z.y,v/_*tt);for(U=b-1;U>=0;U--){for(B=U/b,I=g*(1-B),V=y*Math.sin(B*Math.PI/2),X=0,Y=N.length;Y>X;X++)z=n(N[X],q[X],V),u(z.x,z.y,v+I);for($=0,k=F.length;k>$;$++)for(A=F[$],Z=J[$],X=0,Y=A.length;Y>X;X++)z=n(A[X],Z[X],V),M?u(z.x,z.y+h[_-1].y,h[_-1].x+I):u(z.x,z.y,v+I)}o(),a()},r.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(e,t,n,i){var o=e.vertices,a=o[t],s=o[n],u=o[i];return[new r.Vector2(a.x,a.y),new r.Vector2(s.x,s.y),new r.Vector2(u.x,u.y)]},generateSideWallUV:function(e,t,n,i,o){var a=e.vertices,s=a[t],u=a[n],c=a[i],l=a[o];return Math.abs(s.y-u.y)<.01?[new r.Vector2(s.x,1-s.z),new r.Vector2(u.x,1-u.z),new r.Vector2(c.x,1-c.z),new r.Vector2(l.x,1-l.z)]:[new r.Vector2(s.y,1-s.z),new r.Vector2(u.y,1-u.z),new r.Vector2(c.y,1-c.z),new r.Vector2(l.y,1-l.z)]}},r.ShapeGeometry=function(e,t){r.Geometry.call(this),this.type="ShapeGeometry",e instanceof Array==!1&&(e=[e]),this.addShapeList(e,t),this.computeFaceNormals()},r.ShapeGeometry.prototype=Object.create(r.Geometry.prototype),r.ShapeGeometry.prototype.constructor=r.ShapeGeometry,r.ShapeGeometry.prototype.addShapeList=function(e,t){for(var r=0,n=e.length;n>r;r++)this.addShape(e[r],t);return this},r.ShapeGeometry.prototype.addShape=function(e,t){void 0===t&&(t={});var n,i,o,a=void 0!==t.curveSegments?t.curveSegments:12,s=t.material,u=void 0===t.UVGenerator?r.ExtrudeGeometry.WorldUVGenerator:t.UVGenerator,c=this.vertices.length,l=e.extractPoints(a),h=l.shape,f=l.holes,p=!r.Shape.Utils.isClockWise(h);if(p){for(h=h.reverse(),n=0,i=f.length;i>n;n++)o=f[n],r.Shape.Utils.isClockWise(o)&&(f[n]=o.reverse());p=!1}var d=r.Shape.Utils.triangulateShape(h,f),m=h;for(n=0,i=f.length;i>n;n++)o=f[n],h=h.concat(o);{var v,g,y=h.length,b=d.length;m.length}for(n=0;y>n;n++)v=h[n],this.vertices.push(new r.Vector3(v.x,v.y,0));for(n=0;b>n;n++){g=d[n];var x=g[0]+c,w=g[1]+c,_=g[2]+c;this.faces.push(new r.Face3(x,w,_,null,null,s)),this.faceVertexUvs[0].push(u.generateTopUV(this,x,w,_))}},r.LatheGeometry=function(e,t,n,i){r.Geometry.call(this),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=t||12,n=n||0,i=i||2*Math.PI;for(var o=1/(e.length-1),a=1/t,s=0,u=t;u>=s;s++)for(var c=n+s*a*i,l=Math.cos(c),h=Math.sin(c),f=0,p=e.length;p>f;f++){var d=e[f],m=new r.Vector3;m.x=l*d.x-h*d.y,m.y=h*d.x+l*d.y,m.z=d.z,this.vertices.push(m)}for(var v=e.length,s=0,u=t;u>s;s++)for(var f=0,p=e.length-1;p>f;f++){var g=f+v*s,y=g,b=g+v,l=g+1+v,x=g+1,w=s*a,_=f*o,S=w+a,M=_+o;this.faces.push(new r.Face3(y,b,x)),this.faceVertexUvs[0].push([new r.Vector2(w,_),new r.Vector2(S,_),new r.Vector2(w,M)]),this.faces.push(new r.Face3(b,l,x)),this.faceVertexUvs[0].push([new r.Vector2(S,_),new r.Vector2(S,M),new r.Vector2(w,M)])}this.mergeVertices(),this.computeFaceNormals(),this.computeVertexNormals()},r.LatheGeometry.prototype=Object.create(r.Geometry.prototype),r.LatheGeometry.prototype.constructor=r.LatheGeometry,r.PlaneGeometry=function(e,t,n,i){console.info("THREE.PlaneGeometry: Consider using THREE.PlaneBufferGeometry for lower memory footprint."),r.Geometry.call(this),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i},this.fromBufferGeometry(new r.PlaneBufferGeometry(e,t,n,i))},r.PlaneGeometry.prototype=Object.create(r.Geometry.prototype),r.PlaneGeometry.prototype.constructor=r.PlaneGeometry,r.PlaneBufferGeometry=function(e,t,n,i){r.BufferGeometry.call(this),this.type="PlaneBufferGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};
for(var o=e/2,a=t/2,s=n||1,u=i||1,c=s+1,l=u+1,h=e/s,f=t/u,p=new Float32Array(c*l*3),d=new Float32Array(c*l*3),m=new Float32Array(c*l*2),v=0,g=0,y=0;l>y;y++)for(var b=y*f-a,x=0;c>x;x++){var w=x*h-o;p[v]=w,p[v+1]=-b,d[v+2]=1,m[g]=x/s,m[g+1]=1-y/u,v+=3,g+=2}v=0;for(var _=new(p.length/3>65535?Uint32Array:Uint16Array)(s*u*6),y=0;u>y;y++)for(var x=0;s>x;x++){var S=x+c*y,M=x+c*(y+1),E=x+1+c*(y+1),T=x+1+c*y;_[v]=S,_[v+1]=M,_[v+2]=T,_[v+3]=M,_[v+4]=E,_[v+5]=T,v+=6}this.addAttribute("index",new r.BufferAttribute(_,1)),this.addAttribute("position",new r.BufferAttribute(p,3)),this.addAttribute("normal",new r.BufferAttribute(d,3)),this.addAttribute("uv",new r.BufferAttribute(m,2))},r.PlaneBufferGeometry.prototype=Object.create(r.BufferGeometry.prototype),r.PlaneBufferGeometry.prototype.constructor=r.PlaneBufferGeometry,r.RingGeometry=function(e,t,n,i,o,a){r.Geometry.call(this),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:i,thetaStart:o,thetaLength:a},e=e||0,t=t||50,o=void 0!==o?o:0,a=void 0!==a?a:2*Math.PI,n=void 0!==n?Math.max(3,n):8,i=void 0!==i?Math.max(1,i):8;var s,u,c=[],l=e,h=(t-e)/i;for(s=0;i+1>s;s++){for(u=0;n+1>u;u++){var f=new r.Vector3,p=o+u/n*a;f.x=l*Math.cos(p),f.y=l*Math.sin(p),this.vertices.push(f),c.push(new r.Vector2((f.x/t+1)/2,(f.y/t+1)/2))}l+=h}var d=new r.Vector3(0,0,1);for(s=0;i>s;s++){var m=s*(n+1);for(u=0;n>u;u++){var p=u+m,v=p,g=p+n+1,y=p+n+2;this.faces.push(new r.Face3(v,g,y,[d.clone(),d.clone(),d.clone()])),this.faceVertexUvs[0].push([c[v].clone(),c[g].clone(),c[y].clone()]),v=p,g=p+n+2,y=p+1,this.faces.push(new r.Face3(v,g,y,[d.clone(),d.clone(),d.clone()])),this.faceVertexUvs[0].push([c[v].clone(),c[g].clone(),c[y].clone()])}}this.computeFaceNormals(),this.boundingSphere=new r.Sphere(new r.Vector3,l)},r.RingGeometry.prototype=Object.create(r.Geometry.prototype),r.RingGeometry.prototype.constructor=r.RingGeometry,r.SphereGeometry=function(e,t,n,i,o,a,s){r.Geometry.call(this),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:o,thetaStart:a,thetaLength:s},e=e||50,t=Math.max(3,Math.floor(t)||8),n=Math.max(2,Math.floor(n)||6),i=void 0!==i?i:0,o=void 0!==o?o:2*Math.PI,a=void 0!==a?a:0,s=void 0!==s?s:Math.PI;var u,c,l=[],h=[];for(c=0;n>=c;c++){var f=[],p=[];for(u=0;t>=u;u++){var d=u/t,m=c/n,v=new r.Vector3;v.x=-e*Math.cos(i+d*o)*Math.sin(a+m*s),v.y=e*Math.cos(a+m*s),v.z=e*Math.sin(i+d*o)*Math.sin(a+m*s),this.vertices.push(v),f.push(this.vertices.length-1),p.push(new r.Vector2(d,1-m))}l.push(f),h.push(p)}for(c=0;n>c;c++)for(u=0;t>u;u++){var g=l[c][u+1],y=l[c][u],b=l[c+1][u],x=l[c+1][u+1],w=this.vertices[g].clone().normalize(),_=this.vertices[y].clone().normalize(),S=this.vertices[b].clone().normalize(),M=this.vertices[x].clone().normalize(),E=h[c][u+1].clone(),T=h[c][u].clone(),C=h[c+1][u].clone(),A=h[c+1][u+1].clone();Math.abs(this.vertices[g].y)===e?(E.x=(E.x+T.x)/2,this.faces.push(new r.Face3(g,b,x,[w,S,M])),this.faceVertexUvs[0].push([E,C,A])):Math.abs(this.vertices[b].y)===e?(C.x=(C.x+A.x)/2,this.faces.push(new r.Face3(g,y,b,[w,_,S])),this.faceVertexUvs[0].push([E,T,C])):(this.faces.push(new r.Face3(g,y,x,[w,_,M])),this.faceVertexUvs[0].push([E,T,A]),this.faces.push(new r.Face3(y,b,x,[_.clone(),S,M.clone()])),this.faceVertexUvs[0].push([T.clone(),C,A.clone()]))}this.computeFaceNormals(),this.boundingSphere=new r.Sphere(new r.Vector3,e)},r.SphereGeometry.prototype=Object.create(r.Geometry.prototype),r.SphereGeometry.prototype.constructor=r.SphereGeometry,r.TextGeometry=function(e,t){t=t||{};var n=r.FontUtils.generateShapes(e,t);t.amount=void 0!==t.height?t.height:50,void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),r.ExtrudeGeometry.call(this,n,t),this.type="TextGeometry"},r.TextGeometry.prototype=Object.create(r.ExtrudeGeometry.prototype),r.TextGeometry.prototype.constructor=r.TextGeometry,r.TorusGeometry=function(e,t,n,i,o){r.Geometry.call(this),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,arc:o},e=e||100,t=t||40,n=n||8,i=i||6,o=o||2*Math.PI;for(var a=new r.Vector3,s=[],u=[],c=0;n>=c;c++)for(var l=0;i>=l;l++){var h=l/i*o,f=c/n*Math.PI*2;a.x=e*Math.cos(h),a.y=e*Math.sin(h);var p=new r.Vector3;p.x=(e+t*Math.cos(f))*Math.cos(h),p.y=(e+t*Math.cos(f))*Math.sin(h),p.z=t*Math.sin(f),this.vertices.push(p),s.push(new r.Vector2(l/i,c/n)),u.push(p.clone().sub(a).normalize())}for(var c=1;n>=c;c++)for(var l=1;i>=l;l++){var d=(i+1)*c+l-1,m=(i+1)*(c-1)+l-1,v=(i+1)*(c-1)+l,g=(i+1)*c+l,y=new r.Face3(d,m,g,[u[d].clone(),u[m].clone(),u[g].clone()]);this.faces.push(y),this.faceVertexUvs[0].push([s[d].clone(),s[m].clone(),s[g].clone()]),y=new r.Face3(m,v,g,[u[m].clone(),u[v].clone(),u[g].clone()]),this.faces.push(y),this.faceVertexUvs[0].push([s[m].clone(),s[v].clone(),s[g].clone()])}this.computeFaceNormals()},r.TorusGeometry.prototype=Object.create(r.Geometry.prototype),r.TorusGeometry.prototype.constructor=r.TorusGeometry,r.TorusKnotGeometry=function(e,t,n,i,o,a,s){function u(e,t,n,i,o){var a=Math.cos(e),s=Math.sin(e),u=t/n*e,c=Math.cos(u),l=i*(2+c)*.5*a,h=i*(2+c)*s*.5,f=o*i*Math.sin(u)*.5;return new r.Vector3(l,h,f)}r.Geometry.call(this),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:i,p:o,q:a,heightScale:s},e=e||100,t=t||40,n=n||64,i=i||8,o=o||2,a=a||3,s=s||1;for(var c=new Array(n),l=new r.Vector3,h=new r.Vector3,f=new r.Vector3,p=0;n>p;++p){c[p]=new Array(i);var d=p/n*2*o*Math.PI,m=u(d,a,o,e,s),v=u(d+.01,a,o,e,s);l.subVectors(v,m),h.addVectors(v,m),f.crossVectors(l,h),h.crossVectors(f,l),f.normalize(),h.normalize();for(var g=0;i>g;++g){var y=g/i*2*Math.PI,b=-t*Math.cos(y),x=t*Math.sin(y),w=new r.Vector3;w.x=m.x+b*h.x+x*f.x,w.y=m.y+b*h.y+x*f.y,w.z=m.z+b*h.z+x*f.z,c[p][g]=this.vertices.push(w)-1}}for(var p=0;n>p;++p)for(var g=0;i>g;++g){var _=(p+1)%n,S=(g+1)%i,M=c[p][g],E=c[_][g],T=c[_][S],C=c[p][S],A=new r.Vector2(p/n,g/i),$=new r.Vector2((p+1)/n,g/i),k=new r.Vector2((p+1)/n,(g+1)/i),P=new r.Vector2(p/n,(g+1)/i);this.faces.push(new r.Face3(M,E,C)),this.faceVertexUvs[0].push([A,$,P]),this.faces.push(new r.Face3(E,T,C)),this.faceVertexUvs[0].push([$.clone(),k,P.clone()])}this.computeFaceNormals(),this.computeVertexNormals()},r.TorusKnotGeometry.prototype=Object.create(r.Geometry.prototype),r.TorusKnotGeometry.prototype.constructor=r.TorusKnotGeometry,r.TubeGeometry=function(e,t,n,i,o,a){function s(e,t,n){return k.vertices.push(new r.Vector3(e,t,n))-1}r.Geometry.call(this),this.type="TubeGeometry",this.parameters={path:e,segments:t,radius:n,radialSegments:i,closed:o},t=t||64,n=n||1,i=i||8,o=o||!1,a=a||r.TubeGeometry.NoTaper;var u,c,l,h,f,p,d,m,v,g,y,b,x,w,_,S,M,E,T,C,A,$=[],k=this,P=t+1,R=new r.Vector3,O=new r.TubeGeometry.FrenetFrames(e,t,o),L=O.tangents,F=O.normals,j=O.binormals;for(this.tangents=L,this.normals=F,this.binormals=j,g=0;P>g;g++)for($[g]=[],h=g/(P-1),v=e.getPointAt(h),u=L[g],c=F[g],l=j[g],p=n*a(h),y=0;i>y;y++)f=y/i*2*Math.PI,d=-p*Math.cos(f),m=p*Math.sin(f),R.copy(v),R.x+=d*c.x+m*l.x,R.y+=d*c.y+m*l.y,R.z+=d*c.z+m*l.z,$[g][y]=s(R.x,R.y,R.z);for(g=0;t>g;g++)for(y=0;i>y;y++)b=o?(g+1)%t:g+1,x=(y+1)%i,w=$[g][y],_=$[b][y],S=$[b][x],M=$[g][x],E=new r.Vector2(g/t,y/i),T=new r.Vector2((g+1)/t,y/i),C=new r.Vector2((g+1)/t,(y+1)/i),A=new r.Vector2(g/t,(y+1)/i),this.faces.push(new r.Face3(w,_,M)),this.faceVertexUvs[0].push([E,T,A]),this.faces.push(new r.Face3(_,S,M)),this.faceVertexUvs[0].push([T.clone(),C,A.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},r.TubeGeometry.prototype=Object.create(r.Geometry.prototype),r.TubeGeometry.prototype.constructor=r.TubeGeometry,r.TubeGeometry.NoTaper=function(){return 1},r.TubeGeometry.SinusoidalTaper=function(e){return Math.sin(Math.PI*e)},r.TubeGeometry.FrenetFrames=function(e,t,n){function i(){d[0]=new r.Vector3,m[0]=new r.Vector3,a=Number.MAX_VALUE,s=Math.abs(p[0].x),u=Math.abs(p[0].y),c=Math.abs(p[0].z),a>=s&&(a=s,f.set(1,0,0)),a>=u&&(a=u,f.set(0,1,0)),a>=c&&f.set(0,0,1),v.crossVectors(p[0],f).normalize(),d[0].crossVectors(p[0],v),m[0].crossVectors(p[0],d[0])}var o,a,s,u,c,l,h,f=(new r.Vector3,new r.Vector3),p=(new r.Vector3,[]),d=[],m=[],v=new r.Vector3,g=new r.Matrix4,y=t+1,b=1e-4;for(this.tangents=p,this.normals=d,this.binormals=m,l=0;y>l;l++)h=l/(y-1),p[l]=e.getTangentAt(h),p[l].normalize();for(i(),l=1;y>l;l++)d[l]=d[l-1].clone(),m[l]=m[l-1].clone(),v.crossVectors(p[l-1],p[l]),v.length()>b&&(v.normalize(),o=Math.acos(r.Math.clamp(p[l-1].dot(p[l]),-1,1)),d[l].applyMatrix4(g.makeRotationAxis(v,o))),m[l].crossVectors(p[l],d[l]);if(n)for(o=Math.acos(r.Math.clamp(d[0].dot(d[y-1]),-1,1)),o/=y-1,p[0].dot(v.crossVectors(d[0],d[y-1]))>0&&(o=-o),l=1;y>l;l++)d[l].applyMatrix4(g.makeRotationAxis(p[l],o*l)),m[l].crossVectors(p[l],d[l])},r.PolyhedronGeometry=function(e,t,n,i){function o(e){var t=e.normalize().clone();t.index=h.vertices.push(t)-1;var n=u(e)/2/Math.PI+.5,i=c(e)/Math.PI+.5;return t.uv=new r.Vector2(n,1-i),t}function a(e,t,n){var i=new r.Face3(e.index,t.index,n.index,[e.clone(),t.clone(),n.clone()]);h.faces.push(i),x.copy(e).add(t).add(n).divideScalar(3);var o=u(x);h.faceVertexUvs[0].push([l(e.uv,e,o),l(t.uv,t,o),l(n.uv,n,o)])}function s(e,t){for(var r=Math.pow(2,t),n=(Math.pow(4,t),o(h.vertices[e.a])),i=o(h.vertices[e.b]),s=o(h.vertices[e.c]),u=[],c=0;r>=c;c++){u[c]=[];for(var l=o(n.clone().lerp(s,c/r)),f=o(i.clone().lerp(s,c/r)),p=r-c,d=0;p>=d;d++)u[c][d]=0==d&&c==r?l:o(l.clone().lerp(f,d/p))}for(var c=0;r>c;c++)for(var d=0;2*(r-c)-1>d;d++){var m=Math.floor(d/2);d%2==0?a(u[c][m+1],u[c+1][m],u[c][m]):a(u[c][m+1],u[c+1][m+1],u[c+1][m])}}function u(e){return Math.atan2(e.z,-e.x)}function c(e){return Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))}function l(e,t,n){return 0>n&&1===e.x&&(e=new r.Vector2(e.x-1,e.y)),0===t.x&&0===t.z&&(e=new r.Vector2(n/2/Math.PI+.5,e.y)),e.clone()}r.Geometry.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:i},n=n||1,i=i||0;for(var h=this,f=0,p=e.length;p>f;f+=3)o(new r.Vector3(e[f],e[f+1],e[f+2]));for(var d=this.vertices,m=[],f=0,v=0,p=t.length;p>f;f+=3,v++){var g=d[t[f]],y=d[t[f+1]],b=d[t[f+2]];m[v]=new r.Face3(g.index,y.index,b.index,[g.clone(),y.clone(),b.clone()])}for(var x=new r.Vector3,f=0,p=m.length;p>f;f++)s(m[f],i);for(var f=0,p=this.faceVertexUvs[0].length;p>f;f++){var w=this.faceVertexUvs[0][f],_=w[0].x,S=w[1].x,M=w[2].x,E=Math.max(_,Math.max(S,M)),T=Math.min(_,Math.min(S,M));E>.9&&.1>T&&(.2>_&&(w[0].x+=1),.2>S&&(w[1].x+=1),.2>M&&(w[2].x+=1))}for(var f=0,p=this.vertices.length;p>f;f++)this.vertices[f].multiplyScalar(n);this.mergeVertices(),this.computeFaceNormals(),this.boundingSphere=new r.Sphere(new r.Vector3,n)},r.PolyhedronGeometry.prototype=Object.create(r.Geometry.prototype),r.PolyhedronGeometry.prototype.constructor=r.PolyhedronGeometry,r.DodecahedronGeometry=function(e,t){this.parameters={radius:e,detail:t};var n=(1+Math.sqrt(5))/2,i=1/n,o=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];r.PolyhedronGeometry.call(this,o,a,e,t)},r.DodecahedronGeometry.prototype=Object.create(r.Geometry.prototype),r.DodecahedronGeometry.prototype.constructor=r.DodecahedronGeometry,r.IcosahedronGeometry=function(e,t){var n=(1+Math.sqrt(5))/2,i=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],o=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];r.PolyhedronGeometry.call(this,i,o,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}},r.IcosahedronGeometry.prototype=Object.create(r.Geometry.prototype),r.IcosahedronGeometry.prototype.constructor=r.IcosahedronGeometry,r.OctahedronGeometry=function(e,t){this.parameters={radius:e,detail:t};var n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],i=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];r.PolyhedronGeometry.call(this,n,i,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}},r.OctahedronGeometry.prototype=Object.create(r.Geometry.prototype),r.OctahedronGeometry.prototype.constructor=r.OctahedronGeometry,r.TetrahedronGeometry=function(e,t){var n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],i=[2,1,0,0,3,2,1,3,0,2,3,1];r.PolyhedronGeometry.call(this,n,i,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}},r.TetrahedronGeometry.prototype=Object.create(r.Geometry.prototype),r.TetrahedronGeometry.prototype.constructor=r.TetrahedronGeometry,r.ParametricGeometry=function(e,t,n){r.Geometry.call(this),this.type="ParametricGeometry",this.parameters={func:e,slices:t,stacks:n};var i,o,a,s,u,c=this.vertices,l=this.faces,h=this.faceVertexUvs[0],f=t+1;for(i=0;n>=i;i++)for(u=i/n,o=0;t>=o;o++)s=o/t,a=e(s,u),c.push(a);var p,d,m,v,g,y,b,x;for(i=0;n>i;i++)for(o=0;t>o;o++)p=i*f+o,d=i*f+o+1,m=(i+1)*f+o+1,v=(i+1)*f+o,g=new r.Vector2(o/t,i/n),y=new r.Vector2((o+1)/t,i/n),b=new r.Vector2((o+1)/t,(i+1)/n),x=new r.Vector2(o/t,(i+1)/n),l.push(new r.Face3(p,d,v)),h.push([g,y,x]),l.push(new r.Face3(d,m,v)),h.push([y.clone(),b,x.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},r.ParametricGeometry.prototype=Object.create(r.Geometry.prototype),r.ParametricGeometry.prototype.constructor=r.ParametricGeometry,r.AxisHelper=function(e){e=e||1;var t=new Float32Array([0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e]),n=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]),i=new r.BufferGeometry;i.addAttribute("position",new r.BufferAttribute(t,3)),i.addAttribute("color",new r.BufferAttribute(n,3));var o=new r.LineBasicMaterial({vertexColors:r.VertexColors});r.Line.call(this,i,o,r.LinePieces)},r.AxisHelper.prototype=Object.create(r.Line.prototype),r.AxisHelper.prototype.constructor=r.AxisHelper,r.ArrowHelper=function(){var e=new r.Geometry;e.vertices.push(new r.Vector3(0,0,0),new r.Vector3(0,1,0));var t=new r.CylinderGeometry(0,.5,1,5,1);return t.applyMatrix((new r.Matrix4).makeTranslation(0,-.5,0)),function(n,i,o,a,s,u){r.Object3D.call(this),void 0===a&&(a=16776960),void 0===o&&(o=1),void 0===s&&(s=.2*o),void 0===u&&(u=.2*s),this.position.copy(i),this.line=new r.Line(e,new r.LineBasicMaterial({color:a})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new r.Mesh(t,new r.MeshBasicMaterial({color:a})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(n),this.setLength(o,s,u)}}(),r.ArrowHelper.prototype=Object.create(r.Object3D.prototype),r.ArrowHelper.prototype.constructor=r.ArrowHelper,r.ArrowHelper.prototype.setDirection=function(){var e,t=new r.Vector3;return function(r){r.y>.99999?this.quaternion.set(0,0,0,1):r.y<-.99999?this.quaternion.set(1,0,0,0):(t.set(r.z,0,-r.x).normalize(),e=Math.acos(r.y),this.quaternion.setFromAxisAngle(t,e))}}(),r.ArrowHelper.prototype.setLength=function(e,t,r){void 0===t&&(t=.2*e),void 0===r&&(r=.2*t),this.line.scale.set(1,e-t,1),this.line.updateMatrix(),this.cone.scale.set(r,t,r),this.cone.position.y=e,this.cone.updateMatrix()},r.ArrowHelper.prototype.setColor=function(e){this.line.material.color.set(e),this.cone.material.color.set(e)},r.BoxHelper=function(e){var t=new r.BufferGeometry;t.addAttribute("position",new r.BufferAttribute(new Float32Array(72),3)),r.Line.call(this,t,new r.LineBasicMaterial({color:16776960}),r.LinePieces),void 0!==e&&this.update(e)},r.BoxHelper.prototype=Object.create(r.Line.prototype),r.BoxHelper.prototype.constructor=r.BoxHelper,r.BoxHelper.prototype.update=function(e){var t=e.geometry;null===t.boundingBox&&t.computeBoundingBox();var r=t.boundingBox.min,n=t.boundingBox.max,i=this.geometry.attributes.position.array;i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=r.x,i[4]=n.y,i[5]=n.z,i[6]=r.x,i[7]=n.y,i[8]=n.z,i[9]=r.x,i[10]=r.y,i[11]=n.z,i[12]=r.x,i[13]=r.y,i[14]=n.z,i[15]=n.x,i[16]=r.y,i[17]=n.z,i[18]=n.x,i[19]=r.y,i[20]=n.z,i[21]=n.x,i[22]=n.y,i[23]=n.z,i[24]=n.x,i[25]=n.y,i[26]=r.z,i[27]=r.x,i[28]=n.y,i[29]=r.z,i[30]=r.x,i[31]=n.y,i[32]=r.z,i[33]=r.x,i[34]=r.y,i[35]=r.z,i[36]=r.x,i[37]=r.y,i[38]=r.z,i[39]=n.x,i[40]=r.y,i[41]=r.z,i[42]=n.x,i[43]=r.y,i[44]=r.z,i[45]=n.x,i[46]=n.y,i[47]=r.z,i[48]=n.x,i[49]=n.y,i[50]=n.z,i[51]=n.x,i[52]=n.y,i[53]=r.z,i[54]=r.x,i[55]=n.y,i[56]=n.z,i[57]=r.x,i[58]=n.y,i[59]=r.z,i[60]=r.x,i[61]=r.y,i[62]=n.z,i[63]=r.x,i[64]=r.y,i[65]=r.z,i[66]=n.x,i[67]=r.y,i[68]=n.z,i[69]=n.x,i[70]=r.y,i[71]=r.z,this.geometry.attributes.position.needsUpdate=!0,this.geometry.computeBoundingSphere(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1},r.BoundingBoxHelper=function(e,t){var n=void 0!==t?t:8947848;this.object=e,this.box=new r.Box3,r.Mesh.call(this,new r.BoxGeometry(1,1,1),new r.MeshBasicMaterial({color:n,wireframe:!0}))},r.BoundingBoxHelper.prototype=Object.create(r.Mesh.prototype),r.BoundingBoxHelper.prototype.constructor=r.BoundingBoxHelper,r.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object),this.box.size(this.scale),this.box.center(this.position)},r.CameraHelper=function(e){function t(e,t,r){n(e,r),n(t,r)}function n(e,t){i.vertices.push(new r.Vector3),i.colors.push(new r.Color(t)),void 0===a[e]&&(a[e]=[]),a[e].push(i.vertices.length-1)}var i=new r.Geometry,o=new r.LineBasicMaterial({color:16777215,vertexColors:r.FaceColors}),a={},s=16755200,u=16711680,c=43775,l=16777215,h=3355443;t("n1","n2",s),t("n2","n4",s),t("n4","n3",s),t("n3","n1",s),t("f1","f2",s),t("f2","f4",s),t("f4","f3",s),t("f3","f1",s),t("n1","f1",s),t("n2","f2",s),t("n3","f3",s),t("n4","f4",s),t("p","n1",u),t("p","n2",u),t("p","n3",u),t("p","n4",u),t("u1","u2",c),t("u2","u3",c),t("u3","u1",c),t("c","t",l),t("p","c",h),t("cn1","cn2",h),t("cn3","cn4",h),t("cf1","cf2",h),t("cf3","cf4",h),r.Line.call(this,i,o,r.LinePieces),this.camera=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()},r.CameraHelper.prototype=Object.create(r.Line.prototype),r.CameraHelper.prototype.constructor=r.CameraHelper,r.CameraHelper.prototype.update=function(){var e,t,n=new r.Vector3,i=new r.Camera,o=function(r,o,a,s){n.set(o,a,s).unproject(i);var u=t[r];if(void 0!==u)for(var c=0,l=u.length;l>c;c++)e.vertices[u[c]].copy(n)};return function(){e=this.geometry,t=this.pointMap;var r=1,n=1;i.projectionMatrix.copy(this.camera.projectionMatrix),o("c",0,0,-1),o("t",0,0,1),o("n1",-r,-n,-1),o("n2",r,-n,-1),o("n3",-r,n,-1),o("n4",r,n,-1),o("f1",-r,-n,1),o("f2",r,-n,1),o("f3",-r,n,1),o("f4",r,n,1),o("u1",.7*r,1.1*n,-1),o("u2",.7*-r,1.1*n,-1),o("u3",0,2*n,-1),o("cf1",-r,0,1),o("cf2",r,0,1),o("cf3",0,-n,1),o("cf4",0,n,1),o("cn1",-r,0,-1),o("cn2",r,0,-1),o("cn3",0,-n,-1),o("cn4",0,n,-1),e.verticesNeedUpdate=!0}}(),r.DirectionalLightHelper=function(e,t){r.Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,t=t||1;var n=new r.Geometry;n.vertices.push(new r.Vector3(-t,t,0),new r.Vector3(t,t,0),new r.Vector3(t,-t,0),new r.Vector3(-t,-t,0),new r.Vector3(-t,t,0));var i=new r.LineBasicMaterial({fog:!1});i.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.lightPlane=new r.Line(n,i),this.add(this.lightPlane),n=new r.Geometry,n.vertices.push(new r.Vector3,new r.Vector3),i=new r.LineBasicMaterial({fog:!1}),i.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine=new r.Line(n,i),this.add(this.targetLine),this.update()},r.DirectionalLightHelper.prototype=Object.create(r.Object3D.prototype),r.DirectionalLightHelper.prototype.constructor=r.DirectionalLightHelper,r.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},r.DirectionalLightHelper.prototype.update=function(){var e=new r.Vector3,t=new r.Vector3,n=new r.Vector3;return function(){e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),n.subVectors(t,e),this.lightPlane.lookAt(n),this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine.geometry.vertices[1].copy(n),this.targetLine.geometry.verticesNeedUpdate=!0,this.targetLine.material.color.copy(this.lightPlane.material.color)}}(),r.EdgesHelper=function(e,t){var n=void 0!==t?t:16777215,i=[0,0],o={},a=function(e,t){return e-t},s=["a","b","c"],u=new r.BufferGeometry,c=e.geometry.clone();c.mergeVertices(),c.computeFaceNormals();for(var l=c.vertices,h=c.faces,f=0,p=0,d=h.length;d>p;p++)for(var m=h[p],v=0;3>v;v++){i[0]=m[s[v]],i[1]=m[s[(v+1)%3]],i.sort(a);var g=i.toString();void 0===o[g]?(o[g]={vert1:i[0],vert2:i[1],face1:p,face2:void 0},f++):o[g].face2=p}var y=new Float32Array(2*f*3),b=0;for(var g in o){var x=o[g];if(void 0===x.face2||h[x.face1].normal.dot(h[x.face2].normal)<.9999){var w=l[x.vert1];y[b++]=w.x,y[b++]=w.y,y[b++]=w.z,w=l[x.vert2],y[b++]=w.x,y[b++]=w.y,y[b++]=w.z}}u.addAttribute("position",new r.BufferAttribute(y,3)),r.Line.call(this,u,new r.LineBasicMaterial({color:n}),r.LinePieces),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1},r.EdgesHelper.prototype=Object.create(r.Line.prototype),r.EdgesHelper.prototype.constructor=r.EdgesHelper,r.FaceNormalsHelper=function(e,t,n,i){this.object=e,this.size=void 0!==t?t:1;for(var o=void 0!==n?n:16776960,a=void 0!==i?i:1,s=new r.Geometry,u=this.object.geometry.faces,c=0,l=u.length;l>c;c++)s.vertices.push(new r.Vector3,new r.Vector3);r.Line.call(this,s,new r.LineBasicMaterial({color:o,linewidth:a}),r.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new r.Matrix3,this.update()},r.FaceNormalsHelper.prototype=Object.create(r.Line.prototype),r.FaceNormalsHelper.prototype.constructor=r.FaceNormalsHelper,r.FaceNormalsHelper.prototype.update=function(){var e=this.geometry.vertices,t=this.object,r=t.geometry.vertices,n=t.geometry.faces,i=t.matrixWorld;t.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(i);for(var o=0,a=0,s=n.length;s>o;o++,a+=2){var u=n[o];e[a].copy(r[u.a]).add(r[u.b]).add(r[u.c]).divideScalar(3).applyMatrix4(i),e[a+1].copy(u.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(e[a])}return this.geometry.verticesNeedUpdate=!0,this},r.GridHelper=function(e,t){var n=new r.Geometry,i=new r.LineBasicMaterial({vertexColors:r.VertexColors});this.color1=new r.Color(4473924),this.color2=new r.Color(8947848);for(var o=-e;e>=o;o+=t){n.vertices.push(new r.Vector3(-e,0,o),new r.Vector3(e,0,o),new r.Vector3(o,0,-e),new r.Vector3(o,0,e));var a=0===o?this.color1:this.color2;n.colors.push(a,a,a,a)}r.Line.call(this,n,i,r.LinePieces)},r.GridHelper.prototype=Object.create(r.Line.prototype),r.GridHelper.prototype.constructor=r.GridHelper,r.GridHelper.prototype.setColors=function(e,t){this.color1.set(e),this.color2.set(t),this.geometry.colorsNeedUpdate=!0},r.HemisphereLightHelper=function(e,t){r.Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.colors=[new r.Color,new r.Color];var n=new r.SphereGeometry(t,4,2);n.applyMatrix((new r.Matrix4).makeRotationX(-Math.PI/2));for(var i=0,o=8;o>i;i++)n.faces[i].color=this.colors[4>i?0:1];var a=new r.MeshBasicMaterial({vertexColors:r.FaceColors,wireframe:!0});this.lightSphere=new r.Mesh(n,a),this.add(this.lightSphere),this.update()},r.HemisphereLightHelper.prototype=Object.create(r.Object3D.prototype),r.HemisphereLightHelper.prototype.constructor=r.HemisphereLightHelper,r.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose(),this.lightSphere.material.dispose()},r.HemisphereLightHelper.prototype.update=function(){var e=new r.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),this.lightSphere.geometry.colorsNeedUpdate=!0}}(),r.PointLightHelper=function(e,t){this.light=e,this.light.updateMatrixWorld();var n=new r.SphereGeometry(t,4,2),i=new r.MeshBasicMaterial({wireframe:!0,fog:!1});i.color.copy(this.light.color).multiplyScalar(this.light.intensity),r.Mesh.call(this,n,i),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1},r.PointLightHelper.prototype=Object.create(r.Mesh.prototype),r.PointLightHelper.prototype.constructor=r.PointLightHelper,r.PointLightHelper.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},r.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},r.SkeletonHelper=function(e){this.bones=this.getBoneList(e);for(var t=new r.Geometry,n=0;n<this.bones.length;n++){var i=this.bones[n];i.parent instanceof r.Bone&&(t.vertices.push(new r.Vector3),t.vertices.push(new r.Vector3),t.colors.push(new r.Color(0,0,1)),t.colors.push(new r.Color(0,1,0)))}var o=new r.LineBasicMaterial({vertexColors:r.VertexColors,depthTest:!1,depthWrite:!1,transparent:!0});r.Line.call(this,t,o,r.LinePieces),this.root=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.update()},r.SkeletonHelper.prototype=Object.create(r.Line.prototype),r.SkeletonHelper.prototype.constructor=r.SkeletonHelper,r.SkeletonHelper.prototype.getBoneList=function(e){var t=[];e instanceof r.Bone&&t.push(e);for(var n=0;n<e.children.length;n++)t.push.apply(t,this.getBoneList(e.children[n]));return t},r.SkeletonHelper.prototype.update=function(){for(var e=this.geometry,t=(new r.Matrix4).getInverse(this.root.matrixWorld),n=new r.Matrix4,i=0,o=0;o<this.bones.length;o++){var a=this.bones[o];a.parent instanceof r.Bone&&(n.multiplyMatrices(t,a.matrixWorld),e.vertices[i].setFromMatrixPosition(n),n.multiplyMatrices(t,a.parent.matrixWorld),e.vertices[i+1].setFromMatrixPosition(n),i+=2)}e.verticesNeedUpdate=!0,e.computeBoundingSphere()},r.SpotLightHelper=function(e){r.Object3D.call(this),this.light=e,this.light.updateMatrixWorld(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;var t=new r.CylinderGeometry(0,1,1,8,1,!0);t.applyMatrix((new r.Matrix4).makeTranslation(0,-.5,0)),t.applyMatrix((new r.Matrix4).makeRotationX(-Math.PI/2));var n=new r.MeshBasicMaterial({wireframe:!0,fog:!1});this.cone=new r.Mesh(t,n),this.add(this.cone),this.update()},r.SpotLightHelper.prototype=Object.create(r.Object3D.prototype),r.SpotLightHelper.prototype.constructor=r.SpotLightHelper,r.SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},r.SpotLightHelper.prototype.update=function(){var e=new r.Vector3,t=new r.Vector3;return function(){var r=this.light.distance?this.light.distance:1e4,n=r*Math.tan(this.light.angle);this.cone.scale.set(n,n,r),e.setFromMatrixPosition(this.light.matrixWorld),t.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(t.sub(e)),this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}(),r.VertexNormalsHelper=function(e,t,n,i){this.object=e,this.size=void 0!==t?t:1;for(var o=void 0!==n?n:16711680,a=void 0!==i?i:1,s=new r.Geometry,u=(e.geometry.vertices,e.geometry.faces),c=0,l=u.length;l>c;c++)for(var h=u[c],f=0,p=h.vertexNormals.length;p>f;f++)s.vertices.push(new r.Vector3,new r.Vector3);r.Line.call(this,s,new r.LineBasicMaterial({color:o,linewidth:a}),r.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new r.Matrix3,this.update()},r.VertexNormalsHelper.prototype=Object.create(r.Line.prototype),r.VertexNormalsHelper.prototype.constructor=r.VertexNormalsHelper,r.VertexNormalsHelper.prototype.update=function(){var e=new r.Vector3;return function(){var t=["a","b","c","d"];this.object.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var r=this.geometry.vertices,n=this.object.geometry.vertices,i=this.object.geometry.faces,o=this.object.matrixWorld,a=0,s=0,u=i.length;u>s;s++)for(var c=i[s],l=0,h=c.vertexNormals.length;h>l;l++){var f=c[t[l]],p=n[f],d=c.vertexNormals[l];r[a].copy(p).applyMatrix4(o),e.copy(d).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size),e.add(r[a]),a+=1,r[a].copy(e),a+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),r.VertexTangentsHelper=function(e,t,n,i){this.object=e,this.size=void 0!==t?t:1;for(var o=void 0!==n?n:255,a=void 0!==i?i:1,s=new r.Geometry,u=(e.geometry.vertices,e.geometry.faces),c=0,l=u.length;l>c;c++)for(var h=u[c],f=0,p=h.vertexTangents.length;p>f;f++)s.vertices.push(new r.Vector3),s.vertices.push(new r.Vector3);r.Line.call(this,s,new r.LineBasicMaterial({color:o,linewidth:a}),r.LinePieces),this.matrixAutoUpdate=!1,this.update()},r.VertexTangentsHelper.prototype=Object.create(r.Line.prototype),r.VertexTangentsHelper.prototype.constructor=r.VertexTangentsHelper,r.VertexTangentsHelper.prototype.update=function(){var e=new r.Vector3;return function(){var t=["a","b","c","d"];this.object.updateMatrixWorld(!0);for(var r=this.geometry.vertices,n=this.object.geometry.vertices,i=this.object.geometry.faces,o=this.object.matrixWorld,a=0,s=0,u=i.length;u>s;s++)for(var c=i[s],l=0,h=c.vertexTangents.length;h>l;l++){var f=c[t[l]],p=n[f],d=c.vertexTangents[l];r[a].copy(p).applyMatrix4(o),e.copy(d).transformDirection(o).multiplyScalar(this.size),e.add(r[a]),a+=1,r[a].copy(e),a+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),r.WireframeHelper=function(e,t){var n=void 0!==t?t:16777215,i=[0,0],o={},a=function(e,t){return e-t},s=["a","b","c"],u=new r.BufferGeometry;if(e.geometry instanceof r.Geometry){for(var c=e.geometry.vertices,l=e.geometry.faces,h=0,f=new Uint32Array(6*l.length),p=0,d=l.length;d>p;p++)for(var m=l[p],v=0;3>v;v++){i[0]=m[s[v]],i[1]=m[s[(v+1)%3]],i.sort(a);var g=i.toString();void 0===o[g]&&(f[2*h]=i[0],f[2*h+1]=i[1],o[g]=!0,h++)}for(var y=new Float32Array(2*h*3),p=0,d=h;d>p;p++)for(var v=0;2>v;v++){var b=c[f[2*p+v]],x=6*p+3*v;y[x+0]=b.x,y[x+1]=b.y,y[x+2]=b.z}u.addAttribute("position",new r.BufferAttribute(y,3))}else if(e.geometry instanceof r.BufferGeometry)if(void 0!==e.geometry.attributes.index){var c=e.geometry.attributes.position.array,w=e.geometry.attributes.index.array,_=e.geometry.drawcalls,h=0;0===_.length&&(_=[{count:w.length,index:0,start:0}]);for(var f=new Uint32Array(2*w.length),S=0,M=_.length;M>S;++S)for(var E=_[S].start,T=_[S].count,x=_[S].index,p=E,C=E+T;C>p;p+=3)for(var v=0;3>v;v++){i[0]=x+w[p+v],i[1]=x+w[p+(v+1)%3],i.sort(a);var g=i.toString();void 0===o[g]&&(f[2*h]=i[0],f[2*h+1]=i[1],o[g]=!0,h++)}for(var y=new Float32Array(2*h*3),p=0,d=h;d>p;p++)for(var v=0;2>v;v++){var x=6*p+3*v,A=3*f[2*p+v];y[x+0]=c[A],y[x+1]=c[A+1],y[x+2]=c[A+2]}u.addAttribute("position",new r.BufferAttribute(y,3))}else{for(var c=e.geometry.attributes.position.array,h=c.length/3,$=h/3,y=new Float32Array(2*h*3),p=0,d=$;d>p;p++)for(var v=0;3>v;v++){var x=18*p+6*v,k=9*p+3*v;y[x+0]=c[k],y[x+1]=c[k+1],y[x+2]=c[k+2];var A=9*p+3*((v+1)%3);y[x+3]=c[A],y[x+4]=c[A+1],y[x+5]=c[A+2]}u.addAttribute("position",new r.BufferAttribute(y,3))}r.Line.call(this,u,new r.LineBasicMaterial({color:n}),r.LinePieces),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1},r.WireframeHelper.prototype=Object.create(r.Line.prototype),r.WireframeHelper.prototype.constructor=r.WireframeHelper,r.ImmediateRenderObject=function(){r.Object3D.call(this),this.render=function(){}},r.ImmediateRenderObject.prototype=Object.create(r.Object3D.prototype),r.ImmediateRenderObject.prototype.constructor=r.ImmediateRenderObject,r.MorphBlendMesh=function(e,t){r.Mesh.call(this,e,t),this.animationsMap={},this.animationsList=[];var n=this.geometry.morphTargets.length,i="__default",o=0,a=n-1,s=n/1;this.createAnimation(i,o,a,s),this.setAnimationWeight(i,1)},r.MorphBlendMesh.prototype=Object.create(r.Mesh.prototype),r.MorphBlendMesh.prototype.constructor=r.MorphBlendMesh,r.MorphBlendMesh.prototype.createAnimation=function(e,t,r,n){var i={startFrame:t,endFrame:r,length:r-t+1,fps:n,duration:(r-t)/n,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};
this.animationsMap[e]=i,this.animationsList.push(i)},r.MorphBlendMesh.prototype.autoCreateAnimations=function(e){for(var t,r=/([a-z]+)_?(\d+)/,n={},i=this.geometry,o=0,a=i.morphTargets.length;a>o;o++){var s=i.morphTargets[o],u=s.name.match(r);if(u&&u.length>1){{var c=u[1];u[2]}n[c]||(n[c]={start:1/0,end:-1/0});var l=n[c];o<l.start&&(l.start=o),o>l.end&&(l.end=o),t||(t=c)}}for(var c in n){var l=n[c];this.createAnimation(c,l.start,l.end,e)}this.firstAnimation=t},r.MorphBlendMesh.prototype.setAnimationDirectionForward=function(e){var t=this.animationsMap[e];t&&(t.direction=1,t.directionBackwards=!1)},r.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(e){var t=this.animationsMap[e];t&&(t.direction=-1,t.directionBackwards=!0)},r.MorphBlendMesh.prototype.setAnimationFPS=function(e,t){var r=this.animationsMap[e];r&&(r.fps=t,r.duration=(r.end-r.start)/r.fps)},r.MorphBlendMesh.prototype.setAnimationDuration=function(e,t){var r=this.animationsMap[e];r&&(r.duration=t,r.fps=(r.end-r.start)/r.duration)},r.MorphBlendMesh.prototype.setAnimationWeight=function(e,t){var r=this.animationsMap[e];r&&(r.weight=t)},r.MorphBlendMesh.prototype.setAnimationTime=function(e,t){var r=this.animationsMap[e];r&&(r.time=t)},r.MorphBlendMesh.prototype.getAnimationTime=function(e){var t=0,r=this.animationsMap[e];return r&&(t=r.time),t},r.MorphBlendMesh.prototype.getAnimationDuration=function(e){var t=-1,r=this.animationsMap[e];return r&&(t=r.duration),t},r.MorphBlendMesh.prototype.playAnimation=function(e){var t=this.animationsMap[e];t?(t.time=0,t.active=!0):console.warn("animation["+e+"] undefined")},r.MorphBlendMesh.prototype.stopAnimation=function(e){var t=this.animationsMap[e];t&&(t.active=!1)},r.MorphBlendMesh.prototype.update=function(e){for(var t=0,n=this.animationsList.length;n>t;t++){var i=this.animationsList[t];if(i.active){var o=i.duration/i.length;i.time+=i.direction*e,i.mirroredLoop?(i.time>i.duration||i.time<0)&&(i.direction*=-1,i.time>i.duration&&(i.time=i.duration,i.directionBackwards=!0),i.time<0&&(i.time=0,i.directionBackwards=!1)):(i.time=i.time%i.duration,i.time<0&&(i.time+=i.duration));var a=i.startFrame+r.Math.clamp(Math.floor(i.time/o),0,i.length-1),s=i.weight;a!==i.currentFrame&&(this.morphTargetInfluences[i.lastFrame]=0,this.morphTargetInfluences[i.currentFrame]=1*s,this.morphTargetInfluences[a]=0,i.lastFrame=i.currentFrame,i.currentFrame=a);var u=i.time%o/o;i.directionBackwards&&(u=1-u),this.morphTargetInfluences[i.currentFrame]=u*s,this.morphTargetInfluences[i.lastFrame]=(1-u)*s}}}},{}]},{},[]);